@gadgetinc/ggt 1.6.0 → 1.6.1

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.
Files changed (66) hide show
  1. package/README.md +1 -0
  2. package/dist/{add-FGXJSCE2.js → add-ERWYPHIS.js} +2 -2
  3. package/dist/{chunk-5NCJDCIZ.js → chunk-24OT7GHO.js} +15 -15
  4. package/dist/{chunk-5NCJDCIZ.js.map → chunk-24OT7GHO.js.map} +3 -3
  5. package/dist/{chunk-F4S4AEEO.js → chunk-DYAWQS24.js} +2 -2
  6. package/dist/{chunk-PA2LOSVH.js → chunk-FILWLZUN.js} +2 -2
  7. package/dist/chunk-GCO2TOVZ.js +50 -0
  8. package/dist/{chunk-LPBWX353.js.map → chunk-GCO2TOVZ.js.map} +3 -3
  9. package/dist/{chunk-JHWQLV6Y.js → chunk-ILB6CSBN.js} +2 -2
  10. package/dist/{chunk-IYQBG4II.js → chunk-JBY5A44K.js} +2 -2
  11. package/dist/{chunk-YT2LSGNB.js → chunk-JSGXXXFU.js} +2 -2
  12. package/dist/chunk-KMNQ3LJT.js +12 -0
  13. package/dist/{chunk-VJVFVZNR.js.map → chunk-KMNQ3LJT.js.map} +1 -1
  14. package/dist/chunk-KS2O3TJA.js +116 -0
  15. package/dist/{chunk-I6BQ7MRE.js.map → chunk-KS2O3TJA.js.map} +3 -3
  16. package/dist/{chunk-2CKK6A2Y.js → chunk-OGQ5LIYM.js} +2 -2
  17. package/dist/{chunk-2CKK6A2Y.js.map → chunk-OGQ5LIYM.js.map} +1 -1
  18. package/dist/chunk-QXWICGG6.js +2 -0
  19. package/dist/{chunk-72YIA2TT.js.map → chunk-QXWICGG6.js.map} +1 -1
  20. package/dist/{chunk-L2MG47NS.js → chunk-UCJDY73U.js} +2 -2
  21. package/dist/{chunk-4WFO3NAS.js → chunk-WNAYBYSG.js} +2 -2
  22. package/dist/{chunk-SIAMHUOB.js → chunk-WZ3Q7TTB.js} +2 -2
  23. package/dist/{chunk-XK6JJEHJ.js → chunk-XGQQOMPO.js} +2 -2
  24. package/dist/{configure-L4U26WFP.js → configure-LD5XC2MR.js} +2 -2
  25. package/dist/{deploy-6JWXSMQJ.js → deploy-7Q7RRIXS.js} +2 -2
  26. package/dist/{dev-M2PFPQXX.js → dev-MQ76B6CR.js} +2 -2
  27. package/dist/{list-LNXNHS2W.js → list-YXCTVLRH.js} +2 -2
  28. package/dist/{list-LNXNHS2W.js.map → list-YXCTVLRH.js.map} +1 -1
  29. package/dist/login-XIEASAMY.js +2 -0
  30. package/dist/{logout-JA5JBU3G.js → logout-ACRXIJEF.js} +2 -2
  31. package/dist/main.js +3 -2
  32. package/dist/main.js.map +2 -2
  33. package/dist/{open-TWQBAPIT.js → open-5CYXKN42.js} +2 -2
  34. package/dist/{pull-VWGETR4M.js → pull-STASHXEL.js} +2 -2
  35. package/dist/push-6WUPKY5W.js +2 -0
  36. package/dist/{status-OYEFON4A.js → status-SB22V3DI.js} +2 -2
  37. package/dist/{version-4QPNJ5VH.js → version-NZHW3VLV.js} +2 -2
  38. package/dist/{whoami-TIGWXVEY.js → whoami-AA3ISE77.js} +2 -2
  39. package/package.json +1 -1
  40. package/dist/chunk-72YIA2TT.js +0 -2
  41. package/dist/chunk-I6BQ7MRE.js +0 -116
  42. package/dist/chunk-LPBWX353.js +0 -50
  43. package/dist/chunk-VJVFVZNR.js +0 -12
  44. package/dist/login-4F3H443A.js +0 -2
  45. package/dist/push-KWUMHQCJ.js +0 -2
  46. /package/dist/{add-FGXJSCE2.js.map → add-ERWYPHIS.js.map} +0 -0
  47. /package/dist/{chunk-F4S4AEEO.js.map → chunk-DYAWQS24.js.map} +0 -0
  48. /package/dist/{chunk-PA2LOSVH.js.map → chunk-FILWLZUN.js.map} +0 -0
  49. /package/dist/{chunk-JHWQLV6Y.js.map → chunk-ILB6CSBN.js.map} +0 -0
  50. /package/dist/{chunk-IYQBG4II.js.map → chunk-JBY5A44K.js.map} +0 -0
  51. /package/dist/{chunk-YT2LSGNB.js.map → chunk-JSGXXXFU.js.map} +0 -0
  52. /package/dist/{chunk-L2MG47NS.js.map → chunk-UCJDY73U.js.map} +0 -0
  53. /package/dist/{chunk-4WFO3NAS.js.map → chunk-WNAYBYSG.js.map} +0 -0
  54. /package/dist/{chunk-SIAMHUOB.js.map → chunk-WZ3Q7TTB.js.map} +0 -0
  55. /package/dist/{chunk-XK6JJEHJ.js.map → chunk-XGQQOMPO.js.map} +0 -0
  56. /package/dist/{configure-L4U26WFP.js.map → configure-LD5XC2MR.js.map} +0 -0
  57. /package/dist/{deploy-6JWXSMQJ.js.map → deploy-7Q7RRIXS.js.map} +0 -0
  58. /package/dist/{dev-M2PFPQXX.js.map → dev-MQ76B6CR.js.map} +0 -0
  59. /package/dist/{login-4F3H443A.js.map → login-XIEASAMY.js.map} +0 -0
  60. /package/dist/{logout-JA5JBU3G.js.map → logout-ACRXIJEF.js.map} +0 -0
  61. /package/dist/{open-TWQBAPIT.js.map → open-5CYXKN42.js.map} +0 -0
  62. /package/dist/{pull-VWGETR4M.js.map → pull-STASHXEL.js.map} +0 -0
  63. /package/dist/{push-KWUMHQCJ.js.map → push-6WUPKY5W.js.map} +0 -0
  64. /package/dist/{status-OYEFON4A.js.map → status-SB22V3DI.js.map} +0 -0
  65. /package/dist/{version-4QPNJ5VH.js.map → version-NZHW3VLV.js.map} +0 -0
  66. /package/dist/{whoami-TIGWXVEY.js.map → whoami-AA3ISE77.js.map} +0 -0
@@ -0,0 +1,116 @@
1
+ import{c as K}from"./chunk-WZ3Q7TTB.js";import{a as be}from"./chunk-JBY5A44K.js";import{a as ro,b as no}from"./chunk-HN3YKQ3C.js";import{g as Lr}from"./chunk-FILWLZUN.js";import{a as ft,c as Rr,f as _t,g as wt,k as so,l as Ar,n as ge,o as X,p as Fr,t as jr,u as ye,v as ve,w as Dr,z as kt}from"./chunk-GCO2TOVZ.js";import{a as $r}from"./chunk-KMNQ3LJT.js";import{$ as Pr,A as eo,N as Or,U as vt,Z as he,b as st,e as J,g as br,h as _r,ha as C,i as wr,ia as $,ja as bt,m as kr,n as Tr,u as Sr,v as Cr,w as xr,z as Er}from"./chunk-24OT7GHO.js";import{a as to}from"./chunk-GFQYFEEH.js";import{a as n,b as de,d as nt,f as pt,h as T}from"./chunk-7DYQUG5M.js";var Gr=nt(N=>{"use strict";T();var ao=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N,"__esModule",{value:!0});var uo=de("fs"),co=ao(no()),mt=co.default("@kwsites/file-exists");function lo(t,e,r){mt("checking %s",t);try{let s=uo.statSync(t);return s.isFile()&&e?(mt("[OK] path represents a file"),!0):s.isDirectory()&&r?(mt("[OK] path represents a directory"),!0):(mt("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return mt("[FAIL] path is not accessible: %o",s),!1;throw mt("[FATAL] %o",s),s}}n(lo,"check");function po(t,e=N.READABLE){return lo(t,(e&N.FILE)>0,(e&N.FOLDER)>0)}n(po,"exists");N.exists=po;N.FILE=1;N.FOLDER=2;N.READABLE=N.FILE+N.FOLDER});var Ur=nt(Bt=>{"use strict";T();function fo(t){for(var e in t)Bt.hasOwnProperty(e)||(Bt[e]=t[e])}n(fo,"__export");Object.defineProperty(Bt,"__esModule",{value:!0});fo(Gr())});var we=nt((wl,qr)=>{T();function mo(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=to(),r.destroy=d,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let m=0;for(let h=0;h<p.length;h++)m=(m<<5)-m+p.charCodeAt(h),m|=0;return r.colors[Math.abs(m)%r.colors.length]}n(e,"selectColor"),r.selectColor=e;function r(p){let m,h=null,g,I;function q(...D){if(!q.enabled)return;let Y=q,ct=Number(new Date),le=ct-(m||ct);Y.diff=le,Y.prev=m,Y.curr=ct,m=ct,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let lt=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(yt,pe)=>{if(yt==="%%")return"%";lt++;let Lt=r.formatters[pe];if(typeof Lt=="function"){let fe=D[lt];yt=Lt.call(Y,fe),D.splice(lt,1),lt--}return yt}),r.formatArgs.call(Y,D),(Y.log||r.log).apply(Y,D)}return n(q,"debug"),q.namespace=p,q.useColors=r.useColors(),q.color=r.selectColor(p),q.extend=s,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:n(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(p)),I),"get"),set:n(D=>{h=D},"set")}),typeof r.init=="function"&&r.init(q),q}n(r,"createDebug");function s(p,m){let h=r(this.namespace+(typeof m>"u"?":":m)+p);return h.log=this.log,h}n(s,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m,h=(typeof p=="string"?p:"").split(/[\s,]+/),g=h.length;for(m=0;m<g;m++)h[m]&&(p=h[m].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}n(i,"enable");function o(){let p=[...r.names.map(u),...r.skips.map(u).map(m=>"-"+m)].join(",");return r.enable(""),p}n(o,"disable");function a(p){if(p[p.length-1]==="*")return!0;let m,h;for(m=0,h=r.skips.length;m<h;m++)if(r.skips[m].test(p))return!1;for(m=0,h=r.names.length;m<h;m++)if(r.names[m].test(p))return!0;return!1}n(a,"enabled");function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}n(u,"toNamespace");function c(p){return p instanceof Error?p.stack||p.message:p}n(c,"coerce");function d(){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(d,"destroy"),r.enable(r.load()),r}n(mo,"setup");qr.exports=mo});var Jr=nt((G,It)=>{T();G.formatArgs=go;G.save=yo;G.load=vo;G.useColors=ho;G.storage=bo();G.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();G.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"];function ho(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}n(ho,"useColors");function go(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+It.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}n(go,"formatArgs");G.log=console.debug||console.log||(()=>{});function yo(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}n(yo,"save");function vo(){let t;try{t=G.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}n(vo,"load");function bo(){try{return localStorage}catch{}}n(bo,"localstorage");It.exports=we()(G);var{formatters:_o}=It.exports;_o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vr=nt((R,Gt)=>{T();var wo=de("tty"),Nt=de("util");R.init=Oo;R.log=Co;R.formatArgs=To;R.save=xo;R.load=Eo;R.useColors=ko;R.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R.colors=[6,2,3,4,5,1];try{let t=ro();t&&(t.stderr||t).level>=2&&(R.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{}R.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function ko(){return"colors"in R.inspectOpts?!!R.inspectOpts.colors:wo.isatty(process.stderr.fd)}n(ko,"useColors");function To(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="\x1B[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
2
+ `).join(`
3
+ `+o),t.push(i+"m+"+Gt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=So()+e+" "+t[0]}n(To,"formatArgs");function So(){return R.inspectOpts.hideDate?"":new Date().toISOString()+" "}n(So,"getDate");function Co(...t){return process.stderr.write(Nt.formatWithOptions(R.inspectOpts,...t)+`
4
+ `)}n(Co,"log");function xo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}n(xo,"save");function Eo(){return process.env.DEBUG}n(Eo,"load");function Oo(t){t.inspectOpts={};let e=Object.keys(R.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=R.inspectOpts[e[r]]}n(Oo,"init");Gt.exports=we()(R);var{formatters:zr}=Gt.exports;zr.o=function(t){return this.inspectOpts.colors=this.useColors,Nt.inspect(t,this.inspectOpts).split(`
5
+ `).map(e=>e.trim()).join(" ")};zr.O=function(t){return this.inspectOpts.colors=this.useColors,Nt.inspect(t,this.inspectOpts)}});var Qr=nt((Ol,ke)=>{T();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ke.exports=Jr():ke.exports=Vr()});var Se=nt(it=>{"use strict";T();Object.defineProperty(it,"__esModule",{value:!0});it.createDeferred=it.deferred=void 0;function Te(){let t,e,r="pending";return{promise:new Promise((i,o)=>{t=i,e=o}),done(i){r==="pending"&&(r="resolved",t(i))},fail(i){r==="pending"&&(r="rejected",e(i))},get fulfilled(){return r!=="pending"},get status(){return r}}}n(Te,"deferred");it.deferred=Te;it.createDeferred=Te;it.default=Te});T();var Mr=pt(so(),1);var Kc=Object.freeze({Fatal:"Fatal",Error:"Error",Warning:"Warning",Info:"Info"}),_e=n(({problems:t,showFileTypes:e,...r})=>{let s="";for(let[i,o]of Object.entries(t)){s+=$(""),s+=$`• {cyan ${i}} {redBright ${(0,Mr.default)("problem",o.length,!0)}}`;for(let a of o){let[u,...c]=a.message.split(`
6
+ `);s+=C` {red ✖} `,(e??a.type==="SourceFile")&&(s+=C`${io(i)} `),s+=C(u);for(let d of c)s+=$(""),s+=C` ${d}`;for(let d of a.labels)s+=C` {dim ${d}}`;s+=$("")}}return $({...r,content:s})},"sprintProblems"),Xc=n(t=>{bt(_e(t))},"printProblems"),io=n(t=>{switch(!0){case Sr(t):return st.yellowBright("JavaScript");case Cr(t):return st.blue("TypeScript");case xr(t):return st.magenta("Gelly");default:return st.gray("File")}},"filetype"),Zc=n(t=>{let e={};for(let r of t){let s=r.node?.apiIdentifier??r.node?.name??"Other";e[s]??=[],e[s].push({type:r.node?.type??"Unknown",severity:r.severity,message:r.message,labels:Ar(r.nodeLabels?.map(i=>i?.identifier)??[])})}return e},"publishIssuesToProblems"),tl=n(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},"filesyncProblemsToProblems");T();var Br=class extends wt{static{n(this,"YarnNotFoundError")}isBug=_t.NO;constructor(){super("Yarn not found")}render(){return C`
7
+ Yarn must be installed to sync your application. You can install it by running:
8
+
9
+ $ npm install --global yarn
10
+
11
+ For more information, see: https://classic.yarnpkg.com/en/docs/install
12
+ `}},Mt=class extends wt{constructor(r){super('The ".gadget/sync.json" file was invalid or not found');this.details=r}static{n(this,"UnknownDirectoryError")}isBug=_t.NO;render(){let r=this.details.directory.path;switch(this.details.command){case"add":case"open":case"status":return C`
13
+ A ".gadget/sync.json" file is missing in this directory:
14
+
15
+ ${r}
16
+
17
+ In order to use "ggt ${this.details.command}", you must run it within a directory
18
+ that has already been initialized with "ggt dev".
19
+ `;case"dev":return C`
20
+ A ".gadget/sync.json" file is missing in this directory:
21
+
22
+ ${r}
23
+
24
+ If you're running "ggt dev" for the first time, we recommend
25
+ using a gadget specific directory like this:
26
+
27
+ ggt dev ~/gadget/${this.details.args["--app"]??"<name>"}
28
+
29
+ To use a non-empty directory without a ".gadget/sync.json" file,
30
+ run "ggt dev" again with the "--allow-unknown-directory" flag:
31
+
32
+ ggt dev ${r} --allow-unknown-directory
33
+ `;default:return C`
34
+ A ".gadget/sync.json" file is missing in this directory:
35
+
36
+ ${r}
37
+
38
+ If you're certain you want to use this directory, you can run
39
+ "ggt ${this.details.command}" again with the "--allow-unknown-directory" flag:
40
+
41
+ ggt ${this.details.command} --allow-unknown-directory
42
+ `}}},Ir=class extends wt{constructor(r){super(`Failed to synchronize files after ${r} attempts.`);this.attempts=r}static{n(this,"TooManyMergeAttemptsError")}isBug=_t.MAYBE;render(){return C`
43
+ We merged your local files with your environment's files ${this.attempts} times,
44
+ but your local and environment's files still don't match.
45
+
46
+ Make sure no one else is editing files on your environment, and try again.
47
+ `}},Nr=class extends wt{constructor(r){super("This application is not allowed to be deployed due to fatal errors.");this.fatalErrors=r}static{n(this,"DeployDisallowedError")}isBug=_t.MAYBE;render(){let r=$`{red Gadget has detected the following fatal errors with your files:}`;return r+=_e({ensureEmptyLineAbove:!0,problems:this.fatalErrors,showFileTypes:!1}),r+=$({ensureEmptyLineAbove:!0,content:st.red("Please fix these errors and try again.")}),r}},oo=n(t=>(t instanceof X&&(t=t.cause),kr(t)&&(t=t.errors),Tr(t)&&(t=t[0]),_r(t)&&"message"in t&&br(t.message)&&t.message.includes("Files version mismatch")),"isFilesVersionMismatchError"),pl=n((t,e)=>{if(oo(e)){t.log.debug("swallowing files version mismatch",{error:e});return}throw e},"swallowFilesVersionMismatch");T();var ce=pt(eo(),1);import hr from"node:assert";import Ri from"node:path";T();var te=pt(Ur(),1),Yt=pt(Qr(),1),ri=pt(Se(),1),dt=pt(Se(),1);import{spawn as ga}from"child_process";import{EventEmitter as Fc}from"node:events";var Xt=Object.defineProperty,Po=Object.defineProperties,Ro=Object.getOwnPropertyDescriptor,Ao=Object.getOwnPropertyDescriptors,Je=Object.getOwnPropertyNames,Wr=Object.getOwnPropertySymbols,On=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,Hr=n((t,e,r)=>e in t?Xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,"__defNormalProp"),z=n((t,e)=>{for(var r in e||(e={}))On.call(e,r)&&Hr(t,r,e[r]);if(Wr)for(var r of Wr(e))Fo.call(e,r)&&Hr(t,r,e[r]);return t},"__spreadValues"),Ct=n((t,e)=>Po(t,Ao(e)),"__spreadProps"),f=n((t,e)=>n(function(){return t&&(e=(0,t[Je(t)[0]])(t=0)),e},"__init"),"__esm"),$o=n((t,e)=>n(function(){return e||(0,t[Je(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),P=n((t,e)=>{for(var r in e)Xt(t,r,{get:e[r],enumerable:!0})},"__export"),jo=n((t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Je(e))!On.call(t,i)&&i!==r&&Xt(t,i,{get:n(()=>e[i],"get"),enumerable:!(s=Ro(e,i))||s.enumerable});return t},"__copyProps"),x=n(t=>jo(Xt({},"__esModule",{value:!0}),t),"__toCommonJS"),St=n((t,e,r)=>new Promise((s,i)=>{var o=n(c=>{try{u(r.next(c))}catch(d){i(d)}},"fulfilled"),a=n(c=>{try{u(r.throw(c))}catch(d){i(d)}},"rejected"),u=n(c=>c.done?s(c.value):Promise.resolve(c.value).then(o,a),"step");u((r=r.apply(t,e)).next())}),"__async");function Do(...t){let e=new String(t);return Zt.set(e,t),e}n(Do,"pathspec");function Wt(t){return t instanceof String&&Zt.has(t)}n(Wt,"isPathSpec");function Yr(t){return Zt.get(t)||[]}n(Yr,"toPaths");var Zt,Pt=f({"src/lib/args/pathspec.ts"(){"use strict";Zt=new WeakMap}}),tt,rt=f({"src/lib/errors/git-error.ts"(){"use strict";tt=class extends Error{static{n(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Rt,gt=f({"src/lib/errors/git-response-error.ts"(){"use strict";rt(),Rt=class extends tt{static{n(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),Pn,Rn=f({"src/lib/errors/task-configuration-error.ts"(){"use strict";rt(),Pn=class extends tt{static{n(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function An(t){return typeof t=="function"?t:ut}n(An,"asFunction");function Fn(t){return typeof t=="function"&&t!==ut}n(Fn,"isUserFunction");function $n(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}n($n,"splitOn");function jn(t,e=0){return Dn(t)&&t.length>e?t[e]:void 0}n(jn,"first");function at(t,e=0){if(Dn(t)&&t.length>e)return t[t.length-1-e]}n(at,"last");function Dn(t){return!!(t&&typeof t.length=="number")}n(Dn,"isArrayLike");function At(t="",e=!0,r=`
48
+ `){return t.split(r).reduce((s,i)=>{let o=e?i.trim():i;return o&&s.push(o),s},[])}n(At,"toLinesWithContent");function ze(t,e){return At(t,!0).map(r=>e(r))}n(ze,"forEachLineWithContent");function Ve(t){return(0,te.exists)(t,te.FOLDER)}n(Ve,"folderExists");function w(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}n(w,"append");function Ln(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}n(Ln,"including");function ee(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}n(ee,"remove");function W(t){return Array.isArray(t)?t:[t]}n(W,"asArray");function Mn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}n(Mn,"asCamelCase");function Bn(t){return W(t).map(String)}n(Bn,"asStringArray");function S(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}n(S,"asNumber");function xt(t,e){let r=[];for(let s=0,i=t.length;s<i;s++)r.push(e,t[s]);return r}n(xt,"prefixedArray");function Et(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}n(Et,"bufferToString");function In(t,e){return Object.assign({},...e.map(r=>r in t?{[r]:t[r]}:{}))}n(In,"pick");function Ae(t=0){return new Promise(e=>setTimeout(e,t))}n(Ae,"delay");function Fe(t){if(t!==!1)return t}n(Fe,"orVoid");var ht,ut,Ft,re=f({"src/lib/utils/util.ts"(){"use strict";ht="\0",ut=n(()=>{},"NOOP"),Ft=Object.prototype.toString.call.bind(Object.prototype.toString)}});function H(t,e,r){return e(t)?t:arguments.length>2?r:void 0}n(H,"filterType");function Qe(t,e){let r=Wt(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}n(Qe,"filterPrimitives");function We(t){return!!t&&Ft(t)==="[object Object]"}n(We,"filterPlainObject");function Nn(t){return typeof t=="function"}n(Nn,"filterFunction");var $t,A,Gn,Ht,He,Un=f({"src/lib/utils/argument-filters.ts"(){"use strict";re(),Pt(),$t=n(t=>Array.isArray(t),"filterArray"),A=n(t=>typeof t=="string","filterString"),Gn=n(t=>Array.isArray(t)&&t.every(A),"filterStringArray"),Ht=n(t=>A(t)||Array.isArray(t)&&t.every(A),"filterStringOrStringArray"),He=n(t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number","filterHasLength")}}),$e,Lo=f({"src/lib/utils/exit-codes.ts"(){"use strict";$e=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))($e||{})}}),Ot,Mo=f({"src/lib/utils/git-output-streams.ts"(){"use strict";Ot=class{static{n(this,"GitOutputStreams")}constructor(t,e){this.stdOut=t,this.stdErr=e}asStrings(){return new Ot(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),_,et,Bo=f({"src/lib/utils/line-parser.ts"(){"use strict";_=class{static{n(this,"LineParser")}constructor(t,e){this.matches=[],this.parse=(r,s)=>(this.resetMatches(),this._regExp.every((i,o)=>this.addMatch(i,o,r(o)))?this.useMatches(s,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 s=r&&t.exec(r);return s&&this.pushMatch(e,s),!!s}pushMatch(t,e){this.matches.push(...e.slice(1))}},et=class extends _{static{n(this,"RemoteLineParser")}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 qn(...t){let e=process.cwd(),r=Object.assign(z({baseDir:e},Jn),...t.filter(s=>typeof s=="object"&&s));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}n(qn,"createInstanceConfig");var Jn,Io=f({"src/lib/utils/simple-git-options.ts"(){"use strict";Jn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Ye(t,e=[]){return We(t)?Object.keys(t).reduce((r,s)=>{let i=t[s];return Wt(i)?r.push(i):Qe(i,["boolean"])?r.push(s+"="+i):r.push(s),r},e):e}n(Ye,"appendTaskOptions");function L(t,e=0,r=!1){let s=[];for(let i=0,o=e<0?t.length:e;i<o;i++)"string|number".includes(typeof t[i])&&s.push(String(t[i]));return Ye(Ke(t),s),r||s.push(...No(t)),s}n(L,"getTrailingOptions");function No(t){let e=typeof at(t)=="function";return H(at(t,e?1:0),$t,[])}n(No,"trailingArrayArgument");function Ke(t){let e=Nn(at(t));return H(at(t,e?1:0),We)}n(Ke,"trailingOptionsArgument");function E(t,e=!0){let r=An(at(t));return e||Fn(r)?r:void 0}n(E,"trailingFunctionArgument");var Go=f({"src/lib/utils/task-options.ts"(){"use strict";Un(),re(),Pt()}});function je(t,e){return t(e.stdOut,e.stdErr)}n(je,"callTaskParser");function B(t,e,r,s=!0){return W(r).forEach(i=>{for(let o=At(i,s),a=0,u=o.length;a<u;a++){let c=n((d=0)=>{if(!(a+d>=u))return o[a+d]},"line");e.some(({parse:d})=>d(c,t))}}),t}n(B,"parseStringResponse");var Uo=f({"src/lib/utils/task-parser.ts"(){"use strict";re()}}),zn={};P(zn,{ExitCodes:n(()=>$e,"ExitCodes"),GitOutputStreams:n(()=>Ot,"GitOutputStreams"),LineParser:n(()=>_,"LineParser"),NOOP:n(()=>ut,"NOOP"),NULL:n(()=>ht,"NULL"),RemoteLineParser:n(()=>et,"RemoteLineParser"),append:n(()=>w,"append"),appendTaskOptions:n(()=>Ye,"appendTaskOptions"),asArray:n(()=>W,"asArray"),asCamelCase:n(()=>Mn,"asCamelCase"),asFunction:n(()=>An,"asFunction"),asNumber:n(()=>S,"asNumber"),asStringArray:n(()=>Bn,"asStringArray"),bufferToString:n(()=>Et,"bufferToString"),callTaskParser:n(()=>je,"callTaskParser"),createInstanceConfig:n(()=>qn,"createInstanceConfig"),delay:n(()=>Ae,"delay"),filterArray:n(()=>$t,"filterArray"),filterFunction:n(()=>Nn,"filterFunction"),filterHasLength:n(()=>He,"filterHasLength"),filterPlainObject:n(()=>We,"filterPlainObject"),filterPrimitives:n(()=>Qe,"filterPrimitives"),filterString:n(()=>A,"filterString"),filterStringArray:n(()=>Gn,"filterStringArray"),filterStringOrStringArray:n(()=>Ht,"filterStringOrStringArray"),filterType:n(()=>H,"filterType"),first:n(()=>jn,"first"),folderExists:n(()=>Ve,"folderExists"),forEachLineWithContent:n(()=>ze,"forEachLineWithContent"),getTrailingOptions:n(()=>L,"getTrailingOptions"),including:n(()=>Ln,"including"),isUserFunction:n(()=>Fn,"isUserFunction"),last:n(()=>at,"last"),objectToString:n(()=>Ft,"objectToString"),orVoid:n(()=>Fe,"orVoid"),parseStringResponse:n(()=>B,"parseStringResponse"),pick:n(()=>In,"pick"),prefixedArray:n(()=>xt,"prefixedArray"),remove:n(()=>ee,"remove"),splitOn:n(()=>$n,"splitOn"),toLinesWithContent:n(()=>At,"toLinesWithContent"),trailingFunctionArgument:n(()=>E,"trailingFunctionArgument"),trailingOptionsArgument:n(()=>Ke,"trailingOptionsArgument")});var b=f({"src/lib/utils/index.ts"(){"use strict";Un(),Lo(),Mo(),Bo(),Io(),Go(),Uo(),re()}}),Vn={};P(Vn,{CheckRepoActions:n(()=>De,"CheckRepoActions"),checkIsBareRepoTask:n(()=>Wn,"checkIsBareRepoTask"),checkIsRepoRootTask:n(()=>Qn,"checkIsRepoRootTask"),checkIsRepoTask:n(()=>qo,"checkIsRepoTask")});function qo(t){switch(t){case"bare":return Wn();case"root":return Qn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:ne,parser:Xe}}n(qo,"checkIsRepoTask");function Qn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:ne,parser(e){return/^\.(git)?$/.test(e.trim())}}}n(Qn,"checkIsRepoRootTask");function Wn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:ne,parser:Xe}}n(Wn,"checkIsBareRepoTask");function Jo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}n(Jo,"isNotRepoMessage");var De,ne,Xe,Hn=f({"src/lib/tasks/check-is-repo.ts"(){"use strict";b(),De=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(De||{}),ne=n(({exitCode:t},e,r,s)=>{if(t===128&&Jo(e))return r(Buffer.from("false"));s(e)},"onError"),Xe=n(t=>t.trim()==="true","parser")}});function zo(t,e){let r=new Yn(t),s=t?Xn:Kn;return At(e).forEach(i=>{let o=i.replace(s,"");r.paths.push(o),(Zn.test(o)?r.folders:r.files).push(o)}),r}n(zo,"cleanSummaryParser");var Yn,Kn,Xn,Zn,Vo=f({"src/lib/responses/CleanSummary.ts"(){"use strict";b(),Yn=class{static{n(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Kn=/^[a-z]+\s*/i,Xn=/^[a-z]+\s+[a-z]+\s*/i,Zn=/\/$/}}),Le={};P(Le,{EMPTY_COMMANDS:n(()=>se,"EMPTY_COMMANDS"),adhocExecTask:n(()=>ts,"adhocExecTask"),configurationErrorTask:n(()=>M,"configurationErrorTask"),isBufferTask:n(()=>rs,"isBufferTask"),isEmptyTask:n(()=>ns,"isEmptyTask"),straightThroughBufferTask:n(()=>es,"straightThroughBufferTask"),straightThroughStringTask:n(()=>j,"straightThroughStringTask")});function ts(t){return{commands:se,format:"empty",parser:t}}n(ts,"adhocExecTask");function M(t){return{commands:se,format:"empty",parser(){throw typeof t=="string"?new Pn(t):t}}}n(M,"configurationErrorTask");function j(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}n(j,"straightThroughStringTask");function es(t){return{commands:t,format:"buffer",parser(e){return e}}}n(es,"straightThroughBufferTask");function rs(t){return t.format==="buffer"}n(rs,"isBufferTask");function ns(t){return t.format==="empty"||!t.commands.length}n(ns,"isEmptyTask");var se,O=f({"src/lib/tasks/task.ts"(){"use strict";Rn(),se=[]}}),ss={};P(ss,{CONFIG_ERROR_INTERACTIVE_MODE:n(()=>Ze,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:n(()=>tr,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:n(()=>er,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:n(()=>Jt,"CleanOptions"),cleanTask:n(()=>is,"cleanTask"),cleanWithOptionsTask:n(()=>Qo,"cleanWithOptionsTask"),isCleanOptionsArray:n(()=>Wo,"isCleanOptionsArray")});function Qo(t,e){let{cleanMode:r,options:s,valid:i}=Ho(t);return r?i.options?(s.push(...e),s.some(Xo)?M(Ze):is(r,s)):M(er+JSON.stringify(t)):M(tr)}n(Qo,"cleanWithOptionsTask");function is(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(s){return zo(t==="n",s)}}}n(is,"cleanTask");function Wo(t){return Array.isArray(t)&&t.every(e=>rr.has(e))}n(Wo,"isCleanOptionsArray");function Ho(t){let e,r=[],s={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(i=>{Yo(i)?(e=i,s.cleanMode=!0):s.options=s.options&&Ko(r[r.length]=`-${i}`)}),{cleanMode:e,options:r,valid:s}}n(Ho,"getCleanOptions");function Yo(t){return t==="f"||t==="n"}n(Yo,"isCleanMode");function Ko(t){return/^-[a-z]$/i.test(t)&&rr.has(t.charAt(1))}n(Ko,"isKnownOption");function Xo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}n(Xo,"isInteractiveMode");var Ze,tr,er,Jt,rr,os=f({"src/lib/tasks/clean.ts"(){"use strict";Vo(),b(),O(),Ze="Git clean interactive mode is not supported",tr='Git clean mode parameter ("n" or "f") is required',er="Git clean unknown option found in: ",Jt=(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))(Jt||{}),rr=new Set(["i",...Bn(Object.values(Jt))])}});function Zo(t){let e=new us;for(let r of as(t))e.addValue(r.file,String(r.key),r.value);return e}n(Zo,"configListParser");function ta(t,e){let r=null,s=[],i=new Map;for(let o of as(t,e))o.key===e&&(s.push(r=o.value),i.has(o.file)||i.set(o.file,[]),i.get(o.file).push(r));return{key:e,paths:Array.from(i.keys()),scopes:i,value:r,values:s}}n(ta,"configGetParser");function ea(t){return t.replace(/^(file):/,"")}n(ea,"configFilePath");function*as(t,e=null){let r=t.split("\0");for(let s=0,i=r.length-1;s<i;){let o=ea(r[s++]),a=r[s++],u=e;if(a.includes(`
49
+ `)){let c=$n(a,`
50
+ `);u=c[0],a=c[1]}yield{file:o,key:u,value:a}}}n(as,"configParser");var us,ra=f({"src/lib/responses/ConfigList.ts"(){"use strict";b(),us=class{static{n(this,"ConfigList")}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=at(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let s=this.addFile(t);s.hasOwnProperty(e)?Array.isArray(s[e])?s[e].push(r):s[e]=[s[e],r]:s[e]=r,this._all=void 0}}}});function Ce(t,e){return typeof t=="string"&&Me.hasOwnProperty(t)?t:e}n(Ce,"asConfigScope");function na(t,e,r,s){let i=["config",`--${s}`];return r&&i.push("--add"),i.push(t,e),{commands:i,format:"utf-8",parser(o){return o}}}n(na,"addConfigTask");function sa(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(s){return ta(s,t)}}}n(sa,"getConfigTask");function ia(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return Zo(r)}}}n(ia,"listConfigTask");function oa(){return{addConfig(t,e,...r){return this._runTask(na(t,e,r[0]===!0,Ce(r[1],"local")),E(arguments))},getConfig(t,e){return this._runTask(sa(t,Ce(e,void 0)),E(arguments))},listConfig(...t){return this._runTask(ia(Ce(t[0],void 0)),E(arguments))}}}n(oa,"config_default");var Me,cs=f({"src/lib/tasks/config.ts"(){"use strict";ra(),b(),Me=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Me||{})}});function aa(t){return ls.has(t)}n(aa,"isDiffNameStatus");var xe,ls,ps=f({"src/lib/tasks/diff-name-status.ts"(){"use strict";xe=(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))(xe||{}),ls=new Set(Object.values(xe))}});function ua(...t){return new ms().param(...t)}n(ua,"grepQueryBuilder");function ca(t){let e=new Set,r={};return ze(t,s=>{let[i,o,a]=s.split(ht);e.add(i),(r[i]=r[i]||[]).push({line:S(o),path:i,preview:a})}),{paths:e,results:r}}n(ca,"parseGrep");function la(){return{grep(t){let e=E(arguments),r=L(arguments);for(let i of fs)if(r.includes(i))return this._runTask(M(`git.grep: use of "${i}" is not supported.`),e);typeof t=="string"&&(t=ua().param(t));let s=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:s,format:"utf-8",parser(i){return ca(i)}},e)}}}n(la,"grep_default");var fs,Tt,Kr,ms,ds=f({"src/lib/tasks/grep.ts"(){"use strict";b(),O(),fs=["-h"],Tt=Symbol("grepQuery"),ms=class{static{n(this,"GrepQuery")}constructor(){this[Kr]=[]}*[(Kr=Tt,Symbol.iterator)](){for(let t of this[Tt])yield t}and(...t){return t.length&&this[Tt].push("--and","(",...xt(t,"-e"),")"),this}param(...t){return this[Tt].push(...xt(t,"-e")),this}}}}),hs={};P(hs,{ResetMode:n(()=>zt,"ResetMode"),getResetMode:n(()=>fa,"getResetMode"),resetTask:n(()=>pa,"resetTask")});function pa(t,e){let r=["reset"];return gs(t)&&r.push(`--${t}`),r.push(...e),j(r)}n(pa,"resetTask");function fa(t){if(gs(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}n(fa,"getResetMode");function gs(t){return ys.includes(t)}n(gs,"isValidResetMode");var zt,ys,vs=f({"src/lib/tasks/reset.ts"(){"use strict";O(),zt=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(zt||{}),ys=Array.from(Object.values(zt))}});function ma(){return(0,Yt.default)("simple-git")}n(ma,"createLog");function Xr(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(s,...i)=>{t(s,...i),r(s,...i)}:t:(s,...i)=>{t(`%s ${s}`,e,...i),r&&r(s,...i)}}n(Xr,"prefixedLogger");function da(t,e,{namespace:r}){if(typeof t=="string")return t;let s=e&&e.namespace||"";return s.startsWith(r)?s.substr(r.length+1):s||r}n(da,"childLoggerName");function nr(t,e,r,s=ma()){let i=t&&`[${t}]`||"",o=[],a=typeof e=="string"?s.extend(e):e,u=da(H(e,A),a,s);return d(r);function c(p,m){return w(o,nr(t,u.replace(/^[^:]+/,p),m,s))}function d(p){let m=p&&`[${p}]`||"",h=a&&Xr(a,m)||ut,g=Xr(s,`${i} ${m}`,h);return Object.assign(a?h:g,{label:t,sibling:c,info:g,step:d})}}n(nr,"createLogger");var bs=f({"src/lib/git-logger.ts"(){"use strict";b(),Yt.default.formatters.L=t=>String(He(t)?t.length:"-"),Yt.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Ft(t)}}),Ut,Be,ha=f({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";rt(),bs(),Ut=class{static{n(this,"_TasksPendingQueue")}constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let e=Ut.getName(t.commands[0]),r=nr(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 tt(void 0,"TasksPendingQueue: attempt called for an unknown task");return e.logger("Starting task"),e}static getName(t="empty"){return`task:${t}:${++Ut.counter}`}},Be=Ut,Be.counter=0}});function ot(t,e){return{method:jn(t.commands)||"",commands:e}}n(ot,"pluginContext");function ya(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}n(ya,"onErrorReceived");function Zr(t,e,r,s){return i=>{r("%s received %L bytes",e,i),s("%B",i),t.push(i)}}n(Zr,"onDataReceived");var Ie,va=f({"src/lib/runners/git-executor-chain.ts"(){"use strict";rt(),O(),b(),ha(),Ie=class{static{n(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Be}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 St(this,null,function*(){let e=yield this._scheduler.next(),r=n(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:s}=this._queue.attempt(t);return yield ns(t)?this.attemptEmptyTask(t,s):this.attemptRemoteTask(t,s)}catch(s){throw this.onFatalException(t,s)}finally{r(),e()}})}onFatalException(t,e){let r=e instanceof tt?Object.assign(e,{task:t}):new tt(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(t,e){return St(this,null,function*(){let r=this._plugins.exec("spawn.binary","",ot(t,t.commands)),s=this._plugins.exec("spawn.args",[...t.commands],ot(t,t.commands)),i=yield this.gitResponse(t,r,s,this.outputHandler,e.step("SPAWN")),o=yield this.handleTaskData(t,s,i,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),rs(t)?je(t.parser,o):je(t.parser,o.asStrings())})}attemptEmptyTask(t,e){return St(this,null,function*(){return e("empty task bypassing child process to call to task's parser"),t.parser(this)})}handleTaskData(t,e,r,s){let{exitCode:i,rejection:o,stdOut:a,stdErr:u}=r;return new Promise((c,d)=>{s("Preparing to handle process response exitCode=%d stdOut=",i);let{error:p}=this._plugins.exec("task.error",{error:o},z(z({},ot(t,e)),r));if(p&&t.onError)return s.info("exitCode=%s handling with custom error handler"),t.onError(r,p,m=>{s.info("custom error handler treated as success"),s("custom error returned a %s",Ft(m)),c(new Ot(Array.isArray(m)?Buffer.concat(m):m,Buffer.concat(u)))},d);if(p)return s.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,u.length,o),d(p);s.info("retrieving task output complete"),c(new Ot(Buffer.concat(a),Buffer.concat(u)))})}gitResponse(t,e,r,s,i){return St(this,null,function*(){let o=i.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},ot(t,t.commands));return new Promise(u=>{let c=[],d=[];i.info("%s %o",e,r),i("%O",a);let p=this._beforeSpawn(t,r);if(p)return u({stdOut:c,stdErr:d,exitCode:9901,rejection:p});this._plugins.exec("spawn.before",void 0,Ct(z({},ot(t,r)),{kill(h){p=h||p}}));let m=ga(e,r,a);m.stdout.on("data",Zr(c,"stdOut",i,o.step("stdOut"))),m.stderr.on("data",Zr(d,"stdErr",i,o.step("stdErr"))),m.on("error",ya(d,i)),s&&(i("Passing child process stdOut/stdErr to custom outputHandler"),s(e,m.stdout,m.stderr,[...r])),this._plugins.exec("spawn.after",void 0,Ct(z({},ot(t,r)),{spawned:m,close(h,g){u({stdOut:c,stdErr:d,exitCode:h,rejection:p||g})},kill(h){m.killed||(p=h,m.kill("SIGINT"))}}))})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,Ct(z({},ot(t,e)),{kill(s){r=s||r}})),r}}}}),_s={};P(_s,{GitExecutor:n(()=>ws,"GitExecutor")});var ws,ba=f({"src/lib/runners/git-executor.ts"(){"use strict";va(),ws=class{static{n(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new Ie(this,this._scheduler,this._plugins)}chain(){return new Ie(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function _a(t,e,r=ut){let s=n(o=>{r(null,o)},"onSuccess"),i=n(o=>{o?.task===t&&r(o instanceof Rt?wa(o):o,void 0)},"onError2");e.then(s,i)}n(_a,"taskCallback");function wa(t){let e=n(s=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${s} should be GitResponseError.git.${s}, this will no longer be available in version 3`),e=ut},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(s,i){return i in t||(s[i]={enumerable:!1,configurable:!1,get(){return e(i),t.git[i]}}),s}}n(wa,"addDeprecationNoticeToError");var ka=f({"src/lib/task-callback.ts"(){"use strict";gt(),b()}});function tn(t,e){return ts(r=>{if(!Ve(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}n(tn,"changeWorkingDirectoryTask");var Ta=f({"src/lib/tasks/change-working-directory.ts"(){"use strict";b(),O()}});function Ee(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=ee(e,"-B")),j(e)}n(Ee,"checkoutTask");function Sa(){return{checkout(){return this._runTask(Ee(L(arguments,1)),E(arguments))},checkoutBranch(t,e){return this._runTask(Ee(["-b",t,e,...L(arguments)]),E(arguments))},checkoutLocalBranch(t){return this._runTask(Ee(["-b",t,...L(arguments)]),E(arguments))}}}n(Sa,"checkout_default");var Ca=f({"src/lib/tasks/checkout.ts"(){"use strict";b(),O()}});function xa(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}n(xa,"countObjectsResponse");function Ea(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return B(xa(),[ks],t)}})}}}n(Ea,"count_objects_default");var ks,Oa=f({"src/lib/tasks/count-objects.ts"(){"use strict";b(),ks=new _(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let s=Mn(e);t.hasOwnProperty(s)&&(t[s]=S(r))})}});function Pa(t){return B({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Ts,t)}n(Pa,"parseCommitResult");var Ts,Ra=f({"src/lib/parsers/parse-commit.ts"(){"use strict";b(),Ts=[new _(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,s])=>{t.branch=e,t.commit=s,t.root=!!r}),new _(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),s=r.pop();!s||!s.includes("@")||(t.author={email:s.substr(0,s.length-1),name:r.join("<").trim()})}),new _(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,s])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(s,10)||0}),new _(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,s])=>{t.summary.changes=parseInt(e,10)||0;let i=parseInt(r,10)||0;s==="-"?t.summary.deletions=i:s==="+"&&(t.summary.insertions=i)})]}});function Aa(t,e,r){return{commands:["-c","core.abbrev=40","commit",...xt(t,"-m"),...e,...r],format:"utf-8",parser:Pa}}n(Aa,"commitTask");function Fa(){return{commit(e,...r){let s=E(arguments),i=t(e)||Aa(W(e),W(H(r[0],Ht,[])),[...H(r[1],$t,[]),...L(arguments,0,!0)]);return this._runTask(i,s)}};function t(e){return!Ht(e)&&M("git.commit: requires the commit message to be supplied as a string/string[]")}}n(Fa,"commit_default");var $a=f({"src/lib/tasks/commit.ts"(){"use strict";Ra(),b(),O()}});function ja(){return{firstCommit(){return this._runTask(j(["rev-list","--max-parents=0","HEAD"],!0),E(arguments))}}}n(ja,"first_commit_default");var Da=f({"src/lib/tasks/first-commit.ts"(){"use strict";b(),O()}});function La(t,e){let r=["hash-object",t];return e&&r.push("-w"),j(r,!0)}n(La,"hashObjectTask");var Ma=f({"src/lib/tasks/hash-object.ts"(){"use strict";O()}});function Ba(t,e,r){let s=String(r).trim(),i;if(i=Ss.exec(s))return new Vt(t,e,!1,i[1]);if(i=Cs.exec(s))return new Vt(t,e,!0,i[1]);let o="",a=s.split(" ");for(;a.length;)if(a.shift()==="in"){o=a.join(" ");break}return new Vt(t,e,/^re/i.test(s),o)}n(Ba,"parseInit");var Vt,Ss,Cs,Ia=f({"src/lib/responses/InitSummary.ts"(){"use strict";Vt=class{static{n(this,"InitSummary")}constructor(t,e,r,s){this.bare=t,this.path=e,this.existing=r,this.gitDir=s}},Ss=/^Init.+ repository in (.+)$/,Cs=/^Rein.+ in (.+)$/}});function Na(t){return t.includes(sr)}n(Na,"hasBareCommand");function Ga(t=!1,e,r){let s=["init",...r];return t&&!Na(s)&&s.splice(1,0,sr),{commands:s,format:"utf-8",parser(i){return Ba(s.includes("--bare"),e,i)}}}n(Ga,"initTask");var sr,Ua=f({"src/lib/tasks/init.ts"(){"use strict";Ia(),sr="--bare"}});function ir(t){for(let e=0;e<t.length;e++){let r=or.exec(t[e]);if(r)return`--${r[1]}`}return""}n(ir,"logFormatFromCommand");function qa(t){return or.test(t)}n(qa,"isLogFormat");var or,jt=f({"src/lib/args/log-format.ts"(){"use strict";or=/^--(stat|numstat|name-only|name-status)(=|$)/}}),xs,Ja=f({"src/lib/responses/DiffSummary.ts"(){"use strict";xs=class{static{n(this,"DiffSummary")}constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Es(t=""){let e=Os[t];return r=>B(new xs,e,r,!1)}n(Es,"getDiffParser");var Oe,en,rn,nn,Os,Ps=f({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";jt(),Ja(),ps(),b(),Oe=[new _(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,s=""])=>{t.files.push({file:e.trim(),changes:S(r),insertions:s.replace(/[^+]/g,"").length,deletions:s.replace(/[^-]/g,"").length,binary:!1})}),new _(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,s])=>{t.files.push({file:e.trim(),before:S(r),after:S(s),binary:!0})}),new _(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let s=/(\d+) i/.exec(r),i=/(\d+) d/.exec(r);t.changed=S(e),t.insertions=S(s?.[1]),t.deletions=S(i?.[1])})],en=[new _(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,s])=>{let i=S(e),o=S(r);t.changed++,t.insertions+=i,t.deletions+=o,t.files.push({file:s,changes:i+o,insertions:i,deletions:o,binary:!1})}),new _(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],rn=[new _(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],nn=[new _(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,s,i,o])=>{t.changed++,t.files.push({file:o??s,changes:0,insertions:0,deletions:0,binary:!1,status:Fe(aa(e)&&e),from:Fe(!!o&&s!==o&&s),similarity:S(r)})})],Os={"":Oe,"--stat":Oe,"--numstat":en,"--name-status":nn,"--name-only":rn}}});function za(t,e){return e.reduce((r,s,i)=>(r[s]=t[i]||"",r),Object.create({diff:null}))}n(za,"lineBuilder");function Rs(t=cr,e=As,r=""){let s=Es(r);return function(i){let o=At(i.trim(),!1,ar).map(function(a){let u=a.split(ur),c=za(u[0].split(t),e);return u.length>1&&u[1].trim()&&(c.diff=s(u[1])),c});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}n(Rs,"createListLogSummaryParser");var ar,ur,cr,As,Fs=f({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";b(),Ps(),jt(),ar="\xF2\xF2\xF2\xF2\xF2\xF2 ",ur=" \xF2\xF2",cr=" \xF2 ",As=["hash","date","message","refs","author_name","author_email"]}}),$s={};P($s,{diffSummaryTask:n(()=>Va,"diffSummaryTask"),validateLogFormatConfig:n(()=>ie,"validateLogFormatConfig")});function Va(t){let e=ir(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),ie(r)||{commands:r,format:"utf-8",parser:Es(e)}}n(Va,"diffSummaryTask");function ie(t){let e=t.filter(qa);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'`)}n(ie,"validateLogFormatConfig");var lr=f({"src/lib/tasks/diff.ts"(){"use strict";jt(),Ps(),O()}});function Qa(t,e){let r=[],s=[];return Object.keys(t).forEach(i=>{r.push(i),s.push(String(t[i]))}),[r,s.join(e)]}n(Qa,"prettyFormat");function Wa(t){return Object.keys(t).reduce((e,r)=>(r in Ne||(e[r]=t[r]),e),{})}n(Wa,"userOptions");function js(t={},e=[]){let r=H(t.splitter,A,cr),s=!Qe(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"},[i,o]=Qa(s,r),a=[],u=[`--pretty=format:${ar}${o}${ur}`,...e],c=t.n||t["max-count"]||t.maxCount;if(c&&u.push(`--max-count=${c}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";a.push(`${t.from||""}${d}${t.to||""}`)}return A(t.file)&&u.push("--follow",Do(t.file)),Ye(Wa(t),u),{fields:i,splitter:r,commands:[...u,...a]}}n(js,"parseLogOptions");function Ha(t,e,r){let s=Rs(t,e,ir(r));return{commands:["log",...r],format:"utf-8",parser:s}}n(Ha,"logTask");function Ya(){return{log(...r){let s=E(arguments),i=js(Ke(arguments),H(arguments[0],$t)),o=e(...r)||ie(i.commands)||t(i);return this._runTask(o,s)}};function t(r){return Ha(r.splitter,r.fields,r.commands)}function e(r,s){return A(r)&&A(s)&&M("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}n(Ya,"log_default");var Ne,Ds=f({"src/lib/tasks/log.ts"(){"use strict";jt(),Pt(),Fs(),b(),O(),lr(),Ne=(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))(Ne||{})}}),Qt,Ls,Ka=f({"src/lib/responses/MergeSummary.ts"(){"use strict";Qt=class{static{n(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Ls=class{static{n(this,"MergeSummaryDetail")}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"}}}}),Ge,Ms,Xa=f({"src/lib/responses/PullSummary.ts"(){"use strict";Ge=class{static{n(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ms=class{static{n(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Pe(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}n(Pe,"objectEnumerationResult");function sn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:S(e&&e[1]||"0"),delta:S(r&&r[1]||"0")}}n(sn,"asObjectCount");var Bs,Za=f({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";b(),Bs=[new et(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let s=e.toLowerCase(),i=Pe(t.remoteMessages);Object.assign(i,{[s]:S(r)})}),new et(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let s=e.toLowerCase(),i=Pe(t.remoteMessages);Object.assign(i,{[s]:S(r)})}),new et(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,s])=>{let i=Pe(t.remoteMessages);i.total=sn(e),i.reused=sn(r),i.packReused=S(s)})]}});function Is(t,e){return B({remoteMessages:new Gs},Ns,e)}n(Is,"parseRemoteMessages");var Ns,Gs,Us=f({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";b(),Za(),Ns=[new et(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...Bs,new et([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new et([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,s])=>{t.remoteMessages.vulnerabilities={count:S(e),summary:r,url:s}})],Gs=class{static{n(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function tu(t,e){let r=B(new Ms,qs,[t,e]);return r.message&&r}n(tu,"parsePullErrorResult");var on,an,un,cn,qs,ln,pr,Js=f({"src/lib/parsers/parse-pull.ts"(){"use strict";Xa(),b(),Us(),on=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,an=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,un=/^(create|delete) mode \d+ (.+)/,cn=[new _(on,(t,[e,r,s])=>{t.files.push(e),r&&(t.insertions[e]=r.length),s&&(t.deletions[e]=s.length)}),new _(an,(t,[e,,r,,s])=>r!==void 0||s!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+s||0,!0):!1),new _(un,(t,[e,r])=>{w(t.files,r),w(e==="create"?t.created:t.deleted,r)})],qs=[new _(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new _(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new _(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,s,i])=>{t.branch.local=s,t.hash.local=e,t.branch.remote=i,t.hash.remote=r})],ln=n((t,e)=>B(new Ge,cn,[t,e]),"parsePullDetail"),pr=n((t,e)=>Object.assign(new Ge,ln(t,e),Is(t,e)),"parsePullResult")}}),pn,zs,fn,eu=f({"src/lib/parsers/parse-merge.ts"(){"use strict";Ka(),b(),Js(),pn=[new _(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new _(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Qt(e,r))}),new _(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,s])=>{t.conflicts.push(new Qt(e,r,{deleteRef:s}))}),new _(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Qt(e,null))}),new _(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],zs=n((t,e)=>Object.assign(fn(t,e),pr(t,e)),"parseMergeResult"),fn=n(t=>B(new Ls,pn,t),"parseMergeDetail")}});function mn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let s=zs(e,r);if(s.failed)throw new Rt(s);return s}}:M("Git.merge requires at least one option")}n(mn,"mergeTask");var ru=f({"src/lib/tasks/merge.ts"(){"use strict";gt(),eu(),O()}});function nu(t,e,r){let s=r.includes("deleted"),i=r.includes("tag")||/^refs\/tags/.test(t),o=!r.includes("new");return{deleted:s,tag:i,branch:!i,new:!o,alreadyUpdated:o,local:t,remote:e}}n(nu,"pushResultPushedItem");var dn,Vs,hn,su=f({"src/lib/parsers/parse-push.ts"(){"use strict";b(),Us(),dn=[new _(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new _(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref=Ct(z({},t.ref||{}),{local:e})}),new _(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,s])=>{t.pushed.push(nu(e,r,s))}),new _(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,s])=>{t.branch=Ct(z({},t.branch||{}),{local:e,remote:r,remoteName:s})}),new _(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,s,i])=>{t.update={head:{local:e,remote:r},hash:{from:s,to:i}}})],Vs=n((t,e)=>{let r=hn(t,e),s=Is(t,e);return z(z({},r),s)},"parsePushResult"),hn=n((t,e)=>B({pushed:[]},dn,[t,e]),"parsePushDetail")}}),Qs={};P(Qs,{pushTagsTask:n(()=>iu,"pushTagsTask"),pushTask:n(()=>fr,"pushTask")});function iu(t={},e){return w(e,"--tags"),fr(t,e)}n(iu,"pushTagsTask");function fr(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),ee(r,"-v"),w(r,"--verbose"),w(r,"--porcelain"),{commands:r,format:"utf-8",parser:Vs}}n(fr,"pushTask");var Ws=f({"src/lib/tasks/push.ts"(){"use strict";su(),b()}});function ou(){return{showBuffer(){let t=["show",...L(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(es(t),E(arguments))},show(){let t=["show",...L(arguments,1)];return this._runTask(j(t),E(arguments))}}}n(ou,"show_default");var au=f({"src/lib/tasks/show.ts"(){"use strict";b(),O()}}),gn,Hs,uu=f({"src/lib/responses/FileStatusSummary.ts"(){"use strict";gn=/^(.+)\0(.+)$/,Hs=class{static{n(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let s=gn.exec(t)||[null,t,t];this.from=s[2]||"",this.path=s[1]||""}}}}});function yn(t){let[e,r]=t.split(ht);return{from:r||e,to:e}}n(yn,"renamedFile");function U(t,e,r){return[`${t}${e}`,r]}n(U,"parser3");function Re(t,...e){return e.map(r=>U(t,r,(s,i)=>w(s.conflicted,i)))}n(Re,"conflicts");function cu(t,e){let r=e.trim();switch(" "){case r.charAt(2):return s(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return s(" ",r.charAt(0),r.substr(2));default:return}function s(i,o,a){let u=`${i}${o}`,c=Ys.get(u);c&&c(t,a),u!=="##"&&u!=="!!"&&t.files.push(new Hs(a,i,o))}n(s,"data")}n(cu,"splitLine");var vn,Ys,Ks,lu=f({"src/lib/responses/StatusSummary.ts"(){"use strict";b(),uu(),vn=class{static{n(this,"StatusSummary")}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}},Ys=new Map([U(" ","A",(t,e)=>w(t.created,e)),U(" ","D",(t,e)=>w(t.deleted,e)),U(" ","M",(t,e)=>w(t.modified,e)),U("A"," ",(t,e)=>w(t.created,e)&&w(t.staged,e)),U("A","M",(t,e)=>w(t.created,e)&&w(t.staged,e)&&w(t.modified,e)),U("D"," ",(t,e)=>w(t.deleted,e)&&w(t.staged,e)),U("M"," ",(t,e)=>w(t.modified,e)&&w(t.staged,e)),U("M","M",(t,e)=>w(t.modified,e)&&w(t.staged,e)),U("R"," ",(t,e)=>{w(t.renamed,yn(e))}),U("R","M",(t,e)=>{let r=yn(e);w(t.renamed,r),w(t.modified,r.to)}),U("!","!",(t,e)=>{w(t.ignored=t.ignored||[],e)}),U("?","?",(t,e)=>w(t.not_added,e)),...Re("A","A","U"),...Re("D","D","U"),...Re("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,s=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,a=/\son\s([\S]+)$/,u;u=r.exec(e),t.ahead=u&&+u[1]||0,u=s.exec(e),t.behind=u&&+u[1]||0,u=i.exec(e),t.current=u&&u[1],u=o.exec(e),t.tracking=u&&u[1],u=a.exec(e),t.current=u&&u[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),Ks=n(function(t){let e=t.split(ht),r=new vn;for(let s=0,i=e.length;s<i;){let o=e[s++].trim();o&&(o.charAt(0)==="R"&&(o+=ht+(e[s++]||"")),cu(r,o))}return r},"parseStatusSummary")}});function pu(t){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...t.filter(r=>!Xs.includes(r))],parser(r){return Ks(r)}}}n(pu,"statusTask");var Xs,fu=f({"src/lib/tasks/status.ts"(){"use strict";lu(),Xs=["--null","-z"]}});function Kt(t=0,e=0,r=0,s="",i=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:s,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}n(Kt,"versionResponse");function mu(){return Kt(0,0,0,"",!1)}n(mu,"notInstalledResponse");function du(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:hu,onError(t,e,r,s){if(t.exitCode===-2)return r(Buffer.from(mr));s(e)}})}}}n(du,"version_default");function hu(t){return t===mr?mu():B(Kt(0,0,0,t),Zs,t)}n(hu,"versionParser");var mr,Zs,gu=f({"src/lib/tasks/version.ts"(){"use strict";b(),mr="installed=false",Zs=[new _(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,s,i=""])=>{Object.assign(t,Kt(S(e),S(r),S(s),i))}),new _(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,s,i=""])=>{Object.assign(t,Kt(S(e),S(r),s,i))})]}}),ti={};P(ti,{SimpleGitApi:n(()=>Ue,"SimpleGitApi")});var Ue,yu=f({"src/lib/simple-git-api.ts"(){"use strict";ka(),Ta(),Ca(),Oa(),$a(),cs(),Da(),ds(),Ma(),Ua(),Ds(),ru(),Ws(),au(),fu(),O(),gu(),b(),Ue=class{static{n(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),s=r.push(t);return e&&_a(t,s,e),Object.create(this,{then:{value:s.then.bind(s)},catch:{value:s.catch.bind(s)},_executor:{value:r}})}add(t){return this._runTask(j(["add",...W(t)]),E(arguments))}cwd(t){let e=E(arguments);return typeof t=="string"?this._runTask(tn(t,this._executor),e):typeof t?.path=="string"?this._runTask(tn(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(La(t,e===!0),E(arguments))}init(t){return this._runTask(Ga(t===!0,this._executor.cwd,L(arguments)),E(arguments))}merge(){return this._runTask(mn(L(arguments)),E(arguments))}mergeFromTo(t,e){return A(t)&&A(e)?this._runTask(mn([t,e,...L(arguments)]),E(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=fr({remote:H(arguments[0],A),branch:H(arguments[1],A)},L(arguments));return this._runTask(t,E(arguments))}stash(){return this._runTask(j(["stash",...L(arguments)]),E(arguments))}status(){return this._runTask(pu(L(arguments)),E(arguments))}},Object.assign(Ue.prototype,Sa(),Fa(),oa(),Ea(),ja(),la(),Ya(),ou(),du())}}),ei={};P(ei,{Scheduler:n(()=>ni,"Scheduler")});var bn,ni,vu=f({"src/lib/runners/scheduler.ts"(){"use strict";b(),bs(),bn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,ri.createDeferred)();return{promise:e,done:r,id:t}}})(),ni=class{static{n(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=nr("","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=w(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),ee(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=w(this.pending,bn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),si={};P(si,{applyPatchTask:n(()=>bu,"applyPatchTask")});function bu(t,e){return j(["apply",...e,...t])}n(bu,"applyPatchTask");var _u=f({"src/lib/tasks/apply-patch.ts"(){"use strict";O()}});function wu(t,e){return{branch:t,hash:e,success:!0}}n(wu,"branchDeletionSuccess");function ku(t){return{branch:t,hash:null,success:!1}}n(ku,"branchDeletionFailure");var ii,Tu=f({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";ii=class{static{n(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function oi(t,e){return e===1&&qe.test(t)}n(oi,"hasBranchDeletionError");var _n,qe,wn,oe,Su=f({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";Tu(),b(),_n=/(\S+)\s+\(\S+\s([^)]+)\)/,qe=/^error[^']+'([^']+)'/m,wn=[new _(_n,(t,[e,r])=>{let s=wu(e,r);t.all.push(s),t.branches[e]=s}),new _(qe,(t,[e])=>{let r=ku(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],oe=n((t,e)=>B(new ii,wn,[t,e]),"parseBranchDeletions")}}),ai,Cu=f({"src/lib/responses/BranchSummary.ts"(){"use strict";ai=class{static{n(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,s,i){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:s,label:i}}}}});function kn(t){return t?t.charAt(0):""}n(kn,"branchStatus");function ui(t){return B(new ai,ci,t)}n(ui,"parseBranchSummary");var ci,xu=f({"src/lib/parsers/parse-branch.ts"(){"use strict";Cu(),b(),ci=[new _(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,s,i])=>{t.push(kn(e),!0,r,s,i)}),new _(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(t,[e,r,s,i])=>{t.push(kn(e),!1,r,s,i)})]}}),li={};P(li,{branchLocalTask:n(()=>Ou,"branchLocalTask"),branchTask:n(()=>Eu,"branchTask"),containsDeleteBranchCommand:n(()=>pi,"containsDeleteBranchCommand"),deleteBranchTask:n(()=>Ru,"deleteBranchTask"),deleteBranchesTask:n(()=>Pu,"deleteBranchesTask")});function pi(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}n(pi,"containsDeleteBranchCommand");function Eu(t){let e=pi(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(s,i){return e?oe(s,i).all[0]:ui(s)}}}n(Eu,"branchTask");function Ou(){return{format:"utf-8",commands:["branch","-v"],parser:ui}}n(Ou,"branchLocalTask");function Pu(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,s){return oe(r,s)},onError({exitCode:r,stdOut:s},i,o,a){if(!oi(String(i),r))return a(i);o(s)}}}n(Pu,"deleteBranchesTask");function Ru(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(s,i){return oe(s,i).branches[t]},onError({exitCode:s,stdErr:i,stdOut:o},a,u,c){if(!oi(String(a),s))return c(a);throw new Rt(r.parser(Et(o),Et(i)),String(a))}};return r}n(Ru,"deleteBranchTask");var Au=f({"src/lib/tasks/branch.ts"(){"use strict";gt(),Su(),xu(),b()}}),fi,Fu=f({"src/lib/responses/CheckIgnore.ts"(){"use strict";fi=n(t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e),"parseCheckIgnore")}}),mi={};P(mi,{checkIgnoreTask:n(()=>$u,"checkIgnoreTask")});function $u(t){return{commands:["check-ignore",...t],format:"utf-8",parser:fi}}n($u,"checkIgnoreTask");var ju=f({"src/lib/tasks/check-ignore.ts"(){"use strict";Fu()}}),di={};P(di,{cloneMirrorTask:n(()=>Lu,"cloneMirrorTask"),cloneTask:n(()=>hi,"cloneTask")});function Du(t){return/^--upload-pack(=|$)/.test(t)}n(Du,"disallowedCommand");function hi(t,e,r){let s=["clone",...r];return A(t)&&s.push(t),A(e)&&s.push(e),s.find(Du)?M("git.fetch: potential exploit argument blocked."):j(s)}n(hi,"cloneTask");function Lu(t,e,r){return w(r,"--mirror"),hi(t,e,r)}n(Lu,"cloneMirrorTask");var Mu=f({"src/lib/tasks/clone.ts"(){"use strict";O(),b()}});function Bu(t,e){return B({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},gi,[t,e])}n(Bu,"parseFetchResult");var gi,Iu=f({"src/lib/parsers/parse-fetch.ts"(){"use strict";b(),gi=[new _(/From (.+)$/,(t,[e])=>{t.remote=e}),new _(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new _(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new _(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new _(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,s,i])=>{t.updated.push({name:s,tracking:i,to:r,from:e})})]}}),yi={};P(yi,{fetchTask:n(()=>Gu,"fetchTask")});function Nu(t){return/^--upload-pack(=|$)/.test(t)}n(Nu,"disallowedCommand2");function Gu(t,e,r){let s=["fetch",...r];return t&&e&&s.push(t,e),s.find(Nu)?M("git.fetch: potential exploit argument blocked."):{commands:s,format:"utf-8",parser:Bu}}n(Gu,"fetchTask");var Uu=f({"src/lib/tasks/fetch.ts"(){"use strict";Iu(),O()}});function qu(t){return B({moves:[]},vi,t)}n(qu,"parseMoveResult");var vi,Ju=f({"src/lib/parsers/parse-move.ts"(){"use strict";b(),vi=[new _(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),bi={};P(bi,{moveTask:n(()=>zu,"moveTask")});function zu(t,e){return{commands:["mv","-v",...W(t),e],format:"utf-8",parser:qu}}n(zu,"moveTask");var Vu=f({"src/lib/tasks/move.ts"(){"use strict";Ju(),b()}}),_i={};P(_i,{pullTask:n(()=>Qu,"pullTask")});function Qu(t,e,r){let s=["pull",...r];return t&&e&&s.splice(1,0,t,e),{commands:s,format:"utf-8",parser(i,o){return pr(i,o)},onError(i,o,a,u){let c=tu(Et(i.stdOut),Et(i.stdErr));if(c)return u(new Rt(c));u(o)}}}n(Qu,"pullTask");var Wu=f({"src/lib/tasks/pull.ts"(){"use strict";gt(),Js(),b()}});function Hu(t){let e={};return wi(t,([r])=>e[r]={name:r}),Object.values(e)}n(Hu,"parseGetRemotes");function Yu(t){let e={};return wi(t,([r,s,i])=>{e.hasOwnProperty(r)||(e[r]={name:r,refs:{fetch:"",push:""}}),i&&s&&(e[r].refs[i.replace(/[^a-z]/g,"")]=s)}),Object.values(e)}n(Yu,"parseGetRemotesVerbose");function wi(t,e){ze(t,r=>e(r.split(/\s+/)))}n(wi,"forEach");var Ku=f({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";b()}}),ki={};P(ki,{addRemoteTask:n(()=>Xu,"addRemoteTask"),getRemotesTask:n(()=>Zu,"getRemotesTask"),listRemotesTask:n(()=>tc,"listRemotesTask"),remoteTask:n(()=>ec,"remoteTask"),removeRemoteTask:n(()=>rc,"removeRemoteTask")});function Xu(t,e,r){return j(["remote","add",...r,t,e])}n(Xu,"addRemoteTask");function Zu(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?Yu:Hu}}n(Zu,"getRemotesTask");function tc(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),j(e)}n(tc,"listRemotesTask");function ec(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),j(e)}n(ec,"remoteTask");function rc(t){return j(["remote","remove",t])}n(rc,"removeRemoteTask");var nc=f({"src/lib/tasks/remote.ts"(){"use strict";Ku(),O()}}),Ti={};P(Ti,{stashListTask:n(()=>sc,"stashListTask")});function sc(t={},e){let r=js(t),s=["stash","list",...r.commands,...e],i=Rs(r.splitter,r.fields,ir(s));return ie(s)||{commands:s,format:"utf-8",parser:i}}n(sc,"stashListTask");var ic=f({"src/lib/tasks/stash-list.ts"(){"use strict";jt(),Fs(),lr(),Ds()}}),Si={};P(Si,{addSubModuleTask:n(()=>oc,"addSubModuleTask"),initSubModuleTask:n(()=>ac,"initSubModuleTask"),subModuleTask:n(()=>ae,"subModuleTask"),updateSubModuleTask:n(()=>uc,"updateSubModuleTask")});function oc(t,e){return ae(["add",t,e])}n(oc,"addSubModuleTask");function ac(t){return ae(["init",...t])}n(ac,"initSubModuleTask");function ae(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),j(e)}n(ae,"subModuleTask");function uc(t){return ae(["update",...t])}n(uc,"updateSubModuleTask");var cc=f({"src/lib/tasks/sub-module.ts"(){"use strict";O()}});function lc(t,e){let r=isNaN(t),s=isNaN(e);return r!==s?r?1:-1:r?Ci(t,e):0}n(lc,"singleSorted");function Ci(t,e){return t===e?0:t>e?1:-1}n(Ci,"sorted");function pc(t){return t.trim()}n(pc,"trimmed");function qt(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}n(qt,"toNumber");var Tn,xi,fc=f({"src/lib/responses/TagList.ts"(){"use strict";Tn=class{static{n(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},xi=n(function(t,e=!1){let r=t.split(`
51
+ `).map(pc).filter(Boolean);e||r.sort(function(i,o){let a=i.split("."),u=o.split(".");if(a.length===1||u.length===1)return lc(qt(a[0]),qt(u[0]));for(let c=0,d=Math.max(a.length,u.length);c<d;c++){let p=Ci(qt(a[c]),qt(u[c]));if(p)return p}return 0});let s=e?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new Tn(r,s)},"parseTagList")}}),Ei={};P(Ei,{addAnnotatedTagTask:n(()=>hc,"addAnnotatedTagTask"),addTagTask:n(()=>dc,"addTagTask"),tagListTask:n(()=>mc,"tagListTask")});function mc(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return xi(r,e)}}}n(mc,"tagListTask");function dc(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}n(dc,"addTagTask");function hc(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}n(hc,"addAnnotatedTagTask");var gc=f({"src/lib/tasks/tag.ts"(){"use strict";fc()}}),yc=$o({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(ba(),x(_s)),{SimpleGitApi:s}=(yu(),x(ti)),{Scheduler:i}=(vu(),x(ei)),{configurationErrorTask:o}=(O(),x(Le)),{asArray:a,filterArray:u,filterPrimitives:c,filterString:d,filterStringOrStringArray:p,filterType:m,getTrailingOptions:h,trailingFunctionArgument:g,trailingOptionsArgument:I}=(b(),x(zn)),{applyPatchTask:q}=(_u(),x(si)),{branchTask:D,branchLocalTask:Y,deleteBranchesTask:ct,deleteBranchTask:le}=(Au(),x(li)),{checkIgnoreTask:lt}=(ju(),x(mi)),{checkIsRepoTask:yr}=(Hn(),x(Vn)),{cloneTask:yt,cloneMirrorTask:pe}=(Mu(),x(di)),{cleanWithOptionsTask:Lt,isCleanOptionsArray:fe}=(os(),x(ss)),{diffSummaryTask:$i}=(lr(),x($s)),{fetchTask:ji}=(Uu(),x(yi)),{moveTask:Di}=(Vu(),x(bi)),{pullTask:Li}=(Wu(),x(_i)),{pushTagsTask:Mi}=(Ws(),x(Qs)),{addRemoteTask:Bi,getRemotesTask:Ii,listRemotesTask:Ni,remoteTask:Gi,removeRemoteTask:Ui}=(nc(),x(ki)),{getResetMode:qi,resetTask:Ji}=(vs(),x(hs)),{stashListTask:zi}=(ic(),x(Ti)),{addSubModuleTask:Vi,initSubModuleTask:Qi,subModuleTask:Wi,updateSubModuleTask:Hi}=(cc(),x(Si)),{addAnnotatedTagTask:Yi,addTagTask:Ki,tagListTask:Xi}=(gc(),x(Ei)),{straightThroughBufferTask:Zi,straightThroughStringTask:Q}=(O(),x(Le));function v(l,y){this._plugins=y,this._executor=new r(l.baseDir,new i(l.maxConcurrentProcesses),y),this._trimmed=l.trimmed}n(v,"Git2"),(v.prototype=Object.create(s.prototype)).constructor=v,v.prototype.customBinary=function(l){return this._plugins.reconfigure("binary",l),this},v.prototype.env=function(l,y){return arguments.length===1&&typeof l=="object"?this._executor.env=l:(this._executor.env=this._executor.env||{})[l]=y,this},v.prototype.stashList=function(l){return this._runTask(zi(I(arguments)||{},u(l)&&l||[]),g(arguments))};function vr(l,y,k,F){return typeof k!="string"?o(`git.${l}() requires a string 'repoPath'`):y(k,m(F,d),h(arguments))}n(vr,"createCloneTask"),v.prototype.clone=function(){return this._runTask(vr("clone",yt,...arguments),g(arguments))},v.prototype.mirror=function(){return this._runTask(vr("mirror",pe,...arguments),g(arguments))},v.prototype.mv=function(l,y){return this._runTask(Di(l,y),g(arguments))},v.prototype.checkoutLatestTag=function(l){var y=this;return this.pull(function(){y.tags(function(k,F){y.checkout(F.latest,l)})})},v.prototype.pull=function(l,y,k,F){return this._runTask(Li(m(l,d),m(y,d),h(arguments)),g(arguments))},v.prototype.fetch=function(l,y){return this._runTask(ji(m(l,d),m(y,d),h(arguments)),g(arguments))},v.prototype.silent=function(l){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},v.prototype.tags=function(l,y){return this._runTask(Xi(h(arguments)),g(arguments))},v.prototype.rebase=function(){return this._runTask(Q(["rebase",...h(arguments)]),g(arguments))},v.prototype.reset=function(l){return this._runTask(Ji(qi(l),h(arguments)),g(arguments))},v.prototype.revert=function(l){let y=g(arguments);return typeof l!="string"?this._runTask(o("Commit must be a string"),y):this._runTask(Q(["revert",...h(arguments,0,!0),l]),y)},v.prototype.addTag=function(l){let y=typeof l=="string"?Ki(l):o("Git.addTag requires a tag name");return this._runTask(y,g(arguments))},v.prototype.addAnnotatedTag=function(l,y){return this._runTask(Yi(l,y),g(arguments))},v.prototype.deleteLocalBranch=function(l,y,k){return this._runTask(le(l,typeof y=="boolean"?y:!1),g(arguments))},v.prototype.deleteLocalBranches=function(l,y,k){return this._runTask(ct(l,typeof y=="boolean"?y:!1),g(arguments))},v.prototype.branch=function(l,y){return this._runTask(D(h(arguments)),g(arguments))},v.prototype.branchLocal=function(l){return this._runTask(Y(),g(arguments))},v.prototype.raw=function(l){let y=!Array.isArray(l),k=[].slice.call(y?arguments:l,0);for(let V=0;V<k.length&&y;V++)if(!c(k[V])){k.splice(V,k.length-V);break}k.push(...h(arguments,0,!0));var F=g(arguments);return k.length?this._runTask(Q(k,this._trimmed),F):this._runTask(o("Raw: must supply one or more command to execute"),F)},v.prototype.submoduleAdd=function(l,y,k){return this._runTask(Vi(l,y),g(arguments))},v.prototype.submoduleUpdate=function(l,y){return this._runTask(Hi(h(arguments,!0)),g(arguments))},v.prototype.submoduleInit=function(l,y){return this._runTask(Qi(h(arguments,!0)),g(arguments))},v.prototype.subModule=function(l,y){return this._runTask(Wi(h(arguments)),g(arguments))},v.prototype.listRemote=function(){return this._runTask(Ni(h(arguments)),g(arguments))},v.prototype.addRemote=function(l,y,k){return this._runTask(Bi(l,y,h(arguments)),g(arguments))},v.prototype.removeRemote=function(l,y){return this._runTask(Ui(l),g(arguments))},v.prototype.getRemotes=function(l,y){return this._runTask(Ii(l===!0),g(arguments))},v.prototype.remote=function(l,y){return this._runTask(Gi(h(arguments)),g(arguments))},v.prototype.tag=function(l,y){let k=h(arguments);return k[0]!=="tag"&&k.unshift("tag"),this._runTask(Q(k),g(arguments))},v.prototype.updateServerInfo=function(l){return this._runTask(Q(["update-server-info"]),g(arguments))},v.prototype.pushTags=function(l,y){let k=Mi({remote:m(l,d)},h(arguments));return this._runTask(k,g(arguments))},v.prototype.rm=function(l){return this._runTask(Q(["rm","-f",...a(l)]),g(arguments))},v.prototype.rmKeepLocal=function(l){return this._runTask(Q(["rm","--cached",...a(l)]),g(arguments))},v.prototype.catFile=function(l,y){return this._catFile("utf-8",arguments)},v.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},v.prototype._catFile=function(l,y){var k=g(y),F=["cat-file"],V=y[0];if(typeof V=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),k);Array.isArray(V)&&F.push.apply(F,V);let me=l==="buffer"?Zi(F):Q(F);return this._runTask(me,k)},v.prototype.diff=function(l,y){let k=d(l)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Q(["diff",...h(arguments)]);return this._runTask(k,g(arguments))},v.prototype.diffSummary=function(){return this._runTask($i(h(arguments,1)),g(arguments))},v.prototype.applyPatch=function(l){let y=p(l)?q(a(l),h([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,g(arguments))},v.prototype.revparse=function(){let l=["rev-parse",...h(arguments,!0)];return this._runTask(Q(l,!0),g(arguments))},v.prototype.clean=function(l,y,k){let F=fe(l),V=F&&l.join("")||m(l,d)||"",me=h([].slice.call(arguments,F?1:0));return this._runTask(Lt(V,me),g(arguments))},v.prototype.exec=function(l){let y={commands:[],format:"utf-8",parser(){typeof l=="function"&&l()}};return this._runTask(y)},v.prototype.clearQueue=function(){return this},v.prototype.checkIgnore=function(l,y){return this._runTask(lt(a(m(l,p,[]))),g(arguments))},v.prototype.checkIsRepo=function(l,y){return this._runTask(yr(m(l,d)),g(arguments))},e.exports=v}});Pt();rt();var vc=class extends tt{static{n(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};rt();rt();var Z=class extends tt{static{n(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};gt();Rn();Hn();os();cs();ps();ds();vs();function bc(t){return t?[{type:"spawn.before",action(s,i){t.aborted&&i.kill(new Z(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(s,i){function o(){i.kill(new Z(void 0,"abort","Abort signal received"))}n(o,"kill"),t.addEventListener("abort",o),i.spawned.on("close",()=>t.removeEventListener("abort",o))}}]:void 0}n(bc,"abortPlugin");function _c(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}n(_c,"isConfigSwitch");function wc(t,e){if(_c(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new Z(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}n(wc,"preventProtocolOverride");function kc(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new Z(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 Z(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 Z(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}n(kc,"preventUploadPack");function Tc({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(r,s){return r.forEach((i,o)=>{let a=o<r.length?r[o+1]:"";t||wc(i,a),e||kc(i,s.method)}),r}}}n(Tc,"blockUnsafeOperationsPlugin");b();function Sc(t){let e=xt(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}n(Sc,"commandConfigPrefixingPlugin");b();var Sn=(0,dt.deferred)().promise;function Cc({onClose:t=!0,onExit:e=50}={}){function r(){let i=-1,o={close:(0,dt.deferred)(),closeTimeout:(0,dt.deferred)(),exit:(0,dt.deferred)(),exitTimeout:(0,dt.deferred)()},a=Promise.race([t===!1?Sn:o.closeTimeout.promise,e===!1?Sn:o.exitTimeout.promise]);return s(t,o.close,o.closeTimeout),s(e,o.exit,o.exitTimeout),{close(u){i=u,o.close.done()},exit(u){i=u,o.exit.done()},get exitCode(){return i},result:a}}n(r,"createEvents");function s(i,o,a){i!==!1&&(i===!0?o.promise:o.promise.then(()=>Ae(i))).then(a.done)}return n(s,"configureTimeout"),{type:"spawn.after",action(i,o){return St(this,arguments,function*(a,{spawned:u,close:c}){var d,p;let m=r(),h=!0,g=n(()=>void(h=!1),"quickClose");(d=u.stdout)==null||d.on("data",g),(p=u.stderr)==null||p.on("data",g),u.on("error",g),u.on("close",I=>m.close(I)),u.on("exit",I=>m.exit(I));try{yield m.result,h&&(yield Ae(50)),c(m.exitCode)}catch(I){c(m.exitCode,I)}})}}}n(Cc,"completionDetectionPlugin");b();var xc="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Cn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Ec(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}n(Ec,"isBadArgument");function xn(t,e){if(t.length<1||t.length>2)throw new Z(void 0,"binary",xc);if(t.some(Ec))if(e)console.warn(Cn);else throw new Z(void 0,"binary",Cn);let[s,i]=t;return{binary:s,prefix:i}}n(xn,"toBinaryConfig");function Oc(t,e=["git"],r=!1){let s=xn(W(e),r);t.on("binary",i=>{s=xn(W(i),r)}),t.append("spawn.binary",()=>s.binary),t.append("spawn.args",i=>s.prefix?[s.prefix,...i]:i)}n(Oc,"customBinaryPlugin");rt();function Pc(t){return!!(t.exitCode&&t.stdErr.length)}n(Pc,"isTaskError");function Rc(t){return Buffer.concat([...t.stdOut,...t.stdErr])}n(Rc,"getErrorMessage");function Ac(t=!1,e=Pc,r=Rc){return(s,i)=>!t&&s||!e(i)?s:r(i)}n(Ac,"errorDetectionHandler");function En(t){return{type:"task.error",action(e,r){let s=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(s)?{error:new tt(void 0,s.toString("utf-8"))}:{error:s}}}}n(En,"errorDetectionPlugin");b();var $c=class{static{n(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new Fc}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=w(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return W(t).forEach(r=>r&&this.plugins.add(w(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let s=e,i=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===t&&(s=o.action(s,i));return s}};b();function jc(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,a){return r.includes(a.method)?Ln(o,e):o}},{type:"spawn.after",action(o,a){var u;a.commands.includes(e)&&((u=a.spawned.stderr)==null||u.on("data",c=>{let d=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));d&&t({method:a.method,stage:Dc(d[1]),progress:S(d[2]),processed:S(d[3]),total:S(d[4])})}))}}]}n(jc,"progressMonitorPlugin");function Dc(t){return String(t.toLowerCase().split(" ",1))||"unknown"}n(Dc,"progressEventStage");b();function Lc(t){let e=In(t,["uid","gid"]);return{type:"spawn.options",action(r){return z(z({},e),r)}}}n(Lc,"spawnOptionsPlugin");function Mc({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(s,i){var o,a;let u;function c(){u&&clearTimeout(u),u=setTimeout(p,t)}n(c,"wait");function d(){var m,h;(m=i.spawned.stdout)==null||m.off("data",c),(h=i.spawned.stderr)==null||h.off("data",c),i.spawned.off("exit",d),i.spawned.off("close",d),u&&clearTimeout(u)}n(d,"stop");function p(){d(),i.kill(new Z(void 0,"timeout","block timeout reached"))}n(p,"kill"),r&&((o=i.spawned.stdout)==null||o.on("data",c)),e&&((a=i.spawned.stderr)==null||a.on("data",c)),i.spawned.on("exit",d),i.spawned.on("close",d),c()}}}n(Mc,"timeoutPlugin");Pt();function Bc(){return{type:"spawn.args",action(t){let e=[],r;function s(i){(r=r||[]).push(...i)}n(s,"append2");for(let i=0;i<t.length;i++){let o=t[i];if(Wt(o)){s(Yr(o));continue}if(o==="--"){s(t.slice(i+1).flatMap(a=>Wt(a)&&Yr(a)||a));break}e.push(o)}return r?[...e,"--",...r.map(String)]:e}}}n(Bc,"suffixPathsPlugin");b();var Ic=yc();function Nc(t,e){var r;let s=new $c,i=qn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!Ve(i.baseDir))throw new vc(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&s.add(Sc(i.config)),s.add(Tc(i.unsafe)),s.add(Bc()),s.add(Cc(i.completion)),i.abort&&s.add(bc(i.abort)),i.progress&&s.add(jc(i.progress)),i.timeout&&s.add(Mc(i.timeout)),i.spawnOptions&&s.add(Lc(i.spawnOptions)),s.add(En(Ac(!0))),i.errors&&s.add(En(i.errors)),Oc(s,i.binary,(r=i.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new Ic(i,s)}n(Nc,"gitInstanceFactory");gt();var Oi=Nc;T();var Pi=n((t,e)=>{let r=/^(https:\/\/)?(?<slug>[\w-]+?)(--development)?(\..*)?$/.exec(t)?.groups?.slug;if(r)return r;throw new K(C`
52
+ ${e} must be the application's {bold slug} or {bold URL}
53
+
54
+ {bold EXAMPLES:}
55
+ ${e} my-app
56
+ ${e} my-app.gadget.app
57
+ ${e} https://my-app.gadget.app
58
+ ${e} https://my-app.gadget.app/edit
59
+ ${e} https://my-app--development.gadget.app/edit
60
+ `)},"AppArg");T();import dr from"node:assert";var ue=class{static{n(this,"Edit")}ctx;#t;constructor(e,r){this.ctx=e.child({name:"edit"}),this.#t=new jr(this.ctx,r,"/edit/api/graphql")}async query({query:e,variables:r,...s}){let i=/query (\w+)/.exec(e)?.[1];dr(i,"query name not found");let o=this.ctx.child({name:"edit",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:vt(r)}}});o.log.info("executing graphql query");let a=await this.#t.execute(o,{operation:e,variables:r,...s,http:{retry:{methods:["POST"]},...s.http}});if(a.errors)throw new X(e,a.errors);if(!a.data)throw new X(e,"Query response did not contain data");return a.data}async mutate({mutation:e,variables:r,...s}){let i=/mutation (\w+)/.exec(e)?.[1];dr(i,"mutation name not found");let o=this.ctx.child({name:"edit",fields:{edit:{mutation:i}},devFields:{edit:{mutation:i,variables:vt(r)}}});o.log.info("executing graphql mutation");let a=await this.#t.execute(o,{operation:e,variables:r,...s});if(a.errors)throw wr(a.errors)&&a.errors[0]&&a.errors[0]==="Unauthenticated. No authenticated client."?new Fr(e):new X(e,a.errors);if(!a.data)throw new X(e,"Mutation response did not contain data");return a.data}subscribe({onData:e,...r}){let s=/subscription (\w+)/.exec(r.subscription)?.[1];dr(s,"subscription name not found");let i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:vt(r.variables)}}}),o=n(async u=>{if(u.errors){a(),await r.onError(new X(r.subscription,u.errors));return}if(!u.data){a(),await r.onError(new X(r.subscription,"Subscription response did not contain data"));return}await e(u.data)},"onResponse");i.log.info("subscribing to graphql subscription");let a=this.#t.subscribe(i,{...r,onResponse:o});return{unsubscribe:n(()=>{a()},"unsubscribe"),resubscribe:n(u=>{a(),u!==void 0&&(r.variables=u),i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:vt(r.variables)}}}),i.log.info("re-subscribing to graphql subscription"),a=this.#t.subscribe(i,{...r,onResponse:o})},"resubscribe")}}async dispose(){await this.#t.dispose()}};var Wp={"--app":{type:Pi,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},gr=class t{constructor(e,r,s,i,o,a){this.ctx=e;this.args=r;this.directory=s;this.environment=i;this.previousEnvironment=o;this.state=a;this.ctx=e.child({name:"sync-json",fields:n(()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}}),"fields")}),this.edit=new ue(this.ctx,this.environment)}static{n(this,"SyncJson")}gitBranch;edit;get filesVersion(){let e=this.state.environments[this.state.environment];return hr(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{command:r,args:s,directory:i}){e=e.child({name:"sync-json"});let o=await Lr(e,r),a=await ve(e);if(a.length===0)throw new K(C`
61
+ You (${o.email}) don't have have any Gadget applications.
62
+
63
+ Visit https://gadget.new to create one!
64
+ `);let u=await ce.default.readFile(i.absolute(".gadget/sync.json"),"utf8").catch(g=>e.log.warn("failed to read .gadget/sync.json",{error:g}));if(!u)return;let c;try{c=zc.parse(JSON.parse(u))}catch(g){e.log.warn("failed to parse .gadget/sync.json",{error:g,syncJsonFile:u});return}let d=await Ai({args:s,availableApps:a,state:c}),p=await Fi({command:r,args:s,application:d,state:c});if(Rr({application_id:d.id,environment_id:p.id}),c.application!==d.slug){if(s["--allow-different-app"]){let g={application:d.slug,environment:p.name,environments:{[p.name]:{filesVersion:"0"}}},I=p.type==="production"?new Dt(e,s,i,p,void 0,g):new t(e,s,i,p,void 0,g);return await I.loadGitBranch(),I}throw new K(C`
65
+ You were about to sync the following app to the following directory:
66
+
67
+ ${d.slug} (${p.name}) → ${i.path}
68
+
69
+ However, that directory has already been synced with this app:
70
+
71
+ ${c.application} (${c.environment})
72
+
73
+ If you're sure that you want to sync:
74
+
75
+ ${d.slug} (${p.name}) → ${i.path}
76
+
77
+ Run "ggt dev" with the {bold --allow-different-app} flag.
78
+ `)}let m;c.environment!==p.name&&(p.type!=="production"&&bt({ensureEmptyLineAbove:!0,content:C`
79
+ Changing environment.
80
+
81
+ ${c.environment} → ${p.name}
82
+ `}),m=c.environment,c.environment=p.name,c.environments[p.name]||(c.environments[p.name]={filesVersion:"0"}));let h=p.type==="production"?new Dt(e,s,i,p,m,c):new t(e,s,i,p,m,c);return await h.save(h.filesVersion),await h.loadGitBranch(),h}static async loadOrInit(e,{command:r,args:s,directory:i}){e=e.child({name:"sync-json"});let o=await t.load(e,{command:r,args:s,directory:i});if(o)return o;if(await i.hasFiles()&&!s["--allow-unknown-directory"])throw new Mt({command:r,args:s,directory:i});let a=await Ai({args:s,availableApps:await ve(e)}),u=await Fi({command:r,args:s,application:a});await ce.default.ensureDir(i.path);let c={application:a.slug,environment:u.name,environments:{[u.name]:{filesVersion:"0"}}};return o=u.type==="production"?new Dt(e,s,i,u,void 0,c):new t(e,s,i,u,void 0,c),await o.save(o.filesVersion),await o.loadGitBranch(),o}async save(e){let r=this.state.environments[this.state.environment];hr(r,"environment must exist in environments"),r.filesVersion=String(e),this.ctx.log.debug("saving .gadget/sync.json"),await ce.default.outputJSON(this.directory.absolute(".gadget/sync.json"),this.state,{spaces:2})}async loadGitBranch(){this.gitBranch=await Gc(this.ctx,{directory:this.directory})}sprint(e={}){let r=$`
83
+ Application ${this.environment.application.slug}
84
+ Environment ${this.environment.name}
85
+ `;this.gitBranch&&(r+=$({indent:5,content:`Branch ${this.gitBranch}`}));let s=he.domains.app;return ft.isSupported?r+=$({ensureEmptyLineAbove:!0,content:`${ft(kt.link("Preview"),`https://${this.environment.application.slug}--${this.environment.name}.${s}`)} ${ft(kt.link("Editor"),`https://${this.environment.application.primaryDomain}/edit/${this.environment.name}`)} ${ft(kt.link("Playground"),`https://${this.environment.application.primaryDomain}/api/playground/javascript?environment=${this.environment.name}`)} ${ft(kt.link("Docs"),`https://docs.gadget.dev/api/${this.environment.application.slug}`)}`}):r+=$`
86
+ ------------------------
87
+ Preview https://${this.environment.application.slug}--${this.environment.name}.${s}
88
+ Editor https://${this.environment.application.primaryDomain}/edit/${this.environment.name}
89
+ Playground https://${this.environment.application.primaryDomain}/api/playground/javascript?environment=${this.environment.name}
90
+ Docs https://docs.gadget.dev/api/${this.environment.application.slug}
91
+ `,$({...e,content:r})}print(e){e=Or(e,{ensureEmptyLineAbove:!0}),bt(this.sprint(e))}},Dt=class extends gr{static{n(this,"EphemeralSyncJson")}async save(e){let r=this.state.environments[this.state.environment];return hr(r,"environment must exist in environments"),r.filesVersion=String(e),Promise.resolve()}},Hp=n(async t=>{he.windows&&t.startsWith("~/")&&(t=Pr(t.slice(2)));let e=await Er(".gadget/sync.json",{cwd:t});return e&&(t=Ri.join(e,"../..")),t=Ri.resolve(t),await $r.init(t)},"loadSyncJsonDirectory"),Ai=n(async({args:t,availableApps:e,state:r})=>{let s=t["--app"]||r?.application;if(!s){let a=Array.from(Dr(e)).map(([u,c])=>[u,c.map(d=>d.slug)]);s=await be({groupedChoices:a,content:"Which application do you want to develop?"})}let i=e.find(a=>a.slug===s);if(i)return i;let o=ge(s,e.map(a=>a.slug)).slice(0,5);throw new K(C`
92
+ Unknown application:
93
+
94
+ ${s}
95
+
96
+ Did you mean one of these?
97
+
98
+ • ${o.join(`
99
+ \u2022 `)}
100
+ `)},"loadApplication"),Fi=n(async({command:t,args:e,application:r,state:s})=>{if(e["--env"]&&!r.multiEnvironmentEnabled)throw new K(C`
101
+ You specified an environment but your app doesn't have multiple environments.
102
+
103
+ Remove the "--env" flag to sync to the {bold ${r.primaryDomain}} environment.
104
+ `);let i=r.environments.filter(c=>c.type===ye.Development);t==="pull"&&i.push(...r.environments.filter(c=>c.type===ye.Production));let o=e["--env"]||s?.environment;if(o||(o=await be({choices:i.map(c=>c.name),content:"Which environment do you want to develop on?"})),o.toLowerCase()==="production"&&t!=="pull")throw new K(C`
105
+ You cannot "ggt ${t}" your {bold production} environment.
106
+ `);let a=i.find(c=>c.name===o.toLowerCase());if(a)return{...a,application:r};let u=ge(o,i.map(c=>c.name)).slice(0,5);throw new K(C`
107
+ Unknown environment:
108
+
109
+ ${o}
110
+
111
+ Did you mean one of these?
112
+
113
+ • ${u.join(`
114
+ \u2022 `)}
115
+ `)},"loadEnvironment"),Gc=n(async(t,{directory:e})=>{try{return await Oi(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},"loadBranch"),Uc=J.object({application:J.string(),environment:J.string(),environments:J.record(J.object({filesVersion:J.string()}))}),qc=J.object({app:J.string(),filesVersion:J.string(),mtime:J.number()}),Jc=J.union([Uc,qc]),zc=Jc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Kc as a,_e as b,Xc as c,Zc as d,tl as e,Br as f,Mt as g,Ir as h,Nr as i,oo as j,pl as k,Wp as l,gr as m,Hp as n};
116
+ //# sourceMappingURL=chunk-KS2O3TJA.js.map