@straiffi/archon 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{At as t,H as n,It as r,Nt as i,Pt as a,a as o,d as s,f as c,gt as l,i as u,kt as d,o as f,s as p,t as m}from"./badge-BentDQnz.js";import{_ as h,a as g,c as _,d as v,f as y,g as b,h as ee,i as x,l as S,m as te,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as ne,y as re}from"./index-CyyQsO8z.js";var A=e(r(),1),ie=(e,n)=>a(t(`/projects/${e}/test-sessions`),{method:`POST`,body:n,fallbackErrorMessage:`Unable to open the test runner right now.`}),ae=(e,n)=>a(t(`/tickets/${e}/test-sessions${n?`?project_id=${encodeURIComponent(n)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),oe=(e,n={})=>a(t(`/test-sessions/${e}/discovery${n.commandId?`?command_id=${encodeURIComponent(n.commandId)}`:``}`),{signal:n.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),se=(e,n)=>a(t(`/test-sessions/${e}/run`),{method:`POST`,body:n,fallbackErrorMessage:`Unable to start the selected tests right now.`}),ce=e=>a(t(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),le=e=>i(t(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),j=n(),M=256*1024,N=24,P=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),ue=(e,t)=>{let n=`${e}${t}`;return n.length<=M?n:n.slice(-M)},F=e=>e.replace(P,``),de=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=N,I=e=>{e.scrollTop=e.scrollHeight},fe=(e,t=!1)=>{I(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{I(e),t&&(r=window.requestAnimationFrame(()=>{I(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},pe=e=>{if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;if(typeof t.id!=`string`||typeof t.name!=`string`||typeof t.command!=`string`)return[];let n=t.runner===`vitest`||t.runner===`jest`||t.runner===`unknown`?t.runner:`auto`;return[{id:t.id,name:t.name,command:t.command,runner:n,...typeof t.cwd==`string`&&t.cwd.trim()!==``?{cwd:t.cwd}:{}}]}):[]}catch{return[]}},L=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,R=e=>e==null?null:e<1e3?`${e} ms`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`,z=e=>{let t=e.split(`/`);return t[t.length-1]||e},B=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),V=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),H=(e,t)=>{let n=B(t);return n.length===0?e:e.flatMap(e=>{let t=z(e.path);if(V(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>V(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},U=e=>e===`passed`?`Passed`:e===`failed`?`Failed`:e===`running`?`Running`:e===`error`?`Error`:e===`stopped`?`Stopped`:`Idle`,me=e=>e?.selection?e.selection.kind===`all`?`All tests`:e.selection.kind===`case`?e.selection.name:z(e.selection.path):`No test run yet`,W=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,G=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,he=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ge=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,K=({line:e,tone:t})=>(0,j.jsx)(`div`,{"data-tone":t,className:c(`whitespace-pre-wrap break-words`,G(t)),children:e===``?` `:e}),q=(0,A.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,j.jsxs)(`button`,{type:`button`,"aria-label":`Run ${r}`,title:r,className:c(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,n&&`bg-sky-500/10`),disabled:!e,onClick:()=>{i(t,r)},children:[(0,j.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,j.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));q.displayName=`TestCaseRow`;var J=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:a,onRunCase:o,onRunFile:l,onToggleFile:u})=>{let d=e===`file`&&n===i.path,p=e===`case`&&n===i.path;return(0,j.jsx)(w,{open:a,onOpenChange:e=>{u(i.path,e)},children:(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(_,{asChild:!0,children:(0,j.jsx)(s,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`${a?`Collapse`:`Expand`} ${i.path}`,className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(f,{className:c(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":`Run ${i.path}`,className:c(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(d||p)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{l(i.path)},children:(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,j.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(S,{className:`h-3.5 w-3.5`})}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:z(i.path)}),(0,j.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,j.jsxs)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:[i.cases.length,` test`,i.cases.length===1?``:`s`]})]})]})})]}),(0,j.jsx)(D,{children:(0,j.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,j.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:`No named tests were detected in this file.`}):(0,j.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let s=e===`case`&&n===i.path&&t===a.name;return(0,j.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:s,name:a.name,onRunCase:o},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var _e=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:i,discovery:a,expandedFiles:l,fullSuiteOnlyNotice:d,isLoading:m,selectedCommandId:h,selectedCommandName:_,sessionError:v,sessionStatus:y,shouldShowCommandSelector:b,onRunCase:ee,onRunFile:S,onSelectCommand:te,onToggleFile:w})=>{let[T,D]=(0,A.useState)(``),O=(0,A.useMemo)(()=>H(a,T),[a,T]),k=(0,A.useMemo)(()=>O.reduce((e,t)=>e+t.cases.length,0),[O]),ne=B(T).length>0;return(0,j.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,j.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[b&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:`Test scope`}),(0,j.jsxs)(C,{children:[(0,j.jsx)(g,{asChild:!0,children:(0,j.jsxs)(s,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":`Selected test command`,disabled:r.length===0||y===`running`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:_??`Select test scope`}),(0,j.jsx)(f,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,j.jsx)(E,{align:`start`,className:`w-72`,children:r.map(e=>(0,j.jsx)(x,{className:c(h===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{te(e.id)},children:(0,j.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),d&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:d}),(a.length>0||T.length>0)&&(0,j.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,j.jsx)(p,{type:`search`,value:T,onChange:e=>{D(e.target.value)},placeholder:`Filter`,"aria-label":`Filter test cases`,className:`pr-10`}),T.length>0&&(0,j.jsx)(s,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Clear test case filter`,className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{D(``)},children:(0,j.jsx)(u,{className:`size-4`})})]}),!r.length&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:`No test commands are configured for this target yet.`}),v&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:v}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,j.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[O.length,` file`,O.length===1?``:`s`,`, `,k,` test case`,k===1?``:`s`]})}),m&&(0,j.jsx)(o,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:a.length===0&&!m?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:`No JS or TS test files were detected for this target yet.`}):O.length===0?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:`No test cases match this filter.`}):O.map(r=>(0,j.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:r,isExpanded:ne||(l[r.path]??!1),onRunCase:ee,onRunFile:S,onToggleFile:w},r.path))})]})]})})});_e.displayName=`DiscoveryPane`;var ve=(0,A.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:s})=>{let l=(0,A.useMemo)(()=>t?F(t).replaceAll(`\r
2
+ `,`
3
+ `).replaceAll(`\r`,`
4
+ `).split(`
5
+ `).map(e=>({line:e,tone:W(e)})):[],[t]);return(0,j.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,j.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,j.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),i&&(0,j.jsx)(m,{variant:`outline`,className:c(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,L(i)),children:U(i)}),a&&(0,j.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,j.jsxs)(`span`,{className:`text-rose-200`,children:[a.failed.count,` `,a.failed.label]}),(0,j.jsxs)(`span`,{className:`text-emerald-200`,children:[a.passed.count,` `,a.passed.label]})]}),e!=null&&(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:R(e)}),n&&(0,j.jsx)(m,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:`Output trimmed to recent logs`})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,j.jsx)(`div`,{ref:o,"aria-label":`Test output`,className:`h-full overflow-auto px-4 py-4`,onScroll:s,children:(0,j.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:l.length>0?l.map((e,t)=>(0,j.jsx)(K,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,j.jsx)(`div`,{className:`text-slate-200`,children:`No test output yet.`})})})})]})})});ve.displayName=`OutputPane`;var ye=({testCommands:e,onClose:t,...n})=>{let r=n.scope,i=n.projectId,a=n.scope===`ticket`?n.ticketId:null,o=n.scope===`project`?n.targetKind:null,c=n.scope===`project`?n.targetBundleId:null,[f,p]=(0,A.useState)(e),[m,g]=(0,A.useState)(null),[_,x]=(0,A.useState)([]),[S,C]=(0,A.useState)(``),[w,E]=(0,A.useState)({}),[D,M]=(0,A.useState)(!0),[N,P]=(0,A.useState)(!1),[F,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(!1),[V,H]=(0,A.useState)(!1),U=(0,A.useRef)(null),W=(0,A.useRef)(!1),G=(0,A.useRef)(null),K=(0,A.useRef)(!0),q=(0,A.useRef)(null),J=(0,A.useRef)(null),ye=m?.selection?.kind??null,be=m?.selection?.kind===`all`?null:m?.selection?.path??null,xe=m?.selection?.kind===`case`?m.selection.name:null,Y=m?.id??null,X=m?.status??null,Z=(0,A.useMemo)(()=>f.find(e=>e.id===S)??null,[f,S]),Se=(0,A.useMemo)(()=>{if(m?.summary?.failed_count==null&&m?.summary?.passed_count==null&&m?.summary?.failed_file_count==null&&m?.summary?.passed_file_count==null)return null;let e=m?.summary?.failed_count==null&&m?.summary?.passed_count==null;return{failed:X===`failed`&&m?.summary?.failed_count==null&&m?.summary?.failed_file_count!=null||e?{count:m?.summary?.failed_file_count??0,label:`files failed`}:{count:m?.summary?.failed_count??0,label:`failed`},passed:e?{count:m?.summary?.passed_file_count??0,label:`files passed`}:{count:m?.summary?.passed_count??m?.summary?.passed_file_count??0,label:`passed`}}},[m?.summary?.failed_count,m?.summary?.passed_count,m?.summary?.failed_file_count,m?.summary?.passed_file_count,X]),Ce=Z?.runner===`unknown`?`This scope supports full-suite runs only, so file and case selection is disabled.`:null,we=!!(Z&&m?.status!==`running`&&!N&&!F),Te=we,Ee=we&&V,De=f.length>1;(0,A.useEffect)(()=>{S||f.length===0||C(f[0]?.id??``)},[f,S]),(0,A.useEffect)(()=>{e.length>0&&p(t=>he(t,e)?t:e)},[e]),(0,A.useEffect)(()=>{if(f.length>0||!i)return;let e=new AbortController;return l(e.signal).then(e=>{let t=e.find(e=>e.id===i);t&&p(e=>{let n=pe(t.test_commands);return he(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[f.length,i]),(0,A.useEffect)(()=>{let e=e=>{!e||e.id!==U.current||g(e)},t=e=>{!e||e.session_id!==U.current||g(t=>!t||t.id!==e.session_id?t:{...t,output:ue(t.output,e.chunk),output_truncated:e.output_truncated})};return O.on(`test-session:updated`,e),O.on(`test-session:output`,t),()=>{O.off(`test-session:updated`,e),O.off(`test-session:output`,t)}},[]),(0,A.useEffect)(()=>{let e=G.current;if(!e){q.current=m?.output??null,J.current=m?.status??null;return}let t=q.current!==(m?.output??null),n=J.current!==`running`&&m?.status===`running`,r=J.current===`running`&&m?.status!==`running`;if(n&&(K.current=!0),n||t&&m?.status===`running`&&K.current||r&&K.current){let t=fe(e,r);return q.current=m?.output??null,J.current=m?.status??null,t}q.current=m?.output??null,J.current=m?.status??null},[m?.output,m?.status]),(0,A.useEffect)(()=>{let e=!1;return(async()=>{try{let t=r===`project`?await ie(i,{target_kind:o??`repo_root`,target_bundle_id:c??null}):await ae(a??``,i);if(e)return;U.current=t.id,g(t)}catch(t){e||R(t instanceof d?t.message:`Unable to load the test runner right now.`)}finally{!e&&U.current==null&&M(!1)}})(),()=>{e=!0}},[i,r,c,o,a]),(0,A.useEffect)(()=>{if(!m?.id){H(!1);return}if(f.length>0&&!S){H(!1);return}let e=new AbortController,t=!1;return M(!0),H(!1),oe(m.id,{commandId:S||null,signal:e.signal}).then(e=>{t||(x(e.files),H(e.supports_granular_selection))}).catch(n=>{t||e.signal.aborted||R(n instanceof d?n.message:`Unable to discover tests right now.`)}).finally(()=>{t||M(!1)}),()=>{t=!0,e.abort()}},[f.length,S,m?.id]),(0,A.useEffect)(()=>()=>{let e=U.current;!e||W.current||(W.current=!0,le(e).catch(()=>{}))},[]);let Q=(0,A.useCallback)(async e=>{if(!(!Y||X===`running`||!Z||N||F)){R(null),P(!0);try{g(await se(Y,{command_id:Z.id,selection:e}))}catch(e){R(e instanceof d?e.message:`Unable to start the selected tests right now.`)}finally{P(!1)}}},[N,F,Z,Y,X]),Oe=(0,A.useCallback)(async()=>{if(!(!Y||X!==`running`||F)){R(null),I(!0);try{g(await ce(Y))}catch(e){R(e instanceof d?e.message:`Unable to stop the test run right now.`)}finally{I(!1)}}},[F,Y,X]),$=(0,A.useCallback)(()=>{let e=U.current;if(!e||W.current){t();return}W.current=!0,t(),le(e).catch(()=>{})},[t]),ke=(0,A.useCallback)(()=>{if(X===`running`){B(!0);return}$()},[$,X]),Ae=(0,A.useCallback)(()=>{let e=G.current;e&&(K.current=de(e))},[]),je=(0,A.useCallback)(e=>{C(e)},[]),Me=(0,A.useCallback)((e,t)=>{E(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),Ne=(0,A.useCallback)(e=>{Q({kind:`file`,path:e})},[Q]),Pe=(0,A.useCallback)((e,t)=>{Q({kind:`case`,path:e,name:t})},[Q]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{open:!0,onOpenChange:e=>{e||ke()},children:(0,j.jsxs)(b,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-7xl`,children:[(0,j.jsx)(re,{className:`sr-only`,children:`Tests`}),(0,j.jsx)(h,{className:`sr-only`,children:`Run configured tests for the selected project target and discard the session when this dialog closes.`}),(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(T,{className:`h-5 w-5`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:`Tests`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:m?.target_label??`Preparing target...`})]})]})}),(0,j.jsx)(ee,{asChild:!0,children:(0,j.jsx)(s,{type:`button`,"aria-label":`Close modal`,variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(u,{className:`h-4 w-4`})})})]}),(0,j.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,j.jsx)(_e,{activeSelectionKind:ye,activeSelectionName:xe,activeSelectionPath:be,availableCommands:f,canRunGranular:Ee,discovery:_,expandedFiles:w,fullSuiteOnlyNotice:Ce,isLoading:D,selectedCommandId:S,selectedCommandName:Z?.name??null,sessionError:L,sessionStatus:X,shouldShowCommandSelector:De,onRunCase:Pe,onRunFile:Ne,onSelectCommand:je,onToggleFile:Me}),(0,j.jsx)(ve,{durationMs:m?.duration_ms??null,output:m?.output??``,outputTruncated:m?.output_truncated??!1,selectionLabel:me(m),status:X,summaryCounts:Se,viewportRef:G,onScroll:Ae})]}),(0,j.jsx)(ne,{className:`border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,j.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:m?.status===`running`?(0,j.jsxs)(s,{type:`button`,variant:`destructive`,className:ge,onClick:()=>{Oe()},disabled:F,children:[(0,j.jsx)(v,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:`Stop`})]}):(0,j.jsxs)(s,{type:`button`,variant:`success`,className:ge,disabled:!Te,onClick:()=>{Q({kind:`all`})},children:[(0,j.jsx)(y,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:`Run`})]})})})]})}),z&&(0,j.jsx)(k,{title:`Stop test run and close?`,description:`Closing the Tests dialog discards the current session and its output. Stop the active test run first?`,confirmLabel:`Stop and close`,cancelLabel:`Keep running`,confirmVariant:`destructive`,onConfirm:()=>{B(!1),$()},onCancel:()=>B(!1)})]})};export{ye as TestsDialog};
@@ -1,4 +1,4 @@
1
- import{a as e,t}from"./rolldown-runtime-BYbx6iT9.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=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)},te={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();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 i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(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=a,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 s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.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,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,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=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.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=l(n,t.crossOrigin);a.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=l(t.as,t.crossOrigin);a.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})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.5`})),a=t(((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=i()})),o=(void 0)?.trim()||(typeof window<`u`&&/^https?:\/\//.test(window.location.origin)?window.location.origin:`http://localhost:3001`),s=class extends Error{status;constructor(e,t=0){super(e),this.name=`ApiError`,this.status=t}},c=e=>`${o}${e}`,l=(e,t)=>{let n=new URL(c(e));return t&&n.searchParams.set(`project_id`,t),n.toString()},u=e=>e instanceof DOMException&&e.name===`AbortError`,d=async(e,t)=>{try{let t=await e.json();if(t.error)return t.error}catch{}return t},f=async(e,t={})=>{let{body:n,headers:r,fallbackErrorMessage:i=`Request failed.`,...a}=t,o=new Headers(r),c=Array.from(o.keys()).length>0;n!==void 0&&o.set(`Content-Type`,`application/json`);let l=await fetch(e,{...a,...n===void 0?{}:{body:JSON.stringify(n)},...c||n!==void 0?{headers:o}:{}});if(!l.ok)throw new s(await d(l,i),l.status);return l},p=async(e,t={})=>await(await f(e,t)).json(),m=e=>e&&e.match(/filename="?([^";]+)"?/i)?.[1]?.trim()||`project-archon-memory-v3.json`,h=e=>p(c(`/projects`),{signal:e}),g=e=>p(c(`/projects`),{method:`POST`,body:e,fallbackErrorMessage:`Unable to create the project right now.`}),_=(e,t)=>p(c(`/projects/${e}`),{method:`PATCH`,body:t,fallbackErrorMessage:`Unable to update the project right now.`}),v=e=>f(c(`/projects/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to delete the project right now.`}),y=e=>f(c(`/projects/${e}/open-ide`),{method:`POST`,fallbackErrorMessage:`Unable to open the project IDE right now.`}),b=(e,t)=>p(c(`/projects/${e}/branches`),{signal:t,fallbackErrorMessage:`Unable to load project branches right now.`}),x=(e,t)=>p(c(`/projects/${e}/target`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to update the project target right now.`}),S=e=>p(c(`/projects/auto-config`),{method:`POST`,body:e,fallbackErrorMessage:`Unable to infer project settings right now.`}),C=()=>p(c(`/projects/browse-repo-path`),{method:`POST`,fallbackErrorMessage:`Unable to open the folder picker right now.`}),w=e=>p(c(`/projects/validate-repo-path`),{method:`POST`,body:e,fallbackErrorMessage:`Unable to validate the repository path right now.`}),T=(e,t,n={})=>{let r=new URL(c(`/projects/${e}/file-suggestions`));return r.searchParams.set(`q`,t),n.ticketId&&r.searchParams.set(`ticket_id`,n.ticketId),p(r.toString(),{signal:n.signal,fallbackErrorMessage:`Unable to load project file suggestions right now.`})},E=(e,t,n={})=>p(c(`/projects/${e}/branch${n.refreshRemote?`?refresh_remote=true`:``}`),{signal:t,fallbackErrorMessage:`Unable to load the current branch right now.`}),D=e=>p(c(`/projects/${e}/git-pull`),{method:`POST`,fallbackErrorMessage:`Unable to sync the current branch right now.`}),O=e=>p(c(`/projects/${e}/diff`),{fallbackErrorMessage:`Unable to load the diff right now.`}),k=(e,t)=>p(c(`/projects/${e}/memories`),{signal:t,fallbackErrorMessage:`Unable to load project memories right now.`}),A=(e,t={})=>{let n=new URL(c(`/projects/${e}/git-status`));return t.refreshRemote&&n.searchParams.set(`refresh_remote`,`true`),p(n.toString(),{signal:t.signal,fallbackErrorMessage:`Unable to load git status right now.`})},j=e=>p(c(`/projects/${e}/git-commits`),{fallbackErrorMessage:`Unable to load local commits right now.`}),M=(e,t)=>p(c(`/projects/${e}/git-commit`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to create the commit right now.`}),N=(e,t)=>p(c(`/projects/${e}/git-commit-message`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to generate a commit message right now.`}),P=e=>p(c(`/projects/${e}/git-push`),{method:`POST`,fallbackErrorMessage:`Unable to push the branch right now.`}),ee=e=>p(c(`/projects/${e}/git-undo-latest`),{method:`POST`,fallbackErrorMessage:`Unable to undo the latest local commit right now.`}),F=(e,t)=>p(c(`/projects/${e}/memories`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to create the project memory right now.`}),te=(e,t,n)=>p(c(`/projects/${e}/memories/${t}`),{method:`PATCH`,body:n,fallbackErrorMessage:`Unable to update the project memory right now.`}),ne=(e,t)=>p(c(`/projects/${e}/memories/${t}/archive`),{method:`POST`,fallbackErrorMessage:`Unable to archive the project memory right now.`}),re=(e,t)=>p(c(`/projects/${e}/memories/${t}/restore`),{method:`POST`,fallbackErrorMessage:`Unable to restore the project memory right now.`}),ie=(e,t)=>p(c(`/projects/${e}/memories/${t}/supersede`),{method:`POST`,fallbackErrorMessage:`Unable to supersede the project memory right now.`}),I=(e,t)=>p(c(`/projects/${e}/context`),{signal:t,fallbackErrorMessage:`Unable to load project context right now.`}),L=e=>p(c(`/projects/${e}/context/scan`),{method:`POST`,fallbackErrorMessage:`Unable to start the project context scan right now.`}),ae=(e,t)=>p(c(`/projects/${e}/context/artifacts`),{signal:t,fallbackErrorMessage:`Unable to load project context artifacts right now.`}),oe=(e,t,n)=>p(c(`/projects/${e}/memory/relevant?ticket_id=${encodeURIComponent(t)}`),{signal:n,fallbackErrorMessage:`Unable to load relevant project memory right now.`}),R=(e,t,n,r)=>p(c(t?`/projects/${e}/memory/suggestions?ticket_id=${encodeURIComponent(t)}`:r?`/projects/${e}/memory/suggestions?chat_session_id=${encodeURIComponent(r)}`:`/projects/${e}/memory/suggestions`),{signal:n,fallbackErrorMessage:`Unable to load project memory suggestions right now.`}),se=(e,t,n)=>p(c(`/projects/${e}/memories/${t}/accept`),{method:`POST`,body:n,fallbackErrorMessage:`Unable to accept the project memory right now.`}),ce=(e,t)=>p(c(`/projects/${e}/memories/${t}/dismiss`),{method:`POST`,fallbackErrorMessage:`Unable to dismiss the project memory right now.`}),le=(e,t,n,r)=>p(c(`/projects/${e}/memories/${t}/apply-to-existing`),{method:`POST`,body:{memory_id:n,...r},fallbackErrorMessage:`Unable to apply the project memory right now.`}),ue=async e=>{let t=await f(c(`/projects/${e}/memory/export`),{fallbackErrorMessage:`Unable to export project memory right now.`});return{filename:m(t.headers.get(`Content-Disposition`)),archive:await t.json()}},de=(e,t)=>p(c(`/projects/${e}/memory/import`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to import project memory right now.`}),z=e(r(),1),fe=e(a(),1);function pe(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=pe(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function me(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=pe(e))&&(r&&(r+=` `),r+=t);return r}var he=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ge=me,_e=(e,t)=>n=>{if(t?.variants==null)return ge(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=he(t)||he(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 ge(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)};function ve(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ye(...e){return t=>{let n=!1,r=e.map(e=>{let r=ve(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():ve(e[t],null)}}}}function B(...e){return z.useCallback(ye(...e),e)}var be=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),xe=t(((e,t)=>{t.exports=be()})),V=xe();function Se(e){let t=we(e),n=z.forwardRef((e,n)=>{let{children:r,...i}=e,a=z.Children.toArray(r),o=a.find(De);if(o){let e=o.props.children,r=a.map(t=>t===o?z.Children.count(e)>1?z.Children.only(null):z.isValidElement(e)?e.props.children:null:t);return(0,V.jsx)(t,{...i,ref:n,children:z.isValidElement(e)?z.cloneElement(e,void 0,r):null})}return(0,V.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var Ce=Se(`Slot`);function we(e){let t=z.forwardRef((e,t)=>{let{children:n,...r}=e;if(z.isValidElement(n)){let e=ke(n),i=Oe(r,n.props);return n.type!==z.Fragment&&(i.ref=t?ye(t,e):e),z.cloneElement(n,i)}return z.Children.count(n)>1?z.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Te=Symbol(`radix.slottable`);function Ee(e){let t=({children:e})=>(0,V.jsx)(V.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Te,t}function De(e){return z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Te}function Oe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ke(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)}var H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Se(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ae(e,t){e&&fe.flushSync(()=>e.dispatchEvent(t))}function je(e,t){let n=z.createContext(t),r=e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,V.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=z.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Me(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,V.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=z.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>z.createContext(e));return function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ne(i,...t)]}function Ne(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Pe(e){let t=e+`CollectionProvider`,[n,r]=Me(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,V.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Se(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,V.jsx)(c,{ref:B(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Se(u),p=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=B(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,V.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return z.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[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Fe=globalThis?.document?z.useLayoutEffect:()=>{},Ie=z.useInsertionEffect||Fe;function Le({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Re({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=ze(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Re({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Ie(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ze(e){return typeof e==`function`}function Be(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}var Ve=e=>{let{present:t,children:n}=e,r=He(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=B(r.ref,We(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null};Ve.displayName=`Presence`;function He(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),[o,s]=Be(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{let e=Ue(r.current);a.current=o===`mounted`?e:`none`},[o]),Fe(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ue(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Fe(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ue(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ue(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:z.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ue(e){return e?.animationName||`none`}function We(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)}var Ge=z.useId||(()=>void 0),Ke=0;function qe(e){let[t,n]=z.useState(Ge());return Fe(()=>{e||n(e=>e??String(Ke++))},[e]),e||(t?`radix-${t}`:``)}var Je=z.createContext(void 0);function Ye(e){let t=z.useContext(Je);return e||t||`ltr`}function Xe(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>(...e)=>t.current?.(...e),[])}function Ze(e,t=globalThis?.document){let n=Xe(e);z.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Qe=`DismissableLayer`,$e=`dismissableLayer.update`,et=`dismissableLayer.pointerDownOutside`,tt=`dismissableLayer.focusOutside`,nt,rt=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),it=z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=z.useContext(rt),[u,d]=z.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=z.useState({}),m=B(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=st(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=ct(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Ze(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),z.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(nt=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),lt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=nt)}},[u,f,n,l]),z.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),lt())},[u,l]),z.useEffect(()=>{let e=()=>p({});return document.addEventListener($e,e),()=>document.removeEventListener($e,e)},[]),(0,V.jsx)(H.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:U(e.onFocusCapture,S.onFocusCapture),onBlurCapture:U(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,x.onPointerDownCapture)})});it.displayName=Qe;var at=`DismissableLayerBranch`,ot=z.forwardRef((e,t)=>{let n=z.useContext(rt),r=z.useRef(null),i=B(t,r);return z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,V.jsx)(H.div,{...e,ref:i})});ot.displayName=at;function st(e,t=globalThis?.document){let n=Xe(e),r=z.useRef(!1),i=z.useRef(()=>{});return z.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ut(et,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ct(e,t=globalThis?.document){let n=Xe(e),r=z.useRef(!1);return z.useEffect(()=>{let e=e=>{e.target&&!r.current&&ut(tt,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lt(){let e=new CustomEvent($e);document.dispatchEvent(e)}function ut(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?Ae(i,a):i.dispatchEvent(a)}var dt=`focusScope.autoFocusOnMount`,ft=`focusScope.autoFocusOnUnmount`,pt={bubbles:!1,cancelable:!0},mt=`FocusScope`,ht=z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=Xe(i),u=Xe(a),d=z.useRef(null),f=B(t,e=>c(e)),p=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:St(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||St(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&St(s)};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]),z.useEffect(()=>{if(s){Ct.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dt,pt);s.addEventListener(dt,l),s.dispatchEvent(t),t.defaultPrevented||(gt(Et(vt(s)),{select:!0}),document.activeElement===e&&St(s))}return()=>{s.removeEventListener(dt,l),setTimeout(()=>{let t=new CustomEvent(ft,pt);s.addEventListener(ft,u),s.dispatchEvent(t),t.defaultPrevented||St(e??document.body,{select:!0}),s.removeEventListener(ft,u),Ct.remove(p)},0)}}},[s,l,u,p]);let m=z.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]=_t(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&St(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&St(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,V.jsx)(H.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ht.displayName=mt;function gt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(St(r,{select:t}),document.activeElement!==n)return}function _t(e){let t=vt(e);return[yt(t,e),yt(t.reverse(),e)]}function vt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function yt(e,t){for(let n of e)if(!bt(n,{upTo:t}))return n}function bt(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}function xt(e){return e instanceof HTMLInputElement&&`select`in e}function St(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xt(e)&&t&&e.select()}}var Ct=wt();function wt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Tt(e,t),e.unshift(t)},remove(t){e=Tt(e,t),e[0]?.resume()}}}function Tt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Et(e){return e.filter(e=>e.tagName!==`A`)}var Dt=`Portal`,Ot=z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=z.useState(!1);Fe(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?fe.createPortal((0,V.jsx)(H.div,{...r,ref:t}),o):null});Ot.displayName=Dt;var kt=0;function At(){z.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??jt()),document.body.insertAdjacentElement(`beforeend`,e[1]??jt()),kt++,()=>{kt===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),kt--}},[])}function jt(){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}var W=function(){return W=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},W.apply(this,arguments)};function Mt(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 Nt(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 Pt=`right-scroll-bar-position`,Ft=`width-before-scroll-bar`,It=`with-scroll-bars-hidden`,Lt=`--removed-body-scroll-bar-size`;function Rt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function zt(e,t){var n=(0,z.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 Bt=typeof window<`u`?z.useLayoutEffect:z.useEffect,Vt=new WeakMap;function Ht(e,t){var n=zt(t||null,function(t){return e.forEach(function(e){return Rt(e,t)})});return Bt(function(){var t=Vt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Rt(e,null)}),i.forEach(function(e){r.has(e)||Rt(e,a)})}Vt.set(n,e)},[e]),n}function Ut(e){return e}function Wt(e,t){t===void 0&&(t=Ut);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 Gt(e){e===void 0&&(e={});var t=Wt(null);return t.options=W({async:!0,ssr:!1},e),t}var Kt=function(e){var t=e.sideCar,n=Mt(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 z.createElement(r,W({},n))};Kt.isSideCarExport=!0;function qt(e,t){return e.useMedium(t),Kt}var Jt=Gt(),Yt=function(){},Xt=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:Yt,onWheelCapture:Yt,onTouchMoveCapture:Yt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Mt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ht([n,t]),C=W(W({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:Jt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),W(W({},C),{ref:S})):z.createElement(v,W({},C,{className:c,ref:S}),s))});Xt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xt.classNames={fullWidth:Ft,zeroRight:Pt};var Zt,Qt=function(){if(Zt)return Zt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function $t(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Qt();return t&&e.setAttribute(`nonce`,t),e}function en(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var nn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$t())&&(en(t,n),tn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rn=function(){var e=nn();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},an=function(){var e=rn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},on={left:0,top:0,right:0,gap:0},sn=function(e){return parseInt(e||``,10)||0},cn=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[sn(n),sn(r),sn(i)]},ln=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return on;var t=cn(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])}},un=an(),dn=`data-scroll-locked`,fn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{a as e,t}from"./rolldown-runtime-BYbx6iT9.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=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)},te={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();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 i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(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=a,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 s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.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,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,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=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.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=l(n,t.crossOrigin);a.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=l(t.as,t.crossOrigin);a.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})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.5`})),a=t(((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=i()})),o=(void 0)?.trim()||(typeof window<`u`&&/^https?:\/\//.test(window.location.origin)?window.location.origin:`http://localhost:3001`),s=class extends Error{status;constructor(e,t=0){super(e),this.name=`ApiError`,this.status=t}},c=e=>`${o}${e}`,l=(e,t)=>{let n=new URL(c(e));return t&&n.searchParams.set(`project_id`,t),n.toString()},u=e=>e instanceof DOMException&&e.name===`AbortError`,d=async(e,t)=>{try{let t=await e.json();if(t.error)return t.error}catch{}return t},f=async(e,t={})=>{let{body:n,headers:r,fallbackErrorMessage:i=`Request failed.`,...a}=t,o=new Headers(r),c=Array.from(o.keys()).length>0;n!==void 0&&o.set(`Content-Type`,`application/json`);let l=await fetch(e,{...a,...n===void 0?{}:{body:JSON.stringify(n)},...c||n!==void 0?{headers:o}:{}});if(!l.ok)throw new s(await d(l,i),l.status);return l},p=async(e,t={})=>await(await f(e,t)).json(),m=e=>e&&e.match(/filename="?([^";]+)"?/i)?.[1]?.trim()||`project-archon-memory-v3.json`,h=e=>p(c(`/projects`),{signal:e,cache:`no-store`}),g=e=>p(c(`/projects`),{method:`POST`,body:e,fallbackErrorMessage:`Unable to create the project right now.`}),_=(e,t)=>p(c(`/projects/${e}`),{method:`PATCH`,body:t,fallbackErrorMessage:`Unable to update the project right now.`}),v=e=>f(c(`/projects/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to delete the project right now.`}),y=e=>f(c(`/projects/${e}/open-ide`),{method:`POST`,fallbackErrorMessage:`Unable to open the project IDE right now.`}),b=(e,t)=>p(c(`/projects/${e}/branches`),{signal:t,fallbackErrorMessage:`Unable to load project branches right now.`}),x=(e,t)=>p(c(`/projects/${e}/target`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to update the project target right now.`}),S=e=>p(c(`/projects/auto-config`),{method:`POST`,body:e,fallbackErrorMessage:`Unable to infer project settings right now.`}),C=()=>p(c(`/projects/browse-repo-path`),{method:`POST`,fallbackErrorMessage:`Unable to open the folder picker right now.`}),w=e=>p(c(`/projects/validate-repo-path`),{method:`POST`,body:e,fallbackErrorMessage:`Unable to validate the repository path right now.`}),T=(e,t,n={})=>{let r=new URL(c(`/projects/${e}/file-suggestions`));return r.searchParams.set(`q`,t),n.ticketId&&r.searchParams.set(`ticket_id`,n.ticketId),p(r.toString(),{signal:n.signal,fallbackErrorMessage:`Unable to load project file suggestions right now.`})},E=(e,t,n={})=>p(c(`/projects/${e}/branch${n.refreshRemote?`?refresh_remote=true`:``}`),{signal:t,fallbackErrorMessage:`Unable to load the current branch right now.`}),D=e=>p(c(`/projects/${e}/git-pull`),{method:`POST`,fallbackErrorMessage:`Unable to sync the current branch right now.`}),O=e=>p(c(`/projects/${e}/diff`),{fallbackErrorMessage:`Unable to load the diff right now.`}),k=(e,t)=>p(c(`/projects/${e}/memories`),{signal:t,fallbackErrorMessage:`Unable to load project memories right now.`}),A=(e,t={})=>{let n=new URL(c(`/projects/${e}/git-status`));return t.refreshRemote&&n.searchParams.set(`refresh_remote`,`true`),p(n.toString(),{signal:t.signal,fallbackErrorMessage:`Unable to load git status right now.`})},j=e=>p(c(`/projects/${e}/git-commits`),{fallbackErrorMessage:`Unable to load local commits right now.`}),M=(e,t)=>p(c(`/projects/${e}/git-commit`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to create the commit right now.`}),N=(e,t)=>p(c(`/projects/${e}/git-commit-message`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to generate a commit message right now.`}),P=e=>p(c(`/projects/${e}/git-push`),{method:`POST`,fallbackErrorMessage:`Unable to push the branch right now.`}),ee=e=>p(c(`/projects/${e}/git-undo-latest`),{method:`POST`,fallbackErrorMessage:`Unable to undo the latest local commit right now.`}),F=(e,t)=>p(c(`/projects/${e}/memories`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to create the project memory right now.`}),te=(e,t,n)=>p(c(`/projects/${e}/memories/${t}`),{method:`PATCH`,body:n,fallbackErrorMessage:`Unable to update the project memory right now.`}),ne=(e,t)=>p(c(`/projects/${e}/memories/${t}/archive`),{method:`POST`,fallbackErrorMessage:`Unable to archive the project memory right now.`}),re=(e,t)=>p(c(`/projects/${e}/memories/${t}/restore`),{method:`POST`,fallbackErrorMessage:`Unable to restore the project memory right now.`}),ie=(e,t)=>p(c(`/projects/${e}/memories/${t}/supersede`),{method:`POST`,fallbackErrorMessage:`Unable to supersede the project memory right now.`}),I=(e,t)=>p(c(`/projects/${e}/context`),{signal:t,fallbackErrorMessage:`Unable to load project context right now.`}),L=e=>p(c(`/projects/${e}/context/scan`),{method:`POST`,fallbackErrorMessage:`Unable to start the project context scan right now.`}),ae=(e,t)=>p(c(`/projects/${e}/context/artifacts`),{signal:t,fallbackErrorMessage:`Unable to load project context artifacts right now.`}),oe=(e,t,n)=>p(c(`/projects/${e}/memory/relevant?ticket_id=${encodeURIComponent(t)}`),{signal:n,fallbackErrorMessage:`Unable to load relevant project memory right now.`}),R=(e,t,n,r)=>p(c(t?`/projects/${e}/memory/suggestions?ticket_id=${encodeURIComponent(t)}`:r?`/projects/${e}/memory/suggestions?chat_session_id=${encodeURIComponent(r)}`:`/projects/${e}/memory/suggestions`),{signal:n,fallbackErrorMessage:`Unable to load project memory suggestions right now.`}),se=(e,t,n)=>p(c(`/projects/${e}/memories/${t}/accept`),{method:`POST`,body:n,fallbackErrorMessage:`Unable to accept the project memory right now.`}),ce=(e,t)=>p(c(`/projects/${e}/memories/${t}/dismiss`),{method:`POST`,fallbackErrorMessage:`Unable to dismiss the project memory right now.`}),le=(e,t,n,r)=>p(c(`/projects/${e}/memories/${t}/apply-to-existing`),{method:`POST`,body:{memory_id:n,...r},fallbackErrorMessage:`Unable to apply the project memory right now.`}),ue=async e=>{let t=await f(c(`/projects/${e}/memory/export`),{fallbackErrorMessage:`Unable to export project memory right now.`});return{filename:m(t.headers.get(`Content-Disposition`)),archive:await t.json()}},de=(e,t)=>p(c(`/projects/${e}/memory/import`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to import project memory right now.`}),z=e(r(),1),fe=e(a(),1);function pe(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=pe(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function me(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=pe(e))&&(r&&(r+=` `),r+=t);return r}var he=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ge=me,_e=(e,t)=>n=>{if(t?.variants==null)return ge(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=he(t)||he(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 ge(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)};function ve(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ye(...e){return t=>{let n=!1,r=e.map(e=>{let r=ve(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():ve(e[t],null)}}}}function B(...e){return z.useCallback(ye(...e),e)}var be=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),xe=t(((e,t)=>{t.exports=be()})),V=xe();function Se(e){let t=we(e),n=z.forwardRef((e,n)=>{let{children:r,...i}=e,a=z.Children.toArray(r),o=a.find(De);if(o){let e=o.props.children,r=a.map(t=>t===o?z.Children.count(e)>1?z.Children.only(null):z.isValidElement(e)?e.props.children:null:t);return(0,V.jsx)(t,{...i,ref:n,children:z.isValidElement(e)?z.cloneElement(e,void 0,r):null})}return(0,V.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var Ce=Se(`Slot`);function we(e){let t=z.forwardRef((e,t)=>{let{children:n,...r}=e;if(z.isValidElement(n)){let e=ke(n),i=Oe(r,n.props);return n.type!==z.Fragment&&(i.ref=t?ye(t,e):e),z.cloneElement(n,i)}return z.Children.count(n)>1?z.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Te=Symbol(`radix.slottable`);function Ee(e){let t=({children:e})=>(0,V.jsx)(V.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Te,t}function De(e){return z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Te}function Oe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ke(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)}var H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Se(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ae(e,t){e&&fe.flushSync(()=>e.dispatchEvent(t))}function je(e,t){let n=z.createContext(t),r=e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,V.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=z.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Me(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,V.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=z.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>z.createContext(e));return function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ne(i,...t)]}function Ne(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Pe(e){let t=e+`CollectionProvider`,[n,r]=Me(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,V.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Se(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,V.jsx)(c,{ref:B(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Se(u),p=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=B(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,V.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return z.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[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Fe=globalThis?.document?z.useLayoutEffect:()=>{},Ie=z.useInsertionEffect||Fe;function Le({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Re({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=ze(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Re({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Ie(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ze(e){return typeof e==`function`}function Be(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}var Ve=e=>{let{present:t,children:n}=e,r=He(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=B(r.ref,We(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null};Ve.displayName=`Presence`;function He(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),[o,s]=Be(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{let e=Ue(r.current);a.current=o===`mounted`?e:`none`},[o]),Fe(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ue(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Fe(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ue(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ue(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:z.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ue(e){return e?.animationName||`none`}function We(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)}var Ge=z.useId||(()=>void 0),Ke=0;function qe(e){let[t,n]=z.useState(Ge());return Fe(()=>{e||n(e=>e??String(Ke++))},[e]),e||(t?`radix-${t}`:``)}var Je=z.createContext(void 0);function Ye(e){let t=z.useContext(Je);return e||t||`ltr`}function Xe(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>(...e)=>t.current?.(...e),[])}function Ze(e,t=globalThis?.document){let n=Xe(e);z.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Qe=`DismissableLayer`,$e=`dismissableLayer.update`,et=`dismissableLayer.pointerDownOutside`,tt=`dismissableLayer.focusOutside`,nt,rt=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),it=z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=z.useContext(rt),[u,d]=z.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=z.useState({}),m=B(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=st(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=ct(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Ze(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),z.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(nt=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),lt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=nt)}},[u,f,n,l]),z.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),lt())},[u,l]),z.useEffect(()=>{let e=()=>p({});return document.addEventListener($e,e),()=>document.removeEventListener($e,e)},[]),(0,V.jsx)(H.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:U(e.onFocusCapture,S.onFocusCapture),onBlurCapture:U(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,x.onPointerDownCapture)})});it.displayName=Qe;var at=`DismissableLayerBranch`,ot=z.forwardRef((e,t)=>{let n=z.useContext(rt),r=z.useRef(null),i=B(t,r);return z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,V.jsx)(H.div,{...e,ref:i})});ot.displayName=at;function st(e,t=globalThis?.document){let n=Xe(e),r=z.useRef(!1),i=z.useRef(()=>{});return z.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ut(et,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ct(e,t=globalThis?.document){let n=Xe(e),r=z.useRef(!1);return z.useEffect(()=>{let e=e=>{e.target&&!r.current&&ut(tt,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lt(){let e=new CustomEvent($e);document.dispatchEvent(e)}function ut(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?Ae(i,a):i.dispatchEvent(a)}var dt=`focusScope.autoFocusOnMount`,ft=`focusScope.autoFocusOnUnmount`,pt={bubbles:!1,cancelable:!0},mt=`FocusScope`,ht=z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=Xe(i),u=Xe(a),d=z.useRef(null),f=B(t,e=>c(e)),p=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:St(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||St(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&St(s)};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]),z.useEffect(()=>{if(s){Ct.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dt,pt);s.addEventListener(dt,l),s.dispatchEvent(t),t.defaultPrevented||(gt(Et(vt(s)),{select:!0}),document.activeElement===e&&St(s))}return()=>{s.removeEventListener(dt,l),setTimeout(()=>{let t=new CustomEvent(ft,pt);s.addEventListener(ft,u),s.dispatchEvent(t),t.defaultPrevented||St(e??document.body,{select:!0}),s.removeEventListener(ft,u),Ct.remove(p)},0)}}},[s,l,u,p]);let m=z.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]=_t(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&St(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&St(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,V.jsx)(H.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ht.displayName=mt;function gt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(St(r,{select:t}),document.activeElement!==n)return}function _t(e){let t=vt(e);return[yt(t,e),yt(t.reverse(),e)]}function vt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function yt(e,t){for(let n of e)if(!bt(n,{upTo:t}))return n}function bt(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}function xt(e){return e instanceof HTMLInputElement&&`select`in e}function St(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xt(e)&&t&&e.select()}}var Ct=wt();function wt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Tt(e,t),e.unshift(t)},remove(t){e=Tt(e,t),e[0]?.resume()}}}function Tt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Et(e){return e.filter(e=>e.tagName!==`A`)}var Dt=`Portal`,Ot=z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=z.useState(!1);Fe(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?fe.createPortal((0,V.jsx)(H.div,{...r,ref:t}),o):null});Ot.displayName=Dt;var kt=0;function At(){z.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??jt()),document.body.insertAdjacentElement(`beforeend`,e[1]??jt()),kt++,()=>{kt===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),kt--}},[])}function jt(){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}var W=function(){return W=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},W.apply(this,arguments)};function Mt(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 Nt(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 Pt=`right-scroll-bar-position`,Ft=`width-before-scroll-bar`,It=`with-scroll-bars-hidden`,Lt=`--removed-body-scroll-bar-size`;function Rt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function zt(e,t){var n=(0,z.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 Bt=typeof window<`u`?z.useLayoutEffect:z.useEffect,Vt=new WeakMap;function Ht(e,t){var n=zt(t||null,function(t){return e.forEach(function(e){return Rt(e,t)})});return Bt(function(){var t=Vt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Rt(e,null)}),i.forEach(function(e){r.has(e)||Rt(e,a)})}Vt.set(n,e)},[e]),n}function Ut(e){return e}function Wt(e,t){t===void 0&&(t=Ut);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 Gt(e){e===void 0&&(e={});var t=Wt(null);return t.options=W({async:!0,ssr:!1},e),t}var Kt=function(e){var t=e.sideCar,n=Mt(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 z.createElement(r,W({},n))};Kt.isSideCarExport=!0;function qt(e,t){return e.useMedium(t),Kt}var Jt=Gt(),Yt=function(){},Xt=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:Yt,onWheelCapture:Yt,onTouchMoveCapture:Yt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Mt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ht([n,t]),C=W(W({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:Jt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),W(W({},C),{ref:S})):z.createElement(v,W({},C,{className:c,ref:S}),s))});Xt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xt.classNames={fullWidth:Ft,zeroRight:Pt};var Zt,Qt=function(){if(Zt)return Zt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function $t(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Qt();return t&&e.setAttribute(`nonce`,t),e}function en(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var nn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$t())&&(en(t,n),tn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rn=function(){var e=nn();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},an=function(){var e=rn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},on={left:0,top:0,right:0,gap:0},sn=function(e){return parseInt(e||``,10)||0},cn=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[sn(n),sn(r),sn(i)]},ln=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return on;var t=cn(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])}},un=an(),dn=`data-scroll-locked`,fn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${It} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};