@openchamber/web 2.7.0 → 2.7.1-canary.20261108.12
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/assets/{AboutDialog-Bbu8cDW8.js → AboutDialog-uNKjHvzl.js} +1 -1
- package/dist/assets/{AboutLogo-sAyRFbrm.js → AboutLogo-BhyG0ENm.js} +1 -1
- package/dist/assets/{ArchiveView-DvLmQllR.js → ArchiveView-Jt6Qj8Ry.js} +1 -1
- package/dist/assets/{ChangeRequestDiffUnavailable-Ctc-P6zi.js → ChangeRequestDiffUnavailable-CNIWdYRx.js} +1 -1
- package/dist/assets/{ChangedPathLabel-CQOXgkIF.js → ChangedPathLabel-CCsE-8p4.js} +1 -1
- package/dist/assets/{CommandPalette-DHk0MqYi.js → CommandPalette-DrsFSbmk.js} +1 -1
- package/dist/assets/{DiffView-DPpu52DA.js → DiffView-DwaJOPUe.js} +1 -1
- package/dist/assets/{FilesView-CPrroDyU.js → FilesView-Hvxe_KqA.js} +4 -4
- package/dist/assets/{GitView-wWoZ95Yt.js → GitView-ZI_EafL9.js} +1 -1
- package/dist/assets/{GuestSurfacePane-BsMH8QjU.js → GuestSurfacePane-Ds8luSO0.js} +1 -1
- package/dist/assets/{HelpDialog-BZtzVj6Z.js → HelpDialog-DtZKoPZE.js} +1 -1
- package/dist/assets/{IntegrationsCatalogView-DJAOTlcc.js → IntegrationsCatalogView-DgdYlI3Z.js} +1 -1
- package/dist/assets/{JsonTreeView-BXv2HzlC.js → JsonTreeView-zAv-pn0X.js} +1 -1
- package/dist/assets/{MarkdownDiffPreview-CseaChSt.js → MarkdownDiffPreview-Bf9-WPy9.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-CyXOMsMS.js → MarkdownRendererImpl-w7LnAwp_.js} +4 -4
- package/dist/assets/{MemoryDebugPanel-xYvjTjLG.js → MemoryDebugPanel-ylQytlyw.js} +1 -1
- package/dist/assets/{NoteEditor-Bbrtl8rq.js → NoteEditor-0HEW8KrY.js} +1 -1
- package/dist/assets/{OfficeDocumentDiff-DXsfJnFq.js → OfficeDocumentDiff-BFr4rAHy.js} +1 -1
- package/dist/assets/{OnboardingScreen-DuWvo16v.js → OnboardingScreen-Bpj6hpDe.js} +1 -1
- package/dist/assets/{OpenCodeStatusDialog-9WRgjgWL.js → OpenCodeStatusDialog-CX3oxFSb.js} +1 -1
- package/dist/assets/{OverviewView-BzA9rGEs.js → OverviewView-UfIFJ3mf.js} +1 -1
- package/dist/assets/{PatchDiff-DVcyjZVm.js → PatchDiff-DC4ydsOW.js} +1 -1
- package/dist/assets/{PlanView-BGdba90K.js → PlanView-CgoTn3HJ.js} +1 -1
- package/dist/assets/{ProjectActionsDialog-ByPMdwFG.js → ProjectActionsDialog-B16N4lqs.js} +1 -1
- package/dist/assets/{ReplyCommand-pviKPDT8.js → ReplyCommand-CnDNvFmd.js} +1 -1
- package/dist/assets/{ReplyUiBlock-D7HPBgmq.js → ReplyUiBlock-BsOTgv8M.js} +1 -1
- package/dist/assets/{ReviewCards-CU1YHZkQ.js → ReviewCards-BkpTYy_a.js} +1 -1
- package/dist/assets/{RunOverview-uFEfusCK.js → RunOverview-DsffX3fI.js} +1 -1
- package/dist/assets/{ScheduledTasksDialog-J8i_b433.js → ScheduledTasksDialog-DgrAfpeX.js} +1 -1
- package/dist/assets/{SettingsView-CaUgulkI.js → SettingsView-B804XZvl.js} +1 -1
- package/dist/assets/{SettingsWindow-BVEVntuV.js → SettingsWindow-k5FSMAzV.js} +1 -1
- package/dist/assets/{SidebarSectionsManager-CIXOcE0-.js → SidebarSectionsManager-DH61-mRe.js} +1 -1
- package/dist/assets/{SourceBoardView-BW1OSOo1.js → SourceBoardView-BvGoSNer.js} +1 -1
- package/dist/assets/{SpaceAccessDialog-6GhzlMD8.js → SpaceAccessDialog-DHNqUzKD.js} +1 -1
- package/dist/assets/{SpaceApplyDialog-zB4jAExK.js → SpaceApplyDialog-DEOTeEjy.js} +1 -1
- package/dist/assets/{SpaceRow-C6QD41XF.js → SpaceRow-CBva6ofM.js} +1 -1
- package/dist/assets/{SpaceSetupOutput-6GuKiRed.js → SpaceSetupOutput-C4NhRkjl.js} +1 -1
- package/dist/assets/{SpacesView-BgncMV45.js → SpacesView-BGevrpQp.js} +1 -1
- package/dist/assets/{SubmoduleDiffSummary-BwVdGw0c.js → SubmoduleDiffSummary-Bebhaz7n.js} +1 -1
- package/dist/assets/{ToolOutputDialog-CC9hcX2C.js → ToolOutputDialog-B1gU22Tz.js} +1 -1
- package/dist/assets/{ToolPartDiffPreview-D15Ja459.js → ToolPartDiffPreview-CVy_zn_m.js} +1 -1
- package/dist/assets/{UiBlock-pyLxOJr6.js → UiBlock-C11qZK5T.js} +2 -2
- package/dist/assets/{UsageStatsView-CMf29PeL.js → UsageStatsView-CNm8WPSk.js} +1 -1
- package/dist/assets/{WalkthroughView-DeuNxpZ7.js → WalkthroughView-Bbwyk6rg.js} +1 -1
- package/dist/assets/{WorktreesView-jHcQwWBH.js → WorktreesView-BGIfERNs.js} +1 -1
- package/dist/assets/{appThemeRegistry-BwyM6n38.js → appThemeRegistry-DYzVI9tX.js} +1 -1
- package/dist/assets/{ar-DnPStsLU.js → ar-CT3AuXVj.js} +1 -1
- package/dist/assets/{codeHighlight-C7ZRQ5-2.js → codeHighlight-BcDjh6yS.js} +1 -1
- package/dist/assets/{columnWidthMemory-Cbfh5HD5.js → columnWidthMemory-BA6h4J11.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-DVynfSBh.js → computeVirtualFileMetrics-DVfKKHny.js} +2 -2
- package/dist/assets/{contextFileOpenGuard-CKnYjgFC.js → contextFileOpenGuard-BC79wuu1.js} +1 -1
- package/dist/assets/{date-time-qS8d5iiz.js → date-time-DhfjtTnp.js} +1 -1
- package/dist/assets/{de-SUU4F7Nt.js → de-BdVTH897.js} +1 -1
- package/dist/assets/{documentClient-B0iRikhq.js → documentClient-JcxJ7vyh.js} +2 -2
- package/dist/assets/{documentExport-Cf0gMwM0.js → documentExport-C830mU4N.js} +1 -1
- package/dist/assets/{documentHost-cOykm7qf.js → documentHost-DKm0U_q_.js} +1 -1
- package/dist/assets/{es-BWlkhnKy.js → es-BFk4dosu.js} +1 -1
- package/dist/assets/{fileContentPoller-CKcqqhzG.js → fileContentPoller-BmcApnk-.js} +1 -1
- package/dist/assets/{flexokiTheme-deI9tWCZ.js → flexokiTheme-BMYGLHbL.js} +1 -1
- package/dist/assets/{fr-DN3Tx1EV.js → fr-CeExWqT9.js} +1 -1
- package/dist/assets/{he-B-7jIB_R.js → he-C_O5IfNH.js} +1 -1
- package/dist/assets/{highlights-B2Re-VTM.js → highlights-CIuWBj_n.js} +1 -1
- package/dist/assets/{index-D5Ed7hon.js → index-bD6u6GDm.js} +1 -1
- package/dist/assets/{initializeSharedPreferences-D5FLPdpI.js → initializeSharedPreferences-BcnhlF3e.js} +1 -1
- package/dist/assets/{install-sOrZWWGd.js → install-CSoRI5iX.js} +1 -1
- package/dist/assets/{install-request-C-zhz88k.js → install-request-EHX4ORhb.js} +1 -1
- package/dist/assets/{isDiffPlainText-DpcjRlB-.js → isDiffPlainText-saKoOWJx.js} +1 -1
- package/dist/assets/{isFilePlainText-DJ_bXU7C.js → isFilePlainText-DOjSDWo3.js} +1 -1
- package/dist/assets/{ja-DE4Yf-rX.js → ja-BlUqUBMY.js} +1 -1
- package/dist/assets/{katex.min-g52ii4Gs.js → katex.min-Bs5OLoA1.js} +4 -4
- package/dist/assets/{ko-CETaCyB8.js → ko-CGv47dWq.js} +1 -1
- package/dist/assets/{main-QRYvDkRZ.js → main-064y5MQB.js} +4 -4
- package/dist/assets/{main-89VT8Kff.js → main-D8yzv2tL.js} +2 -2
- package/dist/assets/{miniChat-CgHPqY7Z.js → miniChat-X7g2IHQj.js} +2 -2
- package/dist/assets/{mobile-BQrjPA_e.js → mobile-B5efB3tI.js} +2 -2
- package/dist/assets/{moveWorkspacePath-C4_JgpNC.js → moveWorkspacePath-BaEfuU4S.js} +1 -1
- package/dist/assets/{nl-CL94_9kf.js → nl-CavtTtNf.js} +1 -1
- package/dist/assets/{officeDocument-COfYG-XF.js → officeDocument-CQScRmC1.js} +1 -1
- package/dist/assets/{parseDiffFromFile-CD1h9Yf5.js → parseDiffFromFile-By5H8w4y.js} +1 -1
- package/dist/assets/{pierreDiffTint-Cg024Eeg.js → pierreDiffTint-CVm_qZm-.js} +1 -1
- package/dist/assets/{pl-Bk1GuZBm.js → pl-BQZVI44N.js} +1 -1
- package/dist/assets/{pt-BR-Bfrsw-GS.js → pt-BR-iqkU-MRA.js} +1 -1
- package/dist/assets/{relocateRestoredSession-C79EVzC-.js → relocateRestoredSession-CsK2RUM_.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-lMVP5gEt.js → renderElectronMiniChatApp-DzVezwky.js} +2 -2
- package/dist/assets/{renderMarkdownForExport-DTutihQz.js → renderMarkdownForExport-BM19JOji.js} +1 -1
- package/dist/assets/{renderMobileApp-CmYW0oos.js → renderMobileApp-CiTrtu6R.js} +3 -3
- package/dist/assets/{resolveLanguages-lTTkQHer.js → resolveLanguages-DQXSOQcc.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BJm_77m2.js → runtimeEndpointReset-DiTyBUwe.js} +5 -5
- package/dist/assets/{scheduledTasksApi-CKPLiwD-.js → scheduledTasksApi-Z7dc8sXS.js} +1 -1
- package/dist/assets/{shiki-CQYsk6Az.js → shiki-DW-V1SDr.js} +1 -1
- package/dist/assets/{space-apply-BT-PjBF5.js → space-apply-8YUOtYvk.js} +1 -1
- package/dist/assets/{space-close-C1Qs6EK6.js → space-close-D7zK_obq.js} +1 -1
- package/dist/assets/{spaceNetwork-C14OnxrT.js → spaceNetwork-XStNVwJo.js} +1 -1
- package/dist/assets/{stream-tokenizer-xdyY_PEd.js → stream-tokenizer-BfPOSMyw.js} +1 -1
- package/dist/assets/{textMateThemeFromAppTheme-CRhUx8P-.js → textMateThemeFromAppTheme-CVOJt2hL.js} +1 -1
- package/dist/assets/{tr-Cgg3eQb7.js → tr-CYfLfxAg.js} +1 -1
- package/dist/assets/{uk-zPAKOL1d.js → uk-Bm__l5YX.js} +1 -1
- package/dist/assets/{useAppFontEffects-D9nf8G19.js → useAppFontEffects-3RimJo4B.js} +15 -15
- package/dist/assets/{useBranchPullRequestRequest-CaGsp4wW.js → useBranchPullRequestRequest-CMvepZei.js} +1 -1
- package/dist/assets/{useCallableModelProviders-B1YBs2FN.js → useCallableModelProviders-DpMos2Hl.js} +1 -1
- package/dist/assets/{useDiffFindSurface-DiINVOLu.js → useDiffFindSurface-Dy5ZvPrH.js} +1 -1
- package/dist/assets/{useGitCleanLine-BK-o3SG6.js → useGitCleanLine-COG7MPwc.js} +1 -1
- package/dist/assets/{useInlineCommentController-CzeMiLCm.js → useInlineCommentController-_L6_JHZ6.js} +1 -1
- package/dist/assets/{useMarkdownLocalAssets-wPn7MXUN.js → useMarkdownLocalAssets-CH5Ekvbl.js} +1 -1
- package/dist/assets/{useRootScrollLock-BvsNFl90.js → useRootScrollLock-DdknBCBa.js} +2 -2
- package/dist/assets/{useWalkthroughReview-CEo_4ZLc.js → useWalkthroughReview-Bi8eB9_G.js} +1 -1
- package/dist/assets/{useWholeFileComment-BexRzYws.js → useWholeFileComment-CqHAJ2YU.js} +1 -1
- package/dist/assets/{useWorktreeArchiveActions-DaRx6tMV.js → useWorktreeArchiveActions-D1kaQEP9.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-z3n6zAAT.js → vendor-codemirror-language-data-DRsX0PKK.js} +2 -2
- package/dist/assets/{zh-CN-BPcuR4-K.js → zh-CN-Db0Y0Ij-.js} +1 -1
- package/dist/assets/{zh-TW-CmPAjna9.js → zh-TW-CuzqmROB.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/mini-chat.html +2 -2
- package/dist/mobile.html +2 -2
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as q,j as _,a as Re,f as ot,r as p}from"./vendor-react--VO_rL_p.js";import{p as Jt,a as Zt}from"./parseDiffFromFile-
|
|
1
|
+
import{R as q,j as _,a as Re,f as ot,r as p}from"./vendor-react--VO_rL_p.js";import{p as Jt,a as Zt}from"./parseDiffFromFile-By5H8w4y.js";import{c as St}from"./isDiffPlainText-saKoOWJx.js";import{P as en,V as kt,F as tn}from"./pierreDiffTint-CVm_qZm-.js";import{R as nn,a as rn,V as on}from"./ReviewCards-BkpTYy_a.js";import{u as Wt,al as sn,am as Rt,aP as an,T as ln,g_ as cn,n as dn,Q as Ct,bR as un,cd as fn,as as xe,ce as Et,cf as It,cg as hn}from"./useAppFontEffects-3RimJo4B.js";import"./katex.min-Bs5OLoA1.js";import{a as Tt,I as pn,u as mn}from"./useInlineCommentController-_L6_JHZ6.js";import{u as gn,an as yn}from"./runtimeEndpointReset-DiTyBUwe.js";import{ensurePierreThemeRegistered as At,getResolvedShikiTheme as Mt}from"./appThemeRegistry-DYzVI9tX.js";import{DIFFS_HIGHLIGHTER as vn}from"./diffsHighlighter-BsxkaI3Q.js";const de=e=>{if(e.type==="review")return`review-${e.id}`;if(e.type==="new"){const n=Math.min(e.selection.start,e.selection.end),r=Math.max(e.selection.start,e.selection.end);return`new-comment-${e.selection.side??"additions"}-${n}-${r}`}return`draft-${e.draft.id}`},xn=(e,n)=>e&&!n?{lineNumber:Math.max(e.start,e.end),side:e.side??"additions",metadata:{type:"new",selection:e}}:null,bn=e=>{const{drafts:n,editingDraftId:r,reviewItems:t=[]}=e,i=[];for(const a of n){if(!Number.isFinite(a.endLine))continue;const l=Math.max(1,Math.floor(a.endLine)),u=a.side==="original"?"deletions":"additions";i.push({lineNumber:l,side:u,metadata:{type:a.id===r?"edit":"saved",draft:a}})}for(const a of t)i.push({lineNumber:a.lineNumber,side:a.side,metadata:{type:"review",id:a.id}});return i};function wn(e){const n=e.trim();if(!n)return null;if(/^-?\d+(\.\d+)?$/.test(n)){const r=Number.parseFloat(n);return Number.isFinite(r)?r:null}if(n.endsWith("px")){const r=Number.parseFloat(n.slice(0,-2));return Number.isFinite(r)?r:null}return null}function Pt(e){if(!(!e||e<=0))return Math.max(200,Math.floor(e))}function Ln(e){const{diffRootRef:n,drafts:r,selection:t,editingDraftId:i,commentText:a,onTextChange:l,fileLabel:u,onSave:d,onCancel:c,onEdit:f,onDelete:y,review:m,reviewItems:L,reviewField:E,excerptOf:w}=e,[j,X]=q.useState(0),[N,W]=q.useState(null),$=q.useMemo(()=>!t||i?null:de({type:"new",selection:t}),[i,t]),Y=q.useMemo(()=>{const v=r.map(A=>de({type:A.id===i?"edit":"saved",draft:A}));$&&v.push($);for(const A of L)v.push(de({type:"review",id:A.id}));return v},[r,i,L,$]),z=q.useCallback(v=>{const A=n.current;if(!A)return null;const F=A.querySelector("diffs-container");if(!(F instanceof HTMLElement))return null;const O=F.querySelector(`[data-annotation-id="${v}"]`);if(O instanceof HTMLElement)return O;const M=F.shadowRoot;return M?M.querySelector(`[data-annotation-id="${v}"]`):null},[n]);q.useEffect(()=>{if(Y.length===0)return;let v=!1,A=0;const F=12,O=()=>{v||Y.every(B=>!!z(B))||A>=F||(A+=1,requestAnimationFrame(()=>{v||(X(B=>B+1),O())}))};return O(),()=>{v=!0}},[Y,z]),q.useEffect(()=>{const v=n.current;if(!v)return;const A=()=>{const O=getComputedStyle(v),M=wn(O.getPropertyValue("--oc-context-panel-width")),B=v.getBoundingClientRect(),Z=M??B.width;W(Z>0?Z:null)};A();const F=new ResizeObserver(()=>{A()});return F.observe(v),window.addEventListener("resize",A),()=>{F.disconnect(),window.removeEventListener("resize",A)}},[n]);const re=q.useCallback(v=>{const F=n.current?.getBoundingClientRect(),O=v.closest("[data-annotation-content]"),M=O instanceof HTMLElement?O.getBoundingClientRect():v.getBoundingClientRect(),B=[M.width];F&&B.push(F.right-M.left);const Z=B.filter(Q=>Number.isFinite(Q)&&Q>0);return Z.length>0?Pt(Math.min(...Z)):Pt(N)},[n,N]),V=()=>{const v=n.current?.querySelector("diffs-container")?.shadowRoot,A=v?Array.from(v.querySelectorAll("[data-line][data-selected-line]")).at(-1):void 0;if(A)return getComputedStyle(A).getPropertyValue("--diffs-computed-selected-line-bg").trim()||void 0};return _.jsxs(_.Fragment,{children:[r.map(v=>{const A=de({type:v.id===i?"edit":"saved",draft:v}),F=z(A);if(!F)return null;const O=re(F);return v.id===i?Re.createPortal(_.jsx(Tt,{initialText:a,onTextChange:l,fileLabel:u,lineRange:{start:v.startLine,end:v.endLine,side:v.side==="original"?"deletions":"additions"},isEditing:!0,onSave:d,onCancel:c,maxWidth:O,bandColor:V()}),F,`draft-edit-${v.id}`):Re.createPortal(_.jsx(pn,{draft:v,onEdit:()=>f(v),onDelete:()=>y(v),maxWidth:O,forAgent:m!==null}),F,`draft-card-${v.id}`)}),t&&!i&&$&&(()=>{const v=z($);if(!v)return null;const A=re(v);return Re.createPortal(_.jsx(Tt,{initialText:a,onTextChange:l,fileLabel:u,lineRange:t,isEditing:!1,onSave:d,onCancel:c,maxWidth:A,bandColor:V(),review:E}),v,$)})(),m?L.map(v=>{const A=de({type:"review",id:v.id}),F=z(A);if(!F)return null;const O=re(F);return Re.createPortal(_.jsx("div",{className:"px-3 py-1.5",children:v.kind==="draft"?_.jsx(nn,{comment:v.comment,review:m,excerpt:w(v),fileLabel:u,maxWidth:O}):_.jsx(rn,{thread:v.thread,review:m,excerpt:w(v),maxWidth:O})}),F,A)}):null]})}const Ar=14,Mr=e=>e.slice(e.lastIndexOf("/",e.length-2)+1),zt=e=>e.replace(/\\/g,"/").replace(/^\/+/,"").trim(),Nt=(e,n)=>({id:`dir:${e}`,path:e,name:n,children:new Map,directFiles:[],files:[]}),Pr=e=>{const n=Nt("","");for(const r of e){const t=zt(r.path);if(!t)continue;const a=t.split("/").filter(Boolean).slice(0,-1);let l=n;if(l.files.push(r),a.length>0){let u="";for(const d of a){u=u?`${u}/${d}`:d;const c=l.children.get(d);if(c){c.files.push(r),l=c;continue}const f=Nt(u,d);f.files.push(r),l.children.set(d,f),l=f}}l.directFiles.push(r)}return n},Sn=e=>{let n=e,r=e.name;for(;n.directFiles.length===0&&n.children.size===1;){const[t]=n.children.values();n=t,r=`${r}/${t.name}`}return{node:n,label:r}},Nr=(e,n)=>{const r=[],t=(i,a)=>{const l=Array.from(i.children.values()).sort((d,c)=>d.path.localeCompare(c.path));for(const d of l){const{node:c,label:f}=Sn(d);r.push({key:c.id,kind:"directory",depth:a,label:f,directory:c}),n.has(c.path)&&t(c,a+1)}const u=[...i.directFiles].sort((d,c)=>d.path.localeCompare(c.path));for(const d of u)r.push({key:`file:${zt(d.path)}`,kind:"file",depth:a,file:d})};return t(e,0),r},Je=3,kn=1e6,Ft=new WeakMap,Rn=e=>{const n=Ft.get(e);if(n)return n;let r=!1;const t=[];for(const a of e.hunks){const l=[];for(const u of a.hunkContent){if(u.type==="context"){nt(l,{...u});continue}const d=Cn(e,u);(d.length>1||d[0]?.type==="context")&&(r=!0);for(const c of d)nt(l,c)}t.push(...In(a,l))}const i=r?An(e,t):e;return Ft.set(e,i),i},Ht=e=>e.replace(/\s+/g,""),Cn=(e,n)=>{if(n.deletions===0||n.additions===0)return[{...n}];const r=e.deletionLines.slice(n.deletionLineIndex,n.deletionLineIndex+n.deletions),t=e.additionLines.slice(n.additionLineIndex,n.additionLineIndex+n.additions),i=[];let a=0,l=0;for(const[u,d]of En(r,t))(u>a||d>l)&&i.push({type:"change",deletions:u-a,deletionLineIndex:n.deletionLineIndex+a,additions:d-l,additionLineIndex:n.additionLineIndex+l}),nt(i,{type:"context",lines:1,deletionLineIndex:n.deletionLineIndex+u,additionLineIndex:n.additionLineIndex+d}),a=u+1,l=d+1;return(a<n.deletions||l<n.additions)&&i.push({type:"change",deletions:n.deletions-a,deletionLineIndex:n.deletionLineIndex+a,additions:n.additions-l,additionLineIndex:n.additionLineIndex+l}),i},En=(e,n)=>{const r=e.map(Ht),t=n.map(Ht),i=[];let a=0;for(;a<r.length&&a<t.length&&r[a]===t[a];)i.push([a,a]),a+=1;let l=0;for(;l<r.length-a&&l<t.length-a&&r[r.length-1-l]===t[t.length-1-l];)l+=1;const u=r.length-a-l,d=t.length-a-l;if(u>0&&d>0&&(u+1)*(d+1)<=kn){const c=d+1,f=new Uint32Array((u+1)*c);for(let L=u-1;L>=0;L-=1)for(let E=d-1;E>=0;E-=1)f[L*c+E]=r[a+L]===t[a+E]?f[(L+1)*c+E+1]+1:Math.max(f[(L+1)*c+E],f[L*c+E+1]);let y=0,m=0;for(;y<u&&m<d;)r[a+y]===t[a+m]?(i.push([a+y,a+m]),y+=1,m+=1):f[(y+1)*c+m]>=f[y*c+m+1]?y+=1:m+=1}for(let c=l;c>0;c-=1)i.push([r.length-c,t.length-c]);return i},nt=(e,n)=>{const r=e.at(-1);if(r?.type==="context"&&n.type==="context"){r.lines+=n.lines;return}e.push(n)},_t=(e,n,r)=>({type:"context",lines:r,deletionLineIndex:e.deletionLineIndex+n,additionLineIndex:e.additionLineIndex+n}),In=(e,n)=>{const r=[];let t=null;for(const[a,l]of n.entries()){if(l.type==="change"){if(!t){t=[];const d=n[a-1];if(d?.type==="context"){const c=Math.min(d.lines,Je);t.push(_t(d,d.lines-c,c))}}t.push(l);continue}if(!t)continue;if(a<n.length-1&&l.lines<=Je*2){t.push(l);continue}t.push(_t(l,0,Math.min(l.lines,Je))),r.push(t),t=null}t&&r.push(t);const i=n.at(-1);return r.map(a=>{const l=a.at(-1),u=l!==void 0&&i!==void 0&&Fe(l,"deletion")===Fe(i,"deletion")&&Fe(l,"addition")===Fe(i,"addition");return Tn(e,a,u)})},Fe=(e,n)=>n==="deletion"?e.deletionLineIndex+(e.type==="context"?e.lines:e.deletions):e.additionLineIndex+(e.type==="context"?e.lines:e.additions),Tn=(e,n,r)=>{let t=0,i=0,a=0,l=0,u=0;for(const w of n)w.type==="context"?(a+=w.lines,l+=w.lines,u+=w.lines):(t+=w.additions,i+=w.deletions,l+=Math.max(w.additions,w.deletions),u+=w.additions+w.deletions);const d=n[0],c=a+t,f=a+i,y=$t(_e(e.additionStart,e.additionCount)+d.additionLineIndex-e.additionLineIndex,c),m=$t(_e(e.deletionStart,e.deletionCount)+d.deletionLineIndex-e.deletionLineIndex,f),E=d.additionLineIndex===e.additionLineIndex&&d.deletionLineIndex===e.deletionLineIndex?e.hunkContext:void 0;return{collapsedBefore:0,additionStart:y,additionCount:c,additionLines:t,additionLineIndex:d.additionLineIndex,deletionStart:m,deletionCount:f,deletionLines:i,deletionLineIndex:d.deletionLineIndex,hunkContent:n,hunkContext:E,hunkSpecs:`@@ -${m},${f} +${y},${c} @@${E?` ${E}`:""}
|
|
2
2
|
`,splitLineStart:0,splitLineCount:l,unifiedLineStart:0,unifiedLineCount:u,noEOFCRDeletions:r&&e.noEOFCRDeletions,noEOFCRAdditions:r&&e.noEOFCRAdditions}},_e=(e,n)=>e-(n===0?0:1),$t=(e,n)=>e+(n===0?0:1),An=(e,n)=>{let r=0,t=0,i=0;for(const l of n)l.collapsedBefore=Math.max(_e(l.additionStart,l.additionCount)-i,0),l.splitLineStart=r+l.collapsedBefore,l.unifiedLineStart=t+l.collapsedBefore,r+=l.collapsedBefore+l.splitLineCount,t+=l.collapsedBefore+l.unifiedLineCount,i=_e(l.additionStart,l.additionCount)+l.additionCount;if(n.at(-1)&&!e.isPartial&&e.additionLines.length>0&&e.deletionLines.length>0){const l=Math.max(e.additionLines.length-i,0);r+=l,t+=l}return{...e,...e.isPartial?Mn(e,n):{hunks:n},splitLineCount:r,unifiedLineCount:t,cacheKey:e.cacheKey===void 0?void 0:`${e.cacheKey}:hide-whitespace`}},Mn=(e,n)=>{const r=[],t=[],i=(l,u,d,c)=>{for(let f=d;f<d+c;f+=1)u.push(l[f])};return{hunks:n.map(l=>{const u=r.length,d=t.length,c=l.hunkContent.map(f=>{const y={...f,deletionLineIndex:r.length,additionLineIndex:t.length};return i(e.deletionLines,r,f.deletionLineIndex,f.type==="context"?f.lines:f.deletions),i(e.additionLines,t,f.additionLineIndex,f.type==="context"?f.lines:f.additions),y});return{...l,deletionLineIndex:u,additionLineIndex:d,hunkContent:c}}),deletionLines:r,additionLines:t}},Pn=e=>e.replace(/\r?\n$/,""),Nn=(e,n,r)=>{if(!e.isPartial)return r-1;for(const t of e.hunks){const i=n==="additions"?t.additionStart:t.deletionStart,a=n==="additions"?t.additionCount:t.deletionCount;if(r<i||r>=i+a)continue;return(n==="additions"?t.additionLineIndex:t.deletionLineIndex)+(r-i)}return null},Fn=(e,n,r,t)=>{const i=n==="additions"?e.additionLines:e.deletionLines,a=[];for(let l=Math.max(1,r);l<=t;l+=1){const u=Nn(e,n,l),d=u===null?void 0:i[u];d!==void 0&&a.push(Pn(d))}return a.join(`
|
|
3
3
|
`)},Ze=/[\p{L}\p{N}_$]/u,Hn=(e,n)=>{if(n<0||n>e.length)return null;const r=n===e.length?e.length-1:n;if(r<0||!Ze.test(e[r]))return null;let t=r,i=r+1;for(;t>0&&Ze.test(e[t-1]);)t-=1;for(;i<e.length&&Ze.test(e[i]);)i+=1;return{word:e.slice(t,i),spanStart:t}},_n=e=>e?Array.from(e.children).filter(n=>n instanceof HTMLElement&&n.hasAttribute("data-code")):[],$n=(e,n)=>{const r=new Map,t=()=>{const d=e.getBoundingClientRect().left,c=Array.from(r.values(),f=>({entry:f,left:f.column.getBoundingClientRect().left-d,clientWidth:f.column.clientWidth,scrollWidth:f.column.scrollWidth,scrollLeft:f.column.scrollLeft}));n.hidden=!c.some(f=>f.scrollWidth-f.clientWidth>1);for(const{entry:f,left:y,clientWidth:m,scrollWidth:L,scrollLeft:E}of c){const w=L-m>1;f.track.hidden=!w,w&&(f.track.style.left=`${y}px`,f.track.style.width=`${m}px`,f.spacer.style.width=`${L}px`,f.track.scrollLeft=E)}},i=new ResizeObserver(t),a=new MutationObserver(()=>u()),l=d=>{const c=document.createElement("div");c.className="absolute inset-y-0 overflow-x-auto overflow-y-hidden overscroll-x-none",c.tabIndex=-1,c.hidden=!0;const f=document.createElement("div");f.className="h-px",c.appendChild(f),n.appendChild(c);const y=()=>{Math.abs(c.scrollLeft-d.scrollLeft)>=1&&(c.scrollLeft=d.scrollLeft)},m=()=>{Math.abs(d.scrollLeft-c.scrollLeft)>=1&&(d.scrollLeft=c.scrollLeft)};return d.addEventListener("scroll",y,{passive:!0}),c.addEventListener("scroll",m,{passive:!0}),i.observe(d),{column:d,content:null,track:c,spacer:f,detach:()=>{d.removeEventListener("scroll",y),c.removeEventListener("scroll",m),i.unobserve(d),c.remove()}}},u=()=>{const d=e.querySelector("diffs-container")?.shadowRoot??null,c=d?.querySelector("pre")??null,f=_n(c);for(const[y,m]of r)f.includes(y)||(m.detach(),m.content&&i.unobserve(m.content),r.delete(y));for(const y of f){const m=r.get(y)??l(y);r.set(y,m);const L=Array.from(y.children).find(E=>E.hasAttribute("data-content"))??null;L!==m.content&&(m.content&&i.unobserve(m.content),L&&i.observe(L),m.content=L)}a.disconnect(),a.observe(e,{childList:!0}),d&&a.observe(d,{childList:!0}),c&&a.observe(c,{childList:!0});for(const y of f)a.observe(y,{childList:!0});r.size===0&&(n.hidden=!0)};return u(),i.observe(e),()=>{a.disconnect(),i.disconnect();for(const d of r.values())d.detach();r.clear(),n.hidden=!0}},On=e=>{const n=ot.c(4),{containerRef:r}=e,t=q.useRef(null);let i,a;n[0]!==r?(i=()=>{const u=r.current,d=t.current;if(!(!u||!d))return $n(u,d)},a=[r],n[0]=r,n[1]=i,n[2]=a):(i=n[1],a=n[2]),q.useEffect(i,a);let l;return n[3]===Symbol.for("react.memo_cache_sentinel")?(l=_.jsx("div",{ref:t,hidden:!0,"aria-hidden":"true",className:"sticky bottom-0 z-10 h-2.5 bg-background"}),n[3]=l):l=n[3],l},Ot=[],Dn=`
|
|
4
4
|
[data-gutter-buffer="annotation"] { min-height: 0; }
|
package/dist/assets/{useCallableModelProviders-B1YBs2FN.js → useCallableModelProviders-DpMos2Hl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./vendor-react--VO_rL_p.js";import{l as u,j as p}from"./katex.min-
|
|
1
|
+
import{r as a}from"./vendor-react--VO_rL_p.js";import{l as u,j as p}from"./katex.min-Bs5OLoA1.js";import{V as f}from"./useAppFontEffects-3RimJo4B.js";function h(t=!0){const i=f(r=>r.providers),e=u(r=>r.currentDirectory),[c,n]=a.useState(void 0);return a.useEffect(()=>{if(!t)return;let r=!1;return(async()=>{try{const l=e?`/api/small-model?directory=${encodeURIComponent(e)}`:"/api/small-model",o=await p(l,{method:"GET",headers:{Accept:"application/json"}});if(!o.ok)return;const s=await o.json().catch(()=>null);!r&&Array.isArray(s?.authenticatedProviders)&&n(s.authenticatedProviders.filter(d=>typeof d=="string"))}catch{}})(),()=>{r=!0}},[i,e,t]),c}export{h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as we,R as n,j as x}from"./vendor-react--VO_rL_p.js";import{h as Fe}from"./useBranchPullRequestRequest-CaGsp4wW.js";import{u as Ce,Q as Ee,cY as Se,I as oe,y as Re,ad as ue,B as fe,ae as de,ac as me,fs as ve,ft as Ne}from"./useAppFontEffects-D9nf8G19.js";import"./katex.min-g52ii4Gs.js";const je="data-diff-find-bar",Qe=t=>{const e=we.c(99),{query:i,onQueryChange:y,total:a,currentIndex:h,isSearching:s,failedCount:C,onNext:g,onPrevious:b,onClose:m,focusNonce:d,className:P}=t,k=C===void 0?0:C,{t:l}=Ce(),E=n.useRef(null);let A,N;e[0]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{E.current?.focus()},N=[],e[0]=A,e[1]=N):(A=e[0],N=e[1]),n.useEffect(A,N);let F,S;e[2]!==d?(F=()=>{d&&d>0&&(E.current?.focus(),E.current?.select())},S=[d],e[2]=d,e[3]=F,e[4]=S):(F=e[3],S=e[4]),n.useEffect(F,S);let I;e[5]!==s||e[6]!==i?(I=i.trim().length>0&&!s,e[5]=s,e[6]=i,e[7]=I):I=e[7];const j=I;let p;e[8]!==h||e[9]!==j||e[10]!==l||e[11]!==a?(p=a>0?l("diffFind.countAria",{current:h+1,total:a}):j?l("diffFind.noMatches"):void 0,e[8]=h,e[9]=j,e[10]=l,e[11]=a,e[12]=p):p=e[12];const _=p;let o;e[13]!==s||e[14]!==_||e[15]!==l?(o=s?[_,l("diffFind.searchingAria")].filter(Boolean).join(", "):_,e[13]=s,e[14]=_,e[15]=l,e[16]=o):o=e[16];const c=o;let u;e[17]!==m||e[18]!==g||e[19]!==b?(u=B=>{Se(B)||(B.key==="Enter"?(B.preventDefault(),B.shiftKey?b():g()):B.key==="Escape"&&(B.preventDefault(),m()))},e[17]=m,e[18]=g,e[19]=b,e[20]=u):u=e[20];const w=u;let R;e[21]!==P?(R=Ee("absolute inset-e-3 top-3 z-40 flex flex-col rounded-lg border border-edge bg-[var(--surface-elevated)] px-1.5 py-1 shadow-lg",P),e[21]=P,e[22]=R):R=e[22];let Q;e[23]===Symbol.for("react.memo_cache_sentinel")?(Q=x.jsx(oe,{name:"search",className:"ms-0.5 size-3.5 text-muted-foreground"}),e[23]=Q):Q=e[23];let T;e[24]!==y?(T=B=>y(B.target.value),e[24]=y,e[25]=T):T=e[25];let O;e[26]!==l?(O=l("diffFind.placeholder"),e[26]=l,e[27]=O):O=e[27];let $;e[28]!==l?($=l("diffFind.placeholder"),e[28]=l,e[29]=$):$=e[29];let z;e[30]!==w||e[31]!==i||e[32]!==T||e[33]!==O||e[34]!==$?(z=x.jsx(Re,{ref:E,value:i,onChange:T,onKeyDown:w,placeholder:O,"aria-label":$,className:"h-7 w-40 rounded-md px-2 py-0 text-sm md:w-56"}),e[30]=w,e[31]=i,e[32]=T,e[33]=O,e[34]=$,e[35]=z):z=e[35];let D;e[36]!==h||e[37]!==j||e[38]!==s||e[39]!==l||e[40]!==a?(D=j&&a===0?l("diffFind.noMatches"):a>0?`${h+1}/${a}${s?"+":""}`:"",e[36]=h,e[37]=j,e[38]=s,e[39]=l,e[40]=a,e[41]=D):D=e[41];let r;e[42]!==c||e[43]!==D?(r=x.jsx("span",{className:"min-w-12 px-1 text-center typography-micro text-muted-foreground tabular-nums","aria-live":"polite","aria-label":c,children:D}),e[42]=c,e[43]=D,e[44]=r):r=e[44];let f;e[45]!==l?(f=l("diffFind.previousAria"),e[45]=l,e[46]=f):f=e[46];const v=a===0;let M;e[47]===Symbol.for("react.memo_cache_sentinel")?(M=x.jsx(oe,{name:"arrow-up",className:"size-3.5"}),e[47]=M):M=e[47];let L;e[48]!==b||e[49]!==f||e[50]!==v?(L=x.jsx(ue,{asChild:!0,children:x.jsx("span",{className:"inline-flex",children:x.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:b,"aria-label":f,disabled:v,children:M})})}),e[48]=b,e[49]=f,e[50]=v,e[51]=L):L=e[51];let H;e[52]!==l?(H=l("diffFind.previousAria"),e[52]=l,e[53]=H):H=e[53];let K;e[54]!==H?(K=x.jsx(de,{side:"bottom",sideOffset:6,children:H}),e[54]=H,e[55]=K):K=e[55];let W;e[56]!==L||e[57]!==K?(W=x.jsxs(me,{children:[L,K]}),e[56]=L,e[57]=K,e[58]=W):W=e[58];let U;e[59]!==l?(U=l("diffFind.nextAria"),e[59]=l,e[60]=U):U=e[60];const ce=a===0;let re;e[61]===Symbol.for("react.memo_cache_sentinel")?(re=x.jsx(oe,{name:"arrow-down",className:"size-3.5"}),e[61]=re):re=e[61];let q;e[62]!==g||e[63]!==U||e[64]!==ce?(q=x.jsx(ue,{asChild:!0,children:x.jsx("span",{className:"inline-flex",children:x.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:g,"aria-label":U,disabled:ce,children:re})})}),e[62]=g,e[63]=U,e[64]=ce,e[65]=q):q=e[65];let J;e[66]!==l?(J=l("diffFind.nextAria"),e[66]=l,e[67]=J):J=e[67];let Y;e[68]!==J?(Y=x.jsx(de,{side:"bottom",sideOffset:6,children:J}),e[68]=J,e[69]=Y):Y=e[69];let G;e[70]!==q||e[71]!==Y?(G=x.jsxs(me,{children:[q,Y]}),e[70]=q,e[71]=Y,e[72]=G):G=e[72];let V;e[73]!==l?(V=l("diffFind.closeAria"),e[73]=l,e[74]=V):V=e[74];let ie;e[75]===Symbol.for("react.memo_cache_sentinel")?(ie=x.jsx(oe,{name:"close",className:"size-3.5"}),e[75]=ie):ie=e[75];let X;e[76]!==m||e[77]!==V?(X=x.jsx(ue,{asChild:!0,children:x.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:m,"aria-label":V,children:ie})}),e[76]=m,e[77]=V,e[78]=X):X=e[78];let Z;e[79]!==l?(Z=l("diffFind.closeAria"),e[79]=l,e[80]=Z):Z=e[80];let ee;e[81]!==Z?(ee=x.jsx(de,{side:"bottom",sideOffset:6,children:Z}),e[81]=Z,e[82]=ee):ee=e[82];let te;e[83]!==X||e[84]!==ee?(te=x.jsxs(me,{children:[X,ee]}),e[83]=X,e[84]=ee,e[85]=te):te=e[85];let ne;e[86]!==z||e[87]!==r||e[88]!==W||e[89]!==G||e[90]!==te?(ne=x.jsxs("div",{className:"flex items-center gap-1",children:[Q,z,r,W,G,te]}),e[86]=z,e[87]=r,e[88]=W,e[89]=G,e[90]=te,e[91]=ne):ne=e[91];let se;e[92]!==k||e[93]!==l?(se=k>0&&x.jsx("p",{className:"w-0 min-w-full px-1 pb-0.5 typography-micro text-status-warning",children:l("diffFind.failedCount",{count:k})}),e[92]=k,e[93]=l,e[94]=se):se=e[94];let le;return e[95]!==R||e[96]!==ne||e[97]!==se?(le=x.jsxs("div",{"data-diff-find-bar":"",className:R,children:[ne,se]}),e[95]=R,e[96]=ne,e[97]=se,e[98]=le):le=e[98],le},Ie=/[.*+?^${}()|[\]\\]/g,Me=t=>t.replace(Ie,"\\$&"),Le=t=>t.replace(/\r?\n$/,""),ke=(t,e,i)=>{const y=new RegExp(Me(e),i?"g":"gi"),a=[];for(const h of t.matchAll(y))a.push({spanStart:h.index??0,spanLength:h[0].length});return a},ae=(t,e,i,y,a,h,s)=>{if(y<1)return;const C=Le(a);for(const g of ke(C,h,s))t.push({filePath:e,side:i,lineNumber:y,spanStart:g.spanStart,spanLength:g.spanLength})},Ae=(t,e,i,y)=>{if(i.length===0)return[];const a=y.caseSensitive??!1,h=y.layout==="inline",s=[];for(const C of t.hunks){let g=C.additionStart,b=C.deletionStart;for(const m of C.hunkContent){if(m.type==="context"){for(let d=0;d<m.lines;d+=1)h||ae(s,e,"deletions",b+d,t.deletionLines[m.deletionLineIndex+d],i,a),ae(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,a);g+=m.lines,b+=m.lines;continue}for(let d=0;d<m.deletions;d+=1)ae(s,e,"deletions",b+d,t.deletionLines[m.deletionLineIndex+d],i,a);b+=m.deletions;for(let d=0;d<m.additions;d+=1)ae(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,a);g+=m.additions}}return s},Pe=120,He=(t,e)=>t&&e?Fe(t):t,pe=[],xe=(t,e)=>t.filePath===e.filePath&&t.side===e.side&&t.lineNumber===e.lineNumber&&t.spanStart===e.spanStart,ge=(t,e)=>{const i=t.get(e.filePath);return i!==void 0&&i.revision===e.revision},he=(t,e)=>t.has(e.filePath)&&t.get(e.filePath)===e.revision,be=(t,e)=>{const i=[],y=a=>{for(const h of a){const s=e.get(h.filePath);s?.nestedSources&&s.revision===h.revision?y(s.nestedSources):i.push(h)}};return y(t),i},Ke=({sources:t,caseSensitive:e=!1})=>{const[i,y]=n.useState(!1),[a,h]=n.useState(""),[s,C]=n.useState(""),[g,b]=n.useState(0),[m,d]=n.useState(()=>new Map),P=n.useRef(m),[k,l]=n.useState(()=>new Map),E=n.useRef(k),A=n.useRef(t);A.current=t;const N=n.useRef(i);N.current=i;const F=n.useRef(!1),S=n.useRef(null),I=n.useCallback(async()=>{if(!F.current){F.current=!0;try{for(;;){if(!N.current)return;const r=be(A.current,P.current).find(L=>!ge(P.current,L)&&!he(E.current,L));if(!r)return;let f;try{f=await r.load()}catch{const L=new Map(E.current).set(r.filePath,r.revision);E.current=L,l(L);continue}const v=f!==null&&"nestedSources"in f?{revision:r.revision,diff:null,nestedSources:f.nestedSources}:{revision:r.revision,diff:f,nestedSources:null},M=new Map(P.current).set(r.filePath,v);P.current=M,d(M)}}finally{F.current=!1}}},[]);n.useEffect(()=>{i&&I()},[i,I,t]),n.useEffect(()=>{if(a===s)return;const r=window.setTimeout(()=>{C(a),b(0)},Pe);return()=>window.clearTimeout(r)},[s,a]);const j=n.useMemo(()=>be(t,m),[m,t]),p=n.useMemo(()=>{if(!i)return pe;const r=s.trim();if(r.length===0)return pe;const f=[];for(const v of j){const M=m.get(v.filePath)?.diff;M&&f.push(...Ae(M,v.filePath,r,{caseSensitive:e,layout:v.layout}))}return f},[s,e,i,m,j]),_=n.useRef(p);_.current=p;const[o,c]=n.useState({matches:p,query:s});if(o.matches!==p){const r=o.query===s?o.matches[g]:void 0,f=r?p.findIndex(M=>xe(M,r)):-1,v=f>=0?f:p.length===0?0:Math.min(g,p.length-1);c({matches:p,query:s}),v!==g&&b(v)}const u=n.useCallback(r=>{S.current=null,h(r)},[]),w=n.useCallback(()=>{if(!N.current&&E.current.size>0){const r=new Map;E.current=r,l(r)}y(!0)},[]),R=n.useCallback(()=>{S.current=null,w()},[w]),Q=n.useCallback(()=>{S.current=null,y(!1)},[]),T=n.useCallback((r,f)=>{if(h(r),C(r),w(),f){S.current={...f,query:r};return}S.current=null,b(0)},[w]),O=i&&j.some(r=>!ge(m,r)&&!he(k,r)),$=i?j.filter(r=>he(k,r)).length:0;n.useEffect(()=>{const r=S.current;if(!r)return;if(!i||r.query!==s){S.current=null;return}const f=p.findIndex(v=>xe(v,r));if(f>=0){S.current=null,b(p.length===0?0:(f+1)%p.length);return}O||(S.current=null,b(0))},[s,i,O,p]);const z=n.useCallback(()=>{b(r=>{const f=_.current.length;return f===0?0:(r+1)%f})},[]),D=n.useCallback(()=>{b(r=>{const f=_.current.length;return f===0?0:(r-1+f)%f})},[]);return{isOpen:i,open:R,close:Q,query:a,setQuery:u,matches:p,currentIndex:g,currentMatch:p[g]??null,isSearching:O,failedCount:$,next:z,previous:D,openWithQuery:T}},_e=(t,e)=>t instanceof HTMLElement&&!e?.contains(t)&&(t.isContentEditable||t.matches("input, textarea")),Oe=5e3,Te="[data-find-surface]",ye=(t,e)=>{if(!(t instanceof Element))return!1;const i=t.closest(Te);return i!==null&&i!==e},We=({find:t,visible:e,rootRef:i,reveal:y})=>{const{isOpen:a,matches:h,currentMatch:s,currentIndex:C,open:g,close:b,openWithQuery:m}=t,d=n.useRef(new Map),[P,k]=n.useState(0),l=n.useRef(y);l.current=y;const E=n.useMemo(()=>{const o=new Map;for(const c of h){const u=o.get(c.filePath);u?u.push(c):o.set(c.filePath,[c])}return o},[h]),A=n.useRef({isOpen:a,currentMatch:s,matchesByFile:E});A.current={isOpen:a,currentMatch:s,matchesByFile:E};const N=n.useCallback((o,c)=>{const u=A.current,w=u.currentMatch;if(!u.isOpen||!w||w.filePath!==o){c.setFindHighlights([],0);return}const R=u.matchesByFile.get(o)??[];c.setFindHighlights(R,R.indexOf(w))},[]),F=n.useRef(null),S=n.useCallback(()=>{const o=F.current;o?.frame!=null&&window.cancelAnimationFrame(o.frame),F.current=null},[]),I=n.useCallback(o=>{const c=F.current;c?.frame!=null&&window.cancelAnimationFrame(c.frame);const u={match:o,frame:null,deadline:performance.now()+Oe};F.current=u;const w=()=>{if(u.frame=null,F.current!==u)return;if(d.current.get(o.filePath)?.scrollToLine({lineNumber:o.lineNumber,side:o.side,align:"center"})){F.current=null;return}performance.now()<u.deadline&&(u.frame=window.requestAnimationFrame(w))};u.frame=window.requestAnimationFrame(w)},[]);n.useEffect(()=>S,[S]);const j=n.useCallback((o,c)=>{if(!c){d.current.delete(o);return}d.current.set(o,c),A.current.isOpen&&N(o,c);const u=F.current;u&&u.match.filePath===o&&I(u.match)},[N,I]);n.useEffect(()=>{for(const[o,c]of d.current)N(o,c)},[N,s,a,E]);const p=n.useRef(null);n.useEffect(()=>{if(!a||!s){p.current=null,S();return}const o=`${C}:${s.filePath}:${s.side}:${s.lineNumber}:${s.spanStart}`;p.current!==o&&(p.current=o,l.current(s,d.current.has(s.filePath)),I(s))},[S,C,s,a,I]),ve("find_in_file",o=>{if(!e||o.defaultPrevented||_e(document.activeElement,i.current)||ye(o.target,i.current))return!1;g(),k(c=>c+1)}),n.useEffect(()=>{if(!e||!a)return;const o=c=>{if(c.key!=="Escape"||c.defaultPrevented||Se(c))return;const{target:u}=c;if(!(u instanceof Node))return;const w=document.activeElement,R=!w||w===document.body;!i.current?.contains(u)&&!R||ye(u,i.current)||!(u instanceof Element&&u.closest(`[${je}]`)!==null)&&Ne(u)||(c.preventDefault(),c.stopPropagation(),b())};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[b,a,i,e]);const _=n.useCallback((o,c)=>{m(c.word,{filePath:o,side:c.side,lineNumber:c.lineNumber,spanStart:c.spanStart}),k(u=>u+1)},[m]);return{registerViewer:j,openOnWord:_,focusNonce:P}};export{Qe as D,We as a,He as r,Ke as u};
|
|
1
|
+
import{f as we,R as n,j as x}from"./vendor-react--VO_rL_p.js";import{h as Fe}from"./useBranchPullRequestRequest-CMvepZei.js";import{u as Ce,Q as Ee,cY as Se,I as oe,y as Re,ad as ue,B as fe,ae as de,ac as me,fs as ve,ft as Ne}from"./useAppFontEffects-3RimJo4B.js";import"./katex.min-Bs5OLoA1.js";const je="data-diff-find-bar",Qe=t=>{const e=we.c(99),{query:i,onQueryChange:y,total:a,currentIndex:h,isSearching:s,failedCount:C,onNext:g,onPrevious:b,onClose:m,focusNonce:d,className:P}=t,k=C===void 0?0:C,{t:l}=Ce(),E=n.useRef(null);let A,N;e[0]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{E.current?.focus()},N=[],e[0]=A,e[1]=N):(A=e[0],N=e[1]),n.useEffect(A,N);let F,S;e[2]!==d?(F=()=>{d&&d>0&&(E.current?.focus(),E.current?.select())},S=[d],e[2]=d,e[3]=F,e[4]=S):(F=e[3],S=e[4]),n.useEffect(F,S);let I;e[5]!==s||e[6]!==i?(I=i.trim().length>0&&!s,e[5]=s,e[6]=i,e[7]=I):I=e[7];const j=I;let p;e[8]!==h||e[9]!==j||e[10]!==l||e[11]!==a?(p=a>0?l("diffFind.countAria",{current:h+1,total:a}):j?l("diffFind.noMatches"):void 0,e[8]=h,e[9]=j,e[10]=l,e[11]=a,e[12]=p):p=e[12];const _=p;let o;e[13]!==s||e[14]!==_||e[15]!==l?(o=s?[_,l("diffFind.searchingAria")].filter(Boolean).join(", "):_,e[13]=s,e[14]=_,e[15]=l,e[16]=o):o=e[16];const c=o;let u;e[17]!==m||e[18]!==g||e[19]!==b?(u=B=>{Se(B)||(B.key==="Enter"?(B.preventDefault(),B.shiftKey?b():g()):B.key==="Escape"&&(B.preventDefault(),m()))},e[17]=m,e[18]=g,e[19]=b,e[20]=u):u=e[20];const w=u;let R;e[21]!==P?(R=Ee("absolute inset-e-3 top-3 z-40 flex flex-col rounded-lg border border-edge bg-[var(--surface-elevated)] px-1.5 py-1 shadow-lg",P),e[21]=P,e[22]=R):R=e[22];let Q;e[23]===Symbol.for("react.memo_cache_sentinel")?(Q=x.jsx(oe,{name:"search",className:"ms-0.5 size-3.5 text-muted-foreground"}),e[23]=Q):Q=e[23];let T;e[24]!==y?(T=B=>y(B.target.value),e[24]=y,e[25]=T):T=e[25];let O;e[26]!==l?(O=l("diffFind.placeholder"),e[26]=l,e[27]=O):O=e[27];let $;e[28]!==l?($=l("diffFind.placeholder"),e[28]=l,e[29]=$):$=e[29];let z;e[30]!==w||e[31]!==i||e[32]!==T||e[33]!==O||e[34]!==$?(z=x.jsx(Re,{ref:E,value:i,onChange:T,onKeyDown:w,placeholder:O,"aria-label":$,className:"h-7 w-40 rounded-md px-2 py-0 text-sm md:w-56"}),e[30]=w,e[31]=i,e[32]=T,e[33]=O,e[34]=$,e[35]=z):z=e[35];let D;e[36]!==h||e[37]!==j||e[38]!==s||e[39]!==l||e[40]!==a?(D=j&&a===0?l("diffFind.noMatches"):a>0?`${h+1}/${a}${s?"+":""}`:"",e[36]=h,e[37]=j,e[38]=s,e[39]=l,e[40]=a,e[41]=D):D=e[41];let r;e[42]!==c||e[43]!==D?(r=x.jsx("span",{className:"min-w-12 px-1 text-center typography-micro text-muted-foreground tabular-nums","aria-live":"polite","aria-label":c,children:D}),e[42]=c,e[43]=D,e[44]=r):r=e[44];let f;e[45]!==l?(f=l("diffFind.previousAria"),e[45]=l,e[46]=f):f=e[46];const v=a===0;let M;e[47]===Symbol.for("react.memo_cache_sentinel")?(M=x.jsx(oe,{name:"arrow-up",className:"size-3.5"}),e[47]=M):M=e[47];let L;e[48]!==b||e[49]!==f||e[50]!==v?(L=x.jsx(ue,{asChild:!0,children:x.jsx("span",{className:"inline-flex",children:x.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:b,"aria-label":f,disabled:v,children:M})})}),e[48]=b,e[49]=f,e[50]=v,e[51]=L):L=e[51];let H;e[52]!==l?(H=l("diffFind.previousAria"),e[52]=l,e[53]=H):H=e[53];let K;e[54]!==H?(K=x.jsx(de,{side:"bottom",sideOffset:6,children:H}),e[54]=H,e[55]=K):K=e[55];let W;e[56]!==L||e[57]!==K?(W=x.jsxs(me,{children:[L,K]}),e[56]=L,e[57]=K,e[58]=W):W=e[58];let U;e[59]!==l?(U=l("diffFind.nextAria"),e[59]=l,e[60]=U):U=e[60];const ce=a===0;let re;e[61]===Symbol.for("react.memo_cache_sentinel")?(re=x.jsx(oe,{name:"arrow-down",className:"size-3.5"}),e[61]=re):re=e[61];let q;e[62]!==g||e[63]!==U||e[64]!==ce?(q=x.jsx(ue,{asChild:!0,children:x.jsx("span",{className:"inline-flex",children:x.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:g,"aria-label":U,disabled:ce,children:re})})}),e[62]=g,e[63]=U,e[64]=ce,e[65]=q):q=e[65];let J;e[66]!==l?(J=l("diffFind.nextAria"),e[66]=l,e[67]=J):J=e[67];let Y;e[68]!==J?(Y=x.jsx(de,{side:"bottom",sideOffset:6,children:J}),e[68]=J,e[69]=Y):Y=e[69];let G;e[70]!==q||e[71]!==Y?(G=x.jsxs(me,{children:[q,Y]}),e[70]=q,e[71]=Y,e[72]=G):G=e[72];let V;e[73]!==l?(V=l("diffFind.closeAria"),e[73]=l,e[74]=V):V=e[74];let ie;e[75]===Symbol.for("react.memo_cache_sentinel")?(ie=x.jsx(oe,{name:"close",className:"size-3.5"}),e[75]=ie):ie=e[75];let X;e[76]!==m||e[77]!==V?(X=x.jsx(ue,{asChild:!0,children:x.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:m,"aria-label":V,children:ie})}),e[76]=m,e[77]=V,e[78]=X):X=e[78];let Z;e[79]!==l?(Z=l("diffFind.closeAria"),e[79]=l,e[80]=Z):Z=e[80];let ee;e[81]!==Z?(ee=x.jsx(de,{side:"bottom",sideOffset:6,children:Z}),e[81]=Z,e[82]=ee):ee=e[82];let te;e[83]!==X||e[84]!==ee?(te=x.jsxs(me,{children:[X,ee]}),e[83]=X,e[84]=ee,e[85]=te):te=e[85];let ne;e[86]!==z||e[87]!==r||e[88]!==W||e[89]!==G||e[90]!==te?(ne=x.jsxs("div",{className:"flex items-center gap-1",children:[Q,z,r,W,G,te]}),e[86]=z,e[87]=r,e[88]=W,e[89]=G,e[90]=te,e[91]=ne):ne=e[91];let se;e[92]!==k||e[93]!==l?(se=k>0&&x.jsx("p",{className:"w-0 min-w-full px-1 pb-0.5 typography-micro text-status-warning",children:l("diffFind.failedCount",{count:k})}),e[92]=k,e[93]=l,e[94]=se):se=e[94];let le;return e[95]!==R||e[96]!==ne||e[97]!==se?(le=x.jsxs("div",{"data-diff-find-bar":"",className:R,children:[ne,se]}),e[95]=R,e[96]=ne,e[97]=se,e[98]=le):le=e[98],le},Ie=/[.*+?^${}()|[\]\\]/g,Me=t=>t.replace(Ie,"\\$&"),Le=t=>t.replace(/\r?\n$/,""),ke=(t,e,i)=>{const y=new RegExp(Me(e),i?"g":"gi"),a=[];for(const h of t.matchAll(y))a.push({spanStart:h.index??0,spanLength:h[0].length});return a},ae=(t,e,i,y,a,h,s)=>{if(y<1)return;const C=Le(a);for(const g of ke(C,h,s))t.push({filePath:e,side:i,lineNumber:y,spanStart:g.spanStart,spanLength:g.spanLength})},Ae=(t,e,i,y)=>{if(i.length===0)return[];const a=y.caseSensitive??!1,h=y.layout==="inline",s=[];for(const C of t.hunks){let g=C.additionStart,b=C.deletionStart;for(const m of C.hunkContent){if(m.type==="context"){for(let d=0;d<m.lines;d+=1)h||ae(s,e,"deletions",b+d,t.deletionLines[m.deletionLineIndex+d],i,a),ae(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,a);g+=m.lines,b+=m.lines;continue}for(let d=0;d<m.deletions;d+=1)ae(s,e,"deletions",b+d,t.deletionLines[m.deletionLineIndex+d],i,a);b+=m.deletions;for(let d=0;d<m.additions;d+=1)ae(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,a);g+=m.additions}}return s},Pe=120,He=(t,e)=>t&&e?Fe(t):t,pe=[],xe=(t,e)=>t.filePath===e.filePath&&t.side===e.side&&t.lineNumber===e.lineNumber&&t.spanStart===e.spanStart,ge=(t,e)=>{const i=t.get(e.filePath);return i!==void 0&&i.revision===e.revision},he=(t,e)=>t.has(e.filePath)&&t.get(e.filePath)===e.revision,be=(t,e)=>{const i=[],y=a=>{for(const h of a){const s=e.get(h.filePath);s?.nestedSources&&s.revision===h.revision?y(s.nestedSources):i.push(h)}};return y(t),i},Ke=({sources:t,caseSensitive:e=!1})=>{const[i,y]=n.useState(!1),[a,h]=n.useState(""),[s,C]=n.useState(""),[g,b]=n.useState(0),[m,d]=n.useState(()=>new Map),P=n.useRef(m),[k,l]=n.useState(()=>new Map),E=n.useRef(k),A=n.useRef(t);A.current=t;const N=n.useRef(i);N.current=i;const F=n.useRef(!1),S=n.useRef(null),I=n.useCallback(async()=>{if(!F.current){F.current=!0;try{for(;;){if(!N.current)return;const r=be(A.current,P.current).find(L=>!ge(P.current,L)&&!he(E.current,L));if(!r)return;let f;try{f=await r.load()}catch{const L=new Map(E.current).set(r.filePath,r.revision);E.current=L,l(L);continue}const v=f!==null&&"nestedSources"in f?{revision:r.revision,diff:null,nestedSources:f.nestedSources}:{revision:r.revision,diff:f,nestedSources:null},M=new Map(P.current).set(r.filePath,v);P.current=M,d(M)}}finally{F.current=!1}}},[]);n.useEffect(()=>{i&&I()},[i,I,t]),n.useEffect(()=>{if(a===s)return;const r=window.setTimeout(()=>{C(a),b(0)},Pe);return()=>window.clearTimeout(r)},[s,a]);const j=n.useMemo(()=>be(t,m),[m,t]),p=n.useMemo(()=>{if(!i)return pe;const r=s.trim();if(r.length===0)return pe;const f=[];for(const v of j){const M=m.get(v.filePath)?.diff;M&&f.push(...Ae(M,v.filePath,r,{caseSensitive:e,layout:v.layout}))}return f},[s,e,i,m,j]),_=n.useRef(p);_.current=p;const[o,c]=n.useState({matches:p,query:s});if(o.matches!==p){const r=o.query===s?o.matches[g]:void 0,f=r?p.findIndex(M=>xe(M,r)):-1,v=f>=0?f:p.length===0?0:Math.min(g,p.length-1);c({matches:p,query:s}),v!==g&&b(v)}const u=n.useCallback(r=>{S.current=null,h(r)},[]),w=n.useCallback(()=>{if(!N.current&&E.current.size>0){const r=new Map;E.current=r,l(r)}y(!0)},[]),R=n.useCallback(()=>{S.current=null,w()},[w]),Q=n.useCallback(()=>{S.current=null,y(!1)},[]),T=n.useCallback((r,f)=>{if(h(r),C(r),w(),f){S.current={...f,query:r};return}S.current=null,b(0)},[w]),O=i&&j.some(r=>!ge(m,r)&&!he(k,r)),$=i?j.filter(r=>he(k,r)).length:0;n.useEffect(()=>{const r=S.current;if(!r)return;if(!i||r.query!==s){S.current=null;return}const f=p.findIndex(v=>xe(v,r));if(f>=0){S.current=null,b(p.length===0?0:(f+1)%p.length);return}O||(S.current=null,b(0))},[s,i,O,p]);const z=n.useCallback(()=>{b(r=>{const f=_.current.length;return f===0?0:(r+1)%f})},[]),D=n.useCallback(()=>{b(r=>{const f=_.current.length;return f===0?0:(r-1+f)%f})},[]);return{isOpen:i,open:R,close:Q,query:a,setQuery:u,matches:p,currentIndex:g,currentMatch:p[g]??null,isSearching:O,failedCount:$,next:z,previous:D,openWithQuery:T}},_e=(t,e)=>t instanceof HTMLElement&&!e?.contains(t)&&(t.isContentEditable||t.matches("input, textarea")),Oe=5e3,Te="[data-find-surface]",ye=(t,e)=>{if(!(t instanceof Element))return!1;const i=t.closest(Te);return i!==null&&i!==e},We=({find:t,visible:e,rootRef:i,reveal:y})=>{const{isOpen:a,matches:h,currentMatch:s,currentIndex:C,open:g,close:b,openWithQuery:m}=t,d=n.useRef(new Map),[P,k]=n.useState(0),l=n.useRef(y);l.current=y;const E=n.useMemo(()=>{const o=new Map;for(const c of h){const u=o.get(c.filePath);u?u.push(c):o.set(c.filePath,[c])}return o},[h]),A=n.useRef({isOpen:a,currentMatch:s,matchesByFile:E});A.current={isOpen:a,currentMatch:s,matchesByFile:E};const N=n.useCallback((o,c)=>{const u=A.current,w=u.currentMatch;if(!u.isOpen||!w||w.filePath!==o){c.setFindHighlights([],0);return}const R=u.matchesByFile.get(o)??[];c.setFindHighlights(R,R.indexOf(w))},[]),F=n.useRef(null),S=n.useCallback(()=>{const o=F.current;o?.frame!=null&&window.cancelAnimationFrame(o.frame),F.current=null},[]),I=n.useCallback(o=>{const c=F.current;c?.frame!=null&&window.cancelAnimationFrame(c.frame);const u={match:o,frame:null,deadline:performance.now()+Oe};F.current=u;const w=()=>{if(u.frame=null,F.current!==u)return;if(d.current.get(o.filePath)?.scrollToLine({lineNumber:o.lineNumber,side:o.side,align:"center"})){F.current=null;return}performance.now()<u.deadline&&(u.frame=window.requestAnimationFrame(w))};u.frame=window.requestAnimationFrame(w)},[]);n.useEffect(()=>S,[S]);const j=n.useCallback((o,c)=>{if(!c){d.current.delete(o);return}d.current.set(o,c),A.current.isOpen&&N(o,c);const u=F.current;u&&u.match.filePath===o&&I(u.match)},[N,I]);n.useEffect(()=>{for(const[o,c]of d.current)N(o,c)},[N,s,a,E]);const p=n.useRef(null);n.useEffect(()=>{if(!a||!s){p.current=null,S();return}const o=`${C}:${s.filePath}:${s.side}:${s.lineNumber}:${s.spanStart}`;p.current!==o&&(p.current=o,l.current(s,d.current.has(s.filePath)),I(s))},[S,C,s,a,I]),ve("find_in_file",o=>{if(!e||o.defaultPrevented||_e(document.activeElement,i.current)||ye(o.target,i.current))return!1;g(),k(c=>c+1)}),n.useEffect(()=>{if(!e||!a)return;const o=c=>{if(c.key!=="Escape"||c.defaultPrevented||Se(c))return;const{target:u}=c;if(!(u instanceof Node))return;const w=document.activeElement,R=!w||w===document.body;!i.current?.contains(u)&&!R||ye(u,i.current)||!(u instanceof Element&&u.closest(`[${je}]`)!==null)&&Ne(u)||(c.preventDefault(),c.stopPropagation(),b())};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[b,a,i,e]);const _=n.useCallback((o,c)=>{m(c.word,{filePath:o,side:c.side,lineNumber:c.lineNumber,spanStart:c.spanStart}),k(u=>u+1)},[m]);return{registerViewer:j,openOnWord:_,focusNonce:P}};export{Qe as D,We as a,He as r,Ke as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{R as w,f as be,j as t}from"./vendor-react--VO_rL_p.js";import{u as Rt}from"./vendor-tanstack-react-virtual-CqfECoM0.js";import{h9 as Ot,gM as Ft,u as ye,aP as nt,ac as at,ad as ot,I as _,Q as de,ae as lt,fq as Pt,K as Mt,ha as we,B as ne,hb as Lt,b4 as Ht,hc as $t,t as Fe,q as Pe,D as Me,l as Le,F as He,o as it,hd as Gt,a0 as rt,he as ct,n as dt,hf as _t,aW as Bt,A as xe,C as Kt,bR as bt,bS as wt,hg as Re,hh as vt,cd as Be,hi as jt,hj as Nt,hk as qt,hl as Ct,hm as Ke,hn as St,ho as kt,hp as Ut,hq as Xt,hr as Vt,hs as Wt,ht as Jt,hu as Yt,hv as At,hw as Tt,eI as Je,bt as ut,bu as mt,bv as ft,bw as ht,bx as pt,hx as Zt,hy as Qt,hz as es,hA as ts,hB as ss,cc as $e,hC as It,hD as is,x as gt,hE as ns,hF as as}from"./useAppFontEffects-D9nf8G19.js";import{u as qe,c4 as Et,c5 as os,aX as Ue}from"./katex.min-g52ii4Gs.js";import{a as ls,b as rs,c as cs,f as ds,T as Ye}from"./useBranchPullRequestRequest-CaGsp4wW.js";import{C as us}from"./ChangedPathLabel-CQOXgkIF.js";import{P as ms,L as fs,O as hs,ar as ps}from"./runtimeEndpointReset-BJm_77m2.js";const gs=500,xs=10;let Se=null;const Oe=()=>{Se&&window.clearTimeout(Se.timer),Se=null},Dt=l=>({onPointerDown:e=>{if(Oe(),e.pointerType==="mouse"||e.target instanceof Element&&e.target.closest("button, a, input"))return;Se={timer:window.setTimeout(()=>{Se=null,Ot(),l()},gs),x:e.clientX,y:e.clientY}},onPointerMove:e=>{Se&&Math.hypot(e.clientX-Se.x,e.clientY-Se.y)>xs&&Oe()},onPointerUp:Oe,onPointerCancel:Oe,onPointerLeave:Oe,onContextMenu:e=>e.preventDefault()}),ys=l=>{const e=be.c(14),{insertions:s,deletions:i,hideZero:h}=l,m=h===void 0?!1:h;let f;e[0]!==m||e[1]!==s?(f=m&&s===0?null:t.jsxs("span",{style:{color:"var(--status-success)"},children:["+",s]}),e[0]=m,e[1]=s,e[2]=f):f=e[2];let c;e[3]!==i||e[4]!==m||e[5]!==s?(c=m?s>0&&i>0?" ":null:t.jsx("span",{className:"text-muted-foreground mx-0.5",children:"/"}),e[3]=i,e[4]=m,e[5]=s,e[6]=c):c=e[6];let r;e[7]!==i||e[8]!==m?(r=m&&i===0?null:t.jsxs("span",{style:{color:"var(--status-error)"},children:["-",i]}),e[7]=i,e[8]=m,e[9]=r):r=e[9];let p;return e[10]!==f||e[11]!==c||e[12]!==r?(p=t.jsxs("span",{className:"shrink-0 typography-micro tabular-nums",children:[f,c,r]}),e[10]=f,e[11]=c,e[12]=r,e[13]=p):p=e[13],p},bs=w.memo(function(e){const s=be.c(75),{file:i,actionLabel:h,actionSymbol:m,onAction:f,onViewDiff:c,onRevert:r,isReverting:p,stats:k,rowPaddingClassName:C,indentPx:d,actionAtStart:y,nameOnly:S,showRevert:H}=e,V=d===void 0?0:d,v=y===void 0?!1:y,o=S===void 0?!1:S,x=H===void 0?!0:H;let T;s[0]!==i?(T=Ft(i),s[0]=i,s[1]=T):T=s[1];const I=T,{t:O}=ye(),{isMobile:z}=nt();let Q;s[2]!==I.descriptionKey||s[3]!==O?(Q=O(I.descriptionKey),s[2]=I.descriptionKey,s[3]=O,s[4]=Q):Q=s[4];const U=Q,K=k?.insertions??0,A=k?.deletions??0;let R;s[5]!==f||s[6]!==c?(R=B=>{B.key===" "?(B.preventDefault(),f()):B.key==="Enter"&&(B.preventDefault(),c())},s[5]=f,s[6]=c,s[7]=R):R=s[7];const b=R;let M;s[8]!==f?(M=B=>{B.preventDefault(),B.stopPropagation(),f()},s[8]=f,s[9]=M):M=s[9];const j=M;let D;s[10]!==r?(D=B=>{B.preventDefault(),B.stopPropagation(),r()},s[10]=r,s[11]=D):D=s[11];const $=D,X=m==="+"?"contextTooltips.git.stageFile":"contextTooltips.git.unstageFile";let L;s[12]!==O||s[13]!==X?(L=O(X),s[12]=O,s[13]=X,s[14]=L):L=s[14];let W;s[15]!==h||s[16]!==m||s[17]!==j||s[18]!==L?(W=t.jsx("button",{type:"button",onClick:j,className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":h,"data-row-tooltip":L,children:m}),s[15]=h,s[16]=m,s[17]=j,s[18]=L,s[19]=W):W=s[19];const G=W;let J;s[20]!==A||s[21]!==K||s[22]!==z?(J=t.jsx(ys,{insertions:K,deletions:A,hideZero:z}),s[20]=A,s[21]=K,s[22]=z,s[23]=J):J=s[23];const P=J;let F;s[24]!==i.path||s[25]!==$||s[26]!==z||s[27]!==p||s[28]!==x||s[29]!==O?(F=x?t.jsxs(at,{children:[t.jsx(ot,{asChild:!0,children:t.jsx("button",{type:"button",onClick:$,disabled:p,className:de(z?"sr-only":"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"),"aria-label":O("gitView.changes.revertFileAria",{path:i.path}),children:p?t.jsx(_,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx(_,{name:"arrow-go-back",className:"size-3.5"})})}),t.jsx(lt,{sideOffset:8,children:O("gitView.changes.revertFileTooltip")})]}):null,s[24]=i.path,s[25]=$,s[26]=z,s[27]=p,s[28]=x,s[29]=O,s[30]=F):F=s[30];const Y=F,te=C??"px-3",se=z?"min-h-11 select-none rounded-md active:bg-interactive-hover":"py-1.5";let Z;s[31]!==te||s[32]!==se?(Z=de("group flex items-center gap-2 cursor-pointer",te,se),s[31]=te,s[32]=se,s[33]=Z):Z=s[33];let a;s[34]!==z||s[35]!==p||s[36]!==r||s[37]!==x?(a=z&&x&&!p?Dt(r):null,s[34]=z,s[35]=p,s[36]=r,s[37]=x,s[38]=a):a=s[38];let u;s[39]!==V?(u=V>0?{paddingInlineStart:`${V}px`}:void 0,s[39]=V,s[40]=u):u=s[40];const g=v?G:null;let n;s[41]!==I.color?(n={color:I.color},s[41]=I.color,s[42]=n):n=s[42];let E;s[43]!==I.code||s[44]!==U||s[45]!==n?(E=t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:n,title:U,"aria-label":U,children:I.code}),s[43]=I.code,s[44]=U,s[45]=n,s[46]=E):E=s[46];let N;s[47]!==i.path?(N=t.jsx(Pt,{filePath:i.path,className:"h-3.5 w-3.5 shrink-0"}),s[47]=i.path,s[48]=N):N=s[48];let ee;e:{if(i.path.lastIndexOf("/")===-1||o){let ce;s[49]===Symbol.for("react.memo_cache_sentinel")?(ce={direction:"rtl",unicodeBidi:"plaintext"},s[49]=ce):ce=s[49];const me=i.path;let re;s[50]!==i.path?(re=ls(i.path),s[50]=i.path,s[51]=re):re=s[51];let ue;s[52]!==i.path||s[53]!==re?(ue=t.jsx("span",{className:"oc-ui-start-align flex-1 min-w-0 truncate typography-ui-label text-foreground",style:ce,title:me,children:re}),s[52]=i.path,s[53]=re,s[54]=ue):ue=s[54],ee=ue;break e}let oe;s[55]!==i.path||s[56]!==z?(oe=t.jsx(us,{path:i.path,nameFirst:z,className:"flex-1 typography-ui-label"}),s[55]=i.path,s[56]=z,s[57]=oe):oe=s[57],ee=oe}let q;s[58]!==v||s[59]!==G||s[60]!==p||s[61]!==Y||s[62]!==P?(q=v?t.jsxs(t.Fragment,{children:[P,Y]}):t.jsxs("span",{className:"flex shrink-0 items-center justify-items-end gap-2 md:grid",children:[t.jsx("span",{className:de("md:col-start-1 md:row-start-1",p?"md:invisible":"md:group-hover:invisible md:group-focus-within:invisible"),children:P}),t.jsxs("span",{className:de("flex items-center gap-2 md:col-start-1 md:row-start-1",!p&&"md:invisible md:group-hover:visible md:group-focus-within:visible"),children:[Y,G]})]}),s[58]=v,s[59]=G,s[60]=p,s[61]=Y,s[62]=P,s[63]=q):q=s[63];let ae;return s[64]!==b||s[65]!==c||s[66]!==Z||s[67]!==a||s[68]!==u||s[69]!==g||s[70]!==E||s[71]!==N||s[72]!==ee||s[73]!==q?(ae=t.jsxs("div",{className:Z,role:"button",tabIndex:0,onClick:c,onKeyDown:b,...a,style:u,children:[g,E,N,ee,q]}),s[64]=b,s[65]=c,s[66]=Z,s[67]=a,s[68]=u,s[69]=g,s[70]=E,s[71]=N,s[72]=ee,s[73]=q,s[74]=ae):ae=s[74],ae}),ws=1e3,xt=34,Ze=30,Ge="ps-0 pe-2",Qe=(l,e)=>`${l} ${e}`,Ws=({groups:l,diffStats:e,revertingPaths:s,isRevertingAll:i=!1,headerBackgroundClassName:h="bg-sidebar",onVisiblePathsChange:m,onRevertAll:f,onRevertDirectory:c})=>{const{t:r}=ye(),{isMobile:p}=nt(),k=w.useRef(null),d=qe(a=>a.gitChangesViewMode)==="tree",y=w.useMemo(()=>l.filter(a=>a.entries.length>0),[l]),[S,H]=w.useState(new Set),[V,v]=w.useState(new Set),[o,x]=w.useState(!1),[T,I]=w.useState(null),O=Mt(),{confirm:z}=O,Q=w.useCallback(async(a,u)=>{await z({title:r("gitView.changes.revertFileDialogTitle"),message:r("gitView.changes.revertFileDescription",{path:u}),action:r("gitView.changes.revertFileConfirm"),destructive:!0})&&a.onRevertFile(u)},[z,r]),U=w.useMemo(()=>y.map(a=>rs(a.entries)),[y]),K=w.useMemo(()=>{const a=[];return y.forEach((u,g)=>{Array.from(U[g]?.children.values()??[]).forEach(n=>{a.push(Qe(u.id,cs(n).node.path))})}),a},[U,y]);w.useEffect(()=>{d&&v(a=>{const u=new Set,g=new Set(K);return a.forEach(n=>{(n.slice(n.indexOf(" ")+1).includes("/")||g.has(n))&&u.add(n)}),K.forEach(n=>u.add(n)),u})},[d,K]);const A=w.useMemo(()=>{const a=[];return y.forEach((u,g)=>{if(a.push({type:"header",key:`header:${u.id}`,groupIndex:g}),!S.has(u.id)){if(d){const n=new Set;V.forEach(N=>{N.startsWith(`${u.id} `)&&n.add(N.slice(u.id.length+1))}),ds(U[g],n).forEach(N=>{N.kind==="file"?a.push({type:"file",key:`${u.id}:${N.key}`,groupIndex:g,file:N.file,depth:N.depth}):a.push({type:"directory",key:`${u.id}:${N.key}`,groupIndex:g,directory:N.directory,label:N.label,depth:N.depth})});return}u.entries.forEach(n=>{a.push({type:"file",key:`${u.id}:file:${n.path}`,groupIndex:g,file:n,depth:0})})}}),f&&y.length>0&&a.push({type:"revert-all",key:"revert-all"}),a},[S,V,d,f,U,y]),R=A.length,b=R>=ws,M=Rt({count:R,enabled:b,getScrollElement:()=>k.current,estimateSize:()=>xt,overscan:12,getItemKey:a=>A[a]?.key??a}),j=M.getVirtualItems(),D=w.useMemo(()=>{if(!b)return 0;const a=k.current?.scrollTop??0;return j.find(g=>g.end>a)?.index??0},[b,j,k]);w.useEffect(()=>{if(!m)return;const a=u=>u&&u.type==="file"?u.file.path:null;if(R===0){m([]);return}if(!b){const u=[];for(const g of A)if(g.type==="file"&&(u.push(g.file.path),u.length>=Ze))break;m(u);return}m(A.slice(D,D+Math.ceil((k.current?.clientHeight??0)/xt)+Ze).map(u=>a(u)).filter(u=>!!u).slice(0,Ze))},[m,R,A,b,D]);const $=w.useCallback(a=>{H(u=>{const g=new Set(u);return g.has(a)?g.delete(a):g.add(a),g})},[]),X=w.useCallback((a,u)=>{v(g=>{const n=new Set(g),E=Qe(a,u);return n.has(E)?n.delete(E):n.add(E),n})},[]),L=w.useMemo(()=>{const a=new Set;return y.forEach(u=>u.entries.forEach(g=>a.add(g.path))),Array.from(a)},[y]),W=L.length,G=T?i||T.paths.some(a=>s.has(a)):!1,J=w.useCallback(async()=>{!f||i||L.length===0||(await f(L),x(!1))},[L,i,f]),P=w.useCallback(async()=>{!c||!T||G||(await c(T.paths),I(null))},[G,c,T]),F=w.useCallback((a,u)=>{const g=S.has(a.id),n=a.entries.length;return t.jsxs("div",{className:de("sticky top-0 z-10 flex items-center gap-2 py-2",h,Ge,!u&&"mt-1 border-t border-edge-muted"),children:[t.jsx(we,{sideOffset:8,label:a.actionAllLabel,className:"shrink-0",children:t.jsx("button",{type:"button",onClick:()=>a.onActionAll(a.entries.map(E=>E.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":a.actionAllLabel,children:a.actionSymbol})}),t.jsxs("button",{type:"button",onClick:()=>$(a.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-expanded":!g,children:[t.jsx("h3",{className:"truncate typography-ui-header font-semibold text-foreground",children:a.title}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:n}),t.jsx(_,{name:"arrow-down-s",className:de("size-3.5 shrink-0 text-muted-foreground transition-transform",g&&"-rotate-90 rtl:rotate-90")})]})]})},[S,h,$]),Y=w.useCallback((a,u,g,n)=>{const E=V.has(Qe(a.id,u.path)),N=u.files.map(q=>q.path),ee=i||N.some(q=>s.has(q));return t.jsxs("div",{className:de("group flex items-center gap-2 text-muted-foreground hover:text-foreground",p?"min-h-11 select-none":"py-1.5",Ge),style:{paddingInlineStart:`${n*Ye}px`},...p&&a.showRevertActions!==!1&&c&&!ee?Dt(()=>I({path:u.path,paths:N,count:N.length})):null,children:[t.jsxs("button",{type:"button",onClick:()=>X(a.id,u.path),"aria-expanded":E,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":E?r("gitView.changes.collapseDirectoryAria",{path:u.path}):r("gitView.changes.expandDirectoryAria",{path:u.path}),children:[t.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center",children:t.jsx(_,{name:"arrow-right-s",className:de("size-3.5 transition-transform",E&&"rotate-90 rtl:-rotate-90")})}),t.jsx("span",{className:"min-w-0 truncate typography-ui-label",title:u.path,children:g}),E?null:t.jsx("span",{className:"shrink-0 typography-micro tabular-nums text-muted-foreground",children:u.files.length})]}),t.jsxs("span",{className:de("flex shrink-0 items-center gap-2 transition-opacity",!ee&&"md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),children:[a.showRevertActions!==!1&&c?t.jsx("button",{type:"button",onClick:()=>I({path:u.path,paths:N,count:N.length}),disabled:ee,className:p?"sr-only":"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50","aria-label":r("gitView.changes.revertDirectoryAria",{path:u.path}),"data-row-tooltip":r("gitView.changes.revertDirectoryTooltip"),children:ee?t.jsx(_,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx(_,{name:"arrow-go-back",className:"size-3.5"})}):null,t.jsx("button",{type:"button",onClick:()=>a.onActionAll(u.files.map(q=>q.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":r(a.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:u.path}),"data-row-tooltip":r(a.actionSymbol==="+"?"contextTooltips.git.stageFolder":"contextTooltips.git.unstageFolder"),children:a.actionSymbol})]})]})},[V,p,i,c,s,r,X]),te=w.useCallback((a,u)=>{if(a.type==="revert-all")return t.jsx("div",{className:de("flex justify-end py-2",Ge),children:t.jsx(we,{sideOffset:8,label:r("contextTooltips.git.discardAll"),children:t.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>x(!0),disabled:i,className:"gap-1.5 text-[var(--status-error)] hover:bg-[var(--status-error)]/10 hover:text-[var(--status-error)]",children:[t.jsx(_,{name:"arrow-go-back",className:"size-3.5"}),r("gitView.changes.revertAll")]})})});const g=y[a.groupIndex];if(!g)return null;if(a.type==="header")return F(g,u);if(a.type==="directory")return Y(g,a.directory,a.label,a.depth);const n=a.file;return t.jsx(bs,{file:n,actionLabel:g.getActionLabel(n.path),actionSymbol:g.actionSymbol,onAction:()=>g.onActionFile(n.path),stats:e?.[g.statsScope]?.[n.path],onViewDiff:()=>g.onViewDiff(n.path),onRevert:()=>{Q(g,n.path)},isReverting:s.has(n.path)||i,rowPaddingClassName:Ge,indentPx:a.depth*Ye,actionAtStart:!d,nameOnly:d,showRevert:g.showRevertActions!==!1})},[e,i,d,Y,F,Q,s,r,y]),se=a=>a.type!=="file"&&a.type!=="directory"?null:Array.from({length:a.depth},(u,g)=>t.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 w-px bg-edge",style:{insetInlineStart:`${g*Ye+8}px`}},g)),Z=w.useCallback(a=>{if(d||p)return!1;const u=A[a],g=A[a-1];return!u||!g||u.type!=="file"&&u.type!=="directory"||g.type!=="file"&&g.type!=="directory"?!1:g.groupIndex===u.groupIndex},[p,d,A]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[t.jsx(Lt,{ref:k,className:"overlay-scrollbar-target overlay-scrollbar-container min-h-0 w-full flex-1 overflow-x-hidden overflow-y-auto",children:b?t.jsx("div",{style:{height:M.getTotalSize(),position:"relative"},children:j.map(a=>{const u=A[a.index];return u?t.jsxs("div",{"data-index":a.index,ref:M.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${a.start}px)`},className:de(Z(a.index)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(u),te(u,a.index===0)]},u.key):null})}):t.jsx("div",{role:"list","aria-label":r("gitView.changes.changedFilesAria"),children:A.map((a,u)=>t.jsxs("div",{className:de("relative",Z(u)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(a),te(a,u===0)]},a.key))})}),t.jsx(Ht,{containerRef:k,disableHorizontal:!0}),t.jsx($t,{containerRef:k,sideOffset:8})]}),O.dialog,t.jsx(Fe,{open:o,onOpenChange:a=>{!i&&!a&&x(!1)},children:t.jsxs(Pe,{className:"max-w-md",children:[t.jsxs(Me,{children:[t.jsx(Le,{children:r("gitView.changes.revertAllDialogTitle")}),t.jsx(He,{children:W===1?r("gitView.changes.revertAllDescriptionSingle",{count:W}):r("gitView.changes.revertAllDescriptionPlural",{count:W})})]}),t.jsxs(it,{children:[t.jsx(ne,{variant:"outline",size:"sm",onClick:()=>x(!1),disabled:i,children:r("gitView.common.cancel")}),t.jsx(ne,{variant:"destructive",size:"sm",onClick:()=>{J()},disabled:i,children:r(i?"gitView.changes.reverting":"gitView.changes.revertAll")})]})]})}),t.jsx(Fe,{open:!!T,onOpenChange:a=>{!G&&!a&&I(null)},children:t.jsxs(Pe,{className:"max-w-md",children:[t.jsxs(Me,{children:[t.jsx(Le,{children:r("gitView.changes.revertDirectoryDialogTitle")}),t.jsx(He,{children:T?T.count===1?r("gitView.changes.revertDirectoryDescriptionSingle",{count:T.count,path:T.path}):r("gitView.changes.revertDirectoryDescriptionPlural",{count:T.count,path:T.path}):null})]}),t.jsxs(it,{children:[t.jsx(ne,{variant:"outline",size:"sm",onClick:()=>I(null),disabled:G,children:r("gitView.common.cancel")}),t.jsx(ne,{variant:"destructive",size:"sm",onClick:()=>{P()},disabled:G||!T,children:r(G?"gitView.changes.reverting":"gitView.changes.revertDirectory")})]})]})})]})},et=38,_e=200,vs=l=>{const e=be.c(26),{value:s,onChange:i,onSubmit:h,placeholder:m,disabled:f,hasTouchInput:c,isMobile:r}=l,p=f===void 0?!1:f,k=c===void 0?!1:c,C=r===void 0?!1:r,{t:d}=ye(),y=w.useRef(null),S=Gt(y),H=qe(js);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{const b=y.current;if(!b)return;const M=document.activeElement===b,j=()=>{b.style.height=`${et}px`;const $=b.scrollHeight,X=Math.min(Math.max($,et),_e);b.style.height=`${X}px`,b.style.overflowY=$>_e?"auto":"hidden",$>_e&&!M&&(b.scrollTop=b.scrollHeight)};j();const D=window.requestAnimationFrame(j);return()=>{window.cancelAnimationFrame(D)}},e[0]=V):V=e[0];let v;e[1]!==s?(v=[s],e[1]=s,e[2]=v):v=e[2],w.useLayoutEffect(V,v);let o;e[3]!==i?(o=b=>i(b.target.value),e[3]=i,e[4]=o):o=e[4];let x;e[5]!==h?(x=b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&!b.shiftKey&&!b.altKey&&(b.preventDefault(),h?.())},e[5]=h,e[6]=x):x=e[6];let T;e[7]!==m||e[8]!==d?(T=m??d("gitView.commit.messagePlaceholder"),e[7]=m,e[8]=d,e[9]=T):T=e[9];const I=k?"on":"off",O=k?"sentences":"off",z=C||H,Q=p&&"opacity-50";let U;e[10]!==Q?(U=de("oc-raised oc-field w-full rounded-lg bg-surface-elevated px-3 py-2 typography-ui-label text-foreground placeholder:text-muted-foreground","resize-none outline-none",Q),e[10]=Q,e[11]=U):U=e[11];let K;e[12]===Symbol.for("react.memo_cache_sentinel")?(K={minHeight:et,maxHeight:_e},e[12]=K):K=e[12];let A;e[13]!==p||e[14]!==O||e[15]!==z||e[16]!==U||e[17]!==o||e[18]!==x||e[19]!==T||e[20]!==I||e[21]!==s?(A=t.jsx("textarea",{ref:y,value:s,onChange:o,onKeyDown:x,placeholder:T,rows:1,disabled:p,autoCorrect:I,autoCapitalize:O,spellCheck:z,className:U,style:K}),e[13]=p,e[14]=O,e[15]=z,e[16]=U,e[17]=o,e[18]=x,e[19]=T,e[20]=I,e[21]=s,e[22]=A):A=e[22];let R;return e[23]!==S||e[24]!==A?(R=t.jsxs(t.Fragment,{children:[A,S]}),e[23]=S,e[24]=A,e[25]=R):R=e[25],R};function js(l){return l.inputSpellcheckEnabled}const Ns=l=>{const e=be.c(30),{highlights:s,onInsert:i}=l,{t:h}=ye();if(s.length===0)return null;let m;e[0]!==s||e[1]!==i?(m=()=>{i(s)},e[0]=s,e[1]=i,e[2]=m):m=e[2];const f=m;let c;e[3]!==h?(c=h("gitView.commit.aiHighlights.title"),e[3]=h,e[4]=c):c=e[4];let r;e[5]!==c?(r=t.jsx("p",{className:"typography-micro text-muted-foreground",children:c}),e[5]=c,e[6]=r):r=e[6];let p;e[7]!==h?(p=h("gitView.commit.aiHighlights.insertAria"),e[7]=h,e[8]=p):p=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(_,{name:"arrow-down",className:"size-4"}),e[9]=k):k=e[9];let C;e[10]!==f||e[11]!==p?(C=t.jsx(ot,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"size-6",onClick:f,"aria-label":p,children:k})}),e[10]=f,e[11]=p,e[12]=C):C=e[12];let d;e[13]!==h?(d=h("gitView.commit.aiHighlights.insertTooltip"),e[13]=h,e[14]=d):d=e[14];let y;e[15]!==d?(y=t.jsx(lt,{sideOffset:8,children:d}),e[15]=d,e[16]=y):y=e[16];let S;e[17]!==C||e[18]!==y?(S=t.jsxs(at,{children:[C,y]}),e[17]=C,e[18]=y,e[19]=S):S=e[19];let H;e[20]!==r||e[21]!==S?(H=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r,S]}),e[20]=r,e[21]=S,e[22]=H):H=e[22];let V;e[23]!==s?(V=s.map(Cs),e[23]=s,e[24]=V):V=e[24];let v;e[25]!==V?(v=t.jsx("ul",{className:"space-y-1",children:V}),e[25]=V,e[26]=v):v=e[26];let o;return e[27]!==H||e[28]!==v?(o=t.jsxs("div",{className:"space-y-2 rounded-xl oc-tile px-3 py-2",children:[H,v]}),e[27]=H,e[28]=v,e[29]=o):o=e[29],o};function Cs(l,e){return t.jsx("li",{className:"typography-meta text-foreground",children:l},`${l}-${e}`)}const Js=l=>{const e=be.c(113),{stagedCount:s,commitMessage:i,onCommitMessageChange:h,generatedHighlights:m,onInsertHighlights:f,onGenerateMessage:c,isGeneratingMessage:r,onCommit:p,onCommitAndPush:k,commitAction:C,networkOperationBlocked:d,hasPendingIndexMutation:y,gitmojiEnabled:S,onOpenGitmojiPicker:H}=l,V=d===void 0?!1:d,v=y===void 0?!1:y,{t:o}=ye(),x=s>0;let T;e[0]!==C||e[1]!==i||e[2]!==v||e[3]!==x?(T=i.trim()&&x&&C===null&&!v,e[0]=C,e[1]=i,e[2]=v,e[3]=x,e[4]=T):T=e[4];const I=T,{isMobile:O,hasTouchInput:z}=nt(),[Q,U]=w.useState(!1);let K;e[5]!==i||e[6]!==x||e[7]!==o?(K=x?i.trim()?null:o("contextTooltips.git.writeMessageFirst"):o("contextTooltips.git.stageFilesFirst"),e[5]=i,e[6]=x,e[7]=o,e[8]=K):K=e[8];const A=K;if(O&&!Q&&!x&&!i.trim()&&m.length===0){let le;e[9]!==o?(le=o("gitView.commit.title"),e[9]=o,e[10]=le):le=e[10];let fe;e[11]!==le?(fe=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:le}),e[11]=le,e[12]=fe):fe=e[12];let he;e[13]!==o?(he=o("gitView.commit.stageFilesHint"),e[13]=o,e[14]=he):he=e[14];let pe;e[15]!==he?(pe=t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:he}),e[15]=he,e[16]=pe):pe=e[16];let ve;return e[17]!==fe||e[18]!==pe?(ve=t.jsxs("section",{className:"flex items-baseline gap-2",children:[fe,pe]}),e[17]=fe,e[18]=pe,e[19]=ve):ve=e[19],ve}let R,b;e[20]===Symbol.for("react.memo_cache_sentinel")?(R=()=>U(!0),b=le=>{le.currentTarget.contains(le.relatedTarget)||U(!1)},e[20]=R,e[21]=b):(R=e[20],b=e[21]);let M;e[22]!==o?(M=o("gitView.commit.title"),e[22]=o,e[23]=M):M=e[23];let j;e[24]!==M?(j=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:M}),e[24]=M,e[25]=j):j=e[25];let D;e[26]!==x||e[27]!==o?(D=x?null:t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:o("gitView.commit.stageFilesHint")}),e[26]=x,e[27]=o,e[28]=D):D=e[28];let $;e[29]!==j||e[30]!==D?($=t.jsxs("div",{className:"flex w-full items-baseline gap-2 px-0 pt-2 pb-1",children:[j,D]}),e[29]=j,e[30]=D,e[31]=$):$=e[31];let X;e[32]!==m||e[33]!==f?(X=t.jsx(Ns,{highlights:m,onInsert:f}),e[32]=m,e[33]=f,e[34]=X):X=e[34];let L;e[35]!==I||e[36]!==r||e[37]!==p?(L=()=>{I&&!r&&p()},e[35]=I,e[36]=r,e[37]=p,e[38]=L):L=e[38];let W;e[39]!==o?(W=o("gitView.commit.messagePlaceholder"),e[39]=o,e[40]=W):W=e[40];const G=C!==null;let J;e[41]!==i||e[42]!==z||e[43]!==O||e[44]!==h||e[45]!==L||e[46]!==W||e[47]!==G?(J=t.jsx(vs,{value:i,onChange:h,onSubmit:L,placeholder:W,disabled:G,hasTouchInput:z,isMobile:O}),e[41]=i,e[42]=z,e[43]=O,e[44]=h,e[45]=L,e[46]=W,e[47]=G,e[48]=J):J=e[48];let P;e[49]!==S||e[50]!==H||e[51]!==o?(P=S&&t.jsx(we,{sideOffset:8,label:o("contextTooltips.git.addGitmoji"),className:"w-fit",children:t.jsxs(ne,{variant:"outline",size:"sm",onClick:H,className:"w-fit",type:"button",children:[t.jsx(_,{name:"emotion-happy",className:"size-4"}),o("gitView.commit.addGitmoji")]})}),e[49]=S,e[50]=H,e[51]=o,e[52]=P):P=e[52];let F;e[53]!==x||e[54]!==o?(F=o(x?"gitView.commit.generateAria":"contextTooltips.git.stageFilesFirst"),e[53]=x,e[54]=o,e[55]=F):F=e[55];const Y=r||C!==null||v||s===0;let te;e[56]!==o?(te=o("gitView.commit.generateAria"),e[56]=o,e[57]=te):te=e[57];let se;e[58]!==r?(se=r?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"ai-generate-2",className:"size-4 text-primary"}),e[58]=r,e[59]=se):se=e[59];let Z;e[60]!==o?(Z=o("gitView.commit.generate"),e[60]=o,e[61]=Z):Z=e[61];let a;e[62]!==Z?(a=t.jsx("span",{className:"commit-actions__label",children:Z}),e[62]=Z,e[63]=a):a=e[63];let u;e[64]!==c||e[65]!==Y||e[66]!==te||e[67]!==se||e[68]!==a?(u=t.jsxs(ne,{variant:"outline",size:"sm",onClick:c,disabled:Y,type:"button","aria-label":te,className:"commit-actions__btn",children:[se,a]}),e[64]=c,e[65]=Y,e[66]=te,e[67]=se,e[68]=a,e[69]=u):u=e[69];let g;e[70]!==F||e[71]!==u?(g=t.jsx(we,{sideOffset:8,label:F,children:u}),e[70]=F,e[71]=u,e[72]=g):g=e[72];let n;e[73]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1"}),e[73]=n):n=e[73];let E;e[74]!==A||e[75]!==o?(E=A??o("contextTooltips.git.commit"),e[74]=A,e[75]=o,e[76]=E):E=e[76];let N;e[77]!==p?(N=le=>p(le.currentTarget),e[77]=p,e[78]=N):N=e[78];const ee=!I||r;let q;e[79]!==o?(q=o("gitView.commit.commitAria"),e[79]=o,e[80]=q):q=e[80];let ae;e[81]!==C||e[82]!==o?(ae=C==="commit"?t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label",children:o("gitView.commit.committing")})]}):t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"git-commit",className:"size-4"}),t.jsx("span",{className:"commit-actions__label",children:o("gitView.commit.commit")})]}),e[81]=C,e[82]=o,e[83]=ae):ae=e[83];let B;e[84]!==N||e[85]!==ee||e[86]!==q||e[87]!==ae?(B=t.jsx(ne,{size:"sm",variant:"outline",onClick:N,disabled:ee,className:"commit-actions__btn whitespace-nowrap","aria-label":q,children:ae}),e[84]=N,e[85]=ee,e[86]=q,e[87]=ae,e[88]=B):B=e[88];let oe;e[89]!==E||e[90]!==B?(oe=t.jsx(we,{sideOffset:8,label:E,children:B}),e[89]=E,e[90]=B,e[91]=oe):oe=e[91];let ce;e[92]!==I||e[93]!==C||e[94]!==A||e[95]!==r||e[96]!==O||e[97]!==V||e[98]!==k||e[99]!==o?(ce=O?t.jsxs(at,{children:[t.jsx(ot,{asChild:!0,children:t.jsx(ne,{variant:"default",size:"sm",onClick:le=>k(le.currentTarget),disabled:!I||r||V,className:"h-7 w-7 p-0","aria-label":o("gitView.commit.pushAria"),children:C==="commitAndPush"?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"arrow-up",className:"size-3.5"})})}),t.jsx(lt,{side:"top",children:t.jsx("p",{children:o("gitView.commit.push")})})]}):t.jsx(we,{sideOffset:8,label:A??o("contextTooltips.git.commitAndSync"),children:t.jsx(ne,{size:"sm",variant:"default",onClick:le=>k(le.currentTarget),disabled:!I||r||V,className:"commit-actions__btn","aria-label":o("gitView.commit.pushAria"),children:C==="commitAndPush"?t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:o("gitView.commit.pushing")})]}):t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"arrow-up",className:"size-3.5"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:o("gitView.commit.push")})]})})}),e[92]=I,e[93]=C,e[94]=A,e[95]=r,e[96]=O,e[97]=V,e[98]=k,e[99]=o,e[100]=ce):ce=e[100];let me;e[101]!==g||e[102]!==oe||e[103]!==ce?(me=t.jsxs("div",{className:"@container/commit-actions flex items-center gap-2 min-w-0",children:[g,n,oe,ce]}),e[101]=g,e[102]=oe,e[103]=ce,e[104]=me):me=e[104];let re;e[105]!==X||e[106]!==J||e[107]!==P||e[108]!==me?(re=t.jsxs("div",{className:"flex flex-col gap-3 px-0 pt-1 pb-3",children:[X,J,P,me]}),e[105]=X,e[106]=J,e[107]=P,e[108]=me,e[109]=re):re=e[109];let ue;return e[110]!==$||e[111]!==re?(ue=t.jsxs("section",{className:"border-0 bg-transparent rounded-none",onFocus:R,onBlur:b,children:[$,re]}),e[110]=$,e[111]=re,e[112]=ue):ue=e[112],ue},Ys=l=>{const e=be.c(153),{open:s,onOpenChange:i,conflictFiles:h,directory:m,operation:f,onAbort:c,onClearState:r,onNavigatedToChat:p}=l;let k;e[0]!==h?(k=h===void 0?[]:h,e[0]=h,e[1]=k):k=e[1];const C=k,{t:d}=ye(),y=rt(Ss),S=rt(ks),H=ct(Vs),V=ct(As),[v,o]=w.useState(!1),[x,T]=w.useState(null),[I,O]=w.useState(null);let z,Q;e[2]!==m||e[3]!==s||e[4]!==d?(z=()=>{!s||!m||(o(!0),O(null),T(null),_t(m).then(ie=>{T(ie)}).catch(ie=>{const ge=ie instanceof Error?ie.message:d("gitView.conflict.loadFailed");O(ge)}).finally(()=>{o(!1)}))},Q=[s,m,d],e[2]=m,e[3]=s,e[4]=d,e[5]=z,e[6]=Q):(z=e[5],Q=e[6]),w.useEffect(z,Q);let U;e[7]!==x||e[8]!==m||e[9]!==f?(U=async()=>{if(!x)return null;const ie=f==="merge"?"merge":"rebase",ge=x.headInfo||(f==="merge"?"MERGE_HEAD":"REBASE_HEAD"),ke=f==="merge"?"git commit --no-edit":"git rebase --continue",Ve=await Bt(m),je=Ve.render("git.conflict.resolve.visible",{operation_label:ie,head_ref:ge}),Ne=Ve.render("git.conflict.resolve.instructions",{operation_label:ie,directory:m,operation:f,head_info:x.headInfo||"N/A",continue_cmd:ke}),Ce=`${ie} conflict context (JSON)
|
|
1
|
+
import{R as w,f as be,j as t}from"./vendor-react--VO_rL_p.js";import{u as Rt}from"./vendor-tanstack-react-virtual-CqfECoM0.js";import{h9 as Ot,gM as Ft,u as ye,aP as nt,ac as at,ad as ot,I as _,Q as de,ae as lt,fq as Pt,K as Mt,ha as we,B as ne,hb as Lt,b4 as Ht,hc as $t,t as Fe,q as Pe,D as Me,l as Le,F as He,o as it,hd as Gt,a0 as rt,he as ct,n as dt,hf as _t,aW as Bt,A as xe,C as Kt,bR as bt,bS as wt,hg as Re,hh as vt,cd as Be,hi as jt,hj as Nt,hk as qt,hl as Ct,hm as Ke,hn as St,ho as kt,hp as Ut,hq as Xt,hr as Vt,hs as Wt,ht as Jt,hu as Yt,hv as At,hw as Tt,eI as Je,bt as ut,bu as mt,bv as ft,bw as ht,bx as pt,hx as Zt,hy as Qt,hz as es,hA as ts,hB as ss,cc as $e,hC as It,hD as is,x as gt,hE as ns,hF as as}from"./useAppFontEffects-3RimJo4B.js";import{u as qe,c4 as Et,c5 as os,aX as Ue}from"./katex.min-Bs5OLoA1.js";import{a as ls,b as rs,c as cs,f as ds,T as Ye}from"./useBranchPullRequestRequest-CMvepZei.js";import{C as us}from"./ChangedPathLabel-CCsE-8p4.js";import{P as ms,L as fs,O as hs,ar as ps}from"./runtimeEndpointReset-DiTyBUwe.js";const gs=500,xs=10;let Se=null;const Oe=()=>{Se&&window.clearTimeout(Se.timer),Se=null},Dt=l=>({onPointerDown:e=>{if(Oe(),e.pointerType==="mouse"||e.target instanceof Element&&e.target.closest("button, a, input"))return;Se={timer:window.setTimeout(()=>{Se=null,Ot(),l()},gs),x:e.clientX,y:e.clientY}},onPointerMove:e=>{Se&&Math.hypot(e.clientX-Se.x,e.clientY-Se.y)>xs&&Oe()},onPointerUp:Oe,onPointerCancel:Oe,onPointerLeave:Oe,onContextMenu:e=>e.preventDefault()}),ys=l=>{const e=be.c(14),{insertions:s,deletions:i,hideZero:h}=l,m=h===void 0?!1:h;let f;e[0]!==m||e[1]!==s?(f=m&&s===0?null:t.jsxs("span",{style:{color:"var(--status-success)"},children:["+",s]}),e[0]=m,e[1]=s,e[2]=f):f=e[2];let c;e[3]!==i||e[4]!==m||e[5]!==s?(c=m?s>0&&i>0?" ":null:t.jsx("span",{className:"text-muted-foreground mx-0.5",children:"/"}),e[3]=i,e[4]=m,e[5]=s,e[6]=c):c=e[6];let r;e[7]!==i||e[8]!==m?(r=m&&i===0?null:t.jsxs("span",{style:{color:"var(--status-error)"},children:["-",i]}),e[7]=i,e[8]=m,e[9]=r):r=e[9];let p;return e[10]!==f||e[11]!==c||e[12]!==r?(p=t.jsxs("span",{className:"shrink-0 typography-micro tabular-nums",children:[f,c,r]}),e[10]=f,e[11]=c,e[12]=r,e[13]=p):p=e[13],p},bs=w.memo(function(e){const s=be.c(75),{file:i,actionLabel:h,actionSymbol:m,onAction:f,onViewDiff:c,onRevert:r,isReverting:p,stats:k,rowPaddingClassName:C,indentPx:d,actionAtStart:y,nameOnly:S,showRevert:H}=e,V=d===void 0?0:d,v=y===void 0?!1:y,o=S===void 0?!1:S,x=H===void 0?!0:H;let T;s[0]!==i?(T=Ft(i),s[0]=i,s[1]=T):T=s[1];const I=T,{t:O}=ye(),{isMobile:z}=nt();let Q;s[2]!==I.descriptionKey||s[3]!==O?(Q=O(I.descriptionKey),s[2]=I.descriptionKey,s[3]=O,s[4]=Q):Q=s[4];const U=Q,K=k?.insertions??0,A=k?.deletions??0;let R;s[5]!==f||s[6]!==c?(R=B=>{B.key===" "?(B.preventDefault(),f()):B.key==="Enter"&&(B.preventDefault(),c())},s[5]=f,s[6]=c,s[7]=R):R=s[7];const b=R;let M;s[8]!==f?(M=B=>{B.preventDefault(),B.stopPropagation(),f()},s[8]=f,s[9]=M):M=s[9];const j=M;let D;s[10]!==r?(D=B=>{B.preventDefault(),B.stopPropagation(),r()},s[10]=r,s[11]=D):D=s[11];const $=D,X=m==="+"?"contextTooltips.git.stageFile":"contextTooltips.git.unstageFile";let L;s[12]!==O||s[13]!==X?(L=O(X),s[12]=O,s[13]=X,s[14]=L):L=s[14];let W;s[15]!==h||s[16]!==m||s[17]!==j||s[18]!==L?(W=t.jsx("button",{type:"button",onClick:j,className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":h,"data-row-tooltip":L,children:m}),s[15]=h,s[16]=m,s[17]=j,s[18]=L,s[19]=W):W=s[19];const G=W;let J;s[20]!==A||s[21]!==K||s[22]!==z?(J=t.jsx(ys,{insertions:K,deletions:A,hideZero:z}),s[20]=A,s[21]=K,s[22]=z,s[23]=J):J=s[23];const P=J;let F;s[24]!==i.path||s[25]!==$||s[26]!==z||s[27]!==p||s[28]!==x||s[29]!==O?(F=x?t.jsxs(at,{children:[t.jsx(ot,{asChild:!0,children:t.jsx("button",{type:"button",onClick:$,disabled:p,className:de(z?"sr-only":"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"),"aria-label":O("gitView.changes.revertFileAria",{path:i.path}),children:p?t.jsx(_,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx(_,{name:"arrow-go-back",className:"size-3.5"})})}),t.jsx(lt,{sideOffset:8,children:O("gitView.changes.revertFileTooltip")})]}):null,s[24]=i.path,s[25]=$,s[26]=z,s[27]=p,s[28]=x,s[29]=O,s[30]=F):F=s[30];const Y=F,te=C??"px-3",se=z?"min-h-11 select-none rounded-md active:bg-interactive-hover":"py-1.5";let Z;s[31]!==te||s[32]!==se?(Z=de("group flex items-center gap-2 cursor-pointer",te,se),s[31]=te,s[32]=se,s[33]=Z):Z=s[33];let a;s[34]!==z||s[35]!==p||s[36]!==r||s[37]!==x?(a=z&&x&&!p?Dt(r):null,s[34]=z,s[35]=p,s[36]=r,s[37]=x,s[38]=a):a=s[38];let u;s[39]!==V?(u=V>0?{paddingInlineStart:`${V}px`}:void 0,s[39]=V,s[40]=u):u=s[40];const g=v?G:null;let n;s[41]!==I.color?(n={color:I.color},s[41]=I.color,s[42]=n):n=s[42];let E;s[43]!==I.code||s[44]!==U||s[45]!==n?(E=t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:n,title:U,"aria-label":U,children:I.code}),s[43]=I.code,s[44]=U,s[45]=n,s[46]=E):E=s[46];let N;s[47]!==i.path?(N=t.jsx(Pt,{filePath:i.path,className:"h-3.5 w-3.5 shrink-0"}),s[47]=i.path,s[48]=N):N=s[48];let ee;e:{if(i.path.lastIndexOf("/")===-1||o){let ce;s[49]===Symbol.for("react.memo_cache_sentinel")?(ce={direction:"rtl",unicodeBidi:"plaintext"},s[49]=ce):ce=s[49];const me=i.path;let re;s[50]!==i.path?(re=ls(i.path),s[50]=i.path,s[51]=re):re=s[51];let ue;s[52]!==i.path||s[53]!==re?(ue=t.jsx("span",{className:"oc-ui-start-align flex-1 min-w-0 truncate typography-ui-label text-foreground",style:ce,title:me,children:re}),s[52]=i.path,s[53]=re,s[54]=ue):ue=s[54],ee=ue;break e}let oe;s[55]!==i.path||s[56]!==z?(oe=t.jsx(us,{path:i.path,nameFirst:z,className:"flex-1 typography-ui-label"}),s[55]=i.path,s[56]=z,s[57]=oe):oe=s[57],ee=oe}let q;s[58]!==v||s[59]!==G||s[60]!==p||s[61]!==Y||s[62]!==P?(q=v?t.jsxs(t.Fragment,{children:[P,Y]}):t.jsxs("span",{className:"flex shrink-0 items-center justify-items-end gap-2 md:grid",children:[t.jsx("span",{className:de("md:col-start-1 md:row-start-1",p?"md:invisible":"md:group-hover:invisible md:group-focus-within:invisible"),children:P}),t.jsxs("span",{className:de("flex items-center gap-2 md:col-start-1 md:row-start-1",!p&&"md:invisible md:group-hover:visible md:group-focus-within:visible"),children:[Y,G]})]}),s[58]=v,s[59]=G,s[60]=p,s[61]=Y,s[62]=P,s[63]=q):q=s[63];let ae;return s[64]!==b||s[65]!==c||s[66]!==Z||s[67]!==a||s[68]!==u||s[69]!==g||s[70]!==E||s[71]!==N||s[72]!==ee||s[73]!==q?(ae=t.jsxs("div",{className:Z,role:"button",tabIndex:0,onClick:c,onKeyDown:b,...a,style:u,children:[g,E,N,ee,q]}),s[64]=b,s[65]=c,s[66]=Z,s[67]=a,s[68]=u,s[69]=g,s[70]=E,s[71]=N,s[72]=ee,s[73]=q,s[74]=ae):ae=s[74],ae}),ws=1e3,xt=34,Ze=30,Ge="ps-0 pe-2",Qe=(l,e)=>`${l} ${e}`,Ws=({groups:l,diffStats:e,revertingPaths:s,isRevertingAll:i=!1,headerBackgroundClassName:h="bg-sidebar",onVisiblePathsChange:m,onRevertAll:f,onRevertDirectory:c})=>{const{t:r}=ye(),{isMobile:p}=nt(),k=w.useRef(null),d=qe(a=>a.gitChangesViewMode)==="tree",y=w.useMemo(()=>l.filter(a=>a.entries.length>0),[l]),[S,H]=w.useState(new Set),[V,v]=w.useState(new Set),[o,x]=w.useState(!1),[T,I]=w.useState(null),O=Mt(),{confirm:z}=O,Q=w.useCallback(async(a,u)=>{await z({title:r("gitView.changes.revertFileDialogTitle"),message:r("gitView.changes.revertFileDescription",{path:u}),action:r("gitView.changes.revertFileConfirm"),destructive:!0})&&a.onRevertFile(u)},[z,r]),U=w.useMemo(()=>y.map(a=>rs(a.entries)),[y]),K=w.useMemo(()=>{const a=[];return y.forEach((u,g)=>{Array.from(U[g]?.children.values()??[]).forEach(n=>{a.push(Qe(u.id,cs(n).node.path))})}),a},[U,y]);w.useEffect(()=>{d&&v(a=>{const u=new Set,g=new Set(K);return a.forEach(n=>{(n.slice(n.indexOf(" ")+1).includes("/")||g.has(n))&&u.add(n)}),K.forEach(n=>u.add(n)),u})},[d,K]);const A=w.useMemo(()=>{const a=[];return y.forEach((u,g)=>{if(a.push({type:"header",key:`header:${u.id}`,groupIndex:g}),!S.has(u.id)){if(d){const n=new Set;V.forEach(N=>{N.startsWith(`${u.id} `)&&n.add(N.slice(u.id.length+1))}),ds(U[g],n).forEach(N=>{N.kind==="file"?a.push({type:"file",key:`${u.id}:${N.key}`,groupIndex:g,file:N.file,depth:N.depth}):a.push({type:"directory",key:`${u.id}:${N.key}`,groupIndex:g,directory:N.directory,label:N.label,depth:N.depth})});return}u.entries.forEach(n=>{a.push({type:"file",key:`${u.id}:file:${n.path}`,groupIndex:g,file:n,depth:0})})}}),f&&y.length>0&&a.push({type:"revert-all",key:"revert-all"}),a},[S,V,d,f,U,y]),R=A.length,b=R>=ws,M=Rt({count:R,enabled:b,getScrollElement:()=>k.current,estimateSize:()=>xt,overscan:12,getItemKey:a=>A[a]?.key??a}),j=M.getVirtualItems(),D=w.useMemo(()=>{if(!b)return 0;const a=k.current?.scrollTop??0;return j.find(g=>g.end>a)?.index??0},[b,j,k]);w.useEffect(()=>{if(!m)return;const a=u=>u&&u.type==="file"?u.file.path:null;if(R===0){m([]);return}if(!b){const u=[];for(const g of A)if(g.type==="file"&&(u.push(g.file.path),u.length>=Ze))break;m(u);return}m(A.slice(D,D+Math.ceil((k.current?.clientHeight??0)/xt)+Ze).map(u=>a(u)).filter(u=>!!u).slice(0,Ze))},[m,R,A,b,D]);const $=w.useCallback(a=>{H(u=>{const g=new Set(u);return g.has(a)?g.delete(a):g.add(a),g})},[]),X=w.useCallback((a,u)=>{v(g=>{const n=new Set(g),E=Qe(a,u);return n.has(E)?n.delete(E):n.add(E),n})},[]),L=w.useMemo(()=>{const a=new Set;return y.forEach(u=>u.entries.forEach(g=>a.add(g.path))),Array.from(a)},[y]),W=L.length,G=T?i||T.paths.some(a=>s.has(a)):!1,J=w.useCallback(async()=>{!f||i||L.length===0||(await f(L),x(!1))},[L,i,f]),P=w.useCallback(async()=>{!c||!T||G||(await c(T.paths),I(null))},[G,c,T]),F=w.useCallback((a,u)=>{const g=S.has(a.id),n=a.entries.length;return t.jsxs("div",{className:de("sticky top-0 z-10 flex items-center gap-2 py-2",h,Ge,!u&&"mt-1 border-t border-edge-muted"),children:[t.jsx(we,{sideOffset:8,label:a.actionAllLabel,className:"shrink-0",children:t.jsx("button",{type:"button",onClick:()=>a.onActionAll(a.entries.map(E=>E.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":a.actionAllLabel,children:a.actionSymbol})}),t.jsxs("button",{type:"button",onClick:()=>$(a.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-expanded":!g,children:[t.jsx("h3",{className:"truncate typography-ui-header font-semibold text-foreground",children:a.title}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:n}),t.jsx(_,{name:"arrow-down-s",className:de("size-3.5 shrink-0 text-muted-foreground transition-transform",g&&"-rotate-90 rtl:rotate-90")})]})]})},[S,h,$]),Y=w.useCallback((a,u,g,n)=>{const E=V.has(Qe(a.id,u.path)),N=u.files.map(q=>q.path),ee=i||N.some(q=>s.has(q));return t.jsxs("div",{className:de("group flex items-center gap-2 text-muted-foreground hover:text-foreground",p?"min-h-11 select-none":"py-1.5",Ge),style:{paddingInlineStart:`${n*Ye}px`},...p&&a.showRevertActions!==!1&&c&&!ee?Dt(()=>I({path:u.path,paths:N,count:N.length})):null,children:[t.jsxs("button",{type:"button",onClick:()=>X(a.id,u.path),"aria-expanded":E,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":E?r("gitView.changes.collapseDirectoryAria",{path:u.path}):r("gitView.changes.expandDirectoryAria",{path:u.path}),children:[t.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center",children:t.jsx(_,{name:"arrow-right-s",className:de("size-3.5 transition-transform",E&&"rotate-90 rtl:-rotate-90")})}),t.jsx("span",{className:"min-w-0 truncate typography-ui-label",title:u.path,children:g}),E?null:t.jsx("span",{className:"shrink-0 typography-micro tabular-nums text-muted-foreground",children:u.files.length})]}),t.jsxs("span",{className:de("flex shrink-0 items-center gap-2 transition-opacity",!ee&&"md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),children:[a.showRevertActions!==!1&&c?t.jsx("button",{type:"button",onClick:()=>I({path:u.path,paths:N,count:N.length}),disabled:ee,className:p?"sr-only":"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50","aria-label":r("gitView.changes.revertDirectoryAria",{path:u.path}),"data-row-tooltip":r("gitView.changes.revertDirectoryTooltip"),children:ee?t.jsx(_,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx(_,{name:"arrow-go-back",className:"size-3.5"})}):null,t.jsx("button",{type:"button",onClick:()=>a.onActionAll(u.files.map(q=>q.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":r(a.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:u.path}),"data-row-tooltip":r(a.actionSymbol==="+"?"contextTooltips.git.stageFolder":"contextTooltips.git.unstageFolder"),children:a.actionSymbol})]})]})},[V,p,i,c,s,r,X]),te=w.useCallback((a,u)=>{if(a.type==="revert-all")return t.jsx("div",{className:de("flex justify-end py-2",Ge),children:t.jsx(we,{sideOffset:8,label:r("contextTooltips.git.discardAll"),children:t.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>x(!0),disabled:i,className:"gap-1.5 text-[var(--status-error)] hover:bg-[var(--status-error)]/10 hover:text-[var(--status-error)]",children:[t.jsx(_,{name:"arrow-go-back",className:"size-3.5"}),r("gitView.changes.revertAll")]})})});const g=y[a.groupIndex];if(!g)return null;if(a.type==="header")return F(g,u);if(a.type==="directory")return Y(g,a.directory,a.label,a.depth);const n=a.file;return t.jsx(bs,{file:n,actionLabel:g.getActionLabel(n.path),actionSymbol:g.actionSymbol,onAction:()=>g.onActionFile(n.path),stats:e?.[g.statsScope]?.[n.path],onViewDiff:()=>g.onViewDiff(n.path),onRevert:()=>{Q(g,n.path)},isReverting:s.has(n.path)||i,rowPaddingClassName:Ge,indentPx:a.depth*Ye,actionAtStart:!d,nameOnly:d,showRevert:g.showRevertActions!==!1})},[e,i,d,Y,F,Q,s,r,y]),se=a=>a.type!=="file"&&a.type!=="directory"?null:Array.from({length:a.depth},(u,g)=>t.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 w-px bg-edge",style:{insetInlineStart:`${g*Ye+8}px`}},g)),Z=w.useCallback(a=>{if(d||p)return!1;const u=A[a],g=A[a-1];return!u||!g||u.type!=="file"&&u.type!=="directory"||g.type!=="file"&&g.type!=="directory"?!1:g.groupIndex===u.groupIndex},[p,d,A]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[t.jsx(Lt,{ref:k,className:"overlay-scrollbar-target overlay-scrollbar-container min-h-0 w-full flex-1 overflow-x-hidden overflow-y-auto",children:b?t.jsx("div",{style:{height:M.getTotalSize(),position:"relative"},children:j.map(a=>{const u=A[a.index];return u?t.jsxs("div",{"data-index":a.index,ref:M.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${a.start}px)`},className:de(Z(a.index)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(u),te(u,a.index===0)]},u.key):null})}):t.jsx("div",{role:"list","aria-label":r("gitView.changes.changedFilesAria"),children:A.map((a,u)=>t.jsxs("div",{className:de("relative",Z(u)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(a),te(a,u===0)]},a.key))})}),t.jsx(Ht,{containerRef:k,disableHorizontal:!0}),t.jsx($t,{containerRef:k,sideOffset:8})]}),O.dialog,t.jsx(Fe,{open:o,onOpenChange:a=>{!i&&!a&&x(!1)},children:t.jsxs(Pe,{className:"max-w-md",children:[t.jsxs(Me,{children:[t.jsx(Le,{children:r("gitView.changes.revertAllDialogTitle")}),t.jsx(He,{children:W===1?r("gitView.changes.revertAllDescriptionSingle",{count:W}):r("gitView.changes.revertAllDescriptionPlural",{count:W})})]}),t.jsxs(it,{children:[t.jsx(ne,{variant:"outline",size:"sm",onClick:()=>x(!1),disabled:i,children:r("gitView.common.cancel")}),t.jsx(ne,{variant:"destructive",size:"sm",onClick:()=>{J()},disabled:i,children:r(i?"gitView.changes.reverting":"gitView.changes.revertAll")})]})]})}),t.jsx(Fe,{open:!!T,onOpenChange:a=>{!G&&!a&&I(null)},children:t.jsxs(Pe,{className:"max-w-md",children:[t.jsxs(Me,{children:[t.jsx(Le,{children:r("gitView.changes.revertDirectoryDialogTitle")}),t.jsx(He,{children:T?T.count===1?r("gitView.changes.revertDirectoryDescriptionSingle",{count:T.count,path:T.path}):r("gitView.changes.revertDirectoryDescriptionPlural",{count:T.count,path:T.path}):null})]}),t.jsxs(it,{children:[t.jsx(ne,{variant:"outline",size:"sm",onClick:()=>I(null),disabled:G,children:r("gitView.common.cancel")}),t.jsx(ne,{variant:"destructive",size:"sm",onClick:()=>{P()},disabled:G||!T,children:r(G?"gitView.changes.reverting":"gitView.changes.revertDirectory")})]})]})})]})},et=38,_e=200,vs=l=>{const e=be.c(26),{value:s,onChange:i,onSubmit:h,placeholder:m,disabled:f,hasTouchInput:c,isMobile:r}=l,p=f===void 0?!1:f,k=c===void 0?!1:c,C=r===void 0?!1:r,{t:d}=ye(),y=w.useRef(null),S=Gt(y),H=qe(js);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{const b=y.current;if(!b)return;const M=document.activeElement===b,j=()=>{b.style.height=`${et}px`;const $=b.scrollHeight,X=Math.min(Math.max($,et),_e);b.style.height=`${X}px`,b.style.overflowY=$>_e?"auto":"hidden",$>_e&&!M&&(b.scrollTop=b.scrollHeight)};j();const D=window.requestAnimationFrame(j);return()=>{window.cancelAnimationFrame(D)}},e[0]=V):V=e[0];let v;e[1]!==s?(v=[s],e[1]=s,e[2]=v):v=e[2],w.useLayoutEffect(V,v);let o;e[3]!==i?(o=b=>i(b.target.value),e[3]=i,e[4]=o):o=e[4];let x;e[5]!==h?(x=b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&!b.shiftKey&&!b.altKey&&(b.preventDefault(),h?.())},e[5]=h,e[6]=x):x=e[6];let T;e[7]!==m||e[8]!==d?(T=m??d("gitView.commit.messagePlaceholder"),e[7]=m,e[8]=d,e[9]=T):T=e[9];const I=k?"on":"off",O=k?"sentences":"off",z=C||H,Q=p&&"opacity-50";let U;e[10]!==Q?(U=de("oc-raised oc-field w-full rounded-lg bg-surface-elevated px-3 py-2 typography-ui-label text-foreground placeholder:text-muted-foreground","resize-none outline-none",Q),e[10]=Q,e[11]=U):U=e[11];let K;e[12]===Symbol.for("react.memo_cache_sentinel")?(K={minHeight:et,maxHeight:_e},e[12]=K):K=e[12];let A;e[13]!==p||e[14]!==O||e[15]!==z||e[16]!==U||e[17]!==o||e[18]!==x||e[19]!==T||e[20]!==I||e[21]!==s?(A=t.jsx("textarea",{ref:y,value:s,onChange:o,onKeyDown:x,placeholder:T,rows:1,disabled:p,autoCorrect:I,autoCapitalize:O,spellCheck:z,className:U,style:K}),e[13]=p,e[14]=O,e[15]=z,e[16]=U,e[17]=o,e[18]=x,e[19]=T,e[20]=I,e[21]=s,e[22]=A):A=e[22];let R;return e[23]!==S||e[24]!==A?(R=t.jsxs(t.Fragment,{children:[A,S]}),e[23]=S,e[24]=A,e[25]=R):R=e[25],R};function js(l){return l.inputSpellcheckEnabled}const Ns=l=>{const e=be.c(30),{highlights:s,onInsert:i}=l,{t:h}=ye();if(s.length===0)return null;let m;e[0]!==s||e[1]!==i?(m=()=>{i(s)},e[0]=s,e[1]=i,e[2]=m):m=e[2];const f=m;let c;e[3]!==h?(c=h("gitView.commit.aiHighlights.title"),e[3]=h,e[4]=c):c=e[4];let r;e[5]!==c?(r=t.jsx("p",{className:"typography-micro text-muted-foreground",children:c}),e[5]=c,e[6]=r):r=e[6];let p;e[7]!==h?(p=h("gitView.commit.aiHighlights.insertAria"),e[7]=h,e[8]=p):p=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(_,{name:"arrow-down",className:"size-4"}),e[9]=k):k=e[9];let C;e[10]!==f||e[11]!==p?(C=t.jsx(ot,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"size-6",onClick:f,"aria-label":p,children:k})}),e[10]=f,e[11]=p,e[12]=C):C=e[12];let d;e[13]!==h?(d=h("gitView.commit.aiHighlights.insertTooltip"),e[13]=h,e[14]=d):d=e[14];let y;e[15]!==d?(y=t.jsx(lt,{sideOffset:8,children:d}),e[15]=d,e[16]=y):y=e[16];let S;e[17]!==C||e[18]!==y?(S=t.jsxs(at,{children:[C,y]}),e[17]=C,e[18]=y,e[19]=S):S=e[19];let H;e[20]!==r||e[21]!==S?(H=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r,S]}),e[20]=r,e[21]=S,e[22]=H):H=e[22];let V;e[23]!==s?(V=s.map(Cs),e[23]=s,e[24]=V):V=e[24];let v;e[25]!==V?(v=t.jsx("ul",{className:"space-y-1",children:V}),e[25]=V,e[26]=v):v=e[26];let o;return e[27]!==H||e[28]!==v?(o=t.jsxs("div",{className:"space-y-2 rounded-xl oc-tile px-3 py-2",children:[H,v]}),e[27]=H,e[28]=v,e[29]=o):o=e[29],o};function Cs(l,e){return t.jsx("li",{className:"typography-meta text-foreground",children:l},`${l}-${e}`)}const Js=l=>{const e=be.c(113),{stagedCount:s,commitMessage:i,onCommitMessageChange:h,generatedHighlights:m,onInsertHighlights:f,onGenerateMessage:c,isGeneratingMessage:r,onCommit:p,onCommitAndPush:k,commitAction:C,networkOperationBlocked:d,hasPendingIndexMutation:y,gitmojiEnabled:S,onOpenGitmojiPicker:H}=l,V=d===void 0?!1:d,v=y===void 0?!1:y,{t:o}=ye(),x=s>0;let T;e[0]!==C||e[1]!==i||e[2]!==v||e[3]!==x?(T=i.trim()&&x&&C===null&&!v,e[0]=C,e[1]=i,e[2]=v,e[3]=x,e[4]=T):T=e[4];const I=T,{isMobile:O,hasTouchInput:z}=nt(),[Q,U]=w.useState(!1);let K;e[5]!==i||e[6]!==x||e[7]!==o?(K=x?i.trim()?null:o("contextTooltips.git.writeMessageFirst"):o("contextTooltips.git.stageFilesFirst"),e[5]=i,e[6]=x,e[7]=o,e[8]=K):K=e[8];const A=K;if(O&&!Q&&!x&&!i.trim()&&m.length===0){let le;e[9]!==o?(le=o("gitView.commit.title"),e[9]=o,e[10]=le):le=e[10];let fe;e[11]!==le?(fe=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:le}),e[11]=le,e[12]=fe):fe=e[12];let he;e[13]!==o?(he=o("gitView.commit.stageFilesHint"),e[13]=o,e[14]=he):he=e[14];let pe;e[15]!==he?(pe=t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:he}),e[15]=he,e[16]=pe):pe=e[16];let ve;return e[17]!==fe||e[18]!==pe?(ve=t.jsxs("section",{className:"flex items-baseline gap-2",children:[fe,pe]}),e[17]=fe,e[18]=pe,e[19]=ve):ve=e[19],ve}let R,b;e[20]===Symbol.for("react.memo_cache_sentinel")?(R=()=>U(!0),b=le=>{le.currentTarget.contains(le.relatedTarget)||U(!1)},e[20]=R,e[21]=b):(R=e[20],b=e[21]);let M;e[22]!==o?(M=o("gitView.commit.title"),e[22]=o,e[23]=M):M=e[23];let j;e[24]!==M?(j=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:M}),e[24]=M,e[25]=j):j=e[25];let D;e[26]!==x||e[27]!==o?(D=x?null:t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:o("gitView.commit.stageFilesHint")}),e[26]=x,e[27]=o,e[28]=D):D=e[28];let $;e[29]!==j||e[30]!==D?($=t.jsxs("div",{className:"flex w-full items-baseline gap-2 px-0 pt-2 pb-1",children:[j,D]}),e[29]=j,e[30]=D,e[31]=$):$=e[31];let X;e[32]!==m||e[33]!==f?(X=t.jsx(Ns,{highlights:m,onInsert:f}),e[32]=m,e[33]=f,e[34]=X):X=e[34];let L;e[35]!==I||e[36]!==r||e[37]!==p?(L=()=>{I&&!r&&p()},e[35]=I,e[36]=r,e[37]=p,e[38]=L):L=e[38];let W;e[39]!==o?(W=o("gitView.commit.messagePlaceholder"),e[39]=o,e[40]=W):W=e[40];const G=C!==null;let J;e[41]!==i||e[42]!==z||e[43]!==O||e[44]!==h||e[45]!==L||e[46]!==W||e[47]!==G?(J=t.jsx(vs,{value:i,onChange:h,onSubmit:L,placeholder:W,disabled:G,hasTouchInput:z,isMobile:O}),e[41]=i,e[42]=z,e[43]=O,e[44]=h,e[45]=L,e[46]=W,e[47]=G,e[48]=J):J=e[48];let P;e[49]!==S||e[50]!==H||e[51]!==o?(P=S&&t.jsx(we,{sideOffset:8,label:o("contextTooltips.git.addGitmoji"),className:"w-fit",children:t.jsxs(ne,{variant:"outline",size:"sm",onClick:H,className:"w-fit",type:"button",children:[t.jsx(_,{name:"emotion-happy",className:"size-4"}),o("gitView.commit.addGitmoji")]})}),e[49]=S,e[50]=H,e[51]=o,e[52]=P):P=e[52];let F;e[53]!==x||e[54]!==o?(F=o(x?"gitView.commit.generateAria":"contextTooltips.git.stageFilesFirst"),e[53]=x,e[54]=o,e[55]=F):F=e[55];const Y=r||C!==null||v||s===0;let te;e[56]!==o?(te=o("gitView.commit.generateAria"),e[56]=o,e[57]=te):te=e[57];let se;e[58]!==r?(se=r?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"ai-generate-2",className:"size-4 text-primary"}),e[58]=r,e[59]=se):se=e[59];let Z;e[60]!==o?(Z=o("gitView.commit.generate"),e[60]=o,e[61]=Z):Z=e[61];let a;e[62]!==Z?(a=t.jsx("span",{className:"commit-actions__label",children:Z}),e[62]=Z,e[63]=a):a=e[63];let u;e[64]!==c||e[65]!==Y||e[66]!==te||e[67]!==se||e[68]!==a?(u=t.jsxs(ne,{variant:"outline",size:"sm",onClick:c,disabled:Y,type:"button","aria-label":te,className:"commit-actions__btn",children:[se,a]}),e[64]=c,e[65]=Y,e[66]=te,e[67]=se,e[68]=a,e[69]=u):u=e[69];let g;e[70]!==F||e[71]!==u?(g=t.jsx(we,{sideOffset:8,label:F,children:u}),e[70]=F,e[71]=u,e[72]=g):g=e[72];let n;e[73]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1"}),e[73]=n):n=e[73];let E;e[74]!==A||e[75]!==o?(E=A??o("contextTooltips.git.commit"),e[74]=A,e[75]=o,e[76]=E):E=e[76];let N;e[77]!==p?(N=le=>p(le.currentTarget),e[77]=p,e[78]=N):N=e[78];const ee=!I||r;let q;e[79]!==o?(q=o("gitView.commit.commitAria"),e[79]=o,e[80]=q):q=e[80];let ae;e[81]!==C||e[82]!==o?(ae=C==="commit"?t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label",children:o("gitView.commit.committing")})]}):t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"git-commit",className:"size-4"}),t.jsx("span",{className:"commit-actions__label",children:o("gitView.commit.commit")})]}),e[81]=C,e[82]=o,e[83]=ae):ae=e[83];let B;e[84]!==N||e[85]!==ee||e[86]!==q||e[87]!==ae?(B=t.jsx(ne,{size:"sm",variant:"outline",onClick:N,disabled:ee,className:"commit-actions__btn whitespace-nowrap","aria-label":q,children:ae}),e[84]=N,e[85]=ee,e[86]=q,e[87]=ae,e[88]=B):B=e[88];let oe;e[89]!==E||e[90]!==B?(oe=t.jsx(we,{sideOffset:8,label:E,children:B}),e[89]=E,e[90]=B,e[91]=oe):oe=e[91];let ce;e[92]!==I||e[93]!==C||e[94]!==A||e[95]!==r||e[96]!==O||e[97]!==V||e[98]!==k||e[99]!==o?(ce=O?t.jsxs(at,{children:[t.jsx(ot,{asChild:!0,children:t.jsx(ne,{variant:"default",size:"sm",onClick:le=>k(le.currentTarget),disabled:!I||r||V,className:"h-7 w-7 p-0","aria-label":o("gitView.commit.pushAria"),children:C==="commitAndPush"?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"arrow-up",className:"size-3.5"})})}),t.jsx(lt,{side:"top",children:t.jsx("p",{children:o("gitView.commit.push")})})]}):t.jsx(we,{sideOffset:8,label:A??o("contextTooltips.git.commitAndSync"),children:t.jsx(ne,{size:"sm",variant:"default",onClick:le=>k(le.currentTarget),disabled:!I||r||V,className:"commit-actions__btn","aria-label":o("gitView.commit.pushAria"),children:C==="commitAndPush"?t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:o("gitView.commit.pushing")})]}):t.jsxs(t.Fragment,{children:[t.jsx(_,{name:"arrow-up",className:"size-3.5"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:o("gitView.commit.push")})]})})}),e[92]=I,e[93]=C,e[94]=A,e[95]=r,e[96]=O,e[97]=V,e[98]=k,e[99]=o,e[100]=ce):ce=e[100];let me;e[101]!==g||e[102]!==oe||e[103]!==ce?(me=t.jsxs("div",{className:"@container/commit-actions flex items-center gap-2 min-w-0",children:[g,n,oe,ce]}),e[101]=g,e[102]=oe,e[103]=ce,e[104]=me):me=e[104];let re;e[105]!==X||e[106]!==J||e[107]!==P||e[108]!==me?(re=t.jsxs("div",{className:"flex flex-col gap-3 px-0 pt-1 pb-3",children:[X,J,P,me]}),e[105]=X,e[106]=J,e[107]=P,e[108]=me,e[109]=re):re=e[109];let ue;return e[110]!==$||e[111]!==re?(ue=t.jsxs("section",{className:"border-0 bg-transparent rounded-none",onFocus:R,onBlur:b,children:[$,re]}),e[110]=$,e[111]=re,e[112]=ue):ue=e[112],ue},Ys=l=>{const e=be.c(153),{open:s,onOpenChange:i,conflictFiles:h,directory:m,operation:f,onAbort:c,onClearState:r,onNavigatedToChat:p}=l;let k;e[0]!==h?(k=h===void 0?[]:h,e[0]=h,e[1]=k):k=e[1];const C=k,{t:d}=ye(),y=rt(Ss),S=rt(ks),H=ct(Vs),V=ct(As),[v,o]=w.useState(!1),[x,T]=w.useState(null),[I,O]=w.useState(null);let z,Q;e[2]!==m||e[3]!==s||e[4]!==d?(z=()=>{!s||!m||(o(!0),O(null),T(null),_t(m).then(ie=>{T(ie)}).catch(ie=>{const ge=ie instanceof Error?ie.message:d("gitView.conflict.loadFailed");O(ge)}).finally(()=>{o(!1)}))},Q=[s,m,d],e[2]=m,e[3]=s,e[4]=d,e[5]=z,e[6]=Q):(z=e[5],Q=e[6]),w.useEffect(z,Q);let U;e[7]!==x||e[8]!==m||e[9]!==f?(U=async()=>{if(!x)return null;const ie=f==="merge"?"merge":"rebase",ge=x.headInfo||(f==="merge"?"MERGE_HEAD":"REBASE_HEAD"),ke=f==="merge"?"git commit --no-edit":"git rebase --continue",Ve=await Bt(m),je=Ve.render("git.conflict.resolve.visible",{operation_label:ie,head_ref:ge}),Ne=Ve.render("git.conflict.resolve.instructions",{operation_label:ie,directory:m,operation:f,head_info:x.headInfo||"N/A",continue_cmd:ke}),Ce=`${ie} conflict context (JSON)
|
|
2
2
|
${JSON.stringify({directory:m,operation:x.operation,headInfo:x.headInfo,statusPorcelain:x.statusPorcelain,unmergedFiles:x.unmergedFiles,diff:x.diff},null,2)}`;return{visibleText:je,instructionsText:Ne,payloadText:Ce}},e[7]=x,e[8]=m,e[9]=f,e[10]=U):U=e[10];const K=U;let A;e[11]!==K||e[12]!==d?(A=async()=>{try{return await K()}catch(ie){const ge=ie;xe.error(d("magicPrompts.toast.loadFailed"),{description:ge instanceof Error?ge.message:void 0});return}},e[11]=K,e[12]=d,e[13]=A):A=e[13];const R=A;let b;e[14]!==c||e[15]!==i?(b=()=>{c(),i(!1)},e[14]=c,e[15]=i,e[16]=b):b=e[16];const M=b;let j;e[17]!==r||e[18]!==i?(j=()=>{r?.(),i(!1)},e[17]=r,e[18]=i,e[19]=j):j=e[19];const D=j;let $;e[20]!==S||e[21]!==r||e[22]!==p||e[23]!==i||e[24]!==R||e[25]!==H||e[26]!==V||e[27]!==d?($=async()=>{const ie=await R();if(ie!==void 0){if(!ie){xe.error(d("gitView.conflict.noDetailsAvailable"));return}if(!S){xe.error(d("gitView.conflict.noActiveSession"),{description:d("gitView.conflict.noActiveSessionDescription")});return}H(ie.visibleText,"replace"),V([{text:ie.instructionsText,synthetic:!0},{text:ie.payloadText,synthetic:!0}]),r?.(),i(!1),p?.()}},e[20]=S,e[21]=r,e[22]=p,e[23]=i,e[24]=R,e[25]=H,e[26]=V,e[27]=d,e[28]=$):$=e[28];const X=$;let L;e[29]!==m||e[30]!==r||e[31]!==p||e[32]!==i||e[33]!==y||e[34]!==R||e[35]!==d?(L=async()=>{const ie=await R();if(ie!==void 0){if(!ie){xe.error(d("gitView.conflict.noDetailsAvailable"));return}y({directoryOverride:m,initialPrompt:ie.visibleText,syntheticParts:[{text:ie.instructionsText,synthetic:!0},{text:ie.payloadText,synthetic:!0}]}),r?.(),i(!1),p?.()}},e[29]=m,e[30]=r,e[31]=p,e[32]=i,e[33]=y,e[34]=R,e[35]=d,e[36]=L):L=e[36];const W=L;let G,J,P,F,Y,te,se,Z,a,u,g,n,E,N,ee,q,ae,B,oe,ce,me,re;if(e[37]!==x||e[38]!==C||e[39]!==S||e[40]!==M||e[41]!==D||e[42]!==X||e[43]!==W||e[44]!==v||e[45]!==I||e[46]!==i||e[47]!==s||e[48]!==f||e[49]!==d){const ie=d(f==="merge"?"gitView.operation.merge":"gitView.operation.rebase"),ge=x?.unmergedFiles||C;P=Fe,me=s,re=i,J=Pe,ce="max-w-md w-[calc(100vw-2rem)]",N="flex flex-col gap-4 overflow-hidden";let ke;e[72]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(_,{name:"alert",className:"size-5 shrink-0 text-[var(--status-warning)]"}),e[72]=ke):ke=e[72];const Ve=t.jsxs("div",{className:"flex items-center gap-2",children:[ke,t.jsx(Le,{children:d("gitView.conflict.detectedTitle",{operation:ie})})]});let je;e[73]!==f||e[74]!==d?(je=d("gitView.conflict.detectedDescription",{operation:f}),e[73]=f,e[74]=d,e[75]=je):je=e[75];let Ne;e[76]!==je?(Ne=t.jsx(He,{children:je}),e[76]=je,e[77]=Ne):Ne=e[77],e[78]!==Ve||e[79]!==Ne?(ee=t.jsxs(Me,{children:[Ve,Ne]}),e[78]=Ve,e[79]=Ne,e[80]=ee):ee=e[80],e[81]!==v||e[82]!==d?(q=v&&t.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-muted-foreground",children:[t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"typography-meta",children:d("gitView.conflict.loading")})]}),e[81]=v,e[82]=d,e[83]=q):q=e[83],e[84]!==I||e[85]!==d?(ae=I&&t.jsx("div",{className:"rounded-lg bg-[var(--status-error-bg)] p-3 text-[var(--status-error)] typography-meta break-words",children:d("gitView.conflict.errorLoadingDetails",{message:I})}),e[84]=I,e[85]=d,e[86]=ae):ae=e[86],e[87]!==ge||e[88]!==d?(B=ge.length>0&&t.jsxs("div",{className:"space-y-2 overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:d("gitView.conflict.conflictedFiles")}),t.jsx("span",{className:"typography-micro px-1.5 py-0.5 rounded bg-[var(--surface-elevated)] text-muted-foreground",children:ge.length})]}),t.jsx(dt,{outerClassName:"max-h-40 rounded-lg bg-[var(--surface-elevated)]",className:"p-3",disableHorizontal:!0,children:t.jsx("ul",{className:"space-y-1",children:ge.map(Ts)})})]}),e[87]=ge,e[88]=d,e[89]=B):B=e[89],e[90]!==x||e[91]!==d?(oe=x?.headInfo&&t.jsxs("div",{className:"space-y-1 overflow-hidden",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:d("gitView.conflict.headInfo")}),t.jsx(dt,{outerClassName:"max-h-24 rounded-lg bg-[var(--surface-elevated)]",className:"typography-micro text-foreground font-mono p-3 break-words whitespace-pre-wrap",disableHorizontal:!0,children:x.headInfo})]}),e[90]=x,e[91]=d,e[92]=oe):oe=e[92],g="flex flex-col gap-2 pt-2";let Ce;e[93]!==W?(Ce=()=>{W()},e[93]=W,e[94]=Ce):Ce=e[94];const Xe=v||!x;let Ae;e[95]!==v?(Ae=v?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"add",className:"size-4"}),e[95]=v,e[96]=Ae):Ae=e[96];let Te;e[97]!==d?(Te=d("gitView.conflict.resolveNewSession"),e[97]=d,e[98]=Te):Te=e[98],e[99]!==Ce||e[100]!==Xe||e[101]!==Ae||e[102]!==Te?(n=t.jsxs(ne,{variant:"default",onClick:Ce,disabled:Xe,className:"w-full gap-2",children:[Ae,Te]}),e[99]=Ce,e[100]=Xe,e[101]=Ae,e[102]=Te,e[103]=n):n=e[103];let Ie;e[104]!==X?(Ie=()=>{X()},e[104]=X,e[105]=Ie):Ie=e[105];const We=v||!x||!S;let Ee;e[106]!==v?(Ee=v?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"chat-1",className:"size-4"}),e[106]=v,e[107]=Ee):Ee=e[107];let De;e[108]!==d?(De=d("gitView.conflict.resolveCurrentSession"),e[108]=d,e[109]=De):De=e[109],e[110]!==Ie||e[111]!==We||e[112]!==Ee||e[113]!==De?(E=t.jsxs(ne,{variant:"outline",onClick:Ie,disabled:We,className:"w-full gap-2",children:[Ee,De]}),e[110]=Ie,e[111]=We,e[112]=Ee,e[113]=De,e[114]=E):E=e[114],a="flex gap-2 pt-1";let ze;e[115]!==d?(ze=d("gitView.conflict.continueLater"),e[115]=d,e[116]=ze):ze=e[116],e[117]!==D||e[118]!==ze?(u=t.jsx(ne,{variant:"ghost",size:"sm",onClick:D,className:"flex-1",children:ze}),e[117]=D,e[118]=ze,e[119]=u):u=e[119],G=ne,F="destructive",Y="sm",te=M,se="flex-1",Z=d("gitView.conflict.abortOperation",{operation:ie}),e[37]=x,e[38]=C,e[39]=S,e[40]=M,e[41]=D,e[42]=X,e[43]=W,e[44]=v,e[45]=I,e[46]=i,e[47]=s,e[48]=f,e[49]=d,e[50]=G,e[51]=J,e[52]=P,e[53]=F,e[54]=Y,e[55]=te,e[56]=se,e[57]=Z,e[58]=a,e[59]=u,e[60]=g,e[61]=n,e[62]=E,e[63]=N,e[64]=ee,e[65]=q,e[66]=ae,e[67]=B,e[68]=oe,e[69]=ce,e[70]=me,e[71]=re}else G=e[50],J=e[51],P=e[52],F=e[53],Y=e[54],te=e[55],se=e[56],Z=e[57],a=e[58],u=e[59],g=e[60],n=e[61],E=e[62],N=e[63],ee=e[64],q=e[65],ae=e[66],B=e[67],oe=e[68],ce=e[69],me=e[70],re=e[71];let ue;e[120]!==G||e[121]!==F||e[122]!==Y||e[123]!==te||e[124]!==se||e[125]!==Z?(ue=t.jsx(G,{variant:F,size:Y,onClick:te,className:se,children:Z}),e[120]=G,e[121]=F,e[122]=Y,e[123]=te,e[124]=se,e[125]=Z,e[126]=ue):ue=e[126];let le;e[127]!==a||e[128]!==u||e[129]!==ue?(le=t.jsxs("div",{className:a,children:[u,ue]}),e[127]=a,e[128]=u,e[129]=ue,e[130]=le):le=e[130];let fe;e[131]!==g||e[132]!==n||e[133]!==E||e[134]!==le?(fe=t.jsxs("div",{className:g,children:[n,E,le]}),e[131]=g,e[132]=n,e[133]=E,e[134]=le,e[135]=fe):fe=e[135];let he;e[136]!==N||e[137]!==ee||e[138]!==q||e[139]!==ae||e[140]!==B||e[141]!==oe||e[142]!==fe?(he=t.jsxs("div",{className:N,children:[ee,q,ae,B,oe,fe]}),e[136]=N,e[137]=ee,e[138]=q,e[139]=ae,e[140]=B,e[141]=oe,e[142]=fe,e[143]=he):he=e[143];let pe;e[144]!==J||e[145]!==ce||e[146]!==he?(pe=t.jsx(J,{className:ce,children:he}),e[144]=J,e[145]=ce,e[146]=he,e[147]=pe):pe=e[147];let ve;return e[148]!==P||e[149]!==me||e[150]!==re||e[151]!==pe?(ve=t.jsx(P,{open:me,onOpenChange:re,children:pe}),e[148]=P,e[149]=me,e[150]=re,e[151]=pe,e[152]=ve):ve=e[152],ve};function Ss(l){return l.openNewSessionDraft}function ks(l){return l.currentSessionId}function Vs(l){return l.setPendingInputText}function As(l){return l.setPendingSyntheticParts}function Ts(l){return t.jsx("li",{className:"typography-micro text-foreground font-mono truncate block",title:l,children:l},l)}const Zs=({open:l,onOpenChange:e,targetBranch:s,changedFileCount:i,onCommitAndSwitch:h,onGenerateMessage:m,onRevertAndSwitch:f})=>{const{t:c}=ye(),[r,p]=w.useState(""),[k,C]=w.useState(null),[d,y]=w.useState(!1),S=k!==null;w.useEffect(()=>{l||(p(""),y(!1))},[l]);const H=async()=>{C("generate");try{const o=await m();o&&p(o)}catch(o){xe.error(o instanceof Error?o.message:c("gitView.dirtySwitch.actionFailed"))}finally{C(null)}},V=async()=>{C("commit");try{let o=r.trim();if(!o){if(o=(await m()).trim(),!o){xe.error(c("gitView.toast.enterCommitMessage"));return}p(o)}await h(o,d)}catch(o){xe.error(o instanceof Error?o.message:c("gitView.dirtySwitch.actionFailed"))}finally{C(null)}},v=async()=>{C("revert");try{await f()}catch(o){xe.error(o instanceof Error?o.message:c("gitView.dirtySwitch.actionFailed"))}finally{C(null)}};return t.jsx(Fe,{open:l,onOpenChange:o=>{S||e(o)},children:t.jsx(Pe,{className:"max-w-md w-[calc(100vw-2rem)]",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs(Me,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(_,{name:"alert",className:"size-5 shrink-0 text-[var(--status-warning)]"}),t.jsx(Le,{children:c("gitView.dirtySwitch.title")})]}),t.jsx(He,{children:i===1?c("gitView.dirtySwitch.descriptionSingle",{branch:s}):c("gitView.dirtySwitch.descriptionPlural",{branch:s,count:i})})]}),t.jsxs("div",{className:"oc-raised oc-field flex items-center gap-2 rounded-lg px-3 py-2",children:[t.jsx("input",{value:r,onChange:o=>p(o.target.value),placeholder:c("gitView.commit.messagePlaceholder"),disabled:S,onKeyDown:o=>{o.key==="Enter"&&!S&&(o.preventDefault(),V())},className:"min-w-0 flex-1 bg-transparent typography-meta text-foreground outline-none placeholder:text-muted-foreground"}),t.jsx(we,{sideOffset:8,label:c("gitView.commit.generateAria"),className:"shrink-0",children:t.jsx("button",{type:"button",onClick:()=>{H()},disabled:S,"aria-label":c("gitView.commit.generate"),className:"shrink-0 text-muted-foreground hover:text-foreground disabled:opacity-50",children:k==="generate"?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"ai-generate-2",className:"size-4 text-primary"})})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Kt,{checked:d,onChange:y,disabled:S,ariaLabel:c("gitView.dirtySwitch.pushAfterCommit")}),t.jsx("span",{className:"typography-ui-label text-foreground cursor-pointer select-none",onClick:()=>!S&&y(!d),children:c("gitView.dirtySwitch.pushAfterCommit")})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(ne,{variant:"destructive",size:"sm",onClick:()=>{v()},disabled:S,className:"gap-2",children:[k==="revert"?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):null,c("gitView.dirtySwitch.revertAndSwitch")]}),t.jsxs(ne,{variant:"default",size:"sm",onClick:()=>{V()},disabled:S,className:"gap-2",children:[k==="commit"?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):null,c("gitView.dirtySwitch.commitAndSwitch")]})]})]})})})},tt="max-w-none",Is="flex flex-wrap items-center gap-2",zt=l=>{const e=be.c(6),{error:s,children:i}=l,h=s?"alert":void 0,m=s&&"text-[var(--status-error)]";let f;e[0]!==m?(f=de(Ke,m),e[0]=m,e[1]=f):f=e[1];let c;return e[2]!==i||e[3]!==h||e[4]!==f?(c=t.jsx("p",{role:h,className:f,children:i}),e[2]=i,e[3]=h,e[4]=f,e[5]=c):c=e[5],c},Es=l=>{if(!l||l.target.operation!=="checkout-hydration")return[];const e=[...l.target.requirements],s=[...(l.hydration?.submodules??[]).map(i=>({kind:"submodule",item:i})),...(l.hydration?.lfs??[]).map(i=>({kind:"lfs",item:i}))];for(const{kind:i,item:h}of s){const m=h.endpoint;m&&(e.some(f=>f.kind===i&&f.path===h.path&&f.endpoint.fingerprint===m.fingerprint)||e.push({kind:i,path:h.path,endpoint:m}))}return e},Ds=l=>{const e=be.c(48),{directory:s,className:i}=l,{t:h}=ye(),{git:m,sourceControl:f}=bt(),c=wt(s,f),r=Re(Rs),p=Re(Os),k=vt(),C=Be(Fs),d=Be(Ps);let y;e[0]!==d?(y=jt(d),e[0]=d,e[1]=y):y=e[1];const S=y,[H,V]=w.useState(""),[v,o]=w.useState(!1),x=w.useRef(0);let T;e[2]===Symbol.for("react.memo_cache_sentinel")?(T=()=>(x.current=x.current+1,V(""),o(!1),()=>{x.current=x.current+1}),e[2]=T):T=e[2];let I;e[3]!==c.scope||e[4]!==m||e[5]!==f?(I=[c.scope,m,f],e[3]=c.scope,e[4]=m,e[5]=f,e[6]=I):I=e[6],w.useLayoutEffect(T,I);const O=c.read;let z;e[7]!==k?(z=L=>Et(L)&&Vt(L,k),e[7]=k,e[8]=z):z=e[8];let Q;e[9]!==r||e[10]!==p||e[11]!==z?(Q=Nt(r,p,z),e[9]=r,e[10]=p,e[11]=z,e[12]=Q):Q=e[12];const U=Q;let K,A,R,b,M,j,D;if(e[13]!==i||e[14]!==s||e[15]!==m||e[16]!==r||e[17]!==U||e[18]!==S||e[19]!==H||e[20]!==O||e[21]!==C||e[22]!==f||e[23]!==h){R=Symbol.for("react.early_return_sentinel");e:{const L=O?qt(O):null,W=L?.providers[0]?.primaryRemote??L?.remotes[0]?.name??"origin",G=(O?.repository.remotes??[]).filter(P=>P.name!==W&&L?.remotes.find(F=>F.name===P.name)?.readiness!=="ready"),J=async(P,F)=>{if(H)return;const Y=x.current,te=Ue(),se=()=>x.current===Y&&te===Ue();V(P),o(!1);const Z=await Qt({directory:s,identity:F,remoteName:P},{git:m,sourceControl:f});se()&&(Z.status!=="applied"&&o(!0),V(""))};if(!G.length||!m.configureTransportBinding){R=null;break e}K=At,e[31]!==h?(b=h("gitView.remotes.title"),e[31]=h,e[32]=b):b=e[32],e[33]!==h?(M=h("gitView.remotes.description"),e[33]=h,e[34]=M):M=e[34],e[35]!==i?(j=de("min-w-0",i),e[35]=i,e[36]=j):j=e[36],D=Tt,A=G.map(P=>{const F=Ct(P.fetch.displayUrl);return t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate typography-ui-label text-foreground",children:P.name}),t.jsx("p",{className:de(Ke,"truncate"),title:P.fetch.displayUrl,children:P.fetch.displayUrl})]}),t.jsx(St,{activeProfile:null,identities:U,onSelect:Y=>{J(P.name,Y)},isApplying:H===P.name,applicability:Y=>kt(Y,F,S),triggerClassName:"shrink-0 border border-border",onOpen:()=>{C(f,r.map(Ms))}})]},P.name)})}e[13]=i,e[14]=s,e[15]=m,e[16]=r,e[17]=U,e[18]=S,e[19]=H,e[20]=O,e[21]=C,e[22]=f,e[23]=h,e[24]=K,e[25]=A,e[26]=R,e[27]=b,e[28]=M,e[29]=j,e[30]=D}else K=e[24],A=e[25],R=e[26],b=e[27],M=e[28],j=e[29],D=e[30];if(R!==Symbol.for("react.early_return_sentinel"))return R;let $;e[37]!==v||e[38]!==h?($=v?t.jsx(zt,{error:!0,children:h("settings.sourceControl.instance.status.operationFailed")}):null,e[37]=v,e[38]=h,e[39]=$):$=e[39];let X;return e[40]!==K||e[41]!==A||e[42]!==$||e[43]!==b||e[44]!==M||e[45]!==j||e[46]!==D?(X=t.jsxs(K,{title:b,description:M,className:j,contentClassName:D,children:[A,$]}),e[40]=K,e[41]=A,e[42]=$,e[43]=b,e[44]=M,e[45]=j,e[46]=D,e[47]=X):X=e[47],X},zs=({directory:l,className:e})=>{const{t:s}=ye(),{git:i,sourceControl:h}=bt(),m=wt(l,h),f=Ut(l,i,h),[c,r]=w.useState(""),[p,k]=w.useState(""),[C,d]=w.useState(null),[y,S]=w.useState(!1),[H,V]=w.useState(!1),[v,o]=w.useState(!1),x=w.useRef(0),T=Re(n=>n.profiles),I=Re(n=>n.globalIdentity),O=Re(n=>n.loadProfiles),z=Re(n=>n.loadGlobalIdentity),Q=vt(),U=Be(n=>n.refreshIdentityAccounts),K=Be(n=>n.identities),A=w.useMemo(()=>jt(K),[K]),R=Xt(l),b=f.entry?.reads.at(-1)?.operation,M=b?.target.operation==="checkout-hydration"&&b.target.remote.name===c?Es(b):[],j=M.find(n=>JSON.stringify([n.kind,n.path,n.endpoint.fingerprint])===p),D=m.read,$=D?.repository.remotes.find(n=>n.name===c),X=j&&D?.binding?.auxiliary.find(n=>n.kind===j.kind&&n.endpoint.fingerprint===j.endpoint.fingerprint);w.useLayoutEffect(()=>(x.current+=1,r(""),k(""),d(null),S(!1),V(!1),o(!1),()=>{x.current+=1}),[m.scope,i,h]),w.useLayoutEffect(()=>{},[j?.endpoint.fingerprint]),w.useEffect(()=>{v&&(O(),z())},[O,z,v]);const L=w.useMemo(()=>Nt(T,I,n=>Et(n)&&Vt(n,Q)),[Q,T,I]),W=j?.endpoint.displayUrl??"",G=w.useMemo(()=>W?Ct(W):null,[W]),J=w.useCallback(n=>G?kt(n,G,A):{applicable:!0},[G,A]),P=w.useMemo(()=>{const n=L.filter(N=>J(N).applicable);return(R?.userName&&R.userEmail?n.find(N=>N.userName===R.userName&&N.userEmail===R.userEmail):void 0)??n.find(N=>N.account&&G?.host&&(Wt(N.account.instance)===G.host||Jt(A[N.account.instance]??"")===G.host))??null},[J,L,G,A,R]),F=(C?.endpoint===j?.endpoint.fingerprint?L.find(n=>n.id===C?.id):null)??P,Y=F?os(F):null,te=!!(m.status==="ready"&&D?.binding&&$&&j&&i.configureAuxiliaryBinding&&!y&&F&&J(F).applicable&&(Y!=="account"||F?.account)&&(Y!=="ssh"||F?.sshCredentialId)),se=!!(m.status==="ready"&&X&&$&&i.configureAuxiliaryBinding&&!y),Z=async()=>{if(!c||f.blocked)return;const n=f.start();if(n){V(!1);try{await es({directory:l,git:i,sourceControl:h,parentRemoteName:c,onOperation:n.onOperation})}catch(E){E instanceof ts||V(!0)}finally{n.finish()}}},a=async n=>{if(n==="configure"&&!te||n==="remove"&&!se||!m.isCurrent()||!D?.binding||!$||!j||!i.configureAuxiliaryBinding)return;const E=x.current,N=Ue(),ee=()=>x.current===E&&N===Ue(),q={directory:l,expectedRepositoryId:D.repository.repositoryId,expectedRevision:D.revision,expectedConfigRevision:D.repository.configRevision,parentRemote:c,expectedParentFingerprint:$.fetch.fingerprint,kind:j.kind,path:j.path,expectedEndpointFingerprint:j.endpoint.fingerprint},ae=n==="remove"?{...q,operation:n}:F&&ss(F,q);if(!ae)return;const B=$e.captureMutation(m.scope,D);S(!0),V(!1);try{const oe=await i.configureAuxiliaryBinding(ae);$e.setMutationResult(B,oe.binding)||await $e.reconcile(B,h)}catch{ee()&&V(!0),await $e.reconcile(B,h)}finally{B.release(),ee()&&S(!1)}},u=!!(M.length&&b&&"error"in b&&b.error.code==="AUTHENTICATION_REQUIRED"),g=n=>s(n==="submodule"?"gitView.hydration.kind.submodule":"gitView.hydration.kind.lfs");return t.jsxs(ms,{open:v,onOpenChange:o,className:de("min-w-0",e),children:[t.jsxs(fs,{className:"w-auto justify-start gap-1.5",children:[t.jsx(Yt,{children:s("gitView.hydration.title")}),t.jsx(_,{name:v?"arrow-up-s":"arrow-down-s",className:"h-4 w-4 text-muted-foreground"})]}),t.jsx(hs,{children:t.jsxs(At,{description:s("gitView.hydration.description"),className:"min-w-0 pt-2",contentClassName:Tt,children:[t.jsx(Je,{label:s("gitView.hydration.parentRemote"),controlClassName:tt,children:t.jsxs(ut,{value:c,onValueChange:n=>{r(n),k(""),d(null)},disabled:!D?.binding||y||f.blocked,children:[t.jsx(mt,{className:"w-fit max-w-[28ch]","aria-label":s("gitView.hydration.parentRemote"),children:t.jsx(ft,{placeholder:s("settings.sourceControl.transport.remoteLabel")})}),t.jsx(ht,{children:D?.binding?.remotes.filter(n=>n.readiness==="ready").map(n=>t.jsx(pt,{value:n.name,children:n.name},n.name))})]})}),t.jsx(Zt,{entry:f.entry,onRefresh:()=>{f.refresh()},onCancel:()=>{f.cancel()}}),u?t.jsx("p",{className:Ke,children:s("gitView.hydration.authorizationNeeded")}):null,M.length?t.jsx(Je,{label:s("gitView.hydration.endpoint"),controlClassName:tt,children:t.jsxs(ut,{value:p,onValueChange:k,disabled:y,children:[t.jsx(mt,{className:"w-fit max-w-[28ch]","aria-label":s("gitView.hydration.endpoint"),children:t.jsx(ft,{placeholder:s("gitView.hydration.chooseEndpoint"),children:j?`${j.path} · ${g(j.kind)} · ${j.endpoint.displayUrl}`:void 0})}),t.jsx(ht,{children:M.map(n=>{const E=JSON.stringify([n.kind,n.path,n.endpoint.fingerprint]);return t.jsxs(pt,{value:E,children:[n.path," · ",g(n.kind)," · ",n.endpoint.displayUrl]},E)})})]})}):null,j?t.jsx(t.Fragment,{children:t.jsx(Je,{label:s("gitView.hydration.identity"),controlClassName:tt,children:t.jsx(St,{activeProfile:F,identities:L,onSelect:n=>d({endpoint:j.endpoint.fingerprint,id:n.id}),isApplying:y,applicability:J,triggerClassName:"w-full max-w-none border border-border",menuAlign:"start",onOpen:()=>{U(h,T.map(n=>n.account))}})})}):null,b?.hydration?.status==="client-missing"?t.jsx("p",{role:"alert",className:de(Ke,"text-[var(--status-warning)]"),children:s("gitView.hydration.lfsMissing")}):null,H?t.jsx(zt,{error:!0,children:s("settings.sourceControl.instance.status.operationFailed")}):null,t.jsxs("div",{className:Is,children:[t.jsx(ne,{size:"sm",variant:"outline",disabled:!c||f.blocked||y,onClick:()=>{Z()},children:s("gitView.hydration.retry")}),j?t.jsxs(t.Fragment,{children:[t.jsx(ne,{size:"sm",disabled:!te,onClick:()=>{a("configure")},children:s("settings.common.actions.saveChanges")}),X?t.jsx(ne,{size:"sm",variant:"ghost",disabled:!se,onClick:()=>{a("remove")},children:s("settings.common.actions.delete")}):null]}):null]})]})})]})};function Rs(l){return l.profiles}function Os(l){return l.globalIdentity}function Fs(l){return l.refreshIdentityAccounts}function Ps(l){return l.identities}function Ms(l){return l.account}const st="border-t border-edge pt-4",Qs=l=>{const e=be.c(11),{open:s,onOpenChange:i,directory:h}=l,{t:m}=ye(),f=qe(Ls),c=qe(Hs);let r;e[0]!==h||e[1]!==i||e[2]!==s||e[3]!==c||e[4]!==f||e[5]!==m?(r=s?t.jsxs(Pe,{className:"@container min-w-0 max-h-[85dvh] overflow-y-auto",children:[t.jsxs(Me,{children:[t.jsx(Le,{children:m("gitView.context.configure")}),t.jsx(He,{children:m("gitView.context.description")})]}),t.jsx(Ds,{directory:h,className:st}),t.jsx(zs,{directory:h,className:st}),t.jsxs(it,{className:st,children:[t.jsx(ne,{size:"sm",variant:"ghost",onClick:()=>{i(!1),f("git"),c(!0)},children:m("gitView.context.settings")}),t.jsx(ne,{size:"sm",variant:"outline",onClick:()=>i(!1),children:m("dialog.common.actions.close")})]})]}):null,e[0]=h,e[1]=i,e[2]=s,e[3]=c,e[4]=f,e[5]=m,e[6]=r):r=e[6];let p;return e[7]!==i||e[8]!==s||e[9]!==r?(p=t.jsx(Fe,{open:s,onOpenChange:i,children:r}),e[7]=i,e[8]=s,e[9]=r,e[10]=p):p=e[10],p};function Ls(l){return l.setSettingsPage}function Hs(l){return l.setSettingsDialogOpen}const ei=({mergeInProgress:l,rebaseInProgress:e,onContinue:s,onAbort:i,onResolveWithAI:h,conflictCount:m=0,isLoading:f=!1})=>{const{t:c}=ye(),[r,p]=w.useState(null),k=l&&l.head,C=e&&(e.headName||e.onto),d=k?"merge":C?"rebase":null;if(!d)return null;const y=async()=>{p("continue");try{await s()}finally{p(null)}},S=async()=>{p("abort");try{await i()}finally{p(null)}},H=r!==null,V=m>0,v=c(d==="merge"?"gitView.operation.merge":"gitView.operation.rebase");let o="";l?o=l.message?c("gitView.operation.mergingMessage",{message:l.message}):c("gitView.operation.mergeInProgressWithHead",{head:l.head}):e&&(o=e.headName?c("gitView.operation.rebasingOnto",{headName:e.headName,onto:e.onto||""}):c("gitView.operation.rebaseInProgress"));const x=V?m===1?c("gitView.operation.inProgressTitleOneConflict",{operation:v,count:m}):c("gitView.operation.inProgressTitleManyConflicts",{operation:v,count:m}):c("gitView.operation.inProgressTitle",{operation:v}),T=c(V?"gitView.operation.resolveConflictsHint":"gitView.operation.readyToContinueHint");return t.jsx("div",{className:"mx-4 mt-3 overflow-hidden rounded-lg bg-[var(--status-warning-background)]",children:t.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"typography-label text-[var(--status-warning)]",children:x}),o&&t.jsx("p",{className:"typography-micro break-words text-muted-foreground",children:o})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("p",{className:"typography-micro min-w-[12rem] flex-1 text-muted-foreground",children:T}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t.jsx(we,{sideOffset:8,label:c("contextTooltips.git.abortOperation"),children:t.jsxs(ne,{variant:"ghost",size:"sm",onClick:S,disabled:H||f,className:"gap-1.5",children:[r==="abort"?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"close",className:"size-4"}),c("gitView.operation.abort")]})}),V?h&&t.jsx(we,{sideOffset:8,label:c("contextTooltips.git.resolveWithAgent"),children:t.jsx(ne,{variant:"default",size:"sm",onClick:h,disabled:H||f,children:c("gitView.operation.resolveWithAi")})}):t.jsx(we,{sideOffset:8,label:c("contextTooltips.git.continueOperation"),children:t.jsxs(ne,{variant:"default",size:"sm",onClick:y,disabled:H||f,className:"gap-1.5",children:[r==="continue"?t.jsx(_,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(_,{name:"check",className:"size-4"}),c("gitView.operation.continue")]})})]})]})]})})},yt=()=>Math.floor(Math.random()*1e3);function ti(){const l=be.c(11),{t:e}=ye(),{triggerFireworks:s}=ps(),i=It();let h;l[0]!==i||l[1]!==e||l[2]!==s?(h=(p,k)=>{const{pushAfter:C,origin:d}=k,y=i?is(i,p,gt(),yt()):null;return y?xe.success(y.title,{description:y.description}):xe.success(e("gitView.toast.commitCreated")),y&&!C&&s({kind:"deletion",origin:d}),y!==null},l[0]=i,l[1]=e,l[2]=s,l[3]=h):h=l[3];const m=h;let f;l[4]!==i||l[5]!==e||l[6]!==s?(f=p=>{const{deletion:k,origin:C}=p,d=i?ns(i,new Date,gt(),yt()):null;d?xe.success(d.title,{description:d.description}):xe.success(e("gitView.publish.succeeded")),s({kind:k?"deletion":"push",origin:C})},l[4]=i,l[5]=e,l[6]=s,l[7]=f):f=l[7];const c=f;let r;return l[8]!==m||l[9]!==c?(r={committed:m,pushed:c},l[8]=m,l[9]=c,l[10]=r):r=l[10],r}function si(l){const e=be.c(4),s=It(),[i]=w.useState($s);let h;return e[0]!==s||e[1]!==l||e[2]!==i?(h=(s?as(s,i.at,i.seed):null)??l,e[0]=s,e[1]=l,e[2]=i,e[3]=h):h=e[3],h}function $s(){return{at:new Date,seed:Math.floor(Math.random()*1e3)}}export{Ws as C,Zs as D,ei as I,Qs as R,ti as a,Js as b,Ys as c,ys as d,si as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as ge,r as te,j as s,R as V}from"./vendor-react--VO_rL_p.js";import{u as le,Q as ee,T as ce,B as se,I as Z,ad as oe,ae,ac as re,aP as be,cO as ve,cP as je,ax as ye,cQ as we,cR as Se,cS as Ne,cT as De,cU as ke,cV as Te,cW as Ie,cX as Le,z as me,cY as Ee,a0 as de,aO as Re,cZ as ie,c_ as ze,c$ as Pe,d0 as ue,A as fe,d1 as _e}from"./useAppFontEffects-
|
|
1
|
+
import{f as ge,r as te,j as s,R as V}from"./vendor-react--VO_rL_p.js";import{u as le,Q as ee,T as ce,B as se,I as Z,ad as oe,ae,ac as re,aP as be,cO as ve,cP as je,ax as ye,cQ as we,cR as Se,cS as Ne,cT as De,cU as ke,cV as Te,cW as Ie,cX as Le,z as me,cY as Ee,a0 as de,aO as Re,cZ as ie,c_ as ze,c$ as Pe,d0 as ue,A as fe,d1 as _e}from"./useAppFontEffects-3RimJo4B.js";import{L as Me,O as Ae,P as Oe}from"./runtimeEndpointReset-DiTyBUwe.js";import{bg as he,aX as $e}from"./katex.min-Bs5OLoA1.js";const xe="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-interactive-hover hover:text-foreground";function qe(r){const e=ge.c(79),{draft:l,onEdit:w,onDelete:f,className:x,maxWidth:J,forAgent:Y}=r,C=Y===void 0?!1:Y,{t:n}=le(),[p,X]=te.useState(!1),S=l.text;let B;e[0]!==S?(B=S.length>150||S.split(`
|
|
2
2
|
`).length>3,e[0]=S,e[1]=B):B=e[1];const N=B;let L;e[2]!==x?(L=ee("w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden rounded-xl border border-[var(--interactive-border)] bg-[var(--surface-elevated)] shadow-none",x),e[2]=x,e[3]=L):L=e[3];const m=J?`${Math.max(200,Math.floor(J))}px`:void 0;let d;e[4]!==m?(d={maxWidth:m},e[4]=m,e[5]=d):d=e[5];let A;e[6]!==C?(A=C?s.jsx(Z,{name:"attachment-2",className:"size-3.5 shrink-0 text-muted-foreground"}):null,e[6]=C,e[7]=A):A=e[7];let o;e[8]!==l.fileLabel||e[9]!==C||e[10]!==n?(o=C?n("review.card.forAgent"):l.fileLabel,e[8]=l.fileLabel,e[9]=C,e[10]=n,e[11]=o):o=e[11];let O;e[12]!==l.fileLabel||e[13]!==o?(O=s.jsx("span",{className:"min-w-0 max-w-[200px] truncate text-xs font-medium text-foreground",title:l.fileLabel,children:o}),e[12]=l.fileLabel,e[13]=o,e[14]=O):O=e[14];let $;e[15]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"•"}),e[15]=$):$=e[15];let E;e[16]!==l?(E=ce(l)?"shrink-0":"min-w-0 truncate",e[16]=l,e[17]=E):E=e[17];let i;e[18]!==E?(i=ee("me-auto text-xs text-muted-foreground",E),e[18]=E,e[19]=i):i=e[19];let R;e[20]!==l||e[21]!==n?(R=ce(l)?n("inlineComment.range.wholeFile"):s.jsxs(s.Fragment,{children:[n("inlineComment.range.lines",{start:l.startLine,end:l.endLine}),l.side?` (${l.side})`:""]}),e[20]=l,e[21]=n,e[22]=R):R=e[22];let c;e[23]!==i||e[24]!==R?(c=s.jsx("span",{className:i,children:R}),e[23]=i,e[24]=R,e[25]=c):c=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F={minHeight:0,minWidth:0},e[26]=F):F=e[26];let v;e[27]!==n?(v=n("inlineComment.actions.editComment"),e[27]=n,e[28]=v):v=e[28];let z;e[29]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Z,{name:"pencil",className:"h-3 w-3"}),e[29]=z):z=e[29];let h;e[30]!==w||e[31]!==v?(h=s.jsx(oe,{asChild:!0,children:s.jsx("button",{type:"button",className:xe,style:F,onClick:w,"aria-label":v,children:z})}),e[30]=w,e[31]=v,e[32]=h):h=e[32];let P;e[33]!==n?(P=n("inlineComment.actions.editComment"),e[33]=n,e[34]=P):P=e[34];let K;e[35]!==P?(K=s.jsx(ae,{side:"top",sideOffset:6,children:P}),e[35]=P,e[36]=K):K=e[36];let D;e[37]!==h||e[38]!==K?(D=s.jsxs(re,{children:[h,K]}),e[37]=h,e[38]=K,e[39]=D):D=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k={minHeight:0,minWidth:0},e[40]=k):k=e[40];let j;e[41]!==n?(j=n("inlineComment.actions.deleteComment"),e[41]=n,e[42]=j):j=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Z,{name:"close",className:"h-3 w-3"}),e[43]=q):q=e[43];let _;e[44]!==f||e[45]!==j?(_=s.jsx(oe,{asChild:!0,children:s.jsx("button",{type:"button",className:xe,style:k,onClick:f,"aria-label":j,children:q})}),e[44]=f,e[45]=j,e[46]=_):_=e[46];let y;e[47]!==n?(y=n("inlineComment.actions.deleteComment"),e[47]=n,e[48]=y):y=e[48];let T;e[49]!==y?(T=s.jsx(ae,{side:"top",sideOffset:6,children:y}),e[49]=y,e[50]=T):T=e[50];let H;e[51]!==_||e[52]!==T?(H=s.jsxs(re,{children:[_,T]}),e[51]=_,e[52]=T,e[53]=H):H=e[53];let I;e[54]!==c||e[55]!==D||e[56]!==H||e[57]!==A||e[58]!==O?(I=s.jsxs("div",{className:"flex items-center gap-1.5 px-3 pt-2",children:[A,O,$,c,D,H]}),e[54]=c,e[55]=D,e[56]=H,e[57]=A,e[58]=O,e[59]=I):I=e[59];const U=p||!N,Q=!p&&N&&"line-clamp-3";let a;e[60]!==Q?(a=ee("whitespace-pre-wrap break-words text-sm leading-relaxed text-foreground",Q),e[60]=Q,e[61]=a):a=e[61];let u;e[62]!==S||e[63]!==a?(u=s.jsx("div",{className:a,children:S}),e[62]=S,e[63]=a,e[64]=u):u=e[64];let b;e[65]!==N||e[66]!==p||e[67]!==n?(b=N&&s.jsx(Me,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"sm",className:"mt-1 h-6 w-full justify-start px-0 text-xs text-muted-foreground hover:text-foreground",children:p?s.jsxs(s.Fragment,{children:[s.jsx(Z,{name:"arrow-up-s",className:"me-1 size-3"}),n("inlineComment.actions.showLess")]}):s.jsxs(s.Fragment,{children:[s.jsx(Z,{name:"arrow-down-s",className:"me-1 size-3"}),n("inlineComment.actions.showMore")]})})}),e[65]=N,e[66]=p,e[67]=n,e[68]=b):b=e[68];let G;e[69]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Ae,{}),e[69]=G):G=e[69];let W;e[70]!==U||e[71]!==u||e[72]!==b?(W=s.jsx("div",{className:"px-3 pb-2 pt-1",children:s.jsxs(Oe,{open:U,onOpenChange:X,children:[u,b,G]})}),e[70]=U,e[71]=u,e[72]=b,e[73]=W):W=e[73];let t;return e[74]!==I||e[75]!==L||e[76]!==W||e[77]!==d?(t=s.jsxs("div",{className:L,style:d,"data-comment-card":"true",children:[I,W]}),e[74]=I,e[75]=L,e[76]=W,e[77]=d,e[78]=t):t=e[78],t}const Fe=120,Ke=r=>r.split("/").pop()||r;function Ze({initialText:r="",onTextChange:e,onSave:l,onCancel:w,fileLabel:f,lineRange:x,isEditing:J=!1,className:Y,maxWidth:C,bandColor:n,floating:p=!1,band:X=!0,wholeFile:S=!1,saveLabel:B,saving:N=!1,review:L}){const{t:m}=le(),{isMobile:d}=be(),A=ve(je(),"diff"),[o,O]=V.useState(r),[$,E]=V.useState(!1),i=te.useRef(null),R=ye("enter"),c=()=>{const t=i.current;t&&(t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,Fe)}px`)},F=t=>{O(t),e?.(t)};V.useLayoutEffect(c,[o]);const v=te.useRef(x);te.useEffect(()=>{x&&(v.current=x)},[x]);const z=t=>{if(!t)return;const g=Math.min(t.start,t.end),M=Math.max(t.start,t.end);return{...t,start:g,end:M}},h=z(x),P=S?m("inlineComment.range.wholeFile"):h?h.start===h.end?m("review.range.line",{line:h.start}):m("inlineComment.range.lines",{start:h.start,end:h.end}):null,K=[f,h?m("inlineComment.range.lines",{start:h.start,end:h.end}):null].filter(Boolean).join(" • ")||m("inlineComment.actions.comment");te.useEffect(()=>{const t=i.current;if(!t)return;t.focus({preventScroll:!0});const g=t.value.length;t.setSelectionRange(g,g),d&&t.scrollIntoView({behavior:"auto",block:"nearest"})},[d]);const D=we(),k=te.useRef(null);V.useLayoutEffect(()=>{const t=k.current;t!==null&&(k.current=null,i.current?.setSelectionRange(t,t))},[o]);const j=(t,g,M)=>{const ne=i.current?.value??o;k.current=t+M.length,F(`${ne.slice(0,t)}${M}${ne.slice(g)}`),i.current?.focus()},q=V.useCallback(()=>i.current?.selectionStart??0,[]),_=V.useCallback(t=>i.current?Se(i.current,t):null,[]),y=Ne({text:o,getCaret:q,replaceRange:j,caretCoords:_}),T=De(),H=t=>{const g=t.currentTarget,M=D.takePastedImages(t.clipboardData,g.value,{start:g.selectionStart,end:g.selectionEnd});M&&(t.preventDefault(),j(M.from,M.to,M.insertion))},I=()=>{if(o.trim()&&!N){if(l(o,z(v.current))===!1)return;D.attachCitedImages(o)}},U=t=>{Ee(t)||y.handleKeyDown(t)||(t.key==="Enter"&&T.shouldSubmit(t)?(t.preventDefault(),I()):t.key==="Escape"&&(t.preventDefault(),w()))},Q=async()=>{if(!(!L||!o.trim()||$)){E(!0);try{await L.add(o,z(v.current))}finally{E(!1)}}},a=L?.suggestionCode,u=()=>{if(!a)return;const t=i.current,g=t?.selectionStart??o.length,M=t?.selectionEnd??o.length,ne=g>0&&o[g-1]!==`
|
|
3
3
|
`?`
|
|
4
4
|
`:"";j(g,M,`${ne}\`\`\`suggestion
|
package/dist/assets/{useMarkdownLocalAssets-wPn7MXUN.js → useMarkdownLocalAssets-CH5Ekvbl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k,R as y,f as R}from"./vendor-react--VO_rL_p.js";import{bm as C}from"./useAppFontEffects-
|
|
1
|
+
import{a as k,R as y,f as R}from"./vendor-react--VO_rL_p.js";import{bm as C}from"./useAppFontEffects-3RimJo4B.js";const d="data-oc-block-index",g="data-oc-block-key",A=s=>{const e=s.ownerDocument.defaultView;for(let t=s.parentElement;t&&e;t=t.parentElement)if(/auto|scroll/.test(e.getComputedStyle(t).overflowY))return t;return null},b=(s,e)=>{if(!s)return 0;const t=Number.parseFloat(s.ownerDocument.defaultView?.getComputedStyle(s)[e]??"");return Number.isFinite(t)?t:0},L=s=>Array.from(s.querySelectorAll("video, audio")).some(e=>e instanceof HTMLMediaElement&&!e.paused),O=(s,e)=>{let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)|0;return`${s}:${e.length}:${t>>>0}`},p=new WeakMap,E=24;class D{container=null;scroller=null;attached=!1;near=new Set;pins=new Map;holds=0;selecting=!1;selectionRelease=null;sizes=new Map;kept=new Set;listeners=new Set;stop=null;frame=null;charsPerLine=80;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});isRendered(e){return this.attached?!this.scroller||this.holds>0||this.near.has(e)||this.pins.has(e):e<E}size(e){return this.sizes.get(e)}attach(e){this.detach(),this.container=e,this.scroller=A(e),this.attached=!0,p.set(e,this);const t=this.scroller;if(!t){this.notify();return}const n=e.ownerDocument,o=n.defaultView,r=()=>this.update(),c=()=>{this.frame!==null||!o||(this.frame=o.requestAnimationFrame(()=>{this.frame=null,this.update()}))},l=globalThis.ResizeObserver?new ResizeObserver(()=>{this.charsPerLine=Math.max(20,Math.round(e.clientWidth/7.5)),this.update(),c()}):null;l?.observe(t),l?.observe(e),this.charsPerLine=Math.max(20,Math.round(e.clientWidth/7.5)),c();const u=()=>{const a=n.getSelection(),h=a&&!a.isCollapsed&&a.rangeCount>0?a.getRangeAt(0):null,i=!!(h&&(e.contains(h.commonAncestorContainer)||h.intersectsNode(e)));h&&i&&!this.selectionRelease&&this.spansUnmounted(h)?this.selectionRelease=this.hold(void 0):!i&&this.selectionRelease&&(this.selectionRelease(),this.selectionRelease=null),i!==this.selecting&&(this.selecting=i,i||this.update())},f=a=>{if(!(a.target instanceof Element)||!a.target.closest("summary"))return;const h=a.target.closest(`[${d}]`)?.getAttribute(g);h&&this.kept.add(h)};t.addEventListener("scroll",r,{passive:!0}),e.addEventListener("click",f,!0),n.addEventListener("selectionchange",u),this.stop=()=>{this.frame!==null&&o?.cancelAnimationFrame(this.frame),this.frame=null,l?.disconnect(),t.removeEventListener("scroll",r),e.removeEventListener("click",f,!0),n.removeEventListener("selectionchange",u)}}detach(){this.stop?.(),this.stop=null,this.container&&p.delete(this.container),this.container=null,this.scroller=null;const e=this.selectionRelease;this.selectionRelease=null,this.selecting=!1,e?.()}hold(e,t=!1){e===void 0?this.holds+=1:this.pins.set(e,(this.pins.get(e)??0)+1),this.notify(t);let n=!1;return()=>{if(!n){if(n=!0,e===void 0)this.holds-=1;else{const o=(this.pins.get(e)??1)-1;o>0?this.pins.set(e,o):this.pins.delete(e)}this.update(),this.notify()}}}update(){const e=this.container,t=this.scroller,n=e?.querySelector("[data-oc-streamdown]");if(!e||!t||!n)return;const o=Array.from(n.children).filter(i=>i instanceof HTMLElement&&i.hasAttribute(d)),r=t.getBoundingClientRect();if(r.height===0)return;const c=r.top-r.height,l=r.bottom+r.height;let u=0,f=o.length;for(;u<f;){const i=u+f>>1;o[i].getBoundingClientRect().bottom<c?u=i+1:f=i}const a=new Set;for(let i=u;i<o.length&&!(o[i].getBoundingClientRect().top>l);i+=1)a.add(Number(o[i].getAttribute(d)));if(this.selecting)for(const i of this.near)a.add(i);if(this.holds===0)for(const i of o){const m=Number(i.getAttribute(d));a.has(m)||this.pins.has(m)||(this.isLive(i)?a.add(m):this.measure(i))}const h=a.size!==this.near.size||[...a].some(i=>!this.near.has(i));this.near=a,h&&this.notify()}isLive(e){if(e.hasAttribute("data-oc-block-placeholder"))return!1;const t=e.getAttribute(g);return t!==null&&this.kept.has(t)||L(e)}spansUnmounted(e){const t=r=>{const l=(r instanceof Element?r:r.parentElement)?.closest(`[${d}]`);return l&&this.container?.contains(l)?Number(l.getAttribute(d)):null},n=t(e.startContainer),o=t(e.endContainer);if(n===null||o===null)return!!this.container?.querySelector("[data-oc-block-placeholder]");for(let r=n;r<=o;r+=1)if(!this.isRendered(r))return!0;return!1}measure(e){const t=e.getAttribute(g);!t||e.hasAttribute("data-oc-block-placeholder")||this.sizes.set(t,{height:e.getBoundingClientRect().height,start:b(e.firstElementChild,"marginBlockStart"),end:b(e.lastElementChild,"marginBlockEnd")})}notify(e=!1){const t=()=>{for(const n of this.listeners)n()};e?k.flushSync(t):t()}}const M=(s,e={})=>{const t=s.closest("[data-markdown-content]")??s.querySelector("[data-markdown-content]"),n=t?p.get(t):void 0;if(!n)return()=>{};const o=e.block?.getAttribute(d);return n.hold(o==null?void 0:Number(o),e.sync)},N=y.createContext(null),S=s=>!!s.trim()&&!s.startsWith("#")&&!s.startsWith("//")&&!/^[a-z][a-z\d+.-]*:/i.test(s),w=s=>{try{return decodeURIComponent(s)}catch{return s}},v=(s,e)=>C(s.slice(0,s.lastIndexOf("/")+1)||"/",w(e.split(/[?#]/,1)[0]??"")),x=(s,e)=>{if(!e||s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey)return!1;const t=s.currentTarget.getAttribute("href")??"";if(t.startsWith("#")){s.preventDefault(),s.stopPropagation();const n=w(t.slice(1)).toLowerCase(),o=s.currentTarget.closest("[data-markdown-content]"),r=o?M(o,{sync:!0}):null;for(const c of o?.querySelectorAll("h1,h2,h3,h4,h5,h6")??[]){const l=(c.textContent??"").trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").replace(/\s+/g,"-");if(n&&(c.id===n||l===n)){c.scrollIntoView({block:"start"});break}}return r?.(),!0}return S(t)?(s.preventDefault(),s.stopPropagation(),e.onOpenFile(v(e.filePath,t)),!0):!1},K=s=>{const e=R.c(6),{filePath:t,workspaceRoot:n,onOpenFile:o,enabled:r,colorScheme:c}=s;let l;return e[0]!==c||e[1]!==r||e[2]!==t||e[3]!==o||e[4]!==n?(l=r&&t?{filePath:t,workspaceRoot:n,onOpenFile:o,colorScheme:c}:void 0,e[0]=c,e[1]=r,e[2]=t,e[3]=o,e[4]=n,e[5]=l):l=e[5],l};export{g as B,N as M,d as a,O as b,D as c,M as h,S as i,x as o,v as r,K as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useAppFontEffects-
|
|
2
|
-
import{f as T,R,r as ge,j as i}from"./vendor-react--VO_rL_p.js";import{u as O,bJ as we,bK as xe,bL as be,bx as $,bM as Se,bN as ee,bO as ve,bt as ae,aZ as _e,aX as te}from"./katex.min-g52ii4Gs.js";import{u as J,Q as G,I as A,a5 as ye,a6 as je,a4 as Ne,a0 as q,gg as Ce,gh as Ee,n as Ie,gi as ke,gj as Le,aw as De,gk as Re,cK as ze,cH as Ae,bb as Fe,x as ne,gl as se,gm as Te,gn as Pe,go as $e,gp as Oe,eF as Ge,gq as Me,Y as le,gr as He}from"./useAppFontEffects-D9nf8G19.js";import{M as ce}from"./vendor-base-ui-CqKCZJyd.js";import{o as oe,a as We,f as Ve,s as Be}from"./vendor-zod--raI7LhK.js";import{_ as de}from"./vendor-vite-runtime-DD1OZmLC.js";function Tt(){const n=T.c(5),e=O(Ue);let t;n[0]===Symbol.for("react.memo_cache_sentinel")?(t=we(),n[0]=t):t=n[0];const a=t;let s;n[1]!==e?(s=xe(e),n[1]=e,n[2]=s):s=n[2];const r=s;let o;return n[3]!==r?(o={usesFramelessChrome:a,side:r},n[3]=r,n[4]=o):o=n[4],o}function Ue(n){return n.desktopWindowControlsPosition}const Ze={close:"#FF5F57",minimize:"#FEBC2E",maximize:"#28C940"},Ye="rgba(0, 0, 0, 0.7)",qe=n=>{const e=T.c(3),{action:t}=n;if(t==="close"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(A,{name:"close",className:"size-[10px]"}),e[0]=s):s=e[0],s}if(t==="minimize"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(A,{name:"subtract",className:"size-[10px]"}),e[1]=s):s=e[1],s}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(A,{name:"add",className:"size-[10px]"}),e[2]=a):a=e[2],a},Ke=n=>{const e=T.c(18),{action:t,isMaximized:a,onActivate:s}=n,{t:r}=J(),o=Ze[t];let c;e[0]!==t||e[1]!==a||e[2]!==r?(c=r(t==="close"?"header.windowControls.close":t==="minimize"?"header.windowControls.minimize":a?"header.windowControls.restore":"header.windowControls.maximize"),e[0]=t,e[1]=a,e[2]=r,e[3]=c):c=e[3];const u=c;let d;e[4]!==t||e[5]!==s?(d=()=>s(t),e[4]=t,e[5]=s,e[6]=d):d=e[6];let l;e[7]!==o?(l={backgroundColor:o,color:Ye},e[7]=o,e[8]=l):l=e[8];let m;e[9]!==t?(m=i.jsx("span",{className:"flex items-center justify-center opacity-0 transition-opacity duration-75 group-hover/wctl:opacity-100",children:i.jsx(qe,{action:t})}),e[9]=t,e[10]=m):m=e[10];let h;e[11]!==l||e[12]!==m?(h=i.jsx("span",{className:"flex size-3.5 items-center justify-center rounded-full shadow-[inset_0_0_0_0.5px_rgba(0,0,0,0.28)] transition-[filter] duration-75 active:brightness-90",style:l,children:m}),e[11]=l,e[12]=m,e[13]=h):h=e[13];let p;return e[14]!==u||e[15]!==d||e[16]!==h?(p=i.jsx("button",{type:"button",onClick:d,title:u,"aria-label":u,className:"app-region-no-drag flex h-8 w-[24px] items-center justify-center rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:h}),e[14]=u,e[15]=d,e[16]=h,e[17]=p):p=e[17],p},Pt=R.memo(function(e){const t=T.c(27),{visible:a,position:s}=e,r=s===void 0?"right":s,{t:o}=J(),[c,u]=R.useState(!1),d=O(Je);let l,m;if(t[0]!==a?(l=()=>{if(!a)return;let N=!1;$("desktop_get_current_window_state").then(_=>{N||u(!!_?.maximized)}).catch(Qe);const C=_=>{const y=_.detail;u(!!y?.maximized)};return window.addEventListener("openchamber:window-maximized-changed",C),()=>{N=!0,window.removeEventListener("openchamber:window-maximized-changed",C)}},m=[a],t[0]=a,t[1]=l,t[2]=m):(l=t[1],m=t[2]),ge.useEffect(l,m),!a)return null;const h=r==="left";let p,f,g,w,S;if(t[3]!==d||t[4]!==h||t[5]!==c||t[6]!==r||t[7]!==o){S=Symbol.for("react.early_return_sentinel");e:{const N=be(r);let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=x=>{if(x==="close"){$("desktop_close_current_window");return}if(x==="minimize"){$("desktop_minimize_current_window");return}$("desktop_toggle_current_window_maximized").then(v=>u(!!v?.maximized)).catch(Xe)},t[13]=C):C=t[13];const _=C;if(d==="traffic-lights"){const x=h?"me-1":"ms-1 me-3";let v;t[14]!==x?(v=G("app-region-no-drag group/wctl flex h-8 shrink-0 items-center",x),t[14]=x,t[15]=v):v=t[15];let E;t[16]!==o?(E=o("header.windowControls.groupAria"),t[16]=o,t[17]=E):E=t[17];let I;t[18]!==c?(I=F=>i.jsx(Ke,{action:F,isMaximized:c,onActivate:_},F),t[18]=c,t[19]=I):I=t[19],S=i.jsx("div",{dir:"ltr",className:v,"aria-label":E,children:N.map(I)});break e}const y=G("app-region-no-drag inline-flex items-center justify-center text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h?"h-8 w-8 rounded-md":"h-12 w-11"),L=h?"app-region-no-drag me-1 flex h-8 shrink-0 items-center":"app-region-no-drag ms-1 flex h-12 shrink-0 items-center",D=x=>x==="minimize"?i.jsx("button",{type:"button",className:y,onClick:et,title:o("header.windowControls.minimize"),"aria-label":o("header.windowControls.minimize"),children:i.jsx(A,{name:"subtract",className:"h-4 w-4"})},"minimize"):x==="maximize"?i.jsx("button",{type:"button",className:y,onClick:()=>{$("desktop_toggle_current_window_maximized").then(v=>u(!!v?.maximized)).catch(tt)},title:o(c?"header.windowControls.restore":"header.windowControls.maximize"),"aria-label":o(c?"header.windowControls.restore":"header.windowControls.maximize"),children:i.jsx(A,{name:c?"fullscreen-exit":"checkbox-blank",className:"h-3.5 w-3.5"})},"maximize"):i.jsx("button",{type:"button",className:G(y,"hover:bg-[var(--status-error)] hover:text-[var(--status-error-foreground)]"),onClick:nt,title:o("header.windowControls.close"),"aria-label":o("header.windowControls.close"),children:i.jsx(A,{name:"close",className:"h-4 w-4"})},"close");p="ltr",f=L,t[20]!==o?(g=o("header.windowControls.groupAria"),t[20]=o,t[21]=g):g=t[21],w=N.map(D)}t[3]=d,t[4]=h,t[5]=c,t[6]=r,t[7]=o,t[8]=p,t[9]=f,t[10]=g,t[11]=w,t[12]=S}else p=t[8],f=t[9],g=t[10],w=t[11],S=t[12];if(S!==Symbol.for("react.early_return_sentinel"))return S;let b;return t[22]!==p||t[23]!==f||t[24]!==g||t[25]!==w?(b=i.jsx("div",{dir:p,className:f,"aria-label":g,children:w}),t[22]=p,t[23]=f,t[24]=g,t[25]=w,t[26]=b):b=t[26],b});function Je(n){return n.desktopWindowControlsStyle}function Qe(){}function Xe(){}function et(){$("desktop_minimize_current_window")}function tt(){}function nt(){$("desktop_close_current_window")}const X="new-session";function $t(n){const e=T.c(18),{children:t,variant:a,scopeProjectId:s,align:r}=n,o=a===void 0?"default":a,c=s===void 0?null:s,u=r===void 0?"start":r,d=O(ot),l=O(st);let m;e[0]!==t?(m=i.jsx(ye,{asChild:!0,children:t}),e[0]=t,e[1]=m):m=e[1];const h=o==="compact"?"w-[280px]":"w-[360px]";let p;e[2]!==h?(p=G("overflow-hidden p-1 max-w-[calc(100vw-32px)]",h),e[2]=h,e[3]=p):p=e[3];let f;e[4]!==d||e[5]!==c||e[6]!==l||e[7]!==o?(f=d?i.jsx(it,{onSelect:()=>l(!1),variant:o,scopeProjectId:c}):null,e[4]=d,e[5]=c,e[6]=l,e[7]=o,e[8]=f):f=e[8];let g;e[9]!==u||e[10]!==p||e[11]!==f?(g=i.jsx(je,{align:u,sideOffset:6,className:p,children:f}),e[9]=u,e[10]=p,e[11]=f,e[12]=g):g=e[12];let w;return e[13]!==d||e[14]!==l||e[15]!==m||e[16]!==g?(w=i.jsxs(Ne,{open:d,onOpenChange:l,modal:!1,disableGlobalShortcuts:!0,children:[m,g]}),e[13]=d,e[14]=l,e[15]=m,e[16]=g,e[17]=w):w=e[17],w}function st(n){return n.setSessionDropdownOpen}function ot(n){return n.isSessionDropdownOpen}function it(n){const e=T.c(31),{onSelect:t,variant:a,scopeProjectId:s}=n,r=q(lt),o=q(at);let c;e[0]!==r||e[1]!==s?(c={scopeProjectId:s,currentSessionId:r},e[0]=r,e[1]=s,e[2]=c):c=e[2];const u=Ce(!0,c),d=q(rt),{t:l}=J();let m;e[3]!==t||e[4]!==d?(m=()=>{t(),d()},e[3]=t,e[4]=d,e[5]=m):m=e[5];const h=m;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=new Set,e[6]=p):p=e[6];const[f,g]=R.useState(p),w=R.useRef(null),S=R.useRef(!1),b=o?X:r;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=j=>{g(Y=>{const k=new Set(Y);return k.has(j)?k.delete(j):k.add(j),k})},e[7]=N):N=e[7];const C=N;let _,y;e[8]!==f||e[9]!==b||e[10]!==u?(_=()=>{if(S.current||!b)return;const j=b===X?[]:Ee(u,b);if(!j)return;if(j.some(k=>!f.has(k))){g(k=>new Set([...k,...j]));return}const Y=requestAnimationFrame(()=>{const k=Array.from(w.current?.querySelectorAll("[data-switcher-item-id]")??[]).find(P=>P.dataset.switcherItemId===b);k&&(k.focus(),k.scrollIntoView({block:"nearest"}),S.current=!0)});return()=>cancelAnimationFrame(Y)},y=[f,b,u],e[8]=f,e[9]=b,e[10]=u,e[11]=_,e[12]=y):(_=e[11],y=e[12]),R.useLayoutEffect(_,y);let L,D;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=G("group relative flex w-full cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover"),D=i.jsx(A,{name:"chat-new",className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),e[13]=L,e[14]=D):(L=e[13],D=e[14]);let x;e[15]!==l?(x=l("sessions.sidebar.header.actions.newSession"),e[15]=l,e[16]=x):x=e[16];let v;e[17]!==x?(v=i.jsx("span",{className:"truncate typography-ui-label font-normal leading-tight text-foreground",children:x}),e[17]=x,e[18]=v):v=e[18];let E;e[19]!==h||e[20]!==v?(E=i.jsxs(ce,{"data-switcher-item-id":X,onClick:h,className:L,children:[D,v]}),e[19]=h,e[20]=v,e[21]=E):E=e[21];let I;e[22]!==f||e[23]!==u||e[24]!==t||e[25]!==l||e[26]!==a?(I=u.length===0?i.jsx("div",{className:"px-3 py-4 text-center typography-meta text-muted-foreground",children:l("sessions.switcher.empty")}):u.map(j=>i.jsx(ue,{item:j,depth:0,variant:a,expandedParents:f,toggleParent:C,closeDropdown:t},j.node.session.id)),e[22]=f,e[23]=u,e[24]=t,e[25]=l,e[26]=a,e[27]=I):I=e[27];let F;return e[28]!==E||e[29]!==I?(F=i.jsx(Ie,{ref:w,outerClassName:"max-h-[60vh]",disableHorizontal:!0,children:i.jsxs("div",{className:"space-y-0.5",children:[E,I]})}),e[28]=E,e[29]=I,e[30]=F):F=e[30],F}function rt(n){return n.openNewSessionDraft}function at(n){return n.newSessionDraft.open===!0}function lt(n){return n.currentSessionId}function ue(n){const e=T.c(31),{item:t,depth:a,variant:s,expandedParents:r,toggleParent:o,closeDropdown:c}=n,{node:u,secondaryMeta:d}=t,l=u.session,m=u.children.length>0;let h;e[0]!==r||e[1]!==l.id?(h=r.has(l.id),e[0]=r,e[1]=l.id,e[2]=h):h=e[2];const p=h;let f;e[3]!==m||e[4]!==l.id||e[5]!==o?(f=m?()=>o(l.id):void 0,e[3]=m,e[4]=l.id,e[5]=o,e[6]=f):f=e[6];let g;e[7]!==c||e[8]!==a||e[9]!==m||e[10]!==p||e[11]!==d||e[12]!==l||e[13]!==f||e[14]!==s?(g=i.jsx(ct,{session:l,depth:a,variant:s,secondaryMeta:d,hasChildren:m,isExpanded:p,onToggleExpand:f,closeDropdown:c}),e[7]=c,e[8]=a,e[9]=m,e[10]=p,e[11]=d,e[12]=l,e[13]=f,e[14]=s,e[15]=g):g=e[15];let w;e[16]!==c||e[17]!==a||e[18]!==r||e[19]!==m||e[20]!==p||e[21]!==t.groupDirectory||e[22]!==t.projectId||e[23]!==u.children||e[24]!==d||e[25]!==o||e[26]!==s?(w=m&&p?u.children.map(b=>i.jsx(ue,{item:{node:b,projectId:t.projectId,groupDirectory:t.groupDirectory,secondaryMeta:d},depth:a+1,variant:s,expandedParents:r,toggleParent:o,closeDropdown:c},b.session.id)):null,e[16]=c,e[17]=a,e[18]=r,e[19]=m,e[20]=p,e[21]=t.groupDirectory,e[22]=t.projectId,e[23]=u.children,e[24]=d,e[25]=o,e[26]=s,e[27]=w):w=e[27];let S;return e[28]!==g||e[29]!==w?(S=i.jsxs(i.Fragment,{children:[g,w]}),e[28]=g,e[29]=w,e[30]=S):S=e[30],S}function ct(n){const e=T.c(55),{session:t,depth:a,variant:s,secondaryMeta:r,hasChildren:o,isExpanded:c,onToggleExpand:u,closeDropdown:d}=n,{t:l}=J(),m=q(ut),h=q(dt),p=ke(t.id),f=m===t.id;let g;e[0]!==t.title||e[1]!==l?(g=t.title?.trim()||l("sessions.sidebar.session.untitled"),e[0]=t.title,e[1]=l,e[2]=g):g=e[2];const w=g,S=Le(t.id),b=S!==null,N=De(b),C=!b&&p&&!f;let _;if(e[3]!==t){const z=Re(t)||Date.now();_=ze(z),e[3]=t,e[4]=_}else _=e[4];const y=_;let L;e[5]!==r?.projectLabel?(L=r?.projectLabel?.trim()||null,e[5]=r?.projectLabel,e[6]=L):L=e[6];const D=L;let x;e[7]!==r?.branchLabel?(x=r?.branchLabel?.trim()||null,e[7]=r?.branchLabel,e[8]=x):x=e[8];const v=x,E=v&&v!=="HEAD"?v:null;let I;e[9]!==d||e[10]!==f||e[11]!==t||e[12]!==h?(I=()=>{if(f){d();return}const z=Fe(t);h(t.id,z??null),d()},e[9]=d,e[10]=f,e[11]=t,e[12]=h,e[13]=I):I=e[13];const F=I;let j;e[14]!==F?(j=z=>{if(z.target?.closest("[data-switcher-expand]")){z.preventDefault();return}F()},e[14]=F,e[15]=j):j=e[15];const Y=t.id,k=f&&"bg-interactive-selection text-interactive-selection-foreground hover:bg-interactive-selection data-[highlighted]:bg-interactive-selection";let P;e[16]!==k?(P=G("group relative flex w-full cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover",k),e[16]=k,e[17]=P):P=e[17];const Q=8+a*12;let M;e[18]!==Q?(M={paddingInlineStart:Q},e[18]=Q,e[19]=M):M=e[19];let H;e[20]!==o||e[21]!==c||e[22]!==u||e[23]!==l||e[24]!==s?(H=s==="compact"&&o?i.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:z=>{z.preventDefault(),z.stopPropagation(),u?.()},className:"inline-flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(c?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:c?i.jsx(A,{name:"arrow-down-s",className:"h-3.5 w-3.5"}):i.jsx(A,{name:"arrow-right-s",className:"h-3.5 w-3.5"})}):null,e[20]=o,e[21]=c,e[22]=u,e[23]=l,e[24]=s,e[25]=H):H=e[25];let W;e[26]!==w?(W=i.jsx("span",{dir:"auto",className:"truncate oc-ui-start-align typography-ui-label font-normal leading-tight text-foreground",children:w}),e[26]=w,e[27]=W):W=e[27];let V;e[28]!==H||e[29]!==W?(V=i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[H,W]}),e[28]=H,e[29]=W,e[30]=V):V=e[30];let B;e[31]!==E||e[32]!==o||e[33]!==c||e[34]!==u||e[35]!==D||e[36]!==l||e[37]!==y||e[38]!==s?(B=s==="default"?i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 truncate text-muted-foreground leading-tight",style:{fontSize:"calc(var(--text-ui-label) * 0.85)"},children:[o?i.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:z=>{z.preventDefault(),z.stopPropagation(),u?.()},className:"inline-flex h-3 w-3 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(c?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:c?i.jsx(A,{name:"arrow-down-s",className:"h-3 w-3"}):i.jsx(A,{name:"arrow-right-s",className:"h-3 w-3"})}):null,i.jsx("span",{className:"flex-shrink-0",children:y}),D?i.jsx("span",{className:"truncate",children:D}):null,E?i.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[i.jsx(A,{name:"git-branch",className:"h-3 w-3 flex-shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:E})]}):null]}):null,e[31]=E,e[32]=o,e[33]=c,e[34]=u,e[35]=D,e[36]=l,e[37]=y,e[38]=s,e[39]=B):B=e[39];let U;e[40]!==V||e[41]!==B?(U=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[V,B]}),e[40]=V,e[41]=B,e[42]=U):U=e[42];let Z;e[43]!==b||e[44]!==N||e[45]!==C||e[46]!==S?(Z=b||C?i.jsx("span",{className:"flex h-3 w-3 flex-shrink-0 items-center justify-center self-center",children:i.jsx(Ae,{state:S??"unread",runningClassName:G("h-2 w-2",N)})}):null,e[43]=b,e[44]=N,e[45]=C,e[46]=S,e[47]=Z):Z=e[47];let K;return e[48]!==t.id||e[49]!==M||e[50]!==U||e[51]!==Z||e[52]!==j||e[53]!==P?(K=i.jsxs(ce,{onClick:j,"data-slot":"session-switcher-item","data-switcher-item-id":Y,className:P,style:M,children:[U,Z]}),e[48]=t.id,e[49]=M,e[50]=U,e[51]=Z,e[52]=j,e[53]=P,e[54]=K):K=e[54],K}function dt(n){return n.setCurrentSession}function ut(n){return n.currentSessionId}const Ot=n=>!Number.isFinite(n)||n<=0?new Intl.NumberFormat(ne(),{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(0):new Intl.NumberFormat(ne(),{style:"currency",currency:"USD",minimumFractionDigits:n<.01?4:2,maximumFractionDigits:n<.01?4:2}).format(n),mt="ui-store",ft=oe({state:oe({contextSurfaceZones:We(Be(),Ve())})}),pt=n=>{if(!n)return null;let e;try{e=JSON.parse(n)}catch{return null}const t=ft.safeParse(e);return t.success?ve.parse(t.data.state.contextSurfaceZones):null},Gt=()=>{const n=e=>{if(e.key!==mt)return;const t=pt(e.newValue);if(!t)return;const a=O.getState().contextSurfaceZones,s=new Set([...Object.keys(a),...Object.keys(t)].filter(Se));for(const r of s){const o=ee(t,r);o!==ee(O.getState().contextSurfaceZones,r)&&O.getState().moveContextSurfaceToZone(r,o)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)},ht=R.lazy(()=>de(()=>import("./useAppFontEffects-D9nf8G19.js").then(n=>n.ta),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(n=>({default:n.GuestAttachDialog}))),me=R.lazy(()=>de(()=>import("./useAppFontEffects-D9nf8G19.js").then(n=>n.t9),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(n=>({default:n.PluginPane}))),Mt=()=>{const n=T.c(11),e=se(gt),t=se(wt),a=Te(xt),s=Pe(bt);let r;n[0]!==s?(r=s.map(St),n[0]=s,n[1]=r):r=n[1];let o;n[2]!==t||n[3]!==e?(o=e?i.jsx(R.Suspense,{fallback:null,children:i.jsx(ht,{guestId:e.guestId,item:e.item,onOpenChange:d=>{d||t()}})}):null,n[2]=t,n[3]=e,n[4]=o):o=n[4];let c;n[5]!==a?(c=a?i.jsx("div",{"aria-hidden":"true",className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:i.jsx(R.Suspense,{fallback:null,children:i.jsx(me,{mode:ae(a),surface:"panel",headless:!0})})}):null,n[5]=a,n[6]=c):c=n[6];let u;return n[7]!==r||n[8]!==o||n[9]!==c?(u=i.jsxs(i.Fragment,{children:[r,o,c]}),n[7]=r,n[8]=o,n[9]=c,n[10]=u):u=n[10],u};function gt(n){return n.request}function wt(n){return n.close}function xt(n){return n.guestId}function bt(n){return n.requests}function St(n){return i.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:i.jsx(R.Suspense,{fallback:null,children:i.jsx(me,{mode:ae(n.guestId),surface:"background",headless:!0,backgroundAction:n})})},n.id)}const ie=45e3,re=10*6e4,vt=[1e3,2e3,4e3],fe={isHidden:()=>!1,onVisible:()=>()=>{}},_t=()=>()=>{},yt=()=>typeof document>"u"?fe:{isHidden:()=>document.visibilityState==="hidden",onVisible:n=>{let e=document.visibilityState==="hidden";const t=()=>{const s=document.visibilityState==="hidden";e&&!s&&n(),e=s},a=()=>{e&&document.visibilityState!=="hidden"&&t()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",a)}}},jt=(n,e,t=window.setTimeout.bind(window),a=window.clearTimeout.bind(window),s=fe,r=_t,o=e,c=Date.now)=>{let u=!1,d,l=0,m=!1,h=!1,p=!1,f=!1,g=Number.NEGATIVE_INFINITY;const w=async(N,C=!0)=>{h=!0,p=!1;const _=await N().catch(()=>!1);if(h=!1,u)return;if(m||=_,C&&_&&(g=c()),f){f=!1,w(e);return}if(!m&&p){w(e);return}const y=m?void 0:vt[l];y!==void 0&&(l+=1);const L=re-(c()-g),D=L>0?Math.min(ie,L):C?ie:0;d=t(()=>{if(d=void 0,s.isHidden())return;const x=!m||c()-g>=re;w(x?e:o,x)},y??D)},S=s.onVisible(()=>{if(!u){if(d!==void 0&&a(d),d=void 0,h){f=!0;return}w(e)}}),b=r(()=>{if(!(u||m)){if(h){p=!0;return}d!==void 0&&a(d),d=void 0,w(e)}});return w(n),()=>{u=!0,S(),b(),d!==void 0&&a(d)}},Ht=n=>{const e=T.c(3);let t,a;e[0]!==n?(t=()=>{const s=Ct;let r=s();const o=_e(()=>{r(),r=s()});return()=>{o(),r()}},a=[n],e[0]=n,e[1]=t,e[2]=a):(t=e[1],a=e[2]),R.useEffect(t,a)};function Nt(){return le.getState().refreshSessionHead()}function Ct(){const n=te();let e=!0;const t=async s=>(s?await $e(Oe()):await Ge(),!e||te()!==n?!1:(Me(),le.getState().status==="ready")),a=jt(()=>t(!0),()=>t(!1),window.setTimeout.bind(window),window.clearTimeout.bind(window),yt(),s=>He(r=>{r===n&&s()}),Nt);return()=>{e=!1,a()}}const pe=()=>{const n=[document.documentElement,document.body],e=document.getElementById("root");return e&&n.push(e),n},he=()=>{let n=!1;for(const e of pe())e.scrollTop!==0&&(e.scrollTop=0,n=!0),e.scrollLeft!==0&&(e.scrollLeft=0,n=!0);return n},Et=n=>n===document||pe().some(e=>e===n),Wt=()=>{const n=T.c(1);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],n[0]=e):e=n[0],R.useEffect(kt,e)};function It(n){Et(n.target)&&he()}function kt(){const n=It;return document.addEventListener("scroll",n,{capture:!0,passive:!0}),he(),()=>document.removeEventListener("scroll",n,{capture:!0})}export{Mt as G,$t as S,Pt as W,Gt as a,Wt as b,Ht as c,Ot as f,Tt as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useAppFontEffects-3RimJo4B.js","assets/vendor-react--VO_rL_p.js","assets/vendor-scheduler-7OC5HNn7.js","assets/katex.min-Bs5OLoA1.js","assets/vendor-vite-runtime-DD1OZmLC.js","assets/vendor-zustand-C9tWdk0j.js","assets/vendor-zod--raI7LhK.js","assets/vendor-opencode-client-CeybcDBQ.js","assets/vendor-fuse.js-Dw8P0qyA.js","assets/vendor-streamdown-BbSYZ3NF.js","assets/vendor-markdown-BTUqNk6W.js","assets/vendor-mdast-util-from-markdown-CZHjOE75.js","assets/vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js","assets/vendor-micromark-util-decode-string-fHsnqYdj.js","assets/vendor-decode-named-character-reference-C3-224fz.js","assets/vendor-micromark-util-normalize-identifier-C9ANKk3v.js","assets/vendor-micromark-AWM-NZXP.js","assets/vendor-micromark-util-combine-extensions-d8XJZrgA.js","assets/vendor-micromark-util-chunked-DrRIdSP-.js","assets/vendor-micromark-factory-space-PzSHLgmq.js","assets/vendor-micromark-util-character-CW3Cu1MS.js","assets/vendor-micromark-core-commonmark-kzTLNXAm.js","assets/vendor-micromark-util-classify-character-tcLuZZwM.js","assets/vendor-micromark-util-resolve-all-PQCKh0dx.js","assets/vendor-micromark-util-subtokenize-BF1Jf29a.js","assets/vendor-micromark-factory-destination-Sj0xfi0V.js","assets/vendor-micromark-factory-label-amyP0HdC.js","assets/vendor-micromark-factory-title-khnLkZK6.js","assets/vendor-micromark-factory-whitespace-eIB00uTl.js","assets/vendor-micromark-util-html-tag-name-DbKNfynz.js","assets/vendor-unist-util-stringify-position-Ch_qCilz.js","assets/vendor-mdast-util-to-string-C_aolqmU.js","assets/vendor-unist-util-visit-DhPeCsfG.js","assets/vendor-unist-util-visit-parents-DlviEg7Z.js","assets/vendor-unist-util-is-BPZGFiMU.js","assets/vendor-hast-util-raw-DvvLJg15.js","assets/vendor-ungap-structured-clone--gfxRhYI.js","assets/vendor-html-void-elements-CkdplsNl.js","assets/vendor-parse5-DwmzEj2o.js","assets/vendor-entities-wUUgTZDW.js","assets/vendor-web-namespaces-bsVAaBS1.js","assets/vendor-zwitch-C2o2j-tx.js","assets/vendor-unist-util-position-60F3QETU.js","assets/vendor-hast-util-from-parse5-Ba3T6RJI.js","assets/vendor-devlop-0Dp3JUBc.js","assets/vendor-property-information-Boo8Xpef.js","assets/vendor-hastscript-BrPNioaz.js","assets/vendor-comma-separated-tokens-CRUGqg4f.js","assets/vendor-space-separated-tokens-D7QSIrTI.js","assets/vendor-hast-util-parse-selector-TXfch5wI.js","assets/vendor-vfile-location-LfEFwJ2h.js","assets/vendor-hast-util-to-parse5-BoysVIPW.js","assets/vendor-hast-util-sanitize-2aGO5ay8.js","assets/vendor-micromark-extension-gfm-CsfPlnlB.js","assets/vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js","assets/vendor-micromark-extension-gfm-footnote-OFl1FCH2.js","assets/vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js","assets/vendor-micromark-extension-gfm-table-dgw4LfUw.js","assets/vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js","assets/vendor-mdast-util-gfm-CroMDYLM.js","assets/vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js","assets/vendor-ccount-c2V3InAJ.js","assets/vendor-mdast-util-find-and-replace-DB9iC-bx.js","assets/vendor-escape-string-regexp-BaJN9MlJ.js","assets/vendor-mdast-util-gfm-footnote-C-csI7OF.js","assets/vendor-mdast-util-gfm-strikethrough-BcskTdio.js","assets/vendor-mdast-util-gfm-table-DhPwQIyj.js","assets/vendor-markdown-table-DvhhVmnL.js","assets/vendor-mdast-util-to-markdown-Cl3qaiyc.js","assets/vendor-longest-streak-CtXnX3Xp.js","assets/vendor-mdast-util-phrasing-4oVbNLC3.js","assets/vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js","assets/vendor-mdast-util-to-hast-CWnLaQSO.js","assets/vendor-micromark-util-sanitize-uri-BbwQ7CLk.js","assets/vendor-trim-lines-D8znQY54.js","assets/vendor-micromark-extension-cjk-friendly-BzZDGrF5.js","assets/vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js","assets/vendor-get-east-asian-width-CPhS2cOv.js","assets/vendor-micromark-util-symbol-JJPacVTp.js","assets/vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js","assets/vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js","assets/vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js","assets/vendor-hast-util-from-html-isomorphic-B0Kn01s9.js","assets/vendor-hast-util-from-dom-DeNf9aYW.js","assets/vendor-katex-DBqql0K7.js","assets/vendor-hast-util-to-text-0GXLnBvt.js","assets/vendor-hast-util-is-element-CuOmiqQi.js","assets/vendor-unist-util-find-after-CMaZmLxc.js","assets/vendor-micromark-extension-math-BRFoDziv.js","assets/vendor-mdast-util-math-wB-IJCL0.js","assets/vendor-remend-r8cP_t-e.js","assets/vendor-clsx-B-dksMZM.js","assets/vendor-tailwind-merge-BKkUfl9q.js","assets/vendor-marked-DN3zOnEe.js","assets/vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js","assets/vendor-style-to-js-CI2G4dgu.js","assets/vendor-style-to-object-BAv4SQXc.js","assets/vendor-inline-style-parser-BlqBsVO4.js","assets/vendor-hast-util-whitespace-D4Wp6AEg.js","assets/vendor-estree-util-is-identifier-name-BgBfM8ME.js","assets/vendor-vfile-message-DqhD22jI.js","assets/vendor-unified-1CQKw2_w.js","assets/vendor-bail-FqpXQuLt.js","assets/vendor-extend-B94qxKr5.js","assets/vendor-is-plain-obj-C1gvLhAf.js","assets/vendor-trough-B_b8ryxu.js","assets/vendor-vfile-BCWrK60u.js","assets/vendor-html-url-attributes-D46m5wfe.js","assets/vendor-capacitor-core-B4EWRrHz.js","assets/katex-7f7Y525Q.css","assets/vendor-base-ui-CqKCZJyd.js","assets/vendor-floating-ui-utils-BzXdqYpP.js","assets/vendor-floating-ui-dom-WyXykhNi.js","assets/vendor-floating-ui-core-CXmKXOXc.js","assets/vendor-floating-ui-react-dom-Cy8dRGoy.js","assets/vendor-use-sync-external-store-CfLJGVyr.js","assets/vendor-simplewebauthn-browser-VDA66rT_.js","assets/vendor-dnd-kit-core-Br1Cs7RV.js","assets/vendor-dnd-kit-utilities-DZ9KbT5S.js","assets/vendor-dnd-kit-accessibility-CYclfhtC.js","assets/vendor-dnd-kit-sortable-DpfLEOLv.js","assets/vendor-tanstack-react-virtual-CqfECoM0.js","assets/vendor-tanstack-virtual-core-BdFnkr_2.js","assets/vendor-framer-motion-C_wK4GIM.js","assets/vendor-motion-dom-HXPOMxb7.js","assets/vendor-motion-utils-BGh8QBgx.js","assets/vendor-codemirror-commands-CjjsURR-.js","assets/vendor-codemirror-state-Cd8udR5z.js","assets/vendor-marijn-find-cluster-break-DXwl3gUT.js","assets/vendor-codemirror-view-Ciie9ey-.js","assets/vendor-style-mod-NZ5MEPvj.js","assets/vendor-w3c-keyname-Vcq4gwWv.js","assets/vendor-crelt-C8TCjufn.js","assets/vendor-codemirror-language-8HZTPOnt.js","assets/vendor-lezer-common-B3-cUCR_.js","assets/vendor-lezer-highlight-CZEcqU6G.js","assets/vendor-codemirror-streamparser-CmlTsbN2.js","assets/vendor-codemirror-lang-javascript-DmqaSK_j.js","assets/vendor-lezer-javascript-CWSwshuO.js","assets/vendor-lezer-lr-bhwg1HMg.js","assets/vendor-codemirror-autocomplete-BGedy2gC.js","assets/vendor-codemirror-lang-json-DVAYKmoO.js","assets/vendor-lezer-json-Cn1mncjr.js","assets/vendor-codemirror-lang-css-BLpgXfL2.js","assets/vendor-lezer-css-B2Hx_Nps.js","assets/vendor-codemirror-lang-html-S3jxr3Mo.js","assets/vendor-lezer-html-Cr8K5DGw.js","assets/vendor-codemirror-lang-markdown-D1jveRI5.js","assets/vendor-lezer-markdown-TQKzBB8i.js","assets/vendor-codemirror-language-data-DRsX0PKK.js","assets/vendor-codemirror-lang-python-B-5UC9Ui.js","assets/vendor-lezer-python-BUoImtUb.js","assets/vendor-sonner-Dw26OnzC.js","assets/vendor-cmdk-BtSpU-Io.js","assets/vendor-radix-ui-react-dialog-OIW6VLWw.js","assets/vendor-radix-ui-primitive-Dc_FVRD7.js","assets/vendor-radix-ui-react-compose-refs-D4RvEbuR.js","assets/vendor-radix-ui-react-context-BbFoxCHu.js","assets/vendor-radix-ui-react-id-aGag8i_5.js","assets/vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js","assets/vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js","assets/vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js","assets/vendor-radix-ui-react-primitive-CrN9dRDb.js","assets/vendor-radix-ui-react-slot-BjbalUfz.js","assets/vendor-radix-ui-react-use-callback-ref-CcC_buIU.js","assets/vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js","assets/vendor-radix-ui-react-focus-scope-D1noLHmd.js","assets/vendor-radix-ui-react-portal-BlUEzfrF.js","assets/vendor-radix-ui-react-presence-BGqFfiW4.js","assets/vendor-radix-ui-react-focus-guards-CSS2IbZC.js","assets/vendor-react-remove-scroll-Der_cv-1.js","assets/vendor-tslib-De9GV7Vy.js","assets/vendor-react-remove-scroll-bar-Clwl9llp.js","assets/vendor-react-style-singleton-D_xJlTqU.js","assets/vendor-get-nonce-C-Z93AgS.js","assets/vendor-use-sidecar-BdLl6ZIw.js","assets/vendor-use-callback-ref-CXJF1lEr.js","assets/vendor-aria-hidden-DvXkyWUv.js","assets/vendor-legendapp-list-CEhBoV5L.js","assets/vendor-class-variance-authority-5VPnzWs2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f as T,R,r as ge,j as i}from"./vendor-react--VO_rL_p.js";import{u as O,bJ as we,bK as xe,bL as be,bx as $,bM as Se,bN as ee,bO as ve,bt as ae,aZ as _e,aX as te}from"./katex.min-Bs5OLoA1.js";import{u as J,Q as G,I as A,a5 as ye,a6 as je,a4 as Ne,a0 as q,gg as Ce,gh as Ee,n as Ie,gi as ke,gj as Le,aw as De,gk as Re,cK as ze,cH as Ae,bb as Fe,x as ne,gl as se,gm as Te,gn as Pe,go as $e,gp as Oe,eF as Ge,gq as Me,Y as le,gr as He}from"./useAppFontEffects-3RimJo4B.js";import{M as ce}from"./vendor-base-ui-CqKCZJyd.js";import{o as oe,a as We,f as Ve,s as Be}from"./vendor-zod--raI7LhK.js";import{_ as de}from"./vendor-vite-runtime-DD1OZmLC.js";function Tt(){const n=T.c(5),e=O(Ue);let t;n[0]===Symbol.for("react.memo_cache_sentinel")?(t=we(),n[0]=t):t=n[0];const a=t;let s;n[1]!==e?(s=xe(e),n[1]=e,n[2]=s):s=n[2];const r=s;let o;return n[3]!==r?(o={usesFramelessChrome:a,side:r},n[3]=r,n[4]=o):o=n[4],o}function Ue(n){return n.desktopWindowControlsPosition}const Ze={close:"#FF5F57",minimize:"#FEBC2E",maximize:"#28C940"},Ye="rgba(0, 0, 0, 0.7)",qe=n=>{const e=T.c(3),{action:t}=n;if(t==="close"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(A,{name:"close",className:"size-[10px]"}),e[0]=s):s=e[0],s}if(t==="minimize"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(A,{name:"subtract",className:"size-[10px]"}),e[1]=s):s=e[1],s}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(A,{name:"add",className:"size-[10px]"}),e[2]=a):a=e[2],a},Ke=n=>{const e=T.c(18),{action:t,isMaximized:a,onActivate:s}=n,{t:r}=J(),o=Ze[t];let c;e[0]!==t||e[1]!==a||e[2]!==r?(c=r(t==="close"?"header.windowControls.close":t==="minimize"?"header.windowControls.minimize":a?"header.windowControls.restore":"header.windowControls.maximize"),e[0]=t,e[1]=a,e[2]=r,e[3]=c):c=e[3];const u=c;let d;e[4]!==t||e[5]!==s?(d=()=>s(t),e[4]=t,e[5]=s,e[6]=d):d=e[6];let l;e[7]!==o?(l={backgroundColor:o,color:Ye},e[7]=o,e[8]=l):l=e[8];let m;e[9]!==t?(m=i.jsx("span",{className:"flex items-center justify-center opacity-0 transition-opacity duration-75 group-hover/wctl:opacity-100",children:i.jsx(qe,{action:t})}),e[9]=t,e[10]=m):m=e[10];let h;e[11]!==l||e[12]!==m?(h=i.jsx("span",{className:"flex size-3.5 items-center justify-center rounded-full shadow-[inset_0_0_0_0.5px_rgba(0,0,0,0.28)] transition-[filter] duration-75 active:brightness-90",style:l,children:m}),e[11]=l,e[12]=m,e[13]=h):h=e[13];let p;return e[14]!==u||e[15]!==d||e[16]!==h?(p=i.jsx("button",{type:"button",onClick:d,title:u,"aria-label":u,className:"app-region-no-drag flex h-8 w-[24px] items-center justify-center rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:h}),e[14]=u,e[15]=d,e[16]=h,e[17]=p):p=e[17],p},Pt=R.memo(function(e){const t=T.c(27),{visible:a,position:s}=e,r=s===void 0?"right":s,{t:o}=J(),[c,u]=R.useState(!1),d=O(Je);let l,m;if(t[0]!==a?(l=()=>{if(!a)return;let N=!1;$("desktop_get_current_window_state").then(_=>{N||u(!!_?.maximized)}).catch(Qe);const C=_=>{const y=_.detail;u(!!y?.maximized)};return window.addEventListener("openchamber:window-maximized-changed",C),()=>{N=!0,window.removeEventListener("openchamber:window-maximized-changed",C)}},m=[a],t[0]=a,t[1]=l,t[2]=m):(l=t[1],m=t[2]),ge.useEffect(l,m),!a)return null;const h=r==="left";let p,f,g,w,S;if(t[3]!==d||t[4]!==h||t[5]!==c||t[6]!==r||t[7]!==o){S=Symbol.for("react.early_return_sentinel");e:{const N=be(r);let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=x=>{if(x==="close"){$("desktop_close_current_window");return}if(x==="minimize"){$("desktop_minimize_current_window");return}$("desktop_toggle_current_window_maximized").then(v=>u(!!v?.maximized)).catch(Xe)},t[13]=C):C=t[13];const _=C;if(d==="traffic-lights"){const x=h?"me-1":"ms-1 me-3";let v;t[14]!==x?(v=G("app-region-no-drag group/wctl flex h-8 shrink-0 items-center",x),t[14]=x,t[15]=v):v=t[15];let E;t[16]!==o?(E=o("header.windowControls.groupAria"),t[16]=o,t[17]=E):E=t[17];let I;t[18]!==c?(I=F=>i.jsx(Ke,{action:F,isMaximized:c,onActivate:_},F),t[18]=c,t[19]=I):I=t[19],S=i.jsx("div",{dir:"ltr",className:v,"aria-label":E,children:N.map(I)});break e}const y=G("app-region-no-drag inline-flex items-center justify-center text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h?"h-8 w-8 rounded-md":"h-12 w-11"),L=h?"app-region-no-drag me-1 flex h-8 shrink-0 items-center":"app-region-no-drag ms-1 flex h-12 shrink-0 items-center",D=x=>x==="minimize"?i.jsx("button",{type:"button",className:y,onClick:et,title:o("header.windowControls.minimize"),"aria-label":o("header.windowControls.minimize"),children:i.jsx(A,{name:"subtract",className:"h-4 w-4"})},"minimize"):x==="maximize"?i.jsx("button",{type:"button",className:y,onClick:()=>{$("desktop_toggle_current_window_maximized").then(v=>u(!!v?.maximized)).catch(tt)},title:o(c?"header.windowControls.restore":"header.windowControls.maximize"),"aria-label":o(c?"header.windowControls.restore":"header.windowControls.maximize"),children:i.jsx(A,{name:c?"fullscreen-exit":"checkbox-blank",className:"h-3.5 w-3.5"})},"maximize"):i.jsx("button",{type:"button",className:G(y,"hover:bg-[var(--status-error)] hover:text-[var(--status-error-foreground)]"),onClick:nt,title:o("header.windowControls.close"),"aria-label":o("header.windowControls.close"),children:i.jsx(A,{name:"close",className:"h-4 w-4"})},"close");p="ltr",f=L,t[20]!==o?(g=o("header.windowControls.groupAria"),t[20]=o,t[21]=g):g=t[21],w=N.map(D)}t[3]=d,t[4]=h,t[5]=c,t[6]=r,t[7]=o,t[8]=p,t[9]=f,t[10]=g,t[11]=w,t[12]=S}else p=t[8],f=t[9],g=t[10],w=t[11],S=t[12];if(S!==Symbol.for("react.early_return_sentinel"))return S;let b;return t[22]!==p||t[23]!==f||t[24]!==g||t[25]!==w?(b=i.jsx("div",{dir:p,className:f,"aria-label":g,children:w}),t[22]=p,t[23]=f,t[24]=g,t[25]=w,t[26]=b):b=t[26],b});function Je(n){return n.desktopWindowControlsStyle}function Qe(){}function Xe(){}function et(){$("desktop_minimize_current_window")}function tt(){}function nt(){$("desktop_close_current_window")}const X="new-session";function $t(n){const e=T.c(18),{children:t,variant:a,scopeProjectId:s,align:r}=n,o=a===void 0?"default":a,c=s===void 0?null:s,u=r===void 0?"start":r,d=O(ot),l=O(st);let m;e[0]!==t?(m=i.jsx(ye,{asChild:!0,children:t}),e[0]=t,e[1]=m):m=e[1];const h=o==="compact"?"w-[280px]":"w-[360px]";let p;e[2]!==h?(p=G("overflow-hidden p-1 max-w-[calc(100vw-32px)]",h),e[2]=h,e[3]=p):p=e[3];let f;e[4]!==d||e[5]!==c||e[6]!==l||e[7]!==o?(f=d?i.jsx(it,{onSelect:()=>l(!1),variant:o,scopeProjectId:c}):null,e[4]=d,e[5]=c,e[6]=l,e[7]=o,e[8]=f):f=e[8];let g;e[9]!==u||e[10]!==p||e[11]!==f?(g=i.jsx(je,{align:u,sideOffset:6,className:p,children:f}),e[9]=u,e[10]=p,e[11]=f,e[12]=g):g=e[12];let w;return e[13]!==d||e[14]!==l||e[15]!==m||e[16]!==g?(w=i.jsxs(Ne,{open:d,onOpenChange:l,modal:!1,disableGlobalShortcuts:!0,children:[m,g]}),e[13]=d,e[14]=l,e[15]=m,e[16]=g,e[17]=w):w=e[17],w}function st(n){return n.setSessionDropdownOpen}function ot(n){return n.isSessionDropdownOpen}function it(n){const e=T.c(31),{onSelect:t,variant:a,scopeProjectId:s}=n,r=q(lt),o=q(at);let c;e[0]!==r||e[1]!==s?(c={scopeProjectId:s,currentSessionId:r},e[0]=r,e[1]=s,e[2]=c):c=e[2];const u=Ce(!0,c),d=q(rt),{t:l}=J();let m;e[3]!==t||e[4]!==d?(m=()=>{t(),d()},e[3]=t,e[4]=d,e[5]=m):m=e[5];const h=m;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=new Set,e[6]=p):p=e[6];const[f,g]=R.useState(p),w=R.useRef(null),S=R.useRef(!1),b=o?X:r;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=j=>{g(Y=>{const k=new Set(Y);return k.has(j)?k.delete(j):k.add(j),k})},e[7]=N):N=e[7];const C=N;let _,y;e[8]!==f||e[9]!==b||e[10]!==u?(_=()=>{if(S.current||!b)return;const j=b===X?[]:Ee(u,b);if(!j)return;if(j.some(k=>!f.has(k))){g(k=>new Set([...k,...j]));return}const Y=requestAnimationFrame(()=>{const k=Array.from(w.current?.querySelectorAll("[data-switcher-item-id]")??[]).find(P=>P.dataset.switcherItemId===b);k&&(k.focus(),k.scrollIntoView({block:"nearest"}),S.current=!0)});return()=>cancelAnimationFrame(Y)},y=[f,b,u],e[8]=f,e[9]=b,e[10]=u,e[11]=_,e[12]=y):(_=e[11],y=e[12]),R.useLayoutEffect(_,y);let L,D;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=G("group relative flex w-full cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover"),D=i.jsx(A,{name:"chat-new",className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),e[13]=L,e[14]=D):(L=e[13],D=e[14]);let x;e[15]!==l?(x=l("sessions.sidebar.header.actions.newSession"),e[15]=l,e[16]=x):x=e[16];let v;e[17]!==x?(v=i.jsx("span",{className:"truncate typography-ui-label font-normal leading-tight text-foreground",children:x}),e[17]=x,e[18]=v):v=e[18];let E;e[19]!==h||e[20]!==v?(E=i.jsxs(ce,{"data-switcher-item-id":X,onClick:h,className:L,children:[D,v]}),e[19]=h,e[20]=v,e[21]=E):E=e[21];let I;e[22]!==f||e[23]!==u||e[24]!==t||e[25]!==l||e[26]!==a?(I=u.length===0?i.jsx("div",{className:"px-3 py-4 text-center typography-meta text-muted-foreground",children:l("sessions.switcher.empty")}):u.map(j=>i.jsx(ue,{item:j,depth:0,variant:a,expandedParents:f,toggleParent:C,closeDropdown:t},j.node.session.id)),e[22]=f,e[23]=u,e[24]=t,e[25]=l,e[26]=a,e[27]=I):I=e[27];let F;return e[28]!==E||e[29]!==I?(F=i.jsx(Ie,{ref:w,outerClassName:"max-h-[60vh]",disableHorizontal:!0,children:i.jsxs("div",{className:"space-y-0.5",children:[E,I]})}),e[28]=E,e[29]=I,e[30]=F):F=e[30],F}function rt(n){return n.openNewSessionDraft}function at(n){return n.newSessionDraft.open===!0}function lt(n){return n.currentSessionId}function ue(n){const e=T.c(31),{item:t,depth:a,variant:s,expandedParents:r,toggleParent:o,closeDropdown:c}=n,{node:u,secondaryMeta:d}=t,l=u.session,m=u.children.length>0;let h;e[0]!==r||e[1]!==l.id?(h=r.has(l.id),e[0]=r,e[1]=l.id,e[2]=h):h=e[2];const p=h;let f;e[3]!==m||e[4]!==l.id||e[5]!==o?(f=m?()=>o(l.id):void 0,e[3]=m,e[4]=l.id,e[5]=o,e[6]=f):f=e[6];let g;e[7]!==c||e[8]!==a||e[9]!==m||e[10]!==p||e[11]!==d||e[12]!==l||e[13]!==f||e[14]!==s?(g=i.jsx(ct,{session:l,depth:a,variant:s,secondaryMeta:d,hasChildren:m,isExpanded:p,onToggleExpand:f,closeDropdown:c}),e[7]=c,e[8]=a,e[9]=m,e[10]=p,e[11]=d,e[12]=l,e[13]=f,e[14]=s,e[15]=g):g=e[15];let w;e[16]!==c||e[17]!==a||e[18]!==r||e[19]!==m||e[20]!==p||e[21]!==t.groupDirectory||e[22]!==t.projectId||e[23]!==u.children||e[24]!==d||e[25]!==o||e[26]!==s?(w=m&&p?u.children.map(b=>i.jsx(ue,{item:{node:b,projectId:t.projectId,groupDirectory:t.groupDirectory,secondaryMeta:d},depth:a+1,variant:s,expandedParents:r,toggleParent:o,closeDropdown:c},b.session.id)):null,e[16]=c,e[17]=a,e[18]=r,e[19]=m,e[20]=p,e[21]=t.groupDirectory,e[22]=t.projectId,e[23]=u.children,e[24]=d,e[25]=o,e[26]=s,e[27]=w):w=e[27];let S;return e[28]!==g||e[29]!==w?(S=i.jsxs(i.Fragment,{children:[g,w]}),e[28]=g,e[29]=w,e[30]=S):S=e[30],S}function ct(n){const e=T.c(55),{session:t,depth:a,variant:s,secondaryMeta:r,hasChildren:o,isExpanded:c,onToggleExpand:u,closeDropdown:d}=n,{t:l}=J(),m=q(ut),h=q(dt),p=ke(t.id),f=m===t.id;let g;e[0]!==t.title||e[1]!==l?(g=t.title?.trim()||l("sessions.sidebar.session.untitled"),e[0]=t.title,e[1]=l,e[2]=g):g=e[2];const w=g,S=Le(t.id),b=S!==null,N=De(b),C=!b&&p&&!f;let _;if(e[3]!==t){const z=Re(t)||Date.now();_=ze(z),e[3]=t,e[4]=_}else _=e[4];const y=_;let L;e[5]!==r?.projectLabel?(L=r?.projectLabel?.trim()||null,e[5]=r?.projectLabel,e[6]=L):L=e[6];const D=L;let x;e[7]!==r?.branchLabel?(x=r?.branchLabel?.trim()||null,e[7]=r?.branchLabel,e[8]=x):x=e[8];const v=x,E=v&&v!=="HEAD"?v:null;let I;e[9]!==d||e[10]!==f||e[11]!==t||e[12]!==h?(I=()=>{if(f){d();return}const z=Fe(t);h(t.id,z??null),d()},e[9]=d,e[10]=f,e[11]=t,e[12]=h,e[13]=I):I=e[13];const F=I;let j;e[14]!==F?(j=z=>{if(z.target?.closest("[data-switcher-expand]")){z.preventDefault();return}F()},e[14]=F,e[15]=j):j=e[15];const Y=t.id,k=f&&"bg-interactive-selection text-interactive-selection-foreground hover:bg-interactive-selection data-[highlighted]:bg-interactive-selection";let P;e[16]!==k?(P=G("group relative flex w-full cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover",k),e[16]=k,e[17]=P):P=e[17];const Q=8+a*12;let M;e[18]!==Q?(M={paddingInlineStart:Q},e[18]=Q,e[19]=M):M=e[19];let H;e[20]!==o||e[21]!==c||e[22]!==u||e[23]!==l||e[24]!==s?(H=s==="compact"&&o?i.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:z=>{z.preventDefault(),z.stopPropagation(),u?.()},className:"inline-flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(c?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:c?i.jsx(A,{name:"arrow-down-s",className:"h-3.5 w-3.5"}):i.jsx(A,{name:"arrow-right-s",className:"h-3.5 w-3.5"})}):null,e[20]=o,e[21]=c,e[22]=u,e[23]=l,e[24]=s,e[25]=H):H=e[25];let W;e[26]!==w?(W=i.jsx("span",{dir:"auto",className:"truncate oc-ui-start-align typography-ui-label font-normal leading-tight text-foreground",children:w}),e[26]=w,e[27]=W):W=e[27];let V;e[28]!==H||e[29]!==W?(V=i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[H,W]}),e[28]=H,e[29]=W,e[30]=V):V=e[30];let B;e[31]!==E||e[32]!==o||e[33]!==c||e[34]!==u||e[35]!==D||e[36]!==l||e[37]!==y||e[38]!==s?(B=s==="default"?i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 truncate text-muted-foreground leading-tight",style:{fontSize:"calc(var(--text-ui-label) * 0.85)"},children:[o?i.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:z=>{z.preventDefault(),z.stopPropagation(),u?.()},className:"inline-flex h-3 w-3 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(c?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:c?i.jsx(A,{name:"arrow-down-s",className:"h-3 w-3"}):i.jsx(A,{name:"arrow-right-s",className:"h-3 w-3"})}):null,i.jsx("span",{className:"flex-shrink-0",children:y}),D?i.jsx("span",{className:"truncate",children:D}):null,E?i.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[i.jsx(A,{name:"git-branch",className:"h-3 w-3 flex-shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:E})]}):null]}):null,e[31]=E,e[32]=o,e[33]=c,e[34]=u,e[35]=D,e[36]=l,e[37]=y,e[38]=s,e[39]=B):B=e[39];let U;e[40]!==V||e[41]!==B?(U=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[V,B]}),e[40]=V,e[41]=B,e[42]=U):U=e[42];let Z;e[43]!==b||e[44]!==N||e[45]!==C||e[46]!==S?(Z=b||C?i.jsx("span",{className:"flex h-3 w-3 flex-shrink-0 items-center justify-center self-center",children:i.jsx(Ae,{state:S??"unread",runningClassName:G("h-2 w-2",N)})}):null,e[43]=b,e[44]=N,e[45]=C,e[46]=S,e[47]=Z):Z=e[47];let K;return e[48]!==t.id||e[49]!==M||e[50]!==U||e[51]!==Z||e[52]!==j||e[53]!==P?(K=i.jsxs(ce,{onClick:j,"data-slot":"session-switcher-item","data-switcher-item-id":Y,className:P,style:M,children:[U,Z]}),e[48]=t.id,e[49]=M,e[50]=U,e[51]=Z,e[52]=j,e[53]=P,e[54]=K):K=e[54],K}function dt(n){return n.setCurrentSession}function ut(n){return n.currentSessionId}const Ot=n=>!Number.isFinite(n)||n<=0?new Intl.NumberFormat(ne(),{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(0):new Intl.NumberFormat(ne(),{style:"currency",currency:"USD",minimumFractionDigits:n<.01?4:2,maximumFractionDigits:n<.01?4:2}).format(n),mt="ui-store",ft=oe({state:oe({contextSurfaceZones:We(Be(),Ve())})}),pt=n=>{if(!n)return null;let e;try{e=JSON.parse(n)}catch{return null}const t=ft.safeParse(e);return t.success?ve.parse(t.data.state.contextSurfaceZones):null},Gt=()=>{const n=e=>{if(e.key!==mt)return;const t=pt(e.newValue);if(!t)return;const a=O.getState().contextSurfaceZones,s=new Set([...Object.keys(a),...Object.keys(t)].filter(Se));for(const r of s){const o=ee(t,r);o!==ee(O.getState().contextSurfaceZones,r)&&O.getState().moveContextSurfaceToZone(r,o)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)},ht=R.lazy(()=>de(()=>import("./useAppFontEffects-3RimJo4B.js").then(n=>n.ta),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(n=>({default:n.GuestAttachDialog}))),me=R.lazy(()=>de(()=>import("./useAppFontEffects-3RimJo4B.js").then(n=>n.t9),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(n=>({default:n.PluginPane}))),Mt=()=>{const n=T.c(11),e=se(gt),t=se(wt),a=Te(xt),s=Pe(bt);let r;n[0]!==s?(r=s.map(St),n[0]=s,n[1]=r):r=n[1];let o;n[2]!==t||n[3]!==e?(o=e?i.jsx(R.Suspense,{fallback:null,children:i.jsx(ht,{guestId:e.guestId,item:e.item,onOpenChange:d=>{d||t()}})}):null,n[2]=t,n[3]=e,n[4]=o):o=n[4];let c;n[5]!==a?(c=a?i.jsx("div",{"aria-hidden":"true",className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:i.jsx(R.Suspense,{fallback:null,children:i.jsx(me,{mode:ae(a),surface:"panel",headless:!0})})}):null,n[5]=a,n[6]=c):c=n[6];let u;return n[7]!==r||n[8]!==o||n[9]!==c?(u=i.jsxs(i.Fragment,{children:[r,o,c]}),n[7]=r,n[8]=o,n[9]=c,n[10]=u):u=n[10],u};function gt(n){return n.request}function wt(n){return n.close}function xt(n){return n.guestId}function bt(n){return n.requests}function St(n){return i.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:i.jsx(R.Suspense,{fallback:null,children:i.jsx(me,{mode:ae(n.guestId),surface:"background",headless:!0,backgroundAction:n})})},n.id)}const ie=45e3,re=10*6e4,vt=[1e3,2e3,4e3],fe={isHidden:()=>!1,onVisible:()=>()=>{}},_t=()=>()=>{},yt=()=>typeof document>"u"?fe:{isHidden:()=>document.visibilityState==="hidden",onVisible:n=>{let e=document.visibilityState==="hidden";const t=()=>{const s=document.visibilityState==="hidden";e&&!s&&n(),e=s},a=()=>{e&&document.visibilityState!=="hidden"&&t()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",a)}}},jt=(n,e,t=window.setTimeout.bind(window),a=window.clearTimeout.bind(window),s=fe,r=_t,o=e,c=Date.now)=>{let u=!1,d,l=0,m=!1,h=!1,p=!1,f=!1,g=Number.NEGATIVE_INFINITY;const w=async(N,C=!0)=>{h=!0,p=!1;const _=await N().catch(()=>!1);if(h=!1,u)return;if(m||=_,C&&_&&(g=c()),f){f=!1,w(e);return}if(!m&&p){w(e);return}const y=m?void 0:vt[l];y!==void 0&&(l+=1);const L=re-(c()-g),D=L>0?Math.min(ie,L):C?ie:0;d=t(()=>{if(d=void 0,s.isHidden())return;const x=!m||c()-g>=re;w(x?e:o,x)},y??D)},S=s.onVisible(()=>{if(!u){if(d!==void 0&&a(d),d=void 0,h){f=!0;return}w(e)}}),b=r(()=>{if(!(u||m)){if(h){p=!0;return}d!==void 0&&a(d),d=void 0,w(e)}});return w(n),()=>{u=!0,S(),b(),d!==void 0&&a(d)}},Ht=n=>{const e=T.c(3);let t,a;e[0]!==n?(t=()=>{const s=Ct;let r=s();const o=_e(()=>{r(),r=s()});return()=>{o(),r()}},a=[n],e[0]=n,e[1]=t,e[2]=a):(t=e[1],a=e[2]),R.useEffect(t,a)};function Nt(){return le.getState().refreshSessionHead()}function Ct(){const n=te();let e=!0;const t=async s=>(s?await $e(Oe()):await Ge(),!e||te()!==n?!1:(Me(),le.getState().status==="ready")),a=jt(()=>t(!0),()=>t(!1),window.setTimeout.bind(window),window.clearTimeout.bind(window),yt(),s=>He(r=>{r===n&&s()}),Nt);return()=>{e=!1,a()}}const pe=()=>{const n=[document.documentElement,document.body],e=document.getElementById("root");return e&&n.push(e),n},he=()=>{let n=!1;for(const e of pe())e.scrollTop!==0&&(e.scrollTop=0,n=!0),e.scrollLeft!==0&&(e.scrollLeft=0,n=!0);return n},Et=n=>n===document||pe().some(e=>e===n),Wt=()=>{const n=T.c(1);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],n[0]=e):e=n[0],R.useEffect(kt,e)};function It(n){Et(n.target)&&he()}function kt(){const n=It;return document.addEventListener("scroll",n,{capture:!0,passive:!0}),he(),()=>document.removeEventListener("scroll",n,{capture:!0})}export{Mt as G,$t as S,Pt as W,Gt as a,Wt as b,Ht as c,Ot as f,Tt as u};
|