@a-t-h-i/bot-lobby 0.7.5 → 0.7.7

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.
@@ -1,117 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-BQ_vyCt-.js","assets/rolldown-runtime-hePW80VL.js","assets/ccount-DQxSH8e6.js","assets/TerminalView-BrP-ENHg.css","assets/CodeSurface-raLMzkDq.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{a as r,c as i,i as a,l as o,n as s,o as c,r as l,s as u,t as d}from"./ccount-DQxSH8e6.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=document.querySelector(`meta[property="csp-nonce"]`),p=f?.nonce||f?.content;p&&(window.__webpack_nonce__=p);var m=t(o(),1),h,g=new Set;function _(){for(let e of[...g])e()}typeof window<`u`&&(window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),h=e,_()}),window.addEventListener(`appinstalled`,()=>{h=void 0,_()}));function v(e){return g.add(e),()=>{g.delete(e)}}function y(){return{available:(0,m.useSyncExternalStore)(v,()=>h!==void 0,()=>!1),install:async()=>{let e=h;e&&(await e.prompt().catch(()=>void 0),await e.userChoice?.catch(()=>void 0),h=void 0,_())}}}function b(){let e=`(display-mode: fullscreen), (display-mode: standalone), (display-mode: minimal-ui)`,[t,n]=(0,m.useState)(()=>typeof window<`u`&&window.matchMedia(e).matches);return(0,m.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[]),t}function x(){let e=typeof document<`u`&&typeof document.documentElement.requestFullscreen==`function`,[t,n]=(0,m.useState)(()=>typeof document<`u`&&document.fullscreenElement!==null);return(0,m.useEffect)(()=>{let e=()=>n(document.fullscreenElement!==null);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),{supported:e,on:t,toggle:async()=>{document.fullscreenElement?await document.exitFullscreen().catch(()=>void 0):await document.documentElement.requestFullscreen().catch(()=>void 0)}}}var S=[`background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`,`primary`,`primary-foreground`,`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`,`destructive`,`border`,`input`,`ring`,`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`],C=[`font-sans`,`font-mono`],w=new Set([...S,...C]),T=/^[\w\s#%.,()/+*'"-]{1,300}$/,E=/url\s*\(|expression|import|javascript|\\|<|>/i;function D(e){let t=e.replace(/!important/gi,``).trim();if(t&&T.test(t)&&!E.test(t))return t}function O(e,t,n){let r=e.replace(/^--/,``).toLowerCase();if(!w.has(r))return;let i=D(t);i&&(n[r]=i)}function k(e){let t={};for(let n of e.matchAll(/--([a-z0-9-]+)\s*:\s*([^;}]+)/gi))O(n[1],n[2],t);return t}function A(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&O(n,r,t);return Object.keys(t).length>0?t:void 0}function j(e){let t=e.trim();if(!t)return{error:`Paste a theme first.`};if(t.length>2e5)return{error:`That file is too large to be a theme.`};let n={},r={},i;if(t.startsWith(`{`)){let e;try{e=JSON.parse(t)}catch{return{error:`That is not valid JSON or CSS.`}}let a=e,o=a.cssVars;if(!o||typeof o!=`object`)return{error:`That JSON has no cssVars. Copy the theme's CSS from tweakcn instead.`};let s=e=>{let t={};for(let[n,r]of Object.entries(e??{}))typeof r==`string`&&O(n,r,t);return t};n={...s(o.theme),...s(o.light)},r={...s(o.theme),...s(o.dark)},i=typeof a.title==`string`?a.title:typeof a.name==`string`?a.name:void 0}else for(let e of t.matchAll(/(?<=^|[}\s])((?::root|html|\.dark|:root\.dark|html\.dark)(?:\s*,\s*[^{]+)?)\s*\{([^}]*)\}/g)){let t=e[1].trim(),i=k(e[2]);/\.dark/.test(t)?r={...r,...i}:n={...n,...i}}let a=e=>Object.keys(e).filter(e=>S.includes(e)).length;return a(n)<5&&a(r)<5?{error:`No theme colours found. Copy the code from tweakcn's Code panel (the :root and .dark blocks).`}:{...a(n)>=5?{light:n}:{},...a(r)>=5?{dark:r}:{},...i?{name:i}:{}}}var M={"glass-border":`var(--border)`,typing:`var(--ring)`,"tab-active":`color-mix(in oklab, var(--primary) 14%, var(--background))`,you:`color-mix(in oklab, var(--primary) 9%, var(--card))`,heading:`var(--foreground)`,link:`var(--primary)`,bullet:`var(--primary)`},N=`"Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`,ee=`ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace`;function te(e,t){let n=[];for(let[e,r]of Object.entries(t))e===`font-sans`?n.push(`--app-font-sans:${r},${N};`):e===`font-mono`?n.push(`--app-font-mono:${r},${ee};`):n.push(`--${e}:${r};`);for(let[e,r]of Object.entries(M))e in t||n.push(`--${e}:${r};`);return`${e}{${n.join(``)}}`}function P(e){let t=[];return e.light&&t.push(te(`:root`,e.light)),e.dark&&t.push(te(`.dark`,e.dark)),t.join(`
3
- `)}var ne=`mist`,re=[{id:ne,name:`Default`}],ie={light:{background:`#faf9f5`,card:`#ffffff`,primary:`#c96442`,accent:`#f0eee6`},dark:{background:`#262624`,card:`#30302e`,primary:`#d97757`,accent:`#1f1e1d`}};function ae(e,t){let n=t?e.dark:e.light,r=ie[t?`dark`:`light`];return n?{background:n.background??r.background,card:n.card??r.card,primary:n.primary??r.primary,accent:n.primary?`color-mix(in oklab, ${n.primary} 18%, ${n.background??r.background})`:r.accent}:{...r}}var oe={activity:400,thoughts:40,chat:100};function se(e,t,n){let r=e??[],i=new Set(r.map(e=>e.id)),a=t.filter(e=>typeof e?.id==`number`&&!i.has(e.id));return[...r,...a].slice(-n)}var ce=class{records=new Map;listeners=new Set;reads=new Map;used=new Set;reader;currentStatus={connection:`connecting`,signedOut:!1};get(e){let t=this.records.get(e);if(t)return t;let n={version:0,data:void 0,loading:!1,error:void 0,stale:!1};return this.records.set(e,n),n}status(){return{...this.currentStatus}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}markUsed(e,t){this.reader=t;let n=e.filter(e=>!this.used.has(e));this.used=new Set(e);for(let e of n)this.read(e)}onHello(e){for(let t of this.used){let n=e[t];n!==void 0&&(this.get(t).version=n),this.read(t)}}onChanged(e,t){let n=this.get(e);n.version=t,this.used.has(e)?this.read(e):n.stale=!0,this.notify()}onFeedDelta(e){let t=this.get(`lobby`).data;t&&(this.get(`lobby`).data={...t,activity:se(t.activity,e.activity??[],oe.activity),thoughts:se(t.thoughts,e.thoughts??[],oe.thoughts),chat:se(t.chat,e.chat??[],oe.chat)},this.notify())}onReplyDelta(e){let t=this.get(`lobby`),n=t.data;n&&(t.data={...n,reply:e},this.notify())}onStatus(e){this.currentStatus={...this.currentStatus,...e},this.notify()}async read(e){let t=this.reader;if(!t)return;let n=(this.reads.get(e)??0)+1;this.reads.set(e,n);let r=this.get(e);r.loading=!0,r.error=void 0,this.notify();try{let i=await t(e);if(this.reads.get(e)!==n)return;this.apply(r,i)}catch(t){if(this.reads.get(e)!==n)return;r.loading=!1,r.error=t instanceof Error?t.message:String(t)}this.notify()}apply(e,t){e.data=t,e.loading=!1,e.stale=!1,e.error=void 0}notify(){for(let e of[...this.listeners])e()}};function le(){return new ce}var F=le(),ue=/^[a-f0-9]{32}$/;function de(){return globalThis.location}function fe(){let e=de()?.search??``,t=new URLSearchParams(e).getAll(`project`);if(t.length){if(t.length!==1||!ue.test(t[0]))throw Error(`Invalid project ID. Choose a running project below.`);return t[0]}}function I(e){if(!e.startsWith(`/api/`)&&!e.startsWith(`/files/preview/`))return e;let t=fe();return t?`/projects/${t}${e}`:e}function L(e,t){if(!ue.test(e))throw Error(`Invalid project ID.`);let n=de();if(!n)throw Error(`Project switching requires a browser.`);let r=new URL(n.origin);r.pathname=n.pathname,r.searchParams.set(`project`,e),r.hash=`/${t}`,n.assign(r.href)}var pe=`bot-lobby.projectFolders`,me=new Map;function he(){try{return globalThis.sessionStorage}catch{return}}function ge(){try{let e=JSON.parse(he()?.getItem(pe)??`{}`);for(let[t,n]of Object.entries(e))ue.test(t)&&typeof n==`string`&&me.set(t,n)}catch{}}function _e(e){ge();for(let t of e)ue.test(t.id)&&me.set(t.id,t.cwd);try{he()?.setItem(pe,JSON.stringify(Object.fromEntries([...me].slice(-64))))}catch{}}function ve(e){return me.has(e)||ge(),me.get(e)}async function ye(e){let t;try{t=fe()}catch{return!1}if(!t)return!1;let n=ve(t);if(!n)return!1;let{projects:r}=await e();if(_e(r),r.some(e=>e.id===t))return!1;let i=r.find(e=>e.cwd===n),a=de(),o=globalThis.history;if(!i||!a||!o)return!1;let s=new URL(a.origin);return s.pathname=a.pathname,s.search=a.search,s.searchParams.set(`project`,i.id),s.hash=globalThis.location?.hash??``,o.replaceState(null,``,s.href),!0}var be=class extends Error{code;status;constructor(e,t,n){super(e),this.name=`ApiError`,this.code=t,this.status=n}},xe={"Content-Type":`application/json`};async function R(e,t={}){let n=await fetch(e===`auth.login`||e.startsWith(`projects.`)?`/api/${e}`:I(`/api/${e}`),{method:`POST`,headers:xe,body:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new be(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw r.code===`unauthorized`&&F.onStatus({signedOut:!0}),new be(r.error,r.code,n.status);return r.result}function Se(){return globalThis.location}async function Ce(){let e=Se(),t=e?new URLSearchParams(e.hash.replace(/^#/,``)).get(`token`):null;if(!t||!(await fetch(`/api/auth.login`,{method:`POST`,headers:xe,body:JSON.stringify({token:t}),credentials:`same-origin`}).catch(()=>void 0))?.ok)return!1;let n=globalThis.history;return n&&n.replaceState(null,``,e.pathname+e.search),F.onStatus({signedOut:!1}),!0}var we=`bot-lobby.palette`,Te=`bot-lobby-palette`,Ee=`custom`,De=new Set,Oe=Ae();function ke(e){let t=e;if(!t||typeof t.id!=`string`||typeof t.name!=`string`)return;let n=A(t.light),r=A(t.dark);if(n||r)return{id:t.id,name:t.name.slice(0,40),...n?{light:n}:{},...r?{dark:r}:{}}}function Ae(){try{let e=localStorage.getItem(we);if(!e)return{id:ne,saved:[]};let t=JSON.parse(e),n=(t.saved??[]).map(ke).filter(e=>!!e),r=ke(t.legacy??(t.custom?{...t.custom,id:Ee}:void 0)),i=new Set([...re.map(e=>e.id),...n.map(e=>e.id),...r?[Ee]:[]]);return{id:t.id&&i.has(t.id)?t.id:ne,saved:n,...r?{legacy:r}:{}}}catch{return{id:ne,saved:[]}}}function je(e){return[...re,...e.saved,...e.legacy?[e.legacy]:[]]}function Me(e){return je(e).find(t=>t.id===e.id)??re[0]}function Ne(){if(typeof document>`u`)return;let e=P(Me(Oe)),t=document.getElementById(Te);if(!e){t?.remove();return}t||(t=document.createElement(`style`),t.id=Te,document.head.appendChild(t)),t.textContent=e}function Pe(e){Oe=e;try{localStorage.setItem(we,JSON.stringify(e))}catch{}Ne();for(let e of[...De])e()}function Fe(e){let t=e.themes.map(e=>ke(e)).filter(e=>!!e),{legacy:n}=Oe;Pe({id:e.active??(Oe.id===Ee&&n?Ee:`mist`),saved:t,...n?{legacy:n}:{}})}var Ie,Le=Promise.resolve();function Re(e=!1){return Ie&&!e||(Ie=(async()=>{let e=await R(`themes.get`,{}),t=Oe.legacy;if(t){let n=e.active??(Oe.id===Ee?void 0:Oe.id);e=await R(`themes.save`,{name:t.name,...t.light?{light:t.light}:{},...t.dark?{dark:t.dark}:{}}),n&&(e=await R(`themes.choose`,{id:n}));let{legacy:r,...i}=Oe;Oe=i}Fe(e)})().catch(()=>{Ie=void 0})),Ie}typeof window<`u`&&(Ne(),window.addEventListener(`storage`,e=>{if(e.key===we){Oe=Ae(),Ne();for(let e of[...De])e()}}),window.addEventListener(`focus`,()=>void Re(!0)));function ze(e){return De.add(e),()=>{De.delete(e)}}function Be(){let e=(0,m.useSyncExternalStore)(ze,()=>Oe,()=>Oe),t=(0,m.useCallback)(e=>{Pe({...Oe,id:e}),e!==Ee&&(Le=Le.then(()=>R(`themes.choose`,{id:e})).then(Fe,()=>{}))},[]),n=(0,m.useCallback)(async(e,t)=>(Fe(await R(`themes.save`,{name:t,...e.light?{light:e.light}:{},...e.dark?{dark:e.dark}:{}})),Me(Oe)),[]),r=(0,m.useCallback)(async(e,t)=>Fe(await R(`themes.rename`,{id:e,name:t})),[]),i=(0,m.useCallback)(async e=>Fe(await R(`themes.remove`,{id:e})),[]),a=e.legacy?[...e.saved,e.legacy]:e.saved;return{active:Me(e),saved:a,all:je(e),isSaved:e=>a.some(t=>t.id===e),choose:t,adopt:n,rename:r,remove:i}}var Ve=[{id:`theme`,label:`Default`,help:`San Francisco on Apple devices, Inter elsewhere`},{id:`inter`,label:`Inter`,help:`Neutral and very legible`},{id:`geist`,label:`Geist`,help:`Crisp and modern`},{id:`plex`,label:`IBM Plex Sans`,help:`Technical, with character`},{id:`manrope`,label:`Manrope`,help:`Round and friendly`},{id:`dm-sans`,label:`DM Sans`,help:`Geometric, low contrast`},{id:`jakarta`,label:`Plus Jakarta Sans`,help:`Polished product sans`},{id:`figtree`,label:`Figtree`,help:`Clean and approachable`},{id:`outfit`,label:`Outfit`,help:`Geometric display feel`},{id:`nunito`,label:`Nunito`,help:`Soft rounded terminals`},{id:`space-grotesk`,label:`Space Grotesk`,help:`Quirky, technical`},{id:`source-sans`,label:`Source Sans 3`,help:`Classic UI workhorse`}],He=[{id:`theme`,label:`Default mono`,help:`SF Mono on Apple devices, JetBrains Mono elsewhere`},{id:`jetbrains`,label:`JetBrains Mono`,help:`Tall, made for code`},{id:`geist-mono`,label:`Geist Mono`,help:`Pairs with Geist`},{id:`fira-code`,label:`Fira Code`,help:`Ligatures for operators`},{id:`roboto-mono`,label:`Roboto Mono`,help:`Even and compact`},{id:`source-code`,label:`Source Code Pro`,help:`Open and readable`}],Ue={font:`bot-lobby.typeface`,mono:`bot-lobby.typeface-code`},We={font:Ve,mono:He},Ge={font:`theme`,mono:`theme`},Ke=new Set;function qe(e){let t=null;try{t=localStorage.getItem(Ue[e])}catch{t=Ge[e]}return We[e].some(e=>e.id===t)?t:`theme`}function Je(e,t){let n=document.documentElement;t===`theme`?delete n.dataset[e]:n.dataset[e]=t}function Ye(e,t){Ge[e]=t;try{localStorage.setItem(Ue[e],t)}catch{}Je(e,t);for(let e of Ke)e()}function Xe(e){return Ke.add(e),()=>Ke.delete(e)}function Ze(e){return(0,m.useSyncExternalStore)(Xe,()=>qe(e),()=>`theme`)}typeof document<`u`&&(Je(`font`,qe(`font`)),Je(`mono`,qe(`mono`)));var Qe={inter:`"Inter Variable", system-ui, sans-serif`,geist:`"Geist Variable", system-ui, sans-serif`,plex:`"IBM Plex Sans Variable", system-ui, sans-serif`,manrope:`"Manrope Variable", system-ui, sans-serif`,jetbrains:`"JetBrains Mono Variable", ui-monospace, monospace`,"geist-mono":`"Geist Mono Variable", ui-monospace, monospace`,"dm-sans":`"DM Sans Variable", system-ui, sans-serif`,jakarta:`"Plus Jakarta Sans Variable", system-ui, sans-serif`,figtree:`"Figtree Variable", system-ui, sans-serif`,outfit:`"Outfit Variable", system-ui, sans-serif`,nunito:`"Nunito Variable", system-ui, sans-serif`,"space-grotesk":`"Space Grotesk Variable", system-ui, sans-serif`,"source-sans":`"Source Sans 3 Variable", system-ui, sans-serif`,"fira-code":`"Fira Code Variable", ui-monospace, monospace`,"roboto-mono":`"Roboto Mono Variable", ui-monospace, monospace`,"source-code":`"Source Code Pro Variable", ui-monospace, monospace`},$e=(0,m.createContext)({});function et(e){let t=(0,m.useRef)(null);return t.current===null&&(t.current=e()),t.current}var tt=typeof window<`u`?m.useLayoutEffect:m.useEffect,nt=(0,m.createContext)(null);function rt(e,t){e.indexOf(t)===-1&&e.push(t)}function it(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var at=(e,t,n)=>n>t?t:n<e?e:n,ot={},st=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ct=e=>typeof e==`object`&&!!e,lt=e=>/^0[^.\s]+$/u.test(e);function ut(e){let t;return()=>(t===void 0&&(t=e()),t)}var dt=e=>e,ft=(...e)=>e.reduce((e,t)=>n=>t(e(n))),pt=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},mt=class{constructor(){this.subscriptions=[]}add(e){return rt(this.subscriptions,e),()=>this.remove(e)}remove(e){it(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}},ht=e=>e*1e3,gt=e=>e/1e3,_t=(e,t)=>t?1e3/t*e:0,vt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},yt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bt=1e-7,xt=12;function St(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=yt(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>bt&&++s<xt);return o}function Ct(e,t,n,r){if(e===t&&n===r)return dt;let i=t=>St(t,0,1,e,n);return e=>e===0||e===1?e:yt(i(e),t,r)}var wt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Tt=e=>t=>1-e(1-t),Et=Ct(.33,1.53,.69,.99),Dt=Tt(Et),Ot=wt(Dt),kt=e=>e>=1?1:(e*=2)<1?.5*Dt(e):.5*(2-2**(-10*(e-1))),At=e=>1-Math.sin(Math.acos(e)),jt=Tt(At),Mt=wt(At),Nt=Ct(.42,0,1,1),Pt=Ct(0,0,.58,1),Ft=Ct(.42,0,.58,1),It=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Lt(e,t){return It(e)?e[vt(0,e.length,t)]:e}var Rt=e=>Array.isArray(e)&&typeof e[0]==`number`,zt={linear:dt,easeIn:Nt,easeInOut:Ft,easeOut:Pt,circIn:At,circInOut:Mt,circOut:jt,backIn:Dt,backInOut:Ot,backOut:Et,anticipate:kt},Bt=e=>typeof e==`string`,Vt=e=>{if(Rt(e)){e.length;let[t,n,r,i]=e;return Ct(t,n,r,i)}return Bt(e)?(zt[e],`${e}`,zt[e]):e},Ht={delta:0,timestamp:0,isProcessing:!1},Ut;function Wt(){Ut=void 0}var Gt={now:()=>(Ut===void 0&&Gt.set(Ht.isProcessing||ot.useManualTiming?Ht.timestamp:performance.now()),Ut),set:e=>{Ut=e,queueMicrotask(Wt)}},Kt=e=>Math.round(e*1e5)/1e5,qt=e=>t=>typeof t==`string`&&t.startsWith(e),Jt=qt(`--`),Yt=qt(`var(--`),Xt=e=>Yt(e)?Zt.test(e.split(`/*`)[0].trim()):!1,Zt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qt(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var $t={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},en={...$t,transform:e=>at(0,1,e)},tn={...$t,default:1},nn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rn(e){return e==null}var an=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,on=(e,t)=>n=>!!(typeof n==`string`&&an.test(n)&&n.startsWith(e)||t&&!rn(n)&&Object.prototype.hasOwnProperty.call(n,t)),sn=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(nn);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},cn=e=>at(0,255,e),ln={...$t,transform:e=>Math.round(cn(e))},un={test:on(`rgb`,`red`),parse:sn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ln.transform(e)+`, `+ln.transform(t)+`, `+ln.transform(n)+`, `+Kt(en.transform(r))+`)`};function dn(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 fn={test:on(`#`),parse:dn,transform:un.transform},pn=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mn=pn(`deg`),hn=pn(`%`),z=pn(`px`),gn=pn(`vh`),_n=pn(`vw`),vn={...hn,parse:e=>hn.parse(e)/100,transform:e=>hn.transform(e*100)},yn={test:on(`hsl`,`hue`),parse:sn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+hn.transform(Kt(t))+`, `+hn.transform(Kt(n))+`, `+Kt(en.transform(r))+`)`},bn={test:e=>un.test(e)||fn.test(e)||yn.test(e),parse:e=>un.test(e)?un.parse(e):yn.test(e)?yn.parse(e):fn.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?un.transform(e):yn.transform(e),getAnimatableNone:e=>{let t=bn.parse(e);return t.alpha=0,bn.transform(t)}},xn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Sn=new RegExp(nn.source),Cn=new RegExp(xn.source,`i`);function wn(e){return isNaN(e)&&typeof e==`string`&&(Sn.test(e)||Cn.test(e))}var Tn=`number`,En=`color`,Dn=`var`,On=`var(`,kn="${}",An=/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 jn(e){let t=e.toString();return Sn.test(t)||Cn.test(t)}function Mn(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(An,e=>(bn.test(e)?(r.color.push(a),i.push(En),n.push(bn.parse(e))):e.startsWith(On)?(r.var.push(a),i.push(Dn),n.push(e)):(r.number.push(a),i.push(Tn),n.push(parseFloat(e))),++a,kn)).split(kn),indexes:r,types:i}}function Nn(e){return Mn(e).values}function Pn({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Tn?Kt(r[a]):e===En?bn.transform(r[a]):r[a]}return i}}function Fn(e){return Pn(Mn(e))}var In=e=>typeof e==`number`?0:bn.test(e)?bn.getAnimatableNone(e):e,Ln=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:In(e);function Rn(e){let t=Mn(e);return Pn(t)(t.values.map((e,n)=>Ln(e,t.split[n])))}var zn={test:wn,parse:Nn,createTransformer:Fn,getAnimatableNone:Rn};function Bn(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 Vn({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=Bn(s,r,e+1/3),a=Bn(s,r,e),o=Bn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Hn(e,t){return n=>n>0?t:e}var Un=(e,t,n)=>e+(t-e)*n,Wn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Gn=[fn,un,yn],Kn=e=>Gn.find(t=>t.test(e));function qn(e){let t=Kn(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===yn&&(n=Vn(n)),n}var Jn=(e,t)=>{let n=qn(e),r=qn(t);if(!n||!r)return Hn(e,t);let i={...n};return e=>(i.red=Wn(n.red,r.red,e),i.green=Wn(n.green,r.green,e),i.blue=Wn(n.blue,r.blue,e),i.alpha=Un(n.alpha,r.alpha,e),un.transform(i))},Yn=new Set([`none`,`hidden`]);function Xn(e,t){return Yn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Zn(e,t){return n=>Un(e,t,n)}function Qn(e){return typeof e==`number`?Zn:typeof e==`string`?Xt(e)?Hn:bn.test(e)?Jn:nr:Array.isArray(e)?$n:typeof e==`object`?bn.test(e)?Jn:er:Hn}function $n(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Qn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function er(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Qn(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function tr(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var nr=(e,t)=>{let n=zn.createTransformer(t),r=Mn(e),i=Mn(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?Yn.has(e)&&!i.values.length||Yn.has(t)&&!r.values.length?Xn(e,t):ft($n(tr(r,i),i.values),n):(`${e}${t}`,Hn(e,t))},rr=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ir(e,t){let n=rr.exec(e);if(!n)return;let r=rr.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Kt(Un(a,o,e))+i}function ar(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Un(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=ir(e,t);if(n)return n}return Qn(e)(e,t)}var or=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function sr(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var cr=40;function lr(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=or.reduce((e,t)=>(e[t]=sr(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=ot.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,cr),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:or.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<or.length;t++)o[or[t]].cancel(e)},state:n,steps:o}}var{schedule:ur,cancel:dr,steps:fr}=lr(typeof requestAnimationFrame<`u`?requestAnimationFrame:dt,!0,Ht),pr=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>ur.update(t,e),stop:()=>dr(t),now:()=>Ht.isProcessing?Ht.timestamp:Gt.now()}},mr=(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)})`},hr=2e4;function gr(e,t=50,n=hr,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function _r(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(gr(r),hr);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:gt(i)}}var vr={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},yr=e=>e<0?1/Math.max(1+e,vr.minDamping):Math.max(1-e,vr.minDamping);function br(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cr(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xr(e,t){return e*Math.sqrt(1-t*t)}var Sr=12;function Cr(e,t,n){let r=n;for(let n=1;n<Sr;n++)r-=e(r)/t(r);return r}var wr=.001;function Tr({duration:e=vr.duration,bounce:t=vr.bounce}){let n,r;vr.maxDuration;let i=yr(t);e=at(vr.minDuration,vr.maxDuration,gt(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xr(t,i),o=Math.exp(-r);return wr-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xr(t*t,i);return(-n(t)+wr>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cr(n,r,a),s=o*br(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:ht(e)}}var Er=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dr(e,t){if(Er(e,t))return e}function Or(e){let t=Dr(e.stiffness),n=Dr(e.damping,!0),r=Dr(e.mass),i={...e,stiffness:t??vr.stiffness,damping:n??vr.damping,mass:r??vr.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yr(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*br(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Tr(i)),i.isResolvedFromDuration=!0;(!Er(i.stiffness)||!Er(i.damping,!0))&&(i.stiffness=vr.stiffness,i.damping=vr.damping)}return i}function kr(e=vr.visualDuration,t=vr.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Or({...n}),f=e=>d?0:-gt(e),p=s/(2*Math.sqrt(o*c)),m=gt(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?vr.restSpeed.granular:vr.restSpeed.default),g.restDelta=n.restDelta||(e?vr.restDelta.granular:vr.restDelta.default)};_();let v,y,b;if(p<1){let e=xr(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>ht(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=ht(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(gr(S),hr),t=mr(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}kr.applyToOptions=e=>{let t=_r(e,100,kr);return e.ease=t.ease,e.duration=ht(t.duration),e.type=`keyframes`,e};function Ar({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=>e<s||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=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=kr({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function jr(e,t,n){let r=[],i=n||ot.mix||ar,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=ft(Array.isArray(t)?t[n]||dt:t,a)),r.push(a)}return r}function Mr(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=jr(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=pt(e[r],e[r+1],n);return s[r](i)};return n?t=>l(at(e[0],e[a-1],t)):l}function Nr(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=pt(0,t,r);e.push(Un(n,1,i))}}function Pr(e){let t=[0];return Nr(t,e.length-1),t}function Fr(e,t){return e.map(e=>e*t)}function Ir(e,t){return e.map(()=>t||Ft).splice(0,e.length-1)}function Lr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=It(r)?r.map(Vt):Vt(r)||Ft,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(ot.mix||ar)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?at(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Mr(Fr(n&&n.length===t.length?n:Pr(t),e),t,{ease:Array.isArray(i)?i:Ir(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Rr=5;function zr(e,t,n){let r=Math.max(t-Rr,0);return _t(n-e(r),t-r)}function Br(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):zr(t=>e.next(t).value,t,e.next(t).value)}var Vr=e=>e!==null;function Hr(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Vr),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Ur={decay:Ar,inertia:Ar,tween:Lr,keyframes:Lr,spring:kr};function Wr(e){typeof e.type==`string`&&(e.type=Ur[e.type])}function Gr(e,t){return{kind:e,animation:t,timestamp:Gt.now(),frameTimestamp:Ht.timestamp,frameIsProcessing:Ht.isProcessing}}function Kr(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Gr(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function qr(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Gr(`layout-animation-start`,e),node:t})}catch{}}var Jr=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Yr=e=>e/100,Xr=class extends Jr{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!==Gt.now()&&this.tick(Gt.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Kr(this,this.options)}initAnimation(){let{options:e}=this;Wr(e);let{type:t=Lr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Lr;s!==Lr&&typeof o[0]!=`number`&&(this.mixKeyframes=ft(Yr,ar(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=gr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=at(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!==Ar&&(b.value=Hr(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 gt(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+gt(e)}get time(){return gt(this.currentTime)}set time(e){e=ht(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(){return Br(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Gt.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=gt(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=pr,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(Gt.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Zr=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Qr(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(nn)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Zr.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var $r=/\b([a-z-]*)\(.*?\)/gu,ei={...zn,getAnimatableNone:e=>{let t=e.match($r);return t?t.map(Qr).join(` `):e}},ti={...zn,getAnimatableNone:e=>{let t=zn.parse(e);return zn.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},ni={...$t,transform:Math.round},ri={rotate:mn,pathRotation:mn,rotateX:mn,rotateY:mn,rotateZ:mn,scale:tn,scaleX:tn,scaleY:tn,scaleZ:tn,skew:mn,skewX:mn,skewY:mn,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:en,originX:vn,originY:vn,originZ:z},ii={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,inset:z,insetBlock:z,insetBlockStart:z,insetBlockEnd:z,insetInline:z,insetInlineStart:z,insetInlineEnd:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,paddingBlock:z,paddingBlockStart:z,paddingBlockEnd:z,paddingInline:z,paddingInlineStart:z,paddingInlineEnd:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,marginBlock:z,marginBlockStart:z,marginBlockEnd:z,marginInline:z,marginInlineStart:z,marginInlineEnd:z,fontSize:z,backgroundPositionX:z,backgroundPositionY:z,...ri,zIndex:ni,fillOpacity:en,strokeOpacity:en,numOctaves:ni},ai={...ii,color:bn,backgroundColor:bn,outlineColor:bn,fill:bn,stroke:bn,borderColor:bn,borderTopColor:bn,borderRightColor:bn,borderBottomColor:bn,borderLeftColor:bn,filter:ei,WebkitFilter:ei,mask:ti,WebkitMask:ti},oi=e=>ai[e],si=new Set([ei,ti]);function ci(e,t){let n=oi(e);return si.has(n)||(n=zn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function li(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var ui=e=>e*180/Math.PI,di=e=>pi(ui(Math.atan2(e[1],e[0]))),fi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:di,rotateZ:di,skewX:e=>ui(Math.atan(e[1])),skewY:e=>ui(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},pi=e=>(e%=360,e<0&&(e+=360),e),mi=di,hi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),gi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),_i={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hi,scaleY:gi,scale:e=>(hi(e)+gi(e))/2,rotateX:e=>pi(ui(Math.atan2(e[6],e[5]))),rotateY:e=>pi(ui(Math.atan2(-e[2],e[0]))),rotateZ:mi,rotate:mi,skewX:e=>ui(Math.atan(e[4])),skewY:e=>ui(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vi(e){return+!!e.includes(`scale`)}function yi(e,t){if(!e||e===`none`)return vi(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=_i,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=fi,i=t}if(!i)return vi(t);let a=r[t],o=i[1].split(`,`).map(xi);return typeof a==`function`?a(o):o[a]}var bi=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return yi(n,t)};function xi(e){return parseFloat(e.trim())}var Si=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Ci=new Set([...Si,`pathRotation`]),wi=e=>e===$t||e===z,Ti=new Set([`x`,`y`,`z`]),Ei=Si.filter(e=>!Ti.has(e));function Di(e){let t=[];return Ei.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Oi=new Set([`bottom`,`right`]);function ki(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Ai={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>ki(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>ki(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>yi(e,`x`),y:({transform:e})=>yi(e,`y`)};Ai.translateX=Ai.x,Ai.translateY=Ai.y;var ji=new Set,Mi=!1,Ni=!1,Pi=!1;function Fi(){if(Ni){let e=[],t=new Set,n=new Set;ji.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Oi.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Di(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.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)})}Ni=!1,Mi=!1,ji.forEach(e=>e.complete(Pi)),ji.clear()}function Ii(){ji.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ni=!0)})}function Li(){Pi=!0,Ii(),Fi(),Pi=!1}function Ri(e,t,n){if(typeof e==`string`){if(st(e)||lt(e))return parseFloat(e);if(!zn.test(e)&&zn.test(n))return ci(t,n)}return e??void 0}var zi=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?(ji.add(this),Mi||(Mi=!0,ur.read(Ii),ur.resolveKeyframes(Fi))):(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=Ri(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}li(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ji.delete(this)}cancel(){this.state===`scheduled`&&(ji.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Bi=e=>e.startsWith(`--`);function Vi(e,t,n){Bi(t)?e.style.setProperty(t,n):e.style[t]=n}var Hi={};function Ui(e,t){let n=ut(e);return()=>Hi[t]??n()}var Wi=Ui(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Gi=Ui(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Ki=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,qi={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Ki([0,.65,.55,1]),circOut:Ki([.55,0,1,.45]),backIn:Ki([.31,.01,.66,-.59]),backOut:Ki([.33,1.53,.69,.99])};function Ji(e,t){if(e)return typeof e==`function`?Gi()?mr(e,t):`ease-out`:Rt(e)?Ki(e):Array.isArray(e)?e.map(e=>Ji(e,t)||qi.easeOut):qi[e]}function Yi(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=Ji(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Xi(e){return typeof e==`function`&&`applyToOptions`in e}function Zi({type:e,...t}){return Xi(e)&&Gi()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Qi=class extends Jr{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=Zi(e);this.animation=Yi(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Hr(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Vi(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Kr(this,e,c)}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 gt(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+gt(e)}get time(){return gt(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ht(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,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Wi()?(this.animation.timeline=e,t?.(this.animation),dt):n(this)}},$i={anticipate:kt,backInOut:Ot,circInOut:Mt};function ea(e){return e in $i}function ta(e){typeof e.ease==`string`&&ea(e.ease)&&(e.ease=$i[e.ease])}var na=10,B=class extends Qi{constructor(e){ta(e),Wr(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 Xr({...a,autoplay:!1}),s=Math.max(na,Gt.now()-this.startTime),c=at(0,na,s-na),l=o.sample(s).value,{name:u}=this.options;i&&u&&Vi(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},ra=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(zn.test(e)||e===`0`)&&!e.startsWith(`url(`));function ia(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 aa(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=ra(i,t),s=ra(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):ia(e)||(n===`spring`||Xi(n))&&r}function oa(e){e.duration=0,e.type=`keyframes`}var sa=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ca=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function la(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ca.test(e[t]))return!0;return!1}var ua=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),da=ut(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function fa(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(sa.has(n)||ua.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return da()&&(sa.has(n)||ua.has(n)&&la(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var pa=40,ma=class extends Jr{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Gt.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||zi;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),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=Gt.now();let u=!0;aa(e,i,a,o)||(u=!1,(ot.instantAnimations||!s)&&l?.(Hr(e,n,t)),e[0]=e[e.length-1],oa(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>pa?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&fa(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new B(n)}catch{m=new Xr(n)}}else m=new Xr(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Li()),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()}},ha=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return ga(this.animations,`duration`)}get iterationDuration(){return ga(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function ga(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var _a=class extends ha{then(e,t){return this.finished.finally(e).then(()=>{})}};function va(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 ya=30,ba=e=>!isNaN(parseFloat(e)),xa={current:void 0},Sa=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Gt.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),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=Gt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ba(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new mt)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new mt,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){ur.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;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.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return xa.current&&xa.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Gt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ya)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,ya);return _t(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ca(e,t){return new Sa(e,t)}function wa(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Ta(e,t){let n=e?.[t]??e?.default??e;return n===e?n:wa(n,e)}var Ea={type:`spring`,stiffness:500,damping:25,restSpeed:10},Da=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Oa={type:`keyframes`,duration:.8},ka={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Aa=(e,{keyframes:t})=>t.length>2?Oa:Ci.has(e)?e.startsWith(`scale`)?Da(t[1]):Ea:ka,ja=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Ma(e){for(let t in e)if(!ja.has(t))return!0;return!1}var Na=(e,t,n,r={},i,a)=>o=>{let s=Ta(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=ht(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};Ma(s)||Object.assign(u,Aa(e,u)),u.duration&&=ht(u.duration),u.repeatDelay&&=ht(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(oa(u),u.delay===0&&(d=!0)),(ot.instantAnimations||ot.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,oa(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Hr(u.keyframes,s);if(e!==void 0){ur.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Xr(u):new ma(u)},Pa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Fa(e){let t=Pa.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ia(e,t,n=1){`${e}`;let[r,i]=Fa(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return st(e)?parseFloat(e):e}return Xt(i)?Ia(i,t,n+1):i}function La(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ra(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...La(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function za(e,t,n){return Ra(e.getProps(),t,n,e)}var Ba=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Va=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Si]),Ha=e=>Array.isArray(e);function Ua(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ca(n))}function Wa(e){return Ha(e)?e[e.length-1]||0:e}function Ga(e,t){let{transitionEnd:n={},transition:r={},...i}=za(e,t)||{};i={...i,...n};for(let t in i)Ua(e,t,Wa(i[t]))}var Ka=e=>!!(e&&e.getVelocity);function qa(e){return!!(Ka(e)&&e.add)}function Ja(e,t){let n=e.getValue(`willChange`);if(qa(n))return n.add(t);if(!n&&ot.WillChange){let n=new ot.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Ya(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Xa=`data-`+Ya(`framerAppearId`);function Za(e){return e.props[Xa]}var Qa=typeof window<`u`;function $a({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function eo(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?wa(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&$a(f,t))continue;let o={delay:n,...Ta(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){ur.update(()=>r.set(i));continue}let p=!1;if(Qa&&window.MotionHandoffAnimation){let n=Za(e);if(n){let e=window.MotionHandoffAnimation(n,t,ur);e!==null&&(o.startTime=e,p=!0)}}Ja(e,t);let m=l??e.shouldReduceMotion;r.start(Na(t,r,i,m&&Va.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>ur.update(()=>{o&&Ga(e,o)});d.length?Promise.all(d).then(t):t()}return d}function to(e,t,n={}){let r=za(e,t,Ba(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?eo(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(to(e,t,{...n,delay:r+(typeof o==`function`?0:o)+va(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function no(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>to(e,t,n))):typeof t==`string`?to(e,t,n):Promise.all(eo(e,za(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var ro={test:e=>e===`auto`,parse:e=>e},io=e=>t=>t.test(e),ao=[$t,z,hn,mn,_n,gn,ro],oo=e=>ao.find(io(e));function so(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||lt(e)}var co=new Set([`auto`,`none`,`0`]);function lo(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!co.has(t)&&jn(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=ci(n,i))}var uo=class extends zi{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(),Xt(r))){let i=Ia(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Va.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=oo(r),o=oo(i);if(Qt(r)!==Qt(i)&&Ai[n]){this.needsMeasurement=!0;return}if(a!==o){if(wi(a)&&wi(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ai[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||so(e[t]))&&n.push(t);n.length&&lo(e,n,t)}measure(){let{element:e,name:t}=this;return Ai[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},fo=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],po=[];function mo(e){typeof e.test==`function`&&e.read,ho(e),po.unshift(e)}function ho(e){it(po,e)}function go(e){return po.find(t=>t.test(e))}function _o(e,t,n={},r){let i=[],{velocity:a}=n,o=n.reduceMotion??r?.shouldReduceMotion;for(let s in t){if(s===`transition`||s===`transitionEnd`)continue;let c=t[s];if(c===void 0)continue;let l=e(s),u=l.get();if(u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a){ur.update(()=>l.set(c));continue}l.start(Na(s,l,c,o&&Va.has(s)?{type:!1}:n,r)),l.animation&&i.push(l.animation)}let{transitionEnd:s}=t;if(s){let t=()=>ur.update(()=>{for(let t in s)e(t).set(s[t])});i.length?Promise.all(i).then(t):t()}return i}function vo(e,t,n,r,i){return _o(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=yo(i)??e.read(t,r,i),`${r}`}a=Ca(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function yo(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function bo(e){return ct(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function xo(e){return ct(e)&&`ownerSVGElement`in e}var So=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Co(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 wo=class{constructor(e=ur.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function To(e,{step:t,...n}={}){let r=new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new wo(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}var Eo={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Do={};function Oo(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].get();a!==void 0&&(typeof a==`number`?a:parseFloat(a))!==+!!i.startsWith(`scale`)&&(t+=(t&&` `)+(Do[i]||(Do[i]=(Eo[i]||i)+`(`))+So(a,ri[i])+`)`)}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+`rotate(`+So(i,ri.pathRotation)+`)`),t||`none`}var ko=new Set([`originX`,`originY`,`originZ`]),Ao=(e,t)=>So(e.get(t)?.get(),ii[t]),jo=(e,t,n,r)=>{let i,a;if(Ci.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>Si.indexOf(e)-Si.indexOf(t)))}t.get(`transform`)||(!bo(e)&&!t.get(`transformBox`)&&jo(e,t,`transformBox`,new Sa(`fill-box`)),t.set(`transform`,new Sa(`none`),()=>{e.style.transform=Oo(t)})),a=t.get(`transform`)}else ko.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new Sa(``),()=>{let n=Ao(t,`originX`)??`50%`,r=Ao(t,`originY`)??`50%`,i=Ao(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Bi(n)?()=>{e.style.setProperty(n,r.get())}:()=>{e.style[n]=So(r.get(),ii[n])};return t.set(n,r,i,a)},Mo=e=>bo(e)||xo(e),No=(e,t)=>{if(Ci.has(t))return bi(e,t);let n=getComputedStyle(e),r=Bi(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},Po=To(jo,{test:Mo,read:No}),Fo={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Io=Si.length;function Lo(e,t,n){let r=``,i=!0;for(let a=0;a<Io;a++){let o=Si[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=So(s,ii[o]);if(!c){i=!1;let t=Fo[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${So(a,ii.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ro(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(Ci.has(e)){o=!0;continue}if(Jt(e)){i[e]=n;continue}{let t=So(n,ii[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Lo(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var zo={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Bo={offset:`strokeDashoffset`,array:`strokeDasharray`};function V(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?zo:Bo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Vo=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Ho(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ro(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;for(let e of Vo)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&V(d,i,a,o,!1)}function Uo(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var Wo=(e,t,n,r,i=n)=>{let a=Uo(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=Ya(i));let o=ii[n]||ii[i],s=a?()=>{e[i]=So(r.get(),ii[n])}:()=>{let t=So(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function Go(e,t,n,r){return ur.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new Sa(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var Ko=To((e,t,n,r)=>n.startsWith(`path`)?Go(e,t,n,r):n.startsWith(`attr`)?Wo(e,t,n,r,qo(n)):(Ci.has(n)||ko.has(n)||Bi(n)||n in e.style?jo:Wo)(e,t,n,r),{test:xo,read:(e,t)=>Ci.has(t)?ii[t]?.default||0:Bi(t)||Vo.includes(t)?No(e,t)||e.getAttribute(Ya(t))||0:(t=qo(t),e.getAttribute(Ya(t))??e.getAttribute(t)??void 0)});function qo(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function Jo({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Yo({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Xo(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 Zo(e){return e===void 0||e===1}function Qo({scale:e,scaleX:t,scaleY:n}){return!Zo(e)||!Zo(t)||!Zo(n)}function $o(e){return Qo(e)||es(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function es(e){return ts(e.x)||ts(e.y)}function ts(e){return e&&e!==`0%`}function ns(e,t,n){return n+t*(e-n)}function rs(e,t,n,r,i){return i!==void 0&&(e=ns(e,i,r)),ns(e,n,r)+t}function is(e,t=0,n=1,r,i){e.min=rs(e.min,t,n,r,i),e.max=rs(e.max,t,n,r,i)}function as(e,{x:t,y:n}){is(e.x,t.translate,t.scale,t.originPoint),is(e.y,n.translate,n.scale,n.originPoint)}var os=.999999999999,ss=1.0000000000001;function cs(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&&(ls(e.x,-a.scroll.offset.x),ls(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,as(e,o)),r&&$o(a.latestValues)&&fs(e,a.latestValues,a.layout?.layoutBox))}t.x<ss&&t.x>os&&(t.x=1),t.y<ss&&t.y>os&&(t.y=1)}function ls(e,t){e.min+=t,e.max+=t}function us(e,t,n,r,i=.5){is(e,t,n,Un(e.min,e.max,i),r)}function ds(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function fs(e,t,n){let r=n??e;us(e.x,ds(t.x,r.x),t.scaleX,t.scale,t.originX),us(e.y,ds(t.y,r.y),t.scaleY,t.scale,t.originY)}function ps(e,t){return Jo(Xo(e.getBoundingClientRect(),t))}function ms(e,t,n){let r=ps(e,n),{scroll:i}=t;return i&&(ls(r.x,i.offset.x),ls(r.y,i.offset.y)),r}var hs={},gs=e=>xo(e)?Ko:Po,_s=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=uo}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return ps(this.current)}getProps(){return hs}};function vs(e,t,n,r){if(r)return _o(e=>r.getValue(e,null),t,n,r);let i=gs(e);return vo(i,e,t,n,new _s(i,e))}var ys=To((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>ct(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:bs,cancel:xs}=lr(queueMicrotask,!1),Ss={x:!1,y:!1};function Cs(){return Ss.x||Ss.y}function ws(e){return e===`x`||e===`y`?Ss[e]?null:(Ss[e]=!0,()=>{Ss[e]=!1}):Ss.x||Ss.y?null:(Ss.x=Ss.y=!0,()=>{Ss.x=Ss.y=!1})}function Ts(e,t){let n=Co(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Es(e){return!(e.pointerType===`touch`||Cs())}function Ds(e,t,n={}){let[r,i,a]=Ts(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(!Es(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 Os=(e,t)=>t?e===t||Os(e,t.parentElement):!1,ks=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,As=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function js(e){return As.has(e.tagName)||e.isContentEditable===!0}var Ms=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Ns(e){return Ms.has(e.tagName)||e.isContentEditable===!0}var Ps=new WeakSet;function Fs(e){return t=>{t.key===`Enter`&&e(t)}}function Is(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Ls=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Fs(()=>{if(Ps.has(n))return;Is(n,`down`);let e=Fs(()=>{Is(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Is(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Rs(e){return ks(e)&&!Cs()}var zs=new WeakSet;function Bs(e,t,n={}){let[r,i,a]=Ts(e,n),o=e=>{let r=e.currentTarget;if(!Rs(e)||zs.has(e))return;Ps.add(r),n.stopPropagation&&zs.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Ps.has(r)&&Ps.delete(r),Rs(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Os(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),bo(e)&&(e.addEventListener(`focus`,e=>Ls(e,i)),!js(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var Vs=new WeakMap,Hs,Us=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:xo(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Ws=Us(`inline`,`width`,`offsetWidth`),Gs=Us(`block`,`height`,`offsetHeight`);function Ks({target:e,borderBoxSize:t}){Vs.get(e)?.forEach(n=>{n(e,{get width(){return Ws(e,t)},get height(){return Gs(e,t)}})})}function qs(e){e.forEach(Ks)}function Js(){typeof ResizeObserver<`u`&&(Hs=new ResizeObserver(qs))}function Ys(e,t){Hs||Js();let n=Co(e);return n.forEach(e=>{let n=Vs.get(e);n||(n=new Set,Vs.set(e,n)),n.add(t),Hs?.observe(e)}),()=>{n.forEach(e=>{let n=Vs.get(e);n?.delete(t),n?.size||Hs?.unobserve(e)})}}var Xs=new Set,Zs;function Qs(){Zs=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xs.forEach(t=>t(e))},window.addEventListener(`resize`,Zs)}function $s(e){return Xs.add(e),Zs||Qs(),()=>{Xs.delete(e),!Xs.size&&typeof Zs==`function`&&(window.removeEventListener(`resize`,Zs),Zs=void 0)}}function ec(e,t){return typeof e==`function`?$s(e):Ys(e,t)}var tc={value:null,addProjectionMetrics:null};function nc(e){return xo(e)&&e.tagName===`svg`}var rc=e=>typeof e==`number`?e:parseFloat(e),ic=()=>({translate:0,scale:1,origin:0,originPoint:0}),ac=()=>({x:ic(),y:ic()}),oc=()=>({min:0,max:0}),sc=()=>({x:oc(),y:oc()}),cc=new WeakMap;function lc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function uc(e){return typeof e==`string`||Array.isArray(e)}var dc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],fc=[`initial`,...dc];function pc(e){if(lc(e.animate))return!0;for(let t=0;t<fc.length;t++)if(uc(e[fc[t]]))return!0;return!1}function mc(e){return!!(pc(e)||e.variants)}function hc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Ka(i))e.addValue(r,i);else if(Ka(a))e.addValue(r,Ca(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,Ca(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var gc={current:null},_c={current:!1},vc=typeof window<`u`;function yc(){if(_c.current=!0,vc){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>gc.current=e.matches;e.addEventListener(`change`,t),t()}else gc.current=!1}}var bc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],xc={};function Sc(e){xc=e}function Cc(){return xc}var wc=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=zi,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=Gt.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,ur.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=pc(t),this.isVariantNode=mc(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&&Ka(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];if(this.current=e,cc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(_c.current||yc(),this.shouldReduceMotion=gc.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(),dr(this.notifyUpdate),dr(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&&sa.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Qi({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ht(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Ci.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&ur.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in xc){let t=xc[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):sc()}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<bc.length;t++){let n=bc[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=hc(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}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}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=Ca(t??this.getDefaultValue?.(e),{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`&&(st(n)||lt(n))?n=parseFloat(n):typeof n!=`number`&&!zn.test(n)&&zn.test(t)&&(n=ci(e,t)),this.setBaseTarget(e,Ka(n)?n.get():n)),Ka(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new mt),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){bs.render(this.render)}},Tc=class extends wc{constructor(){super(...arguments),this.KeyframeResolver=uo}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;Ka(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Ec=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Dc(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])}var Oc={};function kc(e,{layout:t,layoutId:n}){return Ci.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Oc[e]||e===`opacity`)}function Ac(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Ka(r[t])||i&&Ka(i[t])||kc(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function jc(e){return window.getComputedStyle(e)}var Mc=class extends Tc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Dc}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Ci.has(t))return this.projection?.isProjecting?vi(t):bi(e,t);{let n=jc(e),r=(Jt(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return ps(e,t)}build(e,t,n){Ro(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ac(e,t,n)}},Nc=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`]),Pc=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Fc(e,t,n,r){Dc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Nc.has(n)?n:Ya(n),t.attrs[n])}function Ic(e,t,n){let r=Ac(e,t,n);for(let n in e)if(Ka(e[n])||Ka(t[n])){let t=Si.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Lc=class extends Tc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=sc}getBaseTargetFromProps(e,t){return Ci.has(t)?super.getBaseTargetFromProps(e,t)??vi(t):e[t]}getDefaultValue(e){return Ci.has(e)?this.latestValues[e]??vi(e):void 0}readValueFromInstance(e,t){if(Ci.has(t)){let e=oi(t);return e&&e.default||0}if(Vo.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Nc.has(t)?t:Ya(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ic(e,t,n)}build(e,t,n){Ho(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Fc(e,t,n,r)}mount(e){this.isSVGTag=Pc(e.tagName),super.mount(e)}};function Rc(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 zc=[...dc].reverse();function Bc(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>no(e,t,n))),n=Hc(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(zc.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?uc(g)||g===!1?g:void 0:h,v=uc(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||lc(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=Vc(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=za(e,n,Ba(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!Rc(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=za(s,n)?.transition?.delayChildren;r.delay=va(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&za(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!Ka(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(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=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=Hc(),i=!0}}}function Vc(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Rc(t,e):!1}function Hc(){let e={};for(let t of dc)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function Uc(e,t){e.min=t.min,e.max=t.max}function Wc(e,t){Uc(e.x,t.x),Uc(e.y,t.y)}function Gc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Kc=.9999,qc=1.0001,Jc=-.01,Yc=.01;function Xc(e){return e.max-e.min}function Zc(e,t,n){return Math.abs(e-t)<=n}function Qc(e,t,n,r=.5){e.origin=r,e.originPoint=Un(t.min,t.max,e.origin),e.scale=Xc(n)/Xc(t),e.translate=Un(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Kc&&e.scale<=qc||isNaN(e.scale))&&(e.scale=1),(e.translate>=Jc&&e.translate<=Yc||isNaN(e.translate))&&(e.translate=0)}function $c(e,t,n,r){Qc(e.x,t.x,n.x,r?r.originX:void 0),Qc(e.y,t.y,n.y,r?r.originY:void 0)}function el(e,t,n,r=0){e.min=(r?Un(n.min,n.max,r):n.min)+t.min,e.max=e.min+Xc(t)}function tl(e,t,n,r){el(e.x,t.x,n.x,r?.x),el(e.y,t.y,n.y,r?.y)}function nl(e,t,n,r=0){let i=r?Un(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Xc(t)}function rl(e,t,n,r){nl(e.x,t.x,n.x,r?.x),nl(e.y,t.y,n.y,r?.y)}function il(e,t,n,r,i){return e-=t,e=ns(e,1/n,r),i!==void 0&&(e=ns(e,1/i,r)),e}function al(e,t=0,n=1,r=.5,i,a=e,o=e){if(hn.test(t)&&(t=parseFloat(t),t=Un(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Un(a.min,a.max,r);e===a&&(s-=t),e.min=il(e.min,t,n,s,i),e.max=il(e.max,t,n,s,i)}function ol(e,t,[n,r,i],a,o){al(e,t[n],t[r],t[i],t.scale,a,o)}var sl=[`x`,`scaleX`,`originX`],cl=[`y`,`scaleY`,`originY`];function ll(e,t,n,r){ol(e.x,t,sl,n?n.x:void 0,r?r.x:void 0),ol(e.y,t,cl,n?n.y:void 0,r?r.y:void 0)}function ul(e){return e.translate===0&&e.scale===1}function dl(e){return ul(e.x)&&ul(e.y)}function fl(e,t){return e.min===t.min&&e.max===t.max}function pl(e,t){return fl(e.x,t.x)&&fl(e.y,t.y)}function ml(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function hl(e,t){return ml(e.x,t.x)&&ml(e.y,t.y)}function gl(e){return Xc(e.x)/Xc(e.y)}function _l(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function vl(e){return[e(`x`),e(`y`)]}function yl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var bl={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(z.test(e))e=parseFloat(e);else return e}return`${yl(e,t.target.x)}% ${yl(e,t.target.y)}%`}},xl={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=zn.parse(e);if(i.length>5)return r;let a=zn.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=Un(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Sl(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Cl=fo.length,wl=e=>typeof e==`number`||z.test(e);function Tl(e,t,n,r,i,a){i?(e.opacity=Un(0,n.opacity??1,Dl(r)),e.opacityExit=Un(t.opacity??1,0,Ol(r))):a&&(e.opacity=Un(t.opacity??1,n.opacity??1,r));for(let i=0;i<Cl;i++){let a=fo[i],o=El(t,a),s=El(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||wl(o)===wl(s)?(e[a]=Math.max(Un(rc(o),rc(s),r),0),(hn.test(s)||hn.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Un(t.rotate||0,n.rotate||0,r))}function El(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Dl=kl(0,.5,jt),Ol=kl(.5,.95,dt);function kl(e,t,n){return r=>r<e?0:r>t?1:n(pt(e,t,r))}function Al(e,t,n){let r=Ka(e)?e:Ca(e);return r.start(Na(``,r,t,n)),r.animation}function jl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Ml=(e,t)=>e.depth-t.depth,Nl=class{constructor(){this.children=[],this.isDirty=!1}add(e){rt(this.children,e),this.isDirty=!0}remove(e){it(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ml),this.isDirty=!1,this.children.forEach(e)}};function Pl(e,t){let n=Gt.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(dr(r),e(a-t))};return ur.setup(r,!0),()=>dr(r)}function Fl(e){return Ka(e)?e.get():e}var Il=class{constructor(){this.members=[]}add(e){rt(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&&(it(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(it(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)}},Ll={borderRadius:{...bl,applyTo:[...fo]},borderTopLeftRadius:bl,borderTopRightRadius:bl,borderBottomLeftRadius:bl,borderBottomRightRadius:bl,boxShadow:xl},Rl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Oc,{...Ll,...Oc});var zl={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Bl=[``,`X`,`Y`,`Z`],Vl=1e3,Hl=0;function Ul(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Wl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Za(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,ur,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Wl(r)}function Gl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Hl++,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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,tc.value&&(zl.nodes=zl.calculatedTargetDeltas=zl.calculatedProjections=0),this.nodes.forEach(Jl),this.nodes.forEach(iu),this.nodes.forEach(au),this.nodes.forEach(Yl),tc.addProjectionMetrics&&tc.addProjectionMetrics(zl)},this.resolvedRelativeTargetAt=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 Nl)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new mt),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=xo(t)&&!nc(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;ur.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Pl(i,250),Rl.hasAnimatedSinceResize&&(Rl.hasAnimatedSinceResize=!1,this.nodes.forEach(ru)))})}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()||fu,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!hl(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={...Ta(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||ru(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(),dr(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(ou),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&&Wl(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(Ql),this.nodes.forEach(Zl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($l);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(eu),this.nodes.forEach(tu),this.nodes.forEach(nu),this.nodes.forEach(Kl),this.nodes.forEach(ql)):this.nodes.forEach($l),this.clearAllSnapshots();let e=Gt.now();Ht.delta=at(0,1e3/60,e-Ht.timestamp),Ht.timestamp=e,Ht.isProcessing=!0,fr.update.process(Ht),fr.preRender.process(Ht),fr.render.process(Ht),Ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xl),this.sharedNodes.forEach(su)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ur.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ur.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Xc(this.snapshot.measuredBox.x)&&!Xc(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.layoutCorrected||=sc(),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&&!dl(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||$o(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)),gu(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return sc();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vu))){let{scroll:e}=this.root;e&&(ls(t.x,e.offset.x),ls(t.y,e.offset.y))}return t}removeElementScroll(e){let t=sc();if(Wc(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&&Wc(t,e),ls(t.x,i.offset.x),ls(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||sc();Wc(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&&(ls(r.x,-n.scroll.offset.x),ls(r.y,-n.scroll.offset.y)),$o(n.latestValues)&&fs(r,n.latestValues,n.layout?.layoutBox)}return $o(this.latestValues)&&fs(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=sc();Wc(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!$o(n.latestValues))continue;let r;n.instance&&(Qo(n.latestValues)&&n.updateSnapshot(),r=sc(),Wc(r,n.measurePageBox())),ll(t,n.latestValues,n.snapshot?.layoutBox,r)}return $o(this.latestValues)&&ll(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ht.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=Ht.timestamp;let a=this.getClosestProjectingParent();!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=sc(),this.targetWithTransforms=sc()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tl(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Wc(this.target,this.layout.layoutBox),as(this.target,this.targetDelta)):Wc(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),tc.value&&zl.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Qo(this.parent.latestValues)||es(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.forceRelativeParentToResolveTarget(),this.relativeTarget=sc(),this.relativeTargetOrigin=sc(),rl(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Wc(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===Ht.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;Wc(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;cs(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=sc());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gc(this.prevProjectionDelta.x,this.projectionDelta.x),Gc(this.prevProjectionDelta.y,this.projectionDelta.y)),$c(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!_l(this.projectionDelta.x,this.prevProjectionDelta.x)||!_l(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),tc.value&&zl.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=ac(),this.projectionDelta=ac(),this.projectionDeltaWithTransform=ac()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=ac();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=sc(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(du));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Un(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Un(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(cu(o.x,e.x,n),cu(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(rl(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),uu(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&pl(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=sc(),Wc(f,this.relativeTarget)),c&&(this.animationValues=a,Tl(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(dr(this.pendingAnimation),void 0),this.pendingAnimation=ur.update(()=>{Rl.hasAnimatedSinceResize=!0,this.motionValue||=Ca(0),this.motionValue.jump(0,!1),this.currentAnimation=Al(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),qr(this.currentAnimation,this),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(Vl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&_u(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||sc();let t=Xc(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Xc(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Wc(t,i),fs(t,r),$c(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Il),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Ul(`z`,e,r,this.animationValues);for(let t=0;t<Bl.length;t++)Ul(`rotate${Bl[t]}`,e,r,this.animationValues),Ul(`skew${Bl[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=Fl(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=Fl(t?.pointerEvents)||``),this.hasProjected&&!$o(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Sl(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Oc){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Oc[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?Fl(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Zl),this.root.sharedNodes.clear()}}}function Kl(e){e.updateLayout()}function ql(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`)vl(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Xc(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Uc(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else _u(i,t.layoutBox,n)&&vl(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Xc(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=ac();$c(o,n,t.layoutBox);let s=ac();a?$c(s,e.applyTransform(r,!0),t.measuredBox):$c(s,n,t.layoutBox);let c=!dl(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=sc();rl(s,t.layoutBox,i.layoutBox,o);let c=sc();rl(c,n,a.layoutBox,o),hl(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 Jl(e){tc.value&&zl.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 Yl(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Xl(e){e.clearSnapshot()}function Zl(e){e.clearMeasurements()}function Ql(e){e.isLayoutDirty=!0,e.updateLayout()}function $l(e){e.isLayoutDirty=!1}function eu(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function tu(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function nu(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ru(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iu(e){e.resolveTargetDelta()}function au(e){e.calcProjection()}function ou(e){e.resetSkewAndRotation()}function su(e){e.removeLeadSnapshot()}function cu(e,t,n){e.translate=Un(t.translate,0,n),e.scale=Un(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function lu(e,t,n,r){e.min=Un(t.min,n.min,r),e.max=Un(t.max,n.max,r)}function uu(e,t,n,r){lu(e.x,t.x,n.x,r),lu(e.y,t.y,n.y,r)}function du(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var fu={duration:.45,ease:[.4,0,.1,1]},pu=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),mu=pu(`applewebkit/`)&&!pu(`chrome/`)?Math.round:dt;function hu(e){e.min=mu(e.min),e.max=mu(e.max)}function gu(e){hu(e.x),hu(e.y)}function _u(e,t,n){return e===`position`||e===`preserve-aspect`&&!Zc(gl(t),gl(n),.2)}function vu(e){return e!==e.root&&e.scroll?.wasRoot}var yu=Gl({attachResizeListener:(e,t)=>jl(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),bu={current:void 0},xu=Gl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!bu.current){let e=new yu({});e.mount(window),e.setOptions({layoutScroll:!0}),bu.current=e}return bu.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Su=(0,m.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Cu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function wu(...e){return t=>{let n=!1,r=e.map(e=>{let r=Cu(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Cu(e[t],null)}}}}function Tu(...e){return m.useCallback(wu(...e),e)}var H=i(),Eu=class extends m.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(bo(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=bo(e)&&e.offsetWidth||0,r=bo(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function Du({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,m.useId)(),s=(0,m.useRef)(null),c=(0,m.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,m.useContext)(Su),u=Tu(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,m.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
4
- [data-motion-pop-id="${o}"] {
5
- position: absolute !important;
6
- width: ${e}px !important;
7
- height: ${u}px !important;
8
- ${_}px !important;
9
- ${v}px !important;
10
- }
11
- `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,H.jsx)(Eu,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:m.cloneElement(e,{ref:u})})}var Ou=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=et(ku),d=(0,m.useId)(),f=(0,m.useRef)(n),p=(0,m.useRef)(r);tt(()=>{f.current=n,p.current=r});let h=!0,g=(0,m.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,m.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,H.jsx)(Du,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,H.jsx)(nt.Provider,{value:g,children:e})};function ku(){return new Map}function Au(e=!0){let t=(0,m.useContext)(nt);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,m.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var ju=e=>e.key||``;function Mu(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}var Nu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Au(o),f=(0,m.useMemo)(()=>Mu(e),[e]),p=o&&!u?[]:f.map(ju),h=(0,m.useRef)(!0),g=et(()=>new Map),_=(0,m.useRef)(new Set),[v,y]=(0,m.useState)(f),[b,x]=(0,m.useState)(f);tt(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]),tt(()=>{h.current=!1;for(let e=0;e<b.length;e++){let t=ju(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f],t=0;for(let n of b){let r=p.indexOf(ju(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>g.get(ju(e)))?e=f:a===`wait`&&(e=S),x(Mu(e)),y(f),null}let{forceRender:C}=(0,m.useContext)($e);return(0,H.jsx)(H.Fragment,{children:b.map(e=>{let m=ju(e),v=o&&!u?!1:f===b||p.includes(m);return(0,H.jsx)(Ou,{isPresent:v,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(_.current.has(m))return;if(g.has(m))_.current.add(m),g.set(m,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),y([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},m)})})},Pu=(0,m.createContext)({strict:!1}),Fu={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`]},Iu=!1;function Lu(){if(Iu)return;let e={};for(let t in Fu)e[t]={isEnabled:e=>Fu[t].some(t=>!!e[t])};Sc(e),Iu=!0}function Ru(){return Lu(),Cc()}function zu(e){let t=Ru();for(let n in e)t[n]={...t[n],...e[n]};Sc(t)}function Bu({children:e,...t}){let n=(0,m.useContext)(Su);t={...n,...t},t.transition=wa(t.transition,n.transition),t.isStatic=et(()=>t.isStatic);let r=(0,m.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,H.jsx)(Su.Provider,{value:r,children:e})}var Vu=(0,m.createContext)({});function Hu(e,t){if(pc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||uc(t)?t:void 0,animate:uc(n)?n:void 0}}return e.inherit===!1?{}:t}function Uu(e){let{initial:t,animate:n}=Hu(e,(0,m.useContext)(Vu));return(0,m.useMemo)(()=>({initial:t,animate:n}),[Wu(t),Wu(n)])}function Wu(e){return Array.isArray(e)?e.join(` `):e}var Gu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ku(e,t,n){for(let r in t)!Ka(t[r])&&!kc(r,n)&&(e[r]=t[r])}function qu({transformTemplate:e},t){return(0,m.useMemo)(()=>{let n=Gu();return Ro(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ju(e,t){let n=e.style||{},r={};return Ku(r,n,e),Object.assign(r,qu(e,t)),r}function Yu(e,t){let n={},r=Ju(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 Xu=()=>({...Gu(),attrs:{}});function Zu(e,t,n,r){let i=(0,m.useMemo)(()=>{let n=Xu();return Ho(n,t,Pc(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Ku(t,e.style,e),i.style={...t,...i.style}}return i}var Qu=new Set(`animate.exit.variants.initial.style.values.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 $u(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Qu.has(e)}function ed(e,t){return e.startsWith(`on`)?!$u(e):t?.(e)??!$u(e)}function td(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Ka(e[a])||(ed(a,r)||n===!0&&$u(a)||!t&&!$u(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var nd=[`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 U(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(nd.indexOf(e)>-1||/[A-Z]/u.test(e))}function rd(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??U(e)?Zu:Yu)(t,r,i,e),l=td(t,typeof e==`string`,a,s),u=e===m.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,m.useMemo)(()=>Ka(d)?d.get():d,[d]);return(0,m.createElement)(e,{...u,children:f})}function id({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ad(n,r,i,e),renderState:t()}}function ad(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Fl(a[e]);let{initial:o,animate:s}=e,c=pc(e),l=mc(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`&&!lc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Ra(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 od=e=>(t,n)=>{let r=(0,m.useContext)(Vu),i=(0,m.useContext)(nt),a=()=>id(e,t,r,i);return n?a():et(a)},sd=od({scrapeMotionValuesFromProps:Ac,createRenderState:Gu}),cd=od({scrapeMotionValuesFromProps:Ic,createRenderState:Xu}),ld=Symbol.for(`motionComponentSymbol`);function ud(e,t,n){let r=(0,m.useRef)(n);(0,m.useInsertionEffect)(()=>{r.current=n});let i=(0,m.useRef)(null);return(0,m.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var dd=(0,m.createContext)({});function fd(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function pd(e,t,n,r,i,a){let{visualElement:o}=(0,m.useContext)(Vu),s=(0,m.useContext)(Pu),c=(0,m.useContext)(nt),l=(0,m.useContext)(Su),u=l.reducedMotion,d=l.skipAnimations,f=(0,m.useRef)(null),p=(0,m.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let h=f.current,g=(0,m.useContext)(dd);h&&!h.projection&&i&&(h.type===`html`||h.type===`svg`)&&md(f.current,n,i,g);let _=(0,m.useRef)(!1);(0,m.useInsertionEffect)(()=>{h&&_.current&&h.update(n,c)});let v=n[Xa],y=(0,m.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return tt(()=>{p.current&&h&&(h.animationState?.animateChanges(),h.enteringChildren=void 0)},[]),tt(()=>{p.current=!0,h&&(_.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,m.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),h.enteringChildren=void 0)}),h}function md(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:hd(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&fd(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function hd(e){if(e)return e.options.allowProjection===!1?hd(e.parent):e.projection}function gd(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&zu(r);let a=n?n===`svg`:U(e),o=a?cd:sd;function s(n,s){let c,l={...(0,m.useContext)(Su),...n,layoutId:_d(n)},{isStatic:u,isValidProp:d}=l,f=Uu(n),p=o(n,u);if(!u&&typeof window<`u`){vd(l,r);let t=yd(l);c=t.MeasureLayout,f.visualElement=pd(e,p,l,i,t.ProjectionNode,a)}return(0,H.jsxs)(Vu.Provider,{value:f,children:[c&&f.visualElement?(0,H.jsx)(c,{visualElement:f.visualElement,...l}):null,rd(e,n,ud(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,m.forwardRef)(s);return c[ld]=e,c}function _d({layoutId:e}){let t=(0,m.useContext)($e).id;return t&&e!==void 0?t+`-`+e:e}function vd(e,t){(0,m.useContext)(Pu).strict}function yd(e){let{drag:t,layout:n}=Ru();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function bd(e,t){if(typeof Proxy>`u`)return gd;let n=new Map,r=(n,r)=>gd(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,gd(a,void 0,e,t)),n.get(a))})}var xd=(e,t)=>t.isSVG??U(e)?new Lc(t):new Mc(t,{allowProjection:e!==m.Fragment}),Sd=class extends Ec{constructor(e){super(e),e.animationState||=Bc(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();lc(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?.()}},Cd=0,wd={animation:{Feature:Sd},exit:{Feature:class extends Ec{constructor(){super(...arguments),this.id=Cd++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=za(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Td(e){return{point:{x:e.pageX,y:e.pageY}}}var Ed=e=>t=>ks(t)&&e(t,Td(t));function Dd(e,t,n,r){return jl(e,t,Ed(n),r)}var Od=({current:e})=>e?e.ownerDocument.defaultView:null,kd=(e,t)=>Math.abs(e-t);function Ad(e,t){let n=kd(e.x,t.x),r=kd(e.y,t.y);return Math.sqrt(n**2+r**2)}var jd=new Set([`auto`,`scroll`]),Md=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.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Nd(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Fd(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Ad(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Gt.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Nd(t,this.transformPagePoint),this.hasPendingMove=!0,ur.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),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=Fd(e.type===`pointercancel`?this.lastMoveEventInfo:Nd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!ks(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Nd(Td(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Ht;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Fd(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=ft(Dd(this.contextWindow,`pointermove`,this.handlePointerMove,d),Dd(this.contextWindow,`pointerup`,this.handlePointerUp,d),Dd(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(jd.has(e.overflowX)||jd.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),ur.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),dr(this.updatePoint)}};function Nd(e,t){return t?{point:t(e.point)}:e}function Pd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Fd({point:e},t){return{point:e,delta:Pd(e,Ld(t)),offset:Pd(e,Id(t)),velocity:Rd(t,.1)}}function Id(e){return e[0]}function Ld(e){return e[e.length-1]}function Rd(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Ld(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ht(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>ht(t)*2&&(r=e[1]);let a=gt(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 zd(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Un(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Un(n,e,r.max):Math.min(e,n)),e}function Bd(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 Vd(e,{top:t,left:n,bottom:r,right:i}){return{x:Bd(e.x,n,i),y:Bd(e.y,t,r)}}function Hd(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 Ud(e,t){return{x:Hd(e.x,t.x),y:Hd(e.y,t.y)}}function Wd(e,t){let n=.5,r=Xc(e),i=Xc(t);return i>r?n=pt(t.min,t.max-r,e.min):r>i&&(n=pt(e.min,e.max-i,t.min)),at(0,1,n)}function Gd(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 Kd=.35;function qd(e=Kd){return e===!1?e=0:e===!0&&(e=Kd),{x:Jd(e,`left`,`right`),y:Jd(e,`top`,`bottom`)}}function Jd(e,t,n){return{min:Yd(e,t),max:Yd(e,n)}}function Yd(e,t){return typeof e==`number`?e:e[t]||0}var Xd=new WeakMap,Zd=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=sc(),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(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ws(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),vl(e=>{let t=this.getAxisMotionValue(e).get()||0;if(hn.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Xc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&ur.update(()=>i(e,t),!1,!0),Ja(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=tf(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&&ur.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 Md(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Od(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&&ur.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||!ef(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=zd(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&&fd(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Vd(n.layoutBox,e):!1,this.elastic=qd(t),r!==this.constraints&&!fd(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&vl(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Gd(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!fd(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=ms(n,r.root,this.visualElement.getTransformPagePoint()),a=Ud(r.layout.layoutBox,i);if(t){let e=t(Yo(a));this.hasMutatedConstraints=!!e,e&&(a=Jo(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=vl(o=>{if(!ef(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 Ja(this.visualElement,e),n.start(Na(e,n,0,t,this.visualElement,!1))}stopAnimation(){vl(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();vl(e=>{if(!ef(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Un(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!fd(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};vl(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Wd({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),vl(t=>{let n=this.getAxisMotionValue(t);if(!ef(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Un(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Xd.set(this.visualElement,this);let e=this.visualElement.current,t=Dd(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Ns(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();fd(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=$d(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ur.read(r);let o=jl(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(vl(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=Kd,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Qd(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function $d(e,t,n){let r=ec(e,Qd(n)),i=ec(t,Qd(n));return()=>{r(),i()}}function ef(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function tf(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var nf=class extends Ec{constructor(e){super(e),this.removeGroupControls=dt,this.removeListeners=dt,this.controls=new Zd(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dt}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()}},rf=e=>(t,n)=>{e&&ur.update(()=>e(t,n),!1,!0)},af=class extends Ec{constructor(){super(...arguments),this.removePointerDownListener=dt}onPointerDown(e){this.session=new Md(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Od(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:rf(e),onStart:rf(t),onMove:rf(n),onEnd:(e,t)=>{delete this.session,r&&ur.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Dd(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},of=!1,sf=class extends m.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),of&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Rl.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}),of=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||ur.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(),bs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;of=!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 cf(e){let[t,n]=Au(),r=(0,m.useContext)($e);return(0,H.jsx)(sf,{...e,layoutGroup:r,switchLayoutGroup:(0,m.useContext)(dd),isPresent:t,safeToRemove:n})}var lf={pan:{Feature:af},drag:{Feature:nf,ProjectionNode:xu,MeasureLayout:cf}};function uf(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&ur.postRender(()=>i(t,Td(t)))}var df=class extends Ec{mount(){let{current:e}=this.node;e&&(this.unmount=Ds(e,(e,t)=>(uf(this.node,t,`Start`),e=>uf(this.node,e,`End`))))}unmount(){}},ff=class extends Ec{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=ft(jl(this.node.current,`focus`,()=>this.onFocus()),jl(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function pf(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&&ur.postRender(()=>i(t,Td(t)))}var mf=class extends Ec{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Bs(e,(e,t)=>(pf(this.node,t,`Start`),(e,{success:t})=>pf(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},hf=new WeakMap,gf=new WeakMap,_f=e=>{let t=hf.get(e.target);t&&t(e)},vf=e=>{e.forEach(_f)};function yf({root:e,...t}){let n=e||document;gf.has(n)||gf.set(n,{});let r=gf.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(vf,{root:e,...t})),r[i]}function bf(e,t,n){let r=yf(t);return hf.set(e,n),r.observe(e),()=>{hf.delete(e),r.unobserve(e)}}var xf={some:0,all:1},Sf=class extends Ec{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:xf[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=bf(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Cf(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Cf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var wf={inView:{Feature:Sf},tap:{Feature:mf},focus:{Feature:ff},hover:{Feature:df}},Tf={layout:{ProjectionNode:xu,MeasureLayout:cf}},Ef=bd({...wd,...wf,...lf,...Tf},xd);function Df(e){let t=et(()=>Ca(e)),{isStatic:n}=(0,m.useContext)(Su);if(n){let[,n]=(0,m.useState)(e);(0,m.useEffect)(()=>t.on(`change`,n),[])}return t}function Of(){!_c.current&&yc();let[e]=(0,m.useState)(gc.current);return e}function kf(e){return typeof e==`object`&&!Array.isArray(e)}function Af(e,t,n,r){return e==null?[]:typeof e==`string`&&kf(t)?Co(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function jf(e,t,n){return e*(t+1)+n*t}function Mf(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Nf(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(it(e,i),r--)}}function Pf(e,t,n,r,i,a){Nf(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Un(i,a,r[o]),easing:Lt(n,o)})}function Ff(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function If(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Lf=`easeInOut`,Rf=20;function zf(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,Mf(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Mf(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Hf(e),{delay:l=0,times:u=Pr(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Xi(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Gf(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=ht(b));let r=_r(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Nr(u,T),c.length===1&&c.unshift(null),m&&`${m}${Rf}`,m&&m<Rf){let e=b>0?_/b:0;b=jf(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Tt(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Lt(f,e-1))}Ff(u,m,e)}let E=w+b;Pf(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ka(p)){let e=Bf(p,s);_(m,h,Vf(`default`,e))}else{let e=Af(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Bf(r,s);for(let e in m)_(m[e],Uf(h,e),Vf(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(If);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(pt(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Lf)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Bf(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Vf(e,t){return t[e]||(t[e]=[]),t[e]}function Hf(e){return Array.isArray(e)?e:[e]}function Uf(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Wf=e=>typeof e==`number`,Gf=e=>e.every(Wf);function Kf(e,t){return Ka(e)||typeof e==`number`||typeof e==`string`&&!kf(t)}function qf(e,t,n,r){let i=[];if(Kf(e,t))i.push(Al(e,kf(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Af(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...vs(r,t,s,cc.get(r))):i.push(...vo(go(r)??ys,r,t,s))}}return i}function Jf(e,t,n){let r=[];return zf(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Ca(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:kr}).forEach(({keyframes:e,transition:t},n)=>{r.push(...qf(n,e,t))}),r}function Yf(e){return Array.isArray(e)&&e.some(Array.isArray)}function Xf(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Yf(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Jf(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=qf(e,i,{...c,...r},t)}let l=new _a(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{it(t.animations,l)})),l}return i}var Zf=Object.assign(Xf(),{addEffect:mo,removeEffect:ho}),Qf=Ef,$f=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ep=n(((e,t)=>{t.exports=$f()})),tp=n((e=>{var t=o();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=i.p;try{if(u.T=null,i.p=2,e)return e()}finally{u.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),np=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=tp()})),rp=n((e=>{var t=ep(),n=o(),r=np();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return u(a),e;if(o===r)return u(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=o;break}if(l===r){c=!0,r=a,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=a;break}if(l===r){c=!0,r=o,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),P=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),oe=Symbol.for(`react.memo_cache_sentinel`),se=Symbol.for(`react.view_transition`),ce=Symbol.for(`react.recoverable`),le=Symbol.iterator;function F(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var ue=Symbol.for(`react.client.reference`);function de(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case j:return`Profiler`;case A:return`StrictMode`;case te:return`Suspense`;case P:return`SuspenseList`;case ie:return`Activity`;case se:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?de(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var fe=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},me=[],he=-1;function ge(e){return{current:e}}function _e(e){0>he||(e.current=me[he],me[he]=null,he--)}function ve(e,t){he++,me[he]=e.current,e.current=t}var ye=ge(null),be=ge(null),xe=ge(null),R=ge(null);function Se(e,t){switch(ve(xe,t),ve(be,e),ve(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bp(t),e=xp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}_e(ye),ve(ye,e)}function Ce(){_e(ye),_e(be),_e(xe)}function we(e){var t=e.memoizedState;t!==null&&(mh._currentValue=t.memoizedState,ve(R,e)),t=ye.current;var n=xp(t,e.type);t!==n&&(ve(be,e),ve(ye,n))}function Te(e){be.current===e&&(_e(ye),_e(be)),R.current===e&&(_e(R),mh._currentValue=pe)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
12
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
13
- `+Ee+e+De}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
14
- `),l=s.split(`
15
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
16
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Oe(n):``}function je(e,t){switch(e.tag){case 26:case 27:case 5:return Oe(e.type);case 16:return Oe(`Lazy`);case 13:return e.child!==t&&t!==null?Oe(`Suspense Fallback`):Oe(`Suspense`);case 19:return Oe(`SuspenseList`);case 0:case 15:return Ae(e.type,!1);case 11:return Ae(e.type.render,!1);case 1:return Ae(e.type,!0);case 31:return Oe(`Activity`);case 30:return Oe(`ViewTransition`);default:return``}}function Me(e){try{var t=``,n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
17
- Error generating stack: `+e.message+`
18
- `+e.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,Le=t.unstable_requestPaint,Re=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,We=t.unstable_IdlePriority,Ge=t.log,Ke=t.unstable_setDisableYieldValue,qe=null,Je=null;function Ye(e){if(typeof Ge==`function`&&Ke(e),Je&&typeof Je.setStrictMode==`function`)try{Je.setStrictMode(qe,e)}catch{}}var Xe=Math.clz32?Math.clz32:$e,Ze=Math.log,Qe=Math.LN2;function $e(e){return e>>>=0,e===0?32:31-(Ze(e)/Qe|0)|0}var et=256,tt=262144,nt=4194304;function rt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function it(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=rt(n))):i=rt(o):i=rt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=rt(n))):i=rt(o)):i=rt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function at(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Xe(n),i=1<<r;t|=e[r],n&=~i}return t}function st(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ct(){var e=nt;return nt<<=1,!(nt&62914560)&&(nt=4194304),e}function lt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ut(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Xe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ft(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ft(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Xe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Xe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function mt(e,t){var n=t&-t;return n=n&42?1:ht(n),(n&(e.suspendedLanes|t))===0?n:0}function ht(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function gt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function _t(){var e=L.p;return e===0?(e=window.event,e===void 0?32:Ah(e.type)):e}function vt(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var yt=Math.random().toString(36).slice(2),bt=`__reactFiber$`+yt,xt=`__reactProps$`+yt,St=`__reactContainer$`+yt,Ct=`__reactEvents$`+yt,wt=`__reactListeners$`+yt,Tt=`__reactHandles$`+yt,Et=`__reactResources$`+yt,Dt=`__reactMarker$`+yt,Ot=`__reactLoad$`+yt;function kt(e){delete e[bt],delete e[xt],delete e[wt],delete e[Tt]}function At(e){var t;if(t=e[bt])return t;for(var n=e.parentNode;n;){if(t=n[St]||n[bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[bt])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function jt(e){if(e=e[bt]||e[St]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Nt(e){var t=e[Et];return t||=e[Et]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Pt(e){e[Dt]=!0}function Ft(e){e[Ot]=void 0}var It=new Set,Lt={};function Rt(e,t){zt(e,t),zt(e+`Capture`,t)}function zt(e,t){for(Lt[e]=t,e=0;e<t.length;e++)It.add(t[e])}var Bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Vt={},Ht={};function Ut(e){return Ne.call(Ht,e)?!0:Ne.call(Vt,e)?!1:Bt.test(e)?Ht[e]=!0:(Vt[e]=!0,!1)}var Wt=!1;function Gt(){var e=Wt;return Wt=!1,e}function Kt(e,t,n){if(Ut(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function qt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Yt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Xt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qt(e){if(!e._valueTracker){var t=Xt(e)?`checked`:`value`;e._valueTracker=Zt(e,t,``+e[t])}}function $t(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Xt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var en=/[\n"\\]/g;function tn(e){return e.replace(en,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function nn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Yt(t)):e.value!==``+Yt(t)&&(e.value=``+Yt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):an(e,Yt(n)):o===`number`&&e.value==t?an(e,Yt(e.value)):an(e,Yt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Yt(s):e.removeAttribute(`name`)}function rn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Qt(e);return}n=n==null?``:``+Yt(n),t=t==null?n:``+Yt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Qt(e)}function an(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function on(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Yt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function sn(e,t,n){if(t!=null&&(t=``+Yt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Yt(n)}function cn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(fe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Yt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Qt(e)}function ln(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var un=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function dn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||un.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function fn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Wt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(dn(e,a,r),Wt=!0)}else for(var o in t)t.hasOwnProperty(o)&&dn(e,o,t[o])}function pn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var mn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),hn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function z(e){return hn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function gn(){}var _n=null;function vn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,bn=null;function xn(e){var t=jt(e);if(t&&(e=t.stateNode)){var n=e[xt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(nn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+tn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[xt]||null;if(!a)throw Error(i(90));nn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&$t(r)}break a;case`textarea`:sn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&on(e,!!n.multiple,t,!1)}}}var Sn=!1;function Cn(e,t,n){if(Sn)return e(t,n);Sn=!0;try{return e(t)}finally{if(Sn=!1,(yn!==null||bn!==null)&&(Wd(),yn&&(t=yn,e=bn,bn=yn=null,xn(t),e)))for(t=0;t<e.length;t++)xn(e[t])}}function wn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[xt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,En=!1;if(Tn)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){En=!0}}),window.addEventListener(`test`,Dn,Dn),window.removeEventListener(`test`,Dn,Dn)}catch{En=!1}var On=null,kn=null,An=null;function jn(){if(An)return An;var e,t=kn,n=t.length,r,i=`value`in On?On.value:On.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return An=i.slice(e,1<r?1-r:void 0)}function Mn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Nn(){return!0}function Pn(){return!1}function Fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Nn:Pn,this.isPropagationStopped=Pn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Nn)},persist:function(){},isPersistent:Nn}),t}var In={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ln=Fn(In),Rn=T({},In,{view:0,detail:0}),zn=Fn(Rn),Bn,Vn,Hn,Un=T({},Rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:er,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Hn&&(Hn&&e.type===`mousemove`?(Bn=e.screenX-Hn.screenX,Vn=e.screenY-Hn.screenY):Vn=Bn=0,Hn=e),Bn)},movementY:function(e){return`movementY`in e?e.movementY:Vn}}),Wn=Fn(Un),Gn=Fn(T({},Un,{dataTransfer:0})),Kn=Fn(T({},Rn,{relatedTarget:0})),qn=Fn(T({},In,{animationName:0,elapsedTime:0,pseudoElement:0})),Jn=Fn(T({},In,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Yn=Fn(T({},In,{data:0})),Xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Zn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function $n(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qn[e])?!!t[e]:!1}function er(){return $n}var tr=Fn(T({},Rn,{key:function(e){if(e.key){var t=Xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:er,charCode:function(e){return e.type===`keypress`?Mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),nr=Fn(T({},Un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),rr=Fn(T({},In,{submitter:0})),ir=Fn(T({},Rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:er})),ar=Fn(T({},In,{propertyName:0,elapsedTime:0,pseudoElement:0})),or=Fn(T({},Un,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),sr=Fn(T({},In,{newState:0,oldState:0,source:0})),cr=[9,13,27,32],lr=Tn&&`CompositionEvent`in window,ur=null;Tn&&`documentMode`in document&&(ur=document.documentMode);var dr=Tn&&`TextEvent`in window&&!ur,fr=Tn&&(!lr||ur&&8<ur&&11>=ur),pr=` `,mr=!1;function hr(e,t){switch(e){case`keyup`:return cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function gr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var _r=!1;function vr(e,t){switch(e){case`compositionend`:return gr(t);case`keypress`:return t.which===32?(mr=!0,pr):null;case`textInput`:return e=t.data,e===pr&&mr?null:e;default:return null}}function yr(e,t){if(_r)return e===`compositionend`||!lr&&hr(e,t)?(e=jn(),An=kn=On=null,_r=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return fr&&t.locale!==`ko`?null:t.data;default:return null}}var br={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!br[e.type]:t===`textarea`}function Sr(e,t,n,r){yn?bn?bn.push(r):bn=[r]:yn=r,t=rp(t,`onChange`),0<t.length&&(n=new Ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Cr=null,wr=null;function Tr(e){qf(e,0)}function Er(e){if($t(Mt(e)))return e}function Dr(e,t){if(e===`change`)return t}var Or=!1;if(Tn){var kr;if(Tn){var Ar=`oninput`in document;if(!Ar){var jr=document.createElement(`div`);jr.setAttribute(`oninput`,`return;`),Ar=typeof jr.oninput==`function`}kr=Ar}else kr=!1;Or=kr&&(!document.documentMode||9<document.documentMode)}function Mr(){Cr&&(Cr.detachEvent(`onpropertychange`,Nr),wr=Cr=null)}function Nr(e){if(e.propertyName===`value`&&Er(wr)){var t=[];Sr(t,wr,e,vn(e)),Cn(Tr,t)}}function Pr(e,t,n){e===`focusin`?(Mr(),Cr=t,wr=n,Cr.attachEvent(`onpropertychange`,Nr)):e===`focusout`&&Mr()}function Fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Er(wr)}function Ir(e,t){if(e===`click`)return Er(t)}function Lr(e,t){if(e===`input`||e===`change`)return Er(t)}function Rr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var zr=typeof Object.is==`function`?Object.is:Rr;function Br(e,t){if(zr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ne.call(t,i)||!zr(e[i],t[i]))return!1}return!0}function Vr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ur(e,t){var n=Hr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Hr(n)}}function Wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vr(e.document)}return t}function Kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var qr=Tn&&`documentMode`in document&&11>=document.documentMode,Jr=null,Yr=null,Xr=null,Zr=!1;function Qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zr||Jr==null||Jr!==Vr(r)||(r=Jr,`selectionStart`in r&&Kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xr&&Br(Xr,r)||(Xr=r,r=rp(Yr,`onSelect`),0<r.length&&(t=new Ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ei={animationend:$r(`Animation`,`AnimationEnd`),animationiteration:$r(`Animation`,`AnimationIteration`),animationstart:$r(`Animation`,`AnimationStart`),transitionrun:$r(`Transition`,`TransitionRun`),transitionstart:$r(`Transition`,`TransitionStart`),transitioncancel:$r(`Transition`,`TransitionCancel`),transitionend:$r(`Transition`,`TransitionEnd`)},ti={},ni={};Tn&&(ni=document.createElement(`div`).style,`AnimationEvent`in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),`TransitionEvent`in window||delete ei.transitionend.transition);function ri(e){if(ti[e])return ti[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ni)return ti[e]=t[n];return e}var ii=ri(`animationend`),ai=ri(`animationiteration`),oi=ri(`animationstart`),si=ri(`transitionrun`),ci=ri(`transitionstart`),li=ri(`transitioncancel`),ui=ri(`transitionend`),di=new Map,fi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);fi.push(`scrollEnd`);function pi(e,t){di.set(e,t),Rt(t,[e])}var mi=0;function hi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=mi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function gi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function _i(e,t){return e=gi(e),t=gi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var vi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},yi=[],bi=0,xi=0;function Si(){for(var e=bi,t=xi=bi=0;t<e;){var n=yi[t];yi[t++]=null;var r=yi[t];yi[t++]=null;var i=yi[t];yi[t++]=null;var a=yi[t];if(yi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ei(n,i,a)}}function Ci(e,t,n,r){yi[bi++]=e,yi[bi++]=t,yi[bi++]=n,yi[bi++]=r,xi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function wi(e,t,n,r){return Ci(e,t,n,r),Di(e)}function Ti(e,t){return Ci(e,null,null,t),Di(e)}function Ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Xe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Di(e){if(50<Pd)throw Pd=0,Fd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Oi={};function ki(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(e,t,n,r){return new ki(e,t,n,r)}function ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mi(e,t){var n=e.alternate;return n===null?(n=Ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ni(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Pi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ji(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=Ai(31,n,t,a),e.elementType=ie,e.lanes=o,e;case k:return Fi(n.children,a,o,t);case A:s=8,a|=24;break;case j:return e=Ai(12,n,t,a|2),e.elementType=j,e.lanes=o,e;case te:return e=Ai(13,n,t,a),e.elementType=te,e.lanes=o,e;case P:return e=Ai(19,n,t,a),e.elementType=P,e.lanes=o,e;case ae:case se:return e=a|32,e=Ai(30,n,t,e),e.elementType=se,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case ee:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Fi(e,t,n,r){return e=Ai(7,e,r,t),e.lanes=n,e}function Ii(e,t,n){return e=Ai(6,e,null,t),e.lanes=n,e}function Li(e){var t=Ai(18,null,null,0);return t.stateNode=e,t}function Ri(e,t,n){return t=Ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var zi=new WeakMap;function Bi(e,t){if(typeof e==`object`&&e){var n=zi.get(e);return n===void 0?(t={value:e,source:t,stack:Me(t)},zi.set(e,t),t):n}return{value:e,source:t,stack:Me(t)}}var Vi=[],Hi=0,Ui=null,Wi=0,Gi=[],Ki=0,qi=null,Ji=1,Yi=``;function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Ui,Ui=e,Wi=t}function Zi(e,t,n){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,qi=e;var r=Ji;e=Yi;var i=32-Xe(r)-1;r&=~(1<<i),n+=1;var a=32-Xe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ji=1<<32-Xe(t)+i|n<<i|r,Yi=a+e}else Ji=1<<a|n<<i|r,Yi=e}function Qi(e){e.return!==null&&(Xi(e,1),Zi(e,1,0))}function $i(e){for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null;for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Yi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null}function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,Ji=t.id,Yi=t.overflow,qi=e}var ta=null,na=null,B=!1,ra=null,ia=!1,aa=Error(i(519));function oa(e){throw fa(Bi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),aa}function sa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[bt]=e,t[xt]=r,n){case`dialog`:Jf(`cancel`,t),Jf(`close`,t);break;case`iframe`:case`object`:case`embed`:Jf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)Jf(Gf[n],t);break;case`source`:Jf(`error`,t);break;case`img`:case`image`:case`link`:Jf(`error`,t),Jf(`load`,t);break;case`details`:Jf(`toggle`,t);break;case`input`:Jf(`invalid`,t),rn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Jf(`invalid`,t);break;case`textarea`:Jf(`invalid`,t),cn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||lp(t.textContent,n)?(r.popover!=null&&(Jf(`beforetoggle`,t),Jf(`toggle`,t)),r.onScroll!=null&&Jf(`scroll`,t),r.onScrollEnd!=null&&Jf(`scrollend`,t),r.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||oa(e,!0)}function ca(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:ia=!1;return;case 27:case 3:ia=!0;return;default:ta=ta.return}}function la(e){if(e!==ta)return!1;if(!B)return ca(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Cp(e.type,e.memoizedProps)),n=!n),n&&na&&oa(e),ca(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=vm(e)}else t===27?(t=na,Mp(e.type)?(e=_m,_m=null,na=e):na=t):na=ta?gm(e.stateNode.nextSibling):null;return!0}function ua(){na=ta=null,B=!1}function da(){var e=ra;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),ra=null),e}function fa(e){ra===null?ra=[e]:ra.push(e)}var pa=ge(null),ma=null,ha=null;function ga(e,t,n){ve(pa,t._currentValue),t._currentValue=n}function _a(e){e._currentValue=pa.current,_e(pa)}function va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ya(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),va(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),va(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),va(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ba(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;zr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===R.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&ya(t,e,n,r),t.flags|=262144,e!==null}function xa(e){for(e=e.firstContext;e!==null;){if(!zr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sa(e){ma=e,ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ca(e){return Ta(ma,e)}function wa(e,t){return ma===null&&Sa(e),Ta(e,t)}function Ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ha===null){if(e===null)throw Error(i(308));ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ha=ha.next=t;return n}var Ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Da=t.unstable_scheduleCallback,Oa=t.unstable_NormalPriority,ka={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Aa(){return{controller:new Ea,data:new Map,refCount:0}}function ja(e){e.refCount--,e.refCount===0&&Da(Oa,function(){e.controller.abort()})}function Ma(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Na=null;function Pa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Fa=null,Ia=0,La=0,Ra=null;function za(e,t){if(Fa===null){var n=Fa=[];Ia=0,La=Bf(),Ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ia++,t.then(Ba,Ba),t}function Ba(){if(--Ia===0&&(Na=null,Fa!==null)){Ra!==null&&(Ra.status=`fulfilled`);var e=Fa;Fa=null,La=0,Ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ha=I.S;I.S=function(e,t){if(bd=Re(),typeof t==`object`&&t&&typeof t.then==`function`&&za(e,t),Na!==null)for(var n=Ef;n!==null;)Ma(n,Na),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Ma(r,n),r=r.next;if(La!==0){r=Na,r===null&&(r=Na=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ha!==null&&Ha(e,t)};var Ua=ge(null);function Wa(){var e=Ua.current;return e===null?nd.pooledCache:e}function Ga(e,t){t===null?ve(Ua,Ua.current):ve(Ua,t.pool)}function Ka(){var e=Wa();return e===null?null:{parent:ka._currentValue,pool:e}}var qa=Error(i(460)),Ja=Error(i(474)),Ya=Error(i(542)),Xa={then:function(){}};function Za(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(gn,gn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(gn,gn);else{if(e=nd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e}throw eo=t,qa}}function $a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(eo=e,qa):e}}var eo=null;function to(){if(eo===null)throw Error(i(459));var e=eo;return eo=null,e}function no(e){if(e===qa||e===Ya)throw Error(i(483))}var ro=null,io=0;function ao(e){var t=io;return io+=1,ro===null&&(ro=[]),Qa(ro,e,t)}function oo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function so(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function co(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Mi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),oo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===re&&$a(i)===t.type)?(t=a(t,n.props),oo(t,n),t.return=e,t):(t=Pi(n.type,n.key,n.props,null,e.mode,r),oo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ri(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ii(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Pi(t.type,t.key,t.props,null,e.mode,n),oo(n,t),n.return=e,n;case O:return t=Ri(t,e.mode,n),t.return=e,t;case re:return t=$a(t),f(e,t,n)}if(fe(t)||F(t))return t=Fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ao(t),n);if(t.$$typeof===N)return f(e,wa(e,t),n);so(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case re:return n=$a(n),p(e,t,n,r)}if(fe(n)||F(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ao(n),r);if(n.$$typeof===N)return p(e,t,wa(e,n),r);so(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=$a(r),m(e,t,n,r,i)}if(fe(r)||F(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ao(r),i);if(r.$$typeof===N)return m(e,t,n,wa(t,r),i);so(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),B&&Xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return B&&Xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),B&&Xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),B&&Xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return B&&Xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),B&&Xi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),oo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&$a(l)===r.type){n(e,r.sibling),c=a(r,o.props),oo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Fi(o.props.children,e.mode,c,o.key),oo(c,o),c.return=e,e=c):(c=Pi(o.type,o.key,o.props,null,e.mode,c),oo(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ri(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=$a(o),_(e,r,o,c)}if(fe(o))return h(e,r,o,c);if(F(o)){if(l=F(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ao(o),c);if(o.$$typeof===N)return _(e,r,wa(e,o),c);so(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ii(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{io=0;var i=_(e,t,n,r);return ro=null,i}catch(t){if(t===qa||t===Ya)throw t;var a=Ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var lo=co(!0),uo=co(!1),fo=!1;function po(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ho(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function go(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,td&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Di(e),Ei(e,null,n),t}return Ci(e,r,t,n),Di(e)}function _o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pt(e,n)}}function vo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yo=!1;function bo(){if(yo){var e=Ra;if(e!==null)throw e}}function xo(e,t,n,r){yo=!1;var i=e.updateQueue;fo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(rd&f)===f:(r&f)===f){f!==0&&f===La&&(yo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:fo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),dd|=o,e.lanes=o,e.memoizedState=d}}function So(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Co(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)So(n[e],t)}var wo=ge(null),To=ge(0);function Eo(e,t){e=ld,ve(To,e),ve(wo,t),ld=e|t.baseLanes}function Do(){ve(To,ld),ve(wo,wo.current)}function Oo(){ld=To.current,_e(wo),_e(To)}var ko=ge(null),Ao=null;function jo(e){var t=e.alternate;ve(Io,Io.current&1),ve(ko,e),Ao===null&&(t===null||wo.current!==null||t.memoizedState!==null)&&(Ao=e)}function Mo(e){ve(Io,Io.current),ve(ko,e),Ao===null&&(Ao=e)}function No(e){e.tag===22?(ve(Io,Io.current),ve(ko,e),Ao===null&&(Ao=e)):Po()}function Po(){ve(Io,Io.current),ve(ko,ko.current)}function Fo(e){_e(ko),Ao===e&&(Ao=null),_e(Io)}var Io=ge(0);function Lo(e,t){ve(ko,ko.current),ve(Io,t)}function Ro(e){_e(Io),_e(ko),Ao===e&&(Ao=null)}function zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Bo=0,V=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zr(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return Bo=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?hc:gc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){I.H=mc;var t=Vo!==null&&Vo.next!==null;if(Bo=0,Ho=Vo=V=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&xa(e)&&(Nc=!0))}function es(e,t,n,r){V=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=_c,o=t(n,r)}while(Wo);return o}function ts(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(V.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}Bo=0,Ho=Vo=V=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?V.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(Vo===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?V.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?V.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=Qa(Jo,e,t),t=V,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?hc:gc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===ce)return;if(e.$$typeof===N)return Ca(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ss(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=oe;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),Vo,e)}function ps(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Bo&f)===f:(rd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===La&&(d=!0);else if((Bo&p)===p){u=u.next,p===La&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,dd|=p;f=u.action,Go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!zr(o,e.memoizedState)&&(Nc=!0,d&&(n=Ra,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ms(e){var t=os(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);zr(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=V,a=os(),o=B;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!zr((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,nd===null)throw Error(i(349));o||Bo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=ss(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zr(e,n)}catch{return!0}}function bs(e){var t=Ti(e,2);t!==null&&zd(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){Ye(!0);try{n()}finally{Ye(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,Vo,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(dc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};o.types=a===null?null:a.types,I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(B){var n=nd.formState;if(n!==null){a:{var r=V;if(B){if(na){b:{for(var i=na,a=ia;i.nodeType!==8;){if(!a){i=null;break b}if(i=gm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){na=gm(i.nextSibling),r=i.data===`F!`;break a}}oa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,V,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,V,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),Vo,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===qa?Ya:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=Vo;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=ss(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();V.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Zo(r,Vo.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(V.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=ss(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(td&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Bo&1073741824&&!(rd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),V.lanes|=e,dd|=e,n)}function Zs(e,t,n,r){return zr(n,t)?n:wo.current===null?!(Bo&106)||Bo&1073741824&&!(rd&261930)?(Nc=!0,e.memoizedState=n):(e=Ld(),V.lanes|=e,dd|=e,t):(e=Xs(e,n,r),zr(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};s.types=o===null?null:o.types,I.T=s,uc(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Va(c,r),Id(e)):lc(e,t,r,Id(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,pe,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:pe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Id())}function rc(){return Ca(mh)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=ho(n);var r=go(t,e,n);r!==null&&(zd(r,t,n),_o(r,t,n)),t={cache:Aa()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=wi(e,t,n,r),n!==null&&(zd(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Id())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,zr(s,o))return Ci(e,t,i,0),nd===null&&Si(),!1}catch{}if(n=wi(e,t,i,r),n!==null)return zd(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=wi(e,n,r,2),t!==null&&zd(t,e,2)}function dc(e){var t=e.alternate;return e===V||t!==null&&t===V}function fc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pt(e,n)}}var mc={readContext:Ca,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},hc={readContext:Ca,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Ca,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){Ye(!0);try{n(t)}finally{Ye(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=sc.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,V,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=as();if(B){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),nd===null)throw Error(i(349));rd&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=nd.identifierPrefix;if(B){var n=Yi,r=Ji;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,V)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if(td&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Ca,use:ls,useCallback:Js,useContext:Ca,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Ca,use:ls,useCallback:Js,useContext:Ca,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return Vo===null?Xs(n,e,t):Zs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=ho(r);i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(zd(t,e,r),_o(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=ho(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(zd(t,e,r),_o(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=ho(n);r.tag=2,t!=null&&(r.callback=t),t=go(e,r,n),t!==null&&(zd(t,e,n),_o(t,e,n))}};function bc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Br(n,r)||!Br(i,a):!0}function xc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yc.enqueueReplaceState(t,t.state,null)}function Sc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){vi(e)}function wc(e){console.error(e)}function Tc(e){vi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){return n=ho(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=ho(e),e.tag=3,e}function Ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ba(t,n,a,!0),n=ko.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ao===null?Zd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===Xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(B)return t=ko.current,t===null?(r!==aa&&(t=Error(i(423),{cause:r}),fa(Bi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Bi(r,n),a=Oc(e.stateNode,r,a),vo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==aa&&(e=Error(i(422),{cause:r}),fa(Bi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Bi(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),vo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),vo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?uo(t,null,n,r):lo(t,e.child,n,r)}function Fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Sa(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(B&&s&&Qi(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ji(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Br:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Mi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Br(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ga(t,a===null?null:a.cachePool),a===null?Do():Eo(t,a),No(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ga(t,null),Do(),Po()):(Ga(t,a.cachePool),Eo(t,a),Po(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Wa();return a=a===null?null:{parent:ka._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ga(t,null),Do(),No(t),e!==null&&ba(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return lo(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Fo(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(Mo(t),(e=na)?(e=fm(e,ia),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Mo(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||ba(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(wo.current===null){if(r=nd,r!==null&&(s=mt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ti(e,s),zd(r,e,s),Mc;Zd()}t=Hc(e,t,n)}else e=o.treeContext,na=gm(s.nextSibling),ta=t,B=!0,ra=null,ia=!1,e!==null&&ea(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Gc(e,t,n,r,i){return Sa(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(B&&r&&Qi(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return Sa(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!Nc?(rs(e,t,a),ll(e,t,a)):(B&&r&&Qi(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(Sa(t),t.stateNode===null){var a=Oi,o=n.contextType;typeof o==`object`&&o&&(a=Ca(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},po(t),o=n.contextType,a.context=typeof o==`object`&&o?Ca(o):Oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&yc.enqueueReplaceState(a,a.state,null),xo(t,r,a,i),bo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Oi,typeof u==`object`&&u&&(o=Ca(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&xc(t,a,r,o),fo=!1;var f=t.memoizedState;a.state=f,xo(t,r,a,i),bo(),l=t.memoizedState,s||f!==l||fo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=fo||bc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mo(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Oi,typeof l==`object`&&l&&(c=Ca(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&xc(t,a,r,c),fo=!1,f=t.memoizedState,a.state=f,xo(t,r,a,i),bo();var p=t.memoizedState;o!==d||f!==p||fo||e!==null&&e.dependencies!==null&&xa(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=fo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&xa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=lo(t,e.child,null,i),t.child=lo(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return ua(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ka()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Io.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?jo(t):Po(),(e=na)?(e=fm(e,ia),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw oa(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Po(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Fi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(jo(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Po(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Mi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Fi(i,a,n,null),i.flags|=2):i=Mi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ka():(s=ka._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(jo(t),n=e.child,e=n.sibling,n=Mi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Ai(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return lo(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(jo(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Po(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Fi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,lo(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(Po(),t.child=e.child,t.flags|=128,null);if(jo(t),mm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,fa({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||ba(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(wo.current!==null)return tl(e,t,c);if(r=nd,r!==null&&(a=mt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ti(e,a),zd(r,e,a),Mc;return pm(o)||Zd(),tl(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,na=gm(o.nextSibling),ta=t,B=!0,ra=null,ia=!1,e!==null&&ea(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),va(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&zo(n)===null&&(t=e),e=e.sibling}return t}function al(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Io.current;if(t.flags&128)return Lo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Lo(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=B?Wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ga(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ba(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&xa(e)))}function dl(e,t,n){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),ga(t,ka,e.memoizedState.cache),ua();break;case 27:case 5:we(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return jo(t),t.flags|=128,null;r=ba(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(jo(t),e=ll(e,t,n),e===null?null:e.sibling)}jo(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ba(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lo(t,Io.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:ga(t,ka,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,B&&t.flags&1048576&&Zi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=$a(t.elementType),t.type=e,typeof e==`function`)ji(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ee){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=de(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,mo(e,t),xo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ga(t,ka,r),r!==o.cache&&ya(t,[ka],n,!0),bo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Jc(e,t,r,n);break a}if(r!==a){a=Bi(Error(i(424)),t),fa(a),t=Jc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(na=gm(e.firstChild),ta=t,B=!0,ra=null,ia=!0,n=uo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ua(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=Sp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return we(t),e===null&&B&&(r=t.stateNode=Sm(t.type,t.pendingProps,xe.current),ta=t,ia=!0,a=na,Mp(t.type)?(_m=a,na=gm(r.firstChild)):na=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((a=r=na)&&(r=um(r,t.type,t.pendingProps,ia),r===null?a=!1:(t.stateNode=r,ta=t,na=gm(r.firstChild),ia=!1,a=!0)),a||oa(t)),we(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Cp(a,o)?r=null:s!==null&&Cp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),mh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=na)&&(n=dm(n,t.pendingProps,ia),n===null?e=!1:(t.stateNode=n,ta=t,na=null,e=!0)),e||oa(t)),null;case 13:return Qc(e,t,n);case 4:return Se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lo(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Sa(t),a=Ca(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return Sa(t),r=Ca(ka),e===null?(a=Wa(),a===null&&(a=nd,o=Aa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},po(t),ga(t,ka,a)):((e.lanes&n)!==0&&(mo(e,t),xo(t,null,null,n),bo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ga(t,ka,r),r!==a.cache&&ya(t,[ka],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ga(t,ka,r))),Pc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:B&&Qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Jd())e.flags|=8192;else throw eo=Xa,Ja}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(Jd())e.flags|=8192;else throw eo=Xa,Ja}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ct(),e.lanes|=t,hd|=t)}function _l(e,t){if(!B)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function vl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function yl(e,t,n){var r=t.pendingProps;switch($i(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),_a(ka),Ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(la(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,da())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(Te(t),n=xe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=ye.current,la(t)?sa(t,e):(e=Sm(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Te(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=ye.current,la(t))sa(t,o);else{var s=yp(xe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[bt]=t,o[xt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(fp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=xe.current,la(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ta,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||oa(t,!0)}else e=yp(e).createTextNode(r),e[bt]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=la(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[bt]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Fo(t),t):(Fo(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=la(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[bt]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Fo(t),t):(Fo(t),null)}return Fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gl(t,t.updateQueue),vl(t),null);case 4:return Ce(),e===null&&Zf(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return _a(t.type),vl(t),null;case 19:if(Ro(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zo(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ni(n,e),n=n.sibling;return Lo(t,Io.current&1|2),B&&Xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Re()>xd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=zo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!B)return vl(t),null}else 2*Re()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Re(),e.sibling=null,o=Io.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?Lo(t,o):(n=o,ve(ko,t),ve(Io,n),Ao===null&&(Ao=t)),B&&Xi(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Fo(t),Oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&_e(Ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_a(ka),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch($i(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _a(ka),Ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if(Fo(t),t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ro(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ce(),null;case 10:return _a(t.type),null;case 22:case 23:return Fo(t),Oo(),e!==null&&_e(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _a(ka),null;case 25:return null;default:return null}}function xl(e,t){switch($i(t),t.tag){case 3:_a(ka),Ce();break;case 26:case 27:case 5:Te(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&Fo(t);break;case 13:Fo(t);break;case 19:Ro(t);break;case 10:_a(t.type);break;case 22:case 23:Fo(t),Oo(),e!==null&&_e(Ua);break;case 24:_a(ka)}}function Sl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){yf(t,t.return,e)}}function Cl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Co(t,n)}catch(t){yf(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=hi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Up(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Wp(e);p(e.child,!1,om,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){yf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){yf(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)K(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&K(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&cm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){yf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[xt]=t}catch(t){yf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mp(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Mp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gn)),Ol(e,r),Wt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Mp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),Wt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Mp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[bt]=e,t[xt]=n}catch(t){yf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Rp(o);r.push(s),s.view&&(a=!0)}else a||Rp(o).view&&(a=!0);Bl=!0,Fp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Ip(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=_i(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=hi(r,n),a=_i(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Rd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=_i(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=_i(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Rd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode);t=_i(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Rp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Fp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=hi(n,r),a=_i(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(zp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,ou=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,_p=Ch,e=Gr(e),Kr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(vp={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&$l(e),gu(n))}}Vl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=hi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=_i(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Iu(e,n),r&4&&Sl(5,n);break;case 1:if(Iu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Iu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Co(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Iu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Iu(e,n);break;case 31:Iu(e,n),r&4&&H(e,n);break;case 13:Iu(e,n),r&4&&Eu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||ou;t=au,i=ou,au=r,(ou=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ru(e,n,r)):Iu(e,n),au=t,ou=i}break;case 30:Iu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Iu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){yf(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Wt=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Pp(s,!0):Pp(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(Je&&typeof Je.onCommitFiberUnmount==`function`)try{Je.onCommitFiberUnmount(qe,n)}catch{}switch(n.tag){case 26:ou||Dl(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ou&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ou||Dl(n,t),Al(n);var r=Su,i=Cu;Mp(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:ou||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),Wt=!0}catch(e){yf(n,t,e)}else try{Su.removeChild(n.stateNode),Wt=!0}catch(e){yf(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Np(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Yh(e)):Np(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),ou||Cl(4,n,t),wu(e,t,n);break;case 1:ou||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:ou=(r=ou)||n.memoizedState!==null,wu(e,t,n),ou=r;break;case 30:Dl(n,t),wu(e,t,n);break;case 7:ou||Dl(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function H(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yh(e)}catch(e){yf(t,t.return,e)}}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yh(e)}catch(e){yf(t,t.return,e)}}function Du(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function Ou(e,t){var n=Du(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function ku(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Mp(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(i(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ju(t,e,n),t=t.sibling}var Au=null;function ju(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ku(t,e,n),Mu(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:ku(t,e,n),Mu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Au,ku(t,e,n),Mu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=Sp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Dt]||r[bt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[bt]=e,Pt(r),t=r;break a;case`link`:if(o=Qm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Qm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[bt]=e,Pt(r),t=r}e.stateNode=t}}else au||$m(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ou||t.parentNode.removeChild(t)):a.count--,n===null?au||$m(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:ku(t,e,n),Mu(e),a&512&&(ou||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,ku(t,e,n),su=o,Mu(e),a&512&&(ou||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{ln(t,``),Wt=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(ku(t,e,n),Mu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Wt=!0}catch(t){yf(e,e.return,t)}}break;case 3:if(Wt=!1,Zm=null,o=Au,Au=Dm(t.containerInfo),ku(t,e,n),Au=o,Mu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Yh(t.containerInfo)}catch(t){yf(e,e.return,t)}cu&&(cu=!1,Nu(e)),Wt=!1;break;case 4:a=su,su=au,r=Gt(),o=Au,Au=Dm(e.stateNode.containerInfo),ku(t,e,n),Mu(e),Au=o,Wt&&fu&&(pu=!0),Wt=r,su=a;break;case 12:ku(t,e,n),Mu(e);break;case 31:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 13:ku(t,e,n),Mu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Re()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=ou,u=su;au=c||o,su=u||o,ou=l||s,ku(t,e,n),ou=l,su=u,au=c,Mu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||ou||(t=s||ou,n=au,r=ou,au=o||au,ou=t,Lu(e,2),au=n,ou=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ou(e,n))));break;case 19:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 30:a&512&&(ou||r===null||Dl(r,r.return)),a=Gt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&_i(c.default,c.update)!==`none`,ku(t,e,n),Mu(e),s&&r!==null&&Wt&&(e.flags|=4),fu=o,Wt=a;break;case 21:break;case 7:a&512&&(ou||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ku(t,e,n),Mu(e)}}function Mu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(ln(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Pu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Fu(t,e),t=t.sibling;else iu(t,!1)}function Fu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Wl(),Pu(t,e),!du&&!pu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ip(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Ul=null;break;case 5:Pu(t,e);break;case 4:r=du,du=!1,Pu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Pu(t,e):Xl(e,!1));break;case 30:r=du,i=Wl(),du=!1,Pu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=hi(a,o),o=hi(n.memoizedProps,o);var s=_i(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),du=e.flags&32?!0:r;break;default:Pu(t,e)}}function Iu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Lu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Lu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Lu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Lu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ou||i.parentNode.removeChild(i),Lu(n,r);break;case 22:n.memoizedState===null&&Lu(n,r);break;case 30:Dl(n,n.return),Lu(n,r);break;case 7:Dl(n,n.return);default:Lu(n,r)}e=e.sibling}}function Ru(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Ru(i,a,n),Sl(4,a);break;case 1:if(Ru(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)So(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||$m(Dm(c.ownerDocument),a.type,c),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Ru(i,a,n);break;case 31:Ru(i,a,n),s&&o&4&&H(i,a);break;case 13:Ru(i,a,n),s&&o&4&&Eu(i,a);break;case 22:a.memoizedState===null&&Ru(i,a,n),El(a,a.return);break;case 30:Ru(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Ru(i,a,n)}t=t.sibling}}function zu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ja(n))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ja(e))}function Vu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Hu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Hu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Vu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Vu(e,t,n,r);break;case 3:Vu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ja(a)));break;case 12:if(a&2048){Vu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){yf(t,t.return,e)}}else Vu(e,t,n,r);break;case 31:Vu(e,t,n,r);break;case 13:Vu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Vu(e,t,n,r):(o._visibility|=2,Uu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Vu(e,t,n,r):Wu(e,t)),a&2048&&zu(s,t);break;case 24:Vu(e,t,n,r),a&2048&&Bu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Vu(e,t,n,r);break;default:Vu(e,t,n,r)}}function Uu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Uu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Uu(a,o,s,c,i)):u._visibility&2?Uu(a,o,s,c,i):Wu(a,o),i&&l&2048&&zu(o.alternate,o);break;case 24:Uu(a,o,s,c,i),i&&l&2048&&Bu(o.alternate,o);break;default:Uu(a,o,s,c,i)}t=t.sibling}}function Wu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Wu(n,r),i&2048&&zu(r.alternate,r);break;case 24:Wu(n,r),i&2048&&Bu(r.alternate,r);break;default:Wu(n,r)}t=t.sibling}}var Gu=8192;function Ku(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:Ku(e,t,n),e.flags&Gu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,Au,e.memoizedState,e.memoizedProps));break;case 5:Ku(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=Au;Au=Dm(e.stateNode.containerInfo),Ku(e,t,n),Au=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,Ku(e,t,n),Gu=r):Ku(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Ku(e,t,n);break;default:Ku(e,t,n)}}function Ju(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:Cl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ja(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var $u={getCacheForType:function(e){var t=Ca(ka),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ca(ka).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,td=0,nd=null,U=null,rd=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return td&2&&rd!==0?rd&-rd:I.T===null?_t():Bf()}function Ld(){if(md===0){if(!(rd&536870912)||B){var e=tt;tt<<=1,!(tt&3932160)&&(tt=262144),md=e}else md=536870912}return e=ko.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Up(hi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===nd&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,rd,md,!1)),ut(e,n),(!(td&2)||e!==nd)&&(e===nd&&(!(td&2)&&(fd|=n),ud===4&&Ud(e,rd,md,!1)),Mf(e))}function Bd(e,t,n){if(td&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||at(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=Qd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-Re(),10<a)){if(Ud(r,t,md,!od),it(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=Ep(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);Mf(e)}function Vd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gn},Vl=null,qu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-Re():(a&4194048)===a?bd-Re():0,m=sh(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!zr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ud(e,t,n,r){t=ot(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Xe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ft(e,n,t)}function Wd(){return td&6?!0:(Nf(0,!1),!1)}function Gd(){if(U!==null){if(id===0)var e=U.return;else e=U,ha=ma=null,is(e),ro=null,io=0,e=U;for(;e!==null;)xl(e.alternate,e),e=e.return;U=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),nd=e,U=n=Mi(e.current,null),rd=t,id=0,ad=null,od=!1,sd=at(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=ot(e,t),Si(),n}function qd(e,t){V=null,I.H=mc,t===qa||t===Ya?(t=to(),id=3):t===Ja?(t=to(),id=4):id=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,U===null&&(ud=1,Ec(e,Bi(t,e.current)))}function Jd(){var e=ko.current;return e===null?!0:(rd&4194048)===rd?Ao===null:(rd&62914560)===rd||rd&536870912?e===Ao:!1}function Yd(){var e=I.H;return I.H=mc,e===null?mc:e}function Xd(){var e=I.A;return I.A=$u,e}function Zd(){ud=4,od||(rd&4194048)!==rd&&ko.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||nd===null||Ud(nd,rd,md,!1)}function Qd(e,t,n){var r=td;td|=2;var i=Yd(),a=Xd();(nd!==e||rd!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&U!==null){var s=U,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:ko.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,ha=ma=null,td=r,I.H=i,I.A=a,U===null&&(nd=null,rd=0,Si()),o}function $d(){for(;U!==null;)nf(U)}function ef(e,t){var n=td;td|=2;var r=Yd(),a=Xd();nd!==e||rd!==t?(Sd=null,xd=Re()+500,Kd(e,t)):sd=at(e,t);a:do try{if(id!==0&&U!==null){t=U;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if(Za(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||nd!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:Za(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(U.tag){case 26:s=U.memoizedState;case 5:case 27:var c=U;if(s?nh(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)U=l;else{var u=c.return;u===null?U=null:(U=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return ha=ma=null,I.H=r,I.A=a,td=n,U===null?(nd=null,rd=0,Si(),ud):0}function tf(){for(;U!==null&&!Ie();)nf(U)}function nf(e){var t=fl(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):U=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,rd);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,rd);break;case 5:is(t);var r=t;r===ta&&(B?(ca(r),r.tag===5&&r.stateNode!=null&&(na=r.stateNode)):(ca(r),B=!0));default:xl(n,t),t=U=Ni(t,ld),t=fl(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):U=t}function af(e,t,n,r){ha=ma=null,is(t),ro=null,io=0;var i=t.return;try{if(jc(e,i,t,n,rd)){ud=1,Ec(e,Bi(n,e.current)),U=null;return}}catch(t){if(i!==null)throw U=i,t;ud=1,Ec(e,Bi(n,e.current)),U=null;return}t.flags&32768?(B||r===1?e=!0:sd||rd&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=ko.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=yl(t.alternate,t,ld);if(n!==null){U=n;return}if(t=t.sibling,t!==null){U=t;return}U=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,U=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){U=e;return}U=e=n}while(e!==null);ud=6,U=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(td&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===nd&&(U=nd=null,rd=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=xi,dt(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Pa(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(He,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,i=L.p,L.p=2,a=td,td|=4;try{hu(e,t,n)}finally{td=a,L.p=i,I.T=r}}wd=1,Bl?jd=W(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Fu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=I.T,I.T=null;var i=L.p;L.p=2;var a=td;td|=4;try{fu=pu=!1,ju(t,e,n),n=vp;var o=Gr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Wr(s.ownerDocument.documentElement,s)){if(c!==null&&Kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Ur(s,h),v=Ur(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ch=!!_p,vp=_p=null}finally{td=a,L.p=i,I.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=td;td|=4;try{_u(e,t.alternate,t)}finally{td=i,L.p=r,I.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Le();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),gt(r),n=n.stateNode,Je&&typeof Je.onCommitFiberRoot==`function`)try{Je.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=I.T,a=L.p,L.p=2,I.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{I.T=n,L.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ja(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=gt(Dd),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,td&6)throw Error(i(331));var c=td;if(td|=4,Xu(o.current),Hu(o,o.current,s,n),td=c,Nf(0,!1),Je&&typeof Je.onPostCommitFiberRoot==`function`)try{Je.onPostCommitFiberRoot(qe,o)}catch{}return!0}finally{L.p=a,I.T=r,hf(e,t)}}function vf(e,t,n){t=Bi(n,t),t=Oc(e.stateNode,t,2),e=go(e,t,2),e!==null&&(ut(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Bi(n,e),n=kc(2),r=go(t,n,2),r!==null&&(Ac(n,r,t,e),ut(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,nd===e&&(rd&n)===n&&(ud===4||ud===3&&(rd&62914560)===rd&&300>Re()-yd?td&2?pd|=n:Kd(e,0):pd|=n,hd===rd&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=ct()),e=Ti(e,t),e!==null&&(ut(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Pe(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Xe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=rd,a=it(r,r===nd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||at(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Tp()&&(e=jf);for(var t=Re(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Xe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=st(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=nd,n=rd,n=it(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Fe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||at(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Fe(r),gt(n)){case 2:case 8:n=Ve;break;case 32:n=He;break;case 268435456:n=We;break;default:n=He}return r=Lf.bind(null,e),n=Pe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Fe(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=rd;return r=it(e,e===nd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Re()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Ap(function(){td&6?Pe(Be,Pf):Ff()})}function Bf(){if(jf===0){var e=La;e===0&&(e=et,et<<=1,!(et&261888)&&(et=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:z(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[xt]||null).action),o=r.submitter;o&&(t=(t=o[xt]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<fi.length;Uf++){var Wf=fi[Uf];pi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}pi(ii,`onAnimationEnd`),pi(ai,`onAnimationIteration`),pi(oi,`onAnimationStart`),pi(`dblclick`,`onDoubleClick`),pi(`focusin`,`onFocus`),pi(`focusout`,`onBlur`),pi(si,`onTransitionRun`),pi(ci,`onTransitionStart`),pi(li,`onTransitionCancel`),pi(ui,`onTransitionEnd`),zt(`onMouseEnter`,[`mouseout`,`mouseover`]),zt(`onMouseLeave`,[`mouseout`,`mouseover`]),zt(`onPointerEnter`,[`pointerout`,`pointerover`]),zt(`onPointerLeave`,[`pointerout`,`pointerover`]),Rt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Rt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Rt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Rt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}}}}function Jf(e,t){var n=t[Ct];n===void 0&&(n=t[Ct]=new Set);var r=e+`__bubble`;n.has(r)||(Qf(t,e,2,!1),n.add(r))}function Yf(e,t,n){var r=0;t&&(r|=4),Qf(n,e,r,t)}var Xf=`_reactListening`+Math.random().toString(36).slice(2);function Zf(e){if(!e[Xf]){e[Xf]=!0,It.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Yf(t,!1,e),Yf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xf]||(t[Xf]=!0,Yf(`selectionchange`,!1,t))}}function Qf(e,t,n,r){switch(Ah(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!En||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function $f(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=At(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}Cn(function(){var r=a,i=vn(n),o=[];a:{var c=di.get(e);if(c!==void 0){var l=Ln,u=e;switch(e){case`keypress`:if(Mn(n)===0)break a;case`keydown`:case`keyup`:l=tr;break;case`focusin`:u=`focus`,l=Kn;break;case`focusout`:u=`blur`,l=Kn;break;case`beforeblur`:case`afterblur`:l=Kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ir;break;case ii:case ai:case oi:l=qn;break;case ui:l=ar;break;case`scroll`:case`scrollend`:l=zn;break;case`wheel`:l=or;break;case`copy`:case`cut`:case`paste`:l=Jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=nr;break;case`submit`:l=rr;break;case`toggle`:case`beforetoggle`:l=sr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=wn(m,p),g!=null&&d.push(tp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==_n&&(u=n.relatedTarget||n.fromElement)&&(At(u)||u[St]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?At(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=nr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Mt(c),h=l==null?u:Mt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,At(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,ip):null,c!==null&&ap(o,u,c,d,!1),l!==null&&f!==null&&ap(o,f,l,d,!0)))}a:{if(c=r?Mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Dr;else if(xr(c)){if(Or)_=Lr;else{_=Fr;var v=Pr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&pn(r.elementType)&&(_=Dr):_=Ir;if(_&&=_(e,r)){Sr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Mt(r):window,e){case`focusin`:(xr(v)||v.contentEditable===`true`)&&(Jr=v,Yr=r,Xr=null);break;case`focusout`:Xr=Yr=Jr=null;break;case`mousedown`:Zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Zr=!1,Qr(o,n,i);break;case`selectionchange`:if(qr)break;case`keydown`:case`keyup`:Qr(o,n,i)}var y;if(lr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else _r?hr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(fr&&n.locale!==`ko`&&(_r||b!==`onCompositionStart`?b===`onCompositionEnd`&&_r&&(y=jn()):(On=i,kn=`value`in On?On.value:On.textContent,_r=!0)),v=rp(r,b),0<v.length&&(b=new Yn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=gr(n),y!==null&&(b.data=y)))),(y=dr?vr(e,n):yr(e,n))&&(b=rp(r,`onBeforeInput`),0<b.length&&(v=new Yn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Hf(o,e,r,n,i)}qf(o,t)})}function tp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=wn(e,n),i!=null&&r.unshift(tp(e,i,a)),i=wn(e,t),i!=null&&r.push(tp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ip(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ap(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=wn(n,a),l!=null&&o.unshift(tp(n,l,c))):i||(l=wn(n,a),l!=null&&o.push(tp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var op=/\r\n?/g,sp=/\u0000|\uFFFD/g;function cp(e){return(typeof e==`string`?e:``+e).replace(op,`
19
- `).replace(sp,``)}function lp(e,t){return t=cp(t),cp(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||ln(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&ln(e,``+r);else return;break;case`className`:qt(e,`class`,r);break;case`tabIndex`:qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:qt(e,n,r);break;case`style`:fn(e,r,o);return;case`data`:if(t!==`object`){qt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=z(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=z(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=gn);return;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=z(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Kt(e,`popover`,r);break;case`xlinkActuate`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Kt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=mn.get(n)||n,Kt(e,n,r);else return}Wt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:fn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)ln(e,r);else if(typeof r==`number`||typeof r==`bigint`)ln(e,``+r);else return;break;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=gn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Lt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[xt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Wt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Kt(e,n,r)}return}Wt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:Jf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:up(e,t,r,d,n,null)}}rn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&on(e,!!r,n,!0):on(e,!!r,t,!1);return;case`textarea`:for(s in Jf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:up(e,t,s,c,n,null)}cn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:up(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,u,r,n,null)}return;default:if(pn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||up(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Wt=!0),o=m;break;case`name`:m!==f&&(Wt=!0),a=m;break;case`checked`:m!==f&&(Wt=!0),u=m;break;case`defaultChecked`:m!==f&&(Wt=!0),d=m;break;case`value`:m!==f&&(Wt=!0),s=m;break;case`defaultValue`:m!==f&&(Wt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}nn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||up(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Wt=!0),p=o;break;case`defaultValue`:o!==l&&(Wt=!0),c=o;break;case`multiple`:o!==l&&(Wt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?on(e,!!n,n?[]:``,!1):on(e,!!n,t,!0)):on(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:up(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Wt=!0),p=a;break;case`defaultValue`:a!==o&&(Wt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}sn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:up(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Wt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&up(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:up(e,t,u,p,r,m)}return;default:if(pn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&hp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&hp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function bp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function xp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Sp(e,t,n,r){return n=yp(n).createElement(e),n[bt]=r,n[xt]=t,fp(n,e,t),Pt(n),n}function Cp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function Pp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Fp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ip(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Lp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Rp(e){return Lp(e.getBoundingClientRect(),getComputedStyle(e),e)}function zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Lp(t,n,e)}function Bp(e){return e.documentElement.clientHeight}function Vp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function W(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Bp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(Vp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Hp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Hp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Hp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Up(e){return{name:e,group:new Hp(`group`,e),imagePair:new Hp(`image-pair`,e),old:new Hp(`old`,e),new:new Hp(`new`,e)}}function Wp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Wp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(G(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=qp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Gp,e,s,r)}this._eventListeners=a}};function Gp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Wp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=G(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=qp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Kp,e,n,i),r.splice(t,1),a!==null&&a()}};function Kp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function qp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Jp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function G(e,t,n,r){if(e.length===0)return-1;r=Jp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Jp(a.optionsOrUseCapture)===r)return i}return-1}Wp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Wp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=v(e),bm(e,t))}Wp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Wp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=yp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Wp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Wp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,xm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Wp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Wp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Wp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(e,t,n,r,i){var a=At(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function am(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Wp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Xp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),am(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),am(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=v(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function K(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lm(n),kt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Dt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function xm(e){kp(function(){kp(function(t){return e(t)})})}function Sm(e,t,n){switch(t=yp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===gn&&(e.onclick=null),kt(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var Tm=new Map,Em=new Set;function Dm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Om=L.d;L.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Wd();return e||t}function Am(e){var t=jt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=tn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Pt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+tn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+tn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+tn(n.imageSizes)+`"]`)):i+=`[href="`+tn(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Ot]=!0,o.onload=o.onerror=function(){Ft(o)}),Pt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+tn(r)+`"][href="`+tn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Pt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=Nt(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);Pt(c),fp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=Nt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=T({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Pt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=Nt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Pt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=xe.current)?Dm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Vm(n.href),t=Nt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vm(n.href);var o=Nt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tm.set(e,o)),Wm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Gm(n),t=Nt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vm(e){return`href="`+tn(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ot]){r.loading=1;return}}else t=e.createElement(`link`),t[Ot]=!0,t.onload=t.onerror=Ft.bind(null,t),fp(t,`link`,n),Pt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Gm(e){return`[src="`+tn(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+tn(n.href)+`"]`);if(r)return t.instance=r,Pt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Pt(r),fp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,Pt(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),Pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,Pt(a),a):(r=n,(a=Tm.get(o))&&(r=T({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Pt(a),fp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jm(r,n.precedence,e));return t.instance}function Jm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=new Map,i=Zm=new Map;i.set(n,r)}else i=Zm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Dt]||a[bt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vm(r.href),a=t.querySelector(Hm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Pt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),Pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:N,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ai(3,null,null,t),e.current=a,a.stateNode=e,t=Aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},po(a),e}function _h(e){return e?(e=Oi,e):Oi}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=ho(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=go(e,r,t),n!==null&&(zd(n,e,t),_o(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Ti(e,67108864);t!==null&&zd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Id();t=ht(t);var n=Ti(e,t);n!==null&&zd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,Eh(e,t,n,r)}finally{L.p=a,I.T=i}}function Th(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,Eh(e,t,n,r)}finally{L.p=a,I.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)$f(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=jt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=rt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Xe(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(td&6)&&(xd=Re()+500,Nf(0,!1))}}break;case 31:case 13:s=Ti(a,2),s!==null&&zd(s,a,2),Wd(),bh(a,2)}if(a=Dh(r),a===null&&$f(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(e,t,r,null,n)}}function Dh(e){return e=vn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=At(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ze()){case Be:return 2;case Ve:return 8;case He:case Ue:return 32;case We:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=jt(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=At(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,vt(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,vt(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_n=r,n.target.dispatchEvent(r),_n=null}else return t=jt(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=jt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[xt]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[xt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Id(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Wd(),t[St]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=_t();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.0`)throw Error(i(527,$h,`19.3.0`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{qe=tg.inject(eg),Je=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[St]=t.current,Zf(e),new Zh(t)}})),ip=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=rp()}))(),ap=[{kind:`question`,label:`Question waiting`,help:`An agent needs your answer.`},{kind:`attention`,label:`Needs a look`,help:`A background session asks something, or work is ready for review.`},{kind:`done`,label:`Task finished`,help:`A task completes.`},{kind:`error`,label:`Something failed`,help:`An error, or a task is blocked or dropped.`},{kind:`sent`,label:`Message sent`,help:`Your message leaves the composer.`}],op={question:`/sounds/question.mp3`,attention:`/sounds/attention.mp3`,done:`/sounds/done.mp3`,error:`/sounds/error.mp3`,sent:`/sounds/sent.mp3`},sp=`bot-lobby.prompt-sound-muted`,cp=`bot-lobby.sound-volume`,lp=`bot-lobby.sounds-off`,up=60,dp=new Set,fp={},pp,mp=new Map;function hp(e){try{return localStorage.getItem(e)}catch{return fp[e]??null}}function gp(e,t){fp[e]=t;try{localStorage.setItem(e,t)}catch{}for(let e of[...dp])e()}function _p(e){return dp.add(e),()=>{dp.delete(e)}}function vp(){return hp(sp)===`on`}function yp(e){gp(sp,e?`on`:`off`)}function bp(){return(0,m.useSyncExternalStore)(_p,vp,()=>!1)}function xp(){let e=Number(hp(cp));return hp(cp)!==null&&Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):up}function Sp(e){gp(cp,String(Math.min(100,Math.max(0,Math.round(e)))))}function Cp(){return(0,m.useSyncExternalStore)(_p,xp,()=>up)}function wp(){return hp(lp)??``}function Tp(e){return!wp().split(`,`).includes(e)}function Ep(e,t){let n=new Set(wp().split(`,`).filter(Boolean));t?n.delete(e):n.add(e),gp(lp,[...n].join(`,`))}function Dp(){return(0,m.useSyncExternalStore)(_p,wp,()=>``)}function Op(){try{pp??=new AudioContext,pp.resume().catch(()=>void 0);for(let{kind:e}of ap)Ap(pp,e)}catch{}}function kp(){(0,m.useEffect)(()=>(window.addEventListener(`pointerdown`,Op),window.addEventListener(`keydown`,Op),()=>{window.removeEventListener(`pointerdown`,Op),window.removeEventListener(`keydown`,Op)}),[])}function Ap(e,t){let n=mp.get(t);return n||(n=(async()=>{if(typeof e.decodeAudioData!=`function`)return;let n=await fetch(op[t]);if(n.ok)return await e.decodeAudioData(await n.arrayBuffer())})().catch(()=>void 0),mp.set(t,n)),n}function jp(e,t){let n=e.currentTime,r=e.createOscillator(),i=e.createGain();r.frequency.setValueAtTime(960,n),r.frequency.exponentialRampToValueAtTime(360,n+.16),i.gain.setValueAtTime(1e-4,n),i.gain.exponentialRampToValueAtTime(Math.max(2e-4,.2*t),n+.012),i.gain.exponentialRampToValueAtTime(1e-4,n+.22),r.connect(i),i.connect(e.destination),r.start(n),r.stop(n+.24),r.onended=()=>{r.disconnect(),i.disconnect()}}async function Mp(e,t,n){let r=await Ap(e,t);if(!r)return jp(e,n);let i=e.createBufferSource(),a=e.createGain();i.buffer=r,a.gain.value=n,i.connect(a),a.connect(e.destination),i.start(),i.onended=()=>{i.disconnect(),a.disconnect()}}function Np(e,t={}){if(!t.preview&&(vp()||!Tp(e)))return;t.preview&&Op();let n=pp;if(!n||n.state!==`running`&&!t.preview)return;let r=xp()/100;r<=0||Mp(n,e,r).catch(()=>void 0)}var Pp={info:3600,success:3e3,warning:5e3,error:6e3},Fp,Ip=[],Lp=0,Rp=new Set;function zp(){for(let e of[...Rp])e()}function Bp(e,t,n){let r=t.trim();if(!r)return;let i=Fp?.message===r?Fp:Ip.find(e=>e.message===r);if(i){if(n?.action&&!i.action){let e={...i,action:n.action};i===Fp?Fp=e:Ip=Ip.map(t=>t===i?e:t),zp()}return}let a={id:++Lp,kind:e,message:r,duration:n?.duration??Pp[e],...n?.action?{action:n.action}:{}};e===`error`&&Np(`error`),Fp?Ip=[...Ip,a].slice(-3):Fp=a,zp()}function Vp(e){Fp?.id===e&&(Fp=Ip[0],Ip=Ip.slice(1),zp())}var W=Object.assign((e,t)=>Bp(`info`,e,t),{success:(e,t)=>Bp(`success`,e,t),error:(e,t)=>Bp(`error`,e,t),warning:(e,t)=>Bp(`warning`,e,t),info:(e,t)=>Bp(`info`,e,t)});function Hp(e){return Rp.add(e),()=>{Rp.delete(e)}}function Up(){return{item:(0,m.useSyncExternalStore)(Hp,()=>Fp,()=>void 0),waiting:(0,m.useSyncExternalStore)(Hp,()=>Ip.length,()=>0)}}var Wp=0,Gp=new Set;function Kp(){Wp+=1;for(let e of[...Gp])e();let e=!1;return()=>{if(!e){e=!0,--Wp;for(let e of[...Gp])e()}}}function qp(){return(0,m.useSyncExternalStore)(e=>(Gp.add(e),()=>{Gp.delete(e)}),()=>Wp>0,()=>!1)}function Jp(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function G(e,t,n={}){try{let r=await R(e,t),i=r.notice;return i&&W(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){W.error(Jp(e));return}}var Yp=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Xp(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Yp(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Zp=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Qp=e=>{let t=Zp(e);return t.charAt(0).toUpperCase()+t.slice(1)},$p=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),em={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function tm(e){return e!=null}function nm(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??em.width,a=e.size??e.height??em.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?$p(...c):$p(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??em[`stroke-width`])*Number(e.size??e.width??em.width)/Number(t.size??t.width??em.width):t.strokeWidth??em[`stroke-width`];return[`svg`,{...Object.entries(em).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&tm(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&tm(t.width)&&{[r(`width`)]:t.width},...`height`in t&&tm(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function rm(e,t={}){return nm(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var im=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},am=(0,m.createContext)({}),om=()=>(0,m.useContext)(am),sm=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=om()??{},b=!!c||im(d),[x,S,C=[]]=rm(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:$p(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function K(e,t=[],n=[]){let r=typeof e==`string`?Xp(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(sm,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Qp(r.name)),i}var cm={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};cm.node;var lm=K(cm),um={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};um.node;var dm=K(um),fm={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};fm.node;var pm=K(fm),mm={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};mm.node;var hm=K(mm),gm={name:`arrow-right-to-line`,size:24,node:[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]]};gm.node;var _m=K(gm),vm={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};vm.node;var ym=K(vm),bm={name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]};bm.node;var xm=K(bm),Sm={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};Sm.node;var Cm=K(Sm),wm={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};wm.node;var Tm=K(wm),Em={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};Em.node;var Dm=K(Em),Om={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Om.node;var km=K(Om),Am={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Am.node;var jm=K(Am),Mm={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Mm.node;var Nm=K(Mm),Pm={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Pm.node;var Fm=K(Pm),Im={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Im.node;var Lm=K(Im),Rm={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Rm.node;var zm=K(Rm),Bm={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Bm.node;var Vm=K(Bm),Hm={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Hm.node;var Um=K(Hm),Wm={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Wm.node;var Gm=K(Wm),Km={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};Km.node;var qm=K(Km),Jm={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Jm.node;var Ym=K(Jm),Xm={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Xm.node;var Zm=K(Xm),Qm={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Qm.node;var $m=K(Qm),eh={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};eh.node;var th=K(eh),nh={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};nh.node;var rh=K(nh),ih={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};ih.node;var ah=K(ih),oh={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};oh.node;var sh=K(oh),ch={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};ch.node;var lh=K(ch),uh={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};uh.node;var dh=K(uh),fh={name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]};fh.node;var ph=K(fh),mh={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};mh.node;var hh=K(mh),gh={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};gh.node;var _h=K(gh),vh={name:`file-x-corner`,size:24,node:[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]],aliases:[`file-x-2`]};vh.node;var yh=K(vh),bh={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};bh.node;var xh=K(bh),Sh={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Sh.node;var Ch=K(Sh),wh={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};wh.node;var Th=K(wh),Eh={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Eh.node;var Dh=K(Eh),Oh={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Oh.node;var kh=K(Oh),Ah={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Ah.node;var jh=K(Ah),Mh={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Mh.node;var Nh=K(Mh),Ph={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Ph.node;var Fh=K(Ph),Ih={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Ih.node;var Lh=K(Ih),Rh={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};Rh.node;var zh=K(Rh),Bh={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};Bh.node;var Vh=K(Bh),Hh={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};Hh.node;var Uh=K(Hh),Wh={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Wh.node;var Gh=K(Wh),Kh={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Kh.node;var qh=K(Kh),Jh={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Jh.node;var Yh=K(Jh),Xh={name:`minimize`,size:24,node:[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]};Xh.node;var Zh=K(Xh),Qh={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Qh.node;var $h=K(Qh),eg={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};eg.node;var tg=K(eg),ng={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};ng.node;var rg=K(ng),ig={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};ig.node;var ag=K(ig),og={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};og.node;var sg=K(og),cg={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};cg.node;var lg=K(cg),ug={name:`picture-in-picture-2`,size:24,node:[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]};ug.node;var dg=K(ug),fg={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};fg.node;var pg=K(fg),mg={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};mg.node;var hg=K(mg),gg={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};gg.node;var _g=K(gg),vg={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};vg.node;var yg=K(vg),bg={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};bg.node;var xg=K(bg),Sg={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Sg.node;var Cg=K(Sg),wg={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};wg.node;var Tg=K(wg),Eg={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};Eg.node;var Dg=K(Eg),Og={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};Og.node;var kg=K(Og),Ag={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Ag.node;var jg=K(Ag),Mg={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Mg.node;var Ng=K(Mg),Pg={name:`skip-forward`,size:24,node:[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]};Pg.node;var Fg=K(Pg),Ig={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Ig.node;var Lg=K(Ig),Rg={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};Rg.node;var zg=K(Rg),Bg={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Bg.node;var Vg=K(Bg),Hg={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Hg.node;var Ug=K(Hg),Wg={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};Wg.node;var Gg=K(Wg),Kg={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Kg.node;var qg=K(Kg),Jg={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Jg.node;var Yg=K(Jg),Xg={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Xg.node;var Zg=K(Xg),Qg={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Qg.node;var $g=K(Qg),e_={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};e_.node;var t_=K(e_),n_={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};n_.node;var r_=K(n_),i_={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};i_.node;var a_=K(i_),o_={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};o_.node;var s_=K(o_),c_={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};c_.node;var l_=K(c_);function u_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function d_(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u_(e))&&(r&&(r+=` `),r+=t);return r}var f_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},p_=(e,t)=>({classGroupId:e,validator:t}),m_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),h_=`-`,g_=[],__=`arbitrary..`,v_=e=>{let t=x_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return b_(e);let n=e.split(h_);return y_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?f_(i,t):t:i||g_}return n[e]||g_}}},y_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=y_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(h_):e.slice(t).join(h_),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},b_=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?__+r:void 0})(),x_=e=>{let{theme:t,classGroups:n}=e;return S_(n,t)},S_=(e,t)=>{let n=m_();for(let r in e){let i=e[r];C_(i,n,r,t)}return n},C_=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];w_(i,t,n,r)}},w_=(e,t,n,r)=>{if(typeof e==`string`){T_(e,t,n);return}if(typeof e==`function`){E_(e,t,n,r);return}D_(e,t,n,r)},T_=(e,t,n)=>{let r=e===``?t:O_(t,e);r.classGroupId=n},E_=(e,t,n,r)=>{if(k_(e)){C_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(p_(n,e))},D_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];C_(o,O_(t,a),n,r)}},O_=(e,t)=>{let n=e,r=t.split(h_),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=m_(),n.nextPart.set(t,i)),n=i}return n},k_=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,A_=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},j_=`!`,M_=`:`,N_=[],P_=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),F_=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===M_){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(j_)?(c=s.slice(0,-1),l=!0):s.startsWith(j_)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return P_(t,l,c,u)};if(t){let e=t+M_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):P_(N_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},I_=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},L_=e=>({cache:A_(e.cacheSize),parseClassName:F_(e),sortModifiers:I_(e),postfixLookupClassGroupIds:R_(e),...v_(e)}),R_=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},z_=/\s+/,B_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(z_),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+j_:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},V_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=H_(n))&&(i&&(i+=` `),i+=r);return i},H_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=H_(e[r]))&&(n&&(n+=` `),n+=t);return n},U_=(e,...t)=>{let n,r,i,a,o=o=>(n=L_(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=B_(e,n);return i(e,a),a};return a=o,(...e)=>a(V_(...e))},W_=[],G_=e=>{let t=t=>t[e]||W_;return t.isThemeGetter=!0,t.themeKey=e,t},K_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,J_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Y_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,X_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Z_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Q_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ev=e=>J_.test(e),tv=e=>!!e&&!Number.isNaN(Number(e)),nv=e=>!!e&&Number.isInteger(Number(e)),rv=e=>e.endsWith(`%`)&&tv(e.slice(0,-1)),iv=e=>Y_.test(e),av=()=>!0,ov=e=>X_.test(e)&&!Z_.test(e),sv=()=>!1,cv=e=>Q_.test(e),lv=e=>$_.test(e),uv=e=>!q(e)&&!J(e),dv=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),fv=e=>Dv(e,jv,sv),q=e=>K_.test(e),pv=e=>Dv(e,Mv,ov),mv=e=>Dv(e,Nv,tv),hv=e=>Dv(e,Fv,av),gv=e=>Dv(e,Pv,sv),_v=e=>Dv(e,kv,sv),vv=e=>Dv(e,Av,lv),yv=e=>Dv(e,Iv,cv),J=e=>q_.test(e),bv=e=>Ov(e,Mv),xv=e=>Ov(e,Pv),Sv=e=>Ov(e,kv),Cv=e=>Ov(e,jv),wv=e=>Ov(e,Av),Tv=e=>Ov(e,Iv,!0),Ev=e=>Ov(e,Fv,!0),Dv=(e,t,n)=>{let r=K_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ov=(e,t,n=!1)=>{let r=q_.exec(e);return r?r[1]?t(r[1]):n:!1},kv=e=>e===`position`||e===`percentage`,Av=e=>e===`image`||e===`url`,jv=e=>e===`length`||e===`size`||e===`bg-size`,Mv=e=>e===`length`,Nv=e=>e===`number`,Pv=e=>e===`family-name`,Fv=e=>e===`number`||e===`weight`,Iv=e=>e===`shadow`,Lv=U_(()=>{let e=G_(`color`),t=G_(`font`),n=G_(`text`),r=G_(`font-weight`),i=G_(`tracking`),a=G_(`leading`),o=G_(`breakpoint`),s=G_(`container`),c=G_(`spacing`),l=G_(`radius`),u=G_(`shadow`),d=G_(`inset-shadow`),f=G_(`text-shadow`),p=G_(`drop-shadow`),m=G_(`blur`),h=G_(`perspective`),g=G_(`aspect`),_=G_(`ease`),v=G_(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,q,c],T=()=>[ev,`full`,`auto`,...w()],E=()=>[nv,`none`,`subgrid`,J,q],D=()=>[`auto`,{span:[`full`,nv,J,q]},nv,J,q],O=()=>[nv,`auto`,J,q],k=()=>[`auto`,`min`,`max`,`fr`,J,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ev,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[s,ev,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[ev,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,J,q],ne=()=>[...b(),Sv,_v,{position:[J,q]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Cv,fv,{size:[J,q]}],ae=()=>[rv,bv,pv],oe=()=>[``,`none`,`full`,l,J,q],se=()=>[``,tv,bv,pv],ce=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],F=()=>[tv,rv,Sv,_v],ue=()=>[``,`none`,m,J,q],de=()=>[`none`,tv,J,q],fe=()=>[`none`,tv,J,q],I=()=>[tv,J,q],L=()=>[ev,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[iv],breakpoint:[iv],color:[av],container:[iv],"drop-shadow":[iv],ease:[`in`,`out`,`in-out`],font:[uv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[iv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[iv],shadow:[iv],spacing:[`px`,tv],text:[iv],"text-shadow":[iv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ev,q,J,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,J,q]}],"container-named":[dv],columns:[{columns:[tv,`auto`,q,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[nv,`auto`,J,q]}],basis:[{basis:[ev,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[tv,ev,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,tv,J,q]}],shrink:[{shrink:[``,tv,J,q]}],order:[{order:[nv,`first`,`last`,`none`,J,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,bv,pv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ev,hv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,rv,q]}],"font-family":[{font:[xv,gv,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,q]}],"line-clamp":[{"line-clamp":[tv,`none`,J,mv]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,J,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ce(),`wavy`]}],"text-decoration-thickness":[{decoration:[tv,`from-font`,`auto`,J,pv]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[tv,`auto`,J,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[nv,J,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},nv,J,q],radial:[``,J,q],conic:[``,nv,J,q]},wv,vv]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":se()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ce(),`hidden`,`none`]}],"divide-style":[{divide:[...ce(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ce(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[tv,J,q]}],"outline-w":[{outline:[``,tv,bv,pv]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,Tv,yv]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Tv,yv]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:se()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[tv,pv]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Tv,yv]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[tv,J,q]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[tv]}],"mask-image-linear-from-pos":[{"mask-linear-from":F()}],"mask-image-linear-to-pos":[{"mask-linear-to":F()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":F()}],"mask-image-t-to-pos":[{"mask-t-to":F()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":F()}],"mask-image-r-to-pos":[{"mask-r-to":F()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":F()}],"mask-image-b-to-pos":[{"mask-b-to":F()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":F()}],"mask-image-l-to-pos":[{"mask-l-to":F()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":F()}],"mask-image-x-to-pos":[{"mask-x-to":F()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":F()}],"mask-image-y-to-pos":[{"mask-y-to":F()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":F()}],"mask-image-radial-to-pos":[{"mask-radial-to":F()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[tv]}],"mask-image-conic-from-pos":[{"mask-conic-from":F()}],"mask-image-conic-to-pos":[{"mask-conic-to":F()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,q]}],filter:[{filter:[``,`none`,J,q]}],blur:[{blur:ue()}],brightness:[{brightness:[tv,J,q]}],contrast:[{contrast:[tv,J,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Tv,yv]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,tv,J,q]}],"hue-rotate":[{"hue-rotate":[tv,J,q]}],invert:[{invert:[``,tv,J,q]}],saturate:[{saturate:[tv,J,q]}],sepia:[{sepia:[``,tv,J,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,q]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[tv,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[tv,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,tv,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[tv,J,q]}],"backdrop-invert":[{"backdrop-invert":[``,tv,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[tv,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[tv,J,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,tv,J,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[tv,`initial`,J,q]}],ease:[{ease:[`linear`,`initial`,_,J,q]}],delay:[{delay:[tv,J,q]}],animate:[{animate:[`none`,v,J,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:I()}],"skew-x":[{"skew-x":I()}],"skew-y":[{"skew-y":I()}],transform:[{transform:[J,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":[`translate-none`],zoom:[{zoom:[nv,J,q]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,q]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[tv,bv,pv,mv]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Y(...e){return Lv(d_(e))}var Rv=4,zv=320,Bv=.9;function Vv(e,t){let n=e.scrollTop>Rv,r=e.scrollTop+e.clientHeight<e.scrollHeight-Rv;if(!t)return{up:n,down:r,top:0,right:0};let i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return{up:n,down:r,top:i.top-a.top+i.height/2,right:a.right-i.right+8}}function Hv(e,t){return e.up===t.up&&e.down===t.down&&Math.abs(e.top-t.top)<.5&&Math.abs(e.right-t.right)<.5}function Uv({target:e,up:t=!0,down:n=!0,className:r}){let i=(0,m.useRef)(null),[a,o]=(0,m.useState)({up:!1,down:!1,top:0,right:0}),s=(0,m.useRef)(null);(0,m.useEffect)(()=>{let t=e.current;if(!t)return;t.setAttribute(`data-scroll-hints`,``);let n=0,r=()=>{n=0;let e=Vv(t,i.current?.offsetParent);o(t=>Hv(t,e)?t:e)},a=()=>{n||=requestAnimationFrame(r)};r(),t.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let s=new ResizeObserver(a);s.observe(t);for(let e of t.children)s.observe(e);let c=new MutationObserver(()=>{for(let e of t.children)s.observe(e);a()});return c.observe(t,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(n),t.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),s.disconnect(),c.disconnect(),t.removeAttribute(`data-scroll-hints`)}},[e]),(0,m.useEffect)(()=>()=>c(),[]);function c(){s.current&&=(clearTimeout(s.current.timer),cancelAnimationFrame(s.current.frame),null)}function l(){return window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches?`smooth`:`auto`}function u(t){let n=e.current;n&&n.scrollBy({top:t*Math.max(80,n.clientHeight*.8),behavior:l()})}function d(t){c();let n={timer:0,frame:0,held:!1};n.timer=window.setTimeout(()=>{n.held=!0;let r=performance.now(),i=a=>{e.current?.scrollBy({top:t*(a-r)*Bv}),r=a,n.frame=requestAnimationFrame(i)};n.frame=requestAnimationFrame(i)},zv),s.current=n}function f(e,t){return(0,H.jsx)(`button`,{type:`button`,tabIndex:-1,"data-shown":t||void 0,"data-direction":e===1?`down`:`up`,"data-tip":e===1?`Scroll down, hold to keep going`:`Scroll up, hold to keep going`,onPointerDown:t=>{t.button===0&&(t.preventDefault(),d(e))},onPointerUp:()=>{let t=s.current?.held;c(),t===!1&&u(e)},onPointerLeave:c,onPointerCancel:c,className:`scroll-hint grid size-7 place-items-center rounded-md border bg-card/85 text-muted-foreground shadow-card hover:text-foreground`,children:(0,H.jsx)(e===1?jm:Lm,{"aria-hidden":`true`,className:`size-4`})})}let p=t&&a.up,h=n&&a.down;return(0,H.jsxs)(`div`,{ref:i,"aria-hidden":`true`,"data-slot":`scroll-hints`,"data-active":p||h||void 0,style:{top:a.top,right:a.right},className:Y(`scroll-hints pointer-events-none absolute z-20 flex -translate-y-1/2 flex-col gap-1.5`,r),children:[t?f(-1,p):null,n?f(1,h):null]})}var Wv=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Gv=d_,Kv=(e,t)=>n=>{if(t?.variants==null)return Gv(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Wv(t)||Wv(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Gv(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},qv=Object.defineProperty,Jv=(e,t)=>qv(e,`name`,{value:t,configurable:!0});function Yv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Jv(Yv,`setRef`);function Xv(...e){return t=>{let n=!1,r=e.map(e=>{let r=Yv(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Yv(e[t],null)}}}}Jv(Xv,`composeRefs`);function Zv(...e){return m.useCallback(Xv(...e),e)}Jv(Zv,`useComposedRefs`);var Qv=Object.defineProperty,$v=(e,t)=>Qv(e,`name`,{value:t,configurable:!0});function ey(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ly(r)&&typeof py==`function`&&(r=py(r._payload)),m.Children.forEach(r,e=>{if(sy(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ly(n)&&typeof py==`function`&&(n=py(n._payload)),a=iy(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?oy(a):void 0,l=Zv(n,c);if(!a){if(r||r===0)throw Error(o?fy(e):dy(e));return r}let u=ay(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}$v(ey,`createSlot`);var ty=ey(`Slot`),ny=Symbol.for(`radix.slottable`);function ry(e){let t=$v(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=ny,t}$v(ry,`createSlottable`);var iy=$v((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function ay(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}$v(ay,`mergeProps`);function oy(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}$v(oy,`getElementRef`);function sy(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ny}$v(sy,`isSlottable`);var cy=Symbol.for(`react.lazy`);function ly(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===cy&&`_payload`in e&&uy(e._payload)}$v(ly,`isLazyComponent`);function uy(e){return typeof e==`object`&&!!e&&`then`in e}$v(uy,`isPromiseLike`);var dy=$v(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),fy=$v(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),py=m.use,my=t(np(),1),hy=Object.defineProperty,gy=(e,t)=>hy(e,`name`,{value:t,configurable:!0}),_y=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ey(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vy(e,t){e&&my.flushSync(()=>e.dispatchEvent(t))}gy(vy,`dispatchDiscreteCustomEvent`);var yy=Object.defineProperty,by=(e,t)=>yy(e,`name`,{value:t,configurable:!0});function xy(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=by(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,H.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return by(i,`useContext`),[r,i]}by(xy,`createContext`);function Sy(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=by(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return by(s,`useContext`),[o,s]}by(r,`createContext`);let i=by(()=>{let t=n.map(e=>m.createContext(e));return by(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Cy(i,...t)]}by(Sy,`createContextScope`);function Cy(...e){let t=e[0];if(e.length===1)return t;let n=by(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return by(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}by(Cy,`composeContextScopes`);var wy=Object.defineProperty,Ty=(e,t)=>wy(e,`name`,{value:t,configurable:!0});function Ey(e){let t=e+`CollectionProvider`,[n,r]=Sy(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Ty(e=>{let{scope:t,children:n}=e,r=m.useRef(null),a=m.useRef(new Map).current;return(0,H.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=ey(s),l=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Zv(t,a(s,n).collectionRef);return(0,H.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=ey(u),p=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),s=Zv(t,o),c=a(u,n);return m.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,H.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return m.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Ty(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},h,r]}Ty(Ey,`createCollection`);var Dy=new WeakMap,Oy=class e extends Map{static{Ty(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Dy.set(this,!0)}set(e,t){return Dy.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=jy(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ky(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ky(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ky(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ky(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ay(e,t);return n===-1?void 0:e[n]}Ty(ky,`at`);function Ay(e,t){let n=e.length,r=jy(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Ty(Ay,`toSafeIndex`);function jy(e){return e!==e||e===0?0:Math.trunc(e)}Ty(jy,`toSafeInteger`);function My(e){let t=e+`CollectionProvider`,[n,r]=Sy(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Oy,setItemMap:Ty(()=>void 0,`setItemMap`)}),o=Ty(({state:e,...t})=>e?(0,H.jsx)(c,{...t,state:e}):(0,H.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Ty(e=>{let t=g();return(0,H.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Ty(e=>{let{scope:t,children:n,state:r}=e,a=m.useRef(null),[o,s]=m.useState(null),c=Zv(a,s),[l,u]=r;return m.useEffect(()=>{if(!o)return;let e=Iy(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,H.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=ey(l),d=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Zv(t,a(l,n).collectionRef);return(0,H.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=ey(f),h=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),[s,c]=m.useState(null),l=Zv(t,o,c),{setItemMap:u}=a(f,n),d=m.useRef(i);Ny(d.current,i)||(d.current=i);let h=d.current;return m.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Fy):(t.set(s,{...e,element:s}),t.toSorted(Fy)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Oy(e)))}},[s,h,u]),(0,H.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=f;function g(){return m.useState(new Oy)}Ty(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Ty(_,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}Ty(My,`createCollection`);function Ny(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Ty(Ny,`shallowEqual`);function Py(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ty(Py,`isElementPreceding`);function Fy(e,t){return!e[1].element||!t[1].element?0:Py(e[1].element,t[1].element)?-1:1}Ty(Fy,`sortByDocumentPosition`);function Iy(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Ty(Iy,`getChildListObserver`);var Ly=Object.defineProperty,Ry=(e,t)=>Ly(e,`name`,{value:t,configurable:!0}),zy=!!(typeof window<`u`&&window.document&&window.document.createElement);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return Ry(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Ry(X,`composeEventHandlers`);function By(e){if(!zy)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Ry(By,`getOwnerWindow`);function Vy(e){if(!zy)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Ry(Vy,`getOwnerDocument`);function Hy(e,t=!1){let{activeElement:n}=Vy(e);if(!n?.nodeName)return null;if(Uy(n)&&n.contentDocument)return Hy(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Vy(n).getElementById(e);if(t)return t}}return n}Ry(Hy,`getActiveElement`);function Uy(e){return e.tagName===`IFRAME`}Ry(Uy,`isFrame`);var Wy=globalThis?.document?m.useLayoutEffect:()=>{},Gy=Object.defineProperty,Ky=(e,t)=>Gy(e,`name`,{value:t,configurable:!0}),qy=m.useEffectEvent,Jy=m.useInsertionEffect;function Yy(e){if(typeof qy==`function`)return qy(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Jy==`function`?Jy(()=>{t.current=e}):Wy(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ky(Yy,`useEffectEvent`);var Xy=Object.defineProperty,Zy=(e,t)=>Xy(e,`name`,{value:t,configurable:!0}),Qy=m.useInsertionEffect||Wy;function $y({prop:e,defaultProp:t,onChange:n=Zy(()=>{},`onChange`),caller:r}){let[i,a,o]=eb({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=tb(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Zy($y,`useControllableState`);function eb({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Qy(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Zy(eb,`useUncontrolledState`);function tb(e){return typeof e==`function`}Zy(tb,`isFunction`);var nb=Symbol(`RADIX:SYNC_STATE`);function rb(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Yy(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===nb)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:nb,state:i})},[i,d.state,c]),[g,f]}Zy(rb,`useControllableStateReducer`);var ib=Object.defineProperty,ab=(e,t)=>ib(e,`name`,{value:t,configurable:!0});function ob(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}ab(ob,`useStateMachine`);var sb=ab(e=>{let{present:t,children:n}=e,r=cb(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=ub(r.ref,fb(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function cb(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=ob(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??db(r.current),o.current=void 0):a.current=`none`},[s]),Wy(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=db(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Wy(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ab(a=>{let o=db(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ab(e=>{e.target===t&&(a.current=db(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=db(t)}else r.current=null;n(e)},[])}}ab(cb,`usePresence`);function lb(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ab(lb,`setRef`);function ub(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=lb(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():lb(n[e],null)}}},[])}ab(ub,`useStableComposedRefs`);function db(e){return e?.animationName||`none`}ab(db,`getAnimationName`);function fb(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ab(fb,`getElementRef`);var pb=Object.defineProperty,mb=(e,t)=>pb(e,`name`,{value:t,configurable:!0}),hb=m.useId||(()=>void 0),gb=0;function _b(e){let[t,n]=m.useState(hb());return Wy(()=>{e||n(e=>e??String(gb++))},[e]),e||(t?`radix-${t}`:``)}mb(_b,`useId`);var vb=Object.defineProperty,yb=(e,t)=>vb(e,`name`,{value:t,configurable:!0}),bb=m.createContext(void 0);function xb(e){let t=m.useContext(bb);return e||t||`ltr`}yb(xb,`useDirection`);var Sb=Object.defineProperty,Cb=(e,t)=>Sb(e,`name`,{value:t,configurable:!0});function wb(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}Cb(wb,`useCallbackRef`);var Tb=Object.defineProperty,Eb=(e,t)=>Tb(e,`name`,{value:t,configurable:!0}),Db=`dismissableLayer.update`,Ob=`dismissableLayer.pointerDownOutside`,kb=`dismissableLayer.focusOutside`,Ab,jb=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Mb=m.forwardRef(Eb(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(jb),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=Zv(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=m.useRef(!1),w=Fb(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Ib(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===_.length-1:!1,D=wb(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ab=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Lb(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Ab))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Lb())},[d,u]),m.useEffect(()=>{let e=Eb(()=>h({}),`handleUpdate`);return document.addEventListener(Db,e),()=>document.removeEventListener(Db,e)},[]),(0,H.jsx)(_y.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:X(e.onFocusCapture,T.onFocusCapture),onBlurCapture:X(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Nb(){let e=m.useContext(jb),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Eb(Nb,`useDismissableLayerSurface`);var Pb=Eb(()=>!0,`IS_TRUE`);function Fb(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Pb}=t,s=wb(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Eb(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Eb(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Eb(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Eb(p,`handleInteractionBubble`);let m=Eb(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Rb(Ob,s,p,{discrete:!0})};if(Eb(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Eb(()=>c.current=!0,`onPointerDownCapture`)}}Eb(Fb,`usePointerDownOutside`);function Ib(e,t=globalThis?.document){let n=wb(e),r=m.useRef(!1);return m.useEffect(()=>{let e=Eb(e=>{e.target&&!r.current&&Rb(kb,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Eb(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Eb(()=>r.current=!1,`onBlurCapture`)}}Eb(Ib,`useFocusOutside`);function Lb(){let e=new CustomEvent(Db);document.dispatchEvent(e)}Eb(Lb,`dispatchUpdate`);function Rb(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?vy(i,a):i.dispatchEvent(a)}Eb(Rb,`handleAndDispatchCustomEvent`);var zb=Object.defineProperty,Bb=(e,t)=>zb(e,`name`,{value:t,configurable:!0}),Vb=`focusScope.autoFocusOnMount`,Hb=`focusScope.autoFocusOnUnmount`,Ub={bubbles:!1,cancelable:!0},Wb=m.forwardRef(Bb(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=wb(i),u=wb(a),d=m.useRef(null),f=Zv(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Zb(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Zb(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Zb(s)};Bb(e,`handleFocusIn`),Bb(t,`handleFocusOut`),Bb(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){Qb.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Vb,Ub);s.addEventListener(Vb,l),s.dispatchEvent(t),t.defaultPrevented||(Gb(tx(qb(s)),{select:!0}),document.activeElement===e&&Zb(s))}return()=>{s.removeEventListener(Vb,l),setTimeout(()=>{let t=new CustomEvent(Hb,Ub);s.addEventListener(Hb,u),s.dispatchEvent(t),t.defaultPrevented||Zb(e??document.body,{select:!0}),s.removeEventListener(Hb,u),Qb.remove(p)},0)}}},[s,l,u,p]);let h=m.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Kb(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Zb(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Zb(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,H.jsx)(_y.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function Gb(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Zb(r,{select:t}),document.activeElement!==n)return}Bb(Gb,`focusFirst`);function Kb(e){let t=qb(e);return[Jb(t,e),Jb(t.reverse(),e)]}Bb(Kb,`getTabbableEdges`);function qb(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Bb(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Bb(qb,`getTabbableCandidates`);function Jb(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Yb(r,{upTo:t})))return r}Bb(Jb,`findVisible`);function Yb(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Bb(Yb,`isHidden`);function Xb(e){return e instanceof HTMLInputElement&&`select`in e}Bb(Xb,`isSelectableInput`);function Zb(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Xb(e)&&t&&e.select()}}Bb(Zb,`focus`);var Qb=$b();function $b(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ex(e,t),e.unshift(t)},remove(t){e=ex(e,t),e[0]?.resume()}}}Bb($b,`createFocusScopesStack`);function ex(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Bb(ex,`arrayRemove`);function tx(e){return e.filter(e=>e.tagName!==`A`)}Bb(tx,`removeLinks`);var nx=Object.defineProperty,rx=m.forwardRef(((e,t)=>nx(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Wy(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?my.createPortal((0,H.jsx)(_y.div,{...r,ref:t}),o):null},`Portal`)),ix=Object.defineProperty,ax=(e,t)=>ix(e,`name`,{value:t,configurable:!0}),ox=0,sx=null;function cx(e){return lx(),e.children}ax(cx,`FocusGuards`);function lx(){m.useEffect(()=>{sx||={start:ux(),end:ux()};let{start:e,end:t}=sx;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ox++,()=>{ox===1&&(sx?.start.remove(),sx?.end.remove(),sx=null),ox=Math.max(0,ox-1)}},[])}ax(lx,`useFocusGuards`);function ux(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}ax(ux,`createFocusGuard`);var dx=function(){return dx=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dx.apply(this,arguments)};function fx(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function px(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var mx=`right-scroll-bar-position`,hx=`width-before-scroll-bar`,gx=`with-scroll-bars-hidden`,_x=`--removed-body-scroll-bar-size`;function vx(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function yx(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var bx=typeof window<`u`?m.useLayoutEffect:m.useEffect,xx=new WeakMap;function Sx(e,t){var n=yx(t||null,function(t){return e.forEach(function(e){return vx(e,t)})});return bx(function(){var t=xx.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||vx(e,null)}),i.forEach(function(e){r.has(e)||vx(e,a)})}xx.set(n,e)},[e]),n}function Cx(e){return e}function wx(e,t){t===void 0&&(t=Cx);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Tx(e){e===void 0&&(e={});var t=wx(null);return t.options=dx({async:!0,ssr:!1},e),t}var Ex=function(e){var t=e.sideCar,n=fx(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return m.createElement(r,dx({},n))};Ex.isSideCarExport=!0;function Dx(e,t){return e.useMedium(t),Ex}var Ox=Tx(),kx=function(){},Ax=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:kx,onWheelCapture:kx,onTouchMoveCapture:kx}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=fx(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Sx([n,t]),w=dx(dx({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:Ox,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),dx(dx({},w),{ref:C})):m.createElement(y,dx({},w,{className:c,ref:C}),s))});Ax.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ax.classNames={fullWidth:hx,zeroRight:mx};var jx=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Mx(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=jx();return t&&e.setAttribute(`nonce`,t),e}function Nx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Px(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Fx=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mx())&&(Nx(t,n),Px(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ix=function(){var e=Fx();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Lx=function(){var e=Ix();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Rx={left:0,top:0,right:0,gap:0},zx=function(e){return parseInt(e||``,10)||0},Bx=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[zx(n),zx(r),zx(i)]},Vx=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Rx;var t=Bx(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Hx=Lx(),Ux=`data-scroll-locked`,Wx=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
20
- .${gx} {
21
- overflow: hidden ${r};
22
- padding-right: ${s}px ${r};
23
- }
24
- body[${Ux}] {
25
- overflow: hidden ${r};
26
- overscroll-behavior: contain;
27
- ${[t&&`position: relative ${r};`,n===`margin`&&`
28
- padding-left: ${i}px;
29
- padding-top: ${a}px;
30
- padding-right: ${o}px;
31
- margin-left:0;
32
- margin-top:0;
33
- margin-right: ${s}px ${r};
34
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
35
- }
36
-
37
- .${mx} {
38
- right: ${s}px ${r};
39
- }
40
-
41
- .${hx} {
42
- margin-right: ${s}px ${r};
43
- }
44
-
45
- .${mx} .${mx} {
46
- right: 0 ${r};
47
- }
48
-
49
- .${hx} .${hx} {
50
- margin-right: 0 ${r};
51
- }
52
-
53
- body[${Ux}] {
54
- ${_x}: ${s}px;
55
- }
56
- `},Gx=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Kx=function(){m.useEffect(function(){return document.body.setAttribute(Ux,(Gx()+1).toString()),function(){var e=Gx()-1;e<=0?document.body.removeAttribute(Ux):document.body.setAttribute(Ux,e.toString())}},[])},qx=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Kx();var a=m.useMemo(function(){return Vx(i)},[i]);return m.createElement(Hx,{styles:Wx(a,!t,i,n?``:`!important`)})},Jx=!1;if(typeof window<`u`)try{var Yx=Object.defineProperty({},"passive",{get:function(){return Jx=!0,!0}});window.addEventListener(`test`,Yx,Yx),window.removeEventListener(`test`,Yx,Yx)}catch{Jx=!1}var Xx=Jx?{passive:!1}:!1,Zx=function(e){return e.tagName===`TEXTAREA`},Qx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Zx(e)&&n[t]===`visible`)},$x=function(e){return Qx(e,`overflowY`)},eS=function(e){return Qx(e,`overflowX`)},tS=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),iS(e,r)){var i=aS(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nS=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},rS=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},iS=function(e,t){return e===`v`?$x(t):eS(t)},aS=function(e,t){return e===`v`?nS(t):rS(t)},oS=function(e,t){return e===`h`&&t===`rtl`?-1:1},sS=function(e,t,n,r,i){var a=oS(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=aS(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&iS(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},cS=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lS=function(e){return[e.deltaX,e.deltaY]},uS=function(e){return e&&`current`in e?e.current:e},dS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fS=function(e){return`
57
- .block-interactivity-${e} {pointer-events: none;}
58
- .allow-interactivity-${e} {pointer-events: all;}
59
- `},pS=0,mS=[];function hS(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(pS++)[0],a=m.useState(Lx)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=px([e.lockRef.current],(e.shards||[]).map(uS),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=cS(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=tS(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=tS(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return sS(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(mS.length&&mS[mS.length-1]===a){var r=`deltaY`in n?lS(n):cS(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&dS(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(uS).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:gS(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=cS(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,lS(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,cS(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return mS.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Xx),document.addEventListener(`touchmove`,c,Xx),document.addEventListener(`touchstart`,u,Xx),function(){mS=mS.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Xx),document.removeEventListener(`touchmove`,c,Xx),document.removeEventListener(`touchstart`,u,Xx)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:fS(i)}):null,p?m.createElement(qx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var _S=Dx(Ox,hS),vS=m.forwardRef(function(e,t){return m.createElement(Ax,dx({},e,{ref:t,sideCar:_S}))});vS.classNames=Ax.classNames;var yS=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},bS=new WeakMap,xS=new WeakMap,SS={},CS=0,wS=function(e){return e&&(e.host||wS(e.parentNode))},TS=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=wS(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ES=function(e,t,n,r){var i=TS(t,Array.isArray(e)?e:[e]);SS[n]||(SS[n]=new WeakMap);var a=SS[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(bS.get(e)||0)+1,l=(a.get(e)||0)+1;bS.set(e,c),a.set(e,l),o.push(e),c===1&&i&&xS.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),CS++,function(){o.forEach(function(e){var t=bS.get(e)-1,i=a.get(e)-1;bS.set(e,t),a.set(e,i),t||(xS.has(e)||e.removeAttribute(r),xS.delete(e)),i||e.removeAttribute(n)}),CS--,CS||(bS=new WeakMap,bS=new WeakMap,xS=new WeakMap,SS={})}},DS=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||yS(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ES(r,i,n,`aria-hidden`)):function(){return null}},OS=Object.defineProperty,kS=(e,t)=>OS(e,`name`,{value:t,configurable:!0}),AS=`Dialog`,[jS,MS]=Sy(AS),[NS,PS]=jS(AS),FS=kS(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=$y({prop:r,defaultProp:i??!1,onChange:a,caller:AS}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,H.jsx)(NS,{scope:t,triggerRef:s,contentRef:c,contentId:_b(),titleId:_b(),descriptionId:_b(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),IS=`DialogPortal`,[LS,RS]=jS(IS,{forceMount:void 0}),zS=kS(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=PS(IS,t);return(0,H.jsx)(LS,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,H.jsx)(sb,{present:n||a.open,children:(0,H.jsx)(rx,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),BS=`DialogOverlay`,VS=m.forwardRef(kS(function(e,t){let n=RS(BS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=PS(BS,e.__scopeDialog);return a.modal?(0,H.jsx)(sb,{present:r||a.open,children:(0,H.jsx)(US,{...i,ref:t})}):null},`DialogOverlay`)),HS=ey(`DialogOverlay.RemoveScroll`),US=m.forwardRef(kS(function(e,t){let{__scopeDialog:n,...r}=e,i=PS(BS,n),a=Zv(t,Nb());return(0,H.jsx)(vS,{as:HS,allowPinchZoom:!0,shards:[i.contentRef],children:(0,H.jsx)(_y.div,{"data-state":tC(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),WS=`DialogContent`,GS=m.forwardRef(kS(function(e,t){let n=RS(WS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=PS(WS,e.__scopeDialog);return(0,H.jsx)(sb,{present:r||a.open,children:a.modal?(0,H.jsx)(KS,{...i,ref:t}):(0,H.jsx)(qS,{...i,ref:t})})},`DialogContent`)),KS=m.forwardRef(kS(function(e,t){let n=PS(WS,e.__scopeDialog),r=m.useRef(null),i=Zv(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return DS(e)},[]),(0,H.jsx)(JS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),qS=m.forwardRef(kS(function(e,t){let n=PS(WS,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,H.jsx)(JS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),JS=m.forwardRef(kS(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=PS(WS,n);return lx(),(0,H.jsx)(H.Fragment,{children:(0,H.jsx)(Wb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Mb,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":tC(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),YS=`DialogTitle`,XS=m.forwardRef(kS(function(e,t){let{__scopeDialog:n,...r}=e,i=PS(YS,n),{setTitleCount:a}=i;return Wy(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(_y.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),ZS=`DialogDescription`,QS=m.forwardRef(kS(function(e,t){let{__scopeDialog:n,...r}=e,i=PS(ZS,n),{setDescriptionCount:a}=i;return Wy(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(_y.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),$S=`DialogClose`,eC=m.forwardRef(kS(function(e,t){let{__scopeDialog:n,...r}=e,i=PS($S,n);return(0,H.jsx)(_y.button,{type:`button`,...r,ref:t,onClick:X(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function tC(e){return e?`open`:`closed`}kS(tC,`getState`);var nC=Object.defineProperty,rC=(e,t)=>nC(e,`name`,{value:t,configurable:!0});function iC(e){let[t,n]=m.useState(void 0);return Wy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}rC(iC,`useSize`);var aC=Object.defineProperty,oC=(e,t)=>aC(e,`name`,{value:t,configurable:!0}),sC=`Checkbox`,[cC,lC]=Sy(sC),[uC,dC]=cC(sC);function fC(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=$y({prop:n,defaultProp:i??!1,onChange:c,caller:sC}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S=!h||!!o||!!h.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!xC(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,H.jsx)(uC,{scope:t,...C,children:bC(d)?d(C):r})}oC(fC,`CheckboxProvider`);var pC=`CheckboxTrigger`,mC=m.forwardRef(oC(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=dC(pC,e),_=Zv(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=oC(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,H.jsx)(_y.button,{type:`button`,role:`checkbox`,"aria-checked":xC(c)?`mixed`:c,"aria-required":l,"data-state":SC(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:X(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:X(n,e=>{p(),d(e=>xC(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),hC=m.forwardRef(oC(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,H.jsx)(fC,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mC,{...d,ref:t,__scopeCheckbox:n}),e&&(0,H.jsx)(yC,{__scopeCheckbox:n})]})})},`Checkbox`)),gC=`CheckboxIndicator`,_C=m.forwardRef(oC(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=dC(gC,n);return(0,H.jsx)(sb,{present:r||xC(a.checked)||a.checked===!0,children:(0,H.jsx)(_y.span,{"data-state":SC(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),vC=`CheckboxBubbleInput`,yC=m.forwardRef(oC(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=dC(vC,e),_=Zv(r,g),v=iC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=xC(s),n.call(e,!xC(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!xC(s)&&s);return(0,H.jsx)(_y.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:X(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function bC(e){return typeof e==`function`}oC(bC,`isFunction`);function xC(e){return e===`indeterminate`}oC(xC,`isIndeterminate`);function SC(e){return xC(e)?`indeterminate`:e?`checked`:`unchecked`}oC(SC,`getState`);var CC=[`top`,`right`,`bottom`,`left`],wC=Math.min,TC=Math.max,EC=Math.round,DC=Math.floor,OC=e=>({x:e,y:e}),kC={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function AC(e,t,n){return TC(e,wC(t,n))}function jC(e,t){return typeof e==`function`?e(t):e}function MC(e){return e.split(`-`)[0]}function NC(e){return e.split(`-`)[1]}function PC(e){return e===`x`?`y`:`x`}function FC(e){return e===`y`?`height`:`width`}function IC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function LC(e){return PC(IC(e))}function RC(e,t,n){n===void 0&&(n=!1);let r=NC(e),i=LC(e),a=FC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qC(o)),[o,qC(o)]}function zC(e){let t=qC(e);return[BC(e),t,BC(t)]}function BC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var VC=[`left`,`right`],HC=[`right`,`left`],UC=[`top`,`bottom`],WC=[`bottom`,`top`];function GC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?HC:VC:t?VC:HC;case`left`:case`right`:return t?UC:WC;default:return[]}}function KC(e,t,n,r){let i=NC(e),a=GC(MC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(BC)))),a}function qC(e){let t=MC(e);return kC[t]+e.slice(t.length)}function JC(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function YC(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:JC(e)}function XC(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ZC(e,t,n){let{reference:r,floating:i}=e,a=IC(t),o=LC(t),s=FC(o),c=MC(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=NC(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function QC(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=jC(t,e),p=YC(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=XC(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=XC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var $C=50,ew=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:QC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ZC(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<$C&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ZC(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},tw=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=jC(e,t)||{};if(l==null)return{};let d=YC(u),f={x:n,y:r},p=LC(i),m=FC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=wC(d[_],T),D=wC(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=AC(E,k,O),j=!c.arrow&&NC(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),nw=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=jC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=MC(r),_=IC(o),v=MC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qC(o)]:zC(o)),x=p!==`none`;!d&&x&&b.push(...KC(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=RC(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===IC(t)||T.every(e=>IC(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=IC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function rw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iw(e){return CC.some(t=>e[t]>=0)}var aw=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=jC(e,t);switch(i){case`referenceHidden`:{let e=rw(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:iw(e)}}}case`escaped`:{let e=rw(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:iw(e)}}}default:return{}}}}},ow=new Set([`left`,`top`]);async function sw(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=MC(n),s=NC(n),c=IC(n)===`y`,l=ow.has(o)?-1:1,u=a&&c?-1:1,d=jC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var cw=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await sw(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},lw=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=jC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=IC(i),p=PC(f),m=u[p],h=u[f],g=(e,t)=>AC(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},uw=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=jC(e,t),u={x:n,y:r},d=IC(i),f=PC(d),p=u[f],m=u[d],h=jC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ow.has(MC(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},dw=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=jC(e,t),c=await i.detectOverflow(t,s),l=MC(n),u=NC(n),d=IC(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=wC(p-c[m],g),y=wC(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*TC(c.left,c.right):S=p-2*TC(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function fw(){return typeof window<`u`}function pw(e){return gw(e)?(e.nodeName||``).toLowerCase():`#document`}function mw(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hw(e){return((gw(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function gw(e){return fw()?e instanceof Node||e instanceof mw(e).Node:!1}function _w(e){return fw()?e instanceof Element||e instanceof mw(e).Element:!1}function vw(e){return fw()?e instanceof HTMLElement||e instanceof mw(e).HTMLElement:!1}function yw(e){return!fw()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof mw(e).ShadowRoot}function bw(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=jw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xw(e){return/^(table|td|th)$/.test(pw(e))}function Sw(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Cw=/transform|translate|scale|rotate|perspective|filter/,ww=/paint|layout|strict|content/,Tw=e=>!!e&&e!==`none`,Ew;function Dw(e){let t=_w(e)?jw(e):e;return Tw(t.transform)||Tw(t.translate)||Tw(t.scale)||Tw(t.rotate)||Tw(t.perspective)||!kw()&&(Tw(t.backdropFilter)||Tw(t.filter))||Cw.test(t.willChange||``)||ww.test(t.contain||``)}function Ow(e){let t=Nw(e);for(;vw(t)&&!Aw(t);){if(Dw(t))return t;if(Sw(t))return null;t=Nw(t)}return null}function kw(){return Ew??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ew}function Aw(e){return/^(html|body|#document)$/.test(pw(e))}function jw(e){return mw(e).getComputedStyle(e)}function Mw(e){return _w(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nw(e){if(pw(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||yw(e)&&e.host||hw(e);return yw(t)?t.host:t}function Pw(e){let t=Nw(e);return Aw(t)?(e.ownerDocument||e).body:vw(t)&&bw(t)?t:Pw(t)}function Fw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Pw(e),i=r===e.ownerDocument?.body,a=mw(r);if(i){let e=Iw(a);return t.concat(a,a.visualViewport||[],bw(r)?r:[],e&&n?Fw(e):[])}return t.concat(r,Fw(r,[],n))}function Iw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lw(e){let t=jw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=vw(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=EC(n)!==a||EC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Rw(e){return _w(e)?e:e.contextElement}function zw(e){let t=Rw(e);if(!vw(t))return OC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Lw(t),o=(a?EC(n.width):n.width)/r,s=(a?EC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Bw=OC(0);function Vw(e){let t=mw(e);return!kw()||!t.visualViewport?Bw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hw(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===mw(e)}function Uw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Rw(e),o=OC(1);t&&(r?_w(r)&&(o=zw(r)):o=zw(e));let s=Hw(a,n,r)?Vw(a):OC(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=mw(a),t=_w(r)?mw(r):r,n=e,i=Iw(n);for(;i&&t!==n;){let e=zw(i),t=i.getBoundingClientRect(),r=jw(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=mw(i),i=Iw(n)}}return XC({width:u,height:d,x:c,y:l})}function Ww(e,t){let n=Mw(e).scrollLeft;return t?t.left+n:Uw(hw(e)).left+n}function Gw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ww(e,n),y:n.top+t.scrollTop}}function Kw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=hw(r),s=t?Sw(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=OC(1),u=OC(0),d=vw(r);if((d||!a)&&((pw(r)!==`body`||bw(o))&&(c=Mw(r)),d)){let e=Uw(r);l=zw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Gw(o,c):OC(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function qw(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Jw(e){let t=Mw(e),n=e.ownerDocument.body,r=TC(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=TC(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ww(e),o=-t.scrollTop;return jw(n).direction===`rtl`&&(a+=TC(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Yw=25;function Xw(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=mw(e),a=hw(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!kw()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ww(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Yw&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Zw(e,t){let n=Uw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=zw(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Qw(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Xw(e,n,t);else if(t===`document`)r=Jw(hw(e));else if(_w(t))r=Zw(t,n);else{let n=Vw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return XC(r)}function $w(e,t){let n=t.get(e);if(n)return n;let r=Fw(e,[],!1).filter(e=>_w(e)&&pw(e)!==`body`),i=null,a=jw(e).position===`fixed`,o=a?Nw(e):e;for(;_w(o)&&!Aw(o);){let e=jw(o),t=Dw(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Nw(o)}return t.set(e,r),r}function eT(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Sw(t)?[]:$w(t,this._c):[].concat(n),r],o=Qw(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Qw(t,a[e],i);s=TC(n.top,s),c=wC(n.right,c),l=wC(n.bottom,l),u=TC(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function tT(e){let{width:t,height:n}=Lw(e);return{width:t,height:n}}function nT(e,t,n){let r=vw(t),i=hw(t),a=n===`fixed`,o=Uw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=OC(0);if((r||!a)&&((pw(t)!==`body`||bw(i))&&(s=Mw(t)),r)){let e=Uw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ww(i));let l=i&&!r&&!a?Gw(i,s):OC(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function rT(e){return jw(e).position===`static`}function iT(e,t){if(!vw(e)||jw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return hw(e)===n&&(n=n.ownerDocument.body),n}function aT(e,t){let n=mw(e);if(Sw(e))return n;if(!vw(e)){let t=Nw(e);for(;t&&!Aw(t);){if(_w(t)&&!rT(t))return t;t=Nw(t)}return n}let r=iT(e,t);for(;r&&xw(r)&&rT(r);)r=iT(r,t);return r&&Aw(r)&&rT(r)&&!Dw(r)?n:r||Ow(e)||n}var oT=async function(e){let t=this.getOffsetParent||aT,n=this.getDimensions,r=await n(e.floating);return{reference:nT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sT(e){return jw(e).direction===`rtl`}var cT={convertOffsetParentRelativeRectToViewportRelativeRect:Kw,getDocumentElement:hw,getClippingRect:eT,getOffsetParent:aT,getElementRects:oT,getClientRects:qw,getDimensions:tT,getScale:zw,isElement:_w,isRTL:sT};function lT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uT(e,t,n){let r=null,i,a=hw(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=DC(d),h=DC(a.clientWidth-(u+f)),g=DC(a.clientHeight-(d+p)),_=DC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:TC(0,wC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!lT(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=mw(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function dT(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Rw(e),u=i||a?[...l?Fw(l):[],...t?Fw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?uT(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Uw(e):null;c&&g();function g(){let t=Uw(e);h&&!lT(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var fT=cw,pT=lw,mT=nw,hT=dw,gT=aw,_T=tw,vT=uw,yT=(e,t,n)=>{let r=new Map,i=n??{},a={...cT,...i.platform,_c:r};return ew(e,t,{...i,platform:a})},bT=typeof document<`u`?m.useLayoutEffect:function(){};function xT(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xT(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xT(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ST(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function CT(e,t){let n=ST(e);return Math.round(t*n)/n}function wT(e){let t=m.useRef(e);return bT(()=>{t.current=e}),t}function TT(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);xT(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=wT(c),O=wT(i),k=wT(l),A=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),yT(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!xT(T.current,t)&&(T.current=t,my.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);bT(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=m.useRef(!1);bT(()=>(j.current=!0,()=>{j.current=!1}),[]),bT(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=m.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=CT(N.floating,u.x),r=CT(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ST(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var ET=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:_T({element:r.current,padding:i}).fn(n):r?_T({element:r,padding:i}).fn(n):{}}}},DT=(e,t)=>{let n=fT(e);return{name:n.name,fn:n.fn,options:[e,t]}},OT=(e,t)=>{let n=pT(e);return{name:n.name,fn:n.fn,options:[e,t]}},kT=(e,t)=>({fn:vT(e).fn,options:[e,t]}),AT=(e,t)=>{let n=mT(e);return{name:n.name,fn:n.fn,options:[e,t]}},jT=(e,t)=>{let n=hT(e);return{name:n.name,fn:n.fn,options:[e,t]}},MT=(e,t)=>{let n=gT(e);return{name:n.name,fn:n.fn,options:[e,t]}},NT=(e,t)=>{let n=ET(e);return{name:n.name,fn:n.fn,options:[e,t]}},PT=Object.defineProperty,FT=(e,t)=>PT(e,`name`,{value:t,configurable:!0}),IT=`Popper`,[LT,RT]=Sy(IT),[zT,BT]=LT(IT),VT=FT(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,H.jsx)(zT,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),HT=`PopperAnchor`,UT=m.forwardRef(FT(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=BT(HT,n),o=m.useRef(null),s=a.onAnchorChange,c=Zv(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&XT(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(_y.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),WT=`PopperContent`,[GT,KT]=LT(WT),qT=m.forwardRef(FT(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=BT(WT,n),[v,y]=m.useState(null),b=Zv(t,y),[x,S]=m.useState(null),C=iC(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(JT),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:te}=TT({strategy:`fixed`,placement:E,whileElementsMounted:FT((...e)=>dT(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[DT({mainAxis:i+T,alignmentAxis:o}),c&&OT({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?kT():void 0,...A}),c&&AT({...A}),jT({...A,apply:FT(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&NT({element:x,padding:s}),YT({arrowWidth:w,arrowHeight:T}),f&&MT({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),P=_.setPlacementState;Wy(()=>(P(N),()=>{P(void 0)}),[N,P]);let[ne,re]=XT(N),ie=wb(h);Wy(()=>{ee&&ie?.()},[ee,ie]);let ae=te.arrow?.x,oe=te.arrow?.y,se=te.arrow?.centerOffset!==0,[ce,le]=m.useState();return Wy(()=>{v&&le(window.getComputedStyle(v).zIndex)},[v]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:ee?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(` `),...te.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(GT,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:S,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,H.jsx)(_y.div,{"data-side":ne,"data-align":re,...g,ref:b,style:{...g.style,animation:ee?g.style?.animation:`none`}})})})},`PopperContent`));function JT(e){return e!==null}FT(JT,`isNotNull`);var YT=FT(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=XT(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function XT(e){let[t,n=`center`]=e.split(`-`);return[t,n]}FT(XT,`getSideAndAlignFromPlacement`);var ZT=VT,QT=UT,$T=qT,eE=Object.defineProperty,tE=(e,t)=>eE(e,`name`,{value:t,configurable:!0}),nE=!1;function rE(){let[e,t]=m.useState(nE);return m.useEffect(()=>{nE||(nE=!0,t(!0))},[]),e}tE(rE,`useIsHydrated`);var iE=m.useSyncExternalStore;function aE(){return()=>{}}tE(aE,`subscribe`);function oE(){return iE(aE,()=>!0,()=>!1)}tE(oE,`useIsHydratedModern`);var sE=typeof iE==`function`?oE:rE,cE=Object.defineProperty,lE=(e,t)=>cE(e,`name`,{value:t,configurable:!0}),uE=`rovingFocusGroup.onEntryFocus`,dE={bubbles:!1,cancelable:!0},fE=`RovingFocusGroup`,[pE,mE,hE]=Ey(fE),[gE,_E]=Sy(fE,[hE]),[vE,yE]=gE(fE),bE=m.forwardRef(lE(function(e,t){return(0,H.jsx)(pE.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(pE.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(xE,{...e,ref:t})})})},`RovingFocusGroup`)),xE=m.forwardRef(lE(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=Zv(t,f),h=xb(a),[g,_]=$y({prop:o,defaultProp:s??null,onChange:c,caller:fE}),[v,y]=m.useState(!1),b=wb(l),x=mE(n),S=m.useRef(!1),[C,w]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(uE,b),()=>e.removeEventListener(uE,b)},[b]),(0,H.jsx)(vE,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(e=>_(e),[_]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>w(e=>e-1),[]),children:(0,H.jsx)(_y.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:X(e.onMouseDown,()=>{S.current=!0}),onFocus:X(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(uE,dE);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);DE([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:X(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),SE=`RovingFocusGroupItem`,CE=m.forwardRef(lE(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=_b(),l=a||c,u=yE(SE,n),d=u.currentTabStopId===l,f=mE(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:g}=u,_=sE();return Wy(()=>{if(_&&r)return p(),()=>h()},[_,r,p,h]),m.useEffect(()=>{if(!_&&r)return p(),()=>h()},[_,r,p,h]),(0,H.jsx)(pE.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(_y.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:X(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:X(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=EE(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?OE(n,r+1):n.slice(r+1)}setTimeout(()=>DE(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),wE={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function TE(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}lE(TE,`getDirectionAwareKey`);function EE(e,t,n){let r=TE(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return wE[r]}lE(EE,`getFocusIntent`);function DE(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}lE(DE,`focusFirst`);function OE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}lE(OE,`wrapArray`);var kE=bE,AE=CE,jE=Object.defineProperty,ME=(e,t)=>jE(e,`name`,{value:t,configurable:!0}),NE=[`Enter`,` `],PE=[`ArrowDown`,`PageUp`,`Home`],FE=[`ArrowUp`,`PageDown`,`End`],IE=[...PE,...FE];[...NE],[...NE];var LE=`Menu`,[RE,zE,BE]=Ey(LE),[VE,HE]=Sy(LE,[BE,RT,_E]),UE=RT(),WE=_E(),[GE,KE]=VE(LE),[qE,JE]=VE(LE),YE=ME(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=UE(t),[c,l]=m.useState(null),u=m.useRef(!1),d=wb(a),f=xb(i);return m.useEffect(()=>{let e=ME(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=ME(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),m.useEffect(()=>{if(!n)return;let e=ME(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,H.jsx)(ZT,{...s,children:(0,H.jsx)(GE,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(qE,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),XE=m.forwardRef(ME(function(e,t){let{__scopeMenu:n,...r}=e,i=UE(n);return(0,H.jsx)(QT,{...i,...r,ref:t})},`MenuAnchor`)),ZE=`MenuPortal`,[QE,$E]=VE(ZE,{forceMount:void 0}),eD=ME(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=KE(ZE,t);return(0,H.jsx)(QE,{scope:t,forceMount:n,children:(0,H.jsx)(sb,{present:n||a.open,children:(0,H.jsx)(rx,{asChild:!0,container:i,children:r})})})},`MenuPortal`),tD=`MenuContent`,[nD,rD]=VE(tD),iD=m.forwardRef(ME(function(e,t){let n=$E(tD,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=KE(tD,e.__scopeMenu),o=JE(tD,e.__scopeMenu);return(0,H.jsx)(RE.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(sb,{present:r||a.open,children:(0,H.jsx)(RE.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(aD,{...i,ref:t}):(0,H.jsx)(oD,{...i,ref:t})})})})},`MenuContent`)),aD=m.forwardRef(ME(function(e,t){let n=KE(tD,e.__scopeMenu),r=m.useRef(null),i=Zv(t,r);return m.useEffect(()=>{let e=r.current;if(e)return DS(e)},[]),(0,H.jsx)(cD,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),oD=m.forwardRef(ME(function(e,t){let n=KE(tD,e.__scopeMenu);return(0,H.jsx)(cD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),sD=ey(`MenuContent.ScrollLock`),cD=m.forwardRef(ME(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...g}=e,_=KE(tD,n),v=JE(tD,n),y=UE(n),b=WE(n),x=zE(n),[S,C]=m.useState(null),w=m.useRef(null),T=Zv(t,w,_.onContentChange),E=m.useRef(0),D=m.useRef(``),O=m.useRef(0),k=m.useRef(null),A=m.useRef(`right`),j=m.useRef(0),M=h?vS:m.Fragment,N=h?{as:sD,allowPinchZoom:!0}:void 0,ee=ME(e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=TD(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;ME((function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);m.useEffect(()=>()=>window.clearTimeout(E.current),[]),lx();let te=m.useCallback(e=>A.current===k.current?.side&&DD(e,k.current?.area),[]);return(0,H.jsx)(nD,{scope:n,searchRef:D,onItemEnter:m.useCallback(e=>{te(e)&&e.preventDefault()},[te]),onItemLeave:m.useCallback(e=>{te(e)||(w.current?.focus(),C(null))},[te]),onTriggerLeave:m.useCallback(e=>{te(e)&&e.preventDefault()},[te]),pointerGraceTimerRef:O,onPointerGraceIntentChange:m.useCallback(e=>{k.current=e},[]),children:(0,H.jsx)(M,{...N,children:(0,H.jsx)(Wb,{asChild:!0,trapped:i,onMountAutoFocus:X(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(Mb,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,H.jsx)(kE,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:X(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)($T,{role:`menu`,"aria-orientation":`vertical`,"data-state":bD(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:T,style:{outline:`none`,...g.style},onKeyDown:X(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=w.current;if(e.target!==i||!IE.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);FE.includes(e.key)&&a.reverse(),CD(a)}),onBlur:X(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:X(e.onPointerMove,OD(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),lD=`MenuItem`,uD=`menu.itemSelect`,dD=m.forwardRef(ME(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=m.useRef(null),o=JE(lD,e.__scopeMenu),s=rD(lD,e.__scopeMenu),c=Zv(t,a),l=m.useRef(!1),u=ME(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(uD,{bubbles:!0,cancelable:!0});e.addEventListener(uD,e=>r?.(e),{once:!0}),vy(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,H.jsx)(fD,{...i,ref:c,disabled:n,onClick:X(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:X(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:X(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&NE.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),fD=m.forwardRef(ME(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=rD(lD,n),s=WE(n),c=m.useRef(null),l=Zv(t,c),[u,d]=m.useState(!1),[f,p]=m.useState(``);return m.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,H.jsx)(RE.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,H.jsx)(AE,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(_y.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:X(e.onPointerMove,OD(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:X(e.onPointerLeave,OD(e=>o.onItemLeave(e))),onFocus:X(e.onFocus,()=>d(!0)),onBlur:X(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[pD,mD]=VE(`MenuRadioGroup`,{value:void 0,onValueChange:ME(()=>{},`onValueChange`)}),[hD,gD]=VE(`MenuItemIndicator`,{checked:!1}),_D=m.forwardRef(ME(function(e,t){let{__scopeMenu:n,...r}=e;return(0,H.jsx)(_y.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[vD,yD]=VE(`MenuSub`);function bD(e){return e?`open`:`closed`}ME(bD,`getOpenState`);function xD(e){return e===`indeterminate`}ME(xD,`isIndeterminate`);function SD(e){return xD(e)?`indeterminate`:e?`checked`:`unchecked`}ME(SD,`getCheckedState`);function CD(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}ME(CD,`focusFirst`);function wD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ME(wD,`wrapArray`);function TD(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=wD(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}ME(TD,`getNextMatch`);function ED(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ME(ED,`isPointInPolygon`);function DD(e,t){return t?ED({x:e.clientX,y:e.clientY},t):!1}ME(DD,`isPointerInGraceArea`);function OD(e){return t=>t.pointerType===`mouse`?e(t):void 0}ME(OD,`whenMouse`);var kD=YE,AD=XE,jD=eD,MD=iD,ND=dD,PD=_D,FD=Object.defineProperty,ID=(e,t)=>FD(e,`name`,{value:t,configurable:!0}),LD=`DropdownMenu`,[RD,zD]=Sy(LD,[HE]),BD=HE(),[VD,HD]=RD(LD),UD=ID(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=BD(t),l=m.useRef(null),[u,d]=$y({prop:i,defaultProp:a??!1,onChange:o,caller:LD});return(0,H.jsx)(VD,{scope:t,triggerId:_b(),triggerRef:l,contentId:_b(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(kD,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),WD=`DropdownMenuTrigger`,GD=m.forwardRef(ID(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=HD(WD,n),o=BD(n),s=Zv(t,a.triggerRef);return(0,H.jsx)(AD,{asChild:!0,...o,children:(0,H.jsx)(_y.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:X(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:X(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),KD=ID(e=>{let{__scopeDropdownMenu:t,...n}=e,r=BD(t);return(0,H.jsx)(jD,{...r,...n})},`DropdownMenuPortal`),qD=`DropdownMenuContent`,JD=m.forwardRef(ID(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=HD(qD,n),a=BD(n),o=m.useRef(!1);return(0,H.jsx)(MD,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:X(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),YD=m.forwardRef(ID(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=BD(n);return(0,H.jsx)(ND,{...i,...r,ref:t})},`DropdownMenuItem`)),XD=m.forwardRef(ID(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=BD(n);return(0,H.jsx)(PD,{...i,...r,ref:t})},`DropdownMenuSeparator`)),ZD=UD,QD=GD,$D=KD,eO=JD,tO=YD,nO=XD,rO=Object.defineProperty,iO=(e,t)=>rO(e,`name`,{value:t,configurable:!0}),aO=`Popover`,[oO,sO]=Sy(aO,[RT]),cO=RT(),[lO,uO]=oO(aO),dO=iO(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=cO(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=$y({prop:r,defaultProp:i??!1,onChange:a,caller:aO});return(0,H.jsx)(ZT,{...s,children:(0,H.jsx)(lO,{scope:t,contentId:_b(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),fO=`PopoverAnchor`,pO=m.forwardRef(iO(function(e,t){let{__scopePopover:n,...r}=e,i=uO(fO,n),a=cO(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return m.useEffect(()=>(o(),()=>s()),[o,s]),(0,H.jsx)(QT,{...a,...r,ref:t})},`PopoverAnchor`)),mO=`PopoverTrigger`,hO=m.forwardRef(iO(function(e,t){let{__scopePopover:n,...r}=e,i=uO(mO,n),a=cO(n),o=Zv(t,i.triggerRef),s=(0,H.jsx)(_y.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":OO(i.open),...r,ref:o,onClick:X(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,H.jsx)(QT,{asChild:!0,...a,children:s})},`PopoverTrigger`)),gO=`PopoverPortal`,[_O,vO]=oO(gO,{forceMount:void 0}),yO=iO(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=uO(gO,t);return(0,H.jsx)(_O,{scope:t,forceMount:n,children:(0,H.jsx)(sb,{present:n||a.open,children:(0,H.jsx)(rx,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),bO=`PopoverContent`,xO=m.forwardRef(iO(function(e,t){let n=vO(bO,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=uO(bO,e.__scopePopover);return(0,H.jsx)(sb,{present:r||a.open,children:a.modal?(0,H.jsx)(CO,{...i,ref:t}):(0,H.jsx)(wO,{...i,ref:t})})},`PopoverContent`)),SO=ey(`PopoverContent.RemoveScroll`),CO=m.forwardRef(iO(function(e,t){let n=uO(bO,e.__scopePopover),r=m.useRef(null),i=Zv(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return DS(e)},[]),(0,H.jsx)(vS,{as:SO,allowPinchZoom:!0,children:(0,H.jsx)(TO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),wO=m.forwardRef(iO(function(e,t){let n=uO(bO,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,H.jsx)(TO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),TO=m.forwardRef(iO(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=uO(bO,n),p=cO(n);return lx(),(0,H.jsx)(Wb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Mb,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,H.jsx)($T,{"data-state":OO(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),EO=`PopoverClose`,DO=m.forwardRef(iO(function(e,t){let{__scopePopover:n,...r}=e,i=uO(EO,n);return(0,H.jsx)(_y.button,{type:`button`,...r,ref:t,onClick:X(e.onClick,()=>i.onOpenChange(!1))})},`PopoverClose`));function OO(e){return e?`open`:`closed`}iO(OO,`getState`);var kO=dO,AO=pO,jO=hO,MO=yO,NO=xO,PO=DO,FO=Object.defineProperty,IO=(e,t)=>FO(e,`name`,{value:t,configurable:!0}),LO=`Switch`,[RO,zO]=Sy(LO),[BO,VO]=RO(LO);function HO(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=$y({prop:n,defaultProp:i??!1,onChange:c,caller:LO}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,H.jsx)(BO,{scope:t,...S,children:JO(d)?d(S):r})}IO(HO,`SwitchProvider`);var UO=`SwitchTrigger`,WO=m.forwardRef(IO(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=VO(UO,e),_=Zv(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=IO(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,H.jsx)(_y.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":YO(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:X(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),GO=m.forwardRef(IO(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,H.jsx)(HO,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(WO,{...d,ref:t,__scopeSwitch:n}),e&&(0,H.jsx)(qO,{__scopeSwitch:n})]})})},`Switch`)),KO=`SwitchBubbleInput`,qO=m.forwardRef(IO(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=VO(KO,e),_=Zv(r,g),v=iC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(s);return(0,H.jsx)(_y.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:X(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function JO(e){return typeof e==`function`}IO(JO,`isFunction`);function YO(e){return e?`checked`:`unchecked`}IO(YO,`getState`);var XO=Kv(`group/button motion-reduce:transition-none motion-reduce:active:scale-100 inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[scale,background-color,box-shadow,color,border-color] duration-150 active:not-aria-[haspopup]:scale-[0.97] ease-snap outline-none select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`btn-tint text-primary-foreground [--tint:var(--primary)] disabled:text-muted-foreground`,soft:`btn-soft text-foreground`,outline:`btn-outline text-foreground [&_svg]:text-muted-foreground`,secondary:`btn-soft text-secondary-foreground`,ghost:`btn-ghost text-foreground [&_svg]:text-muted-foreground hover:[&_svg]:text-foreground`,destructive:`btn-tint text-white [--tint:var(--destructive)] focus-visible:outline-destructive disabled:text-muted-foreground dark:text-background`,link:`text-link underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-7 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-2 px-4`,icon:`size-8`,"icon-xs":`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function ZO({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?ty:`button`;return(0,H.jsx)(a,{"aria-keyshortcuts":r?void 0:`Enter Space`,"aria-description":r?`When focused, press Enter to activate.`:`When focused, press Enter or Space to activate.`,"aria-describedby":`focused-action-help`,"data-slot":`button`,"data-variant":t,"data-size":n,className:Y(XO({variant:t,size:n,className:e})),...i})}var QO=Y(`pointer-events-none inline-flex h-[1.125rem] min-w-[1.125rem] w-fit items-center justify-center gap-1 rounded-[4px] border border-[var(--edge)] bg-[var(--hover)] px-[5px] font-sans text-[11px] leading-none font-medium text-muted-foreground select-none`,`in-data-[variant=default]:bg-primary-foreground/16 in-data-[variant=default]:text-primary-foreground`,`in-data-[variant=destructive]:bg-white/16 in-data-[variant=destructive]:text-current`,`[&_svg:not([class*='size-'])]:size-3`);function $O({className:e,...t}){return(0,H.jsx)(`kbd`,{"data-slot":`kbd`,className:Y(QO,e),...t})}function ek({className:e,...t}){return(0,H.jsx)(`kbd`,{"data-slot":`kbd-group`,className:Y(`inline-flex items-center gap-0.5`,e),...t})}var tk=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),nk={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},rk={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function ik(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return tk&&nk[t]?nk[t]:rk[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function ak({chord:e,className:t}){let n=ik(e);return(0,H.jsx)(ek,{className:t,children:n.map((e,t)=>(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,H.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,H.jsx)($O,{children:e})]},t))})}function ok({chord:e,children:t,className:n}){return(0,H.jsxs)(`span`,{className:Y(`kbd-hint inline-flex shrink-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,n),children:[(0,H.jsx)(ak,{chord:e}),t]})}var sk={type:`spring`,stiffness:560,damping:34,mass:.7,opacity:{duration:.14,ease:`easeOut`}};function ck({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,onEscapeKeyDown:c,children:l}){let u=Of();return(0,H.jsx)(FS,{open:e,onOpenChange:t,children:(0,H.jsx)(Nu,{children:e?(0,H.jsxs)(zS,{forceMount:!0,children:[(0,H.jsx)(VS,{asChild:!0,forceMount:!0,children:(0,H.jsx)(Qf.div,{className:`fixed inset-0 z-[1000] bg-scrim backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:`easeOut`}})}),(0,H.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-[1000] grid place-items-center p-4`,children:(0,H.jsx)(GS,{asChild:!0,forceMount:!0,onCloseAutoFocus:s,...c?{onEscapeKeyDown:c}:{},onInteractOutside:e=>{i||e.preventDefault()},onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[data-nav], [data-autofocus], textarea`);t&&(e.preventDefault(),t.focus())},...r?{}:{"aria-describedby":void 0},children:(0,H.jsxs)(Qf.div,{className:Y(`glass-pop pointer-events-auto flex max-h-[min(86svh,48rem)] w-full max-w-2xl flex-col overflow-hidden rounded-2xl outline-none`,a),style:o,initial:{opacity:0,scale:u?1:.98,y:u?0:6},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:u?1:.98,transition:{duration:.12,ease:`easeIn`}},transition:u?{duration:.12}:sk,children:[(0,H.jsx)(XS,{className:`sr-only`,children:n}),r?(0,H.jsx)(QS,{className:`sr-only`,children:r}):null,l]})})})]}):null})})}var lk=[],uk=0,dk=new Set;function fk(){for(let e of[...dk])e()}function pk(e){return dk.add(e),()=>{dk.delete(e)}}function mk(){let e;for(let t of lk)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var hk={image:40,question:30,confirm:20,help:10,sheet:5};function gk(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return lk=[...lk,{id:n,priority:t,order:++uk}],fk(),()=>{lk=lk.filter(e=>e.id!==n),fk()}},[e,t,n]);let r=(0,m.useSyncExternalStore)(pk,mk,()=>void 0);return e&&r===n}function _k(){return lk.length>0}function vk(){return(0,m.useSyncExternalStore)(pk,()=>lk.length>0,()=>!1)}var yk=[`lobby`,`tasks`,`plan`,`knowledge`],bk=`Attached files:`,xk=[{name:`master`,agent:`master`,hint:`The orchestrator: anything, and changes across the project`},{name:`design`,agent:`designer`,hint:`Frontend: pages, components, styling and UX`},{name:`dev`,agent:`backend`,hint:`Backend: APIs, data and server code`},{name:`qa`,agent:`qa`,hint:`Tests, and how to check a change`},{name:`research`,agent:`researcher`,hint:`Facts from the web: libraries, versions, docs`},{name:`scout`,agent:`scout`,hint:`Reads the code and explains how something works`}],Sk=[{name:`plan`,args:`what to plan`,hint:`Plan it with the panel on the Plan tab`},{name:`task`,args:`what to do`,hint:`Start it as a task for the team`}],Ck=new Set(yk);function wk(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean);if(t[0]===`sessions`||t[0]===`issues`||t[0]===`git`||t[0]===`excalidraw`||t[0]===`metrics`)return`#/lobby`;if(t[0]===`tasks`&&t[1]===`board`)return[`#/tasks`,...t.slice(2,3)].join(`/`)}function Tk(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean),n=t[0];if(!n||n===`lobby`)return{kind:`tab`,tab:`lobby`,rest:t.slice(1)};if(n===`settings`)return{kind:`settings`};if(Ck.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function Ek(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function Dk(e){window.location.hash!==e&&(window.location.hash=e)}function Ok(){let[e,t]=(0,m.useState)(()=>Tk(wk(window.location.hash)??window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=wk(window.location.hash),n=Tk(e||window.location.hash);(e||!n)&&window.history.replaceState(null,``,e??`#/lobby`),t(n??{kind:`tab`,tab:`lobby`,rest:[]})};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function kk(){return(0,H.jsx)(`svg`,{"aria-hidden":`true`,width:`0`,height:`0`,className:`absolute`,children:(0,H.jsxs)(`filter`,{id:`cs-loadgoo`,x:`-40%`,y:`-90%`,width:`180%`,height:`280%`,colorInterpolationFilters:`sRGB`,children:[(0,H.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`3.2`,result:`b`}),(0,H.jsx)(`feColorMatrix`,{in:`b`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10`})]})})}function Ak({label:e=`Connecting…`}){return(0,H.jsxs)(`div`,{role:`status`,className:`flex min-h-48 min-w-0 w-full max-w-full flex-1 items-center justify-center gap-5 overflow-y-auto px-4 py-8 text-sm text-muted-foreground`,children:[(0,H.jsx)(kk,{}),(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`cs-gi cs-big`,children:[(0,H.jsx)(`span`,{className:`cs-gb cs-a`}),(0,H.jsx)(`span`,{className:`cs-gb cs-b`}),(0,H.jsx)(`span`,{className:`cs-gb cs-c`})]}),(0,H.jsx)(`span`,{children:e})]})}function jk({message:e,onRetry:t}){return(0,H.jsx)(`div`,{className:`grid min-h-0 min-w-0 flex-1 place-items-center overflow-y-auto p-4`,children:(0,H.jsxs)(`div`,{role:`alert`,className:`cs-dlg cs-errc`,children:[(0,H.jsxs)(`h2`,{children:[(0,H.jsx)(Yg,{className:`size-[18px] text-[var(--bad)]`,"aria-hidden":`true`}),`Could not load this view`]}),(0,H.jsx)(`p`,{children:e??`The request failed. Try again.`}),t?(0,H.jsxs)(ZO,{variant:`outline`,onClick:t,children:[(0,H.jsx)(Tg,{"aria-hidden":`true`}),`Try again`]}):null]})})}function Mk({onRetry:e}){return(0,H.jsxs)(`div`,{role:`status`,className:`cs-banner`,children:[(0,H.jsx)(a_,{className:`cs-wi size-[18px]`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Lost pi — reconnecting every 2 s. Your planning session and tasks carry on when it is back.`}),e?(0,H.jsx)(ZO,{onClick:e,children:`Retry now`}):null]})}function Nk({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`empty`,className:Y(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 p-6 text-center text-balance`,e),...t})}function Pk({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`empty-header`,className:Y(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var Fk=Kv(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`relative flex size-9 shrink-0 items-center justify-center rounded-md border bg-card text-foreground shadow-sm/5 [&_svg:not([class*='size-'])]:size-4.5`}},defaultVariants:{variant:`default`}});function Ik({className:e,variant:t=`default`,...n}){return(0,H.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:Y(Fk({variant:t,className:e})),...n})}function Lk({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`empty-description`,className:Y(`text-[0.8125rem] leading-[1.125rem] text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function Rk({items:e,value:t,onChange:n,label:r,as:i=`radio`,size:a=`sm`,className:o,idPrefix:s}){let c=(0,m.useId)(),l=Of()??!1,u=s??c;function d(r){let i=Math.max(0,e.findIndex(e=>e.id===t)),a=r.key===`ArrowRight`||r.key===`ArrowDown`?1:r.key===`ArrowLeft`||r.key===`ArrowUp`?-1:0,o=a?(i+a+e.length)%e.length:r.key===`Home`?0:r.key===`End`?e.length-1:-1;if(o<0)return;r.preventDefault(),r.stopPropagation();let s=e[o];n(s.id);let c=0,l=()=>{let e=document.getElementById(`${u}-${s.id}`);e&&e.tabIndex===0?e.focus():c++<20&&requestAnimationFrame(l)};requestAnimationFrame(l)}let f=Math.max(0,e.findIndex(e=>e.id===t));return(0,H.jsxs)(`div`,{role:i===`tab`?`tablist`:i===`radio`?`radiogroup`:void 0,"aria-label":i===`nav`?void 0:r,onKeyDown:d,"data-slot":`segmented`,"data-reduce":l||void 0,style:{"--n":e.length,"--k":f},className:Y(`cs-seg`,a===`sm`&&`cs-sm`,o),children:[(0,H.jsx)(`i`,{"aria-hidden":`true`,className:`cs-thumb`}),e.map(e=>{let r=e.id===t;return(0,H.jsx)(`button`,{id:`${u}-${e.id}`,type:`button`,"data-segment":e.id,"data-on":r?`true`:void 0,role:i===`nav`?void 0:i,...i===`tab`?{"aria-selected":r,"aria-controls":e.controls}:i===`radio`?{"aria-checked":r}:{"aria-current":r?`page`:void 0,"aria-controls":e.controls},"aria-label":e.name,tabIndex:r||i===`nav`?0:-1,onClick:()=>n(e.id),children:e.label},e.id)})]})}function zk(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>F.subscribe(t),[]),e}function Bk(){return zk(),F.status()}function Vk(e){return zk(),F.get(e)}function Hk(e){let t=(0,m.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]),n=(0,m.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,m.useSyncExternalStore)(t,n)}function Uk(e){let t=e;for(;t instanceof HTMLElement&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(t.type)||t instanceof HTMLElement&&t.isContentEditable}function Wk(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function Gk(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var Kk=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function qk(e){return[...e.querySelectorAll(Kk)].filter(e=>e.offsetParent!==null)}function Jk(e,t,n){let r=qk(e);if(r.length===0)return;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1;r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))]?.focus()}function Yk(e,t=document.querySelector(`[data-pane='list']`)){if(!t)return;let n=[...t.querySelectorAll(`button[data-row]`)].filter(e=>e.offsetParent!==null),r=n.findIndex(e=>e.getAttribute(`aria-current`)===`true`),i=Math.max(0,Math.min(n.length-1,r<0?e>0?0:n.length-1:r+e));n[i]?.click(),n[i]?.focus({preventScroll:!0}),n[i]?.scrollIntoView({block:`nearest`})}function Xk(e){return e.querySelector(`[aria-current='true']`)??qk(e)[0]}function Zk(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?Xk(t):void 0)??qk(e)[0]??e).focus(),!0}function Qk(){let e=document.querySelector(`[role='tab'][aria-selected='true']`);if(e)return e.focus({preventScroll:!0}),!0;let t=document.getElementById(`main`);return t?.focus({preventScroll:!0}),!!t}var $k={active:!1},eA=Kv(`bg-muted-foreground/15 motion-safe:animate-skeleton`,{variants:{shape:{block:`rounded-sm`,card:`rounded-lg`,pill:`rounded-full`}},defaultVariants:{shape:`block`}});function tA({className:e,shape:t,...n}){return(0,H.jsx)(`div`,{"aria-hidden":`true`,className:Y(eA({shape:t}),e),"data-slot":`skeleton`,...n})}function nA(){return(0,H.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,H.jsx)(tA,{shape:`card`,className:`h-11`},e))})}var rA=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function iA(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!rA.has(t)}function aA(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function oA(){return _k()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}var sA=(0,m.createContext)(null);function cA(e){return!e.current||!!document.querySelector(`[role='alertdialog'], [role='menu'], [role='listbox']`)}function lA(e,t,{enabled:n=!0,inDialog:r=!1}={}){let i=(0,m.useRef)(t);i.current=t;let a=(0,m.useContext)(sA);(0,m.useEffect)(()=>{if(!n||!e)return;let t=t=>{t.defaultPrevented||t.isComposing||t.repeat||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||aA(t,e)&&(Uk(t.target)||!r&&(a?cA(a):oA())||(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r,a])}var uA=480;function dA({open:e,onClose:t,label:n,head:r,children:i,className:a,onEscape:o,closeText:s}){let c=(0,m.useRef)(!1);c.current=gk(e,hk.sheet);let l=e,u=(0,m.useRef)({head:r,children:i});l&&(u.current={head:r,children:i});let[d,f]=(0,m.useState)(l),[p,h]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(l){f(!0);let e=requestAnimationFrame(()=>requestAnimationFrame(()=>h(!0)));return()=>cancelAnimationFrame(e)}h(!1);let e=window.setTimeout(()=>f(!1),uA);return()=>window.clearTimeout(e)},[l]);let g=(0,m.useRef)(null);return!d&&!l?null:(0,H.jsx)(FS,{open:l,onOpenChange:e=>!e&&t(),modal:l,children:(0,H.jsx)(sA.Provider,{value:c,children:(0,H.jsx)(zS,{forceMount:!0,children:(0,H.jsxs)(`div`,{className:Y(`cs-shw`,a),"data-open":p&&l?`true`:void 0,children:[(0,H.jsx)(VS,{forceMount:!0,className:`cs-shbd`}),(0,H.jsxs)(GS,{forceMount:!0,"aria-describedby":void 0,className:`cs-shp`,...o?{onEscapeKeyDown:o}:{},children:[(0,H.jsx)(XS,{className:`sr-only`,children:n}),(0,H.jsxs)(`div`,{className:`cs-shh`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:u.current.head}),s?(0,H.jsxs)(eC,{className:`cs-kc cs-sm`,"data-tip":`Close`,"data-tip-keys":`Esc`,children:[`Close `,(0,H.jsx)(`span`,{className:`cs-kb`,children:`Esc`})]}):(0,H.jsx)(eC,{className:`cs-kc cs-sm cs-ib`,"aria-label":`Close`,"data-tip":`Close`,"data-tip-keys":`Esc`,children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5`})})]}),(0,H.jsx)(`div`,{ref:g,"data-pane":`detail`,className:`cs-shb`,children:u.current.children}),(0,H.jsx)(Uv,{target:g})]})]})})})})}var fA=[`master`,`designer`,`backend`,`qa`],pA={master:`Orchestrator`,designer:`Designer`,backend:`Backend`,qa:`QA`},mA=`Every write archives the version before it.`;function hA(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function gA(e){return`over the compaction threshold — ask the orchestrator to compact ${e}`}function _A(e){return{text:e.text,occurrence:e.occurrence}}function vA(e){return fA.map(t=>{let n=e.filter(e=>e.agent===t);return{agent:t,files:n,notes:n.reduce((e,t)=>e+t.notes,0)}}).filter(e=>e.files.length>0)}var yA=864e5,bA=e=>e.replace(/^\s*(?:[-*+]|\d+[.)])\s+(?:\[[ x]\]\s+)?/i,``).trim().toLowerCase();function xA(e,t,n=Date.now()){if(!t)return e;let r=bA(e.entry.text),i=t=>t.agent===e.agent&&t.file===e.file&&bA(t.entry)===r,a=t.events.filter(i).sort((e,t)=>Date.parse(e.at)-Date.parse(t.at)),o=a[0],s=o?Date.parse(o.at):0,c=t.runs[e.agent],l=(c?.recent??[]).filter(e=>Date.parse(e.at)>=s),u=t.proposals.find(t=>t.agent===e.agent&&t.replaces&&bA(t.replaces)===r),d=c?.lastAt?Date.parse(c.lastAt):0,f=d?Math.floor((n-d)/yA):0,p=u?{kind:`conflict`,proposal:u.id}:d&&f>=60&&(!s||n-s>=60*yA)?{kind:`stale`,days:f}:void 0,m=a.find(e=>e.source)?.source;return{...e,pinned:t.pins.some(i),history:a,...m?{source:m}:{},...o?{since:o.at}:{},uses:l,...p?{flag:p}:{}}}function SA(e){return e.replace(/^#+\s*/,``).toLowerCase().replace(/[^a-z0-9\s-]/g,``).trim().split(/\s+/).slice(0,2).join(`-`)}function CA(e){return e.text.replace(/^\s*(?:[-*+]|\d+[.)])\s+/,``).trim()}function wA(e,t=0){let n=[],r=``;return e.entries.forEach((i,a)=>{if(i.kind===`heading`){r=SA(i.text);return}let o=CA(i);if(!o)return;let s=[...o.matchAll(/(?:^|\s)#([a-z][\w-]{1,30})/gi)].map(e=>e[1].toLowerCase()),c=[...new Set([...r?[r]:[],...s])];n.push({key:`${e.agent}/${e.file}#${a}`,agent:e.agent,file:e.file,entry:i,text:o,tags:c,comments:e.attached.filter(e=>e.entry===i.text),order:t+n.length,pinned:!1,history:[],uses:[]})}),n}function TA(){zk();let e=`${F.status().connection},${F.get(`knowledge`).version}`,[t,n]=(0,m.useState)(0),[r,i]=(0,m.useState)({files:[],models:{},views:[],notes:[],proposals:[],loading:!0});return(0,m.useEffect)(()=>{let e=!0;return i(e=>({...e,loading:!0})),(async()=>{try{let[t,n]=await Promise.all([R(`knowledge.files`,{}),R(`knowledge.ledger`,{}).catch(()=>void 0)]),r=await Promise.all(t.files.map(e=>R(`knowledge.open`,{agent:e.agent,file:e.file}).then(e=>e.view))),a=[];for(let e of r)a.push(...wA(e,a.length));let o=Date.now();e&&i({files:t.files,...t.threshold?{threshold:t.threshold}:{},models:t.models??{},views:r,notes:a.map(e=>xA(e,n,o)),proposals:n?.proposals??[],...n?{ledger:n}:{},loading:!1})}catch(t){e&&i(e=>({...e,error:t instanceof Error?t.message:String(t),loading:!1}))}})(),()=>{e=!1}},[e,t]),{...r,reload:()=>n(e=>e+1)}}var EA={master:`var(--c-orc)`,designer:`var(--c-des)`,backend:`var(--c-dev)`,qa:`var(--c-qa)`},DA=e=>pA[e][0];function OA(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return!0;let r=[e.text,e.file,pA[e.agent],e.source??``,...e.tags.map(e=>`#${e}`),...e.comments.map(e=>e.text)].join(` `).toLowerCase();return n.every(e=>r.includes(e))}function kA(e,t,n){let r=e.filter(e=>e.agent===t);return r.find(e=>e.file===n)?.file??r[0]?.file??`knowledge.md`}function AA(e,t=Date.now()){let n=e?Date.parse(e):NaN;if(Number.isNaN(n))return``;let r=Math.floor((t-n)/yA);return r<1?t-n<36e5?`just now`:`today`:r<14?`${r}d ago`:new Date(n).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}var jA=e=>e===0?`Never used`:`${e} ${e===1?`use`:`uses`}`;function MA(e,t=Date.now()){let n=Array.from({length:14},()=>0);for(let r of e){let e=Math.floor((t-Date.parse(r.at))/yA);e>=0&&e<14&&(n[13-e]+=1)}let r=Math.max(1,...n);return n.map(e=>e?Math.max(24,Math.round(e/r*100)):0)}function NA(e,t){G(`knowledge.ask`,{text:`${pA[e]}'s ${t.join(` and `)} ${t.length===1?`is`:`are`} over the compaction threshold. Compact ${t.length===1?`it`:`them`}: merge duplicates, drop what is out of date, keep every rule and decision.`})}function PA({data:e,onOpen:t}){let n=e.threshold??Math.max(1,...e.files.map(e=>e.chars)),r=Date.now()-2592e6;return(0,H.jsx)(`div`,{className:`cs-kag4`,children:vA(e.files).map(i=>{let a=e.notes.filter(e=>e.agent===i.agent),o=(e.ledger?.runs[i.agent]?.recent??[]).filter(e=>Date.parse(e.at)>=r).length,s=e.proposals.filter(e=>e.agent===i.agent).length,c=i.files.filter(e=>e.over),l=[...a].sort((e,t)=>Date.parse(t.since??``)-Date.parse(e.since??``)||t.order-e.order).slice(0,2);return(0,H.jsxs)(`section`,{className:`cs-kagc`,style:{"--c":EA[i.agent]},"aria-label":pA[i.agent],children:[(0,H.jsxs)(`div`,{className:`cs-kagh`,children:[(0,H.jsx)(`span`,{className:`cs-kat`,"aria-hidden":`true`,children:DA(i.agent)}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h3`,{children:pA[i.agent]}),e.models[i.agent]?(0,H.jsx)(`p`,{children:e.models[i.agent]}):null]}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm`,onClick:()=>t(i.agent),children:`Open notes`})]}),(0,H.jsxs)(`div`,{className:`cs-kst`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`b`,{children:a.length}),(0,H.jsx)(`span`,{children:`notes`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`b`,{children:a.filter(e=>e.pinned).length}),(0,H.jsx)(`span`,{children:`pinned`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`b`,{children:o}),(0,H.jsx)(`span`,{children:`uses this month`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`b`,{children:s}),(0,H.jsx)(`span`,{children:`to review`})]})]}),(0,H.jsx)(`div`,{className:`cs-kagl`,children:`Starts every session with`}),i.files.map(t=>(0,H.jsxs)(`div`,{className:`cs-kbf`,"data-over":t.over||void 0,children:[(0,H.jsx)(`span`,{className:`truncate`,title:t.file,children:t.file}),(0,H.jsx)(`span`,{className:`cs-kbt`,"aria-hidden":`true`,children:(0,H.jsx)(`i`,{style:{width:`${Math.min(100,Math.max(3,Math.round(t.chars/n*100)))}%`}})}),(0,H.jsxs)(`span`,{className:`cs-v`,children:[hA(t.chars),e.threshold?` / ${hA(e.threshold)}`:` chars`,t.over?` · over`:``]})]},t.file)),c.length?(0,H.jsxs)(`p`,{className:`cs-kagw`,children:[(0,H.jsx)(zm,{"aria-hidden":`true`,className:`size-3.5`}),`Over the compaction threshold`,(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm`,onClick:()=>NA(i.agent,c.map(e=>e.file)),children:`Ask the orchestrator to compact`})]}):null,l.length?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`cs-kagl`,children:`Recently learned`}),(0,H.jsx)(`ul`,{className:`cs-kagr`,children:l.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{title:e.text,children:e.text.replace(/`/g,``)}),(0,H.jsx)(`i`,{children:AA(e.since)||e.file})]},e.key))})]}):null]},i.agent)})})}var FA,IA=new Set;function LA(e){return IA.add(e),()=>{IA.delete(e)}}function RA(){return(0,m.useSyncExternalStore)(LA,()=>FA,()=>void 0)}function zA(e){(0,m.useEffect)(()=>{FA=e;for(let e of[...IA])e();return()=>{if(FA===e){FA=void 0;for(let e of[...IA])e()}}},[e])}var BA=`bot-lobby:knowledge-asked`,VA=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HA=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UA={};function WA(e,t){return((t||UA).jsx?HA:VA).test(e)}var GA={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},KA=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
60
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),qA=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(KA());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),JA=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),YA=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(qA()),r=JA();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),XA=QA(`end`),ZA=QA(`start`);function QA(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function $A(e){let t=ZA(e),n=XA(e);if(t&&n)return{start:t,end:n}}function ej(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?nj(e.position):`start`in e||`end`in e?nj(e):`line`in e||`column`in e?tj(e):``}function tj(e){return rj(e&&e.line)+`:`+rj(e&&e.column)}function nj(e){return tj(e&&e.start)+`-`+tj(e&&e.end)}function rj(e){return e&&typeof e==`number`?e:1}var ij=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ej(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ij.prototype.file=``,ij.prototype.name=``,ij.prototype.reason=``,ij.prototype.message=``,ij.prototype.stack=``,ij.prototype.column=void 0,ij.prototype.line=void 0,ij.prototype.ancestors=void 0,ij.prototype.cause=void 0,ij.prototype.fatal=void 0,ij.prototype.place=void 0,ij.prototype.ruleId=void 0,ij.prototype.source=void 0;var aj=t(YA(),1),oj={}.hasOwnProperty,sj=new Map,cj=/[A-Z]/g,lj=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),uj=new Set([`td`,`th`]),dj=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function fj(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Cj(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Sj(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?a:l,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=pj(i,e,void 0);return o&&typeof o!=`string`?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function pj(e,t,n){if(t.type===`element`)return mj(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return hj(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return _j(e,t,n);if(t.type===`mdxjsEsm`)return gj(e,t);if(t.type===`root`)return vj(e,t,n);if(t.type===`text`)return yj(e,t)}function mj(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=a,e.schema=i),e.ancestors.push(t);let o=kj(e,t.tagName,!1),s=wj(e,t),l=Ej(e,t);return lj.has(t.tagName)&&(l=l.filter(function(e){return typeof e!=`string`||!c(e)})),bj(e,s,o,t),xj(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function hj(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Aj(e,t.position)}function gj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Aj(e,t.position)}function _j(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=a,e.schema=i),e.ancestors.push(t);let o=t.name===null?e.Fragment:kj(e,t.name,!0),s=Tj(e,t),c=Ej(e,t);return bj(e,s,o,t),xj(s,c),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function vj(e,t,n){let r={};return xj(r,Ej(e,t)),e.create(t,e.Fragment,r,n)}function yj(e,t){return t.value}function bj(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xj(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Sj(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Cj(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ZA(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function wj(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&oj.call(t.properties,i)){let a=Dj(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&uj.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Tj(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Aj(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Aj(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Ej(e,t){let n=[],r=-1,i=e.passKeys?new Map:sj;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=pj(e,a,o);s!==void 0&&n.push(s)}return n}function Dj(e,t,n){let i=r(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?u(n):s(n)),i.property===`style`){let t=typeof n==`object`?n:Oj(e,String(n));return e.stylePropertyNameCase===`css`&&(t=jj(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&i.space?GA[i.property]||i.property:i.attribute,n]}}function Oj(e,t){try{return(0,aj.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ij("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=dj+`#cannot-parse-style-attribute`,r}}function kj(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=WA(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=WA(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return oj.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Aj(e)}function Aj(e,t){let n=new ij("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=dj+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function jj(e){let t={},n;for(n in e)oj.call(e,n)&&(t[Mj(n)]=e[n]);return t}function Mj(e){let t=e.replace(cj,Nj);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Nj(e){return`-`+e.toLowerCase()}var Pj={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Fj={};function Ij(e,t){let n=t||Fj;return Lj(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Lj(e,t,n){if(zj(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Rj(e.children,t,n)}return Array.isArray(e)?Rj(e,t,n):``}function Rj(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Lj(e[i],t,n);return r.join(``)}function zj(e){return!!(e&&typeof e==`object`)}var Bj=document.createElement(`i`);function Vj(e){let t=`&`+e+`;`;Bj.innerHTML=t;let n=Bj.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Hj(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Uj(e,t){return e.length>0?(Hj(e,e.length,0,t),e):t}var Wj={}.hasOwnProperty;function Gj(e){let t={},n=-1;for(;++n<e.length;)Kj(t,e[n]);return t}function Kj(e,t){let n;for(n in t){let r=(Wj.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Wj.call(r,a)||(r[a]=[]);let e=i[a];qj(r[a],Array.isArray(e)?e:e?[e]:[])}}}function qj(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Hj(e,0,0,r)}function Jj(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Yj(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Xj=sM(/[A-Za-z]/),Zj=sM(/[\dA-Za-z]/),Qj=sM(/[#-'*+\--9=?A-Z^-~]/);function $j(e){return e!==null&&(e<32||e===127)}var eM=sM(/\d/),tM=sM(/[\dA-Fa-f]/),nM=sM(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function rM(e){return e!==null&&(e<0||e===32)}function iM(e){return e===-2||e===-1||e===32}var aM=sM(/\p{P}|\p{S}/u),oM=sM(/\s/);function sM(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function cM(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Zj(e.charCodeAt(n+1))&&Zj(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function lM(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return iM(r)?(e.enter(n),s(r)):t(r)}function s(r){return iM(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function uM(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&iM(t)?(e.enter(r),c(t)):l(t)}function c(t){return iM(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var dM={tokenize:fM};function fM(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),lM(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var pM=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){mM(this,e,t,n,!1)}addBefore(e,t,n){mM(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function mM(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var hM={tokenize:_M},gM={tokenize:vM};function _M(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new pM;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gM,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(gM,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Z(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new pM;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vM(e,t,n){return lM(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function yM(e){if(e===null||rM(e)||oM(e))return 1;if(aM(e))return 2}function bM(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var xM={name:`attention`,resolveAll:SM,tokenize:CM};function SM(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};wM(o,-a),wM(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Uj(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Uj(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Uj(r,bM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Uj(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Uj(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Hj(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function CM(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yM(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=yM(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function wM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var TM={name:`autolink`,tokenize:EM};function EM(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Xj(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Zj(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Zj(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||$j(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Qj(t)?(e.consume(t),l):n(t)}function u(e){return Zj(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Zj(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var DM={partial:!0,tokenize:OM};function OM(e,t,n){return r;function r(t){return iM(t)?lM(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Z(e)?t(e):n(e)}}var kM={continuation:{tokenize:jM},exit:MM,name:`blockQuote`,tokenize:AM};function AM(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return iM(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function jM(e,t,n){let r=this;return i;function i(t){return iM(t)?lM(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(kM,t,n)(r)}}function MM(e){e.exit(`blockQuote`)}var NM={name:`characterEscape`,tokenize:PM};function PM(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return nM(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var FM={name:`characterReference`,tokenize:IM};function IM(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Zj,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=tM,u):(e.enter(`characterReferenceValue`),a=7,o=eM,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Zj&&!Vj(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var LM={partial:!0,tokenize:RM};function RM(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var zM={concrete:!0,name:`codeFenced`,tokenize:BM};function BM(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),iM(t)?lM(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(LM,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):iM(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),lM(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&iM(t)?lM(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Z(t)?e.check(LM,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),iM(t)?lM(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),iM(t)?lM(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var VM={name:`codeIndented`,tokenize:UM},HM={partial:!0,tokenize:WM};function UM(e,t,n){return r;function r(t){return e.enter(`codeIndented`),uM(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Z(t)?e.attempt(HM,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function WM(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):uM(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Z(e)?i(e):n(e)}}var GM={name:`codeText`,previous:qM,resolve:KM,tokenize:JM};function KM(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function qM(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function JM(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Z(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var YM=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&XM(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),XM(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),XM(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);XM(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);XM(this.left,t.reverse())}}}};function XM(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ZM(e){let t={},n=-1,r,i,a,o,s,c,l,u=new YM(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,QM(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Hj(e,0,1/0,u.slice(0)),!l}function QM(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var $M={resolve:tN,tokenize:nN},eN={partial:!0,tokenize:rN};function tN(e){return ZM(e),e}function nN(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Z(t)?e.check(eN,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function rN(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),lM(e,a,`linePrefix`)}function a(i){if(i===null||Z(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function iN(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||$j(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Z(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||rM(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||$j(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function aN(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Z(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!iM(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function oN(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),lM(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Z(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function sN(e,t){let n;return r;function r(i){return Z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):iM(i)?lM(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var cN={name:`definition`,tokenize:uN},lN={partial:!0,tokenize:dN};function uN(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return aN.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Yj(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return rM(t)?sN(e,l)(t):l(t)}function l(t){return iN(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(lN,d,d)(t)}function d(t){return iM(t)?lM(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function dN(e,t,n){return r;function r(t){return rM(t)?sN(e,i)(t):n(t)}function i(t){return oN(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return iM(t)?lM(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Z(e)?t(e):n(e)}}var fN={name:`hardBreakEscape`,tokenize:pN};function pN(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var mN={name:`headingAtx`,resolve:hN,tokenize:gN};function hN(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};Hj(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function gN(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||rM(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Z(n)?(e.exit(`atxHeading`),t(n)):iM(n)?lM(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||rM(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var _N=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),vN=[`pre`,`script`,`style`,`textarea`],yN={concrete:!0,name:`htmlFlow`,resolveTo:xN,tokenize:SN},bN={partial:!0,tokenize:CN};function xN(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SN(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):Xj(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Xj(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Xj(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||rM(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&vN.includes(l)?(i=1,r.interrupt?t(s):O(s)):_N.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Zj(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return iM(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Xj(t)?(e.consume(t),b):iM(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Zj(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):iM(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):iM(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Z(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||rM(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||iM(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Z(t)?O(t):iM(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):Z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(bN,re,k)(t)):t===null||Z(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(LM,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Z(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return vN.includes(n)?(e.consume(t),ne):O(t)}return Xj(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||Z(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function CN(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(DM,t,n)}}var wN={name:`htmlText`,tokenize:TN};function TN(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Xj(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Xj(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Z(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Z(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Z(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Z(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Xj(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Zj(t)?(e.consume(t),S):C(t)}function C(t){return Z(t)?(o=C,N(t)):iM(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Zj(t)?(e.consume(t),w):t===47||t===62||rM(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Xj(t)?(e.consume(t),E):Z(t)?(o=T,N(t)):iM(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Zj(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Z(t)?(o=D,N(t)):iM(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Z(t)?(o=O,N(t)):iM(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Z(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||rM(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||rM(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return iM(t)?lM(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var EN={name:`labelEnd`,resolveAll:AN,resolveTo:jN,tokenize:MN},DN={tokenize:NN},ON={tokenize:PN},kN={tokenize:FN};function AN(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Hj(e,0,e.length,n),e}function jN(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Uj(o,e.slice(i+1,i+r+3)),o=Uj(o,[[`enter`,l,t]]),o=Uj(o,bM(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Uj(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Uj(o,e.slice(a+1)),o=Uj(o,[[`exit`,s,t]]),Hj(e,i,e.length,o),e}function MN(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Yj(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(DN,u,o?u:d)(t):t===91?e.attempt(ON,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(kN,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function NN(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return rM(t)?sN(e,a)(t):a(t)}function a(t){return t===41?u(t):iN(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return rM(t)?sN(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?oN(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return rM(t)?sN(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function PN(e,t,n){let r=this;return i;function i(t){return aN.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Yj(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function FN(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var IN={name:`labelStartImage`,resolveAll:EN.resolveAll,tokenize:LN};function LN(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var RN={name:`labelStartLink`,resolveAll:EN.resolveAll,tokenize:zN};function zN(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var BN={name:`lineEnding`,tokenize:VN};function VN(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),lM(e,t,`linePrefix`)}}var HN={name:`thematicBreak`,tokenize:UN};function UN(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),iM(t)?lM(e,s,`whitespace`)(t):s(t))}}var WN={continuation:{tokenize:JN},exit:XN,name:`list`,tokenize:qN},GN={partial:!0,tokenize:ZN},KN={partial:!0,tokenize:YN};function qN(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:eM(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(HN,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return eM(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(DM,r.interrupt?n:u,e.attempt(GN,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return iM(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function JN(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(DM,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lM(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!iM(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(KN,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,lM(e,e.attempt(WN,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function YN(e,t,n){let r=this;return lM(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function XN(e){e.exit(this.containerState.type)}function ZN(e,t,n){let r=this;return lM(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!iM(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var QN={name:`setextUnderline`,resolveTo:$N,tokenize:eP};function $N(e,t){let n=new pM,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function eP(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),iM(t)?lM(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var tP={tokenize:nP};function nP(e){let t=this,n=e.attempt(DM,r,e.attempt(this.parser.constructs.flowInitial,i,lM(e,e.attempt(this.parser.constructs.flow,i,e.attempt($M,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var rP={resolveAll:sP()},iP=oP(`string`),aP=oP(`text`);function oP(e){return{resolveAll:sP(e===`text`?cP:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function sP(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function cP(e,t){let n=new pM,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var lP=e({attentionMarkers:()=>_P,contentInitial:()=>dP,disable:()=>vP,document:()=>uP,flow:()=>pP,flowInitial:()=>fP,insideSpan:()=>gP,string:()=>mP,text:()=>hP}),uP={42:WN,43:WN,45:WN,48:WN,49:WN,50:WN,51:WN,52:WN,53:WN,54:WN,55:WN,56:WN,57:WN,62:kM},dP={91:cN},fP={[-2]:VM,[-1]:VM,32:VM},pP={35:mN,42:HN,45:[QN,HN],60:yN,61:QN,95:HN,96:zM,126:zM},mP={38:FM,92:NM},hP={[-5]:BN,[-4]:BN,[-3]:BN,33:IN,38:FM,42:xM,60:[TM,wN],91:RN,92:[fN,NM],93:EN,95:xM,96:GM},gP={null:[xM,rP]},_P={null:[42,95]},vP={null:[]};function yP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Uj(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=bM(a,l.events,l),l.events):[]}function f(e,t){return xP(p(e),t)}function p(e){return bP(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Z(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Hj(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bP(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function xP(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
61
- `;break;case-3:o=`\r
62
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function SP(e){let t={constructs:Gj([lP,...(e||{}).extensions||[]]),content:n(dM),defined:[],document:n(hM),flow:n(tP),lazy:{},string:n(iP),text:n(aP)};return t;function n(e){return n;function n(n){return yP(t,e,n)}}}function CP(e){for(;!ZM(e););return e}var wP=/[\0\t\n\r]/g;function TP(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){wP.lastIndex=c;let n=wP.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var EP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DP(e){return e.replace(EP,OP)}function OP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Jj(n.slice(t?2:1),t?16:10)}return Vj(n)||e}var kP={}.hasOwnProperty;function AP(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),jP(n)(CP(SP(n).document().write(TP()(e,t,!0))))}function jP(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(pe),blockQuote:a(ue),characterEscape:T,characterReference:T,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(fe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(I),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(L),hardBreakEscape:a(me),hardBreakTrailing:a(me),htmlFlow:a(he,o),htmlFlowData:T,htmlText:a(he,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:ie,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(pe),strong:a(xe),thematicBreak:a(Se)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:F,autolinkProtocol:le,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:se,characterReference:ce,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:te,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ae,resourceDestinationString:P,resourceTitleString:ne,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};NP(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];kP.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||FP).call(a,void 0,e[0])}for(r.position={start:MP(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:MP(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:MP(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||FP).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ej({start:e.start,end:e.end})+`): it’s not open`);n.position.end=MP(e.end)}function u(){return Ij(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Yj(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=R(),n.position={start:MP(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=MP(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=MP(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=DP(t),n.identifier=Yj(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Yj(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function oe(e){this.data.characterReferenceType=e.type}function se(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Jj(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Vj(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=MP(e.end)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function F(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[]}}function de(){return{type:`code`,lang:null,meta:null,value:``}}function fe(){return{type:`inlineCode`,value:``}}function I(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function L(){return{type:`emphasis`,children:[]}}function pe(){return{type:`heading`,depth:0,children:[]}}function me(){return{type:`break`}}function he(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function R(){return{type:`text`,value:``}}function Se(){return{type:`thematicBreak`}}}function MP(e){return{line:e.line,column:e.column,offset:e.offset}}function NP(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?NP(e,r):PP(e,r)}}function PP(e,t){let n;for(n in t)if(kP.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function FP(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+ej({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ej({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+ej({start:t.start,end:t.end})+`) is still open`)}function IP(e){let t=this;t.parser=n;function n(n){return AP(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function LP(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function RP(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
63
- `}]}function zP(e,t){let n=t.value?t.value+`
64
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function BP(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VP(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HP(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=cM(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function UP(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WP(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function GP(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function KP(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return GP(e,t);let i={src:cM(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function qP(e,t){let n={src:cM(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function JP(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function YP(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return GP(e,t);let i={href:cM(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function XP(e,t){let n={href:cM(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZP(e,t,n){let r=e.all(t),i=n?QP(n):$P(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
65
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
66
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function QP(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=$P(n[r])}return t}function $P(e){return e.spread??e.children.length>1}function eF(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function tF(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nF(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rF(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iF(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ZA(t.children[1]),o=XA(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function aF(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function oF(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var sF=9,cF=32;function lF(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(uF(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(uF(t.slice(i),i>0,!1)),a.join(``)}function uF(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===sF||t===cF;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===sF||t===cF;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function dF(e,t){let n={type:`text`,value:lF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fF(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var pF={blockquote:LP,break:RP,code:zP,delete:BP,emphasis:VP,footnoteReference:HP,heading:UP,html:WP,imageReference:KP,image:qP,inlineCode:JP,linkReference:YP,link:XP,listItem:ZP,list:eF,paragraph:tF,root:nF,strong:rF,table:iF,tableCell:oF,tableRow:aF,text:dF,thematicBreak:fF,toml:mF,yaml:mF,definition:mF,footnoteDefinition:mF};function mF(){}var{defineProperty:hF}=Object,gF=typeof self==`object`?self:globalThis,_F=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new gF[e](t)},vF=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?hF(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof gF[e]==`function`?_F(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(_F(a,o),i)};return r},yF=e=>vF(new Map,e)(0),bF=``,{toString:xF}={},{keys:SF,is:CF}=Object,wF=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=xF.call(e).slice(8,-1);switch(n){case`Array`:return[1,bF];case`Object`:return[2,bF];case`Date`:return[3,bF];case`RegExp`:return[4,bF];case`Map`:return[5,bF];case`Set`:return[6,bF];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},TF=([e,t])=>e===0&&(t===`function`||t===`symbol`),EF=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=wF(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&CF(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of SF(o))(e||!TF(wF(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?bF:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(TF(wF(n))||TF(wF(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!TF(wF(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},DF=(e,{json:t,lossy:n}={})=>{let r=[];return EF(!(t||n),!!t,new Map,r)(e),r},OF=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?yF(DF(e,t)):structuredClone(e):(e,t)=>yF(DF(e,t));function kF(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function AF(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function jF(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||kF,r=e.options.footnoteBackLabel||AF,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=cM(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...OF(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
67
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
68
- `}]}}var MF=(function(e){if(e==null)return LF;if(typeof e==`function`)return IF(e);if(typeof e==`object`)return Array.isArray(e)?NF(e):PF(e);if(typeof e==`string`)return FF(e);throw Error(`Expected function, string, or object as test`)});function NF(e){let t=[],n=-1;for(;++n<e.length;)t[n]=MF(e[n]);return IF(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function PF(e){let t=e;return IF(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function FF(e){return IF(t);function t(t){return t&&t.type===e}}function IF(e){return t;function t(t,n,r){return!!(RF(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function LF(){return!0}function RF(e){return typeof e==`object`&&!!e&&`type`in e}function zF(e){return e}var BF=[];function VF(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=MF(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+zF(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=BF,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=HF(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function HF(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?BF:[e]}function UF(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),VF(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var WF={}.hasOwnProperty,GF={};function KF(e,t){let n=t||GF,r=new Map,i=new Map,a={all:s,applyData:JF,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...pF,...n.handlers},one:o,options:n,patch:qF,wrap:XF};return UF(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(WF.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=OF(n);return r.children=a.all(e),r}return OF(e)}return(a.options.unknownHandler||YF)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=ZF(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=ZF(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function qF(e,t){e.position&&(t.position=$A(e))}function JF(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,OF(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function YF(e,t){let n=t.data||{},r=`value`in t&&!(WF.call(n,`hProperties`)||WF.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function XF(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
69
- `});++r<e.length;)r&&n.push({type:`text`,value:`
70
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
71
- `}),n}function ZF(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function QF(e,t){let n=KF(e,t),r=n.one(e,void 0),i=jF(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
72
- `},i)),a}function $F(e,t){return e&&`run`in e?async function(n,r){let i=QF(n,{file:r,...t});await e.run(i,r)}:function(n,r){return QF(n,{file:r,...e||t})}}function eI(e){if(e)throw e}var tI=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function nI(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rI(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?iI(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function iI(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var aI={basename:oI,dirname:sI,extname:cI,join:lI,sep:`/`};function oI(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);fI(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function sI(e){if(fI(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function cI(e){fI(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function lI(...e){let t=-1,n;for(;++t<e.length;)fI(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:uI(n)}function uI(e){fI(e);let t=e.codePointAt(0)===47,n=dI(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function dI(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function fI(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var pI={cwd:mI};function mI(){return`/`}function hI(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function gI(e){if(typeof e==`string`)e=new URL(e);else if(!hI(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return _I(e)}function _I(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var vI=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],yI=class{constructor(e){let t;t=e?hI(e)?{path:e}:typeof e==`string`||CI(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:pI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<vI.length;){let e=vI[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)vI.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?aI.basename(this.path):void 0}set basename(e){xI(e,`basename`),bI(e,`basename`),this.path=aI.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?aI.dirname(this.path):void 0}set dirname(e){SI(this.basename,`dirname`),this.path=aI.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?aI.extname(this.path):void 0}set extname(e){if(bI(e,`extname`),SI(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=aI.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){hI(e)&&(e=gI(e)),xI(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?aI.basename(this.path,this.extname):void 0}set stem(e){xI(e,`stem`),bI(e,`stem`),this.path=aI.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new ij(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function bI(e,t){if(e&&e.includes(aI.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+aI.sep+"`")}function xI(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function SI(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function CI(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var wI=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),TI=t(tI(),1),EI={}.hasOwnProperty,DI=new class e extends wI{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=rI()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,TI.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(AI(`data`,this.frozen),this.namespace[e]=t,this):EI.call(this.namespace,e)&&this.namespace[e]||void 0:e?(AI(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=NI(e),n=this.parser||this.Parser;return OI(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),OI(`process`,this.parser||this.Parser),kI(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=NI(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);FI(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),OI(`processSync`,this.parser||this.Parser),kI(`processSync`,this.compiler||this.Compiler),this.process(e,r),MI(`processSync`,`process`,t),n;function r(e,r){t=!0,eI(e),n=r}}run(e,t,n){jI(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=NI(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),MI(`runSync`,`run`,n),r;function i(e,t){eI(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=NI(t),r=this.compiler||this.Compiler;return kI(`stringify`,r),jI(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(AI(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,TI.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];nI(o)&&nI(r)&&(r=(0,TI.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function OI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function kI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function AI(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jI(e){if(!nI(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function MI(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function NI(e){return PI(e)?e:new yI(e)}function PI(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function FI(e){return typeof e==`string`||II(e)}function II(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var LI=[],RI={allowDangerousHtml:!0},zI=/^(https?|ircs?|mailto|xmpp)$/i,BI=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function VI(e){let t=HI(e),n=UI(e);return WI(t.runSync(t.parse(n),n),e)}function HI(e){let t=e.rehypePlugins||LI,n=e.remarkPlugins||LI,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...RI}:RI;return DI().use(IP).use(n).use($F,r).use(t)}function UI(e){let t=e.children||``,n=new yI;return typeof t==`string`?n.value=t:``+t,n}function WI(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||GI;for(let e of BI)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return UF(e,l),fj(e,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Pj)if(Object.hasOwn(Pj,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Pj[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function GI(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||zI.test(e.slice(0,t))?e:``}function KI(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function qI(e,t,n){let r=MF((n||{}).ignore||[]),i=JI(t),a=-1;for(;++a<i.length;)VF(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function JI(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([YI(e[0]),XI(e[1])])}return t}function YI(e){return typeof e==`string`?new RegExp(KI(e),`g`):e}function XI(e){return typeof e==`function`?e:function(){return e}}var ZI=`phrasing`,QI=[`autolink`,`link`,`image`,`label`];function $I(){return{transforms:[sL],enter:{literalAutolink:tL,literalAutolinkEmail:nL,literalAutolinkHttp:nL,literalAutolinkWww:nL},exit:{literalAutolink:oL,literalAutolinkEmail:aL,literalAutolinkHttp:rL,literalAutolinkWww:iL}}}function eL(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:ZI,notInConstruct:QI},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:ZI,notInConstruct:QI},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:ZI,notInConstruct:QI}]}}function tL(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function nL(e){this.config.enter.autolinkProtocol.call(this,e)}function rL(e){this.config.exit.autolinkProtocol.call(this,e)}function iL(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function aL(e){this.config.exit.autolinkEmail.call(this,e)}function oL(e){this.exit(e)}function sL(e){qI(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cL],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,lL]],{ignore:[`link`,`linkReference`]})}function cL(e,t,n,r,i){let a=``;if(!fL(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!uL(n)))return!1;let o=dL(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function lL(e,t,n,r){return!fL(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function uL(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function dL(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=d(e,`(`),a=d(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function fL(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||oM(n)||aM(n))&&(!t||n!==47)}SL.peek=xL;function pL(){this.buffer()}function mL(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function hL(){this.buffer()}function gL(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function _L(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Yj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vL(e){this.exit(e)}function yL(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Yj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bL(e){this.exit(e)}function xL(){return`[`}function SL(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function CL(){return{enter:{gfmFootnoteCallString:pL,gfmFootnoteCall:mL,gfmFootnoteDefinitionLabelString:hL,gfmFootnoteDefinition:gL},exit:{gfmFootnoteCallString:_L,gfmFootnoteCall:vL,gfmFootnoteDefinitionLabelString:yL,gfmFootnoteDefinition:bL}}}function wL(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:SL},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
73
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?EL:TL))),s(),o}}function TL(e,t,n){return t===0?e:EL(e,t,n)}function EL(e,t,n){return(n?``:` `)+e}var DL=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];ML.attention=NL,ML.peek=PL;function OL(){return{canContainEols:[`delete`],enter:{strikethrough:AL},exit:{strikethrough:jL}}}function kL(){return{handlers:{delete:ML},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:DL}]}}function AL(e){this.enter({type:`delete`,children:[],position:void 0},e)}function jL(e){this.exit(e)}function ML(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function NL(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function PL(){return`~`}function FL(e){return e.length}function IL(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||FL,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=LL(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=RL(r[d]);else{let e=RL(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
74
- `)}function LL(e){return e==null?``:String(e)}function RL(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var zL=MF([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function BL(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),VL);return i(),o}function VL(e,t,n){return`>`+(n?``:` `)+e}function HL(e,t){return UL(e,t.inConstruct,!0)&&!UL(e,t.notInConstruct,!1)}function UL(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function WL(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
75
- `&&!e.before&&!e.after&&HL(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
76
- `}function GL(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function KL(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function qL(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function JL(e,t,n,r){let i=qL(n),a=e.value||``;if(KL(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,YL);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(GL(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
77
- `,encode:["`"],...o.current()})),t()}return u+=o.move(`
78
- `),a&&(u+=o.move(a+`
79
- `)),u+=o.move(s),c(),u}function YL(e,t,n){return(n?``:` `)+e}function XL(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ZL(e,t,n,r){let i=XL(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
80
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function QL(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}$L.attention=eR,$L.peek=tR;function $L(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function eR(e,t){return{construct:`emphasis`,markers:QL(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function tR(e,t,n){return n.options.emphasis||`*`}function nR(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function rR(e,t){let n=!1;return UF(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ij(e)&&(t.options.setext||n))}function iR(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(rR(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
81
- `,after:`
82
- `});return r(),t(),o+`
83
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
84
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
85
- `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=nR(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}aR.peek=oR;function aR(e){return e.value||``}function oR(){return`<`}sR.peek=cR;function sR(e,t,n,r){let i=XL(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function cR(){return`!`}lR.peek=uR;function lR(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function uR(){return`!`}dR.peek=fR;function dR(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function fR(){return"`"}function pR(e,t){let n=Ij(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}mR.peek=hR;function mR(e,t,n,r){let i=XL(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(pR(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function hR(e,t,n){return pR(e,n)?`<`:`[`}gR.peek=_R;function gR(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function _R(){return`[`}function vR(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yR(e){let t=vR(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bR(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function xR(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function SR(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?bR(n):vR(n),s=e.ordered?o===`.`?`)`:`.`:yR(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),xR(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function CR(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wR(e,t,n,r){let i=CR(n),a=n.bulletCurrent||vR(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function TR(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function ER(e,t,n,r){if(!e.children.some(function(e){return zL(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function DR(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}OR.attention=kR,OR.peek=AR;function OR(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function kR(e,t){return{construct:`strong`,markers:DR(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function AR(e,t,n){return n.options.strong||`*`}function jR(e,t,n,r){return n.safe(e.value,r)}function MR(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function NR(e,t,n){let r=(xR(n)+(n.options.ruleSpaces?` `:``)).repeat(MR(n));return n.options.ruleSpaces?r.slice(0,-1):r}var PR={blockquote:BL,break:WL,code:JL,definition:ZL,emphasis:$L,hardBreak:WL,heading:iR,html:aR,image:sR,imageReference:lR,inlineCode:dR,link:mR,linkReference:gR,list:SR,listItem:wR,paragraph:TR,root:ER,strong:OR,text:jR,thematicBreak:NR};function FR(){return{enter:{table:IR,tableData:BR,tableHeader:BR,tableRow:RR},exit:{codeText:VR,table:LR,tableData:zR,tableHeader:zR,tableRow:zR}}}function IR(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function LR(e){this.exit(e),this.data.inTable=void 0}function RR(e){this.enter({type:`tableRow`,children:[]},e)}function zR(e){this.exit(e)}function BR(e){this.enter({type:`tableCell`,children:[]},e)}function VR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,HR));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function HR(e,t){return t===`|`?t:e}function UR(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
86
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
87
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return IL(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=PR.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function WR(){return{exit:{taskListCheckValueChecked:KR,taskListCheckValueUnchecked:KR,paragraph:qR}}}function GR(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:JR}}}function KR(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function qR(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function JR(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=PR.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function YR(){return[$I(),CL(),OL(),FR(),WR()]}function XR(e){return{extensions:[eL(),wL(e),kL(),UR(e),GR()]}}var ZR={tokenize:dz,partial:!0},QR={tokenize:fz,partial:!0},$R={tokenize:pz,partial:!0},ez={tokenize:mz,partial:!0},tz={tokenize:hz,partial:!0},nz={name:`wwwAutolink`,tokenize:lz,previous:gz},rz={name:`protocolAutolink`,tokenize:uz,previous:_z},iz={name:`emailAutolink`,tokenize:cz,previous:vz},az={};function oz(){return{text:az}}for(var sz=48;sz<123;)az[sz]=iz,sz++,sz===58?sz=65:sz===91&&(sz=97);az[43]=iz,az[45]=iz,az[46]=iz,az[95]=iz,az[72]=[iz,rz],az[104]=[iz,rz],az[87]=[iz,nz],az[119]=[iz,nz];function cz(e,t,n){let r=this,i,a;return o;function o(t){return!yz(t)||!vz.call(r,r.previous)||bz(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return yz(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(tz,u,l)(t):t===45||t===95||Zj(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Xj(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function lz(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!gz.call(r,r.previous)||bz(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(ZR,e.attempt(QR,e.attempt($R,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function uz(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&_z.call(r,r.previous)&&!bz(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Xj(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||$j(t)||rM(t)||oM(t)||aM(t)?n(t):e.attempt(QR,e.attempt($R,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function dz(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function fz(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ez,c,s)(t):t===null||rM(t)||oM(t)||t!==45&&aM(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function pz(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ez,t,a)(o):o===null||rM(o)||oM(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function mz(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||rM(o)||oM(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||rM(e)||oM(e)?t(e):r(e)}function a(e){return Xj(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Xj(t)?(e.consume(t),o):n(t)}}function hz(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Zj(e)?n(e):t(e)}}function gz(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rM(e)}function _z(e){return!Xj(e)}function vz(e){return!(e===47||yz(e))}function yz(e){return e===43||e===45||e===46||e===95||Zj(e)}function bz(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var xz={tokenize:kz,partial:!0};function Sz(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Ez,continuation:{tokenize:Dz},exit:Oz}},text:{91:{name:`gfmFootnoteCall`,tokenize:Tz},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Cz,resolveTo:wz}}}}function Cz(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Yj(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function wz(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Tz(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||rM(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Yj(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return rM(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Ez(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||rM(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Yj(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return rM(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),lM(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Dz(e,t,n){return e.check(DM,t,e.attempt(xz,t,n))}function Oz(e){e.exit(`gfmFootnoteDefinition`)}function kz(e,t,n){let r=this;return lM(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Az(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Hj(o,o.length,0,bM(s,e.slice(r+1,n),t)),Hj(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Hj(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=yM(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=yM(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var jz=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Mz(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Mz(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Nz(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Pz(){return{flow:{null:{name:`table`,tokenize:Fz,resolveAll:Iz}}}}function Fz(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):iM(t)?lM(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||rM(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,iM(t)?lM(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return iM(t)?lM(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return iM(t)?lM(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):iM(n)?lM(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||rM(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Iz(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new jz;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Rz(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Lz(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Lz(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Lz(f,t,o,i,n,d)):(o[0]=o[1],d=Lz(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Rz(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Nz(t.events,n))}return e}function Lz(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},zz(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=zz(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=zz(t.events,n[2]),a=zz(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},zz(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Rz(e,t,n,r,i){let a=[],o=zz(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function zz(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Bz={name:`tasklistCheck`,tokenize:Hz};function Vz(){return{text:{91:Bz}}}function Hz(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return rM(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):iM(r)?e.check({tokenize:Uz},t,n)(r):n(r)}}function Uz(e,t,n){return lM(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Wz(e){return Gj([oz(),Sz(),Az(e),Pz(),Vz()])}var Gz={};function Kz(e){let t=this,n=e||Gz,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Wz(n)),a.push(YR()),o.push(XR(n))}function qz(e,t={}){return{"data-tip":e,...t.keys?{"data-tip-keys":t.keys}:{},...t.side?{"data-tip-side":t.side}:{},...t.keep?{"data-tip-keep":``}:{}}}var Jz=6,Yz=8,Xz=400;function Zz(e){return!e.isConnected||e.matches(`:disabled, [aria-disabled='true'], [aria-expanded='true']`)?!0:!e.hasAttribute(`data-tip-keep`)&&e.matches(`[aria-pressed='true'], [data-on='true'], [data-on='']`)}function Qz(e){if(!e.hasAttribute(`data-tip-trunc`))return!0;let t=e.querySelector(`.cs-grow, .truncate`)??e;return t.scrollWidth>t.clientWidth+1}function $z(e){let t=e.dataset.tipSide;return t===`top`||t===`bottom`||t===`left`||t===`right`?t:e.classList.contains(`cs-tipl`)?`left`:e.classList.contains(`cs-b`)?`bottom`:`top`}function eB({label:e,hint:t,side:n,keep:r,children:i}){return(0,m.cloneElement)(i,qz(e,{keys:t,side:n,keep:r}))}function tB(e,t,n,r){let i=window.innerWidth,a=window.innerHeight,o=r=>r===`top`?e.top-Jz-n>=Yz:r===`bottom`?e.bottom+Jz+n<=a-Yz:r===`left`?e.left-Jz-t>=Yz:e.right+Jz+t<=i-Yz,s={top:`bottom`,bottom:`top`,left:`right`,right:`left`},c=o(r)||!o(s[r])?r:s[r],l=(e,t,n)=>Math.min(Math.max(e,Yz),n-t-Yz);if(c===`top`||c===`bottom`)return{x:l(e.left+e.width/2-t/2,t,i),y:c===`top`?e.top-Jz-n:e.bottom+Jz,side:c};let u=l(e.top+e.height/2-n/2,n,a);return{x:c===`left`?e.left-Jz-t:e.right+Jz,y:u,side:c}}function nB(){let[e,t]=(0,m.useState)(null),[n,r]=(0,m.useState)(null),i=(0,m.useRef)(null),a=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let e=0,n=()=>{window.clearTimeout(e),a.current=null,t(null),r(null)},i=t=>{if(t.pointerType===`touch`)return;let r=t.target?.closest?.(`[data-tip]`);r!==a.current&&(n(),r&&r.dataset.tip&&(a.current=r,e=window.setTimeout(()=>o(r),Xz)))},o=e=>{a.current===e&&!Zz(e)&&e.dataset.tip&&Qz(e)&&t({text:e.dataset.tip,keys:e.dataset.tipKeys,el:e,side:$z(e)})},s=t=>{let r=t.target;r?.dataset?.tip&&r.matches(`:focus-visible`)&&(n(),a.current=r,e=window.setTimeout(()=>o(r),120))},c=e=>{a.current&&e.target===a.current&&n()},l=e=>{let t=e.relatedTarget;a.current&&(!t||!a.current.contains(t))&&n()};return document.addEventListener(`pointerover`,i,!0),document.addEventListener(`pointerout`,l,!0),document.addEventListener(`pointerdown`,n,!0),document.addEventListener(`keydown`,n,!0),document.addEventListener(`scroll`,n,!0),document.addEventListener(`focusin`,s,!0),document.addEventListener(`focusout`,c,!0),window.addEventListener(`blur`,n),()=>{n(),document.removeEventListener(`pointerover`,i,!0),document.removeEventListener(`pointerout`,l,!0),document.removeEventListener(`pointerdown`,n,!0),document.removeEventListener(`keydown`,n,!0),document.removeEventListener(`scroll`,n,!0),document.removeEventListener(`focusin`,s,!0),document.removeEventListener(`focusout`,c,!0),window.removeEventListener(`blur`,n)}},[]),(0,m.useLayoutEffect)(()=>{let t=i.current;if(!e||!t)return;let n=t.getBoundingClientRect();r(tB(e.el.getBoundingClientRect(),n.width,n.height,e.side))},[e]),e?(0,my.createPortal)((0,H.jsxs)(`div`,{ref:i,role:`tooltip`,className:`tipbox`,"data-side":n?.side??e.side,"data-ready":n?``:void 0,style:{position:`fixed`,left:n?.x??0,top:n?.y??0},children:[(0,H.jsx)(`span`,{className:`tipt`,children:e.text}),e.keys?(0,H.jsx)(ak,{chord:e.keys,className:`tipk`}):null]}),document.body):null}var rB={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function iB({label:e,icon:t,tone:n=`neutral`,shortcut:r,href:i,pressed:a,text:o,iconOnly:s,side:c,className:l,disabled:u,...d}){let f=(0,m.useRef)(null),p=iA(r);lA(p?r:void 0,()=>f.current?.click(),{enabled:p&&!u});let h=(0,H.jsx)(t,{"aria-hidden":`true`}),g=n===`primary`?`default`:s?`ghost`:`outline`,_=Y(!s&&`px-2.5`,rB[n],l),v=s?`icon`:`default`,y=s?h:(0,H.jsxs)(H.Fragment,{children:[h,(0,H.jsx)(`span`,{children:o??e}),r?(0,H.jsx)(ak,{chord:r,className:`kbd-hint ml-1`}):null]}),b=s?qz(o??e,{keys:r,side:c,keep:!0}):{};return i?(0,H.jsx)(ZO,{asChild:!0,ref:f,variant:g,size:v,"data-tone":n,className:_,...b,children:(0,H.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":p?r:void 0,children:y})}):(0,H.jsx)(ZO,{ref:f,type:`button`,variant:g,size:v,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":p?r:void 0,disabled:u,className:_,...b,...d,children:y})}function aB({children:e,className:t}){function n(e){let t=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(!t)return;let n=[...e.currentTarget.querySelectorAll(`button:not([disabled]), a[href]`)],r=n.indexOf(e.target);r<0||(e.preventDefault(),e.stopPropagation(),n[Math.max(0,Math.min(n.length-1,r+t))]?.focus())}return(0,H.jsx)(`div`,{role:`toolbar`,"aria-label":`Actions`,onKeyDown:n,className:Y(`cs-ab`,t),children:e})}var oB=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function sB(e){let t=(e??``).trim();if(t===``)return``;if(/^[#/.]/.test(t))return t;try{let e=new URL(t,`https://example.invalid`);return oB.has(e.protocol)?t:``}catch{return``}}var cB=4e3,lB=/^\s*(?:```|~~~)/,uB=/^#{1,6}\s/,dB=/^\s{0,3}\[[^\]]+\]:\s*\S|\[\^[^\]]+\]/m;function fB(e){if(e.length<=cB||dB.test(e))return[e];let t=[],n=[],r=!1;for(let i of e.split(`
88
- `))lB.test(i)?r=!r:!r&&uB.test(i)&&n.some(e=>e.trim())&&(t.push(n.join(`
89
- `)),n=[]),n.push(i);return t.push(n.join(`
90
- `)),t}function pB(e,t,n=!1){let r=t?.start?.offset,i=t?.end?.offset;if(r===void 0||i===void 0)return;let a=e.slice(r,i);if(!n){let e=a.match(/^`+/)?.[0];return e&&a.endsWith(e)?a.slice(e.length,-e.length):a}let o=a.match(/^ {0,3}(`{3,}|~{3,})[^\r\n]*(?:\r\n|\n|\r)/);if(!o)return a;let s=a.slice(o[0].length),c=RegExp(`^ {0,3}${o[1][0]}{${o[1].length},}[ \\t]*$`,`m`).exec(s);return c?s.slice(0,c.index):s}function mB(e,t){return!e&&!t}async function hB(e,t){if(!t)throw Error(`Clipboard is unavailable. Select the code and copy it manually.`);await t.writeText(e)}var gB,_B=new Set;function vB(){for(let e of[..._B])e()}function yB(e){gB=e,vB()}function bB(){gB&&(gB=void 0,vB())}function xB(e){return _B.add(e),()=>{_B.delete(e)}}var SB=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function CB(e){if(!e)return!1;let t=e.split(/[?#]/,1)[0]??``;return SB.test(t)||/\/files\/preview\/attachments\//.test(t)}function wB(e){return t=>{t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),yB(e))}}var TB={type:`spring`,stiffness:520,damping:32,mass:.7};function EB(){let e=(0,m.useSyncExternalStore)(xB,()=>gB,()=>void 0),t=gk(!!e,hk.image),n=Of(),[r,i]=(0,m.useState)(!1);(0,m.useEffect)(()=>i(!1),[e]);let a=t&&!!e;return(0,H.jsx)(FS,{open:a,onOpenChange:e=>{e||bB()},children:(0,H.jsx)(Nu,{children:a&&e?(0,H.jsxs)(zS,{forceMount:!0,children:[(0,H.jsx)(VS,{asChild:!0,forceMount:!0,children:(0,H.jsx)(Qf.div,{className:`fixed inset-0 z-[1000] bg-scrim backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14,ease:`easeOut`}})}),(0,H.jsxs)(GS,{forceMount:!0,"aria-describedby":void 0,className:`fixed inset-0 z-[1000] flex flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&bB()},children:[(0,H.jsx)(XS,{className:`sr-only`,children:e.alt?`Image: ${e.alt}`:`Image`}),(0,H.jsxs)(`div`,{className:`pointer-events-none flex shrink-0 items-center justify-end gap-1 p-3`,children:[(0,H.jsx)(`a`,{href:e.src,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open the original in a new tab`,"data-tip":`Open the original`,className:`lightbox-tool pointer-events-auto`,children:(0,H.jsx)(sh,{"aria-hidden":`true`,className:`size-4`})}),(0,H.jsx)(eC,{"aria-label":`Close the image`,"data-tip":`Close`,"data-tip-keys":`Esc`,className:`lightbox-tool pointer-events-auto`,children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-4`})})]}),(0,H.jsx)(`div`,{className:Y(`min-h-0 flex-1 overscroll-contain px-4 pb-4`,r?`overflow-auto`:`grid place-items-center overflow-hidden`),onClick:e=>{e.target===e.currentTarget&&bB()},children:(0,H.jsx)(Qf.img,{src:e.src,alt:e.alt??``,draggable:!1,onClick:()=>i(e=>!e),className:Y(`lightbox-image select-none rounded-xl`,r?`m-auto max-w-none cursor-zoom-out`:`max-h-[calc(100svh-5.5rem)] max-w-full cursor-zoom-in object-contain`),initial:{opacity:0,scale:n?1:.92},animate:{opacity:1,scale:1},exit:{opacity:0,scale:n?1:.96,transition:{duration:.12,ease:`easeIn`}},transition:n?{duration:.12}:TB},e.src)}),e.alt?(0,H.jsx)(`p`,{className:`pointer-events-none shrink-0 truncate px-4 pb-4 text-center text-xs text-muted-foreground`,children:e.alt}):null]})]}):null})})}var DB=/^-\s+(.+?)\s+\(([^()\s]+\/[^()\s]+)\)\s*$/;function OB(e){let t=e.lastIndexOf(`${bk}\n`);if(t<0||t>0&&e[t-1]!==`
91
- `)return{body:e,files:[]};let n=e.slice(t+bk.length+1).split(`
92
- `).filter(Boolean),r=[];for(let t of n){let n=DB.exec(t);if(!n)return{body:e,files:[]};let i=n[1].split(/[\\/]/).pop()??``;if(!/^[\w.-]+$/.test(i))return{body:e,files:[]};r.push({id:i,name:i.replace(/^[a-z0-9]+-/,``),mime:n[2]})}return r.length>0?{body:e.slice(0,t).trimEnd(),files:r}:{body:e,files:[]}}var kB=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function AB({files:e}){return e.length===0?null:(0,H.jsx)(`ul`,{className:`mt-2 flex min-w-0 max-w-full flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,H.jsx)(`li`,{children:kB.has(e.mime)?(0,H.jsx)(`a`,{href:I(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,onClick:wB({src:I(`/files/preview/attachments/${e.id}`),alt:e.name}),"aria-label":`${e.name}: open the image`,className:`block max-w-full overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02] focus-visible:outline-2 focus-visible:outline-ring`,children:(0,H.jsx)(`img`,{src:I(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-[min(14rem,100%)] object-cover`})}):(0,H.jsxs)(`span`,{className:`inline-flex max-w-[min(16rem,100%)] min-w-0 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[e.mime===`application/pdf`?(0,H.jsx)(_h,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,H.jsx)(ag,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}function jB(e){return e(),()=>{}}var MB=8;function NB(e,t=24){let[n,r]=(0,m.useState)(t),i=(0,m.useRef)(8),a=n<e;return(0,m.useEffect)(()=>{if(!a)return;let e=0,t=jB(()=>{e=requestAnimationFrame(()=>{let e=performance.now();(0,my.flushSync)(()=>r(e=>e+i.current));let t=Math.max(1,performance.now()-e);i.current=Math.max(2,Math.min(400,Math.round(i.current*MB/t)))})});return()=>{t(),cancelAnimationFrame(e)}},[a,n]),Math.min(n,e)}var PB=`bot-lobby.code.wrap`,FB=`bot-lobby.code.layout`,IB=new Set,LB={open:!1,request:0};function RB(){for(let e of[...IB])e()}function zB(e){return IB.add(e),()=>{IB.delete(e)}}function BB(e,t){LB={open:!0,...e?{path:e}:LB.path?{path:LB.path}:{},...t?{mode:t}:{},request:LB.request+1},RB()}function VB(){LB.open&&(LB={...LB,open:!1},RB())}function HB(){LB.open?VB():BB()}function UB(){return(0,m.useSyncExternalStore)(zB,()=>LB)}function WB(e){try{return localStorage.getItem(e)}catch{return null}}function GB(e,t){try{localStorage.setItem(e,t)}catch{}}var KB=WB(PB)===`1`,qB=WB(FB)===`split`?`split`:`unified`;function JB(e){KB=e,GB(PB,e?`1`:`0`),RB()}function YB(e){qB=e,GB(FB,e),RB()}function XB(){return(0,m.useSyncExternalStore)(zB,()=>KB)}function ZB(){return(0,m.useSyncExternalStore)(zB,()=>qB)}var QB=new Set(`ts tsx mts cts js jsx mjs cjs json jsonc json5 jsonl md mdx css scss sass less html htm vue svelte astro py rb go rs java kt kts swift c h cc cpp hpp cs php lua sh bash zsh fish ps1 sql graphql gql yml yaml toml ini cfg conf env xml svg txt lock prisma proto dockerfile mk gradle`.split(` `));function $B(e){let t=e.trim();if(!t||t.length>300||/\s/.test(t)||/^[a-z][\w+.-]*:\/\//i.test(t))return;let n=t.replace(/:\d+(?::\d+)?$/,``).replace(/^\.\//,``);if(!/^[\w@~./-]+$/.test(n)||n.endsWith(`/`)||n.includes(`..`))return;let r=n.split(`/`).at(-1)??``,i=/^[\w@.-]*[A-Za-z_][\w@-]*\.[A-Za-z][\w]{0,9}$/.test(r)||/^\.[A-Za-z][\w.-]*$/.test(r),a=/^(Dockerfile|Makefile|LICENSE|Procfile|Gemfile|Rakefile)$/.test(r)&&n.includes(`/`);if((i||a)&&!/^v?\d+(\.\d+)+$/.test(r)&&(n.includes(`/`)||r.startsWith(`.`)||QB.has(r.slice(r.lastIndexOf(`.`)+1).toLowerCase())))return n}function eV({path:e,children:t,className:n}){return(0,H.jsx)(`button`,{type:`button`,"data-file-link":e,"data-tip":`Open ${e} in the code viewer`,onClick:t=>{t.stopPropagation(),BB(e)},className:Y(`file-link`,n),children:t})}function tV(e){return e.split(/(\s+)/).map((e,t)=>{let n=e.replace(/^[("'`[]+|[)"'`\],.;:!?]+$/g,``),r=n?$B(n):void 0;if(!r)return e;let i=e.indexOf(n);return(0,H.jsxs)(`span`,{children:[e.slice(0,i),(0,H.jsx)(eV,{path:r,children:n}),e.slice(i+n.length)]},t)})}function nV(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(nV).join(``)}function rV(e,t=!1){let n=t||e.tagName===`a`;e.tagName===`code`&&(e.properties={...e.properties,copyBlocked:n,blockCode:t===!1&&e.properties?.blockCode});for(let t of e.children??[])e.tagName===`pre`&&(t.properties={...t.properties,blockCode:!0}),rV(t,n)}function iV(){return e=>rV(e)}var aV=/(?<![\w/@.:-])((?:\.{1,2}\/)?(?:[\w@.-]+\/)+[\w@.-]*[A-Za-z_][\w@-]*\.[A-Za-z]\w{0,9})(:\d+)?(?![\w/])/g;function oV(e){if(e.tagName===`code`||e.tagName===`pre`||e.tagName===`a`)return;let t=e.children;if(!t)return;let n=[];for(let e of t){if(e.type!==`text`||!e.value||!e.value.includes(`/`)){oV(e),n.push(e);continue}let t=0;for(let r of e.value.matchAll(aV)){let i=$B(r[1]);i&&(r.index>t&&n.push({type:`text`,value:e.value.slice(t,r.index)}),n.push({type:`element`,tagName:`span`,properties:{dataFilePath:i},children:[{type:`text`,value:r[0]}]}),t=r.index+r[0].length)}t===0?n.push(e):t<e.value.length&&n.push({type:`text`,value:e.value.slice(t)})}e.children=n}function sV(){return e=>oV(e)}function cV(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await hB(e,navigator.clipboard),n(!0),W.success(`Code copied.`)}catch{W.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function lV({text:e,children:t,block:n=!1}){let{copy:r}=cV(e),i=(0,m.useRef)(void 0);return(0,H.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,"data-tip":`Copy code`,className:`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY,moved:!1}},onPointerMove:e=>{let t=i.current;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4&&(t.moved=!0)},onClick:e=>{e.stopPropagation(),mB(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),mB(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,H.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function uV({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=cV(pB(n,r?.position,!0)??nV(r)),o=r?.children?.find(e=>e.tagName===`code`)?.properties?.className,s=(Array.isArray(o)?o:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9);return(0,H.jsxs)(`div`,{className:`relative my-3 rounded-lg bg-muted`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,H.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,H.jsx)(iB,{label:i?`Copied`:`Copy the code`,icon:i?km:th,iconOnly:!0,onClick:()=>void a()})]}),(0,H.jsx)(`pre`,{className:`!my-0 overflow-x-auto !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function dV(e){return{pre:t=>(0,H.jsx)(uV,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,H.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode,a=i?void 0:$B(nV(r));return a?(0,H.jsx)(eV,{path:a,children:(0,H.jsx)(`code`,{children:n})}):(0,H.jsx)(lV,{text:pB(e,r?.position,i)??nV(r),block:i,children:n})},span:({node:e,children:t,...n})=>{let r=e?.properties?.dataFilePath;return typeof r==`string`?(0,H.jsx)(eV,{path:r,children:t}):(0,H.jsx)(`span`,{...n,children:t})},a:({node:e,href:t,children:n})=>{let r=t?I(t):void 0;return(0,H.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer nofollow`,onClick:r&&CB(t)?wB({src:r,alt:nV(e)||void 0}):void 0,children:n})},img:({src:e,alt:t})=>{let n=typeof e==`string`?I(e):void 0,r=(0,H.jsx)(`img`,{src:n,alt:t??``,loading:`lazy`});return n?(0,H.jsx)(`button`,{type:`button`,className:`md-image`,"aria-label":t?`${t}: open the image`:`Open the image`,onClick:wB({src:n,alt:t??void 0}),children:r}):r},table:({children:e})=>(0,H.jsx)(`div`,{className:`my-3 w-full overflow-x-auto`,children:(0,H.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})}}var fV=(0,m.memo)(function({text:e}){return(0,H.jsx)(VI,{remarkPlugins:[Kz],rehypePlugins:[iV,sV],urlTransform:sB,components:dV(e),children:e})}),pV=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=OB(e),i=n?fB(n):[],a=NB(i.length,3);return(0,H.jsxs)(`div`,{className:Y(`md-body`,t),children:[i.slice(0,a).map((e,t)=>(0,H.jsx)(fV,{text:e},t)),(0,H.jsx)(AB,{files:r})]})});function mV(e,t){let n=new Set(t.toLowerCase().match(/[a-z][a-z0-9]{3,}/g)??[]);return e.map(e=>({note:e,score:(e.text.toLowerCase().match(/[a-z][a-z0-9]{3,}/g)??[]).filter(e=>n.has(e)).length})).filter(e=>e.score>1).sort((e,t)=>t.score-e.score).slice(0,3).map(e=>e.note)}function hV({notes:e,onOpen:t,onSaved:n}){let r=Vk(`lobby`).data,[i,a]=(0,m.useState)(),[o,s]=(0,m.useState)(!1),c=r?.chat.at(-1)?.id??0;if((0,m.useEffect)(()=>{let e=e=>{let t=String(e.detail??``);s(!1),a({text:t,at:Date.now(),after:c})};return window.addEventListener(BA,e),()=>window.removeEventListener(BA,e)},[c]),!i)return null;let l=r?.chat.find(e=>e.id>i.after&&e.role!==`you`&&e.role!==`note`),u=l?.text??r?.reply??``,d=u?mV(e,`${i.text} ${u}`):[],f=async()=>{await G(`knowledge.add`,{agent:`master`,file:`knowledge.md`,text:`- ${u.replace(/\s+/g,` `).trim()}`})&&(s(!0),n())};return(0,H.jsxs)(`section`,{className:`cs-knask`,"aria-label":`Answer from saved knowledge`,"aria-live":`polite`,children:[(0,H.jsxs)(`div`,{className:`cs-ah`,children:[(0,H.jsx)(Lg,{"aria-hidden":`true`,className:`size-3.5`}),`Answer from saved knowledge`,(0,H.jsx)(`button`,{type:`button`,className:`cs-knb cs-tip cs-b ml-auto`,"data-tip":`Dismiss`,"aria-label":`Dismiss the answer`,onClick:()=>a(void 0),children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5`})})]}),(0,H.jsxs)(`p`,{className:`cs-aq`,children:[`You asked: `,i.text]}),(0,H.jsx)(`div`,{className:`cs-aa`,children:u?(0,H.jsx)(pV,{text:u}):(0,H.jsx)(`span`,{className:`cs-wtx`,children:`Looking through what the agents know`})}),d.length?(0,H.jsx)(`div`,{className:`cs-bs`,children:d.map((e,n)=>(0,H.jsxs)(`button`,{type:`button`,className:`cs-bsr`,onClick:()=>t(e.key),children:[(0,H.jsx)(`span`,{className:`cs-n`,children:n+1}),(0,H.jsx)(`span`,{className:`cs-t`,children:e.text}),(0,H.jsxs)(`span`,{className:`cs-f`,children:[(0,H.jsx)(`b`,{style:{color:EA[e.agent]},children:pA[e.agent]}),` · `,e.file]})]},e.key))}):null,l?(0,H.jsx)(`div`,{className:`cs-aact`,children:(0,H.jsxs)(`button`,{type:`button`,className:`cs-kc cs-sm cs-pri`,disabled:o,onClick:()=>void f(),children:[(0,H.jsx)(_g,{"aria-hidden":`true`,className:`size-3.5`}),o?`Saved as a note`:`Save as a note`]})}):null]})}var gV=m.createContext({title:``,description:``});function _V({children:e,open:t,onOpenChange:n,defaultOpen:r}){let i=m.useId(),a=m.useId(),o=m.Children.toArray(e),s=o.filter(e=>m.isValidElement(e)&&e.type===vV),c=o.filter(e=>!s.includes(e));return(0,H.jsx)(kO,{...t===void 0?{}:{open:t},...n?{onOpenChange:n}:{},...r===void 0?{}:{defaultOpen:r},children:(0,H.jsxs)(gV.Provider,{value:{title:i,description:a},children:[(0,H.jsx)(AO,{asChild:!0,children:(0,H.jsx)(`span`,{"data-slot":`alert-dialog`,className:`inline-flex max-w-full`,children:c})}),s]})})}function vV({className:e,children:t,onOpenAutoFocus:n,...r}){let i=m.useContext(gV);return(0,H.jsx)(MO,{children:(0,H.jsx)(NO,{"data-slot":`alert-dialog-content`,role:`alertdialog`,"aria-labelledby":i.title,"aria-describedby":i.description,side:`bottom`,align:`end`,sideOffset:8,collisionPadding:12,onOpenAutoFocus:e=>{if(n?.(e),e.defaultPrevented)return;let t=e.currentTarget?.querySelector(`[data-slot="alert-dialog-cancel"]`);t&&(e.preventDefault(),t.focus({preventScroll:!0,focusVisible:!1}))},className:Y(`cs-cfm z-[1100] grid w-[min(20rem,calc(100vw-2rem))] gap-3 rounded-2xl p-3.5 text-sm outline-none origin-(--radix-popover-content-transform-origin)`,e),...r,children:t})})}function yV({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:Y(`flex flex-col gap-1`,e),...t})}function bV({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:Y(`flex flex-row justify-end gap-2`,e),...t})}function xV({className:e,...t}){let n=m.useContext(gV);return(0,H.jsx)(`h2`,{id:n.title,"data-slot":`alert-dialog-title`,className:Y(`m-0 text-[13.5px] font-semibold text-foreground`,e),...t})}function SV({className:e,...t}){let n=m.useContext(gV);return(0,H.jsx)(`p`,{id:n.description,"data-slot":`alert-dialog-description`,className:Y(`m-0 text-[12.5px] leading-snug text-muted-foreground`,e),...t})}function CV({className:e,variant:t=`default`,...n}){return(0,H.jsx)(PO,{asChild:!0,children:(0,H.jsx)(ZO,{variant:t,size:`sm`,"data-slot":`alert-dialog-action`,className:Y(`h-7 gap-1 px-2.5`,e),...n})})}function wV({className:e,...t}){return(0,H.jsx)(PO,{asChild:!0,children:(0,H.jsx)(ZO,{variant:`outline`,size:`sm`,"data-slot":`alert-dialog-cancel`,className:Y(`h-7 gap-1 px-2.5`,e),...t})})}function TV({label:e,text:t,shortcut:n,title:r,description:i,confirmLabel:a,onConfirm:o,icon:s,disabled:c,variant:l=`outline`,iconOnly:u,compact:d,className:f,side:p}){let[h,g]=(0,m.useState)(!1),_=gk(h,hk.confirm),v=l===`destructive`;return lA(`y`,()=>{g(!1),o()},{enabled:h&&_,inDialog:!0}),(0,H.jsxs)(_V,{open:h&&_,onOpenChange:g,children:[(0,H.jsx)(iB,{label:e,icon:s,tone:v?`danger`:`neutral`,disabled:c,shortcut:n,iconOnly:u,...d?{"data-compact":!0,className:`size-8`}:f?{className:f}:{},...p?{side:p}:{},...t?{text:t}:{},onClick:()=>g(!0)}),(0,H.jsxs)(vV,{children:[(0,H.jsxs)(yV,{children:[(0,H.jsx)(xV,{children:r}),(0,H.jsx)(SV,{children:i})]}),(0,H.jsxs)(bV,{children:[(0,H.jsxs)(wV,{children:[`Cancel`,(0,H.jsx)(ak,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,H.jsxs)(CV,{variant:v?`destructive`:`default`,onClick:o,children:[a,(0,H.jsx)(ak,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function EV({text:e,className:t,onClick:n}){let r=e.split(/(`[^`]+`)/g).filter(Boolean);return(0,H.jsx)(`p`,{className:t,onClick:n,children:r.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,H.jsx)(`span`,{className:`cs-cod`,children:e.slice(1,-1)},t):(0,H.jsx)(`span`,{children:e},t))})}function DV({initial:e,label:t,action:n,placeholder:r,onSave:i,onCancel:a}){let[o,s]=(0,m.useState)(e),[c,l]=(0,m.useState)(!1),u=async()=>{if(c||!o.trim())return;l(!0);let e=await i(o.trim());l(!1),e&&a()};return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`textarea`,{autoFocus:!0,"aria-label":t,className:`cs-knta`,value:o,placeholder:r,disabled:c,onChange:e=>s(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),a()):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),u()))}}),(0,H.jsxs)(`div`,{className:`cs-knea`,children:[(0,H.jsx)(`span`,{className:`cs-h2`,children:mA}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm`,onClick:a,disabled:c,children:`Cancel`}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-pri`,onClick:()=>void u(),disabled:c||!o.trim(),children:n})]})]})}function OV(e){let t=AA(e.since);return e.source?`${e.source}${t?` · ${t}`:``}`:`${pA[e.agent]} · ${e.file}`}function kV({note:e,selected:t,dragging:n,activeTags:r,onOpen:i,onTag:a,onDragStart:o,onDragEnd:s,onSave:c,onDelete:l,onPin:u,onReview:d,editing:f,onEditing:p}){let[h,g]=(0,m.useState)(!1),_=f??h,v=e=>p?p(e):g(e),y=EA[e.agent];return(0,H.jsxs)(`article`,{className:`cs-knc`,"data-sel":t||void 0,"data-drag":n||void 0,draggable:!_,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.key),o()},onDragEnd:s,"aria-label":`${pA[e.agent]}: ${e.text}`,children:[(0,H.jsxs)(`div`,{className:`cs-knch`,style:{"--c":y},children:[(0,H.jsx)(`span`,{className:`cs-knd`,"aria-hidden":`true`,children:(0,H.jsx)(Th,{className:`size-3.5`})}),(0,H.jsx)(`span`,{className:`cs-kat`,"aria-hidden":`true`,children:DA(e.agent)}),(0,H.jsx)(`b`,{children:pA[e.agent]}),(0,H.jsxs)(`span`,{className:`cs-fl`,children:[`· `,e.file]}),(0,H.jsxs)(`div`,{className:`cs-kna`,children:[(0,H.jsx)(`button`,{type:`button`,className:`cs-knb cs-pin cs-tip cs-b`,"data-on":e.pinned?`true`:`false`,"data-tip":e.pinned?`Unpin`:`Pin to the top`,"aria-label":e.pinned?`Unpin`:`Pin to the top`,"aria-pressed":e.pinned,onClick:u,children:(0,H.jsx)(pg,{className:`size-3.5`,"aria-hidden":`true`})}),(0,H.jsx)(`button`,{type:`button`,className:`cs-knb cs-h cs-tip cs-b`,"data-tip":`Edit`,"aria-label":`Edit the note`,onClick:()=>v(!0),children:(0,H.jsx)(lg,{className:`size-3.5`,"aria-hidden":`true`})}),(0,H.jsx)(TV,{iconOnly:!0,className:`cs-knb cs-h cs-dg`,icon:qg,label:`Delete the note`,title:`Delete this note?`,description:`The note and its comments are removed. The version before is archived.`,confirmLabel:`Delete note`,variant:`destructive`,onConfirm:l})]})]}),_?(0,H.jsx)(DV,{initial:e.entry.text,label:`Edit note`,action:`Save`,onSave:c,onCancel:()=>v(!1)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(EV,{className:`cs-knx`,text:e.text,onClick:i}),e.comments.map(e=>(0,H.jsxs)(`p`,{className:`cs-knn`,children:[(0,H.jsx)(qh,{"aria-hidden":`true`,className:`size-3.5`}),(0,H.jsx)(`span`,{children:e.text})]},e.id)),e.flag?(0,H.jsxs)(`p`,{className:`cs-knfl`,children:[(0,H.jsx)(zm,{"aria-hidden":`true`,className:`size-3.5`}),(0,H.jsx)(`span`,{children:e.flag.kind===`stale`?`Not used in ${e.flag.days} days`:`A newer proposal in the Inbox disagrees with this`}),e.flag.kind===`stale`?(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm`,"data-tip":`Takes it out of the file; the version before is archived`,onClick:l,children:`Archive`}):(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm`,onClick:d,children:`Review`})]}):null,(0,H.jsxs)(`div`,{className:`cs-knf3`,children:[e.tags.length?(0,H.jsx)(`div`,{className:`cs-tg`,children:e.tags.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`cs-ktg`,"data-on":r.includes(e)||void 0,onClick:()=>a(e),children:[`#`,e]},e))}):null,(0,H.jsxs)(`div`,{className:`cs-pv`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`cs-src`,onClick:i,children:[(0,H.jsx)(Fh,{"aria-hidden":`true`,className:`size-3 flex-none`}),(0,H.jsx)(`span`,{children:OV(e)})]}),(0,H.jsxs)(`span`,{className:`cs-use`,children:[(0,H.jsx)(`span`,{className:`cs-ubar`,"aria-hidden":`true`,children:(0,H.jsx)(`i`,{style:{width:`${Math.min(100,e.uses.length*6)}%`}})}),jA(e.uses.length)]})]})]})]})]})}var AV=85;function jV({proposals:e,onChanged:t}){let[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1),o=e.filter(e=>(e.confidence??0)>=AV),s=async e=>{a(!0);let n=!0;for(let t of e)n=await t()!==void 0&&n;return a(!1),t(),n};return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`cs-kih`,children:[(0,H.jsx)(`p`,{children:e.length?`${e.length} ${e.length===1?`proposal`:`proposals`} from finished work, waiting for you`:`Nothing waiting`}),o.length?(0,H.jsxs)(`button`,{type:`button`,className:`cs-kc cs-sm cs-pri`,disabled:i,onClick:()=>void s(o.map(e=>()=>G(`knowledge.accept`,{id:e.id}))),children:[(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3.5`}),`Accept `,o.length,` confident`]}):null]}),e.length?(0,H.jsx)(`div`,{className:`cs-kib`,children:e.map(e=>{let t=(e.confidence??0)>=AV;return(0,H.jsxs)(`article`,{className:`cs-kir`,style:{"--c":EA[e.agent]},"aria-label":`Proposal for ${pA[e.agent]}`,children:[(0,H.jsx)(`span`,{className:`cs-kat`,"aria-hidden":`true`,children:DA(e.agent)}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[n===e.id?(0,H.jsx)(`div`,{className:`cs-edi`,children:(0,H.jsx)(DV,{initial:e.text,label:`Edit before accepting`,action:`Accept`,onSave:t=>s([()=>G(`knowledge.accept`,{id:e.id,text:t})]),onCancel:()=>r(void 0)})}):(0,H.jsx)(`p`,{className:`cs-tx`,children:e.text}),(0,H.jsxs)(`div`,{className:`cs-mt`,children:[(0,H.jsx)(`b`,{style:{color:EA[e.agent],fontWeight:600},children:pA[e.agent]}),(0,H.jsxs)(`span`,{children:[`· `,e.source,e.at?` · ${AA(e.at)}`:``]}),e.confidence===void 0?null:(0,H.jsxs)(`span`,{className:`cs-kcf`,"data-k":t?`ok`:`chk`,children:[`· `,e.confidence,`% `,t?`confident`:`worth a look`]})]}),e.replaces?(0,H.jsxs)(`p`,{className:`cs-rp`,children:[(0,H.jsx)(`b`,{children:`Replaces`}),(0,H.jsx)(`s`,{children:e.replaces})]}):null]}),(0,H.jsxs)(`div`,{className:`cs-ac`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`cs-kc cs-sm cs-pri`,disabled:i||n===e.id,onClick:()=>void s([()=>G(`knowledge.accept`,{id:e.id})]),children:[(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3.5`}),`Accept`]}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib cs-tip cs-b`,"data-tip":`Edit first`,"aria-label":`Edit first`,disabled:i,onClick:()=>r(e.id),children:(0,H.jsx)(lg,{"aria-hidden":`true`,className:`size-3.5`})}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib cs-tip cs-b`,"data-tip":`Dismiss`,"aria-label":`Dismiss`,disabled:i,onClick:()=>void s([()=>G(`knowledge.dismiss`,{id:e.id})]),children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5`})})]})]},e.id)})}):(0,H.jsxs)(`div`,{className:`cs-knempty`,children:[(0,H.jsx)(`b`,{children:`Inbox is clear`}),`New proposals from finished work land here for your review.`]})]})}function MV(e,t,n,r=!0){zk();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[F.status().connection,...n.map(e=>F.get(e).version)].join(`,`),l=JSON.stringify(t);(0,m.useEffect)(()=>{if(!r)return;let t=!0,n=performance.now();return a(e=>({...e,loading:!0})),R(e,JSON.parse(l)).then(e=>t&&a({data:e,loading:!1,at:n}),e=>t&&a(t=>({...t,error:e instanceof Error?e.message:String(e),loading:!1}))),()=>{t=!1}},[e,l,c,o,r]);let u=(0,m.useCallback)(()=>s(e=>e+1),[]);return{data:i.data,error:i.error,loading:i.loading,requestedAt:i.at,reload:u}}function NV(){let e=MV(`tasks.list`,{},[`tasks`]);return(0,m.useMemo)(()=>Object.fromEntries((e.data?.rows??[]).map(e=>[e.id,e.title])),[e.data])}function PV({note:e,onPin:t,onEdit:n,onComment:r,onDelete:i}){return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`cs-knwh min-w-0`,style:{"--c":EA[e.agent]},children:[(0,H.jsx)(`span`,{className:`cs-kat`,"aria-hidden":`true`,children:DA(e.agent)}),(0,H.jsxs)(`span`,{className:`truncate`,children:[(0,H.jsx)(`b`,{children:pA[e.agent]}),` · `,e.file]})]}),(0,H.jsxs)(`div`,{className:`cs-knwhx`,children:[(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib cs-tip cs-b`,"data-tip":e.pinned?`Unpin`:`Pin to the top`,"aria-label":e.pinned?`Unpin`:`Pin to the top`,"aria-pressed":e.pinned,"data-on":e.pinned||void 0,onClick:t,children:(0,H.jsx)(pg,{"aria-hidden":`true`,className:`size-3.5`})}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib cs-tip cs-b`,"data-tip":`Edit`,"aria-label":`Edit the note`,onClick:n,children:(0,H.jsx)(lg,{"aria-hidden":`true`,className:`size-3.5`})}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib cs-tip cs-b`,"data-tip":`Comment`,"aria-label":`Comment on the note`,onClick:r,children:(0,H.jsx)(Gh,{"aria-hidden":`true`,className:`size-3.5`})}),(0,H.jsx)(TV,{iconOnly:!0,side:`bottom`,className:`cs-kc cs-sm cs-ib`,icon:qg,label:`Delete the note`,title:`Delete this note?`,description:`The note and its comments are removed. The version before is archived.`,confirmLabel:`Delete note`,variant:`destructive`,onConfirm:i})]})]})}function FV(e){if(e===`you`)return{name:`You`,letter:`Y`,color:`var(--c-orc)`};let t=fA.find(t=>pA[t].toLowerCase().startsWith(e.toLowerCase())||t===`master`&&/oracle|master/i.test(e));return{name:e,letter:e.charAt(0).toUpperCase(),color:t?EA[t]:`var(--muted-foreground)`}}function IV({note:e,view:t,commenting:n,onCommenting:r,onTag:i,onMove:a,onChanged:o}){let[s,c]=(0,m.useState)(!1),l=NV(),{agent:u,file:d}=e,f=_A(e.entry),p=async e=>{c(!0);let t=await e()!==void 0;return c(!1),t&&o(),t},h=MA(e.uses),g=[...new Map(e.uses.filter(e=>e.taskId).map(e=>[e.taskId,e.at])).entries()].slice(0,5);return(0,H.jsxs)(`article`,{"aria-label":`${pA[u]} note`,children:[(0,H.jsx)(EV,{className:`cs-knwt`,text:e.text}),e.comments.length?(0,H.jsx)(`ul`,{className:`cs-kwu mt-2.5`,children:e.comments.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{title:e.text,children:e.text}),(0,H.jsx)(`button`,{type:`button`,className:`cs-knb cs-tip cs-b`,"data-tip":`Take it back`,"aria-label":`Take the comment back`,disabled:s,onClick:()=>void p(()=>G(`knowledge.unnote`,{id:e.id})),children:(0,H.jsx)(Zg,{"aria-hidden":`true`,className:`size-3.5`})})]},e.id))}):null,n?(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(DV,{initial:``,label:`Comment on this note`,action:`Add comment`,placeholder:`Tell the agent what to change; it reads comments with the note`,onSave:e=>p(()=>G(`knowledge.comment`,{agent:u,file:d,ref:f,text:e})),onCancel:()=>r(!1)})}):null,e.tags.length?(0,H.jsx)(`div`,{className:`cs-knwtg`,children:e.tags.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`cs-ktg`,onClick:()=>i(e),children:[`#`,e]},e))}):null,(0,H.jsx)(`h3`,{className:`cs-kwh`,children:`Where it came from`}),e.history.length?(0,H.jsx)(`ul`,{className:`cs-kwtl`,children:e.history.map(e=>{let t=FV(e.by);return(0,H.jsxs)(`li`,{className:`cs-kwi`,style:{"--c":t.color},children:[(0,H.jsx)(`span`,{className:`cs-kat`,"aria-hidden":`true`,children:t.letter}),(0,H.jsxs)(`div`,{className:`cs-tx`,children:[(0,H.jsx)(`b`,{children:t.name}),e.what,(0,H.jsx)(`em`,{children:AA(e.at)})]}),e.before?(0,H.jsx)(`button`,{type:`button`,className:`cs-knb cs-tip cs-b`,"data-tip":`Restore this version`,"aria-label":`Restore the version before: ${e.before}`,disabled:s,onClick:()=>void p(()=>G(`knowledge.restore`,{agent:u,file:d,ref:f,event:e.id})),children:(0,H.jsx)(Zg,{"aria-hidden":`true`,className:`size-3.5`})}):null]},e.id)})}):(0,H.jsxs)(`p`,{className:`cs-hd2 m-0`,children:[`It was in `,pA[u],`'s `,d,` before its history was kept.`]}),t?.over?(0,H.jsx)(`p`,{className:`cs-kagw`,children:gA(d)}):null,(0,H.jsxs)(`h3`,{className:`cs-kwh`,children:[`Used by agents`,(0,H.jsx)(`span`,{children:e.uses.length?`${e.uses.length} ${e.uses.length===1?`use`:`uses`} in 30 days`:`never`})]}),(0,H.jsx)(`div`,{className:`cs-kwb`,"aria-hidden":`true`,children:h.map((e,t)=>(0,H.jsx)(`i`,{"data-z":e===0||void 0,style:{height:`${e||8}%`}},t))}),g.length?(0,H.jsx)(`ul`,{className:`cs-kwu mt-3`,children:g.map(([e,t])=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3.5`}),(0,H.jsx)(`span`,{children:l[e]??`Task ${e}`}),(0,H.jsx)(`i`,{children:AA(t)})]},e))}):e.uses.length===0?(0,H.jsx)(`p`,{className:`cs-hd2 m-0 mt-2`,children:`No agent has used this note yet.`}):null,(0,H.jsx)(`h3`,{className:`cs-kwh`,children:`Move to`}),(0,H.jsx)(`div`,{className:`cs-kwmv`,children:fA.map(e=>(0,H.jsx)(`button`,{type:`button`,className:`cs-knb cs-tip cs-b`,"data-tip":e===u?`Kept by ${pA[e]}`:`Move to ${pA[e]}`,"aria-label":e===u?`Kept by ${pA[e]}`:`Move to ${pA[e]}`,"aria-pressed":e===u,"data-on":e===u||void 0,disabled:s||e===u,style:{"--c":EA[e]},onClick:()=>a(e),children:DA(e)},e))})]})}var LV=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function RV(){return(0,H.jsx)(Nk,{className:`m-4 flex-1`,children:(0,H.jsxs)(Pk,{children:[(0,H.jsx)(Ik,{variant:`icon`,children:(0,H.jsx)(Tm,{"aria-hidden":`true`})}),(0,H.jsx)(Lk,{children:`No knowledge files yet. The agents write what they learn here as they work.`})]})})}function zV({rest:e}){let t=e[0]===`agents`?`agents`:e[0]===`inbox`?`inbox`:`notes`,n=TA(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(),[s,c]=(0,m.useState)([]),[l,u]=(0,m.useState)(``),[d,f]=(0,m.useState)(),[p,h]=(0,m.useState)(!1),[g,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(),[b,x]=(0,m.useState)(),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(),[E,D]=(0,m.useState)(),O=(0,m.useRef)(null),k=(0,m.useMemo)(()=>{let e=n.notes.filter(e=>(!r||e.agent===r)&&(!a||e.file===a)&&s.every(t=>e.tags.includes(t))&&OA(e,l)&&(!d||(d===`pinned`?e.pinned:e.flag?.kind===d)));return p?[...e].sort((e,t)=>t.uses.length-e.uses.length):[...e].sort((e,t)=>Number(t.pinned)-Number(e.pinned))},[n.notes,r,a,s,l,d,p]),A=(0,m.useMemo)(()=>{let e=new Map;for(let t of n.notes)for(let n of t.tags)e.set(n,(e.get(n)??0)+1);return[...e].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,12)},[n.notes]),j=n.notes.find(e=>e.key===v),M=(0,m.useRef)(void 0);j&&(M.current=j);let N=e=>c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),ee=e=>Dk(Ek(`knowledge`,...e===`notes`?[]:[e])),te=e=>n.views.find(t=>t.agent===e.agent&&t.file===e.file),P=e=>{i(e),o(void 0)},ne=async(e,t)=>{let r=await G(`knowledge.edit`,{agent:e.agent,file:e.file,ref:_A(e.entry),text:t})!==void 0;return r&&n.reload(),r},re=async e=>{await G(`knowledge.remove`,{agent:e.agent,file:e.file,ref:_A(e.entry)})&&(v===e.key&&y(void 0),n.reload())},ie=async e=>{await G(`knowledge.pin`,{agent:e.agent,file:e.file,ref:_A(e.entry),on:!e.pinned})&&n.reload()},ae=async(e,t)=>{t!==e.agent&&await G(`knowledge.move`,{agent:e.agent,file:e.file,ref:_A(e.entry),to:t,toFile:kA(n.files,t,e.file)})&&(y(void 0),n.reload())},oe=r??`master`,se=a??kA(n.files,oe,`knowledge.md`),ce=async e=>{let t=await G(`knowledge.add`,{agent:oe,file:se,text:e.startsWith(`-`)?e:`- ${e}`})!==void 0;return t&&n.reload(),t},le=e=>t=>{t.preventDefault(),D(void 0);let r=n.notes.find(e=>e.key===(t.dataTransfer.getData(`text/plain`)||w));r&&ae(r,e)};if(!n.views.length&&n.error)return(0,H.jsx)(jk,{message:`Could not load the knowledge. ${n.error}`,onRetry:n.reload});if(!n.loading&&!n.files.length)return(0,H.jsx)(RV,{});let F=vA(n.files),ue=[[],[]];k.forEach((e,t)=>ue[t%2].push(e));let de=e=>n.notes.filter(t=>e===`pinned`?t.pinned:t.flag?.kind===e).length,fe=de(`pinned`),I=n.proposals.length,L=e=>f(t=>t===e?void 0:e);return(0,H.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,H.jsx)(`div`,{ref:O,className:`cs-scroll pb-dock`,children:(0,H.jsxs)(`div`,{className:`cs-pg cs-kn`,children:[(0,H.jsxs)(`div`,{className:`cs-knh`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:`cs-hd1`,children:`Knowledge`}),(0,H.jsxs)(`p`,{className:`cs-hd2`,children:[LV(n.notes.length,`note`),` · `,LV(F.length,`agent`),` · `,fe,` pinned`]})]}),(0,H.jsx)(Rk,{as:`tab`,label:`Knowledge view`,value:t,onChange:ee,items:[{id:`notes`,label:`Notes`},{id:`agents`,label:`Agents`},{id:`inbox`,label:(0,H.jsxs)(H.Fragment,{children:[`Inbox`,I?(0,H.jsx)(`span`,{className:`cs-kbn`,children:I}):null]}),name:I?`Inbox, ${I} waiting`:`Inbox`}]})]}),!n.views.length&&n.loading?(0,H.jsx)(nA,{}):t===`agents`?(0,H.jsx)(PA,{data:n,onOpen:e=>{P(e),ee(`notes`)}}):t===`inbox`?(0,H.jsx)(jV,{proposals:n.proposals,onChanged:n.reload}):(0,H.jsxs)(`div`,{className:`cs-knl`,children:[(0,H.jsxs)(`nav`,{className:`cs-knr`,"aria-label":`Filter notes`,children:[(0,H.jsx)(`div`,{className:`cs-knrh cs-f`,children:`Agents`}),(0,H.jsxs)(`button`,{type:`button`,className:`cs-knri`,"data-sel":!r||void 0,"aria-pressed":!r,onClick:()=>P(void 0),children:[(0,H.jsx)(`span`,{className:`cs-nm`,children:`All notes`}),(0,H.jsx)(`span`,{className:`cs-ct`,children:n.notes.length})]}),fA.filter(e=>F.some(t=>t.agent===e)).map(e=>(0,H.jsxs)(`div`,{className:`contents`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`cs-knri`,"data-sel":r===e&&!a||void 0,"data-drop":E===e||void 0,"aria-pressed":r===e,style:{"--c":EA[e]},onClick:()=>P(r===e&&!a?void 0:e),onDragOver:t=>{w&&(t.preventDefault(),D(e))},onDragLeave:()=>D(t=>t===e?void 0:t),onDrop:le(e),children:[(0,H.jsx)(`span`,{className:`cs-nm`,children:pA[e]}),n.files.some(t=>t.agent===e&&t.over)?(0,H.jsx)(`span`,{className:`cs-ovd`,title:`A file is over the compaction threshold`}):null,(0,H.jsx)(`span`,{className:`cs-ct`,children:n.notes.filter(t=>t.agent===e).length})]}),r===e?n.files.filter(t=>t.agent===e).map(t=>(0,H.jsxs)(`button`,{type:`button`,className:`cs-knri`,"data-k":`file`,"data-sel":a===t.file||void 0,"aria-pressed":a===t.file,style:{"--c":EA[e]},onClick:()=>o(e=>e===t.file?void 0:t.file),children:[(0,H.jsx)(`span`,{className:`cs-nm`,children:t.file}),t.over?(0,H.jsx)(`span`,{className:`cs-ovd`,title:`Over the compaction threshold`}):null,(0,H.jsx)(`span`,{className:`cs-ct`,children:hA(t.chars)})]},t.file)):null]},e)),A.length?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`cs-knrh`,children:`Tags`}),(0,H.jsx)(`div`,{className:`cs-kntags`,children:A.map(([e,t])=>(0,H.jsxs)(`button`,{type:`button`,className:`cs-ktg`,"data-on":s.includes(e)||void 0,"aria-pressed":s.includes(e),onClick:()=>N(e),children:[`#`,e,(0,H.jsx)(`span`,{className:`ml-[5px] opacity-60`,children:t})]},e))})]}):null,(0,H.jsx)(`p`,{className:`cs-knhint`,children:`Drag a note onto an agent to move it. Pinned notes always load first.`})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`cs-knt`,children:[(0,H.jsxs)(`label`,{className:`cs-kns`,children:[(0,H.jsx)(jg,{"aria-hidden":`true`,className:`size-4 flex-none`}),(0,H.jsx)(`input`,{type:`text`,value:l,placeholder:`Search notes, tags and sources`,"aria-label":`Search notes`,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Escape`&&l&&(e.stopPropagation(),u(``))}}),l?(0,H.jsx)(`button`,{type:`button`,className:`cs-kx`,"aria-label":`Clear the search`,onClick:()=>u(``),children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5`})}):null]}),(0,H.jsxs)(`button`,{type:`button`,className:`cs-kc cs-sm`,"data-on":d===`pinned`?`true`:void 0,"aria-pressed":d===`pinned`,onClick:()=>L(`pinned`),children:[(0,H.jsx)(pg,{"aria-hidden":`true`,className:`size-3.5`}),`Pinned `,(0,H.jsx)(`span`,{className:`cs-mut`,children:fe})]}),(0,H.jsxs)(`button`,{type:`button`,className:`cs-kc cs-sm`,"data-on":d===`stale`?`true`:void 0,"aria-pressed":d===`stale`,onClick:()=>L(`stale`),children:[`Stale `,(0,H.jsx)(`span`,{className:`cs-mut`,children:de(`stale`)})]}),(0,H.jsxs)(`button`,{type:`button`,className:`cs-kc cs-sm`,"data-on":d===`conflict`?`true`:void 0,"aria-pressed":d===`conflict`,onClick:()=>L(`conflict`),children:[`Conflicts `,(0,H.jsx)(`span`,{className:`cs-mut`,children:de(`conflict`)})]}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm`,"data-tip":`Change the order`,onClick:()=>h(e=>!e),children:p?`Most used`:`Pinned first`}),(0,H.jsxs)(`button`,{type:`button`,className:`cs-kc cs-sm cs-pri`,disabled:g,onClick:()=>_(!0),children:[(0,H.jsx)(_g,{"aria-hidden":`true`,className:`size-3.5`}),`New note`]})]}),(0,H.jsx)(hV,{notes:n.notes,onOpen:y,onSaved:n.reload}),g?(0,H.jsxs)(`div`,{className:`cs-knc mb-3`,children:[(0,H.jsxs)(`div`,{className:`cs-knch`,style:{"--c":EA[oe]},children:[(0,H.jsx)(`span`,{className:`cs-kat`,"aria-hidden":`true`,children:DA(oe)}),(0,H.jsx)(`b`,{children:pA[oe]}),(0,H.jsxs)(`span`,{className:`cs-fl`,children:[`· new note in `,se]})]}),(0,H.jsx)(DV,{initial:``,label:`New note`,action:`Add note`,placeholder:`What should ${pA[oe]} keep in mind?`,onSave:ce,onCancel:()=>_(!1)})]}):null,k.length?(0,H.jsx)(`div`,{className:`cs-kng`,children:ue.map((e,t)=>(0,H.jsx)(`div`,{className:`cs-kcol`,children:e.map(e=>(0,H.jsx)(kV,{note:e,selected:e.key===v,dragging:e.key===w,activeTags:s,editing:b===e.key,onEditing:t=>x(t?e.key:void 0),onOpen:()=>{C(!1),y(e.key)},onTag:N,onDragStart:()=>T(e.key),onDragEnd:()=>{T(void 0),D(void 0)},onSave:t=>ne(e,t),onDelete:()=>void re(e),onPin:()=>void ie(e),onReview:()=>ee(`inbox`)},e.key))},t))}):(0,H.jsxs)(`div`,{className:`cs-knempty`,children:[(0,H.jsx)(`b`,{children:n.notes.length?`No notes match`:`No notes yet`}),n.notes.length?`Try another word, or clear the filters.`:`New note writes the first one.`]})]})]})]})}),(0,H.jsx)(Uv,{target:O}),(0,H.jsx)(dA,{open:!!j,onClose:()=>y(void 0),label:`Note`,className:`cs-knw`,head:M.current?(0,H.jsx)(PV,{note:M.current,onPin:()=>void ie(M.current),onEdit:()=>{let e=M.current.key;y(void 0),x(e)},onComment:()=>C(!0),onDelete:()=>void re(M.current)}):null,children:M.current?(0,H.jsx)(IV,{note:M.current,view:te(M.current),commenting:S,onCommenting:C,onTag:e=>{y(void 0),P(void 0),N(e)},onMove:e=>void ae(M.current,e),onChanged:n.reload},M.current.key):null})]})}function BV(e){let t=e[0];try{return{id:t?decodeURIComponent(t):void 0}}catch{return{id:t}}}function VV({className:e,...t}){return(0,H.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:Y(`inline-flex size-4 shrink-0 items-end justify-between text-primary`,e),...t,children:[0,1,2].map(e=>(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`block aspect-square h-[28%] shrink-0 rounded-full bg-current motion-safe:animate-[hop_0.9s_ease-in-out_infinite]`,style:{animationDelay:`${e*.14}s`}},e))})}function HV(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(!0),[r,i]=(0,m.useState)(!0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(null),s=(0,m.useCallback)(()=>{n.current=!0,i(!0);let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]);return(0,m.useLayoutEffect)(()=>{n.current&&s()},[e,s]),(0,m.useLayoutEffect)(()=>{let e=t.current;if(!e||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{n.current&&(e.scrollTop=e.scrollHeight)});return r.observe(e),a.current=r,()=>{r.disconnect(),a.current=void 0,o.current=null}},[]),(0,m.useLayoutEffect)(()=>{let e=a.current,n=t.current?.firstElementChild??null;e&&n!==o.current&&(o.current&&e.unobserve(o.current),n&&e.observe(n),o.current=n)},[e]),{ref:t,atBottom:r,stick:s,onScroll:(0,m.useCallback)(()=>{let e=t.current;e&&(n.current=e.scrollHeight-e.scrollTop-e.clientHeight<48,i(n.current))},[])}}var UV={MASTER:[`M2 7l5 4 5-7 5 7 5-4-2 12H4z`],DESIGN:[`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-2 2-2H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8z`,`M7.5 11h.01M10 7h.01M15 7h.01`],DEV:[`M8 8l-5 4 5 4M16 8l5 4-5 4M14 5l-4 14`],QA:[`M12 3l8 3v6c0 4.5-3.2 8-8 9-4.8-1-8-4.5-8-9V6z`,`M8.5 12l2.5 2.5 4.5-5`],RESEARCH:[`M12 3a9 9 0 1 0 0 18 9 9 0 1 0 0-18z`,`M3 12h18M12 3c3 3 3 15 0 18M12 3c-3 3-3 15 0 18`],SCOUT:[`M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z`,`M12 9a3 3 0 1 0 0 6 3 3 0 1 0 0-6z`]};function WV(e){let t=e?.toUpperCase();if(t)return t===`ORACLE`||t===`ORCHESTRATOR`||t===`MASTER`?`MASTER`:t===`BACKEND`?`DEV`:t===`DESIGNER`||t===`FRONTEND`?`DESIGN`:t===`RESEARCHER`?`RESEARCH`:UV[t]?t:void 0}function GV(e){let t=WV(e);return t===`MASTER`?`var(--c-orc)`:t===`DESIGN`?`var(--c-des)`:t===`DEV`?`var(--c-dev)`:t===`QA`?`var(--c-qa)`:t===`RESEARCH`?`var(--c-res)`:t===`SCOUT`?`var(--c-sc)`:e?.toUpperCase()===`PLANNER`||e?.toUpperCase()===`PANEL`?`var(--c-pl)`:`var(--muted-foreground)`}function KV(e,t){let n=WV(e);return n?n===WV(t):e?.toUpperCase()===t?.toUpperCase()}function qV(e){let t=e?.toUpperCase();return t===`ORACLE`||t===`ORCHESTRATOR`||t===`MASTER`}function JV(e){return e.role===`you`||e.role===`note`?e.role:e.role===`panel`?`PLANNER`:e.agent??`MASTER`}var YV={MASTER:`text-primary`,DEV:`text-source-dev`,DESIGN:`text-source-design`,QA:`text-source-qa`,RESEARCH:`text-source-research`,SCOUT:`text-source-scout`,ORACLE:`text-primary`,ORCHESTRATOR:`text-primary`,LOBBY:`text-muted-foreground`};function XV(e){return e===`MASTER`||e===`ORACLE`||e===`ORCHESTRATOR`?`Orchestrator`:e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function ZV(e){return YV[e]??`text-muted-foreground`}var QV={MASTER:`var(--primary)`,DEV:`var(--source-dev)`,DESIGN:`var(--source-design)`,QA:`var(--source-qa)`,RESEARCH:`var(--source-research)`,SCOUT:`var(--source-scout)`,ORACLE:`var(--primary)`,ORCHESTRATOR:`var(--primary)`,LOBBY:`var(--muted-foreground)`};function $V(e){return QV[e]??`var(--muted-foreground)`}function eH(e){if(e.role===`researcher`)return`RESEARCH`;let t=e.domain??e.role;return t===`backend`||t===`dev`?`DEV`:t===`designer`||t===`design`?`DESIGN`:t===`researcher`||t===`research`?`RESEARCH`:t===`qa`?`QA`:t?String(t).toUpperCase():`AGENT`}function tH(e,t=40){let n=new Map;for(let t of e)n.set(t.source,t);return[...n.values()].sort((e,t)=>e.at-t.at).slice(-t)}function nH(e){let t=(e??``).toUpperCase();return t===`MASTER`||t===`ORACLE`||t===`ORCHESTRATOR`?`oracle`:t===`PLANNER`||t===`PANEL`?`planner`:t===`SCOUT`?`scout`:t===`RESEARCH`||t===`RESEARCHER`?`research`:t===`DEV`||t===`BACKEND`||t===`WORKER`?`dev`:t===`QA`?`qa`:t===`DESIGN`||t===`DESIGNER`||t===`FRONTEND`?`design`:`agent`}var rH={oracle:[{fx:`lamp`,verb:`Thinking`},{fx:`ripple`,verb:`Considering`},{fx:`twinkle`,verb:`Pondering`},{fx:`breathe`,verb:`Reflecting`},{fx:`focus`,verb:`Focusing`}],planner:[{fx:`route`,verb:`Planning`},{fx:`outline`,verb:`Outlining`},{fx:`fork`,verb:`Mapping`},{fx:`brackets`,verb:`Scoping`},{fx:`stairs`,verb:`Sequencing`}],scout:[{fx:`lens`,verb:`Scouting`},{fx:`radar`,verb:`Surveying`},{fx:`sonar`,verb:`Probing`},{fx:`spotlight`,verb:`Exploring`},{fx:`needle`,verb:`Navigating`}],research:[{fx:`page`,verb:`Reading`},{fx:`bookmark`,verb:`Noting`},{fx:`highlight`,verb:`Studying`},{fx:`skim`,verb:`Skimming`},{fx:`riffle`,verb:`Researching`}],dev:[{fx:`type`,verb:`Writing`},{fx:`braces`,verb:`Coding`},{fx:`block`,verb:`Editing`},{fx:`build`,verb:`Building`},{fx:`code`,verb:`Implementing`}],qa:[{fx:`scan`,verb:`Checking`},{fx:`frame`,verb:`Inspecting`},{fx:`pulse`,verb:`Testing`},{fx:`tests`,verb:`Verifying`},{fx:`stamp`,verb:`Reviewing`}],design:[{fx:`sketch`,verb:`Sketching`},{fx:`swatch`,verb:`Styling`},{fx:`grid`,verb:`Laying out`},{fx:`wave`,verb:`Shaping`},{fx:`ruler`,verb:`Measuring`}],agent:[{fx:`dots`,verb:`Working`},{fx:`glide`,verb:`Processing`},{fx:`fade`,verb:`Busy`},{fx:`march`,verb:`Running`},{fx:`nudge`,verb:`Progressing`}]},iH=3e4,aH=new Map;function oH(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}function sH(e,t){if(e<2)return 0;let n=Math.floor(Math.random()*(t===void 0?e:e-1));return t!==void 0&&n>=t?n+1:n}function cH(e){let t=aH.get(e);return t||(t={index:sH(rH[e].length),listeners:new Set},aH.set(e,t)),t}function lH(e,t){oH()||(t.timer=setTimeout(()=>{t.index=sH(rH[e].length,t.index);for(let e of t.listeners)e();lH(e,t)},iH+Math.random()*3e4))}function uH(e){let t=cH(e),n=(0,m.useSyncExternalStore)(n=>(t.listeners.add(n),t.listeners.size===1&&lH(e,t),()=>{t.listeners.delete(n),t.listeners.size||(clearTimeout(t.timer),t.timer=void 0)}),()=>t.index,()=>t.index);return rH[e][n]??rH[e][0]}function dH({source:e,text:t,className:n}){let r=nH(e),{fx:i,verb:a}=uH(r),o=t??a;return(0,H.jsxs)(`span`,{className:n?`cs-rw ${n}`:`cs-rw`,"data-role":r,"data-fx":i,style:{"--tone":GV(e),"--n":o.length},children:[(0,H.jsx)(`span`,{className:`cs-wtx`,children:o},i),(0,H.jsx)(`span`,{className:`cs-rw-o`,"aria-hidden":`true`},`${i}-o`)]})}function fH({source:e,name:t,time:n,head:r,live:i,children:a,aside:o,named:s,waiting:c,tile:l}){let u=c||r&&(s||!qV(e));return l?(0,H.jsx)(`div`,{className:`cs-pmsg`,children:(0,H.jsx)(fH,{source:e,name:t,head:r,time:n,live:i,children:a,aside:o,waiting:c,named:s??!0})}):(0,H.jsxs)(`div`,{className:`chat-agent group/msg`,"data-live":i||void 0,style:i?{"--orb":$V(e)}:void 0,children:[u||o?(0,H.jsxs)(`p`,{className:`chat-speaker`,children:[u?(0,H.jsx)(`b`,{className:`chat-name`,title:n,style:{"--who":GV(e)},children:c?(0,H.jsx)(dH,{source:e,text:t,className:`cs-rw-name`}):t}):null,o?(0,H.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:o}):null]}):null,c?null:(0,H.jsx)(`div`,{className:`chat-prose`,title:u?void 0:n,children:a})]})}function pH(){return(0,H.jsx)(`svg`,{className:`cs-ut`,viewBox:`0 0 22 16`,"aria-hidden":`true`,focusable:`false`,children:(0,H.jsx)(`path`,{d:`M0 0H13C13 8 16 12.9 21 15.5C17.6 16.4 13.7 15.9 10.7 14.2C9.2 15.4 6.6 16 3 16H0Z`,className:`cs-ut-fill`})})}function mH({time:e,head:t,note:n,children:r,below:i,actions:a,fresh:o}){return(0,H.jsxs)(`div`,{className:`group/msg relative flex flex-col items-end gap-1`,children:[(0,H.jsxs)(`div`,{className:`chat-bubble cs-umsg`,"data-new":o||void 0,title:e,children:[(0,H.jsx)(`i`,{className:`cs-uf`,"aria-hidden":`true`,children:(0,H.jsx)(`b`,{className:`cs-ub`})}),(0,H.jsx)(pH,{}),(0,H.jsx)(`div`,{className:`cs-ux`,children:r}),a&&!n?(0,H.jsx)(`div`,{className:`chat-meta absolute top-1/2 right-full mr-2 flex -translate-y-1/2 items-center gap-2 whitespace-nowrap`,children:a}):null]}),n?(0,H.jsxs)(`div`,{className:`chat-meta flex items-center gap-2 pr-[9px]`,"data-note":``,children:[a,(0,H.jsx)(`span`,{children:n})]}):null,i]})}function hH({failed:e,auto:t,children:n}){return(0,H.jsx)(`div`,{role:`note`,className:Y(`chat-note`,e&&`text-destructive`,t&&`chat-note-auto`),children:(0,H.jsx)(`span`,{children:n})})}function gH({onClick:e,className:t}){return(0,H.jsx)(`button`,{type:`button`,"aria-label":`Jump to latest`,"data-tip":`Jump to latest`,onClick:e,className:Y(`jump-latest btn-outline grid size-9 place-items-center rounded-full border bg-card text-foreground shadow-card outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t),children:(0,H.jsx)(pm,{"aria-hidden":`true`,className:`size-4`})})}var _H=8;function vH(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function yH({done:e,total:t}){let n=Math.min(t,_H);if(n<=0)return null;let r=Math.min(n,Math.round(Math.max(0,e)/t*n));return(0,H.jsx)(`span`,{className:`cs-pips`,"aria-hidden":`true`,style:{"--n":n,"--d":r}})}function bH({mark:e,className:t}){return(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:Y(`cs-mk`,t),"data-s":e===`open`?void 0:e,children:[(0,H.jsx)(`svg`,{className:`cs-ck`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,H.jsx)(`path`,{d:`M5 12.5l4.5 4.5L19 7.5`})}),(0,H.jsx)(`svg`,{className:`cs-xx`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,H.jsx)(`path`,{d:`M7 7l10 10M17 7L7 17`})}),(0,H.jsx)(`svg`,{className:`cs-sl`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,H.jsx)(`path`,{d:`M6 18L18 6`})})]})}function xH({check:e,live:t,waiting:n,className:r}){return(0,H.jsx)(bH,{mark:e===`done`?`done`:e===`dropped`?`drop`:n?`warn`:t?`now`:`open`,...r?{className:r}:{}})}var SH=`auto mode`;function CH(e){return e<10?`0${e}`:String(e)}function wH(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${CH(t.getHours())}:${CH(t.getMinutes())}`}function TH(e){if(!Number.isFinite(e)||e<5e3)return`now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}function EH(e){let t=TH(e);return t===`now`?`just now`:`${t} ago`}function DH({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,H.jsxs)(`section`,{className:Y(`workspace-frame group/frame relative flex min-h-0 min-w-0 flex-col rounded-xl border shadow-xs`,i&&`flex-none`,n),...s,children:[e||t||a?(0,H.jsxs)(`div`,{className:Y(`flex min-h-12 shrink-0 items-center justify-between gap-3 px-4`,!i&&`border-b border-border`),children:[e?(0,H.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,H.jsx)(`span`,{}),(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,H.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":!i,"aria-label":i?`Expand ${c}`:`Minimize ${c}`,"data-tip":i?`Expand`:`Minimize`,"data-tip-keys":o,"data-tip-keep":``,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,"aria-describedby":`focused-action-help`,onClick:a,className:`btn-ghost -mr-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2 text-muted-foreground transition-[box-shadow,color,scale] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:scale-[0.97] motion-reduce:active:scale-100`,children:[o?(0,H.jsx)(ak,{chord:o,className:`kbd-hint`}):null,(0,H.jsx)(jm,{"aria-hidden":`true`,className:Y(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function OH(e,t){if(e===`app.sidebar`&&t==null){let e=globalThis.matchMedia;return typeof e==`function`&&e(`(max-width: 1023.98px)`).matches}return e===`lobby.thinking`||t===`1`}var kH=`bot-lobby.collapsed.`,AH=new Set,jH=new Map;function MH(e){if(jH.has(e))return jH.get(e);if(e===`lobby.thinking`)return OH(e);try{return OH(e,localStorage.getItem(kH+e))}catch{return!1}}function NH(e,t){jH.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(kH+e,t?`1`:`0`)}catch{}for(let e of[...AH])e()}function PH(e){return AH.add(e),()=>{AH.delete(e)}}function FH(e){NH(e,!MH(e))}function IH(e){return[(0,m.useSyncExternalStore)(PH,()=>MH(e),()=>OH(e)),(0,m.useCallback)(()=>NH(e,!MH(e)),[e])]}var LH=`lobby.activity.open`;function RH({entry:e}){return e.pending?(0,H.jsx)(`span`,{className:`size-1.5 rounded-full bg-[var(--orb)]`}):e.kind===`error`?(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,H.jsx)(Yg,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,H.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function zH({entry:e}){return(0,H.jsxs)(`li`,{className:`cs-wl activity-step`,title:wH(e.at),style:e.pending?{"--orb":$V(e.source)}:void 0,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,H.jsx)(RH,{entry:e})}),(0,H.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,H.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,H.jsx)(`b`,{children:XV(e.source)}),` `,(0,H.jsxs)(`span`,{className:e.kind===`error`?`text-destructive`:e.pending?`text-foreground`:void 0,children:[tV(e.text),e.pending?`…`:``]})]})]})}function BH(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,`0`)}m`}function VH(e){let t=[...e].reverse().find(e=>e.pending),n=[...new Set(e.map(e=>XV(e.source)))];return{...t?{live:t}:{},took:(e.at(-1)?.at??0)-(e[0]?.at??0),count:`${e.length} ${e.length===1?`step`:`steps`}`,sources:n.length>3?`${n.slice(0,3).join(`, `)} +${n.length-3}`:n.join(`, `),errors:e.filter(e=>e.kind===`error`).length,warnings:e.filter(e=>e.kind===`warning`).length,label:HH(e,n,(e.at(-1)?.at??0)-(e[0]?.at??0))}}function HH(e,t,n){let r=e.filter(e=>!e.pending);if(r.length>1&&r.every(e=>e.kind===`info`||e.kind===`success`)&&t.length===1&&e[0]!==void 0&&e.at(-1)!==void 0)return`Tool calls (${wH(e[0].at)}–${wH(e.at(-1).at)})`;let i=t.length>3?`${t.slice(0,3).join(`, `)} +${t.length-3}`:t.join(`, `);return`${n>=1e3?`Worked for ${BH(n)}`:`Worked`} · ${e.length} ${e.length===1?`step`:`steps`}${i?` · ${i}`:``}`}function UH(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function WH({entries:e}){let[t]=IH(LH),[n,r]=(0,m.useState)();(0,m.useEffect)(()=>r(void 0),[t]);let i=n??t,a=(0,m.useId)(),{live:o,label:s,count:c,errors:l,warnings:u}=VH(e),d=UH(!!o),f=o?{"--orb":$V(o.source)}:void 0;return(0,H.jsxs)(`div`,{className:`cs-work activity-run`,"data-live":o?!0:void 0,"data-open":i||void 0,style:f,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":a,onClick:()=>r(!i),className:`cs-wrow activity-toggle`,children:[o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(dH,{source:o.source}),(0,H.jsxs)(`span`,{className:`activity-live-step min-w-0 truncate`,children:[(0,H.jsx)(`span`,{className:Y(`font-medium`,ZV(o.source)),children:XV(o.source)}),` `,o.text]},o.id),(0,H.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[c,e[0]&&d-e[0].at>=1e3?` · ${BH(d-e[0].at)}`:``]})]}):(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),l?(0,H.jsxs)(`span`,{className:`shrink-0 text-[var(--bad)]`,children:[l,` `,l===1?`error`:`errors`]}):null,u?(0,H.jsxs)(`span`,{className:`shrink-0 text-[var(--warn)]`,children:[u,` `,u===1?`warning`:`warnings`]}):null,(0,H.jsx)(jm,{"aria-hidden":`true`,className:`cs-chev size-3.5 shrink-0`})]}),(0,H.jsx)(`div`,{className:`cs-wbody`,inert:!i,children:(0,H.jsx)(`div`,{className:`cs-wi`,children:(0,H.jsx)(`ol`,{id:a,"aria-label":`Activity`,className:`cs-wlines`,children:i?e.map(e=>(0,H.jsx)(zH,{entry:e},e.id)):null})})})]})}var GH=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,KH=260,qH=200,JH=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function YH(e){let t=[],n=[],r=!1;for(let i of e){if(/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&!i.trim()){n.length&&t.push(n.join(`
93
- `).trim()),n=[];continue}n.push(i)}return n.length&&t.push(n.join(`
94
- `).trim()),t.filter(Boolean)}function XH(e){let t=e.split(/(?<=[.!?…])\s+(?=[A-Z"'“‘`(\[])/),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&(t.split("`").length-1)%2==1?n[n.length-1]=`${t} ${e}`:n.push(e)}return n}function ZH(e){if(e.length<=KH||JH.test(e))return[e];let t=[],n=``;for(let r of XH(e.replace(/\s*\n\s*/g,` `)))n&&n.length+r.length+1>qH?(t.push(n),n=r):n=n?`${n} ${r}`:r;return n&&t.push(n),t}function QH(e){let t=e.replace(/\r\n?/g,`
95
- `).trim().split(`
96
- `),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:GH.exec(e),i=t?(t[1]??t[2]??t[3])?.trim():void 0;i?n.push({title:i,lines:[]}):n.at(-1).lines.push(e)}let i=[];for(let e of n){let t=YH(e.lines);if(e.title)i.push({title:e.title,text:t.join(`
97
-
98
- `)});else for(let e of t)for(let t of ZH(e))i.push({text:t})}return i}var $H=4,eU=e=>({"--orb":e});function tU({thought:e}){let t=(0,m.useMemo)(()=>QH(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-$H),a=t.slice(i),o=XV(e.source);return(0,H.jsxs)(`li`,{className:`thought`,style:eU($V(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`thought-label`,children:o}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?`thinking…`:EH(Date.now()-e.at)})]}),i?(0,H.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,H.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,H.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,H.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,H.jsx)(pV,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function nU(e){let t=QH(e.text).at(-1);return(t?.title||t?.text||``).replace(/\s+/g,` `).trim()}function rU(e,t){return tH(e).filter(e=>e.live||e.at>=t).sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at||t.id-e.id)}function iU({thoughts:e}){let[t]=IH(`lobby.thinking`),[n,r]=(0,m.useState)();(0,m.useEffect)(()=>r(void 0),[t]);let i=n??!t,a=(0,m.useId)();if(!e.length)return null;let o=e.find(e=>e.live),s=[...new Set(e.map(e=>XV(e.source)))].join(`, `);return(0,H.jsxs)(`div`,{className:`cs-work activity-run cs-think`,"data-live":o?!0:void 0,"data-open":i||void 0,style:o?eU($V(o.source)):void 0,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":a,onClick:()=>r(!i),className:`cs-wrow activity-toggle`,children:[o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(dH,{source:o.source,text:`Thinking`}),(0,H.jsxs)(`span`,{className:`activity-live-step min-w-0 truncate`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:XV(o.source)}),` `,nU(o)]},o.id)]}):(0,H.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Thought · `,s]}),(0,H.jsx)(jm,{"aria-hidden":`true`,className:`cs-chev size-3.5 shrink-0`})]}),(0,H.jsx)(`div`,{className:`cs-wbody`,inert:!i,children:(0,H.jsx)(`div`,{className:`cs-wi`,children:(0,H.jsx)(`ul`,{id:a,"aria-label":`Thinking`,className:`flex flex-col gap-2.5 py-1`,children:i?e.map(e=>(0,H.jsx)(tU,{thought:e},e.id)):null})})})]})}function aU(e,t){let n=[...t].sort((e,t)=>e.at-t.at||e.id-t.id),r=[],i=0,a=e=>{let t=[];for(;i<n.length&&n[i].at<e;)t.push(n[i++]);t.length&&r.push({kind:`activity`,key:`steps-${t[0].id}`,entries:t})};for(let t of e)a(t.at),r.push({kind:`message`,entry:t});return a(1/0),r}function oU(e){if(e.source!==`LOBBY`)return;if(/^a knowledge question\b/.test(e.text))return{knowledge:!0};let t=/^([A-Z]+) answers: (.*)$/.exec(e.text);if(t)return t[2].startsWith(`you named`)?`named`:{agent:t[1]}}function sU(e){let t=[];for(let n of e){if(n.kind===`message`){t.push(n);continue}let e=[],r=()=>{e.length&&t.push({kind:`activity`,key:`steps-${e[0].id}`,entries:e}),e=[]};for(let i of n.entries){let n=oU(i);n?(r(),n!==`named`&&t.push({kind:`route`,key:`route-${i.id}`,route:n})):e.push(i)}r()}return t}var cU=3e5,lU=`What's on your mind?`,uU=`Ask a question or for a change below.`,dU=`Talk about this task`,fU=`The orchestrator answers here.`;function pU({entry:e}){return e.text===`auto mode`?(0,H.jsx)(hH,{auto:!0,children:SH}):(0,H.jsxs)(hH,{failed:e.text.startsWith(`✗`),children:[e.text,e.at?` · ${wH(e.at)}`:``]})}function mU(e){let t=/^\/[a-z][\w-]*(?=\s|$)/i.exec(e.text);if(t)return{token:t[0],color:`var(--primary)`,text:e.text.slice(t[0].length).trimStart()};if(e.to&&e.to!==`MASTER`)return{token:`@${XV(e.to)}`,color:GV(e.to),text:e.text}}function hU({entry:e,head:t,fresh:n}){if(e.role===`you`){let r=mU(e);return(0,H.jsxs)(mH,{time:wH(e.at),head:t,fresh:n,children:[r?(0,H.jsx)(`span`,{className:`cs-lead`,style:{color:r.color},children:r.token}):null,(0,H.jsx)(pV,{text:r?r.text:e.text})]})}let r=JV(e);return(0,H.jsx)(fH,{source:r,name:r===`PLANNER`?`Panel`:XV(r),time:wH(e.at),head:t,named:!0,children:(0,H.jsx)(pV,{text:e.text})})}var gU=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,H.jsx)(Qf.div,{initial:n&&e.role!==`you`?{opacity:0,y:6}:!1,animate:{opacity:1,y:0},transition:{duration:.221,ease:[.22,1,.36,1]},children:e.role===`note`?(0,H.jsx)(pU,{entry:e}):(0,H.jsx)(hU,{entry:e,head:t,fresh:n})})},(e,t)=>e.head===t.head&&e.entry.id===t.entry.id&&e.entry.text===t.entry.text&&e.entry.at===t.entry.at&&e.entry.to===t.entry.to);function _U({text:e,busy:t,working:n,answering:r}){let i=!!e?.trim();if(!i&&(!t||n))return null;let a=i?`MASTER`:r??`MASTER`;return(0,H.jsx)(fH,{source:a,name:XV(a),head:!0,named:!0,live:t,waiting:!i,aside:t&&i?`writing…`:void 0,children:i?(0,H.jsx)(pV,{text:e??``}):null})}function vU({route:e}){return`knowledge`in e?(0,H.jsxs)(`p`,{className:`cs-route`,children:[`Classifier chose `,(0,H.jsx)(`b`,{style:{color:`var(--primary)`},children:`the project's knowledge`})]}):(0,H.jsxs)(`p`,{className:`cs-route`,children:[`Classifier chose `,(0,H.jsx)(`b`,{style:{color:GV(e.agent)},children:XV(e.agent)})]})}function yU({hasTask:e}){return(0,H.jsxs)(`div`,{className:`cs-pg cs-blank`,children:[(0,H.jsx)(`h2`,{children:e?dU:lU}),(0,H.jsx)(`p`,{children:e?fU:uU})]})}async function bU(e){let t=await R(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function xU(e,t,n){let[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(t),[s,c]=(0,m.useState)(!1),l=(0,m.useMemo)(()=>{let t=new Set(e.map(e=>e.id));return[...r.filter(e=>!t.has(e.id)),...e]},[r,e]);return{merged:l,more:a,loading:s,load:(0,m.useCallback)(async()=>{let e=l[0]?.id;if(e===void 0||s||!a)return;c(!0);let t=n.current,r=t?.scrollHeight??0,u=t?.scrollTop??0;try{let t=await bU(e);i(e=>[...t.entries,...e]),o(t.hasOlder),window.requestAnimationFrame(()=>{let e=n.current;e&&(e.scrollTop=e.scrollHeight-r+u)})}catch{o(!1)}finally{c(!1)}},[l,s,a,n])}}var SU=[],CU=[];function wU({chat:e,activity:t=SU,thoughts:n=CU,reply:r,busy:i,answering:a,hasOlder:o,hasTask:s}){let c=(0,m.useMemo)(()=>t.slice(-400),[t]),{ref:l,atBottom:u,stick:d,onScroll:f}=HV(`${e.length}:${r?.length??0}:${c.length}:${c.at(-1)?.pending??``}:${a??``}:${n.at(-1)?.id??``}:${n.at(-1)?.text.length??0}`),{merged:p,more:h,loading:g,load:_}=xU(e,o,l),v=(0,m.useCallback)(()=>{f();let e=l.current;e&&e.scrollTop<80&&h&&!g&&_()},[f,l,h,g,_]),y=(0,m.useMemo)(()=>sU(aU(p,c)),[p,c]),b=p.length===0&&c.length===0&&n.length===0&&!r?.trim()&&!i,x=y.at(-1),S=(0,m.useMemo)(()=>rU(n,p.at(-1)?.at??0),[n,p]),C=x?.kind===`activity`&&!!VH(x.entries).live,[w,T]=(0,m.useState)(!1);return(0,m.useEffect)(()=>T(!0),[]),(0,H.jsxs)(DH,{"aria-label":`Conversation`,"data-bare":!0,className:`flex-1 rounded-none border-0 shadow-none`,children:[(0,H.jsx)(`div`,{ref:l,onScroll:v,className:`cs-thread min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pb-dock outline-none`,role:`log`,"aria-label":`Conversation`,tabIndex:0,children:b?(0,H.jsx)(yU,{hasTask:s}):(0,H.jsxs)(`div`,{className:`chat-column`,children:[h?(0,H.jsx)(`p`,{className:`mb-4 text-center text-xs text-muted-foreground`,children:`Earlier messages load as you scroll up.`}):null,y.map((e,t)=>{if(e.kind===`activity`)return(0,H.jsx)(WH,{entries:e.entries},e.key);if(e.kind===`route`)return(0,H.jsx)(vU,{route:e.route},e.key);let n=y[t-1],r=n?.kind===`message`?n.entry:void 0,i=!r||JV(r)!==JV(e.entry)||e.entry.at-r.at>cU;return(0,H.jsx)(gU,{entry:e.entry,head:i,fresh:w},e.entry.id)}),(0,H.jsx)(iU,{thoughts:S}),(0,H.jsx)(_U,{text:r,busy:i,working:C,...a?{answering:a}:{}})]})}),(0,H.jsx)(Uv,{target:l,down:!1}),u?null:(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-dock z-10 flex justify-center [&>*]:pointer-events-auto`,children:(0,H.jsx)(gH,{onClick:d})})]})}var TU=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function EU({data:e,status:t}){let n=TU(t);if(!n.conversation)return null;let r=n.activity?e?.activity:void 0,i=n.thinking?e?.thoughts:void 0;return(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(wU,{chat:e?.chat??[],...r?{activity:r}:{},...i?{thoughts:i}:{},reply:e?.reply,busy:t?.busy??!1,...e?.answering?{answering:e.answering}:{},hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task})})}function DU(){let e=Vk(`lobby`),t=Vk(`status`);return!e.data&&e.loading?(0,H.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(VV,{}),(0,H.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,H.jsx)(jk,{message:e.error,onRetry:()=>F.onHello({})}):(0,H.jsx)(EU,{data:e.data,status:t.data})}var OU=class{seen=new Set;initialized=new Set;storage;constructor(e){this.storage=e;try{let t=JSON.parse(e?.getItem(`bot-lobby.prompt-seen`)??`[]`);Array.isArray(t)&&(this.seen=new Set(t.filter(e=>typeof e==`string`)))}catch{}}observe(e,t,n=!1){let r=this.initialized.has(e)&&!n?t.filter(e=>!this.seen.has(e)):[];this.initialized.add(e);for(let e of t)this.seen.add(e);try{this.storage?.setItem(`bot-lobby.prompt-seen`,JSON.stringify([...this.seen]))}catch{}return r}};function kU(e,t){return JSON.stringify([e,`prompt`,t])}function AU(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function jU(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var MU=`bot-lobby.notifications`,NU=`/icon-192.png`,PU=new Set;function FU(){for(let e of[...PU])e()}function IU(){try{return localStorage.getItem(MU)===`on`}catch{return!1}}function LU(e){return PU.add(e),()=>{PU.delete(e)}}function RU(e){try{localStorage.setItem(MU,e?`on`:`off`)}catch{}FU()}function zU(){return(0,m.useSyncExternalStore)(LU,IU,()=>!1)}async function BU(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(RU(!0),`granted`):`denied`)}function VU(){RU(!1)}function HU(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function UU(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function WU(e){try{new Notification(`bot-lobby`,{body:e,icon:NU,tag:`bot-lobby`})}catch{}}function GU(){try{return new OU(sessionStorage)}catch{return new OU}}function KU(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?AU(e,t.sessionId??n.key??t.from,n.dialog.id):kU(e,t.id)}function qU(){let e=zU();kp(),zk();let t=MV(`tasks.list`,{},[`tasks`]),n=MV(`sessions.list`,{},[`sessions`]),r=F.get(`prompts`),i=F.get(`lobby`).data,a=(0,m.useRef)(GU()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=fe()??`current`,l=F.status().connection;return{enabled:e,tasks:t,sessions:n,prompts:r,lobby:i,seen:a,quiet:o,previousState:s,project:c,connection:l,lastConnection:(0,m.useRef)(l)}}function JU(e,t,n,r,i){if(!i)return;let{seen:a,project:o,quiet:s,enabled:c}=e,l=a.current.observe(`${o}:${t}`,n,s.current.has(t));s.current.delete(t),l.length&&(Np(t===`prompts`?`question`:`attention`),c&&UU()&&WU(r),t===`delivery`&&W.info(r,{action:{label:`Review tasks`,onClick:()=>Dk(`#/tasks`)}}))}function YU(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;JU(e,`prompts`,(a??[]).map(e=>KU(i,e)),`A question is waiting for you.`,!!a&&!t.loading),JU(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>AU(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),JU(e,`delivery`,r.data?.rows.filter(e=>e.delivery&&(e.delivery.status===`pending_approval`||e.delivery.status===`deferred`||e.delivery.status===`recoverable_failure`)).map(e=>jU(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function XU(e){let{lastConnection:t,connection:n,quiet:r,previousState:i,lobby:a,enabled:o}=e;if(t.current!==n||n!==`live`){t.current=n,r.current=new Set([`prompts`,`sessions`,`delivery`]),i.current=void 0;return}YU(e);let s=a?.task?.state??``,c=HU(s),l=!!i.current&&s!==i.current;l&&s===`completed`?Np(`done`):l&&(s===`abandoned`||s===`blocked`)&&Np(`error`),l&&c&&o&&UU()&&WU(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function ZU(){let e=qU(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>XU(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function QU({className:e,type:t,...n}){return(0,H.jsx)(`input`,{type:t,"data-slot":`input`,className:Y(`flex h-8 w-full rounded-lg border border-input bg-background bg-clip-padding px-3 py-1 text-sm shadow-control transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/24 focus-visible:shadow-none disabled:cursor-not-allowed disabled:opacity-64 aria-invalid:border-destructive/36 aria-invalid:focus-visible:border-destructive/64 aria-invalid:focus-visible:ring-destructive/16 dark:bg-input/32`,e),...n})}function $U({className:e,small:t,...n}){return(0,H.jsx)(GO,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to toggle.`,"data-slot":`switch`,className:Y(`cs-sw`,t&&`cs-sm`,e),...n})}function eW({className:e,...t}){return(0,H.jsx)(`textarea`,{"data-slot":`textarea`,className:Y(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-background bg-clip-padding px-3 py-2 text-sm shadow-control transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/24 focus-visible:shadow-none disabled:cursor-not-allowed disabled:opacity-64 aria-invalid:border-destructive/36 aria-invalid:focus-visible:border-destructive/64 aria-invalid:focus-visible:ring-destructive/16 dark:bg-input/32`,e),...t})}function tW(e){return(0,H.jsx)(kO,{...e})}function nW(e){return(0,H.jsx)(jO,{"data-slot":`popover-trigger`,...e})}function rW({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,H.jsx)(MO,{children:(0,H.jsx)(NO,{"data-slot":`popover-content`,align:t,sideOffset:n,className:Y(`reui-menu z-[1100] w-72 origin-(--radix-popover-content-transform-origin) rounded-lg border p-1 outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-[0.98] data-closed:animate-out data-closed:fade-out-0 motion-reduce:animate-none`,e),...r})})}var iW=`reui-select inline-flex h-8 min-w-36 cursor-pointer items-center justify-between gap-2 rounded-lg border px-[calc(--spacing(3)-1px)] text-left text-sm text-foreground outline-none select-none transition-[color,box-shadow,background-color,border-color] duration-150 focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-ring/24 disabled:pointer-events-none disabled:opacity-64 [&_svg]:pointer-events-none [&_svg]:shrink-0`,aW=`-me-1 size-3 shrink-0 opacity-50`;function oW(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function sW(e,t,n,r){for(let r=t;r>=0&&r<e.length;r+=n)if(!e[r].disabled)return r;return r}function cW(e){return sW(e,0,1,0)}function lW({value:e,options:t,onChange:n,label:r,className:i,disabled:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(0),f=(0,m.useRef)(null),p=(0,m.useId)(),h=(0,m.useMemo)(()=>t.filter(e=>oW(e,c)),[t,c]),g=t.find(t=>t.value===e);(0,m.useEffect)(()=>{o&&(l(``),d(sW(t,Math.max(0,t.findIndex(t=>t.value===e)),1,cW(t))))},[o]);function _(e){l(e),d(cW(t.filter(t=>oW(t,e))))}(0,m.useEffect)(()=>{f.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({block:`nearest`})},[u,o,h.length]);function v(t){t&&!t.disabled&&(s(!1),t.value!==e&&n(t.value))}function y(e){e.key===`ArrowDown`?(e.preventDefault(),d(e=>sW(h,Math.min(h.length-1,e+1),-1,e))):e.key===`ArrowUp`?(e.preventDefault(),d(e=>sW(h,Math.max(0,e-1),1,e))):e.key===`Home`&&!c?(e.preventDefault(),d(cW(h))):e.key===`End`&&!c?(e.preventDefault(),d(sW(h,h.length-1,-1,0))):e.key===`Tab`?s(!1):e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),v(h[u]))}return(0,H.jsxs)(tW,{open:o,onOpenChange:s,children:[(0,H.jsxs)(nW,{type:`button`,role:`combobox`,"aria-label":r,"aria-keyshortcuts":`Enter Space ArrowDown ArrowUp`,"aria-description":`When focused, press Enter, Space or an arrow key to choose. Type to search.`,"aria-expanded":o,"aria-haspopup":`listbox`,"aria-controls":o?p:void 0,disabled:a,onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),s(!0))},"data-slot":`select-trigger`,className:Y(iW,`w-full min-w-0 overflow-hidden whitespace-nowrap`,i),children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),g?.tag?(0,H.jsx)(`span`,{className:`cs-rec`,children:g.tag}):null,(0,H.jsx)(jm,{"aria-hidden":`true`,strokeWidth:2.25,className:aW})]}),(0,H.jsxs)(rW,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`p-0 flex max-h-[min(20rem,var(--radix-popover-content-available-height))] w-[max(var(--radix-popover-trigger-width),17rem)] max-w-(--radix-popover-content-available-width) flex-col overflow-hidden rounded-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-[0.98] data-closed:animate-out data-closed:fade-out-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,H.jsx)(jg,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,H.jsx)(`input`,{value:c,onChange:e=>_(e.target.value),onKeyDown:y,role:`searchbox`,"aria-label":`Search ${r}`,"aria-controls":p,"aria-activedescendant":h[u]?`${p}-${u}`:void 0,placeholder:`Search…`,autoComplete:`off`,spellCheck:!1,className:`h-8 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,H.jsxs)(`div`,{ref:f,id:p,role:`listbox`,"aria-label":r,className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[h.length===0?(0,H.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,H.jsx)(`div`,{id:`${p}-${n}`,role:`option`,"aria-selected":t.value===e,"aria-disabled":t.disabled||void 0,"data-index":n,"data-disabled":t.disabled||void 0,onPointerMove:()=>{t.disabled||d(n)},onClick:()=>v(t),className:Y(`flex min-h-8 items-center gap-2 rounded-sm px-2 py-1 text-sm select-none sm:min-h-7`,t.disabled?`cursor-not-allowed opacity-60`:`cursor-pointer`,!t.disabled&&t.value===e&&`bg-foreground/[0.08]`,!t.disabled&&n===u&&`bg-accent text-accent-foreground`),children:(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,H.jsx)(`span`,{className:`line-clamp-2 text-pretty text-xs text-muted-foreground/80`,children:t.hint}):null]})},t.value))]})]})]})}var uW=Kv([`relative flex flex-col overflow-hidden bg-card text-card-foreground rounded-(--frame-radius)`,`[--frame-radius:var(--radius-xl)]`,`[--frame-gap:0px] [--frame-px:0px] [--frame-py:0px] [--frame-panel-header-gap:0rem] [--frame-panel-footer-gap:--spacing(1)]`,`[--frame-panel-px-adjust:0px] [--frame-panel-py-adjust:0px] [--frame-panel-header-px-adjust:0px] [--frame-panel-header-py-adjust:0px] [--frame-panel-footer-px-adjust:0px] [--frame-panel-footer-py-adjust:0px]`,`[--frame-panel-px:calc(var(--frame-panel-px-base)+var(--frame-panel-px-adjust))] [--frame-panel-py:calc(var(--frame-panel-py-base)+var(--frame-panel-py-adjust))] [--frame-panel-header-px:calc(var(--frame-panel-header-px-base)+var(--frame-panel-header-px-adjust))] [--frame-panel-header-py:calc(var(--frame-panel-header-py-base)+var(--frame-panel-header-py-adjust))] [--frame-panel-footer-px:calc(var(--frame-panel-footer-px-base)+var(--frame-panel-footer-px-adjust))] [--frame-panel-footer-py:calc(var(--frame-panel-footer-py-base)+var(--frame-panel-footer-py-adjust))]`,``,`[--frame-panel-bg:var(--workspace-card)] [--frame-panel-border-color:var(--workspace-border)] [--frame-border-color:var(--workspace-border)]`,`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px)-1px)]`],{variants:{variant:{default:`border border-[var(--frame-border-color)] bg-clip-padding`,inverse:`[--frame-panel-bg:color-mix(in_oklch,var(--color-muted)_40%,transparent)] border border-[var(--frame-border-color)] bg-background bg-clip-padding`,ghost:`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px))]`},spacing:{xs:`[--frame-panel-px-base:--spacing(2)] [--frame-panel-py-base:--spacing(2)] [--frame-panel-header-px-base:--spacing(2)] [--frame-panel-header-py-base:--spacing(0.5)] [--frame-panel-footer-px-base:--spacing(2)] [--frame-panel-footer-py-base:--spacing(0.5)]`,sm:`[--frame-panel-px-base:--spacing(3)] [--frame-panel-py-base:--spacing(3.5)] [--frame-panel-header-px-base:--spacing(3)] [--frame-panel-header-py-base:--spacing(1.5)] [--frame-panel-footer-px-base:--spacing(3)] [--frame-panel-footer-py-base:--spacing(1.5)]`,default:`[--frame-panel-px-base:--spacing(4)] [--frame-panel-py-base:--spacing(4)] [--frame-panel-header-px-base:--spacing(4)] [--frame-panel-header-py-base:--spacing(2)] [--frame-panel-footer-px-base:--spacing(4)] [--frame-panel-footer-py-base:--spacing(2)]`,lg:`[--frame-panel-px-base:--spacing(5)] [--frame-panel-py-base:--spacing(5)] [--frame-panel-header-px-base:--spacing(5)] [--frame-panel-header-py-base:--spacing(2.5)] [--frame-panel-footer-px-base:--spacing(5)] [--frame-panel-footer-py-base:--spacing(2.5)]`},stacked:{true:``,false:``},dense:{true:`p-0 gap-0 border-[var(--frame-border-color)] [--frame-panel-radius:var(--frame-radius)] [&_[data-slot=frame-panel]]:-mx-px [&_[data-slot=frame-panel]]:before:hidden [&_[data-slot=frame-panel]:last-child]:-mb-px [&:not(:has([data-slot=frame-panel-header]))_[data-slot=frame-panel]:is(:first-child)]:-mt-px`,false:``}},defaultVariants:{variant:`default`,spacing:`default`,stacked:!1,dense:!1}});function dW({className:e,variant:t,spacing:n,stacked:r,dense:i,...a}){return(0,H.jsx)(`div`,{className:Y(uW({variant:t,spacing:n,stacked:r,dense:i}),e),"data-slot":`frame`,"data-spacing":n,...a})}function fW({className:e,fit:t,...n}){return(0,H.jsx)(`div`,{className:Y(`relative min-w-0 [[data-slot=frame-panel-header]+&]:border-t [[data-slot=frame-panel]+&]:border-t border-(--frame-panel-border-color)`,!t&&`grow`,`px-(--frame-panel-px) py-(--frame-panel-py)`,e),"data-slot":`frame-panel`,...n})}function pW({className:e,...t}){return(0,H.jsx)(`header`,{className:Y(`flex flex-col gap-(--frame-panel-header-gap) px-(--frame-panel-header-px) py-(--frame-panel-header-py)`,e),"data-slot":`frame-panel-header`,...t})}function mW({label:e,help:t,children:n,stacked:r}){return(0,H.jsxs)(`div`,{className:r?`grid gap-1`:`grid grid-cols-[minmax(0,1fr)_minmax(0,332px)] items-center gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 break-words`,children:[(0,H.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,H.jsx)(`div`,{className:`min-w-0`,children:n})]})}function hW({children:e}){return(0,H.jsx)(dW,{dense:!0,children:(0,H.jsx)(fW,{className:`flex flex-col divide-y divide-border py-0 [&>*]:py-2`,children:e})})}function gW({value:e,items:t,label:n,disabled:r,onChange:i}){let a=t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{},...e.disabled?{disabled:e.disabled}:{},...e.tag?{tag:e.tag}:{}}));return(0,H.jsx)(lW,{value:e,options:a,label:n,disabled:r,onChange:i})}function _W(e,t,n){let r=-1;for(let i=0;i<e.length;i+=1)t.includes(e[i])&&(r<0||Math.abs(i-n)<Math.abs(r-n))&&(r=i);return r}var vW={off:`Off`,minimal:`Minimal`,low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra high`,max:`Max`},yW={off:`No extra reasoning: the quickest, cheapest answer.`,minimal:`A moment of reasoning, barely.`,low:`Light reasoning for simple work.`,medium:`Balanced reasoning for most work.`,high:`Careful reasoning: slower, better on hard problems.`,xhigh:`Very deep reasoning: slow and costly.`,max:`As deep as the model goes.`};function bW(e,t,n){let r=_W(e,t,Math.max(0,e.indexOf(n)));return e[Math.max(r,0)]??n}function xW({value:e,levels:t,supported:n,recommended:r,model:i,label:a,disabled:o,onChange:s}){let c=i??`this model`,l=bW(t,n,e),u=t.map(e=>{let t=n.includes(e),i=t?yW[e]:`Not supported by ${c}.`;return{value:e,label:vW[e]??e,help:t&&e===r?`${i} Recommended.`:i,disabled:!t,...t&&e===r?{tag:`Recommended`}:{}}});return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(gW,{value:l,items:u,label:a,disabled:o,onChange:e=>void s(e)}),e===l?null:(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e,` is not supported by `,c,`, so it runs at `,l,`.`]})]})}function SW({title:e,right:t,prominent:n,children:r}){return(0,H.jsxs)(`section`,{className:Y(`cs-sec flex min-w-0 flex-col`,n&&`cs-prom`),children:[(0,H.jsxs)(`h3`,{className:`cs-rl`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),t?(0,H.jsx)(`span`,{className:`cs-rr`,children:t}):null]}),(0,H.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:r})]})}var CW=`(prefers-color-scheme: dark)`,wW=[`dark`,`light`,`system`],TW=m.createContext(void 0);function EW(e){return e!==null&&wW.includes(e)}function DW(){return window.matchMedia(CW).matches?`dark`:`light`}function OW(){let e=document.createElement(`style`);return e.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;transition:none!important}`)),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.remove()})})}}function kW(e){let t=e;for(;t instanceof HTMLElement&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLElement&&!!(t.isContentEditable||t.closest(`input, textarea, select, [contenteditable='true']`))}function AW({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return EW(e)?e:t}),s=m.useCallback(e=>{localStorage.setItem(n,e),o(e)},[n]),c=m.useCallback(e=>{let t=document.documentElement,n=e===`system`?DW():e,i=r?OW():null;t.classList.remove(`light`,`dark`),t.classList.add(n),i&&i()},[r]);m.useEffect(()=>{if(c(a),a!==`system`)return;let e=window.matchMedia(CW),t=()=>{c(`system`)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[a,c]),m.useEffect(()=>{let e=e=>{e.repeat||e.metaKey||e.ctrlKey||e.altKey||kW(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:DW()===`dark`?`light`:`dark`;return localStorage.setItem(n,t),t})};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n]),m.useEffect(()=>{let e=e=>{if(e.storageArea===localStorage&&e.key===n){if(EW(e.newValue)){o(e.newValue);return}o(t)}};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[t,n]);let l=m.useMemo(()=>({theme:a,setTheme:s}),[a,s]);return(0,H.jsx)(TW.Provider,{...i,value:l,children:e})}var jW=()=>{let e=m.useContext(TW);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function MW({kind:e,dense:t=!1}){let n=e===`font`?Ve:He,r=Ze(e),i=(0,m.useRef)(null);function a(t){let a=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!a)return;t.preventDefault(),t.stopPropagation();let o=Math.max(0,n.findIndex(e=>e.id===r)),s=n[(o+a+n.length)%n.length];Ye(e,s.id),requestAnimationFrame(()=>i.current?.querySelector(`[data-face="${s.id}"]`)?.focus())}return(0,H.jsx)(`div`,{ref:i,role:`radiogroup`,"aria-label":e===`font`?`Typeface`:`Code typeface`,onKeyDown:a,className:t?`grid grid-cols-2 gap-0.5`:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4`,children:n.map(n=>{let i=n.id===r,a=Qe[n.id];return(0,H.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i,"data-face":n.id,tabIndex:i?0:-1,onClick:()=>Ye(e,n.id),className:Y(`outline-none transition-[background-color,border-color,box-shadow] duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t?`flex min-h-8 items-center gap-2 rounded-lg px-2 text-left text-sm hover:bg-accent`:Y(`grid gap-1 rounded-xl border p-2.5 text-left`,i?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-[var(--glass-edge)] hover:bg-accent/50`)),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:Y(`leading-none`,t?`w-7 text-base`:`text-2xl`),style:a?{fontFamily:a}:e===`mono`?{fontFamily:`var(--app-font-mono, ui-monospace, monospace)`}:void 0,children:e===`font`?`Aa`:`{ }`}),(0,H.jsxs)(`span`,{className:Y(`flex min-w-0 items-center justify-between gap-2`,t&&`flex-1`),children:[(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsx)(`span`,{className:`block truncate text-[0.8125rem] font-medium`,children:n.label}),t?null:(0,H.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:n.help})]}),i?(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function NW({disabled:e}){let t=Cp(),[n,r]=(0,m.useState)(String(t));(0,m.useEffect)(()=>r(String(t)),[t]);let i=()=>{let e=Number(n.trim());if(n.trim()===``||!Number.isFinite(e))return r(String(t));Sp(e),r(String(Math.min(100,Math.max(0,Math.round(e)))))};return(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(QU,{type:`number`,inputMode:`numeric`,min:0,max:100,step:5,value:n,disabled:e,"aria-label":`Sound volume`,className:`pr-10`,onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())}}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:`%`})]})}function PW(){let e=bp();return Dp(),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mW,{label:`Sounds`,help:`A short sound when something needs you. Kept in this browser; sound starts after your first click. Desktop notifications are separate.`,children:(0,H.jsx)($U,{checked:!e,onCheckedChange:e=>yp(!e),"aria-label":`Sounds`})}),(0,H.jsx)(mW,{label:`Volume`,help:`0 to 100. The play buttons below use it too.`,children:(0,H.jsx)(NW,{disabled:e})}),ap.map(t=>(0,H.jsx)(mW,{label:t.label,help:t.help,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,H.jsx)(iB,{iconOnly:!0,icon:hg,label:`Play ${t.label.toLowerCase()} sound`,onClick:()=>Np(t.kind,{preview:!0})}),(0,H.jsx)($U,{checked:Tp(t.kind),disabled:e,onCheckedChange:e=>Ep(t.kind,e),"aria-label":`${t.label} sound`})]})},t.kind))]})}var FW=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`planner`],IW={master:`Orchestrator`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,planner:`Planner`},LW=`inherit`,RW=`inherit`,zW=`Use the session's current model`,BW=`__custom__`,VW=`custom…`,HW=`Type a provider/model id`,UW={master:`high`,designer:`medium`,backend:`medium`,qa:`medium`,scout:`low`,researcher:`low`,planner:`high`},WW=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],GW={agents:`Agents`,grants:`Tools & skills`,workflow:`Workflow`,lint:`Linting`,lobby:`Lobby`,classifier:`Classifier`,harnesses:`Harnesses`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},KW=new Set([`scout`,`researcher`,`planner`]),qW={label:`Compact at`,help:`Empty: built-in 64K.`,placeholder:`64000`,min:4e3,max:2e6,bad:e=>`"${e}" is not a whole number of tokens from 4000 to 2000000.`},Q={intro:`Every agent picks up the MCP tools of the servers pi has connected and the skills pi finds, including ones you add later. Narrow an agent here when it should use fewer. Children an agent delegates to get the same grants. Every change saves at once.`,agents:`Agents`,cardLabel:`tools and skills`,tools:`MCP tools`,toolsHelp:`Granted tools are the only MCP tools this agent can call, directly or from codemode.`,everyTool:`Every MCP tool pi connects`,everyToolHelp:`New servers and tools are picked up on the next run. Off: only the tools ticked below.`,everyToolReadOnlyHelp:`Every read-only tool, picked up on the next run as servers connect. Off: only the tools ticked below.`,allTools:`all MCP tools`,noToolsWarning:`This agent gets no MCP tools at all.`,readOnlyHelp:`This agent only reads, so it can call only tools their server marks read-only.`,qaHelp:`QA's tests may use any granted tool; the QA gate, which only reads, calls only the read-only ones.`,blockedHelp:`This agent only reads; the server does not mark this tool read-only.`,filter:`Filter tools`,looking:`Asking pi…`,noServers:`pi has no MCP servers connected. Add one, then reopen Settings:`,unknownServer:`other`,readOnly:`read-only`,writes:`writes`,notConnected:`not connected`,notConnectedHelp:`Granted, but its server is not connected now. It works again once the server is back.`,addLabel:`Grant a tool by its exact name`,add:`Grant`,badName:`A tool name reads mcp__server__tool, such as mcp__github__get_issue.`,noTools:`no MCP tools`,skills:`Skills`,skillsHelp:`An agent sees each granted skill's name and description, and reads its instructions when the work calls for them.`,sessionSkills:`this session's`,masterSkills:`The orchestrator is this pi session, so it uses the skills pi loads for it (pi's own skill settings).`,everySkill:`Every skill pi finds`,everySkillHelp:`Off: only the skills ticked below.`,allSkills:`all skills`,noSkills:`no skills`,noSkillsFound:`pi finds no skills. Put one in ~/.pi/agent/skills/ or the project's .pi/skills/ or .agents/skills/.`,notFound:`not found`,skillMissingHelp:`Granted, but pi no longer finds this skill.`,noneWarning:`This agent gets no skills at all.`,edit:`Tools & skills`},JW=[{id:`startOn`,label:`On when pi starts`,help:`off: pi starts as plain pi, and ctrl+shift+m or /bot-lobby on turns bot-lobby on (a session that owns a task under way always starts on)`}],YW={label:`Retain lobby data in git`,help:`Track this lobby's data (.pi/bot-lobby: tasks, knowledge, scripts, reports) in git. Off keeps it local and gitignored.`,error:`Couldn't read this repository's .gitignore.`},XW=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity steps in the conversation`},{id:`thinking`,label:`Thinking bubble`}],ZW=`shown on the Lobby tab`,QW=`Planning rounds`,$W=`how many rounds the panel gets before the orchestrator settles the rest alone`,eG=[2,3,5,8,0],tG=`Port`,nG=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,rG=`Open browser`,iG=`open this page in the browser when pi starts`,aG=[{id:`off`,label:`off`,help:`tasks work in the folder you started them in`},{id:`branch`,label:`branch`,help:`each new task gets a git branch named after it, checked out in the working folder`},{id:`worktree`,label:`worktree`,help:`each new task gets its own worktree and branch, named after it: every agent runs there, apart from your checkout`}],oG=`Git isolation`,sG=[{id:`off`,label:`off`,help:`agents' work is never linted`},{id:`advise`,label:`advise`,help:`the orchestrator and QA are told what the project's linter finds on the lines a task changed; nothing is held`},{id:`block`,label:`block`,help:`new lint errors also hold a task's completion until they are fixed, or you accept the work as it is`}],cG={intro:`After every worker step, before QA and at completion, bot-lobby lints only the files the task's agents touched. Problems on the lines the task changed are the task's; anything already there is shown but never holds it. Suppressions and lint-config changes the task adds go to QA to judge.`,mode:`Lint gate`,command:`Command`,commandHelp:`empty runs the linters the project configures (ESLint, Biome, Oxlint, Ruff), each from its own folder; a command runs without a shell from the repository's top, with {files} standing for the touched files`,commandPlaceholder:`found from the project`,extensions:`File types`,extensionsHelp:`which touched files the command is given, such as .ts .tsx .py`,extensionsPlaceholder:`every touched file`,timeout:`Time limit`,timeoutHelp:`for one linter run; one that runs over reads as could not run, and holds nothing`,found:`Found in this project`,foundHelp:`config files in the project and the folders a few levels below it`,foundNone:`No linter config found. Add one to the project, or set a command above.`,foundReplaced:`The command replaces these.`,installed:`installed`,missing:`not installed`,missingHelp:`install the project's dependencies there, or lint cannot run`,top:`project root`},lG={title:`Linter setup`,help:`Install the project's linters and switch their common rules. What they find reaches QA and completion through the lint gate.`,stepLinters:`Linters`,stepRules:`Rules`,recheck:`Check again`,noneFound:`No linter config found in the project or the folders a few levels below it.`,install:`Install it here`,add:`Add a linter`,addAnother:`Add another linter`,addHelp:`Run runs the command in a new terminal under the composer, where you can answer its questions.`,run:`Run`,copy:`Copy`,create:`Create`,created:e=>`${e} created.`,failed:`That did not save.`,noRules:`Add or install a linter first; its rules show here.`,which:`Linter`,openConfig:e=>`Open ${e.split(`/`).pop()}`,writesTo:e=>`Switches write to ${e}. Default leaves the rule as the config or the linter has it.`,rulesOf:e=>`${e} rules`},uG=[{id:`auto`,label:`Auto (OpenCode's free Jev, else TypeSafe)`},{id:`opencode`,label:`OpenCode Zen`},{id:`typesafe`,label:`TypeSafe`},{id:`openrouter`,label:`OpenRouter`},{id:`vercel`,label:`Vercel AI Gateway`}],dG=[{id:`seats`,label:`Planning seats`,help:`each round, only the seats your idea or latest answers touch sit; 1-4 in the Plan tab pins one`},{id:`answers`,label:`Obvious answers`,help:`a panel question whose recommended option the conversation already makes clearly right is answered for you (listed under Assumptions)`},{id:`lobby`,label:`Lobby replies`,help:`each lobby message goes to the agent whose area it is: a frontend question to Design, a library question to Research, "how does this work" to a scout; when it is unsure, or off, the Orchestrator answers. Naming an agent with @ always decides`},{id:`triage`,label:`Task triage`,help:`a new task's size, domains and research need reach the Orchestrator as hints`},{id:`effort`,label:`Effort routing`,help:`a simple step runs one thinking level lower, a trivial one on the cheaper model below; a routed run that falls short runs again on your settings`},{id:`qa`,label:`QA risk`,help:`once a task's work is in, the classifier reads the diff and sizes QA to it: no QA agent for a change with nothing that runs, a light check for a small one, deep review where a defect would spread; with it off the engine's rules decide`},{id:`review`,label:`Pull request read`,help:`the Git tab's quick read of a pull request: its size, and how likely it is risky, security-relevant, breaking or untested, before an agent reviews it`},{id:`knowledge`,label:`Relevant knowledge`,help:`when an agent's knowledge, standards or decisions file is too long for its prompt, the classifier picks the sections that bear on the step, and the agent is told where the rest is`},{id:`scripts`,label:`Shared scripts`,help:`the classifier matches each step to the shared scripts that do part of it, and the agent is told to run them instead of redoing the work`},{id:`files`,label:`File hints`,help:`scouts, workers, chat agents and the planning panel start with the files most likely needed, and can look more up with find_relevant_files`}],fG={enabled:`Classifier`,enabledHelp:`a fast model makes the obvious decisions so large models spend fewer tokens on them`,engine:`Answered by`,engineHelp:`pick a provider, then its model: Jev, another classifier model, or any chat model your pi logins offer (OpenAI, Anthropic, Google, …); a small, fast one works best`,provider:`Classifier provider`,engineModel:`Classifier model`,engineJev:`Jev (built in)`,engineJevHelp:`TypeSafe's classifier, on the host below`,engineClassifier:`classifier model`,engineChat:`chat model, answers as JSON`,host:`Host`,model:`Model`,modelHelp:`empty uses the host's default`,key:`API key`,keyNote:`the key pi already holds for this host; it is never read by this page`,cheap:`Cheaper model`,cheapNone:`none: trivial steps keep their model and drop a thinking level`,cheapHelp:`what effort routing runs trivial steps on`},pG={title:`Settings`,intro:`Each agent's model and effort, the workflow and its lint gate, the lobby and the classifier. Changes save as you make them.`,loading:`Loading settings…`,loadFailed:`Could not load settings.`,saved:`Settings saved`,saving:`Saving…`,appearanceHelp:`Light, dark, or follow your system. Kept in this browser only.`,themeLabel:`Mode`,themeItems:[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}],notificationsLabel:`Browser notifications`,notificationsHelp:`While this page is hidden, tell me when a question waits, a task finishes or a background session asks something.`,notificationsBlocked:`Notifications are blocked in your browser. Allow them for this site and try again.`,notificationsUnsupported:`This browser does not offer notifications.`,notificationsOn:`Browser notifications are on.`,notificationsOff:`Browser notifications are off.`,installLabel:`Install bot-lobby`,installHelp:`Opens in its own fullscreen window, with the shell cached so it starts when Pi is not running.`,installButton:`Install as fullscreen app`,installUnavailable:`Your browser has not offered to install it. Use its menu: “Install app” (Chrome, Edge) or Share, then “Add to Home Screen” (Safari).`,installDone:`bot-lobby is installed.`,installedNow:`Running as an installed app.`,fullscreenLabel:`Fullscreen`,fullscreenHelp:`Hide the browser's own bars for this tab (F11 does the same).`,fullscreenOn:`Exit fullscreen`,fullscreenOff:`Go fullscreen`},mG=new Set([`designer`,`backend`,`qa`,`scout`,`researcher`]),$={label:`Harness`,piLabel:`pi`,piHelp:`Bot Lobby's own agent, with your pi logins`,missing:`not found`,model:`Model`,defaultModel:`Harness default`,defaultModelHelp:`Whatever the harness is set to use`,older:`older`,effortNote:`Applied when the agent offers effort levels in its session.`,agentNote:`Runs in this harness with Bot Lobby's prompts. It cannot ask you questions or use Bot Lobby's own tools (desk, board).`,intro:`Run any agent but the orchestrator and the planner on another coding agent. The orchestrator stays on pi and hands each step over: the harness gets the agent's role prompt, and its own login and models. Pick the harness per agent under Agents.`,installed:`Installed`,notFound:`Not found`,usedBy:`Used by`,unused:`No agent uses it yet`,binary:`Command`,binaryHelp:`The executable to start; empty uses the usual command on PATH.`,args:`Launch arguments`,argsHelp:`Added to every run, quoted as in a shell.`,argsAcpHelp:`The arguments that start the agent in ACP mode.`,home:`Home folder`,homeHelp:e=>`Sets ${e} for its config and login; empty keeps its own.`,provider:`Model provider`,providerHelp:`Who serves the models.`,compact:`Compact after`,compactHelp:`Tokens before it compacts an agent's context (10,000 to 2,000,000); empty keeps the harness's own. An agent with Auto-compact off never compacts.`,inject:`Inject Bot Lobby's prompts`,injectHelp:`Give it the agent's role prompt, knowledge and standards. Off sends the task and the report format only.`,custom:`Extra models`,customHelp:`Model ids it should also offer, separated by spaces.`,harnessPath:`Harness path`,harnessPathHelp:`Antigravity's localharness_external, when its ACP server does not find it itself.`},hG=`https://tweakcn.com/editor/theme`;function gG(){let{theme:e}=jW();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function _G({palette:e,dark:t}){let n=ae(e,t);return(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-1.5 rounded-lg border border-border px-2`,style:{background:n.background},children:[(0,H.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,H.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,H.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function vG(){let e=Be(),t=gG(),n=(0,m.useRef)(null);function r(t){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!r)return;t.preventDefault(),t.stopPropagation();let i=Math.max(0,e.all.findIndex(t=>t.id===e.active.id)),a=e.all[(i+r+e.all.length)%e.all.length];e.choose(a.id),window.requestAnimationFrame(()=>n.current?.querySelector(`[data-theme-id="${a.id}"]`)?.focus())}return(0,H.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-3 gap-2 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,H.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"aria-checked":r,"data-theme-id":n.id,tabIndex:r?0:-1,onClick:()=>e.choose(n.id),className:Y(`grid gap-1.5 rounded-lg border p-2 text-left outline-none transition-[border-color,box-shadow,background-color] duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,r?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-border hover:bg-accent/50`),children:[(0,H.jsx)(_G,{palette:n,dark:t}),(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,H.jsxs)(`span`,{className:`truncate`,children:[n.name,e.isSaved(n.id)?(0,H.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`saved`}):null]}),r?(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function yG({entry:e}){let t=Be(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(e.name),[o,s]=(0,m.useState)();async function c(){let n=i.trim();if(!n||n===e.name)return r(!1);try{await t.rename(e.id,n),r(!1),s(void 0),W.success(`Renamed to ${n}.`)}catch(e){s(e.message)}}return(0,H.jsxs)(`li`,{className:`flex min-h-10 flex-wrap items-center gap-2 py-1.5`,children:[n?(0,H.jsxs)(`form`,{className:`flex min-w-0 flex-1 items-center gap-1`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,H.jsx)(QU,{autoFocus:!0,value:i,maxLength:40,"aria-label":`New name for ${e.name}`,"aria-invalid":o?!0:void 0,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),a(e.name),r(!1))},className:`h-8 max-w-64`}),(0,H.jsx)(iB,{label:`Save the name`,text:`Save`,icon:km,tone:`primary`,type:`submit`,disabled:!i.trim()}),(0,H.jsx)(iB,{label:`Keep the old name`,icon:l_,iconOnly:!0,onClick:()=>{a(e.name),r(!1)}})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.name}),(0,H.jsx)(iB,{label:`Rename ${e.name}`,text:`Rename`,icon:lg,onClick:()=>{a(e.name),r(!0)}}),(0,H.jsx)(TV,{label:`Remove ${e.name}`,text:`Remove`,title:`Remove ${e.name}?`,description:`It is removed for every pi session. Keep a copy of its CSS if you want to use it again.`,confirmLabel:`Remove theme`,icon:qg,variant:`destructive`,onConfirm:()=>void t.remove(e.id).catch(e=>W.error(e.message))})]}),o?(0,H.jsx)(`p`,{role:`alert`,className:`w-full text-xs text-destructive`,children:o}):null]})}function bG(){let e=Be();return e.saved.length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No saved themes yet. Import one below and give it a name.`}):(0,H.jsx)(`ul`,{"aria-label":`Saved themes`,className:`divide-y divide-border`,children:e.saved.map(e=>(0,H.jsx)(yG,{entry:e},e.id))})}function xG(){let e=Be(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(),[s,c]=(0,m.useState)(!1),l=(0,m.useRef)(null);async function u(t,a){let s=j(t);if(`error`in s){o(s.error);return}o(void 0),c(!0);try{let t=await e.adopt(s,r.trim()||s.name||a);n(``),i(``);let o=s.light?s.dark?void 0:`dark`:`light`;W.success(o?`${t.name} saved and applied. It has no ${o} colours, so ${o} mode keeps the default ones.`:`${t.name} saved and applied.`)}catch(e){o(e.message)}finally{c(!1)}}async function d(e){if(e){if(e.size>2e5){o(`That file is too large to be a theme.`);return}await u(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,H.jsxs)(`div`,{className:`grid gap-2`,children:[(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,H.jsxs)(`a`,{href:hG,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,H.jsx)(sh,{"aria-hidden":`true`,className:`size-3`})]}),`, press Code, copy it, and paste it here, or save it as a file and upload that. Colours and fonts are used; corners stay the page's own.`]}),(0,H.jsxs)(`label`,{className:`grid gap-1 text-xs text-muted-foreground`,children:[`Name`,(0,H.jsx)(QU,{value:r,maxLength:40,placeholder:`the theme's own name, or the file's`,onChange:e=>i(e.target.value),className:`h-8 max-w-80 text-foreground`})]}),(0,H.jsx)(eW,{value:t,onChange:e=>{n(e.target.value),o(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":a?!0:void 0,placeholder:`:root {
99
- --background: oklch(0.98 0 0);
100
- --primary: oklch(0.55 0.2 260);
101
- …
102
- }
103
- .dark { … }`,className:`max-h-56 font-mono text-xs`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`input`,{ref:l,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{d(e.target.files?.[0]),e.target.value=``}}),(0,H.jsx)(iB,{label:`Save and apply the pasted theme`,text:`Save theme`,icon:km,tone:`primary`,disabled:!t.trim()||s,onClick:()=>void u(t,`Custom theme`)}),(0,H.jsx)(iB,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:$g,disabled:s,onClick:()=>l.current?.click()}),a?(0,H.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive`,children:a}):null]})]})}function SG(){let{theme:e,setTheme:t}=jW();return(0,H.jsxs)(SW,{prominent:!0,title:GW.appearance,children:[(0,H.jsxs)(hW,{children:[(0,H.jsx)(mW,{label:pG.themeLabel,help:pG.appearanceHelp,children:(0,H.jsx)(gW,{value:e,items:pG.themeItems.map(e=>({value:e.id,label:e.label})),label:pG.themeLabel,onChange:e=>t(e)})}),(0,H.jsx)(mW,{label:`Colour theme`,help:`The page's colours, the same in every pi session.`,stacked:!0,children:(0,H.jsx)(vG,{})}),(0,H.jsx)(mW,{label:`Typeface`,help:`The face for the page's text, kept in this browser.`,stacked:!0,children:(0,H.jsx)(MW,{kind:`font`})}),(0,H.jsx)(mW,{label:`Code typeface`,help:`The face for code, paths and commands.`,stacked:!0,children:(0,H.jsx)(MW,{kind:`mono`})}),(0,H.jsx)(mW,{label:`Saved themes`,help:`Themes you imported, kept with pi for every session and project.`,stacked:!0,children:(0,H.jsx)(bG,{})}),(0,H.jsx)(mW,{label:`Import a theme`,stacked:!0,children:(0,H.jsx)(xG,{})})]}),(0,H.jsx)(hW,{children:(0,H.jsx)(PW,{})})]})}function CG({className:e,...t}){return(0,H.jsx)(hC,{"aria-keyshortcuts":`Space`,"aria-description":`When focused, press Space to toggle.`,"data-slot":`checkbox`,className:Y(`cs-cb`,e),...t,children:(0,H.jsx)(_C,{forceMount:!0,"data-slot":`checkbox-indicator`,className:`contents`,children:(0,H.jsx)(km,{"aria-hidden":`true`,strokeWidth:3.4})})})}var wG=`flex min-h-10 w-full flex-col gap-1 rounded-lg border border-transparent px-3 py-2.5 text-left outline-none transition-colors duration-150 hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=true]:bg-accent`,TG={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],planner:[`planner`]};function EG(e,t){let n=TG[t].reduce((e,t)=>e[t],e);return{...n.mcpTools?{mcpTools:n.mcpTools}:{},...n.skills?{skills:n.skills}:{}}}function DG(e,t){return TG[e].reduceRight((e,t)=>({[t]:e}),t)}function OG(e,t){let n=e.mcpTools?e.mcpTools.length===0?Q.noTools:`${e.mcpTools.length} MCP tool${e.mcpTools.length===1?``:`s`}`:Q.allTools;return t===`master`?n:`${n} · ${e.skills?e.skills.length===0?Q.noSkills:`${e.skills.length} skill${e.skills.length===1?``:`s`}`:Q.allSkills}`}var kG=/^mcp__[A-Za-z0-9_]+__[A-Za-z0-9_]+$/;function AG(e,t){let n=`mcp__${t}__`;return e.startsWith(n)?e.slice(n.length):e}function jG(e){return/^mcp__([A-Za-z0-9_]+?)__/.exec(e)?.[1]??``}function MG({config:e,save:t,agent:n,onAgent:r}){let i=MV(`settings.grants`,{},[]),a=i.data;return(0,H.jsxs)(SW,{prominent:!0,title:GW.grants,children:[(0,H.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:Q.intro}),(0,H.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,13rem)_minmax(0,1fr)] items-start gap-4`,children:[(0,H.jsx)(`nav`,{"aria-label":Q.agents,className:`flex flex-col gap-0.5`,children:FW.map(t=>(0,H.jsxs)(`button`,{type:`button`,"aria-current":t===n,onClick:()=>r(t),className:Y(wG,`min-h-0 gap-0.5 py-2`),children:[(0,H.jsx)(`span`,{className:`flex items-center gap-2 text-[0.8125rem] font-medium`,children:IW[t]}),(0,H.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:OG(EG(e,t),t)})]},t))}),(0,H.jsxs)(dW,{dense:!0,"aria-label":`${IW[n]} ${Q.cardLabel}`,children:[(0,H.jsx)(FG,{kind:n,grants:EG(e,n),offered:a?.mcpTools,error:i.error,save:t},`tools-${n}`),(0,H.jsx)(IG,{kind:n,grants:EG(e,n),offered:a?.skills,error:i.error,save:t},`skills-${n}`)]})]})]})}function NG({title:e,note:t}){return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,H.jsx)(`h4`,{className:`text-sm font-semibold`,children:e}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})}function PG({id:e,name:t,help:n,tag:r,tagTone:i,checked:a,disabled:o,title:s,onChange:c}){return(0,H.jsxs)(`label`,{htmlFor:e,title:s,className:Y(`flex min-w-0 cursor-pointer items-start gap-3 rounded-lg px-2 py-1.5 transition-colors hover:bg-accent/60`,o&&`cursor-not-allowed opacity-60 hover:bg-transparent`),children:[(0,H.jsx)(CG,{id:e,checked:a,disabled:o,onCheckedChange:e=>c(e===!0),className:`mt-0.5`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`break-all font-mono text-[0.8125rem]`,children:t}),n?(0,H.jsx)(`span`,{className:`break-words text-xs text-muted-foreground`,children:n}):null]}),r?(0,H.jsx)(`span`,{className:Y(`shrink-0 rounded-md px-1.5 py-0.5 text-[0.6875rem] font-medium`,i===`warning`?`bg-warning/12 text-warning`:`bg-accent text-muted-foreground`),children:r}):null]})}function FG({kind:e,grants:t,offered:n,error:r,save:i}){let[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(``),l=!t.mcpTools,u=t.mcpTools??[],d=new Set(u),f=KW.has(e),p=t=>i(DG(e,{mcpTools:t?[...new Set(t)]:null})),h=(e,t)=>void p(t?[...u,...e]:u.filter(t=>!e.includes(t))),g=new Set((n??[]).map(e=>e.name)),_=u.filter(e=>!g.has(e)).map(e=>({name:e,server:jG(e),description:``,readOnly:!1})),v=a.trim().toLowerCase(),y=[...n??[],..._].filter(e=>!v||e.name.toLowerCase().includes(v)||e.description.toLowerCase().includes(v)),b=[...new Set(y.map(e=>e.server))],x=e=>!f||e.readOnly||!g.has(e.name),S=e=>void p(e?null:(n??[]).filter(x).map(e=>e.name)),C=()=>{let e=s.trim();if(!kG.test(e)){W.error(Q.badName);return}c(``),d.has(e)||p([...u,e])};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(pW,{className:`gap-1 border-b border-(--frame-panel-border-color) py-2.5`,children:[(0,H.jsx)(NG,{title:Q.tools,note:l?Q.allTools:`${u.length} granted`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f?Q.readOnlyHelp:e===`qa`?Q.qaHelp:Q.toolsHelp})]}),(0,H.jsxs)(fW,{fit:!0,className:`flex flex-col gap-3 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-4 px-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:Q.everyTool}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f?Q.everyToolReadOnlyHelp:Q.everyToolHelp})]}),(0,H.jsx)($U,{checked:l,onCheckedChange:S,"aria-label":`${IW[e]} ${Q.everyTool.toLowerCase()}`})]}),(n?.length??0)>8?(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(jg,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(QU,{value:a,placeholder:Q.filter,"aria-label":Q.filter,className:`pl-8`,onChange:e=>o(e.target.value)})]}):null,!n&&!r?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Q.looking}):null,r&&!n?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,n&&n.length===0&&_.length===0?(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[Q.noServers,` `,(0,H.jsx)(`code`,{className:`rounded bg-accent px-1 py-0.5 font-mono text-xs`,children:`pi mcp add <name> -- <command>`})]}):null,b.map(t=>{let n=y.filter(e=>e.server===t),r=n.filter(x).map(e=>e.name),i=l?r.length:r.filter(e=>d.has(e)).length;return(0,H.jsxs)(`div`,{role:`group`,"aria-label":`${t} tools`,className:Y(`flex flex-col gap-0.5`,l&&`opacity-60`),children:[(0,H.jsxs)(`label`,{className:`flex items-center gap-3 px-2 py-1 text-xs font-medium text-muted-foreground`,children:[(0,H.jsx)(CG,{checked:i===0?!1:i===r.length||`indeterminate`,disabled:l||r.length===0,"aria-label":`Every ${t} tool`,onCheckedChange:e=>h(r,e===!0)}),(0,H.jsx)(`span`,{className:`font-mono`,children:t||Q.unknownServer}),(0,H.jsxs)(`span`,{children:[i,` of `,n.length]})]}),n.map(t=>{let n=g.has(t.name),r=!x(t);return(0,H.jsx)(PG,{id:`grant-${e}-${t.name}`,name:AG(t.name,t.server),help:n?t.description||void 0:Q.notConnectedHelp,tag:n?t.readOnly?Q.readOnly:Q.writes:Q.notConnected,tagTone:n?`muted`:`warning`,checked:l?!r:d.has(t.name),disabled:l||r&&!d.has(t.name),...r?{title:Q.blockedHelp}:{},onChange:e=>h([t.name],e)},t.name)})]},t)}),!l&&u.length===0?(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 px-2 text-xs text-warning`,children:[(0,H.jsx)(zm,{"aria-hidden":`true`,className:`size-3.5`}),Q.noToolsWarning]}):null,(0,H.jsxs)(`div`,{hidden:l,className:`flex min-w-0 items-center gap-2 border-t border-(--frame-panel-border-color) pt-3`,children:[(0,H.jsx)(QU,{value:s,placeholder:`mcp__server__tool`,"aria-label":Q.addLabel,className:`min-w-0 flex-1 font-mono`,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),C())}}),(0,H.jsx)(iB,{label:Q.add,icon:_g,onClick:C})]})]})]})}function IG({kind:e,grants:t,offered:n,error:r,save:i}){if(e===`master`)return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(pW,{className:`gap-1 border-y border-(--frame-panel-border-color) py-2.5`,children:(0,H.jsx)(NG,{title:Q.skills,note:Q.sessionSkills})}),(0,H.jsx)(fW,{fit:!0,className:`py-3`,children:(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Q.masterSkills})})]});let a=!t.skills,o=new Set(t.skills??[]),s=t=>i(DG(e,{skills:t?[...new Set(t)]:null})),c=new Set((n??[]).map(e=>e.name)),l=(t.skills??[]).filter(e=>!c.has(e));return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(pW,{className:`gap-1 border-y border-(--frame-panel-border-color) py-2.5`,children:[(0,H.jsx)(NG,{title:Q.skills,note:a?Q.allSkills:`${o.size} granted`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Q.skillsHelp})]}),(0,H.jsxs)(fW,{fit:!0,className:`flex flex-col gap-3 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-4 px-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:Q.everySkill}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Q.everySkillHelp})]}),(0,H.jsx)($U,{checked:a,onCheckedChange:e=>void s(e?null:(n??[]).map(e=>e.name)),"aria-label":`${IW[e]} ${Q.everySkill.toLowerCase()}`})]}),!n&&!r?(0,H.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:Q.looking}):null,r&&!n?(0,H.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:r}):null,n&&n.length===0&&l.length===0?(0,H.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:Q.noSkillsFound}):null,(0,H.jsxs)(`div`,{role:`group`,"aria-label":`${IW[e]} skills`,className:Y(`flex flex-col gap-0.5`,a&&`opacity-60`),children:[(n??[]).map(t=>(0,H.jsx)(PG,{id:`skill-${e}-${t.name}`,name:t.name,help:t.description,checked:a||o.has(t.name),disabled:a,title:t.path,onChange:e=>void s(e?[...o,t.name]:[...o].filter(e=>e!==t.name))},t.name)),l.map(t=>(0,H.jsx)(PG,{id:`skill-${e}-${t}`,name:t,help:Q.skillMissingHelp,tag:Q.notFound,tagTone:`warning`,checked:!0,onChange:()=>void s([...o].filter(e=>e!==t))},t))]}),!a&&o.size===0?(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 px-2 text-xs text-warning`,children:[(0,H.jsx)(zm,{"aria-hidden":`true`,className:`size-3.5`}),Q.noneWarning]}):null]})]})}function LG(e){let t=[[`designer`,e.agents.designer],[`backend`,e.agents.backend],[`qa`,e.agents.qa],[`scout`,e.scout],[`researcher`,e.researcher]],n={};for(let[e,r]of t)r.harness&&mG.has(e)&&(n[r.harness]??=[]).push(e);return n}function RG({value:e,label:t,placeholder:n,onSave:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let t=i.trim();t!==e&&r(t)};return(0,H.jsx)(QU,{value:i,placeholder:n,"aria-label":t,spellCheck:!1,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function zG({value:e,label:t,onSave:n}){let r=e>0?String(e):``,[i,a]=(0,m.useState)(r);(0,m.useEffect)(()=>a(r),[r]);let o=()=>{let e=i.trim().replace(/[,_\s]/g,``);if(e===r)return;if(e===``)return n(0);let t=Number(e);if(!Number.isFinite(t)||t<1e4||t>2e6){W.error(`"${i}" is not between 10,000 and 2,000,000 tokens.`),a(r);return}n(Math.round(t))};return(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(QU,{type:`number`,inputMode:`numeric`,min:1e4,max:2e6,step:1e4,value:i,placeholder:`harness default`,"aria-label":t,className:`pr-14`,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:`tokens`})]})}function BG({status:e}){let t=!!e.path;return(0,H.jsxs)(`span`,{title:e.path??`${e.command||`No command`} is not on PATH`,className:Y(`inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium`,t?`bg-success/8 text-success dark:bg-success/16`:`bg-warning/8 text-warning dark:bg-warning/16`),children:[t?(0,H.jsx)(Vm,{"aria-hidden":`true`,className:`size-3.5`}):(0,H.jsx)(zm,{"aria-hidden":`true`,className:`size-3.5`}),t?`${$.installed}${e.version?` · ${e.version}`:``}`:$.notFound]})}function VG({status:e,config:t,users:n,save:r}){let i=e.id,a=t.harnesses[i],o=e=>void r({harnesses:{[i]:e}}),s=e.protocol===`acp`,c=i===`codex`?`CODEX_HOME`:i===`claude`?`CLAUDE_CONFIG_DIR`:void 0,l=e.providers.some(e=>e.value===a.modelProvider)||!a.modelProvider?e.providers:[...e.providers,{value:a.modelProvider,label:a.modelProvider}];return(0,H.jsxs)(`section`,{"data-slot":`harness-card`,"aria-label":e.label,className:`glass flex min-w-0 flex-col gap-3 rounded-xl border px-3.5 pt-3 pb-3.5`,children:[(0,H.jsxs)(`header`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`h3`,{className:`min-w-0 break-words text-sm font-semibold`,children:e.label}),(0,H.jsx)(BG,{status:e})]}),(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:e.blurb}),(0,H.jsxs)(`p`,{className:`break-words text-xs`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[$.usedBy,`: `]}),n.length>0?n.map(e=>IW[e]).join(`, `):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:$.unused.toLowerCase()})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col divide-y divide-border border-t border-border [&>*]:py-2.5 [&>*:last-child]:pb-0`,children:[(0,H.jsx)(mW,{stacked:!0,label:$.binary,help:$.binaryHelp,children:(0,H.jsx)(RG,{value:a.binaryPath,label:`${e.label} ${$.binary.toLowerCase()}`,placeholder:e.command||`/path/to/agent`,onSave:e=>o({binaryPath:e})})}),(0,H.jsx)(mW,{stacked:!0,label:$.args,help:i===`acp`?$.argsAcpHelp:$.argsHelp,children:(0,H.jsx)(RG,{value:a.launchArgs,label:`${e.label} ${$.args.toLowerCase()}`,placeholder:i===`acp`?`--acp`:`none`,onSave:e=>o({launchArgs:e})})}),c?(0,H.jsx)(mW,{stacked:!0,label:$.home,help:$.homeHelp(c),children:(0,H.jsx)(RG,{value:a.homePath,label:`${e.label} ${$.home.toLowerCase()}`,placeholder:i===`codex`?`~/.codex`:`~/.claude`,onSave:e=>o({homePath:e})})}):null,l.length>0?(0,H.jsx)(mW,{stacked:!0,label:$.provider,help:$.providerHelp,children:(0,H.jsx)(gW,{value:a.modelProvider,items:l.map(e=>({value:e.value,label:e.label})),label:`${e.label} ${$.provider.toLowerCase()}`,onChange:e=>o({modelProvider:e})})}):null,s?null:(0,H.jsx)(mW,{stacked:!0,label:$.compact,help:$.compactHelp,children:(0,H.jsx)(zG,{value:a.compactAt,label:`${e.label} ${$.compact.toLowerCase()}`,onSave:e=>o({compactAt:e})})}),i===`antigravity`?(0,H.jsx)(mW,{stacked:!0,label:$.harnessPath,help:$.harnessPathHelp,children:(0,H.jsx)(RG,{value:a.harnessPath,label:`${e.label} ${$.harnessPath.toLowerCase()}`,placeholder:`localharness_external`,onSave:e=>o({harnessPath:e})})}):null,(0,H.jsx)(mW,{stacked:!0,label:$.custom,help:$.customHelp,children:(0,H.jsx)(RG,{value:a.customModels.join(` `),label:`${e.label} ${$.custom.toLowerCase()}`,placeholder:i===`opencode`?`anthropic/claude-sonnet-5-5`:`model-id`,onSave:e=>o({customModels:e.split(/[\s,]+/).filter(Boolean)})})}),(0,H.jsxs)(`div`,{className:`flex min-h-0 items-center justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:$.inject}),(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:$.injectHelp})]}),(0,H.jsx)($U,{checked:a.injectPrompts,onCheckedChange:e=>o({injectPrompts:e}),"aria-label":`${e.label}: ${$.inject}`})]})]})]})}function HG({config:e,statuses:t,error:n,save:r}){let i=LG(e);return(0,H.jsxs)(SW,{prominent:!0,title:GW.harnesses,children:[(0,H.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:$.intro}),t?(0,H.jsx)(`div`,{className:`grid grid-cols-2 items-start gap-3 xl:grid-cols-3`,children:t.map(t=>(0,H.jsx)(VG,{status:t,config:e,users:i[t.id]??[],save:r},t.id))}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n??`Looking for installed harnesses…`})]})}var UG=`bot-lobby.terminal.open`,WG=`bot-lobby.terminal.height`,GG=`bot-lobby.terminal.popup`,KG={start:280,min:140},qG=new Set,JG,YG,XG;function ZG(e){try{return localStorage.getItem(e)}catch{return null}}function QG(e,t){try{localStorage.setItem(e,t)}catch{}}function $G(){for(let e of[...qG])e()}function eK(e){return qG.add(e),()=>{qG.delete(e)}}function tK(){return JG??=ZG(UG)===`1`,JG}function nK(){if(YG===void 0){let e=Number(ZG(WG));YG=e>=KG.min?e:KG.start}return YG}function rK(e){JG=e,QG(UG,e?`1`:`0`),$G()}function iK(){rK(!tK())}function aK(e){YG=Math.max(KG.min,Math.round(e)),QG(WG,String(YG)),$G()}function oK(){return(0,m.useSyncExternalStore)(eK,tK,()=>!1)}function sK(){return(0,m.useSyncExternalStore)(eK,nK,()=>KG.start)}function cK(){return XG??=ZG(GG)===`1`,XG}function lK(e){XG=e,QG(GG,e?`1`:`0`),$G()}function uK(){return(0,m.useSyncExternalStore)(eK,cK,()=>!1)}var dK;function fK(e){dK={id:e,at:(dK?.at??0)+1},rK(!0)}function pK(){return(0,m.useSyncExternalStore)(eK,()=>dK,()=>void 0)}async function mK(e){try{let t=await R(`terminal.list`,{});if(!t.available){await hK(e,t.reason??`No terminal is available here.`);return}let n=await R(`terminal.open`,{cols:100,rows:24});await R(`terminal.input`,{id:n.id,data:`${e}\r`}),fK(n.id)}catch(e){W.error(e instanceof Error?e.message:`The terminal did not start.`)}}async function hK(e,t){try{await navigator.clipboard.writeText(e),W.success(t?`${t} The command is copied.`:`Copied.`)}catch{W.error(t??`The command could not be copied.`)}}var gK=e=>e?`${e}/`:cG.top,_K=e=>`${e.tool}:${e.folder}`;function vK({label:e,command:t}){return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded-lg bg-accent px-2.5 py-1.5 font-mono text-xs`,title:t,children:t}),(0,H.jsx)(ZO,{size:`icon-sm`,variant:`ghost`,"aria-label":`${lG.copy}: ${t}`,...qz(lG.copy),onClick:()=>void hK(t),children:(0,H.jsx)(th,{})}),(0,H.jsxs)(ZO,{size:`sm`,variant:`outline`,"aria-label":`${lG.run}: ${t}`,onClick:()=>void mK(t),children:[(0,H.jsx)(hg,{}),lG.run]})]})]})}function yK({installed:e}){return(0,H.jsxs)(`span`,{title:e?void 0:cG.missingHelp,className:Y(`inline-flex shrink-0 items-center gap-1 text-xs`,e?`text-success`:`text-warning`),children:[e?(0,H.jsx)(Vm,{"aria-hidden":`true`,className:`size-3.5`}):(0,H.jsx)(zm,{"aria-hidden":`true`,className:`size-3.5`}),e?cG.installed:cG.missing]})}function bK({setup:e,replaced:t,onChange:n}){let r=async e=>{try{n(await R(`settings.lintCreate`,{name:e})),W.success(lG.created(e)),BB(e)}catch(e){W.error(e instanceof Error?e.message:lG.failed)}};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:cG.foundReplaced}):null,e.linters.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:lG.noneFound}):(0,H.jsx)(`ul`,{"aria-label":cG.found,className:`flex flex-col divide-y divide-border [&>li]:py-3 [&>li:first-child]:pt-0 [&>li:last-child]:pb-0`,children:e.linters.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.tool}),(0,H.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:gK(e.folder)}),(0,H.jsx)(`span`,{className:`flex-1`}),(0,H.jsx)(yK,{installed:e.installed})]}),e.install.map(e=>(0,H.jsx)(vK,{label:lG.install,command:e},e))]},_K(e)))}),e.offers.length>0?(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e.linters.length?lG.addAnother:lG.add}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:lG.addHelp})]}),(0,H.jsx)(`ul`,{className:`flex flex-col divide-y divide-border rounded-[10px] border border-border [&>li]:p-3`,children:e.offers.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:e.tool}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.blurb})]}),e.steps.map((e,t)=>e.command?(0,H.jsx)(vK,{label:`${t+1}. ${e.label}`,command:e.command},e.label):e.create?(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`${t+1}. ${e.label}`}),(0,H.jsxs)(ZO,{size:`sm`,variant:`outline`,onClick:()=>void r(e.create),children:[(0,H.jsx)(hh,{}),lG.create]})]},e.label):null)]},e.tool))})]}):null]})}var xK={default:`Default`,off:`Off`,warn:`Warn`,error:`Error`};function SK({setup:e,onChange:t}){let[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(),o=e.linters.find(e=>_K(e)===n)??e.linters[0];if(!o)return(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:lG.noRules});let s=o.rulesAt!==`read`,c=async(e,n)=>{a(e);try{t(await R(`settings.lintRule`,{tool:o.tool,folder:o.folder,rule:e,level:n}))}catch(e){W.error(e instanceof Error?e.message:lG.failed)}finally{a(void 0)}},l=[`default`,...o.levels];return(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[e.linters.length>1?(0,H.jsx)(Rk,{label:lG.which,value:_K(o),onChange:r,items:e.linters.map(e=>({id:_K(e),label:e.folder?`${e.tool} · ${e.folder}`:e.tool}))}):(0,H.jsxs)(`span`,{className:`text-sm font-medium`,children:[o.tool,` `,(0,H.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:gK(o.folder)})]}),(0,H.jsx)(`span`,{className:`flex-1`}),o.config?(0,H.jsxs)(ZO,{size:`sm`,variant:`ghost`,onClick:()=>BB(o.config),children:[(0,H.jsx)(lh,{}),lG.openConfig(o.config)]}):null]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o.note??(o.config?lG.writesTo(o.config):``)}),(0,H.jsx)(`ul`,{"aria-label":lG.rulesOf(o.tool),className:`flex flex-col divide-y divide-border [&>li]:py-2 [&>li:first-child]:pt-0 [&>li:last-child]:pb-0`,children:o.rules.map(e=>(0,H.jsxs)(`li`,{className:Y(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4`,i===e.id&&`opacity-60`),children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e.label}),(0,H.jsxs)(`p`,{className:`break-words text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`font-mono`,children:e.id}),` · `,e.help]})]}),s?(0,H.jsx)(Rk,{label:`${e.label} (${e.id})`,value:e.level,onChange:t=>void c(e.id,t),items:l.map(e=>({id:e,label:o.levels.length===2&&e===`error`?`On`:xK[e]}))}):(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:xK[e.level]})]},e.id))})]})}function CK({replaced:e}){let t=MV(`settings.lintSetup`,{},[`status`]),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(`linters`),o=n??t.data,s=()=>{r(void 0),t.reload()};return(0,H.jsx)(dW,{dense:!0,children:(0,H.jsxs)(fW,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:lG.title}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:lG.help})]}),(0,H.jsx)(Rk,{label:lG.title,value:i,onChange:a,items:[{id:`linters`,label:lG.stepLinters},{id:`rules`,label:lG.stepRules}]}),(0,H.jsx)(ZO,{size:`icon-sm`,variant:`ghost`,"aria-label":lG.recheck,...qz(lG.recheck),onClick:s,children:(0,H.jsx)(yg,{className:Y(t.loading&&`motion-safe:animate-spin`)})})]}),o?i===`linters`?(0,H.jsx)(bK,{setup:o,replaced:e,onChange:r}):(0,H.jsx)(SK,{setup:o,onChange:r}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.error??`Looking…`})]})})}var wK={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],planner:[`planner`]},TK=[...JW,...XW.map(e=>({id:`panel:${e.id}`,label:e.label,help:ZW}))];function EK(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,mcpTools:e.scout.mcpTools,...e.scout.skills?{skills:e.scout.skills}:{},...e.scout.autoCompact===!1?{autoCompact:!1}:{},...e.scout.compactAt?{compactAt:e.scout.compactAt}:{},...e.scout.harness?{harness:e.scout.harness}:{},...e.scout.harnessModel?{harnessModel:e.scout.harnessModel}:{}};case`researcher`:return e.researcher;case`planner`:return e.planner;default:return e.agents[t]}}function DK(e,t){return wK[e].reduceRight((e,t)=>({[t]:e}),t)}function OK(e,t){return e.find(e=>e.id===t)?.thinkingLevels??WW}function kK(e,t){return WW[_W(WW,e,Math.max(0,WW.indexOf(t)))]??t}var AK=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`;function jK(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(``),a=e.models.some(t=>t.id===e.value),o=[...e.inherit?[{value:LW,label:RW,help:zW}]:[],...e.none?[{value:LW,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:LW,label:RW,help:zW}]:[],...e.models.map(e=>({value:e.id,label:e.id,...e.label&&e.label!==e.id?{help:e.label}:{}})),...!a&&e.value!==`inherit`?[{value:e.value,label:e.value,help:HW}]:[],{value:BW,label:VW,help:HW}],s=t=>{if(t!==`__custom__`)return e.onChange(t);i(a?``:e.value),n(!0)},c=()=>{let t=r.trim();n(!1),t&&t!==e.value&&e.onChange(t)};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(gW,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,H.jsx)(QU,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,className:`min-w-0 flex-1`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,H.jsx)(iB,{label:`Use this model`,icon:km,tone:`primary`,onClick:c})]}):null]})}function MK({label:e,help:t,checked:n,onChange:r,name:i}){return(0,H.jsxs)(`div`,{className:`flex min-h-0 items-center justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,H.jsx)($U,{checked:n,onCheckedChange:r,"aria-label":i??e})]})}function NK({value:e,onSave:t,placeholder:n,label:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let n=i.trim();n!==e&&t(n)};return(0,H.jsx)(QU,{value:i,placeholder:n,"aria-label":r,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function PK({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,H.jsx)(LK,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(W.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function FK({value:e,label:t,onSave:n}){return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-x-4 gap-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:qW.label}),(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:qW.help})]}),(0,H.jsx)(`div`,{className:`w-36 shrink-0`,children:(0,H.jsx)(LK,{label:t,value:e?String(e):``,min:qW.min,max:qW.max,step:1e3,placeholder:qW.placeholder,suffix:`tokens`,onSave:e=>{if(e===``)return n(null),!0;let t=Number(e);return!Number.isInteger(t)||t<qW.min||t>qW.max?(W.error(qW.bad(e)),!1):(n(t),!0)}})})]})}function IK({value:e,onSave:t}){return(0,H.jsx)(LK,{label:tG,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(W.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function LK({label:e,value:t,min:n,max:r,step:i,placeholder:a,suffix:o,onSave:s}){let[c,l]=(0,m.useState)(t);(0,m.useEffect)(()=>l(t),[t]);let u=()=>{c!==t&&(s(c.trim())||l(t))};return(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(QU,{type:`number`,inputMode:`numeric`,min:n,max:r,step:i,placeholder:a,value:c,"aria-label":e,className:o?o.length>3?`pr-14`:`pr-10`:void 0,onChange:e=>l(e.target.value),onBlur:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}}),o?(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:o}):null]})}function RK({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(eW,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function zK({value:e,statuses:t,label:n,onChange:r}){let i=[{value:`pi`,label:$.piLabel,help:$.piHelp},...t.map(e=>({value:e.id,label:e.label,help:e.path?e.version?`v${e.version}`:$.installed:$.missing}))];return i.some(t=>t.value===e)||i.push({value:e,label:e}),(0,H.jsx)(gW,{value:e,items:i,label:n,onChange:r})}function BK({value:e,models:t,label:n,onChange:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),c=e===``||t.some(t=>t.id===e),l=[{value:``,label:$.defaultModel,help:$.defaultModelHelp},...t.map(e=>({value:e.id,label:e.label,help:e.custom?HW:e.current?e.id:`${e.id} · ${$.older}`})),...c?[]:[{value:e,label:e,help:HW}],{value:BW,label:VW,help:HW}],u=t=>{if(t!==`__custom__`)return r(t);s(c?``:e),a(!0)},d=()=>{let t=o.trim();a(!1),t&&t!==e&&r(t)};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(gW,{value:e,items:l,label:n,onChange:u}),i?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,H.jsx)(QU,{autoFocus:!0,value:o,placeholder:`model id`,"aria-label":`Harness model id`,className:`min-w-0 flex-1`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())}}),(0,H.jsx)(iB,{label:`Use this model`,icon:km,tone:`primary`,onClick:d})]}):null]})}function VK(e,t){let n=e?.models.find(e=>e.id===t);if(n&&n.efforts.length>0)return n.efforts;if(e?.effort===`session`)return WW;let r=e?.models.find(e=>e.efforts.length>0)?.efforts;return r&&r.length>0?r:WW}function HK({kind:e,config:t,models:n,harnesses:r,save:i,onGrants:a}){let o=EK(t,e),s=t=>i(DK(e,t)),c=IW[e],l=o.harness?r.find(e=>e.id===o.harness):void 0,u=!!o.harness,d=o.harnessModel??``,f=u?VK(l,d):OK(n,o.model),p=t=>{if(t===(o.harness??`pi`))return;if(t===`pi`)return void s({harness:`pi`});let n=VK(r.find(e=>e.id===t),``),i={harness:t,harnessModel:``};e!==`scout`&&!n.includes(o.thinking)&&(i.thinking=kK(n,o.thinking)),s(i)},h=t=>{let n=VK(l,t),r={harnessModel:t};e!==`scout`&&!n.includes(o.thinking)&&(r.thinking=kK(n,o.thinking)),s(r)},g=t=>{let r={model:t};e!==`scout`&&!OK(n,t).includes(o.thinking)&&(r.thinking=kK(OK(n,t),o.thinking)),s(r)},_=e!==`scout`&&e!==`researcher`,[v,y]=(0,m.useState)(!1),b=UK(o,e);return(0,H.jsxs)(`section`,{"data-slot":`agent-row`,className:`glass flex min-w-0 flex-col gap-2.5 rounded-xl border px-3.5 pt-2.5 pb-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,H.jsx)(`h3`,{className:`flex min-w-0 items-center gap-2 break-words text-sm font-semibold`,children:c}),(0,H.jsx)(KK,{open:v,custom:b,onToggle:()=>y(e=>!e)})]}),mG.has(e)?(0,H.jsx)(zK,{value:o.harness??`pi`,statuses:r,label:`${c} ${$.label.toLowerCase()}`,onChange:p}):(0,H.jsx)(GK,{value:$.piLabel,note:`always ${$.piLabel}`,label:`${c} ${$.label.toLowerCase()}`}),u?(0,H.jsx)(BK,{value:d,models:l?.models??[],label:`${c} model`,onChange:h}):(0,H.jsx)(jK,{value:o.model,models:n,label:`${c} model`,inherit:e===`master`,onChange:g}),e===`scout`?(0,H.jsx)(WK,{}):(0,H.jsx)(xW,{value:o.thinking,levels:WW,supported:f,recommended:UW[e],model:u?d||`${l?.label??o.harness}'s default model`:o.model===`inherit`?`the session model`:o.model,label:`${c} effort`,onChange:e=>s({thinking:e})}),u&&l?.effort===`session`&&e!==`scout`?(0,H.jsx)(`p`,{className:`-mt-1 text-xs text-muted-foreground`,children:$.effortNote}):null,(0,H.jsxs)(`div`,{className:`mt-auto grid gap-2.5`,children:[(0,H.jsx)(MK,{label:`Auto-compact`,help:e===`master`?`Compacts the orchestrator's context as it fills, and files what it learned into the knowledge base, shared with the agents it concerns.`:u?l?.protocol===`acp`?`${l.label} compacts on its own; this switch applies to pi, Codex and Claude Code.`:`Lets ${l?.label??`the harness`} compact this agent's context, at the threshold under Harnesses.`:`Compacts this agent's context as it fills.`,checked:o.autoCompact!==!1,onChange:e=>s({autoCompact:e}),name:`${c} auto-compact`}),o.autoCompact!==!1&&!u?(0,H.jsx)(FK,{value:o.compactAt,label:`${c} compact at`,onSave:e=>s({compactAt:e})}):null]}),(0,H.jsxs)(`div`,{hidden:!v,className:`grid gap-2 border-t border-border pt-2`,children:[u?(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:$.agentNote}):null,_?(0,H.jsx)(RK,{value:o.instructions??``,label:`${c} instructions`,onSave:e=>s({instructions:e})}):null,(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`p`,{className:`min-w-[7rem] flex-1 break-words text-xs text-muted-foreground`,children:OG(EG(t,e),e)}),(0,H.jsx)(iB,{label:Q.edit,icon:s_,onClick:a})]})]})]})}function UK(e,t){return[t!==`scout`&&t!==`researcher`&&!!e.instructions,e.mcpTools!==void 0,t!==`master`&&e.skills!==void 0].filter(Boolean).length}function WK(){return(0,H.jsx)(GK,{value:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Dm,{"aria-hidden":`true`,className:`size-3.5`}),(0,H.jsx)(`span`,{className:`capitalize`,children:`low`})]}),note:`fixed for scouts`,label:`Scout effort`})}function GK({value:e,note:t,label:n}){return(0,H.jsxs)(`div`,{role:`group`,"aria-label":`${n}: ${t}`,className:`cs-fixrow`,children:[(0,H.jsx)(`span`,{className:`flex items-center gap-1.5`,children:e}),(0,H.jsx)(`span`,{className:`cs-fixnote`,children:t})]})}function KK({open:e,custom:t,onToggle:n}){return(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":e,onClick:n,className:`-mr-1.5 flex min-h-8 shrink-0 items-center gap-1 rounded-md px-1.5 text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[(0,H.jsx)(Fm,{"aria-hidden":`true`,className:Y(`size-3.5 transition-transform duration-200 ease-snap`,e&&`rotate-90`)}),`More`,t>0?(0,H.jsxs)(`span`,{className:`text-primary`,children:[`· `,t,` customised`]}):null]})}function qK(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function JK({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,H.jsx)(MK,{label:t.label,help:t.help,checked:qK(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function YK({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,H.jsx)(SW,{prominent:!0,title:GW.workflow,children:(0,H.jsx)(hW,{children:(0,H.jsx)(mW,{label:oG,help:aG.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,H.jsx)(gW,{value:n,items:aG.map(e=>({value:e.id,label:e.label})),label:oG,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}function XK(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function ZK({config:e,save:t}){let n=e.lint,r=n.mode===`off`,i=n.command.trim().length>0;return(0,H.jsxs)(SW,{prominent:!0,title:GW.lint,children:[(0,H.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:cG.intro}),(0,H.jsxs)(hW,{children:[(0,H.jsx)(mW,{label:cG.mode,help:sG.find(e=>e.id===n.mode)?.help,children:(0,H.jsx)(gW,{value:n.mode,items:sG.map(e=>({value:e.id,label:e.label})),label:cG.mode,onChange:e=>void t({lint:{mode:e}})})}),(0,H.jsxs)(`div`,{className:Y(`flex flex-col divide-y divide-border [&>*]:py-3 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0`,r&&`opacity-60`),"aria-disabled":r||void 0,children:[(0,H.jsx)(mW,{label:cG.command,help:cG.commandHelp,children:(0,H.jsx)(NK,{value:n.command,label:cG.command,placeholder:cG.commandPlaceholder,onSave:e=>void t({lint:{command:e}})})}),i?(0,H.jsx)(mW,{label:cG.extensions,help:cG.extensionsHelp,children:(0,H.jsx)(NK,{value:n.extensions.join(` `),label:cG.extensions,placeholder:cG.extensionsPlaceholder,onSave:e=>void t({lint:{extensions:XK(e)}})})}):null,(0,H.jsx)(mW,{label:cG.timeout,help:cG.timeoutHelp,children:(0,H.jsx)(PK,{value:n.timeoutMs,label:`Lint ${cG.timeout.toLowerCase()}`,onSave:e=>void t({lint:{timeoutMs:e}})})})]})]}),(0,H.jsx)(CK,{replaced:i})]})}function QK({config:e,save:t}){let n=e.lobby.web;return(0,H.jsx)(SW,{prominent:!0,title:GW.lobby,children:(0,H.jsxs)(hW,{children:[TK.map(n=>(0,H.jsx)(JK,{config:e,item:n,save:t},n.id)),(0,H.jsx)(mW,{label:QW,help:$W,children:(0,H.jsx)(gW,{value:String(e.lobby.maxPlanningRounds),items:eG.map(e=>({value:String(e),label:AK(e)})),label:QW,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,H.jsx)(mW,{label:tG,help:nG,children:(0,H.jsx)(IK,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,H.jsx)(MK,{label:rG,help:iG,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})}),(0,H.jsx)($K,{})]})})}function $K(){let e=MV(`lobby.retention`,{},[]),t=async t=>{try{await R(`lobby.setRetention`,{enabled:t}),e.reload()}catch(e){W.error(e instanceof Error?e.message:`That did not work. Try again.`)}};return(0,H.jsx)(MK,{label:YW.label,help:e.error?YW.error:YW.help,checked:e.data?.enabled??!1,onChange:e=>void t(e)})}function eq(e){let t=e.indexOf(`/`);return t>0?e.slice(0,t):``}function tq(e,t){let n=new Set,r=[];for(let e of t)n.has(e.id)||(n.add(e.id),r.push({id:e.id,label:e.label,kind:`classifier`}));for(let t of e)n.has(t.id)||(n.add(t.id),r.push({id:t.id,label:t.label,kind:`chat`}));return r}function nq({value:e,models:t,classifiers:n,onChange:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),c=tq(t,n),l=eq(e),[u,d]=(0,m.useState)(l),f=e?l:u,p=[...new Set([...c.map(e=>eq(e.id)),...l?[l]:[]])].filter(Boolean).sort(),h=[{value:rq,label:fG.engineJev,help:fG.engineJevHelp},...p.map(e=>{let t=c.filter(t=>eq(t.id)===e),n=t.filter(e=>e.kind===`classifier`).length,r=t.length-n,i=[n?`${n} ${fG.engineClassifier}${n===1?``:`s`}`:``,r?`${r} chat model${r===1?``:`s`}`:``].filter(Boolean).join(`, `);return{value:e,label:e,...i?{help:i}:{}}})],g=c.filter(e=>eq(e.id)===f),_=[...g.map(e=>({value:e.id,label:e.id.slice(f.length+1),help:`${e.kind===`classifier`?fG.engineClassifier:fG.engineChat}${e.label&&e.label!==e.id?` · ${e.label}`:``}`})),...e&&!g.some(t=>t.id===e)?[{value:e,label:e.slice(f.length+1)||e,help:HW}]:[],{value:BW,label:VW,help:HW}],v=e=>{if(a(!1),e===rq)return d(``),r(``);d(e);let t=c.find(t=>eq(t.id)===e&&t.kind===`classifier`)??c.find(t=>eq(t.id)===e);t&&r(t.id)},y=t=>{if(t!==`__custom__`)return r(t);s(e&&!g.some(t=>t.id===e)?e:`${f}/`),a(!0)},b=()=>{let t=o.trim();a(!1),t&&t!==e&&r(t)};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(gW,{value:f||rq,items:h,label:fG.provider,onChange:v}),f?(0,H.jsx)(gW,{value:e||`__custom__`,items:_,label:fG.engineModel,onChange:y}):null,i?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,H.jsx)(QU,{autoFocus:!0,value:o,placeholder:`provider/model`,"aria-label":`Classifier model id`,className:`min-w-0 flex-1`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())}}),(0,H.jsx)(iB,{label:`Use this model`,icon:km,tone:`primary`,onClick:b})]}):null]})}var rq=`__jev__`;function iq({config:e,models:t,classifiers:n,save:r}){let i=e.classifier,a=uG.find(e=>e.id===i.provider)?.label,o=!i.engine;return(0,H.jsx)(SW,{prominent:!0,title:GW.classifier,children:(0,H.jsxs)(hW,{children:[(0,H.jsx)(MK,{label:fG.enabled,help:fG.enabledHelp,checked:i.enabled,onChange:e=>void r({classifier:{enabled:e}})}),(0,H.jsx)(mW,{label:fG.engine,help:fG.engineHelp,children:(0,H.jsx)(nq,{value:i.engine,models:t,classifiers:n,onChange:e=>void r({classifier:{engine:e}})})}),o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mW,{label:fG.host,children:(0,H.jsx)(gW,{value:i.provider,items:uG.map(e=>({value:e.id,label:e.label})),label:fG.host,onChange:e=>void r({classifier:{provider:e}})})}),(0,H.jsx)(mW,{label:fG.model,help:fG.modelHelp,children:(0,H.jsx)(NK,{value:i.model,label:fG.model,placeholder:`the host's default`,onSave:e=>void r({classifier:{model:e}})})}),(0,H.jsx)(mW,{label:fG.key,help:fG.keyNote,children:(0,H.jsx)(`p`,{className:`break-words text-sm text-muted-foreground text-right`,children:a??i.provider})})]}):null,dG.map(e=>(0,H.jsx)(MK,{label:e.label,help:e.help,checked:i.features[e.id],onChange:t=>void r({classifier:{features:{[e.id]:t}}})},e.id)),(0,H.jsx)(mW,{label:fG.cheap,help:fG.cheapHelp,children:(0,H.jsx)(jK,{value:i.effort.cheapModel,models:t,label:fG.cheap,none:!0,onChange:e=>void r({classifier:{effort:{cheapModel:e}}})})})]})})}function aq(){let e=zU(),t=async e=>{if(!e)return VU();let t=await BU();t===`granted`?W.success(pG.notificationsOn):W.error(t===`unsupported`?pG.notificationsUnsupported:pG.notificationsBlocked)};return(0,H.jsx)(SW,{prominent:!0,title:GW.notifications,children:(0,H.jsx)(hW,{children:(0,H.jsx)(MK,{label:pG.notificationsLabel,help:pG.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function oq(){let{available:e,install:t}=y(),n=b(),r=x();return(0,H.jsx)(SW,{prominent:!0,title:GW.install,children:(0,H.jsxs)(hW,{children:[(0,H.jsx)(mW,{label:pG.installLabel,help:n?pG.installedNow:pG.installHelp,children:n?null:(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsx)(iB,{label:pG.installButton,icon:rh,tone:`primary`,onClick:()=>e?void t().then(()=>W.success(pG.installDone)):W.warning(pG.installUnavailable)})})}),r.supported?(0,H.jsx)(mW,{label:pG.fullscreenLabel,help:pG.fullscreenHelp,children:(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsx)(iB,{label:r.on?pG.fullscreenOn:pG.fullscreenOff,icon:r.on?Zh:Uh,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var sq=[`Agents`,`Harnesses`,`Tools & skills`,`Workflow`,`Lobby`,`Classifier`,`Appearance & notifications`],cq=e=>`settings-${e.split(` `)[0]}`;function lq({config:e,models:t,classifierModels:n=[],onConfig:r}){let[i,a]=(0,m.useState)(`Agents`),[o,s]=(0,m.useState)(`master`),c=e=>{s(e),a(`Tools & skills`)},l=MV(`settings.harnesses`,{},[]),u=JSON.stringify(e.harnesses),d=l.reload,f=(0,m.useRef)(u);(0,m.useEffect)(()=>{f.current!==u&&(f.current=u,d())},[u,d]);let p=l.data?.harnesses??[],h=(0,m.useRef)(Promise.resolve()),g=e=>{let t=async()=>{try{return r((await R(`settings.set`,{patch:e})).config),W.success(pG.saved),!0}catch(e){return W.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},n=h.current.then(t,t);return h.current=n,n};return(0,H.jsxs)(`div`,{className:`cs-pg cs-set flex flex-col pb-dock`,children:[(0,H.jsx)(`header`,{className:`cs-pgh`,children:(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`cs-hd1`,children:pG.title}),(0,H.jsx)(`p`,{className:`cs-hd2`,children:pG.intro})]})}),(0,H.jsx)(`nav`,{"aria-label":`Settings sections`,className:`cs-secn`,children:(0,H.jsx)(Rk,{as:`nav`,size:`md`,label:`Settings sections`,items:sq.map(e=>({id:e,label:e,controls:cq(e)})),value:i,onChange:a})}),(0,H.jsxs)(`div`,{id:cq(`Agents`),hidden:i!==`Agents`,"aria-hidden":i!==`Agents`,children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:GW.agents}),(0,H.jsx)(`div`,{className:`cs-agrid grid grid-cols-2 gap-3.5 lg:grid-cols-3`,children:FW.map(n=>(0,H.jsx)(HK,{kind:n,config:e,models:t,harnesses:p,save:g,onGrants:()=>c(n)},n))})]}),(0,H.jsx)(`div`,{id:cq(`Harnesses`),hidden:i!==`Harnesses`,"aria-hidden":i!==`Harnesses`,children:(0,H.jsx)(HG,{config:e,statuses:l.data?.harnesses,...l.error?{error:l.error}:{},save:g})}),(0,H.jsx)(`div`,{id:cq(`Tools & skills`),hidden:i!==`Tools & skills`,"aria-hidden":i!==`Tools & skills`,children:(0,H.jsx)(MG,{config:e,save:g,agent:o,onAgent:s})}),(0,H.jsx)(`div`,{id:cq(`Workflow`),hidden:i!==`Workflow`,"aria-hidden":i!==`Workflow`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,H.jsx)(YK,{config:e,save:g}),(0,H.jsx)(ZK,{config:e,save:g})]})}),(0,H.jsx)(`div`,{id:cq(`Lobby`),hidden:i!==`Lobby`,"aria-hidden":i!==`Lobby`,children:(0,H.jsx)(QK,{config:e,save:g})}),(0,H.jsx)(`div`,{id:cq(`Classifier`),hidden:i!==`Classifier`,"aria-hidden":i!==`Classifier`,children:(0,H.jsx)(iq,{config:e,models:t,classifiers:n,save:g})}),(0,H.jsx)(`div`,{id:cq(`Appearance & notifications`),hidden:i!==`Appearance & notifications`,"aria-hidden":i!==`Appearance & notifications`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,H.jsx)(SG,{}),(0,H.jsx)(aq,{}),(0,H.jsx)(oq,{})]})})]})}function uq(){return(0,H.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-8 pt-8 pb-dock`,role:`status`,"aria-label":pG.loading,children:[0,1,2,3].map(e=>(0,H.jsx)(tA,{shape:`card`,className:`h-48`},e))})}function dq(){let e=MV(`settings.get`,{},[`status`]),[t,n]=(0,m.useState)(),r=(0,m.useRef)(0),i=(0,m.useCallback)(e=>{r.current=performance.now(),n(e)},[]);return(0,m.useEffect)(()=>{e.data&&e.requestedAt>r.current&&n(e.data.config)},[e.data,e.requestedAt]),!t&&e.error?(0,H.jsx)(jk,{message:`${pG.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,H.jsx)(lq,{config:t,models:e.data?.models??[],classifierModels:e.data?.classifierModels??[],onConfig:i}):(0,H.jsx)(uq,{})}function fq(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var pq=`default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src 'none'; font-src 'none'; connect-src 'none'; media-src 'none'; frame-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'`,mq=new Set(`div span p br hr h1 h2 h3 h4 h5 h6 section article header footer main aside nav ul ol li dl dt dd strong em b i u s small sub sup blockquote pre code table thead tbody tfoot tr th td caption colgroup col figure figcaption style button input label select option optgroup textarea details summary fieldset legend progress meter output kbd mark`.split(` `)),hq=new Set(`class id title role aria-label aria-hidden aria-expanded aria-selected aria-checked aria-pressed aria-current colspan rowspan scope type name value placeholder for checked selected disabled readonly open min max step rows cols tabindex`.split(` `)),gq=new Set(`text search email tel url number password checkbox radio range color date time month week button reset submit`.split(` `)),_q=`button,input,select,textarea,summary,label,[role=button],[role=tab]{transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease,opacity .18s ease}button,summary,label,select,[role=button],[role=tab],input[type=checkbox],input[type=radio],input[type=range]{cursor:pointer}button:active,[role=button]:active{transform:scale(.97)}details[open]>:not(summary){animation:mockup-in .22s ease-out}@keyframes mockup-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}`;function vq(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.html!=`string`||t.html.length>1e5)&&!(t.css!==void 0&&(typeof t.css!=`string`||t.css.length>12e4)))return{html:t.html,...typeof t.css==`string`?{css:t.css}:{}}}function yq(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,``);return/\\|@import|url\s*\(|image-set\s*\(|expression\s*\(|behavior\s*:|-moz-binding/i.test(t)?``:t.replace(/<\/?style/gi,``)}function bq(e){if(!mq.has(e.localName)||e.namespaceURI!==`http://www.w3.org/1999/xhtml`){e.remove();return}for(let t of[...e.attributes])t.name===`style`?e.setAttribute(`style`,yq(t.value)):hq.has(t.name)||e.removeAttribute(t.name);if(e.localName===`input`){let t=[...e.attributes].find(e=>e.name===`type`)?.value.toLowerCase();t!==void 0&&!gq.has(t)&&e.setAttribute(`type`,`text`)}e.localName===`style`&&(e.textContent=yq(e.textContent??``));for(let t of[...e.children])bq(t)}function xq(e,t){try{return Sq(e,t??fq())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${pq}"><meta name="referrer" content="no-referrer"></head><body><p role="status">Static mockup unavailable. The preview could not be safely rendered.</p></body></html>`}}function Sq(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])bq(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${pq}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${_q}${yq(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function Cq({preview:e,label:t,className:n,frameWidth:r,minWidth:i,onOpen:a}){let o=(0,m.useMemo)(()=>xq(e),[e]),s=(0,m.useRef)(null),[c,l]=(0,m.useState)();if((0,m.useLayoutEffect)(()=>{let e=s.current;if(!r&&!i||!e)return;let t=()=>l({width:e.clientWidth,height:e.clientHeight});if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r,i]),!r&&!i)return(0,H.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:Y(`h-80 w-full rounded-lg border bg-background`,n)});let u=r??Math.max(c?.width??0,i??0),d=c&&c.width>0&&u>0?Math.min(1,c.width/u):1;return(0,H.jsxs)(`div`,{ref:s,className:Y(`group/mock relative h-80 w-full max-w-full overflow-hidden rounded-lg border bg-background`,n),children:[(0,H.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:`absolute top-0 left-0 origin-top-left border-0`,style:{width:u||`100%`,height:c?c.height/d:`100%`,transform:`scale(${d})`}}),a?(0,H.jsx)(`button`,{type:`button`,"data-compact":``,onClick:a,"aria-label":`Expand the mockup: ${t}`,"data-tip":`Expand`,className:`cs-mxb outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,H.jsx)(Vh,{"aria-hidden":`true`,className:`size-3`})}):null]})}var wq=/\s*\(recommended\)\s*$/i,Tq=1024,Eq=e=>e.replace(wq,``);function Dq(e){return!!(e&&(e.htmlPreview||e.image||e.preview))}function Oq({option:e}){let t=Eq(e.label);return Dq(e)?(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[e.htmlPreview?(0,H.jsx)(Cq,{preview:e.htmlPreview,label:t,minWidth:Tq,className:`h-auto min-h-[18rem] flex-1`}):null,e.image?(0,H.jsx)(`img`,{src:I(e.image),alt:`Mockup: ${t}`,className:`min-h-0 w-full flex-1 rounded-lg border bg-background object-contain`}):null,e.preview?(0,H.jsx)(pV,{text:e.preview,className:Y(`overflow-auto rounded-lg border bg-background p-4 text-sm`,!e.htmlPreview&&!e.image&&`flex-1`)}):null]}):(0,H.jsx)(`p`,{className:`grid h-full place-items-center p-6 text-sm text-muted-foreground`,children:`No mockup for this option.`})}function kq({options:e,start:t,title:n,picked:r=[],multi:i=!1,onChoose:a,onClose:o,onIndex:s}){let c=Of(),l=(0,m.useRef)(null),u=(0,m.useRef)(null),[d,f]=(0,m.useState)(()=>Math.min(Math.max(0,t),e.length-1)),p=e[d],h=e.length-1;(0,m.useEffect)(()=>s?.(d),[d,s]),(0,m.useLayoutEffect)(()=>{let e=l.current;e&&(e.scrollLeft=d*e.clientWidth),u.current?.focus()},[]);let g=(0,m.useCallback)(e=>{let t=Math.min(Math.max(0,e),h),n=l.current;f(t),n?.scrollTo({left:t*n.clientWidth,behavior:c?`auto`:`smooth`})},[h,c]);(0,m.useEffect)(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{e.scrollLeft=d*e.clientWidth});return t.observe(e),()=>t.disconnect()},[d]);function _(){let e=l.current;if(!e||e.clientWidth===0)return;let t=Math.round(e.scrollLeft/e.clientWidth);t!==d&&t>=0&&t<=h&&f(t)}function v(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=t.target;if(n.closest(`input, textarea, [contenteditable='true']`))return;let r={ArrowLeft:-1,ArrowRight:1,PageUp:-1,PageDown:1}[t.key];if(r){t.preventDefault(),g(d+r);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),g(t.key===`Home`?0:h);return}let i=Number(t.key);if(Number.isInteger(i)&&i>=1&&i<=e.length){t.preventDefault(),g(i-1);return}t.key===`Enter`&&a&&!(n instanceof HTMLButtonElement)&&(t.preventDefault(),a(d))}let y=r.includes(d);return(0,H.jsxs)(`div`,{ref:u,tabIndex:-1,"data-autofocus":``,onKeyDown:v,className:`mockup-viewer flex h-full min-h-0 flex-col outline-none`,role:`region`,"aria-label":`Mockups: ${n}`,"aria-roledescription":`carousel`,children:[(0,H.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,H.jsx)(ZO,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Back to the question`,"data-tip":`Back`,"data-tip-keys":`Esc`,onClick:()=>o(d),children:(0,H.jsx)(Yh,{"aria-hidden":`true`})}),(0,H.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:n}),(0,H.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,"aria-live":`polite`,children:[d+1,` of `,e.length]}),(0,H.jsx)(`div`,{role:`tablist`,"aria-label":`Options`,className:`flex w-full flex-wrap gap-1.5 sm:w-auto`,children:e.map((e,t)=>(0,H.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===d,"aria-controls":`mockup-slide-${t}`,"data-compact":``,onClick:()=>g(t),className:Y(`inline-flex h-7 max-w-48 items-center gap-1 rounded-lg border px-2.5 text-xs font-medium transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t===d?`border-primary/50 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,H.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:t+1}),(0,H.jsx)(`span`,{className:`truncate`,children:Eq(e.label)}),r.includes(t)?(0,H.jsx)(km,{"aria-label":`picked`,className:`size-3 text-primary`}):null]},t))})]}),(0,H.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,H.jsx)(`div`,{ref:l,onScroll:_,className:`mockup-track flex h-full snap-x snap-mandatory overflow-x-auto overflow-y-hidden overscroll-x-contain`,children:e.map((t,n)=>(0,H.jsxs)(`section`,{id:`mockup-slide-${n}`,role:`tabpanel`,"aria-roledescription":`slide`,"aria-label":`${n+1} of ${e.length}: ${Eq(t.label)}`,"aria-hidden":n!==d,className:`flex h-full w-full shrink-0 snap-center snap-always flex-col gap-2 overflow-y-hidden px-4 py-4 sm:px-14`,children:[(0,H.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[n+1,`.`]}),(0,H.jsx)(`span`,{className:`font-medium`,children:Eq(t.label)}),wq.test(t.label)?(0,H.jsx)(`span`,{className:`text-xs font-medium text-primary`,children:`Recommended`}):null,r.includes(n)?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-primary`,children:[(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3`}),`picked`]}):null]}),t.description?(0,H.jsx)(pV,{text:t.description,className:`text-sm text-muted-foreground`}):null,(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,H.jsx)(Oq,{option:t})})]},n))}),d>0?(0,H.jsx)(ZO,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Previous option`,"data-tip":`Previous`,"data-tip-keys":`ArrowLeft`,onClick:()=>g(d-1),className:`absolute top-1/2 left-2 -translate-y-1/2 rounded-full`,children:(0,H.jsx)(Nm,{"aria-hidden":`true`})}):null,d<h?(0,H.jsx)(ZO,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Next option`,"data-tip":`Next`,"data-tip-keys":`ArrowRight`,onClick:()=>g(d+1),className:`absolute top-1/2 right-2 -translate-y-1/2 rounded-full`,children:(0,H.jsx)(Fm,{"aria-hidden":`true`})}):null]}),(0,H.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3`,children:[(0,H.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(ok,{chord:`←→`,children:`option`}),a?(0,H.jsx)(ok,{chord:`Enter`,children:i?y?`unpick`:`pick`:`choose`}):null,(0,H.jsx)(ok,{chord:`Esc`,children:`back`})]}),a&&p?(0,H.jsxs)(ZO,{type:`button`,onClick:()=>a(d),className:`max-w-full`,children:[i&&y?`Unpick`:i?`Pick`:`Choose`,(0,H.jsx)(`span`,{className:`truncate`,children:Eq(p.label)})]}):null]})]})}function Aq(e,t,n){e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),e.key===`Enter`&&e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t()))}function jq({text:e,disabled:t=!1,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{u.current?.focus({preventScroll:!0}),u.current?.select()},[]);let d=async()=>{if(!(t||o||!i.trim())){s(!0),l(``);try{await n(i.trim()),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(!1)}}};return(0,H.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>Aq(e,()=>void d(),()=>{o||r()}),children:[(0,H.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,H.jsx)(eW,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24`})]}),c?(0,H.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(ZO,{size:`sm`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,H.jsx)(ZO,{size:`sm`,variant:`ghost`,disabled:o,onClick:r,children:`Cancel`})]})]})}var Mq=1200;function Nq({question:e}){let[t,n]=(0,m.useState)(),r=gk(t!==void 0,hk.sheet),i=e.options.flatMap((e,t)=>e.mockup?[{option:e,index:t,mockup:e.mockup}]:[]);if(i.length===0)return null;let a=e.options.map(e=>({label:e.label,description:e.description,...e.mockup?{htmlPreview:e.mockup}:{}}));return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`ul`,{"aria-label":`Mockups`,className:`cs-mocks`,children:i.map(({option:e,index:t,mockup:r})=>(0,H.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(Cq,{preview:r,label:Eq(e.label),frameWidth:Mq,onOpen:()=>n(t),className:`cs-mk3f aspect-[3/2] h-auto`}),(0,H.jsxs)(`span`,{className:`truncate`,children:[(0,H.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),` `,Eq(e.label)]})]},t))}),(0,H.jsx)(ck,{open:t!==void 0&&r,onOpenChange:e=>{e||n(void 0)},label:`Mockups: ${e.text}`,className:`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`,children:t===void 0?null:(0,H.jsx)(kq,{options:a,start:t,title:e.text,onClose:()=>n(void 0)})})]})}function Pq({questions:e}){return(0,H.jsx)(`ol`,{className:`cs-qs`,children:e.map((e,t)=>(0,H.jsxs)(`li`,{className:`cs-qc`,style:{"--ac":GV(e.from)},children:[(0,H.jsxs)(`p`,{className:`cs-qh`,children:[(0,H.jsx)(`span`,{className:`cs-qwho`,children:XV(e.from)}),(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsxs)(`span`,{className:`sr-only`,children:[`Question `,t+1,`: `]}),e.text]})]}),e.options.length?(0,H.jsx)(`ul`,{"aria-label":`Options`,className:`cs-opts`,children:e.options.map(e=>(0,H.jsxs)(`li`,{className:`cs-op`,children:[(0,H.jsx)(`b`,{children:e.label}),e.description?` — ${e.description}`:``]},e.label))}):null,(0,H.jsx)(Nq,{question:e})]},t))})}function Fq({message:e}){let t=e.decided??[];return t.length?(0,H.jsx)(`ul`,{"aria-label":`Settled for you`,className:`cs-decided`,children:t.map((e,t)=>(0,H.jsxs)(`li`,{title:`Settled by the classifier, ${Math.round(e.probability*100)}% sure. Comment on the plan to overrule it.`,children:[(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-3.5`}),(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsx)(`b`,{className:`font-semibold`,style:{color:GV(e.from)},children:XV(e.from)}),` `,(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:e.question}),` `,(0,H.jsx)(`b`,{className:`font-semibold`,children:e.answer}),(0,H.jsxs)(`span`,{className:`cs-dh2`,children:[`auto · `,Math.round(e.probability*100),`% · comment to overrule`]})]})]},t))}):null}function Iq({message:e,index:t,busy:n,readOnly:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),c=o&&(o.editedAt??0)>(e.editedAt??0)?o:e,l=n||c!==e,u=async n=>{let r=await R(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});s(r.message)},d=!r&&!e.settled?.length&&!i?(0,H.jsxs)(`button`,{type:`button`,disabled:l,onClick:()=>a(!0),className:`chat-action`,children:[(0,H.jsx)(lg,{"aria-hidden":`true`,className:`size-3`}),`Edit`]}):null;return(0,H.jsx)(mH,{time:e.at>0?wH(e.at):void 0,head:!0,note:c.editedAt?`(edited)`:void 0,actions:d,children:i?(0,H.jsx)(jq,{text:c.text,disabled:n,onSave:u,onCancel:()=>a(!1)}):(0,H.jsx)(pV,{text:c.text})})}function Lq({message:e,index:t,busy:n,readOnly:r}){if(e.role===`you`)return(0,H.jsx)(Iq,{message:e,index:t,busy:n,readOnly:r});let i=e.questions??[];return(0,H.jsxs)(fH,{tile:!0,source:`PLANNER`,name:`Panel`,time:e.at>0?wH(e.at):void 0,head:!0,bubble:i.length===0,aside:i.length?`${i.length} question${i.length===1?``:`s`}`:void 0,children:[i.length>0?(0,H.jsx)(Pq,{questions:i}):(0,H.jsx)(pV,{text:e.text}),(0,H.jsx)(Fq,{message:e})]})}function Rq({messages:e,seed:t,busy:n=!1,readOnly:r=!1}){return(0,H.jsxs)(`div`,{className:`chat-column`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,H.jsx)(hH,{children:t}):null,e.map((e,t)=>(0,H.jsx)(Lq,{message:e,index:t,busy:n,readOnly:r},`${e.at}-${t}`)),n?(0,H.jsx)(fH,{tile:!0,source:`PLANNER`,name:`Panel`,head:!0,live:!0,waiting:!0,aside:`the panel is thinking`}):null]})}var zq=`ORCHESTRATOR`,Bq=`No draft yet.`,Vq=`The draft appears after the panel's first round.`,Hq=`What each seat needs`,Uq=[`backend`,`designer`,`qa`,`researcher`],Wq={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`};function Gq(e,t=0){return t<=0?`round ${e}`:e>t?`round ${e} · past the limit, revising`:e===t?`final round ${e}/${t}`:`round ${e}/${t}`}function Kq(e,t){return`${e} ${t}${e===1?``:`s`}`}function qq(e){return e.round===0&&e.messages.length===0&&!e.busy}function Jq(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${Wq[t.member]} failed`).split(`
104
- `)[0]}function Yq(e){let t=[],n=Jq(e);return e.busy?t.push(Gq(e.round,e.limit)):n?t.push(`${n} — Retry runs the round again`):e.questions.length>0&&t.push(`${Kq(e.questions.length,`question`)} waiting`),!e.busy&&e.round>0&&t.push(Gq(e.round,e.limit)),!e.busy&&e.limit>0&&e.round+1===e.limit&&t.push(`the next round is the last: the orchestrator settles the rest`),t}function Xq(e,t){let n=Wq[e],r=t.seats.includes(e),i=t.members.find(t=>t.member===e),a={member:e,label:n,seated:r,working:!1};if(!r)return{...a,text:`off`};if(i?.status===`thinking`)return{...a,working:!0,text:i.step??`thinking`};if(i?.status===`failed`)return{...a,text:`failed — Retry`};if(!i)return{...a,text:`·`};if(i.reply?.status===`ready`)return{...a,text:`ready`};let o=t.questions.filter(e=>e.from===n).length;return{...a,text:o===0?`done`:Kq(o,`question`)}}function Zq(e){let t=e.questions.filter(e=>e.from===`ORCHESTRATOR`||e.from===`ORACLE`).length;return[{label:zq,seated:!0,working:e.busy,text:e.busy?`chairing`:t?Kq(t,`question`):`·`},...Uq.map(t=>Xq(t,e))]}function Qq({iconOnly:e,className:t,side:n}){return(0,H.jsx)(iB,{label:`Previous plans`,text:`Previous`,icon:xg,shortcut:`H`,iconOnly:e,...t?{className:t}:{},...n?{side:n}:{},onClick:()=>Dk(Ek(`plan`,`previous`))})}function $q({snap:e}){return e.busy||Jq(e)===void 0?null:(0,H.jsx)(`p`,{role:`status`,className:`cs-note mx-auto mb-4 max-w-[48.75rem] text-[var(--bad)]`,children:Yq(e).join(` · `)})}function eJ(e){let t=XV(e.toUpperCase()===`MASTER`?`MASTER`:e.toUpperCase());return t.length<=3?t:t.slice(0,3)}function tJ({cell:e,asked:t,onToggled:n}){let r=XV(e.label),i=`${e.member?e.seated?`${r} sits on the panel`:`${r} sits this one out`:`${r} chairs the panel`}${e.text&&e.text!==`·`&&e.text!==`off`?` · ${e.text}`:``}${e.member?` · click to toggle`:``}`,a=async()=>{e.member&&await G(`planner.toggleSeat`,{member:e.member})&&n()};return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,className:`cs-sq cs-tipl`,"data-tip":i,"aria-label":i,"aria-pressed":e.member?e.seated:void 0,"data-on":e.seated?`true`:`false`,"data-fixed":e.member?void 0:`true`,"data-working":e.working?`true`:void 0,style:{"--c":GV(e.label)},onClick:e.member?()=>void a():void 0,children:[(0,H.jsx)(`span`,{className:`cs-sqt`,children:eJ(e.label)}),t>0?(0,H.jsx)(`span`,{className:`cs-sqn`,children:t}):null]})})}function nJ(e){let t=e.messages.at(-1);return t?.role===`planner`?t.questions??[]:[]}function rJ({snap:e,onDone:t}){let n=Vk(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=e=>async()=>{await G(e,{})&&t()},i=Yq(e).join(` · `)||`No rounds yet`,a=e.busy?e.round+1:Math.max(e.round,1);return(0,H.jsxs)(`aside`,{className:`cs-pside`,"aria-label":`Planning`,children:[e.limit>0?(0,H.jsxs)(`span`,{className:`cs-rcnt cs-tipl`,"data-tip":i,role:`status`,"aria-label":i,children:[(0,H.jsx)(`b`,{children:Math.min(a,e.limit)}),(0,H.jsxs)(`i`,{children:[`/`,e.limit]})]}):(0,H.jsx)(`span`,{className:`sr-only`,role:`status`,children:i}),(0,H.jsx)(`ul`,{className:`cs-chips`,"aria-label":`Panel`,children:Zq(e).map(n=>(0,H.jsx)(tJ,{cell:n,asked:nJ(e).filter(e=>KV(e.from,n.label)).length,onToggled:t},n.label))}),(0,H.jsx)(`div`,{className:`cs-sqsep`}),(0,H.jsxs)(`ul`,{className:`cs-chips`,"aria-label":`Plan actions`,children:[e.retryable?(0,H.jsx)(`li`,{children:(0,H.jsx)(iB,{iconOnly:!0,side:`left`,className:`cs-sq cs-act`,label:`Retry the round`,icon:Tg,shortcut:`R`,onClick:()=>void r(`planner.retry`)()})}):null,(0,H.jsx)(`li`,{children:(0,H.jsx)(Qq,{iconOnly:!0,side:`left`,className:`cs-sq cs-act`})}),(0,H.jsx)(`li`,{children:(0,H.jsx)(iB,{iconOnly:!0,side:`left`,className:`cs-sq cs-act`,"data-plan-save":!0,label:`Save the plan`,icon:kg,shortcut:n??`Ctrl+S`,disabled:!e.draft||e.busy,onClick:()=>void r(`planner.save`)()})}),(0,H.jsx)(`li`,{children:(0,H.jsx)(TV,{iconOnly:!0,side:`left`,className:`cs-sq cs-act`,icon:hh,label:`New plan`,shortcut:`N`,title:`Start a new plan?`,description:`The conversation and the draft are left behind. Saved plans are not touched.`,confirmLabel:`New plan`,onConfirm:()=>void G(`planner.new`,{}).then(t)})})]})]})}function iJ(e){let t=!1;return e.split(`
105
- `).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function aJ({notes:e}){return(0,H.jsx)(H.Fragment,{children:e.map((e,t)=>(0,H.jsx)(`p`,{className:`cs-dnote`,children:e},t))})}var oJ=[],sJ=(0,m.memo)(function({row:e,index:t,notes:n,form:r,onComment:i}){let a=e.text.trim(),o=()=>i(t);return(0,H.jsxs)(`li`,{"data-line":t,className:Y(`cs-dr`,!r&&`[contain-intrinsic-size:auto_2.75rem] [content-visibility:auto]`),children:[(0,H.jsxs)(`div`,{className:`cs-dln`,children:[(0,H.jsx)(`span`,{className:`cs-dd`,"aria-hidden":`true`,children:n.length>0?(0,H.jsx)(`i`,{}):null}),(0,H.jsx)(`div`,{className:Y(`cs-dtx`,e.fenced&&`font-mono text-[12.5px] whitespace-pre-wrap break-words`),"data-on":r?`true`:void 0,"data-k":/^#{1,6}\s/.test(a)?`h`:void 0,onClick:e=>!e.target.closest(`a`)&&o(),children:e.fenced?e.text:(0,H.jsx)(pV,{text:e.text})}),(0,H.jsx)(`button`,{type:`button`,className:`cs-dcb`,"aria-label":`Comment on this line: ${a}`,onClick:o,children:(0,H.jsx)(Gh,{"aria-hidden":`true`,className:`size-[15px]`})})]}),(0,H.jsx)(aJ,{notes:n}),r]})});function cJ({draft:e,comments:t,commenting:n,form:r,onComment:i}){let a=(0,m.useMemo)(()=>iJ(e),[e]),o=NB(a.length);return(0,H.jsx)(`ul`,{className:`cs-drl`,"aria-label":`Draft plan lines`,children:a.slice(0,o).map((e,a)=>e.text.trim()?(0,H.jsx)(sJ,{row:e,index:a,notes:t.get(e.text.trim())??oJ,form:a===n?r:void 0,onComment:i},a):(0,H.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},a))})}function lJ({notes:e}){return e.length===0?null:(0,H.jsx)(SW,{title:Hq,children:(0,H.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,H.jsx)(`dt`,{className:`w-20 shrink-0 font-semibold`,style:{color:GV(e.from)},children:XV(e.from)}),(0,H.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(pV,{text:e.text})})]},t))})})}function uJ(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function dJ({label:e,hint:t,buttonLabel:n=`Send`,onSend:r}){let i=(0,m.useId)(),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),l=async()=>{a.trim()&&!s&&(c(!0),await r(a)&&o(``),c(!1))};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,H.jsx)(eW,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{uJ(e)&&(e.preventDefault(),l())}}),t?(0,H.jsx)(`p`,{id:`${i}-hint`,className:`text-xs text-muted-foreground`,children:t}):null,(0,H.jsx)(`div`,{className:`flex self-end`,children:(0,H.jsx)(iB,{label:n,icon:s?zh:ym,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}function fJ({line:e,onCancel:t,onSent:n}){let r=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let e=r.current?.querySelector(`textarea`);e?.focus(),e?.scrollIntoView({block:`nearest`})},[]),(0,H.jsxs)(`div`,{ref:r,role:`group`,"aria-label":`Comment on this line`,className:`line-comment cs-dform`,children:[(0,H.jsx)(ZO,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Cancel the comment`,"data-tip":`Cancel`,"data-tip-keys":`Esc`,onClick:t,className:`absolute top-1.5 right-1.5 size-7`,children:(0,H.jsx)(l_,{"aria-hidden":`true`})}),(0,H.jsx)(dJ,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async t=>await G(`planner.commentLine`,{line:e,text:t.trim()})?(n(t.trim()),!0):!1})]})}function pJ({open:e,onClose:t,snap:n,comments:r,onSent:i}){let a=(0,m.useRef)(null),[o,s]=(0,m.useState)(),c=(0,m.useMemo)(()=>n.draft?iJ(n.draft):[],[n.draft]),l=o===void 0?void 0:c[o]?.text.trim(),u=()=>{let e=o;s(void 0),requestAnimationFrame(()=>a.current?.querySelector(`[data-line="${e}"] button[aria-label^="Comment on this line"]`)?.focus())};return(0,H.jsx)(dA,{open:e,onClose:()=>{s(void 0),t()},label:`Draft plan`,closeText:!0,onEscape:e=>{l!==void 0&&(e.preventDefault(),u())},head:(0,H.jsxs)(`div`,{className:`cs-shtitle`,children:[(0,H.jsx)(`h3`,{children:`Draft plan`}),(0,H.jsxs)(`p`,{children:[n.round>0?`${Gq(n.round,n.limit)} · `:``,`choose a line to comment on it`]})]}),children:(0,H.jsxs)(`div`,{ref:a,className:`flex flex-col gap-5`,children:[n.draft?(0,H.jsx)(cJ,{draft:n.draft,comments:r,commenting:l===void 0?void 0:o,form:l===void 0?void 0:(0,H.jsx)(fJ,{line:l,onCancel:u,onSent:e=>(i(l,e),u())},o),onComment:s}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.busy?Vq:Bq}),(0,H.jsx)(lJ,{notes:n.notes})]})})}function mJ({title:e,sub:t,aside:n,className:r,children:i}){let a=(0,m.useRef)(null);function o(e){let t=a.current;if(!t||e.defaultPrevented||e.nativeEvent.isComposing||_k()||e.altKey||e.ctrlKey||e.metaKey||Uk(e.target)||e.target instanceof HTMLInputElement)return;let n=Wk(e.key);n?(e.preventDefault(),Jk(t,e.target,n)):(e.key===`Home`||e.key===`End`)&&(e.preventDefault(),Jk(t,e.target,e.key===`Home`?`first`:`last`))}return(0,H.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,H.jsx)(`div`,{ref:a,"data-pane":`list`,className:`cs-scroll pb-dock`,onKeyDown:o,children:(0,H.jsxs)(`div`,{className:Y(`cs-pg`,r),children:[(0,H.jsxs)(`div`,{className:`cs-pgh`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`cs-hd1`,children:e}),t?(0,H.jsx)(`p`,{className:`cs-hd2`,children:t}):null]}),n?(0,H.jsx)(`div`,{className:`flex flex-none items-center gap-2`,children:n}):null]}),i]})}),(0,H.jsx)(Uv,{target:a})]})}function hJ({on:e,label:t,count:n,onToggle:r,describe:i}){return(0,H.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,"aria-label":i,className:`cs-chk`,onClick:r,children:[(0,H.jsx)(`span`,{className:`cs-cb`,"data-on":e?`true`:void 0,children:(0,H.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,H.jsx)(`path`,{d:`M5 12.5l4.5 4.5L19 7.5`})})}),t,n===void 0?null:(0,H.jsx)(`span`,{className:`cs-cn`,children:n})]})}var gJ=()=>Dk(Ek(`plan`,`previous`)),_J=e=>Dk(Ek(`plan`,`previous`,e));function vJ(e){let t=Date.now()-Date.parse(e);return Number.isFinite(t)?EH(Math.max(0,t)):``}function yJ(e,t){return[`${t} message${t===1?``:`s`}`,`round ${e.rounds}`,vJ(e.updatedAt)].filter(Boolean).join(` · `)}function bJ({plan:e,selected:t}){return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>_J(e.id),className:`cs-trw cs-prw`,children:[(0,H.jsxs)(`span`,{className:`cs-tt1`,children:[(0,H.jsx)(`span`,{className:`cs-t`,children:e.title}),(0,H.jsx)(`span`,{className:`cs-mt`,children:yJ(e,e.messages)})]}),e.hasDraft?(0,H.jsx)(`span`,{className:`cs-bdg`,"data-t":`acc`,children:`draft`}):(0,H.jsx)(`span`,{})]})})}function xJ({id:e,onGone:t}){let n=MV(`planner.previousGet`,{id:e},[`planner`]),r=n.data;if(!r)return n.error?(0,H.jsx)(jk,{message:`Could not load that plan. ${n.error}`,onRetry:n.reload}):null;let i=!!r.archivedAt,a=async()=>{await G(`planner.previousOpen`,{id:e})&&Dk(Ek(`plan`))},o=async()=>{await G(`planner.previousArchive`,{id:e,archived:!i})&&t()},s=async()=>{await G(`planner.previousDelete`,{id:e})&&t()};return(0,H.jsxs)(`article`,{className:`cs-dt flex flex-col`,"aria-label":r.title,children:[(0,H.jsxs)(aB,{className:`cs-abm`,children:[(0,H.jsx)(iB,{label:`Carry on planning`,text:`Carry on`,icon:hg,tone:`primary`,shortcut:`C`,onClick:()=>void a()}),(0,H.jsx)(iB,{label:i?`Bring it back from the archive`:`Archive`,text:i?`Unarchive`:`Archive`,icon:i?lm:dm,shortcut:`E`,onClick:()=>void o()}),(0,H.jsx)(TV,{icon:qg,label:`Delete`,shortcut:`Delete`,title:`Delete "${r.title}"?`,description:`The conversation and the draft are removed for good.`,confirmLabel:`Delete plan`,variant:`destructive`,onConfirm:()=>void s()})]}),(0,H.jsxs)(`header`,{children:[(0,H.jsx)(`h2`,{children:r.title}),(0,H.jsx)(`p`,{className:`cs-sub`,children:[i?`archived`:``,yJ(r,r.messages.length),r.seed??``].filter(Boolean).join(` · `)})]}),(0,H.jsxs)(SW,{title:`Draft plan`,children:[r.draft?(0,H.jsx)(pV,{text:r.draft}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The panel had not written a draft yet.`}),(0,H.jsx)(lJ,{notes:r.notes})]}),(0,H.jsx)(SW,{title:`Conversation`,children:(0,H.jsx)(`div`,{className:`cs-pvc`,children:(0,H.jsx)(Rq,{messages:r.messages,readOnly:!0})})})]})}function SJ({id:e}){let[t,n]=(0,m.useState)(!1),r=MV(`planner.previous`,t?{archived:!0}:{},[`planner`]),i=r.data?.plans??[];if(!r.data&&r.error)return(0,H.jsx)(jk,{message:`Could not load the previous plans. ${r.error}`,onRetry:r.reload});let a=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(iB,{label:`Back to the current plan`,text:`Back`,icon:hm,onClick:()=>Dk(Ek(`plan`))}),(0,H.jsx)(hJ,{on:t,label:`Archived`,describe:t?`Show the previous plans`:`Show the archived plans`,onToggle:()=>{n(e=>!e),gJ()}})]}),o=r.data?i.length===0?(0,H.jsx)(`p`,{className:`px-2.5 py-6 text-sm text-muted-foreground`,children:t?`No archived plans.`:`No previous plans. A plan you leave without saving it as a task waits here; one saved as a task is in the Tasks tab.`}):(0,H.jsx)(`ul`,{className:`cs-lst`,"aria-label":t?`Archived plans`:`Previous plans`,children:i.map(t=>(0,H.jsx)(bJ,{plan:t,selected:t.id===e},t.id))}):(0,H.jsx)(nA,{});return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mJ,{title:t?`Archived plans`:`Previous plans`,sub:r.data?`${i.length} ${i.length===1?`plan`:`plans`}`:void 0,className:`cs-ts`,aside:a,children:o}),(0,H.jsx)(dA,{open:e!==void 0,onClose:gJ,label:`A previous plan`,className:`cs-tdw`,children:e?(0,H.jsx)(xJ,{id:e,onGone:()=>{r.reload(),gJ()}},e):null})]})}function CJ({snap:e,onDone:t}){let n=(0,m.useRef)(null);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{ref:n,className:`cs-scroll pb-dock`,children:(0,H.jsxs)(`div`,{className:`cs-pg cs-intro cs-blank`,children:[(0,H.jsx)(`h2`,{children:`What are we planning?`}),(0,H.jsx)(`p`,{children:`Describe it below. The panel asks what it needs, then drafts the plan.`})]})}),(0,H.jsx)(Uv,{target:n}),(0,H.jsx)(rJ,{snap:e,onDone:t})]})}function wJ(e,t){let n=(0,m.useRef)(t);n.current=t;let r=(0,m.useCallback)(()=>n.current(),[]);lA(`v`,r,{enabled:!!e.draft}),zA(e.draft?r:void 0)}function TJ({snap:e,reload:t}){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(new Map);wJ(e,()=>r(!0));let o=(e,t)=>a(n=>new Map(n).set(e,[...n.get(e)??[],t])),{ref:s,onScroll:c}=HV(`${JSON.stringify(e.messages)}${e.busy}`);return(0,H.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{ref:s,onScroll:c,className:`cs-thread min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pb-dock`,children:[(0,H.jsx)($q,{snap:e}),(0,H.jsx)(Rq,{messages:e.messages,busy:e.busy})]}),(0,H.jsx)(Uv,{target:s}),(0,H.jsx)(rJ,{snap:e,onDone:t}),(0,H.jsx)(pJ,{open:n,onClose:()=>r(!1),snap:e,comments:i,onSent:o})]})}function EJ({rest:e=[]}){return e[0]===`previous`?(0,H.jsx)(SJ,{id:e[1]}):(0,H.jsx)(DJ,{})}function DJ(){let e=MV(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,H.jsx)(jk,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,H.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=qq(t);return(0,H.jsx)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:n?(0,H.jsx)(CJ,{snap:t,onDone:e.reload}):(0,H.jsx)(TJ,{snap:t,reload:e.reload})})}var OJ={},kJ=new Set;function AJ(e){OJ=e;for(let e of[...kJ])e()}function jJ(e){OJ.taskId!==e&&AJ({...OJ,taskId:e})}function MJ(e){return kJ.add(e),()=>{kJ.delete(e)}}function NJ(){return(0,m.useSyncExternalStore)(MJ,()=>OJ,()=>OJ)}function PJ(e,t=0,n=!1){let r=!n&&!e.waiting&&!!e.runningSince,i=r?Date.parse(e.serverNow)-Date.parse(e.runningSince):0;return Math.max(0,e.elapsedMs)+(Number.isFinite(i)?Math.max(0,i):0)+(r?Math.max(0,t):0)}function FJ(e){let t=Math.floor(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function IJ(e,t){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),!e)return;let t=performance.now(),n=window.setInterval(()=>r(performance.now()-t),1e3);return()=>window.clearInterval(n)},[e,t]),e?n:0}function LJ({timing:e,stopped:t}){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),t||e.waiting||!e.runningSince)return;let n=performance.now(),i=window.setInterval(()=>r(performance.now()-n),1e3);return()=>window.clearInterval(i)},[e,t]),(0,H.jsxs)(`span`,{className:`tabular-nums break-words`,children:[e.waiting?`Waiting for you · `:``,FJ(PJ(e,n,t)),` execution`]})}function RJ({work:e,timing:t,stopped:n}){let r=e.running&&!n&&!t?.waiting,i=IJ(r,e);return(0,H.jsxs)(`span`,{className:`tabular-nums break-words`,"data-work-clock":r?`running`:`stopped`,children:[t?.waiting?`Waiting for you · `:``,`worked `,FJ(e.workedMs+i)]})}function zJ({timing:e,work:t,stopped:n=!1}){return t?(0,H.jsx)(RJ,{work:t,...e?{timing:e}:{},stopped:n}):e?(0,H.jsx)(LJ,{timing:e,stopped:n},JSON.stringify(e)):(0,H.jsx)(`span`,{children:`Timing unavailable`})}var BJ=`This merges the reviewed commit into main and pushes main, then removes the task worktree after verifying the merge. The task branch is kept.`,VJ={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`},HJ={passing:`passing`,failing:`failing`,pending:`pending`,absent:`none`,unavailable:`unavailable`,stale:`out of date`};function UJ({delivery:e,title:t,state:n}){let r=e.verification;return(0,H.jsxs)(`div`,{className:`cs-dlv`,children:[(0,H.jsxs)(`p`,{className:`cs-dlvt`,children:[(0,H.jsx)(`span`,{children:t}),(0,H.jsx)(`span`,{role:`status`,className:`cs-dlvst`,children:n})]}),(0,H.jsxs)(`dl`,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Branch`}),(0,H.jsxs)(`dd`,{children:[e.sourceBranch,` → main`]})]}),e.sourceCommit?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Commit`}),(0,H.jsxs)(`dd`,{children:[e.sourceCommit,e.targetCommit?` onto ${e.targetCommit}`:``]})]}):null,e.repository?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Repository`}),(0,H.jsx)(`dd`,{children:e.repository})]}):null,r?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Checks`}),(0,H.jsxs)(`dd`,{title:r.summary,children:[HJ[r.checks],` · local QA `,r.localVerified?`passed`:`not verified`,r.requiredChecks.length?` · needs ${r.requiredChecks.join(`, `)}`:``]})]}):null]})]})}function WJ(e,t){let n=[t??e.error,e.cleanupError,e.blocked.create_pr,e.blocked.merge_main].filter(e=>!!e);return[...new Set(n.map(e=>e.trim()))]}function GJ(e,t){return t.blocked[e]||t.status===`in_progress`?!1:t.status!==`successful`||e===`merge_main`&&!!t.cleanupError}async function KJ(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?R(`tasks.deliveryReview`,{taskId:t}):e===`defer`?R(`tasks.deliveryDefer`,r):R(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function qJ({taskId:e,delivery:t}){let[n,r]=(0,m.useState)(t),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(null),d=fe(),f=`${d}:${e}`,p=(0,m.useRef)(f);return p.current=f,(0,m.useEffect)(()=>(p.current=f,()=>{p.current=``}),[f]),(0,m.useEffect)(()=>{r(t),l(!1)},[t,e]),{current:n,setCurrent:r,busy:i,setBusy:a,error:o,setError:s,confirm:c,setConfirm:l,trigger:u,project:d,identity:f,scope:p}}function JJ(e){return e.scope.current===e.identity&&e.project===fe()}function YJ(e,t){let n=(0,m.useRef)(!1);async function r(r){if(!(n.current||r===`merge_main`&&!e.confirm)){n.current=!0,e.setBusy(!0),e.setError(void 0),e.setConfirm(!1);try{let n=await KJ(r,t.taskId,e.current.reviewId);JJ(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){JJ(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function XJ(e){let t=qJ(e),n=YJ(t,e),r=gk(t.confirm,hk.confirm),i=t.current.status===`successful`||t.current.status===`in_progress`;function a(){t.trigger.current=document.activeElement,t.setConfirm(!0)}return{...t,request:n,slot:r,terminal:i,reviewMerge:a}}function ZJ({review:e}){let t=e.current,n=WJ(t,e.error);return(0,H.jsxs)(H.Fragment,{children:[n.length?(0,H.jsx)(`ul`,{role:`alert`,className:`cs-dlvp`,children:n.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(zm,{"aria-hidden":`true`}),e]},e))}):null,t.result?(0,H.jsxs)(`p`,{className:`cs-dlvs break-all`,children:[t.result.action===`create_pr`?`PR #${t.result.pullNumber??``} created`:`main pushed · ${t.result.commit??``}`,t.result.pullUrl?(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(`a`,{href:t.result.pullUrl,target:`_blank`,rel:`noreferrer`,children:t.result.pullUrl})]}):null,t.operation?.worktreeRemoved?` · worktree removed`:``]}):null]})}function QJ({review:e}){let t=e.current,n=t.status===`successful`&&!!t.cleanupError;return(0,H.jsxs)(`div`,{className:`cs-dlva`,children:[GJ(`create_pr`,t)?(0,H.jsx)(ZO,{variant:`outline`,size:`sm`,disabled:e.busy,onClick:()=>void e.request(`create_pr`),...qz(`Pushes the task branch and opens a PR to main. Does not merge.`),children:`Create PR`}):null,GJ(`merge_main`,t)?(0,H.jsx)(ZO,{variant:`outline`,size:`sm`,disabled:e.busy,onClick:e.reviewMerge,...qz(n?`Removes the kept worktree. Asks first.`:`Merges into main, pushes, then removes the worktree. Asks first.`),children:n?`Retry worktree cleanup`:`Merge to main`}):null,(0,H.jsxs)(ZO,{variant:`ghost`,size:`sm`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:[(0,H.jsx)(yg,{"aria-hidden":`true`}),`Refresh`]}),e.terminal?null:(0,H.jsx)(ZO,{variant:`ghost`,size:`sm`,disabled:e.busy,onClick:()=>void e.request(`defer`),children:`Not now`})]})}function $J({review:e}){let t=e.current.status===`successful`&&!!e.current.cleanupError,n=t?`Main was already delivered. Remove the task worktree if it still contains only the reviewed commit. The task branch is kept.`:BJ;return(0,H.jsx)(ck,{open:e.slot,onOpenChange:e.setConfirm,label:t?`Confirm worktree removal`:`Confirm merge to main`,description:n,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,H.jsxs)(`div`,{className:`grid gap-3 p-4`,children:[(0,H.jsx)(`h3`,{className:`font-medium`,children:t?`Remove task worktree?`:`Merge to main?`}),(0,H.jsx)(`p`,{className:`text-sm`,children:n}),(0,H.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,H.jsx)(ZO,{variant:`outline`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,H.jsx)(ZO,{disabled:e.busy||!!e.current.blocked.merge_main||e.terminal&&!t,onClick:()=>void e.request(`merge_main`),children:t?`Confirm worktree removal`:`Confirm merge and push main`})]})]})})}function eY({title:e,review:t}){let n=t.current,r=n.status===`pending_approval`&&WJ(n,t.error).length>0,i=t.busy?`Updating…`:n.operation&&n.status===`in_progress`?n.operation.stage:r?`Needs a fix first`:VJ[n.status];return(0,H.jsxs)(SW,{title:`Delivery`,children:[(0,H.jsxs)(`div`,{className:`cs-sunkbox grid gap-3`,children:[(0,H.jsx)(UJ,{delivery:t.current,title:e,state:i}),(0,H.jsx)(ZJ,{review:t}),(0,H.jsx)(QJ,{review:t})]}),(0,H.jsx)($J,{review:t})]})}function tY(e){let t=XJ(e);return(0,H.jsx)(eY,{title:e.title,review:t})}var nY={open:Zm,delivered:Gm,addressed:Vm},rY={open:`waiting for the owning session`,delivered:`sent to the orchestrator`,addressed:`plan amended`};function iY({comment:e}){let t=EH(Date.now()-Date.parse(e.createdAt)),n=nY[e.status];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{"aria-hidden":`true`,className:`size-3.5`}),rY[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function aY({comment:e,taskId:t,own:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??``)>(e.editedAt??``)?a:e;return(0,H.jsxs)(`li`,{className:`cs-cmc`,children:[r?(0,H.jsx)(jq,{text:s.text,onSave:async n=>{let r=await R(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,H.jsx)(pV,{text:s.text}),(0,H.jsxs)(`div`,{className:`cs-cmeta`,"data-s":s.status,children:[(0,H.jsx)(iY,{comment:s}),n&&!r?(0,H.jsx)(`button`,{type:`button`,className:`cs-eb`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function oY({taskId:e,onAdded:t}){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(!1),c=(0,m.useId)();if(!n)return(0,H.jsxs)(ZO,{size:`sm`,variant:`outline`,className:`w-fit`,onClick:()=>r(!0),children:[(0,H.jsx)(Gh,{"aria-hidden":`true`}),`Add comment`]});let l=async()=>{if(o||!i.trim())return;s(!0);let n=await G(`tasks.comment`,{taskId:e,text:i.trim()})!==void 0;s(!1),n&&(a(``),r(!1),t())};return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`label`,{htmlFor:c,className:`sr-only`,children:`Your comment`}),(0,H.jsx)(`textarea`,{id:c,autoFocus:!0,className:`cs-ta2`,placeholder:`Your comment`,value:i,disabled:o,onChange:e=>a(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),r(!1)):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),l()))}}),(0,H.jsxs)(`div`,{className:`cs-fa`,children:[(0,H.jsx)(`span`,{className:`cs-hint2`,children:`Enter adds the comment · Esc cancels`}),(0,H.jsx)(ZO,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>r(!1),children:`Cancel`}),(0,H.jsx)(ZO,{size:`sm`,disabled:o||!i.trim(),onClick:()=>void l(),children:`Add comment`})]})]})}function sY({taskId:e,finished:t,canComment:n}){let r=MV(`tasks.comments`,{taskId:e},[`tasks`]),i=Vk(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,H.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`cs-sec flex flex-col gap-3`,children:[(0,H.jsxs)(`h3`,{id:`comments-${e}`,className:`cs-rl`,children:[`Comments`,o>0?(0,H.jsxs)(`span`,{className:`cs-rr`,children:[o,` open`]}):null]}),a.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`No comments.`:n?`No comments yet. Comment on the plan here or in the box below (Markdown and images work there); the orchestrator amends it.`:`No comments yet.`}):(0,H.jsx)(`ul`,{className:`cs-cm`,children:a.map(t=>(0,H.jsx)(aY,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))}),n?(0,H.jsx)(oY,{taskId:e,onAdded:r.reload}):null]})}var cY={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},lY={open:`open`,done:`done`,dropped:`abandoned`},uY={none:{label:`None`,depth:`nothing that runs changed: the engine's checks decide, no QA agent`,tone:``},low:{label:`Low`,depth:`a light check: the diff, the nearest tests, done once confident`,tone:`ok`},medium:{label:`Medium`,depth:`a standard check: the acceptance criteria and realistic regressions`,tone:`warn`},high:{label:`High`,depth:`a deep, adversarial review: invariants, recovery and everything the change reaches`,tone:`bad`}};function dY(e){let t=e.source===`classifier`?`Jev`:`rules`;if(!e.qaRequired)return`${t} · no QA agent`;let{min:n,max:r}=e.testBudget;return`${t} · ${n===r?r:`${n}-${r}`} new tests at most`}var fY=`Nothing archived. Archive a finished task from its detail to keep this list short.`,pY=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function mY(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function hY(e){return e===`now`?`just now`:`${e} ago`}function gY(e){if(e.kind===`plan`)return[`planned`,e.age?e.age===`now`?`saved just now`:`saved ${e.age} ago`:``,e.issue?`#${e.issue}`:``].filter(Boolean).join(` · `);let t=e.owner??(e.section===`mine`?`this session`:``);return[mY(e.status,e.paused),t].filter(Boolean).join(` · `)}function _Y(e){let t=[];for(let n of e){let e=t.at(-1);e&&e.section===n.section?e.rows.push(n):t.push({section:n.section,rows:[n]})}return t}var vY=1e3;function yY({taskId:e,index:t,text:n,onSkipped:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(``),f=gk(i,hk.confirm),p=(0,m.useId)(),h=(0,m.useId)(),g=o.trim(),_=e=>{c||(a(e),s(``),d(``))},v=async()=>{if(g&&!c){l(!0),d(``);try{W((await R(`tasks.skipStep`,{taskId:e,step:t,text:n,reason:g})).notice),a(!1),s(``),r()}catch(e){d(e instanceof Error?e.message:`That did not work. Try again.`)}finally{l(!1)}}};return(0,H.jsxs)(_V,{open:i&&f,onOpenChange:_,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-label":`Skip step ${t+1}`,onClick:()=>_(!0),className:`cs-skp step-skip`,children:[(0,H.jsx)(Fg,{"aria-hidden":`true`,className:`size-3.5`}),`Skip`]}),(0,H.jsxs)(vV,{children:[(0,H.jsxs)(yV,{children:[(0,H.jsxs)(xV,{children:[`Skip step `,t+1,`?`]}),(0,H.jsx)(SV,{children:`The orchestrator is told to carry on without it, and your reason stays with the step in the task's history.`})]}),(0,H.jsx)(`p`,{className:`rounded-md bg-muted px-2.5 py-1.5 text-sm break-words`,children:n}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`label`,{htmlFor:p,className:`text-sm font-medium`,children:`Why skip it?`}),(0,H.jsx)(eW,{id:p,value:o,autoFocus:!0,required:!0,maxLength:vY,disabled:c,"aria-describedby":h,"aria-invalid":u?!0:void 0,placeholder:`Already done by hand, not needed any more, out of scope…`,className:`max-h-48 min-h-20`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())}}),(0,H.jsx)(`p`,{id:h,className:`text-xs text-muted-foreground`,children:`A reason is required.`})]}),u?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:u}):null,(0,H.jsxs)(bV,{children:[(0,H.jsx)(wV,{disabled:c,children:`Cancel`}),(0,H.jsx)(ZO,{disabled:!g||c,"aria-busy":c,onClick:()=>void v(),children:c?`Skipping…`:`Skip step`})]})]})]})}function bY({step:e,stopped:t}){let n=IJ(!t,e);return(0,H.jsx)(`span`,{className:`tabular-nums`,children:FJ((e.workedMs??0)+n)})}function xY(e){return(e.split(`
106
- `).find(e=>e.trim())?.trim()??``).replace(/^steps?\s+\d+(?:\s*[-–]\s*\d+)?\s*[:.\-–]\s*/i,``).replace(/^\*\*?goal\*\*?\s*[:\-–]\s*/i,``)}var SY=e=>eH({domain:e.domain});function CY({id:e,agents:t,stepText:n}){let[r,i]=(0,m.useState)(Date.now);(0,m.useEffect)(()=>{let e=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let a=t.filter(e=>!e.parentRunId||!t.some(t=>t.runId===e.parentRunId)).flatMap(e=>[e,...t.filter(t=>t.parentRunId===e.runId)]);return(0,H.jsx)(`ul`,{id:e,"aria-label":`Agents on this step`,className:`cs-arows`,children:a.map(e=>{let i=SY(e),a=!!e.parentRunId&&t.some(t=>t.runId===e.parentRunId),o=Date.parse(e.startedAt),s=xY(e.instruction),c=s&&s.toLowerCase()!==n.trim().toLowerCase()?s:``;return(0,H.jsxs)(`li`,{className:`cs-arow`,"data-child":a?`true`:void 0,style:{"--ac":GV(i)},children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`cs-bt`}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`cs-be`}),(0,H.jsxs)(`span`,{className:`cs-ab2`,children:[(0,H.jsxs)(`span`,{className:`cs-ab2h`,children:[(0,H.jsx)(`b`,{children:XV(i)}),a?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`child`}):null,(0,H.jsx)(`span`,{className:`cs-live`,children:`working`})]}),c?(0,H.jsx)(`span`,{className:`cs-br`,title:e.instruction,children:c}):null]}),Number.isFinite(o)?(0,H.jsx)(`span`,{className:`cs-tm`,children:FJ(Math.max(0,r-o))}):null]},e.runId)})})}function wY({agents:e,count:t,step:n,stopped:r}){let i=[...new Set(e.map(SY))].slice(0,3);return(0,H.jsxs)(H.Fragment,{children:[i.length>0?(0,H.jsx)(`span`,{className:`cs-avs`,"aria-hidden":`true`,children:i.map(e=>(0,H.jsx)(`i`,{style:{"--ac":GV(e)},children:XV(e)[0]},e))}):null,(0,H.jsxs)(`span`,{className:`cs-cn1`,children:[t,` `,r?t===1?`agent`:`agents`:`working`]}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`cs-dm`,children:`·`}),(0,H.jsx)(bY,{step:n,stopped:r})]})}function TY(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function EY({step:e,index:t}){let n=e.skip?TY(e.skip.at):``;return(0,H.jsxs)(`li`,{className:`cs-stp`,"data-k":`skip`,"data-step":`skipped`,children:[(0,H.jsxs)(`div`,{className:`cs-stpa`,children:[(0,H.jsx)(bH,{mark:`skip`}),(0,H.jsxs)(`span`,{className:`cs-n`,children:[t+1,`.`]}),(0,H.jsx)(`span`,{className:`cs-tx`,children:e.text}),(0,H.jsx)(`span`,{className:`cs-skd`,children:`skipped`})]}),e.skip?(0,H.jsxs)(`p`,{className:`cs-why step-skip-reason`,children:[(0,H.jsx)(`b`,{children:`Why: `}),e.skip.reason,n?(0,H.jsxs)(`span`,{className:`text-[var(--faint)]`,children:[` · `,n]}):null]}):null]})}function DY({step:e,index:t,stopped:n,skip:r}){let i=!!e.active&&!n,a=i?e.agents??[]:[],o=a.length||(e.activeAgentCount??1),[s,c]=(0,m.useState)(!0),l=(0,m.useId)(),u=e.status===`done`;if(e.status===`skipped`)return(0,H.jsx)(EY,{step:e,index:t});let d=e.status===`current`&&!n;return(0,H.jsxs)(`li`,{className:`cs-stp`,"data-k":i?`now`:u?`done`:d?`next`:`todo`,"data-step":i?`active`:e.status,children:[(0,H.jsxs)(`div`,{className:`cs-stpa`,children:[(0,H.jsx)(bH,{mark:i?`now`:u?`done`:`open`}),(0,H.jsxs)(`span`,{className:`cs-n`,children:[t+1,`.`]}),(0,H.jsx)(`span`,{className:`cs-tx`,children:e.text}),i?(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":a.length>0?s:void 0,"aria-controls":a.length>0?l:void 0,disabled:a.length===0,onClick:()=>c(e=>!e),className:`cs-abdg`,children:[(0,H.jsx)(wY,{agents:a,count:o,step:e,stopped:n}),a.length>0?(0,H.jsx)(jm,{"aria-hidden":`true`,className:`size-3`}):null,(0,H.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):d?(0,H.jsxs)(`span`,{className:`cs-nx`,children:[`next`,(0,H.jsx)(`span`,{className:`sr-only`,children:` (the step up next)`})]}):null,r&&!u&&!n?(0,H.jsx)(yY,{taskId:r.taskId,index:t,text:e.text,onSkipped:r.onSkipped}):null]}),s&&a.length>0?(0,H.jsx)(CY,{id:l,agents:a,stepText:e.text}):null]})}function OY({steps:e,stopped:t,skip:n}){let r=e.filter(e=>e.status===`skipped`).length;return(0,H.jsx)(SW,{title:`Steps`,...r?{right:`${r} skipped`}:{},children:(0,H.jsx)(`ol`,{className:`cs-stl`,"aria-label":`Steps`,children:e.map((e,r)=>(0,H.jsx)(DY,{step:e,index:r,stopped:t,skip:n},`${r}-${e.text}`))})})}function kY({text:e,title:t=`Full plan`,label:n=`Read the details of each step`}){let[r,i]=(0,m.useState)(!1),a=(0,m.useId)();return(0,H.jsxs)(SW,{title:t,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(e=>!e),className:`cs-fold w-fit`,children:[(0,H.jsx)(Fm,{"aria-hidden":`true`,className:`size-4`}),r?`Hide the details`:n]}),r?(0,H.jsx)(`div`,{id:a,className:`cs-fpb`,children:(0,H.jsx)(pV,{text:e})}):null]})}function AY({detail:e,finished:t}){return e.plan&&e.planDetails?(0,H.jsx)(kY,{text:e.planDetails}):e.plan?(0,H.jsx)(SW,{title:`Approved plan`,children:(0,H.jsx)(pV,{text:e.plan})}):e.proposal?(0,H.jsx)(SW,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,H.jsx)(pV,{text:e.proposal})}):(0,H.jsx)(SW,{title:`Plan`,children:(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`It ended before a plan was made.`:`No proposal or plan yet — the orchestrator is still clarifying or scouting.`})})}function jY({amendments:e}){return e.length===0?null:(0,H.jsx)(SW,{title:`Amendments`,children:(0,H.jsx)(`ul`,{className:`cs-bl`,children:e.map(e=>(0,H.jsx)(`li`,{className:`break-words`,children:e},e))})})}function MY({risk:e}){let t=uY[e.risk];return(0,H.jsx)(SW,{title:`QA risk`,right:dY(e),children:(0,H.jsxs)(`div`,{className:`cs-qa`,"data-qa-risk":e.risk,children:[(0,H.jsxs)(`p`,{className:`cs-qa1`,children:[(0,H.jsx)(`span`,{className:`cs-bdg`,"data-t":t.tone,children:t.label}),(0,H.jsx)(`span`,{className:`min-w-0 text-muted-foreground`,children:t.depth})]}),e.qaRequired?(0,H.jsxs)(`p`,{className:`cs-qat`,"data-ok":e.existingTestsLikelySufficient||void 0,children:[e.existingTestsLikelySufficient?(0,H.jsx)(km,{"aria-hidden":`true`}):(0,H.jsx)(l_,{"aria-hidden":`true`}),e.existingTestsLikelySufficient?`Existing tests likely cover it`:`Existing tests likely not enough`]}):null,e.focusAreas.length>0?(0,H.jsxs)(`div`,{className:`cs-qag`,children:[(0,H.jsx)(`h4`,{children:`Check first`}),(0,H.jsx)(`ol`,{"aria-label":`What QA looks at first`,children:e.focusAreas.map(e=>(0,H.jsx)(`li`,{children:e},e))})]}):null,e.riskFactors.length>0?(0,H.jsxs)(`div`,{className:`cs-qag`,"data-why":``,children:[(0,H.jsx)(`h4`,{children:`Why`}),(0,H.jsx)(`ul`,{"aria-label":`What the change touches`,children:e.riskFactors.map(e=>(0,H.jsx)(`li`,{children:e},e))})]}):null]})})}function NY(e){let t=e.charAt(0),n=t===`✓`?`ok`:t===`✗`?`bad`:t===`◐`?`live`:`off`,r=/^[✓✗◐·]\s/.test(e)?e.slice(2):e,i=r.indexOf(` — `),[a=``,...o]=(i>=0?r.slice(0,i):r).split(` · `);return{state:n,who:a,meta:o.join(` · `),why:i>=0?r.slice(i+3):``}}var PY={ok:km,bad:l_,live:zh,off:$h},FY={ok:`succeeded`,bad:`failed`,live:`running`,off:`cancelled`};function IY({runs:e}){if(e.length===0)return null;let t=e.filter(e=>e.startsWith(`✗`)).length;return(0,H.jsx)(SW,{title:`Recent runs`,...t?{right:`${t} failed`}:{},children:(0,H.jsx)(`ul`,{className:`cs-runs`,children:[...e].reverse().map((e,t)=>{let n=NY(e),r=PY[n.state];return(0,H.jsxs)(`li`,{"data-s":n.state,title:e,children:[(0,H.jsx)(r,{"aria-hidden":`true`,className:`cs-runi`}),(0,H.jsxs)(`span`,{className:`sr-only`,children:[FY[n.state],`: `]}),(0,H.jsx)(`b`,{children:n.who}),(0,H.jsx)(`span`,{className:`cs-runm`,children:n.meta}),n.why?(0,H.jsx)(`span`,{className:`cs-runw`,children:n.why}):null]},`${t}-${e}`)})})})}var LY=`
107
-
108
- Agreed plan (from the planning session):
109
- `;function RY({request:e}){let t=e.indexOf(LY),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+43).trim():``;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(SW,{title:`Request`,children:(0,H.jsx)(pV,{text:n})}),r?(0,H.jsx)(kY,{text:r,title:`Agreed plan`,label:`Show the agreed plan`}):null]})}function zY({detail:e,finished:t,skip:n}){return(0,H.jsxs)(H.Fragment,{children:[e.steps.length>0?(0,H.jsx)(OY,{steps:e.steps,stopped:t,skip:n}):null,e.request?(0,H.jsx)(RY,{request:e.request}):null,(0,H.jsx)(AY,{detail:e,finished:t})]})}function BY({detail:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(jY,{amendments:e.amendments}),e.qaRisk?(0,H.jsx)(MY,{risk:e.qaRisk}):null]})}function VY({row:e,quiet:t=!1}){let n=(0,m.useRef)(!0);(0,m.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);async function r(){if(e.section===`mine`)return Dk(`#/lobby`);let t=fe(),r=()=>n.current&&fe()===t;try{let t=await R(`tasks.open`,{taskId:e.id});if(!r())return;let n=await R(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return Dk(`#/lobby`);if(t.sessionId&&!t.key)return W.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return W.info(`The orchestrator is working in this window. Stop it first, then open the task in its session.`);await G(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&Dk(`#/lobby`)}catch(e){r()&&W.error(e instanceof Error?e.message:String(e))}}let i=e.section===`mine`;return(0,H.jsx)(iB,{label:i?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:_m,tone:t?`neutral`:`primary`,shortcut:`S`,onClick:()=>void r()})}function HY({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,H.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,H.jsxs)(`span`,{children:[n>0?(0,H.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,H.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function UY({planId:e}){let t=MV(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,H.jsxs)(H.Fragment,{children:[n.issue?(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,H.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,H.jsx)(HY,{split:n.split}):null,(0,H.jsx)(SW,{title:`Agreed plan`,children:(0,H.jsx)(pV,{text:n.brief})})]}):t.error?(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function WY({row:e,onGone:t}){let n=async n=>{await G(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await G(`plans.discard`,{planId:e.id})&&t()};return(0,H.jsxs)(aB,{children:[(0,H.jsx)(iB,{label:`Start here`,icon:hg,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,H.jsx)(iB,{label:`Start in a new session`,text:`New session`,icon:zg,shortcut:`N`,onClick:()=>void n(`session`)}),(0,H.jsx)(TV,{icon:qg,label:`Discard`,shortcut:`Delete`,title:`Discard "${e.title}"?`,description:`The saved plan is removed from the list. This cannot be undone.`,confirmLabel:`Discard`,variant:`destructive`,onConfirm:()=>void r()})]})}function GY({row:e}){return(0,H.jsxs)(`article`,{className:`cs-dt flex min-w-0 flex-col`,"aria-label":e.title,children:[(0,H.jsxs)(`header`,{children:[(0,H.jsxs)(`h2`,{children:[(0,H.jsx)(xH,{check:`open`}),(0,H.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,H.jsxs)(`p`,{className:`cs-sub`,children:[(0,H.jsx)(`span`,{className:`cs-bdg`,children:`planned`}),e.age?(0,H.jsxs)(`span`,{children:[`saved `,hY(e.age)]}):null]}),(0,H.jsx)(`p`,{className:`cs-ids`,children:e.id})]}),(0,H.jsx)(UY,{planId:e.id})]})}function KY({row:e,onResumed:t}){let[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(!0);(0,m.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);async function a(){let n=fe();r(!0);try{let r=await R(`tasks.resume`,{taskId:e.id});if(fe()!==n)return;W(r.notice,{action:{label:`View task`,onClick:()=>Dk(Ek(`tasks`,e.id))}}),t()}catch(e){fe()===n&&W.error(e instanceof Error?e.message:String(e))}finally{i.current&&r(!1)}}let o=e.owner===`not running`;return(0,H.jsx)(iB,{label:o?`Resume: carry it on in a background session`:`Resume: unpause it where it runs`,text:`Resume`,icon:hg,tone:`primary`,shortcut:`R`,disabled:n,onClick:()=>void a()})}function qY(e){return e instanceof Error?e.message:`That did not work. Try again.`}function JY({run:e,onDone:t}){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``);return{open:n,change:e=>{o||(r(e),a(``),l(``))},typed:i,setTyped:a,busy:o,error:c,submit:async()=>{s(!0),l(``);try{W((await e(i)).notice),r(!1),t()}catch(e){l(qY(e))}finally{s(!1)}}}}function YY({expected:e,value:t,onChange:n,disabled:r}){let i=(0,m.useId)();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium`,children:`Type the task's title to confirm`}),(0,H.jsx)(`p`,{className:`break-words rounded-md bg-muted px-2 py-1 font-mono text-xs select-all`,children:e}),(0,H.jsx)(QU,{id:i,value:t,disabled:r,autoComplete:`off`,spellCheck:!1,onChange:e=>n(e.target.value)})]})}function XY(e){let t=JY(e),n=gk(t.open,hk.confirm),r=e.typeToConfirm!==void 0&&t.typed!==e.typeToConfirm,i=e.tone??`neutral`;return(0,H.jsxs)(_V,{open:t.open&&n,onOpenChange:t.change,children:[(0,H.jsx)(iB,{label:e.label,icon:e.icon,tone:i,onClick:()=>t.change(!0)}),(0,H.jsxs)(vV,{children:[(0,H.jsxs)(yV,{children:[(0,H.jsx)(xV,{children:e.title}),(0,H.jsx)(SV,{children:e.description})]}),e.typeToConfirm===void 0?null:(0,H.jsx)(YY,{expected:e.typeToConfirm,value:t.typed,onChange:t.setTyped,disabled:t.busy}),t.error?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:t.error}):null,(0,H.jsxs)(bV,{children:[(0,H.jsx)(wV,{disabled:t.busy,children:`Cancel`}),(0,H.jsx)(ZO,{variant:i===`danger`?`destructive`:`default`,disabled:r||t.busy,"aria-busy":t.busy,onClick:()=>void t.submit(),children:t.busy?`Working…`:e.confirmLabel})]})]})]})}function ZY({taskId:e,item:t,onDone:n}){let r=n=>()=>R(`tasks.resolveApproval`,{taskId:e,approvalId:t.id,decision:n}),i=`${t.kind}${t.domain?` for ${t.domain}`:``}`;return(0,H.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,children:[(0,H.jsx)(XY,{label:`Approve`,icon:km,title:`Approve the ${i}?`,description:`${t.detail} The task's orchestrator is told and carries on with it.`,confirmLabel:`Approve`,run:r(`approved`),onDone:n}),(0,H.jsx)(XY,{label:`Reject`,icon:l_,tone:`danger`,title:`Reject the ${i}?`,description:`${t.detail} The task's orchestrator is told and works without it.`,confirmLabel:`Reject`,run:r(`rejected`),onDone:n})]})}function QY({taskId:e,item:t,live:n,onDone:r}){return(0,H.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 basis-60 gap-2`,children:[(0,H.jsx)(zm,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-[var(--warn)]`}),(0,H.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[t.kind,` `,t.detail]})]}),n&&t.id?(0,H.jsx)(ZY,{taskId:e,item:t,onDone:r}):null]})}function $Y({blockers:e}){return e.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex gap-2`,children:[(0,H.jsx)(Ym,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-[var(--bad)]`}),(0,H.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))}function eX({row:e,detail:t,onChanged:n}){let r=e.id;return(0,H.jsxs)(`div`,{className:`cs-wacts`,children:[e.resumable?(0,H.jsx)(KY,{row:e,onResumed:n}):null,t.canAccept?(0,H.jsx)(XY,{label:`Accept as is`,icon:Ng,title:`Accept "${e.title}" as is?`,description:`You accept the work unverified: missing QA and lint checks are waived on your word. The task's orchestrator is asked to complete it; nothing is merged.`,confirmLabel:`Accept as is`,run:()=>R(`tasks.accept`,{taskId:r}),onDone:n}):null,t.canForceClose?(0,H.jsx)(XY,{label:`Force close`,icon:qm,tone:`danger`,title:`Force close "${e.title}"?`,description:`The task is abandoned and its running work cancelled. Its code, worktree and history are kept; it is not marked complete.`,confirmLabel:`Force close`,typeToConfirm:e.title,run:e=>R(`tasks.forceClose`,{taskId:r,title:e}),onDone:n}):null]})}function tX({row:e,detail:t,onChanged:n}){let r=e.kind===`task`&&e.check===`open`,i=r&&!!(e.resumable||t.canAccept||t.canForceClose),a=t.waiting;return a.length===0&&t.blockers.length===0&&!i?null:(0,H.jsx)(SW,{title:`Waiting on`,children:(0,H.jsxs)(`div`,{className:`cs-sunkbox cs-cal`,children:[(0,H.jsxs)(`ul`,{className:`flex flex-col gap-2.5 text-[13px]`,children:[a.map((t,i)=>(0,H.jsx)(QY,{taskId:e.id,item:t,live:r,onDone:n},`${i}-${t.id||t.kind}`)),(0,H.jsx)($Y,{blockers:t.blockers})]}),i?(0,H.jsx)(eX,{row:e,detail:t,onChanged:n}):null]})})}function nX(e){if(e.kind===`archived`)return{state:`archived`,rest:hY(e.age??`now`)};let t=e.check!==`open`,n=e.owner??(e.section===`mine`?`this session`:``),r=t&&e.age?`${e.check===`dropped`?`dropped`:`done`} ${hY(e.age)}`:``;return{state:mY(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function rX(e){return e?[vH(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function iX({row:e}){return e.progress?(0,H.jsxs)(`p`,{className:`cs-prog`,children:[(0,H.jsx)(yH,{done:e.progress.done,total:e.progress.total}),(0,H.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]})]}):null}function aX({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=nX(e),[a,o]=(0,m.useState)(!1),s=(0,m.useId)();return(0,H.jsxs)(`header`,{children:[(0,H.jsxs)(`h2`,{children:[(0,H.jsx)(xH,{check:e.check}),(0,H.jsxs)(`span`,{className:`sr-only`,children:[lY[e.check],`:`]}),(0,H.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,H.jsxs)(`p`,{className:`cs-sub`,children:[(0,H.jsx)(`span`,{className:`cs-bdg`,"data-t":e.check===`done`?`ok`:e.timing?.waiting?`warn`:e.check===`open`?`acc`:void 0,children:r}),i?(0,H.jsx)(`span`,{children:i}):null,(0,H.jsx)(`button`,{type:`button`,className:`cs-dtl`,"aria-expanded":a,"aria-controls":s,onClick:()=>o(e=>!e),children:a?`Hide details`:`Details`})]}),a?(0,H.jsx)(`p`,{id:s,className:`cs-ids`,children:[e.id,rX(t),n].filter(Boolean).join(` · `)}):null,(0,H.jsx)(iX,{row:e})]})}function oX({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await G(`tasks.restore`,{taskId:r},{undo:()=>void G(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await G(`tasks.archive`,{taskId:r},{undo:()=>void G(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await G(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void G(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function sX({row:e,archive:t}){return e.check===`open`?(0,H.jsx)(TV,{label:`Archive`,icon:dm,shortcut:`E`,title:`Archive "${e.title}"?`,description:`A task still under way is abandoned first, then moved to the archive. Restore brings it back.`,confirmLabel:`Archive`,onConfirm:()=>void t()}):(0,H.jsx)(iB,{label:`Archive`,icon:dm,shortcut:`E`,onClick:()=>void t()})}function cX({on:e,toggle:t}){return lA(`a`,t),(0,H.jsxs)(`label`,{className:`cs-autol`,...qz(`Auto mode: the orchestrator decides without asking`),children:[(0,H.jsx)(yg,{"aria-hidden":`true`,className:`size-3.5`}),(0,H.jsx)(`span`,{children:`Auto`}),(0,H.jsx)($U,{small:!0,checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,H.jsx)(ak,{chord:`A`,className:`kbd-hint`})]})}function lX(e){return e.row.kind===`plan`?(0,H.jsx)(WY,{row:e.row,onGone:e.onGone}):(0,H.jsx)(uX,{...e})}function uX(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=oX(e),o=t.kind===`archived`,s=t.kind===`task`&&t.check===`open`&&!!t.resumable;return(0,H.jsxs)(aB,{children:[t.kind===`task`&&t.check===`open`?(0,H.jsx)(VY,{row:t,quiet:s}):null,o?(0,H.jsx)(iB,{label:`Restore`,icon:Cg,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,H.jsx)(cX,{on:!!t.auto,toggle:a}):null,o?null:(0,H.jsx)(sX,{row:t,archive:r}),(0,H.jsx)(TV,{icon:qg,label:o?`Delete for good`:`Delete`,text:`Delete`,shortcut:`Delete`,title:`Delete "${t.title}" for good?`,description:`This cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,onConfirm:()=>void i()})]})}function dX(e){let{row:t}=e,n=t.kind===`plan`,r=MV(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=Vk(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,H.jsx)(GY,{row:t});let o=t.check===`open`&&t.kind===`task`,s=r.data?r.data.work:t.work;return(0,H.jsxs)(`article`,{className:`cs-dt flex min-w-0 flex-col`,"aria-label":t.title,children:[(0,H.jsx)(aX,{row:t,task:a}),r.data?(0,H.jsx)(tX,{row:t,detail:r.data,onChanged:()=>{r.reload(),e.onChanged()}}):null,(0,H.jsx)(`p`,{className:`mt-2 text-[12.5px] text-muted-foreground`,children:(0,H.jsx)(zJ,{timing:r.data?.timing??t.timing,...s?{work:s}:{},stopped:t.check!==`open`})}),r.data?(0,H.jsx)(IY,{runs:r.data.runs}):null,r.data?.delivery?(0,H.jsx)(tY,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,H.jsx)(zY,{detail:r.data,finished:!o,...o&&r.data.canSkip?{skip:{taskId:t.id,onSkipped:()=>{r.reload(),e.onChanged()}}}:{}}):null,(0,H.jsx)(sY,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,H.jsx)(BY,{detail:r.data}):null,r.error&&!r.data?(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function fX({row:e}){let t=e.work,n=!!t?.running&&e.check===`open`&&!e.timing?.waiting,r=IJ(n,t??{workedMs:0,running:!1});if(!t||e.kind===`plan`)return(0,H.jsx)(`span`,{className:`cs-ttm`});let i=FJ(t.workedMs+r);return(0,H.jsx)(`span`,{className:`cs-ttm`,"data-work-clock":n?`running`:`stopped`,children:i.replace(/ \d+s$/,``)})}function pX(e){return e.kind===`archived`?``:e.delivery?`delivery ${e.delivery.status.replaceAll(`_`,` `)}`:e.kind===`plan`||e.check===`open`?`${e.timing?.waiting?`waiting for you · `:``}${gY(e)}${e.auto?` · auto`:``}`:``}function mX(e){return e.check===`dropped`?`drop`:e.kind===`archived`?`arch`:e.check===`done`?`done`:`open`}function hX({row:e,selected:t,onSelect:n,head:r,count:i}){let a=e.kind!==`plan`&&e.progress&&e.progress.total>0?e.progress:void 0;return(0,H.jsxs)(`li`,{children:[r?(0,H.jsxs)(`h3`,{className:`cs-tsec`,children:[cY[e.section],(0,H.jsx)(`b`,{children:i})]}):null,(0,H.jsxs)(`button`,{type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:()=>n(e.id),className:`cs-trw`,children:[(0,H.jsx)(xH,{check:e.check}),(0,H.jsxs)(`span`,{className:`cs-tt1`,children:[(0,H.jsxs)(`span`,{className:`sr-only`,children:[lY[e.check],`:`]}),(0,H.jsx)(`span`,{className:`cs-t`,"data-k":mX(e),children:e.title}),(0,H.jsx)(`span`,{className:`cs-mt`,"data-w":e.timing?.waiting?`warn`:void 0,children:pX(e)})]}),(0,H.jsx)(`span`,{className:`cs-tpg`,children:a?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(yH,{done:a.done,total:a.total}),(0,H.jsxs)(`span`,{children:[a.done,`/`,a.total]})]}):null}),(0,H.jsx)(fX,{row:e}),(0,H.jsx)(`span`,{className:`cs-tag`,children:e.age??``})]})]})}function gX({row:e,selected:t,onSelect:n,head:r,count:i}){let a=e.kind!==`plan`&&e.progress&&e.progress.total>0?e.progress:void 0,o=pX(e);return(0,H.jsxs)(`li`,{children:[r?(0,H.jsxs)(`h3`,{className:`cs-tsec`,children:[cY[e.section],(0,H.jsx)(`b`,{children:i})]}):null,(0,H.jsxs)(`button`,{type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:()=>n(e.id),className:`cs-tr2`,children:[(0,H.jsx)(xH,{check:e.check}),(0,H.jsxs)(`span`,{className:`cs-t2a`,children:[(0,H.jsxs)(`span`,{className:`sr-only`,children:[lY[e.check],`:`]}),(0,H.jsx)(`span`,{className:`cs-t`,"data-k":mX(e),children:e.title}),(0,H.jsx)(`span`,{className:`cs-tag`,children:e.age??``})]}),o||a?(0,H.jsxs)(`span`,{className:`cs-t2b`,children:[(0,H.jsx)(`span`,{className:`cs-mt`,"data-w":e.timing?.waiting?`warn`:void 0,children:o}),a?(0,H.jsxs)(`span`,{className:`cs-tpg`,children:[(0,H.jsx)(yH,{done:a.done,total:a.total}),(0,H.jsxs)(`span`,{children:[a.done,`/`,a.total]})]}):null]}):null]})]})}function _X({rows:e,selectedId:t,onSelect:n,compact:r}){return r?(0,H.jsx)(`ul`,{className:`cs-lst cs-lst2`,children:_Y(e).flatMap(({rows:e},r,i)=>e.map((r,a)=>(0,H.jsx)(gX,{row:r,head:a===0&&i.length>1,count:e.length,selected:r.id===t,onSelect:n},`${r.kind}-${r.id}`)))}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`cs-tbh`,"aria-hidden":`true`,children:[(0,H.jsx)(`span`,{}),(0,H.jsx)(`span`,{children:`Task`}),(0,H.jsx)(`span`,{children:`Progress`}),(0,H.jsx)(`span`,{children:`Worked`}),(0,H.jsx)(`span`,{children:`Age`})]}),(0,H.jsx)(`ul`,{className:`cs-lst`,children:_Y(e).flatMap(({rows:e},r,i)=>e.map((r,a)=>(0,H.jsx)(hX,{row:r,head:a===0&&i.length>1,count:e.length,selected:r.id===t,onSelect:n},`${r.kind}-${r.id}`)))})]})}var vX=()=>Dk(Ek(`tasks`)),yX=e=>Dk(Ek(`tasks`,e));function bX(){return(0,H.jsxs)(Nk,{className:`m-4 flex-1`,children:[(0,H.jsxs)(Pk,{children:[(0,H.jsx)(Ik,{variant:`icon`,children:(0,H.jsx)(Lh,{"aria-hidden":`true`})}),(0,H.jsx)(Lk,{children:pY})]}),(0,H.jsx)(ZO,{onClick:()=>Dk(Ek(`plan`)),children:`Plan a task`})]})}function xX({archived:e,current:t,old:n,onChange:r}){return(0,H.jsx)(Rk,{label:`Show`,className:`cs-tshow`,value:e?`archived`:`active`,onChange:e=>r(e===`archived`),items:[{id:`active`,name:`Tasks`,label:(0,H.jsxs)(H.Fragment,{children:[`Tasks`,(0,H.jsx)(`span`,{className:`cs-cn`,children:t})]})},{id:`archived`,name:`Archived`,label:(0,H.jsxs)(H.Fragment,{children:[`Archived`,(0,H.jsx)(`span`,{className:`cs-cn`,children:n})]})}]})}function SX(e){return!(e.defaultPrevented||e.nativeEvent.isComposing||_k()||e.altKey||e.ctrlKey||e.metaKey||Uk(e.target)||e.target instanceof HTMLInputElement)}function CX(){return(0,H.jsxs)(`div`,{className:`cs-tsh`,children:[(0,H.jsx)(rg,{"aria-hidden":`true`}),(0,H.jsx)(`p`,{children:`Choose a task to see its plan, progress and comments.`})]})}function wX({aside:e,list:t,head:n,detail:r,missing:i}){let a=(0,m.useRef)(null),o=(0,m.useRef)(null);function s(e){let t=a.current;if(!t||!SX(e))return;let n=Wk(e.key);n?(e.preventDefault(),Jk(t,e.target,n)):e.key===`Home`||e.key===`End`?(e.preventDefault(),Jk(t,e.target,e.key===`Home`?`first`:`last`)):Gk(e.key)===1&&o.current&&(e.preventDefault(),o.current.focus())}function c(e){if(!SX(e)||Gk(e.key)!==-1&&e.key!==`Escape`)return;let t=a.current?.querySelector(`[data-row][aria-current='true']`)??a.current?.querySelector(`[data-row]`);t&&(e.preventDefault(),t.focus())}return(0,H.jsxs)(`div`,{className:`cs-tsp`,children:[(0,H.jsxs)(`section`,{className:`cs-tsl`,"aria-label":`Tasks`,children:[(0,H.jsxs)(`div`,{className:`cs-pgh cs-tslh`,children:[(0,H.jsx)(`h1`,{className:`cs-hd1`,children:`Tasks`}),e]}),(0,H.jsxs)(`div`,{className:`cs-tsbox`,children:[(0,H.jsx)(`div`,{ref:a,"data-pane":`list`,className:`cs-tss`,onKeyDown:s,children:t}),(0,H.jsx)(Uv,{target:a})]})]}),(0,H.jsx)(`div`,{className:`cs-tsdv`,"aria-hidden":`true`}),(0,H.jsx)(`section`,{className:`cs-tsd`,"aria-label":`Task detail`,children:r?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`cs-tsdh`,children:n}),(0,H.jsxs)(`div`,{className:`cs-tsbox`,children:[(0,H.jsx)(`div`,{ref:o,"data-pane":`detail`,tabIndex:-1,className:`cs-tss cs-tsds`,onKeyDown:c,children:r}),(0,H.jsx)(Uv,{target:o})]})]}):i?(0,H.jsx)(`div`,{className:`cs-tsh`,children:(0,H.jsx)(`p`,{children:`That task is not on the list any more.`})}):(0,H.jsx)(CX,{})})]})}function TX({id:e}){let[t,n]=(0,m.useState)(!1),r=Hk(`(min-width: 900px)`),i=MV(`tasks.list`,{},[`tasks`,`plans`]),a=MV(`tasks.archived`,{},[`tasks`]),o=i.data?.rows??[],s=a.data?.rows??[],c=t?s:o,l=[...o,...s].find(t=>t.id===e&&t.kind===`task`)?.id;if((0,m.useEffect)(()=>(jJ(l),()=>jJ(void 0)),[l]),!i.data&&i.error)return(0,H.jsx)(jk,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,H.jsx)(bX,{});let u=[...o,...s].find(t=>t.id===e),d=u?{row:u,onGone:vX,onChanged:i.reload}:void 0,f=(0,H.jsx)(xX,{archived:t,current:o.length,old:s.length,onChange:n}),p=(t?a:i).data?c.length===0?(0,H.jsx)(`p`,{className:`cs-tnone`,children:t?fY:pY}):(0,H.jsx)(_X,{rows:c,selectedId:e,onSelect:yX,compact:r}):(0,H.jsx)(nA,{});return r?(0,H.jsx)(wX,{aside:f,list:p,head:d?(0,H.jsx)(lX,{...d},d.row.id):null,detail:d?(0,H.jsx)(dX,{...d},d.row.id):null,missing:!!e&&!!(i.data&&a.data)&&!d}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mJ,{title:`Tasks`,className:`cs-ts`,aside:f,children:p}),(0,H.jsx)(dA,{open:!!e,onClose:vX,label:u?.title??`Task`,className:`cs-tdw`,head:d?(0,H.jsx)(lX,{...d},d.row.id):null,children:d?(0,H.jsx)(dX,{...d},d.row.id):e?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`}):null})]})}var EX={l:`lobby`,p:`plan`,t:`tasks`,n:`knowledge`,e:`settings`};function DX(e){if(e.kind===`settings`)return(0,H.jsx)(dq,{});switch(e.tab){case`lobby`:return(0,H.jsx)(DU,{});case`tasks`:return(0,H.jsx)(TX,{...BV(e.rest)});case`plan`:return(0,H.jsx)(EJ,{rest:e.rest});case`knowledge`:return(0,H.jsx)(zV,{rest:e.rest})}}function OX(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var kX={tab:`Tab`,esc:`Escape`,escape:`Escape`,enter:`Enter`,space:`Space`,pageup:`PageUp`,pagedown:`PageDown`,up:`ArrowUp`,down:`ArrowDown`,home:`Home`,end:`End`,"`":`Backquote`,"]":`BracketRight`,"[":`BracketLeft`,"/":`Slash`,"?":`Slash`,",":`Comma`,".":`Period`};function AX(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:kX[e]}function jX(e){let t={alt:!1,ctrl:!1,shift:!1,meta:!1,code:``};for(let n of e.toLowerCase().split(`+`))if(n===`alt`)t.alt=!0;else if(n===`ctrl`||n===`control`)t.ctrl=!0;else if(n===`shift`)t.shift=!0;else if(n===`meta`||n===`cmd`)t.meta=!0;else{let e=AX(n);if(!e)return;t.code=e}return t.code?t:void 0}function MX(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function NX(e,t){let n=jX(t);return n?MX(e,n):!1}function PX(e,t){for(let n of t)if(NX(e,n.key))return n.action}function FX(e,t){for(let n of t)if(NX(e,n.key))return n.id}function IX(e){return Uk(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||_k()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function LX(e,t,n,r){let i=!e.shiftKey&&/^[1-9]$/.test(e.key)?t[Number(e.key)-1]:void 0;if(i)r(i.id);else if(e.key===`/`)n(`search`);else if(e.key===`?`)n(`help`);else if(e.key===`j`||e.key===`k`)Yk(e.key===`j`?1:-1);else return!1;return!0}function RX(e,t){let n=FX(e,t.tabs),r=PX(e,t.keys);return!n&&!r?!1:OX(r,{overlay:!!document.querySelector(`[role='dialog']:not([data-state='closed']), [role='menu']:not([data-state='closed']), [role='listbox']`)||_k(),typing:Uk(e.target)||e.target instanceof HTMLInputElement,saveAvailable:!!document.querySelector(`[data-plan-save]:not([disabled])`)})||(r===`search`||r===`savePlan`)&&!t.insideApp()?!0:(e.preventDefault(),n?t.onTab(n):r&&t.onAction(r),!0)}function zX(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=EX[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(LX(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function BX(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(n.target instanceof Element&&n.target.closest(`.xterm`)){PX(n,e.keys)===`terminal`&&(n.preventDefault(),e.onAction(`terminal`));return}if(!e.insideApp()){PX(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&IX(n)){t=0;return}if(RX(n,e)){t=0;return}t=r?zX(n,e,t):0};return window.addEventListener(`keydown`,n,!0),()=>window.removeEventListener(`keydown`,n,!0)},[e.enabled,e.keys,e.tabs,e.insideApp,e.onAction,e.onTab])}var VX=[{id:`focus`,caps:[`/`],help:`focus search, or the message box`},{id:`send`,label:`Enter`,help:`send the message`},{id:`newline`,label:`Shift+Enter`,help:`a new line (lists carry on)`},{id:`format`,label:`Ctrl+B`,help:`bold; Ctrl+I italic, Ctrl+E code, Ctrl+K link`},{id:`leave`,label:`Esc`,help:`leave the box for the tab bar`}],HX=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(EX).map(([e,t])=>({id:`go.${t}`,caps:[`g`,e],help:`jump to ${t}`})),{id:`project`,caps:[`P`],help:`open the project switcher`},{id:`theme`,caps:[`D`],help:`switch between light and dark`},{id:`edit`,label:`Ctrl+Enter`,help:`save an edited message; Esc cancels`}],UX=[{id:`tasks`,page:`Tasks`,keys:[[`E`,`archive`],[`R`,`restore`],[`A`,`auto mode`],[`Delete`,`delete`]]},{id:`saved`,page:`Saved plan`,keys:[[`S`,`start here`],[`N`,`new session`],[`Delete`,`discard`]]},{id:`plan`,page:`Plan`,keys:[[`A`,`answer`],[`R`,`retry`],[`Ctrl+S`,`save`],[`N`,`new plan`]]},{id:`knowledge`,page:`Knowledge`,keys:[[`E`,`edit`],[`A`,`add`],[`C`,`comment`],[`F`,`edit file`],[`Delete`,`delete`]]},{id:`confirm`,page:`Asked to confirm`,keys:[[`Y`,`yes, do it`],[`Esc`,`keep it`]]}],WX=[{id:`enter`,caps:[`↓`],help:`from the tab bar, into the page`},{id:`rows`,caps:[`↑`,`↓`],help:`move through a list (j and k work too)`},{id:`pane`,caps:[`←`,`→`],help:`between a list and its detail (h and l)`},{id:`ends`,caps:[`Home`,`End`],help:`first and last row`},{id:`open`,caps:[`Enter`,`Space`],help:`activate the focused button or row (links: Enter; checkboxes: Space)`},{id:`back`,label:`Esc`,help:`back up to the tab bar`}],GX=[{id:`qmove`,caps:[`↑`,`↓`],help:`move between the options`},{id:`qpick`,label:`Space`,help:`pick an option (several when allowed)`},{id:`qchoose`,label:`Enter`,help:`choose and go on; in your own answer, send it`},{id:`qacross`,caps:[`←`,`→`],help:`previous and next question`},{id:`qdigit`,caps:[`1`,`2`,`…`],help:`pick that option`},{id:`qesc`,label:`Esc`,help:`put the question away for later`}];function KX({line:e}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,H.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,H.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,H.jsx)($O,{children:e},e))}):(0,H.jsx)(ak,{chord:e.label??``})}),(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function qX(){return(0,H.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),UX.map(e=>(0,H.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,H.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,H.jsx)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 text-sm text-muted-foreground`,children:e.keys.map(([e,t])=>(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(ak,{chord:e}),t]},e))})]},e.id))]})}function JX({title:e,lines:t}){return(0,H.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,H.jsx)(KX,{line:e},e.id))]})}function YX(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function XX(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function ZX({open:e,onOpenChange:t,keys:n,tabs:r}){let i=e,a=gk(i,hk.help),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(!i||!a)return;let e=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&NX(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[n,t,a,i]),(0,H.jsxs)(ck,{open:i&&a,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,H.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-4 py-3`,children:[(0,H.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(ak,{chord:`Esc`}),(0,H.jsx)(ZO,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,H.jsx)(l_,{"aria-hidden":`true`})})]})]}),(0,H.jsxs)(`div`,{ref:o,className:`grid min-h-0 flex-1 grid-cols-2 gap-x-10 gap-y-6 overflow-y-auto p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,H.jsx)(JX,{title:`Everywhere`,lines:YX(n)}),(0,H.jsx)(JX,{title:`Jump to a tab`,lines:XX(r)}),(0,H.jsx)(JX,{title:`Navigation and editing`,lines:HX}),(0,H.jsx)(JX,{title:`Message box`,lines:VX})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,H.jsx)(JX,{title:`Lists and panes`,lines:WX}),(0,H.jsx)(qX,{}),(0,H.jsx)(JX,{title:`Questions`,lines:GX})]})]}),(0,H.jsx)(Uv,{target:o})]})}var QX=`size-[1.05rem]`;function $X({hint:e,onHelp:t,className:n,side:r=`top`}){return(0,H.jsx)(`button`,{...qz(`Keyboard shortcuts`,{keys:e,side:r}),type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:n,children:(0,H.jsx)(Nh,{"aria-hidden":`true`,className:QX})})}function eZ({className:e,side:t=`top`}){let n=bp(),r=n?`Unmute sounds`:`Mute sounds`;return(0,H.jsx)(`button`,{...qz(r,{side:t,keep:!0}),type:`button`,"aria-label":r,"aria-pressed":n,"aria-describedby":`focused-action-help`,className:e,onClick:()=>yp(!n),children:n?(0,H.jsx)(r_,{"aria-hidden":`true`,className:QX}):(0,H.jsx)(t_,{"aria-hidden":`true`,className:QX})})}function tZ({className:e,side:t=`top`}){let{theme:n,setTheme:r}=jW(),i=n===`dark`||n===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,H.jsx)(`button`,{...qz(i?`Light mode`:`Dark mode`,{keys:`D`,side:t}),type:`button`,"aria-label":i?`Switch to light mode`:`Switch to dark mode`,"aria-keyshortcuts":`D`,"aria-describedby":`focused-action-help`,onClick:()=>r(i?`light`:`dark`),className:e,children:i?(0,H.jsx)(Ug,{"aria-hidden":`true`,className:QX}):(0,H.jsx)(tg,{"aria-hidden":`true`,className:QX})})}function nZ({className:e,side:t=`top`}){let n=zU(),r=n?`Turn off desktop notifications`:`Turn on desktop notifications`,i=async()=>{if(n)return VU();let e=await BU();e===`granted`?W.success(`Desktop notifications are on.`):W.error(e===`unsupported`?`This browser cannot show notifications.`:`Notifications are blocked for this page in the browser's settings.`)};return(0,H.jsx)(`button`,{...qz(r,{side:t,keep:!0}),type:`button`,"aria-label":r,"aria-pressed":n,className:e,onClick:()=>void i(),children:n?(0,H.jsx)(Cm,{"aria-hidden":`true`,className:QX}):(0,H.jsx)(xm,{"aria-hidden":`true`,className:QX})})}function rZ({className:e,side:t=`top`}){let n=x();if(!n.supported)return null;let r=n.on?`Leave full screen`:`Full screen`;return(0,H.jsx)(`button`,{...qz(r,{side:t,keep:!0}),type:`button`,"aria-label":r,"aria-pressed":n.on,className:e,onClick:()=>void n.toggle(),children:n.on?(0,H.jsx)(Zh,{"aria-hidden":`true`,className:QX}):(0,H.jsx)(Uh,{"aria-hidden":`true`,className:QX})})}function iZ(){if(typeof document>`u`)return 1;let e=Number.parseFloat(getComputedStyle(document.documentElement).fontSize);return e>0?e/15:1}function aZ(e){return Math.round(e*iZ())}function oZ(e){return`${Number((e/15).toFixed(5))}rem`}function sZ(e){let t=iZ();return{w:Math.round(e.w*t),h:Math.round(e.h*t)}}function cZ(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function lZ(e){if(e.size===0)throw Error(`${e.name||`That file`} is empty.`);if(e.size>20971520)throw Error(`${e.name||`That file`} is larger than 20 MB.`);let t=new URLSearchParams({name:e.name||`pasted-file`,type:e.type}),n=await fetch(I(`/api/files.upload?${t}`),{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e,credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new be(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new be(r.error,r.code,n.status);return r.result}function uZ(e,t,n,r){let i=e.slice(0,t),a=e.slice(t,n),o=e.slice(n);if(a.length>=r.length*2&&a.startsWith(r)&&a.endsWith(r)){let e=a.slice(r.length,a.length-r.length);return{value:i+e+o,start:t,end:t+e.length}}return i.endsWith(r)&&o.startsWith(r)?{value:i.slice(0,i.length-r.length)+a+o.slice(r.length),start:t-r.length,end:n-r.length}:{value:i+r+a+r+o,start:t+r.length,end:n+r.length}}function dZ(e,t,n){let r=e.slice(t,n)||`text`,i=`[${r}](url)`,a=t+r.length+3;return{value:e.slice(0,t)+i+e.slice(n),start:a,end:a+3}}var fZ=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function pZ(e,t){let n=e.lastIndexOf(`
110
- `,t-1)+1,r=e.indexOf(`
111
- `,t),i=e.slice(n,r<0?e.length:r),a=fZ.exec(i);if(!a||t-n<a[0].length)return;let[o,s=``,c,l,u=`.`,d]=a;if(i.slice(o.length).trim()===``)return{value:e.slice(0,n)+e.slice(r<0?e.length:r),start:n,end:n};let f=`\n${s}${c??`${Number(l)+1}${u}`} ${d?`[ ] `:``}`;return{value:e.slice(0,t)+f+e.slice(t),start:t+f.length,end:t+f.length}}function mZ(){try{return{id:fe()}}catch(e){return{error:e.message}}}function hZ(e,t){if(e){if(t&&!e.projects.some(e=>e.id===t))return`Selected project is unknown or offline. Refresh or choose a running project.`;if(!e.projects.length)return`No authorized running projects found. Open a folder from the Project menu, or refresh.`}}function gZ(){let[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(0);async function s(){let e=++o.current;a(!0),r(void 0);try{let n=await R(`projects.list`,{});_e(n.projects),e===o.current&&t(n)}catch(t){e===o.current&&r(t.message)}finally{e===o.current&&a(!1)}}(0,m.useEffect)(()=>(s(),()=>{o.current++}),[]);let[c,l]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(!i)return l(!1);let e=setTimeout(()=>l(!0),300);return()=>clearTimeout(e)},[i]),{data:e,error:n,busy:i,slow:c,refresh:s}}function _Z({data:e,error:t}){let n=mZ();return n.error??t??hZ(e,n.id)}function vZ({projects:e}){let t=_Z(e);return t?(0,H.jsxs)(`p`,{role:`alert`,className:`notice flex min-w-0 items-start gap-2 pt-1 pb-0.5 text-xs break-words text-destructive`,children:[(0,H.jsx)(Yg,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:t})]}):null}function yZ(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0,n=e.key===`Home`?`first`:e.key===`End`?`last`:void 0;if(!t&&!n)return;let r=[...e.currentTarget.querySelectorAll(`[role='option'], [data-walk]`)];if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement);r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?t>0?-1:r.length:i)+t))]?.focus()}var bZ=`bot-lobby:open-projects`,xZ=4;function SZ(e){return{w:360,h:45+Math.max(1,Math.min(e.data?.projects.length??1,xZ))*46+1+32+(_Z(e)?32:0)}}function CZ({projects:e,name:t,branch:n,open:r,onToggle:i}){let a=_Z(e);return(0,H.jsxs)(`button`,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${t}${n?`, branch ${n}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":r,"aria-keyshortcuts":`P ArrowDown`,"aria-busy":e.busy,"data-tip":`Switch project`,"data-on":r||void 0,onClick:i,onKeyDown:e=>{e.key!==`ArrowDown`||e.altKey||e.metaKey||e.ctrlKey||r||(e.preventDefault(),i())},className:`bubble-chip bubble-tip bubble-tool min-w-0`,children:[e.slow?(0,H.jsx)(VV,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):(0,H.jsx)(Ch,{"aria-hidden":`true`,className:Y(`size-3.5 shrink-0`,a&&`text-destructive`)}),(0,H.jsx)(`span`,{className:`truncate`,children:t}),(0,H.jsx)(jm,{"aria-hidden":`true`,className:`size-3 shrink-0`,strokeWidth:2})]})}function wZ({projects:e,tab:t,onBrowse:n,onClose:r}){let{data:i,busy:a,refresh:o}=e,s=mZ(),c=_Z(e),l=s.error?`invalid`:s.id??i?.currentId??``,u=(0,m.useRef)(null);lA(`r`,()=>void o(),{inDialog:!0}),(0,m.useEffect)(()=>{(u.current?.querySelector(`[role='option'][aria-selected='true']`)??u.current?.querySelector(`[role='option']`))?.focus({preventScroll:!0})},[!!i]);function d(e){r(),e!==l&&L(e,t)}let f=Math.max(1,Math.min(i?.projects.length??1,xZ));return(0,H.jsxs)(`div`,{ref:u,"aria-label":`Projects`,onKeyDown:yZ,className:`bubble-pane flex flex-col p-1`,children:[(0,H.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between ps-2.5 pe-1`,children:[(0,H.jsx)(`span`,{className:`text-[13px] font-medium text-(--bubble-muted)`,children:`Running projects`}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>void o(),disabled:a,"aria-label":`Refresh list`,"aria-keyshortcuts":`R`,className:`bubble-chip h-6 text-xs`,children:[a?(0,H.jsx)(VV,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,H.jsx)(yg,{"aria-hidden":`true`,className:`size-3.5`}),`Refresh`,(0,H.jsx)(`kbd`,{className:`bubble-kbd`,children:`R`})]})]}),(0,H.jsx)(`div`,{className:`h-px shrink-0`}),(0,H.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`bubble-scroll flex shrink-0 flex-col overflow-y-auto`,style:{height:oZ(f*46)},children:i?i.projects.map((e,t)=>{let n=e.id===l;return(0,H.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n,onClick:()=>d(e.id),className:Y(`bubble-row cs-prow shrink-0`,n&&`bubble-prow`),style:{"--delay":`${40+t*12}ms`},children:[(0,H.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center`,children:n?(0,H.jsx)(km,{"aria-hidden":`true`,className:`size-4 text-(--bubble-accent)`,strokeWidth:2}):null}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-medium text-(--bubble-ink)`,children:e.name}),(0,H.jsxs)(`span`,{className:`truncate text-xs text-(--bubble-muted)`,children:[e.cwd,` · :`,e.port]})]})]},e.id)}):(0,H.jsxs)(`div`,{className:`flex h-[46px] items-center gap-2 px-2.5 text-[13px] text-(--bubble-muted)`,children:[(0,H.jsx)(VV,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}),`Loading projects…`]})}),c?(0,H.jsxs)(`p`,{role:`alert`,className:`flex h-8 shrink-0 items-center gap-2 px-2 text-xs text-destructive`,children:[(0,H.jsx)(Yg,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,title:c,children:c})]}):null,(0,H.jsx)(`div`,{className:`h-px shrink-0`}),(0,H.jsxs)(`button`,{type:`button`,"data-walk":!0,onClick:n,className:`bubble-row cs-orow shrink-0`,style:{"--delay":`0ms`},children:[(0,H.jsx)(xh,{"aria-hidden":`true`,className:`size-4 shrink-0 text-(--bubble-muted)`,strokeWidth:1.7}),(0,H.jsx)(`span`,{className:`text-sm font-medium text-(--bubble-ink)`,children:`Open folder…`})]})]})}var TZ={w:500,h:308};function EZ(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)();async function a(r){if(!t){n(!0),i(void 0);try{let{project:t}=await R(`projects.open`,{path:r});_e([t]),L(t.id,e)}catch(e){i(e.message)}finally{n(!1)}}}return{opening:t,error:r,open:a}}function DZ(e){let t=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`,n=e.split(t),r=[];return n.forEach((e,i)=>{if(!e)return;let a=n.slice(0,i+1).join(t);r.push({name:e,path:a||t})}),r.length?r:[{name:t,path:t}]}function OZ(e,t,n){let r=[...e.currentTarget.querySelectorAll(`button[data-folder]:not(:disabled)`)],i=r.indexOf(document.activeElement),a={ArrowDown:Math.min(r.length-1,i+1),ArrowUp:Math.max(0,i-1),Home:0,End:r.length-1}[e.key];a!==void 0&&r.length>0?(e.preventDefault(),r[a]?.focus()):e.key===`Backspace`&&t&&(e.preventDefault(),n(t))}function kZ({tab:e,onClose:t}){let[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)({step:0,dir:`fwd`}),o=MV(`projects.browse`,n===void 0?{}:{path:n},[]),s=EZ(e),c=(0,m.useRef)(null),l=o.loading||s.opening,u=o.data?.path??n??``,d=(e,t)=>{e!==u&&(a(e=>({step:e.step+1,dir:t})),r(e))};(0,m.useEffect)(()=>{if(!o.data)return;let e=c.current?.querySelector(`button[data-folder]`);e&&!c.current?.contains(document.activeElement)&&e.focus({preventScroll:!0})},[o.data]);let f=DZ(u),p=f.slice(-4),h=o.data?.folders.length??0,g=o.error||s.error?o.error??s.error:o.loading&&!o.data?`Loading…`:h===0?`No subfolders`:`${h.toLocaleString()} ${h===1?`folder`:`folders`}${o.data?.truncated?` (first 2,000)`:``}`;return(0,H.jsxs)(`div`,{role:`group`,"aria-label":`Open project folder`,className:`bubble-pane flex flex-col gap-1 p-1`,style:{height:oZ(TZ.h)},children:[(0,H.jsxs)(`div`,{className:`bubble-wellbar flex h-9 shrink-0 items-center gap-0.5 px-1`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Parent folder`,"data-tip":`Parent folder`,"data-tip-keys":`Backspace`,disabled:l||!o.data?.parent,onClick:()=>o.data?.parent&&d(o.data.parent,`back`),className:`bubble-iconbtn size-7`,children:(0,H.jsx)(ym,{"aria-hidden":`true`,className:`size-4`,strokeWidth:1.8})}),(0,H.jsxs)(`nav`,{"aria-label":`Folder path`,className:`flex min-w-0 flex-1 items-center overflow-hidden whitespace-nowrap`,title:u,children:[f.length>p.length?(0,H.jsx)(`span`,{className:`shrink-0 px-1.5 text-[13px] text-(--bubble-muted)`,children:`…`}):null,p.map((e,t)=>(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center`,children:[t>0?(0,H.jsx)(Fm,{"aria-hidden":`true`,className:`size-3 shrink-0 text-(--bubble-faint)`,strokeWidth:2}):null,(0,H.jsx)(`button`,{type:`button`,className:`bubble-crumb`,"data-last":t===p.length-1||void 0,"aria-current":t===p.length-1?`location`:void 0,disabled:l,onClick:()=>d(e.path,`back`),children:e.name})]},e.path))]})]}),(0,H.jsxs)(`div`,{ref:c,role:`group`,"aria-label":`Folders`,"aria-busy":o.loading,"data-dir":i.step?i.dir:void 0,onKeyDown:e=>OZ(e,o.data?.parent,e=>d(e,`back`)),className:`bubble-flist bubble-scroll`,children:[o.data?.folders.map(e=>{let t=e.name.startsWith(`.`);return(0,H.jsxs)(`button`,{type:`button`,"data-folder":!0,disabled:s.opening,onClick:()=>d(e.path,`fwd`),"data-tip":e.path,className:Y(`bubble-frow`,t&&`text-(--bubble-muted)`),children:[(0,H.jsx)(`span`,{className:`bubble-ftile`,children:(0,H.jsx)(Ch,{"aria-hidden":`true`,className:`size-3.5 text-(--bubble-muted)`,strokeWidth:1.8})}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,H.jsx)(Fm,{"aria-hidden":`true`,className:`bubble-go size-3.5 shrink-0`,strokeWidth:2})]},e.path)}),o.data&&h===0?(0,H.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-xs text-(--bubble-muted)`,children:[(0,H.jsx)(Ch,{"aria-hidden":`true`,className:`size-6`,strokeWidth:1.5}),(0,H.jsx)(`span`,{children:`No subfolders here. You can open this folder.`})]}):null]},i.step),(0,H.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center justify-between gap-2 ps-2.5 pe-1`,children:[(0,H.jsx)(`span`,{role:o.error||s.error?`alert`:`status`,className:Y(`min-w-0 truncate text-xs`,o.error||s.error?`text-destructive`:`text-(--bubble-muted)`),children:g}),(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,children:[o.error?(0,H.jsx)(`button`,{type:`button`,className:`bubble-btn bubble-ghostbtn`,onClick:o.reload,disabled:o.loading,children:`Retry`}):null,(0,H.jsx)(`button`,{type:`button`,className:`bubble-btn bubble-ghostbtn`,onClick:t,disabled:s.opening,children:`Cancel`}),(0,H.jsx)(`button`,{type:`button`,className:`bubble-btn bubble-key`,disabled:!o.data||o.loading||!!o.error||s.opening,onClick:()=>void s.open(o.data.path),children:s.opening?`Opening project…`:`Open this folder`})]})]})]})}var AZ={info:kh,success:Vm,warning:Yg,error:Ym},jZ={info:`text-info`,success:`text-success`,warning:`text-warning`,error:`text-destructive`},MZ=12,NZ=.4,PZ=.45;function FZ(e,t){let{item:n}=Up(),r=vk(),i=e&&!r?n:void 0,a=Of()??!1,[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)({w:0,h:0}),u=Df(0),d=Df(NZ),f=Df(PZ),p=Df(0),h=Df(0),g=(0,m.useRef)(null),_=(0,m.useRef)(!1),v=(0,m.useRef)(i);v.current=i;let y=(0,m.useRef)(0),b=(0,m.useRef)(0),x=e=>s(e?{item:e,n:++y.current}:void 0);(0,m.useEffect)(()=>{if(_.current)return;if(!o)return void(i&&x(i));if(i&&i.id===o.item.id){i!==o.item&&s({item:i,n:o.n});return}_.current=!0;let e=()=>{_.current=!1,x(v.current)};if(a){Promise.all([Zf(h,0,{duration:.12}),Zf(p,0,{duration:.12})]).then(e);return}let n={duration:.3,delay:.06,ease:[.55,0,.75,.2]};Promise.all([Zf(h,0,{duration:.09,ease:`easeIn`}),Zf(u,b.current,n),Zf(d,NZ,n),Zf(f,PZ,n),...t===`floor`?[Zf(p,0,{duration:.1,delay:.2})]:[]]).then(e)},[i,o,a,t,u,d,f,p,h]);let S=o?.n;(0,m.useLayoutEffect)(()=>{let e=g.current;if(S===void 0||!e)return;let n=e.offsetHeight;if(l({w:e.offsetWidth,h:n}),b.current=t===`composer`?MZ+n*.3:MZ+n+28,a){u.set(0),d.set(1),f.set(1),p.set(0),h.set(0),Zf(p,1,{duration:.14}),Zf(h,1,{duration:.16});return}u.set(b.current),d.set(NZ),f.set(PZ),p.set(+(t===`composer`)),h.set(0),Zf(u,0,{type:`spring`,visualDuration:.42,bounce:.18}),Zf(f,1,{type:`spring`,visualDuration:.36,bounce:.34,delay:.03}),Zf(d,1,{type:`spring`,visualDuration:.44,bounce:.3,delay:.05}),t===`floor`&&Zf(p,1,{duration:.12}),Zf(h,1,{duration:.2,delay:.24,ease:`easeOut`})},[S,a,t,u,d,f,p,h]),(0,m.useEffect)(()=>{let e=g.current;if(S===void 0||!e)return;let t=new ResizeObserver(()=>l({w:e.offsetWidth,h:e.offsetHeight}));return t.observe(e),()=>t.disconnect()},[S]);let C={"--tw":`${c.w}px`,"--th":`${c.h}px`,"--toast-room":o?`${c.h+MZ+24}px`:`0px`};return{item:o?.item,y:u,sx:d,sy:f,solid:p,fade:h,body:g,vars:C}}function IZ({t:e}){return e.item?(0,H.jsx)(`div`,{className:`toast-anchor`,children:(0,H.jsx)(Qf.div,{className:`toast-shape`,style:{y:e.y,scaleX:e.sx,scaleY:e.sy,opacity:e.solid}})}):null}function LZ({t:e}){let t=e.item;if(!t)return null;let n=AZ[t.kind];return(0,H.jsx)(`div`,{className:`toast-anchor`,children:(0,H.jsxs)(Qf.div,{ref:e.body,className:`toast-body`,style:{y:e.y,opacity:e.fade},onFocus:e=>e.stopPropagation(),children:[(0,H.jsx)(n,{"aria-hidden":`true`,className:Y(`size-4 shrink-0`,jZ[t.kind])}),(0,H.jsx)(`span`,{className:`min-w-0 break-words`,children:t.message}),t.action?(0,H.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,className:`btn-outline -my-1.5 -mr-1 h-7 shrink-0 rounded-lg border px-2.5 text-xs font-medium text-foreground transition-[box-shadow,scale] active:scale-[0.97] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,onClick:()=>{t.action?.onClick(),Vp(t.id)},children:t.action.label}):null]})})}function RZ({id:e=`bubble`}){return(0,H.jsx)(`svg`,{width:`0`,height:`0`,className:`absolute`,"aria-hidden":`true`,focusable:`false`,children:(0,H.jsxs)(`defs`,{children:[(0,H.jsxs)(`filter`,{id:`${e}-goolit`,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,H.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`4.5`,result:`b`}),(0,H.jsx)(`feColorMatrix`,{in:`b`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10`,result:`shape`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`1.5`,result:`dn`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`dn`,operator:`out`,result:`rimA`}),(0,H.jsx)(`feGaussianBlur`,{in:`rimA`,stdDeviation:`0.6`,result:`rimB`}),(0,H.jsx)(`feComposite`,{in:`rimB`,in2:`shape`,operator:`in`,result:`rimC`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--bubble-hl)`},result:`hlc`}),(0,H.jsx)(`feComposite`,{in:`hlc`,in2:`rimC`,operator:`in`,result:`hl`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`-1`,result:`up`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`up`,operator:`out`,result:`shA`}),(0,H.jsx)(`feGaussianBlur`,{in:`shA`,stdDeviation:`0.6`,result:`shB`}),(0,H.jsx)(`feComposite`,{in:`shB`,in2:`shape`,operator:`in`,result:`shC`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--bubble-sh)`},result:`shc`}),(0,H.jsx)(`feComposite`,{in:`shc`,in2:`shC`,operator:`in`,result:`sh`}),(0,H.jsxs)(`feMerge`,{children:[(0,H.jsx)(`feMergeNode`,{in:`shape`}),(0,H.jsx)(`feMergeNode`,{in:`sh`}),(0,H.jsx)(`feMergeNode`,{in:`hl`})]})]}),(0,H.jsxs)(`filter`,{id:`${e}-gooedge`,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,H.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`4.5`,result:`b`}),(0,H.jsx)(`feColorMatrix`,{in:`b`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10`,result:`shape`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`1.5`,result:`dn`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`dn`,operator:`out`,result:`tS0`}),(0,H.jsx)(`feGaussianBlur`,{in:`tS0`,stdDeviation:`0.3`,result:`tS1`}),(0,H.jsx)(`feComposite`,{in:`tS1`,in2:`shape`,operator:`in`,result:`tS`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--bubble-ehl)`},result:`tc`}),(0,H.jsx)(`feComposite`,{in:`tc`,in2:`tS`,operator:`in`,result:`eh`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`-1`,result:`up`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`up`,operator:`out`,result:`bS0`}),(0,H.jsx)(`feGaussianBlur`,{in:`bS0`,stdDeviation:`0.3`,result:`bS1`}),(0,H.jsx)(`feComposite`,{in:`bS1`,in2:`shape`,operator:`in`,result:`bS`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--bubble-esh)`},result:`bc`}),(0,H.jsx)(`feComposite`,{in:`bc`,in2:`bS`,operator:`in`,result:`es`}),(0,H.jsxs)(`feMerge`,{children:[(0,H.jsx)(`feMergeNode`,{in:`shape`}),(0,H.jsx)(`feMergeNode`,{in:`eh`}),(0,H.jsx)(`feMergeNode`,{in:`es`})]})]})]})})}function zZ({kind:e,toast:t}){return(0,H.jsxs)(`div`,{className:Y(`bubble-layer`,e===`edge`?`bubble-edge`:`bubble-fill`),"aria-hidden":`true`,children:[(0,H.jsx)(IZ,{t}),(0,H.jsx)(`div`,{className:`bubble-menu`,children:(0,H.jsx)(`div`,{className:`bubble-menu-clip`})}),(0,H.jsx)(`div`,{className:`bubble-ghost`})]})}function BZ({open:e,size:t,shrunk:n,morphing:r,menu:i,children:a,toasts:o=!1,className:s,style:c,...l}){(0,m.useEffect)(()=>o?Kp():void 0,[o]);let u=FZ(o,`composer`),[d,f]=(0,m.useState)(e);return(0,m.useEffect)(()=>{if(e)return f(!0);let t=setTimeout(()=>f(!1),140);return()=>clearTimeout(t)},[e]),(0,H.jsxs)(`div`,{"data-slot":`composer-shell`,"data-open":e||void 0,"data-shrunk":n||void 0,"data-morphing":r||void 0,className:Y(`bubble`,s),style:{...c,...u.vars,"--w":`${t.w}px`,"--h":`${e?t.h:0}px`},...l,children:[(0,H.jsx)(RZ,{}),(0,H.jsx)(zZ,{kind:`edge`,toast:u}),(0,H.jsx)(zZ,{kind:`fill`,toast:u}),(0,H.jsxs)(`div`,{className:`bubble-real`,children:[(0,H.jsx)(LZ,{t:u}),(0,H.jsx)(`div`,{className:`bubble-menu`,inert:!e,children:(0,H.jsx)(`div`,{className:`bubble-menu-clip`,children:(0,H.jsx)(`div`,{className:`bubble-menu-body`,children:e||d?i:null})})}),a]})]})}function VZ(e,t){let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=[];for(let e=n.nextNode();e;e=n.nextNode())r.push(e);let i=e=>{let t=0;for(let n of r){let r=n.data.length;if(e<t+r)return{node:n,local:e-t};t+=r}},a=e=>{let t=i(e);if(!t)return;let n=document.createRange();n.setStart(t.node,t.local),n.setEnd(t.node,t.local+1);let r=n.getClientRects();return r.length?r[0]:void 0},o=e.textContent??``;if(o[t]!==`
112
- `){let e=a(t);if(e)return new DOMRect(e.left,e.top,0,e.height)}if(t>0&&o[t-1]!==`
113
- `){let e=a(t-1);if(e)return new DOMRect(e.right,e.top,0,e.height)}let s=i(t);if(!s)return;let c=document.createRange();c.setStart(s.node,s.local),c.collapse(!0);let l=c.getBoundingClientRect();return l.height?l:void 0}function HZ(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}function UZ({field:e,mirror:t,text:n}){let r=(0,m.useRef)(null),[i,a]=(0,m.useState)(HZ),o=(0,m.useRef)(0),s=(0,m.useRef)(!1);(0,m.useEffect)(()=>{let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`);if(!e)return;let t=()=>a(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let c=(0,m.useCallback)(()=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{let n=e.current,i=t.current,a=r.current,o=n?.parentElement;if(!n||!i||!a||!o)return;let c=document.activeElement===n&&n.selectionStart===n.selectionEnd?VZ(i,n.selectionDirection===`backward`?n.selectionStart:n.selectionEnd):void 0;if(!c){a.dataset.on=`false`,s.current=!1;return}let l=o.getBoundingClientRect(),u=c.left-l.left,d=c.top-l.top;a.dataset.glide=s.current?`true`:`false`,a.style.transform=`translate3d(${u}px, ${d}px, 0)`,a.style.height=`${c.height}px`,a.dataset.on=`true`,s.current=!0,a.style.animation=`none`,a.offsetWidth,a.style.animation=``})},[e,t]);return(0,m.useLayoutEffect)(()=>{i||c()},[n,i,c]),(0,m.useEffect)(()=>{let t=e.current;if(i||!t)return;let n=()=>{r.current&&(r.current.dataset.on=`false`),s.current=!1},a=new ResizeObserver(c);return a.observe(t),t.addEventListener(`focus`,c),t.addEventListener(`blur`,n),t.addEventListener(`scroll`,c),t.addEventListener(`input`,c),document.addEventListener(`selectionchange`,c),c(),()=>{cancelAnimationFrame(o.current),a.disconnect(),t.removeEventListener(`focus`,c),t.removeEventListener(`blur`,n),t.removeEventListener(`scroll`,c),t.removeEventListener(`input`,c),document.removeEventListener(`selectionchange`,c)}},[e,i,c]),i?null:(0,H.jsx)(`span`,{ref:r,className:`bubble-caret`,"data-on":`false`,"aria-hidden":`true`})}var WZ=/^\s{0,3}(`{3,}|~{3,})/,GZ=/^(\s{0,3}#{1,6})(\s+)(.*)$/,KZ=/^(\s{0,3}>[>\s]*)(.*)$/,qZ=/^(\s*)([-*+]|\d{1,9}[.)])(\s+)(\[[ xX]\]\s)?(.*)$/,JZ=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/,YZ=/(`+)([^`\n]+?)\1|\[([^\]\n]+)\]\(([^)\s]+)\)|(\*\*|__)(?=\S)([^\n]*?\S)\5|(~~)(?=\S)([^\n]*?\S)~~|(?<![\w*])(\*)(?=[^\s*])([^*\n]*?[^\s*])\*(?!\*)|(?<![\w_])(_)(?=[^\s_])([^_\n]*?[^\s_])_(?![\w_])|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])|(?<![\w@])(@[a-z][\w-]*)/gi;function XZ(e,t,n){if(!t)return;let r=e.at(-1);r&&r.kind===n?r.text+=t:e.push({text:t,kind:n})}var ZZ=(...e)=>e.filter(Boolean).join(` `);function QZ(e,t,n){let r=0;for(let i of t.matchAll(YZ)){let a=i.index;XZ(e,t.slice(r,a),n);let[o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]=i;if(s)XZ(e,s,ZZ(n,`code`,`mark`)),XZ(e,c,ZZ(n,`code`)),XZ(e,s,ZZ(n,`code`,`mark`));else if(l)XZ(e,`[`,ZZ(n,`mark`)),XZ(e,l,ZZ(n,`link`)),XZ(e,`](${u})`,ZZ(n,`mark`));else if(d)XZ(e,d,ZZ(n,`mark`)),QZ(e,f,ZZ(n,`strong`)),XZ(e,d,ZZ(n,`mark`));else if(p)XZ(e,p,ZZ(n,`mark`)),QZ(e,m,ZZ(n,`strike`)),XZ(e,p,ZZ(n,`mark`));else if(h||_){let t=h??_;XZ(e,t,ZZ(n,`mark`)),QZ(e,g??v,ZZ(n,`em`)),XZ(e,t,ZZ(n,`mark`))}else y?XZ(e,y,ZZ(n,`link`)):b?XZ(e,b,ZZ(n,`mention`)):XZ(e,o,n);r=a+o.length}XZ(e,t.slice(r),n)}function $Z(e){let t=[],n;return e.split(`
114
- `).forEach((e,r)=>{r>0&&XZ(t,`
115
- `,``);let i=WZ.exec(e);if(n!==void 0){i&&i[1].startsWith(n)?(n=void 0,XZ(t,e,`codeblock mark`)):XZ(t,e,`codeblock`);return}if(i){n=i[1][0].repeat(3),XZ(t,e,`codeblock mark`);return}if(r===0&&/^\/[a-z][\w-]*/i.test(e)){let n=/^\/[a-z][\w-]*/i.exec(e)[0];XZ(t,n,`mention`),QZ(t,e.slice(n.length),``);return}if(JZ.test(e))return XZ(t,e,`mark`);let a=GZ.exec(e);if(a)return XZ(t,a[1]+a[2],`heading mark`),QZ(t,a[3],`heading`);let o=KZ.exec(e);if(o)return XZ(t,o[1],`quote mark`),QZ(t,o[2],`quote`);let s=qZ.exec(e);if(s)return XZ(t,s[1],``),XZ(t,s[2],`list`),XZ(t,s[3],``),s[4]&&XZ(t,s[4],`list`),QZ(t,s[5],``);QZ(t,e,``)}),t}function eQ(e){if(e.startsWith(`/`))return`var(--primary)`;let t=GV(e.slice(1));return t===`var(--muted-foreground)`?`var(--primary)`:t}var tQ=260;function nQ(e,t){if(t.length<=e.length)return;let n=0;for(;n<e.length&&e[n]===t[n];)n++;let r=0;for(;r<e.length-n&&e[e.length-1-r]===t[t.length-1-r];)r++;let i=t.length-r;return i-n>0&&i-n<=24?{start:n,end:i}:void 0}function rQ(e,t,n,r,i){let a=nQ(e,t);if(!a)return[];let o=a.end-a.start;return[...n.filter(e=>i-e.at<tQ&&!(e.start<a.start&&e.end>a.start)).map(e=>e.start>=a.start?{...e,start:e.start+o,end:e.end+o}:e),{...a,seq:r,at:i}].sort((e,t)=>e.start-t.start)}var iQ=(0,m.memo)(function({text:e,fresh:t}){let n=0;return(0,H.jsxs)(H.Fragment,{children:[$Z(e).flatMap((e,r)=>{let i=n;n+=e.text.length;let a=e.kind?e.kind.split(` `).map(e=>`md-${e}`).join(` `):``,o=e.kind===`mention`?{color:eQ(e.text)}:void 0,s=[],c=i;for(let e of t){let t=Math.max(i,e.start),r=Math.min(n,e.end);r<=t||(t>c&&s.push({a:c,b:t}),s.push({a:t,b:r,seq:e.seq}),c=r)}return c<n&&s.push({a:c,b:n}),s.map(({a:t,b:n,seq:s})=>{let c=e.text.slice(t-i,n-i),l=s!==void 0;return a||l?(0,H.jsx)(`span`,{className:[a,l?`md-new`:``].filter(Boolean).join(` `),style:o,children:c},l?`n${s}-${r}`:`${r}-${t}`):c})}),`​`]})}),aQ=(0,m.forwardRef)(function({text:e},t){let n=(0,m.useRef)({text:e,fresh:[],seq:0});if(n.current.text!==e){let t=n.current.seq+1;n.current={text:e,seq:t,fresh:rQ(n.current.text,e,n.current.fresh,t,performance.now())}}return(0,H.jsx)(`div`,{ref:t,className:`bubble-text bubble-mirror`,"aria-hidden":`true`,children:(0,H.jsx)(iQ,{text:e,fresh:n.current.fresh})})}),oQ=e=>e.preventDefault();function sQ({onStop:e}){let[t,n]=(0,m.useState)(!1),r=gk(t,hk.confirm),i=()=>{n(!1),e()};return lA(`y`,i,{enabled:t&&r,inDialog:!0}),(0,H.jsxs)(_V,{open:t&&r,onOpenChange:n,children:[(0,H.jsx)(`button`,{type:`button`,className:`bubble-send bubble-key bubble-stop`,"data-tip":`Interrupt`,onPointerDown:oQ,onClick:()=>n(!0),"aria-label":`Stop`,"aria-haspopup":`dialog`,children:(0,H.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`currentColor`,"aria-hidden":`true`,children:(0,H.jsx)(`rect`,{x:`2`,y:`2`,width:`8`,height:`8`,rx:`1.5`})})}),(0,H.jsxs)(vV,{children:[(0,H.jsxs)(yV,{children:[(0,H.jsx)(xV,{children:`Stop the orchestrator?`}),(0,H.jsx)(SV,{children:`The current response stops. Work already recorded is kept.`})]}),(0,H.jsxs)(bV,{children:[(0,H.jsxs)(wV,{children:[`Cancel`,(0,H.jsx)(ak,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,H.jsxs)(CV,{variant:`destructive`,onClick:i,children:[`Stop`,(0,H.jsx)(ak,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function cQ({sending:e,disabled:t,steering:n,onSend:r}){let[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(e);return(0,m.useEffect)(()=>{if(!i)return;l(!0);let e=setTimeout(()=>l(!1),640);return()=>clearTimeout(e)},[i]),(0,m.useEffect)(()=>{if(e&&!u.current&&a(e=>e+1),u.current=e,!e)return s(!1);let t=setTimeout(()=>s(!0),600);return()=>clearTimeout(t)},[e]),(0,H.jsx)(`button`,{type:`button`,className:Y(`bubble-send`,(!t||c)&&`bubble-key`),"data-tip":n?`Steer`:`Send`,"data-flying":c||void 0,onPointerDown:oQ,onClick:r,disabled:t,"aria-label":`Send`,"aria-keyshortcuts":`Enter`,children:o?(0,H.jsx)(VV,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):(0,H.jsxs)(`span`,{className:`bubble-plane-wrap`,"data-fly":i>0?``:void 0,"aria-hidden":`true`,children:[(0,H.jsxs)(`svg`,{className:`bubble-plane`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`path`,{d:`M22 2L11 13`}),(0,H.jsx)(`path`,{d:`M22 2l-7 20-4-9-9-4z`})]}),(0,H.jsx)(`span`,{className:`bubble-trail`})]},i)})}function lQ(e){return e.agent?GV(e.agent):e.tag===`lobby`?`var(--c-orc)`:e.tag===`skill`?`var(--c-pl)`:`var(--c-qa)`}function uQ(e,t){let n=/^\s*([/@])([a-z0-9:_.-]*)$/i.exec(e.slice(0,t));if(n&&!/\S/.test(e.slice(t,t+1)))return{kind:n[1]===`/`?`slash-command`:`mention`,query:n[2].toLowerCase()}}function dQ(e){return[...Sk.map(e=>({id:`/${e.name}`,insert:`/${e.name}`,label:`/${e.name}`,description:e.hint,tag:`lobby`})),...e.map(e=>({id:`/${e.name}`,insert:`/${e.name}`,label:`/${e.name}`,description:e.description+(e.terminal?` · continue in Pi terminal`:``),tag:e.name.startsWith(`skill:`)?`skill`:`pi`}))]}function fQ(e,t=[]){let n=e.kind===`slash-command`?dQ(t):xk.map(e=>({id:`@${e.name}`,insert:`@${e.name}`,label:`@${e.name}`,description:e.hint,agent:e.agent,tag:`agent`})),r=n.filter((e,t)=>n.findIndex(t=>t.id===e.id)===t),i=r.filter(t=>t.label.slice(1).startsWith(e.query)),a=r.filter(t=>!i.includes(t)&&t.label.slice(1).includes(e.query));return[...i,...a]}function pQ(e,t){return`${e}-${encodeURIComponent(t)}`}var mQ={"slash-command":`Commands`,mention:`Agents`};function hQ(e){return 8+Math.min(e,8)*30}var gQ;function _Q(e,t){let n=0;try{if(gQ??=document.createElement(`canvas`).getContext(`2d`),!gQ)throw Error(`no canvas`);for(let r of e){gQ.font=`500 13px ${t}`;let e=gQ.measureText(r.label.slice(1)).width;gQ.font=`400 12px ${t}`,n=Math.max(n,e+gQ.measureText(r.description).width)}}catch{for(let t of e)n=Math.max(n,t.label.length*7.4+t.description.length*6.1)}return Math.min(Math.max(Math.ceil(n)+128,180),600)}var vQ=(0,m.memo)(function(e){let t=(0,m.useRef)(null);(0,m.useLayoutEffect)(()=>{e.activeItemId&&t.current&&t.current.querySelector(`[data-composer-item-id="${CSS.escape(e.activeItemId)}"]`)?.scrollIntoView({block:`nearest`})},[e.activeItemId]);let n=Math.min(e.items.length,8);return(0,H.jsx)(`div`,{ref:t,id:e.listId,role:`listbox`,"aria-label":mQ[e.triggerKind],"data-composer-command-drawer":`true`,className:`bubble-pane bubble-scroll overflow-y-auto p-1`,style:{height:hQ(e.items.length)},children:e.items.map((t,r)=>{let i=e.activeItemId===t.id;return(0,H.jsxs)(`div`,{id:pQ(e.listId,t.id),role:`option`,"aria-selected":i,"data-composer-item-id":t.id,"data-active":i||void 0,onMouseMove:()=>{i||e.onHighlightedItemChange(t.id)},onMouseDown:e=>e.preventDefault(),onClick:()=>e.onSelect(t),className:`bubble-row`,style:{"--delay":`${Math.max(0,n-1-r)*22}ms`},children:[t.agent?null:(0,H.jsx)(`span`,{className:`bubble-glyph cs-kg`,"aria-hidden":`true`,style:{"--k":lQ(t)},children:t.label.charAt(1).toUpperCase()}),(0,H.jsx)(`span`,{className:`shrink-0 text-sm font-medium text-(--bubble-ink)`,style:t.agent?{color:lQ(t)}:void 0,children:t.label.slice(1)}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-(--bubble-muted)`,children:t.description}),(0,H.jsx)(`span`,{className:`cs-ktag`,style:{"--k":lQ(t)},children:t.tag})]},t.id)})})});function yQ(e){return typeof e==`object`&&e?e:{}}function bQ(e){return typeof e==`string`?e.trim():``}function xQ(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function SQ(e){let t=yQ(e),n=bQ(t.label);if(!n)return;let r=bQ(t.description),i=bQ(t.preview),a=bQ(t.image),o=vq(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function CQ(e){let t=yQ(e),n=bQ(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(SQ).filter(e=>!!e);return{question:n,header:bQ(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function wQ(e){let t=yQ(e),n=bQ(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=bQ(t.message),i=xQ(t.options),a=bQ(t.placeholder),o=bQ(t.prefill);return{id:bQ(t.id),method:n,title:bQ(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function TQ(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(CQ).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function EQ(e){return{kind:`choose`,title:bQ(e.title)||`Choose an option`,options:xQ(e.options)}}function DQ(e){let t=bQ(e.question)||bQ(e.title)||`Continue?`,n=bQ(e.detail)||bQ(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function OQ(e){let t=bQ(e.question)||bQ(e.title)||`Type an answer`,n=bQ(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function kQ(e){let t=yQ(e.payload);if(e.kind===`questionnaire`)return TQ(t);if(e.kind===`choose`)return EQ(t);if(e.kind===`confirm`)return DQ(t);if(e.kind===`text`)return OQ(t);let n=wQ(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}var AQ=`That question was already answered in the terminal.`;function jQ(e){let t=e.from.trim();return/panel|plann/i.test(t)?`PLANNER`:/oracle|orchestrator|master|lobby/i.test(t)||!t?`MASTER`:t.split(/\s+/)[0].toUpperCase()}function MQ(e,t){let n=jQ(e);return n===`PLANNER`&&t&&GV(t)!==`var(--muted-foreground)`?t.toUpperCase():n}function NQ(e,t){let n=MQ(e,t);if(n!==jQ(e))return n===`DEV`||n===`BACKEND`?`Dev`:n===`QA`?`QA`:n.charAt(0)+n.slice(1).toLowerCase();let r=jQ(e);if(r===`PLANNER`)return`Panel`;if(r===`MASTER`)return`Orchestrator`;let i=e.from.trim().split(/\s+/)[0]??`Agent`;return i.charAt(0).toUpperCase()+i.slice(1)}function PQ(e,t){let{round:n,limit:r}=e.payload??{},i=n?`From planning · round ${r?`${Math.min(n,r)}/${r}`:n}`:`From planning`,a=jQ(e)===`PLANNER`?i:e.taskId?`From task ${e.taskId}`:`From the Lobby`;return t&&t!==`Question`&&MQ(e,t)===jQ(e)?`${a} · ${t}`:a}function FQ(e,t,n){let r={prompt:e,view:t,index:0,multi:!1,placeholder:`Or type your own reply…`};if(t.kind===`questionnaire`){let e=t.questions[n];return e?{...r,index:n,question:e.question,header:e.header,multi:!!e.multiSelect,options:e.options.map(e=>({...e,value:e.label})),typed:e=>e}:void 0}if(t.kind===`choose`)return{...r,question:t.title,options:t.options.map(e=>({label:e,value:e}))};if(t.kind===`confirm`)return{...r,question:t.detail?`${t.question}\n\n${t.detail}`:t.question,options:[{label:`Yes`,value:!0},{label:`No`,value:!1}]};if(t.kind===`text`)return{...r,question:t.question,options:[],typed:e=>e,placeholder:t.placeholder||`Type your reply…`};let i=t.dialog,a=i.message?`${i.title}\n\n${i.message}`:i.title;return i.method===`select`?{...r,question:a,options:(i.options??[]).map(e=>({label:e,value:{value:e}}))}:i.method===`confirm`?{...r,question:a,options:[{label:`Yes`,value:{confirmed:!0}},{label:`No`,value:{confirmed:!1}}]}:{...r,question:a,options:[],typed:e=>({value:e}),placeholder:i.placeholder||`Type your reply…`}}function IQ(e,t){return e&&e.kind===`questionnaire`?Math.max(0,e.questions.length-t):1}function LQ(e,t,n){let[r,i]=(0,m.useState)({}),[a,o]=(0,m.useState)([]),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(0),[d,f]=(0,m.useState)(),p=(0,m.useMemo)(()=>e.map(e=>({prompt:e,view:kQ(e)})),[e]),h=p[0],g=h?.view?FQ(h.prompt,h.view,r[h.prompt.id]?.length??0):void 0,_=p.reduce((e,{prompt:t,view:n})=>e+IQ(n,r[t.id]?.length??0),0);(0,m.useEffect)(()=>{e.length===0&&(u(0),i({}))},[e.length]);let v=g?`${g.prompt.id}:${g.index}`:``;(0,m.useEffect)(()=>o([]),[v]);let y=(0,m.useCallback)(async(e,n)=>{c(!0);try{await t(e,n)}catch(e){e instanceof be&&e.code===`question_withdrawn`?W(AQ):W.error(e instanceof Error?e.message:`Could not send the answer`)}finally{c(!1)}},[t]),b=(0,m.useCallback)((e,t=`option`,n)=>{if(!g||s)return;if(u(e=>e+1),g.view.kind!==`questionnaire`)return void y(g.prompt.id,e);let a=[...r[g.prompt.id]??[],{questionIndex:g.index,question:g.question,kind:t,answer:String(e),...n?{selected:n}:{}}];if(a.length<g.view.questions.length)return i(e=>({...e,[g.prompt.id]:a}));y(g.prompt.id,{answers:a,cancelled:!1}).then(()=>i(e=>{let t={...e};return delete t[g.prompt.id],t}))},[s,r,y,g]),x=(0,m.useCallback)(e=>{let t=g?.options[e];if(t){if(g.multi)return o(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);b(t.value)}},[g,b]),S=x,C=(0,m.useCallback)(()=>{if(!g||a.length===0)return;let e=[...a].sort((e,t)=>e-t).map(e=>g.options[e].label);b(e.join(`, `),`multi`,e)},[a,g,b]),w=(0,m.useCallback)(e=>!g?.typed||!e.trim()?!1:(b(g.typed(e.trim()),`custom`),!0),[g,b]),T=(0,m.useCallback)(()=>{g&&n(g.prompt.id).catch(e=>W.error(e instanceof Error?e.message:`Could not dismiss the question`))},[n,g]),E=g?r[g.prompt.id]:void 0,D=(0,m.useCallback)(()=>{if(!g||s||!E?.length)return;let e=E.at(-1);i(e=>({...e,[g.prompt.id]:E.slice(0,-1)})),u(e=>Math.max(0,e-1)),f({id:g.prompt.id,index:e.questionIndex,answer:e.answer??``})},[s,E,g]),O=d&&g&&d.id===g.prompt.id&&d.index===g.index?d.answer:void 0;return{...g?{step:g}:{},position:l+1,total:l+_,left:_,picks:a,busy:s,choose:x,toggle:S,submitPicks:C,reply:w,dismiss:T,...E?.length?{back:D}:{},...O?{was:O}:{}}}function RQ({option:e,large:t}){let n=Eq(e.label);return e.htmlPreview?(0,H.jsx)(Cq,{preview:e.htmlPreview,label:n,frameWidth:t?void 0:880,minWidth:t?1024:void 0,className:`static-thumb h-full`}):e.image?(0,H.jsx)(`img`,{src:I(e.image),alt:t?`Mockup: ${n}`:``,loading:`lazy`}):e.preview?t?(0,H.jsx)(`div`,{className:`cs-mktext`,children:(0,H.jsx)(pV,{text:e.preview})}):(0,H.jsx)(`pre`,{className:`cs-mktext`,children:e.preview}):null}function zQ(e,t){return e!==void 0&&(e===t||e.split(`, `).includes(t))}function BQ({color:e,children:t}){return(0,H.jsx)(`span`,{className:`bubble-glyph cs-kg`,"aria-hidden":`true`,style:{"--k":e},children:t})}function VQ({drawer:e,onExpand:t}){let{step:n}=e,[r,i]=(0,m.useState)(!1);if((0,m.useEffect)(()=>i(!1),[n?.prompt.id]),!n)return(0,H.jsx)(`div`,{className:`bubble-pane p-3 text-sm text-(--bubble-muted)`,children:`No questions are waiting.`});let a=GV(MQ(n.prompt,n.header)),o=n.options.some(Dq),s=n.options.length;return(0,H.jsxs)(`div`,{className:`bubble-pane p-1.5`,role:`group`,"aria-label":`Question`,children:[(0,H.jsxs)(`div`,{className:`cs-askh`,children:[(0,H.jsxs)(`div`,{className:`cs-asks`,children:[(0,H.jsx)(`b`,{style:{color:a},children:NQ(n.prompt,n.header)}),(0,H.jsx)(`span`,{className:`cs-askf`,children:PQ(n.prompt,n.header)}),e.back?(0,H.jsx)(`button`,{type:`button`,className:`cs-askx`,"aria-label":`Back to the previous question`,onMouseDown:e=>e.preventDefault(),onClick:e.back,children:`‹ Back`}):null,(0,H.jsxs)(`span`,{className:`cs-askn`,children:[e.position,` of `,e.total]}),(0,H.jsx)(`button`,{type:`button`,className:`cs-askx`,"data-confirm":r||void 0,onMouseDown:e=>e.preventDefault(),onClick:()=>r?e.dismiss():i(!0),onBlur:()=>i(!1),children:r?`Dismiss it?`:`Dismiss`})]}),(0,H.jsx)(`p`,{className:`cs-askq`,children:n.question})]}),o?(0,H.jsx)(`div`,{className:`cs-askm`,style:{"--cols":s<=2||s===4?2:3},children:n.options.map((n,r)=>(0,H.jsxs)(`button`,{type:`button`,className:`cs-mko`,"data-on":e.picks.includes(r)||zQ(e.was,n.label)||void 0,onMouseDown:e=>e.preventDefault(),onClick:()=>e.choose(r),style:{animationDelay:`${r*30}ms`},children:[(0,H.jsxs)(`div`,{className:`cs-mk3`,children:[(0,H.jsx)(RQ,{option:n}),(0,H.jsx)(`span`,{className:`cs-mxb`,role:`button`,"aria-label":`Expand ${Eq(n.label)}`,onClick:e=>{e.stopPropagation(),t(r)},children:(0,H.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,H.jsx)(`path`,{d:`M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7`})})})]}),(0,H.jsxs)(`span`,{className:`cs-mkl`,children:[(0,H.jsx)(BQ,{color:a,children:r+1}),(0,H.jsx)(`span`,{children:Eq(n.label)})]}),n.description?(0,H.jsx)(`span`,{className:`cs-mkd`,children:n.description}):null]},n.label))}):(0,H.jsxs)(`div`,{className:`cs-askopts`,children:[n.options.map((t,r)=>(0,H.jsxs)(`button`,{type:`button`,className:`bubble-row cs-aro`,"data-active":e.picks.includes(r)||zQ(e.was,t.label)||void 0,onMouseDown:e=>e.preventDefault(),onClick:()=>e.choose(r),style:{"--delay":`${(s-1-r)*22}ms`},children:[(0,H.jsx)(BQ,{color:a,children:r+1}),(0,H.jsxs)(`span`,{className:`cs-arot`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium text-(--bubble-ink)`,children:Eq(t.label)}),t.description?(0,H.jsx)(`span`,{className:`cs-arod`,children:t.description}):null]}),n.multi?(0,H.jsx)(`span`,{className:`cs-cb cs-sm`,"data-on":e.picks.includes(r),children:(0,H.jsx)(km,{"aria-hidden":`true`,strokeWidth:3})}):null]},t.label)),s===0?(0,H.jsx)(`div`,{className:`flex h-9 items-center px-2.5 text-[13px] text-(--bubble-muted)`,children:`Type your reply in the box below, then press Enter.`}):null]}),n.multi?(0,H.jsx)(`button`,{type:`button`,className:`bubble-row`,disabled:e.picks.length===0,onMouseDown:e=>e.preventDefault(),onClick:e.submitPicks,children:(0,H.jsx)(`span`,{className:`text-sm font-medium text-(--bubble-accent)`,children:e.picks.length===0?`Pick one or more`:`Answer with ${e.picks.length} picked`})}):null]})}function HQ({drawer:e,at:t,onAt:n}){let r=e.step,i=r?.options??[],a=t>=0&&t<i.length,o=(0,m.useRef)(t);a&&(o.current=t);let s=i[o.current],c=(0,m.useRef)(null);(0,m.useEffect)(()=>{a&&c.current?.focus({preventScroll:!0})},[a]);let l=e=>n((o.current+e+i.length)%i.length),u=r?GV(MQ(r.prompt,r.header)):`var(--primary)`;return(0,H.jsxs)(`div`,{className:`cs-mxw`,"data-open":a,"aria-hidden":!a,inert:!a,children:[(0,H.jsx)(`div`,{className:`cs-shbd`,onClick:()=>n(-1)}),(0,H.jsxs)(`div`,{ref:c,role:a?`dialog`:void 0,"aria-modal":a?`true`:void 0,"aria-label":s?`Mockup: ${Eq(s.label)}`:`Mockup`,tabIndex:-1,className:`cs-mxc`,onKeyDown:t=>{t.key===`Escape`?(t.preventDefault(),t.stopPropagation(),n(-1)):t.key===`ArrowRight`||t.key===`ArrowLeft`?(t.preventDefault(),l(t.key===`ArrowRight`?1:-1)):t.key===`Enter`&&s&&(t.preventDefault(),n(-1),e.choose(o.current))},children:[(0,H.jsx)(`div`,{className:`cs-mxbig`,children:s?(0,H.jsx)(RQ,{option:s,large:!0}):null}),s&&r?(0,H.jsxs)(`div`,{className:`cs-mxf`,children:[(0,H.jsx)(BQ,{color:u,children:o.current+1}),(0,H.jsx)(`b`,{children:Eq(s.label)}),(0,H.jsxs)(`span`,{className:`cs-mxwho`,children:[NQ(r.prompt,r.header),` · `,r.question]}),i.length>1?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib`,"aria-label":`Previous mockup`,onClick:()=>l(-1),children:(0,H.jsx)(Nm,{"aria-hidden":`true`,className:`size-3.5`})}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib`,"aria-label":`Next mockup`,onClick:()=>l(1),children:(0,H.jsx)(Fm,{"aria-hidden":`true`,className:`size-3.5`})})]}):null,(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-pri`,onClick:()=>{n(-1),e.choose(o.current)},children:r.multi?e.picks.includes(o.current)?`Unpick this`:`Pick this`:`Choose this`}),(0,H.jsx)(`button`,{type:`button`,className:`cs-kc cs-sm cs-ib`,"aria-label":`Close`,onClick:()=>n(-1),children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5`})})]}):null]})]})}var UQ=`bot-lobby.questionsPutAway`,WQ=new Set,GQ;function KQ(){if(GQ!==void 0)return GQ;try{GQ=sessionStorage.getItem(UQ)===`1`}catch{GQ=!1}return GQ}function qQ(e){if(KQ()!==e){GQ=e;try{e?sessionStorage.setItem(UQ,`1`):sessionStorage.removeItem(UQ)}catch{}for(let e of[...WQ])e()}}function JQ(e){return WQ.add(e),()=>{WQ.delete(e)}}function YQ(){return(0,m.useSyncExternalStore)(JQ,KQ,()=>!1)}var XQ={id:`oracle`,label:`Message the team`,placeholder:`Write a message, run a command, or ask an agent`},ZQ=new Set([`lobby`,`tasks`,`plan`,`knowledge`]);function QQ(e){return e.kind===`settings`||e.kind===`tab`&&ZQ.has(e.tab)}var $Q={id:`knowledge`,label:`Ask what the agents know`,placeholder:`Ask what the agents know…`};function e$(e,t){if(e.kind!==`tab`)return XQ;if(e.tab===`knowledge`)return $Q;if(e.tab===`plan`)return{id:`panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`};let n=e.tab===`tasks`?BV(e.rest).id??t:void 0;return n?{id:`comment`,label:`Comment on ${n}`,placeholder:`Comment on ${n}'s plan…`,taskId:n}:XQ}var t$={w:260,h:97},n$=0,r$=document.createElement(`canvas`).getContext(`2d`);function i$(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}var a$={duration:.16,ease:`easeOut`};function o$({file:e,onRemove:t}){let n=(0,H.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:Y(`flex shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,e.image?`absolute top-1 right-1 size-[1.625rem] rounded-full bg-background/85 text-foreground shadow-xs hover:bg-background`:`size-7`),children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,H.jsxs)(Qf.li,{layout:!0,initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},transition:a$,title:`${e.name} · ${cZ(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-xl border border-(--bubble-edge) bg-background`,children:[(0,H.jsx)(`img`,{src:I(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,H.jsxs)(`span`,{className:`pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-center gap-1 bg-background/85 px-1 text-[0.625rem] text-foreground`,children:[(0,H.jsx)(VV,{className:`size-2.5`,"aria-hidden":`true`,role:`presentation`}),`uploading`]}):null,n]}):(0,H.jsxs)(Qf.li,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:a$,className:`flex min-w-0 basis-full items-center gap-2 text-sm text-foreground`,children:[(0,H.jsx)(_h,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[e.state===`uploading`?(0,H.jsx)(VV,{className:`size-2.5`,"aria-hidden":`true`,role:`presentation`}):null,e.state===`uploading`?`uploading…`:cZ(e.size)]}),n]})}var s$=0;function c$(e,t,n,r){let[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(r);o.current=r;let s=n.kind===`tab`?n.tab:n.kind;return(0,m.useEffect)(()=>a(!1),[s]),(0,m.useEffect)(()=>{if(!t)return;let n=0,r=t=>{e.current?.contains(t.target)||(n=performance.now())},i=t=>{[`PageDown`,`PageUp`,`ArrowDown`,`ArrowUp`,`Home`,`End`,` `].includes(t.key)&&!e.current?.contains(t.target)&&(n=performance.now())},s=t=>{let r=e.current;!r||o.current||performance.now()-n>400||r.contains(document.activeElement)||r.contains(t.target)||a(!0)};return document.addEventListener(`wheel`,r,{capture:!0,passive:!0}),document.addEventListener(`touchmove`,r,{capture:!0,passive:!0}),document.addEventListener(`keydown`,i,{capture:!0}),document.addEventListener(`scroll`,s,{capture:!0,passive:!0}),()=>{document.removeEventListener(`wheel`,r,{capture:!0}),document.removeEventListener(`touchmove`,r,{capture:!0}),document.removeEventListener(`keydown`,i,{capture:!0}),document.removeEventListener(`scroll`,s,{capture:!0})}},[t,e]),{shrunk:i,expand:(0,m.useCallback)(()=>a(!1),[])}}function l$({children:e}){return(0,H.jsx)(`kbd`,{className:`bubble-kbd`,"data-glyph":/^[^A-Za-z0-9]$/.test(e)||void 0,children:e})}function u$(e,t,n){let[r,i]=(0,m.useState)({w:250,h:38});return(0,m.useLayoutEffect)(()=>{let r=t.current;if(!r)return;let a=()=>{let t=e===`bar`?{w:Math.ceil(r.scrollWidth),h:aZ(38)}:{w:n??aZ(580),h:Math.ceil(r.scrollHeight)};i(e=>e.w===t.w&&e.h===t.h?e:t)};a();let o=new ResizeObserver(a);for(let e of r.children)o.observe(e);return()=>o.disconnect()}),r}function d$({route:e,projects:t,drawer:n,drawerOpen:r}){let[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)([]),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(null),h=Vk(`status`),g=Vk(`lobby`),_=vk(),v=(h.data?.busy??!1)||!!g.data?.reply?.trim(),y=QQ(e),b=(0,m.useRef)(y);b.current=y;let{taskId:x}=NJ(),S=e.kind===`tab`?e.tab:e.kind,C=(0,m.useMemo)(()=>e$(e,x),[e,x]),w=RA(),[T,E]=(0,m.useState)(-1),D=(0,m.useRef)(null),O=(0,m.useRef)(null),k=(0,m.useRef)(null),A=(0,m.useRef)(null),j=(0,m.useRef)(null),M=(0,m.useRef)(null),N=(0,m.useRef)(null),ee=(0,m.useRef)(null),te=(0,m.useRef)(o);te.current=o;let P=(0,m.useRef)(void 0),[ne,re]=(0,m.useState)(0),[ie,ae]=(0,m.useState)(null),[oe,se]=(0,m.useState)(void 0),ce=r&&!!n.step&&y&&!_&&f===null,le=C.id===`oracle`&&!f&&!ce?uQ(i,ne):void 0,F=(0,m.useMemo)(()=>le?fQ(le,h.data?.commands):[],[le?.kind,le?.query,h.data?.commands]),ue=!!le&&F.length>0&&oe!==i&&y&&!_,de=ue?F.find(e=>e.id===ie)??F[0]:void 0,fe=`composer-suggestions`,I={answer:n.left>0&&!r,plan:S===`plan`&&!!w},L=!ue&&f===null&&!ce&&y&&!_&&(I.answer||I.plan),pe=ue||ce||f!==null&&y&&!_,{shrunk:me,expand:he}=c$(D,y&&!_,e,pe),[ge,_e]=(0,m.useState)(!1),ve=(0,m.useRef)(me);(0,m.useEffect)(()=>{if(ve.current===me)return;ve.current=me,_e(!0);let e=setTimeout(()=>_e(!1),400);return()=>clearTimeout(e)},[me]);let ye=L&&!me&&!ge,be=pe||ye;(0,m.useEffect)(()=>{let e=document.documentElement;return e.style.setProperty(`--dock-bar`,L?oZ(44):`0px`),()=>e.style.setProperty(`--dock-bar`,`0px`)},[L]),(0,m.useEffect)(()=>p(null),[S]),(0,m.useEffect)(()=>{(!y||_)&&p(null)},[y,_]),(0,m.useEffect)(()=>{if(!f)return;let e=e=>{O.current?.contains(e.target)||p(null)};return document.addEventListener(`pointerdown`,e,{capture:!0}),()=>document.removeEventListener(`pointerdown`,e,{capture:!0})},[f]);let xe=(0,m.useCallback)(e=>{he(),p(t=>t===e||e===`projects`&&t===`browse`?null:e)},[he]),Se=(0,m.useCallback)(()=>{p(e=>{let t=e===`attach`?`[data-composer-attach]`:e?`[role="combobox"][aria-label="Project"]`:void 0;return t&&requestAnimationFrame(()=>O.current?.querySelector(t)?.focus({preventScroll:!0})),null})},[]);lA(`p`,()=>xe(`projects`),{enabled:y&&!_&&f===null}),(0,m.useEffect)(()=>{let e=()=>{he(),p(`projects`)};return window.addEventListener(bZ,e),()=>window.removeEventListener(bZ,e)},[he]);let Ce=(0,m.useRef)(`suggest`),we=(0,m.useRef)({w:320,h:0}),Te=f??(ce?`ask`:ue?`suggest`:ye?`bar`:Ce.current),Ee=(0,m.useRef)(null),De=Te===`ask`&&!!n.step?.options.some(Dq),Oe=u$(Te,Ee,Te===`ask`?4e3:void 0);if(be){Ce.current=Te;let e=j.current?getComputedStyle(j.current).fontFamily:`system-ui, sans-serif`;we.current=Te===`suggest`?sZ({w:_Q(F,e),h:hQ(F.length)}):Te===`attach`?sZ(t$):Te===`projects`?sZ(SZ(t)):Te===`bar`||Te===`ask`?Oe:sZ(TZ)}let ke=(0,m.useRef)({items:[],kind:`slash-command`});ue&&le&&de&&(ke.current={items:F,kind:le.kind,lit:de.id});let Ae=(0,m.useCallback)(e=>{let t=i.replace(/^\s*[/@][a-z0-9:_.-]*\s*/i,``),n=`${e.insert} ${t}`,r=e.insert.length+1;P.current={start:r,end:r},re(r),a(n),ae(null),j.current?.focus()},[i]);(0,m.useLayoutEffect)(()=>{let e=P.current,t=j.current;e&&t&&(P.current=void 0,t.setSelectionRange(e.start,e.end))},[i]);let je=(0,m.useCallback)(e=>{P.current={start:e.start,end:e.end},re(e.end),a(e.value)},[]);(0,m.useLayoutEffect)(()=>{let e=A.current,t=O.current;if(!e||!t)return;let n=()=>{t.hasAttribute(`data-shrunk`)||t.style.setProperty(`--ch-open`,`${Math.ceil(e.getBoundingClientRect().height)}px`)};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[me]),(0,m.useLayoutEffect)(()=>{let e=j.current,t=O.current;if(!e||!t)return;if(me||!i)return void t.style.removeProperty(`--cg`);let n=getComputedStyle(e);r$.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`;let r=Math.max(...i.split(`
116
- `).map(e=>r$.measureText(e).width));t.style.setProperty(`--cg`,`${Math.ceil((r+aZ(44))/aZ(48))*aZ(48)}px`)},[i,me]),(0,m.useLayoutEffect)(()=>{M.current&&j.current&&(M.current.scrollTop=j.current.scrollTop)}),(0,m.useEffect)(()=>{let e=k.current,t=D.current;if(!e||!t)return;let n=document.documentElement,r=()=>{let r=e.getBoundingClientRect(),i=t.getBoundingClientRect().bottom,a=t.hasAttribute(`data-shrunk`)||e.closest(`.bubble`)?.hasAttribute(`data-morphing`),o=Math.ceil(i-r.top);if(a||(s$=o),n.style.setProperty(`--composer-h`,_||!y?`0px`:`${a?Math.max(s$,o):o}px`),!y||r.width===0){n.style.removeProperty(`--composer-x`),n.style.removeProperty(`--composer-w`);return}n.style.setProperty(`--composer-x`,`${Math.round(r.left)}px`),n.style.setProperty(`--composer-w`,`${Math.round(r.width)}px`)};r();let i=new ResizeObserver(r);return i.observe(e),e.addEventListener(`transitionend`,r),window.addEventListener(`resize`,r),()=>{i.disconnect(),e.removeEventListener(`transitionend`,r),window.removeEventListener(`resize`,r),n.style.setProperty(`--composer-h`,`0px`),n.style.removeProperty(`--composer-x`),n.style.removeProperty(`--composer-w`)}},[_,y]);let Me=(0,m.useCallback)(e=>{if(!b.current)return;let t=[...e],n=8-te.current.length;t.length>n&&W.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++n$}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;s(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),lZ(e).then(e=>s(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{W.error(e instanceof Error?e.message:`That file did not upload.`),s(e=>e.filter(e=>e.key!==t))})}},[]),Ne=(0,m.useCallback)(e=>{s(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),Pe=o.some(e=>e.state===`uploading`),Fe=o.flatMap(e=>e.info?[e.info.id]:[]),Ie=(i.trim().length>0||Fe.length>0)&&!Pe&&!c,Le=(0,m.useCallback)(async()=>{if(!Ie||!b.current)return;l(!0);let e=Fe.length>0?Fe:void 0,t={text:i,...e?{attachments:e}:{}};try{let e=!0,n=C.id===`knowledge`&&/^\s*[/@]/.test(i);if(C.id===`oracle`||n){let e=await R(`lobby.send`,t);e.notice&&W(e.notice),e.open===`plan`?Dk(Ek(`plan`)):S===`knowledge`&&Dk(Ek(`lobby`))}else C.id===`knowledge`?(e=await G(`knowledge.ask`,t)!==void 0,e&&window.dispatchEvent(new CustomEvent(BA,{detail:i.trim()}))):e=C.id===`panel`?await G(`planner.send`,t)!==void 0:await G(`tasks.comment`,{taskId:C.taskId,...t})!==void 0;if(e){Np(`sent`),a(``);for(let e of te.current)e.image&&URL.revokeObjectURL(e.image);s([])}}catch(e){W.error(e instanceof Error?e.message:`Could not send`)}finally{l(!1)}},[Ie,Fe,C,i,e,S]),Re=(0,m.useCallback)(async()=>{try{await R(`lobby.abort`,{})}catch(e){W.error(e instanceof Error?e.message:`Could not stop`)}},[]),ze=e=>{if(ue&&de&&!e.nativeEvent.isComposing){let t=F.indexOf(de);if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let n=(t+(e.key===`ArrowDown`?1:-1)+F.length)%F.length;ae(F[n].id);return}if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`){e.preventDefault(),Ae(de);return}if(e.key===`Escape`){e.preventDefault(),se(i);return}}if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),f?p(null):ce?qQ(!0):Qk();return}if(ce&&i$(e)){e.preventDefault(),n.reply(i)?a(``):!i.trim()&&n.step?.multi&&n.submitPicks();return}let t=e.currentTarget,r=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&[`b`,`i`,`e`,`k`].includes(r)){e.preventDefault();let{selectionStart:n,selectionEnd:i,value:a}=t;je(r===`k`?dZ(a,n,i):uZ(a,n,i,r===`b`?`**`:r===`i`?`_`:"`"));return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=pZ(t.value,t.selectionStart);n&&(e.preventDefault(),je(n));return}if(e.key===`Backspace`&&t.value===``&&te.current.length>0){e.preventDefault(),Ne(te.current.at(-1).key);return}(i$(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),Le())},Be=e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),Me(t))},Ve=e=>{e.preventDefault(),d(!1),e.dataTransfer.files.length>0&&Me(e.dataTransfer.files)},He=h.data?.workspace.name??`bot-lobby`,Ue=h.data?.branch??h.data?.workspace.branch,We=v&&C.id===`oracle`,Ge=me?S===`knowledge`?`Ask what the agents know…`:`Write a message…`:ce?n.step?.typed?n.step.placeholder:`Pick an answer above`:We?`The orchestrator is working. Enter steers it…`:C.placeholder,Ke=e=>{p(null),e.current?.click()},qe=Te===`ask`?(0,H.jsx)(`div`,{ref:Ee,children:(0,H.jsx)(VQ,{drawer:n,onExpand:E})},`ask`):Te===`bar`?(0,H.jsx)(`div`,{ref:Ee,className:`bubble-pane p-1`,style:{width:`max-content`},children:(0,H.jsxs)(`div`,{className:`cs-pbar`,children:[I.answer?(0,H.jsxs)(`button`,{type:`button`,className:`bubble-row cs-pbq cs-acc`,onMouseDown:e=>e.preventDefault(),onClick:()=>{qQ(!1),requestAnimationFrame(()=>j.current?.focus({preventScroll:!0}))},children:[(0,H.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,H.jsx)(`path`,{d:`M21 12a8 8 0 01-11.6 7.1L4 20l1-4.6A8 8 0 1121 12z`}),(0,H.jsx)(`path`,{d:`M9.6 9.5a2.5 2.5 0 014.8.9c0 1.6-2.4 2-2.4 3.4M12 16.5h.01`})]}),(0,H.jsx)(`span`,{className:`text-sm font-medium text-(--bubble-accent)`,children:`Answer questions`}),(0,H.jsxs)(`span`,{className:`cs-ktag`,style:{"--k":`var(--primary)`},children:[n.left,` left`]})]}):null,I.plan?(0,H.jsxs)(`button`,{type:`button`,className:`bubble-row cs-pbq`,"aria-keyshortcuts":`V`,onMouseDown:e=>e.preventDefault(),onClick:()=>w?.(),children:[(0,H.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,H.jsx)(`path`,{d:`M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z`}),(0,H.jsx)(`path`,{d:`M14 3v5h5M9 13h6M9 17h4`})]}),(0,H.jsx)(`span`,{className:`text-sm font-medium text-(--bubble-ink)`,children:`View plan`}),(0,H.jsx)(`span`,{className:`cs-kb`,children:`V`})]}):null]})},`bar`):Te===`suggest`?(0,H.jsx)(vQ,{listId:fe,items:ue?F:ke.current.items,triggerKind:ue&&le?le.kind:ke.current.kind,activeItemId:de?.id??null,onHighlightedItemChange:ae,onSelect:Ae},`suggest`):Te===`attach`?(0,H.jsxs)(`div`,{role:`menu`,"aria-label":`Attach`,className:`bubble-pane flex flex-col p-1`,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=[...e.currentTarget.querySelectorAll(`[role='menuitem']`)];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus()},children:[(0,H.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`bubble-row`,style:{"--delay":`24ms`},onClick:()=>Ke(N),children:[(0,H.jsx)(_h,{"aria-hidden":`true`,className:`size-4 shrink-0 text-(--bubble-muted)`,strokeWidth:1.7}),(0,H.jsx)(`span`,{className:`text-sm font-medium text-(--bubble-ink)`,children:`Upload a file…`})]}),(0,H.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`bubble-row`,style:{"--delay":`12ms`},onClick:()=>Ke(ee),children:[(0,H.jsx)(Dh,{"aria-hidden":`true`,className:`size-4 shrink-0 text-(--bubble-muted)`,strokeWidth:1.7}),(0,H.jsx)(`span`,{className:`text-sm font-medium text-(--bubble-ink)`,children:`Upload an image…`})]}),(0,H.jsx)(`div`,{className:`h-px`}),(0,H.jsx)(`div`,{className:`flex h-7 items-center px-2 text-[11.5px] text-(--bubble-muted)`,children:`Or drop files on the composer`})]},`attach`):Te===`projects`?(0,H.jsx)(wZ,{projects:t,tab:S,onBrowse:()=>p(`browse`),onClose:()=>p(null)},`projects`):(0,H.jsx)(kZ,{tab:S,onClose:Se},`browse`);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`cs-scrim`,"data-open":pe||void 0,"aria-hidden":`true`}),(0,H.jsx)(`div`,{id:`app-dock`,ref:D,"data-shrunk":me||void 0,onFocus:he,className:Y(`dock pointer-events-none absolute inset-x-0 bottom-0 z-30 px-6 pb-[max(24px,env(safe-area-inset-bottom))] transition-opacity duration-200 ease-snap`,_&&`opacity-0`),hidden:!y,"aria-hidden":!y||void 0,inert:_||!y,children:(0,H.jsx)(BZ,{ref:O,open:be,size:we.current,"data-ask":ce?De?`mockups`:`text`:void 0,shrunk:me,morphing:ge,menu:qe,toasts:y,className:`composer-shell pointer-events-auto`,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||(f?(e.preventDefault(),Se()):ce&&(e.preventDefault(),qQ(!0)))},children:(0,H.jsxs)(`div`,{ref:k,className:`bubble-composer group/composer composer-box`,"data-dragging":u||void 0,"data-chat-composer-main-surface":`true`,onPointerDown:he,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),d(!0))},onDragLeave:()=>d(!1),onDrop:Ve,children:[(0,H.jsxs)(`div`,{ref:A,"data-chat-composer-surface":`true`,children:[(0,H.jsx)(Nu,{initial:!1,children:o.length>0?(0,H.jsx)(Qf.ul,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:`easeOut`},"aria-label":`Attachments`,className:`composer-files flex max-w-full flex-wrap gap-2 overflow-hidden px-3.5 pt-3`,children:o.map(e=>(0,H.jsx)(o$,{file:e,onRemove:()=>Ne(e.key)},e.key))},`files`):null}),(0,H.jsxs)(`div`,{className:`bubble-field`,children:[(0,H.jsx)(aQ,{ref:M,text:i}),(0,H.jsx)(`textarea`,{ref:j,id:`composer-text`,"aria-label":C.label,...C.id===`oracle`?{role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":ue,"aria-controls":ue?fe:void 0}:{},...de?{"aria-activedescendant":pQ(fe,de.id)}:{},value:i,onChange:e=>{a(e.target.value),re(e.target.selectionStart),p(null)},onSelect:e=>re(e.currentTarget.selectionStart),onKeyDown:ze,onPaste:Be,onScroll:e=>{M.current&&(M.current.scrollTop=e.currentTarget.scrollTop)},placeholder:Ge,rows:1,className:`bubble-text bubble-input`}),(0,H.jsx)(UZ,{field:j,mirror:M,text:i})]}),(0,H.jsxs)(`div`,{"data-chat-composer-footer":`true`,className:`bubble-tools composer-tools`,children:[(0,H.jsx)(`button`,{type:`button`,"data-composer-attach":!0,"aria-label":`Attach images, PDFs or files`,"aria-haspopup":`menu`,"aria-expanded":f===`attach`,"data-on":f===`attach`||void 0,"data-tip":`Attach a file`,onPointerDown:e=>e.preventDefault(),onClick:()=>xe(`attach`),className:`bubble-iconbtn bubble-tip bubble-tool size-8 rounded-full`,style:{"--i":0},children:(0,H.jsx)(ag,{"aria-hidden":`true`,className:`size-4`,strokeWidth:1.7})}),(0,H.jsx)(`span`,{className:`bubble-tool flex min-w-0`,style:{"--i":1},children:(0,H.jsx)(CZ,{projects:t,name:He,branch:Ue,open:f===`projects`||f===`browse`,onToggle:()=>xe(`projects`)})}),(0,H.jsx)(`span`,{className:`flex-1`}),(0,H.jsx)(`span`,{className:`bubble-hints bubble-tool`,style:{"--i":2},"aria-hidden":`true`,children:ue?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l$,{children:`↑`}),(0,H.jsx)(l$,{children:`↓`}),`choose`,(0,H.jsx)(l$,{children:`↵`}),`insert`]}):f?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l$,{children:`Esc`}),`close`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l$,{children:`Shift`}),(0,H.jsx)(l$,{children:`↵`}),`new line`]})}),(0,H.jsxs)(`span`,{"data-chat-composer-actions":`right`,className:`bubble-tool flex shrink-0 items-center gap-2`,style:{"--i":3},children:[We?(0,H.jsx)(sQ,{onStop:()=>void Re()}):null,(0,H.jsx)(cQ,{sending:c,disabled:!Ie,steering:We,onSend:()=>void Le()})]})]})]}),(0,H.jsx)(`input`,{ref:N,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{Me(e.target.files??[]),e.target.value=``}}),(0,H.jsx)(`input`,{ref:ee,type:`file`,accept:`image/*`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach images`,onChange:e=>{Me(e.target.files??[]),e.target.value=``}}),u?(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-30 flex items-center justify-center rounded-[inherit] text-sm font-medium text-(--bubble-accent)`,children:`Drop to attach`}):null]})})}),(0,H.jsx)(HQ,{drawer:n,at:ce?T:-1,onAt:E})]})}var f$=3e4,p$,m$=0,h$=new Set;function g$(){for(let e of h$)e()}function _$(){return p$}function v$(e){p$=e,window.clearTimeout(m$),m$=window.setTimeout(y$,f$),g$()}function y$(){p$&&(p$=void 0,window.clearTimeout(m$),g$())}function b$(e){p$&&e&&(e===p$.sessionId||p$.from&&e!==p$.from)&&y$()}function x$(){return(0,m.useSyncExternalStore)(e=>(h$.add(e),()=>h$.delete(e)),()=>p$)}var S$=.6;function C$(e,t,n={}){return{initial:e?void 0:!1,animate:t,transition:{duration:S$,...n}}}var w$=(e,t)=>[0,Math.max(e,.001),Math.min(Math.max(t,e+.01),.999),1];function T$(e,t=0,n=1){return C$(e,{pathLength:[0,0,1,1],strokeOpacity:[0,0,1,1]},{pathLength:{duration:S$,times:w$(t,n),ease:`easeInOut`},strokeOpacity:{duration:S$,times:w$(t,t+.02)}})}function E$(e,t){return C$(e,{scale:[0,0,1.3,1]},{times:w$(t,t+.18),ease:`easeOut`})}function D$(e,t,n=1.3){return C$(e,{scale:[1,1,n,1,1]},{times:[0,Math.max(t,.001),Math.min(t+.15,.9),Math.min(t+.35,.99),1],ease:`easeInOut`})}var O$=(e=.5,t=.5)=>({transformBox:`fill-box`,originX:e,originY:t});function k$({play:e}){return(0,H.jsxs)(Qf.g,{style:O$(.1,.9),...C$(e,{rotate:[0,-12,8,-4,0],scale:[1,1.12,.96,1.02,1]},{ease:`easeInOut`}),children:[(0,H.jsx)(`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}),[8,12,16].map((t,n)=>(0,H.jsx)(Qf.circle,{cx:t,cy:11,r:1.15,fill:`currentColor`,stroke:`none`,...C$(e,{fillOpacity:[0,0,1,1,0],y:[0,0,-1.5,0,0]},{times:[0,.12+n*.12,.24+n*.12,.72,1]})},t))]})}function A$({play:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Qf.path,{d:`M13 5h8`,...T$(e,.15,.45)}),(0,H.jsx)(Qf.path,{d:`M13 12h8`,...T$(e,.3,.6)}),(0,H.jsx)(Qf.path,{d:`M13 19h8`,...T$(e,.45,.75)}),(0,H.jsx)(Qf.path,{d:`m3 17 2 2 4-4`,...T$(e,.35,.7)}),(0,H.jsx)(Qf.path,{d:`m3 7 2 2 4-4`,...T$(e,0,.35)})]})}function j$({play:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Qf.circle,{cx:6,cy:19,r:3,style:O$(),...D$(e,0)}),(0,H.jsx)(Qf.path,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,...T$(e,.1,.7)}),(0,H.jsx)(Qf.circle,{cx:18,cy:5,r:3,style:O$(),...E$(e,.62)})]})}var M$=1.05;function N$(e,t){let n=e=>Math.min(t+e,.999);return C$(e,{scaleX:[1,1,.02,-1,-1,-1],skewY:[0,0,-14,0,0,0],y:[0,0,-1.2,0,0,0],strokeOpacity:[0,0,1,.9,0,0],fillOpacity:[0,0,.22,.14,0,0]},{duration:M$,times:[0,Math.max(t,.001),n(.17),n(.34),n(.4),1],ease:`easeInOut`})}function P$({play:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Qf.g,{style:O$(),...C$(e,{scaleX:[1,1.08,1.06,1],y:[0,-.6,-.4,0]},{duration:M$,times:[0,.15,.8,1],ease:`easeInOut`}),children:[(0,H.jsx)(`path`,{d:`M12 5v16`}),(0,H.jsx)(`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`})]}),e?[.06,.26,.46].map(t=>(0,H.jsx)(Qf.path,{d:`M12 6.4C13.6 5 15.6 4.4 18.6 4.5V16.6C15.6 16.5 13.6 17 12 18.4z`,fill:`currentColor`,strokeWidth:1.4,style:O$(0,.5),...N$(e,t)},t)):null]})}var F$={lobby:k$,tasks:A$,plan:j$,knowledge:P$};function I$({id:e,play:t,className:n}){let r=F$[e];return r?(0,H.jsx)(`svg`,{"aria-hidden":`true`,"data-tab-icon":e,"data-play":t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,className:Y(`overflow-visible`,n),children:(0,H.jsx)(r,{play:t})},t):null}function L$(){let e=(e,t)=>(0,H.jsxs)(`filter`,{id:e,x:`-20%`,y:`-35%`,width:`140%`,height:`170%`,colorInterpolationFilters:`sRGB`,children:[(0,H.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t,result:`b`}),(0,H.jsx)(`feColorMatrix`,{in:`b`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10`,result:`shape`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`1.5`,result:`dn`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`dn`,operator:`out`,result:`rimA`}),(0,H.jsx)(`feGaussianBlur`,{in:`rimA`,stdDeviation:`0.6`,result:`rimB`}),(0,H.jsx)(`feComposite`,{in:`rimB`,in2:`shape`,operator:`in`,result:`rimC`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--hl)`},result:`hlc`}),(0,H.jsx)(`feComposite`,{in:`hlc`,in2:`rimC`,operator:`in`,result:`hl`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`-1`,result:`up`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`up`,operator:`out`,result:`shA`}),(0,H.jsx)(`feGaussianBlur`,{in:`shA`,stdDeviation:`0.6`,result:`shB`}),(0,H.jsx)(`feComposite`,{in:`shB`,in2:`shape`,operator:`in`,result:`shC`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--sh)`},result:`shc`}),(0,H.jsx)(`feComposite`,{in:`shc`,in2:`shC`,operator:`in`,result:`sh`}),(0,H.jsxs)(`feMerge`,{children:[(0,H.jsx)(`feMergeNode`,{in:`shape`}),(0,H.jsx)(`feMergeNode`,{in:`sh`}),(0,H.jsx)(`feMergeNode`,{in:`hl`})]})]});return(0,H.jsx)(`svg`,{width:`0`,height:`0`,className:`absolute`,"aria-hidden":`true`,focusable:`false`,children:(0,H.jsxs)(`defs`,{children:[e(`cs-baylit`,3.5),e(`cs-worklit`,3.2),(0,H.jsxs)(`filter`,{id:`cs-bayedge`,x:`-20%`,y:`-35%`,width:`140%`,height:`170%`,colorInterpolationFilters:`sRGB`,children:[(0,H.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`3.5`,result:`b`}),(0,H.jsx)(`feColorMatrix`,{in:`b`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10`,result:`shape`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`1.5`,result:`dn`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`dn`,operator:`out`,result:`tS0`}),(0,H.jsx)(`feGaussianBlur`,{in:`tS0`,stdDeviation:`0.3`,result:`tS1`}),(0,H.jsx)(`feComposite`,{in:`tS1`,in2:`shape`,operator:`in`,result:`tS`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--ehl)`},result:`tc`}),(0,H.jsx)(`feComposite`,{in:`tc`,in2:`tS`,operator:`in`,result:`eh`}),(0,H.jsx)(`feOffset`,{in:`shape`,dx:`0`,dy:`-1`,result:`up`}),(0,H.jsx)(`feComposite`,{in:`shape`,in2:`up`,operator:`out`,result:`bS0`}),(0,H.jsx)(`feGaussianBlur`,{in:`bS0`,stdDeviation:`0.3`,result:`bS1`}),(0,H.jsx)(`feComposite`,{in:`bS1`,in2:`shape`,operator:`in`,result:`bS`}),(0,H.jsx)(`feFlood`,{style:{floodColor:`var(--esh)`},result:`bc`}),(0,H.jsx)(`feComposite`,{in:`bc`,in2:`bS`,operator:`in`,result:`es`}),(0,H.jsxs)(`feMerge`,{children:[(0,H.jsx)(`feMergeNode`,{in:`shape`}),(0,H.jsx)(`feMergeNode`,{in:`eh`}),(0,H.jsx)(`feMergeNode`,{in:`es`})]})]})]})})}function R$({className:e,style:t}){return(0,H.jsxs)(`div`,{className:e,"aria-hidden":`true`,style:t,children:[(0,H.jsx)(`div`,{className:`cs-layer cs-edge`,children:(0,H.jsx)(`div`,{className:`cs-bb`})}),(0,H.jsx)(`div`,{className:`cs-layer cs-fill`,children:(0,H.jsx)(`div`,{className:`cs-bb`})})]})}function z$(e,t=e){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(void 0);(0,m.useEffect)(()=>()=>window.clearTimeout(o.current),[]);let s=(0,m.useCallback)(()=>{window.clearTimeout(o.current),r(!0)},[]),c=(0,m.useCallback)(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),e)},[e]),l=(0,m.useCallback)(()=>{window.clearTimeout(o.current),r(!0),o.current=window.setTimeout(()=>r(!1),t)},[t]),u=(0,m.useRef)(void 0);(0,m.useEffect)(()=>()=>u.current?.(),[]);let d=e=>{if(e.pointerType!==`touch`)return;let t=e.currentTarget;if(n)e.target.closest(`[role='tab']`)&&c();else{window.clearTimeout(o.current),r(!0),u.current?.();let e=e=>{t.contains(e.target)||(window.clearTimeout(o.current),r(!1),u.current?.())};document.addEventListener(`pointerdown`,e,!0);let n=e=>{e.preventDefault(),e.stopPropagation()};t.addEventListener(`click`,n,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener(`click`,n,!0),500),u.current=()=>{document.removeEventListener(`pointerdown`,e,!0),u.current=void 0}}},f=(0,m.useRef)(null),p=n||i;return(0,m.useEffect)(()=>{if(!p)return;let e=()=>{window.clearTimeout(o.current),r(!1),a(!1);let e=f.current;e&&document.activeElement instanceof HTMLElement&&e.contains(document.activeElement)&&document.activeElement.blur()},t=t=>{let n=t.target;n&&!f.current?.contains(n)&&(n.closest(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)||e())};return document.addEventListener(`pointerdown`,t,!0),window.addEventListener(`blur`,e),()=>{document.removeEventListener(`pointerdown`,t,!0),window.removeEventListener(`blur`,e)}},[p]),{open:p,flash:l,close:()=>{window.clearTimeout(o.current),r(!1)},handlers:{onPointerDown:d,onPointerEnter:e=>{f.current=e.currentTarget,e.pointerType!==`touch`&&s()},onPointerLeave:e=>{if(e.pointerType===`touch`)return;let t=e.currentTarget,n=document.activeElement;n instanceof HTMLElement&&t.contains(n)&&!n.matches(`:focus-visible`)&&!n.matches(`input, textarea`)&&(n.blur(),a(!1)),c()},onFocus:e=>{f.current=e.currentTarget,a(!0)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||a(!1)}}}}function B$({id:e}){let t={width:15,height:15,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`lobby`?(0,H.jsx)(`svg`,{...t,children:(0,H.jsx)(`path`,{d:`M21 12a8 8 0 01-11.6 7.1L4 20l1-4.6A8 8 0 1121 12z`})}):e===`tasks`?(0,H.jsxs)(`svg`,{...t,children:[(0,H.jsx)(`path`,{d:`M9 11l3 3L22 4`}),(0,H.jsx)(`path`,{d:`M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11`})]}):e===`plan`?(0,H.jsxs)(`svg`,{...t,children:[(0,H.jsx)(`path`,{d:`M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3z`}),(0,H.jsx)(`path`,{d:`M9 3v15M15 6v15`})]}):e===`knowledge`?(0,H.jsxs)(`svg`,{...t,children:[(0,H.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 016.5 17H20`}),(0,H.jsx)(`path`,{d:`M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z`})]}):(0,H.jsxs)(`svg`,{...t,children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,H.jsx)(`path`,{d:`M19.4 15a1.7 1.7 0 00.3 1.8l.1.1a2 2 0 11-2.8 2.8l-.1-.1a1.7 1.7 0 00-1.8-.3 1.7 1.7 0 00-1 1.5V21a2 2 0 11-4 0v-.1a1.7 1.7 0 00-1.1-1.5 1.7 1.7 0 00-1.8.3l-.1.1a2 2 0 11-2.8-2.8l.1-.1a1.7 1.7 0 00.3-1.8 1.7 1.7 0 00-1.5-1H3a2 2 0 110-4h.1a1.7 1.7 0 001.5-1.1 1.7 1.7 0 00-.3-1.8l-.1-.1a2 2 0 112.8-2.8l.1.1a1.7 1.7 0 001.8.3H9a1.7 1.7 0 001-1.5V3a2 2 0 114 0v.1a1.7 1.7 0 001 1.5 1.7 1.7 0 001.8-.3l.1-.1a2 2 0 112.8 2.8l-.1.1a1.7 1.7 0 00-.3 1.8V9a1.7 1.7 0 001.5 1H21a2 2 0 110 4h-.1a1.7 1.7 0 00-1.5 1z`})]})}function V$({tabs:e,activeId:t,onSelect:n}){let r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)({}),[o,s]=(0,m.useState)(346),c=e.map(e=>e.label).join(`|`),[l,u]=(0,m.useState)({}),d=(0,m.useRef)(t),f=e.findIndex(e=>e.id===t);(0,m.useEffect)(()=>{d.current!==t&&(d.current=t,t&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&u(e=>({...e,[t]:(e[t]??0)+1})))},[t]),(0,m.useLayoutEffect)(()=>{let e=()=>s(i.current?Math.ceil(i.current.getBoundingClientRect().width):346);e(),document.fonts?.ready.then(e)},[c,t]);function p(r){if(r.key===`ArrowDown`&&!r.altKey){Zk()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let o=r.target.closest(`[role='tab']`)?.id.replace(/^tab-/,``)??t,s=e[(Math.max(0,e.findIndex(e=>e.id===o))+i+e.length)%e.length];$k.active=!0,$k.to=s.id,window.setTimeout(()=>{$k.active=!1,$k.to=void 0},3e3),n(s.id),a.current[s.id]?.focus({preventScroll:!0})}let h={"--wT":`${o}px`,"--hT":oZ(40)};return{vars:h,ghost:(0,H.jsx)(R$,{className:`cs-gt`,style:h}),bay:(0,H.jsxs)(`div`,{className:`cs-tbwrap`,style:h,children:[(0,H.jsx)(`div`,{ref:i,className:`cs-track cs-tsizer`,"aria-hidden":`true`,children:e.map(e=>(0,H.jsxs)(`span`,{className:`cs-tab`,"data-chosen":e.id===t?``:void 0,children:[(0,H.jsx)(`span`,{className:`cs-ti`}),(0,H.jsx)(`span`,{className:`cs-tl`,children:(0,H.jsx)(`span`,{children:e.label})})]},e.id))}),(0,H.jsx)(`div`,{className:`cs-tbx`,children:(0,H.jsx)(`div`,{className:`cs-tbo`,"data-none":t?void 0:``,children:(0,H.jsx)(`div`,{ref:r,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:p,className:`cs-track`,children:e.map((e,n)=>(0,H.jsxs)(`a`,{ref:t=>{a.current[e.id]=t},role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":e.id===t,"aria-keyshortcuts":e.key,"data-tip":e.label,"data-tip-keys":e.key,"data-tip-side":`bottom`,tabIndex:e.id===t||!t&&n===0?0:-1,className:`cs-tab`,"data-side":f<0||n===f?void 0:n<f?`l`:`r`,style:{"--i":n},children:[(0,H.jsx)(`span`,{className:`cs-ti`,children:(0,H.jsx)(I$,{id:e.id,play:l[e.id]??0,className:`size-4`})}),(0,H.jsx)(`span`,{className:`cs-tl`,children:(0,H.jsx)(`span`,{children:e.label})})]},e.id))})})})]})}}function H$({children:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(R$,{className:`cs-gr`}),(0,H.jsx)(`div`,{className:Y(`cs-rbx`),children:e})]})}var U$=(0,m.createContext)(()=>{});function W$({name:e,onRename:t,onArchive:n,onDelete:r,onOpenChange:i}){let a=(0,m.useContext)(U$),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(!1),u=gk(c,hk.confirm),d=(0,m.useRef)(!1),f=o||c;(0,m.useEffect)(()=>{a(f),i?.(f)},[f,a,i]),(0,m.useEffect)(()=>()=>a(!1),[a]);let p=()=>{l(!1),r?.()};lA(`y`,p,{enabled:c&&u,inDialog:!0});let h=[];t&&h.push({key:`R`,label:`Rename`,run:()=>{d.current=!0,t()}}),n&&h.push({key:`A`,label:`Archive`,run:n,rule:h.length>0}),r&&h.push({key:`D`,label:`Delete`,run:()=>l(!0),danger:!0,rule:h.length>0&&!n});let g=e=>{s(!1),window.setTimeout(e.run,0)};return(0,H.jsxs)(_V,{open:c&&u,onOpenChange:l,children:[(0,H.jsxs)(ZD,{open:o,onOpenChange:s,modal:!1,children:[(0,H.jsx)(QD,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`More for ${e}`,className:`cs-sact cs-smore`,children:(0,H.jsx)(ah,{"aria-hidden":`true`,className:`size-4`})})}),(0,H.jsx)($D,{children:(0,H.jsx)(eO,{align:`end`,side:`bottom`,sideOffset:6,collisionPadding:12,loop:!0,onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;let t=h.find(t=>t.key.toLowerCase()===e.key.toLowerCase());t&&(e.preventDefault(),e.stopPropagation(),g(t))},onCloseAutoFocus:e=>{d.current&&e.preventDefault(),d.current=!1},className:`reui-menu cs-smenu`,children:h.map(e=>(0,H.jsxs)(`div`,{className:`contents`,children:[e.rule?(0,H.jsx)(nO,{className:`cs-smenu-rule`}):null,(0,H.jsxs)(tO,{className:`cs-smenu-item`,"data-danger":e.danger||void 0,"aria-keyshortcuts":e.key,onSelect:t=>{t.preventDefault(),g(e)},children:[(0,H.jsx)(`span`,{children:e.label}),(0,H.jsx)(`kbd`,{className:`cs-smenu-key`,children:e.key})]})]},e.key))})})]}),(0,H.jsxs)(vV,{children:[(0,H.jsxs)(yV,{children:[(0,H.jsxs)(xV,{children:[`Delete `,e,`?`]}),(0,H.jsx)(SV,{children:`Its conversation file is removed for good. Archive it instead to keep it.`})]}),(0,H.jsxs)(bV,{children:[(0,H.jsxs)(wV,{children:[`Cancel`,(0,H.jsx)(ak,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,H.jsxs)(CV,{variant:`destructive`,onClick:p,children:[`Delete`,(0,H.jsx)(ak,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function G$(e){return e.waiting>0&&e.alive?`asking`:e.status===`exited`||!e.alive?`exited`:e.busy||e.status===`working`?`working`:e.status===`starting`?`starting`:`idle`}function K$(e,t){let n=e?.sessionId,r={id:`here`,name:e?.sessionName?.trim()||`New session`,where:`here`,state:e?.busy?`working`:`idle`,waiting:0,...n?{sessionId:n}:{}},i=(t?.background??[]).filter(e=>!n||e.sessionId!==n).map(e=>({id:`bg:${e.key}`,name:e.name,where:`background`,state:G$(e),waiting:e.alive?e.waiting:0,key:e.key,...e.sessionId?{sessionId:e.sessionId}:{}})),a=new Set([n,...i.map(e=>e.sessionId)].filter(Boolean)),o=(t?.live??[]).filter(e=>!a.has(e.sessionId)).map(e=>({id:`live:${e.sessionId}`,name:e.name?.trim()||`Unnamed session`,where:`elsewhere`,state:`idle`,waiting:0,sessionId:e.sessionId}));i.sort((e,t)=>Number(e.state===`exited`)-Number(t.state===`exited`));let s=new Set([...a,...o.map(e=>e.sessionId)]),c=(t?.saved??[]).filter(e=>!e.archived&&!s.has(e.sessionId)).map(e=>({id:`saved:${e.sessionId}`,name:e.name,where:`saved`,state:`exited`,waiting:0,sessionId:e.sessionId,at:e.at}));return[r,...i,...o,...c]}var q$=`app.sidebar.pinned`,J$=()=>FH(q$),Y$={w:288,h:`min(${oZ(600)}, calc(100vh - ${oZ(40)}))`},X$=`cs-iconbtn cs-sm`;function Z$(){let e=Vk(`status`).data,t=MV(`sessions.list`,{},[`sessions`]),n=x$();(0,m.useEffect)(()=>{t1=e?.sessionId,b$(e?.sessionId)},[e?.sessionId]);let r=K$(e,t.data);return n?n.id===Q$?r.map(e=>e.where===`here`?{...e,name:`New session`,state:`idle`,switching:!0,fresh:!0}:e):r.map(e=>e.id===n.id?{...e,state:`starting`,switching:!0}:e):r}var Q$=`new`,$$=()=>requestAnimationFrame(()=>document.getElementById(`composer-text`)?.focus());async function e1(){if(Dk(`#/lobby`),_$())return void W.info(`Still switching. One moment.`);v$({id:Q$,...t1?{from:t1}:{}}),$$();try{let{opened:e}=await R(`sessions.new`,{});e||y$()}catch(e){y$(),W.error(e instanceof Error?e.message:`Could not open a new session. Try again.`)}}var t1;async function n1(e){if(e.where===`here`)return Dk(`#/lobby`);if(e.where===`elsewhere`)return void W.info(`${e.name} runs in another terminal. Switch to that terminal to work in it.`);if(_$())return void W.info(`Still switching. One moment.`);v$({id:e.id,...e.sessionId?{sessionId:e.sessionId}:{},...t1?{from:t1}:{}}),Dk(`#/lobby`);let t=await G(`sessions.switch`,e.key?{key:e.key}:{sessionId:e.sessionId});(!t||!/switching this window/.test(t.notice))&&y$()}function r1(){return(0,m.useCallback)(n1,[])}var i1={entries:[]};async function a1(e){let t=i1.entries.filter(e=>e.where!==`elsewhere`),n=t.findIndex(e=>e.where===`here`);if(t.length<2||n<0)return void W.info(`No other session to switch to.`);i1.flash?.(),await n1(t[(n+e+t.length)%t.length])}function o1({entry:e}){return e.where!==`elsewhere`&&e.state===`asking`?(0,H.jsxs)(`span`,{className:`cs-badge`,children:[(0,H.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,H.jsx)(`path`,{d:`M9.1 9a3 3 0 015.8 1c0 2-3 2.5-3 4M12 17h.01`})]}),e.waiting,(0,H.jsxs)(`span`,{className:`sr-only`,children:[e.waiting===1?` question`:` questions`,`, Waiting`]})]}):e.where!==`elsewhere`&&(e.state===`working`||e.state===`starting`)?(0,H.jsxs)(`span`,{className:Y(`inline-flex shrink-0`,e.state===`working`?`text-primary`:`text-muted-foreground`),children:[(0,H.jsx)(Um,{"aria-hidden":`true`,className:`session-spin size-3.5`}),(0,H.jsx)(`span`,{className:`sr-only`,children:e.state===`working`?`Working`:`Starting`})]}):(0,H.jsx)(`span`,{className:`sr-only`,children:e.where===`elsewhere`?`Other terminal`:e.state===`exited`?`Ended`:`Idle`})}var s1={here:`Current`,background:`Background`,elsewhere:`Other terminal`,saved:`Recent`};function c1(e){let t=e.key?{key:e.key}:{sessionId:e.sessionId};return G(`sessions.archive`,t,{undo:()=>void G(`sessions.archive`,{...t,archived:!1})})}function l1({entry:e,onDone:t}){let[n,r]=(0,m.useState)(e.name),i=(0,m.useRef)(!1),a=async()=>{if(i.current)return;i.current=!0;let r=n.replace(/\s+/g,` `).trim();r&&r!==e.name&&await G(`sessions.rename`,{...e.where===`here`?{}:{key:e.key},name:r}),t()};return(0,H.jsx)(`input`,{value:n,autoFocus:!0,maxLength:120,"aria-label":`New name for ${e.name}`,onFocus:e=>e.currentTarget.select(),onChange:e=>r(e.target.value),onBlur:()=>void a(),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),a()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i.current=!0,t())},className:`h-7 w-full min-w-0 rounded-md bg-[var(--fill)] px-1.5 text-[14px] text-foreground outline-none ring-2 ring-ring`})}function u1({entry:e,index:t}){let n=r1(),[r,i]=(0,m.useState)(!1),a=e.state===`exited`||e.where===`elsewhere`,o=e.where===`here`||e.where===`background`,s=e.where===`background`&&e.state===`exited`&&!!e.key||e.where===`saved`,c=e.where===`saved`,l=o||s||c,u={"--i":t},[d,f]=(0,m.useState)(!1);return(0,H.jsxs)(`li`,{className:`cs-srow session-item`,"data-fresh":e.fresh||void 0,"data-menu":d||void 0,"data-acts":l||void 0,children:[r?(0,H.jsx)(`div`,{className:`cs-sr`,"data-active":e.where===`here`||void 0,style:u,children:(0,H.jsx)(l1,{entry:e,onDone:()=>i(!1)})}):(0,H.jsxs)(`button`,{type:`button`,"aria-current":e.where===`here`?`true`:void 0,"aria-label":e.where===`here`?`${e.name}, this window`:e.where===`elsewhere`?`${e.name}, in another terminal`:`Switch to ${e.name}`,...qz(e.name,{side:`right`}),"data-tip-trunc":``,"data-where":e.where,"data-state":e.state,"data-dim":a||void 0,"data-active":e.switching||void 0,"aria-busy":e.switching||void 0,onClick:()=>void n(e),onDoubleClick:e=>{o&&(e.preventDefault(),i(!0))},className:`cs-sr session-row`,style:u,children:[(0,H.jsx)(`span`,{className:`cs-grow`,children:e.name}),(0,H.jsx)(`span`,{className:Y(`flex shrink-0 items-center`,l&&`cs-sstate`),children:(0,H.jsx)(o1,{entry:e})})]}),!r&&l?(0,H.jsx)(`span`,{className:`cs-sacts`,children:(0,H.jsx)(W$,{name:e.name,onOpenChange:f,...o?{onRename:()=>i(!0)}:{},...s?{onArchive:()=>void c1(e)}:{},...c?{onDelete:()=>void G(`sessions.delete`,{sessionId:e.sessionId})}:{}})}):null]})}function d1({id:e,label:t,entries:n,start:r,archivable:i=!1}){let[a,o]=IH(`app.sidebar.${e}`),s=(0,m.useId)();return n.length===0?null:(0,H.jsxs)(`section`,{"aria-label":t,className:`group/shelf flex flex-col`,children:[(0,H.jsxs)(`div`,{className:`cs-sh`,style:{"--i":r},children:[(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":!a,"aria-controls":s,onClick:o,className:`cs-shf flex flex-1 items-center gap-1.5 text-left`,children:[(0,H.jsx)(`span`,{children:t}),a?(0,H.jsx)(`span`,{className:`tabular-nums`,children:n.length}):null,(0,H.jsx)(jm,{"aria-hidden":`true`,className:Y(`size-3 opacity-0 transition-[opacity,rotate] duration-150 group-hover/shelf:opacity-100 group-focus-within/shelf:opacity-100`,a&&`-rotate-90 opacity-100`)})]}),i?(0,H.jsx)(`button`,{type:`button`,onClick:()=>void(async()=>{for(let e of n)await G(`sessions.archive`,e.key?{key:e.key}:{sessionId:e.sessionId})})(),className:`cs-shf shrink-0`,children:`Archive all`}):null]}),a?null:(0,H.jsx)(`ul`,{id:s,className:`flex flex-col`,children:n.map((e,t)=>(0,H.jsx)(u1,{entry:e,index:r+1+t},e.id))})]})}function f1(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean),r=`${e.name} ${s1[e.where]}`.toLowerCase();return n.every(e=>r.includes(e))}var p1=(0,H.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,H.jsx)(`path`,{d:`M12 20h9`}),(0,H.jsx)(`path`,{d:`M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z`})]});function m1({hint:e}){return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>void e1(),"aria-keyshortcuts":e,className:`cs-sr cs-snew`,style:{"--i":0},children:[p1,(0,H.jsx)(`span`,{className:`cs-grow`,children:`New session`}),(0,H.jsx)(ak,{chord:e,className:`cs-kbd-quiet`})]})}function h1({query:e,onQuery:t}){return(0,H.jsxs)(`label`,{className:`cs-sr cs-search`,style:{"--i":1},children:[(0,H.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,H.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,H.jsx)(`path`,{d:`M21 21l-4.3-4.3`})]}),(0,H.jsx)(`input`,{type:`search`,value:e,"aria-label":`Search sessions`,placeholder:`Search`,onChange:e=>t(e.target.value),onKeyDown:n=>{n.key===`Escape`&&e&&(n.preventDefault(),n.stopPropagation(),t(``))}})]})}function g1({query:e}){let t=Z$().filter(t=>f1(t,e)),n=[...t.filter(e=>e.where===`here`&&e.state!==`exited`),...t.filter(e=>e.where===`background`&&e.state!==`exited`)],r=t.filter(e=>e.where===`elsewhere`),i=t.filter(e=>e.where!==`elsewhere`&&e.state===`exited`),a=2,o=e=>{let t=a;return a+=e+1,t},s=o(n.length);return(0,H.jsxs)(`nav`,{"aria-label":`Sessions list`,className:`cs-sblist`,children:[t.length===0?(0,H.jsxs)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:[`No sessions match “`,e.trim(),`”.`]}):null,n.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`cs-sh`,style:{"--i":s},children:`Sessions`}),(0,H.jsx)(`ul`,{className:`flex flex-col`,children:n.map((e,t)=>(0,H.jsx)(u1,{entry:e,index:s+1+t},e.id))})]}):null,(0,H.jsx)(d1,{id:`ended`,label:`Recent`,entries:i,start:o(i.length),archivable:!0}),(0,H.jsx)(d1,{id:`elsewhere`,label:`Other terminals`,entries:r,start:o(r.length)})]})}function _1({route:e,keys:t,onHelp:n}){let r=t.settings??`Alt+S`;return(0,H.jsxs)(`div`,{className:`cs-sbfoot`,children:[(0,H.jsxs)(`a`,{href:`#/settings`,"aria-label":`Settings`,"aria-current":e.kind===`settings`?`page`:void 0,"aria-keyshortcuts":r,className:`cs-sr`,style:{"--i":20},children:[(0,H.jsx)(B$,{id:`settings`}),(0,H.jsx)(`span`,{className:`cs-grow`,children:`Settings`}),(0,H.jsx)(ak,{chord:r})]}),(0,H.jsxs)(`div`,{className:`cs-sr cs-tools`,style:{"--i":21},children:[(0,H.jsx)($X,{hint:t.help??`Alt+H`,onHelp:n,className:X$}),(0,H.jsx)(eZ,{className:X$}),(0,H.jsx)(nZ,{className:X$}),(0,H.jsx)(rZ,{className:X$})]})]})}function v1(e){let[t,n]=IH(q$),r=z$(160,1600);i1.entries=Z$(),i1.flash=r.flash;let[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(!1),c=t||r.open||o,l={"--wL":oZ(c?Y$.w:122),"--hL":c?Y$.h:oZ(40),"--sb-open-h":Y$.h};return{open:c,pinned:t,ghost:(0,H.jsx)(R$,{className:`cs-gl`,style:l}),bay:(0,H.jsx)(`div`,{className:`cs-sbwrap`,style:l,...r.handlers,children:(0,H.jsxs)(`aside`,{id:`app-sidebar`,"aria-label":`Sidebar`,className:`cs-sbx`,children:[(0,H.jsxs)(`div`,{className:`cs-sbmini`,inert:c,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Sessions`,"aria-pressed":t,"aria-keyshortcuts":e.keys.sidebar,onClick:n,className:`cs-iconbtn`,...qz(t?`Unpin sidebar`:`Pin sidebar`,{keys:e.keys.sidebar,side:`bottom`,keep:!0}),children:(0,H.jsx)(B$,{id:`lobby`})}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`New session`,"aria-keyshortcuts":e.keys.newSession,onClick:()=>void e1(),className:`cs-iconbtn`,...qz(`New session`,{keys:e.keys.newSession??`Alt+N`,side:`bottom`}),children:(0,H.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,H.jsx)(`path`,{d:`M12 20h9`}),(0,H.jsx)(`path`,{d:`M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z`})]})}),(0,H.jsx)(`a`,{href:`#/settings`,"aria-label":`Settings`,"aria-current":e.route.kind===`settings`?`page`:void 0,className:`cs-iconbtn`,...qz(`Settings`,{keys:e.keys.settings??`Alt+S`,side:`bottom`}),children:(0,H.jsx)(B$,{id:`settings`})})]}),(0,H.jsxs)(`div`,{className:`cs-sbfull`,inert:!c,children:[(0,H.jsx)(m1,{hint:e.keys.newSession??`Alt+N`}),(0,H.jsx)(h1,{query:i,onQuery:a}),(0,H.jsx)(U$.Provider,{value:s,children:(0,H.jsx)(g1,{query:i})}),(0,H.jsx)(_1,{...e})]})]})})}}var y1=`modulepreload`,b1=function(e){return`/`+e},x1={},S1=function(e){return e.pathname.endsWith(`.css`)},C1=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=b1(t,n);let r=s(t);if(r.href in x1)return;x1[r.href]=!0;let i=S1(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:y1,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},w1=(0,m.lazy)(()=>C1(()=>import(`./TerminalView-BQ_vyCt-.js`),__vite__mapDeps([0,1,2,3]))),T1=`inline-flex size-6 items-center justify-center text-foreground/80 outline-none transition-colors duration-150 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40 aria-pressed:bg-accent aria-pressed:text-foreground`;function E1({hint:e,className:t}){let n=oK();return(0,H.jsx)(eB,{side:`top`,label:n?`Hide terminal`:`Terminal`,hint:e,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Terminal`,"aria-pressed":n,"aria-controls":n?`terminal-drawer`:void 0,"aria-keyshortcuts":e,onClick:iK,className:t,children:(0,H.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,H.jsx)(`path`,{d:`M4 17l6-6-6-6M12 19h8`})})})})}function D1(e){let[t,n]=(0,m.useState)(),[r,i]=(0,m.useState)(``),a=(0,m.useCallback)(async()=>{try{n(await R(`terminal.list`,{})),i(``)}catch(e){i(e instanceof Error?e.message:`The terminals could not be read.`)}},[]);return(0,m.useEffect)(()=>{e&&a()},[e,a]),{list:t,error:r,reload:a}}function O1({height:e,max:t}){let n=(0,m.useRef)(null);return(0,H.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-label":`Resize terminal`,"aria-orientation":`horizontal`,"aria-valuenow":e,"aria-valuemin":KG.min,"aria-valuemax":t,className:`terminal-edge`,onPointerDown:t=>{t.button===0&&(t.currentTarget.setPointerCapture?.(t.pointerId),n.current={y:t.clientY,height:e},document.documentElement.dataset.resizing=`row`)},onPointerMove:e=>{n.current&&aK(Math.min(t,n.current.height+n.current.y-e.clientY))},onPointerUp:()=>{n.current=null,delete document.documentElement.dataset.resizing},onPointerCancel:()=>{n.current=null,delete document.documentElement.dataset.resizing},onDoubleClick:()=>aK(KG.start),onKeyDown:n=>{(n.key===`ArrowUp`||n.key===`ArrowDown`)&&(n.preventDefault(),aK(Math.min(t,e+(n.key===`ArrowUp`?24:-24))))}})}function k1({toggleKey:e}){let t=oK(),n=uK(),r=sK(),i=gk(t&&n,hk.sheet),{list:a,error:o,reload:s}=D1(t),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(()=>Math.round(window.innerHeight*.7)),h=a?.terminals??[],g=h.find(e=>e.id===c)??h.at(-1),_=pK();(0,m.useEffect)(()=>{_&&(l(_.id),s())},[_,s]),(0,m.useEffect)(()=>{let e=()=>p(Math.round(window.innerHeight*.7));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let v=(0,m.useCallback)(async()=>{d(!0);try{let e=await R(`terminal.open`,{cols:100,rows:24});l(e.id),await s()}catch(e){W.error(e instanceof Error?e.message:`The terminal did not start.`)}finally{d(!1)}},[s]),y=(0,m.useCallback)(async e=>{try{await R(`terminal.close`,{id:e})}catch{}await s()},[s]);(0,m.useEffect)(()=>{if(!t||h.length<2)return;let e=e=>{if(!e.ctrlKey||e.altKey||e.metaKey||e.key!==`PageDown`&&e.key!==`PageUp`)return;e.preventDefault();let t=Math.max(0,h.findIndex(e=>e.id===g?.id)),n=h[(t+(e.key===`PageDown`?1:-1)+h.length)%h.length];l(n.id)};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[t,h,g?.id]);let b=(0,m.useRef)(!1);(0,m.useEffect)(()=>{if(!t){b.current=!1;return}!a||!a.available||a.terminals.length>0||b.current||u||(b.current=!0,v())},[t,a,u,v]);let x=t&&!n?Math.min(r,f):0;if((0,m.useEffect)(()=>{let e=document.documentElement;return x?e.style.setProperty(`--terminal-h`,`${x}px`):e.style.removeProperty(`--terminal-h`),()=>{e.style.removeProperty(`--terminal-h`)}},[x]),!t)return null;let S=(0,H.jsx)(A1,{list:a,error:o,terminals:h,shown:g,busy:u,popup:n,toggleKey:e,onPick:l,onStart:()=>void v(),onEnd:e=>void y(e),onReload:()=>void s()});return n?(0,H.jsx)(ck,{open:i,onOpenChange:e=>{e||rK(!1)},label:`Terminal`,className:`terminal-pop h-[min(72svh,40rem)] max-h-none max-w-5xl`,onEscapeKeyDown:e=>{e.target?.closest?.(`.xterm`)&&e.preventDefault()},children:(0,H.jsx)(`div`,{id:`terminal-drawer`,className:`flex min-h-0 flex-1`,children:S})}):(0,H.jsxs)(`section`,{id:`terminal-drawer`,"aria-label":`Terminal`,className:`terminal-drawer relative flex shrink-0 border-t border-border`,style:{height:Math.min(r,f)},children:[(0,H.jsx)(O1,{height:Math.min(r,f),max:f}),S]})}function A1({list:e,error:t,terminals:n,shown:r,busy:i,popup:a,toggleKey:o,onPick:s,onStart:c,onEnd:l,onReload:u}){let d=(0,H.jsxs)(`div`,{className:`terminal-tools pointer-events-auto inline-flex items-center overflow-hidden rounded-md border border-border/80 bg-background shadow-xs`,children:[(0,H.jsx)(eB,{side:`top`,label:`New terminal`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`New terminal`,disabled:i||e?.available===!1,onClick:c,className:T1,children:(0,H.jsx)(_g,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border/80`}),(0,H.jsx)(eB,{side:`top`,label:`End this terminal`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`End this terminal`,disabled:!r,onClick:()=>r&&l(r.id),className:T1,children:(0,H.jsx)(qg,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border/80`}),(0,H.jsx)(eB,{side:`top`,label:a?`Back to the drawer`:`Open in a pop-up`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Pop out terminal`,"aria-pressed":a,onClick:()=>lK(!a),className:T1,children:(0,H.jsx)(dg,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border/80`}),(0,H.jsx)(eB,{side:`top`,label:`Hide terminal`,hint:o,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Hide terminal`,onClick:()=>rK(!1),className:T1,children:a?(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-3.5`}):(0,H.jsx)(jm,{"aria-hidden":`true`,className:`size-3.5`})})})]}),f=(0,H.jsx)(H.Fragment,{children:e&&!e.available?(0,H.jsx)(`p`,{className:`flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground`,children:e.reason}):t?(0,H.jsx)(`p`,{role:`alert`,className:`flex h-full items-center justify-center px-6 text-center text-sm text-destructive`,children:t}):(0,H.jsxs)(m.Suspense,{fallback:(0,H.jsx)(`p`,{className:`p-3 text-xs text-muted-foreground`,children:`Loading the terminal…`}),children:[e&&n.length===0&&!i?(0,H.jsx)(`p`,{className:`p-3 text-xs text-muted-foreground`,children:`No terminal is running. Start one with New terminal.`}):null,n.map(e=>(0,H.jsx)(w1,{id:e.id,active:e.id===r?.id,toggleKey:o,onExit:u},e.id))]})}),p=n.length>1?(0,H.jsx)(`nav`,{"aria-label":`Terminals`,className:Y(`flex w-36 shrink-0 flex-col gap-0.5 overflow-y-auto border-l border-border px-1 pb-1`,a?`pt-2`:`pt-10`),children:n.map(e=>(0,H.jsxs)(`button`,{type:`button`,"aria-current":e.id===r?.id?`true`:void 0,onClick:()=>s(e.id),className:Y(`flex h-6 min-w-0 items-center gap-1.5 rounded px-1.5 text-left text-xs text-muted-foreground outline-none transition-colors duration-150 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=true]:bg-accent aria-[current=true]:text-foreground`,!e.alive&&`opacity-60`),children:[(0,H.jsx)(Vg,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.title}),e.alive?null:(0,H.jsx)(`span`,{className:`sr-only`,children:`, ended`})]},e.id))}):null;return a?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border/70 pr-2 pl-4`,children:[(0,H.jsx)(Vg,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:`Terminal`}),d]}),(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1 py-2 pl-2`,children:(0,H.jsx)(`div`,{className:`relative h-full`,children:f})}),p]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[f,(0,H.jsx)(`div`,{className:`pointer-events-none absolute top-2 right-2 z-20`,children:d})]}),p]})}var j1=(0,m.lazy)(()=>C1(()=>import(`./CodeSurface-raLMzkDq.js`),__vite__mapDeps([4,1,2]))),M1=`inline-flex size-7 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors duration-150 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40 aria-pressed:bg-accent aria-pressed:text-foreground`;function N1({hint:e,className:t}){let{open:n}=UB();return(0,H.jsx)(eB,{side:`bottom`,label:`Code and changes`,hint:e,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Code`,"aria-pressed":n,"aria-keyshortcuts":e,onClick:()=>n?VB():BB(),className:t,children:(0,H.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,H.jsx)(`path`,{d:`M16 18l6-6-6-6M8 6l-6 6 6 6`})})})})}var P1={modified:{letter:`M`,word:`Modified`,tone:`text-warning`},added:{letter:`A`,word:`Added`,tone:`text-success`},untracked:{letter:`U`,word:`New, not committed`,tone:`text-success`},deleted:{letter:`D`,word:`Deleted`,tone:`text-destructive`},renamed:{letter:`R`,word:`Renamed`,tone:`text-primary`}};function F1(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t),name:e.slice(t+1)}}function I1({change:e,className:t}){return e.additions===void 0&&e.deletions===void 0?null:(0,H.jsxs)(`span`,{className:Y(`shrink-0 font-mono text-[0.6875rem] tabular-nums`,t),children:[(0,H.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,H.jsxs)(`span`,{className:`text-destructive`,children:[`−`,e.deletions??0]})]})}function L1(){let[e,t]=(0,m.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,m.useEffect)(()=>{let e=document.documentElement,n=new MutationObserver(()=>t(e.classList.contains(`dark`)));return n.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>n.disconnect()},[]),e}function R1({changes:e,loading:t,error:n,current:r,onPick:i,onRefresh:a}){let[o,s]=(0,m.useState)(``),c=e?.files??[],l=c.reduce((e,t)=>({additions:e.additions+(t.additions??0),deletions:e.deletions+(t.deletions??0)}),{additions:0,deletions:0});function u(e){e.preventDefault();let t=o.trim();t&&(i(t),s(``))}return(0,H.jsxs)(`nav`,{"aria-label":`Changed files`,className:`code-rail flex w-64 shrink-0 flex-col border-r border-border max-md:w-52`,children:[(0,H.jsx)(`form`,{onSubmit:u,className:`border-b border-border p-2`,children:(0,H.jsxs)(`label`,{className:`flex h-8 items-center gap-2 rounded-md border border-input bg-background px-2 transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/20`,children:[(0,H.jsx)(jg,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,H.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),"aria-label":`Open a file by path`,placeholder:`Open a file by path…`,spellCheck:!1,autoComplete:`off`,className:`h-full min-w-0 flex-1 bg-transparent font-mono text-xs outline-none placeholder:font-sans placeholder:text-muted-foreground`})]})}),(0,H.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-3 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-medium text-foreground`,children:`Changes`}),(0,H.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[c.length,e?.truncated?`+`:``]}),(0,H.jsx)(I1,{change:l,className:`ml-auto`}),(0,H.jsx)(eB,{side:`bottom`,label:`Read the changes again`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Refresh changes`,onClick:a,disabled:t,className:Y(M1,`-mr-1.5 size-6`,c.length?``:`ml-auto`),children:(0,H.jsx)(yg,{"aria-hidden":`true`,className:Y(`size-3.5`,t&&`animate-spin motion-reduce:animate-none`)})})})]}),(0,H.jsxs)(`ul`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-1.5 pb-2`,children:[c.map(e=>{let{dir:t,name:n}=F1(e.path),a=P1[e.status];return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>i(e.path),"aria-current":e.path===r?`true`:void 0,"data-tip":e.from?`${e.from} → ${e.path}`:e.path,className:`group/row flex h-7 w-full min-w-0 items-center gap-2 rounded-md px-1.5 text-left text-[0.8125rem] outline-none transition-colors duration-150 hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=true]:bg-accent`,children:[(0,H.jsx)(`span`,{"aria-label":a.word,className:Y(`w-3 shrink-0 text-center font-mono text-[0.6875rem] font-semibold`,a.tone),children:a.letter}),(0,H.jsxs)(`span`,{className:Y(`min-w-0 flex-1 truncate`,e.status===`deleted`&&`text-muted-foreground line-through decoration-muted-foreground/50`),children:[n,t?(0,H.jsx)(`span`,{className:`ml-1.5 text-xs text-muted-foreground`,children:t}):null]}),(0,H.jsx)(I1,{change:e})]})},e.path)}),e&&!e.git?(0,H.jsx)(`li`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`This folder is not a git repository, so there are no changes to show. Open a file by its path above.`}):null,e?.git&&c.length===0?(0,H.jsx)(`li`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`No changes since the last commit.`}):null,n?(0,H.jsx)(`li`,{role:`alert`,className:`px-2 py-3 text-xs text-destructive`,children:n}):null]})]})}function z1(e){let[t,n]=(0,m.useState)(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(!1),s=(0,m.useRef)(0),c=(0,m.useCallback)(async e=>{let t=++s.current;o(!0),i(void 0);try{let r=await R(`code.read`,{path:e});t===s.current&&n(e=>({file:r,version:(e?.version??0)+1}))}catch(e){t===s.current&&(n(void 0),i(e instanceof Error?e.message:String(e)))}finally{t===s.current&&o(!1)}},[]);return(0,m.useEffect)(()=>{e?c(e):(s.current++,n(void 0),i(void 0))},[e,c]),{loaded:t,setLoaded:n,error:r,loading:a,reload:()=>e&&c(e)}}function B1({requested:e,requestedMode:t,request:n,codeKey:r,onClose:i,onDirtyChange:a,closeAsked:o}){let s=MV(`code.changes`,{},[`lobby`,`tasks`]),[c,l]=(0,m.useState)(e),[u,d]=(0,m.useState)(t??`code`),{loaded:f,setLoaded:p,error:h,loading:g,reload:_}=z1(c),[v,y]=(0,m.useState)(),[b,x]=(0,m.useState)(!1),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(),E=XB(),D=ZB(),O=L1(),k=f?.file,A=v!==void 0&&v!==k?.contents;(0,m.useEffect)(()=>a(A),[A,a]),(0,m.useEffect)(()=>{if(!e||e===c){t&&d(t);return}M({kind:`open`,path:e})},[n]),(0,m.useEffect)(()=>{if(!c&&s.data?.files[0]){let e=s.data.files.find(e=>e.status!==`deleted`)??s.data.files[0];l(e.path),t||d(`diff`)}},[s.data]),(0,m.useEffect)(()=>{k&&k.path!==c&&l(k.path)},[k?.path]),(0,m.useEffect)(()=>{o&&M({kind:`close`})},[o]);function j(e){if(T(void 0),C(!1),e.kind===`close`){i();return}y(void 0),l(e.path)}function M(e){(e.kind!==`open`||e.path!==c)&&(A?T(e):j(e))}async function N(e=!1){if(k&&v!==void 0&&!b){x(!0);try{let t=await R(`code.save`,{path:k.path,contents:v,mtimeMs:k.mtimeMs,...e?{force:!0}:{}});return p(e=>e&&{...e,file:{...e.file,contents:v,mtimeMs:t.mtimeMs,size:v.length}}),y(void 0),C(!1),s.reload(),w&&j(w),!0}catch(e){return e instanceof be&&e.code===`conflict`?C(!0):W.error(e instanceof Error?e.message:`The file could not be saved.`),!1}finally{x(!1)}}}function ee(e){(e.ctrlKey||e.metaKey)&&!e.altKey&&e.key.toLowerCase()===`s`?(e.preventDefault(),e.stopPropagation(),N()):r&&NX(e.nativeEvent,r)&&(e.preventDefault(),M({kind:`close`}))}let te=k?.change,P=!!te||k?.original!==void 0,ne=P?u:`code`,{dir:re,name:ie}=F1(k?.path??c??``),ae=!!(k?.exists&&k.contents!==void 0),oe=te?P1[te.status]:void 0;return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1`,onKeyDown:ee,children:[(0,H.jsx)(R1,{changes:s.data,loading:s.loading,error:s.error,current:k?.path??c,onPick:e=>M({kind:`open`,path:e}),onRefresh:()=>{s.reload(),A||_()}}),(0,H.jsxs)(`section`,{"aria-label":`File`,className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border pr-2 pl-3`,children:[c?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[oe?(0,H.jsx)(`span`,{title:oe.word,className:Y(`font-mono text-xs font-semibold`,oe.tone),children:oe.letter}):(0,H.jsx)(dh,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,H.jsxs)(`h2`,{className:`min-w-0 truncate text-[0.8125rem]`,title:k?.path??c,children:[re?(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[re,`/`]}):null,(0,H.jsx)(`span`,{className:`font-medium text-foreground`,children:ie}),A?(0,H.jsx)(`span`,{"aria-label":`unsaved`,title:`Unsaved edits`,className:`ml-1.5 inline-block size-1.5 -translate-y-0.5 rounded-full bg-foreground/70`}):null]}),te?(0,H.jsx)(I1,{change:te}):null]}):(0,H.jsx)(`h2`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] text-muted-foreground`,children:`Code`}),P?(0,H.jsx)(Rk,{label:`View`,value:ne,onChange:d,items:[{id:`code`,label:`Code`},{id:`diff`,label:`Diff`}]}):null,ne===`diff`?(0,H.jsx)(eB,{side:`bottom`,label:D===`split`?`Unified diff`:`Side by side`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Side by side`,"aria-pressed":D===`split`,onClick:()=>YB(D===`split`?`unified`:`split`),className:M1,children:D===`split`?(0,H.jsx)(Dg,{"aria-hidden":`true`,className:`size-4`}):(0,H.jsx)($m,{"aria-hidden":`true`,className:`size-4`})})}):null,(0,H.jsx)(eB,{side:`bottom`,label:E?`Do not wrap lines`:`Wrap long lines`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Wrap lines`,"aria-pressed":E,onClick:()=>JB(!E),className:M1,children:(0,H.jsx)(Gg,{"aria-hidden":`true`,className:`size-4`})})}),(0,H.jsx)(eB,{side:`bottom`,label:`Save`,hint:`Ctrl+S`,children:(0,H.jsxs)(ZO,{size:`sm`,variant:A?`default`:`outline`,disabled:!A||b,onClick:()=>void N(),"aria-keyshortcuts":`Control+S Meta+S`,children:[(0,H.jsx)(kg,{"aria-hidden":`true`}),b?`Saving…`:`Save`]})}),(0,H.jsx)(eB,{side:`bottom`,label:`Close`,hint:r,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Close code viewer`,onClick:()=>M({kind:`close`}),className:M1,children:(0,H.jsx)(l_,{"aria-hidden":`true`,className:`size-4`})})})]}),w?(0,H.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-muted/40 px-3 py-2 text-xs`,children:[(0,H.jsx)(sg,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[ie,` has unsaved edits.`]}),(0,H.jsx)(ZO,{size:`xs`,variant:`ghost`,onClick:()=>T(void 0),children:`Keep editing`}),(0,H.jsx)(ZO,{size:`xs`,variant:`outline`,onClick:()=>j(w),children:`Discard`}),(0,H.jsx)(ZO,{size:`xs`,onClick:()=>void N(),disabled:b,children:`Save`})]}):null,S?(0,H.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-muted/40 px-3 py-2 text-xs`,children:[(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[ie,` changed on disk since you opened it, maybe by an agent.`]}),(0,H.jsx)(ZO,{size:`xs`,variant:`outline`,onClick:()=>{y(void 0),C(!1),_()},children:`Load theirs`}),(0,H.jsx)(ZO,{size:`xs`,onClick:()=>void N(!0),disabled:b,children:`Overwrite with mine`})]}):null,(0,H.jsx)(`div`,{className:`code-pane relative flex min-h-0 flex-1 flex-col`,children:h?(0,H.jsx)(`p`,{role:`alert`,className:`m-auto max-w-sm px-6 text-center text-sm text-muted-foreground`,children:h}):c?k?k.binary||k.tooLarge?(0,H.jsx)(`p`,{className:`m-auto max-w-sm px-6 text-center text-sm text-muted-foreground`,children:k.binary?`This is a binary file, so it is not shown.`:`This file is too large to show here.`}):!k.exists&&ne===`code`?(0,H.jsxs)(`p`,{className:`m-auto flex max-w-sm flex-col items-center gap-2 px-6 text-center text-sm text-muted-foreground`,children:[(0,H.jsx)(yh,{"aria-hidden":`true`,className:`size-5`}),`This file was deleted. Switch to Diff to see what it held.`]}):(0,H.jsx)(m.Suspense,{fallback:(0,H.jsx)(`p`,{role:`status`,className:`m-auto text-xs text-muted-foreground`,children:`Loading code…`}),children:(0,H.jsx)(j1,{path:k.path,version:`${f.version}`,contents:k.contents??``,draft:v,original:k.original,mode:ne,layout:D,wrap:E,dark:O,readOnly:!ae,onDraft:y})}):(0,H.jsx)(`p`,{role:`status`,className:`m-auto text-xs text-muted-foreground`,children:g?`Opening…`:``}):(0,H.jsx)(V1,{loading:s.loading})})]})]})}function V1({loading:e}){return(0,H.jsxs)(`div`,{className:`m-auto flex max-w-xs flex-col items-center gap-2 px-6 text-center`,children:[(0,H.jsx)(ph,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e?`Reading the changes…`:`Pick a changed file, open one by its path, or click a file name in the Lobby chat.`})]})}function H1({codeKey:e}){let{open:t,path:n,mode:r,request:i}=UB(),a=gk(t,hk.help),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(0),u=()=>l(e=>e+1);return(0,H.jsx)(ck,{open:a,onOpenChange:e=>{e||(o?u():VB())},label:`Code viewer`,className:`code-pop h-[min(86svh,52rem)] max-h-none max-w-6xl`,onEscapeKeyDown:e=>{o&&(e.preventDefault(),u())},children:t?(0,H.jsx)(B1,{requested:n,requestedMode:r,request:i,codeKey:e,onClose:VB,onDirtyChange:s,closeAsked:c}):null})}function U1(e){let t=e.match(/[#&?]?token=([^&\s#]+)/i);if(t?.[1])return decodeURIComponent(t[1]);let n=e.trim();return n&&!n.includes(`/`)&&!n.includes(` `)?n:void 0}function W1(){let[e,t]=(0,m.useState)(``),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1);async function o(e){a(!0),r(void 0),e&&(window.location.hash=`token=${encodeURIComponent(e)}`),await Ce()?window.location.reload():(r(e?`That link did not sign in. Copy the link from Pi and try again.`:`Paste the link from Pi below.`),a(!1))}function s(t){t.preventDefault(),o(U1(e))}return(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-y-auto p-6`,children:(0,H.jsxs)(`form`,{onSubmit:s,className:`cs-dlg w-full max-w-[420px]`,children:[(0,H.jsxs)(`div`,{className:`cs-dh flex items-center gap-3.5 pt-[22px]`,children:[(0,H.jsx)(`span`,{className:`cs-drop`,"aria-hidden":`true`,children:(0,H.jsx)(jh,{className:`size-[18px]`})}),(0,H.jsx)(`h1`,{children:`Sign in to bot-lobby`})]}),(0,H.jsxs)(`div`,{className:`cs-db`,children:[(0,H.jsxs)(`p`,{className:`mb-3.5 text-[12.5px] leading-relaxed text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,H.jsx)(`code`,{className:`cs-cd`,children:`/bot-lobby web`}),` to see it again). Paste it here.`]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:`Lobby link or token`}),(0,H.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),autoComplete:`off`,spellCheck:!1,autoFocus:!0,placeholder:`http://127.0.0.1:7347/#token=…`,className:`cs-inp`})]}),n?(0,H.jsx)(`p`,{role:`alert`,className:`mt-2.5 text-[12.5px] text-[var(--bad)]`,children:n}):null]}),(0,H.jsxs)(`div`,{className:`cs-df`,children:[(0,H.jsx)(ZO,{type:`button`,variant:`outline`,disabled:i,onClick:()=>void o(void 0),children:`Retry`}),(0,H.jsx)(ZO,{type:`submit`,disabled:i||!e.trim(),children:`Sign in`})]})]})})}var G1=`plan:`,K1=`bot-lobby:plan-put-away`,q1=e=>e.startsWith(G1);function J1(){try{let e=JSON.parse(sessionStorage.getItem(K1)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`number`):[]}catch{return[]}}function Y1(e){let t=e?.messages.at(-1);if(e&&!e.busy&&t?.role===`planner`&&t.questions?.length)return{id:`${G1}${t.at}`,kind:`questionnaire`,createdAt:t.at,from:`planner`,payload:{round:Math.max(e.round,1),limit:e.limit,questions:t.questions.map(e=>({question:e.text,header:e.from,options:e.options.map(e=>({label:e.label,description:e.description,...e.mockup?{htmlPreview:e.mockup}:{}}))}))}}}function X1(e,t){let n=e.payload.questions??[];return(t.answers??[]).map(e=>`${XV(n[e.questionIndex]?.header??``)}: ${e.question} ${e.answer}`.trim()).join(`
117
- `)}function Z1(){let e=MV(`planner.get`,{},[`planner`]),[t,n]=(0,m.useState)(J1),r=Y1(e.data),i=(0,m.useMemo)(()=>r&&!t.includes(r.createdAt)?[r]:[],[r?.id,t.join(`,`)]);return{prompts:i,answer:(0,m.useCallback)(async(t,n)=>{let r=i.find(e=>e.id===t);r&&(await R(`planner.send`,{text:X1(r,n)}),e.reload())},[i,e]),dismiss:(0,m.useCallback)(async e=>{let t=Number(e.slice(5));n(e=>{let n=[...e,t].slice(-20);try{sessionStorage.setItem(K1,JSON.stringify(n))}catch{}return n})},[])}}var Q1=2;function $1(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function e0(e){try{return JSON.parse(e)}catch{return}}function t0(e,t){switch(e.type){case`hello`:t.onHello?.(e.versions);return;case`changed`:t.onChanged?.(e.topic,e.version);return;case`feed`:t.onFeed?.({activity:e.activity,thoughts:e.thoughts,chat:e.chat});return;case`reply`:t.onReply?.(e.text);return;case`notice`:t.onNotice?.(e.text,e.level)}}function n0(e,t=$1){let n=t(I(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===Q1?`offline`:`connecting`),n.onmessage=t=>{let n=e0(t.data);n&&t0(n,e)},()=>n.close()}var r0=2e3,i0=()=>R(`projects.list`,{});async function a0(){let e;try{e=fe()}catch{return}if(e&&!ve(e))try{_e((await i0()).projects)}catch{}}function o0(){let e=(0,m.useRef)(void 0),t=(0,m.useRef)(void 0),n=(0,m.useCallback)(()=>{clearTimeout(t.current),e.current?.();try{fe()}catch{F.onStatus({connection:`offline`});return}e.current=n0({onHello:e=>{F.onHello(e),a0()},onChanged:(e,t)=>F.onChanged(e,t),onFeed:e=>F.onFeedDelta(e),onReply:e=>F.onReplyDelta(e),onNotice:(e,t)=>W[t](e),onConnection:e=>{F.onStatus({connection:e}),e===`offline`&&(clearTimeout(t.current),t.current=setTimeout(()=>{ye(i0).catch(()=>!1).finally(n)},r0))}})},[]);return(0,m.useEffect)(()=>(n(),()=>{clearTimeout(t.current),e.current?.()}),[n]),n}var s0=`bot-lobby.recoveredAt`,c0;function l0(e,t=u0()){try{c0===void 0&&(c0=Number(t?.getItem(s0)??0))}catch{c0??=0}if(c0!==void 0&&e<=c0)return!1;c0=e;try{t?.setItem(s0,String(e))}catch{}return!0}function u0(){try{return globalThis.sessionStorage}catch{return}}function d0(e){let t=e?.recovered?.at,n=e?.recovered?.text;(0,m.useEffect)(()=>{t!==void 0&&n&&l0(t)&&W.success(n)},[t,n])}function f0(){let e=Vk(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await R(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await R(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}var p0=class extends m.Component{state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`bot-lobby: a tab failed to draw`,e,t.componentStack)}render(){let{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,()=>this.setState({error:void 0})):(0,H.jsxs)(`div`,{role:`alert`,className:`cs-pg cs-blank`,children:[(0,H.jsx)(`h2`,{children:`This page hit a snag`}),(0,H.jsx)(`p`,{children:e.message||String(e)}),(0,H.jsx)(`p`,{children:(0,H.jsx)(`button`,{type:`button`,className:`cs-kc`,onClick:()=>this.setState({error:void 0}),children:`Try again`})})]}):this.props.children}};function m0(e,t,n,r,i){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?Dk(`#/settings`):e===`thinking`?t.kind===`tab`&&t.tab===`lobby`?FH(`lobby.thinking`):Dk(Ek(`lobby`)):e===`nextSession`||e===`prevSession`?a1(e===`nextSession`?1:-1):e===`newSession`?e1():e===`sidebar`?i():e===`terminal`?iK():e===`code`?HB():e===`activity`?t.kind===`tab`&&t.tab===`lobby`?FH(LH):Dk(Ek(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&G(`planner.save`,{})}var h0=`cs-iconbtn cs-sq10`,g0=2500;function _0(e){let[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(!1);return e===`live`&&(r.current=!0),(0,m.useEffect)(()=>{if(e!==`connecting`||!r.current)return n(!1);let t=setTimeout(()=>n(!0),g0);return()=>clearTimeout(t)},[e]),e===`offline`||e===`connecting`&&t}function v0({connection:e,onRetry:t}){return _0(e)?(0,H.jsx)(`div`,{className:`cs-outage`,children:(0,H.jsx)(Mk,{onRetry:t})}):null}var y0={tick:0,route:0,focus:0};window.addEventListener(`hashchange`,()=>{y0.route=++y0.tick}),document.addEventListener(`focusin`,()=>{y0.focus=++y0.tick});var b0=()=>y0.focus>y0.route;function x0(e){return e.kind===`tab`?e.tab:e.kind}function S0(){let e=Ok(),t=Vk(`status`);Vk(`lobby`);let{prompts:n,loading:r,answer:i,dismiss:a}=f0(),o=Z1(),s=(0,m.useMemo)(()=>[...n,...o.prompts],[n,o.prompts]),c=LQ(s,(0,m.useCallback)((e,t)=>q1(e)?o.answer(e,t):i(e,t),[i,o.answer]),(0,m.useCallback)(e=>q1(e)?o.dismiss(e):a(e),[a,o.dismiss])),{connection:l,signedOut:u}=Bk(),[d,f]=(0,m.useState)(!1),p=YQ();(0,m.useEffect)(()=>{s.length===0&&!r&&qQ(!1)},[s.length,r]);let h=(0,m.useRef)(null),g=o0();ZU();let _=t.data;d0(_);let v=!!_&&!u;(0,m.useEffect)(()=>{v&&Re()},[v]);let y=_?.tabs??[],b=_?.keys??[],x=e.kind===`tab`?e.tab:void 0,S=(0,m.useCallback)(e=>Dk(Ek(e)),[]),C=(0,m.useCallback)(e=>{if(y.length===0)return;let t=Math.max(0,y.findIndex(e=>e.id===x)),n=y[(t+e+y.length)%y.length];n&&Dk(Ek(n.id))},[y,x]),w=(0,m.useCallback)(()=>f(e=>!e),[]),T=gZ(),E=(0,m.useCallback)(()=>J$(),[]),D=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||_?.panels?.[t]!==!1)&&m0(t,Tk(window.location.hash)??e,w,C,E)},[e,w,C,E,_?.panels]),O=S,k=(0,m.useCallback)(()=>{let e=document.activeElement;return!e||e===document.body||h.current?.contains(e)===!0||e.closest(`.terminal-pop`)?!0:e.closest(`[data-state='closed']`)!==null},[]);BX({enabled:!!_,keys:b,tabs:y,insideApp:k,onAction:D,onTab:O});let A=(0,m.useCallback)(()=>F.onHello({}),[]),j=e.kind===`tab`?e.tab:e.kind,M=!!_;(0,m.useEffect)(()=>{if(!M)return;let e=$k.active&&$k.to===j;if($k.active=!1,$k.to=void 0,e)return;let t=requestAnimationFrame(()=>{if(b0()||document.querySelector(`[role='dialog']:not([data-state='closed'])`))return;let e=document.getElementById(`composer-text`);!window.matchMedia(`(pointer: coarse)`).matches&&e&&!e.disabled&&!e.closest(`[inert]`)?e.focus({preventScroll:!0}):document.activeElement?.id!==`composer-text`&&document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(t)},[j,M]);let N=Object.fromEntries(b.map(e=>[e.action,e.label])),ee=V$({tabs:y,activeId:x,onSelect:S}),te=v1({route:e,keys:N,onHelp:w});return u||!_?(0,H.jsxs)(`div`,{ref:h,className:`cs-frame`,children:[(0,H.jsx)(L$,{}),(0,H.jsx)(`main`,{id:`main`,tabIndex:-1,className:`cs-main`,children:u?(0,H.jsx)(W1,{}):t.error?(0,H.jsx)(jk,{message:t.error,onRetry:A}):(0,H.jsx)(Ak,{})}),(0,H.jsxs)(H$,{children:[(0,H.jsx)(tZ,{className:h0,side:`bottom`}),(0,H.jsx)(eZ,{className:h0,side:`bottom`})]})]}):(0,H.jsxs)(`div`,{ref:h,className:`cs-frame`,"data-sb":te.open?`open`:`closed`,"data-sbpin":te.pinned||void 0,"data-tb":`open`,children:[(0,H.jsx)(L$,{}),(0,H.jsxs)(`div`,{className:`cs-body`,children:[(0,H.jsx)(v0,{connection:l,onRetry:g}),(0,H.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,H.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||Uk(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||Qk()&&e.preventDefault()},role:x?`tabpanel`:void 0,"aria-labelledby":x?`tab-${x}`:void 0,className:`cs-main surface`,children:(0,H.jsx)(Qf.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.17,ease:[.22,1,.36,1]},className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(p0,{children:DX(e)})},x0(e))}),(0,H.jsx)(p0,{fallback:(e,t)=>(0,H.jsxs)(`div`,{role:`alert`,className:`pointer-events-auto absolute inset-x-0 bottom-6 z-30 mx-auto w-fit rounded-xl bg-card px-4 py-2 text-sm shadow`,children:[`The message box hit a snag: `,e.message,` `,(0,H.jsx)(`button`,{type:`button`,className:`font-medium text-primary underline`,onClick:t,children:`Try again`})]}),children:(0,H.jsx)(d$,{route:e,projects:T,drawer:c,drawerOpen:s.length>0&&!p})})]}),(0,H.jsx)(k1,{toggleKey:N.terminal??"Ctrl+`"})]}),te.ghost,ee.ghost,(0,H.jsxs)(H$,{children:[(0,H.jsx)(N1,{hint:N.code,className:h0}),(0,H.jsx)(E1,{hint:N.terminal,className:h0})]}),te.bay,ee.bay,(0,H.jsx)(vZ,{projects:T}),(0,H.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`}),(0,H.jsx)(H1,{codeKey:b.find(e=>e.action===`code`)?.key}),(0,H.jsx)(EB,{}),(0,H.jsx)(ZX,{open:d,onOpenChange:f,keys:b,tabs:y})]})}async function C0(e){switch(e){case`status`:return R(`status.get`,{});case`lobby`:return R(`lobby.snapshot`,{});case`prompts`:return R(`prompts.list`,{});default:return}}var w0=[`status`,`lobby`,`prompts`];function T0(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await Ce(),e&&(F.markUsed(w0,C0),t(!0))})(),()=>{e=!1}},[]),e}function E0(){return T0()?(0,H.jsx)(S0,{}):(0,H.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,H.jsx)(Ak,{})})}var D0={info:`Note:`,success:`Done:`,warning:`Warning:`,error:`Error:`};function O0(){let{item:e,waiting:t}=Up(),n=vk(),r=qp(),i=e&&!n?e:void 0;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>Vp(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`,children:i?`${D0[i.kind]} ${i.message}`:``}),(0,H.jsx)(k0,{enabled:!r})]})}function k0({enabled:e}){let t=FZ(e,`floor`);return t.item?(0,H.jsxs)(`div`,{className:`bubble toast-lone`,style:t.vars,children:[(0,H.jsx)(RZ,{id:`toast`}),(0,H.jsx)(`div`,{className:`bubble-layer bubble-edge`,"aria-hidden":`true`,children:(0,H.jsx)(IZ,{t})}),(0,H.jsx)(`div`,{className:`bubble-layer bubble-fill`,"aria-hidden":`true`,children:(0,H.jsx)(IZ,{t})}),(0,H.jsx)(`div`,{className:`bubble-real`,children:(0,H.jsx)(LZ,{t})})]}):null}(0,ip.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(m.StrictMode,{children:(0,H.jsx)(AW,{children:(0,H.jsxs)(Bu,{reducedMotion:`user`,children:[(0,H.jsx)(E0,{}),(0,H.jsx)(O0,{}),(0,H.jsx)(nB,{})]})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});export{I as i,NX as n,R as r,C1 as t};