@gadgetinc/ggt 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/add-VYOF3CRL.js +78 -0
- package/dist/add-VYOF3CRL.js.map +7 -0
- package/dist/{chunk-FLXIAZND.js → chunk-3B5DKR5D.js} +2 -2
- package/dist/{chunk-FLXIAZND.js.map → chunk-3B5DKR5D.js.map} +4 -4
- package/dist/chunk-3V7YWBUK.js +2 -0
- package/dist/{chunk-BSCZOMV4.js.map → chunk-3V7YWBUK.js.map} +1 -1
- package/dist/chunk-B6XQEEUK.js +2 -0
- package/dist/chunk-B6XQEEUK.js.map +7 -0
- package/dist/chunk-CQH5IRAO.js +50 -0
- package/dist/chunk-CQH5IRAO.js.map +7 -0
- package/dist/{chunk-5ONACLO6.js → chunk-ENT5WEIR.js} +2 -2
- package/dist/chunk-FQ2LR3BI.js +6 -0
- package/dist/chunk-FQ2LR3BI.js.map +7 -0
- package/dist/chunk-J5XIQ6N4.js +187 -0
- package/dist/chunk-J5XIQ6N4.js.map +7 -0
- package/dist/chunk-JU6IEBE5.js +65 -0
- package/dist/chunk-JU6IEBE5.js.map +7 -0
- package/dist/{chunk-TRHAPK2F.js → chunk-LQDBD3BI.js} +4 -4
- package/dist/{chunk-TRHAPK2F.js.map → chunk-LQDBD3BI.js.map} +2 -2
- package/dist/chunk-P5OUQ5XQ.js +2 -0
- package/dist/chunk-SGMPMYEU.js +2 -0
- package/dist/chunk-SGMPMYEU.js.map +7 -0
- package/dist/chunk-VE2URKOG.js +117 -0
- package/dist/chunk-VE2URKOG.js.map +7 -0
- package/dist/{chunk-JKDJXJKF.js → chunk-WBESFPTY.js} +2 -2
- package/dist/chunk-YQO2R55C.js +18 -0
- package/dist/{chunk-M2OJZLL7.js.map → chunk-YQO2R55C.js.map} +3 -3
- package/dist/chunk-ZHG3WLFU.js +2 -0
- package/dist/chunk-ZHG3WLFU.js.map +7 -0
- package/dist/deploy-EEJCK2MG.js +25 -0
- package/dist/deploy-EEJCK2MG.js.map +7 -0
- package/dist/dev-G77WSGIC.js +58 -0
- package/dist/{dev-5UFCKF4X.js.map → dev-G77WSGIC.js.map} +4 -4
- package/dist/esm-3OYJEC4Z.js +36 -0
- package/dist/esm-3OYJEC4Z.js.map +7 -0
- package/dist/list-3AI2FD3F.js +11 -0
- package/dist/list-3AI2FD3F.js.map +7 -0
- package/dist/login-UGTNK3B3.js +2 -0
- package/dist/logout-CN5DL7Z2.js +7 -0
- package/dist/{logout-YXDH5ZZI.js.map → logout-CN5DL7Z2.js.map} +1 -1
- package/dist/main.js +10 -10
- package/dist/main.js.map +3 -3
- package/dist/open-PM56SR6Z.js +74 -0
- package/dist/open-PM56SR6Z.js.map +7 -0
- package/dist/{pull-UAKKKJJP.js → pull-TAW6KHZO.js} +4 -4
- package/dist/{pull-UAKKKJJP.js.map → pull-TAW6KHZO.js.map} +2 -2
- package/dist/push-2NCJSDGS.js +2 -0
- package/dist/status-WDYI4EOU.js +14 -0
- package/dist/status-WDYI4EOU.js.map +7 -0
- package/dist/{version-VE55GG37.js → version-3FBGIVXT.js} +2 -2
- package/dist/{version-VE55GG37.js.map → version-3FBGIVXT.js.map} +1 -1
- package/dist/whoami-UALRX2FT.js +7 -0
- package/dist/{whoami-OAH55L4M.js.map → whoami-UALRX2FT.js.map} +1 -1
- package/package.json +19 -18
- package/dist/add-RDTHYTCK.js +0 -78
- package/dist/add-RDTHYTCK.js.map +0 -7
- package/dist/build-4BGA4IZE.js +0 -3
- package/dist/build-4BGA4IZE.js.map +0 -7
- package/dist/chunk-3Q3GPB6Z.js +0 -2
- package/dist/chunk-3Q3GPB6Z.js.map +0 -7
- package/dist/chunk-457GEPUN.js +0 -9
- package/dist/chunk-457GEPUN.js.map +0 -7
- package/dist/chunk-57XALM2W.js +0 -2
- package/dist/chunk-57XALM2W.js.map +0 -7
- package/dist/chunk-5WC5D4WL.js +0 -2
- package/dist/chunk-5WC5D4WL.js.map +0 -7
- package/dist/chunk-BSCZOMV4.js +0 -2
- package/dist/chunk-CQLM5U6T.js +0 -67
- package/dist/chunk-CQLM5U6T.js.map +0 -7
- package/dist/chunk-D2K5XPNJ.js +0 -2
- package/dist/chunk-D2K5XPNJ.js.map +0 -7
- package/dist/chunk-F3EZ4KS3.js +0 -2
- package/dist/chunk-F3EZ4KS3.js.map +0 -7
- package/dist/chunk-GOBNB5VT.js +0 -2
- package/dist/chunk-GOBNB5VT.js.map +0 -7
- package/dist/chunk-HKBXEZNF.js +0 -2
- package/dist/chunk-LWW4E6P5.js +0 -173
- package/dist/chunk-LWW4E6P5.js.map +0 -7
- package/dist/chunk-M2OJZLL7.js +0 -18
- package/dist/chunk-M4PNFOA5.js +0 -6
- package/dist/chunk-M4PNFOA5.js.map +0 -7
- package/dist/chunk-NGTOMLDS.js +0 -33
- package/dist/chunk-NGTOMLDS.js.map +0 -7
- package/dist/chunk-RYQWS5BH.js +0 -117
- package/dist/chunk-RYQWS5BH.js.map +0 -7
- package/dist/chunk-VICN6LTV.js +0 -12
- package/dist/chunk-VICN6LTV.js.map +0 -7
- package/dist/context-GN36UFJL.js +0 -2
- package/dist/deploy-BAMMI3ZA.js +0 -24
- package/dist/deploy-BAMMI3ZA.js.map +0 -7
- package/dist/dev-5UFCKF4X.js +0 -55
- package/dist/esm-GJ7RK6IC.js +0 -34
- package/dist/esm-GJ7RK6IC.js.map +0 -7
- package/dist/list-WGRXHV2B.js +0 -11
- package/dist/list-WGRXHV2B.js.map +0 -7
- package/dist/login-5YZOB4XB.js +0 -2
- package/dist/logout-YXDH5ZZI.js +0 -7
- package/dist/open-EOH3Q5KP.js +0 -74
- package/dist/open-EOH3Q5KP.js.map +0 -7
- package/dist/push-7X4P2364.js +0 -2
- package/dist/push-7X4P2364.js.map +0 -7
- package/dist/status-UJUGP24U.js +0 -14
- package/dist/status-UJUGP24U.js.map +0 -7
- package/dist/user-B2RIDVTH.js +0 -2
- package/dist/user-B2RIDVTH.js.map +0 -7
- package/dist/whoami-OAH55L4M.js +0 -7
- /package/dist/{chunk-5ONACLO6.js.map → chunk-ENT5WEIR.js.map} +0 -0
- /package/dist/{chunk-HKBXEZNF.js.map → chunk-P5OUQ5XQ.js.map} +0 -0
- /package/dist/{chunk-JKDJXJKF.js.map → chunk-WBESFPTY.js.map} +0 -0
- /package/dist/{context-GN36UFJL.js.map → login-UGTNK3B3.js.map} +0 -0
- /package/dist/{login-5YZOB4XB.js.map → push-2NCJSDGS.js.map} +0 -0
package/dist/chunk-RYQWS5BH.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import{a as Yi,b as Q,d as br,e as _r,f as ne,g as kr}from"./chunk-NGTOMLDS.js";import{a as vr,c as re}from"./chunk-D2K5XPNJ.js";import{a as pr}from"./chunk-M4PNFOA5.js";import{b as fr,c as te,e as hr,f as ee}from"./chunk-3Q3GPB6Z.js";import{e as dr,f as gr,l as yr}from"./chunk-M2OJZLL7.js";import{h as Et}from"./chunk-457GEPUN.js";import{a as mr}from"./chunk-FLXIAZND.js";import{d as Ct,e as st,g as V,k as pt,l as ft}from"./chunk-VICN6LTV.js";import{$ as z,D as ar,E as Ki,H as ur,J as cr,M as xt,P as lr,W as lt,Z as T,_ as O,b as G,e as B,g as tr,h as er,l as rr,m as nr,t as sr,u as ir,v as or,z as ct}from"./chunk-CQLM5U6T.js";import{a as Hi,c as Zt,e as nt,g as P}from"./chunk-5WC5D4WL.js";var Er=Zt(j=>{"use strict";P();var to=j&&j.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(j,"__esModule",{value:!0});var eo=Hi("fs"),ro=to(pr()),it=ro.default("@kwsites/file-exists");function no(t,e,r){it("checking %s",t);try{let n=eo.statSync(t);return n.isFile()&&e?(it("[OK] path represents a file"),!0):n.isDirectory()&&r?(it("[OK] path represents a directory"),!0):(it("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return it("[FAIL] path is not accessible: %o",n),!1;throw it("[FATAL] %o",n),n}}function so(t,e=j.READABLE){return no(t,(e&j.FILE)>0,(e&j.FOLDER)>0)}j.exists=so;j.FILE=1;j.FOLDER=2;j.READABLE=j.FILE+j.FOLDER});var Pr=Zt(Ot=>{"use strict";P();function io(t){for(var e in t)Ot.hasOwnProperty(e)||(Ot[e]=t[e])}Object.defineProperty(Ot,"__esModule",{value:!0});io(Er())});var ce=Zt(Z=>{"use strict";P();Object.defineProperty(Z,"__esModule",{value:!0});Z.createDeferred=Z.deferred=void 0;function ue(){let t,e,r="pending";return{promise:new Promise((s,i)=>{t=s,e=i}),done(s){r==="pending"&&(r="resolved",t(s))},fail(s){r==="pending"&&(r="rejected",e(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}Z.deferred=ue;Z.createDeferred=ue;Z.default=ue});P();var wr=nt(Yi(),1);var Oc=Object.freeze({Fatal:"Fatal",Error:"Error",Warning:"Warning",Info:"Info"}),se=({problems:t,showFileTypes:e,...r})=>{let n="";for(let[s,i]of Object.entries(t)){n+=O(""),n+=O`• {cyan ${s}} {redBright ${(0,wr.default)("problem",i.length,!0)}}`;for(let o of i){let[a,...l]=o.message.split(`
|
|
2
|
-
`);n+=T` {red ✖} `,(e??o.type==="SourceFile")&&(n+=T`${Xi(s)} `),n+=T(a);for(let p of l)n+=O(""),n+=T` ${p}`;for(let p of o.labels)n+=T` {dim ${p}}`;n+=O("")}}return O({...r,content:n})},Rc=t=>{z(se(t))},Xi=t=>{switch(!0){case sr(t):return G.yellowBright("JavaScript");case ir(t):return G.blue("TypeScript");case or(t):return G.magenta("Gelly");default:return G.gray("File")}},Ac=t=>{let e={};for(let r of t){let n=r.node?.apiIdentifier??r.node?.name??"Other";e[n]??=[],e[n].push({type:r.node?.type??"Unknown",severity:r.severity,message:r.message,labels:vr(r.nodeLabels?.map(s=>s?.identifier)??[])})}return e},$c=t=>{let e={};for(let r of t)e[r.path]??=[],e[r.path].push({type:r.type,severity:r.level,message:r.message,labels:[]});return e};P();var Tr=class extends ft{isBug=pt.NO;constructor(){super("Yarn not found")}render(){return T`
|
|
3
|
-
Yarn must be installed to sync your application. You can install it by running:
|
|
4
|
-
|
|
5
|
-
$ npm install --global yarn
|
|
6
|
-
|
|
7
|
-
For more information, see: https://classic.yarnpkg.com/en/docs/install
|
|
8
|
-
`}},Pt=class extends ft{constructor(r,n){super('The ".gadget/sync.json" file was invalid or not found');this.ctx=r;this.opts=n}isBug=pt.NO;render(){let r=Et(this.ctx),n=this.opts.directory.path;switch(r){case"add":case"open":case"status":return T`
|
|
9
|
-
A ".gadget/sync.json" file is missing in this directory:
|
|
10
|
-
|
|
11
|
-
${n}
|
|
12
|
-
|
|
13
|
-
In order to use "ggt ${r}", you must run it within a directory
|
|
14
|
-
that has already been initialized with "ggt dev".
|
|
15
|
-
`;case"dev":return T`
|
|
16
|
-
A ".gadget/sync.json" file is missing in this directory:
|
|
17
|
-
|
|
18
|
-
${n}
|
|
19
|
-
|
|
20
|
-
If you're running "ggt dev" for the first time, we recommend
|
|
21
|
-
using a gadget specific directory like this:
|
|
22
|
-
|
|
23
|
-
ggt dev ~/gadget/${this.ctx.args["--app"]??"<name>"}
|
|
24
|
-
|
|
25
|
-
To use a non-empty directory without a ".gadget/sync.json" file,
|
|
26
|
-
run "ggt dev" again with the "--allow-unknown-directory" flag:
|
|
27
|
-
|
|
28
|
-
ggt dev ${n} --allow-unknown-directory
|
|
29
|
-
`;default:return T`
|
|
30
|
-
A ".gadget/sync.json" file is missing in this directory:
|
|
31
|
-
|
|
32
|
-
${n}
|
|
33
|
-
|
|
34
|
-
If you're certain you want to use this directory, you can run
|
|
35
|
-
"ggt ${r}" again with the "--allow-unknown-directory" flag:
|
|
36
|
-
|
|
37
|
-
ggt ${r} --allow-unknown-directory
|
|
38
|
-
`}}},Sr=class extends ft{constructor(r){super(`Failed to synchronize files after ${r} attempts.`);this.attempts=r}isBug=pt.MAYBE;render(){return T`
|
|
39
|
-
We merged your local files with your environment's files ${this.attempts} times,
|
|
40
|
-
but your local and environment's files still don't match.
|
|
41
|
-
|
|
42
|
-
Make sure no one else is editing files on your environment, and try again.
|
|
43
|
-
`}},xr=class extends ft{constructor(r){super("This application is not allowed to be deployed due to fatal errors.");this.fatalErrors=r}isBug=pt.MAYBE;render(){let r=O`{red Gadget has detected the following fatal errors with your files:}`;return r+=se({ensureEmptyLineAbove:!0,problems:this.fatalErrors,showFileTypes:!1}),r+=O({ensureEmptyLineAbove:!0,content:G.red("Please fix these errors and try again.")}),r}},Zi=t=>(t instanceof Q&&(t=t.cause),rr(t)&&(t=t.errors),nr(t)&&(t=t[0]),er(t)&&"message"in t&&tr(t.message)&&t.message.includes("Files version mismatch")),Uc=(t,e)=>{if(Zi(e)){t.log.debug("swallowing files version mismatch",{error:e});return}throw e};P();import Cr from"node:assert";import ie from"node:process";var ae=t=>(t=lt(t,{ensureEmptyLineAbove:!0}),xt.isInteractive||(z(t.content),z(JSON.stringify(t.choices??t.groupedChoices,void 0,2)),z({ensureEmptyLineAbove:!0,content:"Aborting because ggt is not running in an interactive terminal."}),ie.exit(1)),new Promise(e=>{let r=new oe({formatChoice:n=>n,formatSelection:n=>n,...t});r.on("submit",e),r.on("exit",()=>ie.exit(0)),r.on("abort",()=>ie.exit(0))})),oe=class extends dr{cursor=0;optionsPerPage=10;options;currentChoices;groupedChoicesTitleIndexMap=new Map;constructor(e){if(super(),this.options=lt(e,{formatChoice:r=>r,formatSelection:r=>r,...e}),this.options.choices)this.currentChoices=this.options.choices;else{this.currentChoices=this.options.groupedChoices.flatMap(([n,s])=>s);let r=0;this.options.groupedChoices.forEach(n=>{let[s,i]=n;i.forEach((o,a)=>{a===0&&this.groupedChoicesTitleIndexMap.set(r,s),r++})})}this.render()}get selection(){let e=this.currentChoices[this.cursor];return Cr(e,`choices[${this.cursor}] is not defined`),e}moveCursor(e){this.cursor=e,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render("Cancel (Ctrl+C)"),this.close()}submit(){this.done=!0,this.aborted=!1,this.value=this.selection,this.fire(),this.render(),this.close()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.currentChoices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.currentChoices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.currentChoices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.currentChoices.length),this.render()}_(e,r){if(e===" "){this.submit();return}}render(e){if(this.closed)return;super.render();let r=this.options.content;if(this.done){xt.persistPrompt(O({...this.options,content:`${r.trimEnd()} ${this.options.formatChoice(e??this.selection)}`}));return}r+=` ${G.gray("Use arrow keys to move")}
|
|
44
|
-
|
|
45
|
-
`;let n="",{startIndex:s,endIndex:i}=gr(this.cursor,this.currentChoices.length,this.optionsPerPage);for(let o=s;o<i;o++){let a;this.cursor===o?a=`${Ct.arrowRight} `:o===s&&s>0?a=`${Ct.arrowUp} `:o===i-1&&i<this.currentChoices.length?a=`${Ct.arrowDown} `:a=" ";let l=this.currentChoices[o];Cr(l,`choices[${o}] is not defined`);let p=this.options.formatChoice(l);this.cursor===o&&(p=G.blue.underline(p)),this.groupedChoicesTitleIndexMap.has(o)&&(o!==s&&(n+=`
|
|
46
|
-
`),n+=`${G.grey(this.groupedChoicesTitleIndexMap.get(o))}
|
|
47
|
-
`),n+=`${a}${p}
|
|
48
|
-
`}this.options.indent&&(n=lr(n,this.options.indent)),xt.updatePrompt(r+n)}};P();var Kt=nt(Ki(),1);import fi from"node:assert";import hi from"node:path";P();var Ut=nt(Pr(),1),Bt=nt(pr(),1),Bs=nt(ce(),1),ot=nt(ce(),1);import{spawn as Wo}from"child_process";import{EventEmitter as lc}from"node:events";var Nt=Object.defineProperty,oo=Object.defineProperties,ao=Object.getOwnPropertyDescriptor,uo=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertyNames,Or=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,co=Object.prototype.propertyIsEnumerable,Rr=(t,e,r)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))cn.call(e,r)&&Rr(t,r,e[r]);if(Or)for(var r of Or(e))co.call(e,r)&&Rr(t,r,e[r]);return t},dt=(t,e)=>oo(t,uo(e)),c=(t,e)=>function(){return t&&(e=(0,t[Pe(t)[0]])(t=0)),e},lo=(t,e)=>function(){return e||(0,t[Pe(t)[0]])((e={exports:{}}).exports,e),e.exports},E=(t,e)=>{for(var r in e)Nt(t,r,{get:e[r],enumerable:!0})},po=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Pe(e))!cn.call(t,s)&&s!==r&&Nt(t,s,{get:()=>e[s],enumerable:!(n=ao(e,s))||n.enumerable});return t},S=t=>po(Nt({},"__esModule",{value:!0}),t),mt=(t,e,r)=>new Promise((n,s)=>{var i=l=>{try{a(r.next(l))}catch(p){s(p)}},o=l=>{try{a(r.throw(l))}catch(p){s(p)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,o);a((r=r.apply(t,e)).next())});function fo(...t){let e=new String(t);return Gt.set(e,t),e}function jt(t){return t instanceof String&&Gt.has(t)}function Ar(t){return Gt.get(t)||[]}var Gt,bt=c({"src/lib/args/pathspec.ts"(){"use strict";Gt=new WeakMap}}),H,K=c({"src/lib/errors/git-error.ts"(){"use strict";H=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),_t,ut=c({"src/lib/errors/git-response-error.ts"(){"use strict";K(),_t=class extends H{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),ln,pn=c({"src/lib/errors/task-configuration-error.ts"(){"use strict";K(),ln=class extends H{constructor(t){super(void 0,t)}}}});function fn(t){return typeof t=="function"?t:rt}function hn(t){return typeof t=="function"&&t!==rt}function mn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function dn(t,e=0){return gn(t)&&t.length>e?t[e]:void 0}function et(t,e=0){if(gn(t)&&t.length>e)return t[t.length-1-e]}function gn(t){return!!(t&&typeof t.length=="number")}function kt(t="",e=!0,r=`
|
|
49
|
-
`){return t.split(r).reduce((n,s)=>{let i=e?s.trim():s;return i&&n.push(i),n},[])}function Oe(t,e){return kt(t,!0).map(r=>e(r))}function Re(t){return(0,Ut.exists)(t,Ut.FOLDER)}function _(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function yn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function qt(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function q(t){return Array.isArray(t)?t:[t]}function vn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function bn(t){return q(t).map(String)}function w(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}function gt(t,e){let r=[];for(let n=0,s=t.length;n<s;n++)r.push(e,t[n]);return r}function yt(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}function _n(t,e){return Object.assign({},...e.map(r=>r in t?{[r]:t[r]}:{}))}function ge(t=0){return new Promise(e=>setTimeout(e,t))}function kn(t){if(t!==!1)return t}var at,rt,wt,Jt=c({"src/lib/utils/util.ts"(){"use strict";at="\0",rt=()=>{},wt=Object.prototype.toString.call.bind(Object.prototype.toString)}});function J(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function Ae(t,e){let r=jt(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function $e(t){return!!t&&wt(t)==="[object Object]"}function wn(t){return typeof t=="function"}var Tt,R,Tn,It,Le,Sn=c({"src/lib/utils/argument-filters.ts"(){"use strict";Jt(),bt(),Tt=t=>Array.isArray(t),R=t=>typeof t=="string",Tn=t=>Array.isArray(t)&&t.every(R),It=t=>R(t)||Array.isArray(t)&&t.every(R),Le=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),ye,ho=c({"src/lib/utils/exit-codes.ts"(){"use strict";ye=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(ye||{})}}),vt,mo=c({"src/lib/utils/git-output-streams.ts"(){"use strict";vt=class{constructor(t,e){this.stdOut=t,this.stdErr=e}asStrings(){return new vt(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),y,Y,go=c({"src/lib/utils/line-parser.ts"(){"use strict";y=class{constructor(t,e){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,i)=>this.addMatch(s,i,r(i)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},Y=class extends y{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function xn(...t){let e=process.cwd(),r=Object.assign(F({baseDir:e},Cn),...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var Cn,yo=c({"src/lib/utils/simple-git-options.ts"(){"use strict";Cn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Me(t,e=[]){return $e(t)?Object.keys(t).reduce((r,n)=>{let s=t[n];return jt(s)?r.push(s):Ae(s,["boolean"])?r.push(n+"="+s):r.push(n),r},e):e}function L(t,e=0,r=!1){let n=[];for(let s=0,i=e<0?t.length:e;s<i;s++)"string|number".includes(typeof t[s])&&n.push(String(t[s]));return Me(De(t),n),r||n.push(...vo(t)),n}function vo(t){let e=typeof et(t)=="function";return J(et(t,e?1:0),Tt,[])}function De(t){let e=wn(et(t));return J(et(t,e?1:0),$e)}function x(t,e=!0){let r=fn(et(t));return e||hn(r)?r:void 0}var bo=c({"src/lib/utils/task-options.ts"(){"use strict";Sn(),Jt(),bt()}});function ve(t,e){return t(e.stdOut,e.stdErr)}function D(t,e,r,n=!0){return q(r).forEach(s=>{for(let i=kt(s,n),o=0,a=i.length;o<a;o++){let l=(p=0)=>{if(!(o+p>=a))return i[o+p]};e.some(({parse:p})=>p(l,t))}}),t}var _o=c({"src/lib/utils/task-parser.ts"(){"use strict";Jt()}}),En={};E(En,{ExitCodes:()=>ye,GitOutputStreams:()=>vt,LineParser:()=>y,NOOP:()=>rt,NULL:()=>at,RemoteLineParser:()=>Y,append:()=>_,appendTaskOptions:()=>Me,asArray:()=>q,asCamelCase:()=>vn,asFunction:()=>fn,asNumber:()=>w,asStringArray:()=>bn,bufferToString:()=>yt,callTaskParser:()=>ve,createInstanceConfig:()=>xn,delay:()=>ge,filterArray:()=>Tt,filterFunction:()=>wn,filterHasLength:()=>Le,filterPlainObject:()=>$e,filterPrimitives:()=>Ae,filterString:()=>R,filterStringArray:()=>Tn,filterStringOrStringArray:()=>It,filterType:()=>J,first:()=>dn,folderExists:()=>Re,forEachLineWithContent:()=>Oe,getTrailingOptions:()=>L,including:()=>yn,isUserFunction:()=>hn,last:()=>et,objectToString:()=>wt,orVoid:()=>kn,parseStringResponse:()=>D,pick:()=>_n,prefixedArray:()=>gt,remove:()=>qt,splitOn:()=>mn,toLinesWithContent:()=>kt,trailingFunctionArgument:()=>x,trailingOptionsArgument:()=>De});var d=c({"src/lib/utils/index.ts"(){"use strict";Sn(),ho(),mo(),go(),yo(),bo(),_o(),Jt()}}),Pn={};E(Pn,{CheckRepoActions:()=>be,checkIsBareRepoTask:()=>Rn,checkIsRepoRootTask:()=>On,checkIsRepoTask:()=>ko});function ko(t){switch(t){case"bare":return Rn();case"root":return On()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:zt,parser:je}}function On(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:zt,parser(e){return/^\.(git)?$/.test(e.trim())}}}function Rn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:zt,parser:je}}function wo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var be,zt,je,An=c({"src/lib/tasks/check-is-repo.ts"(){"use strict";d(),be=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(be||{}),zt=({exitCode:t},e,r,n)=>{if(t===128&&wo(e))return r(Buffer.from("false"));n(e)},je=t=>t.trim()==="true"}});function To(t,e){let r=new $n(t),n=t?Mn:Ln;return kt(e).forEach(s=>{let i=s.replace(n,"");r.paths.push(i),(Dn.test(i)?r.folders:r.files).push(i)}),r}var $n,Ln,Mn,Dn,So=c({"src/lib/responses/CleanSummary.ts"(){"use strict";d(),$n=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Ln=/^[a-z]+\s*/i,Mn=/^[a-z]+\s+[a-z]+\s*/i,Dn=/\/$/}}),_e={};E(_e,{EMPTY_COMMANDS:()=>Vt,adhocExecTask:()=>jn,configurationErrorTask:()=>M,isBufferTask:()=>Bn,isEmptyTask:()=>Fn,straightThroughBufferTask:()=>In,straightThroughStringTask:()=>$});function jn(t){return{commands:Vt,format:"empty",parser:t}}function M(t){return{commands:Vt,format:"empty",parser(){throw typeof t=="string"?new ln(t):t}}}function $(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}function In(t){return{commands:t,format:"buffer",parser(e){return e}}}function Bn(t){return t.format==="buffer"}function Fn(t){return t.format==="empty"||!t.commands.length}var Vt,C=c({"src/lib/tasks/task.ts"(){"use strict";pn(),Vt=[]}}),Nn={};E(Nn,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Ie,CONFIG_ERROR_MODE_REQUIRED:()=>Be,CONFIG_ERROR_UNKNOWN_OPTION:()=>Fe,CleanOptions:()=>$t,cleanTask:()=>Gn,cleanWithOptionsTask:()=>xo,isCleanOptionsArray:()=>Co});function xo(t,e){let{cleanMode:r,options:n,valid:s}=Eo(t);return r?s.options?(n.push(...e),n.some(Ro)?M(Ie):Gn(r,n)):M(Fe+JSON.stringify(t)):M(Be)}function Gn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return To(t==="n",n)}}}function Co(t){return Array.isArray(t)&&t.every(e=>Ne.has(e))}function Eo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(s=>{Po(s)?(e=s,n.cleanMode=!0):n.options=n.options&&Oo(r[r.length]=`-${s}`)}),{cleanMode:e,options:r,valid:n}}function Po(t){return t==="f"||t==="n"}function Oo(t){return/^-[a-z]$/i.test(t)&&Ne.has(t.charAt(1))}function Ro(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var Ie,Be,Fe,$t,Ne,Un=c({"src/lib/tasks/clean.ts"(){"use strict";So(),d(),C(),Ie="Git clean interactive mode is not supported",Be='Git clean mode parameter ("n" or "f") is required',Fe="Git clean unknown option found in: ",$t=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))($t||{}),Ne=new Set(["i",...bn(Object.values($t))])}});function Ao(t){let e=new Jn;for(let r of qn(t))e.addValue(r.file,String(r.key),r.value);return e}function $o(t,e){let r=null,n=[],s=new Map;for(let i of qn(t,e))i.key===e&&(n.push(r=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(r));return{key:e,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function Lo(t){return t.replace(/^(file):/,"")}function*qn(t,e=null){let r=t.split("\0");for(let n=0,s=r.length-1;n<s;){let i=Lo(r[n++]),o=r[n++],a=e;if(o.includes(`
|
|
50
|
-
`)){let l=mn(o,`
|
|
51
|
-
`);a=l[0],o=l[1]}yield{file:i,key:a,value:o}}}var Jn,Mo=c({"src/lib/responses/ConfigList.ts"(){"use strict";d(),Jn=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((t,e)=>Object.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=et(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);n.hasOwnProperty(e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function le(t,e){return typeof t=="string"&&ke.hasOwnProperty(t)?t:e}function Do(t,e,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(t,e),{commands:s,format:"utf-8",parser(i){return i}}}function jo(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return $o(n,t)}}}function Io(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return Ao(r)}}}function Bo(){return{addConfig(t,e,...r){return this._runTask(Do(t,e,r[0]===!0,le(r[1],"local")),x(arguments))},getConfig(t,e){return this._runTask(jo(t,le(e,void 0)),x(arguments))},listConfig(...t){return this._runTask(Io(le(t[0],void 0)),x(arguments))}}}var ke,zn=c({"src/lib/tasks/config.ts"(){"use strict";Mo(),d(),ke=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(ke||{})}});function Fo(t){return Vn.has(t)}var pe,Vn,Qn=c({"src/lib/tasks/diff-name-status.ts"(){"use strict";pe=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(pe||{}),Vn=new Set(Object.values(pe))}});function No(...t){return new Hn().param(...t)}function Go(t){let e=new Set,r={};return Oe(t,n=>{let[s,i,o]=n.split(at);e.add(s),(r[s]=r[s]||[]).push({line:w(i),path:s,preview:o})}),{paths:e,results:r}}function Uo(){return{grep(t){let e=x(arguments),r=L(arguments);for(let s of Wn)if(r.includes(s))return this._runTask(M(`git.grep: use of "${s}" is not supported.`),e);typeof t=="string"&&(t=No().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(s){return Go(s)}},e)}}}var Wn,ht,$r,Hn,Yn=c({"src/lib/tasks/grep.ts"(){"use strict";d(),C(),Wn=["-h"],ht=Symbol("grepQuery"),Hn=class{constructor(){this[$r]=[]}*[($r=ht,Symbol.iterator)](){for(let t of this[ht])yield t}and(...t){return t.length&&this[ht].push("--and","(",...gt(t,"-e"),")"),this}param(...t){return this[ht].push(...gt(t,"-e")),this}}}}),Kn={};E(Kn,{ResetMode:()=>Lt,getResetMode:()=>Jo,resetTask:()=>qo});function qo(t,e){let r=["reset"];return Xn(t)&&r.push(`--${t}`),r.push(...e),$(r)}function Jo(t){if(Xn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function Xn(t){return Zn.includes(t)}var Lt,Zn,ts=c({"src/lib/tasks/reset.ts"(){"use strict";C(),Lt=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Lt||{}),Zn=Array.from(Object.values(Lt))}});function zo(){return(0,Bt.default)("simple-git")}function Lr(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...s)=>{t(n,...s),r(n,...s)}:t:(n,...s)=>{t(`%s ${n}`,e,...s),r&&r(n,...s)}}function Vo(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Ge(t,e,r,n=zo()){let s=t&&`[${t}]`||"",i=[],o=typeof e=="string"?n.extend(e):e,a=Vo(J(e,R),o,n);return p(r);function l(b,g){return _(i,Ge(t,a.replace(/^[^:]+/,b),g,n))}function p(b){let g=b&&`[${b}]`||"",v=o&&Lr(o,g)||rt,m=Lr(n,`${s} ${g}`,v);return Object.assign(o?v:m,{label:t,sibling:l,info:m,step:p})}}var es=c({"src/lib/git-logger.ts"(){"use strict";d(),Bt.default.formatters.L=t=>String(Le(t)?t.length:"-"),Bt.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):wt(t)}}),Rt,we,Qo=c({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";K(),es(),Rt=class{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let e=Rt.getName(t.commands[0]),r=Ge(this.logLabel,e);return{task:t,logger:r,name:e}}push(t){let e=this.createProgress(t);return e.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,e),e}fatal(t){for(let[e,{logger:r}]of Array.from(this._queue.entries()))e===t.task?(r.info("Failed %o",t),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(e);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let e=this.withProgress(t);if(!e)throw new H(void 0,"TasksPendingQueue: attempt called for an unknown task");return e.logger("Starting task"),e}static getName(t="empty"){return`task:${t}:${++Rt.counter}`}},we=Rt,we.counter=0}});function tt(t,e){return{method:dn(t.commands)||"",commands:e}}function Ho(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}function Mr(t,e,r,n){return s=>{r("%s received %L bytes",e,s),n("%B",s),t.push(s)}}var Te,Yo=c({"src/lib/runners/git-executor-chain.ts"(){"use strict";K(),C(),d(),Qo(),Te=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new we}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}attemptTask(t){return mt(this,null,function*(){let e=yield this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:n}=this._queue.attempt(t);return yield Fn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n)}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}})}onFatalException(t,e){let r=e instanceof H?Object.assign(e,{task:t}):new H(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(t,e){return mt(this,null,function*(){let r=this._plugins.exec("spawn.binary","",tt(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],tt(t,t.commands)),s=yield this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),i=yield this.handleTaskData(t,n,s,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),Bn(t)?ve(t.parser,i):ve(t.parser,i.asStrings())})}attemptEmptyTask(t,e){return mt(this,null,function*(){return e("empty task bypassing child process to call to task's parser"),t.parser(this)})}handleTaskData(t,e,r,n){let{exitCode:s,rejection:i,stdOut:o,stdErr:a}=r;return new Promise((l,p)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:b}=this._plugins.exec("task.error",{error:i},F(F({},tt(t,e)),r));if(b&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,b,g=>{n.info("custom error handler treated as success"),n("custom error returned a %s",wt(g)),l(new vt(Array.isArray(g)?Buffer.concat(g):g,Buffer.concat(a)))},p);if(b)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,i),p(b);n.info("retrieving task output complete"),l(new vt(Buffer.concat(o),Buffer.concat(a)))})}gitResponse(t,e,r,n,s){return mt(this,null,function*(){let i=s.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},tt(t,t.commands));return new Promise(a=>{let l=[],p=[];s.info("%s %o",e,r),s("%O",o);let b=this._beforeSpawn(t,r);if(b)return a({stdOut:l,stdErr:p,exitCode:9901,rejection:b});this._plugins.exec("spawn.before",void 0,dt(F({},tt(t,r)),{kill(v){b=v||b}}));let g=Wo(e,r,o);g.stdout.on("data",Mr(l,"stdOut",s,i.step("stdOut"))),g.stderr.on("data",Mr(p,"stdErr",s,i.step("stdErr"))),g.on("error",Ho(p,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(e,g.stdout,g.stderr,[...r])),this._plugins.exec("spawn.after",void 0,dt(F({},tt(t,r)),{spawned:g,close(v,m){a({stdOut:l,stdErr:p,exitCode:v,rejection:b||m})},kill(v){g.killed||(b=v,g.kill("SIGINT"))}}))})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,dt(F({},tt(t,e)),{kill(n){r=n||r}})),r}}}}),rs={};E(rs,{GitExecutor:()=>ns});var ns,Ko=c({"src/lib/runners/git-executor.ts"(){"use strict";Yo(),ns=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new Te(this,this._scheduler,this._plugins)}chain(){return new Te(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function Xo(t,e,r=rt){let n=i=>{r(null,i)},s=i=>{i?.task===t&&r(i instanceof _t?Zo(i):i,void 0)};e.then(n,s)}function Zo(t){let e=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=rt};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,s){return s in t||(n[s]={enumerable:!1,configurable:!1,get(){return e(s),t.git[s]}}),n}}var ta=c({"src/lib/task-callback.ts"(){"use strict";ut(),d()}});function Dr(t,e){return jn(r=>{if(!Re(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var ea=c({"src/lib/tasks/change-working-directory.ts"(){"use strict";d(),C()}});function fe(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=qt(e,"-B")),$(e)}function ra(){return{checkout(){return this._runTask(fe(L(arguments,1)),x(arguments))},checkoutBranch(t,e){return this._runTask(fe(["-b",t,e,...L(arguments)]),x(arguments))},checkoutLocalBranch(t){return this._runTask(fe(["-b",t,...L(arguments)]),x(arguments))}}}var na=c({"src/lib/tasks/checkout.ts"(){"use strict";d(),C()}});function sa(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function ia(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return D(sa(),[ss],t)}})}}}var ss,oa=c({"src/lib/tasks/count-objects.ts"(){"use strict";d(),ss=new y(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=vn(e);t.hasOwnProperty(n)&&(t[n]=w(r))})}});function aa(t){return D({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},is,t)}var is,ua=c({"src/lib/parsers/parse-commit.ts"(){"use strict";d(),is=[new y(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new y(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new y(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new y(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let s=parseInt(r,10)||0;n==="-"?t.summary.deletions=s:n==="+"&&(t.summary.insertions=s)})]}});function ca(t,e,r){return{commands:["-c","core.abbrev=40","commit",...gt(t,"-m"),...e,...r],format:"utf-8",parser:aa}}function la(){return{commit(e,...r){let n=x(arguments),s=t(e)||ca(q(e),q(J(r[0],It,[])),[...J(r[1],Tt,[]),...L(arguments,0,!0)]);return this._runTask(s,n)}};function t(e){return!It(e)&&M("git.commit: requires the commit message to be supplied as a string/string[]")}}var pa=c({"src/lib/tasks/commit.ts"(){"use strict";ua(),d(),C()}});function fa(){return{firstCommit(){return this._runTask($(["rev-list","--max-parents=0","HEAD"],!0),x(arguments))}}}var ha=c({"src/lib/tasks/first-commit.ts"(){"use strict";d(),C()}});function ma(t,e){let r=["hash-object",t];return e&&r.push("-w"),$(r,!0)}var da=c({"src/lib/tasks/hash-object.ts"(){"use strict";C()}});function ga(t,e,r){let n=String(r).trim(),s;if(s=os.exec(n))return new Mt(t,e,!1,s[1]);if(s=as.exec(n))return new Mt(t,e,!0,s[1]);let i="",o=n.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new Mt(t,e,/^re/i.test(n),i)}var Mt,os,as,ya=c({"src/lib/responses/InitSummary.ts"(){"use strict";Mt=class{constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},os=/^Init.+ repository in (.+)$/,as=/^Rein.+ in (.+)$/}});function va(t){return t.includes(Ue)}function ba(t=!1,e,r){let n=["init",...r];return t&&!va(n)&&n.splice(1,0,Ue),{commands:n,format:"utf-8",parser(s){return ga(n.includes("--bare"),e,s)}}}var Ue,_a=c({"src/lib/tasks/init.ts"(){"use strict";ya(),Ue="--bare"}});function qe(t){for(let e=0;e<t.length;e++){let r=Je.exec(t[e]);if(r)return`--${r[1]}`}return""}function ka(t){return Je.test(t)}var Je,St=c({"src/lib/args/log-format.ts"(){"use strict";Je=/^--(stat|numstat|name-only|name-status)(=|$)/}}),us,wa=c({"src/lib/responses/DiffSummary.ts"(){"use strict";us=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function cs(t=""){let e=ls[t];return r=>D(new us,e,r,!1)}var he,jr,Ir,Br,ls,ps=c({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";St(),wa(),Qn(),d(),he=[new y(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:w(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new y(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:w(r),after:w(n),binary:!0})}),new y(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);t.changed=w(e),t.insertions=w(n?.[1]),t.deletions=w(s?.[1])})],jr=[new y(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let s=w(e),i=w(r);t.changed++,t.insertions+=s,t.deletions+=i,t.files.push({file:n,changes:s+i,insertions:s,deletions:i,binary:!1})}),new y(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],Ir=[new y(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],Br=[new y(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,s,i])=>{t.changed++,t.files.push({file:i??n,changes:0,status:kn(Fo(e)&&e),insertions:0,deletions:0,binary:!1})})],ls={"":he,"--stat":he,"--numstat":jr,"--name-status":Br,"--name-only":Ir}}});function Ta(t,e){return e.reduce((r,n,s)=>(r[n]=t[s]||"",r),Object.create({diff:null}))}function fs(t=Qe,e=hs,r=""){let n=cs(r);return function(s){let i=kt(s,!0,ze).map(function(o){let a=o.trim().split(Ve),l=Ta(a[0].trim().split(t),e);return a.length>1&&a[1].trim()&&(l.diff=n(a[1])),l});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var ze,Ve,Qe,hs,ms=c({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";d(),ps(),St(),ze="\xF2\xF2\xF2\xF2\xF2\xF2 ",Ve=" \xF2\xF2",Qe=" \xF2 ",hs=["hash","date","message","refs","author_name","author_email"]}}),ds={};E(ds,{diffSummaryTask:()=>Sa,validateLogFormatConfig:()=>Qt});function Sa(t){let e=qe(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),Qt(r)||{commands:r,format:"utf-8",parser:cs(e)}}function Qt(t){let e=t.filter(ka);if(e.length>1)return M(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return M(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var We=c({"src/lib/tasks/diff.ts"(){"use strict";St(),ps(),C()}});function xa(t,e){let r=[],n=[];return Object.keys(t).forEach(s=>{r.push(s),n.push(String(t[s]))}),[r,n.join(e)]}function Ca(t){return Object.keys(t).reduce((e,r)=>(r in Se||(e[r]=t[r]),e),{})}function gs(t={},e=[]){let r=J(t.splitter,R,Qe),n=!Ae(t.format)&&t.format?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[s,i]=xa(n,r),o=[],a=[`--pretty=format:${ze}${i}${Ve}`,...e],l=t.n||t["max-count"]||t.maxCount;if(l&&a.push(`--max-count=${l}`),t.from||t.to){let p=t.symmetric!==!1?"...":"..";o.push(`${t.from||""}${p}${t.to||""}`)}return R(t.file)&&a.push("--follow",fo(t.file)),Me(Ca(t),a),{fields:s,splitter:r,commands:[...a,...o]}}function Ea(t,e,r){let n=fs(t,e,qe(r));return{commands:["log",...r],format:"utf-8",parser:n}}function Pa(){return{log(...r){let n=x(arguments),s=gs(De(arguments),J(arguments[0],Tt)),i=e(...r)||Qt(s.commands)||t(s);return this._runTask(i,n)}};function t(r){return Ea(r.splitter,r.fields,r.commands)}function e(r,n){return R(r)&&R(n)&&M("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Se,ys=c({"src/lib/tasks/log.ts"(){"use strict";St(),bt(),ms(),d(),C(),We(),Se=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(Se||{})}}),Dt,vs,Oa=c({"src/lib/responses/MergeSummary.ts"(){"use strict";Dt=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},vs=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"}}}}),xe,bs,Ra=c({"src/lib/responses/PullSummary.ts"(){"use strict";xe=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},bs=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function me(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Fr(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:w(e&&e[1]||"0"),delta:w(r&&r[1]||"0")}}var _s,Aa=c({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";d(),_s=[new Y(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),s=me(t.remoteMessages);Object.assign(s,{[n]:w(r)})}),new Y(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),s=me(t.remoteMessages);Object.assign(s,{[n]:w(r)})}),new Y(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let s=me(t.remoteMessages);s.total=Fr(e),s.reused=Fr(r),s.packReused=w(n)})]}});function ks(t,e){return D({remoteMessages:new Ts},ws,e)}var ws,Ts,Ss=c({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";d(),Aa(),ws=[new Y(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),..._s,new Y([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Y([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:w(e),summary:r,url:n}})],Ts=class{constructor(){this.all=[]}}}});function $a(t,e){let r=D(new bs,xs,[t,e]);return r.message&&r}var Nr,Gr,Ur,qr,xs,Jr,He,Cs=c({"src/lib/parsers/parse-pull.ts"(){"use strict";Ra(),d(),Ss(),Nr=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Gr=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Ur=/^(create|delete) mode \d+ (.+)/,qr=[new y(Nr,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new y(Gr,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new y(Ur,(t,[e,r])=>{_(t.files,r),_(e==="create"?t.created:t.deleted,r)})],xs=[new y(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new y(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new y(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,s])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=s,t.hash.remote=r})],Jr=(t,e)=>D(new xe,qr,[t,e]),He=(t,e)=>Object.assign(new xe,Jr(t,e),ks(t,e))}}),zr,Es,Vr,La=c({"src/lib/parsers/parse-merge.ts"(){"use strict";Oa(),d(),Cs(),zr=[new y(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new y(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Dt(e,r))}),new y(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new Dt(e,r,{deleteRef:n}))}),new y(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Dt(e,null))}),new y(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],Es=(t,e)=>Object.assign(Vr(t,e),He(t,e)),Vr=t=>D(new vs,zr,t)}});function Qr(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=Es(e,r);if(n.failed)throw new _t(n);return n}}:M("Git.merge requires at least one option")}var Ma=c({"src/lib/tasks/merge.ts"(){"use strict";ut(),La(),C()}});function Da(t,e,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(t),i=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:t,remote:e}}var Wr,Ps,Hr,ja=c({"src/lib/parsers/parse-push.ts"(){"use strict";d(),Ss(),Wr=[new y(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new y(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref=dt(F({},t.ref||{}),{local:e})}),new y(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(Da(e,r,n))}),new y(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch=dt(F({},t.branch||{}),{local:e,remote:r,remoteName:n})}),new y(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,s])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:s}}})],Ps=(t,e)=>{let r=Hr(t,e),n=ks(t,e);return F(F({},r),n)},Hr=(t,e)=>D({pushed:[]},Wr,[t,e])}}),Os={};E(Os,{pushTagsTask:()=>Ia,pushTask:()=>Ye});function Ia(t={},e){return _(e,"--tags"),Ye(t,e)}function Ye(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),qt(r,"-v"),_(r,"--verbose"),_(r,"--porcelain"),{commands:r,format:"utf-8",parser:Ps}}var Rs=c({"src/lib/tasks/push.ts"(){"use strict";ja(),d()}});function Ba(){return{showBuffer(){let t=["show",...L(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(In(t),x(arguments))},show(){let t=["show",...L(arguments,1)];return this._runTask($(t),x(arguments))}}}var Fa=c({"src/lib/tasks/show.ts"(){"use strict";d(),C()}}),Yr,As,Na=c({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Yr=/^(.+) -> (.+)$/,As=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e+r==="R"){let n=Yr.exec(t)||[null,t,t];this.from=n[1]||"",this.path=n[2]||""}}}}});function Kr(t){let[e,r]=t.split(at);return{from:r||e,to:e}}function I(t,e,r){return[`${t}${e}`,r]}function de(t,...e){return e.map(r=>I(t,r,(n,s)=>_(n.conflicted,s)))}function Ga(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,i,o){let a=`${s}${i}`,l=$s.get(a);l&&l(t,o),a!=="##"&&a!=="!!"&&t.files.push(new As(o.replace(/\0.+$/,""),s,i))}}var Xr,$s,Ls,Ua=c({"src/lib/responses/StatusSummary.ts"(){"use strict";d(),Na(),Xr=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}},$s=new Map([I(" ","A",(t,e)=>_(t.created,e)),I(" ","D",(t,e)=>_(t.deleted,e)),I(" ","M",(t,e)=>_(t.modified,e)),I("A"," ",(t,e)=>_(t.created,e)&&_(t.staged,e)),I("A","M",(t,e)=>_(t.created,e)&&_(t.staged,e)&&_(t.modified,e)),I("D"," ",(t,e)=>_(t.deleted,e)&&_(t.staged,e)),I("M"," ",(t,e)=>_(t.modified,e)&&_(t.staged,e)),I("M","M",(t,e)=>_(t.modified,e)&&_(t.staged,e)),I("R"," ",(t,e)=>{_(t.renamed,Kr(e))}),I("R","M",(t,e)=>{let r=Kr(e);_(t.renamed,r),_(t.modified,r.to)}),I("!","!",(t,e)=>{_(t.ignored=t.ignored||[],e)}),I("?","?",(t,e)=>_(t.not_added,e)),...de("A","A","U"),...de("D","D","U"),...de("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,a;a=r.exec(e),t.ahead=a&&+a[1]||0,a=n.exec(e),t.behind=a&&+a[1]||0,a=s.exec(e),t.current=a&&a[1],a=i.exec(e),t.tracking=a&&a[1],a=o.exec(e),t.current=a&&a[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),Ls=function(t){let e=t.split(at),r=new Xr;for(let n=0,s=e.length;n<s;){let i=e[n++].trim();i&&(i.charAt(0)==="R"&&(i+=at+(e[n++]||"")),Ga(r,i))}return r}}});function qa(t){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...t.filter(r=>!Ms.includes(r))],parser(r){return Ls(r)}}}var Ms,Ja=c({"src/lib/tasks/status.ts"(){"use strict";Ua(),Ms=["--null","-z"]}});function Ft(t=0,e=0,r=0,n="",s=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function za(){return Ft(0,0,0,"",!1)}function Va(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Qa,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(Ke));n(e)}})}}}function Qa(t){return t===Ke?za():D(Ft(0,0,0,t),Ds,t)}var Ke,Ds,Wa=c({"src/lib/tasks/version.ts"(){"use strict";d(),Ke="installed=false",Ds=[new y(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,s=""])=>{Object.assign(t,Ft(w(e),w(r),w(n),s))}),new y(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,s=""])=>{Object.assign(t,Ft(w(e),w(r),n,s))})]}}),js={};E(js,{SimpleGitApi:()=>Ce});var Ce,Ha=c({"src/lib/simple-git-api.ts"(){"use strict";ta(),ea(),na(),oa(),pa(),zn(),ha(),Yn(),da(),_a(),ys(),Ma(),Rs(),Fa(),Ja(),C(),Wa(),d(),Ce=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&Xo(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask($(["add",...q(t)]),x(arguments))}cwd(t){let e=x(arguments);return typeof t=="string"?this._runTask(Dr(t,this._executor),e):typeof t?.path=="string"?this._runTask(Dr(t.path,t.root&&this._executor||void 0),e):this._runTask(M("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(ma(t,e===!0),x(arguments))}init(t){return this._runTask(ba(t===!0,this._executor.cwd,L(arguments)),x(arguments))}merge(){return this._runTask(Qr(L(arguments)),x(arguments))}mergeFromTo(t,e){return R(t)&&R(e)?this._runTask(Qr([t,e,...L(arguments)]),x(arguments,!1)):this._runTask(M("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Ye({remote:J(arguments[0],R),branch:J(arguments[1],R)},L(arguments));return this._runTask(t,x(arguments))}stash(){return this._runTask($(["stash",...L(arguments)]),x(arguments))}status(){return this._runTask(qa(L(arguments)),x(arguments))}},Object.assign(Ce.prototype,ra(),la(),Bo(),ia(),fa(),Uo(),Pa(),Ba(),Va())}}),Is={};E(Is,{Scheduler:()=>Fs});var Zr,Fs,Ya=c({"src/lib/runners/scheduler.ts"(){"use strict";d(),es(),Zr=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,Bs.createDeferred)();return{promise:e,done:r,id:t}}})(),Fs=class{constructor(t=2){this.concurrency=t,this.logger=Ge("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}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 t=_(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),qt(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=_(this.pending,Zr());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),Ns={};E(Ns,{applyPatchTask:()=>Ka});function Ka(t,e){return $(["apply",...e,...t])}var Xa=c({"src/lib/tasks/apply-patch.ts"(){"use strict";C()}});function Za(t,e){return{branch:t,hash:e,success:!0}}function tu(t){return{branch:t,hash:null,success:!1}}var Gs,eu=c({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Gs=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Us(t,e){return e===1&&Ee.test(t)}var tn,Ee,en,Wt,ru=c({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";eu(),d(),tn=/(\S+)\s+\(\S+\s([^)]+)\)/,Ee=/^error[^']+'([^']+)'/m,en=[new y(tn,(t,[e,r])=>{let n=Za(e,r);t.all.push(n),t.branches[e]=n}),new y(Ee,(t,[e])=>{let r=tu(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],Wt=(t,e)=>D(new Gs,en,[t,e])}}),qs,nu=c({"src/lib/responses/BranchSummary.ts"(){"use strict";qs=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,s){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:s}}}}});function rn(t){return t?t.charAt(0):""}function Js(t){return D(new qs,zs,t)}var zs,su=c({"src/lib/parsers/parse-branch.ts"(){"use strict";nu(),d(),zs=[new y(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,s])=>{t.push(rn(e),!0,r,n,s)}),new y(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(t,[e,r,n,s])=>{t.push(rn(e),!1,r,n,s)})]}}),Vs={};E(Vs,{branchLocalTask:()=>ou,branchTask:()=>iu,containsDeleteBranchCommand:()=>Qs,deleteBranchTask:()=>uu,deleteBranchesTask:()=>au});function Qs(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}function iu(t){let e=Qs(t),r=["branch",...t];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return e?Wt(n,s).all[0]:Js(n)}}}function ou(){return{format:"utf-8",commands:["branch","-v"],parser:Js}}function au(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return Wt(r,n)},onError({exitCode:r,stdOut:n},s,i,o){if(!Us(String(s),r))return o(s);i(n)}}}function uu(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,s){return Wt(n,s).branches[t]},onError({exitCode:n,stdErr:s,stdOut:i},o,a,l){if(!Us(String(o),n))return l(o);throw new _t(r.parser(yt(i),yt(s)),String(o))}};return r}var cu=c({"src/lib/tasks/branch.ts"(){"use strict";ut(),ru(),su(),d()}}),Ws,lu=c({"src/lib/responses/CheckIgnore.ts"(){"use strict";Ws=t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e)}}),Hs={};E(Hs,{checkIgnoreTask:()=>pu});function pu(t){return{commands:["check-ignore",...t],format:"utf-8",parser:Ws}}var fu=c({"src/lib/tasks/check-ignore.ts"(){"use strict";lu()}}),Ys={};E(Ys,{cloneMirrorTask:()=>mu,cloneTask:()=>Ks});function hu(t){return/^--upload-pack(=|$)/.test(t)}function Ks(t,e,r){let n=["clone",...r];return R(t)&&n.push(t),R(e)&&n.push(e),n.find(hu)?M("git.fetch: potential exploit argument blocked."):$(n)}function mu(t,e,r){return _(r,"--mirror"),Ks(t,e,r)}var du=c({"src/lib/tasks/clone.ts"(){"use strict";C(),d()}});function gu(t,e){return D({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},Xs,[t,e])}var Xs,yu=c({"src/lib/parsers/parse-fetch.ts"(){"use strict";d(),Xs=[new y(/From (.+)$/,(t,[e])=>{t.remote=e}),new y(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new y(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new y(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new y(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,s])=>{t.updated.push({name:n,tracking:s,to:r,from:e})})]}}),Zs={};E(Zs,{fetchTask:()=>bu});function vu(t){return/^--upload-pack(=|$)/.test(t)}function bu(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(vu)?M("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:gu}}var _u=c({"src/lib/tasks/fetch.ts"(){"use strict";yu(),C()}});function ku(t){return D({moves:[]},ti,t)}var ti,wu=c({"src/lib/parsers/parse-move.ts"(){"use strict";d(),ti=[new y(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),ei={};E(ei,{moveTask:()=>Tu});function Tu(t,e){return{commands:["mv","-v",...q(t),e],format:"utf-8",parser:ku}}var Su=c({"src/lib/tasks/move.ts"(){"use strict";wu(),d()}}),ri={};E(ri,{pullTask:()=>xu});function xu(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(s,i){return He(s,i)},onError(s,i,o,a){let l=$a(yt(s.stdOut),yt(s.stdErr));if(l)return a(new _t(l));a(i)}}}var Cu=c({"src/lib/tasks/pull.ts"(){"use strict";ut(),Cs(),d()}});function Eu(t){let e={};return ni(t,([r])=>e[r]={name:r}),Object.values(e)}function Pu(t){let e={};return ni(t,([r,n,s])=>{e.hasOwnProperty(r)||(e[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(e[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}function ni(t,e){Oe(t,r=>e(r.split(/\s+/)))}var Ou=c({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";d()}}),si={};E(si,{addRemoteTask:()=>Ru,getRemotesTask:()=>Au,listRemotesTask:()=>$u,remoteTask:()=>Lu,removeRemoteTask:()=>Mu});function Ru(t,e,r){return $(["remote","add",...r,t,e])}function Au(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?Pu:Eu}}function $u(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),$(e)}function Lu(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),$(e)}function Mu(t){return $(["remote","remove",t])}var Du=c({"src/lib/tasks/remote.ts"(){"use strict";Ou(),C()}}),ii={};E(ii,{stashListTask:()=>ju});function ju(t={},e){let r=gs(t),n=["stash","list",...r.commands,...e],s=fs(r.splitter,r.fields,qe(n));return Qt(n)||{commands:n,format:"utf-8",parser:s}}var Iu=c({"src/lib/tasks/stash-list.ts"(){"use strict";St(),ms(),We(),ys()}}),oi={};E(oi,{addSubModuleTask:()=>Bu,initSubModuleTask:()=>Fu,subModuleTask:()=>Ht,updateSubModuleTask:()=>Nu});function Bu(t,e){return Ht(["add",t,e])}function Fu(t){return Ht(["init",...t])}function Ht(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),$(e)}function Nu(t){return Ht(["update",...t])}var Gu=c({"src/lib/tasks/sub-module.ts"(){"use strict";C()}});function Uu(t,e){let r=isNaN(t),n=isNaN(e);return r!==n?r?1:-1:r?ai(t,e):0}function ai(t,e){return t===e?0:t>e?1:-1}function qu(t){return t.trim()}function At(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var nn,ui,Ju=c({"src/lib/responses/TagList.ts"(){"use strict";nn=class{constructor(t,e){this.all=t,this.latest=e}},ui=function(t,e=!1){let r=t.split(`
|
|
52
|
-
`).map(qu).filter(Boolean);e||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return Uu(At(o[0]),At(a[0]));for(let l=0,p=Math.max(o.length,a.length);l<p;l++){let b=ai(At(o[l]),At(a[l]));if(b)return b}return 0});let n=e?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new nn(r,n)}}}),ci={};E(ci,{addAnnotatedTagTask:()=>Qu,addTagTask:()=>Vu,tagListTask:()=>zu});function zu(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return ui(r,e)}}}function Vu(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function Qu(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var Wu=c({"src/lib/tasks/tag.ts"(){"use strict";Ju()}}),Hu=lo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(Ko(),S(rs)),{SimpleGitApi:n}=(Ha(),S(js)),{Scheduler:s}=(Ya(),S(Is)),{configurationErrorTask:i}=(C(),S(_e)),{asArray:o,filterArray:a,filterPrimitives:l,filterString:p,filterStringOrStringArray:b,filterType:g,getTrailingOptions:v,trailingFunctionArgument:m,trailingOptionsArgument:X}=(d(),S(En)),{applyPatchTask:yi}=(Xa(),S(Ns)),{branchTask:vi,branchLocalTask:bi,deleteBranchesTask:_i,deleteBranchTask:ki}=(cu(),S(Vs)),{checkIgnoreTask:wi}=(fu(),S(Hs)),{checkIsRepoTask:Ti}=(An(),S(Pn)),{cloneTask:Si,cloneMirrorTask:xi}=(du(),S(Ys)),{cleanWithOptionsTask:Ci,isCleanOptionsArray:Ei}=(Un(),S(Nn)),{diffSummaryTask:Pi}=(We(),S(ds)),{fetchTask:Oi}=(_u(),S(Zs)),{moveTask:Ri}=(Su(),S(ei)),{pullTask:Ai}=(Cu(),S(ri)),{pushTagsTask:$i}=(Rs(),S(Os)),{addRemoteTask:Li,getRemotesTask:Mi,listRemotesTask:Di,remoteTask:ji,removeRemoteTask:Ii}=(Du(),S(si)),{getResetMode:Bi,resetTask:Fi}=(ts(),S(Kn)),{stashListTask:Ni}=(Iu(),S(ii)),{addSubModuleTask:Gi,initSubModuleTask:Ui,subModuleTask:qi,updateSubModuleTask:Ji}=(Gu(),S(oi)),{addAnnotatedTagTask:zi,addTagTask:Vi,tagListTask:Qi}=(Wu(),S(ci)),{straightThroughBufferTask:Wi,straightThroughStringTask:U}=(C(),S(_e));function h(u,f){this._plugins=f,this._executor=new r(u.baseDir,new s(u.maxConcurrentProcesses),f),this._trimmed=u.trimmed}(h.prototype=Object.create(n.prototype)).constructor=h,h.prototype.customBinary=function(u){return this._plugins.reconfigure("binary",u),this},h.prototype.env=function(u,f){return arguments.length===1&&typeof u=="object"?this._executor.env=u:(this._executor.env=this._executor.env||{})[u]=f,this},h.prototype.stashList=function(u){return this._runTask(Ni(X(arguments)||{},a(u)&&u||[]),m(arguments))};function Ze(u,f,k,A){return typeof k!="string"?i(`git.${u}() requires a string 'repoPath'`):f(k,g(A,p),v(arguments))}h.prototype.clone=function(){return this._runTask(Ze("clone",Si,...arguments),m(arguments))},h.prototype.mirror=function(){return this._runTask(Ze("mirror",xi,...arguments),m(arguments))},h.prototype.mv=function(u,f){return this._runTask(Ri(u,f),m(arguments))},h.prototype.checkoutLatestTag=function(u){var f=this;return this.pull(function(){f.tags(function(k,A){f.checkout(A.latest,u)})})},h.prototype.pull=function(u,f,k,A){return this._runTask(Ai(g(u,p),g(f,p),v(arguments)),m(arguments))},h.prototype.fetch=function(u,f){return this._runTask(Oi(g(u,p),g(f,p),v(arguments)),m(arguments))},h.prototype.silent=function(u){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},h.prototype.tags=function(u,f){return this._runTask(Qi(v(arguments)),m(arguments))},h.prototype.rebase=function(){return this._runTask(U(["rebase",...v(arguments)]),m(arguments))},h.prototype.reset=function(u){return this._runTask(Fi(Bi(u),v(arguments)),m(arguments))},h.prototype.revert=function(u){let f=m(arguments);return typeof u!="string"?this._runTask(i("Commit must be a string"),f):this._runTask(U(["revert",...v(arguments,0,!0),u]),f)},h.prototype.addTag=function(u){let f=typeof u=="string"?Vi(u):i("Git.addTag requires a tag name");return this._runTask(f,m(arguments))},h.prototype.addAnnotatedTag=function(u,f){return this._runTask(zi(u,f),m(arguments))},h.prototype.deleteLocalBranch=function(u,f,k){return this._runTask(ki(u,typeof f=="boolean"?f:!1),m(arguments))},h.prototype.deleteLocalBranches=function(u,f,k){return this._runTask(_i(u,typeof f=="boolean"?f:!1),m(arguments))},h.prototype.branch=function(u,f){return this._runTask(vi(v(arguments)),m(arguments))},h.prototype.branchLocal=function(u){return this._runTask(bi(),m(arguments))},h.prototype.raw=function(u){let f=!Array.isArray(u),k=[].slice.call(f?arguments:u,0);for(let N=0;N<k.length&&f;N++)if(!l(k[N])){k.splice(N,k.length-N);break}k.push(...v(arguments,0,!0));var A=m(arguments);return k.length?this._runTask(U(k,this._trimmed),A):this._runTask(i("Raw: must supply one or more command to execute"),A)},h.prototype.submoduleAdd=function(u,f,k){return this._runTask(Gi(u,f),m(arguments))},h.prototype.submoduleUpdate=function(u,f){return this._runTask(Ji(v(arguments,!0)),m(arguments))},h.prototype.submoduleInit=function(u,f){return this._runTask(Ui(v(arguments,!0)),m(arguments))},h.prototype.subModule=function(u,f){return this._runTask(qi(v(arguments)),m(arguments))},h.prototype.listRemote=function(){return this._runTask(Di(v(arguments)),m(arguments))},h.prototype.addRemote=function(u,f,k){return this._runTask(Li(u,f,v(arguments)),m(arguments))},h.prototype.removeRemote=function(u,f){return this._runTask(Ii(u),m(arguments))},h.prototype.getRemotes=function(u,f){return this._runTask(Mi(u===!0),m(arguments))},h.prototype.remote=function(u,f){return this._runTask(ji(v(arguments)),m(arguments))},h.prototype.tag=function(u,f){let k=v(arguments);return k[0]!=="tag"&&k.unshift("tag"),this._runTask(U(k),m(arguments))},h.prototype.updateServerInfo=function(u){return this._runTask(U(["update-server-info"]),m(arguments))},h.prototype.pushTags=function(u,f){let k=$i({remote:g(u,p)},v(arguments));return this._runTask(k,m(arguments))},h.prototype.rm=function(u){return this._runTask(U(["rm","-f",...o(u)]),m(arguments))},h.prototype.rmKeepLocal=function(u){return this._runTask(U(["rm","--cached",...o(u)]),m(arguments))},h.prototype.catFile=function(u,f){return this._catFile("utf-8",arguments)},h.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},h.prototype._catFile=function(u,f){var k=m(f),A=["cat-file"],N=f[0];if(typeof N=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),k);Array.isArray(N)&&A.push.apply(A,N);let Xt=u==="buffer"?Wi(A):U(A);return this._runTask(Xt,k)},h.prototype.diff=function(u,f){let k=p(u)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):U(["diff",...v(arguments)]);return this._runTask(k,m(arguments))},h.prototype.diffSummary=function(){return this._runTask(Pi(v(arguments,1)),m(arguments))},h.prototype.applyPatch=function(u){let f=b(u)?yi(o(u),v([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(f,m(arguments))},h.prototype.revparse=function(){let u=["rev-parse",...v(arguments,!0)];return this._runTask(U(u,!0),m(arguments))},h.prototype.clean=function(u,f,k){let A=Ei(u),N=A&&u.join("")||g(u,p)||"",Xt=v([].slice.call(arguments,A?1:0));return this._runTask(Ci(N,Xt),m(arguments))},h.prototype.exec=function(u){let f={commands:[],format:"utf-8",parser(){typeof u=="function"&&u()}};return this._runTask(f)},h.prototype.clearQueue=function(){return this},h.prototype.checkIgnore=function(u,f){return this._runTask(wi(o(g(u,b,[]))),m(arguments))},h.prototype.checkIsRepo=function(u,f){return this._runTask(Ti(g(u,p)),m(arguments))},e.exports=h}});bt();K();var Yu=class extends H{constructor(t,e){super(void 0,e),this.config=t}};K();K();var W=class extends H{constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};ut();pn();An();Un();zn();Qn();Yn();ts();function Ku(t){return t?[{type:"spawn.before",action(n,s){t.aborted&&s.kill(new W(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new W(void 0,"abort","Abort signal received"))}t.addEventListener("abort",i),s.spawned.on("close",()=>t.removeEventListener("abort",i))}}]:void 0}function Xu(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}function Zu(t,e){if(Xu(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new W(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function tc(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new W(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(e==="clone"&&/^\s*-u\b/.test(t))throw new W(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(e==="push"&&/^\s*--exec\b/.test(t))throw new W(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function ec({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";t||Zu(s,o),e||tc(s,n.method)}),r}}}d();function rc(t){let e=gt(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}d();var sn=(0,ot.deferred)().promise;function nc({onClose:t=!0,onExit:e=50}={}){function r(){let s=-1,i={close:(0,ot.deferred)(),closeTimeout:(0,ot.deferred)(),exit:(0,ot.deferred)(),exitTimeout:(0,ot.deferred)()},o=Promise.race([t===!1?sn:i.closeTimeout.promise,e===!1?sn:i.exitTimeout.promise]);return n(t,i.close,i.closeTimeout),n(e,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>ge(s))).then(o.done)}return{type:"spawn.after",action(s,i){return mt(this,arguments,function*(o,{spawned:a,close:l}){var p,b;let g=r(),v=!0,m=()=>void(v=!1);(p=a.stdout)==null||p.on("data",m),(b=a.stderr)==null||b.on("data",m),a.on("error",m),a.on("close",X=>g.close(X)),a.on("exit",X=>g.exit(X));try{yield g.result,v&&(yield ge(50)),l(g.exitCode)}catch(X){l(g.exitCode,X)}})}}}d();var sc="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",on="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function ic(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}function an(t,e){if(t.length<1||t.length>2)throw new W(void 0,"binary",sc);if(t.some(ic))if(e)console.warn(on);else throw new W(void 0,"binary",on);let[n,s]=t;return{binary:n,prefix:s}}function oc(t,e=["git"],r=!1){let n=an(q(e),r);t.on("binary",s=>{n=an(q(s),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}K();function ac(t){return!!(t.exitCode&&t.stdErr.length)}function uc(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function cc(t=!1,e=ac,r=uc){return(n,s)=>!t&&n||!e(s)?n:r(s)}function un(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new H(void 0,n.toString("utf-8"))}:{error:n}}}}d();var pc=class{constructor(){this.plugins=new Set,this.events=new lc}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=_(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return q(t).forEach(r=>r&&this.plugins.add(_(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===t&&(n=i.action(n,s));return n}};d();function fc(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?yn(i,e):i}},{type:"spawn.after",action(i,o){var a;o.commands.includes(e)&&((a=o.spawned.stderr)==null||a.on("data",l=>{let p=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));p&&t({method:o.method,stage:hc(p[1]),progress:w(p[2]),processed:w(p[3]),total:w(p[4])})}))}}]}function hc(t){return String(t.toLowerCase().split(" ",1))||"unknown"}d();function mc(t){let e=_n(t,["uid","gid"]);return{type:"spawn.options",action(r){return F(F({},e),r)}}}function dc({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,s){var i,o;let a;function l(){a&&clearTimeout(a),a=setTimeout(b,t)}function p(){var g,v;(g=s.spawned.stdout)==null||g.off("data",l),(v=s.spawned.stderr)==null||v.off("data",l),s.spawned.off("exit",p),s.spawned.off("close",p),a&&clearTimeout(a)}function b(){p(),s.kill(new W(void 0,"timeout","block timeout reached"))}r&&((i=s.spawned.stdout)==null||i.on("data",l)),e&&((o=s.spawned.stderr)==null||o.on("data",l)),s.spawned.on("exit",p),s.spawned.on("close",p),l()}}}bt();function gc(){return{type:"spawn.args",action(t){let e=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<t.length;s++){let i=t[s];if(jt(i)){n(Ar(i));continue}if(i==="--"){n(t.slice(s+1).flatMap(o=>jt(o)&&Ar(o)||o));break}e.push(i)}return r?[...e,"--",...r.map(String)]:e}}}d();var yc=Hu();function vc(t,e){var r;let n=new pc,s=xn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!Re(s.baseDir))throw new Yu(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(rc(s.config)),n.add(ec(s.unsafe)),n.add(gc()),n.add(nc(s.completion)),s.abort&&n.add(Ku(s.abort)),s.progress&&n.add(fc(s.progress)),s.timeout&&n.add(dc(s.timeout)),s.spawnOptions&&n.add(mc(s.spawnOptions)),n.add(un(cc(!0))),s.errors&&n.add(un(s.errors)),oc(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new yc(s,n)}ut();var li=vc;P();var pi=(t,e)=>{let r=/^(https:\/\/)?(?<slug>[\w-]+?)(--development)?(\..*)?$/.exec(t)?.groups?.slug;if(r)return r;throw new V(T`
|
|
53
|
-
${e} must be the application's {bold slug} or {bold URL}
|
|
54
|
-
|
|
55
|
-
{bold EXAMPLES:}
|
|
56
|
-
${e} my-app
|
|
57
|
-
${e} my-app.gadget.app
|
|
58
|
-
${e} https://my-app.gadget.app
|
|
59
|
-
${e} https://my-app.gadget.app/edit
|
|
60
|
-
${e} https://my-app--development.gadget.app/edit
|
|
61
|
-
`)};P();import Xe from"node:assert";var Yt=class{ctx;#t;constructor(e){this.ctx=e.child({name:"edit"}),this.#t=new br(this.ctx,"/edit/api/graphql")}async query({query:e,variables:r,...n}){let s=/query (\w+)/.exec(e)?.[1];Xe(s,"query name not found");let i=this.ctx.child({fields:{edit:{query:s}},devFields:{edit:{query:s,variables:ct(r)}}});i.log.info("executing graphql query");let o=await this.#t.execute(i,{operation:e,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(o.errors)throw new Q(e,o.errors);if(!o.data)throw new Q(e,"Query response did not contain data");return o.data}async mutate({mutation:e,variables:r,...n}){let s=/mutation (\w+)/.exec(e)?.[1];Xe(s,"mutation name not found");let i=this.ctx.child({fields:{edit:{mutation:s}},devFields:{edit:{mutation:s,variables:ct(r)}}});i.log.info("executing graphql mutation");let o=await this.#t.execute(i,{operation:e,variables:r,...n});if(o.errors)throw new Q(e,o.errors);if(!o.data)throw new Q(e,"Mutation response did not contain data");return o.data}subscribe({onData:e,...r}){let n=/subscription (\w+)/.exec(r.subscription)?.[1];Xe(n,"subscription name not found");let s=this.ctx.child({fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:ct(r.variables)}}}),i=async a=>{if(a.errors){o(),await r.onError(new Q(r.subscription,a.errors));return}if(!a.data){o(),await r.onError(new Q(r.subscription,"Subscription response did not contain data"));return}await e(a.data)};s.log.info("subscribing to graphql subscription");let o=this.#t.subscribe(s,{...r,onResponse:i});return{unsubscribe:()=>{o()},resubscribe:a=>{o(),a!==void 0&&(r.variables=a),s=this.ctx.child({fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:ct(r.variables)}}}),s.log.info("re-subscribing to graphql subscription"),o=this.#t.subscribe(s,{...r,onResponse:i})}}}async dispose(){await this.#t.dispose()}};var _p={"--app":{type:pi,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},mi=class t{constructor(e,r,n,s){this.ctx=e;this.directory=r;this.previousEnvironment=n;this.state=s;this.ctx=e.child({fields:()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}})}),this.app=fr(e),this.env=hr(e),this.edit=new Yt(this.ctx)}app;env;gitBranch;edit;get filesVersion(){let e=this.state.environments[this.state.environment];return fi(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{directory:r}){e=e.child({name:"sync-json"});let n=await yr(e),s=await ne(e);if(s.length===0)throw new V(T`
|
|
62
|
-
You (${n.email}) don't have have any Gadget applications.
|
|
63
|
-
|
|
64
|
-
Visit https://gadget.new to create one!
|
|
65
|
-
`);let i=await Kt.default.readFile(r.absolute(".gadget/sync.json"),"utf8").catch(g=>e.log.warn("failed to read .gadget/sync.json",{error:g}));if(!i)return;let o;try{o=Tc.parse(JSON.parse(i))}catch(g){e.log.warn("failed to parse .gadget/sync.json",{error:g,syncJsonFile:i});return}let a=await di(e,{availableApps:s,state:o});te(e,a);let l=await gi(e,{app:a,state:o});if(ee(e,l),o.application!==a.slug){if(e.args["--allow-different-app"]){let g=new t(e,r,void 0,{application:a.slug,environment:l.name,environments:{[l.name]:{filesVersion:"0"}}});return await g.loadGitBranch(),g}throw new V(T`
|
|
66
|
-
You were about to sync the following app to the following directory:
|
|
67
|
-
|
|
68
|
-
${a.slug} (${l.name}) → ${r.path}
|
|
69
|
-
|
|
70
|
-
However, that directory has already been synced with this app:
|
|
71
|
-
|
|
72
|
-
${o.application} (${o.environment})
|
|
73
|
-
|
|
74
|
-
If you're sure that you want to sync:
|
|
75
|
-
|
|
76
|
-
${a.slug} (${l.name}) → ${r.path}
|
|
77
|
-
|
|
78
|
-
Run "ggt dev" with the {bold --allow-different-app} flag.
|
|
79
|
-
`)}let p;o.environment!==l.name&&(z({ensureEmptyLineAbove:!0,content:T`
|
|
80
|
-
Changing environment.
|
|
81
|
-
|
|
82
|
-
${o.environment} → ${l.name}
|
|
83
|
-
`}),p=o.environment,o.environment=l.name,o.environments[l.name]||(o.environments[l.name]={filesVersion:"0"}));let b=new t(e,r,p,o);return await b.save(b.filesVersion),await b.loadGitBranch(),b}static async loadOrInit(e,{directory:r}){e=e.child({name:"sync-json"});let n=await t.load(e,{directory:r});if(n)return n;if(await r.hasFiles()&&!e.args["--allow-unknown-directory"])throw new Pt(e,{directory:r});let s=await di(e,{availableApps:await ne(e)});te(e,s);let i=await gi(e,{app:s});return ee(e,i),await Kt.default.ensureDir(r.path),n=new t(e,r,void 0,{application:s.slug,environment:i.name,environments:{[i.name]:{filesVersion:"0"}}}),await n.save(n.filesVersion),await n.loadGitBranch(),n}async save(e){let r=this.state.environments[this.state.environment];fi(r,"environment must exist in environments"),r.filesVersion=String(e),this.ctx.log.debug("saving .gadget/sync.json"),await Kt.default.outputJSON(this.directory.absolute(".gadget/sync.json"),this.state,{spaces:2})}async loadGitBranch(){this.gitBranch=await bc(this.ctx,{directory:this.directory})}sprint(e={}){let r=O`
|
|
84
|
-
Application ${this.app.slug}
|
|
85
|
-
Environment ${this.env.name}
|
|
86
|
-
`;return this.gitBranch&&(r+=O({indent:5,content:`Branch ${this.gitBranch}`})),st.isSupported?r+=O({ensureEmptyLineAbove:!0,content:`${st("Preview",`https://${this.app.slug}--${this.env.name}.gadget.app`)} ${st("Editor",`https://${this.app.primaryDomain}/edit/${this.env.name}`)} ${st("Playground",`https://${this.app.primaryDomain}/api/playground/graphql?environment=${this.env.name}`)} ${st("Docs",`https://docs.gadget.dev/api/${this.app.slug}`)}`}):r+=O`
|
|
87
|
-
------------------------
|
|
88
|
-
Preview https://${this.app.slug}--${this.env.name}.gadget.app
|
|
89
|
-
Editor https://${this.app.primaryDomain}/edit/${this.env.name}
|
|
90
|
-
Playground https://${this.app.primaryDomain}/api/playground/graphql?environment=${this.env.name}
|
|
91
|
-
Docs https://docs.gadget.dev/api/${this.app.slug}
|
|
92
|
-
`,O({...e,content:r})}print(e){e=lt(e,{ensureEmptyLineAbove:!0}),z(this.sprint(e))}},kp=async t=>{ur.windows&&t.startsWith("~/")&&(t=cr(t.slice(2)));let e=await ar(".gadget/sync.json",{cwd:t});return e&&(t=hi.join(e,"../..")),t=hi.resolve(t),await mr.init(t)},di=async(t,{availableApps:e,state:r})=>{let n=t.args["--app"]||r?.application;if(!n){let o=Array.from(kr(e)).map(([a,l])=>[a,l.map(p=>p.slug)]);n=await ae({groupedChoices:o,content:"Which application do you want to develop?"})}let s=e.find(o=>o.slug===n);if(s)return s;let i=re(n,e.map(o=>o.slug)).slice(0,5);throw new V(T`
|
|
93
|
-
Unknown application:
|
|
94
|
-
|
|
95
|
-
${n}
|
|
96
|
-
|
|
97
|
-
Did you mean one of these?
|
|
98
|
-
|
|
99
|
-
• ${i.join(`
|
|
100
|
-
\u2022 `)}
|
|
101
|
-
`)},gi=async(t,{app:e,state:r})=>{if(t.args["--env"]&&!e.multiEnvironmentEnabled)throw new V(T`
|
|
102
|
-
You specified an environment but your app doesn't have multiple environments.
|
|
103
|
-
|
|
104
|
-
Remove the "--env" flag to sync to the {bold ${e.primaryDomain}} environment.
|
|
105
|
-
`);let n=e.environments.filter(a=>a.type===_r.Development),s=t.args["--env"]||r?.environment;if(s||(s=await ae({choices:n.map(a=>a.name),content:"Which environment do you want to develop on?"})),s.toLowerCase()==="production")throw new V(T`
|
|
106
|
-
You cannot "ggt ${Et(t)}" your {bold production} environment.
|
|
107
|
-
`);let i=n.find(a=>a.name===s.toLowerCase());if(i)return i;let o=re(s,n.map(a=>a.name)).slice(0,5);throw new V(T`
|
|
108
|
-
Unknown environment:
|
|
109
|
-
|
|
110
|
-
${s}
|
|
111
|
-
|
|
112
|
-
Did you mean one of these?
|
|
113
|
-
|
|
114
|
-
• ${o.join(`
|
|
115
|
-
\u2022 `)}
|
|
116
|
-
`)},bc=async(t,{directory:e})=>{try{return await li(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},_c=B.object({application:B.string(),environment:B.string(),environments:B.record(B.object({filesVersion:B.string()}))}),kc=B.object({app:B.string(),filesVersion:B.string(),mtime:B.number()}),wc=B.union([_c,kc]),Tc=wc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Oc as a,se as b,Rc as c,Ac as d,$c as e,Tr as f,Pt as g,Sr as h,xr as i,Zi as j,Uc as k,ae as l,_p as m,mi as n,kp as o};
|
|
117
|
-
//# sourceMappingURL=chunk-RYQWS5BH.js.map
|