@neuralnomads/codenomad-dev 1.1.0-dev-20261113-1a9b0f9e → 1.1.0-dev-20261114-c8dae86e

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.
Files changed (46) hide show
  1. package/dist/opencode/plugin-controls.test.js +21 -15
  2. package/dist/opencode/plugin-controls.test.js.map +1 -1
  3. package/package.json +1 -1
  4. package/public/assets/App-D0UdWSM2.js +215 -0
  5. package/public/assets/App-D0UdWSM2.js.map +1 -0
  6. package/public/assets/{FilesPanel-DMwbCv00.js → FilesPanel-BFKOqVhL.js} +4 -4
  7. package/public/assets/{FilesPanel-DMwbCv00.js.map → FilesPanel-BFKOqVhL.js.map} +1 -1
  8. package/public/assets/{StatusTab-DOghebB2.js → StatusTab-CKl50stg.js} +9 -9
  9. package/public/assets/{StatusTab-DOghebB2.js.map → StatusTab-CKl50stg.js.map} +1 -1
  10. package/public/assets/{agent-memory-cleanup-D09LNF5N.js → agent-memory-cleanup-DJuMUYIE.js} +2 -2
  11. package/public/assets/{agent-memory-cleanup-D09LNF5N.js.map → agent-memory-cleanup-DJuMUYIE.js.map} +1 -1
  12. package/public/assets/{app-tabs-BFFRsS1G.js → app-tabs-DzqGRT1h.js} +2 -2
  13. package/public/assets/{app-tabs-BFFRsS1G.js.map → app-tabs-DzqGRT1h.js.map} +1 -1
  14. package/public/assets/{client-state-D0va2vn9.js → client-state-C3lHTNnY.js} +2 -2
  15. package/public/assets/{client-state-D0va2vn9.js.map → client-state-C3lHTNnY.js.map} +1 -1
  16. package/public/assets/{client-state-BO6JwV_q.js → client-state-LxpCJ7As.js} +2 -2
  17. package/public/assets/{client-state-BO6JwV_q.js.map → client-state-LxpCJ7As.js.map} +1 -1
  18. package/public/assets/client-state-owner-commands-ode_WhLK.js +2 -0
  19. package/public/assets/{client-state-owner-commands-CU6VQEhP.js.map → client-state-owner-commands-ode_WhLK.js.map} +1 -1
  20. package/public/assets/{diff-viewer-FWGI722p.js → diff-viewer-d_llplfF.js} +2 -2
  21. package/public/assets/{diff-viewer-FWGI722p.js.map → diff-viewer-d_llplfF.js.map} +1 -1
  22. package/public/assets/{external-link-clicks-DOqdc0ik.js → external-link-clicks-BT_S6wz3.js} +2 -2
  23. package/public/assets/{external-link-clicks-DOqdc0ik.js.map → external-link-clicks-BT_S6wz3.js.map} +1 -1
  24. package/public/assets/{main-Bkm9LLSY.js → main-Bnc8FkyW.js} +6 -6
  25. package/public/assets/main-Bnc8FkyW.js.map +1 -0
  26. package/public/assets/{markdown-Df0e5bzs.js → markdown-B4sKKBx2.js} +2 -2
  27. package/public/assets/{markdown-Df0e5bzs.js.map → markdown-B4sKKBx2.js.map} +1 -1
  28. package/public/assets/{opener-startup-state-settings-card-C6udBhBA.js → opener-startup-state-settings-card-kOu4t6NL.js} +2 -2
  29. package/public/assets/{opener-startup-state-settings-card-C6udBhBA.js.map → opener-startup-state-settings-card-kOu4t6NL.js.map} +1 -1
  30. package/public/assets/{startup-state-settings-card-BydGv7OE.js → startup-state-settings-card-BbAvstdq.js} +2 -2
  31. package/public/assets/{startup-state-settings-card-BydGv7OE.js.map → startup-state-settings-card-BbAvstdq.js.map} +1 -1
  32. package/public/assets/{startup-state-settings-view-CVaxXzgE.js → startup-state-settings-view-B9j4CEK5.js} +3 -3
  33. package/public/assets/{startup-state-settings-view-CVaxXzgE.js.map → startup-state-settings-view-B9j4CEK5.js.map} +1 -1
  34. package/public/assets/{terminal-square-BeYqRxu8.js → terminal-square-BIJ_GeZj.js} +2 -2
  35. package/public/assets/{terminal-square-BeYqRxu8.js.map → terminal-square-BIJ_GeZj.js.map} +1 -1
  36. package/public/assets/{tool-call-DBade2gY.js → tool-call-QwCY5Afj.js} +4 -4
  37. package/public/assets/{tool-call-DBade2gY.js.map → tool-call-QwCY5Afj.js.map} +1 -1
  38. package/public/assets/{unified-picker-dYAbBq1q.js → unified-picker-BGT-47SC.js} +2 -2
  39. package/public/assets/{unified-picker-dYAbBq1q.js.map → unified-picker-BGT-47SC.js.map} +1 -1
  40. package/public/index.html +1 -1
  41. package/public/sw.js +1 -1
  42. package/public/sw.js.map +1 -1
  43. package/public/assets/App-B5-6zDBd.js +0 -215
  44. package/public/assets/App-B5-6zDBd.js.map +0 -1
  45. package/public/assets/client-state-owner-commands-CU6VQEhP.js +0 -2
  46. package/public/assets/main-Bkm9LLSY.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{c as a,n as ce,o as Ie,w as Oe,k as n,F as W,t as A,e as T,y as g,v as J,C as he,b as re,S as O,G as ee,a as ge,x as U,m as Re,B as ke,l as Me}from"./monaco-viewer-f4WrCr-d.js";import{a2 as ue,a3 as De,a4 as Te,a5 as xe,a6 as ae,a7 as Ge,a8 as qe,a9 as je,aa as Ne,ab as We,ac as He,ad as Be}from"./App-B5-6zDBd.js";import{I as oe,bm as Pe,ax as le,aX as Ue,C as Ae,F as Ve,de as Ee,hS as Xe,bR as Qe,aQ as Je,a as we,aR as Ke,ev as Ye,hT as Ze,ay as pe}from"./main-Bkm9LLSY.js";import{T as et}from"./terminal-square-BeYqRxu8.js";import"./index-vACU67gZ.js";import"./app-tabs-BFFRsS1G.js";import"./client-state-D0va2vn9.js";import"./client-state-BO6JwV_q.js";import"./git-diff-vendor-CQprbbW9.js";import"./fast-diff-vendor-n_jI32wr.js";import"./highlight-vendor-Cf42DLHD.js";import"./external-link-clicks-DOqdc0ik.js";const tt=[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m10 13-2 2 2 2",key:"17smn8"}],["path",{d:"m14 17 2-2-2-2",key:"14mezr"}]],nt=e=>a(oe,ce(e,{name:"FileCode",iconNode:tt})),it=[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]],at=e=>a(oe,ce(e,{name:"FileText",iconNode:it})),lt=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],st=e=>a(oe,ce(e,{name:"GitCommitHorizontal",iconNode:lt})),rt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ct=e=>a(oe,ce(e,{name:"Image",iconNode:rt})),p=e=>Number.parseFloat(e)||0,te=new Set;let ne=0;function ot(e){te.add(e),!ne&&(ne=requestAnimationFrame(()=>{ne=0;const o=[...te];te.clear();const b=o.map(u=>u());for(const u of b)u==null||u()}))}function ze(e){var d;if(e.matches(".action-overflow-trigger"))return 0;const o=getComputedStyle(e);if(o.display==="none")return 0;if(e instanceof SVGElement||e.matches("button:not(.git-panel-file-main), .workspace-tree-spacer"))return e.getBoundingClientRect().width;const b=[];for(const r of e.childNodes)if(r instanceof Element)b.push(ze(r));else if(r.nodeType===Node.TEXT_NODE&&((d=r.textContent)!=null&&d.trim())){const f=document.createRange();f.selectNode(r),b.push(f.getBoundingClientRect().width)}const u=b.filter(r=>r>0),_=o.flexDirection==="column";return(_?Math.max(0,...u):u.reduce((r,f)=>r+f,0))+(_?0:Math.max(0,u.length-1)*p(o.columnGap))+p(o.paddingLeft)+p(o.paddingRight)+p(o.borderLeftWidth)+p(o.borderRightWidth)}function dt(e){var f;const o=e.parentElement;if(!o)return;let b=!1;const u=()=>{if(b||!e.isConnected||!o.getBoundingClientRect().width)return;const v=e.querySelector(".action-overflow-trigger"),w=e.querySelector(".file-row-inline-actions");if(!v||!w)return;const i=ze(o),l=o.getBoundingClientRect().width,h=v.hasAttribute("data-expanded")||i>l+.5;if(e.dataset.compact===String(h))return;const E=document.activeElement,L=E instanceof Element&&e.contains(E)&&E.matches(".file-row-inline-actions button, .action-overflow-trigger");return()=>{b||!e.isConnected||(e.dataset.compact=String(h),w.inert=h,L&&queueMicrotask(()=>{if(b||!e.isConnected)return;const c=h?v:e.querySelector(".file-row-inline-actions button:not(:disabled)");c==null||c.focus({preventScroll:!0})}))}},_=()=>{b||ot(u)},d=new ResizeObserver(_);d.observe(o),d.observe(e);const r=new MutationObserver(_);r.observe(o,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["data-expanded"]}),(f=document.fonts)==null||f.addEventListener("loadingdone",_),_(),Ie(()=>{var v;b=!0,te.delete(u),te.size||(cancelAnimationFrame(ne),ne=0),d.disconnect(),r.disconnect(),(v=document.fonts)==null||v.removeEventListener("loadingdone",_)})}var gt=A("<button type=button class=file-row-icon-button>"),ht=A("<span class=file-row-actions data-compact=false><span class=file-row-pinned-actions></span><span class=file-row-inline-actions>");const ve=e=>{let o;Oe(()=>dt(o));const b=()=>e.items.filter(d=>typeof d.checked=="boolean"),u=()=>e.items.filter(d=>typeof d.checked!="boolean"),_=d=>(()=>{var r=gt();return r.$$click=()=>{d.onSelect()},n(r,()=>d.icon),T(f=>{var v=typeof d.checked=="boolean",w=d.label,i=d.label,l=d.checked,h=d.disabled;return v!==f.e&&r.classList.toggle("icon-toggle",f.e=v),w!==f.t&&g(r,"title",f.t=w),i!==f.a&&g(r,"aria-label",f.a=i),l!==f.o&&g(r,"aria-pressed",f.o=l),h!==f.i&&(r.disabled=f.i=h),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r})();return(()=>{var d=ht(),r=d.firstChild,f=r.nextSibling;d.$$pointerdown=w=>w.stopPropagation(),d.$$click=w=>w.stopPropagation();var v=o;return typeof v=="function"?J(v,d):o=d,n(r,a(W,{get each(){return b()},children:_})),n(f,a(W,{get each(){return u()},children:_})),n(d,a(Pe,{get items(){return u()},get label(){return e.label},triggerClass:"file-row-icon-button action-overflow-trigger"}),null),d})()};he(["click","pointerdown"]);const se=e=>e!=null&&e.matches("[data-git-item-id]")?e.querySelector(".git-panel-file-main"):null,ut=e=>e.matches(".git-change-hidden-rows")?e.querySelector("button"):null,Ce=(e,o)=>{const b=[];for(let u=e[o];u;u=u[o])b.push(u);return b};function vt(e){var f;const o=document.activeElement;if(!(o instanceof HTMLElement)||!e.contains(o))return;const b=Array.from(e.querySelectorAll("button")).indexOf(o),u=e.parentElement,_=Ce(e,"nextElementSibling"),d=Ce(e,"previousElementSibling"),r=(f=e.closest(".git-change-section"))==null?void 0:f.querySelector(".git-change-section-header");queueMicrotask(()=>{const v=document.activeElement;if(e.isConnected||v&&v!==document.body)return;const w=Array.from((u==null?void 0:u.children)??[]).find(l=>l!==e&&se(l)&&l.dataset.gitItemId===e.dataset.gitItemId),i=[w==null?void 0:w.querySelectorAll("button")[b],se(w??null),..._.map(l=>se(l)??ut(l)),...d.map(se)];for(const l of i)if(!(!(l!=null&&l.isConnected)||l.disabled)&&(l.focus(),document.activeElement===l))return;r!=null&&r.isConnected&&r.focus({preventScroll:!0})})}var mt=A('<p class="p-3 text-xs text-secondary"role=status>'),ft=A("<div class=workspace-tree><div class=workspace-tree-root><strong></strong></div><div role=tree>"),bt=A("<div role=treeitem class=workspace-tree-row><span class=workspace-tree-label>"),yt=A("<span class=workspace-tree-spacer>"),$t=A('<div class="p-3 text-xs text-error"role=alert>: <button>');function St(e){const o=i=>/\.(png|jpe?g|gif|webp|svg|ico|bmp|avif)$/i.test(i)?ct:/\.(md|mdx|txt|rst)$/i.test(i)?at:/\.(tsx?|jsx?|json|ya?ml|css|html|py|rs|sh)$/i.test(i)?nt:Xe;let b;const u=re(()=>{var i;return e.tree.rows().some(l=>l.path===e.tree.state().selected)?e.tree.state().selected:(i=e.tree.rows()[0])==null?void 0:i.path}),_=i=>{var l;return(l=b.querySelector(`[data-path="${CSS.escape(i)}"]`))==null?void 0:l.focus()},d=i=>{e.tree.select(i.path),i.type==="directory"&&e.tree.toggle(i.path)};function r(i,l){var c;if(i.target!==i.currentTarget)return;const h=e.tree.rows(),E=h.findIndex(F=>F.path===l.path),L=document.documentElement.dir==="rtl";if(i.key==="ArrowDown")_(h[Math.min(E+1,h.length-1)].path);else if(i.key==="ArrowUp")_(h[Math.max(E-1,0)].path);else if(i.key==="Home")_(h[0].path);else if(i.key==="End")_(h[h.length-1].path);else if(i.key===(L?"ArrowLeft":"ArrowRight")&&l.type==="directory")e.tree.state().expanded.has(l.path)?((c=h[E+1])==null?void 0:c.parent)===l.path&&_(h[E+1].path):e.tree.toggle(l.path);else if(i.key===(L?"ArrowRight":"ArrowLeft"))l.type==="directory"&&e.tree.state().expanded.has(l.path)?e.tree.toggle(l.path):_(l.parent);else if(i.key==="Enter"||i.key===" ")d(l);else return;i.preventDefault()}const f=async i=>{const l=await Ke(i);we({category:"copy",message:l?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:l?"success":"error"})},v=async(i,l)=>{try{await Te({target:i,instanceId:e.instanceId,worktreeSlug:e.worktreeSlug,path:l})}catch(h){we({category:"files",message:e.t("instanceShell.filesShell.toast.openError",{message:h instanceof Error?h.message:String(h)}),variant:"error"})}},w=i=>{const l=[];if(i.type==="file"&&l.push({key:"preview",label:`${e.t("filesPanel.viewer")} · ${i.path}`,get icon(){return a(ue,{class:"w-3.5 h-3.5"})},disabled:!e.canOpen,checked:e.previewPath===i.path,onSelect:()=>e.onOpen(i.path)}),De())if(i.type==="directory"){const h=kt&&i.path.toLowerCase().endsWith(".app");l.push({key:"open-folder",label:e.t(h?"instanceShell.filesShell.actions.showInFolder":"instanceShell.filesShell.actions.openFolder"),get icon(){return a(le,{class:"w-3.5 h-3.5"})},onSelect:()=>v(h?"reveal":"default",i.path)},{key:"open-terminal",label:e.t("instanceShell.filesShell.actions.openTerminal"),get icon(){return a(et,{class:"w-3.5 h-3.5"})},onSelect:()=>v("terminal",i.path)})}else Le&&l.push({key:"open-default",label:e.t({open:"instanceShell.filesShell.actions.openDefault",edit:"instanceShell.filesShell.actions.editDefault",choose:"instanceShell.filesShell.actions.chooseApplication"}[Ct(i.path)]),get icon(){return a(Qe,{class:"w-3.5 h-3.5"})},onSelect:()=>v("default",i.path)}),l.push({key:"show-in-folder",label:e.t("instanceShell.filesShell.actions.showInFolder"),get icon(){return a(le,{class:"w-3.5 h-3.5"})},onSelect:()=>v("reveal",i.path)});return l.push({key:"copy-path",label:e.t("instanceShell.filesShell.actions.copyPath"),get icon(){return a(Je,{class:"w-3.5 h-3.5"})},onSelect:()=>f(i.path)}),l};return(()=>{var i=ft(),l=i.firstChild,h=l.firstChild,E=l.nextSibling;n(l,a(le,{size:15}),h),n(h,()=>e.directory.replace(/\\/g,"/").split("/").pop());var L=b;return typeof L=="function"?J(L,E):b=E,n(E,a(W,{get each(){return e.tree.rows()},children:c=>{const F=c.type==="directory",y=o(c.name),s=()=>e.tree.state().expanded.has(c.path),k=re(()=>w(c));return(()=>{var $=bt(),M=$.firstChild;return $.$$click=()=>d(c),$.$$keydown=C=>r(C,c),$.addEventListener("focus",()=>e.tree.select(c.path)),n($,a(O,{when:F,get fallback(){return yt()},get children(){return a(O,{get when(){return s()},get fallback(){return a(Ae,{size:12})},get children(){return a(Ue,{size:12})}})}}),M),n($,a(O,{when:F,get fallback(){return a(y,{size:14})},get children(){return a(O,{get when(){return s()},get fallback(){return a(Ve,{size:14})},get children(){return a(le,{size:14})}})}}),M),n(M,()=>c.name),n($,a(O,{get when(){return e.tree.busy().has(c.path)},get children(){return a(Ee,{size:12,class:"animate-spin"})}}),null),n($,a(ve,{get items(){return k()},get label(){return e.t("instanceShell.filesShell.actions.more",{name:c.name})}}),null),T(C=>{var q=c.path,H=c.name,K=c.depth,V=F?s():void 0,X=e.tree.state().selected===c.path,Q=`${8+c.depth*14}px`,B=c.path,N=u()===c.path?0:-1;return q!==C.e&&g($,"data-path",C.e=q),H!==C.t&&g($,"aria-label",C.t=H),K!==C.a&&g($,"aria-level",C.a=K),V!==C.o&&g($,"aria-expanded",C.o=V),X!==C.i&&g($,"aria-selected",C.i=X),Q!==C.n&&ee($,"padding-inline-start",C.n=Q),B!==C.s&&g($,"title",C.s=B),N!==C.h&&g($,"tabindex",C.h=N),C},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),$})()}})),n(i,a(W,{get each(){return[...e.tree.errors()]},children:([c,F])=>(()=>{var y=$t(),s=y.firstChild,k=s.nextSibling;return n(y,c,s),n(y,F,k),k.$$click=()=>{e.tree.load(c,!0)},n(k,()=>e.t("instanceShell.rightPanel.actions.refresh")),y})()}),null),n(i,a(O,{get when(){return e.tree.busy().has(".")},get children(){var c=mt();return n(c,()=>e.t("instanceInfo.loading")),c}}),null),T(c=>{var F=e.directory,y=e.t("filesPanel.workspace");return F!==c.e&&g(l,"title",c.e=F),y!==c.t&&g(E,"aria-label",c.t=y),c},{e:void 0,t:void 0}),i})()}const Le=typeof navigator<"u"&&/windows/i.test(navigator.userAgent),kt=typeof navigator<"u"&&/macintosh|mac os x/i.test(navigator.userAgent),xt=new Set(["7z","avi","bmp","c","cc","cfg","conf","cpp","cs","css","csv","dart","diff","docx","env","flac","fs","fsx","gif","go","gz","h","hpp","htm","html","ini","java","jpeg","jpg","json","jsonc","jsx","kt","kts","less","lock","log","lua","md","markdown","mkv","mov","mp3","mp4","ogg","patch","pdf","png","pptx","r","rar","rmd","rs","scss","sql","svg","svelte","swift","tar","toml","ts","tsx","txt","vue","wav","webm","webp","xlsx","xml","yaml","yml","zip"]),wt=new Set(["bat","cmd","js","jse","pl","ps1","psd1","psm1","py","pyw","rb","reg","vbe","vbs","wsf","wsh"]);function Ct(e){const o=e.split(/[\\/]/).pop()??"",b=o.lastIndexOf("."),u=b>0?o.slice(b+1).toLowerCase():"";return!Le||u&&xt.has(u)?"open":u&&wt.has(u)?"edit":"choose"}he(["keydown","click"]);var _e=A("<option>"),_t=A("<span class=git-panel-count>"),Ft=A('<div role=alert class="p-3 text-error text-xs">'),de=A('<p class="p-3 text-xs text-secondary">'),It=A('<div class=git-init-empty><p></p><button type=button class="git-change-commit-button git-init-button">'),Fe=A("<button class=git-panel-more>"),At=A("<button class=git-panel-back>"),Et=A('<p class="p-3 text-xs text-secondary"role=status>'),zt=A("<section class=git-panel><header class=git-panel-context><div class=git-panel-branch><strong></strong><button class=files-header-icon-button></button></div><select class=git-panel-worktree></select></header><div class=git-panel-tools><div class=git-panel-switch role=group><button></button><button></button><button></button></div></div><div class=git-panel-body></div><div class=git-panel-body><div><input class=git-panel-filter></div></div><div class=git-panel-body>"),Lt=A("<span class=git-history-refs>"),Ot=A("<button class=git-history-row><span class=git-history-row-content><strong></strong><span class=git-history-meta><span> · </span><code>"),Rt=A("<div class=git-commit-summary><code></code><p></p><span>"),Mt=A("<div class=git-commit-files>"),Dt=A('<div class=git-panel-file-row><button class="git-panel-file git-panel-file-main"><span></span><span>'),Tt=A('<div class=git-change-commit-box role=group><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),Gt=A('<div class=git-change-hidden-rows><span class=git-change-hidden-rows-label></span><button type=button class="button-secondary git-change-hidden-rows-button">'),qt=A('<div class="git-drop-zone git-change-section"><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class="git-change-section-chevron disclosure-chevron"></span><span class=git-change-section-title></span></span><span class=git-change-section-count></span></button><div>'),jt=A('<div class=git-panel-file-row><button class="git-panel-file git-panel-file-main"><span class=git-file-status></span><span></span><small><b class=file-list-item-additions>+</b> <b class=file-list-item-deletions>−');const en=e=>{const o=e.git.gitListItems,[b,u]=ge(""),[_,d]=ge(""),r=s=>{const k=ae(e.instanceId);return!!(k&&k.slug===e.slug&&k.directory===e.directory&&k.path===s.path&&(k.kind??"diff")===(s.kind??"diff")&&k.commit===s.commit&&k.scope===s.scope)},f=s=>{r(s)?Ne(e.instanceId):e.onOpenFile(s)};let v,w=0;const i=s=>{w=(v==null?void 0:v.scrollTop)??0,e.history.select(s)},l=()=>{e.history.back(),requestAnimationFrame(()=>{v!=null&&v.isConnected&&(v.scrollTop=w)})},h=re(()=>{var s;return(((s=e.history.page())==null?void 0:s.commits)??[]).filter(k=>`${k.subject} ${k.author} ${k.id}`.toLowerCase().includes(b().toLowerCase()))}),E=({draggable:s,droppable:k})=>{if(!k)return;const $=String(k.id);if($!=="staged"&&$!=="unstaged")return;const M=o().find(C=>C.id===String(s.id));!M||M.section===$||($==="staged"?e.git.stageGitFile(M):e.git.unstageGitFile(M))},L=()=>e.mode==="workspace"?e.tree.busy().size>0:e.mode==="history"?e.history.loading()||e.history.detailLoading():e.git.gitStatusLoading(),c=()=>e.mode==="workspace"||!e.gitAvailable?null:e.mode==="history"?e.history.error():e.git.gitStatusError(),F=s=>s.replace(/\\/g,"/").split("/").pop()||s,y=s=>new Date(s).toLocaleDateString(document.documentElement.lang||void 0,{month:"short",day:"numeric"});return(()=>{var s=zt(),k=s.firstChild,$=k.firstChild,M=$.firstChild,C=M.nextSibling,q=$.nextSibling,H=k.nextSibling,K=H.firstChild,V=K.firstChild,X=V.nextSibling,Q=X.nextSibling,B=H.nextSibling,N=B.nextSibling,Y=N.firstChild,ie=Y.firstChild,me=N.nextSibling;n($,a(xe,{size:16}),M),n(M,(()=>{var t=U(()=>!!e.gitAvailable);return()=>t()?e.branch||e.t("gitPanel.detached"):F(e.directory)})()),C.$$click=()=>{e.mode==="workspace"?e.tree.refresh():e.gitAvailable?e.mode==="history"?e.history.refresh():e.git.refreshGitStatus():e.gitInit.recheck()},n(C,a(Ee,{size:14,get class(){return L()?"animate-spin":""}})),q.addEventListener("change",t=>e.onWorktreeChange(t.currentTarget.value)),n(q,a(O,{get when(){return!e.worktrees.some(t=>t.slug===e.slug)},get children(){var t=_e();return n(t,()=>F(e.directory)),T(()=>t.value=e.slug),t}}),null),n(q,a(W,{get each(){return e.worktrees},children:t=>(()=>{var S=_e();return n(S,()=>F(t.directory),null),n(S,(()=>{var m=U(()=>!!e.gitAvailable);return()=>m()?` · ${t.branch||e.t("gitPanel.detached")}`:""})(),null),T(()=>S.value=t.slug),S})()}),null),V.$$click=()=>e.onModeChange("workspace"),n(V,()=>e.t("filesPanel.workspace")),X.$$click=()=>e.onModeChange("changes"),n(X,()=>e.t("gitPanel.changes")),Q.$$click=()=>e.onModeChange("history"),n(Q,()=>e.t("filesPanel.commits")),n(H,a(O,{get when(){return U(()=>!!(e.gitAvailable&&e.mode==="changes"))()&&e.git.gitStatusEntries()},get children(){var t=_t();return n(t,()=>{var S;return e.t("gitPanel.files",{count:((S=e.git.gitStatusEntries())==null?void 0:S.length)??0})}),t}}),null),n(s,a(O,{get when(){return c()},get children(){var t=Ft();return n(t,c),t}}),B),n(s,a(O,{get when(){return!e.canOpenFile},get children(){var t=de();return n(t,()=>e.t("instanceShell.gitChanges.noSessionSelected")),t}}),B),n(B,a(St,{get tree(){return e.tree},get t(){return e.t},get directory(){return e.directory},get instanceId(){return e.instanceId},get worktreeSlug(){return e.slug},get canOpen(){return e.canOpenFile},get previewPath(){var t;return U(()=>{var S,m;return((S=ae(e.instanceId))==null?void 0:S.kind)==="workspace"&&((m=ae(e.instanceId))==null?void 0:m.slug)===e.slug})()?(t=ae(e.instanceId))==null?void 0:t.path:void 0},onOpen:t=>f({kind:"workspace",path:t})})),n(s,a(O,{get when(){return U(()=>!e.gitAvailable)()&&e.mode!=="workspace"},get children(){var t=It(),S=t.firstChild,m=S.nextSibling;return n(S,()=>e.t("filesPanel.gitInit.notRepository")),m.$$click=()=>{e.gitInit.initialize()},n(m,a(xe,{size:14,"aria-hidden":"true"}),null),n(m,()=>e.t(e.gitInit.pending()?"filesPanel.gitInit.pending":"filesPanel.gitInit.action"),null),T(I=>{var D=e.gitInit.pending(),x=e.gitInit.pending(),R=e.directory;return D!==I.e&&(m.disabled=I.e=D),x!==I.t&&g(m,"aria-busy",I.t=x),R!==I.a&&g(m,"title",I.a=R),I},{e:void 0,t:void 0,a:void 0}),t}}),N);var fe=v;return typeof fe=="function"?J(fe,N):v=N,ie.$$input=t=>u(t.currentTarget.value),n(Y,a(W,{get each(){return h()},children:t=>(()=>{var S=Ot(),m=S.firstChild,I=m.firstChild,D=I.nextSibling,x=D.firstChild,R=x.firstChild,j=x.nextSibling;return S.$$click=()=>i(t.id),n(S,a(st,{class:"git-history-mark",size:16}),m),n(I,()=>t.subject),n(m,a(O,{get when(){return t.refs},get children(){var z=Lt();return n(z,()=>t.refs),T(()=>g(z,"title",t.refs)),z}}),D),n(x,()=>t.author,R),n(x,()=>y(t.date),null),n(j,()=>t.id.slice(0,7)),S})()}),null),n(Y,a(O,{get when(){return U(()=>!L())()&&h().length===0},get children(){var t=de();return n(t,()=>e.t("gitPanel.emptyHistory")),t}}),null),n(Y,a(O,{get when(){var t;return(t=e.history.page())==null?void 0:t.hasMore},get children(){var t=Fe();return t.$$click=()=>{e.history.refresh(!0)},n(t,()=>e.t("gitPanel.more")),T(()=>t.disabled=L()),t}}),null),n(N,a(O,{get when(){return e.history.selected()},get children(){return[(()=>{var t=At();return t.$$click=l,n(t,a(Ye,{size:14}),null),n(t,()=>e.t("filesPanel.commits"),null),t})(),a(O,{get when(){return e.history.details()},children:t=>[(()=>{var S=Rt(),m=S.firstChild,I=m.nextSibling,D=I.nextSibling;return n(m,()=>t().id.slice(0,8)),n(I,()=>t().message),n(D,()=>e.t("gitPanel.files",{count:t().files.length})),S})(),(()=>{var S=Mt();return n(S,a(W,{get each(){return t().files},children:m=>{const I=()=>({path:m.path,commit:t().id,subject:t().message.split(`
2
- `)[0]});return(()=>{var D=Dt(),x=D.firstChild,R=x.firstChild,j=R.nextSibling;return x.$$click=()=>d(`${t().id}:${m.path}`),n(R,()=>m.status),n(j,()=>m.path),n(D,a(ve,{get label(){return e.t("instanceShell.filesShell.actions.more",{name:m.path})},get items(){return[{key:"preview",label:`${e.t("filesPanel.viewer")} · ${m.path}`,icon:a(ue,{size:14}),checked:r(I()),disabled:!e.canOpenFile,onSelect:()=>f(I())}]}}),null),T(z=>{var G=_()===`${t().id}:${m.path}`,P=m.originalPath?`${m.originalPath} → ${m.path}`:m.path,Z=`git-file-status git-file-status-${m.status}`;return G!==z.e&&D.classList.toggle("git-panel-file-selected",z.e=G),P!==z.t&&g(x,"title",z.t=P),Z!==z.a&&Re(R,z.a=Z),z},{e:void 0,t:void 0,a:void 0}),D})()}})),S})()]})]}}),null),n(N,a(O,{get when(){return L()},get children(){var t=Et();return n(t,()=>e.t("instanceInfo.loading")),t}}),null),n(me,a(je,{collisionDetector:Ge,onDragEnd:E,get children(){return a(qe,{get children(){return[a(O,{get when(){return o().length===0},get children(){var t=de();return n(t,(()=>{var S=U(()=>!!e.git.gitStatusLoading());return()=>S()?e.t("instanceInfo.loading"):e.t("instanceShell.gitChanges.empty")})()),t}}),a(W,{each:["staged","unstaged"],children:t=>a(Nt,{get t(){return e.t},section:t,get git(){return e.git},get canOpenFile(){return e.canOpenFile},onOpenFile:f,previewActive:r,get children(){return a(O,{when:t==="staged",get children(){var S=Tt(),m=S.firstChild,I=m.firstChild,D=I.nextSibling;return n(S,a(W,{each:["staged","unstaged"],children:x=>{const R=re(()=>e.git.gitActionItems().filter(z=>z.section===x)),j=x==="staged"?"unstage":"stage";return a(O,{get when(){return R().length>0},get children(){var z=Fe();return z.$$click=()=>{const G=R()[0];G&&(x==="staged"?e.git.unstageGitFile(G):e.git.stageGitFile(G))},n(z,(()=>{var G=U(()=>R().length>1);return()=>{var P;return G()?e.t(`instanceShell.gitChanges.actions.${j}Selected`,{count:R().length}):`${e.t(`instanceShell.gitChanges.actions.${j}`)} · ${((P=R()[0])==null?void 0:P.path)??""}`}})()),T(()=>g(z,"title",R().map(G=>G.path).join(`
3
- `))),z}})}}),m),I.$$input=x=>e.git.setGitCommitMessage(x.currentTarget.value),D.$$click=()=>{e.git.submitGitCommit()},n(D,()=>e.t(e.git.gitCommitSubmitting()?"instanceShell.gitChanges.commit.submitting":"instanceShell.gitChanges.commit.submit")),T(x=>{var R=e.t("gitPanel.actions"),j=e.t("instanceShell.gitChanges.commit.placeholder"),z=e.t("instanceShell.gitChanges.commit.placeholder"),G=!e.git.gitCommitMessage().trim()||e.git.gitChangeWindow("staged").total===0||e.git.gitCommitSubmitting();return R!==x.e&&g(S,"aria-label",x.e=R),j!==x.t&&g(I,"aria-label",x.t=j),z!==x.a&&g(I,"placeholder",x.a=z),G!==x.o&&(D.disabled=x.o=G),x},{e:void 0,t:void 0,a:void 0,o:void 0}),T(()=>I.value=e.git.gitCommitMessage()),S}})}})})]}})}})),T(t=>{var S=e.t("instanceShell.rightPanel.tabs.files"),m=e.t("instanceShell.rightPanel.actions.refresh"),I=L(),D=e.t("gitPanel.worktree"),x=e.directory,R=e.t("instanceShell.rightPanel.tabs.files"),j=e.mode==="workspace",z=e.mode==="changes",G=e.mode==="history",P=e.mode==="workspace"?void 0:"none",Z=e.gitAvailable&&e.mode==="history"?void 0:"none",be=e.history.selected()?"none":void 0,ye=e.t("gitPanel.filter"),$e=e.t("gitPanel.filter"),Se=e.gitAvailable&&e.mode==="changes"?void 0:"none";return S!==t.e&&g(s,"aria-label",t.e=S),m!==t.t&&g(C,"aria-label",t.t=m),I!==t.a&&(C.disabled=t.a=I),D!==t.o&&g(q,"aria-label",t.o=D),x!==t.i&&g(q,"title",t.i=x),R!==t.n&&g(K,"aria-label",t.n=R),j!==t.s&&g(V,"aria-pressed",t.s=j),z!==t.h&&g(X,"aria-pressed",t.h=z),G!==t.r&&g(Q,"aria-pressed",t.r=G),P!==t.d&&ee(B,"display",t.d=P),Z!==t.l&&ee(N,"display",t.l=Z),be!==t.u&&ee(Y,"display",t.u=be),ye!==t.c&&g(ie,"aria-label",t.c=ye),$e!==t.w&&g(ie,"placeholder",t.w=$e),Se!==t.m&&ee(me,"display",t.m=Se),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0}),T(()=>q.value=e.slug),T(()=>ie.value=b()),s})()},Nt=e=>{const o=We(e.section),[b,u]=ge(!0),_=ke(),d=ke(),r=()=>e.git.gitChangeWindow(e.section),f=i=>i.toLocaleString(document.documentElement.lang||void 0);let v;const w=i=>{var L;const l=r().firstHiddenId,h=document.activeElement===i;if(e.git.revealGitChanges(e.section),!h||!l)return;const E=Array.from(v.querySelectorAll("[data-git-item-id]")).find(c=>c.dataset.gitItemId===l);(L=E==null?void 0:E.querySelector("button:enabled"))==null||L.focus({preventScroll:!0})};return(()=>{var i=qt(),l=i.firstChild,h=l.firstChild,E=h.firstChild,L=E.nextSibling,c=h.nextSibling,F=l.nextSibling;J(o,i),l.$$click=()=>u(s=>!s),g(l,"aria-controls",_),n(E,a(Ae,{class:"w-3.5 h-3.5","aria-hidden":"true"})),n(L,()=>e.t(`instanceShell.gitChanges.sections.${e.section}`)),n(c,()=>r().total);var y=v;return typeof y=="function"?J(y,F):v=F,g(F,"id",_),n(F,()=>e.children,null),n(F,a(W,{get each(){return r().rows},children:s=>a(Wt,{get t(){return e.t},item:s,get git(){return e.git},get canOpenFile(){return e.canOpenFile},get onOpenFile(){return e.onOpenFile},get previewActive(){return e.previewActive}})}),null),n(F,a(O,{get when(){return r().hidden>0},get children(){var s=Gt(),k=s.firstChild,$=k.nextSibling;return g(k,"id",d),n(k,()=>e.t(r().hidden===1?"instanceShell.gitChanges.hiddenRows.one":"instanceShell.gitChanges.hiddenRows.other",{count:f(r().hidden)})),$.$$click=M=>w(M.currentTarget),g($,"aria-describedby",d),n($,()=>e.t("instanceShell.gitChanges.hiddenRows.show",{count:f(r().nextReveal)})),s}}),null),T(s=>{var k=!!o.isActiveDroppable,$=b(),M=!b();return k!==s.e&&i.classList.toggle("git-drop-active",s.e=k),$!==s.t&&g(l,"aria-expanded",s.t=$),M!==s.a&&(F.hidden=s.a=M),s},{e:void 0,t:void 0,a:void 0}),i})()},Wt=e=>{const o=He(e.item.id),b=()=>e.item.section==="staged",u=()=>{b()?e.git.unstageGitFile(e.item):e.git.stageGitFile(e.item)},_=()=>e.t(b()?"instanceShell.gitChanges.actions.unstage":"instanceShell.gitChanges.actions.stage"),d=()=>({path:e.item.path,originalPath:e.item.originalPath,scope:e.item.section}),r=[{key:"preview",get label(){return`${e.t("filesPanel.viewer")} · ${e.item.path}`},icon:a(ue,{size:14}),get checked(){return e.previewActive(d())},get disabled(){return!e.canOpenFile},onSelect:()=>e.onOpenFile(d())},{key:"stage",get label(){return`${_()} · ${e.item.path}`},get icon(){return a(O,{get when(){return b()},get fallback(){return a(pe,{size:14})},get children(){return a(Ze,{size:14})}})},onSelect:u}],f=()=>e.git.isGitItemSelected(e.item.id);let v;return Ie(()=>vt(v)),(()=>{var w=jt(),i=w.firstChild,l=i.firstChild,h=l.nextSibling,E=h.nextSibling,L=E.firstChild;L.firstChild;var c=L.nextSibling,F=c.nextSibling;return F.firstChild,J(y=>{v=y,o(y)},w),i.$$click=y=>{e.git.handleGitRowClick(e.item,y)},n(l,()=>e.item.status.slice(0,1).toUpperCase()),n(h,()=>e.item.path),n(L,()=>e.item.additions,null),n(F,()=>e.item.deletions,null),n(w,a(ve,{get label(){return e.t("instanceShell.filesShell.actions.more",{name:e.item.path})},items:r}),null),T(y=>{var s=e.item.id,k=!!f(),$=Be(o.transform),M=f(),C=e.git.isGitItemCurrent(e.item.id)?"true":void 0,q=e.item.path,H=!e.canOpenFile;return s!==y.e&&g(w,"data-git-item-id",y.e=s),k!==y.t&&w.classList.toggle("git-panel-file-selected",y.t=k),y.a=Me(w,$,y.a),M!==y.o&&g(i,"aria-pressed",y.o=M),C!==y.i&&g(i,"aria-current",y.i=C),q!==y.n&&g(i,"title",y.n=q),H!==y.s&&(i.disabled=y.s=H),y},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),w})()};he(["click","input"]);export{en as default};
4
- //# sourceMappingURL=FilesPanel-DMwbCv00.js.map
1
+ import{c as a,n as ce,o as Ie,w as Oe,k as n,F as W,t as A,e as T,y as g,v as J,C as he,b as re,S as O,G as ee,a as ge,x as P,m as Re,B as ke,l as Me}from"./monaco-viewer-f4WrCr-d.js";import{a2 as ue,a3 as De,a4 as Te,a5 as we,a6 as ae,a7 as Ge,a8 as qe,a9 as je,aa as Ne,ab as We,ac as He,ad as Be}from"./App-D0UdWSM2.js";import{I as oe,bm as Ue,ax as le,aX as Pe,C as Ae,F as Ve,df as Ee,hT as Xe,bR as Qe,aQ as Je,a as xe,aR as Ke,ew as Ye,hU as Ze,ay as pe}from"./main-Bnc8FkyW.js";import{T as et}from"./terminal-square-BIJ_GeZj.js";import"./index-vACU67gZ.js";import"./app-tabs-DzqGRT1h.js";import"./client-state-C3lHTNnY.js";import"./client-state-LxpCJ7As.js";import"./git-diff-vendor-CQprbbW9.js";import"./fast-diff-vendor-n_jI32wr.js";import"./highlight-vendor-Cf42DLHD.js";import"./external-link-clicks-BT_S6wz3.js";const tt=[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m10 13-2 2 2 2",key:"17smn8"}],["path",{d:"m14 17 2-2-2-2",key:"14mezr"}]],nt=e=>a(oe,ce(e,{name:"FileCode",iconNode:tt})),it=[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]],at=e=>a(oe,ce(e,{name:"FileText",iconNode:it})),lt=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],st=e=>a(oe,ce(e,{name:"GitCommitHorizontal",iconNode:lt})),rt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ct=e=>a(oe,ce(e,{name:"Image",iconNode:rt})),p=e=>Number.parseFloat(e)||0,te=new Set;let ne=0;function ot(e){te.add(e),!ne&&(ne=requestAnimationFrame(()=>{ne=0;const o=[...te];te.clear();const b=o.map(u=>u());for(const u of b)u==null||u()}))}function ze(e){var d;if(e.matches(".action-overflow-trigger"))return 0;const o=getComputedStyle(e);if(o.display==="none")return 0;if(e instanceof SVGElement||e.matches("button:not(.git-panel-file-main), .workspace-tree-spacer"))return e.getBoundingClientRect().width;const b=[];for(const r of e.childNodes)if(r instanceof Element)b.push(ze(r));else if(r.nodeType===Node.TEXT_NODE&&((d=r.textContent)!=null&&d.trim())){const f=document.createRange();f.selectNode(r),b.push(f.getBoundingClientRect().width)}const u=b.filter(r=>r>0),_=o.flexDirection==="column";return(_?Math.max(0,...u):u.reduce((r,f)=>r+f,0))+(_?0:Math.max(0,u.length-1)*p(o.columnGap))+p(o.paddingLeft)+p(o.paddingRight)+p(o.borderLeftWidth)+p(o.borderRightWidth)}function dt(e){var f;const o=e.parentElement;if(!o)return;let b=!1;const u=()=>{if(b||!e.isConnected||!o.getBoundingClientRect().width)return;const v=e.querySelector(".action-overflow-trigger"),x=e.querySelector(".file-row-inline-actions");if(!v||!x)return;const i=ze(o),l=o.getBoundingClientRect().width,h=v.hasAttribute("data-expanded")||i>l+.5;if(e.dataset.compact===String(h))return;const E=document.activeElement,L=E instanceof Element&&e.contains(E)&&E.matches(".file-row-inline-actions button, .action-overflow-trigger");return()=>{b||!e.isConnected||(e.dataset.compact=String(h),x.inert=h,L&&queueMicrotask(()=>{if(b||!e.isConnected)return;const c=h?v:e.querySelector(".file-row-inline-actions button:not(:disabled)");c==null||c.focus({preventScroll:!0})}))}},_=()=>{b||ot(u)},d=new ResizeObserver(_);d.observe(o),d.observe(e);const r=new MutationObserver(_);r.observe(o,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["data-expanded"]}),(f=document.fonts)==null||f.addEventListener("loadingdone",_),_(),Ie(()=>{var v;b=!0,te.delete(u),te.size||(cancelAnimationFrame(ne),ne=0),d.disconnect(),r.disconnect(),(v=document.fonts)==null||v.removeEventListener("loadingdone",_)})}var gt=A("<button type=button class=file-row-icon-button>"),ht=A("<span class=file-row-actions data-compact=false><span class=file-row-pinned-actions></span><span class=file-row-inline-actions>");const ve=e=>{let o;Oe(()=>dt(o));const b=()=>e.items.filter(d=>typeof d.checked=="boolean"),u=()=>e.items.filter(d=>typeof d.checked!="boolean"),_=d=>(()=>{var r=gt();return r.$$click=()=>{d.onSelect()},n(r,()=>d.icon),T(f=>{var v=typeof d.checked=="boolean",x=d.label,i=d.label,l=d.checked,h=d.disabled;return v!==f.e&&r.classList.toggle("icon-toggle",f.e=v),x!==f.t&&g(r,"title",f.t=x),i!==f.a&&g(r,"aria-label",f.a=i),l!==f.o&&g(r,"aria-pressed",f.o=l),h!==f.i&&(r.disabled=f.i=h),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r})();return(()=>{var d=ht(),r=d.firstChild,f=r.nextSibling;d.$$pointerdown=x=>x.stopPropagation(),d.$$click=x=>x.stopPropagation();var v=o;return typeof v=="function"?J(v,d):o=d,n(r,a(W,{get each(){return b()},children:_})),n(f,a(W,{get each(){return u()},children:_})),n(d,a(Ue,{get items(){return u()},get label(){return e.label},triggerClass:"file-row-icon-button action-overflow-trigger"}),null),d})()};he(["click","pointerdown"]);const se=e=>e!=null&&e.matches("[data-git-item-id]")?e.querySelector(".git-panel-file-main"):null,ut=e=>e.matches(".git-change-hidden-rows")?e.querySelector("button"):null,Ce=(e,o)=>{const b=[];for(let u=e[o];u;u=u[o])b.push(u);return b};function vt(e){var f;const o=document.activeElement;if(!(o instanceof HTMLElement)||!e.contains(o))return;const b=Array.from(e.querySelectorAll("button")).indexOf(o),u=e.parentElement,_=Ce(e,"nextElementSibling"),d=Ce(e,"previousElementSibling"),r=(f=e.closest(".git-change-section"))==null?void 0:f.querySelector(".git-change-section-header");queueMicrotask(()=>{const v=document.activeElement;if(e.isConnected||v&&v!==document.body)return;const x=Array.from((u==null?void 0:u.children)??[]).find(l=>l!==e&&se(l)&&l.dataset.gitItemId===e.dataset.gitItemId),i=[x==null?void 0:x.querySelectorAll("button")[b],se(x??null),..._.map(l=>se(l)??ut(l)),...d.map(se)];for(const l of i)if(!(!(l!=null&&l.isConnected)||l.disabled)&&(l.focus(),document.activeElement===l))return;r!=null&&r.isConnected&&r.focus({preventScroll:!0})})}var mt=A('<p class="p-3 text-xs text-secondary"role=status>'),ft=A("<div class=workspace-tree><div class=workspace-tree-root><strong></strong></div><div role=tree>"),bt=A("<div role=treeitem class=workspace-tree-row><span class=workspace-tree-label>"),yt=A("<span class=workspace-tree-spacer>"),$t=A('<div class="p-3 text-xs text-error"role=alert>: <button>');function St(e){const o=i=>/\.(png|jpe?g|gif|webp|svg|ico|bmp|avif)$/i.test(i)?ct:/\.(md|mdx|txt|rst)$/i.test(i)?at:/\.(tsx?|jsx?|json|ya?ml|css|html|py|rs|sh)$/i.test(i)?nt:Xe;let b;const u=re(()=>{var i;return e.tree.rows().some(l=>l.path===e.tree.state().selected)?e.tree.state().selected:(i=e.tree.rows()[0])==null?void 0:i.path}),_=i=>{var l;return(l=b.querySelector(`[data-path="${CSS.escape(i)}"]`))==null?void 0:l.focus()},d=i=>{e.tree.select(i.path),i.type==="directory"&&e.tree.toggle(i.path)};function r(i,l){var c;if(i.target!==i.currentTarget)return;const h=e.tree.rows(),E=h.findIndex(F=>F.path===l.path),L=document.documentElement.dir==="rtl";if(i.key==="ArrowDown")_(h[Math.min(E+1,h.length-1)].path);else if(i.key==="ArrowUp")_(h[Math.max(E-1,0)].path);else if(i.key==="Home")_(h[0].path);else if(i.key==="End")_(h[h.length-1].path);else if(i.key===(L?"ArrowLeft":"ArrowRight")&&l.type==="directory")e.tree.state().expanded.has(l.path)?((c=h[E+1])==null?void 0:c.parent)===l.path&&_(h[E+1].path):e.tree.toggle(l.path);else if(i.key===(L?"ArrowRight":"ArrowLeft"))l.type==="directory"&&e.tree.state().expanded.has(l.path)?e.tree.toggle(l.path):_(l.parent);else if(i.key==="Enter"||i.key===" ")d(l);else return;i.preventDefault()}const f=async i=>{const l=await Ke(i);xe({category:"copy",message:l?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:l?"success":"error"})},v=async(i,l)=>{try{await Te({target:i,instanceId:e.instanceId,worktreeSlug:e.worktreeSlug,path:l})}catch(h){xe({category:"files",message:e.t("instanceShell.filesShell.toast.openError",{message:h instanceof Error?h.message:String(h)}),variant:"error"})}},x=i=>{const l=[];if(i.type==="file"&&l.push({key:"preview",label:`${e.t("filesPanel.viewer")} · ${i.path}`,get icon(){return a(ue,{class:"w-3.5 h-3.5"})},disabled:!e.canOpen,checked:e.previewPath===i.path,onSelect:()=>e.onOpen(i.path)}),De())if(i.type==="directory"){const h=kt&&i.path.toLowerCase().endsWith(".app");l.push({key:"open-folder",label:e.t(h?"instanceShell.filesShell.actions.showInFolder":"instanceShell.filesShell.actions.openFolder"),get icon(){return a(le,{class:"w-3.5 h-3.5"})},onSelect:()=>v(h?"reveal":"default",i.path)},{key:"open-terminal",label:e.t("instanceShell.filesShell.actions.openTerminal"),get icon(){return a(et,{class:"w-3.5 h-3.5"})},onSelect:()=>v("terminal",i.path)})}else Le&&l.push({key:"open-default",label:e.t({open:"instanceShell.filesShell.actions.openDefault",edit:"instanceShell.filesShell.actions.editDefault",choose:"instanceShell.filesShell.actions.chooseApplication"}[Ct(i.path)]),get icon(){return a(Qe,{class:"w-3.5 h-3.5"})},onSelect:()=>v("default",i.path)}),l.push({key:"show-in-folder",label:e.t("instanceShell.filesShell.actions.showInFolder"),get icon(){return a(le,{class:"w-3.5 h-3.5"})},onSelect:()=>v("reveal",i.path)});return l.push({key:"copy-path",label:e.t("instanceShell.filesShell.actions.copyPath"),get icon(){return a(Je,{class:"w-3.5 h-3.5"})},onSelect:()=>f(i.path)}),l};return(()=>{var i=ft(),l=i.firstChild,h=l.firstChild,E=l.nextSibling;n(l,a(le,{size:15}),h),n(h,()=>e.directory.replace(/\\/g,"/").split("/").pop());var L=b;return typeof L=="function"?J(L,E):b=E,n(E,a(W,{get each(){return e.tree.rows()},children:c=>{const F=c.type==="directory",y=o(c.name),s=()=>e.tree.state().expanded.has(c.path),k=re(()=>x(c));return(()=>{var $=bt(),M=$.firstChild;return $.$$click=()=>d(c),$.$$keydown=C=>r(C,c),$.addEventListener("focus",()=>e.tree.select(c.path)),n($,a(O,{when:F,get fallback(){return yt()},get children(){return a(O,{get when(){return s()},get fallback(){return a(Ae,{size:12})},get children(){return a(Pe,{size:12})}})}}),M),n($,a(O,{when:F,get fallback(){return a(y,{size:14})},get children(){return a(O,{get when(){return s()},get fallback(){return a(Ve,{size:14})},get children(){return a(le,{size:14})}})}}),M),n(M,()=>c.name),n($,a(O,{get when(){return e.tree.busy().has(c.path)},get children(){return a(Ee,{size:12,class:"animate-spin"})}}),null),n($,a(ve,{get items(){return k()},get label(){return e.t("instanceShell.filesShell.actions.more",{name:c.name})}}),null),T(C=>{var q=c.path,H=c.name,K=c.depth,V=F?s():void 0,X=e.tree.state().selected===c.path,Q=`${8+c.depth*14}px`,B=c.path,N=u()===c.path?0:-1;return q!==C.e&&g($,"data-path",C.e=q),H!==C.t&&g($,"aria-label",C.t=H),K!==C.a&&g($,"aria-level",C.a=K),V!==C.o&&g($,"aria-expanded",C.o=V),X!==C.i&&g($,"aria-selected",C.i=X),Q!==C.n&&ee($,"padding-inline-start",C.n=Q),B!==C.s&&g($,"title",C.s=B),N!==C.h&&g($,"tabindex",C.h=N),C},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),$})()}})),n(i,a(W,{get each(){return[...e.tree.errors()]},children:([c,F])=>(()=>{var y=$t(),s=y.firstChild,k=s.nextSibling;return n(y,c,s),n(y,F,k),k.$$click=()=>{e.tree.load(c,!0)},n(k,()=>e.t("instanceShell.rightPanel.actions.refresh")),y})()}),null),n(i,a(O,{get when(){return e.tree.busy().has(".")},get children(){var c=mt();return n(c,()=>e.t("instanceInfo.loading")),c}}),null),T(c=>{var F=e.directory,y=e.t("filesPanel.workspace");return F!==c.e&&g(l,"title",c.e=F),y!==c.t&&g(E,"aria-label",c.t=y),c},{e:void 0,t:void 0}),i})()}const Le=typeof navigator<"u"&&/windows/i.test(navigator.userAgent),kt=typeof navigator<"u"&&/macintosh|mac os x/i.test(navigator.userAgent),wt=new Set(["7z","avi","bmp","c","cc","cfg","conf","cpp","cs","css","csv","dart","diff","docx","env","flac","fs","fsx","gif","go","gz","h","hpp","htm","html","ini","java","jpeg","jpg","json","jsonc","jsx","kt","kts","less","lock","log","lua","md","markdown","mkv","mov","mp3","mp4","ogg","patch","pdf","png","pptx","r","rar","rmd","rs","scss","sql","svg","svelte","swift","tar","toml","ts","tsx","txt","vue","wav","webm","webp","xlsx","xml","yaml","yml","zip"]),xt=new Set(["bat","cmd","js","jse","pl","ps1","psd1","psm1","py","pyw","rb","reg","vbe","vbs","wsf","wsh"]);function Ct(e){const o=e.split(/[\\/]/).pop()??"",b=o.lastIndexOf("."),u=b>0?o.slice(b+1).toLowerCase():"";return!Le||u&&wt.has(u)?"open":u&&xt.has(u)?"edit":"choose"}he(["keydown","click"]);var _e=A("<option>"),_t=A("<span class=git-panel-count>"),Ft=A('<div role=alert class="p-3 text-error text-xs">'),de=A('<p class="p-3 text-xs text-secondary">'),It=A('<div class=git-init-empty><p></p><button type=button class="git-change-commit-button git-init-button">'),Fe=A("<button class=git-panel-more>"),At=A("<button class=git-panel-back>"),Et=A('<p class="p-3 text-xs text-secondary"role=status>'),zt=A("<section class=git-panel><header class=git-panel-context><div class=git-panel-branch><strong></strong><button class=files-header-icon-button></button></div><select class=git-panel-worktree></select></header><div class=git-panel-tools><div class=git-panel-switch role=group><button></button><button></button><button></button></div></div><div class=git-panel-body></div><div class=git-panel-body><div><input class=git-panel-filter></div></div><div class=git-panel-body>"),Lt=A("<span class=git-history-refs>"),Ot=A("<button class=git-history-row><span class=git-history-row-content><strong></strong><span class=git-history-meta><span> · </span><code>"),Rt=A("<div class=git-commit-summary><code></code><p></p><span>"),Mt=A("<div class=git-commit-files>"),Dt=A('<div class=git-panel-file-row><button class="git-panel-file git-panel-file-main"><span></span><span>'),Tt=A('<div class=git-change-commit-box role=group><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),Gt=A('<div class=git-change-hidden-rows><span class=git-change-hidden-rows-label></span><button type=button class="button-secondary git-change-hidden-rows-button">'),qt=A('<div class="git-drop-zone git-change-section"><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class="git-change-section-chevron disclosure-chevron"></span><span class=git-change-section-title></span></span><span class=git-change-section-count></span></button><div>'),jt=A('<div class=git-panel-file-row><button class="git-panel-file git-panel-file-main"><span class=git-file-status></span><span></span><small><b class=file-list-item-additions>+</b> <b class=file-list-item-deletions>−');const en=e=>{const o=e.git.gitListItems,[b,u]=ge(""),[_,d]=ge(""),r=s=>{const k=ae(e.instanceId);return!!(k&&k.slug===e.slug&&k.directory===e.directory&&k.path===s.path&&(k.kind??"diff")===(s.kind??"diff")&&k.commit===s.commit&&k.scope===s.scope)},f=s=>{r(s)?Ne(e.instanceId):e.onOpenFile(s)};let v,x=0;const i=s=>{x=(v==null?void 0:v.scrollTop)??0,e.history.select(s)},l=()=>{e.history.back(),requestAnimationFrame(()=>{v!=null&&v.isConnected&&(v.scrollTop=x)})},h=re(()=>{var s;return(((s=e.history.page())==null?void 0:s.commits)??[]).filter(k=>`${k.subject} ${k.author} ${k.id}`.toLowerCase().includes(b().toLowerCase()))}),E=({draggable:s,droppable:k})=>{if(!k)return;const $=String(k.id);if($!=="staged"&&$!=="unstaged")return;const M=o().find(C=>C.id===String(s.id));!M||M.section===$||($==="staged"?e.git.stageGitFile(M):e.git.unstageGitFile(M))},L=()=>e.mode==="workspace"?e.tree.busy().size>0:e.mode==="history"?e.history.loading()||e.history.detailLoading():e.git.gitStatusLoading(),c=()=>e.mode==="workspace"||!e.gitAvailable?null:e.mode==="history"?e.history.error():e.git.gitStatusError(),F=s=>s.replace(/\\/g,"/").split("/").pop()||s,y=s=>new Date(s).toLocaleDateString(document.documentElement.lang||void 0,{month:"short",day:"numeric"});return(()=>{var s=zt(),k=s.firstChild,$=k.firstChild,M=$.firstChild,C=M.nextSibling,q=$.nextSibling,H=k.nextSibling,K=H.firstChild,V=K.firstChild,X=V.nextSibling,Q=X.nextSibling,B=H.nextSibling,N=B.nextSibling,Y=N.firstChild,ie=Y.firstChild,me=N.nextSibling;n($,a(we,{size:16}),M),n(M,(()=>{var t=P(()=>!!e.gitAvailable);return()=>t()?e.branch||e.t("gitPanel.detached"):F(e.directory)})()),C.$$click=()=>{e.mode==="workspace"?e.tree.refresh():e.gitAvailable?e.mode==="history"?e.history.refresh():e.git.refreshGitStatus():e.gitInit.recheck()},n(C,a(Ee,{size:14,get class(){return L()?"animate-spin":""}})),q.addEventListener("change",t=>e.onWorktreeChange(t.currentTarget.value)),n(q,a(O,{get when(){return!e.worktrees.some(t=>t.slug===e.slug)},get children(){var t=_e();return n(t,()=>F(e.directory)),T(()=>t.value=e.slug),t}}),null),n(q,a(W,{get each(){return e.worktrees},children:t=>(()=>{var S=_e();return n(S,()=>F(t.directory),null),n(S,(()=>{var m=P(()=>!!e.gitAvailable);return()=>m()?` · ${t.branch||e.t("gitPanel.detached")}`:""})(),null),T(()=>S.value=t.slug),S})()}),null),V.$$click=()=>e.onModeChange("workspace"),n(V,()=>e.t("filesPanel.workspace")),X.$$click=()=>e.onModeChange("changes"),n(X,()=>e.t("gitPanel.changes")),Q.$$click=()=>e.onModeChange("history"),n(Q,()=>e.t("filesPanel.commits")),n(H,a(O,{get when(){return P(()=>!!(e.gitAvailable&&e.mode==="changes"))()&&e.git.gitStatusEntries()},get children(){var t=_t();return n(t,()=>{var S;return e.t("gitPanel.files",{count:((S=e.git.gitStatusEntries())==null?void 0:S.length)??0})}),t}}),null),n(s,a(O,{get when(){return c()},get children(){var t=Ft();return n(t,c),t}}),B),n(s,a(O,{get when(){return!e.canOpenFile},get children(){var t=de();return n(t,()=>e.t("instanceShell.gitChanges.noSessionSelected")),t}}),B),n(B,a(St,{get tree(){return e.tree},get t(){return e.t},get directory(){return e.directory},get instanceId(){return e.instanceId},get worktreeSlug(){return e.slug},get canOpen(){return e.canOpenFile},get previewPath(){var t;return P(()=>{var S,m;return((S=ae(e.instanceId))==null?void 0:S.kind)==="workspace"&&((m=ae(e.instanceId))==null?void 0:m.slug)===e.slug})()?(t=ae(e.instanceId))==null?void 0:t.path:void 0},onOpen:t=>f({kind:"workspace",path:t})})),n(s,a(O,{get when(){return P(()=>!e.gitAvailable)()&&e.mode!=="workspace"},get children(){var t=It(),S=t.firstChild,m=S.nextSibling;return n(S,()=>e.t("filesPanel.gitInit.notRepository")),m.$$click=()=>{e.gitInit.initialize()},n(m,a(we,{size:14,"aria-hidden":"true"}),null),n(m,()=>e.t(e.gitInit.pending()?"filesPanel.gitInit.pending":"filesPanel.gitInit.action"),null),T(I=>{var D=e.gitInit.pending(),w=e.gitInit.pending(),R=e.directory;return D!==I.e&&(m.disabled=I.e=D),w!==I.t&&g(m,"aria-busy",I.t=w),R!==I.a&&g(m,"title",I.a=R),I},{e:void 0,t:void 0,a:void 0}),t}}),N);var fe=v;return typeof fe=="function"?J(fe,N):v=N,ie.$$input=t=>u(t.currentTarget.value),n(Y,a(W,{get each(){return h()},children:t=>(()=>{var S=Ot(),m=S.firstChild,I=m.firstChild,D=I.nextSibling,w=D.firstChild,R=w.firstChild,j=w.nextSibling;return S.$$click=()=>i(t.id),n(S,a(st,{class:"git-history-mark",size:16}),m),n(I,()=>t.subject),n(m,a(O,{get when(){return t.refs},get children(){var z=Lt();return n(z,()=>t.refs),T(()=>g(z,"title",t.refs)),z}}),D),n(w,()=>t.author,R),n(w,()=>y(t.date),null),n(j,()=>t.id.slice(0,7)),S})()}),null),n(Y,a(O,{get when(){return P(()=>!L())()&&h().length===0},get children(){var t=de();return n(t,()=>e.t("gitPanel.emptyHistory")),t}}),null),n(Y,a(O,{get when(){var t;return(t=e.history.page())==null?void 0:t.hasMore},get children(){var t=Fe();return t.$$click=()=>{e.history.refresh(!0)},n(t,()=>e.t("gitPanel.more")),T(()=>t.disabled=L()),t}}),null),n(N,a(O,{get when(){return e.history.selected()},get children(){return[(()=>{var t=At();return t.$$click=l,n(t,a(Ye,{size:14}),null),n(t,()=>e.t("filesPanel.commits"),null),t})(),a(O,{get when(){return e.history.details()},children:t=>[(()=>{var S=Rt(),m=S.firstChild,I=m.nextSibling,D=I.nextSibling;return n(m,()=>t().id.slice(0,8)),n(I,()=>t().message),n(D,()=>e.t("gitPanel.files",{count:t().files.length})),S})(),(()=>{var S=Mt();return n(S,a(W,{get each(){return t().files},children:m=>{const I=()=>({path:m.path,commit:t().id,subject:t().message.split(`
2
+ `)[0]});return(()=>{var D=Dt(),w=D.firstChild,R=w.firstChild,j=R.nextSibling;return w.$$click=()=>d(`${t().id}:${m.path}`),n(R,()=>m.status),n(j,()=>m.path),n(D,a(ve,{get label(){return e.t("instanceShell.filesShell.actions.more",{name:m.path})},get items(){return[{key:"preview",label:`${e.t("filesPanel.viewer")} · ${m.path}`,icon:a(ue,{size:14}),checked:r(I()),disabled:!e.canOpenFile,onSelect:()=>f(I())}]}}),null),T(z=>{var G=_()===`${t().id}:${m.path}`,U=m.originalPath?`${m.originalPath} → ${m.path}`:m.path,Z=`git-file-status git-file-status-${m.status}`;return G!==z.e&&D.classList.toggle("git-panel-file-selected",z.e=G),U!==z.t&&g(w,"title",z.t=U),Z!==z.a&&Re(R,z.a=Z),z},{e:void 0,t:void 0,a:void 0}),D})()}})),S})()]})]}}),null),n(N,a(O,{get when(){return L()},get children(){var t=Et();return n(t,()=>e.t("instanceInfo.loading")),t}}),null),n(me,a(je,{collisionDetector:Ge,onDragEnd:E,get children(){return a(qe,{get children(){return[a(O,{get when(){return o().length===0},get children(){var t=de();return n(t,(()=>{var S=P(()=>!!e.git.gitStatusLoading());return()=>S()?e.t("instanceInfo.loading"):e.t("instanceShell.gitChanges.empty")})()),t}}),a(W,{each:["staged","unstaged"],children:t=>a(Nt,{get t(){return e.t},section:t,get git(){return e.git},get canOpenFile(){return e.canOpenFile},onOpenFile:f,previewActive:r,get children(){return a(O,{when:t==="staged",get children(){var S=Tt(),m=S.firstChild,I=m.firstChild,D=I.nextSibling;return n(S,a(W,{each:["staged","unstaged"],children:w=>{const R=re(()=>e.git.gitActionItems().filter(z=>z.section===w)),j=w==="staged"?"unstage":"stage";return a(O,{get when(){return R().length>0},get children(){var z=Fe();return z.$$click=()=>{const G=R()[0];G&&(w==="staged"?e.git.unstageGitFile(G):e.git.stageGitFile(G))},n(z,(()=>{var G=P(()=>R().length>1);return()=>{var U;return G()?e.t(`instanceShell.gitChanges.actions.${j}Selected`,{count:R().length}):`${e.t(`instanceShell.gitChanges.actions.${j}`)} · ${((U=R()[0])==null?void 0:U.path)??""}`}})()),T(()=>g(z,"title",R().map(G=>G.path).join(`
3
+ `))),z}})}}),m),I.$$input=w=>e.git.setGitCommitMessage(w.currentTarget.value),D.$$click=()=>{e.git.submitGitCommit()},n(D,()=>e.t(e.git.gitCommitSubmitting()?"instanceShell.gitChanges.commit.submitting":"instanceShell.gitChanges.commit.submit")),T(w=>{var R=e.t("gitPanel.actions"),j=e.t("instanceShell.gitChanges.commit.placeholder"),z=e.t("instanceShell.gitChanges.commit.placeholder"),G=!e.git.gitCommitMessage().trim()||e.git.gitChangeWindow("staged").total===0||e.git.gitCommitSubmitting();return R!==w.e&&g(S,"aria-label",w.e=R),j!==w.t&&g(I,"aria-label",w.t=j),z!==w.a&&g(I,"placeholder",w.a=z),G!==w.o&&(D.disabled=w.o=G),w},{e:void 0,t:void 0,a:void 0,o:void 0}),T(()=>I.value=e.git.gitCommitMessage()),S}})}})})]}})}})),T(t=>{var S=e.t("instanceShell.rightPanel.tabs.files"),m=e.t("instanceShell.rightPanel.actions.refresh"),I=L(),D=e.t("gitPanel.worktree"),w=e.directory,R=e.t("instanceShell.rightPanel.tabs.files"),j=e.mode==="workspace",z=e.mode==="changes",G=e.mode==="history",U=e.mode==="workspace"?void 0:"none",Z=e.gitAvailable&&e.mode==="history"?void 0:"none",be=e.history.selected()?"none":void 0,ye=e.t("gitPanel.filter"),$e=e.t("gitPanel.filter"),Se=e.gitAvailable&&e.mode==="changes"?void 0:"none";return S!==t.e&&g(s,"aria-label",t.e=S),m!==t.t&&g(C,"aria-label",t.t=m),I!==t.a&&(C.disabled=t.a=I),D!==t.o&&g(q,"aria-label",t.o=D),w!==t.i&&g(q,"title",t.i=w),R!==t.n&&g(K,"aria-label",t.n=R),j!==t.s&&g(V,"aria-pressed",t.s=j),z!==t.h&&g(X,"aria-pressed",t.h=z),G!==t.r&&g(Q,"aria-pressed",t.r=G),U!==t.d&&ee(B,"display",t.d=U),Z!==t.l&&ee(N,"display",t.l=Z),be!==t.u&&ee(Y,"display",t.u=be),ye!==t.c&&g(ie,"aria-label",t.c=ye),$e!==t.w&&g(ie,"placeholder",t.w=$e),Se!==t.m&&ee(me,"display",t.m=Se),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0}),T(()=>q.value=e.slug),T(()=>ie.value=b()),s})()},Nt=e=>{const o=We(e.section),[b,u]=ge(!0),_=ke(),d=ke(),r=()=>e.git.gitChangeWindow(e.section),f=i=>i.toLocaleString(document.documentElement.lang||void 0);let v;const x=i=>{var L;const l=r().firstHiddenId,h=document.activeElement===i;if(e.git.revealGitChanges(e.section),!h||!l)return;const E=Array.from(v.querySelectorAll("[data-git-item-id]")).find(c=>c.dataset.gitItemId===l);(L=E==null?void 0:E.querySelector("button:enabled"))==null||L.focus({preventScroll:!0})};return(()=>{var i=qt(),l=i.firstChild,h=l.firstChild,E=h.firstChild,L=E.nextSibling,c=h.nextSibling,F=l.nextSibling;J(o,i),l.$$click=()=>u(s=>!s),g(l,"aria-controls",_),n(E,a(Ae,{class:"w-3.5 h-3.5","aria-hidden":"true"})),n(L,()=>e.t(`instanceShell.gitChanges.sections.${e.section}`)),n(c,()=>r().total);var y=v;return typeof y=="function"?J(y,F):v=F,g(F,"id",_),n(F,()=>e.children,null),n(F,a(W,{get each(){return r().rows},children:s=>a(Wt,{get t(){return e.t},item:s,get git(){return e.git},get canOpenFile(){return e.canOpenFile},get onOpenFile(){return e.onOpenFile},get previewActive(){return e.previewActive}})}),null),n(F,a(O,{get when(){return r().hidden>0},get children(){var s=Gt(),k=s.firstChild,$=k.nextSibling;return g(k,"id",d),n(k,()=>e.t(r().hidden===1?"instanceShell.gitChanges.hiddenRows.one":"instanceShell.gitChanges.hiddenRows.other",{count:f(r().hidden)})),$.$$click=M=>x(M.currentTarget),g($,"aria-describedby",d),n($,()=>e.t("instanceShell.gitChanges.hiddenRows.show",{count:f(r().nextReveal)})),s}}),null),T(s=>{var k=!!o.isActiveDroppable,$=b(),M=!b();return k!==s.e&&i.classList.toggle("git-drop-active",s.e=k),$!==s.t&&g(l,"aria-expanded",s.t=$),M!==s.a&&(F.hidden=s.a=M),s},{e:void 0,t:void 0,a:void 0}),i})()},Wt=e=>{const o=He(e.item.id),b=()=>e.item.section==="staged",u=()=>{b()?e.git.unstageGitFile(e.item):e.git.stageGitFile(e.item)},_=()=>e.t(b()?"instanceShell.gitChanges.actions.unstage":"instanceShell.gitChanges.actions.stage"),d=()=>({path:e.item.path,originalPath:e.item.originalPath,scope:e.item.section}),r=[{key:"preview",get label(){return`${e.t("filesPanel.viewer")} · ${e.item.path}`},icon:a(ue,{size:14}),get checked(){return e.previewActive(d())},get disabled(){return!e.canOpenFile},onSelect:()=>e.onOpenFile(d())},{key:"stage",get label(){return`${_()} · ${e.item.path}`},get icon(){return a(O,{get when(){return b()},get fallback(){return a(pe,{size:14})},get children(){return a(Ze,{size:14})}})},onSelect:u}],f=()=>e.git.isGitItemSelected(e.item.id);let v;return Ie(()=>vt(v)),(()=>{var x=jt(),i=x.firstChild,l=i.firstChild,h=l.nextSibling,E=h.nextSibling,L=E.firstChild;L.firstChild;var c=L.nextSibling,F=c.nextSibling;return F.firstChild,J(y=>{v=y,o(y)},x),i.$$click=y=>{e.git.handleGitRowClick(e.item,y)},n(l,()=>e.item.status.slice(0,1).toUpperCase()),n(h,()=>e.item.path),n(L,()=>e.item.additions,null),n(F,()=>e.item.deletions,null),n(x,a(ve,{get label(){return e.t("instanceShell.filesShell.actions.more",{name:e.item.path})},items:r}),null),T(y=>{var s=e.item.id,k=!!f(),$=Be(o.transform),M=f(),C=e.git.isGitItemCurrent(e.item.id)?"true":void 0,q=e.item.path,H=!e.canOpenFile;return s!==y.e&&g(x,"data-git-item-id",y.e=s),k!==y.t&&x.classList.toggle("git-panel-file-selected",y.t=k),y.a=Me(x,$,y.a),M!==y.o&&g(i,"aria-pressed",y.o=M),C!==y.i&&g(i,"aria-current",y.i=C),q!==y.n&&g(i,"title",y.n=q),H!==y.s&&(i.disabled=y.s=H),y},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),x})()};he(["click","input"]);export{en as default};
4
+ //# sourceMappingURL=FilesPanel-BFKOqVhL.js.map