tarsk 0.5.36 → 0.5.37
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/dist/index.js +27 -13
- package/dist/public/assets/{account-view-BB-ze5ek.js → account-view-Cn4P1srV.js} +1 -1
- package/dist/public/assets/api-DWU0D34A.js +1 -0
- package/dist/public/assets/{browser-tab-B3bYbBws.js → browser-tab-DeoHDVON.js} +1 -1
- package/dist/public/assets/commit-dialog-CWb_KVrD.js +1 -0
- package/dist/public/assets/context-menu-C7FTMa2c.js +1 -0
- package/dist/public/assets/create-repo-dialog-BCPrWkIv.js +1 -0
- package/dist/public/assets/{dialogs-config-I0_cSU2z.js → dialogs-config-DZKtVbNK.js} +3 -3
- package/dist/public/assets/diff-view-DL3hFREY.js +3 -0
- package/dist/public/assets/explorer-tab-view-DAs4rpHu.js +2 -0
- package/dist/public/assets/{explorer-tree-DrLoiF9t.js → explorer-tree-BV1LcznV.js} +1 -1
- package/dist/public/assets/explorer-view-BGSxs_-F.js +1 -0
- package/dist/public/assets/git-history-dialog-Bqv0bD41.js +1 -0
- package/dist/public/assets/git-ops-button-DZzOCOr8.js +2 -0
- package/dist/public/assets/history-view-jX3PPID6.js +9 -0
- package/dist/public/assets/index-CbJ3v0Sr.js +65 -0
- package/dist/public/assets/mcp-server-card-CTCrhFIS.js +1 -0
- package/dist/public/assets/merged-pr-dialog-B2qqrQ1g.js +1 -0
- package/dist/public/assets/onboarding-CxtzQldG.js +1 -0
- package/dist/public/assets/project-settings-view-B7RBOfiB.js +1 -0
- package/dist/public/assets/providers-list-view-BQFttbEU.js +1 -0
- package/dist/public/assets/pull-request-dialog-BIRSLJAA.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-LUgd2a4S.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-CFmgu9H_.js +1 -0
- package/dist/public/assets/radio-group-Bd8YbtFD.js +1 -0
- package/dist/public/assets/react-vendor-Ba8DSNiO.js +16 -0
- package/dist/public/assets/settings-general-view-CH-51vI0.js +1 -0
- package/dist/public/assets/settings-instructions-view-D9HZldUk.js +1 -0
- package/dist/public/assets/settings-list-CKPEGohm.js +1 -0
- package/dist/public/assets/{settings-mcp-servers-view-DBD-NhPx.js → settings-mcp-servers-view-o2gqb0qo.js} +4 -4
- package/dist/public/assets/{settings-models-skeleton-DsWpzWOw.js → settings-models-skeleton-l966LEN8.js} +1 -1
- package/dist/public/assets/settings-models-view-m-MDG6JH.js +1 -0
- package/dist/public/assets/settings-rules-view-tG9JJQzK.js +8 -0
- package/dist/public/assets/settings-skills-view-DLyWp1pq.js +2 -0
- package/dist/public/assets/settings-slash-commands-view-B7OCA_J1.js +1 -0
- package/dist/public/assets/settings-subagents-view-CSkVwd-J.js +2 -0
- package/dist/public/assets/settings-system-prompt-view-Br6r4RXb.js +1 -0
- package/dist/public/assets/settings-view-rUCFRiPR.js +2 -0
- package/dist/public/assets/skeleton-qzmFgKhS.js +1 -0
- package/dist/public/assets/{terminal-panel-C5qj1ctH.js → terminal-panel-D3Ru16FT.js} +2 -2
- package/dist/public/assets/{ui-components-BN8dp4Bi.js → ui-components-f8jJJzEo.js} +1 -1
- package/dist/public/assets/{utils-CU0c_yCM.js → utils-BlXPFbY9.js} +1 -1
- package/dist/public/index.html +6 -6
- package/package.json +1 -1
- package/dist/public/assets/api-DzFQRz0u.js +0 -1
- package/dist/public/assets/commit-dialog-CJRMd4oA.js +0 -1
- package/dist/public/assets/context-menu-86TNA1D0.js +0 -1
- package/dist/public/assets/create-repo-dialog-nLnVNRqq.js +0 -1
- package/dist/public/assets/diff-view-B8vWYa_2.js +0 -3
- package/dist/public/assets/explorer-tab-view-BGWQPnkw.js +0 -2
- package/dist/public/assets/explorer-view-Clm-RCAB.js +0 -1
- package/dist/public/assets/git-history-dialog-CcdMtW0o.js +0 -1
- package/dist/public/assets/git-ops-button-D9m2nmhO.js +0 -2
- package/dist/public/assets/history-view-Be-1C1tJ.js +0 -7
- package/dist/public/assets/index-DVXbmgHY.js +0 -65
- package/dist/public/assets/mcp-server-card-bNNoXKsW.js +0 -1
- package/dist/public/assets/merged-pr-dialog-Fj8II9Bt.js +0 -1
- package/dist/public/assets/onboarding-CgP4bJ5F.js +0 -1
- package/dist/public/assets/project-settings-view-DixzP7KH.js +0 -1
- package/dist/public/assets/providers-list-view-BzSUZZyq.js +0 -1
- package/dist/public/assets/pull-request-dialog-ChuHHY3J.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-Ck6aK6Q7.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-CbtHXjDH.js +0 -1
- package/dist/public/assets/radio-group-ZjNXbvW6.js +0 -1
- package/dist/public/assets/react-vendor-Do-APsQ6.js +0 -16
- package/dist/public/assets/settings-general-view-FwrdJbys.js +0 -1
- package/dist/public/assets/settings-instructions-view-BHzMtSvN.js +0 -1
- package/dist/public/assets/settings-list-BCoqXa_X.js +0 -1
- package/dist/public/assets/settings-models-view-vgV5YHRx.js +0 -1
- package/dist/public/assets/settings-rules-view-DcSXrmaq.js +0 -8
- package/dist/public/assets/settings-skills-view-DVGGs16n.js +0 -2
- package/dist/public/assets/settings-slash-commands-view-BsJw1F4p.js +0 -1
- package/dist/public/assets/settings-subagents-view-BgWhQ9bf.js +0 -2
- package/dist/public/assets/settings-system-prompt-view-DAAbMucD.js +0 -1
- package/dist/public/assets/settings-view-DLzrbu69.js +0 -2
- package/dist/public/assets/skeleton-iEZ-dj1s.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as t,Ci as n,Ha as r,_o as i,hi as a,li as o,mi as s,pa as c,si as l,wa as u,yo as d}from"./dialogs-config-I0_cSU2z.js";import{S as f}from"./react-vendor-Do-APsQ6.js";import{a as p,l as m,n as h,o as g}from"./history-view-Be-1C1tJ.js";import{n as _}from"./utils-CU0c_yCM.js";import{E as v,a as y,j as b,w as x}from"./index-DVXbmgHY.js";import{a as S,c as C,i as w}from"./api-DzFQRz0u.js";var T=i(),E=e(d(),1),D=t();function O(e){return a(e)===`md`}function k(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,mdc:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`}[a(e)]??`plaintext`}function A(e,t){return`explorer-file:${e}:${t}`}function j(e){let t=(0,T.c)(10),{threadId:n,path:r,onContentReady:i}=e,a;t[0]!==r||t[1]!==n?(a=A(n,r),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;t[3]!==r||t[4]!==n?(o=()=>S(n,r),t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=p(a,o),c,l;return t[6]!==i||t[7]!==s.content?(c=()=>{i({content:s.content,original:s.content})},l=[i,s.content],t[6]=i,t[7]=s.content,t[8]=c,t[9]=l):(c=t[8],l=t[9]),(0,E.useLayoutEffect)(c,l),null}function M(e,t){return`explorer-media:${e}:${t}`}function N(e,t){let n=(0,T.c)(11),r;n[0]!==t||n[1]!==e?(r=M(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]!==t||n[4]!==e?(i=()=>w(e,t),n[3]=t,n[4]=e,n[5]=i):i=n[5];let a=p(r,i),o;n[6]===a?o=n[7]:(o=URL.createObjectURL(a),n[6]=a,n[7]=o);let s=o,c,l;return n[8]===s?(c=n[9],l=n[10]):(c=()=>()=>{URL.revokeObjectURL(s)},l=[s],n[8]=s,n[9]=c,n[10]=l),(0,E.useEffect)(c,l),s}function P(e){let t=(0,T.c)(3),{threadId:n,path:r,alt:i}=e,a=N(n,r),o;return t[0]!==i||t[1]!==a?(o=(0,D.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 overflow-auto`,children:(0,D.jsx)(`img`,{src:a,alt:i,className:`max-w-full max-h-full object-contain`})}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function F(e){let t=(0,T.c)(2),{threadId:n,path:r}=e,i=N(n,r),a;return t[0]===i?a=t[1]:(a=(0,D.jsx)(`div`,{className:`flex items-center justify-center h-full p-4`,children:(0,D.jsx)(`video`,{src:i,controls:!0,className:`max-w-full max-h-full`})}),t[0]=i,t[1]=a),a}function I({selectedFile:e,showTreeBackButton:t=!1,onShowTree:i}){let{resolvedTheme:a}=_(),d=b(e=>e.selectedThreadId),p=(0,E.useRef)(null),[S,w]=(0,E.useState)(null),[T,N]=(0,E.useState)(!1),[I,L]=(0,E.useState)(`edit`),[R,z]=(0,E.useState)(0),B=e?s(e.path,e.name):null,V=e?.type===`file`&&d&&!B?e:null,H=S?.content??``,U=S?.original??``,W=V?`${d}:${V.path}:${R}`:null;(0,E.useEffect)(()=>()=>{p.current&&=(p.current.getModel()?.dispose(),p.current.dispose(),null)},[]),(0,E.useEffect)(()=>{e?.type===`file`?L(O(e.path)?`view`:`edit`):L(`edit`),w(null)},[e?.path,d]);async function G(){if(!(!d||!e)){N(!0);try{await C(d,e.path,H),w({content:H,original:H}),v({title:`Saved`,description:`${e.name} saved successfully.`})}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to save file`,variant:`destructive`})}finally{N(!1)}}}function K(){!d||!V||(g(A(d,V.path)),w(null),z(e=>e+1))}return d?(0,D.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,D.jsxs)(y,{className:`justify-between`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[t&&i?(0,D.jsxs)(l,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:i,children:[(0,D.jsx)(c,{className:`h-4 w-4`}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,D.jsx)(`span`,{className:o(n.label,`truncate text-foreground`),children:e?e.name:`Select a file to edit`}),(0,D.jsx)(`span`,{className:o(n.compact,`truncate text-muted-foreground`),children:e?e.path:`Browse and edit repository files`})]})]}),V&&S?(0,D.jsxs)(`div`,{className:`flex gap-2`,children:[O(V.path)?(0,D.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,D.jsx)(l,{size:`sm`,variant:I===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>L(`view`),children:`View`}),(0,D.jsx)(l,{size:`sm`,variant:I===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>L(`edit`),children:`Edit`})]}):null,(0,D.jsxs)(l,{size:`sm`,onClick:()=>void G(),disabled:T||!H||H===U,children:[T?(0,D.jsx)(u,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null]}),(0,D.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:(0,D.jsx)(`div`,{className:`h-full relative overflow-hidden`,children:V?(0,D.jsxs)(h,{fallbackTitle:`Failed to load file`,onRetry:K,children:[(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(m,{}),children:(0,D.jsx)(j,{threadId:d,path:V.path,onContentReady:w},W??void 0)}),S?O(V.path)&&I===`view`?(0,D.jsx)(`div`,{className:`h-full overflow-auto p-6`,children:(0,D.jsx)(x,{content:H,enableMermaid:!0})}):(0,D.jsx)(f,{height:`100%`,language:k(V.path),value:H,onChange:e=>w(t=>t&&{...t,content:e??``}),onMount:e=>{p.current=e},theme:a===`dark`?`vs-dark`:`vs-light`,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:13,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}}):(0,D.jsx)(m,{})]}):e?.type===`file`&&B===`image`?(0,D.jsx)(h,{fallbackTitle:`Failed to load image`,onRetry:()=>{!d||!e||g(M(d,e.path))},children:(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(m,{}),children:(0,D.jsx)(P,{threadId:d,path:e.path,alt:e.name})})}):e?.type===`file`&&B===`video`?(0,D.jsx)(h,{fallbackTitle:`Failed to load video`,onRetry:()=>{!d||!e||g(M(d,e.path))},children:(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(m,{}),children:(0,D.jsx)(F,{threadId:d,path:e.path})})}):(0,D.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,D.jsx)(r,{className:`h-10 w-10 text-muted-foreground/50`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`p`,{className:o(n.label,`text-muted-foreground`),children:`No file selected`}),(0,D.jsx)(`p`,{className:o(n.bodyMuted,`mt-1`),children:`Select a file from the tree to edit it`})]})]})})})]}):(0,D.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[(0,D.jsx)(r,{className:`h-8 w-8 text-muted-foreground`}),(0,D.jsx)(`p`,{className:n.bodyMuted,children:`Select a thread to browse its files`})]})}export{I as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ai as e,Ar as t,Ci as n,Dr as r,Er as i,Or as a,_o as o,jr as s,kr as c,li as l,si as u,wa as d}from"./dialogs-config-I0_cSU2z.js";var f=o(),p=e();function m(e){let o=(0,f.c)(28),{open:m,onOpenChange:g,commits:_,displayedCommits:v,isLoadingMore:y,onScroll:b,currentBranch:x}=e,S;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,p.jsx)(s,{children:`Commit History`}),o[0]=S):S=o[0];let C;o[1]===x?C=o[2]:(C=(0,p.jsxs)(t,{children:[S,(0,p.jsxs)(a,{children:[`Recent commits on branch `,x]})]}),o[1]=x,o[2]=C);let w;o[3]===v?w=o[4]:(w=v.length>0?v.map(h):(0,p.jsx)(`p`,{className:l(n.bodyMuted,`text-center py-8`),children:`No commits found`}),o[3]=v,o[4]=w);let T;o[5]===y?T=o[6]:(T=y&&(0,p.jsx)(`div`,{className:`p-3 text-center`,children:(0,p.jsx)(d,{className:`h-4 w-4 animate-spin inline`})}),o[5]=y,o[6]=T);let E;o[7]!==_.length||o[8]!==v.length||o[9]!==y?(E=v.length<_.length&&!y&&(0,p.jsx)(`div`,{className:l(n.caption,`p-3 text-center`),children:`Scroll to load more`}),o[7]=_.length,o[8]=v.length,o[9]=y,o[10]=E):E=o[10];let D;o[11]!==w||o[12]!==T||o[13]!==E?(D=(0,p.jsxs)(`div`,{className:`divide-y`,children:[w,T,E]}),o[11]=w,o[12]=T,o[13]=E,o[14]=D):D=o[14];let O;o[15]!==b||o[16]!==D?(O=(0,p.jsx)(`div`,{className:`flex-1 overflow-y-auto border rounded-lg`,onScroll:b,children:D}),o[15]=b,o[16]=D,o[17]=O):O=o[17];let k;o[18]===g?k=o[19]:(k=(0,p.jsx)(c,{children:(0,p.jsx)(u,{onClick:()=>g(!1),children:`Close`})}),o[18]=g,o[19]=k);let A;o[20]!==C||o[21]!==O||o[22]!==k?(A=(0,p.jsxs)(r,{className:`max-w-2xl max-h-[80vh] flex flex-col`,children:[C,O,k]}),o[20]=C,o[21]=O,o[22]=k,o[23]=A):A=o[23];let j;return o[24]!==g||o[25]!==m||o[26]!==A?(j=(0,p.jsx)(i,{open:m,onOpenChange:g,children:A}),o[24]=g,o[25]=m,o[26]=A,o[27]=j):j=o[27],j}function h(e){return(0,p.jsxs)(`div`,{className:`p-3 hover:bg-muted/50 transition-colors`,children:[(0,p.jsx)(`p`,{className:l(n.label,`break-words`),children:e.message}),(0,p.jsxs)(`p`,{className:l(n.bodyMuted,`mt-1`),children:[(0,p.jsx)(`span`,{className:n.mono,children:e.hash.substring(0,7)}),` •`,` `,e.author,` • `,new Date(e.date).toLocaleDateString()]})]},e.hash)}export{m as GitHistoryDialog};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/commit-dialog-CJRMd4oA.js","assets/index-DVXbmgHY.js","assets/rolldown-runtime-aKtaBQYM.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-Be-1C1tJ.js","assets/dialogs-config-I0_cSU2z.js","assets/onboarding-CgP4bJ5F.js","assets/whisper-wasm-EGutPGND.js","assets/react-vendor-Do-APsQ6.js","assets/utils-CU0c_yCM.js","assets/index-jIBJk8xl.css","assets/pull-request-dialog-ChuHHY3J.js","assets/create-repo-dialog-nLnVNRqq.js","assets/git-history-dialog-CcdMtW0o.js","assets/push-before-pr-dialog-CbtHXjDH.js","assets/pull-with-changes-dialog-Ck6aK6Q7.js","assets/merged-pr-dialog-Fj8II9Bt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$n as t,Ai as n,C as r,Ci as i,Ht as a,Ia as o,It as s,J as c,Jn as l,Jt as ee,K as u,Ka as d,Kt as te,Lt as f,Na as p,Oi as ne,Pa as m,Rt as re,St as ie,Vt as h,Wt as ae,Yn as g,_o as _,at as oe,dr as se,fr as ce,ho as v,ir as y,ka as le,li as ue,mr as de,pr as fe,qa as pe,rr as b,si as me,so as he,sr as x,st as ge,wa as _e,yo as S,zi as ve,zt as ye}from"./dialogs-config-I0_cSU2z.js";import{r as C}from"./monaco-CZnIWXyV.js";import{A as w,E as T,_ as be,f as E,g as D,h as xe,j as O,k,m as Se,v as Ce}from"./index-DVXbmgHY.js";var A=e(S(),1),j=n();function we(e,t){return t?`Creating PR...`:e.status===`Behind`&&!e.hasChanges&&!e.hasUnpushedCommits?`Sync`:e.hasChanges?`Commit`:e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits?`Open PR`:e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?`Create PR`:e.hasUnpushedCommits&&e.prExists?`Update PR`:`Commit`}function M(e,t){return t?(0,j.jsx)(_e,{className:`h-3.5 w-3.5 animate-spin`}):e.status===`Behind`&&!e.hasChanges&&!e.hasUnpushedCommits?(0,j.jsx)(v,{className:`h-3.5 w-3.5`}):e.hasChanges?(0,j.jsx)(o,{className:`h-3.5 w-3.5`}):e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits?(0,j.jsx)(d,{className:`h-3.5 w-3.5`}):(0,j.jsx)(m,{className:`h-3.5 w-3.5`})}function Te(e){if(e.status===`Behind`&&!e.hasChanges&&!e.hasUnpushedCommits){let t=e.defaultBranch??`main`;return e.currentBranch===e.defaultBranch?`Your branch is behind the remote. This will pull the latest changes from origin/${t}`:`Your branch "${e.currentBranch}" is behind "${t}". This will rebase and sync with the latest changes`}return e.hasChanges?e.changedFilesCount>0?`Commit ${e.changedFilesCount} changed file${e.changedFilesCount===1?``:`s`}`:`No changes to commit`:e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits?`View pull request in GitHub`:e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?`Create pull request for committed changes`:e.hasUnpushedCommits&&e.prExists?`Update pull request with unpushed commits`:`No actions available`}function N(e,t,n=!1){return t||n?!0:e.status===`Behind`&&!e.hasChanges&&!e.hasUnpushedCommits||e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?!1:!e.hasChanges&&!e.hasUnpushedCommits}function P(e){return e.hasChanges||e.status===`Behind`&&!e.hasChanges&&!e.hasUnpushedCommits||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges}var Ee=_();function De(e){let t=(0,Ee.c)(87),{branchStatus:n,remoteUrl:r,hasRemoteBranch:a,hasUnpushedCommits:o,canCreateRepo:s,repoUrl:c,isRefreshing:l,isBrandState:ee,gitUser:u,isDirectCommitMode:te,isLoading:f,isLoadingHistory:ne,onFetch:re,onPull:ie,onPush:h,onOpenHistory:ae,onCreatePR:g,onCreateRepo:_,onViewInGitHub:oe,onOpenChange:y,layout:b}=e,x=b===void 0?`bar`:b,ge=x===`bar`&&`w-8 rounded-l-none`,S=x===`menu`&&`w-full justify-start gap-2 rounded-md`,ye=ee&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`,C;t[0]!==ge||t[1]!==S||t[2]!==ye?(C=ue(`h-8 px-1`,ge,S,ye),t[0]=ge,t[1]=S,t[2]=ye,t[3]=C):C=t[3];let w;t[4]===l?w=t[5]:(w=l?(0,j.jsx)(_e,{className:`h-3.5 w-3.5 animate-spin`}):(0,j.jsx)(he,{className:`h-3.5 w-3.5`}),t[4]=l,t[5]=w);let T;t[6]===x?T=t[7]:(T=x===`menu`&&(0,j.jsx)(`span`,{children:`More git actions`}),t[6]=x,t[7]=T);let E;t[8]!==f||t[9]!==C||t[10]!==w||t[11]!==T?(E=(0,j.jsx)(Ce,{asChild:!0,children:(0,j.jsxs)(me,{variant:`outline`,size:`sm`,className:C,disabled:f,children:[w,T]})}),t[8]=f,t[9]=C,t[10]=w,t[11]=T,t[12]=E):E=t[12];let O;t[13]!==n||t[14]!==r?(O=n===`Behind`&&(0,j.jsxs)(`div`,{className:ue(i.compact,`px-2 py-1 text-amber-600`),children:[`Branch is behind `,r?`origin`:`remote`]}),t[13]=n,t[14]=r,t[15]=O):O=t[15];let k;t[16]===u?k=t[17]:(k=u&&(0,j.jsxs)(`div`,{className:ue(i.compact,`px-2 py-1 text-muted-foreground`),children:[(0,j.jsx)(`span`,{className:`font-medium`,children:`User:`}),` `,u]}),t[16]=u,t[17]=k);let A;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,j.jsx)(be,{}),t[18]=A):A=t[18];let we;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,j.jsx)(pe,{className:`h-3.5 w-3.5 mr-2`}),t[19]=we):we=t[19];let M;t[20]!==f||t[21]!==re?(M=(0,j.jsx)(de,{asChild:!0,children:(0,j.jsxs)(D,{onClick:re,disabled:f,children:[we,`Fetch`]})}),t[20]=f,t[21]=re,t[22]=M):M=t[22];let Te;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,j.jsx)(ce,{side:`right`,children:`Download latest information from remote without merging changes`}),t[23]=Te):Te=t[23];let N;t[24]===M?N=t[25]:(N=(0,j.jsx)(fe,{children:(0,j.jsxs)(se,{children:[M,Te]})}),t[24]=M,t[25]=N);let P;t[26]!==a||t[27]!==f||t[28]!==ie?(P=()=>{a&&!f&&ie()},t[26]=a,t[27]=f,t[28]=ie,t[29]=P):P=t[29];let De=!a||f?`opacity-50 cursor-not-allowed`:``,Oe;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,j.jsx)(v,{className:`h-3.5 w-3.5 mr-2`}),t[30]=Oe):Oe=t[30];let F;t[31]!==P||t[32]!==De?(F=(0,j.jsx)(de,{asChild:!0,children:(0,j.jsxs)(D,{onClick:P,className:De,children:[Oe,`Pull`]})}),t[31]=P,t[32]=De,t[33]=F):F=t[33];let I=a?`Pull latest changes from remote`:`No remote branch to pull from`,L;t[34]===I?L=t[35]:(L=(0,j.jsx)(ce,{side:`right`,children:I}),t[34]=I,t[35]=L);let R;t[36]!==F||t[37]!==L?(R=(0,j.jsx)(fe,{children:(0,j.jsxs)(se,{children:[F,L]})}),t[36]=F,t[37]=L,t[38]=R):R=t[38];let z;t[39]!==a||t[40]!==f||t[41]!==h?(z=!a&&(0,j.jsx)(fe,{children:(0,j.jsxs)(se,{children:[(0,j.jsx)(de,{asChild:!0,children:(0,j.jsxs)(D,{onClick:h,disabled:f,children:[(0,j.jsx)(ve,{className:`h-3.5 w-3.5 mr-2`}),`Push Branch to Remote`]})}),(0,j.jsx)(ce,{side:`right`,children:`Create remote branch and push local commits`})]})}),t[39]=a,t[40]=f,t[41]=h,t[42]=z):z=t[42];let B;t[43]!==o||t[44]!==f||t[45]!==h?(B=()=>{o&&!f&&h()},t[43]=o,t[44]=f,t[45]=h,t[46]=B):B=t[46];let ke=!o||f?`opacity-50 cursor-not-allowed`:``,Ae;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,j.jsx)(ve,{className:`h-3.5 w-3.5 mr-2`}),t[47]=Ae):Ae=t[47];let V;t[48]!==B||t[49]!==ke?(V=(0,j.jsx)(de,{asChild:!0,children:(0,j.jsxs)(D,{onClick:B,className:ke,children:[Ae,`Push Commits`]})}),t[48]=B,t[49]=ke,t[50]=V):V=t[50];let je=o?f?`Push in progress...`:`Push your uncommitted commits to the remote branch`:`No commits to push - your branch is up to date with remote`,H;t[51]===je?H=t[52]:(H=(0,j.jsx)(ce,{side:`right`,children:je}),t[51]=je,t[52]=H);let U;t[53]!==V||t[54]!==H?(U=(0,j.jsx)(fe,{children:(0,j.jsxs)(se,{children:[V,H]})}),t[53]=V,t[54]=H,t[55]=U):U=t[55];let Me=f||ne,Ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,j.jsx)(le,{className:`h-3.5 w-3.5 mr-2`}),t[56]=Ne):Ne=t[56];let W;t[57]!==ae||t[58]!==Me?(W=(0,j.jsxs)(D,{onClick:ae,disabled:Me,children:[Ne,`History`]}),t[57]=ae,t[58]=Me,t[59]=W):W=t[59];let G;t[60]!==te||t[61]!==f||t[62]!==g?(G=!te&&(0,j.jsxs)(D,{onClick:g,disabled:f,children:[(0,j.jsx)(m,{className:`h-3.5 w-3.5 mr-2`}),`Create Pull Request`]}),t[60]=te,t[61]=f,t[62]=g,t[63]=G):G=t[63];let K;t[64]!==s||t[65]!==f||t[66]!==_?(K=s&&(0,j.jsxs)(D,{onClick:_,disabled:f,children:[(0,j.jsx)(p,{className:`h-3.5 w-3.5 mr-2`}),`Create Repo`]}),t[64]=s,t[65]=f,t[66]=_,t[67]=K):K=t[67];let q;t[68]!==f||t[69]!==oe||t[70]!==c?(q=c&&(0,j.jsxs)(D,{onClick:oe,disabled:f,children:[(0,j.jsx)(d,{className:`h-3.5 w-3.5 mr-2`}),`View in GitHub`]}),t[68]=f,t[69]=oe,t[70]=c,t[71]=q):q=t[71];let J;t[72]!==k||t[73]!==N||t[74]!==R||t[75]!==z||t[76]!==U||t[77]!==W||t[78]!==G||t[79]!==K||t[80]!==q||t[81]!==O?(J=(0,j.jsxs)(xe,{align:`end`,children:[O,k,A,N,R,z,U,W,G,K,q]}),t[72]=k,t[73]=N,t[74]=R,t[75]=z,t[76]=U,t[77]=W,t[78]=G,t[79]=K,t[80]=q,t[81]=O,t[82]=J):J=t[82];let Y;return t[83]!==y||t[84]!==J||t[85]!==E?(Y=(0,j.jsxs)(Se,{onOpenChange:y,children:[E,J]}),t[83]=y,t[84]=J,t[85]=E,t[86]=Y):Y=t[86],Y}function Oe(){return{autoGenerateCommitMessage:l(),autoGeneratePRInfo:g(),privateRepositoryDefault:t()}}function F(e){e.autoGenerateCommitMessage!==void 0&&b(e.autoGenerateCommitMessage),e.autoGeneratePRInfo!==void 0&&y(e.autoGeneratePRInfo),e.privateRepositoryDefault!==void 0&&x(e.privateRepositoryDefault)}function I(e){return e?!0:(T({title:`Error`,description:`No thread selected`,variant:`destructive`}),!1)}function L(e){let t=e.split(`/`);return t.length>=2?{provider:t[0],model:t.slice(1).join(`/`)}:{provider:void 0,model:e}}function R(e,t,n){let[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)(!1),s=()=>n?.id?n.provider?{provider:n.provider,model:n.id}:L(n.id):{provider:void 0,model:void 0};return{isGeneratingMessage:r,isGeneratingPRInfo:a,generateCommitMessageWithAI:(0,A.useCallback)(async()=>{if(!e)return null;try{i(!0);let{provider:t,model:n}=s();return await u(e,n,t)}catch(e){return console.error(`Failed to generate commit message:`,e),T({title:`Error`,description:e instanceof Error?e.message:`Failed to generate commit message`,variant:`destructive`}),null}finally{i(!1)}},[e,n]),generatePRInfoWithAI:(0,A.useCallback)(async()=>{if(!e)return null;try{o(!0);let{provider:t,model:n}=s();return await c(e,n,t)}catch(e){return console.error(`Failed to generate PR info:`,e),T({title:`Error`,description:e instanceof Error?e.message:`Failed to generate PR info`,variant:`destructive`}),null}finally{o(!1)}},[e,n])}}var z=(0,A.lazy)(()=>C(()=>import(`./commit-dialog-CJRMd4oA.js`).then(e=>({default:e.CommitDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),B=(0,A.lazy)(()=>C(()=>import(`./pull-request-dialog-ChuHHY3J.js`).then(e=>({default:e.PullRequestDialog})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),ke=(0,A.lazy)(()=>C(()=>import(`./create-repo-dialog-nLnVNRqq.js`).then(e=>({default:e.CreateRepoDialog})),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11]))),Ae=(0,A.lazy)(()=>C(()=>import(`./git-history-dialog-CcdMtW0o.js`).then(e=>({default:e.GitHistoryDialog})),__vite__mapDeps([14,6,2]))),V=(0,A.lazy)(()=>C(()=>import(`./push-before-pr-dialog-CbtHXjDH.js`).then(e=>({default:e.PushBeforePRDialog})),__vite__mapDeps([15,6,2]))),je=(0,A.lazy)(()=>C(()=>import(`./pull-with-changes-dialog-Ck6aK6Q7.js`).then(e=>({default:e.PullWithChangesDialog})),__vite__mapDeps([16,5,2,6]))),H=(0,A.lazy)(()=>C(()=>import(`./merged-pr-dialog-Fj8II9Bt.js`).then(e=>({default:e.MergedPRDialog})),__vite__mapDeps([17,6,2])));function U(){return null}function Me({projectId:e,threadId:t,layout:n=`bar`}){let i=w(),o=O(e=>e.projectModelSelections[t]),c=O(t=>t.projects.find(t=>t.projectId===e)),[l,u]=(0,A.useState)(!1),[d,p]=(0,A.useState)(!1),[m,g]=(0,A.useState)(!1),[_,v]=(0,A.useState)(!1),[y,le]=(0,A.useState)(``),[pe,b]=(0,A.useState)(``),[he,x]=(0,A.useState)(``),[_e,S]=(0,A.useState)(!1),[ve,C]=(0,A.useState)(null),be=(0,A.useRef)(!1),D=(0,A.useRef)(!1),xe=(0,A.useRef)(pe),Se=(0,A.useRef)(he);xe.current=pe,Se.current=he;let[Ce,Ee]=(0,A.useState)(!1),[L,Me]=(0,A.useState)([]),[Ne,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)([]),[q,J]=(0,A.useState)(!1),[Y,Pe]=(0,A.useState)(!1),[Fe,Ie]=(0,A.useState)(``),[Le,Re]=(0,A.useState)(``),[ze,Be]=(0,A.useState)(``),[Ve,He]=(0,A.useState)(!1),[Ue,We]=(0,A.useState)(!1),[Ge,Ke]=(0,A.useState)(!1),[qe,Je]=(0,A.useState)(!1),X=E(),{fetchUnifiedStatus:Ye}=X,Z=R(t,e,o);async function Q(){te();let e=await ie();i({type:k.SetProjects,projects:e.projects})}let[$,Xe]=(0,A.useState)(()=>Oe()),Ze=c?.commitMethod===ne.Direct;(0,A.useEffect)(()=>{Y&&c?.name&&!Fe&&Ie(c.name)},[Y,c?.name,Fe]),(0,A.useEffect)(()=>{F($)},[$]);function Qe(){Ve||(He(!0),ge().then(e=>Be(e)).catch(()=>{}))}(0,A.useEffect)(()=>{if(!m){D.current=!1;return}if(m&&$.autoGenerateCommitMessage&&!y.trim()&&t&&!D.current){D.current=!0;async function e(){let e=await Z.generateCommitMessageWithAI();e&&le(e)}e()}},[m,$.autoGenerateCommitMessage,t,Z.generateCommitMessageWithAI,y]),(0,A.useEffect)(()=>{if(!_){be.current=!1;return}if(_&&$.autoGeneratePRInfo&&!xe.current.trim()&&!Se.current.trim()&&t&&!be.current){be.current=!0;async function e(){let e=await Z.generatePRInfoWithAI();e&&(b(e.title),x(e.description),T({title:`Success`,description:`PR title and description generated`}))}e()}},[_,$.autoGeneratePRInfo,t,Z.generatePRInfoWithAI]),(0,A.useEffect)(()=>{X.prExists&&X.prState===`MERGED`&&Je(!0),d&&X.prExists&&X.prState===`OPEN`&&p(!1)},[X.prExists,X.prState,t,d]),(0,A.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>{p(!1)},15e3);return()=>clearTimeout(e)},[d]);async function $e(){if(y.trim()&&I(t))try{u(!0),await s(t,y),le(``),g(!1),await X.fetchUnifiedStatus(!0),Q(),T({title:`Changes committed successfully`,description:`Your changes have been committed to '${X.currentBranch}'.`}),Ge&&(Ke(!1),await at())}catch(e){console.error(`Failed to commit:`,e),T({title:`Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{u(!1)}}async function et(){if(X.status===`Behind`&&!X.hasChanges&&!X.hasUnpushedCommits){await lt();return}if(X.hasChanges){g(!0);return}if(X.prExists&&X.prState===`OPEN`&&!X.hasChanges&&!X.hasUnpushedCommits){X.prUrl&&await ee(X.prUrl);return}if(X.commitsAheadOfDefault&&!X.prExists&&!X.hasChanges){v(!0);return}if(X.hasUnpushedCommits&&X.prExists){await rt();return}}async function tt(){let e=await Z.generateCommitMessageWithAI();e&&le(e)}async function nt(){if(I(t))try{u(!0),await ye(t),await X.fetchUnifiedStatus()}catch(e){console.error(`Failed to fetch:`,e)}finally{u(!1)}}async function rt(){if(I(t))try{u(!0),await a(t),await X.fetchUnifiedStatus(!0),Q(),X.hasRemoteBranch?T({title:`Branch pushed successfully`,description:`Your branch '${X.currentBranch}' has been pushed to the remote.`}):T({title:`Push completed`,description:`Changes have been pushed successfully.`})}catch(e){console.error(`Failed to push:`,e),T({title:`Push failed`,description:e instanceof Error?e.message:`Failed to push to remote`,variant:`destructive`})}finally{u(!1)}}async function it(){if(I(t)){if(X.hasChanges){We(!0);return}await at()}}async function at(){try{u(!0),await h(t),await X.fetchUnifiedStatus(!0),Q(),T({title:`Pull successful`,description:`Latest changes have been pulled from remote.`})}catch(e){console.error(`Failed to pull:`,e),T({title:`Pull failed`,description:e instanceof Error?e.message:`Failed to pull from remote`,variant:`destructive`})}finally{u(!1)}}function ot(){We(!1),Ke(!0),g(!0)}async function st(){We(!1),await at()}async function ct(){if(t)try{u(!0);let e=await f(t);te();let n=await ie();i({type:k.SetProjects,projects:n.projects}),T({title:`New branch created`,description:`Created new branch "${e.branchName}" on current thread`}),Je(!1),await X.fetchUnifiedStatus(!0),setTimeout(()=>void X.fetchUnifiedStatus(!0),1500)}catch(e){console.error(`Failed to create new branch:`,e),T({title:`Failed to create new branch`,description:e instanceof Error?e.message:`Unknown error occurred`,variant:`destructive`})}finally{u(!1)}}async function lt(){if(I(t))try{u(!0),await ae(t),await X.fetchUnifiedStatus(!0),Q(),T({title:`Branch synced successfully`,description:`Your branch '${X.currentBranch}' has been synced with the latest changes`})}catch(e){console.error(`[sync] ✗ Failed to sync branch:`,e),T({title:`Sync failed`,description:e instanceof Error?e.message:`Failed to sync with default branch`,variant:`destructive`})}finally{u(!1)}}async function ut(){if(I(t))try{u(!0),p(!0);let e=await re(t,pe,he);e.prUrl&&await ee(e.prUrl),b(``),x(``),v(!1),await X.fetchUnifiedStatus(!0),Q();let n=0,r=setInterval(async()=>{if(n++,n>=6){clearInterval(r);return}await X.fetchUnifiedStatus(!0)},2e3)}catch(e){console.error(`Failed to create PR:`,e);let t=e instanceof Error?e.message:`Failed to create PR`;t.includes(`push the current branch`)||t.includes(`--head flag`)?(v(!1),pt({title:pe,description:he})):(p(!1),T({title:`Create PR Failed`,description:t,variant:`destructive`}))}finally{u(!1)}}async function dt(){if(I(t))try{u(!0);let e=await r(t,Fe,Le,$.privateRepositoryDefault);e.repoUrl&&setTimeout(()=>{ee(e.repoUrl)},3e3),Ie(``),Re(``),Pe(!1),await X.fetchUnifiedStatus(),Q()}catch(e){console.error(`Failed to create repo:`,e)}finally{u(!1)}}async function ft(){let e=await Z.generatePRInfoWithAI();e&&(b(e.title),x(e.description),T({title:`Success`,description:`PR title and description generated`}))}async function pt(e){let n=e??ve;if(!(!t||!n))try{u(!0),p(!0);try{await a(t)}catch(e){let n=e?.message??``;if(n.includes(`non-fast-forward`)||n.includes(`Updates were rejected because the tip of your current branch is behind`)){T({title:`Syncing branch before push`,description:`Your branch is behind remote. Pulling latest changes first...`});try{await ae(t),await a(t)}catch{throw e}}else throw e}let e=await re(t,n.title,n.description);e.prUrl&&await ee(e.prUrl),b(``),x(``),C(null),S(!1),await X.fetchUnifiedStatus(!0),Q();let r=0,i=setInterval(async()=>{if(r++,r>=6){clearInterval(i);return}await X.fetchUnifiedStatus(!0)},2e3)}catch(e){console.error(`Failed to push and create PR:`,e);let t=e instanceof Error?e.message:`Failed to push and create PR`;p(!1),T({title:`Push & Create PR Failed`,description:t,variant:`destructive`})}finally{u(!1)}}async function mt(){if(I(t))try{W(!0);let e=await oe(t,100);Me(e),K(e.slice(0,10)),Ee(!0)}catch(e){console.error(`Failed to fetch git history:`,e)}finally{W(!1)}}function ht(){q||(J(!0),setTimeout(()=>{let e=G.length+10;K(L.slice(0,e)),J(!1)},300))}function gt(e){let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<100&&G.length<L.length&&!q&&ht()}let _t=P(X);function vt(){X.repoUrl&&ee(X.repoUrl)}function yt(){S(!1),C(null)}function bt(){Je(!1),X.fetchUnifiedStatus(!0)}return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:ue(`flex items-center gap-0`,n===`menu`&&`w-full flex-col gap-1 [&_button]:w-full [&_button]:justify-start`),children:[(0,j.jsx)(fe,{children:(0,j.jsxs)(se,{children:[(0,j.jsx)(de,{asChild:!0,children:(0,j.jsxs)(me,{variant:`outline`,size:`sm`,className:ue(`h-8 gap-1.5`,n===`bar`&&`rounded-r-none border-r-0`,n===`menu`&&`rounded-md border`,_t&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`),disabled:N(X,l,d),onClick:et,children:[M(X,d),we(X,d)]})}),(0,j.jsx)(ce,{children:Te(X)})]})}),(0,j.jsx)(De,{branchStatus:X.status,remoteUrl:X.remoteUrl,hasRemoteBranch:X.hasRemoteBranch,hasUnpushedCommits:X.hasUnpushedCommits,canCreateRepo:X.canCreateRepo,repoUrl:X.repoUrl,isRefreshing:X.isRefreshing,isBrandState:_t,gitUser:ze,isDirectCommitMode:Ze,isLoading:l||d,isLoadingHistory:Ne,onFetch:()=>void nt(),onPull:()=>void it(),onPush:()=>void rt(),onOpenHistory:()=>void mt(),onCreatePR:()=>v(!0),onCreateRepo:()=>Pe(!0),onViewInGitHub:vt,onOpenChange:e=>{e&&(Qe(),Ye(!0))},layout:n})]}),m&&(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(U,{}),children:(0,j.jsx)(z,{open:m,onOpenChange:g,commitMessage:y,onCommitMessageChange:le,autoGenerateCommitMessage:$.autoGenerateCommitMessage,onAutoGenerateChange:e=>Xe(t=>({...t,autoGenerateCommitMessage:e})),isGeneratingMessage:Z.isGeneratingMessage,isLoading:l,onGenerateMessage:tt,onCommit:$e,currentBranch:X.currentBranch})}),_&&(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(U,{}),children:(0,j.jsx)(B,{open:_,onOpenChange:v,prTitle:pe,onPrTitleChange:b,prDescription:he,onPrDescriptionChange:x,isGeneratingPRInfo:Z.isGeneratingPRInfo,isLoading:l,onGeneratePRInfo:ft,onCreatePR:ut,currentBranch:X.currentBranch,autoGeneratePRInfo:$.autoGeneratePRInfo,onAutoGeneratePRInfoChange:e=>Xe(t=>({...t,autoGeneratePRInfo:e}))})}),_e&&(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(U,{}),children:(0,j.jsx)(V,{open:_e,onOpenChange:S,isLoading:l,onPushAndCreatePR:pt,onCancel:yt})}),Y&&(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(U,{}),children:(0,j.jsx)(ke,{open:Y,onOpenChange:Pe,repoName:Fe,onRepoNameChange:Ie,repoDescription:Le,onRepoDescriptionChange:Re,isPrivateRepo:$.privateRepositoryDefault,onPrivateRepoChange:e=>Xe(t=>({...t,privateRepositoryDefault:e})),isLoading:l,onCreateRepo:dt})}),Ce&&(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(U,{}),children:(0,j.jsx)(Ae,{open:Ce,onOpenChange:Ee,commits:L,displayedCommits:G,isLoadingMore:q,onScroll:gt,currentBranch:X.currentBranch})}),Ue&&(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(U,{}),children:(0,j.jsx)(je,{open:Ue,onOpenChange:We,onCommitFirst:ot,onStashAndPull:st,onCancel:()=>We(!1),isLoading:l})}),qe&&(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(U,{}),children:(0,j.jsx)(H,{open:qe,onOpenChange:Je,onNewBranch:ct,onJustOpen:bt,isLoading:l})})]})}export{Me as GitOpsButton};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as n,Br as r,Ci as i,Fi as a,Fr as o,Hi as s,Hr as c,Ir as l,Kr as u,Lr as d,Mi as f,Mr as p,Nr as m,Pr as h,Qr as g,Rr as _,Si as v,Ur as y,Vr as b,Wr as x,Xa as S,Yr as C,Zr as w,_ as T,_o as E,_r as D,ai as O,ao as k,br as A,c as ee,ci as j,co as M,dr as N,ei as P,fr as te,hr as F,ii as I,io as L,l as R,li as z,mr as ne,ni as re,oi as B,oo as ie,pr as ae,qr as oe,ri as se,rt as ce,s as le,si as ue,so as de,ti as fe,u as pe,vo as me,vr as he,wa as ge,xr as _e,yo as ve,yr as ye,zr as be}from"./dialogs-config-I0_cSU2z.js";var V=E(),H=e(ve(),1),U=n(),xe=`AlertDialog`,[Se,Ce]=O(xe,[b]),W=b(),we=e=>{let{__scopeAlertDialog:t,...n}=e,r=W(t);return(0,U.jsx)(d,{...r,...n,modal:!0})};we.displayName=xe;var Te=`AlertDialogTrigger`,Ee=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=W(n);return(0,U.jsx)(be,{...i,...r,ref:t})});Ee.displayName=Te;var De=`AlertDialogPortal`,Oe=e=>{let{__scopeAlertDialog:t,...n}=e,r=W(t);return(0,U.jsx)(l,{...r,...n})};Oe.displayName=De;var ke=`AlertDialogOverlay`,Ae=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=W(n);return(0,U.jsx)(o,{...i,...r,ref:t})});Ae.displayName=ke;var je=`AlertDialogContent`,[Me,Ne]=Se(je),Pe=fe(`AlertDialogContent`),Fe=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:i,...a}=e,o=W(n),s=H.useRef(null),c=f(t,s),l=H.useRef(null);return(0,U.jsx)(r,{contentName:je,titleName:Ie,docsSlug:`alert-dialog`,children:(0,U.jsx)(Me,{scope:n,cancelRef:l,children:(0,U.jsxs)(m,{role:`alertdialog`,...o,...a,ref:c,onOpenAutoFocus:B(a.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,U.jsx)(Pe,{children:i}),(0,U.jsx)(We,{contentRef:s})]})})})});Fe.displayName=je;var Ie=`AlertDialogTitle`,Le=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=W(n);return(0,U.jsx)(_,{...i,...r,ref:t})});Le.displayName=Ie;var Re=`AlertDialogDescription`,ze=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=W(n);return(0,U.jsx)(h,{...i,...r,ref:t})});ze.displayName=Re;var Be=`AlertDialogAction`,Ve=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=W(n);return(0,U.jsx)(p,{...i,...r,ref:t})});Ve.displayName=Be;var He=`AlertDialogCancel`,Ue=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Ne(He,n),a=W(n),o=f(t,i);return(0,U.jsx)(p,{...a,...r,ref:o})});Ue.displayName=He;var We=({contentRef:e})=>{let t=`\`${je}\` requires a description for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
You can add a description to the \`${je}\` by passing a \`${Re}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
|
-
|
|
5
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${je}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
6
|
-
|
|
7
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return H.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Ge=we,Ke=Oe,qe=Ae,Je=Fe,Ye=Ve,Xe=Ue,Ze=Le,Qe=ze,$e=Ge,et=Ke,tt=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(qe,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});tt.displayName=qe.displayName;var nt=H.forwardRef((e,t)=>{let n=(0,V.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,U.jsx)(tt,{}),n[3]=a):a=n[3];let o;n[4]===r?o=n[5]:(o=z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==t||n[8]!==o?(s=(0,U.jsxs)(et,{children:[a,(0,U.jsx)(Je,{ref:t,className:o,...i})]}),n[6]=i,n[7]=t,n[8]=o,n[9]=s):s=n[9],s});nt.displayName=Je.displayName;var rt=e=>{let t=(0,V.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`flex flex-col space-y-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,U.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};rt.displayName=`AlertDialogHeader`;var it=e=>{let t=(0,V.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,U.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};it.displayName=`AlertDialogFooter`;var at=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=z(i.dialogTitle,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(Ze,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});at.displayName=Ze.displayName;var ot=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=z(i.dialogDescription,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(Qe,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});ot.displayName=Qe.displayName;var st=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(j(),r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(Ye,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});st.displayName=Ye.displayName;var ct=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(j({variant:`outline`}),`mt-2 sm:mt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(Xe,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ct.displayName=Xe.displayName;function lt(e){let t=(0,V.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=z(v.settingsPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,U.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ut(e){let t=(0,V.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=z(v.accountPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,U.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function dt(e){let t=(0,V.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=z(v.formPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,U.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ft(e){let t=(0,V.c)(16),{title:n,description:r,action:a,className:o,titleClassName:s}=e,c;t[0]===o?c=t[1]:(c=z(`flex items-center justify-between mb-6`,o),t[0]=o,t[1]=c);let l;t[2]===s?l=t[3]:(l=z(i.pageTitle,s),t[2]=s,t[3]=l);let u;t[4]!==l||t[5]!==n?(u=(0,U.jsx)(`h1`,{className:l,children:n}),t[4]=l,t[5]=n,t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=r?(0,U.jsx)(`p`,{className:i.pageSubtitle,children:r}):null,t[7]=r,t[8]=d);let f;t[9]!==u||t[10]!==d?(f=(0,U.jsxs)(`div`,{children:[u,d]}),t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==a||t[13]!==c||t[14]!==f?(p=(0,U.jsxs)(`div`,{className:c,children:[f,a]}),t[12]=a,t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function pt(e){let t=(0,V.c)(5),{title:n,className:r}=e,a;t[0]===r?a=t[1]:(a=z(i.sectionTitle,`mb-3`,r),t[0]=r,t[1]=a);let o;return t[2]!==a||t[3]!==n?(o=(0,U.jsx)(`h2`,{className:a,children:n}),t[2]=a,t[3]=n,t[4]=o):o=t[4],o}function mt(e){let t=(0,V.c)(6),{children:n,variant:r,className:a}=e,o=r===void 0?`info`:r,s;t[0]!==a||t[1]!==o?(s=z(o===`hint`?i.hintBanner:o===`success`?z(i.body,`text-green-700 bg-green-50 dark:text-green-400 dark:bg-green-950/30 rounded-md px-3 py-2 mb-4`):o===`error`?z(i.error,`bg-destructive/10 rounded-md px-3 py-2 mb-4`):i.infoBanner,a),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;return t[3]!==n||t[4]!==s?(c=(0,U.jsx)(`div`,{className:s,children:n}),t[3]=n,t[4]=s,t[5]=c):c=t[5],c}function ht(e){let t=(0,V.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=z(`flex-1 overflow-auto`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,U.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function gt(e){let t=(0,V.c)(10),{children:n,title:r,action:a}=e,o;t[0]===r?o=t[1]:(o=r?(0,U.jsx)(`h2`,{className:z(i.emptyStateTitle,`mb-2`),children:r}):null,t[0]=r,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,U.jsx)(`p`,{className:i.bodyMuted,children:n}),t[2]=n,t[3]=s);let c;t[4]===a?c=t[5]:(c=a?(0,U.jsx)(`div`,{className:`mt-4`,children:a}):null,t[4]=a,t[5]=c);let l;return t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,U.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,U.jsxs)(`div`,{className:`text-center`,children:[o,s,c]})}),t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function _t(e){let t=(0,V.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=z(`h-full flex flex-col overflow-hidden`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,U.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function vt(e){let t=(0,V.c)(14),{title:n,description:r,action:a,children:o,className:s}=e,c;t[0]===n?c=t[1]:(c=(0,U.jsx)(pt,{title:n,className:`mb-1`}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=r?(0,U.jsx)(`p`,{className:i.bodyMuted,children:r}):null,t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==a||t[8]!==u?(d=(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[u,a]}),t[7]=a,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==o||t[11]!==s||t[12]!==d?(f=(0,U.jsxs)(`div`,{className:s,children:[d,o]}),t[10]=o,t[11]=s,t[12]=d,t[13]=f):f=t[13],f}var yt=e(me(),1);function bt(e){let t=H.useRef({value:e,previous:e});return H.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xt=[` `,`Enter`,`ArrowUp`,`ArrowDown`],St=[` `,`Enter`],G=`Select`,[Ct,wt,Tt]=le(G),[K,Et]=O(G,[Tt,_e]),Dt=_e(),[Ot,q]=K(G),[kt,At]=K(G),jt=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=Dt(t),[g,_]=H.useState(null),[v,y]=H.useState(null),[b,x]=H.useState(!1),S=pe(l),[C,w]=re({prop:r,defaultProp:i??!1,onChange:a,caller:G}),[T,E]=re({prop:o,defaultProp:s,onChange:c,caller:G}),D=H.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,ee]=H.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,U.jsx)(A,{...h,children:(0,U.jsxs)(Ot,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:se(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,U.jsx)(Ct.Provider,{scope:t,children:(0,U.jsx)(kt,{scope:e.__scopeSelect,onNativeOptionAdd:H.useCallback(e=>{ee(t=>new Set(t).add(e))},[]),onNativeOptionRemove:H.useCallback(e=>{ee(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,U.jsxs)(wn,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,U.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};jt.displayName=G;var Mt=`SelectTrigger`,Nt=H.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Dt(n),o=q(Mt,n),s=o.disabled||r,c=f(t,o.onTriggerChange),l=wt(n),u=H.useRef(`touch`),[d,p,m]=En(e=>{let t=l().filter(e=>!e.disabled),n=Dn(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),h=e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,U.jsx)(D,{asChild:!0,...a,children:(0,U.jsx)(g.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Tn(o.value)?``:void 0,...i,ref:c,onClick:B(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&h(e)}),onPointerDown:B(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:B(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&xt.includes(e.key)&&(h(),e.preventDefault())})})})});Nt.displayName=Mt;var Pt=`SelectValue`,Ft=H.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=q(Pt,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=f(t,c.onValueNodeChange);return I(()=>{l(u)},[l,u]),(0,U.jsx)(g.span,{...s,ref:d,style:{pointerEvents:`none`},children:Tn(c.value)?(0,U.jsx)(U.Fragment,{children:o}):a})});Ft.displayName=Pt;var It=`SelectIcon`,Lt=H.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,U.jsx)(g.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Lt.displayName=It;var Rt=`SelectPortal`,zt=e=>(0,U.jsx)(u,{asChild:!0,...e});zt.displayName=Rt;var J=`SelectContent`,Bt=H.forwardRef((e,t)=>{let n=q(J,e.__scopeSelect),[r,i]=H.useState();if(I(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?yt.createPortal((0,U.jsx)(Vt,{scope:e.__scopeSelect,children:(0,U.jsx)(Ct.Slot,{scope:e.__scopeSelect,children:(0,U.jsx)(`div`,{children:e.children})})}),t):null}return(0,U.jsx)(Wt,{...e,ref:t})});Bt.displayName=J;var Y=10,[Vt,X]=K(J),Ht=`SelectContentImpl`,Ut=P(`SelectContent.RemoveScroll`),Wt=H.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...b}=e,S=q(J,n),[w,T]=H.useState(null),[E,D]=H.useState(null),O=f(t,e=>T(e)),[k,A]=H.useState(null),[ee,j]=H.useState(null),M=wt(n),[N,P]=H.useState(!1),te=H.useRef(!1);H.useEffect(()=>{if(w)return c(w)},[w]),x();let F=H.useCallback(e=>{let[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,E]),I=H.useCallback(()=>F([k,w]),[F,k,w]);H.useEffect(()=>{N&&I()},[N,I]);let{onOpenChange:L,triggerPointerDownPosRef:R}=S;H.useEffect(()=>{if(w){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener(`pointermove`,t),R.current=null};return R.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[w,L,R]),H.useEffect(()=>{let e=()=>L(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[L]);let[z,ne]=En(e=>{let t=M().filter(e=>!e.disabled),n=Dn(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),re=H.useCallback((e,t,n)=>{let r=!te.current&&!n;(S.value!==void 0&&S.value===t||r)&&(A(e),r&&(te.current=!0))},[S.value]),ie=H.useCallback(()=>w?.focus(),[w]),ae=H.useCallback((e,t,n)=>{let r=!te.current&&!n;(S.value!==void 0&&S.value===t||r)&&j(e)},[S.value]),se=r===`popper`?Jt:Kt,ce=se===Jt?{side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,U.jsx)(Vt,{scope:n,content:w,viewport:E,onViewportChange:D,itemRefCallback:re,selectedItem:k,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:I,selectedItemText:ee,position:r,isPositioned:N,searchRef:z,children:(0,U.jsx)(y,{as:Ut,allowPinchZoom:!0,children:(0,U.jsx)(oe,{asChild:!0,trapped:S.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:B(i,e=>{S.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,U.jsx)(C,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:(0,U.jsx)(se,{role:`listbox`,id:S.contentId,"data-state":S.open?`open`:`closed`,dir:S.dir,onContextMenu:e=>e.preventDefault(),...b,...ce,onPlaced:()=>P(!0),ref:O,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:B(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});Wt.displayName=Ht;var Gt=`SelectItemAlignedPosition`,Kt=H.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=q(J,n),o=X(J,n),[s,c]=H.useState(null),[l,u]=H.useState(null),d=f(t,e=>u(e)),p=wt(n),m=H.useRef(!1),h=H.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=H.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=R(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=R(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-Y*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+h+k,ee=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+ee;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${Y}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);I(()=>x(),[x]);let[S,C]=H.useState();return I(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]),(0,U.jsx)(Yt,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:H.useCallback(e=>{e&&h.current===!0&&(x(),b?.(),h.current=!1)},[x,b]),children:(0,U.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,U.jsx)(g.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Kt.displayName=Gt;var qt=`SelectPopperPosition`,Jt=H.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=Dt(n);return(0,U.jsx)(ye,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Jt.displayName=qt;var[Yt,Xt]=K(J,{}),Zt=`SelectViewport`,Qt=H.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=X(Zt,n),o=Xt(Zt,n),s=f(t,a.onViewportChange),c=H.useRef(0);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,U.jsx)(Ct.Slot,{scope:n,children:(0,U.jsx)(g.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:B(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Qt.displayName=Zt;var $t=`SelectGroup`,[en,tn]=K($t),nn=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=se();return(0,U.jsx)(en,{scope:n,id:i,children:(0,U.jsx)(g.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});nn.displayName=$t;var rn=`SelectLabel`,an=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=tn(rn,n);return(0,U.jsx)(g.div,{id:i.id,...r,ref:t})});an.displayName=rn;var on=`SelectItem`,[sn,cn]=K(on),ln=H.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=q(on,n),c=X(on,n),l=s.value===r,[u,d]=H.useState(a??``),[p,m]=H.useState(!1),h=f(t,e=>c.itemRefCallback?.(e,r,i)),_=se(),v=H.useRef(`touch`),y=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,U.jsx)(sn,{scope:n,value:r,disabled:i,textId:_,isSelected:l,onItemTextChange:H.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,U.jsx)(Ct.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,U.jsx)(g.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":l&&p,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:B(o.onFocus,()=>m(!0)),onBlur:B(o.onBlur,()=>m(!1)),onClick:B(o.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:B(o.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:B(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:B(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:B(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:B(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(St.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})});ln.displayName=on;var un=`SelectItemText`,dn=H.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=q(un,n),s=X(un,n),c=cn(un,n),l=At(un,n),[u,d]=H.useState(null),p=f(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=u?.textContent,h=H.useMemo(()=>(0,U.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=l;return I(()=>(_(h),()=>v(h)),[_,v,h]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(g.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?yt.createPortal(a.children,o.valueNode):null]})});dn.displayName=un;var fn=`SelectItemIndicator`,pn=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return cn(fn,n).isSelected?(0,U.jsx)(g.span,{"aria-hidden":!0,...r,ref:t}):null});pn.displayName=fn;var mn=`SelectScrollUpButton`,hn=H.forwardRef((e,t)=>{let n=X(mn,e.__scopeSelect),r=Xt(mn,e.__scopeSelect),[i,a]=H.useState(!1),o=f(t,r.onScrollButtonChange);return I(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,U.jsx)(vn,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});hn.displayName=mn;var gn=`SelectScrollDownButton`,_n=H.forwardRef((e,t)=>{let n=X(gn,e.__scopeSelect),r=Xt(gn,e.__scopeSelect),[i,a]=H.useState(!1),o=f(t,r.onScrollButtonChange);return I(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,U.jsx)(vn,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});_n.displayName=gn;var vn=H.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=H.useRef(null),s=wt(n),c=H.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return H.useEffect(()=>()=>c(),[c]),I(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,U.jsx)(g.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:B(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:B(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:B(i.onPointerLeave,()=>{c()})})}),yn=`SelectSeparator`,bn=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,U.jsx)(g.div,{"aria-hidden":!0,...r,ref:t})});bn.displayName=yn;var xn=`SelectArrow`,Sn=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Dt(n),a=q(xn,n),o=X(xn,n);return a.open&&o.position===`popper`?(0,U.jsx)(he,{...i,...r,ref:t}):null});Sn.displayName=xn;var Cn=`SelectBubbleInput`,wn=H.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=H.useRef(null),a=f(r,i),o=bt(t);return H.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,U.jsx)(g.select,{...n,style:{...F,...n.style},ref:a,defaultValue:t})});wn.displayName=Cn;function Tn(e){return e===``||e===void 0}function En(e){let t=w(e),n=H.useRef(``),r=H.useRef(0),i=H.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=H.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return H.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Dn(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=On(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function On(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kn=jt,An=Nt,jn=Ft,Mn=Lt,Nn=zt,Pn=Bt,Fn=Qt,In=an,Ln=ln,Rn=dn,zn=pn,Bn=hn,Vn=_n,Hn=bn,Un=kn,Wn=jn,Gn=H.forwardRef((e,t)=>{let n=(0,V.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=z(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(Mn,{asChild:!0,children:(0,U.jsx)(de,{className:`h-4 w-4 opacity-50`})}),n[6]=s):s=n[6];let c;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(c=(0,U.jsxs)(An,{ref:t,className:o,...a,children:[r,s]}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=c):c=n[11],c});Gn.displayName=An.displayName;var Kn=H.forwardRef((e,t)=>{let n=(0,V.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(L,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,U.jsx)(Bn,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});Kn.displayName=Bn.displayName;var qn=H.forwardRef((e,t)=>{let n=(0,V.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(de,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,U.jsx)(Vn,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});qn.displayName=Vn.displayName;var Jn=H.forwardRef((e,t)=>{let n=(0,V.c)(21),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,children:r,position:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`popper`:o,c=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,l;n[5]!==i||n[6]!==c?(l=z(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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`,c,i),n[5]=i,n[6]=c,n[7]=l):l=n[7];let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(Kn,{}),n[8]=u):u=n[8];let d=s===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`,f;n[9]===d?f=n[10]:(f=z(`p-1`,d),n[9]=d,n[10]=f);let p;n[11]!==r||n[12]!==f?(p=(0,U.jsx)(Fn,{className:f,children:r}),n[11]=r,n[12]=f,n[13]=p):p=n[13];let m;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,U.jsx)(qn,{}),n[14]=m):m=n[14];let h;return n[15]!==s||n[16]!==a||n[17]!==t||n[18]!==l||n[19]!==p?(h=(0,U.jsx)(Nn,{children:(0,U.jsxs)(Pn,{ref:t,className:l,position:s,...a,children:[u,p,m]})}),n[15]=s,n[16]=a,n[17]=t,n[18]=l,n[19]=p,n[20]=h):h=n[20],h});Jn.displayName=Pn.displayName;var Yn=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`py-1.5 pl-8 pr-2 text-base font-semibold`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(In,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Yn.displayName=In.displayName;var Xn=H.forwardRef((e,t)=>{let n=(0,V.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=z(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-base outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,U.jsx)(zn,{children:(0,U.jsx)(M,{className:`h-4 w-4`})})}),n[6]=s):s=n[6];let c;n[7]===r?c=n[8]:(c=(0,U.jsx)(Rn,{children:r}),n[7]=r,n[8]=c);let l;return n[9]!==a||n[10]!==t||n[11]!==o||n[12]!==c?(l=(0,U.jsxs)(Ln,{ref:t,className:o,...a,children:[s,c]}),n[9]=a,n[10]=t,n[11]=o,n[12]=c,n[13]=l):l=n[13],l});Xn.displayName=Ln.displayName;var Zn=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(Hn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Zn.displayName=Hn.displayName;function Qn(e){let t=(0,V.c)(14),{className:n,label:r,size:a}=e,o=a===void 0?`md`:a,s=o===`sm`?`h-4 w-4`:o===`lg`?`h-8 w-8`:`h-6 w-6`,c;t[0]===n?c=t[1]:(c=z(`flex h-full items-center justify-center`,n),t[0]=n,t[1]=c);let l;t[2]===s?l=t[3]:(l=z(s,`animate-spin mx-auto text-muted-foreground`),t[2]=s,t[3]=l);let u;t[4]===l?u=t[5]:(u=(0,U.jsx)(ge,{className:l}),t[4]=l,t[5]=u);let d;t[6]===r?d=t[7]:(d=r?(0,U.jsx)(`p`,{className:z(i.bodyMuted,`mt-2`),children:r}):null,t[6]=r,t[7]=d);let f;t[8]!==u||t[9]!==d?(f=(0,U.jsxs)(`div`,{className:`text-center`,children:[u,d]}),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;return t[11]!==c||t[12]!==f?(p=(0,U.jsx)(`div`,{className:c,children:f}),t[11]=c,t[12]=f,t[13]=p):p=t[13],p}function $n(){let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(`div`,{className:`space-y-1 px-2 py-2`,children:[1,2,3].map(er)}),e[0]=t):t=e[0],t}function er(e){return(0,U.jsx)(`div`,{className:`animate-pulse h-7 bg-muted rounded-full`},e)}function tr(){let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded mx-4 my-1`}),e[0]=t):t=e[0],t}var Z=new Map;function nr(e,t){let n=Z.get(e);return n||(n={promise:t().catch(t=>{throw Z.delete(e),t})},Z.set(e,n)),n.promise}function rr(e){Z.delete(e)}function ir(e){for(let t of Z.keys())t.startsWith(e)&&Z.delete(t)}function ar(e,t){return(0,H.use)(nr(e,t))}var or=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`rounded-lg border bg-card text-card-foreground shadow-sm`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});or.displayName=`Card`;var sr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`flex flex-col space-y-1.5 p-6`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});sr.displayName=`CardHeader`;var cr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=z(i.sectionTitle,`leading-none tracking-tight`,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(`div`,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});cr.displayName=`CardTitle`;var lr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=z(i.bodyMuted,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(`div`,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});lr.displayName=`CardDescription`;var ur=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ur.displayName=`CardContent`;var dr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`flex items-center p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});dr.displayName=`CardFooter`;var fr=class extends H.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`AsyncErrorBoundary caught an error:`,e,t)}handleRetry=()=>{this.setState({error:null}),this.props.onRetry?.()};render(){let{error:e}=this.state;return e?this.props.renderFallback?this.props.renderFallback(e,this.handleRetry):(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,U.jsxs)(or,{className:`max-w-md`,children:[(0,U.jsx)(sr,{children:(0,U.jsx)(cr,{className:`text-destructive`,children:this.props.fallbackTitle??`Something went wrong`})}),(0,U.jsxs)(ur,{className:`space-y-4`,children:[(0,U.jsx)(`p`,{className:i.body,children:e.message}),(0,U.jsx)(ue,{variant:`outline`,onClick:this.handleRetry,children:`Retry`})]})]})}):this.props.children}},pr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=z(`w-full caption-bottom`,i.body,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,U.jsx)(`table`,{ref:t,className:o,...a})}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});pr.displayName=`Table`;var mr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`[&_tr]:border-b`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`thead`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});mr.displayName=`TableHeader`;var hr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`[&_tr:last-child]:border-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`tbody`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});hr.displayName=`TableBody`;var gr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`tfoot`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});gr.displayName=`TableFooter`;var _r=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`tr`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});_r.displayName=`TableRow`;var Q=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`th`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Q.displayName=`TableHead`;var $=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=z(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,U.jsx)(`td`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});$.displayName=`TableCell`;var vr=H.forwardRef((e,t)=>{let n=(0,V.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=z(i.caption,`mt-4`,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(`caption`,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});vr.displayName=`TableCaption`;var yr=t({ConversationHistoryView:()=>Dr,default:()=>Dr}),br=`__ALL_PROJECTS__`;function xr(e){let t=(0,V.c)(8),{text:n,maxLength:r}=e,i=r===void 0?100:r;if(n.length<=i){let e;return t[0]===n?e=t[1]:(e=(0,U.jsx)(U.Fragment,{children:n}),t[0]=n,t[1]=e),e}let a;t[2]!==i||t[3]!==n?(a=n.substring(0,i),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(`span`,{className:`text-muted-foreground ml-2`,children:`...`}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,U.jsxs)(U.Fragment,{children:[a,o]}),t[6]=a,t[7]=s),s}function Sr(e,t){let n=`${t} - `,r=e.title??e.threadId;return r.startsWith(n)?r.slice(n.length):r}async function Cr(e){let t=[],n=new Set,r=``;for(let i of e)try{let e=await ce(i.threadId);e?.messages&&(t.push(...e.messages),e.conversationIds&&e.conversationIds.forEach(e=>n.add(e)),e.lastUpdated>r&&(r=e.lastUpdated))}catch(e){console.warn(`Failed to load history for thread ${i.threadId}:`,e)}return t.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()),{messages:t,conversationIds:Array.from(n),lastUpdated:r??new Date().toISOString()}}function wr(e,t){return e.type===`thread`?`conversation-history:thread:${e.threadId}:${t}`:e.type===`project`?`conversation-history:project:${e.projectId}:${t}`:`conversation-history:all:${t}`}async function Tr(e,t){if(e.type===`thread`)return await ce(e.threadId);if(e.type===`project`){let n=t.find(t=>t.projectId===e.projectId);if(!n||n.threads.length===0)return{threadId:e.projectId,messages:[],lastUpdated:new Date().toISOString(),conversationIds:[]};let r=await Cr(n.threads);return{threadId:e.projectId,...r}}return{threadId:br,...await Cr(t.flatMap(e=>e.threads))}}function Er(e){let t=(0,V.c)(45),{scope:n,projects:r,loadVersion:a,currentPromptIndex:o,onPromptIndexChange:s}=e,c;t[0]!==a||t[1]!==n?(c=wr(n,a),t[0]=a,t[1]=n,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==n?(l=()=>Tr(n,r),t[3]=r,t[4]=n,t[5]=l):l=t[5];let u=ar(c,l),d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=function(e){return new Date(e).toLocaleString()},t[6]=d):d=t[6];let f=d,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(e,t){let n=new Date(e),r=new Date(t).getTime()-n.getTime();if(r<0)return{display:`0:00`,tooltip:`0 seconds`};let i=Math.floor(r/1e3),a=Math.floor(i/60),o=i%60,s=`${a}:${o.toString().padStart(2,`0`)}`,c;return c=a===0?`${o} second${o===1?``:`s`}`:o===0?`${a} minute${a===1?``:`s`}`:`${a} minute${a===1?``:`s`} ${o} second${o===1?``:`s`}`,{display:s,tooltip:c}},t[7]=p):p=t[7];let m=p,h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=function(e){return{inputTokens:e.inputTokens??0,outputTokens:e.outputTokens??0}},t[8]=h):h=t[8];let g=h,_;t[9]!==o||t[10]!==u.messages||t[11]!==s?(_=function(){u.messages&&o<u.messages.length-1&&s(o+1)},t[9]=o,t[10]=u.messages,t[11]=s,t[12]=_):_=t[12];let v=_,y;t[13]!==o||t[14]!==s?(y=function(){o>0&&s(o-1)},t[13]=o,t[14]=s,t[15]=y):y=t[15];let b=y;if(!u.messages?.length){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,U.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,U.jsx)(`h3`,{className:i.emptyStateTitle,children:`No history`}),(0,U.jsx)(`p`,{className:i.bodyMuted,children:`No conversation history found for this thread.`})]})}),t[16]=e):e=t[16],e}let x=o===0,C;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,U.jsx)(ie,{className:`h-4 w-4 mr-1`}),t[17]=C):C=t[17];let w;t[18]!==b||t[19]!==x?(w=(0,U.jsx)(ue,{variant:`outline`,size:`sm`,onClick:b,disabled:x,children:C}),t[18]=b,t[19]=x,t[20]=w):w=t[20];let T=o>=u.messages.length-1,E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,U.jsx)(k,{className:`h-4 w-4 ml-1`}),t[21]=E):E=t[21];let D;t[22]!==v||t[23]!==T?(D=(0,U.jsx)(ue,{variant:`outline`,size:`sm`,onClick:v,disabled:T,children:E}),t[22]=v,t[23]=T,t[24]=D):D=t[24];let O;t[25]!==w||t[26]!==D?(O=(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w,D]}),t[25]=w,t[26]=D,t[27]=O):O=t[27];let A=o+1,j;t[28]!==u.messages.length||t[29]!==A?(j=(0,U.jsxs)(`div`,{className:i.bodyMuted,children:[A,` of `,u.messages.length,` messages`]}),t[28]=u.messages.length,t[29]=A,t[30]=j):j=t[30];let M;t[31]!==O||t[32]!==j?(M=(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b py-3 px-0`,children:[O,j]}),t[31]=O,t[32]=j,t[33]=M):M=t[33];let P;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,U.jsx)(mr,{children:(0,U.jsxs)(_r,{children:[(0,U.jsx)(Q,{children:`Prompt`}),(0,U.jsx)(Q,{children:`Answer`}),(0,U.jsx)(Q,{className:`w-24`,children:`Model`}),(0,U.jsx)(Q,{className:`w-24 text-right`,children:`Duration`}),(0,U.jsx)(Q,{className:`w-20 text-right`,children:`Input Tokens`}),(0,U.jsx)(Q,{className:`w-20 text-right`,children:`Output Tokens`}),(0,U.jsx)(Q,{className:`w-32 text-right`,children:`Timestamp`})]})}),t[34]=P):P=t[34];let F;if(t[35]!==o||t[36]!==u.messages){let e;t[38]===o?e=t[39]:(e=(e,t)=>{let{inputTokens:n,outputTokens:r}=g(e);return(0,U.jsxs)(_r,{className:t===o?`bg-muted/50`:``,children:[(0,U.jsx)($,{className:`max-w-md`,children:(0,U.jsx)(`div`,{className:i.body,children:(0,U.jsx)(xr,{text:e.request.message})})}),(0,U.jsx)($,{className:`max-w-md`,children:e.response?(0,U.jsx)(`div`,{className:i.body,children:(0,U.jsx)(xr,{text:e.response.content})}):(0,U.jsx)(`span`,{className:z(i.bodyMuted,`italic`),children:`No response`})}),(0,U.jsx)($,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(S,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e.request.model})]})}),(0,U.jsx)($,{className:z(i.caption,`text-right`),children:e.response?(0,U.jsx)(ae,{children:(0,U.jsxs)(N,{children:[(0,U.jsx)(ne,{asChild:!0,children:(0,U.jsx)(`div`,{className:`cursor-help`,children:m(e.timestamp,e.response.completedAt).display})}),(0,U.jsx)(te,{children:(0,U.jsx)(`p`,{children:m(e.timestamp,e.response.completedAt).tooltip})})]})}):(0,U.jsx)(`span`,{className:`text-muted-foreground italic`,children:`-`})}),(0,U.jsx)($,{className:z(i.bodyMuted,`text-right`),children:n>0?n.toLocaleString():`-`}),(0,U.jsx)($,{className:z(i.bodyMuted,`text-right`),children:r>0?r.toLocaleString():`-`}),(0,U.jsx)($,{className:z(i.bodyMuted,`text-right`),children:f(e.timestamp)})]},e.id)},t[38]=o,t[39]=e),F=u.messages.map(e),t[35]=o,t[36]=u.messages,t[37]=F}else F=t[37];let I;t[40]===F?I=t[41]:(I=(0,U.jsx)(ee,{className:`h-full`,children:(0,U.jsx)(`div`,{className:`py-4`,children:(0,U.jsxs)(pr,{children:[P,(0,U.jsx)(hr,{children:F})]})})}),t[40]=F,t[41]=I);let L;return t[42]!==M||t[43]!==I?(L=(0,U.jsxs)(U.Fragment,{children:[M,I]}),t[42]=M,t[43]=I,t[44]=L):L=t[44],L}var Dr=(0,H.memo)(function({isOpen:e,onClose:t,initialFilter:n,projects:r,inline:o}){let[c,l]=(0,H.useState)(0),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(``),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(!1),[v,y]=(0,H.useState)(0),[b,x]=(0,H.useState)(null),[S,C]=(0,H.useState)(null),w=(0,H.useMemo)(()=>f?{type:`thread`,threadId:f}:u===br?{type:`all`}:u?{type:`project`,projectId:u}:null,[u,f]),E=w?wr(w,v):null;(0,H.useEffect)(()=>{e&&n?n.type===`thread`?(p(n.id),d(``),l(0)):n.type===`project`&&(d(n.id),p(``),l(0)):e&&!n?(d(br),p(``),l(0)):e||(p(``),d(``),l(0),C(null),x(null))},[e,n]);let D=e=>{p(e),d(``),l(0),x(null),C(null)},O=e=>{d(e),p(``),l(0),x(null),C(null)},k=(0,H.useCallback)(()=>{if(f){let e=r.flatMap(e=>e.threads).find(e=>e.threadId===f),t=r.find(e=>e.threads.some(e=>e.threadId===f)),n=e?Sr(e,t?.name??t?.projectId??``):f;return{options:{threadId:f},title:`Clear Thread History`,description:`Permanently delete all conversation history for "${n}"? This cannot be undone.`}}if(u&&u!==br){let e=r.find(e=>e.projectId===u)?.name??u;return{options:{projectId:u},title:`Clear Project History`,description:`Permanently delete all conversation history for "${e}"? This cannot be undone.`}}return{options:void 0,title:`Clear All History`,description:`Permanently delete all conversation history across every project and thread? This cannot be undone.`}},[r,u,f]),A=(0,H.useCallback)(async()=>{let e=k();_(!0),C(null);try{await T(e.options),E&&rr(E),x(E),l(0),h(!1)}catch(e){C(e instanceof Error?e.message:`Failed to clear conversation history`)}finally{_(!1)}},[k,E]);function ee(){w&&rr(wr(w,v)),y(e=>e+1),x(null),C(null)}let j=k();if(!e)return null;let M=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Un,{value:u,onValueChange:O,children:[(0,U.jsx)(Gn,{className:`w-48`,children:(0,U.jsx)(Wn,{placeholder:`Select project`})}),(0,U.jsxs)(Jn,{children:[(0,U.jsx)(Xn,{value:br,children:`All Projects`}),r.map(e=>(0,U.jsx)(Xn,{value:e.projectId,children:e.name??e.projectId},e.projectId))]})]}),(0,U.jsxs)(Un,{value:f,onValueChange:D,children:[(0,U.jsx)(Gn,{className:`w-48`,children:(0,U.jsx)(Wn,{placeholder:`Select thread`})}),(0,U.jsx)(Jn,{children:r.flatMap(e=>e.threads.map(t=>(0,U.jsx)(Xn,{value:t.threadId,children:Sr(t,e.name??e.projectId)},t.threadId)))})]}),(0,U.jsxs)(ue,{variant:`outline`,size:`sm`,onClick:()=>h(!0),disabled:g,children:[(0,U.jsx)(s,{className:`h-4 w-4 mr-2`}),`Clear`]})]}),N=(0,U.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,U.jsx)(`div`,{className:o?void 0:`border-b px-6 py-4`,children:(0,U.jsx)(ft,{title:`History`,description:o?`View and browse conversation history across projects and threads.`:void 0,action:(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[M,o?null:(0,U.jsx)(ue,{variant:`action`,size:`icon-sm`,onClick:t,children:(0,U.jsx)(a,{})})]})})}),(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:S?(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,U.jsxs)(or,{className:`max-w-md`,children:[(0,U.jsx)(sr,{children:(0,U.jsx)(cr,{className:`text-destructive`,children:`Error`})}),(0,U.jsxs)(ur,{className:`space-y-4`,children:[(0,U.jsx)(`p`,{children:S}),(0,U.jsx)(ue,{onClick:()=>C(null),children:`Dismiss`})]})]})}):b&&b===E?(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,U.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,U.jsx)(`h3`,{className:i.emptyStateTitle,children:`No history`}),(0,U.jsx)(`p`,{className:i.bodyMuted,children:`No conversation history found for this thread.`})]})}):w?(0,U.jsx)(fr,{fallbackTitle:`Failed to load conversation history`,onRetry:ee,children:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(Qn,{label:`Loading conversation history...`,size:`lg`}),children:(0,U.jsx)(Er,{scope:w,projects:r,loadVersion:v,currentPromptIndex:c,onPromptIndexChange:l},E??void 0)})}):(0,U.jsx)(Qn,{label:`Loading conversation history...`,size:`lg`})})]});return(0,U.jsxs)(U.Fragment,{children:[o?(0,U.jsx)(ht,{children:(0,U.jsx)(lt,{className:`max-w-none w-full h-full flex flex-col min-h-0`,children:N})}):(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background`,children:N}),(0,U.jsx)($e,{open:m,onOpenChange:h,children:(0,U.jsxs)(nt,{children:[(0,U.jsxs)(rt,{children:[(0,U.jsx)(at,{children:j.title}),(0,U.jsx)(ot,{children:j.description})]}),(0,U.jsxs)(it,{children:[(0,U.jsx)(ct,{disabled:g,children:`Cancel`}),(0,U.jsx)(st,{onClick:e=>{e.preventDefault(),A()},disabled:g,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:g?`Clearing...`:`Clear`})]})]})})]})});export{ct as A,pt as C,ht as D,lt as E,at as F,ot as M,it as N,$e as O,rt as P,ft as S,gt as T,bt as _,ar as a,vt as b,tr as c,Un as d,Jn as f,Wn as g,Gn as h,ur as i,nt as j,st as k,Qn as l,Zn as m,fr as n,rr as o,Xn as p,or as r,ir as s,yr as t,$n as u,ut as v,_t as w,mt as x,dt as y};
|