@wjarka/cezarion 0.14.9-dev.901 → 0.14.9-dev.911
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/ci-wait/controller.d.ts +12 -12
- package/dist/server/server.d.ts +58 -58
- package/dist/skills-remote.d.ts +30 -5
- package/dist/skills-remote.js +122 -32
- package/dist/skills-remote.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{agent-accounts-DOFEs7OK.js → agent-accounts-Bh1l3ZSb.js} +1 -1
- package/web/dist/assets/centered-state-kOb8j_BL.js +43 -0
- package/web/dist/assets/{collapsible-CH3UzMt8.js → collapsible-KSKVv9J9.js} +1 -1
- package/web/dist/assets/{commit-list-BF4myGkq.js → commit-list-na9G1rHG.js} +1 -1
- package/web/dist/assets/{compare-variants-DNX6SniB.js → compare-variants-CG8saweC.js} +1 -1
- package/web/dist/assets/{diff-controls-1iZN3L9z.js → diff-controls-D_kgpdoa.js} +1 -1
- package/web/dist/assets/{dropdown-menu-JK2oEKtU.js → dropdown-menu-78Ug-7x2.js} +1 -1
- package/web/dist/assets/{git-toolbar-Czc2eDts.js → git-toolbar-DFC6bS8a.js} +1 -1
- package/web/dist/assets/github-BiUjSaov.js +1 -0
- package/web/dist/assets/index-D-m3edXI.js +7 -0
- package/web/dist/assets/index-D5NkwqY7.css +1 -0
- package/web/dist/assets/{markdown-CbMH76QP.js → markdown-DlvW2wEx.js} +1 -1
- package/web/dist/assets/pill-0JHCf1v8.js +1 -0
- package/web/dist/assets/{project-router-5lOBnHn-.js → project-router-CS_oeLqi.js} +1 -1
- package/web/dist/assets/{prompt-templates-CinGNbS4.js → prompt-templates-BgXzCOlY.js} +1 -1
- package/web/dist/assets/{repo-git-CwEH2IXE.js → repo-git-CMFUWUJo.js} +1 -1
- package/web/dist/assets/{run-diff-3peOAX9l.js → run-diff-xym-7QHm.js} +1 -1
- package/web/dist/assets/run-header-BSKELRnz.js +1 -0
- package/web/dist/assets/skills-7nEXnFFc.js +1 -0
- package/web/dist/assets/{tab-link-KwnZekGX.js → tab-link-D6eAdJez.js} +1 -1
- package/web/dist/assets/task-changes-CjsEtUjh.js +1 -0
- package/web/dist/assets/{task-commits-CLHTP-nL.js → task-commits-CeALoVuD.js} +1 -1
- package/web/dist/assets/{task-files-BbQ3zTG5.js → task-files-Csb6CCIr.js} +2 -2
- package/web/dist/assets/task-thread-B-e9ZDoy.js +9 -0
- package/web/dist/assets/{textarea-CP5yQwcP.js → textarea-D2Gx4GDI.js} +1 -1
- package/web/dist/assets/thread-loading-hVlcCLdm.js +1 -0
- package/web/dist/assets/{token-metrics-BjlJ1WUf.js → token-metrics-BQvw6Yoj.js} +1 -1
- package/web/dist/assets/{workflows-BPYflHS1.js → workflows-CGbU1HdX.js} +3 -3
- package/web/dist/index.html +12 -12
- package/web/dist/assets/centered-state-BrRPODjj.js +0 -43
- package/web/dist/assets/github-BOYBHSuU.js +0 -1
- package/web/dist/assets/index-CaQiR7tg.js +0 -7
- package/web/dist/assets/index-Cp146nCD.css +0 -1
- package/web/dist/assets/pill-i0LDDqPl.js +0 -1
- package/web/dist/assets/run-header-DDuQGG2F.js +0 -1
- package/web/dist/assets/skills-Cd35zfc2.js +0 -1
- package/web/dist/assets/task-changes-BRAnOBnv.js +0 -1
- package/web/dist/assets/task-thread-BzPJy_YC.js +0 -9
- package/web/dist/assets/thread-loading-DRqt03Zs.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,D as i,M as a,N as o,O as s,j as c,k as l,z as u}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,D as i,M as a,N as o,O as s,j as c,k as l,z as u}from"./centered-state-kOb8j_BL.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:s,onOpenChange:c,...u}=e,[m,h]=l({prop:r,defaultProp:a??!1,onChange:c,caller:p});return(0,f.jsx)(g,{scope:n,disabled:s,contentId:i(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(o.div,{"data-state":w(m),"data-disabled":s?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=_(y,n);return(0,f.jsx)(o.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:c(e.onClick,i.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(s,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:i,children:a,...s}=e,c=_(x,n),[l,p]=d.useState(i),m=d.useRef(null),h=u(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=c.open||l,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),r(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(i)}},[c.open,i]),(0,f.jsx)(o.div,{"data-state":w(c.open),"data-disabled":c.disabled?``:void 0,id:c.contentId,hidden:!S,...s,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&a})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Rt as r,_t as i,lt as a}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Rt as r,_t as i,lt as a}from"./centered-state-kOb8j_BL.js";import{t as o}from"./utils-BW1-Ibnd.js";import{t as s}from"./project-router-CS_oeLqi.js";import{h as c}from"./index-D-m3edXI.js";import{t as l}from"./lib-BQXq3kEf.js";var u=e(t(),1),d=n(),f=77;function p({slot:e,commits:t,className:n,heading:i}){let[a,s]=(0,u.useState)(``),p=a.trim().toLowerCase(),h=p?t.filter(e=>e.subject.toLowerCase().includes(p)):t,g=h.length>150,_=(0,u.useRef)(null),v=(0,u.useRef)(null),[y,b]=(0,u.useState)(0);(0,u.useLayoutEffect)(()=>{if(!g)return;let e=()=>{let e=_.current,t=v.current;!e||!t||b(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[g]);let x=h.map(n=>(0,d.jsx)(m,{commit:n,detailed:e===`task-commits`&&t.length===1},n.sha));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`label`,{className:`relative mb-[22px] block`,children:[(0,d.jsx)(r,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3.5 left-3 size-4 text-muted-foreground`}),(0,d.jsx)(c,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:a,onChange:e=>s(e.target.value),className:`h-11 bg-card pl-10`})]}),(0,d.jsxs)(`div`,{ref:e=>{_.current=e,e&&(v.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":g,className:o(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-4 py-1 md:px-5`,n),children:[i?(0,d.jsx)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 py-4`,children:i}):null,h.length===0?(0,d.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,g?(0,d.jsx)(l,{scrollRef:v,startMargin:y,itemSize:f,children:x}):x]})]})}function m({commit:e,detailed:t}){return(0,d.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_77px] [content-visibility:auto]`,children:(0,d.jsxs)(s,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:o(`flex min-h-[76px] min-w-0 flex-col items-start gap-3 rounded-sm py-4 hover:bg-muted`,!t&&`md:flex-row md:items-center md:py-3`),children:[(0,d.jsx)(i,{size:16,"aria-hidden":`true`,className:o(`shrink-0 text-accent-text`,t?`size-[22px]`:`size-4`)}),(0,d.jsxs)(`span`,{className:o(`min-w-0 w-full`,!t&&`md:w-auto md:flex-1`),children:[(0,d.jsx)(`span`,{className:o(`block font-normal`,t?`text-[22px] leading-snug`:`text-[13px] md:truncate`),children:e.subject}),(0,d.jsxs)(`span`,{className:`mt-1 block truncate text-[11px] text-soft-foreground`,children:[e.author,` · `,e.when]})]}),(0,d.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),t?(0,d.jsxs)(`span`,{className:`inline-flex min-h-11 items-center gap-2 rounded-lg bg-action px-3 text-xs font-medium text-action-foreground`,children:[(0,d.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-4`}),`View changes`]}):null]})})}export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$i as r,Ba as i,Dn as a,En as o,Fr as s,Ga as c,Jr as l,Ra as u,Y as d,Z as f,a as p,c as m,d as h,fr as g,i as _,ii as v,in as y,jr as b,l as x,o as S,r as C,s as w,t as T,u as E,ui as D,ya as O}from"./centered-state-kOb8j_BL.js";import{t as k}from"./utils-BW1-Ibnd.js";import{n as A,r as j,t as M}from"./collapsible-KSKVv9J9.js";import{c as N,t as P}from"./project-router-CS_oeLqi.js";import{t as F}from"./search-x-I9Q8pgUa.js";import{t as I}from"./markdown-DlvW2wEx.js";import{n as L,t as R}from"./token-metrics-BQvw6Yoj.js";import{g as z,m as B}from"./index-D-m3edXI.js";import{t as V}from"./run-diff-xym-7QHm.js";var H=e(t(),1),U=n();function W(){let{groupId:e}=u(),t=o(e),n=R(a().data),r=c();if((0,H.useEffect)(()=>{e&&r.invalidateQueries({queryKey:y.groups.detail(e)})},[r,e,(g().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,U.jsx)(B,{});if(t.isError){let e=t.error instanceof D&&t.error.status===404;return(0,U.jsx)(`div`,{"data-route":`compare`,className:`task-flow-page flex min-h-full flex-col`,children:(0,U.jsx)(T,{icon:e?(0,U.jsx)(F,{}):(0,U.jsx)(z,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsx)(h,{asChild:!0,variant:`outline`,children:(0,U.jsx)(P,{to:`/`,children:`Back to tasks`})}),e?null:(0,U.jsx)(h,{variant:`outline`,onClick:()=>void t.refetch(),children:`Retry`})]})})})}return(0,U.jsx)(G,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function G({groupId:e,variants:t,showTokens:n,showCost:a}){let o=N(),s=c(),[u,d]=(0,H.useState)(null),f=t.every(e=>b.has(e.status)),h=t[0]?l(t[0]):``,g=i({mutationFn:t=>r(e,t),onSuccess:(t,n)=>{s.invalidateQueries({queryKey:y.runs.all}),s.invalidateQueries({queryKey:y.groups.detail(e)}),o(`/tasks/${t.winner?.id??n}`)},onError:e=>O(e.message,{tone:`danger`})});return(0,U.jsxs)(`div`,{"data-route":`compare`,className:`task-flow-page flex w-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,U.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,U.jsx)(z,{className:`size-5 shrink-0 text-accent-icon`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Compare variants`})]}),(0,U.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[h,` · `,t.length,` `,f?`completed variants with distinct committed diffs.`:`variants of the same task, each in its own worktree.`]})]}),f?null:(0,U.jsxs)(`section`,{role:`status`,className:`rounded-xl border border-border bg-card p-5`,children:[(0,U.jsx)(`h2`,{className:`text-lg font-normal`,children:`Variants are still running`}),(0,U.jsx)(`p`,{className:`mt-3 text-[13px] text-muted-foreground`,children:`Compare progress now. Picking a result is disabled until every variant finishes.`})]}),(0,U.jsx)(`div`,{"data-slot":`compare-columns`,className:k(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,U.jsx)(K,{variant:e,allTerminal:f,pickPending:g.isPending,onPick:()=>d(e),showTokens:n,showCost:a},e.id))}),(0,U.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-[22px]`,children:t.map(e=>(0,U.jsx)(q,{variant:e},e.id))}),(0,U.jsx)(C,{open:u!==null,onOpenChange:e=>!e&&d(null),children:(0,U.jsxs)(S,{"data-slot":`variant-confirm-dialog`,children:[(0,U.jsxs)(x,{children:[(0,U.jsxs)(E,{children:[`Pick variant `,u?.variant,`?`]}),(0,U.jsxs)(w,{children:[`Variant `,u?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,U.jsxs)(m,{children:[(0,U.jsx)(p,{children:`Cancel`}),(0,U.jsxs)(_,{"data-slot":`confirm-pick`,onClick:()=>{u&&g.mutate(u.id),d(null)},children:[`Pick variant `,u?.variant]})]})]})})]})}function K({variant:e,allTerminal:t,pickPending:n,onPick:r,showTokens:i,showCost:a}){let o=v(e),c=s(e.costUsd),l=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,U.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-accent-strong/15 font-mono text-xs font-semibold text-accent-text`,children:e.variant}),(0,U.jsxs)(`span`,{"data-slot":`variant-status`,className:`text-lg font-normal`,children:[`· `,(0,U.jsx)(`span`,{className:`capitalize`,children:o.label})]}),i&&l||a&&c?(0,U.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] text-soft-foreground`,children:[i?(0,U.jsx)(L,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,i&&l&&a&&c?(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,a&&c?(0,U.jsx)(`span`,{className:`font-mono tabular-nums`,children:c}):null]}):null]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,U.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,U.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[13px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,U.jsx)(I,{children:e.handoffExcerpt})}):(0,U.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,U.jsx)(h,{asChild:!0,variant:`outline`,className:`self-start`,children:(0,U.jsx)(P,{to:`/tasks/${e.id}`,children:`Open task`})}),(0,U.jsxs)(h,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,U.jsx)(d,{"aria-hidden":`true`}),`Pick variant `,e.variant]})]})}function q({variant:e}){let[t,n]=(0,H.useState)(!1);return(0,U.jsxs)(M,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,U.jsxs)(j,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,U.jsx)(f,{className:k(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,U.jsx)(A,{children:(0,U.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,U.jsx)(V,{runId:e.id})})})]})}export{W as CompareVariantsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{d as t,gt as n,rt as r}from"./centered-state-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{d as t,gt as n,rt as r}from"./centered-state-kOb8j_BL.js";import{t as i}from"./utils-BW1-Ibnd.js";import{t as a}from"./createLucideIcon-BHp8sXmF.js";var o=a(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),s=a(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),c=e();function l({mode:e,wrap:n,onModeChange:r,onWrapChange:a}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,c.jsx)(u,{current:e,value:`unified`,onModeChange:r}),(0,c.jsx)(u,{current:e,value:`split`,onModeChange:r})]}),(0,c.jsx)(t,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":n,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:i(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>a(!n),children:(0,c.jsx)(s,{"aria-hidden":`true`})})]})}function u({current:e,value:t,onModeChange:n}){let a=e===t;return(0,c.jsxs)(`button`,{type:`button`,"data-mode":t,"aria-pressed":a,onClick:()=>n(t),className:i(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[t===`unified`?(0,c.jsx)(o,{"aria-hidden":`true`,className:`size-4`}):(0,c.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),t]})}function d({branch:e}){return(0,c.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,c.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,c.jsx)(`span`,{className:`truncate`,children:e})]})}export{l as n,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,C as a,D as o,E as s,I as c,M as l,N as u,O as d,P as f,S as p,T as m,Y as h,b as g,et as _,j as v,k as y,w as b,x,z as S}from"./centered-state-BrRPODjj.js";import{t as C}from"./utils-BW1-Ibnd.js";var w=e(t(),1),T=r();function E(e){let t=e+`CollectionProvider`,[n,r]=l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,T.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=c(s),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=S(t,a(s,n).collectionRef);return(0,T.jsx)(u,{ref:i,children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=c(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=S(t,o),c=a(f,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,T.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));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:d,ItemSlot:h},g,r]}var D=w.createContext(void 0);function O(e){let t=w.useContext(D);return e||t||`ltr`}var k=e(n(),1);function A(e){let[t,n]=w.useState(void 0);return i(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var j=[`top`,`right`,`bottom`,`left`],M=Math.min,N=Math.max,P=Math.round,F=Math.floor,I=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function te(e,t,n){return N(e,M(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function B(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function V(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return B(V(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=z(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=z(e),a=de(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=R(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _e(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=re(t),s=ne(o),c=R(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=z(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=L(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ye&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=L(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=M(d[_],T),D=M(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=te(E,k,O),j=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,N=j?k<E?k-E:k-O:0;return{[p]:f[p]+N,data:{[p]:A,centerOffset:k-A-N,...j&&{alignmentOffset:N}},reset:j}}}),Se=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=L(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=R(r),_=V(o),v=R(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==V(t))||T.every(e=>V(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=V(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return j.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=L(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=V(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=L(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Oe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await De(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ke=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=L(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(i),p=B(f),m=u[p],h=u[f],g=(e,t)=>te(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=L(e,t),u={x:n,y:r},d=V(i),f=B(d),p=u[f],m=u[d],h=L(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ee.has(R(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},je=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=L(e,t),c=await i.detectOverflow(t,s),l=R(n),u=z(n),d=V(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=M(p-c[m],g),y=M(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*N(c.left,c.right):S=p-2*N(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Me()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Me()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,Ve;function He(e){let t=W(e)?q(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!We()&&(K(t.backdropFilter)||K(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=J(e);for(;G(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=J(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function q(e){return H(e).getComputedStyle(e)}function Ke(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||U(e);return Fe(t)?t.host:t}function qe(e){let t=J(e);return Ge(t)?(e.ownerDocument||e).body:G(t)&&Ie(t)?t:qe(t)}function Je(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qe(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ye(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Je(e):[])}else return t.concat(r,Je(r,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xe(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P(n)!==a||P(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ze(e){return W(e)?e:e.contextElement}function Qe(e){let t=Ze(e);if(!G(t))return I(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xe(t),o=(a?P(n.width):n.width)/r,s=(a?P(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $e=I(0);function et(e){let t=H(e);return!We()||!t.visualViewport?$e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Y(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ze(e),o=I(1);t&&(r?W(r)&&(o=Qe(r)):o=Qe(e));let s=tt(a,n,r)?et(a):I(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=Ye(n);for(;i&&t!==n;){let e=Qe(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ye(n)}}return ge({width:u,height:d,x:c,y:l})}function nt(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:Y(U(e)).left+n}function rt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nt(e,n),y:n.top+t.scrollTop}}function it(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I(1),u=I(0),d=G(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=Y(r);l=Qe(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rt(o,c):I(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function at(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ot(e){let t=Ke(e),n=e.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+nt(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=N(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var st=25;function ct(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(nt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=st&&(s-=o)}return{width:s,height:c,x:l,y:u}}function lt(e,t){let n=Y(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qe(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ut(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ct(e,n,t);else if(t===`document`)r=ot(U(e));else if(W(t))r=lt(t,n);else{let n=et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function dt(e,t){let n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>W(e)&&Ne(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;W(o)&&!Ge(o);){let e=q(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function ft(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:dt(t,this._c):[].concat(n),r],o=ut(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ut(t,a[e],i);s=N(n.top,s),c=M(n.right,c),l=M(n.bottom,l),u=N(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function pt(e){let{width:t,height:n}=Xe(e);return{width:t,height:n}}function mt(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Y(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=Y(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=nt(i));let l=i&&!r&&!a?rt(i,s):I(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ht(e){return q(e).position===`static`}function gt(e,t){if(!G(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){let n=H(e);if(Re(e))return n;if(!G(e)){let t=J(e);for(;t&&!Ge(t);){if(W(t)&&!ht(t))return t;t=J(t)}return n}let r=gt(e,t);for(;r&&Le(r)&&ht(r);)r=gt(r,t);return r&&Ge(r)&&ht(r)&&!He(r)?n:r||Ue(e)||n}var vt=async function(e){let t=this.getOffsetParent||_t,n=this.getDimensions,r=await n(e.floating);return{reference:mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yt(e){return q(e).direction===`rtl`}var bt={convertOffsetParentRelativeRectToViewportRelativeRect:it,getDocumentElement:U,getClippingRect:ft,getOffsetParent:_t,getElementRects:vt,getClientRects:at,getDimensions:pt,getScale:Qe,isElement:W,isRTL:yt};function xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function St(e,t,n){let r=null,i,a=U(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=F(d),h=F(a.clientWidth-(u+f)),g=F(a.clientHeight-(d+p)),_=F(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N(0,M(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ct(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ze(e),u=i||a?[...l?Je(l):[],...t?Je(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?St(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Y(e):null;c&&g();function g(){let t=Y(e);h&&!xt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wt=Oe,Tt=ke,Et=Se,Dt=je,Ot=Te,kt=xe,At=Ae,jt=(e,t,n)=>{let r=new Map,i=n??{},a={...bt,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Mt=typeof document<`u`?w.useLayoutEffect:function(){};function Nt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Nt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(e,t){let n=Pt(e);return Math.round(t*n)/n}function It(e){let t=w.useRef(e);return Mt(()=>{t.current=e}),t}function Lt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);Nt(f,r)||p(r);let[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=w.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=w.useRef(null),C=w.useRef(null),T=w.useRef(u),E=c!=null,D=It(c),O=It(i),A=It(l),j=w.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Nt(T.current,t)&&(T.current=t,k.flushSync(()=>{d(t)}))})},[f,t,n,O,A]);Mt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=w.useRef(!1);Mt(()=>(M.current=!0,()=>{M.current=!1}),[]),Mt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,j);j()}},[b,x,j,D,E]);let N=w.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=w.useMemo(()=>({reference:b,floating:x}),[b,x]),F=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ft(P.floating,u.x),r=Ft(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Rt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:kt({element:r.current,padding:i}).fn(n):r?kt({element:r,padding:i}).fn(n):{}}}},zt=(e,t)=>{let n=wt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{let n=Tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=(e,t)=>({fn:At(e).fn,options:[e,t]}),Ht=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=`Arrow`,qt=w.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,T.jsx)(u.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,T.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qt.displayName=Kt;var Jt=qt,Yt=`Popper`,[Xt,Zt]=l(Yt),[Qt,$t]=Xt(Yt),en=e=>{let{__scopePopper:t,children:n}=e,[r,i]=w.useState(null),[a,o]=w.useState(void 0);return(0,T.jsx)(Qt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};en.displayName=Yt;var tn=`PopperAnchor`,nn=w.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$t(tn,n),o=w.useRef(null),s=a.onAnchorChange,c=S(t,w.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let d=a.placementState&&pn(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,T.jsx)(u.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:c})});nn.displayName=tn;var rn=`PopperContent`,[an,on]=Xt(rn),sn=w.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=$t(rn,n),[b,x]=w.useState(null),C=S(t,x),[E,D]=w.useState(null),O=A(E),k=O?.width??0,j=O?.height??0,M=r+(o===`center`?``:`-`+o),N=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(f)?f:[f],F=P.length>0,I={padding:N,boundary:P.filter(dn),altBoundary:F},{refs:ee,floatingStyles:te,placement:L,isPositioned:R,middlewareData:z}=Lt({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>Ct(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[zt({mainAxis:a+j,alignmentAxis:c}),d&&Bt({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?Vt():void 0,...I}),d&&Ht({...I}),Ut({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Gt({element:E,padding:l}),fn({arrowWidth:k,arrowHeight:j}),h&&Wt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),B=y.setPlacementState;i(()=>(B(L),()=>{B(void 0)}),[L,B]);let[ne,V]=pn(L),re=s(_);i(()=>{R&&re?.()},[R,re]);let ie=z.arrow?.x,ae=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,ce]=w.useState();return i(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),(0,T.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:R?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,T.jsx)(an,{scope:n,placedSide:ne,placedAlign:V,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,T.jsx)(u.div,{"data-side":ne,"data-align":V,...v,ref:C,style:{...v.style,animation:R?void 0:`none`}})})})});sn.displayName=rn;var cn=`PopperArrow`,ln={top:`bottom`,right:`left`,bottom:`top`,left:`right`},un=w.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=on(cn,n),a=ln[i.placedSide];return(0,T.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,T.jsx)(Jt,{...r,ref:t,style:{...r.style,display:`block`}})})});un.displayName=cn;function dn(e){return e!==null}var fn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=pn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function pn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var mn=en,hn=nn,gn=sn,_n=un,vn=!1;function yn(){let[e,t]=w.useState(vn);return w.useEffect(()=>{vn||(vn=!0,t(!0))},[]),e}var bn=w.useSyncExternalStore;function xn(){return()=>{}}function Sn(){return bn(xn,()=>!0,()=>!1)}var Cn=typeof bn==`function`?Sn:yn,wn=`rovingFocusGroup.onEntryFocus`,Tn={bubbles:!1,cancelable:!0},En=`RovingFocusGroup`,[Dn,On,kn]=E(En),[An,jn]=l(En,[kn]),[Mn,Nn]=An(En),Pn=w.forwardRef((e,t)=>(0,T.jsx)(Dn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Dn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Fn,{...e,ref:t})})}));Pn.displayName=En;var Fn=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=w.useRef(null),h=S(t,m),g=O(a),[_,b]=y({prop:o,defaultProp:c??null,onChange:l,caller:En}),[x,C]=w.useState(!1),E=s(d),D=On(n),k=w.useRef(!1),[A,j]=w.useState(0);return w.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(wn,E),()=>e.removeEventListener(wn,E)},[E]),(0,T.jsx)(Mn,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:w.useCallback(e=>b(e),[b]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>j(e=>e-1),[]),children:(0,T.jsx)(u.div,{tabIndex:x||A===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:v(e.onMouseDown,()=>{k.current=!0}),onFocus:v(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(wn,Tn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Vn([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:v(e.onBlur,()=>C(!1))})})}),In=`RovingFocusGroupItem`,Ln=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:c,...l}=e,d=o(),f=s||d,p=Nn(In,n),m=p.currentTabStopId===f,h=On(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:y}=p,b=Cn();return i(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),w.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,T.jsx)(Dn.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:(0,T.jsx)(u.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:t,onMouseDown:v(e.onMouseDown,e=>{r?p.onItemFocus(f):e.preventDefault()}),onFocus:v(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:v(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bn(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?Hn(n,r+1):n.slice(r+1)}setTimeout(()=>Vn(n))}}),children:typeof c==`function`?c({isCurrentTabStop:m,hasTabStop:y!=null}):c})})});Ln.displayName=In;var Rn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Bn(e,t,n){let r=zn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rn[r]}function Vn(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Hn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Un=Pn,Wn=Ln,Gn=[`Enter`,` `],Kn=[`ArrowDown`,`PageUp`,`Home`],qn=[`ArrowUp`,`PageDown`,`End`],Jn=[...Kn,...qn],Yn={ltr:[...Gn,`ArrowRight`],rtl:[...Gn,`ArrowLeft`]},Xn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Zn=`Menu`,[Qn,$n,er]=E(Zn),[X,tr]=l(Zn,[er,Zt,jn]),nr=Zt(),rr=jn(),[ir,Z]=X(Zn),[ar,or]=X(Zn),sr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,c=nr(t),[l,u]=w.useState(null),d=w.useRef(!1),f=s(a),p=O(i);return w.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),w.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,T.jsx)(ar,{scope:t,onClose:w.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};sr.displayName=Zn;var cr=`MenuAnchor`,lr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(hn,{...i,...r,ref:t})});lr.displayName=cr;var ur=`MenuPortal`,[dr,fr]=X(ur,{forceMount:void 0}),pr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Z(ur,t);return(0,T.jsx)(dr,{scope:t,forceMount:n,children:(0,T.jsx)(d,{present:n||o.open,children:(0,T.jsx)(a,{asChild:!0,container:i,children:r})})})};pr.displayName=ur;var Q=`MenuContent`,[mr,hr]=X(Q),gr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=or(Q,e.__scopeMenu);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||a.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:o.modal?(0,T.jsx)(_r,{...i,ref:t}):(0,T.jsx)(vr,{...i,ref:t})})})})}),_r=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),r=w.useRef(null),i=S(t,r);return w.useEffect(()=>{let e=r.current;if(e)return g(e)},[]),(0,T.jsx)(br,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:v(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vr=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,T.jsx)(br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yr=c(`MenuContent.ScrollLock`),br=w.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,..._}=e,y=Z(Q,n),C=or(Q,n),E=nr(n),D=rr(n),O=$n(n),[k,A]=w.useState(null),j=w.useRef(null),M=S(t,j,y.onContentChange),N=w.useRef(0),P=w.useRef(``),F=w.useRef(0),I=w.useRef(null),ee=w.useRef(`right`),te=w.useRef(0),L=g?x:w.Fragment,R=g?{as:yr,allowPinchZoom:!0}:void 0,z=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ii(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};w.useEffect(()=>()=>window.clearTimeout(N.current),[]),p();let B=w.useCallback(e=>ee.current===I.current?.side&&oi(e,I.current?.area),[]);return(0,T.jsx)(mr,{scope:n,searchRef:P,onItemEnter:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:w.useCallback(e=>{B(e)||(j.current?.focus(),A(null))},[B]),onTriggerLeave:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:w.useCallback(e=>{I.current=e},[]),children:(0,T.jsx)(L,{...R,children:(0,T.jsx)(b,{asChild:!0,trapped:i,onMountAutoFocus:v(a,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,T.jsx)(m,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:(0,T.jsx)(Un,{asChild:!0,...D,dir:C.dir,orientation:`vertical`,loop:r,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:v(c,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,T.jsx)(gn,{role:`menu`,"aria-orientation":`vertical`,"data-state":$r(y.open),"data-radix-menu-content":``,dir:C.dir,...E,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:v(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&z(e.key));let i=j.current;if(e.target!==i||!Jn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);qn.includes(e.key)&&a.reverse(),ni(a)}),onBlur:v(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:v(e.onPointerMove,si(e=>{let t=e.target,n=te.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>te.current?`right`:`left`;ee.current=t,te.current=e.clientX}}))})})})})})})});gr.displayName=Q;var xr=`MenuGroup`,Sr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`group`,...r,ref:t})});Sr.displayName=xr;var Cr=`MenuLabel`,wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{...r,ref:t})});wr.displayName=Cr;var Tr=`MenuItem`,Er=`menu.itemSelect`,Dr=w.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=w.useRef(null),o=or(Tr,e.__scopeMenu),s=hr(Tr,e.__scopeMenu),c=S(t,a),l=w.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Er,{bubbles:!0,cancelable:!0});e.addEventListener(Er,e=>r?.(e),{once:!0}),f(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,T.jsx)(Or,{...i,ref:c,disabled:n,onClick:v(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:v(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:v(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||Gn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Dr.displayName=Tr;var Or=w.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=hr(Tr,n),s=rr(n),c=w.useRef(null),l=S(t,c),[d,f]=w.useState(!1),[p,m]=w.useState(``);return w.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,T.jsx)(Qn.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,T.jsx)(Wn,{asChild:!0,...s,focusable:!r,children:(0,T.jsx)(u.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:v(e.onPointerMove,si(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:v(e.onPointerLeave,si(e=>o.onItemLeave(e))),onFocus:v(e.onFocus,()=>f(!0)),onBlur:v(e.onBlur,()=>f(!1))})})})}),kr=`MenuCheckboxItem`,Ar=w.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:n,children:(0,T.jsx)(Dr,{role:`menuitemcheckbox`,"aria-checked":ei(n)?`mixed`:n,...i,ref:t,"data-state":ti(n),onSelect:v(i.onSelect,()=>r?.(ei(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ar.displayName=kr;var jr=`MenuRadioGroup`,[Mr,Nr]=X(jr,{value:void 0,onValueChange:()=>{}}),Pr=w.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=s(r);return(0,T.jsx)(Mr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,T.jsx)(Sr,{...i,ref:t})})});Pr.displayName=jr;var Fr=`MenuRadioItem`,Ir=w.forwardRef((e,t)=>{let{value:n,...r}=e,i=Nr(Fr,e.__scopeMenu),a=n===i.value;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:a,children:(0,T.jsx)(Dr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ti(a),onSelect:v(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ir.displayName=Fr;var Lr=`MenuItemIndicator`,[Rr,zr]=X(Lr,{checked:!1}),Br=w.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=zr(Lr,n);return(0,T.jsx)(d,{present:r||ei(a.checked)||a.checked===!0,children:(0,T.jsx)(u.span,{...i,ref:t,"data-state":ti(a.checked)})})});Br.displayName=Lr;var Vr=`MenuSeparator`,Hr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Hr.displayName=Vr;var Ur=`MenuArrow`,Wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(_n,{...i,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuSub`,[Kr,qr]=X(Gr),Jr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(Gr,t),c=nr(t),[l,u]=w.useState(null),[d,f]=w.useState(null),p=s(i);return w.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,T.jsx)(Kr,{scope:t,contentId:o(),triggerId:o(),trigger:l,onTriggerChange:u,children:n})})})};Jr.displayName=Gr;var Yr=`MenuSubTrigger`,Xr=w.forwardRef((e,t)=>{let n=Z(Yr,e.__scopeMenu),r=or(Yr,e.__scopeMenu),i=qr(Yr,e.__scopeMenu),a=hr(Yr,e.__scopeMenu),o=w.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=w.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);w.useEffect(()=>u,[u]),w.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=S(t,i.onTriggerChange);return(0,T.jsx)(lr,{asChild:!0,...l,children:(0,T.jsx)(Or,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":$r(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:v(e.onPointerMove,si(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:v(e.onPointerLeave,si(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:v(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Yn[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Xr.displayName=Yr;var Zr=`MenuSubContent`,Qr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Z(Q,e.__scopeMenu),s=or(Q,e.__scopeMenu),c=qr(Zr,e.__scopeMenu),l=w.useRef(null),u=S(t,l);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||o.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:(0,T.jsx)(br,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:v(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:v(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:v(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Xn[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Qr.displayName=Zr;function $r(e){return e?`open`:`closed`}function ei(e){return e===`indeterminate`}function ti(e){return ei(e)?`indeterminate`:e?`checked`:`unchecked`}function ni(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ri(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ii(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ri(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ai(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oi(e,t){return t?ai({x:e.clientX,y:e.clientY},t):!1}function si(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ci=sr,li=lr,ui=pr,di=gr,fi=Sr,pi=wr,mi=Dr,hi=Ar,gi=Pr,_i=Ir,vi=Br,yi=Hr,bi=Wr,xi=Xr,Si=Qr,Ci=`DropdownMenu`,[wi,Ti]=l(Ci,[tr]),$=tr(),[Ei,Di]=wi(Ci),Oi=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=e,l=$(t),u=w.useRef(null),[d,f]=y({prop:i,defaultProp:a??!1,onChange:s,caller:Ci});return(0,T.jsx)(Ei,{scope:t,triggerId:o(),triggerRef:u,contentId:o(),open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,T.jsx)(ci,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};Oi.displayName=Ci;var ki=`DropdownMenuTrigger`,Ai=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Di(ki,n),o=$(n),s=S(t,a.triggerRef);return(0,T.jsx)(li,{asChild:!0,...o,children:(0,T.jsx)(u.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:v(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:v(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ai.displayName=ki;var ji=`DropdownMenuPortal`,Mi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,T.jsx)(ui,{...r,...n})};Mi.displayName=ji;var Ni=`DropdownMenuContent`,Pi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Di(Ni,n),a=$(n),o=w.useRef(!1);return(0,T.jsx)(di,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:v(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:v(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pi.displayName=Ni;var Fi=`DropdownMenuGroup`,Ii=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(fi,{...i,...r,ref:t})});Ii.displayName=Fi;var Li=`DropdownMenuLabel`,Ri=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(pi,{...i,...r,ref:t})});Ri.displayName=Li;var zi=`DropdownMenuItem`,Bi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(mi,{...i,...r,ref:t})});Bi.displayName=zi;var Vi=`DropdownMenuCheckboxItem`,Hi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(hi,{...i,...r,ref:t})});Hi.displayName=Vi;var Ui=`DropdownMenuRadioGroup`,Wi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(gi,{...i,...r,ref:t})});Wi.displayName=Ui;var Gi=`DropdownMenuRadioItem`,Ki=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(_i,{...i,...r,ref:t})});Ki.displayName=Gi;var qi=`DropdownMenuItemIndicator`,Ji=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(vi,{...i,...r,ref:t})});Ji.displayName=qi;var Yi=`DropdownMenuSeparator`,Xi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(yi,{...i,...r,ref:t})});Xi.displayName=Yi;var Zi=`DropdownMenuArrow`,Qi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(bi,{...i,...r,ref:t})});Qi.displayName=Zi;var $i=`DropdownMenuSubTrigger`,ea=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(xi,{...i,...r,ref:t})});ea.displayName=$i;var ta=`DropdownMenuSubContent`,na=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(Si,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});na.displayName=ta;var ra=Oi,ia=Ai,aa=Mi,oa=Pi,sa=Ri,ca=Bi,la=Hi,ua=Wi,da=Ki,fa=Ji,pa=Xi;function ma({...e}){return(0,T.jsx)(ra,{"data-slot":`dropdown-menu`,...e})}function ha({...e}){return(0,T.jsx)(ia,{"data-slot":`dropdown-menu-trigger`,...e})}function ga({className:e,sideOffset:t=4,...n}){return(0,T.jsx)(aa,{children:(0,T.jsx)(oa,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:C(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function _a({className:e,inset:t,variant:n=`default`,...r}){return(0,T.jsx)(ca,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:C(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function va({className:e,children:t,checked:n,...r}){return(0,T.jsxs)(la,{"data-slot":`dropdown-menu-checkbox-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(h,{className:`size-4`})})}),t]})}function ya({...e}){return(0,T.jsx)(ua,{"data-slot":`dropdown-menu-radio-group`,...e})}function ba({className:e,children:t,...n}){return(0,T.jsxs)(da,{"data-slot":`dropdown-menu-radio-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(_,{className:`size-2 fill-current`})})}),t]})}function xa({className:e,inset:t,...n}){return(0,T.jsx)(sa,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:C(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Sa({className:e,...t}){return(0,T.jsx)(pa,{"data-slot":`dropdown-menu-separator`,className:C(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Zt as _,xa as a,Sa as c,Un as d,jn as f,mn as g,gn as h,_a as i,ha as l,_n as m,va as n,ya as o,hn as p,ga as r,ba as s,ma as t,Wn as u,A as v,O as y};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,C as a,D as o,E as s,I as c,M as l,N as u,O as d,P as f,S as p,T as m,Y as h,b as g,et as _,j as v,k as y,w as b,x,z as S}from"./centered-state-kOb8j_BL.js";import{t as C}from"./utils-BW1-Ibnd.js";var w=e(t(),1),T=r();function E(e){let t=e+`CollectionProvider`,[n,r]=l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,T.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=c(s),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=S(t,a(s,n).collectionRef);return(0,T.jsx)(u,{ref:i,children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=c(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=S(t,o),c=a(f,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,T.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));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:d,ItemSlot:h},g,r]}var D=w.createContext(void 0);function O(e){let t=w.useContext(D);return e||t||`ltr`}var k=e(n(),1);function A(e){let[t,n]=w.useState(void 0);return i(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var j=[`top`,`right`,`bottom`,`left`],M=Math.min,N=Math.max,P=Math.round,F=Math.floor,I=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function te(e,t,n){return N(e,M(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function B(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function V(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return B(V(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=z(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=z(e),a=de(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=R(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _e(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=re(t),s=ne(o),c=R(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=z(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=L(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ye&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=L(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=M(d[_],T),D=M(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=te(E,k,O),j=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,N=j?k<E?k-E:k-O:0;return{[p]:f[p]+N,data:{[p]:A,centerOffset:k-A-N,...j&&{alignmentOffset:N}},reset:j}}}),Se=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=L(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=R(r),_=V(o),v=R(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==V(t))||T.every(e=>V(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=V(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return j.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=L(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=V(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=L(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Oe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await De(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ke=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=L(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(i),p=B(f),m=u[p],h=u[f],g=(e,t)=>te(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=L(e,t),u={x:n,y:r},d=V(i),f=B(d),p=u[f],m=u[d],h=L(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ee.has(R(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},je=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=L(e,t),c=await i.detectOverflow(t,s),l=R(n),u=z(n),d=V(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=M(p-c[m],g),y=M(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*N(c.left,c.right):S=p-2*N(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Me()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Me()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,Ve;function He(e){let t=W(e)?q(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!We()&&(K(t.backdropFilter)||K(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=J(e);for(;G(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=J(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function q(e){return H(e).getComputedStyle(e)}function Ke(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||U(e);return Fe(t)?t.host:t}function qe(e){let t=J(e);return Ge(t)?(e.ownerDocument||e).body:G(t)&&Ie(t)?t:qe(t)}function Je(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qe(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ye(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Je(e):[])}else return t.concat(r,Je(r,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xe(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P(n)!==a||P(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ze(e){return W(e)?e:e.contextElement}function Qe(e){let t=Ze(e);if(!G(t))return I(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xe(t),o=(a?P(n.width):n.width)/r,s=(a?P(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $e=I(0);function et(e){let t=H(e);return!We()||!t.visualViewport?$e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Y(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ze(e),o=I(1);t&&(r?W(r)&&(o=Qe(r)):o=Qe(e));let s=tt(a,n,r)?et(a):I(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=Ye(n);for(;i&&t!==n;){let e=Qe(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ye(n)}}return ge({width:u,height:d,x:c,y:l})}function nt(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:Y(U(e)).left+n}function rt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nt(e,n),y:n.top+t.scrollTop}}function it(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I(1),u=I(0),d=G(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=Y(r);l=Qe(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rt(o,c):I(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function at(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ot(e){let t=Ke(e),n=e.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+nt(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=N(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var st=25;function ct(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(nt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=st&&(s-=o)}return{width:s,height:c,x:l,y:u}}function lt(e,t){let n=Y(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qe(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ut(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ct(e,n,t);else if(t===`document`)r=ot(U(e));else if(W(t))r=lt(t,n);else{let n=et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function dt(e,t){let n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>W(e)&&Ne(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;W(o)&&!Ge(o);){let e=q(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function ft(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:dt(t,this._c):[].concat(n),r],o=ut(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ut(t,a[e],i);s=N(n.top,s),c=M(n.right,c),l=M(n.bottom,l),u=N(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function pt(e){let{width:t,height:n}=Xe(e);return{width:t,height:n}}function mt(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Y(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=Y(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=nt(i));let l=i&&!r&&!a?rt(i,s):I(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ht(e){return q(e).position===`static`}function gt(e,t){if(!G(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){let n=H(e);if(Re(e))return n;if(!G(e)){let t=J(e);for(;t&&!Ge(t);){if(W(t)&&!ht(t))return t;t=J(t)}return n}let r=gt(e,t);for(;r&&Le(r)&&ht(r);)r=gt(r,t);return r&&Ge(r)&&ht(r)&&!He(r)?n:r||Ue(e)||n}var vt=async function(e){let t=this.getOffsetParent||_t,n=this.getDimensions,r=await n(e.floating);return{reference:mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yt(e){return q(e).direction===`rtl`}var bt={convertOffsetParentRelativeRectToViewportRelativeRect:it,getDocumentElement:U,getClippingRect:ft,getOffsetParent:_t,getElementRects:vt,getClientRects:at,getDimensions:pt,getScale:Qe,isElement:W,isRTL:yt};function xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function St(e,t,n){let r=null,i,a=U(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=F(d),h=F(a.clientWidth-(u+f)),g=F(a.clientHeight-(d+p)),_=F(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N(0,M(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ct(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ze(e),u=i||a?[...l?Je(l):[],...t?Je(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?St(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Y(e):null;c&&g();function g(){let t=Y(e);h&&!xt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wt=Oe,Tt=ke,Et=Se,Dt=je,Ot=Te,kt=xe,At=Ae,jt=(e,t,n)=>{let r=new Map,i=n??{},a={...bt,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Mt=typeof document<`u`?w.useLayoutEffect:function(){};function Nt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Nt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(e,t){let n=Pt(e);return Math.round(t*n)/n}function It(e){let t=w.useRef(e);return Mt(()=>{t.current=e}),t}function Lt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);Nt(f,r)||p(r);let[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=w.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=w.useRef(null),C=w.useRef(null),T=w.useRef(u),E=c!=null,D=It(c),O=It(i),A=It(l),j=w.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Nt(T.current,t)&&(T.current=t,k.flushSync(()=>{d(t)}))})},[f,t,n,O,A]);Mt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=w.useRef(!1);Mt(()=>(M.current=!0,()=>{M.current=!1}),[]),Mt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,j);j()}},[b,x,j,D,E]);let N=w.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=w.useMemo(()=>({reference:b,floating:x}),[b,x]),F=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ft(P.floating,u.x),r=Ft(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Rt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:kt({element:r.current,padding:i}).fn(n):r?kt({element:r,padding:i}).fn(n):{}}}},zt=(e,t)=>{let n=wt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{let n=Tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=(e,t)=>({fn:At(e).fn,options:[e,t]}),Ht=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=`Arrow`,qt=w.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,T.jsx)(u.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,T.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qt.displayName=Kt;var Jt=qt,Yt=`Popper`,[Xt,Zt]=l(Yt),[Qt,$t]=Xt(Yt),en=e=>{let{__scopePopper:t,children:n}=e,[r,i]=w.useState(null),[a,o]=w.useState(void 0);return(0,T.jsx)(Qt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};en.displayName=Yt;var tn=`PopperAnchor`,nn=w.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$t(tn,n),o=w.useRef(null),s=a.onAnchorChange,c=S(t,w.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let d=a.placementState&&pn(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,T.jsx)(u.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:c})});nn.displayName=tn;var rn=`PopperContent`,[an,on]=Xt(rn),sn=w.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=$t(rn,n),[b,x]=w.useState(null),C=S(t,x),[E,D]=w.useState(null),O=A(E),k=O?.width??0,j=O?.height??0,M=r+(o===`center`?``:`-`+o),N=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(f)?f:[f],F=P.length>0,I={padding:N,boundary:P.filter(dn),altBoundary:F},{refs:ee,floatingStyles:te,placement:L,isPositioned:R,middlewareData:z}=Lt({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>Ct(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[zt({mainAxis:a+j,alignmentAxis:c}),d&&Bt({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?Vt():void 0,...I}),d&&Ht({...I}),Ut({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Gt({element:E,padding:l}),fn({arrowWidth:k,arrowHeight:j}),h&&Wt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),B=y.setPlacementState;i(()=>(B(L),()=>{B(void 0)}),[L,B]);let[ne,V]=pn(L),re=s(_);i(()=>{R&&re?.()},[R,re]);let ie=z.arrow?.x,ae=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,ce]=w.useState();return i(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),(0,T.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:R?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,T.jsx)(an,{scope:n,placedSide:ne,placedAlign:V,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,T.jsx)(u.div,{"data-side":ne,"data-align":V,...v,ref:C,style:{...v.style,animation:R?void 0:`none`}})})})});sn.displayName=rn;var cn=`PopperArrow`,ln={top:`bottom`,right:`left`,bottom:`top`,left:`right`},un=w.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=on(cn,n),a=ln[i.placedSide];return(0,T.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,T.jsx)(Jt,{...r,ref:t,style:{...r.style,display:`block`}})})});un.displayName=cn;function dn(e){return e!==null}var fn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=pn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function pn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var mn=en,hn=nn,gn=sn,_n=un,vn=!1;function yn(){let[e,t]=w.useState(vn);return w.useEffect(()=>{vn||(vn=!0,t(!0))},[]),e}var bn=w.useSyncExternalStore;function xn(){return()=>{}}function Sn(){return bn(xn,()=>!0,()=>!1)}var Cn=typeof bn==`function`?Sn:yn,wn=`rovingFocusGroup.onEntryFocus`,Tn={bubbles:!1,cancelable:!0},En=`RovingFocusGroup`,[Dn,On,kn]=E(En),[An,jn]=l(En,[kn]),[Mn,Nn]=An(En),Pn=w.forwardRef((e,t)=>(0,T.jsx)(Dn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Dn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Fn,{...e,ref:t})})}));Pn.displayName=En;var Fn=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=w.useRef(null),h=S(t,m),g=O(a),[_,b]=y({prop:o,defaultProp:c??null,onChange:l,caller:En}),[x,C]=w.useState(!1),E=s(d),D=On(n),k=w.useRef(!1),[A,j]=w.useState(0);return w.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(wn,E),()=>e.removeEventListener(wn,E)},[E]),(0,T.jsx)(Mn,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:w.useCallback(e=>b(e),[b]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>j(e=>e-1),[]),children:(0,T.jsx)(u.div,{tabIndex:x||A===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:v(e.onMouseDown,()=>{k.current=!0}),onFocus:v(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(wn,Tn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Vn([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:v(e.onBlur,()=>C(!1))})})}),In=`RovingFocusGroupItem`,Ln=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:c,...l}=e,d=o(),f=s||d,p=Nn(In,n),m=p.currentTabStopId===f,h=On(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:y}=p,b=Cn();return i(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),w.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,T.jsx)(Dn.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:(0,T.jsx)(u.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:t,onMouseDown:v(e.onMouseDown,e=>{r?p.onItemFocus(f):e.preventDefault()}),onFocus:v(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:v(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bn(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?Hn(n,r+1):n.slice(r+1)}setTimeout(()=>Vn(n))}}),children:typeof c==`function`?c({isCurrentTabStop:m,hasTabStop:y!=null}):c})})});Ln.displayName=In;var Rn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Bn(e,t,n){let r=zn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rn[r]}function Vn(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Hn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Un=Pn,Wn=Ln,Gn=[`Enter`,` `],Kn=[`ArrowDown`,`PageUp`,`Home`],qn=[`ArrowUp`,`PageDown`,`End`],Jn=[...Kn,...qn],Yn={ltr:[...Gn,`ArrowRight`],rtl:[...Gn,`ArrowLeft`]},Xn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Zn=`Menu`,[Qn,$n,er]=E(Zn),[X,tr]=l(Zn,[er,Zt,jn]),nr=Zt(),rr=jn(),[ir,Z]=X(Zn),[ar,or]=X(Zn),sr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,c=nr(t),[l,u]=w.useState(null),d=w.useRef(!1),f=s(a),p=O(i);return w.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),w.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,T.jsx)(ar,{scope:t,onClose:w.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};sr.displayName=Zn;var cr=`MenuAnchor`,lr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(hn,{...i,...r,ref:t})});lr.displayName=cr;var ur=`MenuPortal`,[dr,fr]=X(ur,{forceMount:void 0}),pr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Z(ur,t);return(0,T.jsx)(dr,{scope:t,forceMount:n,children:(0,T.jsx)(d,{present:n||o.open,children:(0,T.jsx)(a,{asChild:!0,container:i,children:r})})})};pr.displayName=ur;var Q=`MenuContent`,[mr,hr]=X(Q),gr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=or(Q,e.__scopeMenu);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||a.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:o.modal?(0,T.jsx)(_r,{...i,ref:t}):(0,T.jsx)(vr,{...i,ref:t})})})})}),_r=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),r=w.useRef(null),i=S(t,r);return w.useEffect(()=>{let e=r.current;if(e)return g(e)},[]),(0,T.jsx)(br,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:v(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vr=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,T.jsx)(br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yr=c(`MenuContent.ScrollLock`),br=w.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,..._}=e,y=Z(Q,n),C=or(Q,n),E=nr(n),D=rr(n),O=$n(n),[k,A]=w.useState(null),j=w.useRef(null),M=S(t,j,y.onContentChange),N=w.useRef(0),P=w.useRef(``),F=w.useRef(0),I=w.useRef(null),ee=w.useRef(`right`),te=w.useRef(0),L=g?x:w.Fragment,R=g?{as:yr,allowPinchZoom:!0}:void 0,z=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ii(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};w.useEffect(()=>()=>window.clearTimeout(N.current),[]),p();let B=w.useCallback(e=>ee.current===I.current?.side&&oi(e,I.current?.area),[]);return(0,T.jsx)(mr,{scope:n,searchRef:P,onItemEnter:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:w.useCallback(e=>{B(e)||(j.current?.focus(),A(null))},[B]),onTriggerLeave:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:w.useCallback(e=>{I.current=e},[]),children:(0,T.jsx)(L,{...R,children:(0,T.jsx)(b,{asChild:!0,trapped:i,onMountAutoFocus:v(a,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,T.jsx)(m,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:(0,T.jsx)(Un,{asChild:!0,...D,dir:C.dir,orientation:`vertical`,loop:r,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:v(c,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,T.jsx)(gn,{role:`menu`,"aria-orientation":`vertical`,"data-state":$r(y.open),"data-radix-menu-content":``,dir:C.dir,...E,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:v(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&z(e.key));let i=j.current;if(e.target!==i||!Jn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);qn.includes(e.key)&&a.reverse(),ni(a)}),onBlur:v(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:v(e.onPointerMove,si(e=>{let t=e.target,n=te.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>te.current?`right`:`left`;ee.current=t,te.current=e.clientX}}))})})})})})})});gr.displayName=Q;var xr=`MenuGroup`,Sr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`group`,...r,ref:t})});Sr.displayName=xr;var Cr=`MenuLabel`,wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{...r,ref:t})});wr.displayName=Cr;var Tr=`MenuItem`,Er=`menu.itemSelect`,Dr=w.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=w.useRef(null),o=or(Tr,e.__scopeMenu),s=hr(Tr,e.__scopeMenu),c=S(t,a),l=w.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Er,{bubbles:!0,cancelable:!0});e.addEventListener(Er,e=>r?.(e),{once:!0}),f(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,T.jsx)(Or,{...i,ref:c,disabled:n,onClick:v(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:v(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:v(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||Gn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Dr.displayName=Tr;var Or=w.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=hr(Tr,n),s=rr(n),c=w.useRef(null),l=S(t,c),[d,f]=w.useState(!1),[p,m]=w.useState(``);return w.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,T.jsx)(Qn.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,T.jsx)(Wn,{asChild:!0,...s,focusable:!r,children:(0,T.jsx)(u.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:v(e.onPointerMove,si(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:v(e.onPointerLeave,si(e=>o.onItemLeave(e))),onFocus:v(e.onFocus,()=>f(!0)),onBlur:v(e.onBlur,()=>f(!1))})})})}),kr=`MenuCheckboxItem`,Ar=w.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:n,children:(0,T.jsx)(Dr,{role:`menuitemcheckbox`,"aria-checked":ei(n)?`mixed`:n,...i,ref:t,"data-state":ti(n),onSelect:v(i.onSelect,()=>r?.(ei(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ar.displayName=kr;var jr=`MenuRadioGroup`,[Mr,Nr]=X(jr,{value:void 0,onValueChange:()=>{}}),Pr=w.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=s(r);return(0,T.jsx)(Mr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,T.jsx)(Sr,{...i,ref:t})})});Pr.displayName=jr;var Fr=`MenuRadioItem`,Ir=w.forwardRef((e,t)=>{let{value:n,...r}=e,i=Nr(Fr,e.__scopeMenu),a=n===i.value;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:a,children:(0,T.jsx)(Dr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ti(a),onSelect:v(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ir.displayName=Fr;var Lr=`MenuItemIndicator`,[Rr,zr]=X(Lr,{checked:!1}),Br=w.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=zr(Lr,n);return(0,T.jsx)(d,{present:r||ei(a.checked)||a.checked===!0,children:(0,T.jsx)(u.span,{...i,ref:t,"data-state":ti(a.checked)})})});Br.displayName=Lr;var Vr=`MenuSeparator`,Hr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Hr.displayName=Vr;var Ur=`MenuArrow`,Wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(_n,{...i,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuSub`,[Kr,qr]=X(Gr),Jr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(Gr,t),c=nr(t),[l,u]=w.useState(null),[d,f]=w.useState(null),p=s(i);return w.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,T.jsx)(Kr,{scope:t,contentId:o(),triggerId:o(),trigger:l,onTriggerChange:u,children:n})})})};Jr.displayName=Gr;var Yr=`MenuSubTrigger`,Xr=w.forwardRef((e,t)=>{let n=Z(Yr,e.__scopeMenu),r=or(Yr,e.__scopeMenu),i=qr(Yr,e.__scopeMenu),a=hr(Yr,e.__scopeMenu),o=w.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=w.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);w.useEffect(()=>u,[u]),w.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=S(t,i.onTriggerChange);return(0,T.jsx)(lr,{asChild:!0,...l,children:(0,T.jsx)(Or,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":$r(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:v(e.onPointerMove,si(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:v(e.onPointerLeave,si(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:v(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Yn[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Xr.displayName=Yr;var Zr=`MenuSubContent`,Qr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Z(Q,e.__scopeMenu),s=or(Q,e.__scopeMenu),c=qr(Zr,e.__scopeMenu),l=w.useRef(null),u=S(t,l);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||o.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:(0,T.jsx)(br,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:v(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:v(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:v(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Xn[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Qr.displayName=Zr;function $r(e){return e?`open`:`closed`}function ei(e){return e===`indeterminate`}function ti(e){return ei(e)?`indeterminate`:e?`checked`:`unchecked`}function ni(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ri(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ii(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ri(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ai(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oi(e,t){return t?ai({x:e.clientX,y:e.clientY},t):!1}function si(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ci=sr,li=lr,ui=pr,di=gr,fi=Sr,pi=wr,mi=Dr,hi=Ar,gi=Pr,_i=Ir,vi=Br,yi=Hr,bi=Wr,xi=Xr,Si=Qr,Ci=`DropdownMenu`,[wi,Ti]=l(Ci,[tr]),$=tr(),[Ei,Di]=wi(Ci),Oi=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=e,l=$(t),u=w.useRef(null),[d,f]=y({prop:i,defaultProp:a??!1,onChange:s,caller:Ci});return(0,T.jsx)(Ei,{scope:t,triggerId:o(),triggerRef:u,contentId:o(),open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,T.jsx)(ci,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};Oi.displayName=Ci;var ki=`DropdownMenuTrigger`,Ai=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Di(ki,n),o=$(n),s=S(t,a.triggerRef);return(0,T.jsx)(li,{asChild:!0,...o,children:(0,T.jsx)(u.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:v(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:v(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ai.displayName=ki;var ji=`DropdownMenuPortal`,Mi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,T.jsx)(ui,{...r,...n})};Mi.displayName=ji;var Ni=`DropdownMenuContent`,Pi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Di(Ni,n),a=$(n),o=w.useRef(!1);return(0,T.jsx)(di,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:v(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:v(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pi.displayName=Ni;var Fi=`DropdownMenuGroup`,Ii=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(fi,{...i,...r,ref:t})});Ii.displayName=Fi;var Li=`DropdownMenuLabel`,Ri=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(pi,{...i,...r,ref:t})});Ri.displayName=Li;var zi=`DropdownMenuItem`,Bi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(mi,{...i,...r,ref:t})});Bi.displayName=zi;var Vi=`DropdownMenuCheckboxItem`,Hi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(hi,{...i,...r,ref:t})});Hi.displayName=Vi;var Ui=`DropdownMenuRadioGroup`,Wi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(gi,{...i,...r,ref:t})});Wi.displayName=Ui;var Gi=`DropdownMenuRadioItem`,Ki=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(_i,{...i,...r,ref:t})});Ki.displayName=Gi;var qi=`DropdownMenuItemIndicator`,Ji=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(vi,{...i,...r,ref:t})});Ji.displayName=qi;var Yi=`DropdownMenuSeparator`,Xi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(yi,{...i,...r,ref:t})});Xi.displayName=Yi;var Zi=`DropdownMenuArrow`,Qi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(bi,{...i,...r,ref:t})});Qi.displayName=Zi;var $i=`DropdownMenuSubTrigger`,ea=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(xi,{...i,...r,ref:t})});ea.displayName=$i;var ta=`DropdownMenuSubContent`,na=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(Si,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});na.displayName=ta;var ra=Oi,ia=Ai,aa=Mi,oa=Pi,sa=Ri,ca=Bi,la=Hi,ua=Wi,da=Ki,fa=Ji,pa=Xi;function ma({...e}){return(0,T.jsx)(ra,{"data-slot":`dropdown-menu`,...e})}function ha({...e}){return(0,T.jsx)(ia,{"data-slot":`dropdown-menu-trigger`,...e})}function ga({className:e,sideOffset:t=4,...n}){return(0,T.jsx)(aa,{children:(0,T.jsx)(oa,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:C(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function _a({className:e,inset:t,variant:n=`default`,...r}){return(0,T.jsx)(ca,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:C(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function va({className:e,children:t,checked:n,...r}){return(0,T.jsxs)(la,{"data-slot":`dropdown-menu-checkbox-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(h,{className:`size-4`})})}),t]})}function ya({...e}){return(0,T.jsx)(ua,{"data-slot":`dropdown-menu-radio-group`,...e})}function ba({className:e,children:t,...n}){return(0,T.jsxs)(da,{"data-slot":`dropdown-menu-radio-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(_,{className:`size-2 fill-current`})})}),t]})}function xa({className:e,inset:t,...n}){return(0,T.jsx)(sa,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:C(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Sa({className:e,...t}){return(0,T.jsx)(pa,{"data-slot":`dropdown-menu-separator`,className:C(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Zt as _,xa as a,Sa as c,Un as d,jn as f,mn as g,gn as h,_a as i,ha as l,_n as m,va as n,ya as o,hn as p,ga as r,ba as s,ma as t,Wn as u,A as v,O as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Xt as r,Z as i,_t as a,d as o,dt as s,xt as c}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Xt as r,Z as i,_t as a,d as o,dt as s,xt as c}from"./centered-state-kOb8j_BL.js";import{n as l,t as u}from"./utils-BW1-Ibnd.js";import{i as d,l as f,r as p,t as m}from"./dropdown-menu-78Ug-7x2.js";import{t as h}from"./createLucideIcon-BHp8sXmF.js";import{n as g,t as _}from"./diff-controls-D_kgpdoa.js";import{t as v}from"./external-link-BE6y205O.js";import{t as y}from"./square-terminal-B6RYYieR.js";import{t as b}from"./diff-stat-C3Id3W_C.js";var x=h(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),S=h(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),C=e(t(),1),w=n();function T({root:e,selected:t,onSelect:n}){return(0,w.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function E({adds:e,dels:t}){return(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,w.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,w.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function D({dir:e,depth:t,selected:n,onSelect:r}){let[a,o]=(0,C.useState)(!0);return(0,w.jsxs)(`li`,{children:[(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,w.jsx)(i,{size:16,"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,w.jsx)(s,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,w.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]}),a?(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var O={added:`text-success`,deleted:`text-danger`};function k({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,w.jsx)(`li`,{children:(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:u(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,w.jsx)(S,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0`,O[e.status])}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]})})}function A(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function j(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(j)}}var M=(e,t)=>e.name.localeCompare(t.name);function N(e){let t=A(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=A(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(M),e.files.sort(M)};return i(t),{...t,dirs:t.dirs.map(j)}}function P({bar:e,branch:t,stat:n,mode:r,wrap:i,onModeChange:a,onWrapChange:s,onAction:c}){return(0,w.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[t?(0,w.jsx)(_,{branch:t}):null,n?(0,w.jsx)(L,{stat:n}):null,(0,w.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,w.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,w.jsx)(g,{mode:r,wrap:i,onModeChange:a,onWrapChange:s})}),e.secondary.map(e=>(0,w.jsx)(I,{action:e,variant:`outline`,onAction:c},e.id)),(0,w.jsx)(I,{action:e.primary,variant:`primary`,onAction:c}),e.menu.length>0?(0,w.jsxs)(m,{children:[(0,w.jsx)(f,{asChild:!0,children:(0,w.jsx)(o,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,w.jsx)(x,{"aria-hidden":`true`})})}),(0,w.jsx)(p,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,w.jsxs)(d,{disabled:!e.enabled,title:e.reason,onSelect:()=>c(e.id),children:[F[e.id],e.label]},e.id))})]}):null]})]})}var F={commit:(0,w.jsx)(a,{size:16,"aria-hidden":`true`}),push:(0,w.jsx)(r,{size:16,"aria-hidden":`true`}),"create-pr":(0,w.jsx)(c,{size:16,"aria-hidden":`true`}),"view-pr":(0,w.jsx)(v,{"aria-hidden":`true`}),"open-terminal":(0,w.jsx)(y,{"aria-hidden":`true`})};function I({action:e,variant:t,onAction:n}){return e.id===`view-pr`?l(e.href)?(0,w.jsx)(o,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,w.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[F[e.id],e.label]})}):(0,w.jsxs)(o,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[F[e.id],e.label]}):(0,w.jsxs)(o,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[F[e.id],e.label]})}function L({stat:e}){return(0,w.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,w.jsx)(b,{stat:{adds:R(e.adds),dels:R(e.dels),files:e.files}})})}function R(e){let[t,n]=(0,C.useState)(e),r=(0,C.useRef)(e);return(0,C.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{T as i,P as n,N as r,L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,$t as i,Ba as a,Cn as o,Cr as s,Dn as c,Ei as l,Ga as u,Ii as d,Ki as f,Li as p,Lt as m,Ra as h,Ri as g,Rt as _,Sn as v,St as y,Tn as b,U as x,Ut as S,Va as C,X as w,Y as T,Yt as ee,Z as te,Zt as E,br as ne,d as D,eo as re,et as O,gr as ie,ia as ae,in as k,nt as A,t as oe,tn as se,wn as ce,xn as le,xt as ue,ya as j,zi as de}from"./centered-state-kOb8j_BL.js";import{d as fe,n as pe,t as M}from"./utils-BW1-Ibnd.js";import{a as N,o as me,r as P}from"./agent-accounts-Bh1l3ZSb.js";import{a as he,i as ge,n as _e,o as ve,r as ye,s as be,t as xe}from"./textarea-D2Gx4GDI.js";import{t as Se}from"./createLucideIcon-BHp8sXmF.js";import{t as F}from"./external-link-BE6y205O.js";import{A as I,D as Ce,I as L,L as we,M as R,N as Te,a as Ee,c as De,d as z,j as Oe,k as B,n as ke,o as Ae,r as je,s as V}from"./prompt-templates-BgXzCOlY.js";import{r as Me,t as Ne,u as Pe}from"./project-router-CS_oeLqi.js";import{t as H}from"./message-square-B-MD-8rD.js";import{i as U,t as Fe}from"./markdown-DlvW2wEx.js";import{d as W,f as Ie,i as Le,s as Re,t as G,u as ze}from"./skills-DFBiAuJG.js";import{n as Be,t as K}from"./use-submit-shortcut-KWJsC906.js";import{d as Ve,f as q,l as He,p as Ue,s as We,u as Ge}from"./index-D-m3edXI.js";import{t as Ke}from"./diff-Jd8igxRb2.js";import{t as qe}from"./tab-link-D6eAdJez.js";var Je=Se(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ye=Se(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),J=e(t(),1),Y=n();function X({className:e,...t}){return(0,Y.jsx)(`div`,{"data-slot":`skeleton`,className:M(`animate-pulse rounded-md bg-accent`,e),...t})}var Xe=`cez-github-list-width`;function Ze(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function Qe(){try{let e=localStorage.getItem(Xe);return e===null?360:Ze(e)}catch{return 360}}function $e(e){try{localStorage.setItem(Xe,String(Ze(e)))}catch{}}function Z(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function et(e,t=[]){let n=Z(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=Q(t)),n}function Q(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function $(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function tt(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function nt(e,t,n){let r=(n??``).trim();if(!r)return et(e,t);let i=Z(e),a=r.startsWith(i)?i+$(r.slice(i.length),e):$(r,e),o=tt(a,e)?a:`${i}\n\n${a}`;return t.length?o+Q(t):o}function rt(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function it(e,t,n,r,i={}){return t?{...i,workflow:t,task:nt(e,n,r)}:n.length?{...i,steps:rt(n),task:nt(e,[],r)}:{...i,workflow:`quick-task`,task:nt(e,[],r)}}var at=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function ot({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let a=new Map;for(let t of e.issues)for(let e of t.assignees??[])a.set(e.toLowerCase(),e);for(let e of t)a.set(e.toLowerCase(),e);let o=[...a.values()].sort((e,t)=>e.localeCompare(t)),s=!!e.viewerLogin&&t.length===1&&t[0]?.toLowerCase()===e.viewerLogin.toLowerCase();return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,"data-slot":`gh-issue-filters`,children:[(0,Y.jsxs)(P,{children:[(0,Y.jsx)(me,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,className:at,disabled:o.length===0,children:[`Assignees`,t.length?` · ${t.length}`:``]})}),(0,Y.jsx)(N,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,Y.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,Y.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),o.map(e=>{let n=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,Y.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>r(n?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,Y.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]}),(0,Y.jsx)(`button`,{type:`button`,className:`${at} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":s,onClick:()=>r(s?[]:[e.viewerLogin]),children:`Assigned to me`}),e.viewerLogin?null:(0,Y.jsx)(`p`,{className:`w-full text-xs text-muted-foreground`,children:`GitHub login unavailable.`}),e.projects?.length?(0,Y.jsxs)(`select`,{"aria-label":`Project board`,className:at,value:n,onChange:e=>i(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects?(0,Y.jsx)(`select`,{"aria-label":`Project board`,className:at,disabled:!0,value:``,children:(0,Y.jsx)(`option`,{value:``,children:`No boards`})}):(0,Y.jsx)(`p`,{className:`w-full text-xs text-muted-foreground`,children:e.projectsReason??`Project boards unavailable.`})]})}function st(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function ct(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.projectId&&!e.projectIds?.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function lt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function ut(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var dt={workflow:null,skills:[]},ft=`cez-followup-selection`;function pt(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function mt(){try{let e=localStorage.getItem(ft);return e?pt(JSON.parse(e)):{...dt}}catch{return{...dt}}}function ht(e){try{localStorage.setItem(ft,JSON.stringify(e))}catch{}}var gt=`cez-followup-prompt:`;function _t(e){try{return localStorage.getItem(gt+e)??``}catch{return``}}function vt(e,t){try{t===``?localStorage.removeItem(gt+e):localStorage.setItem(gt+e,t)}catch{}}function yt({item:e,workflows:t,skills:n,workflow:r,onWorkflowChange:i,selectedSkills:o,onSkillsChange:s,engine:c,onEngineChange:d,queuedRunId:f,onQueued:p}){let m=u(),h=ne(),g=e.kind===`pr`?`PR`:`issue`,_=o.filter(e=>n.some(t=>t.name===e)),[v]=(0,J.useState)(()=>Z(e)),[y,b]=(0,J.useState)(()=>_t(e.url)||v),x=q(c),S=(0,J.useRef)(null),C=(0,J.useRef)(null);(0,J.useEffect)(()=>{vt(e.url,y===v?``:y)},[e.url,y,v]);let w=(0,J.useMemo)(()=>Ee(h.data?.promptTemplates),[h.data?.promptTemplates]),ee=e=>{let t=S.current,n=V({prompt:y,base:v,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:C.current}),r=je(y,n,e);b(r.text),C.current=r.caret,requestAnimationFrame(()=>{S.current?.focus(),S.current?.setSelectionRange(r.caret,r.caret)})},te=ke(w,_),E=(0,J.useRef)(y);E.current=y;let re=(0,J.useRef)(``);(0,J.useEffect)(()=>{let e=Ae(E.current,re.current,te,v);re.current=e.applied,e.text!==E.current&&b(e.text)},[te,v]);let O=a({mutationFn:async()=>x.canRun?l(it(e,r,_,y,Ve(x))):null,onSuccess:t=>{if(t===null)return;let n=`runs`in t?t.runs[0]:t;n&&p(e.url,n.id),j(`Added to the queue — ${g} #${e.number}`),_.length>0&&h.data!==void 0&&ae({skillUsage:_.reduce((e,t)=>G(e,t),h.data.skillUsage)}).then(()=>m.invalidateQueries({queryKey:k.uiState})).catch(()=>{}),vt(e.url,``),b(v),re.current=``,m.invalidateQueries({queryKey:k.runs.all})},onError:e=>j(e.message,{tone:`danger`})}),ie=e=>{K({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!O.isPending&&x.canRun&&O.mutate())},A=e=>s(o.includes(e)?o.filter(t=>t!==e):[...o,e]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Y.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Y.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Y.jsx)(`span`,{children:`Instructions for the agent`}),(0,Y.jsx)(xe,{ref:S,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:y,onChange:e=>b(e.target.value),onSelect:e=>{C.current=e.currentTarget.selectionStart},onKeyDown:ie,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Y.jsx)(He,{templates:w,onInsert:ee}),(0,Y.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Workflow`}),(0,Y.jsx)(bt,{workflows:t,value:r,onChange:i})]}),(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Skills · select one or more`}),(0,Y.jsx)(St,{skills:n,skillUsage:h.data?.skillUsage,selected:_,onToggle:A})]}),_.length>0?(0,Y.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:_.map(e=>(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>A(e),title:`Remove this skill`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,Y.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,Y.jsxs)(`div`,{className:`gh-engine-fields`,children:[(0,Y.jsx)(Ge,{pick:c,onChange:d,disabled:O.isPending||!x.canRun,accounts:!0}),x.runners.length<=1&&!x.accounts.some(e=>e.provider===x.runner&&e.id!=="default")?(0,Y.jsxs)(`div`,{className:`gh-fixed-runner`,children:[(0,Y.jsx)(`span`,{children:`Runner`}),x.runner]}):null]}),(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Account`}),(0,Y.jsx)(xt,{resolved:x,disabled:O.isPending||!x.canRun,onPick:e=>d({...c,account:e})})]}),!x.providerPending&&!x.canRun?(0,Y.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[x.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Y.jsx)(Ne,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Y.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[pe(e.url)?(0,Y.jsx)(D,{asChild:!0,variant:`outline`,children:(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Y.jsxs)(D,{variant:`primary`,"data-action":`gh-run`,disabled:O.isPending||!x.canRun,onClick:()=>O.mutate(),children:[(0,Y.jsx)(L,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,g]}),(0,Y.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[11px] font-medium text-muted-foreground`,children:Be()}),f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Y.jsx)(T,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Y.jsx)(Ne,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function bt({workflows:e,value:t,onChange:n}){let[r,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),c=(0,J.useRef)(null),l=W(e,o);return(0,Y.jsxs)(P,{open:r,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Y.jsx)(me,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:M(z,t&&`border-foreground/60 font-mono text-[11px] font-semibold text-foreground`),children:[(0,Y.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Y.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Y.jsx)(w,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(N,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Y.jsxs)(Ce,{shouldFilter:!1,children:[(0,Y.jsx)(Oe,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Y.jsxs)(Te,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Y.jsx)(B,{children:`Nothing matches.`}):null,(0,Y.jsx)(I,{children:l.map(e=>{let r=t===e.name;return(0,Y.jsxs)(R,{value:`workflow ${e.name}`,keywords:Ie(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Y.jsx)(T,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function xt({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:fe,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,desc:e.configDir}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Y.jsx)(De,{icon:(0,Y.jsx)(E,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function St({skills:e,skillUsage:t,selected:n,onToggle:r}){let[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(null),u=(0,J.useRef)(null),{mostUsed:d,project:f,global:p,ranked:m}=ze(e,o,t),h=(e,t)=>{let i=n.includes(e.name);return(0,Y.jsxs)(R,{value:`skill ${e.name} ${e.path}`,keywords:Ie(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":i?`true`:void 0,onSelect:()=>r(e.name),children:[(0,Y.jsx)(`span`,{className:M(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Y.jsx)(we,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,Y.jsx)(T,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e.path)};return e.length===0?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(We,{skill:c,onClose:()=>l(null)}),(0,Y.jsxs)(P,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Y.jsx)(me,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:M(z,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Y.jsx)(S,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Y.jsx)(w,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(N,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Y.jsxs)(Ce,{shouldFilter:!1,children:[(0,Y.jsx)(Oe,{placeholder:`search skills…`,value:o,onValueChange:s,onInput:()=>u.current?.scrollTo(0,0)}),(0,Y.jsxs)(Te,{ref:u,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(m?m.length===0:d.length===0&&f.length===0&&p.length===0)?(0,Y.jsx)(B,{children:`Nothing matches.`}):null,m?m.length>0?(0,Y.jsx)(I,{children:m.map(e=>h(e,Le(e)))}):null:(0,Y.jsxs)(Y.Fragment,{children:[d.length>0?(0,Y.jsx)(I,{heading:`Most used`,children:d.map(e=>h(e,Le(e)))}):null,f.length>0?(0,Y.jsx)(I,{heading:`Project skills`,children:f.map(e=>h(e,!0))}):null,p.length>0?(0,Y.jsx)(I,{heading:`Global`,children:p.map(e=>h(e,!1))}):null]})]})]})})]})]})}var Ct=1e3,wt=100,Tt=350;function Et({width:e,onWidthChange:t}){let n=(0,J.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(Ze(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,Y.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(Ze(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function Dt(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Ot({view:e,changes:t=!1,index:n=!1}){let{n:i}=h(),o=le({limit:Ct}),l=c().data?.capabilities?.automations===!0,f=o.data,g=u(),x=e=>{g.setQueryData(k.uiState,t=>({...t,githubView:e})),ae({githubView:e}).then(e=>g.setQueryData(k.uiState,e)).catch(e=>{j(e instanceof Error?e.message:String(e),{tone:`danger`}),g.invalidateQueries({queryKey:k.uiState})})},S=(0,J.useRef)(null),C=a({mutationFn:()=>d({refresh:!0,limit:Ct}),onSuccess:t=>{g.setQueryData(k.github({limit:Ct}),t),g.invalidateQueries({queryKey:k.githubChecks(Je)}),g.invalidateQueries({queryKey:k.githubSearch(e===`issues`?`issue`:`pr`,B)});let n=S.current;if(!n){g.removeQueries({queryKey:[`github`,`comments`]});return}let r=k.githubComments(n.kind,n.number);p(n.kind,n.number,{refresh:!0}).then(e=>g.setQueryData(r,e)).catch(()=>{}),g.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==re(r)})},onError:e=>j(e.message,{tone:`danger`})}),w=s(),T=ie(),te=ne(),[E,O]=(0,J.useState)(()=>mt().workflow),[A,se]=(0,J.useState)(()=>mt().skills),[ce,de]=(0,J.useState)({runner:null,model:null,effort:null,account:null}),[fe,pe]=(0,J.useState)(Qe),[N,me]=(0,J.useState)(!1),P=(0,J.useRef)(null),he=(0,J.useRef)(null),ge=e=>{let t=Ze(e);pe(t),$e(t)},_e=o.data?.available===!0;(0,J.useEffect)(()=>{if(!_e)return;let e=P.current,t=he.current,n=e?.closest(`[data-slot="main"]`);if(!e||!t||!n)return;let r=window.matchMedia(`(min-width: 768px)`),i=()=>{if(!r.matches||n.clientHeight<1){e.style.removeProperty(`--gh-workspace-height`);return}e.style.setProperty(`--gh-workspace-height`,`${Math.round(n.clientHeight)}px`)};i();let a=new ResizeObserver(i);a.observe(n);let o=e=>{if(!r.matches||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||t.getBoundingClientRect().top<=n.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let i=e.deltaMode===1?16:e.deltaMode===2?n.clientHeight:1;n.scrollTop+=e.deltaY*i};return t.addEventListener(`wheel`,o,{passive:!1}),r.addEventListener(`change`,i),()=>{t.removeEventListener(`wheel`,o),a.disconnect(),r.removeEventListener(`change`,i)}},[_e]),(0,J.useEffect)(()=>{ht({workflow:E,skills:[...A]})},[E,A]);let ve=w.data?.workflows;(0,J.useEffect)(()=>{ve&&E!==null&&!ve.some(e=>e.name===E)&&O(null)},[ve,E]);let ye=T.data,be=te.data?.skillUsage,xe=(0,J.useMemo)(()=>Re(ye??[],be),[ye,be]),[Se,F]=(0,J.useState)(new Map),[I,Ce]=(0,J.useState)(``),[L,we]=(0,J.useState)([]),[R,Te]=(0,J.useState)([]),[Ee,De]=(0,J.useState)(``),z=f?.projects?.some(e=>e.id===Ee)?Ee:``;(0,J.useEffect)(()=>{f&&Ee&&!z&&De(``)},[f,Ee,z]);let Oe=()=>{Ce(``),we([]),Te([]),De(``)},B=Dt(I,Tt),ke=(0,J.useMemo)(()=>f?.available?e===`issues`?f.issues:f.prs:[],[f,e]),Ae=(0,J.useMemo)(()=>ct(ke,{query:B,labels:L,...e===`issues`?{assignees:R,projectId:z}:{}}),[ke,B,L,e,R,z]),je=I.trim()===B.trim(),V=f?.available===!0&&je&<(B,Ae),H=b(e===`issues`?`issue`:`pr`,B,V),Fe=ke,W=ct(Fe,{query:I,labels:L,...e===`issues`?{assignees:R,projectId:z}:{}}),Ie=e===`issues`&&i!==void 0&&!N,Le=I.trim()!==``||L.length>0||e===`issues`&&(R.length>0||z!==``),G=V&&H.data?.available?H.data:null,ze=new Set(W.map(e=>e.number)),Be=e===`issues`&&G?z&&G.items.some(e=>e.projectIds===void 0)?G.projectsReason??`Project board data is incomplete. Refresh to try again.`:R.length&&G.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null,K=G&&!Be?ct(G.items,{labels:L,...e===`issues`?{assignees:R,projectId:z}:{}}).filter(e=>!ze.has(e.number)):[],Ve=k.github()[0],q=i===void 0?null:Number.parseInt(i,10),He=H.data?.available?H.data.items.find(e=>e.number===q):void 0,[We,Ge]=(0,J.useState)(null);(0,J.useEffect)(()=>{He&&Ge({scope:Ve,view:e,item:He})},[Ve,e,He]);let Ke=He??(We?.scope===Ve&&We.view===e&&We.item.number===q?We.item:null),Je=(()=>{if(!f?.available||e!==`prs`)return[];let t=new Set;q!==null&&Number.isInteger(q)&&t.add(q);for(let e of[...K,...f.prs]){if(t.size>=wt)break;t.add(e.number)}return[...t]})(),Ye=v(Je,e===`prs`),X=Ye.data?.available?Ye.data.checks:void 0;if(n&&te.data?.githubView===`prs`)return(0,Y.jsx)(Me,{to:`/github/prs`,replace:!0});if(!f)return o.isError?(0,Y.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Y.jsx)(oe,{icon:(0,Y.jsx)(ee,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:o.error.message})}):(0,Y.jsx)(Ue,{});if(S.current=null,!f.available)return(0,Y.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Y.jsx)(oe,{icon:(0,Y.jsx)(y,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:f.reason??`unknown reason`,actions:(0,Y.jsx)(D,{variant:`outline`,"data-action":`gh-retry`,disabled:C.isPending,onClick:()=>C.mutate(),children:`Try again`}),children:(0,Y.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,Y.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,Y.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let Xe=I.trim()!==``&&!je||V&&H.isPending,Z={...G?.labelColors??{},...f.labelColors??{}},et=st([...Fe,...G?.items??[]]),Q=i===void 0?null:Number.parseInt(i,10),$=Q===null?W[0]??K[0]??null:Fe.find(e=>e.number===Q)??Ke??null;S.current=$?{kind:$.kind,number:$.number}:null;let tt=e===`issues`?`/github`:`/github/prs`,nt=V&&(H.data?.available===!1||H.isError),rt=H.data?.available===!1?H.data.reason??`unknown reason`:H.error instanceof Error?H.error.message:`the search request failed`,it=Le?Xe?(0,Y.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(Pe,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,I.trim(),`”…`]}):nt?K.length>0?(0,Y.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,rt,`. Use Refresh to try again.`]}):W.length>0?(0,Y.jsxs)(`p`,{children:[`GitHub could not be searched: `,rt,`.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter, and GitHub could not be searched: `,rt,`.`]}):Be?(0,Y.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,Be]}):K.length>0?null:G?.truncated?(0,Y.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):G&&W.length>0?(0,Y.jsxs)(`p`,{children:[`No additional `,e===`issues`?`issues`:`pull requests`,` match your filter on GitHub.`]}):G?(0,Y.jsxs)(`p`,{children:[`No `,e===`issues`?`issues`:`pull requests`,` match your filter — open, closed or merged.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,`.`]});return(0,Y.jsxs)(`div`,{ref:P,"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:p-9 md:pb-4`,children:[(0,Y.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col gap-1`,children:[(0,Y.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[30px]`,children:`GitHub`}),f.repo?(0,Y.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground`,children:[(0,Y.jsx)(`span`,{"data-slot":`gh-repo`,children:f.repo}),(0,Y.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,f.syncedAt?`Synced ${U(f.syncedAt)} ago`:`Not synced yet`]})]}):null]}),(0,Y.jsxs)(`div`,{ref:he,"data-slot":`gh-workspace`,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-[22px]`,children:[(0,Y.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-[22px]`,children:[(0,Y.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(qe,{to:`/github`,active:e===`issues`,onClick:()=>x(`issues`),children:[`Issues · `,kt(f.issues.length)]}),(0,Y.jsxs)(qe,{to:`/github/prs`,active:e===`prs`,onClick:()=>x(`prs`),children:[`Pull requests · `,kt(f.prs.length)]}),l?(0,Y.jsx)(Ne,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:C.isPending,onClick:()=>C.mutate(),className:`gh-utility`,children:[(0,Y.jsx)(m,{size:16,"aria-hidden":`true`,className:M(`size-3.5`,C.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,Y.jsx)(_,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,Y.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:I,onChange:e=>Ce(e.target.value),className:`min-h-11 w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Y.jsx)(jt,{options:et,colors:Z,selected:L,onChange:we}),e===`issues`?(0,Y.jsx)(ot,{data:{...f,issues:[...f.issues,...G?.items??[]]},assignees:R,projectId:z,onAssigneesChange:Te,onProjectChange:De}):null,(0,Y.jsx)(`button`,{type:`button`,disabled:!Le,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:Oe,children:`Clear filters`})]})]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,Y.jsxs)(`section`,{"data-slot":`gh-list`,"data-mobile-preview":Ie||void 0,style:{"--github-list-width":`${fe}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[W.length===0?it&&(0,Y.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:it}):(0,Y.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-1`,children:W.map((t,n)=>(0,Y.jsx)(At,{item:t,view:e,colors:Z,active:$?.url===t.url,compactHidden:Ie&&n>=2&&$?.url!==t.url,queued:Se.has(t.url),checks:t.kind===`pr`?X?.[t.number]??t.checks:t.checks},t.url))}),e===`issues`&&i!==void 0&&W.length>2?(0,Y.jsx)(D,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":N,onClick:()=>me(e=>!e),children:N?`Show fewer issues`:`View all ${W.length} issues`}):null,W.length>0&&V&&it?(0,Y.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:it}):null,K.length>0?(0,Y.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Y.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,G?.truncated?` (first matches)`:``]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:K.map(t=>(0,Y.jsx)(At,{item:t,view:e,colors:Z,active:$?.url===t.url,queued:Se.has(t.url),checks:t.kind===`pr`?X?.[t.number]??t.checks:t.checks},t.url))})]}):null,(0,Y.jsx)(Et,{width:fe,onWidthChange:ge})]}),(0,Y.jsx)(`section`,{"data-slot":`gh-detail`,className:M(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card md:overflow-y-auto`,i===void 0?`hidden md:flex`:`flex`),children:$?(0,Y.jsx)(Nt,{item:$,listPath:tt,colors:Z,changes:t,checks:$.kind===`pr`?X?.[$.number]??$.checks:$.checks,children:(0,Y.jsx)(yt,{item:$,workflows:w.data?.workflows??[],skills:xe,workflow:E,onWorkflowChange:O,selectedSkills:A,onSkillsChange:se,engine:ce,onEngineChange:de,queuedRunId:Se.get($.url)??null,onQueued:(e,t)=>F(n=>new Map(n).set(e,t))},$.url)}):(0,Y.jsx)(oe,{icon:e===`issues`?(0,Y.jsx)(r,{size:16}):(0,Y.jsx)(ue,{size:16}),tone:`neutral`,heading:`h2`,title:Q===null?`Nothing selected`:`Not found`,subtitle:Q===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${Q} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${Q} above to look it up on GitHub, closed and merged included.`})})]})]})]})}function kt(e){return`${e}${e>=Ct?`+`:``}`}function At({item:e,view:t,colors:n,active:i,compactHidden:a,queued:o,checks:s}){let c=e.kind===`issue`?r:ue,l=u(),d=()=>{l.prefetchQuery({queryKey:k.githubComments(e.kind,e.number),queryFn:({signal:t})=>p(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Y.jsx)(`li`,{"data-compact-hidden":a||void 0,children:(0,Y.jsxs)(Ne,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,et(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:d,onFocus:d,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":i?`page`:void 0,title:`Drag into the composer to prefill a task`,className:M(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,i&&`bg-accent-strong/10 text-accent-text`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,Y.jsx)(c,{"aria-hidden":`true`,className:M(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,Y.jsx)(`span`,{className:M(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,i&&`font-semibold`),children:e.title})]}),(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[11px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,Y.jsxs)(`span`,{children:[`#`,e.number]}),(0,Y.jsx)(`span`,{className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,Y.jsx)(`span`,{children:U(e.createdAt)}),(0,Y.jsx)(Zt,{count:e.comments}),s?(0,Y.jsx)($t,{checks:s}):null,o?(0,Y.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,Y.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Y.jsx)(Mt,{label:e,color:n[e],plain:!0},e))}):null]})})}function jt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,J.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Y.jsxs)(P,{open:i,onOpenChange:a,children:[(0,Y.jsx)(me,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:M(`flex min-h-11 min-w-11 shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[(0,Y.jsx)(Ye,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,Y.jsx)(N,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Y.jsxs)(Ce,{children:[(0,Y.jsx)(Oe,{placeholder:`Filter labels…`}),(0,Y.jsxs)(Te,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Y.jsx)(B,{children:`No labels.`}),n.length>0?(0,Y.jsxs)(R,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,Y.jsxs)(R,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:ut(t[e])}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Y.jsx)(T,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}function Mt({label:e,color:t,plain:n=!1}){return(0,Y.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:ut(t),className:n?`text-[11px] font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function Nt({item:e,listPath:t,colors:n,children:r,changes:i,checks:a}){let o=e.kind===`pr`?`pull request`:`issue`,s=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,Y.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Y.jsxs)(Ne,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Y.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Y.jsxs)(`h2`,{className:`mb-4 text-[22px] leading-snug font-normal`,children:[`#`,e.number,` `,e.title]}):null,(0,Y.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,Y.jsx)(`span`,{children:o}),`·`,(0,Y.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Y.jsxs)(`span`,{children:[U(e.createdAt),` ago`]}),e.comments?(0,Y.jsxs)(Y.Fragment,{children:[`·`,(0,Y.jsx)(Zt,{count:e.comments})]}):null,s?(0,Y.jsxs)(Y.Fragment,{children:[`·`,(0,Y.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,pe(e.url)?(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Y.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Y.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]}),e.kind===`pr`?null:(0,Y.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-normal`,children:e.title}),e.kind===`pr`?(0,Y.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Y.jsx)(qe,{to:`/github/prs/${e.number}`,active:!i,children:`Conversation`}),(0,Y.jsx)(qe,{to:`/github/prs/${e.number}/changes`,active:i,children:`Changes`})]}):null,e.labels.length>0||a?(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Y.jsx)(Mt,{label:e,color:n[e]},e)),a?(0,Y.jsx)(Qt,{checks:a,url:e.url}):null]}):null,i&&e.kind===`pr`?(0,Y.jsx)(Lt,{item:e}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,Y.jsx)(Fe,{children:e.body}):(0,Y.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,Y.jsx)(Rt,{item:e,colors:n})]})]}),e.kind===`pr`?(0,Y.jsx)(It,{number:e.number}):null,r]})}var Pt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Ft({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Y.jsx)(T,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:M(t,`text-success`)}):e===`failing`?(0,Y.jsx)(A,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:M(t,`text-danger`)}):e===`pending`?(0,Y.jsx)(Pe,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:M(t,`animate-spin text-warning`)}):(0,Y.jsx)(O,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:M(t,`text-soft-foreground`)})}function It({number:e}){let t=u(),n=C({queryKey:k.githubMergeState(e),queryFn:({signal:t})=>de(e,{},{signal:t}),retry:!1}),r=n.data?.available?n.data.mergeState:null,[i,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),[l,d]=(0,J.useState)(!1),p=a({mutationFn:()=>de(e,{refresh:!0}),onSuccess:n=>t.setQueryData(k.githubMergeState(e),n),onError:e=>j(e instanceof Error?e.message:String(e),{tone:`danger`})}),h=i&&r?.methods.includes(i)?i:r?.defaultMethod??r?.methods[0]??null,g=a({mutationFn:()=>{if(!r||!h)throw Error(`No merge method is available.`);return f(e,{method:h,expectedHeadSha:r.headSha,...l&&r.canOverride?{overrideRules:!0}:{}})},onSuccess:()=>{c(!1),j(`Pull request #${e} merged`),t.invalidateQueries({queryKey:k.githubMergeState(e)}),t.invalidateQueries({queryKey:k.github({limit:Ct})}),t.invalidateQueries({queryKey:k.githubComments(`pr`,e)})},onError:n=>{j(n instanceof Error?n.message:String(n),{tone:`danger`}),t.invalidateQueries({queryKey:k.githubMergeState(e)})}});if(n.isPending)return(0,Y.jsx)(X,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`});if(!r)return(0,Y.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Y.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:n.data?.available===!1?n.data.reason:`GitHub could not load merge requirements.`})]});let _=r.state===`merged`?`Merged`:r.state===`closed`?`Closed`:r.isDraft?`Draft`:r.mergeable===`conflicting`?`Conflicts must be resolved`:r.canMerge?`Ready to merge`:r.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`,v=r.reviewDecision===`approved`?`passing`:r.reviewDecision===`unknown`?`unknown`:`failing`,y=r.mergeable===`mergeable`?`passing`:r.mergeable===`conflicting`?`failing`:`unknown`,b=!!(h&&(r.canMerge||r.canOverride&&l));return(0,Y.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":r.eligibility,"data-conflicting":r.mergeable===`conflicting`?`true`:void 0,"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[r.canMerge?(0,Y.jsx)(T,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,Y.jsx)(ee,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold`,children:_}),(0,Y.jsxs)(D,{type:`button`,variant:`ghost`,size:`sm`,disabled:p.isPending,onClick:()=>p.mutate(),children:[(0,Y.jsx)(m,{size:16,"aria-hidden":`true`,className:M(`size-3.5`,p.isPending&&`animate-spin`)}),`Refresh`]})]}),(0,Y.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[r.headRef,` (`,r.headSha.slice(0,7),`) → `,r.baseRef]}),(0,Y.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(Ft,{state:v}),(0,Y.jsxs)(`span`,{children:[`Reviews: `,r.reviewDecision.replaceAll(`-`,` `)]})]}),(0,Y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(Ft,{state:y}),(0,Y.jsxs)(`span`,{children:[`Conflicts: `,r.mergeable===`conflicting`?`present`:r.mergeable===`mergeable`?`none`:`unknown`]})]}),r.checks.length===0?(0,Y.jsx)(`li`,{children:`No checks configured`}):r.checks.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(Ft,{state:e.state}),(0,Y.jsxs)(`span`,{children:[e.name,` · `,e.state,e.required===!0?` · required`:e.required===null?` · requiredness unknown`:``]})]}),e.url&&pe(e.url)?(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]},e.name)),r.blockers.map(e=>(0,Y.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),r.mergeable===`conflicting`?(0,Y.jsx)(D,{className:`mt-4`,onClick:e=>{let t=e.currentTarget.closest(`article`)?.querySelector(`[data-slot="gh-custom-prompt"]`);t?.scrollIntoView({block:`center`}),t?.focus({preventScroll:!0})},children:`Run agent on this PR`}):null,r.canOverride?(0,Y.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Y.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,r.eligibility===`unknown`?(0,Y.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,r.state===`open`&&r.methods.length>0?(0,Y.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[(0,Y.jsx)(`select`,{"aria-label":`Merge method`,value:h??``,onChange:e=>o(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:r.methods.map(e=>(0,Y.jsx)(`option`,{value:e,children:Pt[e]},e))}),(0,Y.jsx)(D,{disabled:!b,onClick:()=>c(!0),children:h?Pt[h]:`Merge`})]}):null]})]}),(0,Y.jsx)(_e,{open:s,onOpenChange:c,children:(0,Y.jsxs)(ye,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Y.jsxs)(ve,{children:[(0,Y.jsxs)(be,{children:[h?Pt[h]:`Merge`,` pull request #`,e,`?`]}),(0,Y.jsx)(ge,{asChild:!0,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`p`,{children:[`This will merge “`,r.title,`” into `,r.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),l&&r.canOverride?(0,Y.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-warning`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),g.error?(0,Y.jsx)(`p`,{className:`text-sm text-danger`,children:g.error.message}):null,(0,Y.jsxs)(he,{children:[(0,Y.jsx)(D,{variant:`outline`,disabled:g.isPending,onClick:()=>c(!1),children:`Cancel`}),(0,Y.jsx)(D,{disabled:g.isPending,onClick:()=>g.mutate(),children:g.isPending?`Merging…`:h?Pt[h]:`Merge`})]})]})})]})}function Lt({item:e}){let t=u(),n=ce(e.number),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),s=n.data,c=s?.available?s.files.filter(e=>e.path.toLowerCase().includes(r.toLowerCase())):[],l=c.findIndex(e=>e.path===a);(0,J.useEffect)(()=>{c.length>0&&!c.some(e=>e.path===a)&&o(c[0].path)},[s?.available?s.headSha:``,r]);let d=async()=>{let n=s?.available?s.headSha:null,r=await g(e.number,{refresh:!0});t.setQueryData([`github`,`pr-changes`,e.number],r),r.available&&n&&n!==r.headSha&&(o(r.files[0]?.path??null),j(`The reviewed revision changed.`))};if(n.isPending)return(0,Y.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!s)return(0,Y.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!s.available)return(0,Y.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:s.reason});let f=c.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),p=pe(e.url)?`${e.url}/files`:null,m=c.find(e=>e.path===a);return(0,Y.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Y.jsxs)(`strong`,{children:[s.files.length,` changed files`]}),(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,s.additions]}),(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,s.deletions]}),(0,Y.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:s.headSha,children:[`head `,s.headSha.slice(0,8)]}),(0,Y.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void d(),children:`Refresh`})]}),s.truncated?(0,Y.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[s.reason??`This response is incomplete.`,` `,p?(0,Y.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Y.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Y.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Y.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Y.jsx)(`select`,{"aria-label":`Select changed file`,value:a??``,onChange:e=>o(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:c.map(e=>(0,Y.jsx)(`option`,{children:e.path},e.path))}),(0,Y.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:c.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:M(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,a===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Y.jsx)(D,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:l<=0,onClick:()=>o(c[l-1]?.path??null),children:(0,Y.jsx)(Je,{})}),(0,Y.jsx)(D,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:l<0||l>=c.length-1,onClick:()=>o(c[l+1]?.path??null),children:(0,Y.jsx)(te,{size:16})})]}),c.length===0?(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ke,{files:f.filter(e=>e.path===a),wrap:!0,className:`min-w-0`}),m&&!m.patch?(0,Y.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,m.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Rt({item:e,colors:t}){let n=o(e.kind,e.number),r=n.data,i=(0,J.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(zt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Y.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Y.jsx)(X,{className:`mb-3 h-3 w-24`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsx)(X,{className:`h-14 w-full`}),(0,Y.jsx)(X,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Y.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Y.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Y.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Y.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Bt(i).map(e=>e.group===`commits`?(0,Y.jsx)(Vt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Y.jsx)(qt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Y.jsx)(Ut,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Y.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var zt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Bt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Vt({commits:e,colors:t}){let[n,r]=(0,J.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Y.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Y.jsx)(Ut,{event:e,colors:t},e.id))]}):(0,Y.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Y.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:U(e[e.length-1].createdAt)})]})})}var Ht={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Ut({event:e,colors:t}){return(0,Y.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:M(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Ht[e.kind]}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Y.jsx)(Wt,{event:e,colors:t}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:U(e.createdAt)}),e.url?(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Y.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Wt({event:e,colors:t}){switch(e.kind){case`committed`:return(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Y.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,Y.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Y.jsx)(Gt,{checks:e.checks})]});case`labeled`:case`unlabeled`:return(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Y.jsx)(`span`,{"data-slot":`gh-event-label`,style:ut(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Y.jsx)(`span`,{className:`shrink-0`,children:`label`})]});case`assigned`:case`unassigned`:return(0,Y.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]});case`merged`:return(0,Y.jsx)(`span`,{children:`merged this`});case`closed`:return(0,Y.jsx)(`span`,{children:`closed this`});case`reopened`:return(0,Y.jsx)(`span`,{children:`reopened this`});case`head_ref_force_pushed`:return(0,Y.jsx)(`span`,{children:`force-pushed`});case`renamed`:return(0,Y.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]});case`cross-referenced`:return(0,Y.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}}function Gt({checks:e}){return e?(0,Y.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:M(`shrink-0`,Xt[e]),children:Yt[e]}):null}var Kt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function qt({comment:e}){let t=e.reviewState?Kt[e.reviewState]:null;return(0,Y.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Y.jsx)(Jt,{url:e.avatarUrl,login:e.author}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Y.jsx)(`span`,{children:U(e.createdAt)}),t?(0,Y.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:M(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Y.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Y.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,Y.jsx)(Fe,{children:e.body}):(0,Y.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function Jt({url:e,login:t}){let[n,r]=(0,J.useState)(!1);return e&&!n?(0,Y.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,Y.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Yt={passing:`✓`,failing:`✗`,pending:`○`},Xt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Zt({count:e}){return e?(0,Y.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Y.jsx)(H,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Qt({checks:e,url:t}){let n=M(`text-[11px] font-medium`,Xt[e],t&&`hover:underline`),r=`${Yt[e]} checks ${e}`;return t?(0,Y.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,Y.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function $t({checks:e}){return(0,Y.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:M(`shrink-0 font-sans text-[11px] font-semibold`,Xt[e]),children:Yt[e]})}export{Ot as GithubRoute};
|