@scolladon/tsgit 3.0.0 → 3.1.0
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/README.md +12 -0
- package/dist/cjs/adapters/browser/index.cjs +1 -2
- package/dist/cjs/adapters/memory/index.cjs +1 -2
- package/dist/cjs/adapters/node/index.cjs +1 -2
- package/dist/cjs/chunks/{adapter-detect-D7DFJtuk.cjs → adapter-detect-DW9fsw9d.cjs} +1 -2
- package/dist/cjs/chunks/browser-http-transport-DGwW5YL7.cjs +1 -0
- package/dist/cjs/chunks/context-BcoAzPuU.cjs +0 -1
- package/dist/cjs/chunks/error-CfLWDui_.cjs +1 -0
- package/dist/cjs/chunks/index-Cy44GVR6.cjs +1 -0
- package/dist/cjs/chunks/inflate-CmCtM4-w.cjs +1 -0
- package/dist/cjs/chunks/lru-cache-1OU7JhD8.cjs +0 -1
- package/dist/cjs/chunks/memory-http-transport-CGriODcQ.cjs +1 -0
- package/dist/cjs/chunks/node-ssh-transport-PFu3ijfp.cjs +1 -0
- package/dist/cjs/chunks/{progress-CjhUeyxd.cjs → progress-D8Dqbftk.cjs} +1 -2
- package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs +0 -1
- package/dist/cjs/chunks/{repository-DJNNrfQr.cjs → repository-Ci-BBxk0.cjs} +1 -2
- package/dist/cjs/chunks/write-sparse-checkout-C1dsHCAD.cjs +1 -0
- package/dist/cjs/commands/index.cjs +1 -2
- package/dist/cjs/index.browser.cjs +1 -2
- package/dist/cjs/index.cjs +1 -2
- package/dist/cjs/index.default.cjs +1 -2
- package/dist/cjs/index.node.cjs +1 -2
- package/dist/cjs/operators/index.cjs +0 -1
- package/dist/cjs/primitives/index.cjs +1 -2
- package/dist/cjs/transport/index.cjs +0 -1
- package/dist/esm/adapters/browser/index.js +1 -2
- package/dist/esm/adapters/memory/index.js +1 -2
- package/dist/esm/adapters/node/index.js +1 -2
- package/dist/esm/chunks/{adapter-detect-CTTG6hpk.js → adapter-detect-BkCMnjrI.js} +1 -2
- package/dist/esm/chunks/browser-http-transport-CSxAte5h.js +1 -0
- package/dist/esm/chunks/context-CumKOV7K.js +0 -1
- package/dist/esm/chunks/error-BotOd-nD.js +1 -0
- package/dist/esm/chunks/index-DsvINN8n.js +1 -0
- package/dist/esm/chunks/inflate-BCIXqeeE.js +1 -0
- package/dist/esm/chunks/lru-cache-Cy7C7Lx2.js +0 -1
- package/dist/esm/chunks/memory-http-transport-caqmMGR1.js +1 -0
- package/dist/esm/chunks/node-ssh-transport-BgSv2IhT.js +1 -0
- package/dist/esm/chunks/{progress-CLPpgZJ6.js → progress-B_AJnOHx.js} +1 -2
- package/dist/esm/chunks/readable-stream-CGuf8k1J.js +0 -1
- package/dist/esm/chunks/repository-DyxknzvE.js +1 -0
- package/dist/esm/chunks/write-sparse-checkout-BwHbNKNS.js +1 -0
- package/dist/esm/commands/index.js +1 -2
- package/dist/esm/index.browser.js +1 -2
- package/dist/esm/index.default.js +1 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.node.js +1 -2
- package/dist/esm/operators/index.js +0 -1
- package/dist/esm/primitives/index.js +1 -2
- package/dist/esm/transport/index.js +0 -1
- package/dist/types/adapters/browser/index.d.cts +1 -1
- package/dist/types/adapters/browser/index.d.ts +1 -1
- package/dist/types/adapters/memory/index.d.cts +1 -1
- package/dist/types/adapters/memory/index.d.ts +1 -1
- package/dist/types/adapters/node/index.d.cts +94 -36
- package/dist/types/adapters/node/index.d.ts +94 -36
- package/dist/types/chunks/{context-D_A7-uau.d.cts → context-CF1YF2S8.d.cts} +48 -2
- package/dist/types/chunks/{context-CNtbFlwI.d.ts → context-sIhhtk2u.d.ts} +48 -2
- package/dist/types/chunks/{index-E_KapqW9.d.ts → index-B5Dps3fg.d.ts} +32 -3
- package/dist/types/chunks/{index-BJDekgCP.d.ts → index-B_A8VLaf.d.ts} +111 -12
- package/dist/types/chunks/{index-wwZiot4c.d.cts → index-Dfh8cvEs.d.cts} +32 -3
- package/dist/types/chunks/{index-CMLLVz9B.d.cts → index-Dqxddhav.d.cts} +111 -12
- package/dist/types/chunks/{progress-hcn9r2H3.d.ts → progress-BjAKfkam.d.ts} +51 -5
- package/dist/types/chunks/{progress-Cp-huK45.d.cts → progress-Ldnfb8st.d.cts} +51 -5
- package/dist/types/chunks/{reflog-entry-BGJr9VfU.d.cts → reflog-entry-Cqh3QrPH.d.ts} +12 -3
- package/dist/types/chunks/{reflog-entry-DecZqJna.d.ts → reflog-entry-Dy-O27Dd.d.cts} +12 -3
- package/dist/types/chunks/{repository-Dxhwpzd6.d.ts → repository-D8QBTkEz.d.ts} +5 -5
- package/dist/types/chunks/{repository-DASBgOb9.d.cts → repository-D9YrVhcH.d.cts} +5 -5
- package/dist/types/commands/index.d.cts +3 -3
- package/dist/types/commands/index.d.ts +3 -3
- package/dist/types/index.browser.d.cts +6 -6
- package/dist/types/index.browser.d.ts +6 -6
- package/dist/types/index.d.cts +8 -8
- package/dist/types/index.d.ts +8 -8
- package/dist/types/index.default.d.cts +6 -6
- package/dist/types/index.default.d.ts +6 -6
- package/dist/types/index.node.d.cts +6 -6
- package/dist/types/index.node.d.ts +6 -6
- package/dist/types/primitives/index.d.cts +3 -3
- package/dist/types/primitives/index.d.ts +3 -3
- package/package.json +90 -24
- package/dist/cjs/adapters/browser/index.cjs.map +0 -1
- package/dist/cjs/adapters/memory/index.cjs.map +0 -1
- package/dist/cjs/adapters/node/index.cjs.map +0 -1
- package/dist/cjs/chunks/adapter-detect-D7DFJtuk.cjs.map +0 -1
- package/dist/cjs/chunks/adler32-CrRRuL2P.cjs +0 -2
- package/dist/cjs/chunks/adler32-CrRRuL2P.cjs.map +0 -1
- package/dist/cjs/chunks/browser-http-transport-nGm6alox.cjs +0 -2
- package/dist/cjs/chunks/browser-http-transport-nGm6alox.cjs.map +0 -1
- package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +0 -1
- package/dist/cjs/chunks/error-CA80UqXF.cjs +0 -2
- package/dist/cjs/chunks/error-CA80UqXF.cjs.map +0 -1
- package/dist/cjs/chunks/index-01WCH0eg.cjs +0 -2
- package/dist/cjs/chunks/index-01WCH0eg.cjs.map +0 -1
- package/dist/cjs/chunks/lru-cache-1OU7JhD8.cjs.map +0 -1
- package/dist/cjs/chunks/memory-http-transport-7hpDW8o3.cjs +0 -2
- package/dist/cjs/chunks/memory-http-transport-7hpDW8o3.cjs.map +0 -1
- package/dist/cjs/chunks/node-http-transport-CoqnAvIL.cjs +0 -2
- package/dist/cjs/chunks/node-http-transport-CoqnAvIL.cjs.map +0 -1
- package/dist/cjs/chunks/progress-CjhUeyxd.cjs.map +0 -1
- package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs.map +0 -1
- package/dist/cjs/chunks/repository-DJNNrfQr.cjs.map +0 -1
- package/dist/cjs/chunks/write-sparse-checkout-DzVubBcI.cjs +0 -2
- package/dist/cjs/chunks/write-sparse-checkout-DzVubBcI.cjs.map +0 -1
- package/dist/cjs/commands/index.cjs.map +0 -1
- package/dist/cjs/index.browser.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index.default.cjs.map +0 -1
- package/dist/cjs/index.node.cjs.map +0 -1
- package/dist/cjs/operators/index.cjs.map +0 -1
- package/dist/cjs/primitives/index.cjs.map +0 -1
- package/dist/cjs/transport/index.cjs.map +0 -1
- package/dist/esm/adapters/browser/index.js.map +0 -1
- package/dist/esm/adapters/memory/index.js.map +0 -1
- package/dist/esm/adapters/node/index.js.map +0 -1
- package/dist/esm/chunks/adapter-detect-CTTG6hpk.js.map +0 -1
- package/dist/esm/chunks/adler32-BfvKJOAO.js +0 -2
- package/dist/esm/chunks/adler32-BfvKJOAO.js.map +0 -1
- package/dist/esm/chunks/browser-http-transport-DD0YKmIW.js +0 -2
- package/dist/esm/chunks/browser-http-transport-DD0YKmIW.js.map +0 -1
- package/dist/esm/chunks/context-CumKOV7K.js.map +0 -1
- package/dist/esm/chunks/error-BD0nFV6t.js +0 -2
- package/dist/esm/chunks/error-BD0nFV6t.js.map +0 -1
- package/dist/esm/chunks/index-BEI7XKaV.js +0 -2
- package/dist/esm/chunks/index-BEI7XKaV.js.map +0 -1
- package/dist/esm/chunks/lru-cache-Cy7C7Lx2.js.map +0 -1
- package/dist/esm/chunks/memory-http-transport-D13LBPvu.js +0 -2
- package/dist/esm/chunks/memory-http-transport-D13LBPvu.js.map +0 -1
- package/dist/esm/chunks/node-http-transport-doU9Y8WN.js +0 -2
- package/dist/esm/chunks/node-http-transport-doU9Y8WN.js.map +0 -1
- package/dist/esm/chunks/progress-CLPpgZJ6.js.map +0 -1
- package/dist/esm/chunks/readable-stream-CGuf8k1J.js.map +0 -1
- package/dist/esm/chunks/repository-dCH3DdLQ.js +0 -2
- package/dist/esm/chunks/repository-dCH3DdLQ.js.map +0 -1
- package/dist/esm/chunks/write-sparse-checkout-D4tNUXOp.js +0 -2
- package/dist/esm/chunks/write-sparse-checkout-D4tNUXOp.js.map +0 -1
- package/dist/esm/commands/index.js.map +0 -1
- package/dist/esm/index.browser.js.map +0 -1
- package/dist/esm/index.default.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.node.js.map +0 -1
- package/dist/esm/operators/index.js.map +0 -1
- package/dist/esm/primitives/index.js.map +0 -1
- package/dist/esm/transport/index.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{T as t,v as e,k as n,x as o,u as r,y as s,o as i,z as a,A as c,B as d,l as u,C as f,D as l,E as h,s as w,F as p,G as g,H as m,I as y,J as v,K as b,L as k,M as x,N as E,O as I}from"./error-BD0nFV6t.js";import{r as $}from"./readable-stream-CGuf8k1J.js";const L=e=>new t({code:"INVALID_OBJECT_ID",value:e}),D=e=>new t({code:"INVALID_OBJECT_HEADER",reason:e}),C=(e,n)=>new t({code:"INVALID_TREE_ENTRY",offset:e,reason:n}),A=e=>new t({code:"INVALID_COMMIT",reason:e}),O=e=>new t({code:"INVALID_TAG",reason:e}),S=(e,n)=>new t({code:"INVALID_IDENTITY",line:e,reason:n}),T=e=>new t({code:"OBJECT_NOT_FOUND",id:e}),U=(e,n)=>new t({code:"OBJECT_HASH_MISMATCH",expected:e,actual:n}),_=(e,n,o)=>new t({code:"UNEXPECTED_OBJECT_TYPE",expected:e,actual:n,id:o}),N=e=>new t({code:"TREE_DEPTH_EXCEEDED",depth:e}),M=(e,n)=>new t({code:"TREE_ENTRY_LIMIT_EXCEEDED",count:e,limit:n}),R=(e,n,o)=>new t({code:"OBJECT_TOO_LARGE",id:e,actualSize:n,limit:o}),P={REGULAR:"100644",EXECUTABLE:"100755",SYMLINK:"120000",DIRECTORY:"40000",GITLINK:"160000"},F=new Set(Object.values(P)),B=new Map([["040000",P.DIRECTORY]]);function W(e){return function(e){if(!F.has(e))throw new t({code:"INVALID_FILE_MODE",value:e});return e}(B.get(e)??e)}function z(t){return t===P.DIRECTORY}function j(t){return t.isSymbolicLink?P.SYMLINK:73&t.mode?P.EXECUTABLE:P.REGULAR}const H=function(){const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n}return t}();function K(t){let e=4294967295;for(let n=0;n<t.length;n++)e=H[255&(e^t[n])]^e>>>8;return(4294967295^e)>>>0}const V=t=>/[a-zA-Z0-9-]/.test(t),G=t=>{if(!/[a-zA-Z]/.test(t[0]))return 0;for(let e=1;e<t.length;e+=1)if(!V(t[e]))return e},Y=/[\n\0]/,q=t=>{const n=t.indexOf(".");if(-1===n)throw e(t,"missing-name");const o=t.slice(0,n),r=t.lastIndexOf("."),s=t.slice(r+1),i=n===r?void 0:t.slice(n+1,r);if(0===o.length&&void 0===i)throw e(t,"empty-section");if(0===s.length)throw e(t,"missing-name");if(o.length>0){const n=G(o);if(void 0!==n)throw e(t,"bad-character",n)}const a=G(s);if(void 0!==a)throw e(t,"bad-character",r+1+a);if(void 0!==i&&Y.test(i)){const o=i.search(Y);throw e(t,"bad-character",n+1+o)}return{section:o.toLowerCase(),subsection:i,name:s.toLowerCase()}},X=1e6,J=e=>new t({code:"INVALID_INDEX_HEADER",reason:e}),Q=(e,n)=>new t({code:"INVALID_INDEX_ENTRY",offset:e,reason:n}),Z={assumeValid:!1,stage:0,skipWorktree:!1,intentToAdd:!1},tt=t=>({ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:t.mode,uid:0,gid:0,fileSize:0,id:t.id,flags:{...Z,skipWorktree:!0},path:t.path}),et=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function nt(t){const e=new Array(t.length);for(let n=0;n<t.length;n++)e[n]=et[t[n]];return e.join("")}function ot(t){if(t.length%2!=0)throw new Error("Hex string must have even length");const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2){const o=rt(t.charCodeAt(n)),r=rt(t.charCodeAt(n+1));if(-1===o||-1===r)throw new Error(`Invalid hex character at position ${n}`);e[n/2]=o<<4|r}return e}function rt(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:-1}function st(t,e){const n=Math.min(t.length,e.length);for(let o=0;o<n;o++)if(t[o]!==e[o])return t[o]-e[o];return t.length-e.length}function it(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function at(t,e,n){for(let o=n;o<t.length;o++)if(t[o]===e)return o;return-1}const ct=new TextEncoder,dt=new TextDecoder;function ut(t){return ct.encode(t)}function ft(t){return dt.decode(t)}function lt(t){const e=t.indexOf("\n\n");return-1===e?{headerPart:t,message:""}:{headerPart:t.slice(0,e),message:t.slice(e+2)}}function ht(t,e){if(t.includes("\n")||t.includes(" ")||""===t)throw new Error(`invalid header key: ${t}`);const n=e.split("\n");return[`${t} ${n[0]}`,...n.slice(1).map(t=>` ${t}`)].join("\n")}function wt(t){const e=t.indexOf(" ");return-1===e?{key:t,value:""}:{key:t.slice(0,e),value:t.slice(e+1)}}function pt(t,e,n,o){let r;const s=[];let i=e;for(;i<t.length;){const{key:e,value:a}=wt(t[i]);""===e&&n("unexpected continuation line without preceding header");const c=[a];let d=i;for(let e=i+1;e<t.length;e++){const n=t[e];if(!n.startsWith(" "))break;c.push(n.slice(1)),d=e}i=d+1;const u=c.join("\n");"gpgsig"===e?(void 0!==r&&o("duplicate gpgsig header"),r=u):s.push({key:e,value:u})}return{gpgSignature:r,extraHeaders:s}}function gt(t){const e=t.lastIndexOf(">");if(-1===e)throw S(t,"missing closing angle bracket");const n=t.lastIndexOf("<",e);if(-1===n)throw S(t,"missing opening angle bracket");const o=t.slice(0,n),r=o.endsWith(" ")?o.slice(0,-1):o,s=t.slice(n+1,e),i=t.slice(e+1).trim().split(/\s+/);if(i.length<2)throw S(t,"missing timestamp or timezone");const a=Number(i[0]);if(!Number.isSafeInteger(a))throw S(t,"invalid timestamp");const c=i[1];if(!/^[+-]\d{4}$/.test(c))throw S(t,"invalid timezone offset");return{name:r,email:s,timestamp:a,timezoneOffset:c}}const mt=/[\n\r\0]/;function yt(t){const e=`${t.name} <${t.email}>`;if(mt.test(t.name))throw S(e,"name contains forbidden control character");if(mt.test(t.email))throw S(e,"email contains forbidden control character");if(mt.test(t.timezoneOffset))throw S(e,"timezoneOffset contains forbidden control character");if(t.name.includes("<")||t.name.includes(">"))throw S(e,"invalid identity fields");if(t.email.includes("<")||t.email.includes(">"))throw S(e,"invalid identity fields");if(!/^[+-]\d{4}$/.test(t.timezoneOffset))throw S(e,"invalid identity fields");return`${t.name} <${t.email}> ${t.timestamp} ${t.timezoneOffset}`}const vt=/^[0-9a-f]{40}$/,bt=/^[0-9a-f]{64}$/,kt={from(t){if(!vt.test(t)&&!bt.test(t))throw L(t);return t},fromRaw(t){if(20!==t.length&&32!==t.length)throw L(`raw bytes length ${t.length} is not 20 or 32`);return kt.from(nt(t))}},xt=kt.from("0000000000000000000000000000000000000000");kt.from("4b825dc642cb6eb9a060e54bf8d69288fbee4904");const Et={from(t){if(""===t)throw new Error("RefName must not be empty");return t}},It={from(t){if(""===t)throw new Error("FilePath must not be empty");return t}};function $t(t){const e=[],{data:n}=t;e.push(`tree ${n.tree}`);for(const t of n.parents)e.push(`parent ${t}`);e.push(`author ${yt(n.author)}`),e.push(`committer ${yt(n.committer)}`),void 0!==n.gpgSignature&&e.push(ht("gpgsig",n.gpgSignature));for(const t of n.extraHeaders)e.push(ht(t.key,t.value));return ut(`${e.join("\n")}\n\n${n.message}`)}const Lt=new Set(["blob","tree","commit","tag"]);function Dt(t){const e=at(t,0,0);if(-1===e)throw D("missing null terminator");const n=ft(t.subarray(0,e)),o=n.indexOf(" ");if(-1===o)throw D("missing space between type and size");const r=n.slice(0,o);if(!Lt.has(r))throw D(`unknown object type: ${r}`);const s=n.slice(o+1),i=Number(s);if(!Number.isFinite(i)||i<0||s!==String(i))throw D(`invalid size: ${s}`);return{type:r,size:i,contentOffset:e+1}}const Ct=new Set(["blob","tree","commit","tag"]);function At(t){const e=[],{data:n}=t;if(e.push(`object ${n.object}`),e.push(`type ${n.objectType}`),""===n.tagName||n.tagName.includes("\n")||n.tagName.includes("\0"))throw O(`invalid tag name: ${n.tagName}`);e.push(`tag ${n.tagName}`),void 0!==n.tagger&&e.push(`tagger ${yt(n.tagger)}`),void 0!==n.gpgSignature&&e.push(ht("gpgsig",n.gpgSignature));for(const t of n.extraHeaders)e.push(ht(t.key,t.value));return ut(`${e.join("\n")}\n\n${n.message}`)}function Ot(t,e){const n=St(t.entries).map(t=>({mode:ut(t.mode),name:ut(t.name),hash:ot(t.id)})),o=n.reduce((t,n)=>t+n.mode.length+1+n.name.length+1+e.digestLength,0),r=new Uint8Array(o);let s=0;for(const t of n)r.set(t.mode,s),s+=t.mode.length,r[s++]=32,r.set(t.name,s),s+=t.name.length,r[s++]=0,r.set(t.hash,s),s+=t.hash.length;return r}function St(t){const e=t.map(t=>({entry:t,sortKey:Ut(t.name,z(t.mode))}));return e.sort((t,e)=>st(t.sortKey,e.sortKey)),e.map(t=>t.entry)}function Tt(t,e){return st(Ut(t.name,z(t.mode)),Ut(e.name,z(e.mode)))}function Ut(t,e){const n=ut(t);if(!e)return n;const o=new Uint8Array(n.length+1);return o.set(n),o[n.length]=47,o}function _t(t,e,n){const{type:o,size:r,contentOffset:s}=Dt(e),i=e.subarray(s);if(i.length!==r)throw D(`size mismatch: header says ${r}, actual content is ${i.length}`);switch(o){case"blob":return function(t,e){return{type:"blob",id:t,content:e}}(t,i);case"tree":return function(t,e,n){const o=[],r=new Set;let s=0;for(;s<e.length;){const t=at(e,32,s);if(-1===t)throw C(s,"missing space after mode");const i=ft(e.subarray(s,t)),a=at(e,0,t+1);if(-1===a)throw C(s,"missing null after name");const c=ft(e.subarray(t+1,a));if(""===c||"."===c||".."===c||c.includes("/"))throw C(s,`invalid entry name: ${c}`);const d=a+1,u=d+n.digestLength;if(u>e.length)throw C(s,"truncated hash");const f=e.subarray(d,u),l=kt.fromRaw(f),h=W(i);if(r.has(c))throw C(s,`duplicate entry name: ${c}`);r.add(c),o.push({mode:h,name:c,id:l}),s=u}return{type:"tree",id:t,entries:o}}(t,i,n);case"commit":return function(t,e){const{headerPart:n,message:o}=lt(ft(e)),r=n.split("\n"),{tree:s,parents:i,author:a,committer:c,nextIndex:d}=function(t){if(!t[0].startsWith("tree "))throw A("first line must be tree");const e=kt.from(t[0].slice(5)),n=[];let o=1;for(;o<t.length&&t[o].startsWith("parent ");)n.push(kt.from(t[o].slice(7))),o++;if(o>=t.length||!t[o].startsWith("author "))throw A("missing author");const r=gt(t[o].slice(7));if(o++,o>=t.length||!t[o].startsWith("committer "))throw A("missing committer");const s=gt(t[o].slice(10));return o++,{tree:e,parents:n,author:r,committer:s,nextIndex:o}}(r),{gpgSignature:u,extraHeaders:f}=function(t,e){return pt(t,e,t=>{throw A(t)},t=>{throw A(t)})}(r,d);return{type:"commit",id:t,data:{tree:s,parents:i,author:a,committer:c,message:o,...void 0!==u?{gpgSignature:u}:{},extraHeaders:f}}}(t,i);case"tag":return function(t,e){const{headerPart:n,message:o}=lt(ft(e)),r=n.split("\n"),{object:s,objectType:i,tagName:a,nextIndex:c}=function(t){if(!t[0].startsWith("object "))throw O("first line must be object");const e=kt.from(t[0].slice(7));if(t.length<2||!t[1].startsWith("type "))throw O("second line must be type");const n=t[1].slice(5);if(!Ct.has(n))throw O(`invalid object type: ${n}`);if(t.length<3||!t[2].startsWith("tag "))throw O("third line must be tag name");const o=t[2].slice(4);if(""===o||o.includes("\0")||o.includes("\n"))throw O(`invalid tag name: ${o}`);return{object:e,objectType:n,tagName:o,nextIndex:3}}(r),{tagger:d,nextIndex:u}=function(t,e){return e<t.length&&t[e].startsWith("tagger ")?{tagger:gt(t[e].slice(7)),nextIndex:e+1}:{tagger:void 0,nextIndex:e}}(r,c),{gpgSignature:f,extraHeaders:l}=function(t,e){return pt(t,e,t=>{throw O(t)},t=>{throw O(t)})}(r,u);return{type:"tag",id:t,data:{object:s,objectType:i,tagName:a,...void 0!==d?{tagger:d}:{},message:o,...void 0!==f?{gpgSignature:f}:{},extraHeaders:l}}}(t,i)}}function Nt(t,e){let n;switch(t.type){case"blob":n=t.content;break;case"tree":n=Ot(t,e);break;case"commit":n=$t(t);break;case"tag":n=At(t)}const o=ut(`${t.type} ${n.length}\0`),r=new Uint8Array(o.length+n.length);return r.set(o,0),r.set(n,o.length),r}const Mt=(t,e)=>{switch(t.type){case"blob":return t.content.byteLength;case"tree":return Ot(t,e).byteLength;case"commit":return $t(t).byteLength;case"tag":return At(t).byteLength}},Rt=new Set(["",".",".."]),Pt=new Set([1564,8206,8207,8234,8235,8236,8237,8238,8294,8295,8296,8297]),Ft=t=>""===t?"empty segment rejected":"."===t?"'.' segment rejected":"'..' segment rejected",Bt=t=>t<32||t>=127&&t<=159,Wt=(t,e)=>{if(t.startsWith("/"))throw Q(e,"absolute path rejected");const n=(t=>{for(let e=0;e<t.length;e+=1){const n=t.charCodeAt(e);if(92===n)return"backslash rejected";if(Bt(n))return"control character rejected";if(Pt.has(n))return"bidi control character rejected"}})(t);if(void 0!==n)throw Q(e,n);for(const n of t.split("/"))if(Rt.has(n))throw Q(e,Ft(n))};function zt(t,e,n,o){const r=t.getUint16(e+60),s=!!(16384&r);if(s&&3!==n)throw Q(e,"extended flag requires index v3");const i=s?2:0;if(e+62+i>o-20)throw Q(e,"truncated extended flags");return{flags:(a=r,c=s?t.getUint16(e+62):0,{assumeValid:!!(32768&a),stage:a>>>12&3,skipWorktree:!!(16384&c),intentToAdd:!!(8192&c)}),extendedSize:i};var a,c}function jt(t,e){for(let n=e;n<t.length;n++)if(0===t[n])return n;return-1}function Ht(t,e){const n=t.path,o=e.path;return n<o?-1:n>o?1:0}function Kt(t,e,n,o,r,s){e.setUint32(n,o.ctimeSeconds),e.setUint32(n+4,o.ctimeNanoseconds),e.setUint32(n+8,o.mtimeSeconds),e.setUint32(n+12,o.mtimeNanoseconds),e.setUint32(n+16,o.dev),e.setUint32(n+20,o.ino),e.setUint32(n+24,Number.parseInt(o.mode,8)),e.setUint32(n+28,o.uid),e.setUint32(n+32,o.gid),e.setUint32(n+36,o.fileSize);const i=ot(o.id);t.set(i,n+40);const a=Math.min(r.length,4095);e.setUint16(n+60,(o.flags.assumeValid?32768:0)|(s?16384:0)|o.flags.stage<<12|a),s&&e.setUint16(n+62,(o.flags.skipWorktree?16384:0)|(o.flags.intentToAdd?8192:0)),t.set(r,n+62+(s?2:0))}function Vt(t){switch(t.type){case"add":case"rename":case"copy":return t.newPath;case"delete":return t.oldPath;case"modify":case"type-change":return t.path}}function Gt(t){return t===P.REGULAR||t===P.EXECUTABLE?"file":t===P.SYMLINK?"symlink":t===P.DIRECTORY?"directory":"gitlink"}function Yt(t,e){return Gt(t)===Gt(e)}function qt(t){return"gitlink"===Gt(t)}const Xt=new TextEncoder;function Jt(t,e){return st(Xt.encode(t),Xt.encode(e))}function Qt(t,e){const n=t.map(t=>({item:t,key:Xt.encode(e(t))}));return n.sort((t,e)=>st(t.key,e.key)),n.map(t=>t.item)}function Zt(t){return 32===t||9===t}function te(t){const e=t.length-1;return e>=0&&10===t[e]?e:t.length}function ee(t,e){const n=function(t,e){return e.ignoreCrAtEol||"all"===e.mode||"change"===e.mode||"at-eol"===e.mode?function(t){const e=te(t),n=e-1;if(n<0||13!==t[n])return t;const o=new Uint8Array(t.length-1);return o.set(t.subarray(0,n)),e<t.length&&(o[n]=10),o}(t):t}(t,e);switch(e.mode){case"all":return function(t){const e=te(t),n=[];for(let o=0;o<e;o++){const e=t[o];Zt(e)||n.push(e)}return e<t.length&&n.push(10),new Uint8Array(n)}(n);case"change":return function(t){const e=te(t),n=[];let o=!1;for(let r=0;r<e;r++){const e=t[r];Zt(e)?o||(n.push(32),o=!0):(o=!1,n.push(e))}return n.length>0&&32===n[n.length-1]&&n.pop(),e<t.length&&n.push(10),new Uint8Array(n)}(n);case"at-eol":return function(t){const e=te(t);let n=e;for(;n>0&&Zt(t[n-1]);)n--;if(n===e&&e===t.length)return t;const o=new Uint8Array(n+(e<t.length?1:0));return o.set(t.subarray(0,n)),e<t.length&&(o[n]=10),o}(n);case"none":return n}}const ne={mode:"none",ignoreCrAtEol:!1};function oe(t,e){return 0===te(ee(t,e))}const re=65536,se=1e5;function ie(t){const e=[];let n=0;for(let o=0;o<t.length;o++)10===t[o]&&(e.push(t.subarray(n,o+1)),n=o+1);return n<t.length&&e.push(t.subarray(n)),e}function ae(t){return function(t){const e=Math.min(t.length,8e3);for(let n=0;n<e;n++)if(0===t[n])return!0;return!1}(t)||function(t){let e=0,n=0;for(let o=0;o<t.length;o++){if(e++,e>=65536)return!0;if(10===t[o]){if(n++,n>=se)return!0;e=0}}return e>0&&(n++,n>=se)}(t)}function ce(t,e,n,o){return o===-n||t[o-1+e]<t[o+1+e]}function de(t,e,n,o,r,s,i){let a=ce(n,o,r,s)?n[s+1+o]:n[s-1+o]+1,c=a-s;for(;a<t.length&&c<e.length&&i(t[a],e[c]);)a++,c++;return{x:a,y:c}}function ue(t){const e=[];let n=0,o=0,r=0;for(;r<t.length;){const s=t[r],i=n,a=o;for(;t[r]===s;)"equal"===s?(n++,o++):"delete"===s?n++:o++,r++;e.push({kind:"equal"===s?"common":"delete"===s?"ours-only":"theirs-only",oursStart:i,oursEnd:n,theirsStart:a,theirsEnd:o})}return e}function fe(t,e,n){const o=n?.lineKey,r=o?(t,e)=>function(t,e,n){return it(ee(t,n),ee(e,n))}(t,e,o):it,s=ie(t),i=ie(e),a=s.length,c=i.length;if(0===a&&0===c)return{hunks:[{kind:"common",oursStart:0,oursEnd:0,theirsStart:0,theirsEnd:0}],oursLines:s,theirsLines:i,degraded:!1};const d=function(t,e,n){const o=t.length,r=e.length;if(o+r>5e4)return;const s=o+r,i=s,a=new Array(2*s+1).fill(0),c=[],d=1e3*s;let u=0;for(let s=0;;s++){const f=2*s+1,l=new Array(f);for(let t=0;t<f;t++)l[t]=a[i-s+t];c.push(l);for(let f=-s;f<=s;f+=2){if(u++,u>d)return;const l=de(t,e,a,i,s,f,n);if(a[f+i]=l.x,l.x>=o&&l.y>=r)return{trace:c,totalD:s}}}}(s,i,r);return void 0===d?function(t,e){const n=[];return t.length>0&&n.push({kind:"ours-only",oursStart:0,oursEnd:t.length,theirsStart:0,theirsEnd:0}),e.length>0&&n.push({kind:"theirs-only",oursStart:t.length,oursEnd:t.length,theirsStart:0,theirsEnd:e.length}),{hunks:n,oursLines:t,theirsLines:e,degraded:!0}}(s,i):{hunks:ue(function(t,e,n){const o=[];let r=t,s=e;for(let t=n.length-1;t>0;t--){const e=n[t],i=t,a=r-s,c=ce(e,i,t,a)?a+1:a-1,d=e[c+i],u=d-c;for(;r>d&&s>u;)o.push("equal"),r--,s--;o.push(r===d?"insert":"delete"),r===d?s--:r--}for(;r>0;)o.push("equal"),r--;return o.reverse(),o}(a,c,d.trace)),oursLines:s,theirsLines:i,degraded:!1}}const le=6e4,he=107927;function we(t){const e=new Map,n=t.length;let o=0,r=0,s=0;for(let i=0;i<n;i++){const n=t[i],a=o;if(o=(o<<7^r>>>25)+n>>>0,r=(r<<7^a>>>25)>>>0,s++,s>=64||10===n){const t=(o+Math.imul(r,97))%he;e.set(t,(e.get(t)??0)+s),s=0,o=0,r=0}}if(s>0){const t=(o+Math.imul(r,97))%he;e.set(t,(e.get(t)??0)+s)}return e}function pe(t,e){let n=0;for(const[o,r]of t){const t=e.get(o)??0;t>0&&(n+=Math.min(r,t))}return n}function ge(t){return 100*t/le|0}function me(t,e){const n=e.get(t.newId);if(void 0===n||1!==n.length)return;const o=n[0];return{rename:{type:"rename",oldPath:o.oldPath,newPath:t.newPath,oldId:o.oldId,newId:t.newId,oldMode:o.oldMode,newMode:t.newMode,similarity:{score:le,maxScore:le}},consumedDelete:o}}function ye(t,e,n){if("ours-only"===e.kind){for(let o=e.oursStart;o<e.oursEnd;o++)if(!oe(t.oursLines[o],n))return!0;return!1}for(let o=e.theirsStart;o<e.theirsEnd;o++)if(!oe(t.theirsLines[o],n))return!0;return!1}function ve(t,e,n){return"theirs-only"!==e.kind?0:void 0===n||ye(t,e,n)?e.theirsEnd-e.theirsStart:0}function be(t,e,n){return"ours-only"!==e.kind?0:void 0===n||ye(t,e,n)?e.oursEnd-e.oursStart:0}const ke=(t,e,n)=>{const o=n?.numstatBinaryOverride;if("binary"===o||void 0===o&&(ae(t)||ae(e)))return{added:0,deleted:0,binary:!0};const r=n?.lineKey,s=fe(t,e,void 0!==r?{lineKey:r}:void 0),i=!0===n?.ignoreBlankLines?r??ne:void 0;let a=0,c=0;for(const t of s.hunks)a+=ve(s,t,i),c+=be(s,t,i);return{added:a,deleted:c,binary:!1}};function xe(t){return{type:"add",newPath:t.name,newId:t.id,newMode:t.mode}}function Ee(t){return{type:"delete",oldPath:t.name,oldId:t.id,oldMode:t.mode}}function Ie(t,e){if(t.id!==e.id||t.mode!==e.mode)return Yt(t.mode,e.mode)?{type:"modify",path:t.name,oldId:t.id,newId:e.id,oldMode:t.mode,newMode:e.mode}:{type:"type-change",path:t.name,oldId:t.id,newId:e.id,oldMode:t.mode,newMode:e.mode}}function $e(t){return void 0===t?[]:St(t.entries)}function Le(t,e){const n=$e(t),o=$e(e),r=[];let s=0,i=0;for(;s<n.length&&i<o.length;){const t=n[s],e=o[i],a=Tt(t,e);if(a<0)r.push(Ee(t)),s++;else if(a>0)r.push(xe(e)),i++;else{const n=Ie(t,e);void 0!==n&&r.push(n),s++,i++}}for(;s<n.length;)r.push(Ee(n[s])),s++;for(;i<o.length;)r.push(xe(o[i])),i++;return{changes:r}}const De=(t,e,n)=>{const o=((t,e,n)=>{let o;for(let r=0;r<t.length;r+=1){const s=t[r];s.directoryOnly&&!n||s.compiled.test(e)&&(o={rule:s,index:r})}return o})(t,e,n);return void 0===o?{verdict:"unset"}:{verdict:o.rule.negated?"unignored":"ignored",ruleIndex:o.index}},Ce=(t,e)=>{if(""===e)return t;const n=`${e}/`;return t.startsWith(n)?t.slice(n.length):void 0},Ae=(t,e,n)=>{let o={verdict:"unset"};for(const r of t){const t=Ce(e,r.basedir);if(void 0===t)continue;const s=De(r.rules,t,n);void 0!==s.ruleIndex&&(o={verdict:s.verdict,level:r,ruleIndex:s.ruleIndex})}return o},Oe={kind:"star-slash"},Se=(t,e)=>{const n=t[e];return"*"===n?((t,e)=>{if("*"!==t[e+1])return{token:{kind:"star"},next:e+1};const n=e+2;return"/"===t[n]?{token:{kind:"star-slash"},next:n+1}:{token:{kind:"star-star"},next:n}})(t,e):"?"===n?{token:{kind:"single"},next:e+1}:{token:{kind:"literal",char:n},next:e+1}},Te=(t,e,n)=>{switch(t.kind){case"literal":return((t,e,n)=>{const o=new Uint8Array(e.length+1);for(let r=0;r<e.length;r++)e[r]===t&&1===n[r+1]&&(o[r]=1);return o})(t.char,e,n);case"single":return((t,e)=>{const n=new Uint8Array(t.length+1);for(let o=0;o<t.length;o++)"/"!==t[o]&&1===e[o+1]&&(n[o]=1);return n})(e,n);case"star":return((t,e)=>{const n=new Uint8Array(t.length+1);n[t.length]=1===e[t.length]?1:0;for(let o=t.length-1;o>=0;o--)n[o]=1===e[o]||"/"!==t[o]&&1===n[o+1]?1:0;return n})(e,n);case"star-star":return((t,e)=>{const n=new Uint8Array(t.length+1);n[t.length]=1===e[t.length]?1:0;for(let o=t.length-1;o>=0;o--)n[o]=1===e[o]||1===n[o+1]?1:0;return n})(e,n);case"star-slash":return((t,e)=>{const n=new Uint8Array(t.length+1);for(let o=t.length-1;o>=0;o--)n[o]="/"===t[o]&&1===e[o+1]||1===n[o+1]?1:0;const o=new Uint8Array(t.length+1);for(let r=0;r<=t.length;r++)o[r]=1===e[r]||1===n[r]?1:0;return o})(e,n)}},Ue=(t,e)=>{const n=(t=>{const e=[];let n=0;for(;n<t.length;){const o=Se(t,n);e.push(o.token),n=o.next}return e})(t);return{test:t=>((t,e,n)=>{let o=((t,e)=>{const n=new Uint8Array(t.length+1);if(n[t.length]=1,e)for(let e=0;e<t.length;e++)"/"===t[e]&&(n[e]=1);return n})(n,!0===e.withDirSuffix);for(let e=t.length-1;e>=0;e--)o=Te(t[e],n,o);return e.anchored||(o=Te(Oe,n,o)),1===o[0]})(n,e,t)}},_e=t=>t.includes("*")||t.includes("?"),Ne=t=>{let e=t.length;for(;e>0&&32===t.charCodeAt(e-1)&&!(e>=2&&92===t.charCodeAt(e-2));)e-=1;return t.slice(0,e)},Me=t=>t.replace(/\\(.)/g,"$1"),Re=t=>{if(""===t)return;if(/^\s*$/.test(t))return;if(t.startsWith("#"))return;const e=Ne(t),n=e.startsWith("!"),o=n?e.slice(1):e,r=o.endsWith("/"),s=r?o.slice(0,-1):o,i=s.startsWith("/")||s.includes("/"),a=s.startsWith("/")?s.slice(1):s;return{negated:n,anchored:i,directoryOnly:r,cleanPattern:Me(a)}},Pe="agent=tsgit/0.0",Fe=["multi_ack_detailed","side-band-64k","ofs-delta","thin-pack","no-progress","include-tag","filter",Pe],Be=["report-status","side-band-64k","ofs-delta","atomic","delete-refs",Pe],We=t=>{const e=t.indexOf("=");return e<0?t:t.slice(0,e)},ze=(t,e)=>{const n=new Map;for(const e of t)n.set(We(e),e);const o=[];for(const t of e){const e=We(t),r=n.get(e);void 0!==r&&o.push(r)}return o},je=e=>new t({code:"PKT_LENGTH_RESERVED",value:e}),He=e=>new t({code:"PKT_TOO_LARGE",value:e}),Ke=e=>new t({code:"INVALID_BASE_URL",reason:e}),Ve=(e,n)=>new t({code:"MISSING_SERVICE_HEADER",expected:e,actual:n}),Ge=e=>new t({code:"INVALID_REF_LINE",line:e}),Ye=e=>new t({code:"INVALID_SIDEBAND_CHANNEL",channel:e}),qe=e=>new t({code:"SIDEBAND_FATAL",message:e}),Xe=e=>new t({code:"INVALID_REPORT_STATUS",line:e}),Je=()=>new t({code:"EMPTY_RECEIVE_UPDATES"}),Qe=(e,n)=>new t({code:"REFSPEC_INVALID",raw:e,reason:n}),Ze=(e,n)=>new t({code:"TOO_MANY_ADVERTISED_REFS",count:e,limit:n}),tn=(e,n)=>new t({code:"INVALID_FILTER_SPEC",spec:e,reason:n}),en=()=>new t({code:"REMOTE_FILTER_UNSUPPORTED"}),nn=new TextEncoder,on=new TextDecoder("utf-8",{fatal:!1}),rn=/^[0-9a-f]{4}$/i,sn=65520,an=nn.encode("0000");nn.encode("0001"),nn.encode("0002");const cn=t=>{const e=(t+65536).toString(16).slice(-4);return nn.encode(e)},dn=t=>{let e=an.byteLength;for(const n of t){if(n.byteLength>65516)throw new RangeError(`pkt-line: payload too large (${n.byteLength} > 65516)`);e+=n.byteLength+4}const n=new Uint8Array(e);let o=0;for(const e of t)n.set(cn(e.byteLength+4),o),o+=4,n.set(e,o),o+=e.byteLength;return n.set(an,o),n},un=e=>{const n=on.decode(e.subarray(0,4));if(!rn.test(n))throw new t({code:"INVALID_PKT_LENGTH",value:n});const o=Number.parseInt(n,16);if(o>sn)throw He(o);return o},fn=(e,n)=>({[Symbol.asyncIterator]:()=>async function*(e){const n=new hn;for await(const t of e)n.accept(t),yield*wn(n);if(n.used>0)throw new t({code:"PKT_TRUNCATED",remaining:n.used})}(e)}),ln=(t,e,n)=>{if(0===t)return{kind:"flush",consume:4};if(1===t)throw je(1);if(2===t)throw je(2);if(t<4)throw je(t);return e<t?{kind:"wait"}:{kind:"data",consume:t}};class hn{acc=new Uint8Array(sn);used=0;accept(t){if(this.used+t.byteLength<=sn)return this.acc.set(t,this.used),void(this.used+=t.byteLength);const e=Math.max(0,4-this.used),n=t.subarray(0,e);throw this.acc.set(n,this.used),this.used+=n.byteLength,un(this.acc),He(this.used)}drop(t){this.acc.copyWithin(0,t,this.used),this.used-=t}slice(t,e){return this.acc.slice(t,e)}}function*wn(t,e){for(;t.used>=4;){const e=un(t.acc),n=ln(e,t.used);if("wait"===n.kind)return;if("data"===n.kind){const e=t.slice(4,n.consume);t.drop(n.consume),yield{kind:"data",payload:e};continue}t.drop(n.consume),yield{kind:n.kind}}}const pn=new TextDecoder("utf-8",{fatal:!1}),gn=(t,e)=>{if(t)try{t(e)}catch{}},mn=(t,e)=>({[Symbol.asyncIterator]:()=>async function*(t,e){for await(const n of t){if("data"!==n.kind)return;if(0===n.payload.byteLength)throw Ye(-1);const t=n.payload[0],o=n.payload.subarray(1);if(1!==t){if(2!==t){if(3===t){const t=pn.decode(o);throw gn(e.onError,t),qe(t)}throw Ye(t)}gn(e.onProgress,pn.decode(o))}else yield o}}(t,e)}),yn=new TextDecoder("utf-8",{fatal:!1}),vn=new TextEncoder,bn=/^[0-9a-f]{40}([0-9a-f]{24})?$/i,kn=/^# service=(?<service>[^\n]+)\n?$/,xn=5e5,En=(t,e)=>{let n;try{n=new URL(t)}catch{throw Ke("invalid URL")}if(""!==n.hash)throw Ke("fragment must not be set");const o=n.pathname.endsWith("/")?n.pathname.slice(0,-1):n.pathname;return`${n.protocol}//${n.host}${o}/info/refs${""===n.search?`?service=${e}`:`${n.search}&service=${e}`}`},In=t=>t.endsWith("\n")?t.slice(0,-1):t,$n=t=>{if(!bn.test(t))throw Ge(t);return kt.from(t)},Ln=t=>{const e=t.indexOf(" ");if(e<0)throw Ge(t);const n=t.slice(0,e),o=t.slice(e+1);if(0===o.length)throw Ge(t);return{id:n,name:o}},Dn=(e,n,o)=>{if(e.byName.has(n))throw(e=>new t({code:"DUPLICATE_REF",name:e}))(n);e.refs.push({id:o,name:n}),e.byName.set(n,e.refs.length-1)},Cn=(e,n,o)=>{if(void 0===n){const n=(e=>{const n=e.indexOf("\0");if(n<0)throw new t({code:"MISSING_CAPABILITIES"});const o=e.slice(0,n),r=e.slice(n+1),s=o.indexOf(" ");if(s<0)throw Ge(e);const i=o.slice(0,s),a=o.slice(s+1);if(0===a.length)throw Ge(e);return{id:i,name:a,tail:r}})(o);return Dn(e,n.name,$n(n.id)),(t=>{const e=new Map;for(const n of t)e.set(We(n),n);return Array.from(e.values())})(n.tail.split(" ").filter(t=>t.length>0))}if(o.endsWith("^{}"))return((t,e)=>{const n=e.slice(0,-3),o=Ln(n),r=$n(o.id),s=t.byName.get(o.name);if(void 0===s)throw Ge(e);t.refs[s]={...t.refs[s],peeled:r}})(e,o),n;const r=Ln(o);return Dn(e,r.name,$n(r.id)),n},An=async(t,e)=>{const n=t[Symbol.asyncIterator]();try{await(async(t,e)=>{const n=await t.next();if(n.done||"data"!==n.value.kind)throw Ve(e,"");const o=In(yn.decode(n.value.payload)),r=kn.exec(`${o}\n`),s=r?.groups?.service;if(void 0===s)throw Ve(e,o);if(s!==e)throw Ve(e,s);const i=await t.next();if(i.done||"flush"!==i.value.kind)throw Ve(e,s)})(n,e);const{capabilities:t,refs:o}=await(async t=>{const e={refs:[],byName:new Map};let n,o=await t.next();for(;!o.done&&"data"===o.value.kind;){if(e.refs.length>=xn)throw Ze(e.refs.length+1,xn);const r=In(yn.decode(o.value.payload));n=Cn(e,n,r),o=await t.next()}return{capabilities:n??[],refs:e.refs}})(n),r=((t,e)=>{const n=e.find(t=>"HEAD"===t.name);if(n)return n;const o=t.find(t=>t.startsWith("symref=HEAD:"));if(!o)return;const r=o.slice(12),s=e.find(t=>t.name===r);return s?{name:"HEAD",id:s.id}:void 0})(t,o);return r?{capabilities:t,refs:o,head:r}:{capabilities:t,refs:o}}finally{await(n.return?.())}},On=t=>vn.encode(`have ${t}\n`),Sn=(t=>{if(t.byteLength>65516)throw new RangeError(`pkt-line: payload too large (${t.byteLength} > 65516)`);const e=t.byteLength+4,n=new Uint8Array(e);return n.set(cn(e),0),n.set(t,4),n})(vn.encode("done\n")),Tn=e=>{const n=In(e).split(" "),o=kt.from(n[1]),r=n[2];if(void 0===r)return{id:o,status:"ack"};if("continue"===r||"common"===r||"ready"===r)return{id:o,status:r};throw new t({code:"UNKNOWN_ACK_STATUS",value:r})},Un="shallow ",_n="unshallow ",Nn=(t,e)=>{const n=In(t),o=n.slice(e.length);if(!bn.test(o))throw Ge(n);return kt.from(o)},Mn=(t,e)=>t.startsWith(Un)?(e.shallow.push(Nn(t,Un)),!0):!!t.startsWith(_n)&&(e.unshallow.push(Nn(t,_n)),!0),Rn=new WeakMap,Pn=e=>new t({code:"INVALID_REFLOG_ENTRY",reason:e}),Fn=e=>new t({code:"REFLOG_NOT_FOUND",ref:e}),Bn=(e,n,o)=>new t({code:"REFLOG_ENTRY_OUT_OF_RANGE",ref:e,requested:n,available:o}),Wn=/[\n\r]/;function zn(t){if(Wn.test(t.message))throw Pn("message contains a line break");const e=yt(t.identity),n=`${t.oldId} ${t.newId} ${e}`;return""===t.message?`${n}\n`:`${n}\t${t.message}\n`}function jn(t){const e=t.indexOf("\t"),n=-1===e?t:t.slice(0,e),o=-1===e?"":t.slice(e+1);if(" "!==n[40]||" "!==n[81])throw Pn("misplaced field separator");return{oldId:Kn(n.slice(0,40)),newId:Kn(n.slice(41,81)),identity:function(t){try{return gt(t)}catch{throw Pn("invalid identity")}}(n.slice(82)),message:o}}function Hn(t){return t.replace(/[\r\n]+/g," ").trim()}function Kn(t){try{return kt.from(t)}catch{throw Pn("invalid object id")}}const Vn=["refs/heads/","refs/remotes/","refs/notes/"];const Gn=e=>new t({code:"INVALID_REF",reason:e}),Yn=e=>new t({code:"INVALID_PACKED_REFS",reason:e}),qn=e=>new t({code:"REF_NOT_FOUND",name:e}),Xn=(e,n)=>new t({code:"REF_CHAIN_TOO_DEEP",depth:e,chain:n}),Jn=e=>new t({code:"REF_CYCLE_DETECTED",chain:e}),Qn=new Set(["~","^",":","?","*","[","\\"," "]);function Zn(t){if(""===t)throw Gn("ref name must not be empty");if(t.startsWith("/")||t.endsWith("/"))throw Gn("ref name must not start or end with /");if(t.startsWith("-"))throw Gn("ref name must not start with -");if("@"===t)throw Gn("ref name must not be single @");if(t.includes(".."))throw Gn("ref name must not contain ..");if(t.includes("//"))throw Gn("ref name must not contain consecutive slashes");if(t.includes("@{"))throw Gn("ref name must not contain @{");if(t.endsWith("."))throw Gn("ref name must not end with .");!function(t){for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n<=31||127===n)throw Gn("ref name contains forbidden character");const o=t[e];if(void 0!==o&&Qn.has(o))throw Gn("ref name contains forbidden character");if(n>=8234&&n<=8238||n>=8294&&n<=8297)throw Gn("ref name contains forbidden Unicode override")}}(t);const e=t.split("/");for(const t of e){if(t.startsWith("."))throw Gn("ref name component must not start with .");if(t.endsWith(".lock"))throw Gn("ref name component must not end with .lock")}return t}function to(t){const e=t.replace(/[\r\n]+$/,"");if(""===e)throw Gn("empty ref content");if(e.startsWith("ref: ")){const t=e.slice(5);if(""===t)throw Gn("empty symbolic ref target");return{type:"symbolic",target:Zn(t)}}return{type:"direct",target:kt.from(e)}}function eo(t){return`ref: ${t}\n`}const no=new Set(["HEAD","ORIG_HEAD","FETCH_HEAD","MERGE_HEAD","CHERRY_PICK_HEAD","REVERT_HEAD","BISECT_HEAD"]),oo=["refs/bisect/","refs/worktree/","refs/rewritten/"],ro=t=>{const e=t.split("/"),n=[];for(let t=e.length-1;t>0;t-=1)n.push(e.slice(0,t).join("/"));return n},so=t=>{const e=t.replace(/\\/g,"/").replace(/^\/+/,"").replace(/\/+$/,"");for(const n of e.split("/"))io(n,t);return e},io=(t,e)=>{const o=e.slice(0,128);if(""===t||"."===t||".."===t)throw n("patterns",`cone directory has an invalid segment: ${o}`);if(t.includes("*")||t.includes("?"))throw n("patterns",`cone directory must not contain glob metacharacters: ${o}`);if(/[\n\r\0]/.test(t))throw n("patterns",`cone directory must not contain control characters: ${o}`)},ao=t=>{const e=new Set(t.map(so)),n=new Set;for(const t of e)for(const o of ro(t))e.has(o)||n.add(o);return{mode:"cone",recursive:e,parents:n}},co=t=>{const e=[...t.parents,...t.recursive].sort();let n="";for(const o of e)n+=`/${o}/\n`,t.parents.has(o)&&(n+=`!/${o}/*/\n`);return"/*\n!/*/\n"+n},uo=t=>{if(!t.startsWith("/")||!t.endsWith("/"))return;const e=t.slice(1,-1);return""===e||e.startsWith("!")?void 0:e},fo=(t,e)=>{const n=(t=>{if(t.directoryOnly)return!0;const e=t.cleanPattern.split("/"),n=e[e.length-1];return!n.includes("*")&&!n.includes("?")})(t);return{source:e,negated:t.negated,matcher:Ue(t.cleanPattern,{anchored:t.anchored,withDirSuffix:n})}},lo=new TextEncoder,ho=t=>{const e=t.split("\n").map(t=>t.replace(/\r$/,"")),o=[];for(const t of e){if(lo.encode(t).byteLength>256)throw n("patterns","pattern exceeds max length 256 bytes");const e=Re(t);if(void 0!==e){if(o.length>=2048)throw n("patterns","pattern file exceeds max 2048 patterns");o.push(fo(e,t))}}return o},wo=(t,e)=>{if(e){const e=(t=>{const e=t.split("\n").map(t=>t.replace(/\r$/,""));if("/*"!==e[0]||"!/*/"!==e[1])return;const n=new Set,o=new Set;let r=2;for(;r<e.length;){const t=e[r];if(""===t){r+=1;continue}const s=uo(t);if(void 0===s)return;r+=1,e[r]===`!/${s}/*/`?(o.add(s),r+=1):n.add(s)}return{mode:"cone",recursive:n,parents:o}})(t);return void 0!==e?{spec:e,degraded:!1}:{spec:{mode:"no-cone",rules:ho(t)},degraded:!0}}return{spec:{mode:"no-cone",rules:ho(t)},degraded:!1}},po=t=>{return"cone"===t.mode?(t=>e=>{const n=(t=>{const e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)})(e);if(""===n)return!0;if(t.parents.has(n))return!0;let o=n;for(;;){if(t.recursive.has(o))return!0;const e=o.lastIndexOf("/");if(-1===e)return!1;o=o.slice(0,e)}})(t):(e=t.rules,t=>{let n=!1;for(const o of e)o.matcher.test(t)&&(n=!o.negated);return n});var e},go=e=>new t({code:"INVALID_PACK_HEADER",reason:e}),mo=e=>new t({code:"INVALID_PACK_INDEX",reason:e}),yo=(e,n)=>new t({code:"INVALID_PACK_ENTRY",offset:e,reason:n}),vo=e=>new t({code:"INVALID_DELTA",reason:e}),bo=e=>new t({code:"DELTA_CHAIN_TOO_DEEP",depth:e});function ko(t,e){if(e>=t.length)throw vo("truncated variable-length integer");let n=0,o=0,r=e,s=0,i=t[r];for(n=(127&i)<<o>>>0,o+=7,s+=1;128&i;){if(s>=5)throw vo("variable-length integer too long");if(r+=1,r>=t.length)throw vo("truncated variable-length integer");i=t[r],n=(n|(127&i)<<o)>>>0,o+=7,s+=1}return{value:n,nextOffset:r+1}}function xo(t,e,n){const o=function(t){let e=0;return 1&t&&(e+=1),2&t&&(e+=1),4&t&&(e+=1),8&t&&(e+=1),16&t&&(e+=1),32&t&&(e+=1),64&t&&(e+=1),e}(n);if(e+o>t.length)throw vo(`COPY instruction truncated: needs ${o} bytes at position ${e}`);let r=e,s=0,i=0;return 1&n&&(s|=t[r],r+=1),2&n&&(s|=t[r]<<8,r+=1),4&n&&(s|=t[r]<<16,r+=1),8&n&&(s=(s|16777216*t[r])>>>0,r+=1),16&n&&(i|=t[r],r+=1),32&n&&(i|=t[r]<<8,r+=1),64&n&&(i|=t[r]<<16,r+=1),0===i&&(i=65536),{offset:s,size:i,nextPos:r}}function Eo(t,e,n,o,r){if(t+e>n)throw vo(`COPY out of bounds: offset=${t} size=${e} exceeds base length ${n}`);if(o+e>r)throw vo(`COPY overflows target: position=${o} size=${e} exceeds target length ${r}`)}function Io(t,e,n,o,r,s){if(0===n)throw vo("INSERT with N=0 is reserved");if(e+n>t.length)throw vo(`INSERT data truncated: needs ${n} bytes at position ${e}`);if(r+n>s)throw vo(`INSERT overflows target: position=${r} size=${n} exceeds target length ${s}`);return o.set(t.subarray(e,e+n),r),{nextPos:e+n,nextResultPos:r+n}}function $o(t,e){const{value:n,nextOffset:o}=ko(e,0),{value:r,nextOffset:s}=ko(e,o);!function(t,e,n){if(t.length!==e)throw vo(`source length mismatch: expected ${e}, got ${t.length}`);if(n>2147483648)throw vo(`target length ${n} exceeds maximum allowed size`)}(t,n,r);const i=new Uint8Array(r);let a=0,c=s;for(;c<e.length;){const n=e[c];if(c+=1,128&n){const{offset:o,size:s,nextPos:d}=xo(e,c,n);c=d,Eo(o,s,t.length,a,r),i.set(t.subarray(o,o+s),a),a+=s}else{const t=Io(e,c,n,i,a,r);c=t.nextPos,a=t.nextResultPos}}if(a!==r)throw vo(`underfill: produced ${a} bytes but target length is ${r}`);return i}const Lo=1346454347;function Do(t,e,n){const{type:o,size:r,nextPos:s}=function(t,e){if(e>=t.length)throw yo(e,"unexpected end of header");let n=e;const o=t[n],r=o>>4&7;let s=15&o,i=4,a=0;for(;128&t[n];){if(a+=1,a>5)throw yo(e,"size encoding too long");if(n+=1,n>=t.length)throw yo(e,"unexpected end of header");s|=(127&t[n])<<i,i+=7}return{type:r,size:s,nextPos:n+1}}(t,e);if(function(t,e){if(5===t)throw yo(e,"reserved type 5");if(t<1||t>7)throw yo(e,`unknown type ${t}`)}(o,e),6===o){const{distance:n,nextPos:o}=function(t,e,n){if(e>=t.length)throw yo(n,"unexpected end of OFS_DELTA distance");let o=e,r=127&t[o],s=0;for(;128&t[o];){if(s+=1,s>4)throw yo(n,"OFS_DELTA distance encoding too long");if(o+=1,o>=t.length)throw yo(n,"unexpected end of OFS_DELTA distance");r=r+1<<7|127&t[o]}return{distance:r,nextPos:o+1}}(t,s,e);return{type:6,size:r,dataOffset:o,baseDistance:n}}if(7===o){const o=s+n.digestLength;if(o>t.length)throw yo(e,"unexpected end of REF_DELTA base id");return{type:7,size:r,dataOffset:o,baseId:nt(t.subarray(s,o))}}return{type:o,size:r,dataOffset:s}}function Co(t,e){const n=[];let o=(7&t)<<4|15&e,r=e>>>4;for(r>0&&(o|=128),n.push(o);r>0;){let t=127&r;r>>>=7,r>0&&(t|=128),n.push(t)}return new Uint8Array(n)}const Ao=1032,Oo=20;function So(t,e){return t._view.getUint32(8+4*e)}function To(t,e,n){const o=Ao+e*Oo;return st(t._bytes.subarray(o,o+Oo),n)}function Uo(t,e){const n=t._view.getUint32(t.smallOffsetsTableOffset+4*e);if(2147483648&n){const e=2147483647&n,o=t.largeOffsetsTableOffset+8*e;if(o+8>t.trailerOffset)throw mo(`large offset index ${e} out of range`);const r=t._view.getUint32(o),s=t._view.getUint32(o+4);if(r>2097151)throw mo(`pack offset exceeds safe JavaScript number range: high word=${r}`);return 4294967296*r+s}return n}function _o(t,e){const n=ot(e),o=n[0];let r=0===o?0:So(t,o-1),s=So(t,o);for(;r<s;){const e=r+s>>>1,o=To(t,e,n);if(o<0)r=e+1;else{if(!(o>0))return Uo(t,e);s=e}}}const No=/^[0-9a-f]+$/;function Mo(t,e){if(e.length<4)throw mo(`prefix too short: minimum 4 hex chars, got ${e.length}`);if(e.length>40)throw mo(`prefix too long: maximum 40 hex chars, got ${e.length}`);if(!No.test(e))throw mo("prefix contains non-hex characters");const n=e.padEnd(40,"0"),o=e.padEnd(40,"f"),r=ot(n),s=ot(o),i=r[0],a=0===i?0:So(t,i-1),c=So(t,s[0]),d=function(t,e,n,o){let r=e,s=n;for(;r<s;){const e=r+s>>>1;To(t,e,o)<0?r=e+1:s=e}return r}(t,a,c,r),u=function(t,e,n,o){let r=e,s=n;for(;r<s;){const e=r+s>>>1;To(t,e,o)<=0?r=e+1:s=e}return r}(t,a,c,s),f=[];for(let e=d;e<u;e++){const n=Ao+e*Oo,o=t._bytes.subarray(n,n+Oo);f.push(nt(o))}return f}function Ro(t){const e=[];for(let n=0;n<t.objectCount;n++){const o=Ao+n*Oo,r=t._bytes.subarray(o,o+Oo);e.push(nt(r))}return e}function Po(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function Fo(t){const e=t.reduce((t,e)=>t+e.length,0),n=new Uint8Array(e);let o=0;for(const e of t)n.set(e,o),o+=e.length;return n}const Bo=t=>t.layout.workDir,Wo=t=>t.layout.commonDir??t.layout.gitDir,zo=(t,e)=>(t=>no.has(t)||oo.some(e=>t.startsWith(e)))(e)?t.layout.gitDir:Wo(t),jo=(t,e)=>`${t}/objects/${function(t){return`${t.slice(0,2)}/${t.slice(2)}`}(e)}`,Ho=(t,e)=>`${t}/${e}`,Ko=t=>`${t}/index`,Vo=(t,e)=>`${t}/objects/${e}`,Go=(t,e)=>`${t}/logs/${e}`,Yo=t=>`${t}/info/sparse-checkout`,qo=".lock";async function Xo(e,n,o,r){const s=`${o}${qo}`;try{await e.fs.writeExclusive(s,r)}catch(e){if(function(e){return e instanceof t&&"FILE_EXISTS"===e.data.code}(e))throw new t({code:"REF_LOCKED",name:n});throw e}try{await e.fs.rename(s,o)}catch(n){try{await e.fs.rm(s)}catch(e){if(!function(e){return e instanceof t&&"FILE_NOT_FOUND"===e.data.code}(e))throw e}throw n}}let Jo=new WeakMap;const Qo=t=>Zo(t).then(t=>t.parsed),Zo=t=>{const e=Jo.get(t);if(void 0!==e)return e;const n=er(t);return Jo.set(t,n),n},tr=t=>{Jo.delete(t)},er=async t=>{const e=`${Wo(t)}/config`,n=await nr(t,e);if(void 0===n)return{parsed:{},tokens:[],source:e};const o=hr(n,e);return{parsed:Fr(xr(o)),tokens:o,source:e}},nr=async(e,n)=>{try{return await e.fs.readUtf8(n)}catch(e){if(e instanceof t&&"FILE_NOT_FOUND"===e.data.code)return;throw e}},or=(t,e,n,o)=>t.toLowerCase()===n.toLowerCase()&&e===o,rr=async(t,e,n,o)=>{const{tokens:r,source:s}=await Zo(t),i=new Set(o.map(t=>t.toLowerCase()));let a=!1;for(const t of r){if("header"===t.kind){a=or(t.section,t.subsection,e,n);continue}if(!a||"entry"!==t.kind||null!==t.value)continue;const o=t.key.toLowerCase();if(!i.has(o))continue;const r=e.toLowerCase();return{key:void 0===n?`${r}.${o}`:`${r}.${n}.${o}`,source:s,line:t.startLine+1}}},sr=async(t,e,n)=>{const{tokens:o,source:r}=await Zo(t),s=new Set(n.map(t=>t.toLowerCase())),i=e.toLowerCase();let a,c=!1;for(const t of o){if("header"===t.kind){c=t.section.toLowerCase()===i,a=t.subsection;continue}if(!c||"entry"!==t.kind||null!==t.value)continue;const e=t.key.toLowerCase();if(s.has(e))return{key:void 0===a?`${i}.${e}`:`${i}.${a}.${e}`,source:r,line:t.startLine+1}}},ir=new Set(["loosecompression","compression"]),ar=async t=>{const{tokens:e,source:n}=await Zo(t);let o=!1;for(const t of e){if("header"===t.kind){o=or(t.section,t.subsection,"core",void 0);continue}if(!o||"entry"!==t.kind)continue;const e=t.key.toLowerCase();if(!ir.has(e))continue;const r=`core.${e}`,s=t.startLine+1;if(null===t.value)return{key:r,source:n,line:s,failure:{kind:"numeric",value:"",reason:"invalid unit"}};const i=ss(t.value);if(!i.ok)return{key:r,source:n,line:s,failure:{kind:"numeric",value:t.value,reason:i.reason}};if(i.value<-1||i.value>9)return{key:r,source:n,line:s,failure:{kind:"zlib",level:i.value}}}},cr=t=>t>="a"&&t<="z"||t>="A"&&t<="Z",dr=t=>cr(t)||t>="0"&&t<="9"||"-"===t,ur=t=>" "===t||"\t"===t,fr=(t,e,n,r)=>{const s=t[e];if(n>=s.length||!cr(s[n]))throw o(e+1,r);let i=n+1;for(;i<s.length&&dr(s[i]);)i+=1;const a=s.slice(n,i);for(;i<s.length&&ur(s[i]);)i+=1;const c={key:a,value:null,nextLineIdx:e+1};if(i>=s.length)return c;const d=s[i];if("\r"===d&&i===s.length-1)return c;if("="!==d)throw o(e+1,r);const u=$r(t,e,i+1,r);return{key:a,value:u.value,nextLineIdx:u.nextLineIdx}},lr=(t,e)=>{let n=e;for(;n<t.length&&ur(t[n]);)n+=1;return n},hr=(t,e)=>wr(t.split("\n"),t.endsWith("\n"),e),wr=(t,e,n)=>{const o=[],r=e?t.length-1:t.length;let s=0;for(;s<r;)s=pr(o,t,s,n);return o},pr=(t,e,n,r)=>{const s=e[n];if(""===Or(s).trim())return t.push(""===s.trim()?{kind:"blank",line:n}:{kind:"comment",line:n}),n+1;const i=Tr(s);if("header"===i.parse.kind)return mr(t,e,n,i,r);if("malformed"===i.parse.kind)throw o(n+1,r,i.parse.partialName);return gr(t,e,n,r)},gr=(t,e,n,o)=>{const r=lr(e[n],0),s=fr(e,n,r,o);return t.push({kind:"entry",key:s.key,value:s.value,startLine:n,endLine:s.nextLineIdx}),s.nextLineIdx},mr=(t,e,n,r,s)=>{const i=e[n];let a=r,c=br(i,a.endOffset);for(;"["===i[c];){if(yr(t,a,n,!1),a=Tr(i,c),"header"!==a.parse.kind)throw o(n+1,s,vr(a.parse));c=br(i,a.endOffset)}const d=i[c],u="#"===d||";"===d;if(yr(t,a,n,u),c>=i.length||u)return n+1;const f=fr(e,n,c,s);return t.push({kind:"entry",key:f.key,value:f.value,startLine:n,endLine:f.nextLineIdx,sharesHeaderLine:!0,startCol:c}),f.nextLineIdx},yr=(t,e,n,o)=>{const r=e.parse;t.push({kind:"header",section:r.section,subsection:r.subsection,line:n,hasComment:o})},vr=t=>"malformed"===t.kind?t.partialName:void 0,br=(t,e)=>{let n=e;for(;n<t.length&&Ir.has(t[n]);)n+=1;return n},kr=(t,e)=>xr(hr(t,e)),xr=t=>{const e=[],n={section:"",subsection:void 0,entries:[]};let o=n;for(const n of t)"header"===n.kind?(o={section:n.section,subsection:n.subsection,entries:[]},e.push(o)):"entry"===n.kind&&o.entries.push({key:n.key,value:n.value});return n.entries.length>0?[n,...e]:e},Er=new Map([["n","\n"],["t","\t"],["b","\b"],["\\","\\"],['"','"']]),Ir=new Set([" ","\t","\r"]),$r=(t,e,n,r)=>{const s={lineIdx:e,col:n},i={out:"",trimLen:-1,inQuotes:!1,inComment:!1};for(;s.lineIdx<t.length;){if(s.col>=t[s.lineIdx].length){if(i.inQuotes)throw o(s.lineIdx+1,r);return Ar(i,s.lineIdx+1)}Lr(t,s,i,r)}return Ar(i,s.lineIdx)},Lr=(t,e,n,o)=>{const r=t[e.lineIdx][e.col];if(e.col+=1,!n.inComment)if(n.inQuotes||!Ir.has(r))if(n.inQuotes||"#"!==r&&";"!==r)if("\\"!==r){if('"'===r)return n.inQuotes=!n.inQuotes,void(n.trimLen=-1);n.out+=r,n.trimLen=-1}else Dr(t,e,n,o);else n.inComment=!0;else Cr(n,r)},Dr=(t,e,n,r)=>{const s=t[e.lineIdx];if(e.col>=s.length)return e.lineIdx+=1,void(e.col=0);const i=Er.get(s[e.col]);if(void 0===i)throw o(e.lineIdx+1,r);e.col+=1,n.out+=i,n.trimLen=-1},Cr=(t,e)=>{""!==t.out&&(-1===t.trimLen&&(t.trimLen=t.out.length),t.out+=e)},Ar=(t,e)=>({value:-1===t.trimLen?t.out:t.out.slice(0,t.trimLen),nextLineIdx:e}),Or=t=>{const e=[Sr(t,"#"),Sr(t,";")].filter(t=>t>=0);return 0===e.length?t:t.slice(0,Math.min(...e))},Sr=(t,e)=>{let n=!1;for(let o=0;o<t.length;o+=1){const r=t[o];if(n&&"\\"===r)o+=1;else if('"'===r)n=!n;else if(!n&&r===e)return o}return-1},Tr=(t,e=0)=>{const n=lr(t,e);if("["!==t[n])return _r;const o=n+1,r=t.indexOf("]",o),s=Ur(t,o,r);return-1===s?Mr(t,o,r):Rr(t,o,s)},Ur=(t,e,n)=>{const o=-1===n?t.length:n;for(let n=e;n<o;n+=1)if('"'===t[n])return n;return-1},_r={parse:{kind:"not-header"},endOffset:0},Nr=/^[A-Za-z0-9.-]+$/,Mr=(t,e,n)=>{if(-1===n)return _r;const o=t.slice(e,n);return Nr.test(o)?{parse:{kind:"header",section:o,subsection:void 0},endOffset:n+1}:_r},Rr=(t,e,n)=>{const{parse:o,closeQuoteAt:r}=((t,e,n)=>{const o=t.slice(e,n).trim(),r=o.toLowerCase(),s=n>e?t[n-1]:void 0;return void 0!==s&&Ir.has(s)?((t,e,n,o)=>{const r=((t,e)=>{let n="",o=e+1;for(;o<t.length;){const e=t[o];if("\\"!==e){if('"'===e)return{subsection:n,closeQuoteAt:o};n+=e,o+=1}else{if(o+1>=t.length)return{partial:n};n+=t[o+1],o+=2}}return{partial:n}})(t,e);return"partial"in r?{parse:{kind:"malformed",partialName:`${o}.${r.partial}`}}:t.startsWith("]",r.closeQuoteAt+1)?{parse:{kind:"header",section:n,subsection:r.subsection},closeQuoteAt:r.closeQuoteAt}:{parse:{kind:"malformed",partialName:`${o}.${r.subsection}`}}})(t,n,o,r):{parse:{kind:"malformed",partialName:r}}})(t,e,n);return"header"!==o.kind||void 0===r?{parse:o,endOffset:0}:{parse:o,endOffset:r+2}},Pr=(t,e)=>{void 0!==e.subsection?((t,e,n)=>{"remote"===e.section?Kr(t,n,e):"branch"===e.section?Vr(t,n,e):"submodule"===e.section?Gr(t,n,e):"merge"===e.section?Yr(t,n,e):"diff"===e.section?qr(t,n,e):"filter"===e.section&&Jr(t,n,e)})(t,e,e.subsection):"core"===e.section?Wr(t,e):"user"===e.section?jr(t,e):"extensions"===e.section&&Qr(t,e)},Fr=t=>{const e={};for(const n of t)Pr(e,n);return Zr(e)},Br=(t,e,n)=>"bare"===e?{...t,bare:es(n)}:"logallrefupdates"===e?{...t,logAllRefUpdates:zr(n)}:"sparsecheckout"===e?{...t,sparseCheckout:es(n)}:"sparsecheckoutcone"===e?{...t,sparseCheckoutCone:es(n)}:null!==n?"excludesfile"===e?{...t,excludesFile:n}:"attributesfile"===e?{...t,attributesFile:n}:"hookspath"===e?{...t,hooksPath:n}:"notesref"===e?{...t,notesRef:n}:"loosecompression"===e||"compression"===e?((t,e,n)=>{const o=ss(n);if(o.ok){if("loosecompression"===e)return{...t,looseCompression:o.value,looseCompressionFromLoose:!0};if(!0!==t.looseCompressionFromLoose)return{...t,looseCompression:o.value}}})(t,e,n):void 0:void 0,Wr=(t,e)=>{for(const{key:n,value:o}of e.entries){const e=Br(t.core??{},n.toLowerCase(),o);void 0!==e&&(t.core=e)}},zr=t=>null!==t&&"always"===t.toLowerCase()?"always":es(t),jr=(t,e)=>{for(const{key:n,value:o}of e.entries)null!==o&&("name"===n?t.user={...t.user,name:o}:"email"===n&&(t.user={...t.user,email:o}))},Hr=(t,e,n)=>{const o=e.toLowerCase();"url"===o?null!==n&&(t.url=n):"pushurl"===o?null!==n&&(t.pushUrl=n):"fetch"===o?null!==n&&(t.fetch??=[],t.fetch.push(n)):"promisor"===o?t.promisor=es(n):"partialclonefilter"===o&&null!==n&&(t.partialCloneFilter=n)},Kr=(t,e,n)=>{t.remote??=new Map;const o=t.remote.get(e)??{},r={...o,fetch:o.fetch?[...o.fetch]:[]};for(const{key:t,value:e}of n.entries)Hr(r,t,e);t.remote.set(e,(t=>{const e={};return void 0!==t.url&&(e.url=t.url),void 0!==t.pushUrl&&(e.pushUrl=t.pushUrl),void 0!==t.fetch&&t.fetch.length>0&&(e.fetch=t.fetch),void 0!==t.promisor&&(e.promisor=t.promisor),void 0!==t.partialCloneFilter&&(e.partialCloneFilter=t.partialCloneFilter),e})(r))},Vr=(t,e,n)=>{t.branch??=new Map;const o={...t.branch.get(e)??{}};for(const{key:t,value:e}of n.entries)null!==e&&("remote"===t?o.remote=e:"merge"===t&&(o.merge=e));t.branch.set(e,o)},Gr=(t,e,n)=>{t.submodule??=new Map;const o={...t.submodule.get(e)??{}};for(const{key:t,value:e}of n.entries){const n=t.toLowerCase();"url"===n?null!==e&&(o.url=e):"active"===n?o.active=es(e):"update"===n&&null!==e&&(o.update=e)}t.submodule.set(e,o)},Yr=(t,e,n)=>{t.merge??=new Map;const o={...t.merge.get(e)??{}};for(const{key:t,value:e}of n.entries){if(null===e)continue;const n=t.toLowerCase();"name"===n?o.name=e:"driver"===n?o.driver=e:"recursive"===n&&(o.recursive=e)}t.merge.set(e,o)},qr=(t,e,n)=>{t.diff??=new Map;const o={...t.diff.get(e)??{}};for(const{key:t,value:e}of n.entries){const n=t.toLowerCase();if("textconv"===n){if(null===e)continue;o.textconv=e}else"cachetextconv"===n&&(o.cachetextconv=es(e))}t.diff.set(e,o)},Xr=(t,e,n)=>{const o=e.toLowerCase();"required"!==o?null!==n&&("clean"===o?t.clean=n:"smudge"===o?t.smudge=n:"process"===o&&(t.process=n)):t.required=es(n)},Jr=(t,e,n)=>{t.filter??=new Map;const o={...t.filter.get(e)??{}};for(const{key:t,value:e}of n.entries)Xr(o,t,e);t.filter.set(e,o)},Qr=(t,e)=>{for(const{key:n,value:o}of e.entries)"partialclone"===n.toLowerCase()&&null!==o&&(t.extensions={...t.extensions,partialClone:o})},Zr=t=>{const e={},n=(t=>{if(void 0!==t)return{...void 0!==t.bare?{bare:t.bare}:{},...void 0!==t.excludesFile?{excludesFile:t.excludesFile}:{},...void 0!==t.attributesFile?{attributesFile:t.attributesFile}:{},...void 0!==t.logAllRefUpdates?{logAllRefUpdates:t.logAllRefUpdates}:{},...void 0!==t.hooksPath?{hooksPath:t.hooksPath}:{},...void 0!==t.notesRef?{notesRef:t.notesRef}:{},...void 0!==t.sparseCheckout?{sparseCheckout:t.sparseCheckout}:{},...void 0!==t.sparseCheckoutCone?{sparseCheckoutCone:t.sparseCheckoutCone}:{},...void 0!==t.looseCompression?{looseCompression:t.looseCompression}:{}}})(t.core);return void 0!==n&&(e.core=n),void 0!==t.user?.name&&void 0!==t.user?.email&&(e.user={name:t.user.name,email:t.user.email}),void 0!==t.remote&&t.remote.size>0&&(e.remote=t.remote),void 0!==t.extensions&&(e.extensions=t.extensions),void 0!==t.branch&&t.branch.size>0&&(e.branch=t.branch),void 0!==t.submodule&&t.submodule.size>0&&(e.submodule=t.submodule),void 0!==t.merge&&t.merge.size>0&&(e.merge=t.merge),((t,e)=>{void 0!==t.diff&&t.diff.size>0&&(e.diff=t.diff),void 0!==t.filter&&t.filter.size>0&&(e.filter=t.filter)})(t,e),e},ts=new Set(["true","yes","on","1"]),es=t=>null===t||ts.has(t.toLowerCase()),ns=BigInt("9223372036854775807"),os=BigInt("-9223372036854775808"),rs=new Map([["k",BigInt(1024)],["K",BigInt(1024)],["m",BigInt(1024)*BigInt(1024)],["M",BigInt(1024)*BigInt(1024)],["g",BigInt(1024)*BigInt(1024)*BigInt(1024)],["G",BigInt(1024)*BigInt(1024)*BigInt(1024)]]),ss=t=>{const e=(t??"").replace(/^[ \t]+/,""),n="+"===e[0]||"-"===e[0]?e.slice(1):e,o=(t=>{const e=/^0[xX][0-9a-fA-F]+/.exec(t);if(null!==e)return{token:e[0],radix:16};if("0"===t[0])return{token:/^0[0-7]*/.exec(t)[0],radix:8};const n=/^[0-9]+/.exec(t);return null===n?null:{token:n[0],radix:10}})(n);if(null===o)return{ok:!1,reason:"invalid unit"};const r=n.slice(o.token.length),s=""===r?BigInt(1):rs.get(r);if(void 0===s)return{ok:!1,reason:"invalid unit"};const i=((t,e)=>{const n=(16===e?t.slice(2):8===e?t.slice(1):t).replace(/^0+/,"");return n.length>32?null:""===n?BigInt(0):BigInt(`${16===e?"0x":8===e?"0o":""}${n}`)})(o.token,o.radix);if(null===i)return{ok:!1,reason:"out of range"};const a=("-"===e[0]?-i:i)*s;return a<os||a>ns?{ok:!1,reason:"out of range"}:{ok:!0,value:Number(a)}};async function is(t){const e=(await Qo(t)).user;return{name:void 0===e?"tsgit":e.name,email:void 0===e?"tsgit@localhost":e.email,timestamp:Math.floor(Date.now()/1e3),timezoneOffset:"+0000"}}const as=1024,cs=268435456,ds=256,us=1e6,fs=1048576,ls=100;async function hs(t,e,n){await t.fs.appendUtf8(Go(zo(t,e),e),zn(n))}async function ws(t,e){const n=Go(zo(t,e),e);if(!await t.fs.exists(n))return[];if((await t.fs.stat(n)).size>16777216)throw Pn("reflog file exceeds 16777216 bytes");return(await t.fs.readUtf8(n)).split("\n").filter(t=>""!==t).map(jn)}async function ps(t,e){return t.fs.exists(Go(zo(t,e),e))}async function gs(t,e,n){const o=n.map(zn).join("");await t.fs.writeUtf8(Go(zo(t,e),e),o)}async function ms(t,e){const n=Go(zo(t,e),e);await t.fs.exists(n)&&await t.fs.rm(n)}async function ys(t){const e=`${t.layout.gitDir}/logs`;return await t.fs.exists(e)?vs(t,e,""):[]}async function vs(t,e,n){const o=await t.fs.readdir(e),r=[];for(const s of o){const o=""===n?s.name:`${n}/${s.name}`;s.isDirectory?r.push(...await vs(t,`${e}/${s.name}`,o)):r.push(o)}return r}async function bs(t,e,n,o,r){if(!await async function(t,e){if(await ps(t,e))return!0;return function(t,e){return"always"===e.logAllRefUpdates||!1!==e.logAllRefUpdates&&(!0===e.logAllRefUpdates||!0!==e.bare)&&function(t){return"HEAD"===t||Vn.some(e=>t.startsWith(e))}(t)}(e,(await Qo(t)).core??{})}(t,e))return;const s=await is(t);await hs(t,e,{oldId:n,newId:o,identity:s,message:Hn(r)})}const ks=new WeakMap;function xs(t){let e=ks.get(t);return void 0===e&&(e=function(t){let e;const n=e=>zo(t,e);async function o(){const n=`${Wo(t)}/packed-refs`;if(!await t.fs.exists(n))return{entries:[],peeling:"none",sorted:!1};const o=await t.fs.stat(n),r=`${o.mtimeMs}:${o.size}`;if(void 0!==e&&e.mtimeKey===r)return e.parsed;const s=function(t){if(""===t)return{entries:[],peeling:"none",sorted:!1};const e=t.split("\n"),{peeling:n,sorted:o,startIndex:r}=function(t){const e=t[0];if(e?.startsWith("# pack-refs with:")){const t=e.slice(17).trim(),n=""===t?[]:t.split(/\s+/),o=n.includes("peeled");return{peeling:n.includes("fully-peeled")?"fully":o?"tags":"none",sorted:n.includes("sorted"),startIndex:1}}return{peeling:"none",sorted:!1,startIndex:0}}(e);return{entries:function(t,e){const n=[];for(let o=e;o<t.length;o++){const e=t[o];if(void 0===e||""===e||e.startsWith("#"))continue;if(e.startsWith("^")){if(0===n.length)throw Yn("peel line without preceding ref entry");const t=kt.from(e.slice(1)),o=n.length-1;n[o]={...n[o],peeled:t};continue}const r=e.indexOf(" ");if(-1===r)throw Yn(`invalid ref line format: ${e.slice(0,80)}`);const s=e.slice(0,r),i=e.slice(r+1),a=kt.from(s);n.push({name:Et.from(i),id:a})}return n}(e,r),peeling:n,sorted:o}}(await t.fs.readUtf8(n));return e={parsed:s,mtimeKey:r},s}async function r(e){const o=Ho(n(e),e);if(await t.fs.exists(o))return t.fs.readUtf8(o)}return{async resolveDirect(t){const e=await r(t);if(void 0!==e){const t=to(e);return"symbolic"===t.type?{kind:"symbolic",target:t.target}:{kind:"direct",id:t.target}}const n=await o();for(const e of n.entries)if(e.name===t)return{kind:"direct",id:e.id};return{kind:"missing"}},async writeLoose(e,o){const r=Ho(n(e),e);await t.fs.writeUtf8(r,function(t){return`${t}\n`}(o))},async removeLoose(e){const o=Ho(n(e),e);await t.fs.exists(o)&&await t.fs.rm(o)},isLoose:async e=>t.fs.exists(Ho(n(e),e)),readLooseRaw:async t=>r(t),getPackedRefs:o}}(t),ks.set(t,e)),e}const Es="HEAD";async function Is(e,n,o,s){Zn(n);const i=Ho(e.layout.gitDir,n),a=xs(e),c=await a.resolveDirect(n);if(void 0!==s.expected){const e="direct"===c.kind?c.id:"absent";if(s.expected!==e)throw((e,n,o)=>new t({code:"REF_UPDATE_CONFLICT",name:e,expected:n,actual:o}))(n,s.expected,e)}if(!0===s.delete)return await async function(t,e){if(await t.isLoose(e))return void await t.removeLoose(e);if("direct"===(await t.resolveDirect(e)).kind)throw r("delete-packed-ref","deleting packed-only refs requires packed-refs rewrite");throw qn(e)}(a,n),void await ms(e,n);const d="direct"===c.kind?c.id:xt,u=(new TextEncoder).encode(`${o}\n`);await Xo(e,n,i,u),d!==o&&await bs(e,n,d,o,s.reflogMessage),await async function(t,e,n,o,r,s){const i=await e.resolveDirect(Es);"symbolic"===i.kind&&i.target===n&&await bs(t,Es,o,r,s)}(e,a,n,d,o,s.reflogMessage)}const $s=(t,e)=>t.endsWith("/")?`${t}${e}`:`${t}/${e}`,Ls=new Map([["binary",new Map([["diff",!1],["merge",!1],["text",!1]])]]),Ds=(t,e)=>{const n=new Map;for(const[o,r]of t){const t=!0===r?e.get(o):void 0;if(n.set(o,r),void 0!==t)for(const[e,o]of t)n.set(e,o)}return n},Cs=t=>"t"===t?"\t":"n"===t?"\n":"r"===t?"\r":t,As=t=>{if(t.startsWith('"')){const{value:e,end:n}=(t=>{let e="",n=1;for(;n<t.length;){const o=t[n];if("\\"===o){const o=t[n+1];if(void 0===o)break;e+=Cs(o),n+=2;continue}if('"'===o){n+=1;break}e+=o,n+=1}return{value:e,end:n}})(t);return{pattern:e,rest:t.slice(n)}}const e=t.search(/\s/);return-1===e?{pattern:t,rest:""}:{pattern:t.slice(0,e),rest:t.slice(e)}},Os=t=>t.split(/\s+/).filter(t=>""!==t),Ss=t=>{if(t.startsWith("-")){const e=t.slice(1);return""===e?void 0:{name:e,value:!1}}if(t.startsWith("!")){const e=t.slice(1);return""===e?void 0:{name:e,value:"unspecified"}}const e=t.indexOf("=");if(-1!==e){const n=t.slice(0,e);return""===n?void 0:{name:n,value:{set:t.slice(e+1)}}}return{name:t,value:!0}},Ts=t=>{const e=new Map;for(const n of t){const t=Ss(n);void 0!==t&&e.set(t.name,t.value)}return e},Us=(t,e,n)=>{const{anchored:o,directoryOnly:r,body:s}=(t=>{const e=t.endsWith("/"),n=e?t.slice(0,-1):t;return{anchored:n.includes("/"),directoryOnly:e,body:n.startsWith("/")?n.slice(1):n}})(t);return{pattern:t,anchored:o,directoryOnly:r,lineNumber:n,compiled:Ue(s,{anchored:o}),attributes:Ts(Os(e))}},_s=t=>{const e=Os(t),[n,...o]=e;if(void 0!==n)return{name:n,attributes:Ts(o)}},Ns=(t,e,n,o)=>{const r=((t,e)=>{if(""===e)return t;const n=`${e}/`;return t.startsWith(n)?t.slice(n.length):void 0})(e,t.basedir);if(void 0===r)return;let s;for(const e of t.rules){if(!e.compiled.test(r))continue;const t=Ds(e.attributes,o).get(n);void 0!==t&&(s=t)}return s},Ms=(t,e,n,o)=>{for(const r of t){const t=Ns(r,e,n,o);if(void 0!==t)return t}return"unspecified"},Rs=(t,e)=>{if("~"===e)return t.layout.homeDir;if(e.startsWith("~/")){if(void 0===t.layout.homeDir)return;return`${t.layout.homeDir}/${e.slice(2)}`}return e},Ps=async(e,n,o,r)=>{let s;try{s=await e.fs.lstat(n)}catch(e){if(e instanceof t&&"FILE_NOT_FOUND"===e.data.code)return;throw e}if(s.isFile&&!s.isSymbolicLink){if(s.size>o)throw r((t=>{const e=t.lastIndexOf("/");return-1===e?t:t.slice(e+1)})(n),s.size,o);return e.fs.readUtf8(n)}},Fs=async(t,e)=>{const n=await Ps(t,e,1048576,s);return void 0===n?void 0:(t=>{const e=[],n=[],o=t.split("\n");for(let t=0;t<o.length;t+=1){const r=o[t].trim();if(""===r||r.startsWith("#"))continue;if(r.startsWith("[attr]")){const t=_s(r.slice(6));void 0!==t&&n.push(t);continue}const{pattern:s,rest:i}=As(r);e.push(Us(s,i,t+1))}return{rules:e,macros:n}})(n)},Bs=(t,e)=>Fs(t,$s(t.layout.workDir,""===e?".gitattributes":`${e}/.gitattributes`)),Ws=async t=>{const e=await(t=>Fs(t,`${Wo(t)}/info/attributes`))(t),n=await(async t=>{const e=(await Qo(t)).core?.attributesFile;if(void 0===e||""===e)return;const n=Rs(t,e);return void 0!==n?Fs(t,n):void 0})(t),o=await Bs(t,""),r=((t,e=Ls)=>{const n=new Map(e);for(const e of t)n.set(e.name,e.attributes);return n})([...e?.macros??[],...o?.macros??[],...n?.macros??[]]),s=new Map([["",o]]),i=async e=>{if(s.has(e))return s.get(e);const n=await Bs(t,e);return s.set(e,n),n};return{sourcesForPath:async t=>{const o=[];void 0!==e&&o.push({basedir:"",rules:e.rules});for(const e of(t=>{const e=t.split("/");e.pop();const n=[];for(let t=e.length;t>=1;t-=1)n.push(e.slice(0,t).join("/"));return n.push(""),n})(t)){const t=await i(e);void 0!==t&&o.push({basedir:e,rules:t.rules})}return void 0!==n&&o.push({basedir:"",rules:n.rules}),{sources:o,macros:r}}}},zs=t=>void 0!==t.command?Ws(t):Promise.resolve(void 0),js=async(t,e)=>{const n=Nt(e,t.hashConfig);return{bytes:n,id:await t.hash.hashHex(n)}},Hs=new TextDecoder,Ks=async(t,e)=>{await t.fs.lstat(e).then(()=>!0).catch(()=>!1)&&await t.fs.rm(e)},Vs=async(t,e,n,o)=>{await Ks(t,e),await t.fs.write(e,n),void 0!==o&&await t.fs.chmod(e,o===P.EXECUTABLE?493:420)},Gs=async(t,e,n)=>{await Vs(t,$s(t.layout.workDir,e),n)},Ys=async(t,e,n,o)=>{const r=$s(t.layout.workDir,e);if(o===P.SYMLINK)return await Ks(t,r),void await t.fs.symlink(Hs.decode(n),r);o!==P.GITLINK?await Vs(t,r,n,o):await t.fs.mkdir(r)},qs=async(t,e,n,o)=>{await Ks(t,e),await t.fs.writeStream(e,n),void 0!==o&&await t.fs.chmod(e,o===P.EXECUTABLE?493:420)},Xs=async(t,e,n)=>{await qs(t,$s(t.layout.workDir,e),n)},Js=async(t,e)=>{const n=$s(t.layout.workDir,e);await Ks(t,n)},Qs="empty from",Zs="too many seeds";function ti(t){return 0===t.length}function ei(t){return t.length>1024}function ni(t){return!!(t.includes("\0")||t.includes("\r")||t.includes("\n\n")||t.startsWith("\n")||t.endsWith("\n"))}function oi(t){return 0===t.length||!!(t.includes("\0")||t.includes("\r")||t.includes("\n"))||!(!t.includes(" ")&&!t.includes("\t"))}const ri="index file exceeds 256 MiB",si="pack .idx file exceeds 64 MiB";function ii(t){return t>268435456}function ai(t){return t>67108864}function ci(t,e=5){return t>e}function di(t,e=5){return t>e}function ui(t){return"160000"===t}function fi(t,e){return t>e}const li=/^[0-9a-f]{40}$/,hi=/^[0-9a-f]{64}$/;function wi(t){return li.test(t)||hi.test(t)}function pi(t){return t.isFile&&t.name.endsWith(".idx")&&!(e=t.name).includes("/")&&!e.includes("\\")&&!e.includes("..");var e}async function gi(t,e,n){const o=`${e}/${n}`,r=await async function(t,e){if(ai((await t.fs.stat(e)).size))throw mo(si);const n=await t.fs.read(e);if(ai(n.length))throw mo(si);return n}(t,o),s=function(t){if(t.length<1032)throw mo("truncated: file too short for header and fanout");const e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint32(0);if(4285812579!==n)throw mo(`invalid magic: expected 0xff744f63, got 0x${n.toString(16).padStart(8,"0")}`);const o=e.getUint32(4);if(2!==o)throw mo(`unsupported version: expected 2, got ${o}`);!function(t){let e=0;for(let n=0;n<256;n++){const o=t.getUint32(8+4*n);if(o<e)throw mo(`non-monotonic fanout at index ${n}: ${e} > ${o}`);e=o}}(e);const r=e.getUint32(1028),s=Ao+r*Oo,i=s+4*r,a=i+4*r,c=t.length-40,d=Ao+r*Oo+4*r+4*r+40;if(t.length<d)throw mo(`truncated: expected at least ${d} bytes for ${r} objects, got ${t.length}`);return{objectCount:r,crc32TableOffset:s,smallOffsetsTableOffset:i,largeOffsetsTableOffset:a,trailerOffset:c,_bytes:t,_view:e}}(r),i=n.slice(0,-4),a=`${e}/${i}.pack`;let c;return{name:i,index:s,packPath:a,idxPath:o,offsetTable:async()=>{if(void 0!==c)return c;const e=(await t.fs.stat(a)).size,n=function(t){const e=[];for(let n=0;n<t.objectCount;n+=1)e.push(Uo(t,n));return e}(s),o=[...n].sort((t,e)=>t-e),r=e-t.hashConfig.digestLength;if(r<0)throw mo("pack file too small to contain a trailer");return c={sortedOffsets:o,packFileSize:e,trailerStart:r},c}}}function mi(t,e){const{sortedOffsets:n,trailerStart:o}=t,r=function(t,e){let n=0,o=t.length;for(;n<o;){const r=n+o>>>1;t[r]<e?n=r+1:o=r}return n}(n,e);if(r>=n.length||n[r]!==e)throw mo("offset not in pack index: corrupt index");return r===n.length-1?o:n[r+1]}function yi(t){let e;async function n(){if(void 0!==e)return e;const n=`${Wo(t)}/objects/pack`;if(!await t.fs.exists(n))return e=[],e;const o=await t.fs.readdir(n),r=[];for(const e of o)pi(e)&&r.push(await gi(t,n,e.name));return e=r,e}return{all:n,refresh(){e=void 0},async lookup(t){const e=await n();for(const n of e){const e=_o(n.index,t);if(void 0!==e)return{pack:n,offset:e}}}}}async function vi(t,e,n,o,r){xi(t);const s=await async function(t,e){const n=jo(Wo(t),e);if(!await t.fs.exists(n))return;const o=await t.fs.read(n);return t.compressor.inflate(o)}(t,n);if(void 0!==s)return xi(t),function(t,e,n){if(void 0===n)return;const{contentOffset:o}=Dt(e),r=e.length-o;if(r>n)throw R(t,r,n)}(n,s,r),Ii(t,n,s,o);xi(t);const i=await e.lookup(n);if(void 0===i)throw T(n);xi(t);const a=await $i(t,e,i,n,r);return xi(t),Ii(t,n,a,o)}function bi(t,e,n){if(void 0!==n&&e>n)throw R(t,e,n)}function ki(t,e,n,o){if(void 0===n)return;if(1!==o)return;const r=function(t){const{nextOffset:e}=ko(t,0),{value:n}=ko(t,e);return n}(e);if(r>n)throw R(t,r,n)}function xi(t){if(!0===t.signal?.aborted)throw i()}async function Ei(t,e){const n=jo(Wo(t),e);if(await t.fs.exists(n))return t.fs.read(n)}async function Ii(t,e,n,o){if(o){const o=await t.hash.hashHex(n);if(xi(t),o!==e)throw U(e,o)}return _t(e,n,t.hashConfig)}async function $i(t,e,n,o,r){const s=await async function(t,e,n,o,r){const s=[];let i=n,a=0;const c=await n.pack.offsetTable();for(;;){xi(t);const n=mi(c,i.offset);if(n>c.packFileSize)throw mo("next offset exceeds pack file size: corrupt index");const{header:d,chunk:u,headerEndInChunk:f}=await Di(t,i,n);if(Li(d))return bi(o,d.size,r),{deltas:s,baseContent:await t.compressor.inflate(u.subarray(f)),baseType:d.type};if(a+=1,a>50)throw bo(a);const l=await t.compressor.inflate(u.subarray(f));if(ki(o,l,r,a),6===d.type){const t=i.offset-d.baseDistance;if(t<0)throw T(o);s.push({instructions:l,resolvedBaseId:void 0}),i={pack:i.pack,offset:t};continue}if(7===d.type){const n=d.baseId;s.push({instructions:l,resolvedBaseId:n});const o=await Ci(t,e,n,r);return{deltas:s,baseContent:o.content,baseType:o.type}}throw T(o)}}(t,e,n,o,r);let i=s.baseContent;for(let t=s.deltas.length-1;t>=0;t-=1){const e=s.deltas[t];if(void 0===e)break;i=$o(i,e.instructions)}if(void 0!==r&&i.length>r)throw R(o,i.length,r);const a=function(t,e,n){const o=function(t,e){switch(t){case 1:return"commit";case 2:return"tree";case 3:return"blob";case 4:return"tag";default:throw T(e)}}(e,n),r=`${o} ${t.length}\0`,s=(new TextEncoder).encode(r),i=new Uint8Array(s.length+t.length);return i.set(s,0),i.set(t,s.length),i}(i,s.baseType,o);return Si(t.deltaCache,o,a),a}function Li(t){return 1===t.type||2===t.type||3===t.type||4===t.type}async function Di(t,e,n){const o=n-e.offset;if(o<=0)throw mo("slice length ≤ 0: next offset not beyond entry offset");const r=await t.fs.readSlice(e.pack.packPath,e.offset,o),s=Do(r,0,t.hashConfig);return{header:s,chunk:r,headerEndInChunk:s.dataOffset}}async function Ci(t,e,n,o){const r=t.deltaCache.get(n);if(void 0!==r)return function(t,e,n){if(void 0===n)return;const o=e.indexOf(0);if(o<0)return;const r=e.length-(o+1);if(r>n)throw R(t,r,n)}(n,r,o),Ai(r,n);const s=Nt(await vi(t,e,n,!1,o),t.hashConfig);return Si(t.deltaCache,n,s),Ai(s,n)}function Ai(t,e){const n=t.indexOf(0);if(n<0)throw T(e);const o=t.subarray(0,n).indexOf(32);if(o<0)throw T(e);const r=(new TextDecoder).decode(t.subarray(0,o));return{content:t.subarray(n+1),type:Oi(r,e)}}function Oi(t,e){switch(t){case"commit":return 1;case"tree":return 2;case"blob":return 3;case"tag":return 4;default:throw T(e)}}function Si(t,e,n){t.set(e,n,n.length)}const Ti=new WeakMap,Ui=new WeakMap;function _i(t){let e=Ti.get(t);return void 0===e&&(e=yi(t),Ti.set(t,e)),e}async function Ni(e,n,o){const r=o?.verifyHash??!0,s=_i(e);try{return await vi(e,s,n,r,o?.maxBytes)}catch(i){const a=e.promisor;if(void 0===a||!function(e){return e instanceof t&&"OBJECT_NOT_FOUND"===e.data.code}(i))throw i;if(!await async function(t,e,n){const o=function(t){let e=Ui.get(t);return void 0===e&&(e=new Map,Ui.set(t,e)),e}(t),r=o.get(n);if(void 0!==r)return r;const s=e.fetch([n]).then(t=>t.attempted);o.set(n,s);try{return await s}finally{o.delete(n)}}(e,a,n))throw i;return s.refresh(),vi(e,s,n,r,o?.maxBytes)}}async function Mi(t,e,n){const o=await Ni(t,e,n);if("blob"!==o.type)throw _("blob",o.type,e);return o}const Ri={kind:"identity"},Pi=async(t,e,n)=>{const{sources:o,macros:r}=await e.sourcesForPath(n);return((t,e)=>!1===e||!0===e||"unspecified"===e?Promise.resolve(Ri):(async(t,e)=>{const n=(await Qo(t)).filter?.get(e);return void 0===n?Ri:{kind:"external",name:e,...void 0!==n.clean&&{clean:n.clean},...void 0!==n.smudge&&{smudge:n.smudge},required:n.required??!1}})(t,e.set))(t,Ms(o,n,"filter",r))},Fi=async(t,e,n,o)=>{const{gitDir:r,workDir:s}=t.layout,i=await e.run({command:n,cwd:s,env:{GIT_DIR:r},stdin:o,...void 0!==t.signal?{signal:t.signal}:{}});return 0!==i.exitCode?{ok:!1,exitCode:i.exitCode}:{ok:!0,bytes:i.stdout??new Uint8Array(0)}};async function Bi(t,e,n){const o=n?.verifyHash??!0;if(!0===t.signal?.aborted)throw i();const r=await Ei(t,e);if(void 0!==r)return function(t,e,n,o){const r=async function*(t,e,n,o){const r=o?t.hash.createHasher():void 0,s=n[Symbol.asyncIterator](),a=await s.next();if(!0===a.done)throw D(`inflate stream produced no output for object ${e}`);const c=await async function(t,e,n){let o=n;for(;;){const n=o.indexOf(0);if(-1!==n){const{type:e}=Dt(o);if("blob"!==e)throw _("blob",e,t);return{headerBytes:o.subarray(0,n+1),content:o.subarray(n+1)}}const r=await e.next();if(!0===r.done)throw D(`no NUL terminator found in inflated object ${t}`);o=ji(o,r.value)}}(e,s,a.value);r?.update(c.headerBytes),c.content.length>0&&(r?.update(c.content),yield c.content);for await(const e of{[Symbol.asyncIterator]:()=>s}){if(!0===t.signal?.aborted)throw i();r?.update(e),yield e}await Wi(r,e)}(t,e,zi(t,n),o);return Object.assign(r,{materialised:!1})}(t,e,r,o);const s=_i(t),a=await s.lookup(e);if(void 0===a)throw T(e);const c=mi(await a.pack.offsetTable(),a.offset),{header:d,chunk:u,headerEndInChunk:f}=await Di(t,a,c);if(Li(d)){if(3!==d.type)throw _("blob",function(t){switch(t){case 1:return"commit";case 2:return"tree";case 4:return"tag"}}(d.type),e);return function(t,e,n,o,r){const s=async function*(t,e,n,o,r){const s=r?t.hash.createHasher():void 0;if(void 0!==s){const t=(new TextEncoder).encode(`blob ${o}\0`);s.update(t)}for await(const e of n){if(!0===t.signal?.aborted)throw i();s?.update(e),yield e}await Wi(s,e)}(t,e,zi(t,n),o,r);return Object.assign(s,{materialised:!1})}(t,e,u.subarray(f),d.size,o)}return async function(t,e,n,o){const{type:r,contentOffset:s}=Dt(n);if("blob"!==r)throw _("blob",r,e);const i=n.subarray(0,s),a=n.subarray(s);return Object.assign(async function*(){const n=o?t.hash.createHasher():void 0;n?.update(i),a.length>0&&(n?.update(a),yield a),await Wi(n,e)}(),{materialised:!0})}(t,e,await $i(t,s,a,e,void 0),o)}async function Wi(t,e){if(void 0===t)return;const n=await t.digestHex();if(n!==e)throw U(e,n)}function zi(t,e){const n=new ReadableStream({start(t){t.enqueue(e),t.close()}}).pipeThrough(t.compressor.createInflateStream());return $(n)}function ji(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}const Hi=async(e,n,o)=>!!await e.fs.exists(n)&&!await(async(e,n,o)=>{let r;try{r=await e.fs.read(n)}catch(e){if(e instanceof t&&"FILE_NOT_FOUND"===e.data.code)return!0;throw e}const{id:s}=await js(e,{type:"blob",content:r});return s===o})(e,n,o),Ki=async(t,e,n)=>{const o=$s(e,n.path);if("update"===n.kind||"delete"===n.kind){if(void 0===n.previousId)return;return await Hi(t,o,n.previousId)?{class:"local-changes",path:n.path}:void 0}if("add"===n.kind)return await(async(t,e)=>t.fs.exists(e))(t,o)?{class:"untracked",path:n.path}:void 0},Vi=async(t,e,n,o)=>{const r=$s(e,n.path);if("noop"!==n.kind)if("delete"!==n.kind){if(void 0!==n.id)return await(async(t,e,n,o,r)=>{if(o===P.GITLINK)return void await Ys(t,e,new Uint8Array,o);if(o===P.SYMLINK){const r=await Mi(t,n);return void await Ys(t,e,r.content,o)}if(void 0!==r&&void 0!==t.command){const s=await Pi(t,r,e);if("external"===s.kind&&void 0!==s.smudge){const r=await Mi(t,n),i=await Fi(t,t.command,s.smudge,r.content);if(!i.ok){if(s.required)throw c(e,s.name,i.exitCode);return void await Ys(t,e,r.content,o)}return void await Ys(t,e,i.bytes,o)}}const s=await Bi(t,n);await(async(t,e,n,o)=>{await qs(t,$s(t.layout.workDir,e),n,o)})(t,e,s,o)})(t,n.path,n.id,n.mode,o),(async(t,e,n,o,r)=>{const s=await t.fs.lstat(e);return{ctimeSeconds:Math.floor(s.ctimeMs/1e3),ctimeNanoseconds:Number(s.ctimeNs??0n)%1e9,mtimeSeconds:Math.floor(s.mtimeMs/1e3),mtimeNanoseconds:Number(s.mtimeNs??0n)%1e9,dev:s.dev,ino:s.ino,mode:r,uid:s.uid,gid:s.gid,fileSize:s.size,id:o,flags:Z,path:n}})(t,r,n.path,n.id,n.mode)}else await Ks(t,r)},Gi=async(t,e)=>{const{changeset:n,force:o,workdir:r}=e;if(!o){const e=await(async(t,e,n)=>{const o=[],r=[];for(const s of n.entries){const n=await Ki(t,e,s);void 0!==n&&("local-changes"===n.class?o.push(n.path):r.push(n.path))}return{localChanges:o.sort(Jt),untracked:r.sort(Jt)}})(t,r,n);if(e.localChanges.length>0||e.untracked.length>0)throw a(e)}let s;return(async(t,e,n,o)=>{const r=[];let s=0,i=0;for(const a of e.entries){const c=void 0!==t.command?await o():void 0,d=await Vi(t,n,a,c);"delete"===a.kind?i+=1:"add"!==a.kind&&"update"!==a.kind||(s+=1,void 0!==d&&r.push(d)),"noop"!==a.kind&&t.progress.update("checkout:materialize",s+i,e.stats.add+e.stats.update+e.stats.delete,a.path)}return{writtenEntries:r,written:s,deleted:i}})(t,n,r,()=>s??=Ws(t))},Yi=(t,e,n)=>void 0===e&&void 0!==n?{kind:"add",path:t,mode:n.mode,id:n.id,previousId:void 0,previousMode:void 0}:void 0!==e&&void 0===n?{kind:"delete",path:t,mode:e.mode,id:void 0,previousId:e.id,previousMode:e.mode}:{kind:e.id===n.id&&e.mode===n.mode?"noop":"update",path:t,mode:n.mode,id:n.id,previousId:e.id,previousMode:e.mode},qi=(t,e)=>{const n=(t=>{const e=new Map;for(const n of t.entries)0===n.flags.stage&&e.set(n.path,{id:n.id,mode:n.mode});return e})(t),o=(t=>{const e=new Map;for(const n of t)e.set(n.path,n);return e})(e),r=new Set;for(const t of n.keys())r.add(t);for(const t of o.keys())r.add(t);const s=[],i={add:0,update:0,delete:0,noop:0};for(const t of[...r].sort()){const e=Yi(t,n.get(t),o.get(t));s.push(e),i[e.kind]+=1}return{entries:s,stats:i}};async function*Xi(t,e,n){const o={ctx:t,recursive:n?.recursive??!0,maxDepth:n?.maxDepth??1024,maxEntries:n?.maxEntries??X},r="string"==typeof e?await async function(t,e){const n=await Ni(t,e);if("tree"!==n.type)throw _("tree",n.type,e);return n}(t,e):e;yield*Ji(o,{value:0},r,"",0,[])}async function*Ji(e,n,o,r,s,a){if(a.includes(o.id))throw new t({code:"TREE_CYCLE_DETECTED",id:o.id});if(function(t,e){return t>e}(s,e.maxDepth))throw N(s);const c=[...a,o.id];for(const t of o.entries){if(e.ctx.signal?.aborted)throw i();const o=""===r?t.name:`${r}/${t.name}`;if(n.value+=1,fi(n.value,e.maxEntries))throw M(n.value,e.maxEntries);if(yield{path:o,id:t.id,mode:t.mode},!Qi(e.recursive,t.mode))continue;const a=await Ni(e.ctx,t.id);"tree"===a.type&&(yield*Ji(e,n,a,o,s+1,c))}}function Qi(t,e){return!!t&&z(e)}const Zi=(t,e)=>t.filter(t=>e.has(t.path)),ta=(t,e,n)=>e.get(t)??n.get(t),ea=t=>{const e={add:0,update:0,delete:0,noop:0};for(const n of t)e[n.kind]+=1;return e},na=async(t,e)=>{const n=await(async(t,e)=>{const n=[];for await(const o of Xi(t,e))o.mode!==P.DIRECTORY&&n.push({path:o.path,id:o.id,mode:o.mode});return n})(t,e.targetTree),o=((t,e)=>{if(void 0!==e.paths)return{target:Zi(t,e.paths),indexForDiff:{...e.currentIndex,entries:Zi(e.currentIndex.entries,e.paths)},excluded:[]};const n=e.sparse;if(void 0!==n){const o=[],r=[];for(const e of t)(n(e.path)?o:r).push(e);return{target:o,indexForDiff:{...e.currentIndex,entries:e.currentIndex.entries.filter(t=>!t.flags.skipWorktree)},excluded:r}}return{target:t,indexForDiff:e.currentIndex,excluded:[]}})(n,e),r=qi(o.indexForDiff,o.target),s=!0===e.forceRewriteAll?(t=>{const e=t.entries.map(t=>"noop"===t.kind?{...t,kind:"update"}:t);return{entries:e,stats:ea(e)}})(r):r,i=await Gi(t,{changeset:s,force:e.force??!1,workdir:t.layout.workDir}),a=((t,e,n,o)=>{const r=(t=>{const e=new Map;for(const n of t)e.set(n.path,n);return e})(t),s=(t=>{const e=new Map;for(const n of t.entries)0===n.flags.stage&&e.set(n.path,n);return e})(e),i=((t,e)=>{if(void 0===e)return[];const n=[];for(const[o,r]of t)e.has(o)||n.push(r);return n})(s,o);for(const t of n){const e=ta(t.path,r,s);void 0!==e&&i.push(e)}return i.sort((t,e)=>t.path<e.path?-1:1),i})(i.writtenEntries,e.currentIndex,o.target,e.paths);var c;return{newIndexEntries:0===o.excluded.length?a:(c=[...a,...o.excluded.map(tt)],[...c].sort(Ht)),written:i.written,deleted:i.deleted}};async function oa(t){const e=Ko(t.layout.gitDir);if(!await t.fs.exists(e))return{version:2,entries:[],extensions:[],trailerSha:new Uint8Array(0)};if(ii((await t.fs.stat(e)).size))throw J(ri);const n=await t.fs.read(e);if(ii(n.length))throw J(ri);const o=t.hashConfig.digestLength;if(n.length<o)throw J("file is shorter than the hash trailer");const r=n.subarray(0,n.length-o),s=nt(n.subarray(n.length-o));if(await t.hash.hashHex(r)!==s)throw J("index trailer checksum mismatch");return function(t){if(t.length<12)throw J("truncated header");const e=new DataView(t.buffer,t.byteOffset,t.byteLength);if(1145655875!==e.getUint32(0))throw J("invalid signature: expected DIRC");const n=e.getUint32(4);if(2!==n&&3!==n)throw J(`unsupported version: ${n}`);const o=e.getUint32(8);if(62*o>t.length-12-20)throw J(`entry count ${o} exceeds file capacity`);let r=12;const s=[];for(let i=0;i<o;i++){const o=r;if(r+62>t.length-20)throw Q(r,"truncated entry");const i=e.getUint32(r),a=e.getUint32(r+4),c=e.getUint32(r+8),d=e.getUint32(r+12),u=e.getUint32(r+16),f=e.getUint32(r+20),l=e.getUint32(r+24),h=e.getUint32(r+28),w=e.getUint32(r+32),p=e.getUint32(r+36),g=nt(t.subarray(r+40,r+60)),m=e.getUint16(r+60),{flags:y,extendedSize:v}=zt(e,r,n,t.length),b=W(l.toString(8));r+=62+v;const k=jt(t,r);if(-1===k)throw Q(o,"missing NUL terminator");const x=4095&m,E=ft(t.subarray(r,4095===x?k:r+x));Wt(E,o),r=k+1,r=o+(r-o+7&-8),s.push({ctimeSeconds:i,ctimeNanoseconds:a,mtimeSeconds:c,mtimeNanoseconds:d,dev:u,ino:f,mode:b,uid:h,gid:w,fileSize:p,id:g,flags:y,path:It.from(E)})}const i=function(t,e,n){const o=[],r=t.length-20;for(;e+8<=r;){const s=ft(t.subarray(e,e+4)),i=n.getUint32(e+4);if(e+8+i>r)throw Q(e,"extension size exceeds remaining bytes");const a=s.charCodeAt(0);if(a>=97&&a<=122){const t=s.replace(/[^\x20-\x7e]/g,"?");throw Q(e,`mandatory extension '${t}' not supported`)}const c=t.slice(e+8,e+8+i);o.push({signature:s,data:c}),e+=8+i}return o}(t,r,e);return{version:n,entries:s,extensions:i,trailerSha:t.slice(t.length-20)}}(n)}const ra=1048576,sa=new TextDecoder,ia=async e=>{const n=Yo(e.layout.gitDir);let o;try{o=await e.fs.read(n)}catch(e){if(e instanceof t&&"FILE_NOT_FOUND"===e.data.code)return;throw e}if(o.byteLength>ra)throw d("info/sparse-checkout",o.byteLength,ra);return sa.decode(o)},aa=async t=>{const e=await Qo(t);if(!0!==e.core?.sparseCheckout)return;const n=!0===e.core.sparseCheckoutCone,o=await ia(t),r=wo(o??"",n);return r.degraded&&void 0!==o&&t.logger?.warn?.(".git/info/sparse-checkout is not cone-shaped; falling back to non-cone matching"),po(r.spec)},ca=(e,n)=>new t(void 0===n?{code:"RESOURCE_LOCKED",resource:"index",path:e}:{code:"RESOURCE_LOCKED",resource:"index",path:e,mtimeMs:n}),da=async(e,n={})=>{const o=`${Ko(e.layout.gitDir)}${qo}`,r=Ko(e.layout.gitDir),s=n.now??(()=>Date.now()),i=e.config?.breakStaleLockMs;try{await e.fs.writeExclusive(o,new Uint8Array)}catch(n){if(!(n instanceof t)||"FILE_EXISTS"!==n.data.code)throw n;if(void 0===i)throw ca(o,await ua(e,o));await fa(e,o,i,s)}return la(e,o,r)},ua=async(t,e)=>{try{return(await t.fs.lstat(e)).mtimeMs}catch{return}},fa=async(e,n,o,r)=>{const s=await ua(e,n);if(void 0===s)return void await e.fs.writeExclusive(n,new Uint8Array);const i=r()-s;if(i<0)throw ca(n,s);if(i<o)throw ca(n,s);await e.fs.rm(n);try{await e.fs.writeExclusive(n,new Uint8Array)}catch(o){if(o instanceof t&&"FILE_EXISTS"===o.data.code)throw ca(n,await ua(e,n));throw o}},la=(e,n,o)=>{let r=!1,s=!1;return{release:async()=>{if(!r&&!s){s=!0;try{await e.fs.rm(n)}catch(e){if(!(e instanceof t)||"FILE_NOT_FOUND"!==e.data.code)throw e}}},commit:async t=>{if(r||s)return;const i=function(t){const e=[...t.entries].sort(Ht),n=e.map(t=>{const e=ut(t.path),n=t.flags.skipWorktree||t.flags.intentToAdd;return{entry:t,pathBytes:e,extended:n,paddedLength:62+(n?2:0)+e.length+8&-8}}),o=t.extensions.map(t=>({ext:t,sigBytes:ut(t.signature),totalLength:8+t.data.length})),r=12+n.reduce((t,e)=>t+e.paddedLength,0)+o.reduce((t,e)=>t+e.totalLength,0),s=new Uint8Array(r),i=new DataView(s.buffer),a=n.some(t=>t.extended)?3:2;i.setUint32(0,1145655875),i.setUint32(4,a),i.setUint32(8,e.length);let c=12;for(const{entry:t,pathBytes:e,extended:o,paddedLength:r}of n)Kt(s,i,c,t,e,o),c+=r;for(const{ext:t,sigBytes:e,totalLength:n}of o)s.set(e,c),i.setUint32(c+4,t.data.length),s.set(t.data,c+8),c+=n;return s}({entries:[...t],extensions:[]}),a=await e.hash.hash(i),c=new Uint8Array(i.length+a.length);c.set(i,0),c.set(a,i.length),await e.fs.write(n,c),await e.fs.rename(n,o),r=!0}}},ha=new TextEncoder,wa=new Set([".git"]),pa=t=>{""===t&&ma(t),va(t)>4096&&ma(t),t.startsWith("/")&&ma(t),t.includes("\\")&&ma(t),t.includes("\0")&&ma(t);const e=t.split("/");for(const n of e)ya(n,t);return t},ga=t=>{const e=t.toLowerCase();return!!wa.has(e)||".git"===e.replace(/[. ]+$/,"")},ma=t=>{throw u(t)},ya=(t,e)=>{""===t&&ma(e),"."!==t&&".."!==t||ma(e),va(t)>255&&ma(e),ga(t)&&ma(e),t.includes(":")&&ma(e);for(let n=0;n<t.length;n+=1){const o=t.charCodeAt(n);(o<=31||127===o)&&ma(e)}},va=t=>ha.encode(t).length,ba=(t,e)=>""===t?e:`${t}/${e}`;async function*ka(t,e){const n={ctx:t,maxDepth:e?.maxDepth??4096,maxEntries:e?.maxEntries??X,ignore:e?.ignore};yield*xa(n,{value:0},"",0,!0)}async function*xa(t,e,n,o,r){if(o>t.maxDepth)throw N(o);const s=await t.ctx.fs.readdir(Ia(t,n));if(r||!s.some($a))for(const r of s){if(t.ctx.signal?.aborted)throw i();ga(r.name)||(yield*Ea(t,e,n,o,r))}}async function*Ea(t,e,n,o,r){const s=ba(n,r.name);if(pa(s),r.isDirectory&&!r.isSymbolicLink){if(void 0!==t.ignore&&await t.ignore(s,!0))return;return void(yield*xa(t,e,s,o+1,!1))}if(!r.isFile&&!r.isSymbolicLink)return;if(void 0!==t.ignore&&await t.ignore(s,!1))return;if(e.value+=1,e.value>t.maxEntries)throw M(e.value,t.maxEntries);const i=await t.ctx.fs.lstat($s(t.ctx.layout.workDir,s));yield{path:s,stat:i}}const Ia=(t,e)=>""===e?t.ctx.layout.workDir:$s(t.ctx.layout.workDir,e),$a=t=>!!ga(t.name)&&(t.isDirectory||t.isFile&&!t.isSymbolicLink);async function La(e,n){if(e.signal?.aborted)throw i();const{bytes:o,id:r}=await js(e,n),s=n.id;if(""!==s&&s!==r)throw U(n.id,r);if(e.signal?.aborted)throw i();const a=await Qo(e),c=a.core?.looseCompression,d=r.slice(0,2);await e.fs.mkdir(Vo(e.layout.gitDir,d));const u=jo(e.layout.gitDir,r),f=void 0!==c&&c>=-1&&c<=9?await e.compressor.deflate(o,c):await e.compressor.deflate(o);try{await e.fs.writeExclusive(u,f)}catch(e){if(function(e){return e instanceof t&&"FILE_EXISTS"===e.data.code}(e))return r;throw e}return r}const Da=async(t,e)=>{const n=$s(t.layout.workDir,""===e?".gitignore":`${e}/.gitignore`);return Ca(t,n)},Ca=async(t,e)=>{const n=await Ps(t,e,1048576,f);return void 0===n?void 0:(t=>{const e=[],n=t.split("\n");for(let t=0;t<n.length;t+=1){const o=n[t],r=Re(o);if(void 0===r)continue;const{negated:s,anchored:i,directoryOnly:a,cleanPattern:c}=r;e.push({pattern:Me(Ne(o)),negated:s,directoryOnly:a,anchored:i,lineNumber:t+1,compiled:Ue(c,{anchored:i})})}return e})(n)},Aa=async t=>{const e=[],n=await(async t=>{const e=await Qo(t),n=e.core?.excludesFile;if(void 0===n||""===n)return;const o=Rs(t,n);return void 0!==o?Ca(t,o):void 0})(t);void 0!==n&&e.push({basedir:"",rules:n,kind:"global"});const o=await(async t=>Ca(t,`${Wo(t)}/info/exclude`))(t);void 0!==o&&e.push({basedir:"",rules:o,kind:"info"});const r=await Da(t,"");void 0!==r&&e.push({basedir:"",rules:r,kind:"gitignore"});const s=new Map;return{base:e,loadDirRules:async e=>{const n=s.get(e);if(void 0!==n)return n;const o=await Da(t,e)??[];return s.set(e,o),o}}},Oa=async t=>{const e=await Aa(t),n=[...e.base],o=new Set([]);return async(t,r)=>{for(const r of Sa(t)){if(o.has(r))continue;o.add(r);const t=await e.loadDirRules(r);t.length>0&&n.push({basedir:r,rules:t})}return"ignored"===((t,e,n)=>Ae(t,e,n).verdict)(n,t,r)}},Sa=t=>{const e=t.split("/");if(e.length<=1)return[];const n=[];for(let t=1;t<e.length;t+=1)n.push(e.slice(0,t).join("/"));return n};async function Ta(t,e,n){const o=n?.maxSymbolicDepth??5,r=n?.maxPeelDepth??5,s=n?.peel??!1,i=xs(t),a=await async function(t,e,n){const o=[];let r=e,s=0;for(;;){if("HEAD"!==r&&Zn(r),o.includes(r))throw Jn([...o,r]);o.push(r);const e=await t.resolveDirect(r);if("missing"===e.kind)throw qn(r);if("direct"===e.kind)return e.id;if(s+=1,ci(s,n))throw Xn(s,o);r=e.target}}(i,e,o);return s?async function(t,e,n){let o=e,r=0;for(;;){const e=await Ni(t,o);if("tag"!==e.type)return o;if(r+=1,di(r,n))throw Xn(r,[]);o=e.data.object}}(t,a,r):a}async function Ua(t,e){let n=wi(e)?e:await Ta(t,e),o=await Ni(t,n),r=0;for(;"commit"===o.type||"tag"===o.type;){if(r+=1,r>5)throw Xn(r,[]);n="commit"===o.type?o.data.tree:o.data.object,o=await Ni(t,n)}if("tree"!==o.type)throw _("tree",o.type,n);return o}const _a=(t,e)=>t.date>e.date||t.date===e.date&&t.oid<e.oid,Na=(t,e)=>{let n=0;for(;n<t.length&&!_a(e,t[n]);)n+=1;t.splice(n,0,e)},Ma=32;async function Ra(t,e,n){const o=new Array(t.length);let r=0;const s=async()=>{for(;r<t.length;){const e=r++;o[e]=await n(t[e])}},i=Math.min(e,t.length),a=[];for(let t=0;t<i;t++)a.push(s());return await Promise.all(a),o}async function Pa(t,e){return Ra(e,32,async e=>({id:e,bytes:(await Mi(t,e)).content}))}function Fa(t,e){const n=[];for(const e of t)n.push({oldPath:e.oldPath,oldId:e.oldId,oldMode:e.oldMode});for(const t of e)"modify"!==t.type&&"type-change"!==t.type||qt(t.oldMode)||n.push({oldPath:t.path,oldId:t.oldId,oldMode:t.oldMode});return n}function Ba(t,e){const n=new Map;for(const o of t){if(n.has(o))continue;const t=e.get(o);void 0!==t&&n.set(o,{chunkMap:we(t),size:t.length})}return n}function Wa(t,e,n,o,r){if(function(t,e,n){const o=Math.max(t,e),r=Math.min(t,e);return o*(le-n)<(o-r)*le}(t.size,e.size,n))return;const s=function(t,e,n,o){const r=Math.max(e,o);if(0===r)return le;if(0===e||0===o)return 0;const s=pe(t,n);return Math.trunc(s*le/r)}(t.chunkMap,t.size,e.chunkMap,e.size);s>=n&&function(t,e){if(t.length<4)return void t.push(e);let n=0;for(let e=1;e<t.length;e++){const o=t[e],r=t[n];void 0!==o&&void 0!==r&&o.score<r.score&&(n=e)}const o=t[n];void 0!==o&&e.score>o.score&&(t[n]=e)}(r,{...o,score:s})}function za(t,e,n){return{type:"rename",oldPath:t.oldPath,newPath:e.newPath,oldId:t.oldId,newId:e.newId,oldMode:t.oldMode,newMode:e.newMode,similarity:{score:n,maxScore:le}}}function ja(t,e,n){return{type:"copy",oldPath:t.oldPath,newPath:e.newPath,oldId:t.oldId,newId:e.newId,oldMode:t.oldMode,newMode:e.newMode,similarity:{score:n,maxScore:le}}}async function Ha(t,e){const{adds:n,deletes:o,threshold:r,copyThreshold:s,copies:i,copySources:a}=e;if(0===o.length&&0===a.length)return null;const c=[...o.map(t=>t.oldId),...a.map(t=>t.oldId)],d=await async function(t,e,n){const[o,r]=await Promise.all([Pa(t,e),Pa(t,n.map(t=>t.newId))]),s=new Map(o.map(t=>[t.id,t.bytes])),i=new Map(r.map(t=>[t.id,t.bytes]));return{srcFingerprints:Ba(e,s),dstFingerprints:Ba(n.map(t=>t.newId),i)}}(t,c,n),u=function(t){const e=new Set,n=new Set,o=[];for(const r of t)if(!n.has(r.add))if("rename"===r.kind){if(e.has(r.src))continue;e.add(r.src),n.add(r.add),o.push({kind:"rename",change:za(r.src,r.add,r.score),del:r.src,add:r.add})}else n.add(r.add),o.push({kind:"copy",change:ja(r.src,r.add,r.score),add:r.add});return o}(function(t,e,n,o,r,s,{srcFingerprints:i,dstFingerprints:a}){const c=function(t,e,n,o,r){const s=[];for(const i of e){const e=o.get(i.newId);if(void 0===e)continue;const a=[];for(const o of t){const t=n.get(o.oldId);void 0!==t&&Wa(t,e,r,{kind:"rename",src:o,add:i,score:0},a)}for(const t of a)s.push(t)}return s}(t,e,i,a,r),d="off"!==o?function(t,e,n,o,r){const s=[];for(const i of e){const e=o.get(i.newId);if(void 0===e)continue;const a=[];for(const o of t){const t=n.get(o.oldId);void 0!==t&&Wa(t,e,r,{kind:"copy",src:o,add:i,score:0},a)}for(const t of a)s.push(t)}return s}(n,e,i,a,s):[],u=[...c,...d];return u.sort((t,e)=>e.score!==t.score?e.score-t.score:"rename"===t.kind&&"copy"===e.kind?-1:"copy"===t.kind&&"rename"===e.kind?1:0),u}(o,n,a,i,r,s,d)),f=u.filter(t=>"rename"===t.kind),l=u.filter(t=>"copy"===t.kind);return{renames:f.map(t=>t.change),copyChanges:l.map(t=>t.change),consumedDeletes:new Set(f.map(t=>t.del)),consumedAdds:new Set(u.map(t=>t.add))}}function Ka(t,e){const n=t.length,o=Math.max(n,e.length),{srcCopied:r,literalAdded:s}=function(t,e){const n=e.length;if(0===t.length||0===n)return{srcCopied:0,literalAdded:n};const o=pe(we(t),we(e));return{srcCopied:o,literalAdded:n-o}}(t,e),i=n-r,a=Math.min(i+s,o);return{computedBreakScore:o>0?Math.trunc(a*le/o):0,dissimilarity:n>0?Math.trunc(i*le/n):0}}function Va(t,e,n){const o=new Map(e.map(t=>[t.original.path,t])),r=[];for(const e of t.changes){const t="modify"===e.type&&n.has(e.path)?o.get(e.path):void 0;void 0!==t?r.push(t.del,t.add):r.push(e)}return{changes:r}}function Ga(t,e){return t.dissimilarity>=e?{...t.original,broken:{score:t.dissimilarity,maxScore:le}}:t.original}function Ya(t,e,n){if(0===e.length)return t;const{presentDels:o,presentAdds:r}=function(t,e){const n=new Set(e.map(t=>t.del)),o=new Set(e.map(t=>t.add)),r=new Set,s=new Set;for(const e of t)"delete"===e.type&&n.has(e)?r.add(e):"add"===e.type&&o.has(e)&&s.add(e);return{presentDels:r,presentAdds:s}}(t,e),s=new Set,i=[];for(const t of e){const e=o.has(t.del),a=r.has(t.add);(e||a)&&e&&a&&(s.add(t.del),s.add(t.add),i.push(Ga(t,n)))}return 0===s.size?t:[...t.filter(t=>!s.has(t)),...i]}function qa(t,e,n){return 0===e.length?{changes:Qt(t,Vt)}:{changes:Qt(Ya(t,e,n),Vt)}}async function Xa(t,e,n,o){const{threshold:r,copyThreshold:s,limit:i,copies:a,breakRewrites:c}=function(t){const e=t?.threshold??3e4;return{threshold:e,copyThreshold:t?.copyThreshold??e,limit:t?.limit??1e3,copies:t?.copies??"off",breakRewrites:t?.breakRewrites??!1}}(n),d=function(t){return function(t){return{breakScore:t.score,mergeScore:0===t.merge?36e3:t.merge}}(!1!==t&&void 0!==t?t:{score:3e4,merge:36e3}).mergeScore}(c),{broken:u,workingDiff:f}=await async function(t,e,n){if(!1===n||void 0===n)return{broken:[],workingDiff:e};const o=0!==n.score?n.score:3e4,r=await async function(t,e,n){const o=e.changes.filter(t=>"modify"===t.type&&!qt(t.oldMode));if(0===o.length)return{broken:[],patchedDiff:e};const{records:r,paths:s}=await async function(t,e,n){const o=e.flatMap(t=>[t.oldId,t.newId]),r=await Pa(t,o),s=new Map(r.map(t=>[t.id,t.bytes])),i=[],a=new Set;for(const t of e){const e=s.get(t.oldId)??new Uint8Array(0),o=s.get(t.newId)??new Uint8Array(0),{computedBreakScore:r,dissimilarity:c}=Ka(e,o);r<n||(i.push({original:t,del:{type:"delete",oldPath:t.path,oldId:t.oldId,oldMode:t.oldMode},add:{type:"add",newPath:t.path,newId:t.newId,newMode:t.newMode},dissimilarity:c}),a.add(t.path))}return{records:i,paths:a}}(t,o,n);return 0===r.length?{broken:[],patchedDiff:e}:{broken:r,patchedDiff:Va(e,r,s)}}(t,e,o);return{broken:r.broken,workingDiff:r.patchedDiff}}(t,e,c),l=function(t,e={}){const n=e.limit??1e3,o=e.maxSameIdDeletes??100,{adds:r,deletes:s,other:i}=function(t){const e=[],n=[],o=[];for(const r of t)"add"===r.type?e.push(r):"delete"===r.type?n.push(r):o.push(r);return{adds:e,deletes:n,other:o}}(t.changes);if(r.length*s.length>n)return t;const a=function(t,e){const n=new Map;for(const e of t){const t=n.get(e.oldId);void 0===t?n.set(e.oldId,[e]):t.push(e)}const o=new Map;for(const[t,r]of n)r.length<=e&&o.set(t,r);return o}(s,o),c=new Set,d=[],u=[];for(const t of r){const e=me(t,a);void 0===e?u.push(t):(d.push(e.rename),c.add(e.consumedDelete))}const f=s.filter(t=>!c.has(t));return{changes:Qt([...u,...f,...d,...i],Vt)}}(f,{...n,limit:Number.MAX_SAFE_INTEGER}),{adds:h,deletes:w,other:p}=function(t){const e=[],n=[],o=[];for(const r of t)"add"===r.type?qt(r.newMode)?o.push(r):e.push(r):"delete"===r.type?qt(r.oldMode)?o.push(r):n.push(r):o.push(r);return{adds:e,deletes:n,other:o}}(l.changes);if(!(h.length>0&&w.length>0||"off"!==a&&h.length>0))return qa(l.changes,u,d);const g=function(t,e,n,o,r,s){if("off"===t)return[];if("on"===t)return Fa(n,o);const i=void 0!==r?function(t){const e=[];for(const[n,o]of t)qt(o.mode)||e.push({oldPath:n,oldId:o.id,oldMode:o.mode});return e}(r):Fa(n,o);return 0!==s&&e.length*i.length>s*s?Fa(n,o):i}(a,h,w,p,o,i);return qa(0!==i&&h.length*(w.length+g.length)>i*i?l.changes:function(t,e,n,o){const r=o?.consumedDeletes??new Set,s=o?.consumedAdds??new Set,i=o?.renames??[],a=o?.copyChanges??[];return[...t.filter(t=>!s.has(t)),...e.filter(t=>!r.has(t)),...i,...a,...n]}(h,w,p,await Ha(t,{adds:h,deletes:w,threshold:r,copyThreshold:s,copies:a,copySources:g})),u,d)}const Ja=async(t,e)=>{const n=new Map;for await(const o of Xi(t,e))o.mode!==P.DIRECTORY&&n.set(o.path,{id:o.id,mode:o.mode});return{entries:n}},Qa=new Uint8Array(0),Za={},tc={patch:"binary",numstat:"binary"},ec={patch:"text",numstat:"text"},nc={patch:"text",numstat:"binary"},oc=new TextEncoder;function rc(t){return oc.encode(`Subproject commit ${t}\n`)}async function sc(t,e,n){return qt(e)?rc(n):(await Mi(t,n)).content}async function ic(t,e,n,o){const{sources:r,macros:s}=await e.sourcesForPath(n),i=Ms(r,n,"diff",s);let a,c=!1;var d,u;return!1!==i&&!0!==i&&"unspecified"!==i&&(a=await async function(t,e){const n=(await Qo(t)).diff?.get(e),o=n?.textconv;return void 0!==o&&""!==o?o:void 0}(t,i.set),c=void 0!==a),{pair:(d=i,u={textconvConfigured:c,rawIsBinary:!!c&&await o()},!1===d?tc:!0===d?ec:"unspecified"===d?Za:u.textconvConfigured?u.rawIsBinary?nc:ec:Za),command:a}}async function ac(t,e,n,o,r,s,i){return qt(s)?i:(async(t,e,n,o,r)=>{const s=`${t.layout.gitDir}/TEXTCONV_INPUT_${r}`;await t.fs.write(s,o);try{return(await e.run({command:`${n} ${s}`,cwd:t.layout.workDir,env:{GIT_DIR:t.layout.gitDir},...void 0!==t.signal?{signal:t.signal}:{}})).stdout??Qa}finally{await t.fs.rm(s)}})(t,e,n,i,`${r}_${a=Vt(o),a.replace(/[^a-zA-Z0-9]/g,"_").slice(0,64)}`);var a}function cc(t,e){return{...t,...void 0!==e.patch?{patchBinaryOverride:e.patch}:{},...void 0!==e.numstat?{numstatBinaryOverride:e.numstat}:{}}}async function dc(t,e,n,o,r,s,i,a){return void 0===e.runner||void 0===n?[r,s]:Promise.all([ac(t,e.runner,n,o,"old",i,r),ac(t,e.runner,n,o,"new",a,s)])}async function uc(t,e,n){let o;const r=!0===n?.applyTextconv?{runner:t.command,getProvider:()=>o??=Ws(t)}:void 0;return Ra(e,32,e=>async function(t,e,n){return"add"===e.type?async function(t,e,n){if(qt(e.newMode))return{change:e,newContent:rc(e.newId)};const o=(await Mi(t,e.newId)).content;if(void 0===n)return{change:e,newContent:o};const r=await n.getProvider(),{pair:s,command:i}=await ic(t,r,Vt(e),()=>ae(o));return cc({change:e,newContent:void 0!==n.runner&&void 0!==i?await ac(t,n.runner,i,e,"new",e.newMode,o):o},s)}(t,e,n):"delete"===e.type?async function(t,e,n){if(qt(e.oldMode))return{change:e,oldContent:rc(e.oldId)};const o=(await Mi(t,e.oldId)).content;if(void 0===n)return{change:e,oldContent:o};const r=await n.getProvider(),{pair:s,command:i}=await ic(t,r,Vt(e),()=>ae(o));return cc({change:e,oldContent:void 0!==n.runner&&void 0!==i?await ac(t,n.runner,i,e,"old",e.oldMode,o):o},s)}(t,e,n):"rename"===e.type||"copy"===e.type?async function(t,e,n){if(e.similarity.score===le){if(void 0===n)return{change:e};const o=await n.getProvider(),{pair:r}=await ic(t,o,Vt(e),async()=>!qt(e.newMode)&&ae((await Mi(t,e.newId)).content));return cc({change:e},r)}const[o,r]=await Promise.all([Mi(t,e.oldId),Mi(t,e.newId)]);if(void 0===n)return{change:e,oldContent:o.content,newContent:r.content};const s=await n.getProvider(),{pair:i,command:a}=await ic(t,s,Vt(e),()=>ae(o.content)||ae(r.content)),[c,d]=await dc(t,n,a,e,o.content,r.content,e.oldMode,e.newMode);return cc({change:e,oldContent:c,newContent:d},i)}(t,e,n):e.oldId!==e.newId||qt(e.oldMode)||qt(e.newMode)?async function(t,e,n){const[o,r]=await Promise.all([sc(t,e.oldMode,e.oldId),sc(t,e.newMode,e.newId)]);if(void 0===n)return{change:e,oldContent:o,newContent:r};const s=qt(e.oldMode)?new Uint8Array(0):o,i=qt(e.newMode)?new Uint8Array(0):r,a=await n.getProvider(),{pair:c,command:d}=await ic(t,a,Vt(e),()=>ae(s)||ae(i)),[u,f]=await dc(t,n,d,e,o,r,e.oldMode,e.newMode);return cc({change:e,oldContent:u,newContent:f},c)}(t,e,n):async function(t,e,n){const o=(await Mi(t,e.oldId)).content;if(void 0===n)return{change:e,oldContent:o,newContent:o};const r=await n.getProvider(),{pair:s,command:i}=await ic(t,r,Vt(e),()=>ae(o)),[a,c]=await dc(t,n,i,e,o,o,e.oldMode,e.newMode);return cc({change:e,oldContent:a,newContent:c},s)}(t,e,n)}(t,e,r))}const fc=new Uint8Array(0);async function lc(t,e,n,o){const[r,s]=await Promise.all([pc(t,e),pc(t,n)]),i=!0===o?.recursive?await async function(t,e,n){const[o,r]=await Promise.all([gc(t,e),gc(t,n)]);return Le(o,r)}(t,r,s):Le(r,s),a=!0===o?.detectRenames?await Xa(t,i,o.renameOptions,await async function(t,e,n){if("harder"!==n?.copies||void 0===e)return;return(await Ja(t,e)).entries}(t,r,o.renameOptions)):i,c={mode:(d=o??{}).ignoreWhitespace??"none",ignoreCrAtEol:d.ignoreCrAtEol??!1};var d;const u="none"!==(f=c).mode||f.ignoreCrAtEol;var f;const l=!0===o?.ignoreBlankLines,h=!0===o?.withStat;return u||h?async function(t,e,n,o,r,s){const i=await uc(t,e.changes,{applyTextconv:!0}),a=[];for(const t of i){const e=ke(t.oldContent??fc,t.newContent??fc,hc(n,o,r,t.numstatBinaryOverride));o&&wc(t.change,e)||a.push(s?{...t.change,...e}:t.change)}return{changes:a}}(t,a,c,u,l,h):a}function hc(t,e,n,o){const r=void 0!==o?{numstatBinaryOverride:o}:{};return e?{lineKey:t,ignoreBlankLines:n,...r}:n?{ignoreBlankLines:n,...r}:void 0!==o?{numstatBinaryOverride:o}:void 0}function wc(t,e){return"modify"===t.type&&0===e.added&&0===e.deleted&&!e.binary}async function pc(t,e){if(void 0!==e)return"string"==typeof e?Ua(t,e):e}async function gc(t,e){if(void 0===e)return;const n=await Ja(t,e),o=Array.from(n.entries,([t,e])=>({name:t,mode:e.mode,id:e.id}));return{type:"tree",id:e.id,entries:o}}const mc=async(t,e)=>{const n=[];for(const o of e.oids){const e=await Ni(t,o);n.push(await yc(t,e))}const o=function(t){const e=function(t,e){const n=new Uint8Array(12),o=new DataView(n.buffer);return o.setUint32(0,Lo),o.setUint32(4,2),o.setUint32(8,e),n}(0,t.length),n=[e],o=[];let r=e.length;for(const e of t){const t=Po(Co(e.type,e.uncompressedSize),e.compressedData),s=K(t);o.push({crc32:s,offset:r}),n.push(t),r+=t.length}return{data:Fo(n),entries:o}}(n),r=await t.hash.hash(o.data),s=nt(r),i=new Uint8Array(o.data.length+r.length);return i.set(o.data,0),i.set(r,o.data.length),{bytes:i,sha:s,objectCount:n.length}},yc=async(t,e)=>{const n=Nt(e,t.hashConfig),o=n.indexOf(0),r=n.subarray(o+1),s=await t.compressor.deflate(r);return{type:vc(e.type),uncompressedSize:r.length,compressedData:s}},vc=t=>{switch(t){case"commit":return 1;case"tree":return 2;case"blob":return 3;case"tag":return 4}},bc=(e,n)=>{if(e.emitted.has(n))return!1;if(e.emitted.size>=e.cap)throw new t({code:"PACK_TOO_LARGE",objectCount:e.emitted.size+1,limit:e.cap});return e.emitted.add(n),!0},kc=async(t,e,n)=>{let o=e;for(let e=0;e<16;e+=1){const e=await Ni(t,o);if("tag"!==e.type)return o;n(o),o=e.data.object}return o},xc=async(t,e,n)=>{try{const o=await Ni(t,e,{verifyHash:n.verifyHash});return"commit"===o.type?o:void 0}catch(t){if(n.ignoreMissing&&Ec(t))return void n.missing.add(e);throw t}},Ec=e=>e instanceof t&&"OBJECT_NOT_FOUND"===e.data.code;async function*Ic(t,e){!function(t){if(ti(t.from))throw l(Qs);if(ei(t.from))throw l(Zs)}(e);const n=e.order??"topo",o=e.ignoreMissing??!1,r=e.verifyHash??!0,s={queue:[...e.from],visited:new Set,missing:new Set,until:new Set(e.until??[]),shallow:e.shallow??new Set};for(;s.queue.length>0;){if(t.signal?.aborted)throw i();const e=s.queue.shift();if(s.visited.has(e)||s.until.has(e))continue;const a=await xc(t,e,{verifyHash:r,ignoreMissing:o,missing:s.missing});void 0!==a&&(s.visited.add(e),yield a,$c(s,a,n))}}function $c(t,e,n){if(t.shallow.has(e.id))return;const o="first-parent"===n&&e.data.parents.length>0?[e.data.parents[0]]:e.data.parents;for(const e of o)if(!(t.visited.has(e)||t.missing.has(e)||t.until.has(e))){if(t.queue.length>=65536)throw l("walk queue exceeds bound");t.queue.push(e)}}async function Lc(t){const e=new Set;await t.fs.exists(`${t.layout.gitDir}/HEAD`)&&e.add("HEAD");for(const n of await async function(t){const e=`${t.layout.gitDir}/refs`;return await t.fs.exists(e)?Dc(t,e,"refs"):[]}(t))e.add(n);for(const n of(await xs(t).getPackedRefs()).entries)e.add(n.name);return[...e]}async function Dc(t,e,n){const o=await t.fs.readdir(e),r=[];for(const s of o){const o=`${n}/${s.name}`;s.isDirectory?r.push(...await Dc(t,`${e}/${s.name}`,o)):r.push(o)}return r}const Cc=(t,e)=>t.some(t=>!(4&(e.get(t.oid)??0))),Ac=async(t,e,n)=>{const o=new Map,r=[],s=async(e,n)=>{var s;o.set(e,(o.get(e)??0)|n),Na(r,{oid:e,date:(s=await t(e),s?.data.committer.timestamp??0),value:void 0})};await s(e,1);for(const t of n)await s(t,2);for(;Cc(r,o);){const{oid:e}=r.shift();let n=7&(o.get(e)??0);3===n&&(o.set(e,8|(o.get(e)??0)),n|=4);const i=await t(e);for(const t of i?.data.parents??[])((o.get(t)??0)&n)!==n&&await s(t,n)}return o},Oc=async(t,e)=>{const n=[...new Set(e)];if(n.length<=1)return n;const o=[];for(const e of n){const r=n.filter(t=>t!==e);2&((await Ac(t,e,r)).get(e)??0)||o.push(e)}return o},Sc=async(t,e,n)=>{if(0===n.length)return[e];const o=(t=>{const e=[];for(const[n,o]of t)8&o&&e.push(n);return e})(await Ac(t,e,n));return Oc(t,o)},Tc=async(t,e,n)=>{if(0===e.length)throw l("mergeBase requires at least one commit");const o=(t=>{const e=new Map;return async n=>{if(!e.has(n)){const o=await Ni(t,n);e.set(n,"commit"===o.type?o:void 0)}return e.get(n)}})(t),r=[...n?.octopus?await(async(t,e)=>{let n=[e[0]];for(let o=1;o<e.length;o+=1){const r=[];for(const s of n)r.push(...await Sc(t,e[o],[s]));n=r}return Oc(t,n)})(o,e):await Sc(o,e[0],e.slice(1))].sort();return!0===n?.all?r:r.slice(0,1)},Uc=new TextEncoder,_c=new Set(["side-band-64k","side-band"]),Nc=async(t,e,n)=>{t.progress.start(n.progressOp);try{const o=await Mc(t,e,n);if(0===o.packBytes.length)return{packPath:"",idxPath:"",objectCount:0,packSha:"",shallow:o.shallow,unshallow:o.unshallow};const r=await Wc(o.packBytes,t),s=await zc(t,o.packBytes),i=await Qc(t,s,r),a=await Zc(t,o.packBytes,i,r,s.length,!0===n.promisor);return function(t){Ti.get(t)?.refresh()}(t),{...a,shallow:o.shallow,unshallow:o.unshallow}}finally{t.progress.end(n.progressOp)}},Mc=async(e,n,o)=>{const r=(e=>{if(0===e.wants.length)throw new t({code:"EMPTY_WANTS"});const n=[];e.wants.forEach((t,o)=>{n.push(((t,e)=>{const n=0===e.length?"":` ${e.join(" ")}`;return vn.encode(`want ${t}${n}\n`)})(t,0===o?e.capabilities:[]))}),void 0!==e.depth&&n.push(vn.encode(`deepen ${e.depth}\n`)),void 0!==e.filter&&n.push(vn.encode(`filter ${e.filter}\n`));const o=dn(n),r=0===e.haves.length?new Uint8Array(0):dn(e.haves.map(On)),s=e.done?Sn:new Uint8Array(0),i=new Uint8Array(o.byteLength+r.byteLength+s.byteLength);let a=0;return i.set(o,a),a+=o.byteLength,i.set(r,a),a+=r.byteLength,i.set(s,a),i})({wants:o.wants,haves:o.haves,capabilities:o.capabilities,done:!0,...void 0!==o.depth?{depth:o.depth}:{},...void 0!==o.filter?{filter:o.filter}:{}}),s=Fc(o.url),i=await n.request({url:s,method:"POST",headers:{"content-type":"application/x-git-upload-pack-request",accept:"application/x-git-upload-pack-result"},body:r,...void 0!==e.signal?{signal:e.signal}:{}});if(200!==i.statusCode)throw h(i.statusCode,`git-upload-pack returned ${i.statusCode}`);const a=fn($(i.body)),c=await(async(t,e)=>{const n=t[Symbol.asyncIterator](),o=!0===e.expectShallow?await(async t=>{const e={shallow:[],unshallow:[]};let n=await t.next();for(;!n.done;){if("data"!==n.value.kind)return{shallow:e.shallow,unshallow:e.unshallow};const o=yn.decode(n.value.payload);if(!Mn(o,e))return Rn.set(t,n.value),{shallow:e.shallow,unshallow:e.unshallow};n=await t.next()}return{shallow:e.shallow,unshallow:e.unshallow}})(n):{shallow:[],unshallow:[]},r=await(async t=>{const e=[];let n=!1;const o=Rn.get(t);void 0!==o&&Rn.delete(t);let r=void 0!==o?{done:!1,value:o}:await t.next();for(;!r.done;){if("data"!==r.value.kind)return{acks:e,nak:n,buffered:[r.value]};const o=yn.decode(r.value.payload);if(o.startsWith("ACK "))e.push(Tn(o)),r=await t.next();else{if(!o.startsWith("NAK"))return{acks:e,nak:n,buffered:[r.value]};n=!0,r=await t.next()}}return{acks:e,nak:n,buffered:[]}})(n);return{acks:r.acks,nak:r.nak,shallow:o.shallow,unshallow:o.unshallow,packBody:{[Symbol.asyncIterator]:()=>async function*(t,e,n){const o=async function*(t,e){for(const e of t)yield e;let n=await e.next();for(;!n.done;)yield n.value,n=await e.next()}(t,e);if(n.sideBand){const t=n.onProgress?{onProgress:n.onProgress}:{};return void(yield*mn(o,t))}yield*async function*(t){for await(const e of t){if("data"!==e.kind)return;yield e.payload}}(o)}(r.buffered,n,e)}}})(a,{sideBand:Bc(o.capabilities),onProgress:t=>e.progress.update(o.progressOp,0,void 0,w(t)),expectShallow:void 0!==o.depth});return{packBytes:await Rc(e,o,c.packBody),shallow:c.shallow,unshallow:c.unshallow}},Rc=async(t,e,n)=>{const o=t.config?.maxResponseBytes??536870912,r=[];let s=0,i=0;for await(const a of n){if(s+a.byteLength>o)throw Pc(o);r.push(a),s+=a.byteLength,s-i>=65536&&(t.progress.update(e.progressOp,s),i=s)}0!==s&&s!==i&&t.progress.update(e.progressOp,s);const a=new Uint8Array(s);let c=0;for(const t of r)a.set(t,c),c+=t.byteLength;return a},Pc=e=>new t({code:"PACK_TOO_LARGE",objectCount:0,limit:e}),Fc=t=>{let e;try{e=new URL(t)}catch{throw Ke("invalid URL")}if(""!==e.hash)throw Ke("fragment must not be set");const n=e.pathname.endsWith("/")?e.pathname.slice(0,-1):e.pathname;return`${e.protocol}//${e.host}${n}/git-upload-pack${e.search}`},Bc=t=>t.some(t=>_c.has(t)),Wc=async(t,e)=>{const n=e.hash.digestLength;if(t.length<12+n)throw go("trailer mismatch: pack too short for header + trailer");const o=t.length-n,r=t.subarray(0,o),s=t.subarray(o),i=await e.hash.hashHex(r),a=nt(s);if(i!==a)throw go(`trailer mismatch: expected ${i}, got ${a}`);return i},zc=async(t,e,n)=>{const o=await jc(t,e);return(await Hc(t,o,n)).slice().sort((t,e)=>t.offset-e.offset).map(t=>({id:t.id,crc32:t.crc32,offset:t.offset}))},jc=async(e,n)=>{const o=function(t){if(t.length<12)throw go("truncated: pack header requires 12 bytes");const e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint32(0);if(n!==Lo)throw go(`invalid magic: expected 0x5041434b, got 0x${n.toString(16).padStart(8,"0")}`);const o=e.getUint32(4);if(2!==o)throw go(`unsupported version: expected 2, got ${o}`);return{version:o,objectCount:e.getUint32(8)}}(n),r=e.config?.maxObjectsPerPack??5e7;if(o.objectCount>r)throw new t({code:"PACK_TOO_LARGE",objectCount:o.objectCount,limit:r});const s=n.length-e.hash.digestLength,i=[];let a=12;for(let t=0;t<o.objectCount;t+=1){const t=Do(n,a,e.hashConfig),o=await e.compressor.streamInflate(n,t.dataOffset),r=t.dataOffset+o.bytesConsumed;if(r>s)throw go("entry extends past pack trailer");const c=K(n.subarray(a,r));i.push({offset:a,header:t,inflated:o.output,crc32:c}),a=r}if(a!==s)throw go("extra bytes between last entry and trailer");return i},Hc=async(t,e,n)=>{const o=new Map,r=new Map;let s=e;for(;s.length>0;){const e=[];let i=!1;for(const a of s){const s=await Gc(t,a,o,r,n);void 0===s?e.push(a):(o.set(s.offset,s),r.set(s.id,s),i=!0)}if(!i)throw Kc(e);s=e}return[...o.values()]},Kc=t=>{const e=t[0];if(void 0===e)return go("unresolved deltas: empty queue (internal invariant violated)");const n=Vc(e.header);return go(void 0!==n?`unresolved REF_DELTA: base ${n} not in pack`:`unresolved entry at offset ${e.offset}`)},Vc=t=>{if(!qc(t)&&6!==t.type)return t.baseId},Gc=async(t,e,n,o,r)=>{if(qc(e.header)){const n=Xc(e.header.type);return{id:await Jc(t,n,e.inflated),type:n,content:e.inflated,crc32:e.crc32,offset:e.offset}}if(6===e.header.type){const o=e.offset-e.header.baseDistance;if(o<12)throw go(`OFS_DELTA at offset ${e.offset} points before pack body: distance ${e.header.baseDistance}`);const r=n.get(o);if(void 0===r)return;return Yc(t,e,r)}const s=o.get(e.header.baseId);if(void 0!==s)return Yc(t,e,s);if(void 0===r)return;const i=await r(e.header.baseId);return void 0!==i?Yc(t,e,{type:i.type,content:i.content}):void 0},Yc=async(t,e,n)=>{const o=$o(n.content,e.inflated);return{id:await Jc(t,n.type,o),type:n.type,content:o,crc32:e.crc32,offset:e.offset}},qc=t=>1===t.type||2===t.type||3===t.type||4===t.type,Xc=t=>{switch(t){case 1:return"commit";case 2:return"tree";case 3:return"blob";case 4:return"tag"}},Jc=async(t,e,n)=>{const o=Uc.encode(`${e} ${n.length}\0`),r=new Uint8Array(o.length+n.length);return r.set(o,0),r.set(n,o.length),t.hash.hashHex(r)},Qc=async(t,e,n)=>{const o=function(t,e){if(20!==e.length)throw mo(`packChecksum must be 20 bytes, got ${e.length}`);const n=t.map(t=>({shaBytes:ot(t.id),entry:t}));n.sort((t,e)=>st(t.shaBytes,e.shaBytes));const o=n.length;let r=0;for(const t of n)t.entry.offset>2147483647&&(r+=1);const s=20*o,i=4*o,a=4*o,c=1032+s+i+a+8*r+20,d=new Uint8Array(c),u=new DataView(d.buffer);u.setUint32(0,4285812579),u.setUint32(4,2);const f=new Uint32Array(256);for(const{shaBytes:t}of n)f[t[0]]+=1;const l=new Uint32Array(256);let h=0;for(let t=0;t<256;t++)h+=f[t],l[t]=h;for(let t=0;t<256;t++)u.setUint32(8+4*t,l[t]);for(let t=0;t<o;t++)d.set(n[t].shaBytes,1032+20*t);const w=1032+s;for(let t=0;t<o;t++)u.setUint32(w+4*t,n[t].entry.crc32);const p=w+i;let g=0;const m=p+a;for(let t=0;t<o;t++){const e=n[t].entry.offset;if(e>2147483647){u.setUint32(p+4*t,2147483648|g);const n=Math.floor(e/4294967296),o=e>>>0;u.setUint32(m+8*g,n),u.setUint32(m+8*g+4,o),g+=1}else u.setUint32(p+4*t,e)}return d.set(e,c-20),d}(e.map(t=>({id:t.id,crc32:t.crc32,offset:t.offset})),ot(n)),r=ot(await t.hash.hashHex(o)),s=new Uint8Array(o.length+r.length);return s.set(o,0),s.set(r,o.length),s},Zc=async(t,e,n,o,r,s)=>{const i=`${t.layout.gitDir}/objects/pack`;await t.fs.mkdir(i);const a=`${i}/pack-${o}.pack`,c=`${i}/pack-${o}.idx`;return await t.fs.writeExclusive(a,e),await t.fs.writeExclusive(c,n),s&&await t.fs.writeExclusive(`${i}/pack-${o}.promisor`,new Uint8Array(0)),{packPath:a,idxPath:c,objectCount:r,packSha:o}},td=t=>{if(t.signal?.aborted)throw i()},ed=async(e,n,o)=>{try{return((t,e,n)=>({ok:!0,id:e,type:n.type,size:Mt(n,t.hashConfig),object:n}))(e,n,await Ni(e,n,o))}catch(e){if((e=>e instanceof t&&"OBJECT_NOT_FOUND"===e.data.code)(e))return(t=>({ok:!1,id:t,reason:"missing"}))(n);throw e}};async function*nd(t,e,n){const o=void 0===n?.maxBytes?void 0:{maxBytes:n.maxBytes};for await(const n of e){td(t);const e=await ed(t,n,o);yield e,td(t)}}const od=async(t,e,n,o)=>{const r=await rr(t,e,n,o);if(void 0!==r)throw p(r.key,r.source,r.line)},rd=(t,e)=>{const n=`${e.gitDir}/hooks`;return void 0===t?n:""===t?`${e.gitDir}/.tsgit-no-hooks`:t.startsWith("~/")?void 0===e.homeDir?n:`${e.homeDir}/${t.slice(2)}`:(o=t).startsWith("/")||/^[A-Za-z]:[\\/]/.test(o)?t:$s(e.workDir,t);var o},sd=async(t,e,n)=>{const o=t.hooks;if(void 0===o)return;await od(t,"core",void 0,["hookspath"]);const r=await Qo(t),s={name:e,hooksDir:rd(r.core?.hooksPath,t.layout),workDir:t.layout.workDir,gitDir:t.layout.gitDir,args:n.args??[],stdin:n.stdin??"",...void 0!==t.signal?{signal:t.signal}:{}};return o.run(s)},id=async(t,e,n={})=>{const o=await sd(t,e,n);if(void 0!==o&&"skipped"!==o.kind&&0!==o.exitCode)throw g(e,o.exitCode,o.stderr)},ad=async(t,e,n={})=>{await sd(t,e,n)};async function cd(t,e){if(e.length>X)throw M(e.length,X);return La(t,{type:"tree",id:"",entries:e})}const dd=t=>{let e=0;for(const n of t)"/"===n&&(e+=1);if(e>4096)throw N(e)},ud=async(t,e)=>{const{files:n,subdirs:o}=(t=>{const e=[],n=new Map;for(const o of t){const t=o.path.indexOf("/");if(-1===t){e.push(o);continue}const r=o.path.slice(0,t),s=o.path.slice(t+1),i=n.get(r),a={path:s,id:o.id,mode:o.mode};void 0===i?n.set(r,[a]):i.push(a)}return{files:e,subdirs:n}})(e),r=[];for(const t of n)r.push({name:t.path,id:t.id,mode:t.mode});for(const[e,n]of o){const o=await ud(t,n);r.push({name:e,id:o,mode:P.DIRECTORY})}return cd(t,r)},fd=async(t,e)=>ud(t,(t=>{const e=[];for(const n of t)0===n.flags.stage&&(Wt(n.path,-1),dd(n.path),e.push({path:n.path,id:n.id,mode:n.mode}));return e})(e)),ld=t=>"unchanged"!==t&&"absent"!==t,hd=new TextEncoder,wd=async(t,e,n)=>{const o=$s(t.layout.workDir,e.path),r=await t.fs.lstat(o).catch(()=>{});if(void 0===r)return{status:"absent"};const s=j(r);if(e.mode!==P.GITLINK&&!Yt(s,e.mode))return{status:"type-changed",worktreeMode:s};try{const i=r.isSymbolicLink?hd.encode(await t.fs.readlink(o)):await t.fs.read(o),a=r.isSymbolicLink||void 0===n||void 0===t.command?i:await(async(t,e,n,o,r)=>{const s=await Pi(t,n,o);if("external"!==s.kind||void 0===s.clean)return r;const i=await Fi(t,e,s.clean,r);return i.ok?i.bytes:r})(t,t.command,n,e.path,i),{id:c}=await js(t,{type:"blob",id:"",content:a});return c!==e.id?{status:"modified",worktreeMode:s}:{status:s===e.mode?"unchanged":"mode-changed",worktreeMode:s}}catch{return{status:"modified",worktreeMode:s}}},pd=async(t,e,n)=>(await wd(t,e,n)).status;async function gd(t,e){if(e.message.includes("\0"))throw A("message contains NUL");if(n=e.message,(new TextEncoder).encode(n).byteLength>16777216)throw A("message exceeds 16 MiB");var n;if(void 0!==e.gpgSignature&&ni(e.gpgSignature))throw A("gpgSignature contains header-boundary chars");if(void 0!==e.extraHeaders)for(const t of e.extraHeaders){if(oi(t.key))throw A("extraHeader key contains forbidden characters");if(ni(t.value))throw A("extraHeader value contains header-boundary chars")}return yt(e.author),yt(e.committer),La(t,{type:"commit",id:"",data:{tree:e.tree,parents:e.parents,author:e.author,committer:e.committer,message:e.message,...void 0!==e.gpgSignature?{gpgSignature:e.gpgSignature}:{},extraHeaders:e.extraHeaders??[]}})}const md=t=>`${t.layout.gitDir}/shallow`,yd=e=>e instanceof t&&"FILE_NOT_FOUND"===e.data.code,vd=async t=>{let e;try{e=await t.fs.readUtf8(md(t))}catch(t){if(yd(t))return new Set;throw t}const n=new Set;for(const t of e.split("\n")){const e=t.trim();0!==e.length&&kd(e)&&n.add(kt.from(e))}return n},bd=/^[0-9a-f]{40}([0-9a-f]{24})?$/i,kd=t=>bd.test(t),xd=async(t,e)=>{const n=new Set(await vd(t));for(const t of e.shallow)n.add(t);for(const t of e.unshallow)n.delete(t);const o=md(t);if(0===n.size)return void await Id(t,o);const r=[...n].sort(),s=(new TextEncoder).encode(r.map(t=>`${t}\n`).join(""));await Ed(t,o,s)},Ed=async(t,e,n)=>{const o=(t=>`${t.layout.gitDir}/shallow.lock`)(t);await t.fs.writeExclusive(o,n);try{await t.fs.rename(o,e)}catch(e){try{await t.fs.rm(o)}catch(t){if(!yd(t))throw t}throw e}},Id=async(t,e)=>{try{await t.fs.rm(e)}catch(t){if(yd(t))return;throw t}},$d=(t,e)=>{const n=e.toLowerCase();if(""===t.section&&void 0===t.subsection)return n;const o=t.section.toLowerCase();return void 0===t.subsection?`${o}.${n}`:`${o}.${t.subsection}.${n}`},Ld=(t,e)=>t.section.toLowerCase()===e.section&&(void 0===e.subsection?void 0===t.subsection:t.subsection===e.subsection),Dd=(t,e)=>{const n=[];for(const o of t)if(Ld(o,e))for(const t of o.entries)t.key.toLowerCase()===e.name&&n.push({value:t.value});return n},Cd=["system","global","local","worktree"],Ad=async(t,e)=>{try{return await t.fs.exists(e)}catch{return!1}},Od=(e,n)=>{try{return n()}catch(n){if(n instanceof t&&"UNSUPPORTED_OPERATION"===n.data.code)throw m(e,"browser-adapter");throw n}},Sd=async(e,n)=>{if("local"===n)return`${Wo(e)}/config`;if("worktree"===n){if(!await(async e=>{const n=`${Wo(e)}/config`,o=await(async(e,n)=>{try{return await e.fs.readUtf8(n)}catch(e){if(e instanceof t&&"FILE_NOT_FOUND"===e.data.code)return;throw e}})(e,n);if(void 0===o)return!1;const r=kr(o,n);for(const t of r)if("extensions"===t.section.toLowerCase()&&void 0===t.subsection)for(const e of t.entries)if("worktreeconfig"===e.key.toLowerCase())return"true"===e.value;return!1})(e))throw m("worktree","worktree-extension-unset");return`${e.layout.gitDir}/config.worktree`}if("global"===n){const t=Od("global",()=>e.fs.xdgConfigHome()),n=Od("global",()=>e.fs.homedir()),o=`${t}/git/config`;if(await Ad(e,o))return o;const r=`${n}/.gitconfig`;return await Ad(e,r),r}const o=Od("system",()=>e.fs.systemConfigPath());if(0===o.length)throw y();return o};let Td=new WeakMap;const Ud=t=>{Td.delete(t)},_d=(e,n)=>{const o=(t=>{const e=Td.get(t);if(void 0!==e)return e;const n=new Map;return Td.set(t,n),n})(e),r=o.get(n);if(void 0!==r)return r;const s=(async(e,n)=>{const o=await Sd(e,n);try{const t=await e.fs.readUtf8(o);return kr(t,o)}catch(e){if(e instanceof t){const t=e.data.code;if("FILE_NOT_FOUND"===t||"PERMISSION_DENIED"===t)return[]}throw e}})(e,n);return o.set(n,s),s},Nd=async(e,n)=>{try{return{scope:n,sections:await _d(e,n)}}catch(e){if(e instanceof t){const t=e.data.code;if("CONFIG_SCOPE_NOT_AVAILABLE"===t)return;if("CONFIG_SYSTEM_PATH_UNRESOLVED"===t)return}throw e}},Md=async({ctx:t,scope:e})=>{if(void 0!==e)return(await _d(t,e)).map(t=>({scope:e,section:t}));const n=[];for(const e of Cd){const o=await Nd(t,e);void 0!==o&&n.push(o)}return(t=>{const e=new Map;for(const{scope:n,sections:o}of t)e.set(n,o);const n=[];for(const t of Cd){const o=e.get(t);if(void 0!==o)for(const e of o)n.push({scope:t,section:e})}return n})(n)},Rd=async(t,e,n)=>{if(void 0!==n){const o=await _d(t,n);return Dd(o,e).map(t=>({value:t.value,scope:n}))}return((t,e)=>{const n=[];for(const{scope:o,section:r}of t)if(Ld(r,e))for(const t of r.entries)t.key.toLowerCase()===e.name&&n.push({value:t.value,scope:o});return n})((await Md({ctx:t})).map(({scope:t,section:e})=>({scope:t,section:e})),e)},Pd=async({ctx:t,key:e,scope:n})=>{const o=q(e),r=await Rd(t,o,n);if(0===r.length)return{key:e,value:void 0};if(r.length>1)throw v(e,r.length,"read",n);const[s]=r;return{key:e,value:s.value,scope:s.scope}},Fd=async({ctx:t,key:e,scope:n})=>{const o=q(e);return{key:e,values:await Rd(t,o,n)}},Bd=(t,e)=>`\t${t} = ${(t=>{const e=t.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll("\n","\\n").replaceAll("\t","\\t");return(t=>t.startsWith(" ")||t.endsWith(" ")||t.includes(";")||t.includes("#")||t.includes("\r"))(t)?`"${e}"`:e})(e)}`,Wd=(t,e)=>void 0===e?`[${t}]`:`[${t} "${(t=>t.replaceAll("\\","\\\\").replaceAll('"','\\"'))(e)}"]`,zd=(t,e)=>{if(/[\n\r\0]/.test(e))throw n("config",`${t} must not contain a newline or NUL`)},jd=t=>{if(t.includes("\0"))throw n("config","value must not contain a NUL byte")},Hd=t=>{if(/[\n\0]/.test(t))throw n("config","subsection must not contain a newline or NUL")},Kd=t=>{if(/[\s\0[\]"\\]/.test(t))throw n("config","section must not contain whitespace, NUL, brackets, quotes, or backslashes")},Vd=(t,e)=>{if(""===t&&void 0===e)throw n("config","section name must not be empty without a subsection")},Gd=t=>void 0===t.subsection?t.section:`${t.section}.${t.subsection}`,Yd=t=>{const e=Tr(t);if("header"===e.parse.kind)return{rawName:Gd(e.parse),endOffset:e.endOffset}},qd=(t,e)=>{for(let n=0;n<t.length;n+=1)if(Yd(t[n])?.rawName===e)return n;return-1},Xd=(t,e)=>{const n=t.split("\n"),o=[];let r=!1;for(const t of n){const n=Yd(t);void 0===n||(r=n.rawName===e),r||o.push(t)}return((t,e)=>""===t[t.length-1]&&e.length>0&&""!==e[e.length-1]?[...e,""]:e)(n,o).join("\n")},Jd=(t,e,n)=>{Kd(n.section),Vd(n.section,n.subsection),void 0!==n.subsection&&Hd(n.subsection);const o=t.split("\n").map(t=>{const o=Yd(t);return void 0===o||o.rawName!==e?t:((t,e,n)=>{const o=Wd(n.section,n.subsection),r=br(t,e);return r>=t.length?o:`${o}\n\t${t.slice(r)}`})(t,o.endOffset,n)});return o.join("\n")},Qd=async(e,n)=>{try{return await e.fs.readUtf8(n)}catch(e){if(e instanceof t&&"FILE_NOT_FOUND"===e.data.code)return"";throw e}},Zd=async({ctx:t,oldName:e,newName:o,scope:r})=>{const s=(t=>{if(""===t)throw n("config",`invalid section name: ${t}`);const e=t.indexOf("."),o=-1===e?t:t.slice(0,e);if(o.length>0&&!/^[a-zA-Z0-9-]+$/.test(o))throw n("config",`invalid section name: ${t}`);return-1===e?{section:o}:{section:o,subsection:t.slice(e+1)}})(o);void 0!==s.subsection&&Hd(s.subsection);const i=r??"local",a=await Sd(t,i),c=await Qd(t,a);if(-1===qd(c.split("\n"),e))throw b(e,i);const d=Jd(c,e,s);await t.fs.writeUtf8(a,d),tr(t),Ud(t)},tu=async({ctx:t,sectionName:e,scope:n})=>{const o=n??"local",r=await Sd(t,o),s=await Qd(t,r);if(-1===qd(s.split("\n"),e))throw b(e,o);const i=Xd(s,e);await t.fs.writeUtf8(r,i),tr(t),Ud(t)},eu=(t,e)=>({sectionLc:t.toLowerCase(),subsection:e}),nu=(t,e)=>t.section.toLowerCase()===e.sectionLc&&t.subsection===e.subsection,ou=(t,e)=>{let n,o,r=!1;for(const s of t)"header"===s.kind?(r&&(n=o),r=nu(s,e),o=r?s.line+1:void 0):r&&"entry"===s.kind&&(o=s.endLine);return r&&(n=o),n},ru=(t,e,n,o)=>{const r=o.endsWith("\n")?t.length-1:t.length,s=Math.min(e,r),i=[...t.slice(0,s),n,...t.slice(s)];return s===t.length&&i.push(""),i},su=(t,e,n,o,r)=>{Kd(e),Vd(e,n),zd("key",o),jd(r),void 0!==n&&Hd(n);const s=t.split("\n"),i=wr(s,t.endsWith("\n")),a=eu(e,n),c=((t,e,n)=>{const o=n.toLowerCase();let r=!1;for(const n of t)if("header"===n.kind)r=nu(n,e);else if(r&&"entry"===n.kind&&n.key.toLowerCase()===o)return n})(i,a,o);if(void 0!==c)return((t,e,n,o)=>{const r=n.sharesHeaderLine?((t,e)=>{for(const n of t)if("header"===n.kind&&n.line===e.startLine)return n})(e,n):void 0,s=void 0!==r?[Wd(r.section,r.subsection),o]:[o],i=[...t.slice(0,n.startLine),...s,...t.slice(n.endLine)];return(n.endLine===t.length?[...i,""]:i).join("\n")})(s,i,c,Bd(o,r));const d=ou(i,a);return void 0===d?`${""===t?"":t.endsWith("\n")?t:`${t}\n`}${Wd(e,n)}\n${Bd(o,r)}\n`:ru(s,d,Bd(o,r),t).join("\n")},iu=(t,e,n)=>su(t,"core",void 0,e,n),au=t=>[t.header.line,...t.bodyTokens.flatMap(t=>"entry"===t.kind?cu([t]):[t.line])],cu=t=>t.flatMap(t=>Array.from({length:t.endLine-t.startLine},(e,n)=>t.startLine+n)),du=(t,e,n,o)=>{Kd(e),void 0!==n&&Hd(n),zd("key",o);const r=t.split("\n"),s=eu(e,n),i=(t=>{const e=[];for(let n=0;n<t.length;n++){const o=t[n];if("header"!==o.kind)continue;const r=[];let s=n+1;for(;s<t.length&&"header"!==t[s].kind;)r.push(t[s]),s++;e.push({header:o,bodyTokens:r}),n=s-1}return e})(wr(r,t.endsWith("\n"))),a=o.toLowerCase(),c=i.filter(t=>nu(t.header,s)).map(t=>((t,e)=>{const n=((t,e)=>t.bodyTokens.flatMap(t=>"entry"===t.kind&&t.key.toLowerCase()===e?[{startLine:t.startLine,endLine:t.endLine}]:[]))(t,e);return 0===n.length?{excluded:[]}:((t,e)=>t.header.hasComment||t.bodyTokens.some(t=>"comment"===t.kind||"entry"===t.kind&&t.key.toLowerCase()!==e))(t,e)?n.some(e=>e.startLine===t.header.line)?{excluded:cu(n).filter(e=>e!==t.header.line),headerRewrite:{line:t.header.line,text:Wd(t.header.section,t.header.subsection)}}:{excluded:cu(n)}:{excluded:au(t)}})(t,a));return((t,e)=>{const n=new Set(e.flatMap(t=>t.excluded)),o=new Map(e.flatMap(t=>t.headerRewrite?[[t.headerRewrite.line,t.headerRewrite.text]]:[]));if(0===n.size&&0===o.size)return;const r=[];for(const[e,s]of t.entries())n.has(e)||r.push(o.get(e)??s);return(n.has(t.length-1)?[...r,""]:r).join("\n")})(r,c)??t},uu=async(t,e)=>{const n=`${t.layout.gitDir}/config`,o=await Qd(t,n);pu(o,n);const r=e.reduce((t,e)=>su(t,e.section,e.subsection,e.key,e.value),o);await t.fs.writeUtf8(n,r),tr(t)},fu=async(t,e)=>{await uu(t,Object.entries(e).map(([t,e])=>({section:"core",key:t,value:e})))},lu=(t,e)=>"set"===e.kind?su(t,e.section,e.subsection,e.key,e.value):"appendEntry"===e.kind?hu(t,e.section,e.subsection,e.key,e.value):"removeEntry"===e.kind?du(t,e.section,e.subsection,e.key):"removeSection"===e.kind?Xd(t,Gd({section:e.section,subsection:e.subsection})):Jd(t,Gd({section:e.section,subsection:e.from}),{section:e.section,subsection:e.to}),hu=(t,e,n,o,r)=>{Kd(e),Vd(e,n),zd("key",o),jd(r),void 0!==n&&Hd(n);const s=t.split("\n"),i=wr(s,t.endsWith("\n")),a=eu(e,n),c=ou(i,a);return void 0===c?`${""===t?"":t.endsWith("\n")?t:`${t}\n`}${Wd(e,n)}\n${Bd(o,r)}\n`:ru(s,c,Bd(o,r),t).join("\n")},wu=async(t,e)=>{const n=`${t.layout.gitDir}/config`,o=await Qd(t,n);pu(o,n);const r=e.reduce(lu,o);await t.fs.writeUtf8(n,r),tr(t)},pu=(e,n)=>{try{return kr(e,n)}catch(e){if(e instanceof t&&"CONFIG_PARSE_ERROR"===e.data.code&&void 0!==e.data.partialSectionName)throw x(e.data.partialSectionName,n);throw e}},gu=async({ctx:t,key:e,value:n,scope:o})=>{const r=q(e);((t,e)=>{for(let n=0;n<e.length;n+=1)if(0===e.charCodeAt(n))throw k(t,n)})(e,n);const s=o??"local";await(async(t,e)=>{const o=await Sd(t,e),s=await Qd(t,o);pu(s,o);const i=su(s,r.section,r.subsection,r.name,n);await t.fs.writeUtf8(o,i),tr(t),Ud(t)})(t,s)},mu=async({ctx:t,key:e,scope:n})=>{const o=q(e),r=n??"local",s=await Sd(t,r),i=await Qd(t,s),a=pu(i,s),c=Dd(a,o);if(0===c.length)return;if(c.length>1)throw v(e,c.length,"remove",r);const d=du(i,o.section,o.subsection,o.name);await t.fs.writeUtf8(s,d),tr(t),Ud(t)},yu=async({ctx:t,key:e,scope:n})=>{const o=q(e),r=n??"local",s=await Sd(t,r),i=await Qd(t,s),a=pu(i,s);if(0===Dd(a,o).length)return;const c=du(i,o.section,o.subsection,o.name);await t.fs.writeUtf8(s,c),tr(t),Ud(t)},vu=(t,e)=>e?t.data.parents.slice(0,1):t.data.parents;async function*bu(t,e){const n=e.shallow??new Set,o={queue:[],seen:new Set(e.from),until:new Set(e.until??[]),firstParent:e.firstParent??!1,read:ku(t,e)};for(await xu(o);o.queue.length>0;){if(t.signal?.aborted)throw i();const{value:e}=o.queue.shift();yield e,n.has(e.id)||await Eu(o,e)}}const ku=(t,e)=>{const n=e.verifyHash??!0,o=e.ignoreMissing??!1,r=new Set;return e=>xc(t,e,{verifyHash:n,ignoreMissing:o,missing:r})},xu=async t=>{for(const e of t.seen)t.until.has(e)||await Iu(t,e)},Eu=async(t,e)=>{for(const n of vu(e,t.firstParent))t.seen.has(n)||t.until.has(n)||(t.seen.add(n),await Iu(t,n))},Iu=async(t,e)=>{const n=await t.read(e);void 0!==n&&Na(t.queue,{oid:e,date:n.data.committer.timestamp,value:n})},$u=async e=>{const n=await Ta(e,"HEAD").catch(e=>{if(!(e instanceof t&&"REF_NOT_FOUND"===e.data.code))throw e});if(void 0===n)return;const o=await Ni(e,n);if("commit"!==o.type)throw _("commit",o.type,n);return Ja(e,o.data.tree)};async function Lu(t,e){const n=!1!==e?.includePacks,o=new Set;return await async function(t,e){const n=Wo(t);for(const o of Du){const r=Vo(n,o);if(!await t.fs.exists(r))continue;const s=await t.fs.readdir(r);for(const t of s)t.isFile&&e.add(`${o}${t.name}`)}}(t,o),n&&await async function(t,e){const n=_i(t),o=await n.all();for(const t of o)for(const n of Ro(t.index))e.add(n)}(t,o),[...o].sort()}const Du=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0")),Cu=/^[A-Za-z]:/,Au=t=>{if(t.startsWith("-"))return!0;if(t.includes("\\"))return!0;if((t=>{for(let e=0;e<t.length;e+=1){const n=t.charCodeAt(e);if(n<=31)return!0;if(127===n)return!0}return!1})(t))return!0;if(Cu.test(t))return!0;for(const e of t.split("/")){if(""===e)return!0;if("."===e)return!0;if(".."===e)return!0}return!1},Ou=(t,e)=>void 0!==e?{...t,stage:0,skipWorktree:!1}:{...t,stage:0},Su=(t,e)=>t.path<e.path?-1:t.path>e.path?1:0,Tu=async(t,e)=>{const n=(t=>{const e=new Map;for(const n of t.entries)0===n.flags.stage&&e.set(n.path,n);return e})(e.currentIndex),o=await(async(t,e)=>{const n=[];for await(const o of Xi(t,e))o.mode!==P.DIRECTORY&&n.push({path:o.path,id:o.id,mode:o.mode});return n})(t,e.targetTree),r=o.map(t=>((t,e,n)=>{if(void 0!==n&&!n(t.path))return tt(t);const o=e.get(t.path);return void 0!==o&&o.id===t.id&&o.mode===t.mode?{...o,flags:Ou(o.flags,n)}:(t=>({ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:t.mode,uid:0,gid:0,fileSize:0,id:t.id,flags:Z,path:t.path}))(t)})(t,n,e.sparse));return r.sort(Su),r};async function*Uu(t,e){const n={emitted:new Set,cap:e.maxObjects??us},o=await(async(t,e,n)=>{const o=[];for(const r of n){const n=await kc(t,r,t=>{bc(e,t)});o.push(n)}return o})(t,n,e.wants);for(const t of n.emitted)yield t;yield*async function*(t,e,n,o){for await(const r of Ic(t,{from:n,until:o,ignoreMissing:!0})){bc(e,r.id)&&(yield r.id),bc(e,r.data.tree)&&(yield r.data.tree);for await(const n of Xi(t,r.data.tree,{recursive:!0}))ui(n.mode)||bc(e,n.id)&&(yield n.id)}}(t,n,o,e.haves)}const _u=async(t,e,n={})=>{if(t.signal?.aborted)throw i();if(e.byteLength>cs)throw E("(hashBlob-content)",e.byteLength,cs);const{id:o}=await js(t,{type:"blob",content:e});return!0!==n.write?o:La(t,{type:"blob",id:o,content:e})},Nu={kind:"empty"},Mu=()=>({slots:Array.from({length:16},()=>Nu),preserved:[]}),Ru=t=>({kind:"internal",node:t}),Pu=(t,e,n)=>({...t,slots:t.slots.map((t,o)=>o===e?n:t)}),Fu=(t,e)=>Number.parseInt(t.charAt(e),16),Bu=t=>"note"===t.kind?t.key:t.prefix,Wu=(t,e,n)=>{const o=Bu(e),r=Fu(o,n),s=t.slots[r];if("empty"===s.kind)return Pu(t,r,e);if("internal"===s.kind)return Pu(t,r,Ru(Wu(s.node,e,n+1)));if(Bu(s)===o)return Pu(t,r,e);const i=Wu(Wu(Mu(),s,n+1),e,n+1);return Pu(t,r,Ru(i))},zu=(t,e,n)=>[...e.slice(n+1)].reduceRight((t,e)=>Ru(Pu(Mu(),Fu(e,0),t)),Ru(t)),ju=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/,Hu=/^[0-9a-f]{2}$/,Ku=(t,e)=>{const n=[];return{...t.reduce((t,o)=>{const r=((t,e)=>{const n=e+t.name;return!z(t.mode)&&ju.test(n)?{kind:"note",key:kt.from(n),val:t.id}:z(t.mode)&&Hu.test(t.name)?{kind:"subtree",prefix:n,oid:t.id}:null})(o,e);return null===r?(n.push(o),t):Wu(t,r,e.length)},Mu()),preserved:n}},Vu=t=>Ku(t,""),Gu=async(t,e)=>Ku(await e(t.oid),t.prefix);async function Yu(e,n){const o=new Map,r=t=>{const n=o.get(t);if(void 0!==n)return n;const r=async function(t,e){const n=await Ni(t,e);if("tree"!==n.type)throw _("tree",n.type,e);return n.entries}(e,t);return o.set(t,r),r},s=await Ta(e,n).catch(e=>{if(!(e instanceof t&&"REF_NOT_FOUND"===e.data.code))throw e});if(void 0===s)return{trie:Vu([]),read:r,notesCommitOid:void 0,notesTreeOid:void 0};const i=await Ni(e,s);if("commit"!==i.type)throw _("commit",i.type,s);const a=i.data.tree,c=await Ni(e,a);if("tree"!==c.type)throw _("tree",c.type,a);return{trie:Vu(c.entries),read:r,notesCommitOid:s,notesTreeOid:a}}const qu=async t=>{const e=await Ua(t,"HEAD"),n=await da(t);try{const o=await oa(t),r=await na(t,{targetTree:e.id,currentIndex:o});return await n.commit(r.newIndexEntries),r}finally{await n.release()}},Xu="refs/notes/",Ju=`${Xu}commits`,Qu=t=>{if(!t.startsWith(Xu))throw I(t);return t};async function Zu(t,e){if(void 0!==e)return Zn((t=>t.startsWith(Xu)?t:t.startsWith("notes/")?`refs/${t}`:`${Xu}${t}`)(e));const n=t.env?.get("GIT_NOTES_REF");if(void 0!==n)return Zn(Qu(n));const o=await Qo(t),r=o.core?.notesRef;return void 0!==r?Zn(Qu(r)):Ju}async function*tf(t,e){ef(e.from),yield*bu(t,e)}const ef=t=>{if(ti(t))throw l(Qs);if(ei(t))throw l(Zs)},nf=(t,e,n)=>{const o=`${t.layout.gitDir}/modules/${e}`,r=$s(t.layout.workDir,n),{promisor:s,hooks:i,...a}=t;return Object.freeze({...a,layout:Object.freeze({workDir:r,gitDir:o,bare:!1,...void 0!==t.layout.homeDir?{homeDir:t.layout.homeDir}:{}}),cwd:r})},of=async(t,e,n,o=new Set)=>{if(void 0===e)return;const r=`${t.layout.gitDir}/modules/${e}`;return!o.has(r)&&await t.fs.exists(`${r}/HEAD`)?nf(t,e,n):void 0},rf=(t,e,n)=>nf(t,e,n),sf=(t,e)=>{if(null===e.value)return t;const n=e.key.toLowerCase();return"path"===n?{...t,path:e.value}:"url"===n?{...t,url:e.value}:"update"===n?{...t,update:e.value}:"branch"===n?{...t,branch:e.value}:t},af=t=>{if("submodule"!==t.section)return;if(void 0===t.subsection)return;if(Au(t.subsection))return;const e=t.entries.reduce(sf,{});return{name:t.subsection,...void 0!==e.path?{path:e.path}:{},...void 0!==e.url?{url:e.url}:{},...void 0!==e.update?{update:e.update}:{},...void 0!==e.branch?{branch:e.branch}:{}}},cf=t=>{const e=[];for(const n of kr(t,".gitmodules")){const t=af(n);void 0!==t&&e.push(t)}return e},df=Et.from("HEAD"),uf=new TextDecoder;async function*ff(t,e){const n=e?.ref??df,o=!0===e?.recursive,r=e?.maxDepth??100,s=await Ua(t,n),i=new Set([t.layout.gitDir]);yield*lf(t,s,0,void 0,"",i,o,r)}async function*lf(t,e,n,o,r,s,i,a){const c=await wf(t,e);for await(const d of Xi(t,e,{recursive:!0})){if(d.mode!==P.GITLINK)continue;const e=ba(r,d.path),u=c.get(d.path);if(yield hf(u,d.path,d.id,e,n,o),!i)continue;if(n>=a)continue;const f=await of(t,u?.name,d.path,s);if(void 0===f)continue;const l=await pf(f,d.id);if(void 0===l)continue;const h=new Set(s).add(f.layout.gitDir);yield*lf(f,l,n+1,e,e,h,i,a)}}const hf=(t,e,n,o,r,s)=>({name:t?.name??e,path:o,commit:n,depth:r,...void 0!==t?.url?{url:t.url}:{},...void 0!==t?.branch?{branch:t.branch}:{},...void 0!==s?{parent:s}:{}}),wf=async(t,e)=>{const n=e.entries.find(t=>".gitmodules"===t.name);if(void 0===n)return new Map;if(n.mode!==P.REGULAR&&n.mode!==P.EXECUTABLE)return new Map;const o=await Mi(t,n.id,{maxBytes:fs}),r=uf.decode(o.content),s=new Map;for(const t of cf(r))void 0!==t.path&&s.set(t.path,t);return s},pf=async(e,n)=>{try{return await Ua(e,n)}catch(e){if(e instanceof t&&"OBJECT_NOT_FOUND"===e.data.code)return;throw e}},gf=(t,e)=>[...Array.from({length:e},(e,n)=>t.slice(2*n,2*n+2)),t.slice(2*e)].join("/"),mf=t=>Array.from({length:t.length/2},(e,n)=>t.slice(2*n,2*n+2)).join("/"),yf=async(t,e,n,o,r,s)=>{return"empty"===t.kind?[]:"note"===t.kind?[{name:gf(t.key,r),mode:P.REGULAR,oid:t.val}]:"internal"===t.kind?(await vf(t.node,n,o+1,r,s+(i=e,i.toString(16)))).entries:o<2*r?[{name:mf(t.prefix),mode:P.DIRECTORY,oid:t.oid}]:(await vf(await Gu(t,n),n,t.prefix.length,r,t.prefix)).entries;var i},vf=async(t,e,n,o,r)=>{const s=((t,e,n)=>e%2!=0||e>2*n?n:t.slots.every(t=>{return"subtree"===(e=t.kind)||"internal"===e;var e})?n+1:n)(t,n,o),i=[];for(const[o,a]of t.slots.entries())i.push(...await yf(a,o,e,n,s,r));const a=t.preserved.map(t=>((t,e)=>({name:""===e?t.name:`${mf(e)}/${t.name}`,mode:t.mode,oid:t.id}))(t,r));return{entries:[...i,...a]}};async function bf(t,e){const n=await((t,e,n=0,o=0)=>vf(t,e,n,o,""))(e.trie,e.read);return gd(t,{tree:await kf(t,n.entries),parents:void 0!==e.prevCommitOid?[e.prevCommitOid]:[],author:e.author,committer:e.author,message:e.message})}async function kf(t,e){const n=[],o=new Map;for(const t of e){const e=t.name.indexOf("/");if(-1===e)n.push({id:t.oid,mode:t.mode,name:t.name});else{const n=t.name.slice(0,e),r=t.name.slice(e+1),s=o.get(n)??[];s.push({name:r,mode:t.mode,oid:t.oid}),o.set(n,s)}}const r=[];for(const[e,n]of o){const o=await kf(t,n);r.push({id:o,mode:P.DIRECTORY,name:e})}return cd(t,St([...n,...r]))}const xf=async(t,e)=>{await t.fs.mkdir(`${t.layout.gitDir}/info`),await t.fs.writeUtf8(Yo(t.layout.gitDir),e)};export{to as $,gd as A,nd as B,Qt as C,Jt as D,Yt as E,It as F,Vt as G,ie as H,fe as I,ae as J,ge as K,le as L,X as M,oe as N,kt as O,ne as P,_e as Q,Et as R,Z as S,Ue as T,it as U,Gt as V,tn as W,Je as X,dn as Y,Xe as Z,qn as _,P as a,uu as a$,rr as a0,ar as a1,Qo as a2,aa as a3,da as a4,na as a5,pa as a6,zs as a7,Oa as a8,cs as a9,Wc as aA,zc as aB,Nt as aC,Dt as aD,ad as aE,bs as aF,fd as aG,Ms as aH,sr as aI,Ws as aJ,ld as aK,pd as aL,Ys as aM,Js as aN,Gs as aO,Xs as aP,kr as aQ,od as aR,En as aS,An as aT,fn as aU,ze as aV,Pe as aW,Fe as aX,en as aY,Nc as aZ,xd as a_,Pi as aa,Fi as ab,j as ac,T as ad,Vo as ae,Wo as af,_i as ag,Mo as ah,xs as ai,ps as aj,Bn as ak,Zn as al,Ja as am,Na as an,eo as ao,Xo as ap,Ho as aq,gs as ar,xt as as,kc as at,bc as au,N as av,ui as aw,us as ax,Lc as ay,mc as az,Ni as b,of as b$,Pd as b0,Fd as b1,Md as b2,$d as b3,tu as b4,Zd as b5,gu as b6,mu as b7,yu as b8,di as b9,Zu as bA,Yu as bB,bf as bC,S as bD,uc as bE,Qe as bF,wu as bG,Gi as bH,Hi as bI,ia as bJ,fu as bK,wo as bL,ao as bM,co as bN,xf as bO,po as bP,ms as bQ,is as bR,hs as bS,Hn as bT,A as bU,Tu as bV,rf as bW,qu as bX,lu as bY,fs as bZ,cf as b_,$u as ba,wd as bb,bu as bc,vu as bd,ds as be,as as bf,jo as bg,yi as bh,Au as bi,at as bj,st as bk,Ei as bl,ys as bm,Lu as bn,Ra as bo,Ma as bp,re as bq,tt as br,Fu as bs,Gu as bt,Pu as bu,Ru as bv,Wu as bw,zu as bx,Mu as by,Nu as bz,K as c,wi as c0,ls as c1,ba as c2,Be as c3,Uu as c4,Ke as c5,mn as c6,Fn as c7,Aa as c8,Ae as c9,Ju as ca,ra as cb,qi as cc,tr as cd,Ud as ce,vd as cf,su as cg,iu as ch,Yo as ci,Mi as d,Xi as e,z as f,ws as g,Ta as h,Ko as i,$s as j,cd as k,La as l,ff as m,tf as n,Ic as o,Is as p,id as q,oa as r,Bi as s,Ua as t,_ as u,Tc as v,ka as w,_u as x,Bo as y,lc as z};
|
|
2
|
-
//# sourceMappingURL=write-sparse-checkout-D4tNUXOp.js.map
|