@jetcrab/pi-desk 1.1.32 → 1.1.33
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/package.json +1 -1
- package/src/client/l2_biz/project-preview/l2-project-preview.tsx +2 -2
- package/src/client/l2_biz/project-preview/views/l2-project-history-view.tsx +2 -2
- package/src/client/l2_biz/terminal/l2-terminal-workspace.tsx +1 -0
- package/src/client/l2_biz/workbench/l2-work-session-columns.tsx +1 -0
- package/src/client/l2_biz/workbench/l2-workbench-sidebar-layout.tsx +1 -0
- package/temp/build/pi-desk/release/.next/BUILD_ID +1 -1
- package/temp/build/pi-desk/release/.next/build-manifest.json +2 -2
- package/temp/build/pi-desk/release/.next/prerender-manifest.json +3 -3
- package/temp/build/pi-desk/release/.next/required-server-files.js +2 -2
- package/temp/build/pi-desk/release/.next/required-server-files.json +2 -2
- package/temp/build/pi-desk/release/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/temp/build/pi-desk/release/.next/server/app/_global-error.html +1 -1
- package/temp/build/pi-desk/release/.next/server/app/_global-error.rsc +1 -1
- package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/temp/build/pi-desk/release/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/temp/build/pi-desk/release/.next/server/app/api/health/route.js +1 -1
- package/temp/build/pi-desk/release/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/temp/build/pi-desk/release/.next/server/app/page.js +4 -4
- package/temp/build/pi-desk/release/.next/server/app/page_client-reference-manifest.js +1 -1
- package/temp/build/pi-desk/release/.next/server/app/project-preview/page_client-reference-manifest.js +1 -1
- package/temp/build/pi-desk/release/.next/server/chunks/27344.js +1 -1
- package/temp/build/pi-desk/release/.next/server/middleware-build-manifest.js +1 -1
- package/temp/build/pi-desk/release/.next/server/pages/500.html +1 -1
- package/temp/build/pi-desk/release/.next/server/server-reference-manifest.json +1 -1
- package/temp/build/pi-desk/release/.next/static/chunks/{65232-f5b71cec787a30ec.js → 65232-87ad5d745e5d22f0.js} +1 -1
- package/temp/build/pi-desk/release/.next/static/chunks/app/{page-4f02cd8374a5ea39.js → page-eb5c2229f59dda1a.js} +4 -4
- package/temp/build/pi-desk/release/.next/trace-build +1 -1
- /package/temp/build/pi-desk/release/.next/static/{YNnS2PkK7QVGmBEX0iXCM → IDVi-aOj0xwp4DoZljk5f}/_buildManifest.js +0 -0
- /package/temp/build/pi-desk/release/.next/static/{YNnS2PkK7QVGmBEX0iXCM → IDVi-aOj0xwp4DoZljk5f}/_ssgManifest.js +0 -0
|
@@ -12,4 +12,4 @@ window.addEventListener('keydown', function (event) {
|
|
|
12
12
|
</script>`;function e(a){return`${a}
|
|
13
13
|
${d}`}},49057:(a,b,c)=>{"use strict";c.d(b,{A_:()=>k,Hj:()=>i,XB:()=>l,eP:()=>o,iH:()=>m,lN:()=>n,oW:()=>h,oY:()=>g,ws:()=>j});var d=c(53403),e=c(89172),f=c(83731);function g(a){let b=new Map;for(let c of a){let a=c.split("/").filter(Boolean),d=b,e="";for(let[b,f]of a.entries()){e=e?`${e}/${f}`:f;let g=d.get(f);g||(g={name:f,path:e,branchName:null,children:new Map},d.set(f,g)),b===a.length-1&&(g.branchName=c),d=g.children}}return function a(b){return[...b].sort((a,b)=>a.name.localeCompare(b.name,void 0,{numeric:!0,sensitivity:"base"})).map(b=>({name:b.name,path:b.path,branchName:b.branchName,children:a(b.children.values())}))}(b.values())}function h(a,b){return(0,f._J)(a,b)}function i(a,b){return b.split("/").at(-1)||a}function j(a){return"branch"===a.type?a.name:`@ ${a.commit.slice(0,7)}`}function k(a,b,c="en"){if(0===b.length)return null;let f=e.C[c];if(1===b.length){let e=b[0],g=i(a,e.root);if("unavailable"===e.state){let a=f.gitUnavailable;return{full:e.root?`${g} \xb7 ${a}`:a,compact:"Git !",title:`${g}${"en"===c?": ":":"}${(0,d.fD)(e.message,c)}`,diverged:!0}}let h=j(e.head);return{full:e.root?`${g} \xb7 ${h}`:h,compact:h,title:`${f.gitBranches}: ${g} \xb7 ${h}`,diverged:"detached"===e.head.type}}let g=`${b.length} ${f.repositoriesUnit}`;return{full:g,compact:`Git ${b.length}`,title:`${f.gitBranches}: ${g}`,diverged:!1}}function l(a){let b=[a.indexStatus,a.worktreeStatus];return b.includes("unmerged")?"!":b.includes("deleted")?"D":b.includes("renamed")?"R":b.includes("added")?"A":b.includes("modified")?"M":"?"}function m(a){let b=l(a);return"D"===b?"text-muted-foreground":"?"===b?"text-red-600 dark:text-red-400":"A"===b?"text-emerald-600 dark:text-emerald-400":"!"===b?"text-violet-600 dark:text-violet-400":"text-blue-600 dark:text-blue-400"}function n(a,b,c){if(/^(?:[a-z]:|\/|\\\\)/i.test(b))return null;let d=/^[a-z]:[\\/]/i.test(a)||a.startsWith("\\\\"),e=a=>d?a.toLowerCase():a,f=[...c].sort((a,b)=>b.root.length-a.root.length).find(a=>!a.root||e(b).startsWith(`${e(a.root)}/`));if(!f)return null;let g=f.root?b.slice(f.root.length+1):b;return{repository:f,path:g,change:"ready"===f.state?f.changes.find(a=>e(a.path)===e(g)):void 0}}function o(a){return a.flatMap(a=>"ready"===a.state?a.changes.map(b=>({repositoryRoot:a.root,repository:a,path:b.path,projectPath:h(a.root,b.path),change:b})):[])}},51108:(a,b,c)=>{"use strict";c.d(b,{J:()=>q});var d=c(52834),e=c(97586),f=c(87366),g=c(37496),h=c(9365),i=c(50599),j=c(49147),k=c(57850),l=c(93306),m=c(2719),n=c(91816),o=c(60819),p=c(13749);function q({cwd:a,path:b,type:c,trigger:r,openLabel:s,onOpen:t,expanded:u,onToggle:v,historical:w,oldPath:x,onReveal:y}){let{t:z}=(0,k.Bd)("projectFiles"),A=(0,m.G)(),[B,C]=(0,j.useState)(null),D=B??{cwd:a,path:b,type:c,oldPath:x},E=(0,j.useRef)(!1),F=(0,j.useRef)(""),G="file"===c?"file":"folder",H=a=>{(0,l.x)(a).then(a=>{a?A.success(z("copied")):A.error(z("copyFailed"))})},I=(D.path||D.cwd.replaceAll("\\","/")).split("/").filter(Boolean).at(-1)??D.cwd;return(0,d.jsxs)(n.tz,{onOpenChange:(d,e)=>{C(d?{cwd:a,path:b,type:c,oldPath:x}:null);let f=e.event;d&&("touch"===F.current||"pointerType"in f&&"touch"===f.pointerType||f.type.startsWith("touch"))&&(E.current=!0)},children:[(0,d.jsx)(n.Rc,{render:r,"data-project-path-menu-trigger":"",onPointerDown:a=>{F.current=a.pointerType,E.current=!1},onTouchEndCapture:a=>{let b=a.target;!B||!E.current||"touch"!==F.current||b instanceof Element&&b.closest("[data-project-path-menu-trigger]")===a.currentTarget&&a.cancelable&&a.preventDefault()},onClickCapture:a=>{E.current&&(a.preventDefault(),a.stopPropagation(),E.current=!1)},onKeyDownCapture:a=>{if(a.defaultPrevented||a.nativeEvent.isComposing)return;let b=a.target;if(!(b instanceof Element)||b.closest("[data-project-path-menu-trigger]")!==a.currentTarget||(F.current="keyboard",E.current=!1,"ContextMenu"!==a.key&&!("F10"===a.key&&a.shiftKey)))return;a.preventDefault(),a.stopPropagation();let c=b.getBoundingClientRect();a.currentTarget.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,button:2,clientX:c.left+Math.min(c.width,120)/2,clientY:c.top+Math.min(c.height,36)/2}))}}),(0,d.jsxs)(o.D,{children:[t?(0,d.jsxs)(n.kt,{onClick:t,children:[(0,d.jsx)(e.A,{}),s??z("openPreview")]}):null,v?(0,d.jsxs)(n.kt,{onClick:v,children:[u?(0,d.jsx)(f.A,{}):(0,d.jsx)(g.A,{}),z(u?"collapse":"expand")]}):null,t||v?(0,d.jsx)(n.K5,{}):null,y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(n.kt,{"data-testid":`project-${G}-reveal-${b}`,onClick:()=>{y&&y(D.path,D.type).then(()=>A.success(z("revealRequested"))).catch(a=>{A.error(a instanceof Error?a.message:z("revealFailed"))})},children:[(0,d.jsx)(h.A,{}),w?"directory"===c?z("openCurrentWorkspace"):z("locateCurrentWorkspace"):"directory"===c?z("openFolder"):z("openContainingFolder")]}),(0,d.jsx)(n.K5,{})]}):null,(0,d.jsxs)(n.kt,{"data-testid":`project-${G}-copy-address-${b}`,onClick:()=>H((0,p.$)(D.cwd,D.path)),children:[(0,d.jsx)(i.A,{}),z("copyAbsolutePath")]}),(0,d.jsxs)(n.kt,{onClick:()=>H(D.path||"."),children:[(0,d.jsx)(i.A,{}),z("copyRelativePath")]}),(0,d.jsxs)(n.kt,{onClick:()=>H(I),children:[(0,d.jsx)(i.A,{}),z("directory"===c?"copyFolderName":"copyFileName")]}),D.oldPath?(0,d.jsxs)(n.kt,{onClick:()=>H(D.oldPath),children:[(0,d.jsx)(i.A,{}),z("copyOldRelativePath")]}):null]})]})}},51949:(a,b,c)=>{"use strict";c.d(b,{CT:()=>n,JH:()=>p,NL:()=>g,Nu:()=>q,_g:()=>k,eC:()=>l,gB:()=>h,ih:()=>v,jI:()=>u,p$:()=>m,rh:()=>j,uV:()=>e,xm:()=>f});var d=c(87883);let e=4096,f=5e3,g=5242880,h=1048576;function i(a,b){return""===a?b:!(a.length>e||a.startsWith("/")||a.includes("\\")||a.includes("\0")||/^[a-zA-Z]:/.test(a))&&a.split("/").every(a=>a.length>0&&"."!==a&&".."!==a)}let j=d.Yj().max(e).refine(a=>i(a,!0),"目录路径必须是规范相对路径"),k=d.Yj().min(1).max(e).refine(a=>i(a,!1),"文件路径必须是规范相对路径"),l=d.Yj().min(1).max(e).refine(a=>i(a,!1)||a.length>0&&a.length<=e&&!a.includes("\0")&&(a.startsWith("/")||a.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(a)),"预览路径必须是规范相对路径或绝对路径"),m=d.k5(["compressed","original"]),n=d.k5(["image/jpeg","image/png","image/webp","image/gif"]),o=d.Ik({name:d.Yj().min(1),type:d.k5(["directory","file"])}).strict(),p=d.Ik({entries:d.YO(o).max(f),truncated:d.zM()}).strict(),q=d.Ik({query:d.Yj().min(1).max(200).refine(a=>a.trim().length>0&&!/[\0\r\n]/.test(a),"搜索词必须是非空单行文本"),scope:d.k5(["all","files","content"]).default("all"),caseSensitive:d.zM().default(!1),wholeWord:d.zM().default(!1),regex:d.zM().default(!1)}).strict(),r=d.Ik({start:d.ai().int().nonnegative(),end:d.ai().int().nonnegative()}).strict().refine(a=>a.start<=a.end,"搜索命中区间无效"),s=d.Ik({path:k,ranges:d.YO(r)}).strict().refine(a=>a.ranges.every(b=>b.end<=a.path.length),"文件名命中区间越界"),t=d.Ik({path:k,line:d.ai().int().positive(),text:d.Yj().max(1e3),ranges:d.YO(r)}).strict().refine(a=>a.ranges.every(b=>b.end<=a.text.length),"正文命中区间越界"),u=d.Ik({fileMatches:d.YO(s).max(100),contentMatches:d.YO(t).max(200),truncated:d.zM()}).strict(),v=d.gM("kind",[d.Ik({kind:d.eu("text"),content:d.Yj(),size:d.ai().int().nonnegative().max(g)}).strict(),d.Ik({kind:d.eu("image"),mimeType:n,data:d.Yj().min(1),size:d.ai().int().positive().max(0xa00000)}).strict()])},51972:(a,b,c)=>{"use strict";function d(a,b,c){a.addCommand(b,c,"editorTextFocus && !findWidgetVisible && !suggestWidgetVisible && !renameInputVisible && !parameterHintsVisible && !referenceSearchVisible && !editorHoverVisible && !editorHoverFocused")}c.d(b,{e:()=>d})},52660:(a,b,c)=>{"use strict";c.d(b,{Wq:()=>g,ku:()=>i,lU:()=>h}),c(51949);let d=new Set,e="compressed";function f(){}function g(){return f(),e}function h(a){if(f(),e!==a){e=a;try{window.localStorage.setItem("pi-super:image-preview-mode",a)}catch{}for(let a of[...d])a()}}function i(a){return d.add(a),()=>d.delete(a)}},53403:(a,b,c)=>{"use strict";c.d(b,{fD:()=>f,qf:()=>e});var d=c(87883);let e=d.KC([d.Yj(),d.Ik({default:d.Yj(),translations:d.g1(d.Yj().min(1).max(35),d.Yj()).refine(a=>Object.keys(a).length<=16,"too many translations")}).strict()]);function f(a,b){return"string"==typeof a?a:a.translations[b]??a.translations[b.split("-")[0]]??a.default}},53437:(a,b,c)=>{"use strict";c.d(b,{IV:()=>o,om:()=>t,e6:()=>v,XC:()=>s});var d=c(52834),e=c(60816),f=c(63345),g=c(98004),h=c(40181),i=c(49028),j=c(21556),k=c(97832),l=c(57850),m=c(38684),n=c(15620);let o={input:["dataPiMarkdownProgress"],blockquote:["dataPiMarkdownAlert"]};function p(a){return{type:"paragraph",children:[],data:{hName:"input",hProperties:{type:"checkbox",disabled:!0,checked:"[x]"===a.toLowerCase(),..."[-]"===a?{dataPiMarkdownProgress:"true"}:{}}}}}var q=c(4935),r=c.n(q);let s=[...Object.values(m.U2),function(){return(a,b)=>{let c=String(b.value),d=(a,b)=>{let d=a.position?.start.offset;return void 0!==d&&c.slice(d,d+b.length)===b},e=a=>{let b=a.children?.[0];if("tableCell"===a.type&&a.children?.length===1&&b?.type==="text"){let c=b.value??"";/^\[[ xX-]\]$/.test(c)&&d(b,c)&&(a.children=[p(c)])}else if("listItem"===a.type&&b?.type==="paragraph"){let c=b.children?.[0];c?.type==="text"&&/^\[-\](?:\s|$)/.test(c.value??"")&&d(c,"[-]")&&(c.value=c.value.slice(3),b.children.unshift(p("[-]")),a.data={...a.data,hProperties:{className:["task-list-item"]}})}else if("blockquote"===a.type&&b?.type==="paragraph"){let c=b.children?.[0],e=c?.value?.match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][ \t]*(?:\r?\n|$)/);c?.type==="text"&&e&&d(c,`[!${e[1]}]`)&&(e[0].endsWith("\n")||1===b.children.length||b.children[1]?.type==="break")&&(c.value=c.value.slice(e[0].length),c.value||(b.children.shift(),b.children[0]?.type==="break"&&b.children.shift()),0===b.children.length&&a.children.shift(),a.data={...a.data,hProperties:{dataPiMarkdownAlert:e[1].toLowerCase()}})}for(let b of a.children??[])e(b)};e(a)}}],t=r().markdown,u={note:{icon:e.A,label:"markdownNote"},tip:{icon:f.A,label:"markdownTip"},important:{icon:g.A,label:"markdownImportant"},warning:{icon:h.A,label:"markdownWarning"},caution:{icon:i.A,label:"markdownCaution"}},v={input:function({"data-pi-markdown-progress":a,...b}){let{t:c}=(0,l.Bd)("common");if(delete b.node,"checkbox"!==b.type)return(0,d.jsx)("input",{...b});let e=a?"progress":b.checked?"completed":"pending",f=a?"[-]":b.checked?"[x]":"[ ]",g=c(a?"markdownProgress":b.checked?"markdownCompleted":"markdownPending");return(0,d.jsxs)("span",{className:r().status,"data-state":e,role:"img","aria-label":g,title:g,children:[a?(0,d.jsx)(j.A,{"aria-hidden":"true"}):b.checked?(0,d.jsx)(k.A,{"aria-hidden":"true"}):null,(0,d.jsx)("span",{className:"sr-only","aria-hidden":"true",children:f})]})},blockquote:function({"data-pi-markdown-alert":a,className:b,children:c,...e}){let{t:f}=(0,l.Bd)("common");delete e.node;let g=Object.entries(u).find(([b])=>b===a)?.[1];if(!g)return(0,d.jsx)("blockquote",{...e,"data-streamdown":"blockquote",className:(0,n.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",b),children:c});let h=g.icon;return(0,d.jsxs)("aside",{className:r().alert,role:"note","aria-label":f(g.label),children:[(0,d.jsxs)("div",{className:r().alertTitle,children:[(0,d.jsx)(h,{"aria-hidden":"true"}),f(g.label)]}),(0,d.jsx)("div",{className:r().alertBody,children:c})]})}}},55091:(a,b,c)=>{"use strict";function d(a){return/\.(md|markdown)$/i.test(a)?"markdown":/\.html?$/i.test(a)?"html":null}c.d(b,{g:()=>d})},55579:(a,b,c)=>{"use strict";c.d(b,{Fj:()=>e});let d="/project-preview";function e(a){return a?`${d}?cwd=${encodeURIComponent(a)}`:d}},57396:a=>{a.exports={tree:"l3-project-file-browser_tree__KA1C9"}},59411:(a,b,c)=>{"use strict";c.d(b,{FH:()=>i,N$:()=>j,qY:()=>p,rB:()=>l,rn:()=>m});var d=c(87883),e=c(23423),f=c(41994),g=c(62598);let h=d.Ik({cwd:e.m4,sessionCount:d.ai().int().nonnegative(),updatedAt:f.k}).strict(),i=d.Ik({forceRefresh:d.zM().default(!1)}).strict(),j=d.Ik({directories:d.YO(h)}).strict();d.Ik({cwd:e.m4,ignored:d.zM()}).strict(),d.Ik({}).strict();let k=d.Ik({cwd:e.m4,name:d.Yj().trim().min(1)}).strict(),l=d.Ik({cwd:e.m4.nullable()}).strict(),m=d.Ik({cwd:e.m4.nullable(),parentCwd:e.m4.nullable(),directories:d.YO(k)}).strict(),n=g.Jk,o=d.Ik({sessionId:e.$E,cwd:e.m4,name:d.Yj().nullable(),createdAt:f.k,updatedAt:f.k,messageCount:d.ai().int().nonnegative(),userMessageCount:d.ai().int().nonnegative(),firstMessage:d.Yj().max(160),matches:d.YO(n).min(1).max(4).nullable()}).strict();g.Gm.extend({cwd:e.m4,forceRefresh:d.zM().default(!1)});let p=d.Ik({cwd:e.m4,sessions:d.YO(o)}).strict();d.Ik({cwd:e.m4,sessionId:e.$E,query:d.Yj().trim().max(120).default(""),page:d.Ik({index:d.ai().int().positive(),size:d.ai().int().positive().max(50)}).strict()}).strict();let q=d.Ik({entryId:e.Rv,timestampMs:f.k,text:d.Yj()}).strict();d.Ik({page:d.Ik({index:d.ai().int().positive(),size:d.ai().int().positive(),total:d.ai().int().nonnegative()}).strict(),messages:d.YO(q)}).strict()},60819:(a,b,c)=>{"use strict";c.d(b,{D:()=>k});var d=c(52834),e=c(65614),f=c(9698),g=c(5701),h=c(91816),i=c(15620),j=c(91464);function k({children:a}){return(0,d.jsx)(h.JW,{children:(0,d.jsx)(e.y,{className:"isolate z-[130] outline-none",side:"right",align:"start",alignOffset:4,children:(0,d.jsx)(f._,{"data-slot":"context-menu-content",finalFocus:!1,className:(0,i.cn)(j.hD,"flex flex-col overflow-hidden p-0"),children:(0,d.jsx)(g.V,{className:"min-h-0",viewportClassName:"p-1",children:a})})})})}},61332:(a,b,c)=>{"use strict";function d(a,b,c=!0){}c.d(b,{L:()=>d}),c(49147)},62598:(a,b,c)=>{"use strict";c.d(b,{Gm:()=>i,Jk:()=>h});var d=c(87883),e=c(23423),f=c(41994);let g=d.k5(["title","user","assistant","sessionId"]),h=d.Ik({scope:g,count:d.ai().int().positive(),entryId:e.Rv.nullable(),timestampMs:f.k.nullable(),preview:d.Yj().min(1).max(160)}).strict(),i=d.Ik({query:d.Yj().trim().max(120).default(""),searchIn:d.YO(g).min(1).max(4).default(["title","user"])}).strict()},68341:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>q,ph:()=>r,Tk:()=>p});var d=c(13749),e=c(95186),f=c(59411),g=c(92494);class h{constructor(a,b){this.cwd=a,this.reader=b,this.state={snapshot:{status:"idle",repositories:[],error:null},layout:"directory",changesOnly:!1,expandedRepositories:new Set},this.listeners=new Set,this.revision=0,this.request=null,this.disposed=!1,this.subscribe=a=>(this.listeners.add(a),()=>this.listeners.delete(a)),this.getRevision=()=>this.revision}getWorkspace(a){return a===this.cwd?this.state:null}ensureSnapshot(a){return a!==this.cwd||"ready"===this.state.snapshot.status||this.request?Promise.resolve():this.load(!1)}refreshSnapshot(a){return a===this.cwd?this.load(!0):Promise.resolve()}setLayout(a,b){this.state.layout=b,this.publish()}setChangesOnly(a,b){this.state.changesOnly=b,this.publish()}toggleRepository(a,b){let c=new Set(this.state.expandedRepositories);c.has(b)?c.delete(b):c.add(b),this.state.expandedRepositories=c,this.publish()}dispose(){this.disposed=!0,this.request?.abort(),this.request=null,this.listeners.clear()}async load(a){if(this.disposed||this.request)return;let b=new AbortController;this.request=b,"ready"!==this.state.snapshot.status&&(this.state.snapshot={...this.state.snapshot,status:"loading",error:null},this.publish());try{let c=await this.reader.snapshot(b.signal,a);if(this.request!==b)return;this.state.snapshot={status:"ready",repositories:c.repositories,error:null}}catch(a){if(this.request!==b)return;this.state.snapshot={...this.state.snapshot,status:"error",error:a instanceof Error?a.message:"读取 Git 状态失败"}}this.request===b&&(this.request=null,this.publish())}publish(){if(!this.disposed)for(let a of(this.revision+=1,this.listeners))a()}}var i=c(52660),j=c(51601),k=c(21850),l=c(83731);function m(a,b){return(0,k.B)({msg:j.p["zh-CN"][a],i18n:{key:`projectHistory:${a}`,...b?{params:b}:{}}})}function n(){return{status:"idle",data:null,error:null}}class o{constructor(a,b){this.reader=a,this.files=b,this.state={repositoryRoot:null,mode:"history",tip:"HEAD",base:"",target:"HEAD",strategy:"merge-base",query:"",author:"",authorSuggestions:[],selectedCommit:null,selectedChangePath:null,branches:n(),log:n(),changes:n()},this.scroll={log:0,changes:0},this.listeners=new Set,this.requests=new Map,this.revision=0,this.disposed=!1,this.logPage=1,this.changesPage=1,this.range=null,this.selection=null,this.restoredCommit=null,this.restoredChangePath=null,this.restoredChangesScroll=null,this.queryTimer=null,this.collapsedDirectories=new Set,this.changeTree=(0,l.OA)([]),this.changeRows=[],this.changeRowHeight=36,this.subscribe=a=>(this.listeners.add(a),()=>this.listeners.delete(a)),this.getRevision=()=>this.revision}getChangeRows(){return this.changeRows}restoreBrowsing(a,b=!0){Object.assign(this.state,{repositoryRoot:a.repositoryRoot,mode:a.mode,tip:a.tip,base:a.base,target:a.target,strategy:a.strategy,query:a.query,author:a.author}),this.scroll.log=a.logScroll,this.restoredChangesScroll=a.changesScroll,this.restoredCommit=a.selectedCommit,this.restoredChangePath=a.selectedChangePath,b&&null!==a.repositoryRoot&&(this.loadBranches(),this.reload())}selectChange(a){this.state.changes.data?.items.some(b=>b.path===a)&&(this.state.selectedChangePath=a,this.publish())}toggleChangeDirectory(a){let b=this.changeRows.find(b=>b.directory?.path===a);if(b?.directory){if(b.expanded)this.collapsedDirectories.add(a);else for(let a of b.directory.paths)this.collapsedDirectories.delete(a);this.rebuildChangeRows(),this.publish()}}setScroll(a,b){this.scroll[a]=b}setChangeRowHeight(a){this.changeRowHeight!==a&&(this.scroll.changes=this.scroll.changes/this.changeRowHeight*a,this.changeRowHeight=a,this.publish())}setRepository(a){if(a===this.state.repositoryRoot){"idle"===this.state.branches.status&&(this.loadBranches(),this.reload());return}this.cancel("branches"),this.state.repositoryRoot=a,this.state.tip=this.state.target="HEAD",this.state.base="",this.state.author="",this.state.authorSuggestions=[],this.state.branches=n(),this.resetSelection(),this.loadBranches(),this.reload()}setMode(a){this.state.mode!==a&&(this.state.mode=a,this.resetSelection(),this.reload())}setRevision(a,b){this.state[a]!==b&&(this.state[a]=b,this.resetSelection(),this.reload())}setStrategy(a){this.state.strategy!==a&&(this.state.strategy=a,this.resetSelection(),this.reload())}setQuery(a){this.setLogFilter("query",a)}setAuthor(a){this.setLogFilter("author",a)}setLogFilter(a,b){this.state[a]=b,this.resetSelection(),this.queryTimer=setTimeout(()=>{this.queryTimer=null,this.reload()},220)}refresh(){this.resetSelection(),this.loadBranches(),this.reload()}async reload(){if(!this.disposed&&null!==this.state.repositoryRoot){if("compare"===this.state.mode)return this.state.base?void await this.loadChanges({base:this.state.base,target:this.state.target,strategy:this.state.strategy},1,!0):void this.publish();await this.loadLog(1)}}selectCommit(a,b){let c="string"==typeof a?a:a.oid;this.state.selectedCommit=c,this.scroll.changes=0,this.loadChanges({commit:c,...b?{parent:b}:{}},1)}showAggregate(){this.range&&(this.state.selectedCommit=null,this.loadChanges(this.range,1))}loadMoreLog(){("ready"===this.state.log.status||"error"===this.state.log.status)&&this.state.log.data?.hasMore&&!(this.state.log.data.items.length>=2e3)&&this.loadLog(this.logPage+1)}loadMoreChanges(){this.selection&&"ready"===this.state.changes.status&&this.state.changes.data?.hasMore&&this.loadChanges(this.selection,this.changesPage+1)}openChange(a){if(null===this.state.repositoryRoot)return;let b=this.state.changes.data,c=b?.items.find(b=>b.path===a);if(!b||!c)return;this.state.selectedChangePath=a,this.publish();let{original:d,target:e}=b.comparison,f=d?d.slice(0,8):m("emptyRevision"),g=m(this.state.selectedCommit||"merge-base"!==this.state.strategy?"historyDiffDirect":"historyDiffAncestor",{left:f,target:e.slice(0,8)});this.files.openDiff(this.state.repositoryRoot,a,{baseCommit:d,targetCommit:e,...c.oldPath?{oldPath:c.oldPath}:{}},g)}dispose(){for(let a of(this.disposed=!0,this.queryTimer&&clearTimeout(this.queryTimer),this.requests.values()))a.abort();this.requests.clear(),this.resetChangeTree(),this.listeners.clear()}async loadBranches(){let a=this.state.repositoryRoot;if(null===a||this.disposed)return;let b=this.begin("branches");this.state.branches={status:"loading",data:this.state.branches.data,error:null},this.publish();try{let c=await this.reader.branches(a,b.signal);if(!this.current("branches",b))return;this.state.branches={status:"ready",data:c,error:null}}catch(a){if(!this.current("branches",b))return;this.state.branches={status:"error",data:null,error:this.error(a)}}this.requests.delete("branches"),this.publish()}async loadLog(a){let b=this.state.repositoryRoot;if(this.disposed||null===b)return;let c=a>1?this.state.log.data:null,d=c?.tip??("compare"===this.state.mode?this.range?.target:this.state.tip),e=c?.exclude??("compare"===this.state.mode?this.range?.base:void 0);if(!d)return;let f=this.begin("log");this.state.log={status:"loading",data:c,error:null},this.publish();try{let g=await this.reader.log(b,{tip:d,...e?{exclude:e}:{},query:this.state.query,...this.state.author.trim()?{author:this.state.author.trim()}:{},page:{index:a,size:50}},f.signal);if(!this.current("log",f))return;for(let{author:b}of(this.logPage=a,g.items))b&&this.state.authorSuggestions.length<200&&!this.state.authorSuggestions.includes(b)&&this.state.authorSuggestions.push(b);if(this.state.log={status:"ready",data:{...g,items:[...c?.items??[],...g.items].slice(0,2e3)},error:null},1===a&&g.items[0]){let a=g.items.find(a=>a.oid===this.restoredCommit);this.restoredCommit=null,a?(this.state.selectedCommit=a.oid,this.loadChanges({commit:a.oid},1)):"history"===this.state.mode&&this.selectCommit(g.items[0])}}catch(a){if(!this.current("log",f))return;this.state.log={status:"error",data:c,error:this.error(a)}}this.requests.delete("log"),this.publish()}async loadChanges(a,b,c=!1){let d=this.state.repositoryRoot;if(this.disposed||null===d)return;let e=this.begin("changes"),f=b>1?this.state.changes.data:null;1===b&&this.resetChangeTree(),this.selection=a,this.state.changes={status:"loading",data:f,error:null},this.publish();try{let g=await this.reader.changes(d,{selection:a,page:{index:b,size:200}},e.signal);if(!this.current("changes",e))return;this.changesPage=b;let h=[...f?.items??[],...g.items];this.state.changes={status:"ready",data:{...g,items:h},error:null},this.changeTree=(0,l.OA)(h.map(a=>a.path)),null!==this.restoredChangesScroll&&(this.scroll.changes=this.restoredChangesScroll,this.restoredChangesScroll=null),this.rebuildChangeRows(),this.restoredChangePath&&h.some(a=>a.path===this.restoredChangePath)&&(this.state.selectedChangePath=this.restoredChangePath,this.restoredChangePath=null),this.selection="commit"in a?{commit:g.comparison.target,...g.commit?.selectedParent?{parent:g.commit.selectedParent}:{}}:{base:g.comparison.base,target:g.comparison.target,strategy:a.strategy},c&&"base"in this.selection&&(this.range=this.selection,this.loadLog(1))}catch(a){if(!this.current("changes",e))return;this.state.changes={status:"error",data:f,error:this.error(a)}}this.requests.delete("changes"),this.publish()}resetSelection(){this.restoredCommit=null,this.restoredChangePath=null,this.restoredChangesScroll=null,this.queryTimer&&clearTimeout(this.queryTimer),this.queryTimer=null,this.scroll.log=this.scroll.changes=0,this.cancel("log"),this.cancel("changes"),this.range=null,this.selection=null,this.state.selectedCommit=null,this.state.log=n(),this.state.changes=n(),this.resetChangeTree(),this.publish()}resetChangeTree(){this.collapsedDirectories.clear(),this.changeTree=(0,l.OA)([]),this.changeRows=[],this.state.selectedChangePath=null,this.scroll.changes=0}rebuildChangeRows(){let a=this.changeRowHeight,b=Math.floor(this.scroll.changes/a),c=this.changeRows[b],d=this.scroll.changes%a;this.changeRows=(0,l.qV)(this.changeTree,this.collapsedDirectories);let e=c?this.changeRows.findIndex(a=>a.key===c.key):-1;this.scroll.changes=e>=0?e*a+d:Math.min(this.scroll.changes,Math.max(0,(this.changeRows.length-1)*a))}begin(a){this.cancel(a);let b=new AbortController;return this.requests.set(a,b),b}cancel(a){this.requests.get(a)?.abort(),this.requests.delete(a)}current(a,b){return!this.disposed&&this.requests.get(a)===b}error(a){return a instanceof Error?a.message:m("historyReadFailed")}publish(){if(!this.disposed)for(let a of(this.revision+=1,this.listeners))a()}}function p(a,b){return(0,e.QL)(a,{path:"/api/pi/directories/list",request:f.FH,response:f.N$},{forceRefresh:!1},b)}function q(a,b,c){return(0,e.QL)(a,{path:"/api/pi/directory-entries/list",request:f.rB,response:f.rn},{cwd:b},c)}function r(a,b,c,f,j,k={}){let l=(0,e.Y4)(a,{cwd:b},k.onUnauthorized),m=new g.h(b,l,{imagePreviewMode:i.Wq,onNotice:c,reveal:(c,e="file")=>(0,d.P)(a,{cwd:b},c,e),maxTabs:20}),n=new h(b,l),p=new o(l,m),q=!1;return{files:m,git:n,history:p,restore(){if(!q&&(q=!0,n.setLayout(b,j.treeLayout),f)){for(let a of(n.setChangesOnly(b,f.changesOnly),f.expandedRepositories))n.toggleRepository(b,a);m.restoreBrowsing(f),p.restoreBrowsing(f.history,!k.lazyHistory)}},dispose(){p.dispose(),n.dispose(),m.dispose()}}}},70448:a=>{a.exports={host:"l4-code-line-markers_host__BBo2H",added:"l4-code-line-markers_added__oTNsK",modified:"l4-code-line-markers_modified__PZnY_",deletedBefore:"l4-code-line-markers_deletedBefore___1b0w",deletedAfter:"l4-code-line-markers_deletedAfter__SEoHy"}},82386:(a,b,c)=>{"use strict";c.d(b,{B3:()=>m,BK:()=>g,R:()=>f,Tr:()=>l,cu:()=>j,dC:()=>k,ix:()=>n});var d=c(51949),e=c(37222);function f(){let a=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)/16;return{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:14*a,lineHeight:Math.round(22*a)}}function g(a){let b=new MutationObserver(()=>a(f()));return b.observe(document.documentElement,{attributes:!0,attributeFilter:["data-pi-desk-display-size"]}),()=>b.disconnect()}let h=null,i=0;function j(){return h||(h=(async()=>{(0,e.fx)()?.locale==="zh-CN"&&await c.e(80880).then(c.t.bind(c,80880,23));let{monaco:a}=await Promise.all([c.e(73691),c.e(20842),c.e(82499)]).then(c.bind(c,82499));return globalThis.MonacoEnvironment={getWorker:(a,b)=>new Worker(new URL(c.p+c.u(354),c.b),{type:void 0,name:b})},a})())}function k(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}function l(a){let b=new MutationObserver(()=>a(k()));return b.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>b.disconnect()}function m(a,b,c){i+=1;let d=b.split("/").map(a=>encodeURIComponent(a)).join("/");return a.Uri.parse(`inmemory://pi-desk/${i}/${c}/${d}`)}function n(a,b){if(b>d.gB)return"plaintext";let c=a.replaceAll("\\","/").split("/").at(-1)?.toLocaleLowerCase()??"";return"dockerfile"===c?"dockerfile":"makefile"===c?"plaintext":({bat:"bat",c:"c",cc:"cpp",cjs:"javascript",cpp:"cpp",cs:"csharp",css:"css",dockerfile:"dockerfile",go:"go",h:"cpp",hpp:"cpp",htm:"html",html:"html",ini:"ini",java:"java",js:"javascript",json:"javascript",jsonl:"javascript",jsx:"javascript",kt:"kotlin",less:"less",lua:"lua",md:"markdown",mdx:"markdown",mjs:"javascript",php:"php",ps1:"powershell",py:"python",rb:"ruby",rs:"rust",scss:"scss",sh:"shell",sql:"sql",swift:"swift",toml:"ini",ts:"typescript",tsx:"typescript",txt:"plaintext",xml:"xml",yaml:"yaml",yml:"yaml"})[c.includes(".")?c.split(".").at(-1)??"":""]??"plaintext"}},82563:(a,b,c)=>{"use strict";c.d(b,{Ke:()=>j,Nt:()=>h,R6:()=>i});var d=c(52834),e=c(33023),f=c(42500),g=c(91047);function h({...a}){return(0,d.jsx)(e.N,{"data-slot":"collapsible",...a})}function i({...a}){return(0,d.jsx)(f.R,{"data-slot":"collapsible-trigger",...a})}function j({...a}){return(0,d.jsx)(g.j,{"data-slot":"collapsible-content",...a})}},82589:(a,b,c)=>{"use strict";c.d(b,{b:()=>l});var d=c(52834),e=c(99451),f=c(49147),g=c(57850),h=c(5319),i=c(9860),j=c(42704),k=c(15620);function l({value:a,options:b,onChange:c,ariaLabel:m,placeholder:n,searchPlaceholder:o,emptyText:p,disabled:q=!1,className:r}){let{t:s}=(0,g.Bd)("common"),[t,u]=(0,f.useState)(!1),v=b.find(b=>b.value===a);return(0,d.jsxs)(j.AM,{open:t,onOpenChange:u,children:[(0,d.jsx)(j.Wv,{render:(0,d.jsxs)(h.$,{type:"button",variant:"outline",role:"combobox","aria-label":m,"aria-expanded":t,disabled:q,className:(0,k.cn)("w-full min-w-0 justify-between border-input px-2.5 font-normal focus-visible:-outline-offset-2",r),children:[(0,d.jsx)("span",{className:(0,k.cn)("min-w-0 truncate",!v&&"text-muted-foreground"),children:v?.label??n??s("selectPlaceholder")}),(0,d.jsx)(e.A,{className:"text-muted-foreground"})]})}),(0,d.jsx)(j.hl,{align:"start",sideOffset:4,positionerClassName:"z-[120]",className:"w-(--anchor-width) max-w-[calc(100vw-2rem)] gap-0 p-0",children:(0,d.jsxs)(i.uB,{children:[(0,d.jsx)(i.G7,{placeholder:o??s("searchPlaceholder"),autoFocus:!0}),(0,d.jsxs)(i.oI,{className:"max-h-[min(20rem,var(--available-height))]",children:[(0,d.jsx)(i.xL,{children:p??s("noMatches")}),(0,d.jsx)(i.L$,{children:b.map(b=>(0,d.jsx)(i.h_,{value:`${b.label} ${b.description??""} ${b.value}`,"data-checked":b.value===a?"true":void 0,onSelect:()=>{c(b.value),u(!1)},children:(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate",children:b.label}),b.description?(0,d.jsx)("span",{className:"mt-0.5 block truncate text-xs text-muted-foreground",children:b.description}):null]})},b.value))})]})]})})]})}},83731:(a,b,c)=>{"use strict";function d(a,b){return`${a}:${b}`}function e(a,b){return a?`${a}/${b}`:b}function f(a,b){return a.localeCompare(b,void 0,{numeric:!0,sensitivity:"base"})}function g(a,b,c=new Set){let d=[a],e=a;for(;!c.has(e);){let a=b(e);if(!a||c.has(a)||!a.startsWith(`${e}/`))break;d.push(a),e=a}return{path:a,targetPath:e,paths:d,label:e.slice(a.lastIndexOf("/")+1)}}function h(a,b=""){let c={path:b,directories:new Map,files:[]},d=new Map([[b,c]]);for(let f of a){let a=(b?f.slice(b.length+1):f).split("/"),g=c;for(let b of a.slice(0,-1)){let a=e(g.path,b),c=d.get(a);c||(c={path:a,directories:new Map,files:[]},d.set(a,c),g.directories.set(a,c)),g=c}g.files.push(f)}return d}function i(a,b,c){return g(a,a=>{let c=b.get(a);return c&&0===c.files.length&&1===c.directories.size?c.directories.keys().next().value??null:null},c)}function j(a,b,c=""){let e=[],g=(c,h)=>{let j=a.get(c);if(j){for(let c of[...j.directories.keys()].sort(f)){let f=i(c,a),j=!f.paths.some(a=>b.has(a));e.push({key:d("directory",c),type:"directory",path:f.targetPath,label:f.label,depth:h,directory:f,expanded:j}),j&&g(f.targetPath,h+1)}for(let a of[...j.files].sort(f))e.push({key:d("file",a),type:"file",path:a,label:a.slice(a.lastIndexOf("/")+1),depth:h})}};return g(c,0),e}c.d(b,{Im:()=>d,Kn:()=>f,OA:()=>h,_J:()=>e,qV:()=>j,rk:()=>g,xV:()=>i})},84386:(a,b,c)=>{"use strict";c.d(b,{q:()=>aA});var d=c(52834),e=c(57850),f=c(35385),g=c(46505),h=c(34911),i=c(38721),j=c(22207),k=c(79918),l=c(39620),m=c(9665),n=c(97586),o=c(84912),p=c(37096),q=c(5319),r=c(39511),s=c(32772),t=c(49147),u=c(15620),v=c(14120),w=c(91816),x=c(92494),y=c(60819),z=c(49057);let A=[{scope:"current",label:"closeTab"},{scope:"others",label:"closeOtherTabs"},{scope:"right",label:"closeRightTabs"},{scope:"left",label:"closeLeftTabs"},{scope:"all",label:"closeAllTabs"}];function B(a,b){let c=a.replaceAll("\\","/").split("/"),d=b.map(a=>a.replaceAll("\\","/")).filter(a=>a!==c.join("/"));for(let a=1;a<c.length;a++){let b=c.slice(-a).join("/");if(!d.some(c=>c.split("/").slice(-a).join("/")===b))return b}return c.join("/")}function C({cwd:a,gitRuntime:b,paths:c,activePath:f,diffs:g,activeDiff:h,mobile:i,actions:j,onActivate:k,onClose:l}){let{t:m}=(0,e.Bd)("projectFiles");(0,t.useSyncExternalStore)(b.subscribe,b.getRevision,b.getRevision);let n=b.getWorkspace(a)?.snapshot,o=(0,t.useRef)(null),p=(0,t.useRef)(!1),r=[...c,...g.map(a=>[a.repositoryRoot,a.path].filter(Boolean).join("/"))],D=c.map(a=>({target:a,key:`file:${a}`,path:a,label:B(a,r),title:a,testId:`file-tab-${a}`}));for(let a of g){let b=[a.repositoryRoot,a.path].filter(Boolean).join("/"),c=a.comparison,d=c?`${c.baseCommit?.slice(0,7)??"∅"} → ${c.targetCommit.slice(0,7)}`:"",e=(0,x.Q)(a);D.push({target:a,key:`diff:${e}`,path:b,label:`${B(b,r)} \xb7 Diff`,revisions:d,title:[b,c?.oldPath,c?`${c.baseCommit??"∅"} → ${c.targetCommit}`:null].filter(Boolean).join("\n"),testId:`file-diff-tab-${b}${c?`-${e}`:""}`})}let E=h?`diff:${(0,x.Q)(h)}`:`file:${f}`;return 0===D.length?null:(0,d.jsxs)("div",{className:"flex min-w-0 max-w-full shrink-0 flex-col border-b bg-muted","data-testid":"file-tabs",children:[(0,d.jsx)("div",{className:"min-w-0 max-w-full",children:(0,d.jsx)("div",{ref:o,role:"tablist","aria-label":m("openFiles"),"aria-orientation":"horizontal",className:"relative flex min-w-0 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden overscroll-x-contain [scrollbar-color:var(--border)_transparent] [scrollbar-width:thin]",children:D.map((b,c)=>{let e=b.key===E,f="string"!=typeof b.target,g=f||n?.status!=="ready"?void 0:(0,z.lN)(a,b.path,n.repositories)?.change,h=f?m("closeDiff",{name:`${b.path.split("/").at(-1)}${b.revisions?` \xb7 ${b.revisions}`:""}`}):m("closeFile",{name:b.path.split("/").at(-1)});return(0,d.jsxs)(w.tz,{onOpenChange:(a,b)=>{a&&"pointerType"in b.event&&"touch"===b.event.pointerType&&(p.current=!0)},children:[(0,d.jsxs)(w.Rc,{render:(0,d.jsx)("div",{"data-file-tab":!0,"data-testid":b.testId,title:b.title,className:(0,u.cn)("flex shrink-0 items-center border-r text-sm transition-colors",i?"h-9":"h-8",b.revisions?"max-w-[min(100%,20rem)]":"max-w-[min(100%,15rem)]",e?"bg-background text-foreground shadow-[inset_0_-2px_0_var(--foreground)]":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),onPointerDown:a=>{"touch"===a.pointerType&&(p.current=!1)}}),children:[(0,d.jsxs)("button",{type:"button",role:"tab","aria-selected":e,className:"flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2 pl-3 pr-1 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",onFocus:a=>{var b;let c,d,e=a.currentTarget.closest("[data-file-tab]");o.current&&e&&(b=o.current,d=(c=e.offsetLeft)+e.offsetWidth,c<b.scrollLeft?b.scrollLeft=c:d>b.scrollLeft+b.clientWidth&&(b.scrollLeft=d-b.clientWidth))},onClick:()=>{if(p.current){p.current=!1;return}k(b.target)},onKeyDown:a=>{if("F10"===a.key&&a.shiftKey){a.preventDefault(),a.stopPropagation();let b=a.currentTarget.closest('[data-slot="context-menu-trigger"]');if(b){let a=b.getBoundingClientRect();b.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:a.left+a.width/2,clientY:a.top+a.height/2}))}return}let b="ArrowRight"===a.key||"ArrowDown"===a.key?1:"ArrowLeft"===a.key||"ArrowUp"===a.key?-1:0;if(!b)return;a.preventDefault();let d=(c+b+D.length)%D.length,e=o.current?.querySelectorAll('[role="tab"]');e?.[d]?.focus({preventScroll:!0})},children:[(0,d.jsx)(v.s,{path:b.path,className:"size-4 shrink-0"}),(0,d.jsx)("span",{className:(0,u.cn)("truncate",g&&(0,z.iH)(g)),children:b.label}),b.revisions?(0,d.jsx)("span",{className:"max-w-36 truncate font-mono text-xs",children:b.revisions}):null,g?(0,d.jsx)("span",{className:(0,u.cn)("shrink-0 text-xs",(0,z.iH)(g)),"aria-label":m("gitStatus",{status:(0,z.XB)(g)}),children:(0,z.XB)(g)}):null]}),(0,d.jsx)(q.$,{variant:"ghost",size:"icon",className:(0,u.cn)("shrink-0 rounded-none",i&&"size-9"),"data-testid":f?b.testId.replace("file-diff-tab-","file-diff-tab-close-"):`file-tab-close-${b.path}`,"aria-label":h,onClick:a=>{if(a.stopPropagation(),p.current){p.current=!1;return}l(b.target,"current")},children:(0,d.jsx)(s.A,{className:"size-3.5"})})]}),(0,d.jsx)(y.D,{children:A.map(({scope:a,label:e})=>(0,d.jsxs)("span",{children:["all"===a?(0,d.jsx)(w.K5,{}):null,(0,d.jsx)(w.kt,{disabled:"others"===a?D.length<=1:"left"===a?0===c:"right"===a&&c===D.length-1,onClick:()=>{p.current=!1,l(b.target,a)},children:m(e)})]},a))})]},b.key)})})}),j?(0,d.jsx)("div",{className:(0,u.cn)("flex min-h-9 min-w-0 max-w-full flex-wrap items-center justify-end gap-1 overflow-x-auto border-t bg-background p-1 [&>*]:min-w-0 [&>*]:max-w-full [&>span]:break-all [&>[role=group]]:flex-wrap",i&&"[&_button]:min-h-9 [&_button]:min-w-9"),role:"group","aria-label":m("fileActions"),children:j}):null]})}var D=c(17747),E=c(31748),F=c(51314),G=c(30340),H=c(29837),I=c(41568),J=c(79904),K=c(50599),L=c(90814),M=c(93306),N=c(87348);c(82386),c(51972);var O=c(96478);let P=(0,t.forwardRef)(function({original:a,modified:b,viewMode:c,onEscape:f,savedState:g,onSaveState:h,initialLine:i},j){let{t:k}=(0,e.Bd)("common"),{wrapLines:l,collapseUnchanged:m}=(0,O.TX)(),n=(0,t.useRef)(null),o=(0,t.useRef)(null);(0,t.useRef)({viewMode:c,wrapLines:l,collapseUnchanged:m}),(0,t.useRef)(f),(0,t.useRef)(g),(0,t.useRef)(h),(0,t.useRef)(i);let[p,q]=(0,t.useState)("loading"),[r,s]=(0,t.useState)(null);return(0,t.useImperativeHandle)(j,()=>({previousChange(){o.current?.goToDiff("previous")},nextChange(){o.current?.goToDiff("next")},focus(){o.current?.getModifiedEditor().focus()}}),[]),(0,d.jsxs)("div",{"data-testid":"code-diff",className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-background",children:[(0,d.jsx)("div",{ref:n,className:"min-h-0 flex-1"}),(0,d.jsx)("div",{role:"status","aria-label":k("diffStatus"),className:"flex min-h-6 shrink-0 items-center justify-end border-t px-3 text-xs text-muted-foreground",children:null===r?k("diffCalculating"):k("diffCount",{count:r})}),"loading"===p?(0,d.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-background text-sm text-muted-foreground",children:[(0,d.jsx)(L.A,{className:"size-4 animate-spin"})," ",k("diffLoading")]}):null,"error"===p?(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-6 text-center text-sm text-destructive",children:k("diffFailed")}):null]})});var Q=c(85544),R=c(2719),S=c(61332),T=c(59582);function U({label:a,onClick:b,active:c=!1,children:e}){return(0,d.jsxs)(T.m_,{children:[(0,d.jsx)(T.k$,{render:(0,d.jsx)(q.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":a,"aria-pressed":c||void 0,onPointerDown:a=>a.preventDefault(),onClick:b}),children:e}),(0,d.jsx)(T.ZI,{children:a})]})}var V=c(45694),W=c(45427),X=c(55091);function Y({ref:a,runtime:b,gitRuntime:c,compact:f,visible:g=!0,onEscape:h,onSwitchPane:i,renderHeader:j}){let k,m,p,r,s,u,v,w,{t:y}=(0,e.Bd)("projectFiles"),{wrapLines:A,diffViewMode:B,collapseUnchanged:C}=(0,O.TX)();(0,t.useSyncExternalStore)(b.subscribe,b.getRevision,b.getRevision);let{activeDiff:L,activePath:T}=b.state,$=!L&&T?b.state.documents.get(T):null,_=T?(0,X.g)(T):null,aa=$?.status==="text"&&(!_||"source"===$.viewMode),ab=(0,t.useRef)(null),ac=(0,t.useRef)(null),ad=(0,t.useRef)(null),ae=(0,t.useRef)(null),af=(0,R.G)();(0,t.useImperativeHandle)(a,()=>({focus(){aa?ac.current?.focus():L?ad.current?.focus():ab.current?.querySelector('[data-testid="markdown-preview"]')?.focus()}}),[L,aa]);let ag=()=>{T&&ac.current&&b.saveEditorState(T,ac.current.getViewState())},{refresh:ah,unavailable:ai}=((0,t.useSyncExternalStore)(c.subscribe,c.getRevision,c.getRevision),k=c.getWorkspace(b.cwd)?.snapshot,m=b.state.activePath,r=!!(p=b.state.activeDiff),m&&b.state.documents.get(m),s=(0,t.useRef)(ag),u=(0,t.useCallback)(()=>{m&&!r&&(s.current(),b.reloadFile(m),c.refreshSnapshot(b.cwd))},[r,c,m,b]),v=(0,t.useCallback)(()=>{p?b.refreshDiff():m&&(s.current(),b.ensureDocument(m,!0)),c.refreshSnapshot(b.cwd)},[p,c,m,b]),(0,S.L)(ab,v,g),w=m&&k?.status==="ready"?(0,z.lN)(b.cwd,m,k.repositories):null,{refresh:u,unavailable:k?.status==="error"||w?.repository.state==="unavailable"}),aj=$?.status==="text"?$.comparison:void 0,[ak,al]=(0,t.useState)(null),am=aj?.status==="ready"&&$?.status==="text"&&ak?.original===aj.original.content&&ak.modified===$.content?ak.count:void 0,an=a=>{T&&(ag(),b.openFileDiff(T,a))},ao=ai||aj?.status==="error"?y("gitMarkersFailed"):aj?.status==="unavailable"||aj?.status==="ready"&&null===am?y("gitMarkersUnavailable"):aj?.status==="loading"||aj?.status==="ready"&&void 0===am?y("gitMarkersLoading"):aj?.status==="ready"?y("gitChangesCount",{count:am}):null,ap=L||T?(0,d.jsx)(d.Fragment,{children:L?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"mr-auto shrink-0 px-1 text-xs text-muted-foreground",children:[L.label??(L.comparison?`${L.comparison.baseCommit?.slice(0,7)??"∅"} → ${L.comparison.targetCommit.slice(0,7)}`:y("headToWorking")),"text"===L.status&&L.original.content===L.modified.content?y("noDiffChanges"):""]}),(0,d.jsx)(U,{label:y("previousChange"),onClick:()=>ad.current?.previousChange(),children:(0,d.jsx)(D.A,{className:"size-4"})}),(0,d.jsx)(U,{label:y("nextChange"),onClick:()=>ad.current?.nextChange(),children:(0,d.jsx)(E.A,{className:"size-4"})}),f?null:(0,d.jsx)(U,{label:"side-by-side"===B?y("inlineDiff"):y("sideBySideDiff"),active:"inline"===B,onClick:()=>b.setDiffViewMode("side-by-side"===B?"inline":"side-by-side"),children:(0,d.jsx)(o.A,{className:"size-4"})}),(0,d.jsx)(U,{label:y(A?"wrapOff":"wrapOn"),active:A,onClick:()=>b.setDiffWrapLines(!A),children:(0,d.jsx)(F.A,{className:"size-4"})}),(0,d.jsx)(U,{label:y(C?"expandUnchanged":"collapseUnchanged"),active:C,onClick:()=>b.setDiffCollapseUnchanged(!C),children:(0,d.jsx)(G.A,{className:"size-4"})}),(0,d.jsx)(U,{label:y("reloadDiff"),onClick:()=>b.reloadDiff(),children:(0,d.jsx)(l.A,{className:"size-4"})})]}):(0,d.jsxs)(d.Fragment,{children:[_&&$?.status==="text"&&T?(0,d.jsx)("div",{className:"mr-auto flex shrink-0",role:"group","aria-label":y("markdown"===_?"markdownMode":"htmlMode"),children:["preview","source"].map(a=>(0,d.jsx)(q.$,{variant:$.viewMode===a?"secondary":"ghost",size:"sm","aria-pressed":$.viewMode===a,onClick:()=>{ag(),b.setTextViewMode(T,a)},children:y("preview"===a?"previewMode":"sourceMode")},a))}):null,aa&&ao?(0,d.jsx)("span",{"data-testid":"file-git-status",role:"status",className:"mr-auto min-w-0 truncate text-xs text-muted-foreground",title:aj?.status==="error"?aj.error:ao,children:f&&aj?.status==="ready"&&"number"==typeof am?y("gitChangesCompact",{count:am}):ao}):null,aa&&aj?.status==="ready"?(0,d.jsxs)(d.Fragment,{children:["number"==typeof am&&am>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(U,{label:y("previousChange"),onClick:()=>ac.current?.previousChange(),children:(0,d.jsx)(D.A,{className:"size-4"})}),(0,d.jsx)(U,{label:y("nextChange"),onClick:()=>ac.current?.nextChange(),children:(0,d.jsx)(E.A,{className:"size-4"})})]}):null,(0,d.jsx)(U,{label:y("viewDiff"),onClick:()=>an(),children:(0,d.jsx)(H.A,{className:"size-4"})})]}):null,aa&&T?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(U,{label:y("findInFile"),onClick:()=>ac.current?.openSearch(),children:(0,d.jsx)(I.A,{className:"size-4"})}),f?null:(0,d.jsx)(U,{label:y("goToLine"),onClick:()=>ac.current?.gotoLine(),children:(0,d.jsx)(J.A,{className:"size-4"})}),(0,d.jsx)(U,{label:y(A?"wrapOff":"wrapOn"),active:A,onClick:()=>b.setWrapLines(T,!A),children:(0,d.jsx)(F.A,{className:"size-4"})}),(0,d.jsx)(U,{label:y("copySelectionOrAll"),onClick:()=>{if($?.status!=="text")return;let a=ac.current?.getSelectionText()??"";(0,M.x)(a||$.content).then(b=>{b?af.success(y(a?"selectedCodeCopied":"allCodeCopied")):af.error(y("copyContentFailed"))})},children:(0,d.jsx)(K.A,{className:"size-4"})})]}):null,T?(0,d.jsx)(U,{label:y("reloadCurrentFile"),onClick:ah,children:(0,d.jsx)(l.A,{className:"size-4"})}):null]})}):null;return(0,d.jsxs)("div",{ref:ab,className:"flex size-full min-h-0 min-w-0 flex-col outline-none",tabIndex:-1,onFocus:a=>{a.target===a.currentTarget&&(aa?ac.current?.focus():L?ad.current?.focus():ab.current?.querySelector('[data-testid="markdown-preview"]')?.focus())},children:[j?j(ap):ap?(0,d.jsx)("div",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-end gap-2 border-b px-3 py-1","aria-label":y("fileActions"),children:ap}):null,(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden pb-[env(safe-area-inset-bottom)]",children:L?"text"===L.status?(0,d.jsx)(P,{ref:ad,original:L.original,modified:L.modified,viewMode:f?"inline":B,savedState:L.editorState,initialLine:L.initialLine,onSaveState:a=>b.saveDiffState(L,a),onEscape:h},(0,x.Q)(L)):"metadata"===L.status?(0,d.jsxs)("div",{className:"grid h-full grid-cols-1 gap-4 overflow-auto p-4 md:grid-cols-2",children:[(0,d.jsx)("pre",{className:"whitespace-pre-wrap break-all text-sm",children:L.originalMetadata}),(0,d.jsx)("pre",{className:"whitespace-pre-wrap break-all text-sm",children:L.modifiedMetadata})]}):"loading"===L.status||"unloaded"===L.status?(0,d.jsx)(Z,{}):(0,d.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-3 p-6 text-center text-sm",children:[(0,d.jsx)("p",{className:"text-muted-foreground",children:"binary"===L.status?y("binaryDiffUnavailable"):"too_large"===L.status?y("largeDiffUnavailable"):L.error}),"error"===L.status?(0,d.jsx)(q.$,{variant:"outline",onClick:()=>b.reloadDiff(),children:y("readAgain")}):null]}):T&&$?"loading"===$.status||"unloaded"===$.status?(0,d.jsx)(Z,{}):"error"===$.status?(0,d.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-3 p-6 text-center",children:[(0,d.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:$.error}),(0,d.jsx)(q.$,{variant:"outline",onClick:()=>b.reloadFile(T),children:y("readAgain")})]}):"image"===$.status?(0,d.jsx)(Q.k,{mode:"inline",slides:[{src:$.objectUrl,alt:T}],ariaLabel:y("imageViewer",{name:T.replaceAll("\\","/").split("/").at(-1)??T})},$.objectUrl):"markdown"===_&&"preview"===$.viewMode?(0,d.jsx)(W.n,{content:$.content,label:y("markdownPreview",{name:T}),savedScrollTop:$.previewScrollTop,onScroll:a=>b.savePreviewScrollTop(T,a)},T):"html"===_&&"preview"===$.viewMode?(0,d.jsx)("iframe",{ref:ae,className:"block size-full border-0 bg-white",sandbox:"allow-scripts",srcDoc:(0,V.z)($.content),title:y("htmlPreview",{name:T})}):(0,d.jsx)(N.e,{ref:ac,path:T,content:$.content,size:$.size,originalContent:aj?.status==="ready"?aj.original.content:void 0,onChanges:a=>{aj?.status==="ready"&&al({original:aj.original.content,modified:$.content,count:a})},onOpenDiff:an,savedState:$.editorState,navigation:b.pendingNavigation,onNavigation:(a,c)=>b.consumeNavigation(a,c),onSaveState:(a,c)=>b.saveEditorState(a,c),onEscape:h},T):(0,d.jsxs)("div",{"data-testid":"file-workspace-empty",className:"flex size-full flex-col items-center justify-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,d.jsx)(n.A,{className:"size-6"}),y("noOpenFile")]})})]})}function Z(){let{t:a}=(0,e.Bd)("projectFiles");return(0,d.jsxs)("div",{className:"flex size-full items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,d.jsx)(L.A,{className:"size-4 animate-spin"}),a("loadingFile")]})}var $=c(68341),_=c(1222);function aa(a){let b=window.matchMedia("(pointer: fine)");return b.addEventListener("change",a),()=>b.removeEventListener("change",a)}function ab(){return window.matchMedia("(pointer: fine)").matches}function ac(){return!1}var ad=c(79739),ae=c(53403),af=c(4998),ag=c(5701),ah=c(11071),ai=c(82589);function aj({items:a,label:b,scrollTop:c,onScroll:e,render:f,role:g="listbox",onKeyDown:h,rowHeight:i=36,onNearEnd:j,footer:k}){let l=(0,t.useRef)(null),[m,n]=(0,t.useState)({top:c,height:300}),o=Math.max(0,Math.floor(m.top/i)-8),p=Math.min(a.length,Math.ceil((m.top+m.height)/i)+8);return(0,d.jsxs)("div",{ref:l,role:g,tabIndex:"tree"===g?0:void 0,onKeyDown:h,"aria-label":b,className:"min-h-0 flex-1 overflow-auto overscroll-contain",onScroll:a=>{let b=a.currentTarget.scrollTop;n(a=>({...a,top:b})),e(b)},children:[(0,d.jsx)("div",{style:{height:a.length*i,position:"relative"},children:(0,d.jsx)("div",{style:{position:"absolute",top:o*i,left:0,right:0},children:a.slice(o,p).map((a,b)=>f(a,o+b))})}),k]})}var ak=c(37496),al=c(9365),am=c(75152),an=c(51108),ao=c(83731);let ap={added:"A",modified:"M",deleted:"D",renamed:"R","type-changed":"T"};function aq({cwd:a,repositoryRoot:b,rows:c,changes:f,selectedPath:g,scrollTop:h,rowHeight:i,onScroll:j,onSelect:k,onToggle:l,onOpen:m,onReveal:n}){let{t:p}=(0,e.Bd)("projectHistory"),r=(0,t.useRef)(null),s=(a,b)=>{a&&r.current===b&&(r.current=null,a.focus({preventScroll:!0}))},v=new Map(f.map(a=>[a.path,a]));return(0,d.jsx)(aj,{role:"tree",label:p("changeFiles"),items:c,scrollTop:h,rowHeight:i,onScroll:j,onKeyDown:a=>{if(a.defaultPrevented||!a.currentTarget.contains(a.target))return;let b=a.target instanceof Element?a.target.closest("[data-tree-key]"):null;if(a.target instanceof Element&&a.target.closest("button"))return;let d=b?c.findIndex(a=>a.key===b.dataset.treeKey):-1,e=c[d],f=d;if("ArrowDown"===a.key)f=Math.min(c.length-1,d+1);else if("ArrowUp"===a.key)f=Math.max(0,d-1);else if("Home"===a.key)f=0;else if("End"===a.key)f=c.length-1;else if("ArrowRight"===a.key&&e?.directory)e.expanded?f=Math.min(c.length-1,d+1):l(e.directory.path);else if("ArrowLeft"===a.key&&e){if(e.expanded&&e.directory)l(e.directory.path);else for(let a=d-1;a>=0;a-=1)if(c[a].depth<e.depth){f=a;break}}else{if("Enter"!==a.key&&" "!==a.key||!e)return;e.directory?l(e.directory.path):"Enter"===a.key?m(e.path):k(e.path)}a.preventDefault();let g=c[f];if(!g)return;let h=a.currentTarget;f*i<h.scrollTop?h.scrollTop=f*i:(f+1)*i>h.scrollTop+h.clientHeight&&(h.scrollTop=(f+1)*i-h.clientHeight),r.current=g.key,s([...h.querySelectorAll("[data-tree-key]")].find(a=>a.dataset.treeKey===g.key)??null,g.key)},render:c=>{let e=v.get(c.path),f=(0,ao._J)(b,c.path),h=c.directory;return(0,d.jsx)(an.J,{cwd:a,path:f,type:c.type,historical:!0,expanded:c.expanded,onToggle:h?()=>l(h.path):void 0,onOpen:"file"===c.type?()=>m(c.path):void 0,openLabel:p("viewDiff"),oldPath:"file"===c.type&&e?.oldPath?(0,ao._J)(b,e.oldPath):void 0,onReveal:n,trigger:(0,d.jsxs)("div",{ref:a=>s(a,c.key),role:"treeitem",tabIndex:0,"aria-level":c.depth+1,"aria-expanded":c.expanded,"aria-selected":"file"===c.type&&g===c.path,"data-tree-key":c.key,className:(0,u.cn)("flex min-w-0 cursor-pointer items-center gap-1 pr-1 text-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring","file"===c.type&&g===c.path&&"bg-accent"),style:{height:i,paddingLeft:4+c.depth*(24===i?12:24)},title:e?.oldPath&&"file"===c.type?`${(0,ao._J)(b,e.oldPath)} → ${f}`:f,onClick:a=>{h?a.detail<2&&l(h.path):k(c.path)},onDoubleClick:()=>{"file"===c.type&&m(c.path)},children:[h?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ak.A,{className:(0,u.cn)("size-4 shrink-0 text-muted-foreground",c.expanded&&"rotate-90")}),c.expanded?(0,d.jsx)(al.A,{className:"size-4 shrink-0 text-muted-foreground"}):(0,d.jsx)(am.A,{className:"size-4 shrink-0 text-muted-foreground"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"w-4 shrink-0"}),(0,d.jsx)("span",{className:(0,u.cn)("w-4 shrink-0 font-mono text-xs",e?.status==="added"?"text-emerald-600 dark:text-emerald-400":e?.status==="deleted"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"),"aria-label":p("gitStatus",{status:e?ap[e.status]:""}),children:e?ap[e.status]:""})]}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[c.label,"directory"===c.type&&v.has(c.path)?"/":""]}),"file"===c.type?(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost",className:24===i?"size-6":void 0,"aria-label":p("viewDiffPath",{path:c.path}),onDoubleClick:a=>a.stopPropagation(),onClick:a=>{a.stopPropagation(),m(c.path)},children:(0,d.jsx)(o.A,{className:"size-4"})}):null]})},c.key)}})}var ar=c(37259),as=c(99451),at=c(87366),au=c(97832),av=c(42704);function aw(a){let b=[],c=a;for(;c.includes("/")&&"refs"!==(c=c.slice(0,c.lastIndexOf("/")));)b.push(c);return b}function ax({branches:a,value:b,onChange:c,ariaLabel:g,placeholder:h,className:i}){let{t:j}=(0,e.Bd)("projectHistory"),{t:k}=(0,e.Bd)("common"),l=(0,t.useId)(),m=(0,t.useRef)(null),n=(0,t.useRef)(null),o=(0,t.useRef)(new Map),[p,r]=(0,t.useState)(!1),[s,v]=(0,t.useState)(""),[w,x]=(0,t.useState)(b),[y,A]=(0,t.useState)(()=>new Set(["refs/heads","refs/remotes",...aw(b)])),B=s.trim().toLocaleLowerCase(),C="HEAD"===b?j("currentHead"):b.replace(/^refs\/(heads|remotes)\//,""),D=(0,t.useMemo)(()=>{let b=[],c=[{key:"refs/heads",label:j("localBranch"),names:a?.local??[]},{key:"refs/remotes",label:j("remoteBranch"),names:a?.remote??[]}].map(a=>({...a,nodes:(0,z.oY)(a.names.filter(a=>a.toLocaleLowerCase().includes(B)))})).filter(a=>a.nodes.length>0),d=`HEAD ${j("currentHead")}`.toLocaleLowerCase().includes(B),e=c.length+Number(d);d&&b.push({key:"HEAD",label:j("currentHead"),fullName:j("currentHead"),parentKey:null,level:1,position:1,siblingCount:e,expandable:!1});let f=(a,c,d,e)=>{a.forEach((g,h)=>{let i=`${c}/${g.path}`;b.push({key:i,label:g.name,fullName:g.path,parentKey:d,level:e,position:h+1,siblingCount:a.length,expandable:g.children.length>0}),y.has(i)&&f(g.children,c,i,e+1)})};return c.forEach((a,c)=>{b.push({key:a.key,label:a.label,fullName:a.label,parentKey:null,level:1,position:c+Number(d)+1,siblingCount:e,expandable:!0}),y.has(a.key)&&f(a.nodes,a.key,a.key,2)}),b},[a,y,B,j]),E=D.find(a=>a.key===w)??D.find(a=>a.key===b)??D.find(a=>!a.expandable)??D[0],F=a=>{if(!a)return;x(a.key);let b=o.current.get(a.key);b?.focus({preventScroll:!0}),b?.scrollIntoView({block:"nearest"})},G=a=>{A(b=>{let c=new Set(b);return c.has(a.key)?c.delete(a.key):c.add(a.key),c})};return(0,d.jsxs)(av.AM,{open:p,onOpenChange:a=>{a&&(v(""),x(b),A(a=>new Set([...a,...aw(b)]))),r(a)},onOpenChangeComplete:a=>{a&&document.activeElement===m.current&&o.current.get(b)?.scrollIntoView({block:"nearest"})},children:[(0,d.jsx)(av.Wv,{render:(0,d.jsxs)(q.$,{ref:n,type:"button",variant:"outline",role:"combobox","aria-haspopup":"dialog","aria-label":g,"aria-expanded":p,title:C||h,className:(0,u.cn)("w-full min-w-0 justify-between border-input px-2.5 font-normal focus-visible:-outline-offset-2",i),children:[(0,d.jsxs)("span",{className:(0,u.cn)("flex min-w-0 flex-1 items-center gap-2",!b&&"text-muted-foreground"),children:["HEAD"===b?(0,d.jsx)(ar.A,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"}):(0,d.jsx)(f.A,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:C||h||k("selectPlaceholder")})]}),(0,d.jsx)(as.A,{className:"text-muted-foreground"})]})}),(0,d.jsxs)(av.hl,{align:"start","aria-label":g,initialFocus:m,finalFocus:n,positionerClassName:"z-[120]",className:"max-h-[min(30rem,var(--available-height))] w-[max(26rem,calc(var(--anchor-width)+8rem))] max-w-[min(calc(100vw-2rem),var(--available-width))] gap-0 overflow-hidden p-0",children:[(0,d.jsx)("div",{className:"shrink-0 border-b p-2",children:(0,d.jsx)(ah.p,{ref:m,type:"search","aria-label":k("searchPlaceholder"),"aria-controls":l,placeholder:k("searchPlaceholder"),value:s,onChange:b=>(b=>{v(b),x("");let c=b.trim().toLocaleLowerCase();if(!c)return;let d=[...(a?.local??[]).filter(a=>a.toLocaleLowerCase().includes(c)).map(a=>`refs/heads/${a}`),...(a?.remote??[]).filter(a=>a.toLocaleLowerCase().includes(c)).map(a=>`refs/remotes/${a}`)];A(a=>new Set([...a,...d.flatMap(aw)]))})(b.target.value),onKeyDown:a=>{a.nativeEvent.isComposing||a.altKey||a.ctrlKey||a.metaKey||("ArrowDown"===a.key||"ArrowUp"===a.key)&&(a.preventDefault(),a.stopPropagation(),F("ArrowDown"===a.key?E:D.at(-1)))}})}),(0,d.jsx)("div",{id:l,role:"tree","aria-label":g,className:"min-h-0 overflow-y-auto overscroll-contain p-1",children:D.map(a=>{let e=!a.expandable&&a.key===b,g=a.expandable?y.has(a.key):void 0,h=a.expandable?1===a.level?null:g?al.A:am.A:"HEAD"===a.key?ar.A:f.A;return(0,d.jsxs)("button",{ref:b=>{b?o.current.set(a.key,b):o.current.delete(a.key)},type:"button",role:"treeitem","aria-label":a.fullName,"aria-level":a.level,"aria-posinset":a.position,"aria-setsize":a.siblingCount,"aria-selected":a.expandable?void 0:e,"aria-expanded":g,tabIndex:E?.key===a.key?0:-1,title:a.fullName,className:(0,u.cn)("flex min-h-8 w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left text-sm outline-none transition-colors duration-150 hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring [@media(pointer:coarse)]:min-h-10",e&&"bg-accent text-accent-foreground",1===a.level&&a.expandable&&"font-medium text-muted-foreground"),style:{paddingLeft:8+12*Math.min(a.level-1,8)},onFocus:()=>x(a.key),onKeyDown:b=>((a,b)=>{if(a.nativeEvent.isComposing||a.altKey||a.ctrlKey||a.metaKey)return;let c=D.indexOf(b);switch(a.key){case"ArrowDown":F(D[Math.min(c+1,D.length-1)]);break;case"ArrowUp":F(D[Math.max(c-1,0)]);break;case"Home":F(D[0]);break;case"End":F(D.at(-1));break;case"ArrowRight":b.expandable&&(y.has(b.key)?F(D[c+1]):G(b));break;case"ArrowLeft":b.expandable&&y.has(b.key)?G(b):F(D.find(a=>a.key===b.parentKey));break;default:return}a.preventDefault(),a.stopPropagation()})(b,a),onClick:()=>{x(a.key),a.expandable?G(a):(c(a.key),r(!1))},children:[a.expandable?g?(0,d.jsx)(at.A,{"aria-hidden":"true",className:"size-3.5 shrink-0"}):(0,d.jsx)(ak.A,{"aria-hidden":"true",className:"size-3.5 shrink-0"}):(0,d.jsx)("span",{"aria-hidden":"true",className:"size-3.5 shrink-0"}),h?(0,d.jsx)(h,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"}):null,(0,d.jsx)("span",{className:"min-w-0 flex-1 break-all",children:a.label}),e?(0,d.jsx)(au.A,{"aria-hidden":"true",className:"size-3.5 shrink-0"}):null]},a.key)})}),D.length?null:(0,d.jsx)("p",{role:"status",className:"px-3 py-6 text-center text-sm text-muted-foreground",children:k("noMatches")}),E&&E.fullName!==E.label?(0,d.jsx)("div",{className:"max-h-24 shrink-0 overflow-y-auto border-t px-3 py-2 text-xs break-all text-muted-foreground",children:E.fullName}):null]})]})}function ay(a){let{state:b,repositories:c,projectName:f,narrow:g,scroll:h}=a,{t:i}=(0,e.Bd)("projectHistory"),{locale:j,timeZone:k}=(0,af.i)(),m=(0,t.useMemo)(()=>new Intl.DateTimeFormat("en"===j?"en-US":"zh-CN",{timeZone:k,month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),[j,k]),n=(0,t.useMemo)(()=>new Intl.DateTimeFormat("en"===j?"en-US":"zh-CN",{timeZone:k,timeZoneName:"shortOffset",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),[j,k]),o=(0,t.useId)(),{mobilePane:r,onMobilePane:s}=a,v=b.changes.data,w=`${b.repositoryRoot}:${v?.comparison.original}:${v?.comparison.target}`,x=b.selectedChangePath,y=b.branches.data?.upstream,z=v?.commit,A=(c,e=a.onRefresh)=>c?(0,d.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center gap-2 p-3 text-sm text-destructive",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 break-words",children:c}),(0,d.jsx)(q.$,{size:"sm",variant:"outline",onClick:e,children:i("retry")}),"compare"===b.mode&&"merge-base"===b.strategy?(0,d.jsx)(q.$,{size:"sm",variant:"outline",onClick:()=>a.onStrategy("direct"),children:i("compareDirect")}):null]}):null,B=(0,d.jsx)("div",{className:"flex size-full min-h-0 min-w-0 flex-col",children:(0,d.jsx)(aj,{items:b.log.data?.items??[],label:i("commitList"),scrollTop:h.log,onScroll:b=>a.onScroll("log",b),onNearEnd:"ready"===b.log.status&&b.log.data?.hasMore&&b.log.data.items.length<2e3?a.onMoreLog:void 0,footer:(0,d.jsxs)(d.Fragment,{children:[A(b.log.error,b.log.data?a.onMoreLog:a.onRefresh),"loading"===b.log.status?(0,d.jsxs)("div",{role:"status",className:"flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",children:[(0,d.jsx)(L.A,{className:"size-4 animate-spin"}),i("loadingCommits")]}):null,"ready"!==b.log.status||b.log.data?.items.length?null:(0,d.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:b.query||b.author?i("noMatchingCommits"):i("noCommits")}),b.log.data?.truncated?(0,d.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:i("scanLimit")}):(b.log.data?.items.length??0)>=2e3?(0,d.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:i("loadedLimit")}):"ready"===b.log.status&&b.log.data?.items.length&&!b.log.data.hasMore?(0,d.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:i("noMoreCommits")}):null]}),render:c=>(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b.selectedCommit===c.oid,className:(0,u.cn)("flex h-9 w-full items-center gap-3 border-b border-border/40 px-3 text-left text-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",b.selectedCommit===c.oid&&"bg-accent"),onClick:()=>{var b;return b=c.oid,void(a.onCommit(b),g&&s("files"))},title:`${c.subject}
|
|
14
14
|
${c.oid}
|
|
15
|
-
${c.author} \xb7 ${n.format(c.timestampMs)}`,children:[(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[c.subject||i("noCommitMessage"),c.refs.length?(0,d.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:c.refs.join(" \xb7 ")}):null]}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:c.oid.slice(0,7)}),g?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"w-20 truncate text-xs text-muted-foreground",children:c.author}),(0,d.jsx)("time",{className:"w-28 shrink-0 text-right text-xs text-muted-foreground",children:m.format(c.timestampMs)})]})]},c.oid)},`${b.repositoryRoot}:${b.mode}:${b.tip}:${b.base}:${b.target}:${b.query}:${b.author}`)}),C=(0,d.jsxs)("div",{className:"flex size-full min-h-0 min-w-0 flex-col",children:[(0,d.jsxs)("div",{className:"flex min-h-9 shrink-0 flex-wrap items-center gap-2 border-b px-3 py-1",children:[g?(0,d.jsx)(q.$,{variant:"ghost",size:"icon-sm","aria-label":i("backCommits"),onClick:()=>s("log"),children:(0,d.jsx)(ad.A,{className:"size-4"})}):null,(0,d.jsx)("span",{className:"text-sm font-medium",children:b.selectedCommit?i("commitChanges"):i("cumulativeChanges")}),v?(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("loadedFiles",{count:v.items.length})}):null,"compare"===b.mode&&b.selectedCommit?(0,d.jsx)(q.$,{variant:"ghost",size:"sm",onClick:a.onAggregate,children:i("backCumulative")}):null]}),A(b.changes.error),"loading"===b.changes.status?(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,d.jsx)(L.A,{className:"size-4 animate-spin"}),i("loadingChanges")]}):null,(0,d.jsxs)(p.HK,{orientation:"vertical",defaultLayout:{"project-changes":a.panelSizes.changes,"project-detail":100-a.panelSizes.changes},onLayoutChanged:(b,c)=>{c.isUserInteraction&&void 0!==b["project-changes"]&&a.onPanelSize("changes",b["project-changes"])},children:[(0,d.jsx)(p.wV,{id:"project-changes",defaultSize:`${a.panelSizes.changes}%`,minSize:"80px",children:(0,d.jsxs)("div",{className:"flex size-full min-h-0 flex-col",children:[(0,d.jsx)(aq,{cwd:a.cwd,repositoryRoot:b.repositoryRoot??"",rows:a.changeRows,rowHeight:a.changeRowHeight,changes:v?.items??[],selectedPath:x,scrollTop:h.changes,onScroll:b=>a.onScroll("changes",b),onSelect:a.onSelectChange,onToggle:a.onToggleDirectory,onOpen:a.onOpenFile,onReveal:a.onReveal},w),"ready"!==b.changes.status||v?.items.length?null:(0,d.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:i("noDiff")}),v?.hasMore?(0,d.jsx)(q.$,{size:"sm",variant:"ghost",disabled:"loading"===b.changes.status,onClick:a.onMoreChanges,children:i("loadMoreFiles")}):null,v?.truncated?(0,d.jsx)("p",{className:"p-3 text-xs text-muted-foreground",children:i("changesLimit")}):null]})}),(0,d.jsx)(p.WM,{}),(0,d.jsx)(p.wV,{id:"project-detail",defaultSize:`${100-a.panelSizes.changes}%`,minSize:"60px",children:(0,d.jsxs)(ag.V,{className:"h-full",viewportClassName:"p-3 text-sm",role:"region","aria-label":i("commitDetails"),children:[z?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"mb-3 whitespace-pre-wrap break-words font-sans leading-relaxed",children:z.message}),(0,d.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 break-all font-mono text-xs",children:z.oid}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":i("copySha"),onClick:()=>a.onCopy(z.oid),children:(0,d.jsx)(K.A,{className:"size-4"})})]}),(0,d.jsxs)("p",{className:"mb-3 text-xs text-muted-foreground",children:[z.author," \xb7 ",n.format(z.timestampMs)]}),z.parents.length>1?(0,d.jsx)(ai.b,{className:"mb-3",ariaLabel:i("compareParent"),value:z.selectedParent??"",options:z.parents.map((a,b)=>({value:a,label:i("parentCommit",{count:b+1,oid:a.slice(0,10)})})),onChange:b=>a.onCommit(z.oid,b)}):null]}):v?(0,d.jsxs)("div",{className:"space-y-2 text-xs text-muted-foreground",children:[(0,d.jsx)("p",{children:"merge-base"===b.strategy?i("mergeBaseToTarget"):i("baseToTarget")}),(0,d.jsx)("p",{className:"break-all font-mono",children:v.comparison.original??i("emptyRevision")}),(0,d.jsx)("p",{className:"break-all font-mono",children:v.comparison.target})]}):(0,d.jsx)("p",{className:"text-muted-foreground",children:i("selectCommit")}),x?(0,d.jsx)("p",{className:"mt-3 break-all font-mono text-xs text-muted-foreground",children:x}):null]})})]})]});return(0,d.jsxs)("section",{className:"flex size-full min-h-0 min-w-0 flex-col","aria-label":i("historyAndCompare"),children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b px-3 py-2",children:[(0,d.jsxs)("div",{className:"flex gap-1",role:"group","aria-label":i("viewMode"),children:[(0,d.jsx)(q.$,{size:"sm",variant:"history"===b.mode?"secondary":"ghost","aria-pressed":"history"===b.mode,onClick:()=>{a.onMode("history"),s("log")},children:i("historyMode")}),(0,d.jsx)(q.$,{size:"sm",variant:"compare"===b.mode?"secondary":"ghost","aria-pressed":"compare"===b.mode,onClick:()=>{a.onMode("compare"),s("log")},children:i("compareMode")})]}),(0,d.jsx)(ai.b,{className:"w-44",ariaLabel:i("selectRepository"),value:b.repositoryRoot??"",options:c.map(a=>({value:a.root,label:a.root||f,description:"unavailable"===a.state?(0,ae.fD)(a.message,j):void 0})),onChange:a.onRepository}),"history"===b.mode?(0,d.jsx)(ax,{className:"w-48",ariaLabel:i("viewBranch"),value:b.tip,branches:b.branches.data,onChange:b=>a.onRevision("tip",b)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ax,{className:"w-44",ariaLabel:i("baseBranch"),placeholder:i("chooseBase"),value:b.base,branches:b.branches.data,onChange:b=>a.onRevision("base",b)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"→"}),(0,d.jsx)(ax,{className:"w-44",ariaLabel:i("targetBranch"),value:b.target,branches:b.branches.data,onChange:b=>a.onRevision("target",b)}),(0,d.jsx)(ai.b,{className:"w-48",ariaLabel:i("comparison"),value:b.strategy,options:[{value:"merge-base",label:i("introducedChanges")},{value:"direct",label:i("directComparison")}],onChange:b=>a.onStrategy("direct"===b?"direct":"merge-base")}),g?(0,d.jsx)(q.$,{size:"sm",variant:"outline",onClick:()=>s("files"),children:i("cumulativeChanges")}):null]}),(0,d.jsx)(ah.p,{className:"w-40 shrink-0","aria-label":i("filterAuthor"),placeholder:i("author"),list:o,value:b.author,onChange:b=>a.onAuthor(b.target.value)}),(0,d.jsx)("datalist",{id:o,children:b.authorSuggestions.map(a=>(0,d.jsx)("option",{value:a},a))}),(0,d.jsx)(ah.p,{className:"min-w-32 flex-1 basis-40","aria-label":i("searchCommits"),placeholder:i("searchCommits"),value:b.query,onChange:b=>a.onQuery(b.target.value)}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":i("refreshGit"),onClick:a.onRefresh,children:(0,d.jsx)(l.A,{className:"size-4"})})]}),b.branches.error?A(b.branches.error):null,y?(0,d.jsxs)("p",{className:"shrink-0 truncate border-b px-3 py-1 text-xs text-muted-foreground",title:y.ref,children:[y.ref.replace("refs/remotes/","")," \xb7 ",i("localRecord")," \xb7"," ",null===y.ahead||null===y.behind?i("refUnavailable"):i("aheadBehind",{ahead:y.ahead,behind:y.behind})]}):null,"compare"!==b.mode||b.base?g?"log"===r?B:C:(0,d.jsxs)(p.HK,{orientation:"horizontal",defaultLayout:{"project-log":a.panelSizes.log,"project-files":100-a.panelSizes.log},onLayoutChanged:(b,c)=>{c.isUserInteraction&&void 0!==b["project-log"]&&a.onPanelSize("log",b["project-log"])},children:[(0,d.jsx)(p.wV,{id:"project-log",defaultSize:`${a.panelSizes.log}%`,minSize:"30%",children:B}),(0,d.jsx)(p.WM,{}),(0,d.jsx)(p.wV,{id:"project-files",defaultSize:`${100-a.panelSizes.log}%`,minSize:"25%",children:C})]}):(0,d.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:i("chooseBaseBranch")})]})}let az=()=>{};function aA({clientId:a,cwd:b,title:c,actions:s,onEscape:u=az,onUnauthorized:v}){let{t:w}=(0,e.Bd)("projectHistory"),x=(0,R.G)(),{files:y,git:z,history:A,global:B,updateGlobal:D,page:E,setPage:F,historyPane:G,setHistoryPane:H,setContainer:I,narrow:J,stacked:K,width:L,changeRowHeight:N,openGit:O,refresh:P}=function(a,b,c){let d=(0,R.G)(),[e]=(0,t.useState)(_.N1),[f,g]=(0,t.useState)(e),h=(0,t.useCallback)(a=>{g(b=>({...b,...a})),(0,_.Ms)({...(0,_.N1)(),...a})},[]),[i]=(0,t.useState)(()=>(0,_.tQ)(b)),[j]=(0,t.useState)(()=>(0,$.ph)(a,b,a=>d.show({level:"info",title:a}),i,e,{lazyHistory:!0,onUnauthorized:c})),{files:k,git:l,history:m}=j;(0,t.useSyncExternalStore)(k.subscribe,k.getRevision,k.getRevision),(0,t.useSyncExternalStore)(l.subscribe,l.getRevision,l.getRevision),(0,t.useSyncExternalStore)(m.subscribe,m.getRevision,m.getRevision);let[n,o]=(0,t.useState)(i?.page??"files"),[p,q]=(0,t.useState)(i?.historyPane??"log"),[r,s]=(0,t.useState)({width:1200,height:800}),[u,v]=(0,t.useState)(null);(0,t.useRef)(!1),(0,t.useRef)(()=>void 0);let w=r.width<900,x=w||r.height<680;l.getWorkspace(b).snapshot.repositories;let y=k.state,z=(0,t.useSyncExternalStore)(aa,ab,ac),A=f.gitOpen&&(!x||"git"===n);return{files:k,git:l,history:m,global:f,updateGlobal:h,page:n,setPage:o,historyPane:p,setHistoryPane:q,setContainer:v,narrow:w,stacked:x,width:r.width,changeRowHeight:z?24:36,openGit(a){h({gitOpen:!0}),o("git"),void 0!==a&&m.setRepository(a)},refresh(){k.refreshTree(),l.refreshSnapshot(b),y.activeDiff?k.reloadDiff():y.activePath&&k.reloadFile(y.activePath),A&&m.refresh()}}}(a,b,v),{directoryOpen:Q,gitOpen:S,gitMaximized:T}=B,U=b.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??b,V=z.getWorkspace(b),W=V.snapshot.repositories,X=y.state,Z=(0,d.jsx)(r.F,{cwd:b,projectName:U,showRootTitle:!1,runtime:y,gitRuntime:z,onOpenGitBranches:O,onFileOpened:()=>F("code")}),ad=(0,d.jsx)(Y,{runtime:y,gitRuntime:z,compact:L<1100,onEscape:u,renderHeader:a=>(0,d.jsx)(C,{cwd:b,gitRuntime:z,paths:X.tabs,activePath:X.activePath,diffs:X.diffs,activeDiff:X.activeDiff,mobile:J,actions:a,onActivate:a=>{"string"==typeof a?y.openFile(a):y.openDiff(a.repositoryRoot,a.path,a.comparison)},onClose:(a,b)=>y.closeTabs(a,b)})}),ae=(0,d.jsxs)("div",{className:"flex size-full min-h-0 min-w-0 flex-col",children:[(0,d.jsxs)("div",{className:"flex h-9 shrink-0 items-center gap-2 border-b bg-muted px-3",children:[(0,d.jsx)(f.A,{className:"size-4"}),(0,d.jsx)("span",{className:"flex-1 text-sm font-medium",children:"Git"}),K?null:(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w(T?"restoreGit":"maximizeGit"),onClick:()=>D({gitMaximized:!T}),children:T?(0,d.jsx)(g.A,{className:"size-4"}):(0,d.jsx)(h.A,{className:"size-4"})}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w("collapseGit"),onClick:()=>{D({gitOpen:!1,gitMaximized:!1}),F("code")},children:(0,d.jsx)(i.A,{className:"size-4"})})]}),W.length?(0,d.jsx)(ay,{state:A.state,cwd:b,changeRows:A.getChangeRows(),changeRowHeight:N,onSelectChange:a=>A.selectChange(a),onToggleDirectory:a=>A.toggleChangeDirectory(a),onReveal:(a,b)=>y.revealFile(a,b),repositories:W,projectName:U,narrow:J,mobilePane:G,onMobilePane:H,scroll:A.scroll,onScroll:(a,b)=>A.setScroll(a,b),panelSizes:{log:B.logSize,changes:B.changeSize},onPanelSize:(a,b)=>D("log"===a?{logSize:b}:{changeSize:b}),onRepository:a=>{A.setRepository(a),H("log")},onMode:a=>A.setMode(a),onRevision:(a,b)=>A.setRevision(a,b),onStrategy:a=>A.setStrategy(a),onQuery:a=>A.setQuery(a),onAuthor:a=>A.setAuthor(a),onCommit:(a,b)=>A.selectCommit(a,b),onAggregate:()=>A.showAggregate(),onMoreLog:()=>A.loadMoreLog(),onMoreChanges:()=>A.loadMoreChanges(),onOpenFile:a=>{A.openChange(a),F("code"),D({gitMaximized:!1})},onRefresh:()=>A.refresh(),onCopy:a=>{(0,M.x)(a).then(a=>{a||x.error(w("copyFailed"))})}}):(0,d.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:"loading"===V.snapshot.status||"idle"===V.snapshot.status?w("findingGit"):V.snapshot.error??w("noGit")})]}),af=(0,d.jsxs)(p.HK,{orientation:"horizontal",defaultLayout:Q?{"project-tree":B.directorySize,"project-code":100-B.directorySize}:void 0,onLayoutChanged:(a,b)=>{b.isUserInteraction&&void 0!==a["project-tree"]&&D({directorySize:a["project-tree"]})},children:[Q?(0,d.jsx)(p.wV,{id:"project-tree",defaultSize:`${B.directorySize}%`,minSize:"180px",maxSize:"40%",children:Z}):null,Q?(0,d.jsx)(p.WM,{}):null,(0,d.jsx)(p.wV,{id:"project-code",minSize:"40%",children:ad})]},Q?"tree-visible":"tree-hidden");return(0,d.jsxs)("div",{ref:I,className:"flex size-full min-h-0 min-w-0 flex-col overflow-hidden","data-testid":"project-preview",children:[(0,d.jsxs)("header",{className:"flex min-h-9 shrink-0 items-center gap-1 bg-muted px-2 py-1 pt-[max(4px,env(safe-area-inset-top))]",children:[K?null:(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w(Q?"collapseDirectory":"expandDirectory"),onClick:()=>D({directoryOpen:!Q}),children:Q?(0,d.jsx)(j.A,{className:"size-4"}):(0,d.jsx)(k.A,{className:"size-4"})}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-baseline gap-3",title:b,children:[(0,d.jsx)("div",{className:"min-w-0 shrink-0 max-w-[50%] max-sm:max-w-full max-sm:shrink",children:c??(0,d.jsx)("h1",{className:"truncate text-sm font-semibold",children:U})}),(0,d.jsx)("p",{className:"min-w-0 truncate text-xs text-muted-foreground max-sm:hidden",children:b})]}),(0,d.jsxs)(q.$,{size:"sm",variant:S?"secondary":"ghost","aria-pressed":S,onClick:()=>O(),children:[(0,d.jsx)(f.A,{className:"size-4"}),(0,d.jsx)("span",{className:"max-sm:hidden",children:w("gitRecords")})]}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w("refreshPreview"),onClick:P,children:(0,d.jsx)(l.A,{className:"size-4"})}),s]}),V.snapshot.error?(0,d.jsx)("p",{role:"alert",className:"shrink-0 border-b px-3 py-2 text-sm text-destructive",children:V.snapshot.error}):null,K?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex shrink-0 gap-1 px-2 py-1",role:"group","aria-label":w("previewArea"),children:[(0,d.jsxs)(q.$,{size:"sm",variant:"files"===E?"secondary":"ghost",onClick:()=>F("files"),children:[(0,d.jsx)(m.A,{className:"size-4"}),w("files")]}),(0,d.jsxs)(q.$,{size:"sm",variant:"code"===E?"secondary":"ghost",onClick:()=>F("code"),children:[(0,d.jsx)(n.A,{className:"size-4"}),w("code")]}),(0,d.jsxs)(q.$,{size:"sm",variant:"git"===E?"secondary":"ghost",onClick:()=>O(),children:[(0,d.jsx)(o.A,{className:"size-4"}),"Git"]})]}),(0,d.jsx)("div",{className:"min-h-0 flex-1",children:"files"===E?Z:"git"===E?ae:ad})]}):T&&S?ae:(0,d.jsxs)(p.HK,{orientation:"vertical",defaultLayout:S?{"project-main":100-B.gitSize,"project-git":B.gitSize}:void 0,onLayoutChanged:(a,b)=>{b.isUserInteraction&&void 0!==a["project-git"]&&D({gitSize:a["project-git"]})},children:[(0,d.jsx)(p.wV,{id:"project-main",defaultSize:S?`${100-B.gitSize}%`:"100%",minSize:"35%",children:af}),S?(0,d.jsx)(p.WM,{}):null,S?(0,d.jsx)(p.wV,{id:"project-git",defaultSize:`${B.gitSize}%`,minSize:"300px",children:ae}):null]},S?"git-visible":"git-hidden")]})}},85544:(a,b,c)=>{"use strict";c.d(b,{k:()=>h});var d=c(52834);c(84593);var e=c(49147),f=c(15620),g=c(4998);function h(a){let{locale:b}=(0,g.i)(),{slides:c,index:h=0,onIndexChange:i,className:j,thumbnails:k=!0,ariaLabel:l="en"===b?"Image preview":"图片预览"}=a,m="inline"===a.mode,n="inline"===a.mode||a.open,o="modal"===a.mode?a.onClose:void 0;c.length;let p=Math.min(Math.max(h,0),Math.max(c.length-1,0)),q=`pi-desk-image-viewer-${(0,e.useId)().replaceAll(":","")}`,r=(0,e.useRef)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null);if((0,e.useRef)(""),(0,e.useRef)(""),(0,e.useRef)(p),(0,e.useRef)(p),(0,e.useRef)(i),(0,e.useRef)(o),(0,e.useMemo)(()=>JSON.stringify(c.map(a=>[a.src,a.alt])),[c]),(0,f.cn)("pi-desk-image-viewer",m?"pi-desk-image-viewer-inline":"pi-desk-image-viewer-modal",q,j),0===c.length||!n)return null;let u=(0,d.jsx)("span",{ref:r,className:"pi-desk-image-viewer-source","aria-hidden":"true",children:c.map((a,b)=>(0,d.jsx)("img",{src:a.src,alt:a.alt,width:a.width,height:a.height,decoding:"async",draggable:!1},b))});return m?(0,d.jsx)("div",{ref:s,className:"pi-desk-image-viewer-host",role:"region","aria-label":l,tabIndex:0,onKeyDown:a=>{let b=t.current;!b||b.fulled||a.altKey||a.ctrlKey||a.metaKey||a.nativeEvent.isComposing||("ArrowLeft"===a.key||"ArrowRight"===a.key)&&(a.preventDefault(),a.stopPropagation(),"ArrowLeft"===a.key?b.prev(!1):b.next(!1))},children:u}):u}},87348:(a,b,c)=>{"use strict";c.d(b,{e:()=>k});var d=c(52834),e=c(90814),f=c(49147),g=c(57850);c(82386),c(51972);var h=c(96478),i=c(70448),j=c.n(i);let k=(0,f.forwardRef)(function({path:a,content:b,size:c,savedState:i,onSaveState:k,onEscape:l,originalContent:m,onChanges:n,onOpenDiff:o,navigation:p,onNavigation:q},r){let{t:s}=(0,g.Bd)("common"),{t:t}=(0,g.Bd)("projectFiles"),{wrapLines:u}=(0,h.TX)(),v=(0,f.useRef)(null),w=(0,f.useRef)(null);(0,f.useRef)(k),(0,f.useRef)(u),(0,f.useRef)(i),(0,f.useRef)(l);let x=(0,f.useRef)(null);(0,f.useRef)(n),(0,f.useRef)(o),(0,f.useRef)(q);let y=(0,f.useRef)(null),z=(0,f.useRef)(null);(0,f.useCallback)(a=>{let b=z.current;y.current?.clear(),null===b||b>(a.getModel()?.getLineCount()??0)||(y.current??=a.createDecorationsCollection(),y.current.set([{range:{startLineNumber:b,startColumn:1,endLineNumber:b,endColumn:1},options:{isWholeLine:!0,className:"bg-accent"}}]))},[]);let[A,B]=(0,f.useState)("loading");return(0,f.useImperativeHandle)(r,()=>({openSearch(){w.current?.getAction("actions.find")?.run()},gotoLine(){w.current?.getAction("editor.action.gotoLine")?.run()},getSelectionText(){let a=w.current,b=a?.getModel(),c=a?.getSelection();return b&&c&&!c.isEmpty()?b.getValueInRange(c):""},getViewState:()=>w.current?.saveViewState()??null,focus(){w.current?.focus()},previousChange(){x.current?.previousChange()},nextChange(){x.current?.nextChange()}}),[]),(0,d.jsxs)("div",{"data-testid":"code-preview",className:"relative h-full min-h-0 w-full overflow-hidden bg-background",children:[(0,d.jsx)("div",{ref:v,className:`size-full ${j().host}`}),"loading"===A?(0,d.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-background text-sm text-muted-foreground",children:[(0,d.jsx)(e.A,{className:"size-4 animate-spin"})," ",s("codeLoading")]}):null,"error"===A?(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-6 text-center text-sm text-destructive",children:s("codeFailed")}):null]})})},89101:(a,b,c)=>{"use strict";c.d(b,{Ik:()=>n,MG:()=>j,Sq:()=>l,iV:()=>o,oR:()=>p});var d=c(52834);c(49147);var e=c(80546),f=c(15620),g=c(5319),h=c(11071),i=c(13221);function j({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,f.cn)("group/input-group relative flex min-h-8 w-full min-w-0 items-center rounded-lg border border-input bg-card transition-colors duration-150 outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-muted has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:outline-solid has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-2 has-[[data-slot=input-group-control]:focus-visible]:outline-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",a),...b})}let k=(0,e.F)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function l({className:a,align:b="inline-start",...c}){return(0,d.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":b,className:(0,f.cn)(k({align:b}),a),onClick:a=>{a.target.closest("button")||a.currentTarget.parentElement?.querySelector("input")?.focus()},...c})}let m=(0,e.F)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"min-h-7 gap-2 rounded-md px-2",sm:"","icon-xs":"size-7 rounded-md p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function n({className:a,type:b="button",variant:c="ghost",size:e="xs",...h}){return(0,d.jsx)(g.$,{type:b,"data-size":e,variant:c,className:(0,f.cn)(m({size:e}),a),...h})}function o({className:a,...b}){return(0,d.jsx)(h.p,{"data-slot":"input-group-control",className:(0,f.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",a),...b})}function p({className:a,...b}){return(0,d.jsx)(i.T,{"data-slot":"input-group-control",className:(0,f.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",a),...b})}},91464:(a,b,c)=>{"use strict";c.d(b,{S6:()=>d,dQ:()=>e,hD:()=>f});let d="relative flex min-h-7 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-sm leading-5 outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e="data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive",f="z-50 max-h-(--available-height) min-w-60 max-w-[calc(100vw-2rem)] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none transition-[opacity,transform] duration-100 ease-out data-starting-style:scale-[0.98] data-starting-style:opacity-0 data-ending-style:scale-[0.98] data-ending-style:opacity-0 motion-reduce:transition-none"},91816:(a,b,c)=>{"use strict";c.d(b,{Ip:()=>q,JW:()=>o,K5:()=>s,Rc:()=>p,kt:()=>r,tz:()=>n});var d=c(52834);c(49147);var e=c(49067),f=c(10962),g=c(48329),h=c(65614),i=c(9698),j=c(16484),k=c(36089),l=c(15620),m=c(91464);function n({...a}){return(0,d.jsx)(e.D,{"data-slot":"context-menu",...a})}function o({...a}){return(0,d.jsx)(f.g,{"data-slot":"context-menu-portal",...a})}function p({className:a,...b}){return(0,d.jsx)(g.R,{"data-slot":"context-menu-trigger",className:(0,l.cn)("select-none",a),...b})}function q({className:a,align:b="start",alignOffset:c=4,side:e="right",sideOffset:g=0,finalFocus:j=!1,...k}){return(0,d.jsx)(f.g,{children:(0,d.jsx)(h.y,{className:"isolate z-50 outline-none",align:b,alignOffset:c,side:e,sideOffset:g,children:(0,d.jsx)(i._,{"data-slot":"context-menu-content",finalFocus:j,className:(0,l.cn)(m.hD,a),...k})})})}function r({className:a,inset:b,variant:c="default",...e}){return(0,d.jsx)(j.D,{"data-slot":"context-menu-item","data-inset":b,"data-variant":c,className:(0,l.cn)(m.S6,m.dQ,"group/context-menu-item",a),...e})}function s({className:a,...b}){return(0,d.jsx)(k.w,{"data-slot":"context-menu-separator",className:(0,l.cn)("-mx-1 my-1 h-px bg-border",a),...b})}},92494:(a,b,c)=>{"use strict";c.d(b,{Q:()=>m,h:()=>q});var d=c(89172),e=c(21850),f=c(28661),g=c(96478),h=c(95186),i=c(55091),j=c(83731);let k={scope:"all",caseSensitive:!1,wholeWord:!1,regex:!1};function l(a){return{...a,status:a.query.trim()?"loading":"idle",fileMatches:[],contentMatches:[],truncated:!1,error:null}}function m(a){return JSON.stringify([a.repositoryRoot,a.path,a.comparison?.baseCommit??null,a.comparison?.targetCommit??null,a.comparison?.oldPath??null])}function n(a,b){return(0,e.B)({msg:d.C["zh-CN"][a],i18n:{key:`projectFiles:${a}`,...b?{params:b}:{}}})}function o(a){return a instanceof Error?a.message:n("projectReadFailed")}async function p(a,b){if(a.type!==b.type||a.size!==b.size)return!1;let[c,d]=await Promise.all([a.arrayBuffer(),b.arrayBuffer()]),e=new Uint8Array(d);return new Uint8Array(c).every((a,b)=>a===e[b])}class q{constructor(a,b,c){this.cwd=a,this.reader=b,this.options=c,this.state={tabs:[],activePath:null,directories:new Map,expandedPaths:new Set,treeScrollTop:0,search:l({query:"",...k}),searchOpen:!1,documents:new Map,diffs:[],activeDiff:null},this.listeners=new Set,this.directoryRequests=new Map,this.compactRequests=new Map,this.documentRequests=new Map,this.closeMissing=new Set,this.restoredTabs=new Set,this.restoredEditorStates=new Map,this.restoredFileViewModes=new Map,this.restoredPreviewScrollTops=new Map,this.searchRequest=null,this.navigation=null,this.diffRequests=new Map,this.revision=0,this.disposed=!1,this.subscribe=a=>(this.listeners.add(a),()=>this.listeners.delete(a)),this.getRevision=()=>this.revision}setSearchOpen(a){this.disposed||this.state.searchOpen===a||(this.cancelSearch(),this.state.searchOpen=a,this.state.search=l({...this.searchInput(),scope:a?"all":this.state.search.scope}),this.publish())}get pendingNavigation(){let a=this.state.activePath;return a&&!this.documentRequests.has(a)?this.navigation:null}consumeNavigation(a,b){this.navigation===a&&(this.navigation=null,b||this.options.onNotice?.(n("searchLineUnavailable")),this.publish())}get canReveal(){return!!this.options.reveal}getBrowsingDocumentSettings(){let a={},b={};for(let c of this.state.tabs){let d=this.state.documents.get(c),e=d?.status==="text"?d.editorState:this.restoredEditorStates.get(c);e&&JSON.stringify(e).length<32768&&(a[c]=e);let f=d?.status==="text"?d.viewMode:this.restoredFileViewModes.get(c);f&&(b[c]=f)}return{editorStates:a,fileViewModes:b}}restoreBrowsing(a){if(this.disposed)return;for(let b of(this.state.tabs=a.tabs.slice(0,this.options.maxTabs),this.state.tabs)){this.restoredTabs.add(b);let c=a.editorStates[b];c&&this.restoredEditorStates.set(b,c);let d=a.fileViewModes[b];d&&this.restoredFileViewModes.set(b,d)}for(let b of(this.state.activePath=a.activePath&&this.state.tabs.includes(a.activePath)?a.activePath:null,this.state.expandedPaths=new Set(a.expandedPaths),this.state.treeScrollTop=a.treeScrollTop,this.state.search=l({query:a.searchQuery,...k}),this.state.tabs))this.state.documents.set(b,{status:"unloaded"});for(let b of[...a.diffs??[],...a.activeDiff?[a.activeDiff]:[]])if(!this.state.diffs.some(a=>m(a)===m(b))){if(this.options.maxTabs&&this.state.tabs.length+this.state.diffs.length>=this.options.maxTabs)break;this.state.diffs.push({...b,status:"unloaded"})}for(let b of a.expandedPaths)this.ensureDirectory(b);this.publish();let b=a.activeDiff,c=b?this.state.diffs.find(a=>m(a)===m(b)):null;c?this.openDiff(c.repositoryRoot,c.path,c.comparison):this.state.activePath&&this.ensureDocument(this.state.activePath)}async revealFile(a,b="file"){if(!this.options.reveal)throw Error(n("revealUnavailable"));await this.options.reveal(a,b)}ensureRoot(){return this.ensureDirectory("")}ensureDirectory(a,b=!1){let c=this.state.directories.get(a);if(this.disposed||!b&&c?.status==="ready")return Promise.resolve();let d=this.directoryRequests.get(a);if(d)return d.promise;let e=new AbortController,f=Promise.resolve().then(async()=>{try{if(e.signal.aborted)return;let b=await this.reader.list(a,e.signal);if(this.directoryRequests.get(a)?.controller!==e)return;this.state.directories.set(a,{status:"ready",...b})}catch(b){if(this.directoryRequests.get(a)?.controller!==e)return;this.state.directories.set(a,{status:"error",error:o(b)})}this.directoryRequests.get(a)?.controller===e&&(this.directoryRequests.delete(a),this.publish())});return this.directoryRequests.set(a,{controller:e,promise:f}),c?.status!=="ready"&&(this.state.directories.set(a,{status:"loading"}),this.publish()),f}refreshDirectories(a){for(let b of new Set(a))this.ensureDirectory(b,!0)}setExpandedPaths(a,b=!0){let c=[...this.state.expandedPaths].filter(b=>!a.has(b));for(let b of(this.state.expandedPaths=new Set(a),this.compactRequests.keys()))c.some(a=>b===a||b.startsWith(`${a}/`))&&this.compactRequests.delete(b);if(this.publish(),b)for(let b of a)this.ensureDirectory(b,!0)}cancelDirectoryExpansion(a=""){for(let b of this.compactRequests.keys())(!a||b===a||b.startsWith(`${a}/`))&&this.compactRequests.delete(b)}compactDirectory(a,b){return(0,j.rk)(a,a=>{let b=this.onlyDirectory(a);return b&&this.state.directories.has(b)?b:null},b)}async expandDirectoryChain(a,b){let c={};this.compactRequests.set(a,c);let d=a,e=16;for(;!this.disposed&&this.compactRequests.get(a)===c&&this.state.expandedPaths.has(a);){if(this.state.directories.get(d)?.status!=="ready"){if(e--<=0)break;await this.ensureDirectory(d)}if(this.compactRequests.get(a)!==c||this.disposed)return;let f=this.onlyDirectory(d);if(!f||b.has(d)||b.has(f)||e<=0&&this.state.directories.get(f)?.status!=="ready")break;this.state.expandedPaths.add(f),d=f,this.publish()}this.compactRequests.get(a)===c&&this.compactRequests.delete(a)}onlyDirectory(a){let b=this.state.directories.get(a);if(b?.status!=="ready"||b.truncated||1!==b.entries.length)return null;let c=b.entries[0];return"directory"===c.type?(0,j._J)(a,c.name):null}setTreeScrollTop(a){this.state.treeScrollTop=a}refreshTree(){for(let a of(this.compactRequests.clear(),this.directoryRequests.values()))a.controller.abort();this.directoryRequests.clear(),this.state.directories.clear(),this.cancelSearch(),this.state.search=l(this.searchInput()),this.publish(),this.ensureRoot().then(()=>{if(!this.disposed){for(let a of this.state.expandedPaths)this.ensureDirectory(a);this.state.searchOpen&&this.state.search.query.trim()&&(this.cancelSearch(),this.state.search={...this.state.search,status:"loading"},this.search(this.state.search.query))}})}setSearchQuery(a){this.disposed||this.state.search.query===a||(this.cancelSearch(),this.state.search=l({...this.searchInput(),query:a}),this.publish())}setSearchOptions(a){if(this.disposed)return;let b=this.searchInput(),c={...b,...a};(c.scope!==b.scope||c.caseSensitive!==b.caseSensitive||c.wholeWord!==b.wholeWord||c.regex!==b.regex)&&(this.cancelSearch(),this.state.search=l(c),this.publish(),this.state.searchOpen&&this.search(c.query))}searchInput(){let{query:a,scope:b,caseSensitive:c,wholeWord:d,regex:e}=this.state.search;return{query:a,scope:b,caseSensitive:c,wholeWord:d,regex:e}}async search(a){if(this.disposed||!a.trim()||this.state.search.query!==a||"ready"===this.state.search.status||this.searchRequest)return;let b=new AbortController;this.searchRequest=b;let c=this.searchInput();this.state.search=l(c),this.publish();try{let a=await this.reader.search(c,b.signal);if(this.searchRequest!==b)return;this.state.search={...c,status:"ready",...a,error:null}}catch(a){if(this.searchRequest!==b)return;this.state.search={...l(c),status:"error",error:o(a)}}this.searchRequest===b&&(this.searchRequest=null,this.publish())}openFile(a,b){var c;let d,e;if(this.disposed)return;let f=(c=this.cwd,d=a.replaceAll("\\","/"),e=`${c.replaceAll("\\","/").replace(/\/+$/,"")}/`,(/^[a-z]:\//i.test(e)||e.startsWith("//")?d.toLowerCase().startsWith(e.toLowerCase()):d.startsWith(e))?d.slice(e.length):d),g=/^[a-z]:[\\/]/i.test(this.cwd)||this.cwd.startsWith("\\\\")?this.state.tabs.find(a=>a.toLowerCase()===f.toLowerCase())??f:f;if(!this.state.tabs.includes(g)){if(!this.canOpenTab())return;this.state.tabs.push(g)}this.state.activeDiff=null,this.state.documents.has(g)||this.state.documents.set(g,{status:"unloaded"}),this.state.activePath=g,this.navigation=void 0===b?null:{line:b};let h=this.state.documents.get(g);void 0!==b&&h?.status==="text"&&(h.viewMode="source"),this.ensureDocument(g,void 0!==b),this.publish()}closeTabs(a,b){if(this.disposed)return;let c=this.state,d=[...c.tabs,...c.diffs],e=null===a?c.activeDiff:"string"==typeof a?a:c.diffs.find(b=>m(b)===m(a)),f=null==e?-1:d.indexOf(e);if(f<0&&"all"!==b)return;let g=new Set(d.filter((a,c)=>"all"===b||("current"===b?a===e:"others"===b?a!==e:"left"===b?c<f:c>f)));if(!g.size)return;let h=c.activeDiff??c.activePath;for(let a of g){if("string"!=typeof a){this.invalidateDiff(a);continue}this.documentRequests.get(a)?.abort(),this.documentRequests.delete(a),this.releaseDocument(c.documents.get(a)),c.documents.delete(a),this.restoredEditorStates.delete(a),this.restoredFileViewModes.delete(a),this.restoredPreviewScrollTops.delete(a),this.closeMissing.delete(a),this.restoredTabs.delete(a)}if(c.tabs=c.tabs.filter(a=>!g.has(a)),c.diffs=c.diffs.filter(a=>!g.has(a)),c.activePath&&g.has(c.activePath)){let a=d.filter(a=>"string"==typeof a),b=a.indexOf(c.activePath);c.activePath=a.slice(b+1).find(a=>!g.has(a))??a.slice(0,b).reverse().find(a=>!g.has(a))??null}if(null!==h&&g.has(h)){this.navigation=null;let a=d.indexOf(h),b=d.slice(a+1).find(a=>!g.has(a))??d.slice(0,a).reverse().find(a=>!g.has(a));c.activeDiff="object"==typeof b?b:null,"string"==typeof b&&(c.activePath=b)}this.publish(),c.activeDiff?this.ensureDiff(c.activeDiff):c.activePath&&h!==c.activePath&&this.ensureDocument(c.activePath)}reloadFile(a){if(this.state.tabs.includes(a)){if(this.state.activePath===a&&this.navigation)return void this.ensureDocument(a,!0);this.invalidateDocument(a),this.publish(),this.ensureDocument(a)}}async ensureDocument(a,b=!1){if(this.disposed||!this.state.tabs.includes(a)||this.documentRequests.has(a))return;let c=this.state.documents.get(a);if(!b&&c&&["loading","text","image"].includes(c.status))return;let d=new AbortController;this.documentRequests.set(a,d),c?.status!=="text"&&c?.status!=="image"&&(this.state.documents.set(a,{status:"loading"}),this.publish());try{let b=await this.reader.get(a,this.options.imagePreviewMode(),d.signal);if(this.documentRequests.get(a)!==d)return;let e="image"===b.kind?(0,f.E)(b):null,g=c?.status==="text"&&"text"===b.kind&&c.content===b.content&&c.size===b.size||c?.status==="image"&&null!==e&&await p(c.blob,e);if(this.documentRequests.get(a)!==d)return;this.documentRequests.delete(a),this.closeMissing.delete(a),this.restoredTabs.delete(a),g||this.state.documents.set(a,"text"===b.kind?{status:"text",content:b.content,size:b.size,editorState:c?.status==="text"?c.editorState:this.restoredEditorStates.get(a)??null,viewMode:this.state.activePath===a&&this.navigation?"source":c?.status==="text"?c.viewMode:this.restoredFileViewModes.get(a)??("markdown"===(0,i.g)(a)||this.options.htmlPreview&&"html"===(0,i.g)(a)?"preview":"source"),previewScrollTop:c?.status==="text"?c.previewScrollTop:this.restoredPreviewScrollTops.get(a)??0}:{status:"image",mimeType:b.mimeType,size:b.size,objectUrl:URL.createObjectURL(e),blob:e}),this.state.activePath===a&&"text"!==b.kind&&(this.navigation=null),g||this.releaseDocument(c)}catch(f){if(this.documentRequests.get(a)!==d)return;this.documentRequests.delete(a);let b=this.restoredTabs.delete(a),e=this.closeMissing.delete(a);if((b||e)&&f instanceof h.aw&&404===f.status&&"errors:fileMissing"===f.errorKey){this.closeTabs(a,"current"),e&&this.options.onNotice?.(n("branchFileClosed",{path:a}));return}console.warn("[Pi Desk][ProjectFile] 读取文件失败",{cwd:this.cwd,path:a,error:o(f)}),this.state.documents.set(a,{status:"error",error:o(f)}),this.releaseDocument(c),this.state.activePath===a&&(this.navigation=null)}this.publish()}async compareFile(a,b,c){let d=this.state.documents.get(a);if(this.disposed||c.aborted||d?.status!=="text")return;if(!b){d.comparison&&(delete d.comparison,this.publish());return}let e={status:"loading"};d.comparison=e,this.publish();let f=()=>!this.disposed&&!c.aborted&&this.state.documents.get(a)===d&&d.comparison===e;try{let a=await this.reader.diff(b.repositoryRoot,b.path,c);if(!f())return;"text"===a.kind?(d.content=a.modified.content,d.size=new TextEncoder().encode(a.modified.content).length,d.comparison={status:"ready",repositoryRoot:b.repositoryRoot,path:b.path,original:a.original}):d.comparison={status:"unavailable"}}catch(b){if(!f())return;console.warn("[Pi Desk][ProjectFile] 读取行变更失败",{cwd:this.cwd,path:a,error:o(b)}),d.comparison={status:"error",error:o(b)}}this.publish()}openFileDiff(a,b){let c=this.state.documents.get(a);if(this.disposed||c?.status!=="text"||c.comparison?.status!=="ready")return;let d=c.comparison,e=this.state.diffs.find(a=>!a.comparison&&a.repositoryRoot===d.repositoryRoot&&a.path===d.path);if(e)this.invalidateDiff(e),Object.assign(e,{status:"text",original:d.original,modified:{path:d.path,content:c.content}});else{if(!this.canOpenTab())return;e={status:"text",repositoryRoot:d.repositoryRoot,path:d.path,original:d.original,modified:{path:d.path,content:c.content}},this.state.diffs.push(e)}void 0!==b&&(e.initialLine=b),this.openDiff(e.repositoryRoot,e.path)}openDiff(a,b,c,d){if(this.disposed)return;let e={repositoryRoot:a,path:b,comparison:c},f=this.state.diffs.find(a=>m(a)===m(e));if(f)void 0!==d&&(f.label=d);else{if(!this.canOpenTab())return;f={...e,status:"unloaded",label:d},this.state.diffs.push(f)}this.navigation=null,this.state.activeDiff=f,this.publish(),this.ensureDiff(f)}closeDiff(){this.closeTabs(null,"current")}reloadDiff(){let a=this.state.activeDiff;a&&!this.disposed&&(this.invalidateDiff(a),this.publish(),this.ensureDiff(a))}refreshDiff(){let a=this.state.activeDiff;a&&!a.comparison&&this.ensureDiff(a,!0)}saveDiffState(a,b){!this.disposed&&this.state.diffs.includes(a)&&b&&(a.editorState=b,delete a.initialLine)}setDiffViewMode(a){this.state.activeDiff&&(0,g.ZQ)({diffViewMode:a})}setDiffWrapLines(a){this.state.activeDiff&&(0,g.ZQ)({wrapLines:a})}setDiffCollapseUnchanged(a){this.state.activeDiff&&(0,g.ZQ)({collapseUnchanged:a})}handleGitBranchChanged(a){for(let b of(this.refreshTree(),this.state.tabs))(!a||b===a||b.startsWith(`${a}/`))&&(this.invalidateDocument(b),this.closeMissing.add(b));for(let b of this.state.diffs)b.repositoryRoot!==a||b.comparison||this.invalidateDiff(b);this.publish(),this.state.activeDiff?this.ensureDiff(this.state.activeDiff):this.state.activePath&&this.ensureDocument(this.state.activePath)}saveEditorState(a,b){let c=this.state.documents.get(a);c?.status==="text"&&(c.editorState=b)}savePreviewScrollTop(a,b){let c=this.state.documents.get(a);c?.status==="text"&&(c.previewScrollTop=b)}setWrapLines(a,b){this.state.documents.get(a)?.status==="text"&&(0,g.ZQ)({wrapLines:b})}setTextViewMode(a,b){let c=this.state.documents.get(a);c?.status==="text"&&c.viewMode!==b&&(c.viewMode=b,this.publish())}dispose(){for(let a of(this.disposed=!0,this.compactRequests.clear(),this.directoryRequests.values()))a.controller.abort();for(let a of(this.directoryRequests.clear(),this.documentRequests.values()))a.abort();for(let a of(this.documentRequests.clear(),this.cancelSearch(),this.state.diffs))this.invalidateDiff(a);for(let a of(this.state.diffs=[],this.state.activeDiff=null,this.state.documents.values()))this.releaseDocument(a);this.state.documents.clear(),this.restoredPreviewScrollTops.clear(),this.listeners.clear()}async ensureDiff(a,b=!1){let c=m(a);if(this.disposed||!b&&"unloaded"!==a.status||this.diffRequests.has(c))return;let d=new AbortController;this.diffRequests.set(c,d),"text"!==a.status&&"metadata"!==a.status&&(Object.assign(a,{status:"loading"}),this.publish());try{let b=await this.reader.diff(a.repositoryRoot,a.path,d.signal,a.comparison);if(this.diffRequests.get(c)!==d)return;Object.assign(a,"text"===b.kind?{status:"text",original:b.original,modified:b.modified}:"metadata"===b.kind?{status:"metadata",originalMetadata:b.original,modifiedMetadata:b.modified}:{status:b.kind,error:null})}catch(b){if(this.diffRequests.get(c)!==d)return;console.warn("[Pi Desk][ProjectFile] 读取 Diff 失败",{cwd:this.cwd,repositoryRoot:a.repositoryRoot,path:a.path,error:o(b)}),Object.assign(a,{status:"error",error:o(b)})}this.diffRequests.get(c)===d&&(this.diffRequests.delete(c),this.publish())}invalidateDiff(a){let b=m(a);for(let c of(this.diffRequests.get(b)?.abort(),this.diffRequests.delete(b),Object.assign(a,{status:"unloaded"}),["original","modified","originalMetadata","modifiedMetadata","error"]))Reflect.deleteProperty(a,c)}canOpenTab(){let a=this.options.maxTabs;return!a||this.state.tabs.length+this.state.diffs.length<a||(this.options.onNotice?.(n("maxOpenFiles",{count:a})),!1)}cancelSearch(){this.searchRequest?.abort(),this.searchRequest=null}invalidateDocument(a){this.state.activePath===a&&(this.navigation=null),this.documentRequests.get(a)?.abort(),this.documentRequests.delete(a);let b=this.state.documents.get(a);b?.status==="text"&&(b.editorState&&this.restoredEditorStates.set(a,b.editorState),this.restoredFileViewModes.set(a,b.viewMode),this.restoredPreviewScrollTops.set(a,b.previewScrollTop)),this.releaseDocument(b),this.state.documents.set(a,{status:"unloaded"})}releaseDocument(a){a?.status==="image"&&URL.revokeObjectURL(a.objectUrl)}publish(){if(!this.disposed)for(let a of(this.revision+=1,this.listeners))a()}}},93306:(a,b,c)=>{"use strict";c.d(b,{x:()=>e});var d=c(97563);function e(a){return(0,d.h3)(a)}},95186:(a,b,c)=>{"use strict";c.d(b,{QL:()=>g,Y4:()=>h,aw:()=>f});var d=c(21850),e=c(17983);class f extends Error{constructor(a,b,c,d=null){super(c),this.status=a,this.code=b,this.errorKey=d,this.name="L3ProjectRequestError"}}async function g(a,b,c,e){let g=await fetch(b.path,{method:"POST",headers:{"Content-Type":"application/json","X-Pi-Desk-Client-Id":a},body:JSON.stringify(b.request.parse(c)),signal:e}),h=await g.json();if(!g.ok||0!==h.code||null===h.data)throw new f(g.status,h.code,h.msg?(0,d.B)(h):"项目读取失败",h.i18n?.key??null);return b.response.parse(h.data)}function h(a,b,c){async function d(b,d,e){try{return await g(a,b,d,e)}catch(a){throw!e?.aborted&&a instanceof f&&401===a.status&&c?.(),a}}return{list:(a,c)=>d(e.Xe,{...b,path:a},c),search:(a,c)=>d(e.fg,{...b,...a},c),get:(a,c,f)=>d(e.ZI,{...b,path:a,imagePreviewMode:c},f),snapshot:(a,c)=>d(e.p0,{...b,refresh:c},a),branches:(a,c)=>d(e.ry,{...b,repositoryRoot:a},c),log:(a,c,f)=>d(e.p3,{...b,repositoryRoot:a,...c},f),changes:(a,c,f)=>d(e.ys,{...b,repositoryRoot:a,...c},f),diff:(a,c,f,g)=>d(e.OC,{...b,repositoryRoot:a,path:c,comparison:g},f)}}},97563:(a,b,c)=>{"use strict";async function d(a){let b="u"<typeof navigator?void 0:navigator.clipboard;if(b?.writeText)try{return await b.writeText(a),!0}catch{}if("u"<typeof document||!document.body)return!1;let c=document.activeElement instanceof HTMLElement?document.activeElement:null,d=document.createElement("textarea");d.value=a,d.setAttribute("readonly",""),d.setAttribute("aria-hidden","true"),d.style.position="fixed",d.style.top="-9999px",d.style.left="-9999px",d.style.width="1px",d.style.height="1px",d.style.opacity="0";try{return document.body.append(d),d.select(),d.setSelectionRange(0,d.value.length),document.execCommand("copy")}catch{return!1}finally{d.remove();try{c?.focus()}catch{}}}c.d(b,{h3:()=>d,qj:()=>e});class e extends Error{constructor(a){super(a.message,{cause:a.cause}),this.name="PiDeskBrowserPluginError",this.pluginName=a.pluginName,this.contributionName=a.contributionName??null,this.phase=a.phase}}},98722:(a,b,c)=>{"use strict";c.d(b,{T8:()=>q,WW:()=>r,aD:()=>g,co:()=>m,lw:()=>s,ph:()=>p,xv:()=>k,yw:()=>n});var d=c(87883),e=c(51949),f=c(18997);let g=d.Yj().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),h=d.KC([g,d.eu("HEAD"),d.Yj().max(1024).regex(/^refs\/(?:heads|remotes)\/[^\0\r\n]+$/)]).refine(a=>!a.includes("..")&&!a.endsWith("/"),"Git 版本无效"),i=d.KC([d.Ik({commit:h,parent:g.optional()}).strict(),d.Ik({base:h,target:h,strategy:d.k5(["merge-base","direct"])}).strict()]),j=d.Ik({base:g.nullable(),target:g,original:g.nullable()}).strict(),k=d.Ik({baseCommit:g.nullable(),targetCommit:g,oldPath:e._g.optional()}).strict(),l=d.Ik({oid:g,parents:d.YO(g),subject:d.Yj(),author:d.Yj(),timestampMs:d.ai().int(),refs:d.YO(d.Yj())}).strict(),m=d.Ik({tip:h,exclude:h.optional(),query:d.Yj().trim().max(200).default(""),author:d.Yj().trim().max(200).optional(),page:d.Ik({index:d.ai().int().min(1).max(2e3),size:d.ai().int().min(1).max(100)}).strict()}).strict(),n=d.Ik({tip:g.nullable(),exclude:g.nullable(),items:d.YO(l),hasMore:d.zM(),truncated:d.zM()}).strict(),o=d.Ik({path:e._g,oldPath:e._g.nullable(),status:d.k5(["added","modified","deleted","renamed","type-changed"])}).strict(),p=d.Ik({selection:i,page:d.Ik({index:d.ai().int().min(1).max(5e4),size:d.ai().int().min(1).max(500)}).strict()}).strict(),q=d.Ik({comparison:j,commit:l.extend({message:d.Yj(),selectedParent:g.nullable()}).nullable(),items:d.YO(o),hasMore:d.zM(),truncated:d.zM()}).strict(),r=f.gf.extend({upstream:d.Ik({ref:d.Yj(),ahead:d.ai().int().nonnegative().nullable(),behind:d.ai().int().nonnegative().nullable()}).strict().nullable()}).strict(),s=d.KC([f.FJ,d.Ik({kind:d.eu("metadata"),original:d.Yj(),modified:d.Yj()}).strict()])}};
|
|
15
|
+
${c.author} \xb7 ${n.format(c.timestampMs)}`,children:[(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[c.subject||i("noCommitMessage"),c.refs.length?(0,d.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:c.refs.join(" \xb7 ")}):null]}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:c.oid.slice(0,7)}),g?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"w-20 truncate text-xs text-muted-foreground",children:c.author}),(0,d.jsx)("time",{className:"w-28 shrink-0 text-right text-xs text-muted-foreground",children:m.format(c.timestampMs)})]})]},c.oid)},`${b.repositoryRoot}:${b.mode}:${b.tip}:${b.base}:${b.target}:${b.query}:${b.author}`)}),C=(0,d.jsxs)("div",{className:"flex size-full min-h-0 min-w-0 flex-col",children:[(0,d.jsxs)("div",{className:"flex min-h-9 shrink-0 flex-wrap items-center gap-2 border-b px-3 py-1",children:[g?(0,d.jsx)(q.$,{variant:"ghost",size:"icon-sm","aria-label":i("backCommits"),onClick:()=>s("log"),children:(0,d.jsx)(ad.A,{className:"size-4"})}):null,(0,d.jsx)("span",{className:"text-sm font-medium",children:b.selectedCommit?i("commitChanges"):i("cumulativeChanges")}),v?(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("loadedFiles",{count:v.items.length})}):null,"compare"===b.mode&&b.selectedCommit?(0,d.jsx)(q.$,{variant:"ghost",size:"sm",onClick:a.onAggregate,children:i("backCumulative")}):null]}),A(b.changes.error),"loading"===b.changes.status?(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,d.jsx)(L.A,{className:"size-4 animate-spin"}),i("loadingChanges")]}):null,(0,d.jsxs)(p.HK,{orientation:"vertical",defaultLayout:{"project-changes":a.panelSizes.changes,"project-detail":100-a.panelSizes.changes},onLayoutChanged:(b,c)=>{c.isUserInteraction&&void 0!==b["project-changes"]&&a.onPanelSize("changes",b["project-changes"])},children:[(0,d.jsx)(p.wV,{id:"project-changes",defaultSize:`${a.panelSizes.changes}%`,minSize:"80px",children:(0,d.jsxs)("div",{className:"flex size-full min-h-0 flex-col",children:[(0,d.jsx)(aq,{cwd:a.cwd,repositoryRoot:b.repositoryRoot??"",rows:a.changeRows,rowHeight:a.changeRowHeight,changes:v?.items??[],selectedPath:x,scrollTop:h.changes,onScroll:b=>a.onScroll("changes",b),onSelect:a.onSelectChange,onToggle:a.onToggleDirectory,onOpen:a.onOpenFile,onReveal:a.onReveal},w),"ready"!==b.changes.status||v?.items.length?null:(0,d.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:i("noDiff")}),v?.hasMore?(0,d.jsx)(q.$,{size:"sm",variant:"ghost",disabled:"loading"===b.changes.status,onClick:a.onMoreChanges,children:i("loadMoreFiles")}):null,v?.truncated?(0,d.jsx)("p",{className:"p-3 text-xs text-muted-foreground",children:i("changesLimit")}):null]})}),(0,d.jsx)(p.WM,{disableDoubleClick:!0}),(0,d.jsx)(p.wV,{id:"project-detail",defaultSize:`${100-a.panelSizes.changes}%`,minSize:"60px",children:(0,d.jsxs)(ag.V,{className:"h-full",viewportClassName:"p-3 text-sm",role:"region","aria-label":i("commitDetails"),children:[z?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"mb-3 whitespace-pre-wrap break-words font-sans leading-relaxed",children:z.message}),(0,d.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 break-all font-mono text-xs",children:z.oid}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":i("copySha"),onClick:()=>a.onCopy(z.oid),children:(0,d.jsx)(K.A,{className:"size-4"})})]}),(0,d.jsxs)("p",{className:"mb-3 text-xs text-muted-foreground",children:[z.author," \xb7 ",n.format(z.timestampMs)]}),z.parents.length>1?(0,d.jsx)(ai.b,{className:"mb-3",ariaLabel:i("compareParent"),value:z.selectedParent??"",options:z.parents.map((a,b)=>({value:a,label:i("parentCommit",{count:b+1,oid:a.slice(0,10)})})),onChange:b=>a.onCommit(z.oid,b)}):null]}):v?(0,d.jsxs)("div",{className:"space-y-2 text-xs text-muted-foreground",children:[(0,d.jsx)("p",{children:"merge-base"===b.strategy?i("mergeBaseToTarget"):i("baseToTarget")}),(0,d.jsx)("p",{className:"break-all font-mono",children:v.comparison.original??i("emptyRevision")}),(0,d.jsx)("p",{className:"break-all font-mono",children:v.comparison.target})]}):(0,d.jsx)("p",{className:"text-muted-foreground",children:i("selectCommit")}),x?(0,d.jsx)("p",{className:"mt-3 break-all font-mono text-xs text-muted-foreground",children:x}):null]})})]})]});return(0,d.jsxs)("section",{className:"flex size-full min-h-0 min-w-0 flex-col","aria-label":i("historyAndCompare"),children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b px-3 py-2",children:[(0,d.jsxs)("div",{className:"flex gap-1",role:"group","aria-label":i("viewMode"),children:[(0,d.jsx)(q.$,{size:"sm",variant:"history"===b.mode?"secondary":"ghost","aria-pressed":"history"===b.mode,onClick:()=>{a.onMode("history"),s("log")},children:i("historyMode")}),(0,d.jsx)(q.$,{size:"sm",variant:"compare"===b.mode?"secondary":"ghost","aria-pressed":"compare"===b.mode,onClick:()=>{a.onMode("compare"),s("log")},children:i("compareMode")})]}),(0,d.jsx)(ai.b,{className:"w-44",ariaLabel:i("selectRepository"),value:b.repositoryRoot??"",options:c.map(a=>({value:a.root,label:a.root||f,description:"unavailable"===a.state?(0,ae.fD)(a.message,j):void 0})),onChange:a.onRepository}),"history"===b.mode?(0,d.jsx)(ax,{className:"w-48",ariaLabel:i("viewBranch"),value:b.tip,branches:b.branches.data,onChange:b=>a.onRevision("tip",b)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ax,{className:"w-44",ariaLabel:i("baseBranch"),placeholder:i("chooseBase"),value:b.base,branches:b.branches.data,onChange:b=>a.onRevision("base",b)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"→"}),(0,d.jsx)(ax,{className:"w-44",ariaLabel:i("targetBranch"),value:b.target,branches:b.branches.data,onChange:b=>a.onRevision("target",b)}),(0,d.jsx)(ai.b,{className:"w-48",ariaLabel:i("comparison"),value:b.strategy,options:[{value:"merge-base",label:i("introducedChanges")},{value:"direct",label:i("directComparison")}],onChange:b=>a.onStrategy("direct"===b?"direct":"merge-base")}),g?(0,d.jsx)(q.$,{size:"sm",variant:"outline",onClick:()=>s("files"),children:i("cumulativeChanges")}):null]}),(0,d.jsx)(ah.p,{className:"w-40 shrink-0","aria-label":i("filterAuthor"),placeholder:i("author"),list:o,value:b.author,onChange:b=>a.onAuthor(b.target.value)}),(0,d.jsx)("datalist",{id:o,children:b.authorSuggestions.map(a=>(0,d.jsx)("option",{value:a},a))}),(0,d.jsx)(ah.p,{className:"min-w-32 flex-1 basis-40","aria-label":i("searchCommits"),placeholder:i("searchCommits"),value:b.query,onChange:b=>a.onQuery(b.target.value)}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":i("refreshGit"),onClick:a.onRefresh,children:(0,d.jsx)(l.A,{className:"size-4"})})]}),b.branches.error?A(b.branches.error):null,y?(0,d.jsxs)("p",{className:"shrink-0 truncate border-b px-3 py-1 text-xs text-muted-foreground",title:y.ref,children:[y.ref.replace("refs/remotes/","")," \xb7 ",i("localRecord")," \xb7"," ",null===y.ahead||null===y.behind?i("refUnavailable"):i("aheadBehind",{ahead:y.ahead,behind:y.behind})]}):null,"compare"!==b.mode||b.base?g?"log"===r?B:C:(0,d.jsxs)(p.HK,{orientation:"horizontal",defaultLayout:{"project-log":a.panelSizes.log,"project-files":100-a.panelSizes.log},onLayoutChanged:(b,c)=>{c.isUserInteraction&&void 0!==b["project-log"]&&a.onPanelSize("log",b["project-log"])},children:[(0,d.jsx)(p.wV,{id:"project-log",defaultSize:`${a.panelSizes.log}%`,minSize:"30%",children:B}),(0,d.jsx)(p.WM,{disableDoubleClick:!0}),(0,d.jsx)(p.wV,{id:"project-files",defaultSize:`${100-a.panelSizes.log}%`,minSize:"25%",children:C})]}):(0,d.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:i("chooseBaseBranch")})]})}let az=()=>{};function aA({clientId:a,cwd:b,title:c,actions:s,onEscape:u=az,onUnauthorized:v}){let{t:w}=(0,e.Bd)("projectHistory"),x=(0,R.G)(),{files:y,git:z,history:A,global:B,updateGlobal:D,page:E,setPage:F,historyPane:G,setHistoryPane:H,setContainer:I,narrow:J,stacked:K,width:L,changeRowHeight:N,openGit:O,refresh:P}=function(a,b,c){let d=(0,R.G)(),[e]=(0,t.useState)(_.N1),[f,g]=(0,t.useState)(e),h=(0,t.useCallback)(a=>{g(b=>({...b,...a})),(0,_.Ms)({...(0,_.N1)(),...a})},[]),[i]=(0,t.useState)(()=>(0,_.tQ)(b)),[j]=(0,t.useState)(()=>(0,$.ph)(a,b,a=>d.show({level:"info",title:a}),i,e,{lazyHistory:!0,onUnauthorized:c})),{files:k,git:l,history:m}=j;(0,t.useSyncExternalStore)(k.subscribe,k.getRevision,k.getRevision),(0,t.useSyncExternalStore)(l.subscribe,l.getRevision,l.getRevision),(0,t.useSyncExternalStore)(m.subscribe,m.getRevision,m.getRevision);let[n,o]=(0,t.useState)(i?.page??"files"),[p,q]=(0,t.useState)(i?.historyPane??"log"),[r,s]=(0,t.useState)({width:1200,height:800}),[u,v]=(0,t.useState)(null);(0,t.useRef)(!1),(0,t.useRef)(()=>void 0);let w=r.width<900,x=w||r.height<680;l.getWorkspace(b).snapshot.repositories;let y=k.state,z=(0,t.useSyncExternalStore)(aa,ab,ac),A=f.gitOpen&&(!x||"git"===n);return{files:k,git:l,history:m,global:f,updateGlobal:h,page:n,setPage:o,historyPane:p,setHistoryPane:q,setContainer:v,narrow:w,stacked:x,width:r.width,changeRowHeight:z?24:36,openGit(a){h({gitOpen:!0}),o("git"),void 0!==a&&m.setRepository(a)},refresh(){k.refreshTree(),l.refreshSnapshot(b),y.activeDiff?k.reloadDiff():y.activePath&&k.reloadFile(y.activePath),A&&m.refresh()}}}(a,b,v),{directoryOpen:Q,gitOpen:S,gitMaximized:T}=B,U=b.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??b,V=z.getWorkspace(b),W=V.snapshot.repositories,X=y.state,Z=(0,d.jsx)(r.F,{cwd:b,projectName:U,showRootTitle:!1,runtime:y,gitRuntime:z,onOpenGitBranches:O,onFileOpened:()=>F("code")}),ad=(0,d.jsx)(Y,{runtime:y,gitRuntime:z,compact:L<1100,onEscape:u,renderHeader:a=>(0,d.jsx)(C,{cwd:b,gitRuntime:z,paths:X.tabs,activePath:X.activePath,diffs:X.diffs,activeDiff:X.activeDiff,mobile:J,actions:a,onActivate:a=>{"string"==typeof a?y.openFile(a):y.openDiff(a.repositoryRoot,a.path,a.comparison)},onClose:(a,b)=>y.closeTabs(a,b)})}),ae=(0,d.jsxs)("div",{className:"flex size-full min-h-0 min-w-0 flex-col",children:[(0,d.jsxs)("div",{className:"flex h-9 shrink-0 items-center gap-2 border-b bg-muted px-3",children:[(0,d.jsx)(f.A,{className:"size-4"}),(0,d.jsx)("span",{className:"flex-1 text-sm font-medium",children:"Git"}),K?null:(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w(T?"restoreGit":"maximizeGit"),onClick:()=>D({gitMaximized:!T}),children:T?(0,d.jsx)(g.A,{className:"size-4"}):(0,d.jsx)(h.A,{className:"size-4"})}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w("collapseGit"),onClick:()=>{D({gitOpen:!1,gitMaximized:!1}),F("code")},children:(0,d.jsx)(i.A,{className:"size-4"})})]}),W.length?(0,d.jsx)(ay,{state:A.state,cwd:b,changeRows:A.getChangeRows(),changeRowHeight:N,onSelectChange:a=>A.selectChange(a),onToggleDirectory:a=>A.toggleChangeDirectory(a),onReveal:(a,b)=>y.revealFile(a,b),repositories:W,projectName:U,narrow:J,mobilePane:G,onMobilePane:H,scroll:A.scroll,onScroll:(a,b)=>A.setScroll(a,b),panelSizes:{log:B.logSize,changes:B.changeSize},onPanelSize:(a,b)=>D("log"===a?{logSize:b}:{changeSize:b}),onRepository:a=>{A.setRepository(a),H("log")},onMode:a=>A.setMode(a),onRevision:(a,b)=>A.setRevision(a,b),onStrategy:a=>A.setStrategy(a),onQuery:a=>A.setQuery(a),onAuthor:a=>A.setAuthor(a),onCommit:(a,b)=>A.selectCommit(a,b),onAggregate:()=>A.showAggregate(),onMoreLog:()=>A.loadMoreLog(),onMoreChanges:()=>A.loadMoreChanges(),onOpenFile:a=>{A.openChange(a),F("code"),D({gitMaximized:!1})},onRefresh:()=>A.refresh(),onCopy:a=>{(0,M.x)(a).then(a=>{a||x.error(w("copyFailed"))})}}):(0,d.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:"loading"===V.snapshot.status||"idle"===V.snapshot.status?w("findingGit"):V.snapshot.error??w("noGit")})]}),af=(0,d.jsxs)(p.HK,{orientation:"horizontal",defaultLayout:Q?{"project-tree":B.directorySize,"project-code":100-B.directorySize}:void 0,onLayoutChanged:(a,b)=>{b.isUserInteraction&&void 0!==a["project-tree"]&&D({directorySize:a["project-tree"]})},children:[Q?(0,d.jsx)(p.wV,{id:"project-tree",defaultSize:`${B.directorySize}%`,minSize:"180px",maxSize:"40%",children:Z}):null,Q?(0,d.jsx)(p.WM,{disableDoubleClick:!0}):null,(0,d.jsx)(p.wV,{id:"project-code",minSize:"40%",children:ad})]},Q?"tree-visible":"tree-hidden");return(0,d.jsxs)("div",{ref:I,className:"flex size-full min-h-0 min-w-0 flex-col overflow-hidden","data-testid":"project-preview",children:[(0,d.jsxs)("header",{className:"flex min-h-9 shrink-0 items-center gap-1 bg-muted px-2 py-1 pt-[max(4px,env(safe-area-inset-top))]",children:[K?null:(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w(Q?"collapseDirectory":"expandDirectory"),onClick:()=>D({directoryOpen:!Q}),children:Q?(0,d.jsx)(j.A,{className:"size-4"}):(0,d.jsx)(k.A,{className:"size-4"})}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-baseline gap-3",title:b,children:[(0,d.jsx)("div",{className:"min-w-0 shrink-0 max-w-[50%] max-sm:max-w-full max-sm:shrink",children:c??(0,d.jsx)("h1",{className:"truncate text-sm font-semibold",children:U})}),(0,d.jsx)("p",{className:"min-w-0 truncate text-xs text-muted-foreground max-sm:hidden",children:b})]}),(0,d.jsxs)(q.$,{size:"sm",variant:S?"secondary":"ghost","aria-pressed":S,onClick:()=>O(),children:[(0,d.jsx)(f.A,{className:"size-4"}),(0,d.jsx)("span",{className:"max-sm:hidden",children:w("gitRecords")})]}),(0,d.jsx)(q.$,{size:"icon-sm",variant:"ghost","aria-label":w("refreshPreview"),onClick:P,children:(0,d.jsx)(l.A,{className:"size-4"})}),s]}),V.snapshot.error?(0,d.jsx)("p",{role:"alert",className:"shrink-0 border-b px-3 py-2 text-sm text-destructive",children:V.snapshot.error}):null,K?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex shrink-0 gap-1 px-2 py-1",role:"group","aria-label":w("previewArea"),children:[(0,d.jsxs)(q.$,{size:"sm",variant:"files"===E?"secondary":"ghost",onClick:()=>F("files"),children:[(0,d.jsx)(m.A,{className:"size-4"}),w("files")]}),(0,d.jsxs)(q.$,{size:"sm",variant:"code"===E?"secondary":"ghost",onClick:()=>F("code"),children:[(0,d.jsx)(n.A,{className:"size-4"}),w("code")]}),(0,d.jsxs)(q.$,{size:"sm",variant:"git"===E?"secondary":"ghost",onClick:()=>O(),children:[(0,d.jsx)(o.A,{className:"size-4"}),"Git"]})]}),(0,d.jsx)("div",{className:"min-h-0 flex-1",children:"files"===E?Z:"git"===E?ae:ad})]}):T&&S?ae:(0,d.jsxs)(p.HK,{orientation:"vertical",defaultLayout:S?{"project-main":100-B.gitSize,"project-git":B.gitSize}:void 0,onLayoutChanged:(a,b)=>{b.isUserInteraction&&void 0!==a["project-git"]&&D({gitSize:a["project-git"]})},children:[(0,d.jsx)(p.wV,{id:"project-main",defaultSize:S?`${100-B.gitSize}%`:"100%",minSize:"35%",children:af}),S?(0,d.jsx)(p.WM,{disableDoubleClick:!0}):null,S?(0,d.jsx)(p.wV,{id:"project-git",defaultSize:`${B.gitSize}%`,minSize:"300px",children:ae}):null]},S?"git-visible":"git-hidden")]})}},85544:(a,b,c)=>{"use strict";c.d(b,{k:()=>h});var d=c(52834);c(84593);var e=c(49147),f=c(15620),g=c(4998);function h(a){let{locale:b}=(0,g.i)(),{slides:c,index:h=0,onIndexChange:i,className:j,thumbnails:k=!0,ariaLabel:l="en"===b?"Image preview":"图片预览"}=a,m="inline"===a.mode,n="inline"===a.mode||a.open,o="modal"===a.mode?a.onClose:void 0;c.length;let p=Math.min(Math.max(h,0),Math.max(c.length-1,0)),q=`pi-desk-image-viewer-${(0,e.useId)().replaceAll(":","")}`,r=(0,e.useRef)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null);if((0,e.useRef)(""),(0,e.useRef)(""),(0,e.useRef)(p),(0,e.useRef)(p),(0,e.useRef)(i),(0,e.useRef)(o),(0,e.useMemo)(()=>JSON.stringify(c.map(a=>[a.src,a.alt])),[c]),(0,f.cn)("pi-desk-image-viewer",m?"pi-desk-image-viewer-inline":"pi-desk-image-viewer-modal",q,j),0===c.length||!n)return null;let u=(0,d.jsx)("span",{ref:r,className:"pi-desk-image-viewer-source","aria-hidden":"true",children:c.map((a,b)=>(0,d.jsx)("img",{src:a.src,alt:a.alt,width:a.width,height:a.height,decoding:"async",draggable:!1},b))});return m?(0,d.jsx)("div",{ref:s,className:"pi-desk-image-viewer-host",role:"region","aria-label":l,tabIndex:0,onKeyDown:a=>{let b=t.current;!b||b.fulled||a.altKey||a.ctrlKey||a.metaKey||a.nativeEvent.isComposing||("ArrowLeft"===a.key||"ArrowRight"===a.key)&&(a.preventDefault(),a.stopPropagation(),"ArrowLeft"===a.key?b.prev(!1):b.next(!1))},children:u}):u}},87348:(a,b,c)=>{"use strict";c.d(b,{e:()=>k});var d=c(52834),e=c(90814),f=c(49147),g=c(57850);c(82386),c(51972);var h=c(96478),i=c(70448),j=c.n(i);let k=(0,f.forwardRef)(function({path:a,content:b,size:c,savedState:i,onSaveState:k,onEscape:l,originalContent:m,onChanges:n,onOpenDiff:o,navigation:p,onNavigation:q},r){let{t:s}=(0,g.Bd)("common"),{t:t}=(0,g.Bd)("projectFiles"),{wrapLines:u}=(0,h.TX)(),v=(0,f.useRef)(null),w=(0,f.useRef)(null);(0,f.useRef)(k),(0,f.useRef)(u),(0,f.useRef)(i),(0,f.useRef)(l);let x=(0,f.useRef)(null);(0,f.useRef)(n),(0,f.useRef)(o),(0,f.useRef)(q);let y=(0,f.useRef)(null),z=(0,f.useRef)(null);(0,f.useCallback)(a=>{let b=z.current;y.current?.clear(),null===b||b>(a.getModel()?.getLineCount()??0)||(y.current??=a.createDecorationsCollection(),y.current.set([{range:{startLineNumber:b,startColumn:1,endLineNumber:b,endColumn:1},options:{isWholeLine:!0,className:"bg-accent"}}]))},[]);let[A,B]=(0,f.useState)("loading");return(0,f.useImperativeHandle)(r,()=>({openSearch(){w.current?.getAction("actions.find")?.run()},gotoLine(){w.current?.getAction("editor.action.gotoLine")?.run()},getSelectionText(){let a=w.current,b=a?.getModel(),c=a?.getSelection();return b&&c&&!c.isEmpty()?b.getValueInRange(c):""},getViewState:()=>w.current?.saveViewState()??null,focus(){w.current?.focus()},previousChange(){x.current?.previousChange()},nextChange(){x.current?.nextChange()}}),[]),(0,d.jsxs)("div",{"data-testid":"code-preview",className:"relative h-full min-h-0 w-full overflow-hidden bg-background",children:[(0,d.jsx)("div",{ref:v,className:`size-full ${j().host}`}),"loading"===A?(0,d.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-background text-sm text-muted-foreground",children:[(0,d.jsx)(e.A,{className:"size-4 animate-spin"})," ",s("codeLoading")]}):null,"error"===A?(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-6 text-center text-sm text-destructive",children:s("codeFailed")}):null]})})},89101:(a,b,c)=>{"use strict";c.d(b,{Ik:()=>n,MG:()=>j,Sq:()=>l,iV:()=>o,oR:()=>p});var d=c(52834);c(49147);var e=c(80546),f=c(15620),g=c(5319),h=c(11071),i=c(13221);function j({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,f.cn)("group/input-group relative flex min-h-8 w-full min-w-0 items-center rounded-lg border border-input bg-card transition-colors duration-150 outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-muted has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:outline-solid has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-2 has-[[data-slot=input-group-control]:focus-visible]:outline-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",a),...b})}let k=(0,e.F)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function l({className:a,align:b="inline-start",...c}){return(0,d.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":b,className:(0,f.cn)(k({align:b}),a),onClick:a=>{a.target.closest("button")||a.currentTarget.parentElement?.querySelector("input")?.focus()},...c})}let m=(0,e.F)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"min-h-7 gap-2 rounded-md px-2",sm:"","icon-xs":"size-7 rounded-md p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function n({className:a,type:b="button",variant:c="ghost",size:e="xs",...h}){return(0,d.jsx)(g.$,{type:b,"data-size":e,variant:c,className:(0,f.cn)(m({size:e}),a),...h})}function o({className:a,...b}){return(0,d.jsx)(h.p,{"data-slot":"input-group-control",className:(0,f.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",a),...b})}function p({className:a,...b}){return(0,d.jsx)(i.T,{"data-slot":"input-group-control",className:(0,f.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",a),...b})}},91464:(a,b,c)=>{"use strict";c.d(b,{S6:()=>d,dQ:()=>e,hD:()=>f});let d="relative flex min-h-7 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-sm leading-5 outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e="data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive",f="z-50 max-h-(--available-height) min-w-60 max-w-[calc(100vw-2rem)] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none transition-[opacity,transform] duration-100 ease-out data-starting-style:scale-[0.98] data-starting-style:opacity-0 data-ending-style:scale-[0.98] data-ending-style:opacity-0 motion-reduce:transition-none"},91816:(a,b,c)=>{"use strict";c.d(b,{Ip:()=>q,JW:()=>o,K5:()=>s,Rc:()=>p,kt:()=>r,tz:()=>n});var d=c(52834);c(49147);var e=c(49067),f=c(10962),g=c(48329),h=c(65614),i=c(9698),j=c(16484),k=c(36089),l=c(15620),m=c(91464);function n({...a}){return(0,d.jsx)(e.D,{"data-slot":"context-menu",...a})}function o({...a}){return(0,d.jsx)(f.g,{"data-slot":"context-menu-portal",...a})}function p({className:a,...b}){return(0,d.jsx)(g.R,{"data-slot":"context-menu-trigger",className:(0,l.cn)("select-none",a),...b})}function q({className:a,align:b="start",alignOffset:c=4,side:e="right",sideOffset:g=0,finalFocus:j=!1,...k}){return(0,d.jsx)(f.g,{children:(0,d.jsx)(h.y,{className:"isolate z-50 outline-none",align:b,alignOffset:c,side:e,sideOffset:g,children:(0,d.jsx)(i._,{"data-slot":"context-menu-content",finalFocus:j,className:(0,l.cn)(m.hD,a),...k})})})}function r({className:a,inset:b,variant:c="default",...e}){return(0,d.jsx)(j.D,{"data-slot":"context-menu-item","data-inset":b,"data-variant":c,className:(0,l.cn)(m.S6,m.dQ,"group/context-menu-item",a),...e})}function s({className:a,...b}){return(0,d.jsx)(k.w,{"data-slot":"context-menu-separator",className:(0,l.cn)("-mx-1 my-1 h-px bg-border",a),...b})}},92494:(a,b,c)=>{"use strict";c.d(b,{Q:()=>m,h:()=>q});var d=c(89172),e=c(21850),f=c(28661),g=c(96478),h=c(95186),i=c(55091),j=c(83731);let k={scope:"all",caseSensitive:!1,wholeWord:!1,regex:!1};function l(a){return{...a,status:a.query.trim()?"loading":"idle",fileMatches:[],contentMatches:[],truncated:!1,error:null}}function m(a){return JSON.stringify([a.repositoryRoot,a.path,a.comparison?.baseCommit??null,a.comparison?.targetCommit??null,a.comparison?.oldPath??null])}function n(a,b){return(0,e.B)({msg:d.C["zh-CN"][a],i18n:{key:`projectFiles:${a}`,...b?{params:b}:{}}})}function o(a){return a instanceof Error?a.message:n("projectReadFailed")}async function p(a,b){if(a.type!==b.type||a.size!==b.size)return!1;let[c,d]=await Promise.all([a.arrayBuffer(),b.arrayBuffer()]),e=new Uint8Array(d);return new Uint8Array(c).every((a,b)=>a===e[b])}class q{constructor(a,b,c){this.cwd=a,this.reader=b,this.options=c,this.state={tabs:[],activePath:null,directories:new Map,expandedPaths:new Set,treeScrollTop:0,search:l({query:"",...k}),searchOpen:!1,documents:new Map,diffs:[],activeDiff:null},this.listeners=new Set,this.directoryRequests=new Map,this.compactRequests=new Map,this.documentRequests=new Map,this.closeMissing=new Set,this.restoredTabs=new Set,this.restoredEditorStates=new Map,this.restoredFileViewModes=new Map,this.restoredPreviewScrollTops=new Map,this.searchRequest=null,this.navigation=null,this.diffRequests=new Map,this.revision=0,this.disposed=!1,this.subscribe=a=>(this.listeners.add(a),()=>this.listeners.delete(a)),this.getRevision=()=>this.revision}setSearchOpen(a){this.disposed||this.state.searchOpen===a||(this.cancelSearch(),this.state.searchOpen=a,this.state.search=l({...this.searchInput(),scope:a?"all":this.state.search.scope}),this.publish())}get pendingNavigation(){let a=this.state.activePath;return a&&!this.documentRequests.has(a)?this.navigation:null}consumeNavigation(a,b){this.navigation===a&&(this.navigation=null,b||this.options.onNotice?.(n("searchLineUnavailable")),this.publish())}get canReveal(){return!!this.options.reveal}getBrowsingDocumentSettings(){let a={},b={};for(let c of this.state.tabs){let d=this.state.documents.get(c),e=d?.status==="text"?d.editorState:this.restoredEditorStates.get(c);e&&JSON.stringify(e).length<32768&&(a[c]=e);let f=d?.status==="text"?d.viewMode:this.restoredFileViewModes.get(c);f&&(b[c]=f)}return{editorStates:a,fileViewModes:b}}restoreBrowsing(a){if(this.disposed)return;for(let b of(this.state.tabs=a.tabs.slice(0,this.options.maxTabs),this.state.tabs)){this.restoredTabs.add(b);let c=a.editorStates[b];c&&this.restoredEditorStates.set(b,c);let d=a.fileViewModes[b];d&&this.restoredFileViewModes.set(b,d)}for(let b of(this.state.activePath=a.activePath&&this.state.tabs.includes(a.activePath)?a.activePath:null,this.state.expandedPaths=new Set(a.expandedPaths),this.state.treeScrollTop=a.treeScrollTop,this.state.search=l({query:a.searchQuery,...k}),this.state.tabs))this.state.documents.set(b,{status:"unloaded"});for(let b of[...a.diffs??[],...a.activeDiff?[a.activeDiff]:[]])if(!this.state.diffs.some(a=>m(a)===m(b))){if(this.options.maxTabs&&this.state.tabs.length+this.state.diffs.length>=this.options.maxTabs)break;this.state.diffs.push({...b,status:"unloaded"})}for(let b of a.expandedPaths)this.ensureDirectory(b);this.publish();let b=a.activeDiff,c=b?this.state.diffs.find(a=>m(a)===m(b)):null;c?this.openDiff(c.repositoryRoot,c.path,c.comparison):this.state.activePath&&this.ensureDocument(this.state.activePath)}async revealFile(a,b="file"){if(!this.options.reveal)throw Error(n("revealUnavailable"));await this.options.reveal(a,b)}ensureRoot(){return this.ensureDirectory("")}ensureDirectory(a,b=!1){let c=this.state.directories.get(a);if(this.disposed||!b&&c?.status==="ready")return Promise.resolve();let d=this.directoryRequests.get(a);if(d)return d.promise;let e=new AbortController,f=Promise.resolve().then(async()=>{try{if(e.signal.aborted)return;let b=await this.reader.list(a,e.signal);if(this.directoryRequests.get(a)?.controller!==e)return;this.state.directories.set(a,{status:"ready",...b})}catch(b){if(this.directoryRequests.get(a)?.controller!==e)return;this.state.directories.set(a,{status:"error",error:o(b)})}this.directoryRequests.get(a)?.controller===e&&(this.directoryRequests.delete(a),this.publish())});return this.directoryRequests.set(a,{controller:e,promise:f}),c?.status!=="ready"&&(this.state.directories.set(a,{status:"loading"}),this.publish()),f}refreshDirectories(a){for(let b of new Set(a))this.ensureDirectory(b,!0)}setExpandedPaths(a,b=!0){let c=[...this.state.expandedPaths].filter(b=>!a.has(b));for(let b of(this.state.expandedPaths=new Set(a),this.compactRequests.keys()))c.some(a=>b===a||b.startsWith(`${a}/`))&&this.compactRequests.delete(b);if(this.publish(),b)for(let b of a)this.ensureDirectory(b,!0)}cancelDirectoryExpansion(a=""){for(let b of this.compactRequests.keys())(!a||b===a||b.startsWith(`${a}/`))&&this.compactRequests.delete(b)}compactDirectory(a,b){return(0,j.rk)(a,a=>{let b=this.onlyDirectory(a);return b&&this.state.directories.has(b)?b:null},b)}async expandDirectoryChain(a,b){let c={};this.compactRequests.set(a,c);let d=a,e=16;for(;!this.disposed&&this.compactRequests.get(a)===c&&this.state.expandedPaths.has(a);){if(this.state.directories.get(d)?.status!=="ready"){if(e--<=0)break;await this.ensureDirectory(d)}if(this.compactRequests.get(a)!==c||this.disposed)return;let f=this.onlyDirectory(d);if(!f||b.has(d)||b.has(f)||e<=0&&this.state.directories.get(f)?.status!=="ready")break;this.state.expandedPaths.add(f),d=f,this.publish()}this.compactRequests.get(a)===c&&this.compactRequests.delete(a)}onlyDirectory(a){let b=this.state.directories.get(a);if(b?.status!=="ready"||b.truncated||1!==b.entries.length)return null;let c=b.entries[0];return"directory"===c.type?(0,j._J)(a,c.name):null}setTreeScrollTop(a){this.state.treeScrollTop=a}refreshTree(){for(let a of(this.compactRequests.clear(),this.directoryRequests.values()))a.controller.abort();this.directoryRequests.clear(),this.state.directories.clear(),this.cancelSearch(),this.state.search=l(this.searchInput()),this.publish(),this.ensureRoot().then(()=>{if(!this.disposed){for(let a of this.state.expandedPaths)this.ensureDirectory(a);this.state.searchOpen&&this.state.search.query.trim()&&(this.cancelSearch(),this.state.search={...this.state.search,status:"loading"},this.search(this.state.search.query))}})}setSearchQuery(a){this.disposed||this.state.search.query===a||(this.cancelSearch(),this.state.search=l({...this.searchInput(),query:a}),this.publish())}setSearchOptions(a){if(this.disposed)return;let b=this.searchInput(),c={...b,...a};(c.scope!==b.scope||c.caseSensitive!==b.caseSensitive||c.wholeWord!==b.wholeWord||c.regex!==b.regex)&&(this.cancelSearch(),this.state.search=l(c),this.publish(),this.state.searchOpen&&this.search(c.query))}searchInput(){let{query:a,scope:b,caseSensitive:c,wholeWord:d,regex:e}=this.state.search;return{query:a,scope:b,caseSensitive:c,wholeWord:d,regex:e}}async search(a){if(this.disposed||!a.trim()||this.state.search.query!==a||"ready"===this.state.search.status||this.searchRequest)return;let b=new AbortController;this.searchRequest=b;let c=this.searchInput();this.state.search=l(c),this.publish();try{let a=await this.reader.search(c,b.signal);if(this.searchRequest!==b)return;this.state.search={...c,status:"ready",...a,error:null}}catch(a){if(this.searchRequest!==b)return;this.state.search={...l(c),status:"error",error:o(a)}}this.searchRequest===b&&(this.searchRequest=null,this.publish())}openFile(a,b){var c;let d,e;if(this.disposed)return;let f=(c=this.cwd,d=a.replaceAll("\\","/"),e=`${c.replaceAll("\\","/").replace(/\/+$/,"")}/`,(/^[a-z]:\//i.test(e)||e.startsWith("//")?d.toLowerCase().startsWith(e.toLowerCase()):d.startsWith(e))?d.slice(e.length):d),g=/^[a-z]:[\\/]/i.test(this.cwd)||this.cwd.startsWith("\\\\")?this.state.tabs.find(a=>a.toLowerCase()===f.toLowerCase())??f:f;if(!this.state.tabs.includes(g)){if(!this.canOpenTab())return;this.state.tabs.push(g)}this.state.activeDiff=null,this.state.documents.has(g)||this.state.documents.set(g,{status:"unloaded"}),this.state.activePath=g,this.navigation=void 0===b?null:{line:b};let h=this.state.documents.get(g);void 0!==b&&h?.status==="text"&&(h.viewMode="source"),this.ensureDocument(g,void 0!==b),this.publish()}closeTabs(a,b){if(this.disposed)return;let c=this.state,d=[...c.tabs,...c.diffs],e=null===a?c.activeDiff:"string"==typeof a?a:c.diffs.find(b=>m(b)===m(a)),f=null==e?-1:d.indexOf(e);if(f<0&&"all"!==b)return;let g=new Set(d.filter((a,c)=>"all"===b||("current"===b?a===e:"others"===b?a!==e:"left"===b?c<f:c>f)));if(!g.size)return;let h=c.activeDiff??c.activePath;for(let a of g){if("string"!=typeof a){this.invalidateDiff(a);continue}this.documentRequests.get(a)?.abort(),this.documentRequests.delete(a),this.releaseDocument(c.documents.get(a)),c.documents.delete(a),this.restoredEditorStates.delete(a),this.restoredFileViewModes.delete(a),this.restoredPreviewScrollTops.delete(a),this.closeMissing.delete(a),this.restoredTabs.delete(a)}if(c.tabs=c.tabs.filter(a=>!g.has(a)),c.diffs=c.diffs.filter(a=>!g.has(a)),c.activePath&&g.has(c.activePath)){let a=d.filter(a=>"string"==typeof a),b=a.indexOf(c.activePath);c.activePath=a.slice(b+1).find(a=>!g.has(a))??a.slice(0,b).reverse().find(a=>!g.has(a))??null}if(null!==h&&g.has(h)){this.navigation=null;let a=d.indexOf(h),b=d.slice(a+1).find(a=>!g.has(a))??d.slice(0,a).reverse().find(a=>!g.has(a));c.activeDiff="object"==typeof b?b:null,"string"==typeof b&&(c.activePath=b)}this.publish(),c.activeDiff?this.ensureDiff(c.activeDiff):c.activePath&&h!==c.activePath&&this.ensureDocument(c.activePath)}reloadFile(a){if(this.state.tabs.includes(a)){if(this.state.activePath===a&&this.navigation)return void this.ensureDocument(a,!0);this.invalidateDocument(a),this.publish(),this.ensureDocument(a)}}async ensureDocument(a,b=!1){if(this.disposed||!this.state.tabs.includes(a)||this.documentRequests.has(a))return;let c=this.state.documents.get(a);if(!b&&c&&["loading","text","image"].includes(c.status))return;let d=new AbortController;this.documentRequests.set(a,d),c?.status!=="text"&&c?.status!=="image"&&(this.state.documents.set(a,{status:"loading"}),this.publish());try{let b=await this.reader.get(a,this.options.imagePreviewMode(),d.signal);if(this.documentRequests.get(a)!==d)return;let e="image"===b.kind?(0,f.E)(b):null,g=c?.status==="text"&&"text"===b.kind&&c.content===b.content&&c.size===b.size||c?.status==="image"&&null!==e&&await p(c.blob,e);if(this.documentRequests.get(a)!==d)return;this.documentRequests.delete(a),this.closeMissing.delete(a),this.restoredTabs.delete(a),g||this.state.documents.set(a,"text"===b.kind?{status:"text",content:b.content,size:b.size,editorState:c?.status==="text"?c.editorState:this.restoredEditorStates.get(a)??null,viewMode:this.state.activePath===a&&this.navigation?"source":c?.status==="text"?c.viewMode:this.restoredFileViewModes.get(a)??("markdown"===(0,i.g)(a)||this.options.htmlPreview&&"html"===(0,i.g)(a)?"preview":"source"),previewScrollTop:c?.status==="text"?c.previewScrollTop:this.restoredPreviewScrollTops.get(a)??0}:{status:"image",mimeType:b.mimeType,size:b.size,objectUrl:URL.createObjectURL(e),blob:e}),this.state.activePath===a&&"text"!==b.kind&&(this.navigation=null),g||this.releaseDocument(c)}catch(f){if(this.documentRequests.get(a)!==d)return;this.documentRequests.delete(a);let b=this.restoredTabs.delete(a),e=this.closeMissing.delete(a);if((b||e)&&f instanceof h.aw&&404===f.status&&"errors:fileMissing"===f.errorKey){this.closeTabs(a,"current"),e&&this.options.onNotice?.(n("branchFileClosed",{path:a}));return}console.warn("[Pi Desk][ProjectFile] 读取文件失败",{cwd:this.cwd,path:a,error:o(f)}),this.state.documents.set(a,{status:"error",error:o(f)}),this.releaseDocument(c),this.state.activePath===a&&(this.navigation=null)}this.publish()}async compareFile(a,b,c){let d=this.state.documents.get(a);if(this.disposed||c.aborted||d?.status!=="text")return;if(!b){d.comparison&&(delete d.comparison,this.publish());return}let e={status:"loading"};d.comparison=e,this.publish();let f=()=>!this.disposed&&!c.aborted&&this.state.documents.get(a)===d&&d.comparison===e;try{let a=await this.reader.diff(b.repositoryRoot,b.path,c);if(!f())return;"text"===a.kind?(d.content=a.modified.content,d.size=new TextEncoder().encode(a.modified.content).length,d.comparison={status:"ready",repositoryRoot:b.repositoryRoot,path:b.path,original:a.original}):d.comparison={status:"unavailable"}}catch(b){if(!f())return;console.warn("[Pi Desk][ProjectFile] 读取行变更失败",{cwd:this.cwd,path:a,error:o(b)}),d.comparison={status:"error",error:o(b)}}this.publish()}openFileDiff(a,b){let c=this.state.documents.get(a);if(this.disposed||c?.status!=="text"||c.comparison?.status!=="ready")return;let d=c.comparison,e=this.state.diffs.find(a=>!a.comparison&&a.repositoryRoot===d.repositoryRoot&&a.path===d.path);if(e)this.invalidateDiff(e),Object.assign(e,{status:"text",original:d.original,modified:{path:d.path,content:c.content}});else{if(!this.canOpenTab())return;e={status:"text",repositoryRoot:d.repositoryRoot,path:d.path,original:d.original,modified:{path:d.path,content:c.content}},this.state.diffs.push(e)}void 0!==b&&(e.initialLine=b),this.openDiff(e.repositoryRoot,e.path)}openDiff(a,b,c,d){if(this.disposed)return;let e={repositoryRoot:a,path:b,comparison:c},f=this.state.diffs.find(a=>m(a)===m(e));if(f)void 0!==d&&(f.label=d);else{if(!this.canOpenTab())return;f={...e,status:"unloaded",label:d},this.state.diffs.push(f)}this.navigation=null,this.state.activeDiff=f,this.publish(),this.ensureDiff(f)}closeDiff(){this.closeTabs(null,"current")}reloadDiff(){let a=this.state.activeDiff;a&&!this.disposed&&(this.invalidateDiff(a),this.publish(),this.ensureDiff(a))}refreshDiff(){let a=this.state.activeDiff;a&&!a.comparison&&this.ensureDiff(a,!0)}saveDiffState(a,b){!this.disposed&&this.state.diffs.includes(a)&&b&&(a.editorState=b,delete a.initialLine)}setDiffViewMode(a){this.state.activeDiff&&(0,g.ZQ)({diffViewMode:a})}setDiffWrapLines(a){this.state.activeDiff&&(0,g.ZQ)({wrapLines:a})}setDiffCollapseUnchanged(a){this.state.activeDiff&&(0,g.ZQ)({collapseUnchanged:a})}handleGitBranchChanged(a){for(let b of(this.refreshTree(),this.state.tabs))(!a||b===a||b.startsWith(`${a}/`))&&(this.invalidateDocument(b),this.closeMissing.add(b));for(let b of this.state.diffs)b.repositoryRoot!==a||b.comparison||this.invalidateDiff(b);this.publish(),this.state.activeDiff?this.ensureDiff(this.state.activeDiff):this.state.activePath&&this.ensureDocument(this.state.activePath)}saveEditorState(a,b){let c=this.state.documents.get(a);c?.status==="text"&&(c.editorState=b)}savePreviewScrollTop(a,b){let c=this.state.documents.get(a);c?.status==="text"&&(c.previewScrollTop=b)}setWrapLines(a,b){this.state.documents.get(a)?.status==="text"&&(0,g.ZQ)({wrapLines:b})}setTextViewMode(a,b){let c=this.state.documents.get(a);c?.status==="text"&&c.viewMode!==b&&(c.viewMode=b,this.publish())}dispose(){for(let a of(this.disposed=!0,this.compactRequests.clear(),this.directoryRequests.values()))a.controller.abort();for(let a of(this.directoryRequests.clear(),this.documentRequests.values()))a.abort();for(let a of(this.documentRequests.clear(),this.cancelSearch(),this.state.diffs))this.invalidateDiff(a);for(let a of(this.state.diffs=[],this.state.activeDiff=null,this.state.documents.values()))this.releaseDocument(a);this.state.documents.clear(),this.restoredPreviewScrollTops.clear(),this.listeners.clear()}async ensureDiff(a,b=!1){let c=m(a);if(this.disposed||!b&&"unloaded"!==a.status||this.diffRequests.has(c))return;let d=new AbortController;this.diffRequests.set(c,d),"text"!==a.status&&"metadata"!==a.status&&(Object.assign(a,{status:"loading"}),this.publish());try{let b=await this.reader.diff(a.repositoryRoot,a.path,d.signal,a.comparison);if(this.diffRequests.get(c)!==d)return;Object.assign(a,"text"===b.kind?{status:"text",original:b.original,modified:b.modified}:"metadata"===b.kind?{status:"metadata",originalMetadata:b.original,modifiedMetadata:b.modified}:{status:b.kind,error:null})}catch(b){if(this.diffRequests.get(c)!==d)return;console.warn("[Pi Desk][ProjectFile] 读取 Diff 失败",{cwd:this.cwd,repositoryRoot:a.repositoryRoot,path:a.path,error:o(b)}),Object.assign(a,{status:"error",error:o(b)})}this.diffRequests.get(c)===d&&(this.diffRequests.delete(c),this.publish())}invalidateDiff(a){let b=m(a);for(let c of(this.diffRequests.get(b)?.abort(),this.diffRequests.delete(b),Object.assign(a,{status:"unloaded"}),["original","modified","originalMetadata","modifiedMetadata","error"]))Reflect.deleteProperty(a,c)}canOpenTab(){let a=this.options.maxTabs;return!a||this.state.tabs.length+this.state.diffs.length<a||(this.options.onNotice?.(n("maxOpenFiles",{count:a})),!1)}cancelSearch(){this.searchRequest?.abort(),this.searchRequest=null}invalidateDocument(a){this.state.activePath===a&&(this.navigation=null),this.documentRequests.get(a)?.abort(),this.documentRequests.delete(a);let b=this.state.documents.get(a);b?.status==="text"&&(b.editorState&&this.restoredEditorStates.set(a,b.editorState),this.restoredFileViewModes.set(a,b.viewMode),this.restoredPreviewScrollTops.set(a,b.previewScrollTop)),this.releaseDocument(b),this.state.documents.set(a,{status:"unloaded"})}releaseDocument(a){a?.status==="image"&&URL.revokeObjectURL(a.objectUrl)}publish(){if(!this.disposed)for(let a of(this.revision+=1,this.listeners))a()}}},93306:(a,b,c)=>{"use strict";c.d(b,{x:()=>e});var d=c(97563);function e(a){return(0,d.h3)(a)}},95186:(a,b,c)=>{"use strict";c.d(b,{QL:()=>g,Y4:()=>h,aw:()=>f});var d=c(21850),e=c(17983);class f extends Error{constructor(a,b,c,d=null){super(c),this.status=a,this.code=b,this.errorKey=d,this.name="L3ProjectRequestError"}}async function g(a,b,c,e){let g=await fetch(b.path,{method:"POST",headers:{"Content-Type":"application/json","X-Pi-Desk-Client-Id":a},body:JSON.stringify(b.request.parse(c)),signal:e}),h=await g.json();if(!g.ok||0!==h.code||null===h.data)throw new f(g.status,h.code,h.msg?(0,d.B)(h):"项目读取失败",h.i18n?.key??null);return b.response.parse(h.data)}function h(a,b,c){async function d(b,d,e){try{return await g(a,b,d,e)}catch(a){throw!e?.aborted&&a instanceof f&&401===a.status&&c?.(),a}}return{list:(a,c)=>d(e.Xe,{...b,path:a},c),search:(a,c)=>d(e.fg,{...b,...a},c),get:(a,c,f)=>d(e.ZI,{...b,path:a,imagePreviewMode:c},f),snapshot:(a,c)=>d(e.p0,{...b,refresh:c},a),branches:(a,c)=>d(e.ry,{...b,repositoryRoot:a},c),log:(a,c,f)=>d(e.p3,{...b,repositoryRoot:a,...c},f),changes:(a,c,f)=>d(e.ys,{...b,repositoryRoot:a,...c},f),diff:(a,c,f,g)=>d(e.OC,{...b,repositoryRoot:a,path:c,comparison:g},f)}}},97563:(a,b,c)=>{"use strict";async function d(a){let b="u"<typeof navigator?void 0:navigator.clipboard;if(b?.writeText)try{return await b.writeText(a),!0}catch{}if("u"<typeof document||!document.body)return!1;let c=document.activeElement instanceof HTMLElement?document.activeElement:null,d=document.createElement("textarea");d.value=a,d.setAttribute("readonly",""),d.setAttribute("aria-hidden","true"),d.style.position="fixed",d.style.top="-9999px",d.style.left="-9999px",d.style.width="1px",d.style.height="1px",d.style.opacity="0";try{return document.body.append(d),d.select(),d.setSelectionRange(0,d.value.length),document.execCommand("copy")}catch{return!1}finally{d.remove();try{c?.focus()}catch{}}}c.d(b,{h3:()=>d,qj:()=>e});class e extends Error{constructor(a){super(a.message,{cause:a.cause}),this.name="PiDeskBrowserPluginError",this.pluginName=a.pluginName,this.contributionName=a.contributionName??null,this.phase=a.phase}}},98722:(a,b,c)=>{"use strict";c.d(b,{T8:()=>q,WW:()=>r,aD:()=>g,co:()=>m,lw:()=>s,ph:()=>p,xv:()=>k,yw:()=>n});var d=c(87883),e=c(51949),f=c(18997);let g=d.Yj().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),h=d.KC([g,d.eu("HEAD"),d.Yj().max(1024).regex(/^refs\/(?:heads|remotes)\/[^\0\r\n]+$/)]).refine(a=>!a.includes("..")&&!a.endsWith("/"),"Git 版本无效"),i=d.KC([d.Ik({commit:h,parent:g.optional()}).strict(),d.Ik({base:h,target:h,strategy:d.k5(["merge-base","direct"])}).strict()]),j=d.Ik({base:g.nullable(),target:g,original:g.nullable()}).strict(),k=d.Ik({baseCommit:g.nullable(),targetCommit:g,oldPath:e._g.optional()}).strict(),l=d.Ik({oid:g,parents:d.YO(g),subject:d.Yj(),author:d.Yj(),timestampMs:d.ai().int(),refs:d.YO(d.Yj())}).strict(),m=d.Ik({tip:h,exclude:h.optional(),query:d.Yj().trim().max(200).default(""),author:d.Yj().trim().max(200).optional(),page:d.Ik({index:d.ai().int().min(1).max(2e3),size:d.ai().int().min(1).max(100)}).strict()}).strict(),n=d.Ik({tip:g.nullable(),exclude:g.nullable(),items:d.YO(l),hasMore:d.zM(),truncated:d.zM()}).strict(),o=d.Ik({path:e._g,oldPath:e._g.nullable(),status:d.k5(["added","modified","deleted","renamed","type-changed"])}).strict(),p=d.Ik({selection:i,page:d.Ik({index:d.ai().int().min(1).max(5e4),size:d.ai().int().min(1).max(500)}).strict()}).strict(),q=d.Ik({comparison:j,commit:l.extend({message:d.Yj(),selectedParent:g.nullable()}).nullable(),items:d.YO(o),hasMore:d.zM(),truncated:d.zM()}).strict(),r=f.gf.extend({upstream:d.Ik({ref:d.Yj(),ahead:d.ai().int().nonnegative().nullable(),behind:d.ai().int().nonnegative().nullable()}).strict().nullable()}).strict(),s=d.KC([f.FJ,d.Ik({kind:d.eu("metadata"),original:d.Yj(),modified:d.Yj()}).strict()])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/
|
|
1
|
+
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/IDVi-aOj0xwp4DoZljk5f/_buildManifest.js","static/IDVi-aOj0xwp4DoZljk5f/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-a84310d111797bef.js","static/chunks/e388c842-1ca92f1ea0dfe8ee.js","static/chunks/64444-3e955f910569274d.js","static/chunks/main-app-6230945a5a062fce.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-a84310d111797bef.js"/><script src="/_next/static/chunks/e388c842-1ca92f1ea0dfe8ee.js" async=""></script><script src="/_next/static/chunks/64444-3e955f910569274d.js" async=""></script><script src="/_next/static/chunks/main-app-6230945a5a062fce.js" async=""></script><script src="/_next/static/chunks/57235-03ba1044f22b6c84.js" async=""></script><script src="/_next/static/chunks/22092-6d1bfbefa825ec03.js" async=""></script><script src="/_next/static/chunks/app/error-1ab62762c5f4144f.js" async=""></script><script src="/_next/static/chunks/app/not-found-b8b9b7ef5ccb7601.js" async=""></script><script src="/_next/static/chunks/app/global-error-6f5fc4928fd1966c.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-a84310d111797bef.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[90184,[],\"\"]\n3:I[84845,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"18039\",\"static/chunks/app/error-1ab62762c5f4144f.js\"],\"default\"]\n4:I[44478,[],\"\"]\n5:I[66999,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"24345\",\"static/chunks/app/not-found-b8b9b7ef5ccb7601.js\"],\"L1ErrorPage\"]\n6:I[14405,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[14405,[],\"ViewportBoundary\"]\nc:I[14405,[],\"MetadataBoundary\"]\ne:I[71713,[\"34219\",\"static/chunks/app/global-error-6f5fc4928fd1966c.js\"],\"default\"]\n9:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$3\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L5\",null,{\"notFound\":true}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$9\"]},null,false,\"$9\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-a84310d111797bef.js"/><script src="/_next/static/chunks/e388c842-1ca92f1ea0dfe8ee.js" async=""></script><script src="/_next/static/chunks/64444-3e955f910569274d.js" async=""></script><script src="/_next/static/chunks/main-app-6230945a5a062fce.js" async=""></script><script src="/_next/static/chunks/57235-03ba1044f22b6c84.js" async=""></script><script src="/_next/static/chunks/22092-6d1bfbefa825ec03.js" async=""></script><script src="/_next/static/chunks/app/error-1ab62762c5f4144f.js" async=""></script><script src="/_next/static/chunks/app/not-found-b8b9b7ef5ccb7601.js" async=""></script><script src="/_next/static/chunks/app/global-error-6f5fc4928fd1966c.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-a84310d111797bef.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[90184,[],\"\"]\n3:I[84845,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"18039\",\"static/chunks/app/error-1ab62762c5f4144f.js\"],\"default\"]\n4:I[44478,[],\"\"]\n5:I[66999,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"24345\",\"static/chunks/app/not-found-b8b9b7ef5ccb7601.js\"],\"L1ErrorPage\"]\n6:I[14405,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[14405,[],\"ViewportBoundary\"]\nc:I[14405,[],\"MetadataBoundary\"]\ne:I[71713,[\"34219\",\"static/chunks/app/global-error-6f5fc4928fd1966c.js\"],\"default\"]\n9:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$3\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L5\",null,{\"notFound\":true}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$9\"]},null,false,\"$9\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"IDVi-aOj0xwp4DoZljk5f\"}\n9:C\nb:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n8:null\nd:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"3b/RVN6kfSC1ShQxS3HX66BsOChiDOl7Uf2UfFC4D0s="}
|