tarsk 0.5.59 → 0.5.61
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 +33807 -17461
- package/dist/public/assets/account-view-DUydvr5r.js +1 -0
- package/dist/public/assets/api-Bx3qG-84.js +1 -0
- package/dist/public/assets/async-error-boundary-CGXO1iOm.js +1 -0
- package/dist/public/assets/browser-tab-DJyMA4n2.js +8 -0
- package/dist/public/assets/card-DueeH7Ho.js +1 -0
- package/dist/public/assets/commit-dialog-BXKzr2Vp.js +1 -0
- package/dist/public/assets/commit-method-fields-CLryb6U0.js +1 -0
- package/dist/public/assets/context-menu-D-TmtGey.js +1 -0
- package/dist/public/assets/create-project-dialog--truH-BC.js +6 -0
- package/dist/public/assets/create-repo-dialog-8ZeXEZJO.js +1 -0
- package/dist/public/assets/diff-view-CY0z2YXM.js +4 -0
- package/dist/public/assets/editor.worker-Cn2oRESe.js +26 -0
- package/dist/public/assets/explorer-tab-context-D6TtM23Z.js +1 -0
- package/dist/public/assets/explorer-tab-view-C-_bGI_B.js +2 -0
- package/dist/public/assets/explorer-tree-_4KO_6Ms.js +1 -0
- package/dist/public/assets/explorer-view-CWM5299Z.js +75 -0
- package/dist/public/assets/git-history-dialog-C3CiYKAa.js +1 -0
- package/dist/public/assets/git-ops-button-Bh7oa-6K.js +2 -0
- package/dist/public/assets/history-view-BfMYJF7S.js +63 -0
- package/dist/public/assets/index-CjF8Ycpv.js +3306 -0
- package/dist/public/assets/index-CmmUTvZV.css +1 -0
- package/dist/public/assets/interactive-BpXvXOVa.js +20 -0
- package/dist/public/assets/is-macos-client-BIb4ZSEa.js +1 -0
- package/dist/public/assets/mcp-server-card-b4garp8Y.js +1 -0
- package/dist/public/assets/merged-pr-dialog-BRtZav8e.js +1 -0
- package/dist/public/assets/model-list-controls-4mhkdZIT.js +1 -0
- package/dist/public/assets/monaco-BQve5vfS.css +1 -0
- package/dist/public/assets/{monaco-CMkNoWsM.js → monaco-DmAs9OAa.js} +192 -190
- package/dist/public/assets/monaco-setup-B-a4Z1e-.js +1 -0
- package/dist/public/assets/onboarding-BoaQkHLd.js +1 -0
- package/dist/public/assets/project-env-vars-view-0vg67W7H.js +1 -0
- package/dist/public/assets/project-model-aliases-view-C9nZgC6K.js +1 -0
- package/dist/public/assets/project-settings-view-BmnCqFHi.js +1 -0
- package/dist/public/assets/project-tools-view-CjWD0LWo.js +1 -0
- package/dist/public/assets/providers-list-view-Cu-XaQ0J.js +1 -0
- package/dist/public/assets/pull-request-dialog-B_SO17C0.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-bfGiMljP.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-8ai15P2k.js +1 -0
- package/dist/public/assets/react-vendor-C5nxgKkG.js +14 -0
- package/dist/public/assets/settings-general-view-BSxsk_m5.js +1 -0
- package/dist/public/assets/settings-instructions-view-CoQbusO7.js +1 -0
- package/dist/public/assets/settings-list-BXFAt1ro.js +1 -0
- package/dist/public/assets/settings-logs-view-DKf220uN.js +5 -0
- package/dist/public/assets/settings-mcp-servers-view-BOnRRjxr.js +5 -0
- package/dist/public/assets/settings-models-view-DsTRKX08.js +1 -0
- package/dist/public/assets/settings-rules-view-CqHhaztV.js +8 -0
- package/dist/public/assets/settings-skills-view-K-_W0HrF.js +3 -0
- package/dist/public/assets/settings-slack-view-BeWZ3a93.js +1 -0
- package/dist/public/assets/settings-slash-commands-view-BiikOGS5.js +1 -0
- package/dist/public/assets/settings-statistics-view-BlzgqwIc.js +1 -0
- package/dist/public/assets/settings-storage-view-DRNF5odI.js +1 -0
- package/dist/public/assets/settings-subagents-view-BCzI1v3n.js +2 -0
- package/dist/public/assets/settings-system-prompt-view-CxY0QGfq.js +1 -0
- package/dist/public/assets/settings-view-6LDq3cdz.js +2 -0
- package/dist/public/assets/skeleton-6zJJLoPb.js +1 -0
- package/dist/public/assets/slug-utils-DoHqPUWU.js +1 -0
- package/dist/public/assets/tasks-view-iJQeQQjd.js +2 -0
- package/dist/public/assets/terminal-panel-BBpenHNS.js +38 -0
- package/dist/public/assets/terminal-panel-BrP-ENHg.css +1 -0
- package/dist/public/assets/ui-components-BhBb-B_8.js +1 -0
- package/dist/public/assets/use-active-dock-panel-instance-BOwwEcFt.js +1 -0
- package/dist/public/assets/use-deferred-search-BrfhkvlC.js +1 -0
- package/dist/public/assets/use-installed-ai-files-D2ZUG6zW.js +1 -0
- package/dist/public/assets/use-settings-page-loading-BQufQmWq.js +1 -0
- package/dist/public/assets/utils-DECAGLEg.js +1 -0
- package/dist/public/assets/web-BGOf-14T.js +1 -0
- package/dist/public/assets/web-DPJnf7cc.js +1 -0
- package/dist/public/assets/web-Dtf_4xSv.js +1 -0
- package/dist/public/assets/web-gso7t-j3.js +1 -0
- package/dist/public/browser-preview-rpc.js +58 -0
- package/dist/public/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/public/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/dist/public/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/public/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/public/fonts/liberation-mono-regular.woff2 +0 -0
- package/dist/public/fonts/plus-jakarta-sans-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/plus-jakarta-sans-latin-wght-normal.woff2 +0 -0
- package/dist/public/fonts/plus-jakarta-sans-vietnamese-wght-normal.woff2 +0 -0
- package/dist/public/ide/android-studio.svg +10 -1
- package/dist/public/ide/antigravity.svg +3 -1
- package/dist/public/ide/cursor.svg +3 -12
- package/dist/public/ide/devin.svg +3 -1
- package/dist/public/ide/kiro.svg +2 -10
- package/dist/public/ide/terminal.svg +3 -7
- package/dist/public/ide/vscode.svg +5 -2
- package/dist/public/ide/windsurf.svg +2 -2
- package/dist/public/ide/xcode.svg +3 -2
- package/dist/public/index.html +11 -10
- package/dist/public/slack-app-icon.png +0 -0
- package/package.json +7 -3
- package/dist/public/assets/account-view-Cc6oDwk4.js +0 -1
- package/dist/public/assets/api-CtfZCd77.js +0 -1
- package/dist/public/assets/async-error-boundary-CaRNnJZe.js +0 -1
- package/dist/public/assets/browser-tab-BfAt-Sho.js +0 -8
- package/dist/public/assets/card-DFACZp3F.js +0 -1
- package/dist/public/assets/commit-dialog-Ck0r2v9S.js +0 -1
- package/dist/public/assets/context-menu-CBvTcHUI.js +0 -1
- package/dist/public/assets/create-repo-dialog-CBvRaov7.js +0 -1
- package/dist/public/assets/dialogs-config-C2KFQf9x.js +0 -51
- package/dist/public/assets/diff-view-DDECIdhE.js +0 -4
- package/dist/public/assets/explorer-file-drop-DaQtKkIj.js +0 -1
- package/dist/public/assets/explorer-tab-context-DCq1BBX_.js +0 -1
- package/dist/public/assets/explorer-tab-view-72Krb0Ir.js +0 -2
- package/dist/public/assets/explorer-tree-CcFgAYMn.js +0 -1
- package/dist/public/assets/explorer-view-DsNxf6nu.js +0 -75
- package/dist/public/assets/git-history-dialog--akFTQOd.js +0 -1
- package/dist/public/assets/git-ops-button-CKGLh3Zk.js +0 -2
- package/dist/public/assets/history-view-IcXfB6BD.js +0 -15
- package/dist/public/assets/index-BmpLvHah.js +0 -75
- package/dist/public/assets/index-r8I03VVW.css +0 -1
- package/dist/public/assets/mcp-server-card-DDmDAlY8.js +0 -1
- package/dist/public/assets/merged-pr-dialog-CiwhRqFv.js +0 -1
- package/dist/public/assets/model-list-controls-D5IaOffK.js +0 -1
- package/dist/public/assets/monaco-Br_kD0ds.css +0 -1
- package/dist/public/assets/onboarding-CFIVEI92.js +0 -1
- package/dist/public/assets/project-settings-view-Klpu7p3U.js +0 -1
- package/dist/public/assets/providers-list-view-Df-ONKwe.js +0 -1
- package/dist/public/assets/pull-request-dialog-DVYZgMuN.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-CHHJ0gpA.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-DoNMB3C8.js +0 -1
- package/dist/public/assets/react-vendor-tSKmVA4e.js +0 -14
- package/dist/public/assets/settings-general-view-yDDYKQmO.js +0 -1
- package/dist/public/assets/settings-instructions-view-y9bUZtKn.js +0 -1
- package/dist/public/assets/settings-list-j_NDw-aW.js +0 -1
- package/dist/public/assets/settings-logs-view-BzrjJRk6.js +0 -5
- package/dist/public/assets/settings-mcp-servers-view-NuKeyQ92.js +0 -5
- package/dist/public/assets/settings-models-view-64UG4njI.js +0 -1
- package/dist/public/assets/settings-rules-view-DdxIfxki.js +0 -8
- package/dist/public/assets/settings-skills-view-DoVxhA-A.js +0 -3
- package/dist/public/assets/settings-slash-commands-view-vm0HNVw1.js +0 -1
- package/dist/public/assets/settings-statistics-view-CKc3bD1x.js +0 -1
- package/dist/public/assets/settings-subagents-view-DuHK-7uc.js +0 -2
- package/dist/public/assets/settings-system-prompt-view-1clIREZ5.js +0 -1
- package/dist/public/assets/settings-telegram-view-DCPC5GxD.js +0 -1
- package/dist/public/assets/settings-view-BweC2YuW.js +0 -2
- package/dist/public/assets/skeleton-DBWV1Usf.js +0 -1
- package/dist/public/assets/slug-utils-D8SJJo7H.js +0 -1
- package/dist/public/assets/tasks-view-Cg9N8GZb.js +0 -2
- package/dist/public/assets/terminal-panel-Dlon-VDl.js +0 -7
- package/dist/public/assets/terminal-panel-kHJ-D0s7.css +0 -1
- package/dist/public/assets/ui-components-Dd2afm0c.js +0 -1
- package/dist/public/assets/use-deferred-search-Cu-o4nau.js +0 -1
- package/dist/public/assets/use-installed-ai-files-X8NXRdGD.js +0 -1
- package/dist/public/assets/use-settings-page-loading-D1JlmLmD.js +0 -1
- package/dist/public/assets/utils-Dt07QR3w.js +0 -1
- package/dist/public/assets/web-CdkfJJZ3.js +0 -1
- package/dist/public/assets/web-CiaJzwav.js +0 -1
- package/dist/public/assets/web-DeCAC9ap.js +0 -1
- package/dist/public/assets/web-DsLUxLTR.js +0 -1
- package/dist/public/fonts/google-sans.ttf +0 -0
- package/dist/public/snpro.woff2 +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{If as t,af as n,wf as r}from"./history-view-BfMYJF7S.js";var i=r(),a=e(t(),1),o=n(),s=(0,a.createContext)(null);function c(e){let t=(0,i.c)(8),{children:n}=e,[r,c]=(0,a.useState)(null),[u,d]=(0,a.useState)(0),[f,p]=(0,a.useState)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{d(l)},t[0]=m):m=t[0];let h=m,g;t[1]!==f||t[2]!==u||t[3]!==r?(g={pendingExplorerPath:r,setPendingExplorerPath:c,explorerRefreshTick:u,triggerExplorerRefresh:h,explorerClearPath:f,setExplorerClearPath:p},t[1]=f,t[2]=u,t[3]=r,t[4]=g):g=t[4];let _=g,v;return t[5]!==n||t[6]!==_?(v=(0,o.jsx)(s.Provider,{value:_,children:n}),t[5]=n,t[6]=_,t[7]=v):v=t[7],v}function l(e){return e+1}function u(){let e=(0,a.useContext)(s);if(!e)throw Error(`useExplorerTab must be used within an ExplorerTabProvider`);return e}export{u as n,c as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/explorer-tree-_4KO_6Ms.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-CjF8Ycpv.js","assets/history-view-BfMYJF7S.js","assets/api-Bx3qG-84.js","assets/onboarding-BoaQkHLd.js","assets/interactive-BpXvXOVa.js","assets/explorer-tab-context-D6TtM23Z.js","assets/react-vendor-C5nxgKkG.js","assets/monaco-DmAs9OAa.js","assets/monaco-BQve5vfS.css","assets/utils-DECAGLEg.js","assets/index-CmmUTvZV.css","assets/async-error-boundary-CGXO1iOm.js","assets/card-DueeH7Ho.js","assets/context-menu-D-TmtGey.js","assets/ui-components-BhBb-B_8.js","assets/explorer-view-CWM5299Z.js","assets/monaco-setup-B-a4Z1e-.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Cl as t,If as n,K as r,Ko as i,Pf as a,Zt as o,_d as s,af as c,ls as ee,nn as te,rn as l}from"./history-view-BfMYJF7S.js";import{n as u}from"./explorer-tab-context-D6TtM23Z.js";import{C as d,E as f,G as p,J as m,K as h,T as ne,Y as g,_t as _,q as v,w as y}from"./index-CjF8Ycpv.js";import{t as b}from"./async-error-boundary-CGXO1iOm.js";var x=e(n(),1),S=c(),C=(0,x.lazy)(()=>a(()=>import(`./explorer-tree-_4KO_6Ms.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),w=(0,x.lazy)(()=>a(()=>import(`./explorer-view-CWM5299Z.js`),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18])));function T(){let e=t(e=>e.selectedThreadId),n=f(),[a,c]=(0,x.useState)(null),[T,E]=(0,x.useState)(!0),[D,O]=(0,x.useState)(null),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(!1),N=(0,x.useRef)(0),{pendingExplorerPath:P,setPendingExplorerPath:F,explorerClearPath:I,setExplorerClearPath:L,triggerExplorerRefresh:R}=u();(0,x.useEffect)(()=>{function e(e){g(e.dataTransfer)&&e.preventDefault()}return window.addEventListener(`dragover`,e),window.addEventListener(`drop`,e),()=>{window.removeEventListener(`dragover`,e),window.removeEventListener(`drop`,e)}},[]),(0,x.useEffect)(()=>{E(!0)},[e]);let z=(0,x.useCallback)(e=>{c(e),n&&E(!1)},[n]),B=(0,x.useCallback)(()=>{E(!0)},[]),V=(0,x.useCallback)(e=>{c(e),n&&E(!1)},[n]);(0,x.useEffect)(()=>{P&&(c({name:P.split(`/`).pop()??P,path:P,type:`file`}),n&&E(!1),F(null))},[n,P,F]),(0,x.useEffect)(()=>{I&&(a&&(a.path===I||a.path.startsWith(I+`/`))&&(c(null),n&&E(!0)),L(null))},[I,n,a,L]);function H(){N.current=0,M(!1)}function U(e){g(e.dataTransfer)&&(N.current+=1,M(!0))}function W(e){g(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}function G(e){g(e.dataTransfer)&&(N.current=Math.max(0,N.current-1),N.current===0&&M(!1))}function K(e){if(!g(e.dataTransfer))return;e.preventDefault(),H();let{files:t,skippedFolders:n}=m(e.dataTransfer);n>0&&r({title:`Folders skipped`,description:`Only files can be copied. Drop individual files instead of folders.`}),t.length!==0&&O({files:t,dirPath:``})}let q=(0,x.useCallback)((e,t)=>{N.current=0,M(!1),O({files:e,dirPath:t})},[]);async function J(){if(!(!D||!e||k)){A(!0);try{let{copied:t,failures:n}=await v(e,D.dirPath,D.files);t.length>0&&R(),r(h(D,t.length,n))}finally{A(!1),O(null)}}}let Y={onDragEnter:U,onDragOver:W,onDragLeave:G,onDrop:K},X=j?(0,S.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-50 flex items-center justify-center bg-background/70`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border-2 border-dashed border-primary bg-background px-6 py-4`,children:[(0,S.jsx)(ee,{className:`h-4 w-4 text-primary`}),(0,S.jsx)(`span`,{className:s.label,children:`Drop files to copy them into the repository`})]})}):null,Z=(0,S.jsx)(o,{className:`h-full`,children:e?(0,S.jsx)(_,{threadId:e,children:(0,S.jsx)(b,{fallbackTitle:`Failed to load files`,children:(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(l,{}),children:(0,S.jsx)(C,{threadId:e,selectedPath:a?.path??null,onNodeSelect:z,onFilesDrop:q})})})}):(0,S.jsx)(`p`,{className:i(s.caption,`px-3 py-4 text-center`),children:`No thread selected.`})}),Q=(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(te,{}),children:(0,S.jsx)(w,{selectedFile:a,showTreeBackButton:n&&!T,onShowTree:B,onFileCreated:V})}),$=(0,S.jsx)(p,{pendingDrop:D,dropCopying:k,onConfirm:()=>{J()},onDismiss:()=>{O(null)}});return n?(0,S.jsxs)(`div`,{className:`relative flex h-full flex-col overflow-hidden`,...Y,children:[X,$,(0,S.jsx)(`div`,{className:i(`flex-1 min-h-0 overflow-hidden`,!T&&`hidden`),children:Z}),(0,S.jsx)(`div`,{className:i(`flex-1 min-h-0 overflow-hidden`,T&&`hidden`),children:Q})]}):(0,S.jsxs)(`div`,{className:`relative flex h-full flex-col overflow-hidden`,...Y,children:[X,$,(0,S.jsxs)(ne,{direction:`horizontal`,className:`flex-1 overflow-hidden`,children:[(0,S.jsx)(y,{defaultSize:25,minSize:15,maxSize:50,className:`overflow-hidden border-r border-border`,children:Z}),(0,S.jsx)(d,{withHandle:!0}),(0,S.jsx)(y,{className:`overflow-hidden`,children:Q})]})]})}export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dc as t,F as n,If as r,K as i,Ko as a,M as o,N as s,P as c,R as l,Tc as u,_d as d,af as f,al as p,b as m,j as h,js as g,rn as _,sl as v,tn as y,wc as b,wf as x,y as S}from"./history-view-BfMYJF7S.js";import{f as C,x as w}from"./onboarding-BoaQkHLd.js";import{n as T}from"./explorer-tab-context-D6TtM23Z.js";import{l as E,n as D,o as O,r as k,s as A,t as j}from"./api-Bx3qG-84.js";import{$ as ee,J as M,Y as N,ft as P,mt as te,pt as F,vt as I}from"./index-CjF8Ycpv.js";import{a as L,i as R,n as z,r as B,t as ne}from"./context-menu-D-TmtGey.js";import{t as re}from"./async-error-boundary-CGXO1iOm.js";import{t as V}from"./ui-components-BhBb-B_8.js";var H=x(),U=e(r(),1),W=f(),G=U.forwardRef((e,t)=>{let n=(0,H.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 o;n[3]===r?o=n[4]:(o=a(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,W.jsx)(V,{ref:t,className:o,...i}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});G.displayName=V.displayName;var K=U.forwardRef((e,t)=>{let n=(0,H.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 o;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(g,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),n[3]=o):o=n[3];let s;n[4]===r?s=n[5]:(s=a(`flex h-11 w-full rounded-md bg-transparent py-3 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,r),n[4]=r,n[5]=s);let c;return n[6]!==i||n[7]!==t||n[8]!==s?(c=(0,W.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[o,(0,W.jsx)(V.Input,{ref:t,className:s,...i})]}),n[6]=i,n[7]=t,n[8]=s,n[9]=c):c=n[9],c});K.displayName=V.Input.displayName;var q=U.forwardRef((e,t)=>{let n=(0,H.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 o;n[3]===r?o=n[4]:(o=a(`max-h-[300px] overflow-y-auto overflow-x-hidden`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,W.jsx)(V.List,{ref:t,className:o,...i}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});q.displayName=V.List.displayName;var J=U.forwardRef((e,t)=>{let n=(0,H.c)(4),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=a(d.bodyMuted,`py-6 text-center`),n[0]=r):r=n[0];let i;return n[1]!==e||n[2]!==t?(i=(0,W.jsx)(V.Empty,{ref:t,className:r,...e}),n[1]=e,n[2]=t,n[3]=i):i=n[3],i});J.displayName=V.Empty.displayName;var Y=U.forwardRef((e,t)=>{let n=(0,H.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 o;n[3]===r?o=n[4]:(o=a(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,W.jsx)(V.Group,{ref:t,className:o,...i}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});Y.displayName=V.Group.displayName;var ie=U.forwardRef((e,t)=>{let n=(0,H.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 o;n[3]===r?o=n[4]:(o=a(`-mx-1 h-px bg-divider`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,W.jsx)(V.Separator,{ref:t,className:o,...i}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});ie.displayName=V.Separator.displayName;var ae=U.forwardRef((e,t)=>{let n=(0,H.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 o;n[3]===r?o=n[4]:(o=a(a(d.body,`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`),r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,W.jsx)(V.Item,{ref:t,className:o,...i}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});ae.displayName=V.Item.displayName;var oe=e=>{let t=(0,H.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=a(d.compact,`ml-auto tracking-widest text-muted-foreground`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,W.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o};oe.displayName=`CommandShortcut`;var X=100,se=500;function Z(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean)}function ce(e,t){return t.length===0?!0:t.every(t=>e.haystack.includes(t))}function le(e,t,n){if(t.length===0)return[];let r=[];for(let n of e)if(ce(n,t)&&(r.push(n.node),r.length>=se))break;return r.sort((e,t)=>ue(e,t,n)).slice(0,X)}function ue(e,t,n){let r=n.trim().toLowerCase(),i=e.name.toLowerCase(),a=t.name.toLowerCase(),o=r?i.startsWith(r):!1;return o===(r?a.startsWith(r):!1)?e.type===t.type?e.path.localeCompare(t.path):e.type===`folder`?-1:1:o?-1:1}function de(e){let t=(0,H.c)(38),{items:n,isReady:r,onRequestIndex:i,onOpenChange:o,onSelect:s}=e,c=r===void 0?!1:r,l=(0,U.useRef)(null),u=(0,U.useRef)(!1),f=(0,U.useRef)(!1),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(``),_=(0,U.useDeferredValue)(h),v;t[0]===i?v=t[1]:(v=function(){f.current||(f.current=!0,i())},t[0]=i,t[1]=v);let y=v,x;t[2]!==_||t[3]!==n?(x=le(n,Z(_),_),t[2]=_,t[3]=n,t[4]=x):x=t[4];let S=x,C,T;t[5]!==o||t[6]!==h?(C=()=>{let e=h.trim().length>0;m(e),u.current!==e&&(u.current=e,o(e))},T=[o,h],t[5]=o,t[6]=h,t[7]=C,t[8]=T):(C=t[7],T=t[8]),(0,U.useEffect)(C,T);let E;t[9]===o?E=t[10]:(E=function(e){e||g(``),m(e),o(e),e&&requestAnimationFrame(()=>l.current?.focus())},t[9]=o,t[10]=E);let D=E,O;t[11]!==o||t[12]!==s?(O=function(e){s(e),m(!1),o(!1),g(``)},t[11]=o,t[12]=s,t[13]=O):O=t[13];let k=O,A;t[14]===y?A=t[15]:(A=e=>{y(),g(e.target.value)},t[14]=y,t[15]=A);let j;t[16]!==h||t[17]!==y||t[18]!==A?(j=(0,W.jsx)(te,{asChild:!0,children:(0,W.jsx)(`div`,{className:`bg-transparent`,children:(0,W.jsx)(w,{ref:l,value:h,onPointerDown:y,onChange:A,placeholder:`Search files and folders`,className:`pr-[4px]`})})}),t[16]=h,t[17]=y,t[18]=A,t[19]=j):j=t[19];let M;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(M=a(d.compact,`py-4`),t[20]=M):M=t[20];let N=c?`No matches found.`:`Indexing files and folders...`,I;t[21]===N?I=t[22]:(I=(0,W.jsx)(J,{className:M,children:N}),t[21]=N,t[22]=I);let L;if(t[23]!==k||t[24]!==S){let e;t[26]===k?e=t[27]:(e=e=>(0,W.jsxs)(ae,{value:e.path,onSelect:()=>k(e),className:e.ignored?`opacity-50`:void 0,children:[e.type===`folder`?(0,W.jsx)(b,{className:`h-4 w-4 text-muted-foreground`}):(0,W.jsx)(ee,{filename:e.name}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`truncate`,children:e.name}),(0,W.jsx)(`div`,{className:a(d.compact,`truncate text-muted-foreground`),children:e.path})]})]},e.path),t[26]=k,t[27]=e),L=S.map(e),t[23]=k,t[24]=S,t[25]=L}else L=t[25];let R;t[28]===L?R=t[29]:(R=(0,W.jsx)(Y,{children:L}),t[28]=L,t[29]=R);let z;t[30]!==I||t[31]!==R?(z=(0,W.jsx)(F,{align:`start`,side:`bottom`,sideOffset:4,onOpenAutoFocus:Q,className:`w-[var(--radix-popover-trigger-width)] p-0`,children:(0,W.jsx)(G,{shouldFilter:!1,children:(0,W.jsxs)(q,{children:[I,R]})})}),t[30]=I,t[31]=R,t[32]=z):z=t[32];let B;return t[33]!==D||t[34]!==p||t[35]!==z||t[36]!==j?(B=(0,W.jsxs)(P,{open:p,onOpenChange:D,children:[j,z]}),t[33]=D,t[34]=p,t[35]=z,t[36]=j,t[37]=B):B=t[37],B}function Q(e){return e.preventDefault()}function fe(e,t,n){return`explorer-dir:${e}:${t}:${n}`}function pe(e){let t=(0,H.c)(12),{threadId:n,dirPath:r,version:i,children:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==i?(o=fe(n,r,i),t[0]=r,t[1]=n,t[2]=i,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==n?(s=()=>O(n,r).then(me),t[4]=r,t[5]=n,t[6]=s):s=t[6];let c=S(o,s),l;t[7]!==a||t[8]!==c?(l=a(c),t[7]=a,t[8]=c,t[9]=l):l=t[9];let u;return t[10]===l?u=t[11]:(u=(0,W.jsx)(W.Fragment,{children:l}),t[10]=l,t[11]=u),u}function me(e){return e.entries}function he(e){let t=(0,H.c)(17),{defaultValue:n,onCommit:r,onCancel:i,level:a,basePadding:o,icon:s}=e,c=(0,U.useRef)(null),l,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{c.current?.focus(),c.current?.select()},u=[],t[0]=l,t[1]=u):(l=t[0],u=t[1]),(0,U.useEffect)(l,u);let f;t[2]!==i||t[3]!==r?(f=function(e){if(e.key===`Enter`){let e=c.current?.value.trim()??``;e?r(e):i()}else e.key===`Escape`&&i()},t[2]=i,t[3]=r,t[4]=f):f=t[4];let p=f,m;t[5]!==i||t[6]!==r?(m=function(){let e=c.current?.value.trim()??``;e?r(e):i()},t[5]=i,t[6]=r,t[7]=m):m=t[7];let h=m,g;t[8]!==n||t[9]!==h||t[10]!==p?(g=(0,W.jsx)(`input`,{ref:c,defaultValue:n,onKeyDown:p,onBlur:h,className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`,onClick:$}),t[8]=n,t[9]=h,t[10]=p,t[11]=g):g=t[11];let _;return t[12]!==o||t[13]!==s||t[14]!==a||t[15]!==g?(_=(0,W.jsxs)(C,{level:a,basePadding:o,className:d.conversationBody,children:[s,g]}),t[12]=o,t[13]=s,t[14]=a,t[15]=g,t[16]=_):_=t[16],_}function $(e){return e.stopPropagation()}function ge(e){return e.map(e=>({node:e,haystack:`${e.name} ${e.path}`.toLowerCase()}))}function _e(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t):``}var ve=(0,U.memo)(function e({node:n,level:r,threadId:o,selectedPath:s,expandedPaths:c,getDirVersion:l,renamingPath:f,newItemIn:m,onToggleFolder:h,onSelectNode:g,onStartRename:_,onCommitRename:x,onCancelRename:S,onDelete:w,onOpen:T,onCopyReference:E,onNewFile:D,onNewFolder:O,onCommitNewItem:k,onCancelNewItem:A,dropTargetPath:j,onFolderDropTargetChange:P,onFilesDrop:te}){let F=c.has(n.path),I=f===n.path,re=m?.dirPath===n.path&&F,V=j===n.path;return n.type===`folder`?(0,W.jsxs)(ne,{children:[(0,W.jsx)(L,{asChild:!0,children:(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(C,{level:r,basePadding:10,selected:s===n.path,className:a(d.conversationBody,n.ignored&&`opacity-50`,V&&`bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-primary`),onClick:e=>{e.stopPropagation(),h(n)},onDragOver:e=>{N(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,V||P(n.path))},onDragLeave:e=>{N(e.dataTransfer)&&(e.currentTarget.contains(e.relatedTarget)||V&&P(null))},onDrop:e=>{if(!N(e.dataTransfer))return;e.preventDefault(),e.stopPropagation(),P(null);let{files:t,skippedFolders:r}=M(e.dataTransfer);r>0&&i({title:`Folders skipped`,description:`Only files can be copied. Drop individual files instead of folders.`}),t.length>0&&te(t,n.path)},children:[(0,W.jsx)(`span`,{className:`text-muted-foreground w-3 flex-shrink-0`,children:F?(0,W.jsx)(v,{className:`h-3 w-3`}):(0,W.jsx)(p,{className:`h-3 w-3`})}),I?(0,W.jsxs)(W.Fragment,{children:[F?(0,W.jsx)(u,{className:`h-4 w-4 flex-shrink-0`}):(0,W.jsx)(b,{className:`h-4 w-4 flex-shrink-0`}),(0,W.jsx)(`input`,{autoFocus:!0,defaultValue:n.name,onKeyDown:e=>{if(e.key===`Enter`){let t=e.target.value.trim();t?x(n,t):S()}else e.key===`Escape`&&S()},onBlur:e=>{let t=e.target.value.trim();t?x(n,t):S()},onClick:e=>e.stopPropagation(),className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`})]}):(0,W.jsxs)(W.Fragment,{children:[F?(0,W.jsx)(u,{className:`h-4 w-4 flex-shrink-0`}):(0,W.jsx)(b,{className:`h-4 w-4 flex-shrink-0`}),(0,W.jsx)(`span`,{className:`flex-1 truncate`,children:n.name})]})]}),F&&(0,W.jsx)(`div`,{children:(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(y,{}),children:(0,W.jsx)(pe,{threadId:o,dirPath:n.path,version:l(n.path),children:n=>(0,W.jsxs)(W.Fragment,{children:[re&&(0,W.jsx)(he,{defaultValue:``,level:r+1,basePadding:m.type===`folder`?10:22,icon:m.type===`folder`?(0,W.jsx)(b,{className:`h-4 w-4 flex-shrink-0`}):(0,W.jsx)(t,{className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),onCommit:k,onCancel:A}),n.map(t=>(0,W.jsx)(e,{node:t,level:r+1,threadId:o,selectedPath:s,expandedPaths:c,getDirVersion:l,renamingPath:f,newItemIn:m,onToggleFolder:h,onSelectNode:g,onStartRename:_,onCommitRename:x,onCancelRename:S,onDelete:w,onOpen:T,onCopyReference:E,onNewFile:D,onNewFolder:O,onCommitNewItem:k,onCancelNewItem:A,dropTargetPath:j,onFolderDropTargetChange:P,onFilesDrop:te},t.path))]})})})})]})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(B,{onSelect:()=>T(n),children:`Open`}),(0,W.jsx)(R,{}),(0,W.jsx)(B,{onSelect:()=>D(n.path),children:`New File...`}),(0,W.jsx)(B,{onSelect:()=>O(n.path),children:`New Folder...`}),(0,W.jsx)(R,{}),(0,W.jsx)(B,{onSelect:()=>E(n),children:`Copy Reference`}),(0,W.jsx)(B,{onSelect:()=>_(n),children:`Rename...`}),(0,W.jsx)(B,{onSelect:()=>w(n),className:`text-destructive focus:text-destructive`,children:`Delete`})]})]}):(0,W.jsxs)(ne,{children:[(0,W.jsx)(L,{asChild:!0,children:(0,W.jsxs)(C,{level:r,basePadding:22,selected:s===n.path,className:a(d.conversationBody,n.ignored&&`opacity-50`),onClick:()=>g(n),children:[(0,W.jsx)(ee,{filename:n.name}),I?(0,W.jsx)(`input`,{autoFocus:!0,defaultValue:n.name,onKeyDown:e=>{if(e.key===`Enter`){let t=e.target.value.trim();t?x(n,t):S()}else e.key===`Escape`&&S()},onBlur:e=>{let t=e.target.value.trim();t?x(n,t):S()},onClick:e=>e.stopPropagation(),className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`}):(0,W.jsx)(`span`,{className:`flex-1 truncate`,children:n.name})]})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(B,{onSelect:()=>T(n),children:`Open`}),(0,W.jsx)(R,{}),(0,W.jsx)(B,{onSelect:()=>D(_e(n.path)),children:`New File...`}),(0,W.jsx)(B,{onSelect:()=>O(_e(n.path)),children:`New Folder...`}),(0,W.jsx)(R,{}),(0,W.jsx)(B,{onSelect:()=>E(n),children:`Copy Reference`}),(0,W.jsx)(B,{onSelect:()=>_(n),children:`Rename...`}),(0,W.jsx)(B,{onSelect:()=>w(n),className:`text-destructive focus:text-destructive`,children:`Delete`})]})]})}),ye=new Map;function be({threadId:e,selectedPath:r,onNodeSelect:a,onFilesDrop:u}){let[d,f]=(0,U.useState)(()=>new Map([[``,0]])),[p,g]=(0,U.useState)(new Set),[v,y]=(0,U.useState)(null),[x,S]=(0,U.useState)(null),[C,w]=(0,U.useState)(null),[ee,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1),[te,F]=(0,U.useState)([]),[R,V]=(0,U.useState)(!1),[H,G]=(0,U.useState)(!1),K=(0,U.useRef)(null),q=(0,U.useRef)(0),J=(0,U.useRef)(null),{explorerRefreshTick:Y,pendingExplorerPath:ie,setExplorerClearPath:ae}=T(),{fetchUnifiedStatus:oe}=I(),X=(0,U.useMemo)(()=>`${e}:${Y}`,[Y,e]),se=(0,U.useCallback)(e=>{(0,U.startTransition)(()=>{P(t=>t===e?t:e)})},[]),Z=(0,U.useCallback)(async()=>{if(!e)return;let t=ye.get(X);if(t){F(t),V(!0);return}if(K.current!==X){K.current=X,F([]),V(!1);try{let t=ge((await O(e,``,!0)).entries);ye.set(X,t),F(t),V(!0)}catch{F([]),V(!1)}finally{K.current===X&&(K.current=null)}}},[X,e]),ce=(0,U.useCallback)(()=>{G(!0)},[]),le=(0,U.useCallback)(()=>{ye.delete(X),F([]),V(!1)},[X]),ue=(0,U.useCallback)(()=>{le(),H&&Z()},[le,Z,H]),Q=(0,U.useCallback)(e=>d.get(e)??0,[d]),me=(0,U.useCallback)(e=>{f(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},[]),$=(0,U.useCallback)(t=>{e&&(m(fe(e,t,Q(t))),me(t))},[me,Q,e]),be=(0,U.useCallback)(t=>{if(!e)return;let n=t.path.split(`/`);t.type===`file`&&n.pop();let r=[],i=``;for(let e of n)i=i?`${i}/${e}`:e,r.push(i);g(e=>{let t=new Set(e);for(let e of r)t.add(e);return t})},[e]);(0,U.useEffect)(()=>{if(!e)return;let t=J.current!==null&&J.current!==e;J.current=e,t&&(f(new Map([[``,0]])),g(new Set),y(null),S(null),q.current=Y)},[Y,e]),(0,U.useEffect)(()=>{!e||Y<=q.current||(q.current=Y,f(t=>{let n=new Set([``]);for(let e of p)n.add(e);let r=new Map(t);for(let i of n){let n=t.get(i)??0;m(fe(e,i,n)),r.set(i,n+1)}return r}))},[Y,p,e]),(0,U.useEffect)(()=>{F([]),V(!1),G(!1),K.current=null},[X]),(0,U.useEffect)(()=>{!H||!e||Z()},[Z,H,e]),(0,U.useEffect)(()=>{if(!ie||!e)return;let t=ie.split(`/`);t.pop();let n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);if(n.length!==0){g(e=>{let t=new Set(e);for(let e of n)t.add(e);return t});for(let e of n)f(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})}},[ie,e]);function xe(e){p.has(e.path)?g(t=>{let n=new Set(t);return n.delete(e.path),n}):(g(t=>new Set(t).add(e.path)),f(t=>{if(t.has(e.path))return t;let n=new Map(t);return n.set(e.path,0),n}))}function Se(e){w(e)}async function Ce(t){try{await A(e,t.path)}catch{i({title:`Error`,description:`Failed to open "${t.name}"`,variant:`destructive`})}}async function we(e){try{await navigator.clipboard.writeText(e.path);let t=i({title:`Copied`,description:`Reference copied to clipboard.`});window.setTimeout(()=>{t.dismiss()},2e3)}catch{i({title:`Error`,description:`Failed to copy reference for "${e.name}"`,variant:`destructive`})}}async function Te(){if(!C)return;let t=C;w(null);try{await k(e,t.path),ae(t.path),$(_e(t.path)),ue(),oe(!0),g(e=>{let n=new Set(e);for(let e of n)(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}),f(e=>{let n=new Map(e);for(let e of n.keys())(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n})}catch{i({title:`Error`,description:`Failed to move "${t.name}" to trash`,variant:`destructive`})}}function Ee(e){S(null),y(e.path)}async function De(t,n){if(n===t.name){y(null);return}y(null);try{await E(e,t.path,n),$(_e(t.path)),ue(),oe(!0),t.type===`folder`&&(g(e=>{let n=new Set(e);for(let e of n)(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}),f(e=>{let n=new Map(e);for(let e of n.keys())(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}))}catch{i({title:`Error`,description:`Failed to rename "${t.name}"`,variant:`destructive`})}}function Oe(e){y(null),p.has(e)||(g(t=>new Set(t).add(e)),f(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})),S({dirPath:e,type:`file`})}function ke(e){y(null),p.has(e)||(g(t=>new Set(t).add(e)),f(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})),S({dirPath:e,type:`folder`})}async function Ae(t){if(!x)return;let{dirPath:n,type:r}=x;S(null);try{r===`file`?await j(e,n,t):await D(e,n,t),$(n),ue(),oe(!0)}catch{i({title:`Error`,description:`Failed to create ${r} "${t}"`,variant:`destructive`})}}function je(){S(null)}let Me=(0,U.useCallback)((e,t)=>{u?.(e,t)},[u]);function Ne(e){be(e),e.type===`file`&&a(e)}let Pe=x?.dirPath===``?(0,W.jsx)(he,{defaultValue:``,level:0,basePadding:x.type===`folder`?10:22,icon:x.type===`folder`?(0,W.jsx)(b,{className:`h-4 w-4 flex-shrink-0`}):(0,W.jsx)(t,{className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),onCommit:Ae,onCancel:je}):null;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(h,{open:C!==null,onOpenChange:e=>!e&&w(null),children:(0,W.jsxs)(c,{children:[(0,W.jsx)(l,{children:`Move to Trash`}),(0,W.jsxs)(n,{children:[`Move “`,C?.name,`” to trash?`]}),(0,W.jsxs)(`div`,{className:`flex gap-3 justify-end`,children:[(0,W.jsx)(s,{children:`Cancel`}),(0,W.jsx)(o,{onClick:()=>void Te(),children:`Move to Trash`})]})]})}),(0,W.jsx)(`div`,{className:`border-b border-border px-2 py-2`,children:(0,W.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(de,{items:te,isReady:R,onRequestIndex:ce,onOpenChange:se,onSelect:e=>Ne(e)},X)})})}),(0,W.jsxs)(ne,{children:[(0,W.jsx)(L,{asChild:!0,disabled:N,children:(0,W.jsx)(`div`,{className:`py-2 min-h-full`,children:(0,W.jsx)(re,{fallbackTitle:`Failed to load files`,onRetry:()=>$(``),children:(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(_,{}),children:(0,W.jsx)(pe,{threadId:e,dirPath:``,version:Q(``),children:t=>(0,W.jsxs)(W.Fragment,{children:[Pe,t.map(t=>(0,W.jsx)(ve,{node:t,level:0,threadId:e,selectedPath:r,expandedPaths:p,getDirVersion:Q,renamingPath:v,newItemIn:x,onToggleFolder:xe,onSelectNode:a,onStartRename:Ee,onCommitRename:De,onCancelRename:()=>y(null),onDelete:Se,onOpen:Ce,onCopyReference:we,onNewFile:Oe,onNewFolder:ke,onCommitNewItem:Ae,onCancelNewItem:je,dropTargetPath:ee,onFolderDropTargetChange:M,onFilesDrop:Me},t.path))]})})})})})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(B,{onSelect:()=>Oe(``),children:`New File...`}),(0,W.jsx)(B,{onSelect:()=>ke(``),children:`New Folder...`})]})]})]})}export{be as default};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,Ac as n,Cl as r,Fu as i,Go as a,If as o,K as s,Ko as c,Q as l,Rc as u,Tr as ee,Vs as te,X as ne,Zc as re,_d as d,af as f,b as p,cl as m,ed as h,kc as g,nn as _,oc as v,ot as ie,qa as ae,qs as oe,td as y,wf as b,y as x,zs as S}from"./history-view-BfMYJF7S.js";import{d as C}from"./react-vendor-C5nxgKkG.js";import{n as w}from"./explorer-tab-context-D6TtM23Z.js";import{a as T,c as se,i as E,o as D,s as ce,t as le,u as ue}from"./api-Bx3qG-84.js";import{n as de}from"./utils-DECAGLEg.js";import{bt as fe,yt as pe}from"./index-CjF8Ycpv.js";import{t as O}from"./async-error-boundary-CGXO1iOm.js";import"./monaco-setup-B-a4Z1e-.js";var k=b(),A=e(o(),1),j=f(),M=i(`explorer.preview`),N=[{label:`Markdown`,ext:`md`,icon:n},{label:`TypeScript`,ext:`ts`,icon:u},{label:`Text`,ext:`txt`,icon:g}];async function P(e,t){try{let n=await D(e,``),r=new Set(n.entries.map(e=>e.name)),i=`untitled`,a=`${i}.${t}`,o=2;for(;r.has(a);)a=`${i}${o}.${t}`,o++;return a}catch{return`untitled.${t}`}}function F(e){return y(e)===`md`}function I(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`}[y(e)]??`plaintext`}function L(e,t){return`explorer-file:${e}:${t}`}function R(e){let t=(0,k.c)(11),{threadId:n,path:r,contentKey:i,onContentReady:a}=e,o;t[0]!==r||t[1]!==n?(o=L(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n?(s=async()=>{try{return await T(n,r)}catch(e){let t=e;throw z(`Failed to load explorer file preview`,{threadId:n,path:r},t),t}},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c=x(o,s),l,u;return t[6]!==i||t[7]!==a||t[8]!==c.content?(l=()=>{a({key:i,content:c.content,original:c.content})},u=[a,c.content,i],t[6]=i,t[7]=a,t[8]=c.content,t[9]=l,t[10]=u):(l=t[9],u=t[10]),(0,A.useLayoutEffect)(l,u),null}function z(e,t,n){M.error(e,{...t,error:n})}function B(e,t){return`explorer-media:${e}:${t}`}function V(e,t){let n=(0,k.c)(11),r;n[0]!==t||n[1]!==e?(r=B(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]!==t||n[4]!==e?(i=async()=>{try{return await E(e,t)}catch(n){let r=n;throw z(`Failed to load explorer media preview`,{threadId:e,path:t},r),r}},n[3]=t,n[4]=e,n[5]=i):i=n[5];let a=x(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,A.useEffect)(c,l),s}function me(e){let t=(0,k.c)(3),{threadId:n,path:r,alt:i}=e,a=V(n,r),o;return t[0]!==i||t[1]!==a?(o=(0,j.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 overflow-auto`,children:(0,j.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 he(e){let t=(0,k.c)(2),{threadId:n,path:r}=e,i=V(n,r),a;return t[0]===i?a=t[1]:(a=(0,j.jsx)(`div`,{className:`flex items-center justify-center h-full p-4`,children:(0,j.jsx)(`video`,{src:i,controls:!0,className:`max-w-full max-h-full`})}),t[0]=i,t[1]=a),a}function H({selectedFile:e,showTreeBackButton:i=!1,onShowTree:o,onFileCreated:u}){let{resolvedTheme:f}=de(),g=r(e=>e.selectedThreadId),{triggerExplorerRefresh:y}=w(),b=(0,A.useRef)(null),x=(0,A.useRef)(null),T=(0,A.useRef)(!1),[E,D]=(0,A.useState)(null),[k,M]=(0,A.useState)(!1),[V,H]=(0,A.useState)(!1),[U,W]=(0,A.useState)(`edit`),[ge,_e]=(0,A.useState)(0),[G,ve]=(0,A.useState)(null),[K,q]=(0,A.useState)(!1),ye=e?.path??null;(0,A.useEffect)(()=>{g&&ee(g).then(ve).catch(()=>{})},[g]);let be=async()=>{if(!(!G||K)){q(!0);try{await navigator.clipboard.writeText(G),s({title:`Copied`,description:`Repository folder path copied to clipboard.`})}catch(e){z(`Failed to copy explorer folder path`,{threadId:g,folderPath:G},e),s({title:`Error`,description:`Failed to copy path to clipboard.`,variant:`destructive`})}finally{q(!1)}}},xe=async()=>{if(g)try{await ce(g,`.`)}catch(e){z(`Failed to open explorer repository folder`,{threadId:g,folderPath:G},e),s({title:`Error`,description:`Failed to open repository folder.`,variant:`destructive`})}},Se=(0,A.useCallback)(async e=>{if(g)try{let t=await P(g,e);await le(g,``,t);let n={name:t,path:t,type:`file`};x.current=t,T.current=!0,u?.(n),y(),s({title:`Created`,description:`${t} created successfully.`})}catch(t){z(`Failed to create explorer file`,{threadId:g,extension:e},t),s({title:`Error`,description:`Failed to create file.`,variant:`destructive`})}},[g,u,y]),J=e?h(e.path,e.name):null,Y=e?.type===`file`&&g&&!J?e:null,X=Y?`${g}:${Y.path}:${ge}`:null,Z=E&&E.key===X?E:null,Q=Z?.content??``,Ce=Z?.original??``;(0,A.useEffect)(()=>()=>{b.current&&=(b.current.getModel()?.dispose(),b.current.dispose(),null)},[]),(0,A.useEffect)(()=>{e?.type===`file`?x.current===e.path?(x.current=null,W(`edit`)):W(F(e.path)?`view`:`edit`):W(`edit`)},[ye,g]);async function $(){if(!(!g||!e||!X)){M(!0);try{await ue(g,e.path,Q),D({key:X,content:Q,original:Q}),s({title:`Saved`,description:`${e.name} saved successfully.`})}catch(t){z(`Failed to save explorer file`,{threadId:g,path:e.path},t),s({title:`Error`,description:t instanceof Error?t.message:`Failed to save file`,variant:`destructive`})}finally{M(!1)}}}async function we(){if(!(!g||!e||V)){H(!0);try{if(!ae()){if(typeof window>`u`)return;let t=document.querySelector(`[data-markdown-print-content]`);if(!(t instanceof HTMLElement)){s({title:`Print unavailable`,description:`Couldn't find the markdown preview to print.`,variant:`destructive`});return}let n=`<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>${e.name??`Markdown document`}</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
color-scheme: light;
|
|
10
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
}
|
|
13
|
+
* {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
background: white;
|
|
19
|
+
color: black;
|
|
20
|
+
}
|
|
21
|
+
.markdown-print-shell {
|
|
22
|
+
max-width: 900px;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
padding: 32px;
|
|
25
|
+
}
|
|
26
|
+
img, video, svg {
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
height: auto;
|
|
29
|
+
}
|
|
30
|
+
pre {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
overflow-wrap: anywhere;
|
|
33
|
+
border: 1px solid #d4d4d8;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
padding: 12px;
|
|
36
|
+
background: #f4f4f5;
|
|
37
|
+
}
|
|
38
|
+
code {
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
overflow-wrap: anywhere;
|
|
41
|
+
}
|
|
42
|
+
table {
|
|
43
|
+
width: 100%;
|
|
44
|
+
border-collapse: collapse;
|
|
45
|
+
}
|
|
46
|
+
th, td {
|
|
47
|
+
border: 1px solid #d4d4d8;
|
|
48
|
+
padding: 8px;
|
|
49
|
+
text-align: left;
|
|
50
|
+
}
|
|
51
|
+
@page {
|
|
52
|
+
margin: 0.75in;
|
|
53
|
+
}
|
|
54
|
+
@media print {
|
|
55
|
+
body {
|
|
56
|
+
-webkit-print-color-adjust: exact;
|
|
57
|
+
print-color-adjust: exact;
|
|
58
|
+
}
|
|
59
|
+
.markdown-print-shell {
|
|
60
|
+
max-width: none;
|
|
61
|
+
padding: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<main class="markdown-print-shell">${t.innerHTML}</main>
|
|
68
|
+
<script>
|
|
69
|
+
window.addEventListener("load", () => {
|
|
70
|
+
window.focus();
|
|
71
|
+
window.print();
|
|
72
|
+
}, { once: true });
|
|
73
|
+
<\/script>
|
|
74
|
+
</body>
|
|
75
|
+
</html>`,r=window.open(``,`_blank`,`noopener,noreferrer`);if(!r){s({title:`Print blocked`,description:`Allow pop-ups to print this file.`,variant:`destructive`});return}r.document.open(),r.document.write(n),r.document.close();return}s({title:`PDF created`,description:`Opened ${(await se(g,e.path)).outputPath.split(/[\\/]/).pop()??`the PDF`} in your default app.`})}catch(t){z(`Failed to print markdown file as PDF`,{threadId:g,path:e.path},t),s({title:`PDF export failed`,description:t instanceof Error?t.message:`Failed to convert this markdown file to PDF.`,variant:`destructive`})}finally{H(!1)}}}function Te(){!g||!Y||(p(L(g,Y.path)),_e(e=>e+1))}return g?(0,j.jsxs)(`div`,{className:`explorer-view-root flex flex-col h-full print:block print:h-auto`,children:[(0,j.jsxs)(fe,{className:`justify-between print:hidden`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[i&&o?(0,j.jsxs)(a,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:o,children:[(0,j.jsx)(oe,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,j.jsx)(`span`,{className:c(d.label,`truncate leading-normal text-foreground`),children:e?e.name:`Select a file to edit`}),(0,j.jsx)(`span`,{className:c(d.compact,`truncate text-muted-foreground`),children:e?e.path:`Browse and edit repository files`})]})]}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[Y&&Z?(0,j.jsxs)(j.Fragment,{children:[F(Y.path)&&U===`view`?(0,j.jsxs)(a,{size:`sm`,variant:`outline`,onClick:()=>void we(),disabled:V,children:[V?(0,j.jsx)(v,{className:`h-4 w-4 animate-spin`}):(0,j.jsx)(S,{className:`h-4 w-4`}),V?`Printing…`:`Print`]}):null,F(Y.path)?(0,j.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,j.jsx)(a,{size:`sm`,variant:U===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`view`),children:`View`}),(0,j.jsx)(a,{size:`sm`,variant:U===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`edit`),children:`Edit`})]}):null,(0,j.jsxs)(a,{size:`sm`,onClick:()=>void $(),disabled:k||!Q||Q===Ce,children:[k?(0,j.jsx)(v,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null,e?null:(0,j.jsxs)(ne,{children:[(0,j.jsx)(ie,{asChild:!0,children:(0,j.jsxs)(a,{size:`sm`,className:`gap-1.5`,children:[(0,j.jsx)(te,{className:`h-3.5 w-3.5`}),`New file`]})}),(0,j.jsx)(l,{align:`end`,children:N.map(({label:e,ext:n,icon:r})=>(0,j.jsxs)(t,{onSelect:()=>void Se(n),children:[(0,j.jsx)(r,{className:`h-4 w-4`}),e]},n))})]})]})]}),(0,j.jsx)(`div`,{className:`flex-1 overflow-hidden print:overflow-visible print:flex-none`,children:(0,j.jsx)(`div`,{className:`h-full relative overflow-hidden print:h-auto print:overflow-visible`,children:Y?(0,j.jsxs)(O,{fallbackTitle:`Failed to load file`,onRetry:Te,children:[(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(_,{}),children:(0,j.jsx)(R,{threadId:g,path:Y.path,contentKey:X??``,onContentReady:D},X??void 0)}),Z?F(Y.path)&&U===`view`?(0,j.jsx)(`div`,{className:`h-full overflow-auto p-6 print:h-auto print:overflow-visible print:p-0`,children:(0,j.jsx)(`div`,{className:`mx-auto max-w-4xl print:max-w-none`,"data-markdown-print-content":!0,children:(0,j.jsx)(pe,{content:Q,enableMermaid:!0})})}):(0,j.jsx)(C,{height:`100%`,language:I(Y.path),value:Q,onChange:e=>D(t=>t&&{...t,content:e??``}),onMount:e=>{b.current=e,T.current&&(T.current=!1,e.focus())},theme:f===`dark`?`vs-dark`:`vs-light`,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:14,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}}):(0,j.jsx)(_,{})]},X??void 0):e?.type===`file`&&J===`image`?(0,j.jsx)(O,{fallbackTitle:`Failed to load image`,onRetry:()=>{!g||!e||p(B(g,e.path))},children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(_,{}),children:(0,j.jsx)(me,{threadId:g,path:e.path,alt:e.name})})},e.path):e?.type===`file`&&J===`video`?(0,j.jsx)(O,{fallbackTitle:`Failed to load video`,onRetry:()=>{!g||!e||p(B(g,e.path))},children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(_,{}),children:(0,j.jsx)(he,{threadId:g,path:e.path})})},e.path):(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,j.jsx)(`h2`,{className:c(d.pageTitle,`text-foreground`),children:`File Explorer`}),(0,j.jsx)(`p`,{className:c(d.pageSubtitle),children:`Browse and edit files`})]})})}),e?null:(0,j.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 py-2`,children:G?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>void xe(),className:c(d.compact,`min-w-0 flex-1 truncate text-left font-mono text-muted-foreground hover:text-foreground hover:underline`),title:G,children:G}),(0,j.jsxs)(a,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,onClick:()=>void be(),disabled:K,children:[K?(0,j.jsx)(m,{className:`h-3.5 w-3.5`}):(0,j.jsx)(re,{className:`h-3.5 w-3.5`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Copy path`})]})]}):(0,j.jsx)(`p`,{className:c(d.compact,`text-muted-foreground/50 italic`),children:`Loading path...`})})]}):(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[(0,j.jsx)(n,{className:`h-8 w-8 text-muted-foreground`}),(0,j.jsx)(`p`,{className:d.bodyMuted,children:`Select a thread to browse its files`})]})}export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Go as e,Ko as t,_d as n,af as r,oc as i,wf as a}from"./history-view-BfMYJF7S.js";import{A as o,D as s,O as c,T as l,j as u,k as d}from"./onboarding-BoaQkHLd.js";var f=a(),p=r();function m(r){let a=(0,f.c)(28),{open:m,onOpenChange:g,commits:_,displayedCommits:v,isLoadingMore:y,onScroll:b,currentBranch:x}=r,S;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,p.jsx)(u,{children:`Commit History`}),a[0]=S):S=a[0];let C;a[1]===x?C=a[2]:(C=(0,p.jsxs)(o,{children:[S,(0,p.jsxs)(c,{children:[`Recent commits on branch `,x]})]}),a[1]=x,a[2]=C);let w;a[3]===v?w=a[4]:(w=v.length>0?v.map(h):(0,p.jsx)(`p`,{className:t(n.bodyMuted,`text-center py-8`),children:`No commits found`}),a[3]=v,a[4]=w);let T;a[5]===y?T=a[6]:(T=y&&(0,p.jsx)(`div`,{className:`p-3 text-center`,children:(0,p.jsx)(i,{className:`h-4 w-4 animate-spin inline`})}),a[5]=y,a[6]=T);let E;a[7]!==_.length||a[8]!==v.length||a[9]!==y?(E=v.length<_.length&&!y&&(0,p.jsx)(`div`,{className:t(n.caption,`p-3 text-center`),children:`Scroll to load more`}),a[7]=_.length,a[8]=v.length,a[9]=y,a[10]=E):E=a[10];let D;a[11]!==w||a[12]!==T||a[13]!==E?(D=(0,p.jsxs)(`div`,{className:`divide-y`,children:[w,T,E]}),a[11]=w,a[12]=T,a[13]=E,a[14]=D):D=a[14];let O;a[15]!==b||a[16]!==D?(O=(0,p.jsx)(`div`,{className:`flex-1 overflow-y-auto border rounded-lg`,onScroll:b,children:D}),a[15]=b,a[16]=D,a[17]=O):O=a[17];let k;a[18]===g?k=a[19]:(k=(0,p.jsx)(d,{children:(0,p.jsx)(e,{onClick:()=>g(!1),children:`Close`})}),a[18]=g,a[19]=k);let A;a[20]!==C||a[21]!==O||a[22]!==k?(A=(0,p.jsxs)(s,{className:`max-w-2xl max-h-[80vh] flex flex-col`,children:[C,O,k]}),a[20]=C,a[21]=O,a[22]=k,a[23]=A):A=a[23];let j;return a[24]!==g||a[25]!==m||a[26]!==A?(j=(0,p.jsx)(l,{open:m,onOpenChange:g,children:A}),a[24]=g,a[25]=m,a[26]=A,a[27]=j):j=a[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:t(n.label,`break-words`),children:e.message}),(0,p.jsxs)(`p`,{className:t(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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/commit-dialog-BXKzr2Vp.js","assets/index-CjF8Ycpv.js","assets/rolldown-runtime-aKtaBQYM.js","assets/history-view-BfMYJF7S.js","assets/api-Bx3qG-84.js","assets/onboarding-BoaQkHLd.js","assets/interactive-BpXvXOVa.js","assets/explorer-tab-context-D6TtM23Z.js","assets/react-vendor-C5nxgKkG.js","assets/monaco-DmAs9OAa.js","assets/monaco-BQve5vfS.css","assets/utils-DECAGLEg.js","assets/index-CmmUTvZV.css","assets/pull-request-dialog-B_SO17C0.js","assets/create-repo-dialog-8ZeXEZJO.js","assets/git-history-dialog-C3CiYKAa.js","assets/push-before-pr-dialog-8ai15P2k.js","assets/pull-with-changes-dialog-bfGiMljP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,Aa as n,Ca as r,Cc as i,Cl as a,Da as o,Fu as s,Go as c,Hr as l,If as u,K as d,Kc as f,Ko as p,Ls as m,Ma as h,Nd as g,Oa as _,Or as v,Pf as y,Q as b,Sl as x,Ta as S,Wc as C,X as w,_a as T,_d as ee,_l as E,af as D,an as O,bc as k,ea as A,fi as j,hc as M,il as N,in as P,ka as F,li as I,ls as te,ml as ne,nt as L,oc as R,on as z,ot as re,pu as B,rs as ie,sn as V,tt as ae,va as oe,wf as se,xa as ce,xc as le,ya as ue}from"./history-view-BfMYJF7S.js";import{f as de}from"./onboarding-BoaQkHLd.js";import{A as fe,M as pe,O as me,R as he,W as ge,j as _e,k as H,vt as ve,z as ye}from"./index-CjF8Ycpv.js";var be=se(),U=e(u(),1),W=D();function G(e){return!e.hasChanges&&e.defaultBranchBehind>0}function xe(e){return e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits}function K(e){return e.hasUnpushedCommits&&e.prExists}function Se(e,t){return t?`Creating PR`:e.hasChanges?`Commit`:K(e)?`Update PR`:xe(e)?`Open PR`:e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?`Create PR`:G(e)?`Sync`:`Commit`}function Ce(e,t,n=!1){return t||n||e.hasChanges||K(e)||xe(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||!e.hasChanges&&!e.hasUnpushedCommits&&!G(e)?null:G(e)?(0,W.jsx)(E,{className:`h-3.5 w-3.5`}):(0,W.jsx)(le,{className:`h-3.5 w-3.5`})}function q(e){if(e.hasChanges)return e.changedFilesCount>0?`Commit ${e.changedFilesCount} changed file${e.changedFilesCount===1?``:`s`}`:`No changes to commit`;if(K(e))return`Update pull request with unpushed commits`;if(xe(e))return`View pull request in GitHub`;if(e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges)return`Create pull request for committed changes`;if(G(e)){let t=e.defaultBranch??`main`,n=`${e.defaultBranchBehind} commit${e.defaultBranchBehind===1?``:`s`} behind origin/${t}`,r=e.defaultBranchAhead>0?`, ${e.defaultBranchAhead} commit${e.defaultBranchAhead===1?``:`s`} ahead`:``;return e.currentBranch===e.defaultBranch?`Your branch is ${n}${r}. Click to pull the latest changes.`:`Your branch "${e.currentBranch}" is ${n}${r}. Click to rebase onto the latest ${t}.`}return`No actions available`}function we(e,t,n=!1){return t||n?!0:xe(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||G(e)?!1:!e.hasChanges&&!e.hasUnpushedCommits}function Te(e){return e.hasChanges||xe(e)||K(e)||G(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges}function J(e){let n=(0,be.c)(104),{branchStatus:r,remoteUrl:i,hasRemoteBranch:a,hasUnpushedCommits:o,canCreateRepo:s,repoUrl:l,isRefreshing:u,isCreatingPR:d,hasChanges:h,commitsAheadOfDefault:g,prExists:_,defaultBranch:v,defaultBranchAhead:y,defaultBranchBehind:x,gitUser:S,isDirectCommitMode:T,autoGenerateCommitMessage:D,isLoading:A,isLoadingHistory:j,isQuickCommitting:F,onFetch:I,onPull:B,onPush:oe,onOpenHistory:se,onCreatePR:ce,onCreateRepo:ue,onViewInGitHub:de,onQuickCommit:fe,onSyncWithDefault:me,onOpenChange:he,open:ge,layout:_e}=e,H=d===void 0?!1:d,ve=_e===void 0?`bar`:_e,ye=!!v&&!!i&&x>0,U=!h&&!A,G;n[0]!==H||n[1]!==u?(G=H||u?(0,W.jsx)(R,{className:`h-4 w-4 shrink-0 animate-spin`}):(0,W.jsx)(N,{className:`h-4 w-4 shrink-0`}),n[0]=H,n[1]=u,n[2]=G):G=n[2];let xe=G,K;n[3]!==H||n[4]!==A||n[5]!==u||n[6]!==ve||n[7]!==xe?(K=(0,W.jsx)(re,{asChild:!0,children:ve===`sidebar`?(0,W.jsx)(c,{variant:`ghost`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,disabled:A||H,"aria-label":`Git Ops`,children:xe}):ve===`bar`?(0,W.jsx)(`button`,{type:`button`,className:`flex h-full shrink-0 items-center rounded-r-full pr-3 pl-0.5 disabled:opacity-50`,disabled:A||H,"aria-label":`Git Ops`,children:H||u?(0,W.jsx)(R,{className:p(pe,`animate-spin`)}):(0,W.jsx)(N,{className:pe})}):(0,W.jsxs)(c,{variant:`outline`,size:`sm`,className:`h-8 w-full justify-start gap-2 rounded-md px-1`,disabled:A||H,children:[(0,W.jsx)(`span`,{children:`Git Ops`}),H||u?(0,W.jsx)(R,{className:`h-3.5 w-3.5 animate-spin`}):(0,W.jsx)(N,{className:`h-3.5 w-3.5`})]})}),n[3]=H,n[4]=A,n[5]=u,n[6]=ve,n[7]=xe,n[8]=K):K=n[8];let Se=ve===`sidebar`?`start`:`end`,Ce;n[9]!==r||n[10]!==i?(Ce=r===`Behind`&&(0,W.jsxs)(`div`,{className:p(ee.compact,`px-2 py-1 text-amber-600`),children:[`Branch is behind `,i?`origin`:`remote`]}),n[9]=r,n[10]=i,n[11]=Ce):Ce=n[11];let q;n[12]===S?q=n[13]:(q=S&&(0,W.jsxs)(`div`,{className:p(ee.compact,`px-2 py-1 text-muted-foreground`),children:[(0,W.jsx)(`span`,{className:`font-medium`,children:`User:`}),` `,S]}),n[12]=S,n[13]=q);let we;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,W.jsx)(ae,{}),n[14]=we):we=n[14];let Te;n[15]!==U||n[16]!==v||n[17]!==y||n[18]!==x||n[19]!==h||n[20]!==me||n[21]!==ye?(Te=ye&&(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(t,{onClick:()=>{U&&me()},className:U?``:`opacity-50 cursor-not-allowed`,children:[(0,W.jsx)(m,{className:`h-3.5 w-3.5 mr-2`}),`Sync with `,v,(0,W.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 pl-3 text-xs tabular-nums text-muted-foreground`,children:[y>0&&(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,W.jsx)(ne,{className:`h-3 w-3`}),y]}),x>0&&(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,W.jsx)(E,{className:`h-3 w-3`}),x]})]})]})}),(0,W.jsx)(O,{side:`right`,children:h?`Commit or stash changes before syncing with the default branch`:`Pull latest changes from origin/${v} onto your current branch`})]})}),n[15]=U,n[16]=v,n[17]=y,n[18]=x,n[19]=h,n[20]=me,n[21]=ye,n[22]=Te):Te=n[22];let J;n[23]!==D||n[24]!==h||n[25]!==A||n[26]!==F||n[27]!==fe?(J=h&&D&&(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(t,{onClick:fe,disabled:A||F,children:[F?(0,W.jsx)(R,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,W.jsx)(ie,{className:`h-3.5 w-3.5 mr-2`}),`Quick Commit`,(0,W.jsx)(L,{children:`⌘⇧C`})]})}),(0,W.jsx)(O,{side:`right`,children:`Generate the commit message and commit`})]})}),n[23]=D,n[24]=h,n[25]=A,n[26]=F,n[27]=fe,n[28]=J):J=n[28];let Y;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,W.jsx)(f,{className:`h-3.5 w-3.5 mr-2`}),n[29]=Y):Y=n[29];let X;n[30]!==A||n[31]!==I?(X=(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(t,{onClick:I,disabled:A,children:[Y,`Fetch`]})}),n[30]=A,n[31]=I,n[32]=X):X=n[32];let Ee;n[33]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,W.jsx)(O,{side:`right`,children:`Download latest information from remote without merging changes`}),n[33]=Ee):Ee=n[33];let De;n[34]===X?De=n[35]:(De=(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[X,Ee]})}),n[34]=X,n[35]=De);let Oe;n[36]!==a||n[37]!==A||n[38]!==B?(Oe=()=>{a&&!A&&B()},n[36]=a,n[37]=A,n[38]=B,n[39]=Oe):Oe=n[39];let ke=!a||A?`opacity-50 cursor-not-allowed`:``,Z;n[40]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,W.jsx)(E,{className:`h-3.5 w-3.5 mr-2`}),n[40]=Z):Z=n[40];let Ae;n[41]!==Oe||n[42]!==ke?(Ae=(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(t,{onClick:Oe,className:ke,children:[Z,`Pull`]})}),n[41]=Oe,n[42]=ke,n[43]=Ae):Ae=n[43];let je=a?`Pull latest changes from remote`:`No remote branch to pull from`,Me;n[44]===je?Me=n[45]:(Me=(0,W.jsx)(O,{side:`right`,children:je}),n[44]=je,n[45]=Me);let Ne;n[46]!==Ae||n[47]!==Me?(Ne=(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[Ae,Me]})}),n[46]=Ae,n[47]=Me,n[48]=Ne):Ne=n[48];let Q;n[49]!==a||n[50]!==A||n[51]!==oe?(Q=!a&&(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(t,{onClick:oe,disabled:A,children:[(0,W.jsx)(te,{className:`h-3.5 w-3.5 mr-2`}),`Push Branch to Remote`]})}),(0,W.jsx)(O,{side:`right`,children:`Create remote branch and push local commits`})]})}),n[49]=a,n[50]=A,n[51]=oe,n[52]=Q):Q=n[52];let Pe;n[53]!==o||n[54]!==A||n[55]!==oe?(Pe=()=>{o&&!A&&oe()},n[53]=o,n[54]=A,n[55]=oe,n[56]=Pe):Pe=n[56];let Fe=!o||A?`opacity-50 cursor-not-allowed`:``,Ie;n[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,W.jsx)(te,{className:`h-3.5 w-3.5 mr-2`}),n[57]=Ie):Ie=n[57];let Le;n[58]!==Pe||n[59]!==Fe?(Le=(0,W.jsx)(V,{asChild:!0,children:(0,W.jsxs)(t,{onClick:Pe,className:Fe,children:[Ie,`Push Commits`]})}),n[58]=Pe,n[59]=Fe,n[60]=Le):Le=n[60];let $=o?A?`Push in progress...`:`Push your uncommitted commits to the remote branch`:`No commits to push - your branch is up to date with remote`,Re;n[61]===$?Re=n[62]:(Re=(0,W.jsx)(O,{side:`right`,children:$}),n[61]=$,n[62]=Re);let ze;n[63]!==Le||n[64]!==Re?(ze=(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[Le,Re]})}),n[63]=Le,n[64]=Re,n[65]=ze):ze=n[65];let Be=A||j,Ve;n[66]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,W.jsx)(M,{className:`h-3.5 w-3.5 mr-2`}),n[66]=Ve):Ve=n[66];let He;n[67]!==se||n[68]!==Be?(He=(0,W.jsxs)(t,{onClick:se,disabled:Be,children:[Ve,`History`]}),n[67]=se,n[68]=Be,n[69]=He):He=n[69];let Ue;n[70]!==g||n[71]!==h||n[72]!==T||n[73]!==A||n[74]!==ce||n[75]!==_?(Ue=!T&&g&&!_&&!h&&(0,W.jsxs)(t,{onClick:ce,disabled:A,children:[(0,W.jsx)(le,{className:`h-3.5 w-3.5 mr-2`}),`Create Pull Request`,(0,W.jsx)(L,{children:`⌘⇧P`})]}),n[70]=g,n[71]=h,n[72]=T,n[73]=A,n[74]=ce,n[75]=_,n[76]=Ue):Ue=n[76];let We;n[77]!==s||n[78]!==A||n[79]!==ue?(We=s&&(0,W.jsxs)(t,{onClick:ue,disabled:A,children:[(0,W.jsx)(k,{className:`h-3.5 w-3.5 mr-2`}),`Create Repo`]}),n[77]=s,n[78]=A,n[79]=ue,n[80]=We):We=n[80];let Ge;n[81]!==A||n[82]!==de||n[83]!==l?(Ge=l&&(0,W.jsxs)(t,{onClick:de,disabled:A,children:[(0,W.jsx)(C,{className:`h-3.5 w-3.5 mr-2`}),`View in GitHub`,(0,W.jsx)(L,{children:`⌘⇧G`})]}),n[81]=A,n[82]=de,n[83]=l,n[84]=Ge):Ge=n[84];let Ke;n[85]!==J||n[86]!==De||n[87]!==Ne||n[88]!==Q||n[89]!==ze||n[90]!==He||n[91]!==Ue||n[92]!==We||n[93]!==Ge||n[94]!==Se||n[95]!==Ce||n[96]!==q||n[97]!==Te?(Ke=(0,W.jsxs)(b,{align:Se,children:[Ce,q,we,Te,J,De,Ne,Q,ze,He,Ue,We,Ge]}),n[85]=J,n[86]=De,n[87]=Ne,n[88]=Q,n[89]=ze,n[90]=He,n[91]=Ue,n[92]=We,n[93]=Ge,n[94]=Se,n[95]=Ce,n[96]=q,n[97]=Te,n[98]=Ke):Ke=n[98];let qe;return n[99]!==he||n[100]!==ge||n[101]!==Ke||n[102]!==K?(qe=(0,W.jsxs)(w,{open:ge,onOpenChange:he,children:[K,Ke]}),n[99]=he,n[100]=ge,n[101]=Ke,n[102]=K,n[103]=qe):qe=n[103],qe}var Y=(0,U.lazy)(()=>y(()=>import(`./commit-dialog-BXKzr2Vp.js`).then(e=>({default:e.CommitDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),X=(0,U.lazy)(()=>y(()=>import(`./pull-request-dialog-B_SO17C0.js`).then(e=>({default:e.PullRequestDialog})),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]))),Ee=(0,U.lazy)(()=>y(()=>import(`./create-repo-dialog-8ZeXEZJO.js`).then(e=>({default:e.CreateRepoDialog})),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12]))),De=(0,U.lazy)(()=>y(()=>import(`./git-history-dialog-C3CiYKAa.js`).then(e=>({default:e.GitHistoryDialog})),__vite__mapDeps([15,3,2,5]))),Oe=(0,U.lazy)(()=>y(()=>import(`./push-before-pr-dialog-8ai15P2k.js`).then(e=>({default:e.PushBeforePRDialog})),__vite__mapDeps([16,3,2,5]))),ke=(0,U.lazy)(()=>y(()=>import(`./pull-with-changes-dialog-bfGiMljP.js`).then(e=>({default:e.PullWithChangesDialog})),__vite__mapDeps([17,3,2,5])));function Z(){return null}function Ae(e){let t=(0,be.c)(65),{isLoading:n,currentBranch:r,commit:i,pullRequest:a,pushBeforePR:o,createRepo:s,history:c,pullWithChanges:l}=e,u;t[0]!==i.autoGenerate||t[1]!==i.isGenerating||t[2]!==i.isOpen||t[3]!==i.message||t[4]!==i.onAutoGenerateChange||t[5]!==i.onCommit||t[6]!==i.onGenerateMessage||t[7]!==i.onMessageChange||t[8]!==i.onOpenChange||t[9]!==r||t[10]!==n?(u=i.isOpen&&(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(Y,{open:i.isOpen,onOpenChange:i.onOpenChange,commitMessage:i.message,onCommitMessageChange:i.onMessageChange,autoGenerateCommitMessage:i.autoGenerate,onAutoGenerateChange:i.onAutoGenerateChange,isGeneratingMessage:i.isGenerating,isLoading:n,onGenerateMessage:i.onGenerateMessage,onCommit:i.onCommit,currentBranch:r})}),t[0]=i.autoGenerate,t[1]=i.isGenerating,t[2]=i.isOpen,t[3]=i.message,t[4]=i.onAutoGenerateChange,t[5]=i.onCommit,t[6]=i.onGenerateMessage,t[7]=i.onMessageChange,t[8]=i.onOpenChange,t[9]=r,t[10]=n,t[11]=u):u=t[11];let d;t[12]!==r||t[13]!==n||t[14]!==a.autoGenerate||t[15]!==a.description||t[16]!==a.isGeneratingInfo||t[17]!==a.isOpen||t[18]!==a.onAutoGenerateChange||t[19]!==a.onCreatePR||t[20]!==a.onDescriptionChange||t[21]!==a.onGenerateInfo||t[22]!==a.onOpenChange||t[23]!==a.onTitleChange||t[24]!==a.title?(d=a.isOpen&&(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(X,{open:a.isOpen,onOpenChange:a.onOpenChange,prTitle:a.title,onPrTitleChange:a.onTitleChange,prDescription:a.description,onPrDescriptionChange:a.onDescriptionChange,isGeneratingPRInfo:a.isGeneratingInfo,isLoading:n,onGeneratePRInfo:a.onGenerateInfo,onCreatePR:a.onCreatePR,currentBranch:r,autoGeneratePRInfo:a.autoGenerate,onAutoGeneratePRInfoChange:a.onAutoGenerateChange})}),t[12]=r,t[13]=n,t[14]=a.autoGenerate,t[15]=a.description,t[16]=a.isGeneratingInfo,t[17]=a.isOpen,t[18]=a.onAutoGenerateChange,t[19]=a.onCreatePR,t[20]=a.onDescriptionChange,t[21]=a.onGenerateInfo,t[22]=a.onOpenChange,t[23]=a.onTitleChange,t[24]=a.title,t[25]=d):d=t[25];let f;t[26]!==n||t[27]!==o.isOpen||t[28]!==o.onCancel||t[29]!==o.onOpenChange||t[30]!==o.onPushAndCreatePR?(f=o.isOpen&&(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(Oe,{open:o.isOpen,onOpenChange:o.onOpenChange,isLoading:n,onPushAndCreatePR:o.onPushAndCreatePR,onCancel:o.onCancel})}),t[26]=n,t[27]=o.isOpen,t[28]=o.onCancel,t[29]=o.onOpenChange,t[30]=o.onPushAndCreatePR,t[31]=f):f=t[31];let p;t[32]!==s.description||t[33]!==s.isOpen||t[34]!==s.isPrivate||t[35]!==s.name||t[36]!==s.onCreateRepo||t[37]!==s.onDescriptionChange||t[38]!==s.onNameChange||t[39]!==s.onOpenChange||t[40]!==s.onPrivateChange||t[41]!==n?(p=s.isOpen&&(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(Ee,{open:s.isOpen,onOpenChange:s.onOpenChange,repoName:s.name,onRepoNameChange:s.onNameChange,repoDescription:s.description,onRepoDescriptionChange:s.onDescriptionChange,isPrivateRepo:s.isPrivate,onPrivateRepoChange:s.onPrivateChange,isLoading:n,onCreateRepo:s.onCreateRepo})}),t[32]=s.description,t[33]=s.isOpen,t[34]=s.isPrivate,t[35]=s.name,t[36]=s.onCreateRepo,t[37]=s.onDescriptionChange,t[38]=s.onNameChange,t[39]=s.onOpenChange,t[40]=s.onPrivateChange,t[41]=n,t[42]=p):p=t[42];let m;t[43]!==r||t[44]!==c.commits||t[45]!==c.displayedCommits||t[46]!==c.isLoadingMore||t[47]!==c.isOpen||t[48]!==c.onOpenChange||t[49]!==c.onScroll?(m=c.isOpen&&(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(De,{open:c.isOpen,onOpenChange:c.onOpenChange,commits:c.commits,displayedCommits:c.displayedCommits,isLoadingMore:c.isLoadingMore,onScroll:c.onScroll,currentBranch:r})}),t[43]=r,t[44]=c.commits,t[45]=c.displayedCommits,t[46]=c.isLoadingMore,t[47]=c.isOpen,t[48]=c.onOpenChange,t[49]=c.onScroll,t[50]=m):m=t[50];let h;t[51]!==n||t[52]!==l.isOpen||t[53]!==l.onCancel||t[54]!==l.onCommitFirst||t[55]!==l.onOpenChange||t[56]!==l.onStashAndPull?(h=l.isOpen&&(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(ke,{open:l.isOpen,onOpenChange:l.onOpenChange,onCommitFirst:l.onCommitFirst,onStashAndPull:l.onStashAndPull,onCancel:l.onCancel,isLoading:n})}),t[51]=n,t[52]=l.isOpen,t[53]=l.onCancel,t[54]=l.onCommitFirst,t[55]=l.onOpenChange,t[56]=l.onStashAndPull,t[57]=h):h=t[57];let g;return t[58]!==u||t[59]!==d||t[60]!==f||t[61]!==p||t[62]!==m||t[63]!==h?(g=(0,W.jsxs)(W.Fragment,{children:[u,d,f,p,m,h]}),t[58]=u,t[59]=d,t[60]=f,t[61]=p,t[62]=m,t[63]=h,t[64]=g):g=t[64],g}function je(e){let t=e.split(`/`);return t.length>=2?{provider:t[0],model:t.slice(1).join(`/`)}:{provider:void 0,model:e}}var Me=s(`app.use-ai-generation.hook`);function Ne(e,t,n){let[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(!1),s=()=>n?.id?n.provider?{provider:n.provider,model:n.id}:je(n.id):{provider:void 0,model:void 0};return{isGeneratingMessage:r,isGeneratingPRInfo:a,generateCommitMessageWithAI:(0,U.useCallback)(async()=>{if(!e)return null;try{i(!0);let{provider:t,model:n}=s();return await oe(e,n,t)}catch(e){return Me.error(`Failed to generate commit message:`,e),d({title:`Error`,description:e instanceof Error?e.message:`Failed to generate commit message`,variant:`destructive`}),null}finally{i(!1)}},[e,n]),generatePRInfoWithAI:(0,U.useCallback)(async()=>{if(!e)return null;try{o(!0);let{provider:t,model:n}=s();return await ue(e,n,t)}catch(e){return Me.error(`Failed to generate PR info:`,e),d({title:`Error`,description:e instanceof Error?e.message:`Failed to generate PR info`,variant:`destructive`}),null}finally{o(!1)}},[e,n])}}function Q(e){return e?!0:(d({title:`Error`,description:`No thread selected`,variant:`destructive`}),!1)}async function Pe(e,t,n,r){r&&(await A(e,{title:r}),n({type:B.UpdateThreadTitle,projectId:t,threadId:e,title:r}))}var Fe=2e3,Ie=6;function Le(e,t){let n=0;e.current!==null&&clearInterval(e.current),e.current=setInterval(async()=>{if(n++,n>=Ie){e.current!==null&&(clearInterval(e.current),e.current=null);return}await t(!0)},Fe)}var $=s(`app.git-ops-button.ui`),Re=10;function ze(e){let{projectId:t,threadId:i,projectName:a,dispatch:s,aiGeneration:c,unifiedGitStatus:u}=e,[f,p]=(0,U.useState)(!1),[m,g]=(0,U.useState)(!1),[y,b]=(0,U.useState)(!1),[x,C]=(0,U.useState)(!1),[w,ee]=(0,U.useState)(``),[E,D]=(0,U.useState)(``),[O,k]=(0,U.useState)(``),[A,M]=(0,U.useState)(!1),[N,P]=(0,U.useState)(null),te=(0,U.useRef)(!1),ne=(0,U.useRef)(!1),L=(0,U.useRef)(E),R=(0,U.useRef)(O);L.current=E,R.current=O;let[z,re]=(0,U.useState)(!1),[ie,V]=(0,U.useState)([]),[ae,oe]=(0,U.useState)(!1),[se,le]=(0,U.useState)([]),[ue,de]=(0,U.useState)(!1),[fe,pe]=(0,U.useState)(!1),[me,ge]=(0,U.useState)(``),[_e,H]=(0,U.useState)(``),[ve,be]=(0,U.useState)(``),[W,G]=(0,U.useState)(!1),[xe,K]=(0,U.useState)(!1),[Se,Ce]=(0,U.useState)(!1),[q,we]=(0,U.useState)(!1),Te=(0,U.useRef)(!1),J=(0,U.useRef)(null);(0,U.useEffect)(()=>()=>{J.current!==null&&(clearInterval(J.current),J.current=null)},[]);async function Y(){I();let e=await l();s({type:B.SetProjects,projects:e.projects,cloneRootPath:e.cloneRootPath})}let[X,Ee]=(0,U.useState)(()=>he());(0,U.useEffect)(()=>{fe&&a&&!me&&ge(a)},[fe,a,me]),(0,U.useEffect)(()=>{ye(X)},[X]);function De(){W||(G(!0),v().then(e=>be(e)).catch(()=>{}))}function Oe(e){we(e),e&&(De(),u.fetchUnifiedStatus(!0))}(0,U.useEffect)(()=>{m&&u.prExists&&u.prState===`OPEN`&&g(!1)},[u.prExists,u.prState,m]),(0,U.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>{g(!1)},15e3);return()=>clearTimeout(e)},[m]),(0,U.useEffect)(()=>{let e=u.prExists&&u.prState===`OPEN`&&!u.hasChanges&&!u.hasUnpushedCommits;e&&!Te.current&&Y(),Te.current=e},[u.hasChanges,u.hasUnpushedCommits,u.prExists,u.prState]);async function ke(){if(w.trim()&&Q(i))try{p(!0),await S(i,w),ee(``),b(!1),await u.fetchUnifiedStatus(!0),Y(),d({title:`Changes committed successfully`,description:`Your changes have been committed to '${u.currentBranch}'.`}),Se&&(Ce(!1),await ze())}catch(e){$.error(`Failed to commit:`,e),d({title:`Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{p(!1)}}async function Z(){if(!Q(i))return;let e=u.prUrl;if(!e)try{e=(await r(i)).url}catch(e){$.error(`Failed to fetch pull request URL:`,e),d({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to fetch pull request URL`,variant:`destructive`});return}if(!e){d({title:`Could not open pull request`,description:`Pull request URL is unavailable. Try refreshing git status.`,variant:`destructive`});return}try{await j(e)}catch(e){$.error(`Failed to open pull request:`,e),d({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to open URL in browser`,variant:`destructive`})}}async function Ae(){if(u.hasChanges){b(!0);return}if(u.hasUnpushedCommits&&u.prExists){await Fe();return}if(u.prExists&&u.prState===`OPEN`&&!u.hasChanges&&!u.hasUnpushedCommits){await Z();return}if(u.commitsAheadOfDefault&&!u.prExists&&!u.hasChanges){C(!0);return}if(u.defaultBranchBehind>0){await He();return}}async function je(){let e=await c.generateCommitMessageWithAI();e&&ee(e)}async function Me(){if(Q(i))try{p(!0);let e=await c.generateCommitMessageWithAI();if(!e){d({title:`Quick Commit failed`,description:`Could not generate commit message`,variant:`destructive`});return}await S(i,e),await u.fetchUnifiedStatus(!0),Y(),d({title:`Changes committed successfully`,description:`Committed: ${e}`})}catch(e){$.error(`Quick commit failed:`,e),d({title:`Quick Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{p(!1)}}async function Ne(){if(Q(i))try{p(!0),await _(i),await u.fetchUnifiedStatus()}catch(e){$.error(`Failed to fetch:`,e)}finally{p(!1)}}async function Fe(){if(Q(i))try{p(!0),await n(i),await u.fetchUnifiedStatus(!0),Y(),u.hasRemoteBranch?d({title:`Branch pushed successfully`,description:`Your branch '${u.currentBranch}' has been pushed to the remote.`}):d({title:`Push completed`,description:`Changes have been pushed successfully.`})}catch(e){$.error(`Failed to push:`,e),d({title:`Push failed`,description:e instanceof Error?e.message:`Failed to push to remote`,variant:`destructive`})}finally{p(!1)}}async function Ie(){if(Q(i)){if(u.hasChanges){K(!0);return}await ze()}}async function ze(){try{p(!0),await F(i),await u.fetchUnifiedStatus(!0),Y(),d({title:`Pull successful`,description:`Latest changes have been pulled from remote.`})}catch(e){$.error(`Failed to pull:`,e),d({title:`Pull failed`,description:e instanceof Error?e.message:`Failed to pull from remote`,variant:`destructive`})}finally{p(!1)}}function Be(){K(!1),Ce(!0),b(!0)}async function Ve(){K(!1),await ze()}async function He(){if(Q(i))try{p(!0),await h(i),await u.fetchUnifiedStatus(!0),Y(),d({title:`Branch synced successfully`,description:`Your branch '${u.currentBranch}' has been synced with the latest changes`})}catch(e){$.error(`[sync] ✗ Failed to sync branch:`,e),d({title:`Sync failed`,description:e instanceof Error?e.message:`Failed to sync with default branch`,variant:`destructive`})}finally{p(!1)}}async function Ue(){if(Q(i))try{p(!0),g(!0);let e=await o(i,E,O);await Pe(i,t,s,e.title??E),e.prUrl&&await j(e.prUrl),D(``),k(``),C(!1),await u.fetchUnifiedStatus(!0),Y(),Le(J,u.fetchUnifiedStatus)}catch(e){$.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`)?(C(!1),Ke({title:E,description:O})):(g(!1),d({title:`Create PR Failed`,description:t,variant:`destructive`}))}finally{p(!1)}}async function We(){if(Q(i))try{p(!0);let e=await T(i,me,_e,X.privateRepositoryDefault);e.repoUrl&&setTimeout(()=>{j(e.repoUrl)},3e3),ge(``),H(``),pe(!1),await u.fetchUnifiedStatus(),Y()}catch(e){$.error(`Failed to create repo:`,e)}finally{p(!1)}}async function Ge(){let e=await c.generatePRInfoWithAI();e&&(D(e.title),k(e.description),d({title:`Success`,description:`PR title and description generated`}))}async function Ke(e){let r=e??N;if(!(!i||!r))try{p(!0),g(!0);try{await n(i)}catch(e){let t=e?.message??``;if(t.includes(`non-fast-forward`)||t.includes(`Updates were rejected because the tip of your current branch is behind`)){d({title:`Syncing branch before push`,description:`Your branch is behind remote. Pulling latest changes first...`});try{await h(i),await n(i)}catch{throw e}}else throw e}let e=await o(i,r.title,r.description);await Pe(i,t,s,e.title??r.title),e.prUrl&&await j(e.prUrl),D(``),k(``),P(null),M(!1),await u.fetchUnifiedStatus(!0),Y(),Le(J,u.fetchUnifiedStatus)}catch(e){$.error(`Failed to push and create PR:`,e);let t=e instanceof Error?e.message:`Failed to push and create PR`;g(!1),d({title:`Push & Create PR Failed`,description:t,variant:`destructive`})}finally{p(!1)}}async function qe(){if(Q(i))try{oe(!0);let e=await ce(i,100);V(e),le(e.slice(0,Re)),re(!0)}catch(e){$.error(`Failed to fetch git history:`,e)}finally{oe(!1)}}function Je(){ue||(de(!0),setTimeout(()=>{let e=se.length+Re;le(ie.slice(0,e)),de(!1)},300))}function Ye(e){let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<100&&se.length<ie.length&&!ue&&Je()}function Xe(){u.repoUrl&&j(u.repoUrl)}function Ze(){M(!1),P(null)}return{isLoading:f,isCreatingPR:m,isCommitDialogOpen:y,setIsCommitDialogOpen:b,isPRDialogOpen:x,setIsPRDialogOpen:C,commitMessage:w,setCommitMessage:ee,prTitle:E,setPrTitle:D,prDescription:O,setPrDescription:k,isPushBeforePRDialogOpen:A,setIsPushBeforePRDialogOpen:M,prGenerationRef:te,commitGenerationRef:ne,prTitleRef:L,prDescriptionRef:R,isHistoryDialogOpen:z,setIsHistoryDialogOpen:re,commits:ie,displayedCommits:se,isLoadingHistory:ae,isLoadingMore:ue,isRepoDialogOpen:fe,setIsRepoDialogOpen:pe,repoName:me,setRepoName:ge,repoDescription:_e,setRepoDescription:H,gitUser:ve,isPullWithChangesDialogOpen:xe,setIsPullWithChangesDialogOpen:K,isGitOpsMenuOpen:q,userPrefs:X,setUserPrefsState:Ee,handleGitOpsMenuOpenChange:Oe,handleCommit:ke,handleOpenPullRequest:Z,handleMainButtonClick:Ae,handleGenerateCommitMessage:je,handleQuickCommit:Me,handleFetch:Ne,handlePush:Fe,handlePull:Ie,handleSyncBranch:He,handleCreatePR:Ue,handleCreateRepo:We,handleGeneratePRInfo:Ge,handlePushAndCreatePR:Ke,handleOpenHistory:qe,handleScroll:Ye,handleViewInGitHub:Xe,handleCancelPushBeforePR:Ze,handleCommitFirstAndPull:Be,handleStashAndPull:Ve}}function Be(e){let t=(0,be.c)(29),{threadId:n,aiGeneration:r,isCommitDialogOpen:i,commitMessage:a,setCommitMessage:o,autoGenerateCommitMessage:s,commitGenerationRef:c,isPRDialogOpen:l,prTitleRef:u,prDescriptionRef:d,setPrTitle:f,setPrDescription:p,autoGeneratePRInfo:m,prGenerationRef:h}=e,g;t[0]!==r||t[1]!==s||t[2]!==c||t[3]!==a||t[4]!==i||t[5]!==o||t[6]!==n?(g=()=>{if(!i){c.current=!1;return}i&&s&&!a.trim()&&n&&!c.current&&(c.current=!0,(async function(){let e=await r.generateCommitMessageWithAI();e&&o(e)})())},t[0]=r,t[1]=s,t[2]=c,t[3]=a,t[4]=i,t[5]=o,t[6]=n,t[7]=g):g=t[7];let _;t[8]!==r.generateCommitMessageWithAI||t[9]!==s||t[10]!==a||t[11]!==i||t[12]!==n?(_=[i,s,n,r.generateCommitMessageWithAI,a],t[8]=r.generateCommitMessageWithAI,t[9]=s,t[10]=a,t[11]=i,t[12]=n,t[13]=_):_=t[13],(0,U.useEffect)(g,_);let v;t[14]!==r||t[15]!==m||t[16]!==l||t[17]!==d||t[18]!==h||t[19]!==u||t[20]!==p||t[21]!==f||t[22]!==n?(v=()=>{if(!l){h.current=!1;return}l&&m&&!u.current.trim()&&!d.current.trim()&&n&&!h.current&&(h.current=!0,(async function(){let e=await r.generatePRInfoWithAI();e&&(f(e.title),p(e.description))})())},t[14]=r,t[15]=m,t[16]=l,t[17]=d,t[18]=h,t[19]=u,t[20]=p,t[21]=f,t[22]=n,t[23]=v):v=t[23];let y;t[24]!==r.generatePRInfoWithAI||t[25]!==m||t[26]!==l||t[27]!==n?(y=[l,m,n,r.generatePRInfoWithAI],t[24]=r.generatePRInfoWithAI,t[25]=m,t[26]=l,t[27]=n,t[28]=y):y=t[28],(0,U.useEffect)(v,y)}function Ve(e){let{unifiedGitStatus:t,autoGenerateCommitMessage:n,isLoading:r,isCreatingPR:i,isDirectCommitMode:a,onQuickCommit:o,onCreatePR:s,onViewInGitHub:c,onOpenGitOpsMenu:l}=e,u=(0,U.useRef)(o),d=(0,U.useRef)(s),f=(0,U.useRef)(c),p=(0,U.useRef)(l);u.current=o,d.current=s,f.current=c,p.current=l,(0,U.useEffect)(()=>{function e(e){let o=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey){if(o===`c`){t.hasChanges&&n&&!r&&(e.preventDefault(),u.current());return}if(o===`p`){t.commitsAheadOfDefault&&!t.prExists&&!t.hasChanges&&!r&&!a&&(e.preventDefault(),d.current());return}if(o===`g`){t.repoUrl&&!r&&(e.preventDefault(),f.current());return}o===`b`&&!r&&!i&&(e.preventDefault(),p.current())}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t.commitsAheadOfDefault,t.hasChanges,t.prExists,t.repoUrl,n,r,i,a])}function He(e){let t=(0,be.c)(169),{projectId:n,threadId:r,layout:o}=e,s=o===void 0?`bar`:o,l=x(),u=ge(),d;t[0]===r?d=t[1]:(d=e=>e.projectModelSelections[r],t[0]=r,t[1]=d);let f=a(d),m;t[2]===n?m=t[3]:(m=e=>e.projects.find(e=>e.projectId===n),t[2]=n,t[3]=m);let h=a(m),_=ve(),v=Ne(r,n,f),y=h?.commitMethod===g.Direct,b=h?.name,S;t[4]!==v||t[5]!==l||t[6]!==n||t[7]!==b||t[8]!==r||t[9]!==_?(S={projectId:n,threadId:r,projectName:b,dispatch:l,aiGeneration:v,unifiedGitStatus:_},t[4]=v,t[5]=l,t[6]=n,t[7]=b,t[8]=r,t[9]=_,t[10]=S):S=t[10];let C=ze(S),w;t[11]!==C.commitGenerationRef||t[12]!==C.commitMessage||t[13]!==C.isCommitDialogOpen||t[14]!==C.isPRDialogOpen||t[15]!==C.prDescriptionRef||t[16]!==C.prGenerationRef||t[17]!==C.prTitleRef||t[18]!==C.setCommitMessage||t[19]!==C.setPrDescription||t[20]!==C.setPrTitle||t[21]!==C.userPrefs.autoGenerateCommitMessage||t[22]!==C.userPrefs.autoGeneratePRInfo||t[23]!==v||t[24]!==r?(w={threadId:r,aiGeneration:v,isCommitDialogOpen:C.isCommitDialogOpen,commitMessage:C.commitMessage,setCommitMessage:C.setCommitMessage,autoGenerateCommitMessage:C.userPrefs.autoGenerateCommitMessage,commitGenerationRef:C.commitGenerationRef,isPRDialogOpen:C.isPRDialogOpen,prTitleRef:C.prTitleRef,prDescriptionRef:C.prDescriptionRef,setPrTitle:C.setPrTitle,setPrDescription:C.setPrDescription,autoGeneratePRInfo:C.userPrefs.autoGeneratePRInfo,prGenerationRef:C.prGenerationRef},t[11]=C.commitGenerationRef,t[12]=C.commitMessage,t[13]=C.isCommitDialogOpen,t[14]=C.isPRDialogOpen,t[15]=C.prDescriptionRef,t[16]=C.prGenerationRef,t[17]=C.prTitleRef,t[18]=C.setCommitMessage,t[19]=C.setPrDescription,t[20]=C.setPrTitle,t[21]=C.userPrefs.autoGenerateCommitMessage,t[22]=C.userPrefs.autoGeneratePRInfo,t[23]=v,t[24]=r,t[25]=w):w=t[25],Be(w);let T;t[26]===C?T=t[27]:(T=()=>C.setIsPRDialogOpen(!0),t[26]=C,t[27]=T);let E;t[28]===C?E=t[29]:(E=()=>{C.isLoading||C.isCreatingPR||C.handleGitOpsMenuOpenChange(!0)},t[28]=C,t[29]=E);let D;t[30]!==C.handleQuickCommit||t[31]!==C.handleViewInGitHub||t[32]!==C.isCreatingPR||t[33]!==C.isLoading||t[34]!==C.userPrefs.autoGenerateCommitMessage||t[35]!==y||t[36]!==T||t[37]!==E||t[38]!==_?(D={unifiedGitStatus:_,autoGenerateCommitMessage:C.userPrefs.autoGenerateCommitMessage,isLoading:C.isLoading,isCreatingPR:C.isCreatingPR,isDirectCommitMode:y,onQuickCommit:C.handleQuickCommit,onCreatePR:T,onViewInGitHub:C.handleViewInGitHub,onOpenGitOpsMenu:E},t[30]=C.handleQuickCommit,t[31]=C.handleViewInGitHub,t[32]=C.isCreatingPR,t[33]=C.isLoading,t[34]=C.userPrefs.autoGenerateCommitMessage,t[35]=y,t[36]=T,t[37]=E,t[38]=_,t[39]=D):D=t[39],Ve(D);let k;if(t[40]!==C||t[41]!==v.isGeneratingMessage||t[42]!==y||t[43]!==s||t[44]!==u||t[45]!==_){let e=Te(_),n=we(_,C.isLoading,C.isCreatingPR),r=C.isLoading||C.isCreatingPR,a=n&&!r,o;t[47]!==C.isCreatingPR||t[48]!==_?(o=Se(_,C.isCreatingPR),t[47]=C.isCreatingPR,t[48]=_,t[49]=o):o=t[49];let l=o,d;t[50]!==C.isCreatingPR||t[51]!==C.isLoading||t[52]!==_?(d=Ce(_,C.isCreatingPR,C.isLoading)??(0,W.jsx)(i,{className:`h-4 w-4 shrink-0`}),t[50]=C.isCreatingPR,t[51]=C.isLoading,t[52]=_,t[53]=d):d=t[53];let f=d,m=u&&!e?_e:me,h=_.defaultBranch??null,g=v.isGeneratingMessage&&C.isLoading,b,x,S,w,T,E;t[54]===C?(b=t[55],x=t[56],S=t[57],w=t[58],T=t[59],E=t[60]):(b=()=>void C.handleFetch(),x=()=>void C.handlePull(),S=()=>void C.handlePush(),w=()=>void C.handleOpenHistory(),T=()=>C.setIsPRDialogOpen(!0),E=()=>C.setIsRepoDialogOpen(!0),t[54]=C,t[55]=b,t[56]=x,t[57]=S,t[58]=w,t[59]=T,t[60]=E);let D,A;t[61]===C?(D=t[62],A=t[63]):(D=()=>void C.handleQuickCommit(),A=()=>void C.handleSyncBranch(),t[61]=C,t[62]=D,t[63]=A);let j;t[64]!==C.gitUser||t[65]!==C.handleGitOpsMenuOpenChange||t[66]!==C.handleViewInGitHub||t[67]!==C.isCreatingPR||t[68]!==C.isGitOpsMenuOpen||t[69]!==C.isLoading||t[70]!==C.isLoadingHistory||t[71]!==C.userPrefs.autoGenerateCommitMessage||t[72]!==y||t[73]!==s||t[74]!==h||t[75]!==g||t[76]!==b||t[77]!==x||t[78]!==S||t[79]!==w||t[80]!==T||t[81]!==E||t[82]!==D||t[83]!==A||t[84]!==_.canCreateRepo||t[85]!==_.commitsAheadOfDefault||t[86]!==_.defaultBranchAhead||t[87]!==_.defaultBranchBehind||t[88]!==_.hasChanges||t[89]!==_.hasRemoteBranch||t[90]!==_.hasUnpushedCommits||t[91]!==_.isRefreshing||t[92]!==_.prExists||t[93]!==_.remoteUrl||t[94]!==_.repoUrl||t[95]!==_.status?(j=(0,W.jsx)(J,{branchStatus:_.status,remoteUrl:_.remoteUrl,hasRemoteBranch:_.hasRemoteBranch,hasUnpushedCommits:_.hasUnpushedCommits,canCreateRepo:_.canCreateRepo,repoUrl:_.repoUrl,isRefreshing:_.isRefreshing,isCreatingPR:C.isCreatingPR,hasChanges:_.hasChanges,commitsAheadOfDefault:_.commitsAheadOfDefault,prExists:_.prExists,defaultBranch:h,defaultBranchAhead:_.defaultBranchAhead,defaultBranchBehind:_.defaultBranchBehind,gitUser:C.gitUser,isDirectCommitMode:y,autoGenerateCommitMessage:C.userPrefs.autoGenerateCommitMessage,isLoading:C.isLoading,isLoadingHistory:C.isLoadingHistory,isQuickCommitting:g,onFetch:b,onPull:x,onPush:S,onOpenHistory:w,onCreatePR:T,onCreateRepo:E,onViewInGitHub:C.handleViewInGitHub,onQuickCommit:D,onSyncWithDefault:A,open:C.isGitOpsMenuOpen,onOpenChange:C.handleGitOpsMenuOpenChange,layout:s}),t[64]=C.gitUser,t[65]=C.handleGitOpsMenuOpenChange,t[66]=C.handleViewInGitHub,t[67]=C.isCreatingPR,t[68]=C.isGitOpsMenuOpen,t[69]=C.isLoading,t[70]=C.isLoadingHistory,t[71]=C.userPrefs.autoGenerateCommitMessage,t[72]=y,t[73]=s,t[74]=h,t[75]=g,t[76]=b,t[77]=x,t[78]=S,t[79]=w,t[80]=T,t[81]=E,t[82]=D,t[83]=A,t[84]=_.canCreateRepo,t[85]=_.commitsAheadOfDefault,t[86]=_.defaultBranchAhead,t[87]=_.defaultBranchBehind,t[88]=_.hasChanges,t[89]=_.hasRemoteBranch,t[90]=_.hasUnpushedCommits,t[91]=_.isRefreshing,t[92]=_.prExists,t[93]=_.remoteUrl,t[94]=_.repoUrl,t[95]=_.status,t[96]=j):j=t[96];let M=j;k=s===`sidebar`?(0,W.jsxs)(`div`,{className:`flex w-full min-w-0 items-center`,children:[(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsx)(de,{asChild:!0,className:`min-w-0 flex-1`,children:(0,W.jsx)(`button`,{type:`button`,className:p(`min-w-0 w-full justify-start`,e&&`border-transparent bg-brand !text-white hover:bg-brand/90 hover:!text-white dark:bg-brand dark:hover:bg-brand/90`,e&&a&&`cursor-default opacity-50 hover:bg-brand hover:!text-white`,!e&&a&&`cursor-default`),disabled:r,"aria-disabled":n,onClick:n?void 0:C.handleMainButtonClick,children:(0,W.jsxs)(`span`,{className:p(`flex min-w-0 flex-1 items-center gap-2`,!e&&a&&`text-muted-foreground opacity-50`,e&&`font-medium text-white`),children:[f,(0,W.jsx)(`span`,{className:p(ee.body,`truncate`),children:l})]})})})}),(0,W.jsx)(O,{side:`right`,children:q(_)})]})}),M]}):s===`bar`?(0,W.jsxs)(`div`,{className:p(m,fe,H,`group min-w-0 gap-0 px-0`,e&&`border-transparent bg-brand !text-white hover:bg-brand/90 hover:!text-white dark:bg-brand dark:hover:bg-brand/90`,e&&a&&`cursor-default opacity-50 hover:bg-brand hover:!text-white`),children:[(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,className:p(ee.compact,`flex min-w-0 flex-1 items-center gap-1.5 rounded-l-full pl-3 pr-0.5 disabled:opacity-50`,a&&`cursor-default`,e&&`text-white`),disabled:r,"aria-disabled":n,onClick:n?void 0:C.handleMainButtonClick,children:(0,W.jsxs)(`span`,{className:p(`inline-flex min-w-0 items-center gap-1.5 truncate`,e&&`font-medium`,!e&&a&&`opacity-50`),children:[f,(0,W.jsx)(`span`,{className:`truncate`,children:l})]})})}),(0,W.jsx)(O,{side:`top`,children:q(_)})]})}),M]}):(0,W.jsxs)(`div`,{className:p(`flex w-full flex-col gap-1 items-stretch [&_button]:w-full [&_button]:justify-start`),children:[(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[(0,W.jsx)(V,{asChild:!0,children:(0,W.jsx)(c,{variant:`outline`,size:`sm`,className:p(`h-8 gap-1.5 rounded-md border`,e&&`border-transparent bg-brand !text-white hover:bg-brand/90 hover:!text-white dark:bg-brand dark:hover:bg-brand/90`,a&&`cursor-default hover:bg-background hover:text-foreground`),disabled:r,"aria-disabled":n,onClick:n?void 0:C.handleMainButtonClick,children:(0,W.jsxs)(`span`,{className:p(`inline-flex items-center gap-1.5`,e&&`text-white`,a&&!e&&`text-muted-foreground opacity-50`,a&&e&&`opacity-50`),children:[f,l]})})}),(0,W.jsx)(O,{children:q(_)})]})}),M]}),t[40]=C,t[41]=v.isGeneratingMessage,t[42]=y,t[43]=s,t[44]=u,t[45]=_,t[46]=k}else k=t[46];let A;t[97]===C?A=t[98]:(A=e=>C.setUserPrefsState(t=>({...t,autoGenerateCommitMessage:e})),t[97]=C,t[98]=A);let j;t[99]!==C.commitMessage||t[100]!==C.handleCommit||t[101]!==C.handleGenerateCommitMessage||t[102]!==C.isCommitDialogOpen||t[103]!==C.setCommitMessage||t[104]!==C.setIsCommitDialogOpen||t[105]!==C.userPrefs.autoGenerateCommitMessage||t[106]!==v.isGeneratingMessage||t[107]!==A?(j={isOpen:C.isCommitDialogOpen,onOpenChange:C.setIsCommitDialogOpen,message:C.commitMessage,onMessageChange:C.setCommitMessage,autoGenerate:C.userPrefs.autoGenerateCommitMessage,onAutoGenerateChange:A,isGenerating:v.isGeneratingMessage,onGenerateMessage:C.handleGenerateCommitMessage,onCommit:C.handleCommit},t[99]=C.commitMessage,t[100]=C.handleCommit,t[101]=C.handleGenerateCommitMessage,t[102]=C.isCommitDialogOpen,t[103]=C.setCommitMessage,t[104]=C.setIsCommitDialogOpen,t[105]=C.userPrefs.autoGenerateCommitMessage,t[106]=v.isGeneratingMessage,t[107]=A,t[108]=j):j=t[108];let M;t[109]===C?M=t[110]:(M=e=>C.setUserPrefsState(t=>({...t,autoGeneratePRInfo:e})),t[109]=C,t[110]=M);let N;t[111]!==C.handleCreatePR||t[112]!==C.handleGeneratePRInfo||t[113]!==C.isPRDialogOpen||t[114]!==C.prDescription||t[115]!==C.prTitle||t[116]!==C.setIsPRDialogOpen||t[117]!==C.setPrDescription||t[118]!==C.setPrTitle||t[119]!==C.userPrefs.autoGeneratePRInfo||t[120]!==v.isGeneratingPRInfo||t[121]!==M?(N={isOpen:C.isPRDialogOpen,onOpenChange:C.setIsPRDialogOpen,title:C.prTitle,onTitleChange:C.setPrTitle,description:C.prDescription,onDescriptionChange:C.setPrDescription,isGeneratingInfo:v.isGeneratingPRInfo,onGenerateInfo:C.handleGeneratePRInfo,onCreatePR:C.handleCreatePR,autoGenerate:C.userPrefs.autoGeneratePRInfo,onAutoGenerateChange:M},t[111]=C.handleCreatePR,t[112]=C.handleGeneratePRInfo,t[113]=C.isPRDialogOpen,t[114]=C.prDescription,t[115]=C.prTitle,t[116]=C.setIsPRDialogOpen,t[117]=C.setPrDescription,t[118]=C.setPrTitle,t[119]=C.userPrefs.autoGeneratePRInfo,t[120]=v.isGeneratingPRInfo,t[121]=M,t[122]=N):N=t[122];let F;t[123]===C?F=t[124]:(F=()=>C.handlePushAndCreatePR(),t[123]=C,t[124]=F);let I;t[125]!==C.handleCancelPushBeforePR||t[126]!==C.isPushBeforePRDialogOpen||t[127]!==C.setIsPushBeforePRDialogOpen||t[128]!==F?(I={isOpen:C.isPushBeforePRDialogOpen,onOpenChange:C.setIsPushBeforePRDialogOpen,onPushAndCreatePR:F,onCancel:C.handleCancelPushBeforePR},t[125]=C.handleCancelPushBeforePR,t[126]=C.isPushBeforePRDialogOpen,t[127]=C.setIsPushBeforePRDialogOpen,t[128]=F,t[129]=I):I=t[129];let te;t[130]===C?te=t[131]:(te=e=>C.setUserPrefsState(t=>({...t,privateRepositoryDefault:e})),t[130]=C,t[131]=te);let ne;t[132]!==C.handleCreateRepo||t[133]!==C.isRepoDialogOpen||t[134]!==C.repoDescription||t[135]!==C.repoName||t[136]!==C.setIsRepoDialogOpen||t[137]!==C.setRepoDescription||t[138]!==C.setRepoName||t[139]!==C.userPrefs.privateRepositoryDefault||t[140]!==te?(ne={isOpen:C.isRepoDialogOpen,onOpenChange:C.setIsRepoDialogOpen,name:C.repoName,onNameChange:C.setRepoName,description:C.repoDescription,onDescriptionChange:C.setRepoDescription,isPrivate:C.userPrefs.privateRepositoryDefault,onPrivateChange:te,onCreateRepo:C.handleCreateRepo},t[132]=C.handleCreateRepo,t[133]=C.isRepoDialogOpen,t[134]=C.repoDescription,t[135]=C.repoName,t[136]=C.setIsRepoDialogOpen,t[137]=C.setRepoDescription,t[138]=C.setRepoName,t[139]=C.userPrefs.privateRepositoryDefault,t[140]=te,t[141]=ne):ne=t[141];let L;t[142]!==C.commits||t[143]!==C.displayedCommits||t[144]!==C.handleScroll||t[145]!==C.isHistoryDialogOpen||t[146]!==C.isLoadingMore||t[147]!==C.setIsHistoryDialogOpen?(L={isOpen:C.isHistoryDialogOpen,onOpenChange:C.setIsHistoryDialogOpen,commits:C.commits,displayedCommits:C.displayedCommits,isLoadingMore:C.isLoadingMore,onScroll:C.handleScroll},t[142]=C.commits,t[143]=C.displayedCommits,t[144]=C.handleScroll,t[145]=C.isHistoryDialogOpen,t[146]=C.isLoadingMore,t[147]=C.setIsHistoryDialogOpen,t[148]=L):L=t[148];let R;t[149]===C?R=t[150]:(R=()=>C.setIsPullWithChangesDialogOpen(!1),t[149]=C,t[150]=R);let re;t[151]!==C.handleCommitFirstAndPull||t[152]!==C.handleStashAndPull||t[153]!==C.isPullWithChangesDialogOpen||t[154]!==C.setIsPullWithChangesDialogOpen||t[155]!==R?(re={isOpen:C.isPullWithChangesDialogOpen,onOpenChange:C.setIsPullWithChangesDialogOpen,onCommitFirst:C.handleCommitFirstAndPull,onStashAndPull:C.handleStashAndPull,onCancel:R},t[151]=C.handleCommitFirstAndPull,t[152]=C.handleStashAndPull,t[153]=C.isPullWithChangesDialogOpen,t[154]=C.setIsPullWithChangesDialogOpen,t[155]=R,t[156]=re):re=t[156];let B;t[157]!==C.isLoading||t[158]!==j||t[159]!==N||t[160]!==I||t[161]!==ne||t[162]!==L||t[163]!==re||t[164]!==_.currentBranch?(B=(0,W.jsx)(Ae,{isLoading:C.isLoading,currentBranch:_.currentBranch,commit:j,pullRequest:N,pushBeforePR:I,createRepo:ne,history:L,pullWithChanges:re}),t[157]=C.isLoading,t[158]=j,t[159]=N,t[160]=I,t[161]=ne,t[162]=L,t[163]=re,t[164]=_.currentBranch,t[165]=B):B=t[165];let ie;return t[166]!==k||t[167]!==B?(ie=(0,W.jsxs)(W.Fragment,{children:[k,B]}),t[166]=k,t[167]=B,t[168]=ie):ie=t[168],ie}export{He as GitOpsButton};
|