@makaio/framework 1.0.0-dev-1783973359164 → 1.0.0-dev-1783977266352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.makaio-build.json +2 -2
- package/dist/{account-identity-BYfeWLe-.mjs → account-identity-CP4DC0DL.mjs} +1 -1
- package/dist/{adapter-nl_xz9dz.mjs → adapter-B9vVBwli.mjs} +1 -1
- package/dist/adapters/node.mjs +1 -1
- package/dist/bus/index.mjs +1 -1
- package/dist/{client-BkpLM8Fx.mjs → client-CzPCSeyE.mjs} +1 -1
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/artifact/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +1 -1
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/extension/index.d.mts +2 -2
- package/dist/contracts/extension/index.mjs +1 -1
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/harness/index.d.mts +1 -1
- package/dist/contracts/index.d.mts +61 -61
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/native-session-supervisor/index.mjs +1 -1
- package/dist/contracts/session/index.d.mts +2 -2
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/workflow/index.d.mts +2 -2
- package/dist/{definition-Bj9Vr16H.d.mts → definition-D7qCBmtc.d.mts} +1 -1
- package/dist/{extension-D4iKUUMG.mjs → extension-Cgg45Xk1.mjs} +1 -1
- package/dist/git/index.mjs +8 -8
- package/dist/{index-DHGW7dFf.d.mts → index-2PsDAhPN.d.mts} +8 -8
- package/dist/{index-CtjLeK1F.d.mts → index-BXWTilGs.d.mts} +1 -1
- package/dist/{index-DNkR5yTY.d.mts → index-BrAp9ntB.d.mts} +47 -47
- package/dist/{index-C2C1qH1Y.d.mts → index-CHjKP5G0.d.mts} +8 -8
- package/dist/{index-CVs0Qxks.d.mts → index-CSxfU0tB.d.mts} +4 -4
- package/dist/{index-Lp0T_V1W.d.mts → index-CidblQAY.d.mts} +6 -6
- package/dist/{index-BKZAAWo2.d.mts → index-Cq6rXKae.d.mts} +88 -88
- package/dist/{index-9g0agW_p.d.mts → index-D3Eek6kd.d.mts} +22 -22
- package/dist/{index-x2gFj3BK.d.mts → index-DMQlLz2W.d.mts} +9 -9
- package/dist/{index-COC9jCdc.d.mts → index-DmuGKvE2.d.mts} +4 -4
- package/dist/{index-BDr2Ba122.d.mts → index-MTvmxwiu2.d.mts} +1 -1
- package/dist/{index-ButbwvVY.d.mts → index-kqxUXYe7.d.mts} +6 -6
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/index.d.mts +2 -2
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/{lib-DymjnkAP.mjs → lib-DktBDEoY.mjs} +1 -1
- package/dist/{namespace-B0uZIZYT.d.mts → namespace-TLkZRkcU.d.mts} +20 -20
- package/dist/{namespace-CCZXyxSe.d.mts → namespace-dgNmx9g3.d.mts} +27 -27
- package/dist/{native-session-supervisor-CdtVGWA9.mjs → native-session-supervisor-Bgz-Q1WH.mjs} +1 -1
- package/dist/package.json +1 -1
- package/dist/{profile-D2m94ZYD.mjs → profile-BRi6K6am.mjs} +1 -1
- package/dist/runtime-node/index.mjs +1 -1
- package/dist/{schema-aOwmHxaF.d.mts → schema-CxN7d_MU.d.mts} +1 -1
- package/dist/{schemas-CoJCTFod2.d.mts → schemas-CIO03KSD2.d.mts} +8 -8
- package/dist/{schemas-BolSW7pQ.d.mts → schemas-DlCdlCEF.d.mts} +4 -4
- package/dist/{schemas-n9Ff6_RX.mjs → schemas-DyJHJ8Pm.mjs} +1 -1
- package/dist/semver-D3Y7uMEb.mjs +1 -0
- package/dist/services/context-rules/index.d.mts +3 -3
- package/dist/services/execution-target/index.d.mts +1 -1
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/harness/index.d.mts +3 -3
- package/dist/services/index.d.mts +16 -16
- package/dist/services/session/index.d.mts +4 -4
- package/dist/services/session/session-events/namespace.d.mts +1 -1
- package/dist/services/session/storage/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +1 -1
- package/dist/services/settings/namespace.d.mts +8 -8
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
- package/dist/services/subagent-template/index.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/{session-lRd8HZNZ.mjs → session-BxWogVkD.mjs} +1 -1
- package/dist/{transition-CwUIm1hJ.d.mts → transition-DjipYcC3.d.mts} +1 -1
- package/dist/{types-BaDYigzD.d.mts → types-DQsYUZwa.d.mts} +34 -34
- package/dist/{version-C1-VD-XL.mjs → version-BbWrAPld.mjs} +1 -1
- package/dist/workflow-engine/index.d.mts +46 -46
- package/package.json +2 -2
- package/dist/semver-BccS1s9R.mjs +0 -1
package/dist/git/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"../chunk-DTipWd-i.mjs";import{t as r}from"../supports-color-Dzp6WuF5.mjs";import{t as i}from"../quick-lru-BLaSzINB.mjs";import*as a from"node:fs/promises";import{readFile as o}from"node:fs/promises";import*as s from"node:path";import c,{normalize as l}from"node:path";import{createHash as u}from"node:crypto";import{GitHookSubjects as d}from"@makaio/framework/contracts";import{BaseService as f}from"@makaio/framework/service-base";import{FsSubjects as p}from"@makaio/framework/services/filesystem/namespace";import{GitSubjects as m,GitSubjects as h}from"@makaio/framework/services/git/namespace";import{promisify as ee}from"util";import{exec as
|
|
1
|
+
import{i as e,o as t,t as n}from"../chunk-DTipWd-i.mjs";import{t as r}from"../supports-color-Dzp6WuF5.mjs";import{t as i}from"../quick-lru-BLaSzINB.mjs";import*as a from"node:fs/promises";import{readFile as o}from"node:fs/promises";import*as s from"node:path";import c,{normalize as l}from"node:path";import{createHash as u}from"node:crypto";import{GitHookSubjects as d}from"@makaio/framework/contracts";import{BaseService as f}from"@makaio/framework/service-base";import{FsSubjects as p}from"@makaio/framework/services/filesystem/namespace";import{GitSubjects as m,GitSubjects as h}from"@makaio/framework/services/git/namespace";import{promisify as ee}from"util";import{exec as g,spawn as _}from"child_process";import{EventEmitter as te}from"node:events";import v from"path";import{FsSubjects as ne}from"@makaio/framework/services/filesystem";var y=n(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),b=n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=y(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),x=n(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=b()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),re=n(((t,n)=>{let i=e(`tty`),a=e(`util`);t.init=f,t.log=l,t.formatArgs=s,t.save=u,t.load=d,t.useColors=o,t.destroy=a.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{let e=r();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function o(){return`colors`in t.inspectOpts?!!t.inspectOpts.colors:i.isatty(process.stderr.fd)}function s(e){let{namespace:t,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${t} \u001B[0m`;e[0]=a+e[0].split(`
|
|
2
2
|
`).join(`
|
|
3
3
|
`+a),e.push(i+`m+`+n.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=c()+t+` `+e[0]}function c(){return t.inspectOpts.hideDate?``:new Date().toISOString()+` `}function l(...e){return process.stderr.write(a.formatWithOptions(t.inspectOpts,...e)+`
|
|
4
4
|
`)}function u(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function d(){return process.env.DEBUG}function f(e){e.inspectOpts={};let n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]}n.exports=b()(t);let{formatters:p}=n.exports;p.o=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts).split(`
|
|
5
5
|
`).map(e=>e.trim()).join(` `)},p.O=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts)}})),S=n(((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=x():t.exports=re()})),C=n((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0});let r=e(`fs`),i=n(S()).default(`@kwsites/file-exists`);function a(e,t,n){i(`checking %s`,e);try{let a=r.statSync(e);return a.isFile()&&t?(i(`[OK] path represents a file`),!0):a.isDirectory()&&n?(i(`[OK] path represents a directory`),!0):(i(`[FAIL] path represents something other than a file or directory`),!1)}catch(e){if(e.code===`ENOENT`)return i(`[FAIL] path is not accessible: %o`,e),!1;throw i(`[FATAL] %o`,e),e}}function o(e,n=t.READABLE){return a(e,(n&t.FILE)>0,(n&t.FOLDER)>0)}t.exists=o,t.FILE=1,t.FOLDER=2,t.READABLE=t.FILE+t.FOLDER})),w=n((e=>{function t(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,`__esModule`,{value:!0}),t(C())}))();const T=new WeakMap;function ie(...e){let t=new String(e);return T.set(t,e),t}function ae(e){return e instanceof String&&T.has(e)}function E(e){return T.get(e)??[]}var oe=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDeferred=e.deferred=void 0;function t(){let e,t,n=`pending`;return{promise:new Promise((n,r)=>{e=n,t=r}),done(t){n===`pending`&&(n=`resolved`,e(t))},fail(e){n===`pending`&&(n=`rejected`,t(e))},get fulfilled(){return n!==`pending`},get status(){return n}}}e.deferred=t,e.createDeferred=t})),se=t(S()),ce=oe();function*D(e,t){let n=t===`global`;for(let t of e)t.isGlobal===n&&(yield t)}const O=new Set([`--add`,`--edit`,`--remove-section`,`--rename-section`,`--replace-all`,`--unset`,`--unset-all`,`-e`]),k=new Set([`--get`,`--get-all`,`--get-color`,`--get-colorbool`,`--get-regexp`,`--get-urlmatch`,`--list`,`-l`]),A=new Set([`edit`,`remove-section`,`rename-section`,`set`,`unset`]),le=new Set([`get`,`get-color`,`get-colorbool`,`list`]);function j(e,t){for(let{name:n}of D(e,`task`)){if(O.has(n))return M(!0,t);if(k.has(n))return M(!1,t)}let n=t.at(0)?.toLowerCase();return n===void 0?null:A.has(n)?M(!0,t.slice(1)):le.has(n)?M(!1,t.slice(1)):t.length===1?M(!1,t):M(!0,t)}function M(e=!1,t=[]){let n=t.at(0)?.toLowerCase();return n===void 0?null:{isWrite:e,isRead:!e,key:n,value:t.at(1)}}function N(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function P(e){let t=e?.indexOf(`=`)||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function ue(e){for(let{name:t}of D(e,`task`))switch(t){case`--global`:return`global`;case`--system`:return`system`;case`--worktree`:return`worktree`;case`--local`:return`local`;case`--file`:case`-f`:return`file`}return`local`}function F({name:e}){if(e===`-c`||e===`--config`)return`inline`;if(e===`--config-env`)return`env`}function*I(e){for(let t of e){let e=F(t),n=e&&P(t.value);n&&(yield{...n,scope:e})}}function de(e,t,n){let r={read:[],write:[...I(t)]};return e===`config`&&fe(r,ue(t),j(t,n)),r}function fe(e,t,n){if(n===null)return;let r=N(t,n);n.isWrite?e.write.push(r):e.read.push(r)}const pe={short:new Map([[`c`,!0]])},me={short:new Map([[`C`,!0],[`P`,!1],[`h`,!1],[`p`,!1],[`v`,!1],...pe.short.entries()]),long:new Set([`attr-source`,`config-env`,`exec-path`,`git-dir`,`list-cmds`,`namespace`,`super-prefix`,`work-tree`])},L={clone:{short:new Map([[`b`,!0],[`j`,!0],[`l`,!1],[`n`,!1],[`o`,!0],[`q`,!1],[`s`,!1],[`u`,!0]]),long:new Set([`branch`,`config`,`jobs`,`origin`,`upload-pack`,`u`,`template`])},commit:{short:new Map([[`C`,!0],[`F`,!0],[`c`,!0],[`m`,!0],[`t`,!0]]),long:new Set([`file`,`message`,`reedit-message`,`reuse-message`,`template`])},config:{short:new Map([[`e`,!1],[`f`,!0],[`l`,!1]]),long:new Set([`blob`,`comment`,`default`,`file`,`type`,`value`])},fetch:{short:new Map,long:new Set([`upload-pack`])},init:{short:new Map,long:new Set([`template`])},pull:{short:new Map,long:new Set([`upload-pack`])},push:{short:new Map,long:new Set([`exec`,`receive-pack`])}},he={short:new Map,long:new Set};function ge(e){let t=L[e??``]??he;return{short:new Map([...pe.short.entries(),...t.short.entries()]),long:t.long}}function _e(e,t=me){if(e.startsWith(`--`)){let n=e.indexOf(`=`);if(n>2)return[{name:e.slice(0,n),value:e.slice(n+1),needsNext:!1}];let r=e.slice(2);return[{name:e,needsNext:t.long.has(r)}]}if(e.length===2){let n=e.charAt(1);return[{name:e,needsNext:t.short.get(n)===!0}]}return ve(e,t.short)}function ve(e,t){let n=e.slice(1).split(``),r=[];for(let i=0;i<n.length;i++){let a=n[i],o=t.get(a);if(o===void 0)return[{name:e,needsNext:!1}];if(o){let e=n.slice(i+1).join(``);if(e&&![...e].every(e=>t.has(e)))return r.push({name:`-${a}`,value:e,needsNext:!1}),r}r.push({name:`-${a}`,needsNext:o})}return r}function ye(e,t=[]){let n=0;for(;n<e.length;){let r=String(e[n]);if(!r.startsWith(`-`)||r.length<2)break;let i=_e(r),a=n+1;for(let n of i){let r={name:n.name,value:n.value,absorbedNext:!1,isGlobal:!0};n.needsNext&&r.value===void 0&&a<e.length&&(r.value=String(e[a]),r.absorbedNext=!0,a++),t.push(r)}n=a}return{flags:t,taskIndex:n}}function be(e,t,n=[]){let r=ge(t),i=[],a=[],o=0;for(;o<e.length;){let t=e[o];if(ae(t)){a.push(...E(t)),o++;continue}let s=String(t);if(s===`--`){for(let t=o+1;t<e.length;t++){let n=e[t];ae(n)?a.push(...E(n)):a.push(String(n))}break}if(!s.startsWith(`-`)||s.length<2){i.push(s),o++;continue}let c=_e(s,r),l=o+1;for(let t of c){let r={name:t.name,value:t.value,absorbedNext:!1,isGlobal:!1};t.needsNext&&r.value===void 0&&l<e.length&&!ae(e[l])&&(r.value=String(e[l]),r.absorbedNext=!0,l++),n.push(r)}o=l}return{flags:n,positionals:i,pathspecs:a}}function*xe({write:e}){for(let t of e)for(let e of we){let n=e(t.key);n&&(yield n)}}function Se(e,t,n=String(e)){let r=typeof e==`string`?RegExp(`\\s*${e.toLowerCase()}`):e;return function(e){if(r.test(e))return{category:t,message:`Configuring ${n} is not permitted without enabling ${t}`}}}function Ce(e,t){return Se(RegExp(`\\s*${e.toLowerCase().replace(/\./g,`(..+)?.`)}`),t,e)}const we=[Se(`alias`,`allowUnsafeAlias`),Se(`core.askPass`,`allowUnsafeAskPass`),Se(`core.editor`,`allowUnsafeEditor`),Se(`core.fsmonitor`,`allowUnsafeFsMonitor`),Se(`core.gitProxy`,`allowUnsafeGitProxy`),Se(`core.hooksPath`,`allowUnsafeHooksPath`),Se(`core.pager`,`allowUnsafePager`),Se(`core.sshCommand`,`allowUnsafeSshCommand`),Ce(`credential.helper`,`allowUnsafeCredentialHelper`),Ce(`diff.command`,`allowUnsafeDiffExternal`),Se(`diff.external`,`allowUnsafeDiffExternal`),Ce(`diff.textconv`,`allowUnsafeDiffTextConv`),Ce(`filter.clean`,`allowUnsafeFilter`),Ce(`filter.smudge`,`allowUnsafeFilter`),Ce(`gpg.program`,`allowUnsafeGpgProgram`),Se(`init.templateDir`,`allowUnsafeTemplateDir`),Ce(`merge.driver`,`allowUnsafeMergeDriver`),Ce(`mergetool.path`,`allowUnsafeMergeDriver`),Ce(`mergetool.cmd`,`allowUnsafeMergeDriver`),Ce(`protocol.allow`,`allowUnsafeProtocolOverride`),Ce(`remote.receivepack`,`allowUnsafePack`),Ce(`remote.uploadpack`,`allowUnsafePack`),Se(`sequence.editor`,`allowUnsafeEditor`)];function*Te(e,t){for(let n of t)for(let t of De){let r=t(e,n.name);r&&(yield r)}}function Ee(e,t,n,r=String(t)){let i=typeof t==`string`?RegExp(`\\s*${t.toLowerCase()}`):t,a=`Use of ${e?`${e} with option `:``}${r} is not permitted without enabling ${n}`;return function(t,r){if((!e||t===e)&&i.test(r))return{category:n,message:a}}}const De=[Ee(null,/--(upload|receive)-pack/,`allowUnsafePack`,`--upload-pack or --receive-pack`),Ee(`clone`,/^-\w*u/,`allowUnsafePack`),Ee(`clone`,`--u`,`allowUnsafePack`),Ee(`push`,`--exec`,`allowUnsafePack`),Ee(null,`--template`,`allowUnsafeTemplateDir`)];function Oe(e,t,n){return[...Te(e,t),...xe(n)]}function ke(...e){let{flags:t,taskIndex:n}=ye(e),r=n<e.length?String(e[n]).toLowerCase():null,{positionals:i,pathspecs:a}=be(r===null?[]:e.slice(n+1),r,t),o=de(r,t,i);return{task:r,flags:t.map(je),paths:a,config:o,vulnerabilities:Ae(Oe(r,t,o))}}function Ae(e){return Object.defineProperty(e,`vulnerabilities`,{value:e})}function je({value:e,name:t}){return e===void 0?{name:t}:{name:t,value:e}}const Me={editor:`allowUnsafeEditor`,git_askpass:`allowUnsafeAskPass`,git_config_global:`allowUnsafeConfigPaths`,git_config_system:`allowUnsafeConfigPaths`,git_config_count:`allowUnsafeConfigEnvCount`,git_config:`allowUnsafeConfigPaths`,git_editor:`allowUnsafeEditor`,git_exec_path:`allowUnsafeConfigPaths`,git_external_diff:`allowUnsafeDiffExternal`,git_pager:`allowUnsafePager`,git_proxy_command:`allowUnsafeGitProxy`,git_template_dir:`allowUnsafeTemplateDir`,git_sequence_editor:`allowUnsafeEditor`,git_ssh:`allowUnsafeSshCommand`,git_ssh_command:`allowUnsafeSshCommand`,pager:`allowUnsafePager`,prefix:`allowUnsafeConfigPaths`,ssh_askpass:`allowUnsafeAskPass`};function*Ne(e){let t=parseInt(e.git_config_count??`0`,10);for(let n=0;n<t;n++){let t=e[`git_config_key_${n}`],r=e[`git_config_value_${n}`];t!==void 0&&(yield{key:t.toLowerCase().trim(),value:r,scope:`env`})}}function*Pe(e){for(let t of Object.keys(e))if(Fe(t)){let e=Me[t];yield{category:e,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${e}`}}}function Fe(e){return Object.hasOwn(Me,e)}function Ie(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase().trim();(Fe(e)||e.startsWith(`git`))&&(t[e]=String(r))}return t}function Le(e){let t=Ie(e),n={read:[],write:[...Ne(t)]};return{config:n,vulnerabilities:[...Pe(t),...Oe(null,[],n)]}}function Re(e,t){return[...ke(...e).vulnerabilities,...Le(t).vulnerabilities]}var ze=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Ve=Object.getOwnPropertyNames,He=Object.prototype.hasOwnProperty,R=(e,t)=>function(){return e&&(t=(0,e[Ve(e)[0]])(e=0)),t},Ue=(e,t)=>function(){return t||(0,e[Ve(e)[0]])((t={exports:{}}).exports,t),t.exports},z=(e,t)=>{for(var n in t)ze(e,n,{get:t[n],enumerable:!0})},We=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Ve(t))!He.call(e,i)&&i!==n&&ze(e,i,{get:()=>t[i],enumerable:!(r=Be(t,i))||r.enumerable});return e},B=e=>We(ze({},`__esModule`,{value:!0}),e),Ge,Ke=R({"src/lib/errors/git-error.ts"(){Ge=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),qe,Je=R({"src/lib/errors/git-response-error.ts"(){Ke(),qe=class extends Ge{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),Ye,Xe=R({"src/lib/errors/task-configuration-error.ts"(){Ke(),Ye=class extends Ge{constructor(e){super(void 0,e)}}}});function Ze(e){return typeof e==`function`?e:vt}function Qe(e){return typeof e==`function`&&e!==vt}function $e(e,t){let n=e.indexOf(t);return n<=0?[e,``]:[e.substr(0,n),e.substr(n+1)]}function et(e,t=0){return nt(e)&&e.length>t?e[t]:void 0}function tt(e,t=0){if(nt(e)&&e.length>t)return e[e.length-1-t]}function nt(e){return Dt(e)}function rt(e=``,t=!0,n=`
|
|
6
6
|
`){return e.split(n).reduce((e,n)=>{let r=t?n.trim():n;return r&&e.push(r),e},[])}function it(e,t){return rt(e,!0).map(e=>t(e))}function at(e){return(0,w.exists)(e,w.FOLDER)}function ot(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function st(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function ct(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function lt(e){return Array.isArray(e)?e:[e]}function ut(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function dt(e){return lt(e).map(e=>e instanceof String?e:String(e))}function V(e,t=0){if(e==null)return t;let n=parseInt(e,10);return Number.isNaN(n)?t:n}function ft(e,t){let n=[];for(let r=0,i=e.length;r<i;r++)n.push(t,e[r]);return n}function pt(e){return(Array.isArray(e)?Buffer.concat(e):e).toString(`utf-8`)}function mt(e,t){let n={};return t.forEach(t=>{e[t]!==void 0&&(n[t]=e[t])}),n}function ht(e=0){return new Promise(t=>setTimeout(t,e))}function gt(e){if(e!==!1)return e}var _t,vt,yt,bt=R({"src/lib/utils/util.ts"(){Ot(),_t=`\0`,vt=()=>{},yt=Object.prototype.toString.call.bind(Object.prototype.toString)}});function H(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function xt(e,t){let n=ae(e)?`string`:typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function St(e){return!!e&&yt(e)===`[object Object]`}function Ct(e){return typeof e==`function`}var wt,Tt,U,Et,Dt,Ot=R({"src/lib/utils/argument-filters.ts"(){bt(),wt=e=>Array.isArray(e),Tt=e=>typeof e==`number`,U=e=>typeof e==`string`||ae(e),Et=e=>U(e)||Array.isArray(e)&&e.every(U),Dt=e=>e==null||`number|boolean|function`.includes(typeof e)?!1:typeof e.length==`number`}}),kt,At=R({"src/lib/utils/exit-codes.ts"(){kt=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e[e.ERROR=1]=`ERROR`,e[e.NOT_FOUND=-2]=`NOT_FOUND`,e[e.UNCLEAN=128]=`UNCLEAN`,e))(kt||{})}}),jt,Mt=R({"src/lib/utils/git-output-streams.ts"(){jt=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString(`utf8`),this.stdErr.toString(`utf8`))}}}});function Nt(){throw Error(`LineParser:useMatches not implemented`)}var W,Pt,Ft=R({"src/lib/utils/line-parser.ts"(){W=class{constructor(e,t){this.matches=[],this.useMatches=Nt,this.parse=(e,t)=>(this.resetMatches(),this._regExp.every((t,n)=>this.addMatch(t,n,e(n)))?this.useMatches(t,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){let r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},Pt=class extends W{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function It(...e){let t=process.cwd(),n=Object.assign({baseDir:t,...Lt},...e.filter(e=>typeof e==`object`&&e));return n.baseDir=n.baseDir||t,n.trimmed=n.trimmed===!0,n}var Lt,Rt=R({"src/lib/utils/simple-git-options.ts"(){Lt={binary:`git`,maxConcurrentProcesses:5,config:[],trimmed:!1}}});function zt(e,t=[]){return St(e)?Object.keys(e).reduce((t,n)=>{let r=e[n];if(ae(r))t.push(r);else if(xt(r,[`boolean`]))t.push(n+`=`+r);else if(Array.isArray(r))for(let e of r)xt(e,[`string`,`number`])||t.push(n+`=`+e);else t.push(n);return t},t):t}function G(e,t=0,n=!1){let r=[];for(let n=0,i=t<0?e.length:t;n<i;n++)`string|number`.includes(typeof e[n])&&r.push(String(e[n]));return zt(Vt(e),r),n||r.push(...Bt(e)),r}function Bt(e){return dt(H(tt(e,+(typeof tt(e)==`function`)),wt,[]))}function Vt(e){return H(tt(e,+!!Ct(tt(e))),St)}function K(e,t=!0){let n=Ze(tt(e));return t||Qe(n)?n:void 0}var Ht=R({"src/lib/utils/task-options.ts"(){Ot(),bt()}});function Ut(e,t){return e(t.stdOut,t.stdErr)}function q(e,t,n,r=!0){return lt(n).forEach(n=>{for(let i=rt(n,r),a=0,o=i.length;a<o;a++){let n=(e=0)=>{if(!(a+e>=o))return i[a+e]};t.some(({parse:t})=>t(n,e))}}),e}var Wt=R({"src/lib/utils/task-parser.ts"(){bt()}}),Gt={};z(Gt,{ExitCodes:()=>kt,GitOutputStreams:()=>jt,LineParser:()=>W,NOOP:()=>vt,NULL:()=>_t,RemoteLineParser:()=>Pt,append:()=>ot,appendTaskOptions:()=>zt,asArray:()=>lt,asCamelCase:()=>ut,asFunction:()=>Ze,asNumber:()=>V,asStringArray:()=>dt,bufferToString:()=>pt,callTaskParser:()=>Ut,createInstanceConfig:()=>It,delay:()=>ht,filterArray:()=>wt,filterFunction:()=>Ct,filterHasLength:()=>Dt,filterNumber:()=>Tt,filterPlainObject:()=>St,filterPrimitives:()=>xt,filterString:()=>U,filterStringOrStringArray:()=>Et,filterType:()=>H,first:()=>et,folderExists:()=>at,forEachLineWithContent:()=>it,getTrailingOptions:()=>G,including:()=>st,isUserFunction:()=>Qe,last:()=>tt,objectToString:()=>yt,orVoid:()=>gt,parseStringResponse:()=>q,pick:()=>mt,prefixedArray:()=>ft,remove:()=>ct,splitOn:()=>$e,toLinesWithContent:()=>rt,trailingFunctionArgument:()=>K,trailingOptionsArgument:()=>Vt});var J=R({"src/lib/utils/index.ts"(){Ot(),At(),Mt(),Ft(),Rt(),Ht(),Wt(),bt()}}),Kt={};z(Kt,{CheckRepoActions:()=>Zt,checkIsBareRepoTask:()=>Yt,checkIsRepoRootTask:()=>Jt,checkIsRepoTask:()=>qt});function qt(e){switch(e){case`bare`:return Yt();case`root`:return Jt()}return{commands:[`rev-parse`,`--is-inside-work-tree`],format:`utf-8`,onError:Qt,parser:$t}}function Jt(){return{commands:[`rev-parse`,`--git-dir`],format:`utf-8`,onError:Qt,parser(e){return/^\.(git)?$/.test(e.trim())}}}function Yt(){return{commands:[`rev-parse`,`--is-bare-repository`],format:`utf-8`,onError:Qt,parser:$t}}function Xt(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Zt,Qt,$t,en=R({"src/lib/tasks/check-is-repo.ts"(){J(),Zt=(e=>(e.BARE=`bare`,e.IN_TREE=`tree`,e.IS_REPO_ROOT=`root`,e))(Zt||{}),Qt=({exitCode:e},t,n,r)=>{if(e===128&&Xt(t))return n(Buffer.from(`false`));r(t)},$t=e=>e.trim()===`true`}});function tn(e,t){let n=new nn(e),r=e?an:rn;return rt(t).forEach(e=>{let t=e.replace(r,``);n.paths.push(t),(on.test(t)?n.folders:n.files).push(t)}),n}var nn,rn,an,on,sn=R({"src/lib/responses/CleanSummary.ts"(){J(),nn=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},rn=/^[a-z]+\s*/i,an=/^[a-z]+\s+[a-z]+\s*/i,on=/\/$/}}),cn={};z(cn,{EMPTY_COMMANDS:()=>pn,adhocExecTask:()=>ln,configurationErrorTask:()=>Y,isBufferTask:()=>dn,isEmptyTask:()=>fn,straightThroughBufferTask:()=>un,straightThroughStringTask:()=>X});function ln(e){return{commands:pn,format:`empty`,parser:e}}function Y(e){return{commands:pn,format:`empty`,parser(){throw typeof e==`string`?new Ye(e):e}}}function X(e,t=!1){return{commands:e,format:`utf-8`,parser(e){return t?String(e).trim():e}}}function un(e){return{commands:e,format:`buffer`,parser(e){return e}}}function dn(e){return e.format===`buffer`}function fn(e){return e.format===`empty`||!e.commands.length}var pn,Z=R({"src/lib/tasks/task.ts"(){Xe(),pn=[]}}),mn={};z(mn,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Sn,CONFIG_ERROR_MODE_REQUIRED:()=>Cn,CONFIG_ERROR_UNKNOWN_OPTION:()=>wn,CleanOptions:()=>Tn,cleanTask:()=>gn,cleanWithOptionsTask:()=>hn,isCleanOptionsArray:()=>_n});function hn(e,t){let{cleanMode:n,options:r,valid:i}=vn(e);return n?i.options?(r.push(...t),r.some(xn)?Y(Sn):gn(n,r)):Y(wn+JSON.stringify(e)):Y(Cn)}function gn(e,t){return{commands:[`clean`,`-${e}`,...t],format:`utf-8`,parser(t){return tn(e===`n`,t)}}}function _n(e){return Array.isArray(e)&&e.every(e=>En.has(e))}function vn(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,``).split(``).forEach(e=>{yn(e)?(t=e,r.cleanMode=!0):r.options=r.options&&bn(n[n.length]=`-${e}`)}),{cleanMode:t,options:n,valid:r}}function yn(e){return e===`f`||e===`n`}function bn(e){return/^-[a-z]$/i.test(e)&&En.has(e.charAt(1))}function xn(e){return/^-[^\-]/.test(e)?e.indexOf(`i`)>0:e===`--interactive`}var Sn,Cn,wn,Tn,En,Dn=R({"src/lib/tasks/clean.ts"(){sn(),J(),Z(),Sn=`Git clean interactive mode is not supported`,Cn=`Git clean mode parameter ("n" or "f") is required`,wn=`Git clean unknown option found in: `,Tn=(e=>(e.DRY_RUN=`n`,e.FORCE=`f`,e.IGNORED_INCLUDED=`x`,e.IGNORED_ONLY=`X`,e.EXCLUDING=`e`,e.QUIET=`q`,e.RECURSIVE=`d`,e))(Tn||{}),En=new Set([`i`,...dt(Object.values(Tn))])}});function On(e){let t=new Mn;for(let n of jn(e))t.addValue(n.file,String(n.key),n.value);return t}function kn(e,t){let n=null,r=[],i=new Map;for(let a of jn(e,t))a.key===t&&(r.push(n=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function An(e){return e.replace(/^(file):/,``)}function*jn(e,t=null){let n=e.split(`\0`);for(let e=0,r=n.length-1;e<r;){let r=An(n[e++]),i=n[e++],a=t;if(i.includes(`
|
|
7
7
|
`)){let e=$e(i,`
|
|
8
|
-
`);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var Mn,Nn=R({"src/lib/responses/ConfigList.ts"(){J(),Mn=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{}),this._all}addFile(e){if(!(e in this.values)){let t=tt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function Pn(e,t){return typeof e==`string`&&Object.hasOwn(zn,e)?e:t}function Fn(e,t,n,r){let i=[`config`,`--${r}`];return n&&i.push(`--add`),i.push(e,t),{commands:i,format:`utf-8`,parser(e){return e}}}function In(e,t){let n=[`config`,`--null`,`--show-origin`,`--get-all`,e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:`utf-8`,parser(t){return kn(t,e)}}}function Ln(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return On(e)}}}function Rn(){return{addConfig(e,t,...n){return this._runTask(Fn(e,t,n[0]===!0,Pn(n[1],`local`)),K(arguments))},getConfig(e,t){return this._runTask(In(e,Pn(t,void 0)),K(arguments))},listConfig(...e){return this._runTask(Ln(Pn(e[0],void 0)),K(arguments))}}}var zn,Bn=R({"src/lib/tasks/config.ts"(){Nn(),J(),zn=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(zn||{})}});function Vn(e){return Un.has(e)}var Hn,Un,Wn=R({"src/lib/tasks/diff-name-status.ts"(){Hn=(e=>(e.ADDED=`A`,e.COPIED=`C`,e.DELETED=`D`,e.MODIFIED=`M`,e.RENAMED=`R`,e.CHANGED=`T`,e.UNMERGED=`U`,e.UNKNOWN=`X`,e.BROKEN=`B`,e))(Hn||{}),Un=new Set(Object.values(Hn))}});function Gn(...e){return new Zn().param(...e)}function Kn(e){let t=new Set,n={};return it(e,e=>{let[r,i,a]=e.split(_t);t.add(r),(n[r]=n[r]||[]).push({line:V(i),path:r,preview:a})}),{paths:t,results:n}}function qn(){return{grep(e){let t=K(arguments),n=G(arguments);for(let e of Jn)if(n.includes(e))return this._runTask(Y(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=Gn().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return Kn(e)}},t)}}}var Jn,Yn,Xn,Zn,Qn=R({"src/lib/tasks/grep.ts"(){J(),Z(),Jn=[`-h`],Yn=Symbol(`grepQuery`),Zn=class{constructor(){this[Xn]=[]}*[(Xn=Yn,Symbol.iterator)](){for(let e of this[Yn])yield e}and(...e){return e.length&&this[Yn].push(`--and`,`(`,...ft(e,`-e`),`)`),this}param(...e){return this[Yn].push(...ft(e,`-e`)),this}}}}),$n={};z($n,{ResetMode:()=>rr,getResetMode:()=>tr,resetTask:()=>er});function er(e,t){let n=[`reset`];return nr(e)&&n.push(`--${e}`),n.push(...t),X(n)}function tr(e){if(nr(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function nr(e){return typeof e==`string`&&ir.includes(e)}var rr,ir,ar=R({"src/lib/tasks/reset.ts"(){J(),Z(),rr=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(rr||{}),ir=dt(Object.values(rr))}});function or(){return(0,se.default)(`simple-git`)}function sr(e,t,n){return!t||!String(t).replace(/\s*/,``)?n?(t,...r)=>{e(t,...r),n(t,...r)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function cr(e,t,{namespace:n}){if(typeof e==`string`)return e;let r=t&&t.namespace||``;return r.startsWith(n)?r.substr(n.length+1):r||n}function lr(e,t,n,r=or()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=cr(H(t,U),o,r);return l(n);function c(t,n){return ot(a,lr(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&sr(o,n)||vt,s=sr(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var ur=R({"src/lib/git-logger.ts"(){J(),se.default.formatters.L=e=>String(Dt(e)?e.length:`-`),se.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):yt(e)}}),dr,fr=R({"src/lib/runners/tasks-pending-queue.ts"(){Ke(),ur(),dr=class e{constructor(e=`GitExecutor`){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){let n=e.getName(t.commands[0]);return{task:t,logger:lr(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new Ge(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function pr(e,t){return{method:et(e.commands)||``,commands:t}}function mr(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function hr(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var gr,_r=R({"src/lib/runners/git-executor-chain.ts"(){Ke(),Z(),J(),fr(),gr=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new dr}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:t}=this._queue.attempt(e);return await(fn(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof Ge?Object.assign(t,{task:e}):new Ge(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,pr(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...pr(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),dn(e)?Ut(e.parser,a):Ut(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...pr(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,yt(e)),c(new jt(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(s)))},l);if(u)return r.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,i,s.length,a),l(u);r.info(`retrieving task output complete`),c(new jt(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let a=i.sibling(`output`),o=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},pr(e,e.commands));return new Promise(s=>{let c=[],l=[];i.info(`%s %o`,t,n),i(`%O`,o);let u=this._beforeSpawn(e,n);if(u)return s({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec(`spawn.before`,void 0,{...pr(e,n),kill(e){u=e||u}});let d=g(t,n,o);d.stdout.on(`data`,hr(c,`stdOut`,i,a.step(`stdOut`))),d.stderr.on(`data`,hr(l,`stdErr`,i,a.step(`stdErr`))),d.on(`error`,mr(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...pr(e,n),spawned:d,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...pr(e,t),kill(e){n=e||n}}),n}}}}),vr={};z(vr,{GitExecutor:()=>yr});var yr,br=R({"src/lib/runners/git-executor.ts"(){_r(),yr=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new gr(this,this._scheduler,this._plugins)}chain(){return new gr(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function xr(e,t,n=vt){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof qe?Sr(t):t,void 0)})}function Sr(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=vt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),n}}var Cr=R({"src/lib/task-callback.ts"(){Je(),J()}});function wr(e,t){return ln(n=>{if(!at(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var Tr=R({"src/lib/tasks/change-working-directory.ts"(){J(),Z()}});function Er(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=ct(t,`-B`)),X(t)}function Dr(){return{checkout(){return this._runTask(Er(G(arguments,1)),K(arguments))},checkoutBranch(e,t){return this._runTask(Er([`-b`,e,t,...G(arguments)]),K(arguments))},checkoutLocalBranch(e){return this._runTask(Er([`-b`,e,...G(arguments)]),K(arguments))}}}var Or=R({"src/lib/tasks/checkout.ts"(){J(),Z()}});function kr(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Ar(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return q(kr(),[jr],e)}})}}}var jr,Mr=R({"src/lib/tasks/count-objects.ts"(){J(),jr=new W(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=ut(t);Object.hasOwn(e,r)&&(e[r]=V(n))})}});function Nr(e){return q({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},Pr,e)}var Pr,Fr=R({"src/lib/parsers/parse-commit.ts"(){J(),Pr=[new W(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new W(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new W(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new W(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function Ir(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...ft(e,`-m`),...t,...n],format:`utf-8`,parser:Nr}}function Lr(){return{commit(t,...n){let r=K(arguments),i=e(t)||Ir(lt(t),lt(H(n[0],Et,[])),[...dt(H(n[1],wt,[])),...G(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!Et(e)&&Y(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var Rr=R({"src/lib/tasks/commit.ts"(){Fr(),J(),Z()}});function zr(){return{firstCommit(){return this._runTask(X([`rev-list`,`--max-parents=0`,`HEAD`],!0),K(arguments))}}}var Br=R({"src/lib/tasks/first-commit.ts"(){J(),Z()}});function Vr(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),X(n,!0)}var Hr=R({"src/lib/tasks/hash-object.ts"(){Z()}});function Ur(e,t,n){let r=String(n).trim(),i;if(i=Gr.exec(r))return new Wr(e,t,!1,i[1]);if(i=Kr.exec(r))return new Wr(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new Wr(e,t,/^re/i.test(r),a)}var Wr,Gr,Kr,qr=R({"src/lib/responses/InitSummary.ts"(){Wr=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},Gr=/^Init.+ repository in (.+)$/,Kr=/^Rein.+ in (.+)$/}});function Jr(e){return e.includes(Xr)}function Yr(e=!1,t,n){let r=[`init`,...n];return e&&!Jr(r)&&r.splice(1,0,Xr),{commands:r,format:`utf-8`,parser(e){return Ur(r.includes(`--bare`),t,e)}}}var Xr,Zr=R({"src/lib/tasks/init.ts"(){qr(),Xr=`--bare`}});function Qr(e){for(let t=0;t<e.length;t++){let n=ei.exec(e[t]);if(n)return`--${n[1]}`}return``}function $r(e){return ei.test(e)}var ei,ti=R({"src/lib/args/log-format.ts"(){ei=/^--(stat|numstat|name-only|name-status)(=|$)/}}),ni,ri=R({"src/lib/responses/DiffSummary.ts"(){ni=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function ii(e=``){let t=li[e];return e=>q(new ni,t,e,!1)}var ai,oi,si,ci,li,ui=R({"src/lib/parsers/parse-diff-summary.ts"(){ti(),ri(),Wn(),J(),ai=[new W(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:V(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new W(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:V(n),after:V(r),binary:!0})}),new W(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=V(t),e.insertions=V(r?.[1]),e.deletions=V(i?.[1])})],oi=[new W(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=V(t),a=V(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new W(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],si=[new W(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ci=[new W(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:gt(Vn(t)&&t),from:gt(!!a&&r!==a&&r),similarity:V(n)})})],li={"":ai,"--stat":ai,"--numstat":oi,"--name-status":ci,"--name-only":si}}});function di(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function fi(e=hi,t=gi,n=``){let r=ii(n);return function(n){let i=rt(n.trim(),!1,pi).map(function(n){let i=n.split(mi),a=di(i[0].split(e),t);return i.length>1&&i[1].trim()&&(a.diff=r(i[1])),a});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var pi,mi,hi,gi,_i=R({"src/lib/parsers/parse-list-log-summary.ts"(){J(),ui(),ti(),pi=`òòòòòò `,mi=` òò`,hi=` ò `,gi=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),vi={};z(vi,{diffSummaryTask:()=>yi,validateLogFormatConfig:()=>bi});function yi(e){let t=Qr(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),bi(n)||{commands:n,format:`utf-8`,parser:ii(t)}}function bi(e){let t=e.filter($r);if(t.length>1)return Y(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return Y(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var xi=R({"src/lib/tasks/diff.ts"(){ti(),ui(),Z()}});function Si(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function Ci(e){return Object.keys(e).reduce((t,n)=>(n in Di||(t[n]=e[n]),t),{})}function wi(e={},t=[]){let n=H(e.splitter,U,hi),[r,i]=Si(St(e.format)?e.format:{hash:`%H`,date:e.strictDate===!1?`%ai`:`%aI`,message:`%s`,refs:`%D`,body:e.multiLine?`%B`:`%b`,author_name:e.mailMap===!1?`%an`:`%aN`,author_email:e.mailMap===!1?`%ae`:`%aE`},n),a=[],o=[`--pretty=format:${pi}${i}${mi}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return U(e.file)&&o.push(`--follow`,ie(e.file)),zt(Ci(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function Ti(e,t,n){let r=fi(e,t,Qr(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function Ei(){return{log(...n){let r=K(arguments),i=wi(Vt(arguments),dt(H(arguments[0],wt,[]))),a=t(...n)||bi(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return Ti(e.splitter,e.fields,e.commands)}function t(e,t){return U(e)&&U(t)&&Y(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var Di,Oi=R({"src/lib/tasks/log.ts"(){ti(),_i(),J(),Z(),xi(),Di=(e=>(e[e[`--pretty`]=0]=`--pretty`,e[e[`max-count`]=1]=`max-count`,e[e.maxCount=2]=`maxCount`,e[e.n=3]=`n`,e[e.file=4]=`file`,e[e.format=5]=`format`,e[e.from=6]=`from`,e[e.to=7]=`to`,e[e.splitter=8]=`splitter`,e[e.symmetric=9]=`symmetric`,e[e.mailMap=10]=`mailMap`,e[e.multiLine=11]=`multiLine`,e[e.strictDate=12]=`strictDate`,e))(Di||{})}}),ki,Ai,ji=R({"src/lib/responses/MergeSummary.ts"(){ki=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Ai=class{constructor(){this.conflicts=[],this.merges=[],this.result=`success`}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(`, `)}`:`OK`}}}}),Mi,Ni,Pi=R({"src/lib/responses/PullSummary.ts"(){Mi=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ni=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function Fi(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Ii(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:V(t&&t[1]||`0`),delta:V(n&&n[1]||`0`)}}var Li,Ri=R({"src/lib/parsers/parse-remote-objects.ts"(){J(),Li=[new Pt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Fi(e.remoteMessages);Object.assign(i,{[r]:V(n)})}),new Pt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Fi(e.remoteMessages);Object.assign(i,{[r]:V(n)})}),new Pt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=Fi(e.remoteMessages);i.total=Ii(t),i.reused=Ii(n),i.packReused=V(r)})]}});function zi(e,t){return q({remoteMessages:new Vi},Bi,t)}var Bi,Vi,Hi=R({"src/lib/parsers/parse-remote-messages.ts"(){J(),Ri(),Bi=[new Pt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Li,new Pt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Pt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:V(t),summary:n,url:r}})],Vi=class{constructor(){this.all=[]}}}});function Ui(e,t){let n=q(new Ni,Ji,[e,t]);return n.message&&n}var Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi=R({"src/lib/parsers/parse-pull.ts"(){Pi(),J(),Hi(),Wi=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Gi=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Ki=/^(create|delete) mode \d+ (.+)/,qi=[new W(Wi,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new W(Gi,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new W(Ki,(e,[t,n])=>{ot(e.files,n),ot(t===`create`?e.created:e.deleted,n)})],Ji=[new W(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new W(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new W(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],Yi=(e,t)=>q(new Mi,qi,[e,t]),Xi=(e,t)=>Object.assign(new Mi,Yi(e,t),zi(e,t))}}),Qi,$i,ea,ta=R({"src/lib/parsers/parse-merge.ts"(){ji(),J(),Zi(),Qi=[new W(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new W(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new ki(t,n))}),new W(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new ki(t,n,{deleteRef:r}))}),new W(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new ki(t,null))}),new W(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],$i=(e,t)=>Object.assign(ea(e,t),Xi(e,t)),ea=e=>q(new Ai,Qi,e)}});function na(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=$i(e,t);if(n.failed)throw new qe(n);return n}}:Y(`Git.merge requires at least one option`)}var ra=R({"src/lib/tasks/merge.ts"(){Je(),ta(),Z()}});function ia(e,t,n){let r=n.includes(`deleted`),i=n.includes(`tag`)||/^refs\/tags/.test(e),a=!n.includes(`new`);return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var aa,oa,sa,ca=R({"src/lib/parsers/parse-push.ts"(){J(),Hi(),aa=[new W(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new W(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new W(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(ia(t,n,r))}),new W(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new W(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],oa=(e,t)=>{let n=sa(e,t),r=zi(e,t);return{...n,...r}},sa=(e,t)=>q({pushed:[]},aa,[e,t])}}),la={};z(la,{pushTagsTask:()=>ua,pushTask:()=>da});function ua(e={},t){return ot(t,`--tags`),da(e,t)}function da(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),ct(n,`-v`),ot(n,`--verbose`),ot(n,`--porcelain`),{commands:n,format:`utf-8`,parser:oa}}var fa=R({"src/lib/tasks/push.ts"(){ca(),J()}});function pa(){return{showBuffer(){let e=[`show`,...G(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(un(e),K(arguments))},show(){let e=[`show`,...G(arguments,1)];return this._runTask(X(e),K(arguments))}}}var ma=R({"src/lib/tasks/show.ts"(){J(),Z()}}),ha,ga,_a=R({"src/lib/responses/FileStatusSummary.ts"(){ha=/^(.+)\0(.+)$/,ga=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=ha.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function va(e){let[t,n]=e.split(_t);return{from:n||t,to:t}}function Q(e,t,n){return[`${e}${t}`,n]}function ya(e,...t){return t.map(t=>Q(e,t,(e,t)=>e.conflicted.push(t)))}function ba(e,t){let n=t.trim();switch(` `){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(` `,n.charAt(0),n.slice(2));default:return}function r(t,n,r){let i=`${t}${n}`,a=Sa.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new ga(r,t,n))}}var xa,Sa,Ca,wa=R({"src/lib/responses/StatusSummary.ts"(){J(),_a(),xa=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Sa=new Map([Q(` `,`A`,(e,t)=>e.created.push(t)),Q(` `,`D`,(e,t)=>e.deleted.push(t)),Q(` `,`M`,(e,t)=>e.modified.push(t)),Q(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),Q(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Q(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Q(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`R`,` `,(e,t)=>{e.renamed.push(va(t))}),Q(`R`,`M`,(e,t)=>{let n=va(t);e.renamed.push(n),e.modified.push(n.to)}),Q(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Q(`?`,`?`,(e,t)=>e.not_added.push(t)),...ya(`A`,`A`,`U`),...ya(`D`,`D`,`U`),...ya(`U`,`A`,`D`,`U`),[`##`,(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,s=n.exec(t);e.ahead=s&&+s[1]||0,s=r.exec(t),e.behind=s&&+s[1]||0,s=i.exec(t),e.current=H(s?.[1],U,null),s=a.exec(t),e.tracking=H(s?.[1],U,null),s=o.exec(t),s&&(e.current=H(s?.[1],U,e.current)),e.detached=/\(no branch\)/.test(t)}]]),Ca=function(e){let t=e.split(_t),n=new xa;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=_t+(t[e++]||``)),ba(n,r))}return n}}});function Ta(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!Ea.includes(e))],parser(e){return Ca(e)}}}var Ea,Da=R({"src/lib/tasks/status.ts"(){wa(),Ea=[`--null`,`-z`]}});function Oa(e=0,t=0,n=0,r=``,i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},`toString`,{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function ka(){return Oa(0,0,0,``,!1)}function Aa(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:ja,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(Ma));r(t)}})}}}function ja(e){return e===Ma?ka():q(Oa(0,0,0,e),Na,e)}var Ma,Na,Pa=R({"src/lib/tasks/version.ts"(){J(),Ma=`installed=false`,Na=[new W(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,Oa(V(t),V(n),V(r),i))}),new W(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,Oa(V(t),V(n),r,i))})]}});function Fa(e,t,n,...r){return U(n)?t(n,H(r[0],U),G(arguments)):Y(`git.${e}() requires a string 'repoPath'`)}function Ia(){return{clone(e,...t){return this._runTask(Fa(`clone`,La,H(e,U),...t),K(arguments))},mirror(e,...t){return this._runTask(Fa(`mirror`,Ra,H(e,U),...t),K(arguments))}}}var La,Ra,za=R({"src/lib/tasks/clone.ts"(){Z(),J(),La=(e,t,n)=>{let r=[`clone`,...n];return U(e)&&r.push(ie(e)),U(t)&&r.push(ie(t)),X(r)},Ra=(e,t,n)=>(ot(n,`--mirror`),La(e,t,n))}}),Ba={};z(Ba,{SimpleGitApi:()=>Va});var Va,Ha=R({"src/lib/simple-git-api.ts"(){Cr(),Tr(),Or(),Mr(),Rr(),Bn(),Br(),Qn(),Hr(),Zr(),Oi(),ra(),fa(),ma(),Da(),Z(),Pa(),J(),za(),Va=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&xr(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(X([`add`,...lt(e)]),K(arguments))}cwd(e){let t=K(arguments);return typeof e==`string`?this._runTask(wr(e,this._executor),t):typeof e?.path==`string`?this._runTask(wr(e.path,e.root&&this._executor||void 0),t):this._runTask(Y(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(Vr(e,t===!0),K(arguments))}init(e){return this._runTask(Yr(e===!0,this._executor.cwd,G(arguments)),K(arguments))}merge(){return this._runTask(na(G(arguments)),K(arguments))}mergeFromTo(e,t){return U(e)&&U(t)?this._runTask(na([e,t,...G(arguments)]),K(arguments,!1)):this._runTask(Y(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=da({remote:H(arguments[0],U),branch:H(arguments[1],U)},G(arguments));return this._runTask(e,K(arguments))}stash(){return this._runTask(X([`stash`,...G(arguments)]),K(arguments))}status(){return this._runTask(Ta(G(arguments)),K(arguments))}},Object.assign(Va.prototype,Dr(),Ia(),Lr(),Rn(),Ar(),zr(),qn(),Ei(),pa(),Aa())}}),Ua={};z(Ua,{Scheduler:()=>Ga});var Wa,Ga,Ka=R({"src/lib/runners/scheduler.ts"(){J(),ur(),Wa=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,ce.createDeferred)();return{promise:t,done:n,id:e}}})(),Ga=class{constructor(e=2){this.concurrency=e,this.logger=lr(``,`scheduler`),this.pending=[],this.running=[],this.logger(`Constructed, concurrency=%s`,e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`,this.pending.length,this.running.length,this.concurrency);return}let e=ot(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),ct(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=ot(this.pending,Wa());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),qa={};z(qa,{applyPatchTask:()=>Ja});function Ja(e,t){return X([`apply`,...t,...e])}var Ya=R({"src/lib/tasks/apply-patch.ts"(){Z()}});function Xa(e,t){return{branch:e,hash:t,success:!0}}function Za(e){return{branch:e,hash:null,success:!1}}var Qa,$a=R({"src/lib/responses/BranchDeleteSummary.ts"(){Qa=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function eo(e,t){return t===1&&no.test(e)}var to,no,ro,io,ao=R({"src/lib/parsers/parse-branch-delete.ts"(){$a(),J(),to=/(\S+)\s+\(\S+\s([^)]+)\)/,no=/^error[^']+'([^']+)'/m,ro=[new W(to,(e,[t,n])=>{let r=Xa(t,n);e.all.push(r),e.branches[t]=r}),new W(no,(e,[t])=>{let n=Za(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],io=(e,t)=>q(new Qa,ro,[e,t])}}),oo,so=R({"src/lib/responses/BranchSummary.ts"(){oo=class{constructor(){this.all=[],this.branches={},this.current=``,this.detached=!1}push(e,t,n,r,i){e===`*`&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e===`*`,linkedWorkTree:e===`+`,name:n,commit:r,label:i}}}}});function co(e){return e?e.charAt(0):``}function lo(e,t=!1){return q(new oo,t?[fo]:uo,e)}var uo,fo,po=R({"src/lib/parsers/parse-branch.ts"(){so(),J(),uo=[new W(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(co(t),!0,n,r,i)}),new W(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(co(t),!1,n,r,i)})],fo=new W(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),mo={};z(mo,{branchLocalTask:()=>_o,branchTask:()=>go,containsDeleteBranchCommand:()=>ho,deleteBranchTask:()=>yo,deleteBranchesTask:()=>vo});function ho(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function go(e){let t=ho(e),n=e.includes(`--show-current`),r=[`branch`,...e];return r.length===1&&r.push(`-a`),r.includes(`-v`)||r.splice(1,0,`-v`),{format:`utf-8`,commands:r,parser(e,r){return t?io(e,r).all[0]:lo(e,n)}}}function _o(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return lo(e)}}}function vo(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return io(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!eo(String(n),e))return i(n);r(t)}}}function yo(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return io(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!eo(String(i),e))return o(i);throw new qe(n.parser(pt(r),pt(t)),String(i))}};return n}var bo=R({"src/lib/tasks/branch.ts"(){Je(),ao(),po(),J()}});function xo(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&l(t)}var So,Co=R({"src/lib/responses/CheckIgnore.ts"(){So=e=>e.split(/\n/g).map(xo).filter(Boolean)}}),wo={};z(wo,{checkIgnoreTask:()=>To});function To(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:So}}var Eo=R({"src/lib/tasks/check-ignore.ts"(){Co()}});function Do(e,t){return q({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Oo,[e,t])}var Oo,ko=R({"src/lib/parsers/parse-fetch.ts"(){J(),Oo=[new W(/From (.+)$/,(e,[t])=>{e.remote=t}),new W(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new W(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new W(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new W(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),Ao={};z(Ao,{fetchTask:()=>Mo});function jo(e){return/^--upload-pack(=|$)/.test(e)}function Mo(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(jo)?Y(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:Do}}var No=R({"src/lib/tasks/fetch.ts"(){ko(),Z()}});function Po(e){return q({moves:[]},Fo,e)}var Fo,Io=R({"src/lib/parsers/parse-move.ts"(){J(),Fo=[new W(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Lo={};z(Lo,{moveTask:()=>Ro});function Ro(e,t){return{commands:[`mv`,`-v`,...lt(e),t],format:`utf-8`,parser:Po}}var zo=R({"src/lib/tasks/move.ts"(){Io(),J()}}),Bo={};z(Bo,{pullTask:()=>Vo});function Vo(e,t,n){let r=[`pull`,...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:`utf-8`,parser(e,t){return Xi(e,t)},onError(e,t,n,r){let i=Ui(pt(e.stdOut),pt(e.stdErr));if(i)return r(new qe(i));r(t)}}}var Ho=R({"src/lib/tasks/pull.ts"(){Je(),Zi(),J()}});function Uo(e){let t={};return Go(e,([e])=>t[e]={name:e}),Object.values(t)}function Wo(e){let t={};return Go(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:``,push:``}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,``)]=n)}),Object.values(t)}function Go(e,t){it(e,e=>t(e.split(/\s+/)))}var Ko=R({"src/lib/responses/GetRemoteSummary.ts"(){J()}}),qo={};z(qo,{addRemoteTask:()=>Jo,getRemotesTask:()=>Yo,listRemotesTask:()=>Xo,remoteTask:()=>Zo,removeRemoteTask:()=>Qo});function Jo(e,t,n){return X([`remote`,`add`,...n,e,t])}function Yo(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?Wo:Uo}}function Xo(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),X(t)}function Zo(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),X(t)}function Qo(e){return X([`remote`,`remove`,e])}var $o=R({"src/lib/tasks/remote.ts"(){Ko(),Z()}}),es={};z(es,{stashListTask:()=>ts});function ts(e={},t){let n=wi(e),r=[`stash`,`list`,...n.commands,...t],i=fi(n.splitter,n.fields,Qr(r));return bi(r)||{commands:r,format:`utf-8`,parser:i}}var ns=R({"src/lib/tasks/stash-list.ts"(){ti(),_i(),xi(),Oi()}}),rs={};z(rs,{addSubModuleTask:()=>is,initSubModuleTask:()=>as,subModuleTask:()=>os,updateSubModuleTask:()=>ss});function is(e,t){return os([`add`,e,t])}function as(e){return os([`init`,...e])}function os(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),X(t)}function ss(e){return os([`update`,...e])}var cs=R({"src/lib/tasks/sub-module.ts"(){Z()}});function ls(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?us(e,t):0:n?1:-1}function us(e,t){return e===t?0:e>t?1:-1}function ds(e){return e.trim()}function fs(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var ps,ms,hs=R({"src/lib/responses/TagList.ts"(){ps=class{constructor(e,t){this.all=e,this.latest=t}},ms=function(e,t=!1){let n=e.split(`
|
|
9
|
-
`).map(ds).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return ls(fs(n[0]),fs(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=us(fs(n[e]),fs(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new ps(n,r)}}}),gs={};z(gs,{addAnnotatedTagTask:()=>ys,addTagTask:()=>vs,tagListTask:()=>_s});function _s(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return ms(e,t)}}}function vs(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function ys(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var bs=R({"src/lib/tasks/tag.ts"(){hs()}}),xs=Ue({"src/git.js"(e,t){var{GitExecutor:n}=(br(),B(vr)),{SimpleGitApi:r}=(Ha(),B(Ba)),{Scheduler:i}=(Ka(),B(Ua)),{adhocExecTask:a,configurationErrorTask:o}=(Z(),B(cn)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(J(),B(Gt)),{applyPatchTask:ee}=(Ya(),B(qa)),{branchTask:te,branchLocalTask:g,deleteBranchesTask:_,deleteBranchTask:v}=(bo(),B(mo)),{checkIgnoreTask:ne}=(Eo(),B(wo)),{checkIsRepoTask:y}=(en(),B(Kt)),{cleanWithOptionsTask:b,isCleanOptionsArray:x}=(Dn(),B(mn)),{diffSummaryTask:re}=(xi(),B(vi)),{fetchTask:S}=(No(),B(Ao)),{moveTask:C}=(zo(),B(Lo)),{pullTask:w}=(Ho(),B(Bo)),{pushTagsTask:T}=(fa(),B(la)),{addRemoteTask:ie,getRemotesTask:ae,listRemotesTask:E,remoteTask:oe,removeRemoteTask:se}=($o(),B(qo)),{getResetMode:ce,resetTask:D}=(ar(),B($n)),{stashListTask:O}=(ns(),B(es)),{addSubModuleTask:k,initSubModuleTask:A,subModuleTask:le,updateSubModuleTask:j}=(cs(),B(rs)),{addAnnotatedTagTask:M,addTagTask:N,tagListTask:P}=(bs(),B(gs)),{straightThroughBufferTask:ue,straightThroughStringTask:F}=(Z(),B(cn));function I(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(I.prototype=Object.create(r.prototype)).constructor=I,I.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},I.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},I.prototype.stashList=function(e){return this._runTask(O(h(arguments)||{},c(e)&&e||[]),m(arguments))},I.prototype.mv=function(e,t){return this._runTask(C(e,t),m(arguments))},I.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},I.prototype.pull=function(e,t,n,r){return this._runTask(w(f(e,u),f(t,u),p(arguments)),m(arguments))},I.prototype.fetch=function(e,t){return this._runTask(S(f(e,u),f(t,u),p(arguments)),m(arguments))},I.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},I.prototype.tags=function(e,t){return this._runTask(P(p(arguments)),m(arguments))},I.prototype.rebase=function(){return this._runTask(F([`rebase`,...p(arguments)]),m(arguments))},I.prototype.reset=function(e){return this._runTask(D(ce(e),p(arguments)),m(arguments))},I.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(F([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},I.prototype.addTag=function(e){let t=typeof e==`string`?N(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},I.prototype.addAnnotatedTag=function(e,t){return this._runTask(M(e,t),m(arguments))},I.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(v(e,typeof t==`boolean`?t:!1),m(arguments))},I.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(_(e,typeof t==`boolean`?t:!1),m(arguments))},I.prototype.branch=function(e,t){return this._runTask(te(p(arguments)),m(arguments))},I.prototype.branchLocal=function(e){return this._runTask(g(),m(arguments))},I.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(F(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},I.prototype.submoduleAdd=function(e,t,n){return this._runTask(k(e,t),m(arguments))},I.prototype.submoduleUpdate=function(e,t){return this._runTask(j(p(arguments,!0)),m(arguments))},I.prototype.submoduleInit=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},I.prototype.subModule=function(e,t){return this._runTask(le(p(arguments)),m(arguments))},I.prototype.listRemote=function(){return this._runTask(E(p(arguments)),m(arguments))},I.prototype.addRemote=function(e,t,n){return this._runTask(ie(e,t,p(arguments)),m(arguments))},I.prototype.removeRemote=function(e,t){return this._runTask(se(e),m(arguments))},I.prototype.getRemotes=function(e,t){return this._runTask(ae(e===!0),m(arguments))},I.prototype.remote=function(e,t){return this._runTask(oe(p(arguments)),m(arguments))},I.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(F(n),m(arguments))},I.prototype.updateServerInfo=function(e){return this._runTask(F([`update-server-info`]),m(arguments))},I.prototype.pushTags=function(e,t){let n=T({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},I.prototype.rm=function(e){return this._runTask(F([`rm`,`-f`,...s(e)]),m(arguments))},I.prototype.rmKeepLocal=function(e){return this._runTask(F([`rm`,`--cached`,...s(e)]),m(arguments))},I.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},I.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},I.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?ue(r):F(r);return this._runTask(a,n)},I.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):F([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},I.prototype.diffSummary=function(){return this._runTask(re(p(arguments,1)),m(arguments))},I.prototype.applyPatch=function(e){let t=d(e)?ee(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},I.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(F(e,!0),m(arguments))},I.prototype.clean=function(e,t,n){let r=x(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(b(i,a),m(arguments))},I.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},I.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},I.prototype.checkIgnore=function(e,t){return this._runTask(ne(s(f(e,d,[]))),m(arguments))},I.prototype.checkIsRepo=function(e,t){return this._runTask(y(f(e,u)),m(arguments))},t.exports=I}});Ke();var Ss=class extends Ge{constructor(e,t){super(void 0,t),this.config=e}};Ke(),Ke();var Cs=class extends Ge{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Je(),Xe(),en(),Dn(),Bn(),Wn(),Qn(),ar();function ws(e){if(e)return[{type:`spawn.before`,action(t,n){e.aborted&&n.kill(new Cs(void 0,`abort`,`Abort already signaled`))}},{type:`spawn.after`,action(t,n){function r(){n.kill(new Cs(void 0,`abort`,`Abort signal received`))}e.addEventListener(`abort`,r),n.spawned.on(`close`,()=>e.removeEventListener(`abort`,r))}}]}function Ts(e={}){return{type:`spawn.args`,action(t,{env:n}){for(let r of Re(t,n))if(e[r.category]!==!0)throw new Cs(void 0,`unsafe`,r.message);return t}}}J();function Es(e){let t=ft(e,`-c`);return{type:`spawn.args`,action(e){return[...t,...e]}}}J();var Ds=(0,ce.deferred)().promise;function Os({onClose:e=!0,onExit:t=50}={}){function n(){let n=-1,i={close:(0,ce.deferred)(),closeTimeout:(0,ce.deferred)(),exit:(0,ce.deferred)(),exitTimeout:(0,ce.deferred)()},a=Promise.race([e===!1?Ds:i.closeTimeout.promise,t===!1?Ds:i.exitTimeout.promise]);return r(e,i.close,i.closeTimeout),r(t,i.exit,i.exitTimeout),{close(e){n=e,i.close.done()},exit(e){n=e,i.exit.done()},get exitCode(){return n},result:a}}function r(e,t,n){e!==!1&&(e===!0?t.promise:t.promise.then(()=>ht(e))).then(n.done)}return{type:`spawn.after`,async action(e,{spawned:t,close:r}){let i=n(),a=!0,o=()=>void(a=!1);t.stdout?.on(`data`,o),t.stderr?.on(`data`,o),t.on(`error`,o),t.on(`close`,e=>i.close(e)),t.on(`exit`,e=>i.exit(e));try{await i.result,a&&await ht(50),r(i.exitCode)}catch(e){r(i.exitCode,e)}}}}J();var ks=`Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`,As=`Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;function js(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function Ms(e,t){if(e.length<1||e.length>2)throw new Cs(void 0,`binary`,ks);if(e.some(js))if(t)console.warn(As);else throw new Cs(void 0,`binary`,As);let[n,r]=e;return{binary:n,prefix:r}}function Ns(e,t=[`git`],n=!1){let r=Ms(lt(t),n);e.on(`binary`,e=>{r=Ms(lt(e),n)}),e.append(`spawn.binary`,()=>r.binary),e.append(`spawn.args`,e=>r.prefix?[r.prefix,...e]:e)}Ke();function Ps(e){return!!(e.exitCode&&e.stdErr.length)}function Fs(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Is(e=!1,t=Ps,n=Fs){return(r,i)=>!e&&r||!t(i)?r:n(i)}function Ls(e){return{type:`task.error`,action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new Ge(void 0,r.toString(`utf-8`))}:{error:r}}}}J();var Rs=class{constructor(){this.plugins=new Set,this.events=new _}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=ot(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return lt(e).forEach(e=>e&&this.plugins.add(ot(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};J();function zs(e){let t=`--progress`,n=[`checkout`,`clone`,`fetch`,`pull`,`push`];return[{type:`spawn.args`,action(e,r){return n.includes(r.method)?st(e,t):e}},{type:`spawn.after`,action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on(`data`,t=>{let n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString(`utf8`));n&&e({method:r.method,stage:Bs(n[1]),progress:V(n[2]),processed:V(n[3]),total:V(n[4])})})}}]}function Bs(e){return String(e.toLowerCase().split(` `,1))||`unknown`}J();function Vs(e){let t=mt(e,[`uid`,`gid`]);return{type:`spawn.options`,action(e){return{...t,...e}}}}function Hs({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:`spawn.after`,action(r,i){let a;function o(){a&&clearTimeout(a),a=setTimeout(c,e)}function s(){i.spawned.stdout?.off(`data`,o),i.spawned.stderr?.off(`data`,o),i.spawned.off(`exit`,s),i.spawned.off(`close`,s),a&&clearTimeout(a)}function c(){s(),i.kill(new Cs(void 0,`timeout`,`block timeout reached`))}n&&i.spawned.stdout?.on(`data`,o),t&&i.spawned.stderr?.on(`data`,o),i.spawned.on(`exit`,s),i.spawned.on(`close`,s),o()}}}function Us(){return{type:`spawn.args`,action(e){let t=[],n;function r(e){(n||=[]).push(...e)}for(let n=0;n<e.length;n++){let i=e[n];if(ae(i)){r(E(i));continue}if(i===`--`){r(e.slice(n+1).flatMap(e=>ae(e)&&E(e)||e));break}t.push(i)}return n?[...t,`--`,...n.map(String)]:t}}}J();var Ws=xs();function Gs(e,t){let n=new Rs,r=It(e&&(typeof e==`string`?{baseDir:e}:e)||{},t);if(!at(r.baseDir))throw new Ss(r,`Cannot use simple-git on a directory that does not exist`);return Array.isArray(r.config)&&n.add(Es(r.config)),n.add(Ts(r.unsafe)),n.add(Os(r.completion)),r.abort&&n.add(ws(r.abort)),r.progress&&n.add(zs(r.progress)),r.timeout&&n.add(Hs(r.timeout)),r.spawnOptions&&n.add(Vs(r.spawnOptions)),n.add(Us()),n.add(Ls(Is(!0))),r.errors&&n.add(Ls(r.errors)),Ns(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new Ws(r,n)}Je();var Ks=Gs;function $(e){return Ks(e??process.cwd())}async function qs(e){try{return{root:(await Ks(e).revparse([`--show-toplevel`])).trim()}}catch{return{root:null}}}async function Js(e){let t=await e.status();return{current:t.current??``,isDetached:t.detached}}async function Ys(e,t){let n=(await e.log([t??`HEAD`,`-1`])).latest;if(!n)throw Error(`No commits found`);return{hash:n.hash,message:n.message,author:n.author_name,email:n.author_email,date:n.date}}function Xs(e){return e.split(`\0`).filter(e=>e.length>0)}function Zs(e){let t=new Map,n=Xs(e);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let i=r[0];if(!i)continue;if(i===`R`||i===`C`){let r=n[e+1],a=n[e+2];r&&a&&t.set(a,{status:i,oldPath:r}),e+=2;continue}let a=n[e+1];a&&t.set(a,{status:i}),e+=1}return t}function Qs(e){let t=Xs(e),n=[];for(let e=0;e<t.length;e+=1){let r=t[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){n.push({path:o,additions:s,deletions:c});continue}let l=t[e+1],u=t[e+2];u&&(n.push({path:u,additions:s,deletions:c,...l?{oldPath:l}:{}}),e+=2)}return n}async function $s(e,t){return(await e.raw([`rev-parse`,`--verify`,`--quiet`,`${t}^1`])).trim()?{args:[`diff-tree`,`-M`,`-r`,`--no-commit-id`],isRoot:!1}:{args:[`diff-tree`,`--root`,`-M`,`-r`,`--no-commit-id`],isRoot:!0}}async function ec(e,t){let n=[],r=0,i=0,a=await $s(e,t),o=a.isRoot?[t]:[`${t}^1`,t],[s,c]=await Promise.all([e.raw([...a.args,`--name-status`,`-z`,...o]),e.raw([...a.args,`--numstat`,`-z`,...o])]),l=Zs(s),u=Qs(c);for(let e of u){let t=l.get(e.path),a=t?.status??`M`,o=t?.oldPath??e.oldPath;r+=e.additions,i+=e.deletions,n.push({path:e.path,...o&&{oldPath:o},status:a,additions:e.additions,deletions:e.deletions})}return{files:n,stats:{totalAdditions:r,totalDeletions:i,changedFiles:n.length}}}function tc(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){t.set(o,{additions:s,deletions:c});continue}let l=n[e+2];l&&t.set(l,{additions:s,deletions:c}),e+=2}return t}function nc(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){if(!n[e]?.startsWith(`R`)){e+=1;continue}let r=n[e+1],i=n[e+2];r&&i&&t.set(i,r),e+=2}return t}function rc(e,t){for(let[n,r]of t){let t=e.get(n)??{additions:0,deletions:0};t.additions+=r.additions,t.deletions+=r.deletions,e.set(n,t)}}async function ic(e){let t=await e.status(),[n,r,i,a]=await Promise.all([e.raw([`diff`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--cached`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--name-status`,`-M`,`-z`]),e.raw([`diff`,`--cached`,`--name-status`,`-M`,`-z`])]),o=tc(n),s=tc(r),c=nc(i),l=nc(a),u=new Map;rc(u,o),rc(u,s);let d=[],f=[],p=[],m=[],h=new Set,ee=new Set(t.conflicted),te=(e,t,n,r)=>{e.push({path:t,additions:n.additions,deletions:n.deletions,...r?{oldPath:r}:{}}),h.add(t)};for(let e of t.files){let t=e.path;if(ee.has(t)){te(m,t,u.get(t)??{additions:0,deletions:0},c.get(t)??l.get(t));continue}if(e.index===`?`&&e.working_dir===`?`){te(p,t,{additions:0,deletions:0});continue}let n=e.index!==` `&&e.index!==`?`,r=e.working_dir!==` `&&e.working_dir!==`?`;n&&te(d,t,s.get(t)??{additions:0,deletions:0},l.get(t)),r&&te(f,t,o.get(t)??{additions:0,deletions:0},c.get(t))}let g=0,_=0;for(let e of u.values())g+=e.additions,_+=e.deletions;return{staged:d,unstaged:f,untracked:p,conflicted:m,stats:{totalAdditions:g,totalDeletions:_,changedFiles:h.size}}}async function ac(e){let t=await e.status();return{staged:t.staged,modified:t.modified,untracked:t.not_added,conflicted:t.conflicted}}async function oc(e){let t=await e.raw([`worktree`,`list`,`--porcelain`]),n=[],r,i,a,o=()=>{if(r){let e=n.length===0;n.push({path:r,branch:a??`(detached)`,commit:i??``,isMain:e})}};for(let e of t.split(`
|
|
8
|
+
`);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var Mn,Nn=R({"src/lib/responses/ConfigList.ts"(){J(),Mn=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{}),this._all}addFile(e){if(!(e in this.values)){let t=tt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function Pn(e,t){return typeof e==`string`&&Object.hasOwn(zn,e)?e:t}function Fn(e,t,n,r){let i=[`config`,`--${r}`];return n&&i.push(`--add`),i.push(e,t),{commands:i,format:`utf-8`,parser(e){return e}}}function In(e,t){let n=[`config`,`--null`,`--show-origin`,`--get-all`,e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:`utf-8`,parser(t){return kn(t,e)}}}function Ln(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return On(e)}}}function Rn(){return{addConfig(e,t,...n){return this._runTask(Fn(e,t,n[0]===!0,Pn(n[1],`local`)),K(arguments))},getConfig(e,t){return this._runTask(In(e,Pn(t,void 0)),K(arguments))},listConfig(...e){return this._runTask(Ln(Pn(e[0],void 0)),K(arguments))}}}var zn,Bn=R({"src/lib/tasks/config.ts"(){Nn(),J(),zn=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(zn||{})}});function Vn(e){return Un.has(e)}var Hn,Un,Wn=R({"src/lib/tasks/diff-name-status.ts"(){Hn=(e=>(e.ADDED=`A`,e.COPIED=`C`,e.DELETED=`D`,e.MODIFIED=`M`,e.RENAMED=`R`,e.CHANGED=`T`,e.UNMERGED=`U`,e.UNKNOWN=`X`,e.BROKEN=`B`,e))(Hn||{}),Un=new Set(Object.values(Hn))}});function Gn(...e){return new Zn().param(...e)}function Kn(e){let t=new Set,n={};return it(e,e=>{let[r,i,a]=e.split(_t);t.add(r),(n[r]=n[r]||[]).push({line:V(i),path:r,preview:a})}),{paths:t,results:n}}function qn(){return{grep(e){let t=K(arguments),n=G(arguments);for(let e of Jn)if(n.includes(e))return this._runTask(Y(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=Gn().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return Kn(e)}},t)}}}var Jn,Yn,Xn,Zn,Qn=R({"src/lib/tasks/grep.ts"(){J(),Z(),Jn=[`-h`],Yn=Symbol(`grepQuery`),Zn=class{constructor(){this[Xn]=[]}*[(Xn=Yn,Symbol.iterator)](){for(let e of this[Yn])yield e}and(...e){return e.length&&this[Yn].push(`--and`,`(`,...ft(e,`-e`),`)`),this}param(...e){return this[Yn].push(...ft(e,`-e`)),this}}}}),$n={};z($n,{ResetMode:()=>rr,getResetMode:()=>tr,resetTask:()=>er});function er(e,t){let n=[`reset`];return nr(e)&&n.push(`--${e}`),n.push(...t),X(n)}function tr(e){if(nr(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function nr(e){return typeof e==`string`&&ir.includes(e)}var rr,ir,ar=R({"src/lib/tasks/reset.ts"(){J(),Z(),rr=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(rr||{}),ir=dt(Object.values(rr))}});function or(){return(0,se.default)(`simple-git`)}function sr(e,t,n){return!t||!String(t).replace(/\s*/,``)?n?(t,...r)=>{e(t,...r),n(t,...r)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function cr(e,t,{namespace:n}){if(typeof e==`string`)return e;let r=t&&t.namespace||``;return r.startsWith(n)?r.substr(n.length+1):r||n}function lr(e,t,n,r=or()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=cr(H(t,U),o,r);return l(n);function c(t,n){return ot(a,lr(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&sr(o,n)||vt,s=sr(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var ur=R({"src/lib/git-logger.ts"(){J(),se.default.formatters.L=e=>String(Dt(e)?e.length:`-`),se.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):yt(e)}}),dr,fr=R({"src/lib/runners/tasks-pending-queue.ts"(){Ke(),ur(),dr=class e{constructor(e=`GitExecutor`){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){let n=e.getName(t.commands[0]);return{task:t,logger:lr(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new Ge(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function pr(e,t){return{method:et(e.commands)||``,commands:t}}function mr(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function hr(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var gr,_r=R({"src/lib/runners/git-executor-chain.ts"(){Ke(),Z(),J(),fr(),gr=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new dr}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:t}=this._queue.attempt(e);return await(fn(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof Ge?Object.assign(t,{task:e}):new Ge(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,pr(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...pr(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),dn(e)?Ut(e.parser,a):Ut(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...pr(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,yt(e)),c(new jt(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(s)))},l);if(u)return r.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,i,s.length,a),l(u);r.info(`retrieving task output complete`),c(new jt(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let a=i.sibling(`output`),o=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},pr(e,e.commands));return new Promise(s=>{let c=[],l=[];i.info(`%s %o`,t,n),i(`%O`,o);let u=this._beforeSpawn(e,n);if(u)return s({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec(`spawn.before`,void 0,{...pr(e,n),kill(e){u=e||u}});let d=_(t,n,o);d.stdout.on(`data`,hr(c,`stdOut`,i,a.step(`stdOut`))),d.stderr.on(`data`,hr(l,`stdErr`,i,a.step(`stdErr`))),d.on(`error`,mr(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...pr(e,n),spawned:d,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...pr(e,t),kill(e){n=e||n}}),n}}}}),vr={};z(vr,{GitExecutor:()=>yr});var yr,br=R({"src/lib/runners/git-executor.ts"(){_r(),yr=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new gr(this,this._scheduler,this._plugins)}chain(){return new gr(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function xr(e,t,n=vt){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof qe?Sr(t):t,void 0)})}function Sr(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=vt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),n}}var Cr=R({"src/lib/task-callback.ts"(){Je(),J()}});function wr(e,t){return ln(n=>{if(!at(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var Tr=R({"src/lib/tasks/change-working-directory.ts"(){J(),Z()}});function Er(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=ct(t,`-B`)),X(t)}function Dr(){return{checkout(){return this._runTask(Er(G(arguments,1)),K(arguments))},checkoutBranch(e,t){return this._runTask(Er([`-b`,e,t,...G(arguments)]),K(arguments))},checkoutLocalBranch(e){return this._runTask(Er([`-b`,e,...G(arguments)]),K(arguments))}}}var Or=R({"src/lib/tasks/checkout.ts"(){J(),Z()}});function kr(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Ar(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return q(kr(),[jr],e)}})}}}var jr,Mr=R({"src/lib/tasks/count-objects.ts"(){J(),jr=new W(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=ut(t);Object.hasOwn(e,r)&&(e[r]=V(n))})}});function Nr(e){return q({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},Pr,e)}var Pr,Fr=R({"src/lib/parsers/parse-commit.ts"(){J(),Pr=[new W(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new W(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new W(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new W(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function Ir(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...ft(e,`-m`),...t,...n],format:`utf-8`,parser:Nr}}function Lr(){return{commit(t,...n){let r=K(arguments),i=e(t)||Ir(lt(t),lt(H(n[0],Et,[])),[...dt(H(n[1],wt,[])),...G(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!Et(e)&&Y(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var Rr=R({"src/lib/tasks/commit.ts"(){Fr(),J(),Z()}});function zr(){return{firstCommit(){return this._runTask(X([`rev-list`,`--max-parents=0`,`HEAD`],!0),K(arguments))}}}var Br=R({"src/lib/tasks/first-commit.ts"(){J(),Z()}});function Vr(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),X(n,!0)}var Hr=R({"src/lib/tasks/hash-object.ts"(){Z()}});function Ur(e,t,n){let r=String(n).trim(),i;if(i=Gr.exec(r))return new Wr(e,t,!1,i[1]);if(i=Kr.exec(r))return new Wr(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new Wr(e,t,/^re/i.test(r),a)}var Wr,Gr,Kr,qr=R({"src/lib/responses/InitSummary.ts"(){Wr=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},Gr=/^Init.+ repository in (.+)$/,Kr=/^Rein.+ in (.+)$/}});function Jr(e){return e.includes(Xr)}function Yr(e=!1,t,n){let r=[`init`,...n];return e&&!Jr(r)&&r.splice(1,0,Xr),{commands:r,format:`utf-8`,parser(e){return Ur(r.includes(`--bare`),t,e)}}}var Xr,Zr=R({"src/lib/tasks/init.ts"(){qr(),Xr=`--bare`}});function Qr(e){for(let t=0;t<e.length;t++){let n=ei.exec(e[t]);if(n)return`--${n[1]}`}return``}function $r(e){return ei.test(e)}var ei,ti=R({"src/lib/args/log-format.ts"(){ei=/^--(stat|numstat|name-only|name-status)(=|$)/}}),ni,ri=R({"src/lib/responses/DiffSummary.ts"(){ni=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function ii(e=``){let t=li[e];return e=>q(new ni,t,e,!1)}var ai,oi,si,ci,li,ui=R({"src/lib/parsers/parse-diff-summary.ts"(){ti(),ri(),Wn(),J(),ai=[new W(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:V(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new W(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:V(n),after:V(r),binary:!0})}),new W(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=V(t),e.insertions=V(r?.[1]),e.deletions=V(i?.[1])})],oi=[new W(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=V(t),a=V(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new W(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],si=[new W(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ci=[new W(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:gt(Vn(t)&&t),from:gt(!!a&&r!==a&&r),similarity:V(n)})})],li={"":ai,"--stat":ai,"--numstat":oi,"--name-status":ci,"--name-only":si}}});function di(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function fi(e=hi,t=gi,n=``){let r=ii(n);return function(n){let i=rt(n.trim(),!1,pi).map(function(n){let i=n.split(mi),a=di(i[0].split(e),t);return i.length>1&&i[1].trim()&&(a.diff=r(i[1])),a});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var pi,mi,hi,gi,_i=R({"src/lib/parsers/parse-list-log-summary.ts"(){J(),ui(),ti(),pi=`òòòòòò `,mi=` òò`,hi=` ò `,gi=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),vi={};z(vi,{diffSummaryTask:()=>yi,validateLogFormatConfig:()=>bi});function yi(e){let t=Qr(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),bi(n)||{commands:n,format:`utf-8`,parser:ii(t)}}function bi(e){let t=e.filter($r);if(t.length>1)return Y(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return Y(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var xi=R({"src/lib/tasks/diff.ts"(){ti(),ui(),Z()}});function Si(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function Ci(e){return Object.keys(e).reduce((t,n)=>(n in Di||(t[n]=e[n]),t),{})}function wi(e={},t=[]){let n=H(e.splitter,U,hi),[r,i]=Si(St(e.format)?e.format:{hash:`%H`,date:e.strictDate===!1?`%ai`:`%aI`,message:`%s`,refs:`%D`,body:e.multiLine?`%B`:`%b`,author_name:e.mailMap===!1?`%an`:`%aN`,author_email:e.mailMap===!1?`%ae`:`%aE`},n),a=[],o=[`--pretty=format:${pi}${i}${mi}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return U(e.file)&&o.push(`--follow`,ie(e.file)),zt(Ci(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function Ti(e,t,n){let r=fi(e,t,Qr(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function Ei(){return{log(...n){let r=K(arguments),i=wi(Vt(arguments),dt(H(arguments[0],wt,[]))),a=t(...n)||bi(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return Ti(e.splitter,e.fields,e.commands)}function t(e,t){return U(e)&&U(t)&&Y(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var Di,Oi=R({"src/lib/tasks/log.ts"(){ti(),_i(),J(),Z(),xi(),Di=(e=>(e[e[`--pretty`]=0]=`--pretty`,e[e[`max-count`]=1]=`max-count`,e[e.maxCount=2]=`maxCount`,e[e.n=3]=`n`,e[e.file=4]=`file`,e[e.format=5]=`format`,e[e.from=6]=`from`,e[e.to=7]=`to`,e[e.splitter=8]=`splitter`,e[e.symmetric=9]=`symmetric`,e[e.mailMap=10]=`mailMap`,e[e.multiLine=11]=`multiLine`,e[e.strictDate=12]=`strictDate`,e))(Di||{})}}),ki,Ai,ji=R({"src/lib/responses/MergeSummary.ts"(){ki=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Ai=class{constructor(){this.conflicts=[],this.merges=[],this.result=`success`}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(`, `)}`:`OK`}}}}),Mi,Ni,Pi=R({"src/lib/responses/PullSummary.ts"(){Mi=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ni=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function Fi(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Ii(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:V(t&&t[1]||`0`),delta:V(n&&n[1]||`0`)}}var Li,Ri=R({"src/lib/parsers/parse-remote-objects.ts"(){J(),Li=[new Pt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Fi(e.remoteMessages);Object.assign(i,{[r]:V(n)})}),new Pt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Fi(e.remoteMessages);Object.assign(i,{[r]:V(n)})}),new Pt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=Fi(e.remoteMessages);i.total=Ii(t),i.reused=Ii(n),i.packReused=V(r)})]}});function zi(e,t){return q({remoteMessages:new Vi},Bi,t)}var Bi,Vi,Hi=R({"src/lib/parsers/parse-remote-messages.ts"(){J(),Ri(),Bi=[new Pt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Li,new Pt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Pt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:V(t),summary:n,url:r}})],Vi=class{constructor(){this.all=[]}}}});function Ui(e,t){let n=q(new Ni,Ji,[e,t]);return n.message&&n}var Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi=R({"src/lib/parsers/parse-pull.ts"(){Pi(),J(),Hi(),Wi=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Gi=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Ki=/^(create|delete) mode \d+ (.+)/,qi=[new W(Wi,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new W(Gi,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new W(Ki,(e,[t,n])=>{ot(e.files,n),ot(t===`create`?e.created:e.deleted,n)})],Ji=[new W(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new W(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new W(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],Yi=(e,t)=>q(new Mi,qi,[e,t]),Xi=(e,t)=>Object.assign(new Mi,Yi(e,t),zi(e,t))}}),Qi,$i,ea,ta=R({"src/lib/parsers/parse-merge.ts"(){ji(),J(),Zi(),Qi=[new W(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new W(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new ki(t,n))}),new W(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new ki(t,n,{deleteRef:r}))}),new W(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new ki(t,null))}),new W(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],$i=(e,t)=>Object.assign(ea(e,t),Xi(e,t)),ea=e=>q(new Ai,Qi,e)}});function na(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=$i(e,t);if(n.failed)throw new qe(n);return n}}:Y(`Git.merge requires at least one option`)}var ra=R({"src/lib/tasks/merge.ts"(){Je(),ta(),Z()}});function ia(e,t,n){let r=n.includes(`deleted`),i=n.includes(`tag`)||/^refs\/tags/.test(e),a=!n.includes(`new`);return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var aa,oa,sa,ca=R({"src/lib/parsers/parse-push.ts"(){J(),Hi(),aa=[new W(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new W(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new W(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(ia(t,n,r))}),new W(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new W(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],oa=(e,t)=>{let n=sa(e,t),r=zi(e,t);return{...n,...r}},sa=(e,t)=>q({pushed:[]},aa,[e,t])}}),la={};z(la,{pushTagsTask:()=>ua,pushTask:()=>da});function ua(e={},t){return ot(t,`--tags`),da(e,t)}function da(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),ct(n,`-v`),ot(n,`--verbose`),ot(n,`--porcelain`),{commands:n,format:`utf-8`,parser:oa}}var fa=R({"src/lib/tasks/push.ts"(){ca(),J()}});function pa(){return{showBuffer(){let e=[`show`,...G(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(un(e),K(arguments))},show(){let e=[`show`,...G(arguments,1)];return this._runTask(X(e),K(arguments))}}}var ma=R({"src/lib/tasks/show.ts"(){J(),Z()}}),ha,ga,_a=R({"src/lib/responses/FileStatusSummary.ts"(){ha=/^(.+)\0(.+)$/,ga=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=ha.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function va(e){let[t,n]=e.split(_t);return{from:n||t,to:t}}function Q(e,t,n){return[`${e}${t}`,n]}function ya(e,...t){return t.map(t=>Q(e,t,(e,t)=>e.conflicted.push(t)))}function ba(e,t){let n=t.trim();switch(` `){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(` `,n.charAt(0),n.slice(2));default:return}function r(t,n,r){let i=`${t}${n}`,a=Sa.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new ga(r,t,n))}}var xa,Sa,Ca,wa=R({"src/lib/responses/StatusSummary.ts"(){J(),_a(),xa=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Sa=new Map([Q(` `,`A`,(e,t)=>e.created.push(t)),Q(` `,`D`,(e,t)=>e.deleted.push(t)),Q(` `,`M`,(e,t)=>e.modified.push(t)),Q(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),Q(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Q(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Q(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`R`,` `,(e,t)=>{e.renamed.push(va(t))}),Q(`R`,`M`,(e,t)=>{let n=va(t);e.renamed.push(n),e.modified.push(n.to)}),Q(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Q(`?`,`?`,(e,t)=>e.not_added.push(t)),...ya(`A`,`A`,`U`),...ya(`D`,`D`,`U`),...ya(`U`,`A`,`D`,`U`),[`##`,(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,s=n.exec(t);e.ahead=s&&+s[1]||0,s=r.exec(t),e.behind=s&&+s[1]||0,s=i.exec(t),e.current=H(s?.[1],U,null),s=a.exec(t),e.tracking=H(s?.[1],U,null),s=o.exec(t),s&&(e.current=H(s?.[1],U,e.current)),e.detached=/\(no branch\)/.test(t)}]]),Ca=function(e){let t=e.split(_t),n=new xa;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=_t+(t[e++]||``)),ba(n,r))}return n}}});function Ta(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!Ea.includes(e))],parser(e){return Ca(e)}}}var Ea,Da=R({"src/lib/tasks/status.ts"(){wa(),Ea=[`--null`,`-z`]}});function Oa(e=0,t=0,n=0,r=``,i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},`toString`,{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function ka(){return Oa(0,0,0,``,!1)}function Aa(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:ja,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(Ma));r(t)}})}}}function ja(e){return e===Ma?ka():q(Oa(0,0,0,e),Na,e)}var Ma,Na,Pa=R({"src/lib/tasks/version.ts"(){J(),Ma=`installed=false`,Na=[new W(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,Oa(V(t),V(n),V(r),i))}),new W(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,Oa(V(t),V(n),r,i))})]}});function Fa(e,t,n,...r){return U(n)?t(n,H(r[0],U),G(arguments)):Y(`git.${e}() requires a string 'repoPath'`)}function Ia(){return{clone(e,...t){return this._runTask(Fa(`clone`,La,H(e,U),...t),K(arguments))},mirror(e,...t){return this._runTask(Fa(`mirror`,Ra,H(e,U),...t),K(arguments))}}}var La,Ra,za=R({"src/lib/tasks/clone.ts"(){Z(),J(),La=(e,t,n)=>{let r=[`clone`,...n];return U(e)&&r.push(ie(e)),U(t)&&r.push(ie(t)),X(r)},Ra=(e,t,n)=>(ot(n,`--mirror`),La(e,t,n))}}),Ba={};z(Ba,{SimpleGitApi:()=>Va});var Va,Ha=R({"src/lib/simple-git-api.ts"(){Cr(),Tr(),Or(),Mr(),Rr(),Bn(),Br(),Qn(),Hr(),Zr(),Oi(),ra(),fa(),ma(),Da(),Z(),Pa(),J(),za(),Va=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&xr(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(X([`add`,...lt(e)]),K(arguments))}cwd(e){let t=K(arguments);return typeof e==`string`?this._runTask(wr(e,this._executor),t):typeof e?.path==`string`?this._runTask(wr(e.path,e.root&&this._executor||void 0),t):this._runTask(Y(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(Vr(e,t===!0),K(arguments))}init(e){return this._runTask(Yr(e===!0,this._executor.cwd,G(arguments)),K(arguments))}merge(){return this._runTask(na(G(arguments)),K(arguments))}mergeFromTo(e,t){return U(e)&&U(t)?this._runTask(na([e,t,...G(arguments)]),K(arguments,!1)):this._runTask(Y(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=da({remote:H(arguments[0],U),branch:H(arguments[1],U)},G(arguments));return this._runTask(e,K(arguments))}stash(){return this._runTask(X([`stash`,...G(arguments)]),K(arguments))}status(){return this._runTask(Ta(G(arguments)),K(arguments))}},Object.assign(Va.prototype,Dr(),Ia(),Lr(),Rn(),Ar(),zr(),qn(),Ei(),pa(),Aa())}}),Ua={};z(Ua,{Scheduler:()=>Ga});var Wa,Ga,Ka=R({"src/lib/runners/scheduler.ts"(){J(),ur(),Wa=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,ce.createDeferred)();return{promise:t,done:n,id:e}}})(),Ga=class{constructor(e=2){this.concurrency=e,this.logger=lr(``,`scheduler`),this.pending=[],this.running=[],this.logger(`Constructed, concurrency=%s`,e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`,this.pending.length,this.running.length,this.concurrency);return}let e=ot(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),ct(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=ot(this.pending,Wa());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),qa={};z(qa,{applyPatchTask:()=>Ja});function Ja(e,t){return X([`apply`,...t,...e])}var Ya=R({"src/lib/tasks/apply-patch.ts"(){Z()}});function Xa(e,t){return{branch:e,hash:t,success:!0}}function Za(e){return{branch:e,hash:null,success:!1}}var Qa,$a=R({"src/lib/responses/BranchDeleteSummary.ts"(){Qa=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function eo(e,t){return t===1&&no.test(e)}var to,no,ro,io,ao=R({"src/lib/parsers/parse-branch-delete.ts"(){$a(),J(),to=/(\S+)\s+\(\S+\s([^)]+)\)/,no=/^error[^']+'([^']+)'/m,ro=[new W(to,(e,[t,n])=>{let r=Xa(t,n);e.all.push(r),e.branches[t]=r}),new W(no,(e,[t])=>{let n=Za(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],io=(e,t)=>q(new Qa,ro,[e,t])}}),oo,so=R({"src/lib/responses/BranchSummary.ts"(){oo=class{constructor(){this.all=[],this.branches={},this.current=``,this.detached=!1}push(e,t,n,r,i){e===`*`&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e===`*`,linkedWorkTree:e===`+`,name:n,commit:r,label:i}}}}});function co(e){return e?e.charAt(0):``}function lo(e,t=!1){return q(new oo,t?[fo]:uo,e)}var uo,fo,po=R({"src/lib/parsers/parse-branch.ts"(){so(),J(),uo=[new W(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(co(t),!0,n,r,i)}),new W(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(co(t),!1,n,r,i)})],fo=new W(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),mo={};z(mo,{branchLocalTask:()=>_o,branchTask:()=>go,containsDeleteBranchCommand:()=>ho,deleteBranchTask:()=>yo,deleteBranchesTask:()=>vo});function ho(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function go(e){let t=ho(e),n=e.includes(`--show-current`),r=[`branch`,...e];return r.length===1&&r.push(`-a`),r.includes(`-v`)||r.splice(1,0,`-v`),{format:`utf-8`,commands:r,parser(e,r){return t?io(e,r).all[0]:lo(e,n)}}}function _o(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return lo(e)}}}function vo(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return io(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!eo(String(n),e))return i(n);r(t)}}}function yo(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return io(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!eo(String(i),e))return o(i);throw new qe(n.parser(pt(r),pt(t)),String(i))}};return n}var bo=R({"src/lib/tasks/branch.ts"(){Je(),ao(),po(),J()}});function xo(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&l(t)}var So,Co=R({"src/lib/responses/CheckIgnore.ts"(){So=e=>e.split(/\n/g).map(xo).filter(Boolean)}}),wo={};z(wo,{checkIgnoreTask:()=>To});function To(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:So}}var Eo=R({"src/lib/tasks/check-ignore.ts"(){Co()}});function Do(e,t){return q({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Oo,[e,t])}var Oo,ko=R({"src/lib/parsers/parse-fetch.ts"(){J(),Oo=[new W(/From (.+)$/,(e,[t])=>{e.remote=t}),new W(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new W(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new W(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new W(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),Ao={};z(Ao,{fetchTask:()=>Mo});function jo(e){return/^--upload-pack(=|$)/.test(e)}function Mo(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(jo)?Y(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:Do}}var No=R({"src/lib/tasks/fetch.ts"(){ko(),Z()}});function Po(e){return q({moves:[]},Fo,e)}var Fo,Io=R({"src/lib/parsers/parse-move.ts"(){J(),Fo=[new W(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Lo={};z(Lo,{moveTask:()=>Ro});function Ro(e,t){return{commands:[`mv`,`-v`,...lt(e),t],format:`utf-8`,parser:Po}}var zo=R({"src/lib/tasks/move.ts"(){Io(),J()}}),Bo={};z(Bo,{pullTask:()=>Vo});function Vo(e,t,n){let r=[`pull`,...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:`utf-8`,parser(e,t){return Xi(e,t)},onError(e,t,n,r){let i=Ui(pt(e.stdOut),pt(e.stdErr));if(i)return r(new qe(i));r(t)}}}var Ho=R({"src/lib/tasks/pull.ts"(){Je(),Zi(),J()}});function Uo(e){let t={};return Go(e,([e])=>t[e]={name:e}),Object.values(t)}function Wo(e){let t={};return Go(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:``,push:``}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,``)]=n)}),Object.values(t)}function Go(e,t){it(e,e=>t(e.split(/\s+/)))}var Ko=R({"src/lib/responses/GetRemoteSummary.ts"(){J()}}),qo={};z(qo,{addRemoteTask:()=>Jo,getRemotesTask:()=>Yo,listRemotesTask:()=>Xo,remoteTask:()=>Zo,removeRemoteTask:()=>Qo});function Jo(e,t,n){return X([`remote`,`add`,...n,e,t])}function Yo(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?Wo:Uo}}function Xo(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),X(t)}function Zo(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),X(t)}function Qo(e){return X([`remote`,`remove`,e])}var $o=R({"src/lib/tasks/remote.ts"(){Ko(),Z()}}),es={};z(es,{stashListTask:()=>ts});function ts(e={},t){let n=wi(e),r=[`stash`,`list`,...n.commands,...t],i=fi(n.splitter,n.fields,Qr(r));return bi(r)||{commands:r,format:`utf-8`,parser:i}}var ns=R({"src/lib/tasks/stash-list.ts"(){ti(),_i(),xi(),Oi()}}),rs={};z(rs,{addSubModuleTask:()=>is,initSubModuleTask:()=>as,subModuleTask:()=>os,updateSubModuleTask:()=>ss});function is(e,t){return os([`add`,e,t])}function as(e){return os([`init`,...e])}function os(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),X(t)}function ss(e){return os([`update`,...e])}var cs=R({"src/lib/tasks/sub-module.ts"(){Z()}});function ls(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?us(e,t):0:n?1:-1}function us(e,t){return e===t?0:e>t?1:-1}function ds(e){return e.trim()}function fs(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var ps,ms,hs=R({"src/lib/responses/TagList.ts"(){ps=class{constructor(e,t){this.all=e,this.latest=t}},ms=function(e,t=!1){let n=e.split(`
|
|
9
|
+
`).map(ds).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return ls(fs(n[0]),fs(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=us(fs(n[e]),fs(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new ps(n,r)}}}),gs={};z(gs,{addAnnotatedTagTask:()=>ys,addTagTask:()=>vs,tagListTask:()=>_s});function _s(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return ms(e,t)}}}function vs(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function ys(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var bs=R({"src/lib/tasks/tag.ts"(){hs()}}),xs=Ue({"src/git.js"(e,t){var{GitExecutor:n}=(br(),B(vr)),{SimpleGitApi:r}=(Ha(),B(Ba)),{Scheduler:i}=(Ka(),B(Ua)),{adhocExecTask:a,configurationErrorTask:o}=(Z(),B(cn)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(J(),B(Gt)),{applyPatchTask:ee}=(Ya(),B(qa)),{branchTask:g,branchLocalTask:_,deleteBranchesTask:te,deleteBranchTask:v}=(bo(),B(mo)),{checkIgnoreTask:ne}=(Eo(),B(wo)),{checkIsRepoTask:y}=(en(),B(Kt)),{cleanWithOptionsTask:b,isCleanOptionsArray:x}=(Dn(),B(mn)),{diffSummaryTask:re}=(xi(),B(vi)),{fetchTask:S}=(No(),B(Ao)),{moveTask:C}=(zo(),B(Lo)),{pullTask:w}=(Ho(),B(Bo)),{pushTagsTask:T}=(fa(),B(la)),{addRemoteTask:ie,getRemotesTask:ae,listRemotesTask:E,remoteTask:oe,removeRemoteTask:se}=($o(),B(qo)),{getResetMode:ce,resetTask:D}=(ar(),B($n)),{stashListTask:O}=(ns(),B(es)),{addSubModuleTask:k,initSubModuleTask:A,subModuleTask:le,updateSubModuleTask:j}=(cs(),B(rs)),{addAnnotatedTagTask:M,addTagTask:N,tagListTask:P}=(bs(),B(gs)),{straightThroughBufferTask:ue,straightThroughStringTask:F}=(Z(),B(cn));function I(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(I.prototype=Object.create(r.prototype)).constructor=I,I.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},I.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},I.prototype.stashList=function(e){return this._runTask(O(h(arguments)||{},c(e)&&e||[]),m(arguments))},I.prototype.mv=function(e,t){return this._runTask(C(e,t),m(arguments))},I.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},I.prototype.pull=function(e,t,n,r){return this._runTask(w(f(e,u),f(t,u),p(arguments)),m(arguments))},I.prototype.fetch=function(e,t){return this._runTask(S(f(e,u),f(t,u),p(arguments)),m(arguments))},I.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},I.prototype.tags=function(e,t){return this._runTask(P(p(arguments)),m(arguments))},I.prototype.rebase=function(){return this._runTask(F([`rebase`,...p(arguments)]),m(arguments))},I.prototype.reset=function(e){return this._runTask(D(ce(e),p(arguments)),m(arguments))},I.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(F([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},I.prototype.addTag=function(e){let t=typeof e==`string`?N(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},I.prototype.addAnnotatedTag=function(e,t){return this._runTask(M(e,t),m(arguments))},I.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(v(e,typeof t==`boolean`?t:!1),m(arguments))},I.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(te(e,typeof t==`boolean`?t:!1),m(arguments))},I.prototype.branch=function(e,t){return this._runTask(g(p(arguments)),m(arguments))},I.prototype.branchLocal=function(e){return this._runTask(_(),m(arguments))},I.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(F(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},I.prototype.submoduleAdd=function(e,t,n){return this._runTask(k(e,t),m(arguments))},I.prototype.submoduleUpdate=function(e,t){return this._runTask(j(p(arguments,!0)),m(arguments))},I.prototype.submoduleInit=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},I.prototype.subModule=function(e,t){return this._runTask(le(p(arguments)),m(arguments))},I.prototype.listRemote=function(){return this._runTask(E(p(arguments)),m(arguments))},I.prototype.addRemote=function(e,t,n){return this._runTask(ie(e,t,p(arguments)),m(arguments))},I.prototype.removeRemote=function(e,t){return this._runTask(se(e),m(arguments))},I.prototype.getRemotes=function(e,t){return this._runTask(ae(e===!0),m(arguments))},I.prototype.remote=function(e,t){return this._runTask(oe(p(arguments)),m(arguments))},I.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(F(n),m(arguments))},I.prototype.updateServerInfo=function(e){return this._runTask(F([`update-server-info`]),m(arguments))},I.prototype.pushTags=function(e,t){let n=T({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},I.prototype.rm=function(e){return this._runTask(F([`rm`,`-f`,...s(e)]),m(arguments))},I.prototype.rmKeepLocal=function(e){return this._runTask(F([`rm`,`--cached`,...s(e)]),m(arguments))},I.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},I.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},I.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?ue(r):F(r);return this._runTask(a,n)},I.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):F([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},I.prototype.diffSummary=function(){return this._runTask(re(p(arguments,1)),m(arguments))},I.prototype.applyPatch=function(e){let t=d(e)?ee(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},I.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(F(e,!0),m(arguments))},I.prototype.clean=function(e,t,n){let r=x(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(b(i,a),m(arguments))},I.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},I.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},I.prototype.checkIgnore=function(e,t){return this._runTask(ne(s(f(e,d,[]))),m(arguments))},I.prototype.checkIsRepo=function(e,t){return this._runTask(y(f(e,u)),m(arguments))},t.exports=I}});Ke();var Ss=class extends Ge{constructor(e,t){super(void 0,t),this.config=e}};Ke(),Ke();var Cs=class extends Ge{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Je(),Xe(),en(),Dn(),Bn(),Wn(),Qn(),ar();function ws(e){if(e)return[{type:`spawn.before`,action(t,n){e.aborted&&n.kill(new Cs(void 0,`abort`,`Abort already signaled`))}},{type:`spawn.after`,action(t,n){function r(){n.kill(new Cs(void 0,`abort`,`Abort signal received`))}e.addEventListener(`abort`,r),n.spawned.on(`close`,()=>e.removeEventListener(`abort`,r))}}]}function Ts(e={}){return{type:`spawn.args`,action(t,{env:n}){for(let r of Re(t,n))if(e[r.category]!==!0)throw new Cs(void 0,`unsafe`,r.message);return t}}}J();function Es(e){let t=ft(e,`-c`);return{type:`spawn.args`,action(e){return[...t,...e]}}}J();var Ds=(0,ce.deferred)().promise;function Os({onClose:e=!0,onExit:t=50}={}){function n(){let n=-1,i={close:(0,ce.deferred)(),closeTimeout:(0,ce.deferred)(),exit:(0,ce.deferred)(),exitTimeout:(0,ce.deferred)()},a=Promise.race([e===!1?Ds:i.closeTimeout.promise,t===!1?Ds:i.exitTimeout.promise]);return r(e,i.close,i.closeTimeout),r(t,i.exit,i.exitTimeout),{close(e){n=e,i.close.done()},exit(e){n=e,i.exit.done()},get exitCode(){return n},result:a}}function r(e,t,n){e!==!1&&(e===!0?t.promise:t.promise.then(()=>ht(e))).then(n.done)}return{type:`spawn.after`,async action(e,{spawned:t,close:r}){let i=n(),a=!0,o=()=>void(a=!1);t.stdout?.on(`data`,o),t.stderr?.on(`data`,o),t.on(`error`,o),t.on(`close`,e=>i.close(e)),t.on(`exit`,e=>i.exit(e));try{await i.result,a&&await ht(50),r(i.exitCode)}catch(e){r(i.exitCode,e)}}}}J();var ks=`Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`,As=`Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;function js(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function Ms(e,t){if(e.length<1||e.length>2)throw new Cs(void 0,`binary`,ks);if(e.some(js))if(t)console.warn(As);else throw new Cs(void 0,`binary`,As);let[n,r]=e;return{binary:n,prefix:r}}function Ns(e,t=[`git`],n=!1){let r=Ms(lt(t),n);e.on(`binary`,e=>{r=Ms(lt(e),n)}),e.append(`spawn.binary`,()=>r.binary),e.append(`spawn.args`,e=>r.prefix?[r.prefix,...e]:e)}Ke();function Ps(e){return!!(e.exitCode&&e.stdErr.length)}function Fs(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Is(e=!1,t=Ps,n=Fs){return(r,i)=>!e&&r||!t(i)?r:n(i)}function Ls(e){return{type:`task.error`,action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new Ge(void 0,r.toString(`utf-8`))}:{error:r}}}}J();var Rs=class{constructor(){this.plugins=new Set,this.events=new te}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=ot(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return lt(e).forEach(e=>e&&this.plugins.add(ot(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};J();function zs(e){let t=`--progress`,n=[`checkout`,`clone`,`fetch`,`pull`,`push`];return[{type:`spawn.args`,action(e,r){return n.includes(r.method)?st(e,t):e}},{type:`spawn.after`,action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on(`data`,t=>{let n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString(`utf8`));n&&e({method:r.method,stage:Bs(n[1]),progress:V(n[2]),processed:V(n[3]),total:V(n[4])})})}}]}function Bs(e){return String(e.toLowerCase().split(` `,1))||`unknown`}J();function Vs(e){let t=mt(e,[`uid`,`gid`]);return{type:`spawn.options`,action(e){return{...t,...e}}}}function Hs({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:`spawn.after`,action(r,i){let a;function o(){a&&clearTimeout(a),a=setTimeout(c,e)}function s(){i.spawned.stdout?.off(`data`,o),i.spawned.stderr?.off(`data`,o),i.spawned.off(`exit`,s),i.spawned.off(`close`,s),a&&clearTimeout(a)}function c(){s(),i.kill(new Cs(void 0,`timeout`,`block timeout reached`))}n&&i.spawned.stdout?.on(`data`,o),t&&i.spawned.stderr?.on(`data`,o),i.spawned.on(`exit`,s),i.spawned.on(`close`,s),o()}}}function Us(){return{type:`spawn.args`,action(e){let t=[],n;function r(e){(n||=[]).push(...e)}for(let n=0;n<e.length;n++){let i=e[n];if(ae(i)){r(E(i));continue}if(i===`--`){r(e.slice(n+1).flatMap(e=>ae(e)&&E(e)||e));break}t.push(i)}return n?[...t,`--`,...n.map(String)]:t}}}J();var Ws=xs();function Gs(e,t){let n=new Rs,r=It(e&&(typeof e==`string`?{baseDir:e}:e)||{},t);if(!at(r.baseDir))throw new Ss(r,`Cannot use simple-git on a directory that does not exist`);return Array.isArray(r.config)&&n.add(Es(r.config)),n.add(Ts(r.unsafe)),n.add(Os(r.completion)),r.abort&&n.add(ws(r.abort)),r.progress&&n.add(zs(r.progress)),r.timeout&&n.add(Hs(r.timeout)),r.spawnOptions&&n.add(Vs(r.spawnOptions)),n.add(Us()),n.add(Ls(Is(!0))),r.errors&&n.add(Ls(r.errors)),Ns(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new Ws(r,n)}Je();var Ks=Gs;function $(e){return Ks(e??process.cwd())}async function qs(e){try{return{root:(await Ks(e).revparse([`--show-toplevel`])).trim()}}catch{return{root:null}}}async function Js(e){let t=await e.status();return{current:t.current??``,isDetached:t.detached}}async function Ys(e,t){let n=(await e.log([t??`HEAD`,`-1`])).latest;if(!n)throw Error(`No commits found`);return{hash:n.hash,message:n.message,author:n.author_name,email:n.author_email,date:n.date}}function Xs(e){return e.split(`\0`).filter(e=>e.length>0)}function Zs(e){let t=new Map,n=Xs(e);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let i=r[0];if(!i)continue;if(i===`R`||i===`C`){let r=n[e+1],a=n[e+2];r&&a&&t.set(a,{status:i,oldPath:r}),e+=2;continue}let a=n[e+1];a&&t.set(a,{status:i}),e+=1}return t}function Qs(e){let t=Xs(e),n=[];for(let e=0;e<t.length;e+=1){let r=t[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){n.push({path:o,additions:s,deletions:c});continue}let l=t[e+1],u=t[e+2];u&&(n.push({path:u,additions:s,deletions:c,...l?{oldPath:l}:{}}),e+=2)}return n}async function $s(e,t){return(await e.raw([`rev-parse`,`--verify`,`--quiet`,`${t}^1`])).trim()?{args:[`diff-tree`,`-M`,`-r`,`--no-commit-id`],isRoot:!1}:{args:[`diff-tree`,`--root`,`-M`,`-r`,`--no-commit-id`],isRoot:!0}}async function ec(e,t){let n=[],r=0,i=0,a=await $s(e,t),o=a.isRoot?[t]:[`${t}^1`,t],[s,c]=await Promise.all([e.raw([...a.args,`--name-status`,`-z`,...o]),e.raw([...a.args,`--numstat`,`-z`,...o])]),l=Zs(s),u=Qs(c);for(let e of u){let t=l.get(e.path),a=t?.status??`M`,o=t?.oldPath??e.oldPath;r+=e.additions,i+=e.deletions,n.push({path:e.path,...o&&{oldPath:o},status:a,additions:e.additions,deletions:e.deletions})}return{files:n,stats:{totalAdditions:r,totalDeletions:i,changedFiles:n.length}}}function tc(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){t.set(o,{additions:s,deletions:c});continue}let l=n[e+2];l&&t.set(l,{additions:s,deletions:c}),e+=2}return t}function nc(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){if(!n[e]?.startsWith(`R`)){e+=1;continue}let r=n[e+1],i=n[e+2];r&&i&&t.set(i,r),e+=2}return t}function rc(e,t){for(let[n,r]of t){let t=e.get(n)??{additions:0,deletions:0};t.additions+=r.additions,t.deletions+=r.deletions,e.set(n,t)}}async function ic(e){let t=await e.status(),[n,r,i,a]=await Promise.all([e.raw([`diff`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--cached`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--name-status`,`-M`,`-z`]),e.raw([`diff`,`--cached`,`--name-status`,`-M`,`-z`])]),o=tc(n),s=tc(r),c=nc(i),l=nc(a),u=new Map;rc(u,o),rc(u,s);let d=[],f=[],p=[],m=[],h=new Set,ee=new Set(t.conflicted),g=(e,t,n,r)=>{e.push({path:t,additions:n.additions,deletions:n.deletions,...r?{oldPath:r}:{}}),h.add(t)};for(let e of t.files){let t=e.path;if(ee.has(t)){g(m,t,u.get(t)??{additions:0,deletions:0},c.get(t)??l.get(t));continue}if(e.index===`?`&&e.working_dir===`?`){g(p,t,{additions:0,deletions:0});continue}let n=e.index!==` `&&e.index!==`?`,r=e.working_dir!==` `&&e.working_dir!==`?`;n&&g(d,t,s.get(t)??{additions:0,deletions:0},l.get(t)),r&&g(f,t,o.get(t)??{additions:0,deletions:0},c.get(t))}let _=0,te=0;for(let e of u.values())_+=e.additions,te+=e.deletions;return{staged:d,unstaged:f,untracked:p,conflicted:m,stats:{totalAdditions:_,totalDeletions:te,changedFiles:h.size}}}async function ac(e){let t=await e.status();return{staged:t.staged,modified:t.modified,untracked:t.not_added,conflicted:t.conflicted}}async function oc(e){let t=await e.raw([`worktree`,`list`,`--porcelain`]),n=[],r,i,a,o=()=>{if(r){let e=n.length===0;n.push({path:r,branch:a??`(detached)`,commit:i??``,isMain:e})}};for(let e of t.split(`
|
|
10
10
|
`))e.startsWith(`worktree `)?(o(),r=e.slice(9),i=void 0,a=void 0):e.startsWith(`HEAD `)?i=e.slice(5):e.startsWith(`branch `)&&(a=e.slice(7).replace(`refs/heads/`,``));return o(),{worktrees:n}}async function sc(e,t=`main`){return await Ks(e).init([`--initial-branch`,t]),{success:!0,path:e,defaultBranch:t}}async function cc(e,t,n,r){try{let i=[`worktree`,`add`];return r?.createBranch?(i.push(`-b`,n,t),r.baseBranch&&i.push(r.baseBranch)):i.push(t,n),await e.raw(i),{success:!0,path:t,branch:n}}catch(e){return{success:!1,path:t,branch:n,error:e instanceof Error?e.message:String(e)}}}async function lc(e,t,n){try{let r;if(n?.deleteBranch){let n=await oc(e),i=await a.realpath(t).catch(()=>t),o=n.worktrees.find(e=>e.path===i);o&&o.branch!==`(detached)`&&(r=o.branch)}let i=[`worktree`,`remove`];return n?.force&&i.push(`--force`),i.push(t),await e.raw(i),r&&await e.branch([`-D`,r]),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:String(e)}}}async function uc(e){return{remotes:(await e.getRemotes(!0)).map(e=>({name:e.name,fetchUrl:e.refs.fetch??``,pushUrl:e.refs.push??e.refs.fetch??``}))}}async function dc(e){try{return{branch:(await e.raw([`symbolic-ref`,`refs/remotes/origin/HEAD`])).trim().replace(`refs/remotes/origin/`,``)}}catch{let t=await e.branchLocal();return t.all.includes(`main`)?{branch:`main`}:t.all.includes(`master`)?{branch:`master`}:{branch:t.current}}}async function fc(e){let[t,n,r,i]=await Promise.all([e.branchLocal(),e.branch([`-r`,`--format=%(refname:short) %(objectname)`]),e.tags(),e.revparse([`HEAD`])]),a={};await Promise.all(t.all.map(async t=>{try{a[t]=(await e.revparse([`refs/heads/${t}`])).trim()}catch{}}));let o={};for(let e of n.all){let t=n.branches[e];t&&(o[e]=t.commit)}let s={};for(let t of r.all)try{s[t]=(await e.revparse([t])).trim()}catch{}return{branches:a,remoteBranches:o,tags:s,HEAD:i.trim()}}async function pc(e,t){try{return(await e.raw([`log`,t,`--format=%H`])).trim().split(`
|
|
11
11
|
`).filter(Boolean)}catch{return[]}}function mc(e){let t=[];return e?.author&&t.push(`--author=${e.author}`),e?.since&&t.push(`--since=${e.since}`),e?.until&&t.push(`--until=${e.until}`),e?.searchQuery&&t.push(`--grep=${e.searchQuery}`),t}function hc(e){return e?.paths?.length?[`--`,...e.paths]:[]}function gc(e){return e.trim()?e.trim().split(`
|
|
12
|
-
`).map(e=>{let[t,n,r,i,a,o,s]=e.split(`\0`);return{hash:t,shortHash:n,message:r,author:i,email:a,date:o,parents:s?s.split(` `):[]}}):[]}async function _c(e,t,n){let r=n.branches??[],i=n.branchMode??`all`,a=[`log`,`--max-count=${t}`,`--format=%H%x00%h%x00%s%x00%an%x00%ae%x00%aI%x00%P`,...mc(n)];i===`specific`&&n.baseBranch?(a.push(...r),a.push(`--not`,n.baseBranch)):a.push(...r),a.push(...hc(n));let o=gc(await e.raw(a)),s=await fc(e);return{commits:o.slice(0,t-1),refs:s,truncated:o.length>=t}}async function vc(e,t,n,r){let i=[`log`,`--max-count=${t}`,`--format=%H%x00%h%x00%s%x00%an%x00%ae%x00%aI%x00%P`,...mc(r)];n&&i.push(n),i.push(...hc(r));let a=gc(await e.raw(i)),o=await fc(e);return{commits:a.slice(0,t-1),refs:o,truncated:a.length>=t}}function yc(e){let t={};return e?.author&&(t[`--author`]=e.author),e?.since&&(t[`--since`]=e.since),e?.until&&(t[`--until`]=e.until),e?.searchQuery&&(t[`--grep`]=e.searchQuery),t}async function bc(e,t,n,r){let i=t??1e3,a=i+1;if(r?.branches?.length)return _c(e,a,r);if((r?.paths?.length??0)>1)return vc(e,a,n,r??{});let o=await e.log({maxCount:a,format:{hash:`%H`,shortHash:`%h`,message:`%s`,author:`%an`,email:`%ae`,date:`%aI`,parents:`%P`},...n?{from:n}:{},...yc(r),...r?.paths?.length===1?{file:r.paths[0]}:{}}),s=o.all.length>i;return{commits:o.all.slice(0,i).map(e=>({hash:e.hash,shortHash:e.shortHash,message:e.message,author:e.author,email:e.email,date:e.date,parents:e.parents?e.parents.split(` `).filter(Boolean):[]})),refs:await fc(e),truncated:s}}function xc(e){return e.includes(`\0`)}function Sc(e){return e.filter(e=>e.length>0)}async function Cc(e,t,n){let r=await e.show([`${n}:${t}`]),i=xc(r);return{content:i?``:r,isBinary:i}}async function wc(e,t,n){try{let r=await e.show([`${n}:${t}`]),i=xc(r);return{content:i?null:r,isBinary:i}}catch{return{content:null,isBinary:!1}}}async function Tc(e,t,n){try{let r=await e.raw([`ls-tree`,n,`--`,t]);return r.trim()?{blobHash:r.trim().split(/\s+/)[2]??null}:{blobHash:null}}catch{return{blobHash:null}}}async function Ec(e,t,n,r,i){let a=[`diff`];return t?(await e.raw([`rev-list`,`--parents`,`-n`,`1`,t])).trim().split(/\s+/).length===1?a.push(`4b825dc642cb6eb9a060e54bf8d69288fbee4904`,t):a.push(`${t}^..${t}`):n&&a.push(`--cached`),typeof r==`number`&&a.push(`--unified=${r}`),i?.length&&a.push(`--`,...i),{diff:await e.raw(a)}}async function Dc(e,t){let n=Sc(t);if(n.length===0)return{success:!1,error:`No paths provided`};try{return await e.add(n),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Failed to stage files`}}}async function Oc(e,t){let n=Sc(t);if(n.length===0)return{success:!1,error:`No paths provided`};try{return await e.reset([`HEAD`,`--`,...n]),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Failed to unstage files`}}}const kc=ee(
|
|
13
|
-
`).filter(e=>e.length>0),r={repoPath:e.repoRoot,staged:n,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.staging,r)}async emitMergeEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ac(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ac(`name-rev --name-only ${await Ac(`rev-parse MERGE_HEAD`,n)}`,n)}catch{}let a=await Ac(`rev-parse HEAD`,n),o={repoPath:e.repoRoot,sourceBranch:i,targetBranch:r,mergeCommit:a,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.merge,o)}async emitRebaseEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ac(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ac(`rev-parse --abbrev-ref REBASE_HEAD~1`,n)}catch{}let a={repoPath:e.repoRoot,branch:r,onto:i,status:`started`,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.rebase,a)}async emitWorktreeEvent(e,t,n){let r=v.join(e.gitDir,`worktrees`,t,`gitdir`),i=Fc(e.repoRoot,t),a=t;if(n===`added`)try{i=await Ic(r),a=await Ac(`rev-parse --abbrev-ref HEAD`,i)}catch{}let o={repoPath:e.repoRoot,name:t,path:i,branch:a,event:n,timestamp:new Date().toISOString()};await this.bus.emit(h.worktree,o)}interpretChange(e,t){return jc(e,t)}};function Fc(e,t){return v.resolve(e,`..`,t)}async function Ic(e){let t=(await a.readFile(e,`utf8`)).trim(),n=v.resolve(v.dirname(e),t);return v.basename(n)===`.git`?v.dirname(n):n}var Lc=class{cache;index=new Map;constructor(e=20){this.cache=new i({maxSize:e,onEviction:(e,t)=>{this.removeIndexEntry(t.invalidationRoot,e)}})}get(e,t){let n=this.buildKey(e,t);return this.cache.get(n)?.response}set(e,t,n,r){let i=this.buildKey(e,t);this.cache.set(i,{response:r,timestamp:Date.now(),invalidationRoot:n});let a=this.index.get(n)??new Set;a.add(i),this.index.set(n,a)}invalidate(e){let t=this.index.get(e);if(t)for(let n of[...t])this.deleteEntry(e,n)}clear(){this.cache.clear(),this.index.clear()}deleteEntry(e,t){this.removeIndexEntry(e,t),this.cache.delete(t)}removeIndexEntry(e,t){let n=this.index.get(e);n&&(n.delete(t),n.size===0&&this.index.delete(e))}},Rc=class extends Lc{buildKey(e,t){let n={repoPath:t,limit:e.limit,ref:e.ref,filters:e.filters?{author:e.filters.author,baseBranch:e.filters.baseBranch,branchMode:e.filters.branchMode,branches:e.filters.branches?.slice().sort(),paths:e.filters.paths?.slice().sort(),searchQuery:e.filters.searchQuery,selectedWorktree:e.filters.selectedWorktree,since:e.filters.since,until:e.filters.until}:void 0};return JSON.stringify(n)}},zc=class extends Lc{buildKey(e,t){return JSON.stringify({repoPath:t})}},Bc=class extends Lc{buildKey(e,t){return JSON.stringify({repoPath:t,include:e.include.slice().sort(),exclude:e.exclude.slice().sort(),worktree:e.worktree})}},Vc=n(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),Hc=n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=Vc();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),Uc=n(((e,t)=>{let n=Hc(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:ee,CHAR_RIGHT_SQUARE_BRACKET:te}=Vc(),g=e=>e===l||e===a,_=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let v=t||{},ne=e.length-1,y=v.parts===!0||v.scanToEnd===!0,b=[],x=[],re=[],S=e,C=-1,w=0,T=0,ie=!1,ae=!1,E=!1,oe=!1,se=!1,ce=!1,D=!1,O=!1,k=!1,A=!1,le=0,j,M,N={value:``,depth:0,isGlob:!1},P=()=>C>=ne,ue=()=>S.charCodeAt(C+1),F=()=>(j=M,S.charCodeAt(++C));for(;C<ne;){M=F();let e;if(M===a){D=N.backslashes=!0,M=F(),M===u&&(ce=!0);continue}if(ce===!0||M===u){for(le++;P()!==!0&&(M=F());){if(M===a){D=N.backslashes=!0,F();continue}if(M===u){le++;continue}if(ce!==!0&&M===s&&(M=F())===s){if(ie=N.isBrace=!0,E=N.isGlob=!0,A=!0,y===!0)continue;break}if(ce!==!0&&M===o){if(ie=N.isBrace=!0,E=N.isGlob=!0,A=!0,y===!0)continue;break}if(M===h&&(le--,le===0)){ce=!1,ie=N.isBrace=!0,A=!0;break}}if(y===!0)continue;break}if(M===l){if(b.push(C),x.push(N),N={value:``,depth:0,isGlob:!1},A===!0)continue;if(j===s&&C===w+1){w+=2;continue}T=C+1;continue}if(v.noext!==!0&&(M===p||M===i||M===r||M===m||M===c)&&ue()===d){if(E=N.isGlob=!0,oe=N.isExtglob=!0,A=!0,M===c&&C===w&&(k=!0),y===!0){for(;P()!==!0&&(M=F());){if(M===a){D=N.backslashes=!0,M=F();continue}if(M===ee){E=N.isGlob=!0,A=!0;break}}continue}break}if(M===r){if(j===r&&(se=N.isGlobstar=!0),E=N.isGlob=!0,A=!0,y===!0)continue;break}if(M===m){if(E=N.isGlob=!0,A=!0,y===!0)continue;break}if(M===f){for(;P()!==!0&&(e=F());){if(e===a){D=N.backslashes=!0,F();continue}if(e===te){ae=N.isBracket=!0,E=N.isGlob=!0,A=!0;break}}if(y===!0)continue;break}if(v.nonegate!==!0&&M===c&&C===w){O=N.negated=!0,w++;continue}if(v.noparen!==!0&&M===d){if(E=N.isGlob=!0,y===!0){for(;P()!==!0&&(M=F());){if(M===d){D=N.backslashes=!0,M=F();continue}if(M===ee){A=!0;break}}continue}break}if(E===!0){if(A=!0,y===!0)continue;break}}v.noext===!0&&(oe=!1,E=!1);let I=S,de=``,fe=``;w>0&&(de=S.slice(0,w),S=S.slice(w),T-=w),I&&E===!0&&T>0?(I=S.slice(0,T),fe=S.slice(T)):E===!0?(I=``,fe=S):I=S,I&&I!==``&&I!==`/`&&I!==S&&g(I.charCodeAt(I.length-1))&&(I=I.slice(0,-1)),v.unescape===!0&&(fe&&=n.removeBackslashes(fe),I&&D===!0&&(I=n.removeBackslashes(I)));let pe={prefix:de,input:e,start:w,base:I,glob:fe,isBrace:ie,isBracket:ae,isGlob:E,isExtglob:oe,isGlobstar:se,negated:O,negatedExtglob:k};if(v.tokens===!0&&(pe.maxDepth=0,g(M)||x.push(N),pe.tokens=x),v.parts===!0||v.tokens===!0){let t;for(let n=0;n<b.length;n++){let r=t?t+1:w,i=b[n],a=e.slice(r,i);v.tokens&&(n===0&&w!==0?(x[n].isPrefix=!0,x[n].value=de):x[n].value=a,_(x[n]),pe.maxDepth+=x[n].depth),(n!==0||a!==``)&&re.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);re.push(n),v.tokens&&(x[x.length-1].value=n,_(x[x.length-1]),pe.maxDepth+=x[x.length-1].depth)}pe.slashes=b,pe.parts=re}return pe}})),Wc=n(((e,t)=>{let n=Vc(),r=Hc(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},ee=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},te=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},g=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};for(let e of i){let t=ee(e);if(t)return{risky:!0,safeOutput:t};if(te(e)>r)return{risky:!0}}return{risky:!1}},_=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],ee=d.capture?``:`?:`,te=n.globChars(d.windows),v=n.extglobChars(te),{DOT_LITERAL:ne,PLUS_LITERAL:y,SLASH_LITERAL:b,ONE_CHAR:x,DOTS_SLASH:re,NO_DOT:S,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK:T,QMARK_NO_DOT:ie,STAR:ae,START_ANCHOR:E}=te,oe=e=>`(${ee}(?:(?!${E}${e.dot?re:ne}).)*?)`,se=d.dot?``:S,ce=d.dot?T:ie,D=d.bash===!0?oe(d):ae;d.capture&&(D=`(${D})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let O={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,O),p=e.length;let k=[],A=[],le=[],j=m,M,N=()=>O.index===p-1,P=O.peek=(t=1)=>e[O.index+t],ue=O.advance=()=>e[++O.index]||``,F=()=>e.slice(O.index+1),I=(e=``,t=0)=>{O.consumed+=e,O.index+=t},de=e=>{O.output+=e.output==null?e.value:e.output,I(e.value)},fe=()=>{let e=1;for(;P()===`!`&&(P(2)!==`(`||P(3)===`?`);)ue(),O.start++,e++;return e%2==0?!1:(O.negated=!0,O.start++,!0)},pe=e=>{O[e]++,le.push(e)},me=e=>{O[e]--,le.pop()},L=e=>{if(j.type===`globstar`){let t=O.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||k.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(O.output=O.output.slice(0,-j.output.length),j.type=`star`,j.value=`*`,j.output=D,O.output+=j.output)}if(k.length&&e.type!==`paren`&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&de(e),j&&j.type===`text`&&e.type===`text`){j.output=(j.output||j.value)+e.value,j.value+=e.value;return}e.prev=j,h.push(e),j=e},he=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=j,n.parens=O.parens,n.output=O.output,n.startIndex=O.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;pe(`parens`),L({type:e,value:t,output:O.output?``:x}),L({type:`paren`,extglob:!0,value:ue(),output:r}),k.push(n)},ge=n=>{let i=e.slice(n.startIndex,O.index+1),a=g(e.slice(n.startIndex+2,O.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:x)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;O.output=n.output+t.output,O.backtrack=!0,L({type:`paren`,extglob:!0,value:M,output:``}),me(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=D;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=oe(d)),(e!==D||N()||/^\)+$/.test(F()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=F())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${_(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(O.negatedExtglob=!0)}L({type:`paren`,extglob:!0,value:M,output:o}),me(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?T.repeat(a.length):``):o===0?ce+(a?T.repeat(a.length):``):T.repeat(r.length):i===`.`?ne.repeat(r.length):i===`*`?t?t+i+(a?D:``):D:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(O.output=e,O):(O.output=r.wrapOutput(i,O,t),O)}for(;!N();){if(M=ue(),M===`\0`)continue;if(M===`\\`){let e=P();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){M+=`\\`,L({type:`text`,value:M});continue}let t=/^\\+/.exec(F()),n=0;if(t&&t[0].length>2&&(n=t[0].length,O.index+=n,n%2!=0&&(M+=`\\`)),d.unescape===!0?M=ue():M+=ue(),O.brackets===0){L({type:`text`,value:M});continue}}if(O.brackets>0&&(M!==`]`||j.value===`[`||j.value===`[^`)){if(d.posix!==!1&&M===`:`){let e=j.value.slice(1);if(e.includes(`[`)&&(j.posix=!0,e.includes(`:`))){let e=j.value.lastIndexOf(`[`),t=j.value.slice(0,e),n=a[j.value.slice(e+2)];if(n){j.value=t+n,O.backtrack=!0,ue(),!m.output&&h.indexOf(j)===1&&(m.output=x);continue}}}(M===`[`&&P()!==`:`||M===`-`&&P()===`]`)&&(M=`\\${M}`),M===`]`&&(j.value===`[`||j.value===`[^`)&&(M=`\\${M}`),d.posix===!0&&M===`!`&&j.value===`[`&&(M=`^`),j.value+=M,de({value:M});continue}if(O.quotes===1&&M!==`"`){M=r.escapeRegex(M),j.value+=M,de({value:M});continue}if(M===`"`){O.quotes=O.quotes===1?0:1,d.keepQuotes===!0&&L({type:`text`,value:M});continue}if(M===`(`){pe(`parens`),L({type:`paren`,value:M});continue}if(M===`)`){if(O.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=k[k.length-1];if(e&&O.parens===e.parens+1){ge(k.pop());continue}L({type:`paren`,value:M,output:O.parens?`)`:`\\)`}),me(`parens`);continue}if(M===`[`){if(d.nobracket===!0||!F().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));M=`\\${M}`}else pe(`brackets`);L({type:`bracket`,value:M});continue}if(M===`]`){if(d.nobracket===!0||j&&j.type===`bracket`&&j.value.length===1){L({type:`text`,value:M,output:`\\${M}`});continue}if(O.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));L({type:`text`,value:M,output:`\\${M}`});continue}me(`brackets`);let e=j.value.slice(1);if(j.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(M=`/${M}`),j.value+=M,de({value:M}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(j.value);if(O.output=O.output.slice(0,-j.value.length),d.literalBrackets===!0){O.output+=t,j.value=t;continue}j.value=`(${ee}${t}|${j.value})`,O.output+=j.value;continue}if(M===`{`&&d.nobrace!==!0){pe(`braces`);let e={type:`brace`,value:M,output:`(`,outputIndex:O.output.length,tokensIndex:O.tokens.length};A.push(e),L(e);continue}if(M===`}`){let e=A[A.length-1];if(d.nobrace===!0||!e){L({type:`text`,value:M,output:M});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),O.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=O.output.slice(0,e.outputIndex),r=O.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,M=t=`\\}`,O.output=n;for(let e of r)O.output+=e.output||e.value}L({type:`brace`,value:M,output:t}),me(`braces`),A.pop();continue}if(M===`|`){k.length>0&&k[k.length-1].conditions++,L({type:`text`,value:M});continue}if(M===`,`){let e=M,t=A[A.length-1];t&&le[le.length-1]===`braces`&&(t.comma=!0,e=`|`),L({type:`comma`,value:M,output:e});continue}if(M===`/`){if(j.type===`dot`&&O.index===O.start+1){O.start=O.index+1,O.consumed=``,O.output=``,h.pop(),j=m;continue}L({type:`slash`,value:M,output:b});continue}if(M===`.`){if(O.braces>0&&j.type===`dot`){j.value===`.`&&(j.output=ne);let e=A[A.length-1];j.type=`dots`,j.output+=M,j.value+=M,e.dots=!0;continue}if(O.braces+O.parens===0&&j.type!==`bos`&&j.type!==`slash`){L({type:`text`,value:M,output:ne});continue}L({type:`dot`,value:M,output:ne});continue}if(M===`?`){if(!(j&&j.value===`(`)&&d.noextglob!==!0&&P()===`(`&&P(2)!==`?`){he(`qmark`,M);continue}if(j&&j.type===`paren`){let e=P(),t=M;(j.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(F()))&&(t=`\\${M}`),L({type:`text`,value:M,output:t});continue}if(d.dot!==!0&&(j.type===`slash`||j.type===`bos`)){L({type:`qmark`,value:M,output:ie});continue}L({type:`qmark`,value:M,output:T});continue}if(M===`!`){if(d.noextglob!==!0&&P()===`(`&&(P(2)!==`?`||!/[!=<:]/.test(P(3)))){he(`negate`,M);continue}if(d.nonegate!==!0&&O.index===0){fe();continue}}if(M===`+`){if(d.noextglob!==!0&&P()===`(`&&P(2)!==`?`){he(`plus`,M);continue}if(j&&j.value===`(`||d.regex===!1){L({type:`plus`,value:M,output:y});continue}if(j&&(j.type===`bracket`||j.type===`paren`||j.type===`brace`)||O.parens>0){L({type:`plus`,value:M});continue}L({type:`plus`,value:y});continue}if(M===`@`){if(d.noextglob!==!0&&P()===`(`&&P(2)!==`?`){L({type:`at`,extglob:!0,value:M,output:``});continue}L({type:`text`,value:M});continue}if(M!==`*`){(M===`$`||M===`^`)&&(M=`\\${M}`);let e=o.exec(F());e&&(M+=e[0],O.index+=e[0].length),L({type:`text`,value:M});continue}if(j&&(j.type===`globstar`||j.star===!0)){j.type=`star`,j.star=!0,j.value+=M,j.output=D,O.backtrack=!0,O.globstar=!0,I(M);continue}let t=F();if(d.noextglob!==!0&&/^\([^?]/.test(t)){he(`star`,M);continue}if(j.type===`star`){if(d.noglobstar===!0){I(M);continue}let n=j.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){L({type:`star`,value:M,output:``});continue}let o=O.braces>0&&(n.type===`comma`||n.type===`brace`),s=k.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){L({type:`star`,value:M,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[O.index+4];if(n&&n!==`/`)break;t=t.slice(3),I(`/**`,3)}if(n.type===`bos`&&N()){j.type=`globstar`,j.value+=M,j.output=oe(d),O.output=j.output,O.globstar=!0,I(M);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&N()){O.output=O.output.slice(0,-(n.output+j.output).length),n.output=`(?:${n.output}`,j.type=`globstar`,j.output=oe(d)+(d.strictSlashes?`)`:`|$)`),j.value+=M,O.globstar=!0,O.output+=n.output+j.output,I(M);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;O.output=O.output.slice(0,-(n.output+j.output).length),n.output=`(?:${n.output}`,j.type=`globstar`,j.output=`${oe(d)}${b}|${b}${e})`,j.value+=M,O.output+=n.output+j.output,O.globstar=!0,I(M+ue()),L({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){j.type=`globstar`,j.value+=M,j.output=`(?:^|${b}|${oe(d)}${b})`,O.output=j.output,O.globstar=!0,I(M+ue()),L({type:`slash`,value:`/`,output:``});continue}O.output=O.output.slice(0,-j.output.length),j.type=`globstar`,j.output=oe(d),j.value+=M,O.output+=j.output,O.globstar=!0,I(M);continue}let n={type:`star`,value:M,output:D};if(d.bash===!0){n.output=`.*?`,(j.type===`bos`||j.type===`slash`)&&(n.output=se+n.output),L(n);continue}if(j&&(j.type===`bracket`||j.type===`paren`)&&d.regex===!0){n.output=M,L(n);continue}(O.index===O.start||j.type===`slash`||j.type===`dot`)&&(j.type===`dot`?(O.output+=C,j.output+=C):d.dot===!0?(O.output+=w,j.output+=w):(O.output+=se,j.output+=se),P()!==`*`&&(O.output+=x,j.output+=x)),L(n)}for(;O.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));O.output=r.escapeLast(O.output,`[`),me(`brackets`)}for(;O.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));O.output=r.escapeLast(O.output,`(`),me(`parens`)}for(;O.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));O.output=r.escapeLast(O.output,`{`),me(`braces`)}if(d.strictSlashes!==!0&&(j.type===`star`||j.type===`bracket`)&&L({type:`maybe_slash`,value:``,output:`${b}?`}),O.backtrack===!0){O.output=``;for(let e of O.tokens)O.output+=e.output==null?e.value:e.output,e.suffix&&(O.output+=e.suffix)}return O};_.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:ee,START_ANCHOR:te}=n.globChars(a.windows),g=a.dot?m:p,_=a.dot?h:p,v=a.capture?``:`?:`,ne={negated:!1,prefix:``},y=a.bash===!0?`.*?`:ee;a.capture&&(y=`(${y})`);let b=e=>e.noglobstar===!0?y:`(${v}(?:(?!${te}${e.dot?f:l}).)*?)`,x=e=>{switch(e){case`*`:return`${g}${d}${y}`;case`.*`:return`${l}${d}${y}`;case`*.*`:return`${g}${y}${l}${d}${y}`;case`*/*`:return`${g}${y}${u}${d}${_}${y}`;case`**`:return g+b(a);case`**/*`:return`(?:${g}${b(a)}${u})?${_}${d}${y}`;case`**/*.*`:return`(?:${g}${b(a)}${u})?${_}${y}${l}${d}${y}`;case`**/.*`:return`(?:${g}${b(a)}${u})?${l}${d}${y}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=x(t[1]);return n?n+l+t[2]:void 0}}},re=x(r.removePrefix(e,ne));return re&&a.strictSlashes!==!0&&(re+=`${u}?`),re},t.exports=_})),Gc=n(((e,t)=>{let n=Uc(),r=Wc(),i=Hc(),a=Vc(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),Kc=t(n(((e,t)=>{let n=Gc(),r=Hc();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);const qc=`0`.repeat(40);function Jc(e){return e.map(e=>(0,Kc.default)(e,{dot:!0}))}function Yc(e,t){return t.some(t=>t(e))}function Xc(e,t,n){return e.filter(e=>Yc(e,t)&&!Yc(e,n))}async function Zc(e,t,n,r){let i=r??e,a=Ks(i),s=Jc(t.length>0?t:[`**`]),l=Jc(n),d=qc,f=!0;try{d=(await a.revparse([`HEAD`])).trim()}catch{f=!1}let p=f?(await a.raw([`diff`,`HEAD`,`--name-only`])).trim().split(`
|
|
12
|
+
`).map(e=>{let[t,n,r,i,a,o,s]=e.split(`\0`);return{hash:t,shortHash:n,message:r,author:i,email:a,date:o,parents:s?s.split(` `):[]}}):[]}async function _c(e,t,n){let r=n.branches??[],i=n.branchMode??`all`,a=[`log`,`--max-count=${t}`,`--format=%H%x00%h%x00%s%x00%an%x00%ae%x00%aI%x00%P`,...mc(n)];i===`specific`&&n.baseBranch?(a.push(...r),a.push(`--not`,n.baseBranch)):a.push(...r),a.push(...hc(n));let o=gc(await e.raw(a)),s=await fc(e);return{commits:o.slice(0,t-1),refs:s,truncated:o.length>=t}}async function vc(e,t,n,r){let i=[`log`,`--max-count=${t}`,`--format=%H%x00%h%x00%s%x00%an%x00%ae%x00%aI%x00%P`,...mc(r)];n&&i.push(n),i.push(...hc(r));let a=gc(await e.raw(i)),o=await fc(e);return{commits:a.slice(0,t-1),refs:o,truncated:a.length>=t}}function yc(e){let t={};return e?.author&&(t[`--author`]=e.author),e?.since&&(t[`--since`]=e.since),e?.until&&(t[`--until`]=e.until),e?.searchQuery&&(t[`--grep`]=e.searchQuery),t}async function bc(e,t,n,r){let i=t??1e3,a=i+1;if(r?.branches?.length)return _c(e,a,r);if((r?.paths?.length??0)>1)return vc(e,a,n,r??{});let o=await e.log({maxCount:a,format:{hash:`%H`,shortHash:`%h`,message:`%s`,author:`%an`,email:`%ae`,date:`%aI`,parents:`%P`},...n?{from:n}:{},...yc(r),...r?.paths?.length===1?{file:r.paths[0]}:{}}),s=o.all.length>i;return{commits:o.all.slice(0,i).map(e=>({hash:e.hash,shortHash:e.shortHash,message:e.message,author:e.author,email:e.email,date:e.date,parents:e.parents?e.parents.split(` `).filter(Boolean):[]})),refs:await fc(e),truncated:s}}function xc(e){return e.includes(`\0`)}function Sc(e){return e.filter(e=>e.length>0)}async function Cc(e,t,n){let r=await e.show([`${n}:${t}`]),i=xc(r);return{content:i?``:r,isBinary:i}}async function wc(e,t,n){try{let r=await e.show([`${n}:${t}`]),i=xc(r);return{content:i?null:r,isBinary:i}}catch{return{content:null,isBinary:!1}}}async function Tc(e,t,n){try{let r=await e.raw([`ls-tree`,n,`--`,t]);return r.trim()?{blobHash:r.trim().split(/\s+/)[2]??null}:{blobHash:null}}catch{return{blobHash:null}}}async function Ec(e,t,n,r,i){let a=[`diff`];return t?(await e.raw([`rev-list`,`--parents`,`-n`,`1`,t])).trim().split(/\s+/).length===1?a.push(`4b825dc642cb6eb9a060e54bf8d69288fbee4904`,t):a.push(`${t}^..${t}`):n&&a.push(`--cached`),typeof r==`number`&&a.push(`--unified=${r}`),i?.length&&a.push(`--`,...i),{diff:await e.raw(a)}}async function Dc(e,t){let n=Sc(t);if(n.length===0)return{success:!1,error:`No paths provided`};try{return await e.add(n),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Failed to stage files`}}}async function Oc(e,t){let n=Sc(t);if(n.length===0)return{success:!1,error:`No paths provided`};try{return await e.reset([`HEAD`,`--`,...n]),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Failed to unstage files`}}}const kc=ee(g);async function Ac(e,t){let{stdout:n}=await kc(`git ${e}`,{cwd:t});return n.trim()}function jc(e,t){let n=t.path.slice(e.length+1),r=n.match(/^worktrees\/([^/]+)(?:\/(.*))?$/);if(r){let[,e,n]=r;return Mc(e,n,t.kind)}return Nc(n)}function Mc(e,t,n){if(!t)return n===`create`?{type:`worktree-added`,worktree:e}:n===`delete`?{type:`worktree-removed`,worktree:e}:null;if(t===`gitdir`){if(n===`create`)return{type:`worktree-added`,worktree:e};if(n===`delete`)return{type:`worktree-removed`,worktree:e}}return t===`HEAD`?{type:`checkout`,worktree:e}:t===`index`?{type:`staging`,worktree:e}:t===`MERGE_HEAD`||t===`CHERRY_PICK_HEAD`?{type:`merge`,worktree:e}:t===`REBASE_HEAD`||t.startsWith(`rebase-merge/`)?{type:`rebase`,worktree:e}:null}function Nc(e){return e.startsWith(`refs/heads/`)?{type:`commit`,worktree:void 0}:e===`HEAD`?{type:`checkout`,worktree:void 0}:e===`index`?{type:`staging`,worktree:void 0}:e===`MERGE_HEAD`||e===`CHERRY_PICK_HEAD`?{type:`merge`,worktree:void 0}:e===`REBASE_HEAD`||e.startsWith(`rebase-merge/`)?{type:`rebase`,worktree:void 0}:null}var Pc=class{bus;watchers=new Map;unsubFsChanged=null;unsubAddRepo=null;unsubRemoveRepo=null;initialized=!1;constructor(e){this.bus=e}async init(){this.initialized||=(this.unsubAddRepo=this.bus.on(h.addRepo,async e=>{let t=await this.addRepo(e.payload.repoPath);e.setResult(t)}),this.unsubRemoveRepo=this.bus.on(h.removeRepo,async e=>{let t=await this.removeRepo(e.payload.repoPath);e.setResult(t)}),this.unsubFsChanged=this.bus.on(ne.changed,async e=>{await this.handleFsChange(e.payload)}),!0)}async destroy(){this.unsubFsChanged?.(),this.unsubAddRepo?.(),this.unsubRemoveRepo?.(),this.unsubFsChanged=null,this.unsubAddRepo=null,this.unsubRemoveRepo=null;let e=[...this.watchers.keys()];await Promise.all(e.map(e=>this.removeRepo(e))),this.initialized=!1}async addRepo(e){if(this.watchers.has(e))return{success:!0};let t=`git-watcher-${e}`;try{let n=await this.resolveGitDir(e);return await this.bus.request(ne.watch,{id:t,paths:[n],excludeFromDefaults:[`**/.git/**`]}),this.watchers.set(e,{repoRoot:e,gitDir:n,watchId:t}),{success:!0}}catch(e){return{success:!1,error:String(e)}}}async resolveGitDir(e){let t=v.join(e,`.git`),n;try{n=await a.stat(t)}catch(t){throw t?.code===`ENOENT`?Error(`Not a git repository: no .git found at ${e}`):t}if(n.isDirectory())return t;if(!n.isFile())throw Error(`Unsupported .git entry at ${t} (expected file or directory).`);let r=(await a.readFile(t,`utf8`)).trim();if(!r.toLowerCase().startsWith(`gitdir:`))throw Error(`Invalid .git file format at ${t}.`);let i=r.slice(7).trim();if(i.length===0)throw Error(`Empty gitdir reference in ${t}.`);let o=v.resolve(v.dirname(t),i),s;try{s=await a.stat(o)}catch(e){throw e?.code===`ENOENT`?Error(`Invalid .git gitdir reference at ${t}: path does not exist (${o}).`):e}if(!s.isDirectory())throw Error(`Invalid .git gitdir reference at ${t}: expected directory, found ${o}.`);return o}async removeRepo(e){let t=this.watchers.get(e);if(!t)return{success:!0};try{await this.bus.request(ne.unwatch,{id:t.watchId})}catch{}return this.watchers.delete(e),{success:!0}}async handleFsChange(e){let t=[];for(let[,n]of this.watchers){let r=v.relative(n.gitDir,e.path);!r.startsWith(`..`)&&!v.isAbsolute(r)&&t.push(n)}if(t.length!==0){t.sort((e,t)=>t.gitDir.length-e.gitDir.length);for(let n of t)if(await this.handleRepoChange(n,e))return}}isSuppressibleOperation(e){return e===`commit`||e===`checkout`}async isCoveredByNativeHook(e,t,n){try{let r=await this.bus.requestOptional(d.coverage,{repoPath:e.repoRoot,operation:t,...n!==void 0&&{worktree:n}});return r.handled&&r.data.covered}catch(r){return console.debug(`[GitWatcher] Git hook coverage check failed; preserving fs fallback emission.`,{repoPath:e.repoRoot,operation:t,worktree:n,error:r}),!1}}async handleRepoChange(e,t){let n=jc(e.gitDir,t);if(!n)return!1;if(this.isSuppressibleOperation(n.type)&&await this.isCoveredByNativeHook(e,n.type,n.worktree))return!0;try{await{commit:t=>this.emitCommitEvent(e,t),checkout:t=>this.emitCheckoutEvent(e,t),staging:t=>this.emitStagingEvent(e,t),merge:t=>this.emitMergeEvent(e,t),rebase:t=>this.emitRebaseEvent(e,t),"worktree-added":t=>this.emitWorktreeEvent(e,t,`added`),"worktree-removed":t=>this.emitWorktreeEvent(e,t,`removed`)}[n.type](n.worktree)}catch(n){return console.debug(`[GitWatcher] Failed to emit git event for fs change; trying less-specific watcher if available.`,{repoPath:e.repoRoot,changePath:t.path,error:n}),!1}return!0}async getWorkingDir(e,t){return t?Ic(v.join(e.gitDir,`worktrees`,t,`gitdir`)):e.repoRoot}async emitCommitEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ac(`log -1 --format="%H%x00%s%x00%an%x00%ae%x00%aI"`,n),i=await Ac(`rev-parse --abbrev-ref HEAD`,n),[a,o,s,c,l]=r.split(`\0`),u={repoPath:e.repoRoot,hash:a,message:o,author:s,email:c,branch:i,timestamp:l,worktree:t};await this.bus.emit(h.commit,u)}async emitCheckoutEvent(e,t){let n=await Ac(`rev-parse --abbrev-ref HEAD`,await this.getWorkingDir(e,t)),r={repoPath:e.repoRoot,currentBranch:n,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.checkout,r)}async emitStagingEvent(e,t){let n=(await Ac(`diff --cached --name-only`,await this.getWorkingDir(e,t))).split(`
|
|
13
|
+
`).filter(e=>e.length>0),r={repoPath:e.repoRoot,staged:n,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.staging,r)}async emitMergeEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ac(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ac(`name-rev --name-only ${await Ac(`rev-parse MERGE_HEAD`,n)}`,n)}catch{}let a=await Ac(`rev-parse HEAD`,n),o={repoPath:e.repoRoot,sourceBranch:i,targetBranch:r,mergeCommit:a,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.merge,o)}async emitRebaseEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ac(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ac(`rev-parse --abbrev-ref REBASE_HEAD~1`,n)}catch{}let a={repoPath:e.repoRoot,branch:r,onto:i,status:`started`,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.rebase,a)}async emitWorktreeEvent(e,t,n){let r=v.join(e.gitDir,`worktrees`,t,`gitdir`),i=Fc(e.repoRoot,t),a=t;if(n===`added`)try{i=await Ic(r),a=await Ac(`rev-parse --abbrev-ref HEAD`,i)}catch{}let o={repoPath:e.repoRoot,name:t,path:i,branch:a,event:n,timestamp:new Date().toISOString()};await this.bus.emit(h.worktree,o)}interpretChange(e,t){return jc(e,t)}};function Fc(e,t){return v.resolve(e,`..`,t)}async function Ic(e){let t=(await a.readFile(e,`utf8`)).trim(),n=v.resolve(v.dirname(e),t);return v.basename(n)===`.git`?v.dirname(n):n}var Lc=class{cache;index=new Map;constructor(e=20){this.cache=new i({maxSize:e,onEviction:(e,t)=>{this.removeIndexEntry(t.invalidationRoot,e)}})}get(e,t){let n=this.buildKey(e,t);return this.cache.get(n)?.response}set(e,t,n,r){let i=this.buildKey(e,t);this.cache.set(i,{response:r,timestamp:Date.now(),invalidationRoot:n});let a=this.index.get(n)??new Set;a.add(i),this.index.set(n,a)}invalidate(e){let t=this.index.get(e);if(t)for(let n of[...t])this.deleteEntry(e,n)}clear(){this.cache.clear(),this.index.clear()}deleteEntry(e,t){this.removeIndexEntry(e,t),this.cache.delete(t)}removeIndexEntry(e,t){let n=this.index.get(e);n&&(n.delete(t),n.size===0&&this.index.delete(e))}},Rc=class extends Lc{buildKey(e,t){let n={repoPath:t,limit:e.limit,ref:e.ref,filters:e.filters?{author:e.filters.author,baseBranch:e.filters.baseBranch,branchMode:e.filters.branchMode,branches:e.filters.branches?.slice().sort(),paths:e.filters.paths?.slice().sort(),searchQuery:e.filters.searchQuery,selectedWorktree:e.filters.selectedWorktree,since:e.filters.since,until:e.filters.until}:void 0};return JSON.stringify(n)}},zc=class extends Lc{buildKey(e,t){return JSON.stringify({repoPath:t})}},Bc=class extends Lc{buildKey(e,t){return JSON.stringify({repoPath:t,include:e.include.slice().sort(),exclude:e.exclude.slice().sort(),worktree:e.worktree})}},Vc=n(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),Hc=n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=Vc();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),Uc=n(((e,t)=>{let n=Hc(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:ee,CHAR_RIGHT_SQUARE_BRACKET:g}=Vc(),_=e=>e===l||e===a,te=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let v=t||{},ne=e.length-1,y=v.parts===!0||v.scanToEnd===!0,b=[],x=[],re=[],S=e,C=-1,w=0,T=0,ie=!1,ae=!1,E=!1,oe=!1,se=!1,ce=!1,D=!1,O=!1,k=!1,A=!1,le=0,j,M,N={value:``,depth:0,isGlob:!1},P=()=>C>=ne,ue=()=>S.charCodeAt(C+1),F=()=>(j=M,S.charCodeAt(++C));for(;C<ne;){M=F();let e;if(M===a){D=N.backslashes=!0,M=F(),M===u&&(ce=!0);continue}if(ce===!0||M===u){for(le++;P()!==!0&&(M=F());){if(M===a){D=N.backslashes=!0,F();continue}if(M===u){le++;continue}if(ce!==!0&&M===s&&(M=F())===s){if(ie=N.isBrace=!0,E=N.isGlob=!0,A=!0,y===!0)continue;break}if(ce!==!0&&M===o){if(ie=N.isBrace=!0,E=N.isGlob=!0,A=!0,y===!0)continue;break}if(M===h&&(le--,le===0)){ce=!1,ie=N.isBrace=!0,A=!0;break}}if(y===!0)continue;break}if(M===l){if(b.push(C),x.push(N),N={value:``,depth:0,isGlob:!1},A===!0)continue;if(j===s&&C===w+1){w+=2;continue}T=C+1;continue}if(v.noext!==!0&&(M===p||M===i||M===r||M===m||M===c)&&ue()===d){if(E=N.isGlob=!0,oe=N.isExtglob=!0,A=!0,M===c&&C===w&&(k=!0),y===!0){for(;P()!==!0&&(M=F());){if(M===a){D=N.backslashes=!0,M=F();continue}if(M===ee){E=N.isGlob=!0,A=!0;break}}continue}break}if(M===r){if(j===r&&(se=N.isGlobstar=!0),E=N.isGlob=!0,A=!0,y===!0)continue;break}if(M===m){if(E=N.isGlob=!0,A=!0,y===!0)continue;break}if(M===f){for(;P()!==!0&&(e=F());){if(e===a){D=N.backslashes=!0,F();continue}if(e===g){ae=N.isBracket=!0,E=N.isGlob=!0,A=!0;break}}if(y===!0)continue;break}if(v.nonegate!==!0&&M===c&&C===w){O=N.negated=!0,w++;continue}if(v.noparen!==!0&&M===d){if(E=N.isGlob=!0,y===!0){for(;P()!==!0&&(M=F());){if(M===d){D=N.backslashes=!0,M=F();continue}if(M===ee){A=!0;break}}continue}break}if(E===!0){if(A=!0,y===!0)continue;break}}v.noext===!0&&(oe=!1,E=!1);let I=S,de=``,fe=``;w>0&&(de=S.slice(0,w),S=S.slice(w),T-=w),I&&E===!0&&T>0?(I=S.slice(0,T),fe=S.slice(T)):E===!0?(I=``,fe=S):I=S,I&&I!==``&&I!==`/`&&I!==S&&_(I.charCodeAt(I.length-1))&&(I=I.slice(0,-1)),v.unescape===!0&&(fe&&=n.removeBackslashes(fe),I&&D===!0&&(I=n.removeBackslashes(I)));let pe={prefix:de,input:e,start:w,base:I,glob:fe,isBrace:ie,isBracket:ae,isGlob:E,isExtglob:oe,isGlobstar:se,negated:O,negatedExtglob:k};if(v.tokens===!0&&(pe.maxDepth=0,_(M)||x.push(N),pe.tokens=x),v.parts===!0||v.tokens===!0){let t;for(let n=0;n<b.length;n++){let r=t?t+1:w,i=b[n],a=e.slice(r,i);v.tokens&&(n===0&&w!==0?(x[n].isPrefix=!0,x[n].value=de):x[n].value=a,te(x[n]),pe.maxDepth+=x[n].depth),(n!==0||a!==``)&&re.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);re.push(n),v.tokens&&(x[x.length-1].value=n,te(x[x.length-1]),pe.maxDepth+=x[x.length-1].depth)}pe.slashes=b,pe.parts=re}return pe}})),Wc=n(((e,t)=>{let n=Vc(),r=Hc(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},ee=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,g=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},_=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},te=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=g(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,_(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:ee([...new Set(a)])}:{risky:!0}:{risky:!1}},v=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],ee=d.capture?``:`?:`,g=n.globChars(d.windows),_=n.extglobChars(g),{DOT_LITERAL:ne,PLUS_LITERAL:y,SLASH_LITERAL:b,ONE_CHAR:x,DOTS_SLASH:re,NO_DOT:S,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK:T,QMARK_NO_DOT:ie,STAR:ae,START_ANCHOR:E}=g,oe=e=>`(${ee}(?:(?!${E}${e.dot?re:ne}).)*?)`,se=d.dot?``:S,ce=d.dot?T:ie,D=d.bash===!0?oe(d):ae;d.capture&&(D=`(${D})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let O={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,O),p=e.length;let k=[],A=[],le=[],j=m,M,N=()=>O.index===p-1,P=O.peek=(t=1)=>e[O.index+t],ue=O.advance=()=>e[++O.index]||``,F=()=>e.slice(O.index+1),I=(e=``,t=0)=>{O.consumed+=e,O.index+=t},de=e=>{O.output+=e.output==null?e.value:e.output,I(e.value)},fe=()=>{let e=1;for(;P()===`!`&&(P(2)!==`(`||P(3)===`?`);)ue(),O.start++,e++;return e%2==0?!1:(O.negated=!0,O.start++,!0)},pe=e=>{O[e]++,le.push(e)},me=e=>{O[e]--,le.pop()},L=e=>{if(j.type===`globstar`){let t=O.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||k.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(O.output=O.output.slice(0,-j.output.length),j.type=`star`,j.value=`*`,j.output=D,O.output+=j.output)}if(k.length&&e.type!==`paren`&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&de(e),j&&j.type===`text`&&e.type===`text`){j.output=(j.output||j.value)+e.value,j.value+=e.value;return}e.prev=j,h.push(e),j=e},he=(e,t)=>{let n={..._[t],conditions:1,inner:``};n.prev=j,n.parens=O.parens,n.output=O.output,n.startIndex=O.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;pe(`parens`),L({type:e,value:t,output:O.output?``:x}),L({type:`paren`,extglob:!0,value:ue(),output:r}),k.push(n)},ge=n=>{let i=e.slice(n.startIndex,O.index+1),a=te(e.slice(n.startIndex+2,O.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:x)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;O.output=n.output+t.output,O.backtrack=!0,L({type:`paren`,extglob:!0,value:M,output:``}),me(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=D;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=oe(d)),(e!==D||N()||/^\)+$/.test(F()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=F())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${v(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(O.negatedExtglob=!0)}L({type:`paren`,extglob:!0,value:M,output:o}),me(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?T.repeat(a.length):``):o===0?ce+(a?T.repeat(a.length):``):T.repeat(r.length):i===`.`?ne.repeat(r.length):i===`*`?t?t+i+(a?D:``):D:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(O.output=e,O):(O.output=r.wrapOutput(i,O,t),O)}for(;!N();){if(M=ue(),M===`\0`)continue;if(M===`\\`){let e=P();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){M+=`\\`,L({type:`text`,value:M});continue}let t=/^\\+/.exec(F()),n=0;if(t&&t[0].length>2&&(n=t[0].length,O.index+=n,n%2!=0&&(M+=`\\`)),d.unescape===!0?M=ue():M+=ue(),O.brackets===0){L({type:`text`,value:M});continue}}if(O.brackets>0&&(M!==`]`||j.value===`[`||j.value===`[^`)){if(d.posix!==!1&&M===`:`){let e=j.value.slice(1);if(e.includes(`[`)&&(j.posix=!0,e.includes(`:`))){let e=j.value.lastIndexOf(`[`),t=j.value.slice(0,e),n=a[j.value.slice(e+2)];if(n){j.value=t+n,O.backtrack=!0,ue(),!m.output&&h.indexOf(j)===1&&(m.output=x);continue}}}(M===`[`&&P()!==`:`||M===`-`&&P()===`]`)&&(M=`\\${M}`),M===`]`&&(j.value===`[`||j.value===`[^`)&&(M=`\\${M}`),d.posix===!0&&M===`!`&&j.value===`[`&&(M=`^`),j.value+=M,de({value:M});continue}if(O.quotes===1&&M!==`"`){M=r.escapeRegex(M),j.value+=M,de({value:M});continue}if(M===`"`){O.quotes=O.quotes===1?0:1,d.keepQuotes===!0&&L({type:`text`,value:M});continue}if(M===`(`){pe(`parens`),L({type:`paren`,value:M});continue}if(M===`)`){if(O.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=k[k.length-1];if(e&&O.parens===e.parens+1){ge(k.pop());continue}L({type:`paren`,value:M,output:O.parens?`)`:`\\)`}),me(`parens`);continue}if(M===`[`){if(d.nobracket===!0||!F().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));M=`\\${M}`}else pe(`brackets`);L({type:`bracket`,value:M});continue}if(M===`]`){if(d.nobracket===!0||j&&j.type===`bracket`&&j.value.length===1){L({type:`text`,value:M,output:`\\${M}`});continue}if(O.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));L({type:`text`,value:M,output:`\\${M}`});continue}me(`brackets`);let e=j.value.slice(1);if(j.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(M=`/${M}`),j.value+=M,de({value:M}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(j.value);if(O.output=O.output.slice(0,-j.value.length),d.literalBrackets===!0){O.output+=t,j.value=t;continue}j.value=`(${ee}${t}|${j.value})`,O.output+=j.value;continue}if(M===`{`&&d.nobrace!==!0){pe(`braces`);let e={type:`brace`,value:M,output:`(`,outputIndex:O.output.length,tokensIndex:O.tokens.length};A.push(e),L(e);continue}if(M===`}`){let e=A[A.length-1];if(d.nobrace===!0||!e){L({type:`text`,value:M,output:M});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),O.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=O.output.slice(0,e.outputIndex),r=O.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,M=t=`\\}`,O.output=n;for(let e of r)O.output+=e.output||e.value}L({type:`brace`,value:M,output:t}),me(`braces`),A.pop();continue}if(M===`|`){k.length>0&&k[k.length-1].conditions++,L({type:`text`,value:M});continue}if(M===`,`){let e=M,t=A[A.length-1];t&&le[le.length-1]===`braces`&&(t.comma=!0,e=`|`),L({type:`comma`,value:M,output:e});continue}if(M===`/`){if(j.type===`dot`&&O.index===O.start+1){O.start=O.index+1,O.consumed=``,O.output=``,h.pop(),j=m;continue}L({type:`slash`,value:M,output:b});continue}if(M===`.`){if(O.braces>0&&j.type===`dot`){j.value===`.`&&(j.output=ne);let e=A[A.length-1];j.type=`dots`,j.output+=M,j.value+=M,e.dots=!0;continue}if(O.braces+O.parens===0&&j.type!==`bos`&&j.type!==`slash`){L({type:`text`,value:M,output:ne});continue}L({type:`dot`,value:M,output:ne});continue}if(M===`?`){if(!(j&&j.value===`(`)&&d.noextglob!==!0&&P()===`(`&&P(2)!==`?`){he(`qmark`,M);continue}if(j&&j.type===`paren`){let e=P(),t=M;(j.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(F()))&&(t=`\\${M}`),L({type:`text`,value:M,output:t});continue}if(d.dot!==!0&&(j.type===`slash`||j.type===`bos`)){L({type:`qmark`,value:M,output:ie});continue}L({type:`qmark`,value:M,output:T});continue}if(M===`!`){if(d.noextglob!==!0&&P()===`(`&&(P(2)!==`?`||!/[!=<:]/.test(P(3)))){he(`negate`,M);continue}if(d.nonegate!==!0&&O.index===0){fe();continue}}if(M===`+`){if(d.noextglob!==!0&&P()===`(`&&P(2)!==`?`){he(`plus`,M);continue}if(j&&j.value===`(`||d.regex===!1){L({type:`plus`,value:M,output:y});continue}if(j&&(j.type===`bracket`||j.type===`paren`||j.type===`brace`)||O.parens>0){L({type:`plus`,value:M});continue}L({type:`plus`,value:y});continue}if(M===`@`){if(d.noextglob!==!0&&P()===`(`&&P(2)!==`?`){L({type:`at`,extglob:!0,value:M,output:``});continue}L({type:`text`,value:M});continue}if(M!==`*`){(M===`$`||M===`^`)&&(M=`\\${M}`);let e=o.exec(F());e&&(M+=e[0],O.index+=e[0].length),L({type:`text`,value:M});continue}if(j&&(j.type===`globstar`||j.star===!0)){j.type=`star`,j.star=!0,j.value+=M,j.output=D,O.backtrack=!0,O.globstar=!0,I(M);continue}let t=F();if(d.noextglob!==!0&&/^\([^?]/.test(t)){he(`star`,M);continue}if(j.type===`star`){if(d.noglobstar===!0){I(M);continue}let n=j.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){L({type:`star`,value:M,output:``});continue}let o=O.braces>0&&(n.type===`comma`||n.type===`brace`),s=k.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){L({type:`star`,value:M,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[O.index+4];if(n&&n!==`/`)break;t=t.slice(3),I(`/**`,3)}if(n.type===`bos`&&N()){j.type=`globstar`,j.value+=M,j.output=oe(d),O.output=j.output,O.globstar=!0,I(M);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&N()){O.output=O.output.slice(0,-(n.output+j.output).length),n.output=`(?:${n.output}`,j.type=`globstar`,j.output=oe(d)+(d.strictSlashes?`)`:`|$)`),j.value+=M,O.globstar=!0,O.output+=n.output+j.output,I(M);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;O.output=O.output.slice(0,-(n.output+j.output).length),n.output=`(?:${n.output}`,j.type=`globstar`,j.output=`${oe(d)}${b}|${b}${e})`,j.value+=M,O.output+=n.output+j.output,O.globstar=!0,I(M+ue()),L({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){j.type=`globstar`,j.value+=M,j.output=`(?:^|${b}|${oe(d)}${b})`,O.output=j.output,O.globstar=!0,I(M+ue()),L({type:`slash`,value:`/`,output:``});continue}O.output=O.output.slice(0,-j.output.length),j.type=`globstar`,j.output=oe(d),j.value+=M,O.output+=j.output,O.globstar=!0,I(M);continue}let n={type:`star`,value:M,output:D};if(d.bash===!0){n.output=`.*?`,(j.type===`bos`||j.type===`slash`)&&(n.output=se+n.output),L(n);continue}if(j&&(j.type===`bracket`||j.type===`paren`)&&d.regex===!0){n.output=M,L(n);continue}(O.index===O.start||j.type===`slash`||j.type===`dot`)&&(j.type===`dot`?(O.output+=C,j.output+=C):d.dot===!0?(O.output+=w,j.output+=w):(O.output+=se,j.output+=se),P()!==`*`&&(O.output+=x,j.output+=x)),L(n)}for(;O.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));O.output=r.escapeLast(O.output,`[`),me(`brackets`)}for(;O.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));O.output=r.escapeLast(O.output,`(`),me(`parens`)}for(;O.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));O.output=r.escapeLast(O.output,`{`),me(`braces`)}if(d.strictSlashes!==!0&&(j.type===`star`||j.type===`bracket`)&&L({type:`maybe_slash`,value:``,output:`${b}?`}),O.backtrack===!0){O.output=``;for(let e of O.tokens)O.output+=e.output==null?e.value:e.output,e.suffix&&(O.output+=e.suffix)}return O};v.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:ee,START_ANCHOR:g}=n.globChars(a.windows),_=a.dot?m:p,te=a.dot?h:p,v=a.capture?``:`?:`,ne={negated:!1,prefix:``},y=a.bash===!0?`.*?`:ee;a.capture&&(y=`(${y})`);let b=e=>e.noglobstar===!0?y:`(${v}(?:(?!${g}${e.dot?f:l}).)*?)`,x=e=>{switch(e){case`*`:return`${_}${d}${y}`;case`.*`:return`${l}${d}${y}`;case`*.*`:return`${_}${y}${l}${d}${y}`;case`*/*`:return`${_}${y}${u}${d}${te}${y}`;case`**`:return _+b(a);case`**/*`:return`(?:${_}${b(a)}${u})?${te}${d}${y}`;case`**/*.*`:return`(?:${_}${b(a)}${u})?${te}${y}${l}${d}${y}`;case`**/.*`:return`(?:${_}${b(a)}${u})?${l}${d}${y}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=x(t[1]);return n?n+l+t[2]:void 0}}},re=x(r.removePrefix(e,ne));return re&&a.strictSlashes!==!0&&(re+=`${u}?`),re},t.exports=v})),Gc=n(((e,t)=>{let n=Uc(),r=Wc(),i=Hc(),a=Vc(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),Kc=t(n(((e,t)=>{let n=Gc(),r=Hc();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);const qc=`0`.repeat(40);function Jc(e){return e.map(e=>(0,Kc.default)(e,{dot:!0}))}function Yc(e,t){return t.some(t=>t(e))}function Xc(e,t,n){return e.filter(e=>Yc(e,t)&&!Yc(e,n))}async function Zc(e,t,n,r){let i=r??e,a=Ks(i),s=Jc(t.length>0?t:[`**`]),l=Jc(n),d=qc,f=!0;try{d=(await a.revparse([`HEAD`])).trim()}catch{f=!1}let p=f?(await a.raw([`diff`,`HEAD`,`--name-only`])).trim().split(`
|
|
14
14
|
`):[],m=f?[]:[...(await a.raw([`diff`,`--name-only`])).trim().split(`
|
|
15
15
|
`),...(await a.raw([`diff`,`--cached`,`--name-only`])).trim().split(`
|
|
16
|
-
`)],h=Xc(Array.from(new Set([...p,...m].filter(Boolean))),s,l).sort(),ee=``;f&&h.length>0?ee=await a.raw([`diff`,`HEAD`,`--`,...h]):!f&&h.length>0&&(ee=`${await a.raw([`diff`,`--`,...h])}\n${await a.raw([`diff`,`--cached`,`--`,...h])}`);let
|
|
17
|
-
`).filter(Boolean),s,l).sort(),
|
|
18
|
-
`);return{hash:u(`sha256`).update(v).digest(`hex`),commitSha:d,changedPaths:
|
|
16
|
+
`)],h=Xc(Array.from(new Set([...p,...m].filter(Boolean))),s,l).sort(),ee=``;f&&h.length>0?ee=await a.raw([`diff`,`HEAD`,`--`,...h]):!f&&h.length>0&&(ee=`${await a.raw([`diff`,`--`,...h])}\n${await a.raw([`diff`,`--cached`,`--`,...h])}`);let g=Xc((await a.raw([`ls-files`,`--others`,`--exclude-standard`])).trim().split(`
|
|
17
|
+
`).filter(Boolean),s,l).sort(),_=(await Promise.allSettled(g.map(async e=>{let t=await o(c.join(i,e));return`${e}:${u(`sha256`).update(t).digest(`hex`)}`}))).filter(e=>e.status===`fulfilled`).map(e=>e.value),te=Array.from(new Set([...h,...g])).sort(),v=[d,ee,..._].join(`
|
|
18
|
+
`);return{hash:u(`sha256`).update(v).digest(`hex`),commitSha:d,changedPaths:te,timestamp:new Date().toISOString()}}async function Qc(e){return(await qs(e)).root??e}async function $c(e,t){if(!t)return e;let[n,r]=await Promise.all([el(e),el(t)]);if(n!==r)throw Error(`selectedWorktree must belong to the same repository as repoPath`);return rl(t)}async function el(e){let t=Ks(e);try{return rl((await t.revparse([`--path-format=absolute`,`--git-common-dir`])).trim())}catch{}try{return rl(tl((await t.revparse([`--git-common-dir`])).trim(),e))}catch{}try{return rl(nl((await t.revparse([`--absolute-git-dir`])).trim()))}catch{}return rl(await Qc(e))}function tl(e,t){return s.isAbsolute(e)?e:s.resolve(t,e)}function nl(e){let t=`${s.sep}.git${s.sep}worktrees${s.sep}`,n=e.lastIndexOf(t);return n===-1?e:e.slice(0,n+`${s.sep}.git`.length)}async function rl(e){try{return await a.realpath(e)}catch{return e}}function il(e,t){return e.filters?.selectedWorktree?{...e,filters:{...e.filters,selectedWorktree:t}}:e}var al=class extends f{watcher;logCache=new Rc;workingTreeCache=new zc;fingerprintCache=new Bc;constructor(e){super(e),this.watcher=new Pc(e)}async onInit(){this.registerQueryHandlers(),this.registerFingerprintHandler(),await this.watcher.init(),this.registerCacheInvalidationHandlers()}async onDestroy(){this.logCache.clear(),this.workingTreeCache.clear(),this.fingerprintCache.clear(),await this.watcher.destroy()}registerQueryHandlers(){this.registerGitStateHandlers(),this.registerHistoryHandlers(),this.registerWorktreeManagementHandlers()}registerGitStateHandlers(){this.registerHandler(m.getRepoRoot,async e=>{let t=await qs(e.payload.path);e.setResult(t)}),this.registerHandler(m.getBranch,async e=>{let t=await Js($(e.payload.repoPath));e.setResult(t)}),this.registerHandler(m.getStatus,async e=>{let t=await ac($(e.payload.repoPath));e.setResult(t)})}registerHistoryHandlers(){this.registerHandler(m.getCommit,async e=>{let t=await Ys($(e.payload.repoPath),e.payload.ref);e.setResult(t)}),this.registerHandler(m.getCommitDetails,async e=>{let t=await ec($(e.payload.repoPath),e.payload.hash);e.setResult(t)}),this.registerHandler(m.getWorkingTreeDetails,async e=>{let t=this.resolveRepoPath(e.payload),n=this.workingTreeCache.get(e.payload,t);if(n){e.setResult(n);return}let r=await ic($(t)),i=await Qc(t);this.workingTreeCache.set(e.payload,t,i,r),e.setResult(r)}),this.registerHandler(m.getWorktrees,async e=>{try{let t=await oc($(e.payload.repoPath));e.setResult(t)}catch(t){let n=t instanceof Error?t:Error(String(t)),r=t?.code,i=n.message.toLowerCase();if(r===`ENOENT`||i.includes(`no such file or directory`)||i.includes(`not a git repository`)||i.includes(`does not exist`))console.debug(`[GitService] getWorktrees failed for missing path, returning empty array`,{repoPath:e.payload.repoPath,error:n.message}),e.setResult({worktrees:[]});else throw console.error(`[GitService] getWorktrees failed with unexpected error`,{repoPath:e.payload.repoPath,error:n.message}),t}}),this.registerHandler(m.getRemotes,async e=>{let t=await uc($(e.payload.repoPath));e.setResult(t)}),this.registerHandler(m.getDefaultBranch,async e=>{let t=await dc($(e.payload.repoPath));e.setResult(t)}),this.registerHandler(m.getLog,async e=>{let t=this.resolveRepoPath(e.payload),n=await $c(t,e.payload.filters?.selectedWorktree),r=il(e.payload,n),i=this.logCache.get(r,t);if(i){e.setResult(i);return}let a=await bc($(n),r.limit,r.ref,r.filters),o=await Qc(t);this.logCache.set(r,t,o,a),e.setResult(a)}),this.registerHandler(m.getFileAtRevision,async e=>{let t=await Cc($(e.payload.repoPath),e.payload.path,e.payload.ref);e.setResult(t)}),this.registerHandler(m.getFileAtCommit,async e=>{let t=await wc($(e.payload.repoPath),e.payload.filePath,e.payload.commitHash);e.setResult(t)}),this.registerHandler(m.getBlobHashAtCommit,async e=>{let t=await Tc($(e.payload.repoPath),e.payload.filePath,e.payload.commitHash);e.setResult(t)}),this.registerHandler(m.getDiff,async e=>{let t=await Ec($(e.payload.repoPath),e.payload.ref,e.payload.staged,e.payload.unified,e.payload.paths);e.setResult(t)}),this.registerHandler(m.getBranchCommits,async e=>{let t=await pc($(e.payload.repoPath),e.payload.branchName);e.setResult({commitHashes:t})})}registerWorktreeManagementHandlers(){this.registerHandler(m.initRepo,async e=>{this.requireHostOwnedOrigin(e,`initRepo`);let t=await sc(e.payload.path,e.payload.defaultBranch);e.setResult(t)}),this.registerHandler(m.createWorktree,async e=>{this.requireHostOwnedOrigin(e,`createWorktree`);let t=await cc($(e.payload.repoPath),e.payload.path,e.payload.branch,{baseBranch:e.payload.baseBranch,createBranch:e.payload.createBranch});e.setResult(t)}),this.registerHandler(m.removeWorktree,async e=>{this.requireHostOwnedOrigin(e,`removeWorktree`);let t=await lc($(e.payload.repoPath),e.payload.path,{force:e.payload.force,deleteBranch:e.payload.deleteBranch});e.setResult(t)}),this.registerHandler(m.stage,async e=>{this.requireHostOwnedOrigin(e,`stage`);let{repoPath:t,paths:n}=e.payload,r=await Dc($(t),n);e.setResult(r)}),this.registerHandler(m.unstage,async e=>{this.requireHostOwnedOrigin(e,`unstage`);let{repoPath:t,paths:n}=e.payload,r=await Oc($(t),n);e.setResult(r)})}requireHostOwnedOrigin(e,t){if(!(e.origin.local||e.transport?.transportName===`worker`&&e.transport.peer===void 0))throw Error(`Unauthorized: git.${t} requires a host-owned request`)}registerFingerprintHandler(){this.registerHandler(m.fingerprint,async e=>{let{repoPath:t,include:n,exclude:r,worktree:i}=e.payload,a=this.fingerprintCache.get(e.payload,t);if(a){e.setResult(a);return}let o=await Zc(t,n,r,i),s=await Qc(t);this.fingerprintCache.set(e.payload,t,s,o),e.setResult(o)})}async invalidateLogCache(e){let t=await Qc(e);this.logCache.invalidate(t)}async invalidateWorkingTreeCache(e){let t=await Qc(e);this.workingTreeCache.invalidate(t)}async invalidateFingerprintCache(e){let t=await Qc(e);this.fingerprintCache.invalidate(t)}resolveRepoPath(e){return e.repoPath??process.cwd()}registerCacheInvalidationHandlers(){this.registerHandler(m.commit,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.checkout,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.staging,async e=>{await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.merge,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.rebase,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(p.batch,async e=>{let t=new Set,n=await Promise.allSettled(e.payload.changes.map(e=>Qc(c.dirname(e.path))));for(let r=0;r<n.length;r++){let i=n[r];if(i.status===`fulfilled`){t.add(i.value);continue}let a=e.payload.changes[r]?.path;console.debug(`[GitService] Failed to resolve invalidation root for fs.batch change`,{path:a,reason:i.reason})}for(let e of t)this.fingerprintCache.invalidate(e)})}};export{al as GitService,Pc as GitWatcher};
|