@gadgetinc/ggt 2.3.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +387 -327
  2. package/dist/action-CF6zatIh.js +64 -0
  3. package/dist/action-CF6zatIh.js.map +1 -0
  4. package/dist/action-CrDCeX3F.js +8 -0
  5. package/dist/action-CrDCeX3F.js.map +1 -0
  6. package/dist/add-Basu3Gyf.js +1 -0
  7. package/dist/agent-plugin-CqgwTOk-.js +15 -0
  8. package/dist/agent-plugin-CqgwTOk-.js.map +1 -0
  9. package/dist/agent-plugin-DU9G5B1d.js +9 -0
  10. package/dist/agent-plugin-DU9G5B1d.js.map +1 -0
  11. package/dist/assert-Bu1E126Z.js +2 -0
  12. package/dist/assert-Bu1E126Z.js.map +1 -0
  13. package/dist/chunk-BjEoQXZ0.js +1 -0
  14. package/dist/collection-C2TCeYqY.js +2 -0
  15. package/dist/collection-C2TCeYqY.js.map +1 -0
  16. package/dist/collection-aM0fpch0.js +1 -0
  17. package/dist/command-2iNTc5dV.js +118 -0
  18. package/dist/command-2iNTc5dV.js.map +1 -0
  19. package/dist/completion-D96nxD5n.js +37 -0
  20. package/dist/completion-D96nxD5n.js.map +1 -0
  21. package/dist/configure-C8ge-2cK.js +15 -0
  22. package/dist/configure-C8ge-2cK.js.map +1 -0
  23. package/dist/debugger-BkYgApKn.js +22 -0
  24. package/dist/debugger-BkYgApKn.js.map +1 -0
  25. package/dist/defaults-B_eD7Pia.js +2 -0
  26. package/dist/defaults-B_eD7Pia.js.map +1 -0
  27. package/dist/deploy-Da6P2HXS.js +15 -0
  28. package/dist/deploy-Da6P2HXS.js.map +1 -0
  29. package/dist/dev-DWMSNcLl.js +32 -0
  30. package/dist/dev-DWMSNcLl.js.map +1 -0
  31. package/dist/dev-lock-BFanZSu1.js +10 -0
  32. package/dist/dev-lock-BFanZSu1.js.map +1 -0
  33. package/dist/directory-CNL03L6c.js +9 -0
  34. package/dist/directory-CNL03L6c.js.map +1 -0
  35. package/dist/env-DoWNvHzW.js +62 -0
  36. package/dist/env-DoWNvHzW.js.map +1 -0
  37. package/dist/esm-B25i6Etq.js +12 -0
  38. package/dist/esm-B25i6Etq.js.map +1 -0
  39. package/dist/esm-CJocZrdd.js +2 -0
  40. package/dist/esm-CJocZrdd.js.map +1 -0
  41. package/dist/eval-BceZMSd5.js +27 -0
  42. package/dist/eval-BceZMSd5.js.map +1 -0
  43. package/dist/execAsync-DrhcEHLd.js +2 -0
  44. package/dist/execAsync-DrhcEHLd.js.map +1 -0
  45. package/dist/filesync-De6asZeR.js +61 -0
  46. package/dist/filesync-De6asZeR.js.map +1 -0
  47. package/dist/getMachineId-bsd-Cch8Z6pV.js +2 -0
  48. package/dist/getMachineId-bsd-Cch8Z6pV.js.map +1 -0
  49. package/dist/getMachineId-darwin-kbQWK54o.js +3 -0
  50. package/dist/getMachineId-darwin-kbQWK54o.js.map +1 -0
  51. package/dist/getMachineId-linux-DdIel6zr.js +2 -0
  52. package/dist/getMachineId-linux-DdIel6zr.js.map +1 -0
  53. package/dist/getMachineId-unsupported-Bvmsh30k.js +2 -0
  54. package/dist/getMachineId-unsupported-Bvmsh30k.js.map +1 -0
  55. package/dist/getMachineId-win-BteHZe8j.js +2 -0
  56. package/dist/getMachineId-win-BteHZe8j.js.map +1 -0
  57. package/dist/ggt-B3HQjQRM.js +3 -0
  58. package/dist/ggt-B3HQjQRM.js.map +1 -0
  59. package/dist/handler-DZyG8Sel.js +4 -0
  60. package/dist/handler-DZyG8Sel.js.map +1 -0
  61. package/dist/http-CY3lPMkt.js +320 -0
  62. package/dist/http-CY3lPMkt.js.map +1 -0
  63. package/dist/indent-string-BVm-4tyL.js +2 -0
  64. package/dist/indent-string-BVm-4tyL.js.map +1 -0
  65. package/dist/list-lQKWZ6ZI.js +10 -0
  66. package/dist/list-lQKWZ6ZI.js.map +1 -0
  67. package/dist/login-Ce0tByNd.js +1 -0
  68. package/dist/logout-_sTWeaiQ.js +5 -0
  69. package/dist/logout-_sTWeaiQ.js.map +1 -0
  70. package/dist/logs-DbhJzz4M.js +9 -0
  71. package/dist/logs-DbhJzz4M.js.map +1 -0
  72. package/dist/main.js +2 -2
  73. package/dist/main.js.map +1 -7
  74. package/dist/model-CBiMKY0P.js +11 -0
  75. package/dist/model-CBiMKY0P.js.map +1 -0
  76. package/dist/ms-B7sMc0pR.js +2 -0
  77. package/dist/ms-B7sMc0pR.js.map +1 -0
  78. package/dist/open-CSsA4B-l.js +38 -0
  79. package/dist/open-CSsA4B-l.js.map +1 -0
  80. package/dist/p-map-DE0acmRv.js +2 -0
  81. package/dist/p-map-DE0acmRv.js.map +1 -0
  82. package/dist/problems-BMLsmxd4.js +11 -0
  83. package/dist/problems-BMLsmxd4.js.map +1 -0
  84. package/dist/prompt-C9nwJW0G.js +2 -0
  85. package/dist/prompt-C9nwJW0G.js.map +1 -0
  86. package/dist/pull-DpizmJGk.js +12 -0
  87. package/dist/pull-DpizmJGk.js.map +1 -0
  88. package/dist/push-67KBCw6c.js +12 -0
  89. package/dist/push-67KBCw6c.js.map +1 -0
  90. package/dist/root-D_UnUsp7.js +28 -0
  91. package/dist/root-D_UnUsp7.js.map +1 -0
  92. package/dist/select-Dey_sjjd.js +4 -0
  93. package/dist/select-Dey_sjjd.js.map +1 -0
  94. package/dist/session-BmzGF1t7.js +2 -0
  95. package/dist/session-BmzGF1t7.js.map +1 -0
  96. package/dist/spinner-BVmbgIil.js +8 -0
  97. package/dist/spinner-BVmbgIil.js.map +1 -0
  98. package/dist/src-DxCC1MV4.js +6 -0
  99. package/dist/src-DxCC1MV4.js.map +1 -0
  100. package/dist/status-P_RFQ7J0.js +13 -0
  101. package/dist/status-P_RFQ7J0.js.map +1 -0
  102. package/dist/subscribeToEnvironmentLogs-CUicaiw_.js +2 -0
  103. package/dist/subscribeToEnvironmentLogs-CUicaiw_.js.map +1 -0
  104. package/dist/sync-json-V52OzeCz.js +112 -0
  105. package/dist/sync-json-V52OzeCz.js.map +1 -0
  106. package/dist/table-MrBbxMay.js +11 -0
  107. package/dist/table-MrBbxMay.js.map +1 -0
  108. package/dist/update-CfxiL08e.js +12 -0
  109. package/dist/update-CfxiL08e.js.map +1 -0
  110. package/dist/update-iyhnL9-M.js +1 -0
  111. package/dist/var-ByWcufFt.js +59 -0
  112. package/dist/var-ByWcufFt.js.map +1 -0
  113. package/dist/version-B_9GB4u3.js +9 -0
  114. package/dist/version-B_9GB4u3.js.map +1 -0
  115. package/dist/whoami-BNcXIfz7.js +5 -0
  116. package/dist/whoami-BNcXIfz7.js.map +1 -0
  117. package/package.json +18 -22
  118. package/assets/favicon-128@4x.png +0 -0
  119. package/dist/add-7MLI3TCY.js +0 -82
  120. package/dist/add-7MLI3TCY.js.map +0 -7
  121. package/dist/agent-plugin-543K6WBH.js +0 -11
  122. package/dist/agent-plugin-543K6WBH.js.map +0 -7
  123. package/dist/chunk-2HJS3KFB.js +0 -2
  124. package/dist/chunk-2HJS3KFB.js.map +0 -7
  125. package/dist/chunk-3WKH3DJL.js +0 -2
  126. package/dist/chunk-3WKH3DJL.js.map +0 -7
  127. package/dist/chunk-577KP32Z.js +0 -8
  128. package/dist/chunk-577KP32Z.js.map +0 -7
  129. package/dist/chunk-6FVHOLT7.js +0 -28
  130. package/dist/chunk-6FVHOLT7.js.map +0 -7
  131. package/dist/chunk-72J7X5LR.js +0 -2
  132. package/dist/chunk-72J7X5LR.js.map +0 -7
  133. package/dist/chunk-7DYQUG5M.js +0 -2
  134. package/dist/chunk-7DYQUG5M.js.map +0 -7
  135. package/dist/chunk-ALSXPCRD.js +0 -118
  136. package/dist/chunk-ALSXPCRD.js.map +0 -7
  137. package/dist/chunk-CNNOPE5K.js +0 -69
  138. package/dist/chunk-CNNOPE5K.js.map +0 -7
  139. package/dist/chunk-ETKWDO4V.js +0 -2
  140. package/dist/chunk-ETKWDO4V.js.map +0 -7
  141. package/dist/chunk-F6BGQ4LG.js +0 -11
  142. package/dist/chunk-F6BGQ4LG.js.map +0 -7
  143. package/dist/chunk-FE5O5VX4.js +0 -2
  144. package/dist/chunk-FE5O5VX4.js.map +0 -7
  145. package/dist/chunk-GFQYFEEH.js +0 -2
  146. package/dist/chunk-GFQYFEEH.js.map +0 -7
  147. package/dist/chunk-GJGBTM5Y.js +0 -2
  148. package/dist/chunk-GJGBTM5Y.js.map +0 -7
  149. package/dist/chunk-GZTHIOXS.js +0 -2
  150. package/dist/chunk-GZTHIOXS.js.map +0 -7
  151. package/dist/chunk-IQSZEOYY.js +0 -283
  152. package/dist/chunk-IQSZEOYY.js.map +0 -7
  153. package/dist/chunk-J232VCIM.js +0 -2
  154. package/dist/chunk-J232VCIM.js.map +0 -7
  155. package/dist/chunk-KKIL22RY.js +0 -2
  156. package/dist/chunk-KKIL22RY.js.map +0 -7
  157. package/dist/chunk-L2XBSR7G.js +0 -2
  158. package/dist/chunk-L2XBSR7G.js.map +0 -7
  159. package/dist/chunk-N5FFICAP.js +0 -9
  160. package/dist/chunk-N5FFICAP.js.map +0 -7
  161. package/dist/chunk-TGCJ6TMW.js +0 -10
  162. package/dist/chunk-TGCJ6TMW.js.map +0 -7
  163. package/dist/chunk-ULJYEUQG.js +0 -113
  164. package/dist/chunk-ULJYEUQG.js.map +0 -7
  165. package/dist/chunk-UVVKKUYG.js +0 -10
  166. package/dist/chunk-UVVKKUYG.js.map +0 -7
  167. package/dist/chunk-WZ2PO6H2.js +0 -11
  168. package/dist/chunk-WZ2PO6H2.js.map +0 -7
  169. package/dist/chunk-X4XSYLCE.js +0 -12
  170. package/dist/chunk-X4XSYLCE.js.map +0 -7
  171. package/dist/chunk-ZYDMXS5R.js +0 -6
  172. package/dist/chunk-ZYDMXS5R.js.map +0 -7
  173. package/dist/configure-PYRXYNGZ.js +0 -12
  174. package/dist/configure-PYRXYNGZ.js.map +0 -7
  175. package/dist/debugger-VKLUEWIN.js +0 -41
  176. package/dist/debugger-VKLUEWIN.js.map +0 -7
  177. package/dist/deploy-JCREEGBA.js +0 -25
  178. package/dist/deploy-JCREEGBA.js.map +0 -7
  179. package/dist/dev-Y2GLI7EH.js +0 -59
  180. package/dist/dev-Y2GLI7EH.js.map +0 -7
  181. package/dist/env-5OPHX3MC.js +0 -135
  182. package/dist/env-5OPHX3MC.js.map +0 -7
  183. package/dist/esm-3JVXH7DT.js +0 -37
  184. package/dist/esm-3JVXH7DT.js.map +0 -7
  185. package/dist/eval-LZPZ6PBQ.js +0 -54
  186. package/dist/eval-LZPZ6PBQ.js.map +0 -7
  187. package/dist/getMachineId-bsd-QUXN4NKS.js +0 -2
  188. package/dist/getMachineId-bsd-QUXN4NKS.js.map +0 -7
  189. package/dist/getMachineId-darwin-TCXBAX22.js +0 -3
  190. package/dist/getMachineId-darwin-TCXBAX22.js.map +0 -7
  191. package/dist/getMachineId-linux-IJ3LYIOX.js +0 -2
  192. package/dist/getMachineId-linux-IJ3LYIOX.js.map +0 -7
  193. package/dist/getMachineId-unsupported-IKXBUCYY.js +0 -2
  194. package/dist/getMachineId-unsupported-IKXBUCYY.js.map +0 -7
  195. package/dist/getMachineId-win-6CX7VSFF.js +0 -2
  196. package/dist/getMachineId-win-6CX7VSFF.js.map +0 -7
  197. package/dist/ggt-KUAF6WUA.js +0 -45
  198. package/dist/ggt-KUAF6WUA.js.map +0 -7
  199. package/dist/list-IANT7SNF.js +0 -11
  200. package/dist/list-IANT7SNF.js.map +0 -7
  201. package/dist/login-TYRZLN5S.js +0 -2
  202. package/dist/login-TYRZLN5S.js.map +0 -7
  203. package/dist/logout-P75XYYZ6.js +0 -7
  204. package/dist/logout-P75XYYZ6.js.map +0 -7
  205. package/dist/logs-SBMD6JSR.js +0 -28
  206. package/dist/logs-SBMD6JSR.js.map +0 -7
  207. package/dist/open-JPAMII4K.js +0 -74
  208. package/dist/open-JPAMII4K.js.map +0 -7
  209. package/dist/problems-EZRSHLZT.js +0 -14
  210. package/dist/problems-EZRSHLZT.js.map +0 -7
  211. package/dist/pull-R3PMBVOT.js +0 -28
  212. package/dist/pull-R3PMBVOT.js.map +0 -7
  213. package/dist/push-5XEEESQQ.js +0 -2
  214. package/dist/push-5XEEESQQ.js.map +0 -7
  215. package/dist/status-RJN5ES6S.js +0 -14
  216. package/dist/status-RJN5ES6S.js.map +0 -7
  217. package/dist/update-X7YS3MNH.js +0 -2
  218. package/dist/update-X7YS3MNH.js.map +0 -7
  219. package/dist/var-PC6KQUPF.js +0 -159
  220. package/dist/var-PC6KQUPF.js.map +0 -7
  221. package/dist/version-GZJOU2CV.js +0 -11
  222. package/dist/version-GZJOU2CV.js.map +0 -7
  223. package/dist/whoami-GKPGPZ3B.js +0 -7
  224. package/dist/whoami-GKPGPZ3B.js.map +0 -7
@@ -1,59 +0,0 @@
1
- import{a as En}from"./chunk-3WKH3DJL.js";import{d as lr,f as fr}from"./chunk-TGCJ6TMW.js";import{a as cr}from"./chunk-ETKWDO4V.js";import{a as rt}from"./chunk-KKIL22RY.js";import{a as Vt,b as Xt}from"./chunk-UVVKKUYG.js";import{a as tt,d as gn,h as z,i as ir,j as ar}from"./chunk-CNNOPE5K.js";import"./chunk-L2XBSR7G.js";import{b as rr}from"./chunk-577KP32Z.js";import"./chunk-WZ2PO6H2.js";import{f as Zt,s as nr,t as sr,u as or}from"./chunk-ULJYEUQG.js";import"./chunk-2HJS3KFB.js";import{a as tr}from"./chunk-F6BGQ4LG.js";import"./chunk-ZYDMXS5R.js";import{$ as Qt,ba as er,d as Jt,j as wn}from"./chunk-IQSZEOYY.js";import"./chunk-GZTHIOXS.js";import{c as Yt}from"./chunk-72J7X5LR.js";import"./chunk-X4XSYLCE.js";import{W as et,b as jt,ba as $t,ma as Ge,r as Ht,ra as H,sa as Kt,ta as zt}from"./chunk-ALSXPCRD.js";import{a as yn}from"./chunk-GFQYFEEH.js";import{a as s,b as E,c as q,d as F,e as mn,f as We,g as pn,h as c}from"./chunk-7DYQUG5M.js";var Fr=F(R=>{"use strict";c();var gt=s((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"a"),Cn=gt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=void 0;var t=E("node:fs"),r=E("node:fs/promises"),i=s(async(l,f={})=>{let{ignoreErrors:u=!1}=f;try{return o(await(0,r.stat)(l),f)}catch(h){let m=h;if(u||m.code==="EACCES")return!1;throw m}},"q");e.isexe=i;var n=s((l,f={})=>{let{ignoreErrors:u=!1}=f;try{return o((0,t.statSync)(l),f)}catch(h){let m=h;if(u||m.code==="EACCES")return!1;throw m}},"m");e.sync=n;var o=s((l,f)=>l.isFile()&&a(l,f),"d"),a=s((l,f)=>{let u=f.uid??process.getuid?.(),h=f.groups??process.getgroups?.()??[],m=f.gid??process.getgid?.()??h[0];if(u===void 0||m===void 0)throw new Error("cannot get uid or gid");let p=new Set([m,...h]),d=l.mode,x=l.uid,D=l.gid,L=parseInt("100",8),j=parseInt("010",8),b=parseInt("001",8),W=L|j;return!!(d&b||d&j&&p.has(D)||d&L&&x===u||d&W&&u===0)},"A")}),Tn=gt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=void 0;var t=E("node:fs"),r=E("node:fs/promises"),i=E("node:path"),n=s(async(f,u={})=>{let{ignoreErrors:h=!1}=u;try{return l(await(0,r.stat)(f),f,u)}catch(m){let p=m;if(h||p.code==="EACCES")return!1;throw p}},"F");e.isexe=n;var o=s((f,u={})=>{let{ignoreErrors:h=!1}=u;try{return l((0,t.statSync)(f),f,u)}catch(m){let p=m;if(h||p.code==="EACCES")return!1;throw p}},"L");e.sync=o;var a=s((f,u)=>{let{pathExt:h=process.env.PATHEXT||""}=u,m=h.split(i.delimiter);if(m.indexOf("")!==-1)return!0;for(let p of m){let d=p.toLowerCase(),x=f.substring(f.length-d.length).toLowerCase();if(d&&x===d)return!0}return!1},"B"),l=s((f,u,h)=>f.isFile()&&a(u,h),"y")}),Rn=gt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})}),br=R&&R.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),bn=R&&R.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),kr=R&&R.__importStar||(function(){var e=s(function(t){return e=Object.getOwnPropertyNames||function(r){var i=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i[i.length]=n);return i},e(t)},"t");return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var i=e(t),n=0;n<i.length;n++)i[n]!=="default"&&br(r,t,i[n]);return bn(r,t),r}})(),kn=R&&R.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&br(t,e,r)};Object.defineProperty(R,"__esModule",{value:!0});R.sync=R.isexe=R.posix=R.win32=void 0;var Lr=kr(Cn());R.posix=Lr;var Or=kr(Tn());R.win32=Or;kn(Rn(),R);var Ln=process.env._ISEXE_TEST_PLATFORM_||process.platform,qr=Ln==="win32"?Or:Lr;R.isexe=qr.isexe;R.sync=qr.sync});var Kr=F((bc,$r)=>{c();var{isexe:On,sync:qn}=Fr(),{join:Fn,delimiter:Pn,sep:Pr,posix:Ur}=E("path"),Mr=process.platform==="win32",Wr=new RegExp(`[${Ur.sep}${Pr===Ur.sep?"":Pr}]`.replace(/(\\)/g,"\\$1")),Un=new RegExp(`^\\.${Wr.source}`),Gr=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),Br=s((e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:i=Pn})=>{let n=e.match(Wr)?[""]:[...Mr?[process.cwd()]:[],...(t||"").split(i)];if(Mr){let o=r||[".EXE",".CMD",".BAT",".COM"].join(i),a=o.split(i).flatMap(l=>[l,l.toLowerCase()]);return e.includes(".")&&a[0]!==""&&a.unshift(""),{pathEnv:n,pathExt:a,pathExtExe:o}}return{pathEnv:n,pathExt:[""]}},"getPathInfo"),jr=s((e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&Un.test(t)?t.slice(0,2):"")+Fn(r,t)},"getPathPart"),Hr=s(async(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=Br(e,t),o=[];for(let a of r){let l=jr(a,e);for(let f of i){let u=l+f;if(await On(u,{pathExt:n,ignoreErrors:!0})){if(!t.all)return u;o.push(u)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Gr(e)},"which"),Mn=s((e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=Br(e,t),o=[];for(let a of r){let l=jr(a,e);for(let f of i){let u=l+f;if(qn(u,{pathExt:n,ignoreErrors:!0})){if(!t.all)return u;o.push(u)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Gr(e)},"whichSync");$r.exports=Hr;Hr.sync=Mn});var zr=F(He=>{c();(function(){var e;e=s(function(t,r,i){var n,o;for(o="";t.length>0;)n=t.match(r),n?(o+=t.slice(0,n.index),o+=i(n),t=t.slice(n.index+n[0].length)):(o+=t,t="");return o},"scan"),He.split=function(t){var r,i;return t==null&&(t=""),i=[],r="",e(t,/\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/,function(n){var o,a,l,f,u,h,m;if(f=n[0],m=n[1],h=n[2],o=n[3],a=n[4],l=n[5],u=n[6],l!=null)throw new Error("Unmatched quote");if(r+=m||(h||o||a).replace(/\\(?=.)/,""),u!=null)return i.push(r),r=""}),r&&i.push(r),i},He.escape=function(t){return t==null&&(t=""),t==null?"''":t.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g,"\\$1").replace(/\n/g,`'
2
- '`)}}).call(He)});var Vr=F((Bc,Yr)=>{"use strict";c();var Jr=E("fs"),vt;function Wn(){try{return Jr.statSync("/.dockerenv"),!0}catch{return!1}}s(Wn,"hasDockerEnv");function Gn(){try{return Jr.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}s(Gn,"hasDockerCGroup");Yr.exports=()=>(vt===void 0&&(vt=Wn()||Gn()),vt)});var Qr=F(($c,Nt)=>{"use strict";c();var Bn=E("os"),jn=E("fs"),Xr=Vr(),Zr=s(()=>{if(process.platform!=="linux")return!1;if(Bn.release().toLowerCase().includes("microsoft"))return!Xr();try{return jn.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Xr():!1}catch{return!1}},"isWsl");process.env.__IS_WSL_TEST__?Nt.exports=Zr:Nt.exports=Zr()});var de=F((Jc,C)=>{c();var Hn=zr(),$e=E("child_process"),xt=En(),$n=Qr(),Kn=E("path"),zn=E("url"),he=E("os"),St=E("fs"),Jn=E("net"),Yn=1024;function ii(e){return JSON.parse(JSON.stringify(e))}s(ii,"clone");C.exports.clone=ii;var Vn=s(function(e){return typeof e=="string"?e.replace(/(["$`\\])/g,"\\$1"):e},"escapeQuotes"),Xn=s(function(e,t){return e.indexOf(t)!==-1},"inArray"),ei={u:"urgency",urgency:"urgency",t:"expire-time",time:"expire-time",timeout:"expire-time",e:"expire-time",expire:"expire-time","expire-time":"expire-time",i:"icon",icon:"icon",c:"category",category:"category",subtitle:"category",h:"hint",hint:"hint",a:"app-name","app-name":"app-name"};C.exports.command=function(e,t,r){return e=Hn.escape(e),process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (command):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.exec(e+" "+t.join(" "),function(i,n,o){if(i)return r(i);r(o,n)})};C.exports.fileCommand=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommand):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,o){if(i)return r(i,n);r(o,n)})};C.exports.fileCommandJson=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommandJson):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,o){if(i)return r(i,n);if(!n)return r(i,{});try{let a=JSON.parse(n);r(o||null,a)}catch(a){r(a,n)}})};C.exports.immediateFileCommand=function(e,t,r){process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (notifier):"),console.info("[notifier path]",e)),Zn(e,function(i,n){if(!n)return r(new Error("Notifier ("+e+") not found on system."));$e.execFile(e,t),r()})};function Zn(e,t){return St.stat(e,function(r,i){return r?Kn.extname(e)?t(r,!1):St.stat(e+".exe",function(n,o){if(n)return t(n,!1);t(n,o.isFile())}):t(r,i.isFile())})}s(Zn,"notifierExists");var Ke=s(function(e){return e.appIcon&&(e.icon=e.appIcon,delete e.appIcon),e},"mapAppIcon"),_e=s(function(e){return e.text&&(e.message=e.text,delete e.text),e},"mapText"),ni=s(function(e){return e.i&&(e.icon=e.i,delete e.i),e},"mapIconShorthand");C.exports.mapToNotifySend=function(e){e=Ke(e),e=_e(e),e.timeout===!1&&delete e.timeout,e.wait===!0&&(e["expire-time"]=5);for(let t in e)t==="message"||t==="title"||e.hasOwnProperty(t)&&ei[t]!==t&&(e[ei[t]]=e[t],delete e[t]);return typeof e["expire-time"]>"u"?e["expire-time"]=10*1e3:typeof e["expire-time"]=="number"&&(e["expire-time"]=e["expire-time"]*1e3),e};C.exports.mapToGrowl=function(e){if(e=Ke(e),e=ni(e),e=_e(e),e.icon&&!Buffer.isBuffer(e.icon))try{e.icon=St.readFileSync(e.icon)}catch{}return e};C.exports.mapToMac=function(e){return e=ni(e),e=_e(e),e.icon&&(e.appIcon=e.icon,delete e.icon),e.sound===!0&&(e.sound="Bottle"),e.sound===!1&&delete e.sound,e.sound&&e.sound.indexOf("Notification.")===0&&(e.sound="Bottle"),e.wait===!0&&(e.timeout||(e.timeout=5),delete e.wait),!e.wait&&!e.timeout&&(e.timeout===!1?delete e.timeout:e.timeout=10),e.json=!0,e};function _t(e){return Object.prototype.toString.call(e)==="[object Array]"}s(_t,"isArray");C.exports.isArray=_t;function Qn(){}s(Qn,"noop");C.exports.actionJackerDecorator=function(e,t,r,i){if(t=ii(t),r=r||Qn,typeof r!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof r);return function(n,o){let a=o,l={};if(a&&typeof a=="object"&&(l=a,a=a.activationType),a&&(a=a.toLowerCase().trim(),a.match(/^activate|clicked$/)&&(a="activate"),a.match(/^timedout$/)&&(a="timeout")),r.apply(e,[n,a,l]),!i||!a)return;let f=i(a);f&&e.emit(f,e,t,l)}};C.exports.constructArgumentList=function(e,t){let r=[];t=t||{};let i=t.initial||[],n=t.keyExtra||"",o=t.allowedArguments||[],a=t.noEscape!==void 0,l=t.allowedArguments!==void 0,f=!!t.explicitTrue,u=!!t.keepNewlines,h=t.wrapper===void 0?'"':t.wrapper,m=s(function p(d){return _t(d)?ti(d.map(p).join(",")):(a||(d=Vn(d)),typeof d=="string"&&!u&&(d=ti(d)),h+d+h)},"escapeFn");i.forEach(function(p){r.push(m(p))});for(let p in e)if(e.hasOwnProperty(p)&&(!l||Xn(o,p)))if(f&&e[p]===!0)r.push("-"+n+p);else{if(f&&e[p]===!1)continue;r.push("-"+n+p,m(e[p]))}return r};function ti(e){let t=process.platform==="win32"?"\\r\\n":"\\n";return e.replace(/\r?\n/g,t)}s(ti,"removeNewLines");var es=["t","m","b","tb","p","id","s","silent","appID","pid","pipeName","close","install"],ts="Notification.",ri="Notification.Default";C.exports.mapToWin8=function(e){e=Ke(e),e=_e(e),e.icon&&(/^file:\/+/.test(e.icon)?e.p=new zn.URL(e.icon).pathname.replace(/^\/(\w:\/)/,"$1").replace(/\//g,"\\"):e.p=e.icon,delete e.icon),e.message&&(e.m=e.message.replace(/\x1b/g,""),delete e.message),e.title&&(e.t=e.title,delete e.title),e.appName&&(e.appID=e.appName,delete e.appName),typeof e.remove<"u"&&(e.close=e.remove,delete e.remove),(e.quiet||e.silent)&&(e.silent=e.quiet||e.silent,delete e.quiet),typeof e.sound<"u"&&(e.s=e.sound,delete e.sound),e.s===!1&&(e.silent=!0,delete e.s),e.s&&e.silent&&delete e.s,e.s===!0&&(e.s=ri),e.s&&e.s.indexOf(ts)!==0&&(e.s=ri),e.actions&&_t(e.actions)&&(e.b=e.actions.join(";"),delete e.actions);for(let t in e)e.hasOwnProperty(t)&&es.indexOf(t)===-1&&delete e[t];return e};C.exports.mapToNotifu=function(e){return e=Ke(e),e=_e(e),e.icon&&(e.i=e.icon,delete e.icon),e.message&&(e.m=e.message,delete e.message),e.title&&(e.p=e.title,delete e.title),e.time&&(e.d=e.time,delete e.time),e.q!==!1?e.q=!0:delete e.q,e.quiet===!1&&(delete e.q,delete e.quiet),e.sound&&(delete e.q,delete e.sound),e.t&&(e.d=e.t,delete e.t),e.type&&(e.t=rs(e.type),delete e.type),e};C.exports.isMac=function(){return he.type()==="Darwin"};C.exports.isMountainLion=function(){return he.type()==="Darwin"&&xt.satisfies(It(he.release()),">=12.0.0")};C.exports.isWin8=function(){return he.type()==="Windows_NT"&&xt.satisfies(It(he.release()),">=6.2.9200")};C.exports.isWSL=function(){return $n};C.exports.isLessThanWin8=function(){return he.type()==="Windows_NT"&&xt.satisfies(It(he.release()),"<6.2.9200")};function It(e){return e.split(".").length===2&&(e+=".0"),e}s(It,"garanteeSemverFormat");function rs(e){if(typeof e=="string"||e instanceof String){if(e.toLowerCase()==="info")return"info";if(e.toLowerCase()==="warn")return"warn";if(e.toLowerCase()==="error")return"error"}return"info"}s(rs,"sanitizeNotifuTypeArgument");C.exports.createNamedPipe=e=>{let t=Buffer.alloc(Yn);return new Promise(r=>{e.instance=Jn.createServer(i=>{i.on("data",n=>{t.write(n.toString())}),i.on("end",()=>{e.instance.close()})}),e.instance.listen(e.namedPipe,()=>{r(t)})})}});var fi=F((Xc,li)=>{c();var si=E("os"),is=gn(),Ie=de(),ai=E("events").EventEmitter,ns=E("util"),ci="notify-send",ze;li.exports=De;function De(e){if(e=Ie.clone(e||{}),!(this instanceof De))return new De(e);this.options=e,ai.call(this)}s(De,"NotifySend");ns.inherits(De,ai);function ss(){}s(ss,"noop");function os(e,t){if(e=Ie.clone(e||{}),t=t||ss,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof t);if(typeof e=="string"&&(e={title:"node-notifier",message:e}),!e.message)return t(new Error("Message is required.")),this;if(si.type()!=="Linux"&&!si.type().match(/BSD$/))return t(new Error("Only supported on Linux and *BSD systems")),this;if(ze===!1)return t(new Error("notify-send must be installed on the system.")),this;if(ze||this.options.suppressOsdCheck)return oi(e,t),this;try{ze=!!is.sync(ci),oi(e,t)}catch(r){return ze=!1,t(r)}return this}s(os,"notifyRaw");Object.defineProperty(De.prototype,"notify",{get:s(function(){return this._notify||(this._notify=os.bind(this)),this._notify},"get")});var as=["urgency","expire-time","icon","category","hint","app-name"];function oi(e,t){e=Ie.mapToNotifySend(e),e.title=e.title||"Node Notification:";let r=[e.title,e.message];delete e.title,delete e.message;let i=Ie.constructArgumentList(e,{initial:r,keyExtra:"-",allowedArguments:as});Ie.command(ci,i,t)}s(oi,"doNotification")});var Dt=F((el,hi)=>{c();var cs=E("net"),ui=!1;hi.exports=function(e,t){if(typeof t>"u"&&(t=e,e={}),ui)return t(null,ui);let r=e.port||23053,i=e.host||"localhost",n=cs.connect(r,i);n.setTimeout(100),n.once("connect",function(){n.end(),t(null,!0)}),n.once("error",function(){n.end(),t(null,!1)})}});var pi=F((rl,mi)=>{c();var ls=E("net"),fs=E("crypto"),di=E("util").format,us=E("fs"),B=`\r
3
- `;function me(e,t){t=t||{},this.type=e,this.host=t.host||"localhost",this.port=t.port||23053,this.request="GNTP/1.0 "+e+" NONE"+B,this.resources=[],this.attempts=0,this.maxAttempts=5}s(me,"GNTP");me.prototype.parseResp=function(e){var t={},r,i;return e=e.slice(0,e.indexOf(B+B)).split(B),r=e[0],i=e.slice(1),t.state=r.match(/-(OK|ERROR|CALLBACK)/)[0].slice(1),i.forEach(function(n){n=n.split(": "),t[n[0]]=n[1]}),t};me.prototype.retry=function(){var e=this,t=arguments;setTimeout(function(){e.send.apply(e,t)},750)};me.prototype.addResource=function(e){var t=fs.createHash("md5").update(e).digest("hex"),r="Identifier: "+t+B+"Length: "+e.length+B+B;return this.resources.push({header:r,file:e}),"x-growl-resource://"+t};me.prototype.add=function(e,t){t!==void 0&&(/-Icon/.test(e)&&!/^https?:\/\//.test(t)&&(/\.(png|gif|jpe?g)$/.test(t)?t=this.addResource(us.readFileSync(t)):t instanceof Buffer&&(t=this.addResource(t))),this.request+=e+": "+t+B)};me.prototype.newline=function(){this.request+=B};me.prototype.send=function(e){var t=this,r=ls.connect(this.port,this.host),i="";e=e||function(){},this.attempts+=1,r.on("connect",function(){r.write(t.request),t.resources.forEach(function(n){r.write(n.header),r.write(n.file),r.write(B+B)})}),r.on("data",function(n){i+=n.toString(),i.slice(i.length-4)===B+B&&(i=t.parseResp(i),i.state==="ERROR"||i.state==="CALLBACK"?r.end():i="")}),r.on("end",function(){if(["200","401","402"].indexOf(i["Error-Code"])>=0)if(t.attempts<=t.maxAttempts)t.retry(e);else{var n='GNTP request to "%s:%d" failed with error code %s (%s)';e(new Error(di(n,t.host,t.port,i["Error-Code"],i["Error-Description"])))}else e(void 0,i)}),r.on("error",function(){e(new Error(di('Error while sending GNTP request to "%s:%d"',t.host,t.port))),r.destroy()})};mi.exports=me});var gi=F((sl,wi)=>{c();var yi=pi();function Ae(){this.appname="Growly",this.notifications=void 0,this.labels=void 0,this.count=0,this.registered=!1,this.host=void 0,this.port=void 0}s(Ae,"Growly");Ae.prototype.getLabels=function(){return this.notifications.map(function(e){return e.label})};Ae.prototype.setHost=function(e,t){this.host=e,this.port=t};Ae.prototype.register=function(e,t,r,i){var n;typeof t=="object"&&(r=t,t=void 0),(r===void 0||!r.length)&&(r=[{label:"default",dispname:"Default Notification",enabled:!0}]),typeof arguments[arguments.length-1]=="function"?i=arguments[arguments.length-1]:i=s(function(){},"callback"),this.appname=e,this.notifications=r,this.labels=this.getLabels(),this.registered=!0,n=new yi("REGISTER",{host:this.host,port:this.port}),n.add("Application-Name",e),n.add("Application-Icon",t),n.add("Notifications-Count",r.length),n.newline(),r.forEach(function(o){o.enabled===void 0&&(o.enabled=!0),n.add("Notification-Name",o.label),n.add("Notification-Display-Name",o.dispname),n.add("Notification-Enabled",o.enabled?"True":"False"),n.add("Notification-Icon",o.icon),n.newline()}),n.send(i)};Ae.prototype.notify=function(e,t,r){var i=this,n;if(!this.registered){this.register(this.appname,function(o){o&&console.log(o),i.notify.call(i,e,t,r)});return}t=t||{},typeof t=="function"&&(r=t,t={}),n=new yi("NOTIFY",{host:this.host,port:this.port}),n.add("Application-Name",this.appname),n.add("Notification-Name",t.label||this.labels[0]),n.add("Notification-ID",++this.count),n.add("Notification-Title",t.title),n.add("Notification-Text",e),n.add("Notification-Sticky",t.sticky?"True":"False"),n.add("Notification-Priority",t.priority),n.add("Notification-Icon",t.icon),n.add("Notification-Coalescing-ID",t.coalescingId||void 0),n.add("Notification-Callback-Context",r?"context":void 0),n.add("Notification-Callback-Context-Type",r?"string":void 0),n.add("Notification-Callback-Target",void 0),n.newline(),n.send(function(o,a){r&&o?r(o):r&&a.state==="CALLBACK"&&r(void 0,a["Notification-Callback-Result"].toLowerCase())})};wi.exports=new Ae});var Ye=F((cl,Ni)=>{c();var hs=Dt(),Je=de(),Ce=gi(),vi=E("events").EventEmitter,ds=E("util"),ms="Couldn't connect to growl (might be used as a fallback). Make sure it is running";Ni.exports=Te;var Ei;function Te(e){if(e=Je.clone(e||{}),!(this instanceof Te))return new Te(e);Ce.appname=e.name||"Node",this.options=e,vi.call(this)}s(Te,"Growl");ds.inherits(Te,vi);function ps(e,t){if(Ce.setHost(this.options.host,this.options.port),e=Je.clone(e||{}),typeof e=="string"&&(e={title:"node-notifier",message:e}),t=Je.actionJackerDecorator(this,e,t,function(r){return r==="click"?"click":r==="timedout"?"timeout":!1}),e=Je.mapToGrowl(e),!e.message)return t(new Error("Message is required.")),this;if(e.title=e.title||"Node Notification:",Ei||e.wait){let r=e.wait?t:ys;return Ce.notify(e.message,e,r),e.wait||t(),this}return hs(Ce,function(r,i){if(Ei=i,!i)return t(new Error(ms));Ce.notify(e.message,e),t()}),this}s(ps,"notifyRaw");Object.defineProperty(Te.prototype,"notify",{get:s(function(){return this._notify||(this._notify=ps.bind(this)),this._notify},"get")});function ys(){}s(ys,"noop")});var Ii=F((ul,_i)=>{c();var pe=de(),ws=Ye(),gs=E("path"),Es=gs.join(__dirname,"../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier"),xi=E("events").EventEmitter,vs=E("util"),Ns="You need Mac OS X 10.8 or above to use NotificationCenter, or use Growl fallback with constructor option {withFallback: true}.";_i.exports=Re;function Re(e){if(e=pe.clone(e||{}),!(this instanceof Re))return new Re(e);this.options=e,xi.call(this)}s(Re,"NotificationCenter");vs.inherits(Re,xi);var Si=null;function Ss(){}s(Ss,"noop");function xs(e,t){let r,i=_s();if(e=pe.clone(e||{}),Si=i,typeof e=="string"&&(e={title:"node-notifier",message:e}),t=t||Ss,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let n=pe.actionJackerDecorator(this,e,t,function(a){return Si!==i?!1:a==="activate"?"click":a==="timeout"?"timeout":a==="replied"?"replied":!1});if(e=pe.mapToMac(e),!e.message&&!e.group&&!e.list&&!e.remove)return t(new Error("Message, group, remove or list property is required.")),this;let o=pe.constructArgumentList(e);return pe.isMountainLion()?(pe.fileCommandJson(this.options.customPath||Es,o,n),this):r||this.options.withFallback?(r=r||new ws(this.options),r.notify(e,t)):(t(new Error(Ns)),this)}s(xs,"notifyRaw");Object.defineProperty(Re.prototype,"notify",{get:s(function(){return this._notify||(this._notify=xs.bind(this)),this._notify},"get")});function _s(){return{_ref:"val"}}s(_s,"identificator")});var At=F((ml,Ti)=>{c();var Is=E("path"),Ds=Is.resolve(__dirname,"../vendor/notifu/notifu"),As=Dt(),ie=de(),Cs=Ct(),Di=Ye(),Ts=E("os"),Ci=E("events").EventEmitter,Rs=E("util"),Ve;Ti.exports=be;function be(e){if(e=ie.clone(e||{}),!(this instanceof be))return new be(e);this.options=e,Ci.call(this)}s(be,"WindowsBalloon");Rs.inherits(be,Ci);function bs(){}s(bs,"noop");function ks(e,t){let r,i=this.options;e=ie.clone(e||{}),t=t||bs,typeof e=="string"&&(e={title:"node-notifier",message:e});let n=ie.actionJackerDecorator(this,e,t,function(o){return o==="activate"?"click":o==="timeout"?"timeout":!1});return this.options.withFallback&&ie.isWin8()?(r=r||new Cs(i),r.notify(e,t)):this.options.withFallback&&(!ie.isLessThanWin8()||Ve===!0)?(r=r||new Di(i),r.notify(e,t)):!this.options.withFallback||Ve===!1?(Ai(e,i,n),this):(As(i,function(o,a){if(Ve=a,Ve)return r=r||new Di(i),r.notify(e,t);Ai(e,i,n)}),this)}s(ks,"notifyRaw");Object.defineProperty(be.prototype,"notify",{get:s(function(){return this._notify||(this._notify=ks.bind(this)),this._notify},"get")});var Ls=["t","d","p","m","i","e","q","w","xp"];function Ai(e,t,r){let i=Ts.arch()==="x64";e=e||{},e=ie.mapToNotifu(e),e.p=e.p||"Node Notification:";let n=Ds+(i?"64":"")+".exe",o=t.customPath||n;if(!e.m)return r(new Error("Message is required.")),this;let a=ie.constructArgumentList(e,{wrapper:"",noEscape:!0,explicitTrue:!0,allowedArguments:Ls});if(e.wait)return ie.fileCommand(o,a,function(l,f){let u=Os(l.code);return u==="error"?r(l,f):r(null,u)});ie.immediateFileCommand(o,a,r)}s(Ai,"doNotification");function Os(e){switch(e){case 2:return"timeout";case 3:case 6:case 7:return"activate";case 4:return"close";default:return"error"}}s(Os,"fromErrorCodeToAction")});import qs from"crypto";function ke(){return Xe>Ze.length-16&&(qs.randomFillSync(Ze),Xe=0),Ze.slice(Xe,Xe+=16)}var Ze,Xe,Tt=q(()=>{c();Ze=new Uint8Array(256),Xe=Ze.length;s(ke,"rng")});var Ri,bi=q(()=>{c();Ri=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function Fs(e){return typeof e=="string"&&Ri.test(e)}var ce,Le=q(()=>{c();bi();s(Fs,"validate");ce=Fs});function Ps(e,t=0){let r=(k[e[t+0]]+k[e[t+1]]+k[e[t+2]]+k[e[t+3]]+"-"+k[e[t+4]]+k[e[t+5]]+"-"+k[e[t+6]]+k[e[t+7]]+"-"+k[e[t+8]]+k[e[t+9]]+"-"+k[e[t+10]]+k[e[t+11]]+k[e[t+12]]+k[e[t+13]]+k[e[t+14]]+k[e[t+15]]).toLowerCase();if(!ce(r))throw TypeError("Stringified UUID is invalid");return r}var k,le,Oe=q(()=>{c();Le();k=[];for(let e=0;e<256;++e)k.push((e+256).toString(16).substr(1));s(Ps,"stringify");le=Ps});function Us(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let o=e.node||ki,a=e.clockseq!==void 0?e.clockseq:Rt;if(o==null||a==null){let p=e.random||(e.rng||ke)();o==null&&(o=ki=[p[0]|1,p[1],p[2],p[3],p[4],p[5]]),a==null&&(a=Rt=(p[6]<<8|p[7])&16383)}let l=e.msecs!==void 0?e.msecs:Date.now(),f=e.nsecs!==void 0?e.nsecs:kt+1,u=l-bt+(f-kt)/1e4;if(u<0&&e.clockseq===void 0&&(a=a+1&16383),(u<0||l>bt)&&e.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");bt=l,kt=f,Rt=a,l+=122192928e5;let h=((l&268435455)*1e4+f)%4294967296;n[i++]=h>>>24&255,n[i++]=h>>>16&255,n[i++]=h>>>8&255,n[i++]=h&255;let m=l/4294967296*1e4&268435455;n[i++]=m>>>8&255,n[i++]=m&255,n[i++]=m>>>24&15|16,n[i++]=m>>>16&255,n[i++]=a>>>8|128,n[i++]=a&255;for(let p=0;p<6;++p)n[i+p]=o[p];return t||le(n)}var ki,Rt,bt,kt,Li,Oi=q(()=>{c();Tt();Oe();bt=0,kt=0;s(Us,"v1");Li=Us});function Ms(e){if(!ce(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var Qe,Lt=q(()=>{c();Le();s(Ms,"parse");Qe=Ms});function Ws(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function qe(e,t,r){function i(n,o,a,l){if(typeof n=="string"&&(n=Ws(n)),typeof o=="string"&&(o=Qe(o)),o.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+n.length);if(f.set(o),f.set(n,o.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,a){l=l||0;for(let u=0;u<16;++u)a[l+u]=f[u];return a}return le(f)}s(i,"generateUUID");try{i.name=e}catch{}return i.DNS=Gs,i.URL=Bs,i}var Gs,Bs,Ot=q(()=>{c();Oe();Lt();s(Ws,"stringToBytes");Gs="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Bs="6ba7b811-9dad-11d1-80b4-00c04fd430c8";s(qe,"default")});import js from"crypto";function Hs(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),js.createHash("md5").update(e).digest()}var qi,Fi=q(()=>{c();s(Hs,"md5");qi=Hs});var $s,Pi,Ui=q(()=>{c();Ot();Fi();$s=qe("v3",48,qi),Pi=$s});function Ks(e,t,r){e=e||{};let i=e.random||(e.rng||ke)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return le(i)}var Mi,Wi=q(()=>{c();Tt();Oe();s(Ks,"v4");Mi=Ks});import zs from"crypto";function Js(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),zs.createHash("sha1").update(e).digest()}var Gi,Bi=q(()=>{c();s(Js,"sha1");Gi=Js});var Ys,ji,Hi=q(()=>{c();Ot();Bi();Ys=qe("v5",80,Gi),ji=Ys});var $i,Ki=q(()=>{c();$i="00000000-0000-0000-0000-000000000000"});function Vs(e){if(!ce(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var zi,Ji=q(()=>{c();Le();s(Vs,"version");zi=Vs});var Yi={};mn(Yi,{NIL:()=>$i,parse:()=>Qe,stringify:()=>le,v1:()=>Li,v3:()=>Pi,v4:()=>Mi,v5:()=>ji,validate:()=>ce,version:()=>zi});var Vi=q(()=>{c();Oi();Ui();Wi();Hi();Ki();Ji();Le();Oe();Lt()});var Ct=F((Tf,Zi)=>{c();var Xs=E("path"),Zs=Xs.resolve(__dirname,"../vendor/snoreToast/snoretoast"),Z=de(),Qs=At(),eo=E("os"),{v4:to}=(Vi(),pn(Yi)),Xi=E("events").EventEmitter,ro=E("util"),qt,io="notifierPipe",no="\\\\.\\pipe\\",so="/tmp/";Zi.exports=Fe;function Fe(e){if(e=Z.clone(e||{}),!(this instanceof Fe))return new Fe(e);this.options=e,Xi.call(this)}s(Fe,"WindowsToaster");ro.inherits(Fe,Xi);function oo(){}s(oo,"noop");function ao(e){return e?e.split(";").reduce((t,r)=>{let i=r.split("=");return i&&i.length===2&&(t[i[0]]=i[1]),t},{}):{}}s(ao,"parseResult");function co(){return`${Z.isWSL()?so:no}${io}-${to()}`}s(co,"getPipeName");function lo(e,t){e=Z.clone(e||{}),t=t||oo;let r=eo.arch()==="x64",i,n={namedPipe:co()};if(typeof e=="string"&&(e={title:"node-notifier",message:e}),typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let o=s((l,f)=>{let u=ao(i&&i.toString("utf16le"));u.action==="buttonClicked"&&u.button?u.activationType=u.button:u.action&&(u.activationType=u.action),l&&l.code===-1&&f(l,u),f(null,u),n.instance&&n.instance.close()},"snoreToastResultParser"),a=s(l=>o(l,Z.actionJackerDecorator(this,e,t,f=>f==="activate"?"click":f||!1)),"actionJackedCallback");return e.title=e.title||"Node Notification:",typeof e.message>"u"&&typeof e.close>"u"?(t(new Error("Message or ID to close is required.")),this):!Z.isWin8()&&!Z.isWSL()&&this.options.withFallback?(qt=qt||new Qs(this.options),qt.notify(e,t)):(Z.createNamedPipe(n).then(l=>{i=l,e.pipeName=n.namedPipe;let f=e.customPath||this.options.customPath||Zs+"-x"+(r?"64":"86")+".exe";e=Z.mapToWin8(e);let u=Z.constructArgumentList(e,{explicitTrue:!0,wrapper:"",keepNewlines:!0,noEscape:!0});Z.fileCommand(f,u,a)}),this)}s(lo,"notifyRaw");Object.defineProperty(Fe.prototype,"notify",{get:s(function(){return this._notify||(this._notify=lo.bind(this)),this._notify},"get")})});var tn=F((kf,T)=>{c();var Qi=E("os"),en=de(),Pe=fi(),Ft=Ii(),Ue=Ct(),Pt=Ye(),Ut=At(),ye={withFallback:!0},fo=en.isWSL()?"WSL":Qi.type();switch(fo){case"Linux":T.exports=new Pe(ye),T.exports.Notification=Pe;break;case"Darwin":T.exports=new Ft(ye),T.exports.Notification=Ft;break;case"Windows_NT":en.isLessThanWin8()?(T.exports=new Ut(ye),T.exports.Notification=Ut):(T.exports=new Ue(ye),T.exports.Notification=Ue);break;case"WSL":T.exports=new Ue(ye),T.exports.Notification=Ue;break;default:Qi.type().match(/BSD$/)?(T.exports=new Pe(ye),T.exports.Notification=Pe):(T.exports=new Pt(ye),T.exports.Notification=Pt)}T.exports.NotifySend=Pe;T.exports.NotificationCenter=Ft;T.exports.WindowsToaster=Ue;T.exports.WindowsBalloon=Ut;T.exports.Growl=Pt});c();import uo from"node:fs";import sn from"node:path";var on=We(wn(),1),ne=We(yn(),1);c();import{EventEmitter as An}from"node:events";import yt from"node:fs";import ge from"node:path";c();import vn from"node:os";var ur=300,oe=20,Ee=1e7,hr=vn.platform();var Nn=hr==="darwin",it=hr==="win32",ae=Nn||it,dr=3e3,mr=2e4,nt=1250;c();var Y;(function(e){e[e.DIR=1]="DIR",e[e.FILE=2]="FILE"})(Y||(Y={}));var ue;(function(e){e.CHANGE="change",e.RENAME="rename"})(ue||(ue={}));var ve;(function(e){e.CHANGE="change",e.ERROR="error"})(ve||(ve={}));var y;(function(e){e.ADD="add",e.ADD_DIR="addDir",e.CHANGE="change",e.RENAME="rename",e.RENAME_DIR="renameDir",e.UNLINK="unlink",e.UNLINK_DIR="unlinkDir"})(y||(y={}));var P;(function(e){e.ALL="all",e.CLOSE="close",e.ERROR="error",e.READY="ready"})(P||(P={}));c();c();c();var Sn=s((e,t=1,r)=>{t=Math.max(1,t);let i=r?.leading??!1,n=r?.trailing??!0,o=Math.max(r?.maxWait??1/0,t),a,l,f=0,u=0,h=s(()=>{let _=Date.now(),G=_-f,se=_-u,fe=G>=t||se>=o;return[_,fe]},"getInstantData"),m=s(_=>{if(u=_,!a)return;let G=a;a=void 0,e.apply(void 0,G)},"invoke"),p=s(()=>{b(0)},"onCancel"),d=s(()=>{l&&(p(),m(Date.now()))},"onFlush"),x=s(_=>{if(u=_,i)return m(_)},"onLeading"),D=s(_=>{if(n&&a)return m(_);a=void 0},"onTrailing"),L=s(()=>{l=void 0;let[_,G]=h();return G?D(_):j(_)},"onTimeout"),j=s(_=>{let G=_-f,se=_-u,fe=t-G,Me=o-se,$=Math.min(fe,Me);return b($)},"updateTimeout"),b=s(_=>{l&&clearTimeout(l),!(_<=0)&&(l=setTimeout(L,_))},"resetTimeout"),W=s((..._)=>{let[G,se]=h(),fe=!!l;if(a=_,f=G,(se||!l)&&b(t),se)return fe?m(G):x(G)},"debounced");return W.cancel=p,W.flush=d,W},"debounce"),Be=Sn;c();import Dr from"node:fs";import ct from"node:path";c();import S from"node:fs";import{promisify as O}from"node:util";c();var ee=s((e,t)=>s(function(...i){return e.apply(void 0,i).catch(t)},"attemptified"),"attemptifyAsync"),V=s((e,t)=>s(function(...i){try{return e.apply(void 0,i)}catch(n){return t(n)}},"attemptified"),"attemptifySync");c();import pr from"node:process";var yr=pr.getuid?!pr.getuid():!1,wr=1e4,M=s(()=>{},"NOOP");c();var Ne={isChangeErrorOk:s(e=>{if(!Ne.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!yr&&(t==="EINVAL"||t==="EPERM")},"isChangeErrorOk"),isNodeError:s(e=>e instanceof Error,"isNodeError"),isRetriableError:s(e=>{if(!Ne.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},"isRetriableError"),onChangeError:s(e=>{if(!Ne.isNodeError(e))throw e;if(!Ne.isChangeErrorOk(e))throw e},"onChangeError")},A=Ne;c();c();var st=class{static{s(this,"RetryfyQueue")}constructor(){this.interval=25,this.intervalId=void 0,this.limit=wr,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=s(()=>this.remove(i),"cleanup"),i=s(()=>t(r),"resolver");this.add(i)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},gr=new st;var te=s((e,t)=>s(function(i){return s(function n(...o){return gr.schedule().then(a=>{let l=s(u=>(a(),u),"onResolve"),f=s(u=>{if(a(),Date.now()>=i)throw u;if(t(u)){let h=Math.round(100*Math.random());return new Promise(p=>setTimeout(p,h)).then(()=>n.apply(void 0,o))}throw u},"onReject");return e.apply(void 0,o).then(l,f)})},"attempt")},"retrified"),"retryifyAsync"),re=s((e,t)=>s(function(i){return s(function n(...o){try{return e.apply(void 0,o)}catch(a){if(Date.now()>i)throw a;if(t(a))return n.apply(void 0,o);throw a}},"attempt")},"retrified"),"retryifySync");var xn={attempt:{chmod:ee(O(S.chmod),A.onChangeError),chown:ee(O(S.chown),A.onChangeError),close:ee(O(S.close),M),fsync:ee(O(S.fsync),M),mkdir:ee(O(S.mkdir),M),realpath:ee(O(S.realpath),M),stat:ee(O(S.stat),M),unlink:ee(O(S.unlink),M),chmodSync:V(S.chmodSync,A.onChangeError),chownSync:V(S.chownSync,A.onChangeError),closeSync:V(S.closeSync,M),existsSync:V(S.existsSync,M),fsyncSync:V(S.fsync,M),mkdirSync:V(S.mkdirSync,M),realpathSync:V(S.realpathSync,M),statSync:V(S.statSync,M),unlinkSync:V(S.unlinkSync,M)},retry:{close:te(O(S.close),A.isRetriableError),fsync:te(O(S.fsync),A.isRetriableError),open:te(O(S.open),A.isRetriableError),readFile:te(O(S.readFile),A.isRetriableError),rename:te(O(S.rename),A.isRetriableError),stat:te(O(S.stat),A.isRetriableError),write:te(O(S.write),A.isRetriableError),writeFile:te(O(S.writeFile),A.isRetriableError),closeSync:re(S.closeSync,A.isRetriableError),fsyncSync:re(S.fsyncSync,A.isRetriableError),openSync:re(S.openSync,A.isRetriableError),readFileSync:re(S.readFileSync,A.isRetriableError),renameSync:re(S.renameSync,A.isRetriableError),statSync:re(S.statSync,A.isRetriableError),writeSync:re(S.writeSync,A.isRetriableError),writeFileSync:re(S.writeFileSync,A.isRetriableError)}},Er=xn;c();import at from"node:fs";import je from"node:path";c();c();c();var ot=s(()=>{},"noop");var _n=s(()=>{let e=ot,t=ot,r=!1,i=!1;return{promise:new Promise((f,u)=>{e=s(h=>(r=!0,f(h)),"resolve"),t=s(h=>(i=!0,u(h)),"reject")}),resolve:e,reject:t,isPending:s(()=>!r&&!i,"isPending"),isResolved:s(()=>r,"isResolved"),isRejected:s(()=>i,"isRejected")}},"makeNakedPromise"),vr=_n;var In=s(()=>{let{promise:e,resolve:t,isPending:r}=vr(),i=0,n=s(()=>{i+=1},"increment"),o=s(()=>{i-=1,!i&&t()},"decrement");return s(()=>{n(),queueMicrotask(o)},"init")(),{promise:e,isPending:r,increment:n,decrement:o}},"makeCounterPromise"),Nr=In;c();var Sr={then:s(e=>{e()},"then")};c();var xr=s(e=>Array.isArray(e)?e:[e],"castArray"),_r=s(e=>typeof e=="function","isFunction");var Dn=s((e,t)=>{let r=t?.followSymlinks??!1,i=t?.depth??1/0,n=t?.limit??1/0,o=t?.ignore??[],a=xr(o).map(v=>_r(v)?v:g=>v.test(g)),l=s((v,g)=>a.some(N=>N(v,g)),"isIgnored"),f=t?.signal??{aborted:!1},u=t?.onDirents||(()=>{}),h=[],m=new Set,p={},d=[],x=new Set,D={},L=[],j=new Set,b={},W={},_=new Set,G={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{},map:{}},se={directories:h,directoriesNames:m,directoriesNamesToPaths:p,files:d,filesNames:x,filesNamesToPaths:D,symlinks:L,symlinksNames:j,symlinksNamesToPaths:b,map:W},{promise:fe,increment:Me,decrement:$}=Nr(),Q=0,Mt=s((v,g,N,I)=>{_.has(g)||Q>=n||(Q+=1,v.directories.push(g),v.directoriesNames.add(N),h.push(g),m.add(N),p.propertyIsEnumerable(N)||(p[N]=[]),p[N].push(g),_.add(g),!(I>=i)&&(Q>=n||Bt(g,I+1)))},"handleDirectory"),Wt=s((v,g,N)=>{_.has(g)||Q>=n||(Q+=1,v.files.push(g),v.filesNames.add(N),d.push(g),x.add(N),D.propertyIsEnumerable(N)||(D[N]=[]),D[N].push(g),_.add(g))},"handleFile"),Gt=s((v,g,N,I)=>{_.has(g)||Q>=n||(Q+=1,v.symlinks.push(g),v.symlinksNames.add(N),L.push(g),j.add(N),b.propertyIsEnumerable(N)||(b[N]=[]),b[N].push(g),_.add(g),r&&(I>=i||Q>=n||hn(g,I+1)))},"handleSymlink"),cn=s((v,g,N,I,K)=>{f.aborted||l(g,I.isDirectory())||(I.isDirectory()?Mt(v,g,N,K):I.isFile()?Wt(v,g,N):I.isSymbolicLink()&&Gt(v,g,N,K))},"handleStat"),ln=s((v,g,N,I)=>{if(f.aborted)return;let K=g===je.sep?"":je.sep,J=N.name,we=`${g}${K}${J}`;l(we,N.isDirectory())||(N.isDirectory()?Mt(v,we,J,I):N.isFile()?Wt(v,we,J):N.isSymbolicLink()&&Gt(v,we,J,I))},"handleDirent"),un=s((v,g,N,I)=>{for(let K=0,J=N.length;K<J;K++)ln(v,g,N[K],I)},"handleDirents"),Bt=s((v,g)=>{f.aborted||g>i||Q>=n||(Me(),at.readdir(v,{withFileTypes:!0},(N,I)=>{if(N||f.aborted||!I.length)return $();(u(I)||Sr).then(()=>{let J=W[v]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};un(J,v,I,g),$()})}))},"populateResultFromPath"),hn=s((v,g)=>{Me(),at.realpath(v,(N,I)=>{if(N||f.aborted)return $();at.stat(I,(K,J)=>{if(K||f.aborted)return $();let we=je.basename(I),dn=W[v]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};cn(dn,I,we,J,g),$()})})},"populateResultFromSymlink");return s(async(v,g=1)=>(v=je.normalize(v),_.add(v),Bt(v,g),await fe,f.aborted?G:se),"populateResultFromRoot")(e)},"readdir"),Ir=Dn;var X={lang:{debounce:Be,attempt:s(e=>{try{return e()}catch(t){return X.lang.castError(t)}},"attempt"),castArray:s(e=>X.lang.isArray(e)?e:[e],"castArray"),castError:s(e=>X.lang.isError(e)?e:X.lang.isString(e)?new Error(e):new Error("Unknown error"),"castError"),defer:s(e=>setTimeout(e,0),"defer"),isArray:s(e=>Array.isArray(e),"isArray"),isError:s(e=>e instanceof Error,"isError"),isFunction:s(e=>typeof e=="function","isFunction"),isNaN:s(e=>Number.isNaN(e),"isNaN"),isNumber:s(e=>typeof e=="number","isNumber"),isPrimitive:s(e=>{if(e===null)return!0;let t=typeof e;return t!=="object"&&t!=="function"},"isPrimitive"),isShallowEqual:s((e,t)=>{if(e===t)return!0;if(X.lang.isNaN(e))return X.lang.isNaN(t);if(X.lang.isPrimitive(e)||X.lang.isPrimitive(t))return e===t;for(let r in e)if(!(r in t))return!1;for(let r in t)if(e[r]!==t[r])return!1;return!0},"isShallowEqual"),isSet:s(e=>e instanceof Set,"isSet"),isString:s(e=>typeof e=="string","isString"),isUndefined:s(e=>e===void 0,"isUndefined"),noop:s(()=>{},"noop"),uniq:s(e=>e.length<2?e:Array.from(new Set(e)),"uniq")},fs:{getDepth:s(e=>Math.max(0,e.split(ct.sep).length-1),"getDepth"),getRealPath:s((e,t)=>{try{return t?Dr.realpathSync.native(e):Dr.realpathSync(e)}catch{return}},"getRealPath"),isSubPath:s((e,t)=>t.startsWith(e)&&t[e.length]===ct.sep&&t.length-e.length>ct.sep.length,"isSubPath"),poll:s((e,t=mr)=>Er.retry.stat(t)(e,{bigint:!0}).catch(X.lang.noop),"poll"),readdir:s(async(e,t,r=1/0,i=1/0,n,o)=>{if(o&&r===1&&e in o){let a=o[e];return[a.directories,a.files]}else{let a=await Ir(e,{depth:r,limit:i,ignore:t,signal:n});return[a.directories,a.files]}},"readdir")}},w=X;c();import lt from"node:path";var ft=class{static{s(this,"WatcherHandler")}constructor(t,r,i){this.base=i,this.watcher=t,this.handler=r.handler,this.fswatcher=r.watcher,this.options=r.options,this.folderPath=r.folderPath,this.filePath=r.filePath,this.handlerBatched=this.base?this.base.onWatcherEvent.bind(this.base):this._makeHandlerBatched(this.options.debounce)}_isSubRoot(t){return this.filePath?t===this.filePath:t===this.folderPath||w.fs.isSubPath(this.folderPath,t)}_makeHandlerBatched(t=ur){return(()=>{let r=this.watcher._readyWait,i=[],n=new Set,o=s(async(l,f)=>{let u=this.options.ignoreInitial?[]:l,h=await this.eventsPopulate([...f]),m=this.eventsDeduplicate([...u,...h]);this.onTargetEvents(m)},"flush"),a=w.lang.debounce(()=>{this.watcher.isClosed()||(r=o(i,n),i=[],n=new Set)},t);return async(l,f="",u=!1)=>{u?await this.eventsPopulate([f],i,!0):n.add(f),r.then(a)}})()}eventsDeduplicate(t){if(t.length<2)return t;let r={};return t.reduce((i,n)=>{let[o,a]=n,l=r[a];return o===l||o===y.CHANGE&&l===y.ADD||(r[a]=o,i.push(n)),i},[])}async eventsPopulate(t,r=[],i=!1){return await Promise.all(t.map(async n=>{let o=await this.watcher._poller.update(n,this.options.pollingTimeout);await Promise.all(o.map(async a=>{r.push([a,n]),a===y.ADD_DIR?await this.eventsPopulateAddDir(t,n,r,i):a===y.UNLINK_DIR&&await this.eventsPopulateUnlinkDir(t,n,r,i)}))})),r}async eventsPopulateAddDir(t,r,i=[],n=!1){if(n)return i;let o=this.options.recursive?this.options.depth??oe:Math.min(1,this.options.depth??oe),a=this.options.limit??Ee,[l,f]=await w.fs.readdir(r,this.options.ignore,o,a,this.watcher._closeSignal),u=new Set(l),h=[...l,...f];return await Promise.all(h.map(m=>{if(!this.watcher.isIgnored(m,this.options.ignore,u.has(m))&&!t.includes(m))return this.eventsPopulate([m],i,!0)})),i}async eventsPopulateUnlinkDir(t,r,i=[],n=!1){if(n)return i;for(let o of this.watcher._poller.stats.keys())w.fs.isSubPath(r,o)&&(t.includes(o)||await this.eventsPopulate([o],i,!0));return i}onTargetAdd(t){this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAdd(t,this.options.renameTimeout):this.watcher.event(y.ADD,t))}onTargetAddDir(t){t!==this.folderPath&&this.options.recursive&&!ae&&this.options.native!==!1&&this.watcher.watchDirectory(t,this.options,this.handler,void 0,this.base||this),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAddDir(t,this.options.renameTimeout):this.watcher.event(y.ADD_DIR,t))}onTargetChange(t){this._isSubRoot(t)&&this.watcher.event(y.CHANGE,t)}onTargetUnlink(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlink(t,this.options.renameTimeout):this.watcher.event(y.UNLINK,t))}onTargetUnlinkDir(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this.watcher.watchersClose(t),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlinkDir(t,this.options.renameTimeout):this.watcher.event(y.UNLINK_DIR,t))}onTargetEvent(t){let[r,i]=t;r===y.ADD?this.onTargetAdd(i):r===y.ADD_DIR?this.onTargetAddDir(i):r===y.CHANGE?this.onTargetChange(i):r===y.UNLINK?this.onTargetUnlink(i):r===y.UNLINK_DIR&&this.onTargetUnlinkDir(i)}onTargetEvents(t){for(let r of t)this.onTargetEvent(r)}onWatcherEvent(t,r,i=!1){return this.handlerBatched(t,r,i)}onWatcherChange(t=ue.CHANGE,r){if(this.watcher.isClosed())return;let i=lt.resolve(this.folderPath,r||"");this.filePath&&i!==this.folderPath&&i!==this.filePath||this.watcher.isIgnored(i,this.options.ignore)||this.onWatcherEvent(t,i)}onWatcherError(t){it&&t.code==="EPERM"?this.onWatcherChange(ue.CHANGE,""):this.watcher.error(t)}async init(){await this.initWatcherEvents(),await this.initInitialEvents()}async initWatcherEvents(){let t=this.onWatcherChange.bind(this);this.fswatcher.on(ve.CHANGE,t);let r=this.onWatcherError.bind(this);this.fswatcher.on(ve.ERROR,r)}async initInitialEvents(){let t=!this.watcher.isReady();if(this.filePath){if(this.watcher._poller.stats.has(this.filePath))return;await this.onWatcherEvent(ue.CHANGE,this.filePath,t)}else{let r=this.options.recursive&&ae&&this.options.native!==!1?this.options.depth??oe:Math.min(1,this.options.depth??oe),i=this.options.limit??Ee,[n,o]=await w.fs.readdir(this.folderPath,this.options.ignore,r,i,this.watcher._closeSignal,this.options.readdirMap),a=new Set(n);a.add(this.folderPath);let l=[this.folderPath,...n,...o];await Promise.all(l.map(f=>{if(!this.watcher._poller.stats.has(f)&&!this.watcher.isIgnored(f,this.options.ignore,a.has(f)))return this.onWatcherEvent(ue.CHANGE,f,t)}))}}},Ar=ft;c();c();var U={interval:100,intervalId:void 0,fns:new Map,init:s(()=>{U.intervalId||(U.intervalId=setInterval(U.resolve,U.interval))},"init"),reset:s(()=>{U.intervalId&&(clearInterval(U.intervalId),delete U.intervalId)},"reset"),add:s((e,t)=>{U.fns.set(e,Date.now()+t),U.init()},"add"),remove:s(e=>{U.fns.delete(e)},"remove"),resolve:s(()=>{if(!U.fns.size)return U.reset();let e=Date.now();for(let[t,r]of U.fns)r>=e||(U.remove(t),t())},"resolve")},Se=U;var xe=class e{static{s(this,"WatcherLocker")}constructor(t){this._watcher=t,this.reset()}getLockAdd(t,r=nt){let{ino:i,targetPath:n,events:o,locks:a}=t,l=s(()=>{let m=this._watcher._poller.paths.find(i||-1,p=>p!==n);if(m&&m!==n){if(w.fs.getRealPath(n,!0)===m)return;this._watcher.event(o.rename,m,n)}else this._watcher.event(o.add,n)},"emit");if(!i)return l();let f=s(()=>{a.add.delete(i),Se.remove(u)},"cleanup"),u=s(()=>{f(),l()},"free");Se.add(u,r);let h=s(()=>{let m=a.unlink.get(i);if(!m)return;f();let p=m();n===p?o.change&&this._watcher._poller.stats.has(n)&&this._watcher.event(o.change,n):this._watcher.event(o.rename,p,n)},"resolve");a.add.set(i,h),h()}getLockUnlink(t,r=nt){let{ino:i,targetPath:n,events:o,locks:a}=t,l=s(()=>{this._watcher.event(o.unlink,n)},"emit");if(!i)return l();let f=s(()=>{a.unlink.delete(i),Se.remove(u)},"cleanup"),u=s(()=>{f(),l()},"free");Se.add(u,r);let h=s(()=>(f(),n),"overridden");a.unlink.set(i,h),a.add.get(i)?.()}getLockTargetAdd(t,r){let i=this._watcher._poller.getIno(t,y.ADD,Y.FILE);return this.getLockAdd({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetAddDir(t,r){let i=this._watcher._poller.getIno(t,y.ADD_DIR,Y.DIR);return this.getLockAdd({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}getLockTargetUnlink(t,r){let i=this._watcher._poller.getIno(t,y.UNLINK,Y.FILE);return this.getLockUnlink({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetUnlinkDir(t,r){let i=this._watcher._poller.getIno(t,y.UNLINK_DIR,Y.DIR);return this.getLockUnlink({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}reset(){this._locksAdd=new Map,this._locksAddDir=new Map,this._locksUnlink=new Map,this._locksUnlinkDir=new Map,this._locksDir={add:this._locksAddDir,unlink:this._locksUnlinkDir},this._locksFile={add:this._locksAdd,unlink:this._locksUnlink}}};xe.DIR_EVENTS={add:y.ADD_DIR,rename:y.RENAME_DIR,unlink:y.UNLINK_DIR};xe.FILE_EVENTS={add:y.ADD,change:y.CHANGE,rename:y.RENAME,unlink:y.UNLINK};var Cr=xe;c();c();var ut=class{static{s(this,"LazyMapSet")}constructor(){this.map=new Map}clear(){this.map.clear()}delete(t,r){if(w.lang.isUndefined(r))return this.map.delete(t);if(this.map.has(t)){let i=this.map.get(t);if(w.lang.isSet(i)){let n=i.delete(r);return i.size||this.map.delete(t),n}else if(i===r)return this.map.delete(t),!0}return!1}find(t,r){if(this.map.has(t)){let i=this.map.get(t);if(w.lang.isSet(i))return Array.from(i).find(r);if(r(i))return i}}get(t){return this.map.get(t)}has(t,r){if(w.lang.isUndefined(r))return this.map.has(t);if(this.map.has(t)){let i=this.map.get(t);return w.lang.isSet(i)?i.has(r):i===r}return!1}set(t,r){if(this.map.has(t)){let i=this.map.get(t);w.lang.isSet(i)?i.add(r):i!==r&&this.map.set(t,new Set([i,r]))}else this.map.set(t,r);return this}},ht=ut;c();var dt=class{static{s(this,"WatcherStats")}constructor(t){this.ino=t.ino<=Number.MAX_SAFE_INTEGER?Number(t.ino):t.ino,this.size=Number(t.size),this.atimeMs=Number(t.atimeMs),this.mtimeMs=Number(t.mtimeMs),this.ctimeMs=Number(t.ctimeMs),this.birthtimeMs=Number(t.birthtimeMs),this._isFile=t.isFile(),this._isDirectory=t.isDirectory(),this._isSymbolicLink=t.isSymbolicLink()}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}},Tr=dt;var mt=class{static{s(this,"WatcherPoller")}constructor(){this.inos={},this.paths=new ht,this.stats=new Map}getIno(t,r,i){let n=this.inos[r];if(!n)return;let o=n[t];if(o&&!(i&&o[1]!==i))return o[0]}getStats(t){return this.stats.get(t)}async poll(t,r){let i=await w.fs.poll(t,r);if(!(!i||!(i.isFile()||i.isDirectory())))return new Tr(i)}reset(){this.inos={},this.paths=new ht,this.stats=new Map}async update(t,r){let i=this.getStats(t),n=await this.poll(t,r);if(this.updateStats(t,n),!i&&n){if(n.isFile())return this.updateIno(t,y.ADD,n),[y.ADD];if(n.isDirectory())return this.updateIno(t,y.ADD_DIR,n),[y.ADD_DIR]}else if(i&&!n){if(i.isFile())return this.updateIno(t,y.UNLINK,i),[y.UNLINK];if(i.isDirectory())return this.updateIno(t,y.UNLINK_DIR,i),[y.UNLINK_DIR]}else if(i&&n){if(i.isFile()){if(n.isFile())return i.ino===n.ino&&!i.size&&!n.size?[]:(this.updateIno(t,y.CHANGE,n),[y.CHANGE]);if(n.isDirectory())return this.updateIno(t,y.UNLINK,i),this.updateIno(t,y.ADD_DIR,n),[y.UNLINK,y.ADD_DIR]}else if(i.isDirectory()){if(n.isFile())return this.updateIno(t,y.UNLINK_DIR,i),this.updateIno(t,y.ADD,n),[y.UNLINK_DIR,y.ADD];if(n.isDirectory())return i.ino===n.ino?[]:(this.updateIno(t,y.UNLINK_DIR,i),this.updateIno(t,y.ADD_DIR,n),[y.UNLINK_DIR,y.ADD_DIR])}}return[]}updateIno(t,r,i){let n=this.inos[r]=this.inos[r]||(this.inos[r]={}),o=i.isFile()?Y.FILE:Y.DIR;n[t]=[i.ino,o]}updateStats(t,r){if(r)this.paths.set(r.ino,t),this.stats.set(t,r);else{let i=this.stats.get(t)?.ino||-1;this.paths.delete(i,t),this.stats.delete(t)}}},pt=mt;var wt=class e extends An{static{s(this,"Watcher")}constructor(t,r,i){super(),this._closed=!1,this._ready=!1,this._closeAborter=new AbortController,this._closeSignal=this._closeAborter.signal,this.on(P.CLOSE,()=>this._closeAborter.abort()),this._closeWait=new Promise(n=>this.on(P.CLOSE,n)),this._readyWait=new Promise(n=>this.on(P.READY,n)),this._locker=new Cr(this),this._roots=new Set,this._poller=new pt,this._pollers=new Set,this._subwatchers=new Set,this._watchers={},this._watchersLock=Promise.resolve(),this._watchersRestorable={},this.watch(t,r,i)}isClosed(){return this._closed}isIgnored(t,r,i){return!!r&&(w.lang.isFunction(r)?!!r(t,i):r.test(t))}isReady(){return this._ready}close(){return this._locker.reset(),this._poller.reset(),this._roots.clear(),this.watchersClose(),this.isClosed()?!1:(this._closed=!0,this.emit(P.CLOSE))}error(t){if(this.isClosed())return!1;let r=w.lang.castError(t);return this.emit(P.ERROR,r)}event(t,r,i){return this.isClosed()?!1:(this.emit(P.ALL,t,r,i),this.emit(t,r,i))}ready(){return this.isClosed()||this.isReady()?!1:(this._ready=!0,this.emit(P.READY))}pollerExists(t,r){for(let i of this._pollers)if(i.targetPath===t&&w.lang.isShallowEqual(i.options,r))return!0;return!1}subwatcherExists(t,r){for(let i of this._subwatchers)if(i.targetPath===t&&w.lang.isShallowEqual(i.options,r))return!0;return!1}watchersClose(t,r,i=!0){if(t){let n=this._watchers[t];if(n)for(let o of[...n])r&&o.filePath!==r||this.watcherClose(o);if(i)for(let o in this._watchers)w.fs.isSubPath(t,o)&&this.watchersClose(o,r,!1)}else for(let n in this._watchers)this.watchersClose(n,r,!1)}watchersLock(t){return this._watchersLock.then(()=>this._watchersLock=new Promise(async r=>{await t(),r()}))}watchersRestore(){delete this._watchersRestoreTimeout;let t=Object.entries(this._watchersRestorable);this._watchersRestorable={};for(let[r,i]of t)this.watchPath(r,i.options,i.handler)}async watcherAdd(t,r){let{folderPath:i}=t;(this._watchers[i]=this._watchers[i]||[]).push(t);let o=new Ar(this,t,r);return await o.init(),o}watcherClose(t){t.watcher.close();let r=this._watchers[t.folderPath];if(r){let o=r.indexOf(t);r.splice(o,1),r.length||delete this._watchers[t.folderPath]}let i=t.filePath||t.folderPath;this._roots.has(i)&&(this._watchersRestorable[i]=t,this._watchersRestoreTimeout||(this._watchersRestoreTimeout=w.lang.defer(()=>this.watchersRestore())))}watcherExists(t,r,i,n){if(this._watchers[t]?.find(l=>l.handler===i&&(!l.filePath||l.filePath===n)&&l.options.ignore===r.ignore&&!!l.options.native==!!r.native&&(!r.recursive||l.options.recursive)))return!0;let a=ge.dirname(t);for(let l=1;l<1/0;l++){if(this._watchers[a]?.find(h=>(l===1||h.options.recursive&&l<=(h.options.depth??oe))&&h.handler===i&&(!h.filePath||h.filePath===n)&&h.options.ignore===r.ignore&&!!h.options.native==!!r.native&&(!r.recursive||h.options.recursive&&ae&&h.options.native!==!1)))return!0;if(!ae)break;let u=ge.dirname(t);if(a===u)break;a=u}return!1}async watchDirectories(t,r,i,n,o){if(this.isClosed())return;t=w.lang.uniq(t).sort();let a;for(let l of t)if(!this.isIgnored(l,r.ignore,!0)&&!this.watcherExists(l,r,i,n))try{let f=!r.recursive||ae&&r.native!==!1?r:{...r,recursive:!1},h={watcher:yt.watch(l,f),handler:i,options:r,folderPath:l,filePath:n},m=a=await this.watcherAdd(h,o);if(this._roots.has(n||l)){let d={...r,ignoreInitial:!0,recursive:!1},x=ge.dirname(l),D=l;await this.watchDirectories([x],d,i,D,m)}}catch(f){this.error(f)}return a}async watchDirectory(t,r,i,n,o){if(!this.isClosed()&&!this.isIgnored(t,r.ignore,!0)){if(!r.recursive||ae&&r.native!==!1)return this.watchersLock(()=>this.watchDirectories([t],r,i,n,o));{r={...r,recursive:!0};let a=r.depth??oe,l=r.limit??Ee,[f]=await w.fs.readdir(t,r.ignore,a,l,this._closeSignal,r.readdirMap);return this.watchersLock(async()=>{let u=await this.watchDirectories([t],r,i,n,o);if(f.length){let h=w.fs.getDepth(t);for(let m of f){let p=w.fs.getDepth(m),d=Math.max(0,a-(p-h)),x={...r,depth:d};await this.watchDirectories([m],x,i,n,o||u)}}})}}}async watchFileOnce(t,r,i){if(this.isClosed()||(r={...r,ignoreInitial:!1},this.subwatcherExists(t,r)))return;let n={targetPath:t,options:r},o=s((u,h)=>{h===t&&(f(),i())},"handler"),a=new e(o),l=s(()=>{this._subwatchers.add(n),this.on(P.CLOSE,f),a.watchFile(t,r,o)},"start"),f=s(()=>{this._subwatchers.delete(n),this.removeListener(P.CLOSE,f),a.close()},"stop");return l()}async watchFile(t,r,i){if(this.isClosed()||this.isIgnored(t,r.ignore,!1))return;r={...r,recursive:!1};let n=ge.dirname(t);return this.watchDirectory(n,r,i,t)}async watchPollingOnce(t,r,i){if(this.isClosed())return;let n=!1,o=new pt,a=await this.watchPolling(t,r,async()=>{n||!(await o.update(t,r.pollingTimeout)).length||n||(n=!0,a(),i())})}async watchPolling(t,r,i){if(this.isClosed())return w.lang.noop;if(this.pollerExists(t,r))return w.lang.noop;let n={...r,interval:r.pollingInterval??dr},o={targetPath:t,options:r},a=s(()=>{this._pollers.add(o),this.on(P.CLOSE,l),yt.watchFile(t,n,i)},"start"),l=s(()=>{this._pollers.delete(o),this.removeListener(P.CLOSE,l),yt.unwatchFile(t,i)},"stop");return w.lang.attempt(a),()=>w.lang.attempt(l)}async watchUnknownChild(t,r,i){if(this.isClosed())return;let n=s(()=>this.watchPath(t,r,i),"watch");return this.watchFileOnce(t,r,n)}async watchUnknownTarget(t,r,i){if(this.isClosed())return;let n=s(()=>this.watchPath(t,r,i),"watch");return this.watchPollingOnce(t,r,n)}async watchPaths(t,r,i){if(this.isClosed())return;if(t=w.lang.uniq(t).sort(),t.every((o,a)=>t.every((l,f)=>f===a||!w.fs.isSubPath(o,l))))await Promise.all(t.map(o=>this.watchPath(o,r,i)));else for(let o of t)await this.watchPath(o,r,i)}async watchPath(t,r,i){if(this.isClosed()||(t=ge.resolve(t),this.isIgnored(t,r.ignore)))return;let n=await w.fs.poll(t,r.pollingTimeout);if(n){if(n.isFile())return this.watchFile(t,r,i);if(n.isDirectory())return this.watchDirectory(t,r,i);this.error(`"${t}" is not supported`)}else{let o=ge.dirname(t);return(await w.fs.poll(o,r.pollingTimeout))?.isDirectory()?this.watchUnknownChild(t,r,i):this.watchUnknownTarget(t,r,i)}}async watch(t,r,i=w.lang.noop){if(w.lang.isFunction(t))return this.watch([],{},t);if(w.lang.isUndefined(t))return this.watch([],r,i);if(w.lang.isFunction(r))return this.watch(t,{},r);if(w.lang.isUndefined(r))return this.watch(t,{},i);if(this.isClosed())return;this.isReady()&&(r.readdirMap=void 0);let n=w.lang.castArray(t);n.forEach(o=>this._roots.add(o)),await this.watchPaths(n,r,i),!this.isClosed()&&(i!==w.lang.noop&&this.on(P.ALL,i),r.readdirMap=void 0,this.ready())}},Rr=wt;var an=We(Kr(),1);c();var Et=s(((e,...t)=>{let r=Kt(e,...t);Ge.isInteractive?Ge.updateFooter(r):Ge.writeStdout(r)}),"footer");c();var rn=We(tn(),1);var nn=s((e,t)=>{e.log.info("notifying user",{notification:t}),rn.default.notify({title:"Gadget",contentImage:et("favicon-128@4x.png"),icon:et("favicon-128@4x.png"),sound:!0,timeout:!1,...t},r=>{r&&e.log.warn("error notifying user",{notification:t})})},"notify");var fu={...nr,...Qt,"--prefer":ir,"--file-push-delay":{type:Number,default:(0,ne.default)("100ms")},"--file-watch-debounce":{type:Number,default:(0,ne.default)("300ms")},"--file-watch-poll-interval":{type:Number,default:(0,ne.default)("3s")},"--file-watch-poll-timeout":{type:Number,default:(0,ne.default)("20s")},"--file-watch-rename-timeout":{type:Number,default:(0,ne.default)("1.25s")},"--no-logs":Boolean},uu=s(e=>H`
4
- Clones your Gadget environment's files to your local machine and keeps it in sync, in order to
5
- enable local development with your text editor and source code with Git.
6
-
7
- If your app's local directory already exists, this command first performs a sync to ensure
8
- that your local and environment directories match, changes are tracked since last sync. If any
9
- conflicts are detected, they must be resolved before development starts.
10
-
11
- {gray Usage}
12
- $ ggt dev [DIRECTORY] [options]
13
-
14
- DIRECTORY: The directory to sync files to (default: the current directory)
15
-
16
- {gray Options}
17
- -a, --app <app_name> Selects the app to sync files with. Defaults to the app synced to the current directory, if there is one.
18
- -e, --env <env_name> Selects the environment to sync files with. Defaults to the environment synced to the current directory, if there is one.
19
- --prefer <source> Auto-select changes from 'local' or 'environment' source on conflict
20
- --allow-unknown-directory Syncs to any local directory with existing files, even if the directory hasn't been synced before
21
- --allow-different-app Syncs with a different app using the --app command, instead of the most recently synced one in the current directory
22
- --log-level <level> Sets the log level for incoming application logs (default: info)
23
- --no-logs Disables outputting application logs to the console
24
- --my-logs Only outputs user sourced logs
25
-
26
- {gray Ignoring files}
27
- ggt dev uses a .ignore file, similar to .gitignore, to exclude specific files and
28
- folders from syncing. These files are always ignored:
29
-
30
- • .DS_Store
31
- • .gadget
32
- • .git
33
- • node_modules
34
- • .shopify
35
-
36
- {gray Notes}
37
- • "ggt dev" only works with development environments
38
- • "ggt dev" only supports "yarn" v1 for installing dependencies
39
- • Avoid deleting or moving all of your files while "ggt dev" is running
40
-
41
- {gray Examples}
42
- sync an app in a custom path
43
- {cyanBright $ ggt dev ~/myGadgetApps/myBlog --app myBlogApp}
44
-
45
- sync with a specific environment and preselect all local changes on conflicts
46
- {cyanBright $ ggt dev --env main --prefer local}
47
-
48
- sync a custom path with a specific app, environment and preselect all changes from local on conflicts
49
- {cyanBright $ ggt dev ~/gadget/example --app=example --env=development --prefer=local}
50
- `,"usage"),hu=s(async(e,t)=>{if(!await(0,an.default)("yarn",{nothrow:!0}))throw new Zt;let r=await or(t._[0]||process.cwd()),i=await sr.loadOrAskAndInit(e,{command:"dev",args:t,directory:r});await Vt(r),e.onAbort(async()=>{await Xt(r)}),await lr({ctx:e,directory:i.directory}),await fr({ctx:e,directory:i.directory}),Et({ensureEmptyLineAbove:!0,content:i.sprint()});let n=new ar(i),o=await n.hashes(e);if(!o.inSync)if(!i.previousEnvironment||o.localChangesToPush.size===0&&o.onlyDotGadgetFilesChanged)await n.merge(e,{hashes:o,printLocalChangesOptions:{limit:5},printEnvironmentChangesOptions:{limit:5}});else{await n.print(e,{hashes:o});let d=Object.values(z);switch(await tr({ensureEmptyLineAbove:!0,choices:o.bothChanged?d:d.filter(D=>D!==z.MERGE),content:jt.bold("What do you want to do?"),formatChoice:s(D=>{switch(D){case z.CANCEL:return H`Cancel (Ctrl+C)`;case z.MERGE:return H`Merge local and environment's changes`;case z.PUSH:switch(!0){case o.bothChanged:return H`Push local changes and {underline discard environment's} changes`;case o.localChanges.size>0:return H`Push local changes`;case o.environmentChanges.size>0:return H`Discard environment's changes`;default:return rt("no changes to push or discard")}case z.PULL:switch(!0){case o.bothChanged:return H`Pull environment's changes and {underline discard local} changes`;case o.localChanges.size>0:return H`Discard local changes`;case o.environmentChanges.size>0:return H`Pull environment's changes`;default:return rt("no changes to pull or discard")}}},"formatChoice")})){case z.CANCEL:process.exit(0);break;case z.MERGE:await n.merge(e,{hashes:o});break;case z.PUSH:await n.push(e,{command:"dev",hashes:o});break;case z.PULL:await n.pull(e,{hashes:o,force:!0});break}}let a=new Map,l=setInterval(()=>{for(let[d,x]of a)(0,on.default)().isAfter(x+(0,ne.default)("5s"))&&a.delete(d)},(0,ne.default)("1s")).unref(),f=n.subscribeToEnvironmentChanges(e,{onError:s(d=>e.abort(d),"onError"),beforeChanges:s(({changed:d,deleted:x})=>{for(let D of[...d,...x]){a.set(D,Date.now());let L=sn.dirname(D);for(;L!==".";)a.set(L+"/",Date.now()),L=sn.dirname(L)}},"beforeChanges")}),u;t["--no-logs"]||(u=cr(i.edit,t,{onError:s(d=>{e.abort(d)},"onError")}));let h=new tt,m=$t(t["--file-push-delay"],async()=>{try{let d=i.gitBranch;if(await i.loadGitBranch(),d!==i.gitBranch){zt({ensureEmptyLineAbove:!0,content:H`
51
- Your git branch changed.
52
-
53
- ${d} → ${i.gitBranch}
54
- `});let D=rr({ensureEmptyLineAbove:!0,content:"Waiting for file changes to settle."});await er("3s"),D.succeed()}let x=new tt(h.entries());h.clear(),await n.mergeChangesWithEnvironment(e,{changes:x})}catch(d){e.log.error("error sending changes to gadget",{error:d}),e.abort(d)}});e.log.debug("watching",{path:i.directory.path});let p=new Rr(i.directory.path,{ignoreInitial:!0,recursive:!0,ignore:s((d,x)=>{if(i.directory.relative(d).startsWith(".gadget"))return!0;if(x===void 0)try{x=uo.statSync(d).isDirectory()}catch{x=!1}return i.directory.ignores(d,x)},"ignore"),renameDetection:!0,renameTimeout:t["--file-watch-rename-timeout"],debounce:t["--file-watch-debounce"]},(d,x,D)=>{let L=d==="rename"||d==="renameDir"?D:x,j=d==="renameDir"||d==="addDir"||d==="unlinkDir",b=i.directory.normalize(L,j);if(e.log.trace("file event",{event:d,isDirectory:j,path:b}),a.delete(b)){e.log.trace("ignoring event because we caused it",{event:d,path:b});return}if(L===i.directory.absolute(".ignore"))i.directory.ignoreFileLoadedWithin((0,ne.default)("2s"))||i.directory.loadIgnoreFile().catch(W=>e.abort(W));else if(i.directory.ignores(L,j))return;switch(d){case"add":case"addDir":h.set(b,{type:"create"});break;case"rename":case"renameDir":{let W=i.directory.normalize(x,j);h.set(b,{type:"create",oldPath:W});break}case"change":{h.set(b,{type:"update"});break}case"unlink":case"unlinkDir":{h.set(b,{type:"delete"});break}}m()}).once("error",d=>e.abort(d));e.onAbort(async d=>{e.log.info("stopping",{reason:d}),u?.unsubscribe(),f.unsubscribe(),p.close(),clearInterval(l),await m.flush();try{await n.idle()}catch(x){e.log.error("error while waiting for idle",{error:x})}Ht(d)||(nn(e,{subtitle:"Uh oh!",message:"An error occurred while syncing files"}),await Jt(e,d))}),Et({ensureEmptyLineAbove:!0,content:H`
55
- ${i.sprint({indent:4})}
56
-
57
- Waiting for file changes${Yt.ellipsis} {gray Press Ctrl+C to stop}
58
- `})},"run");export{fu as args,hu as run,uu as usage};
59
- //# sourceMappingURL=dev-Y2GLI7EH.js.map