zen-code 5.0.0 → 5.0.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 (94) hide show
  1. package/dist/app.js +3 -3
  2. package/dist/{chunk-6saqxa3z.js → chunk-0p3df51n.js} +1 -1
  3. package/dist/{chunk-78ksrp8v.js → chunk-0pzpg2ra.js} +2 -2
  4. package/dist/{chunk-tbav8trq.js → chunk-142wmdx8.js} +1 -1
  5. package/dist/chunk-1t3rabge.js +1 -0
  6. package/dist/{chunk-bn077sjq.js → chunk-2z45fjmt.js} +51 -51
  7. package/dist/{chunk-6b3vfr39.js → chunk-3gn0c0j2.js} +1 -1
  8. package/dist/{chunk-9zcr1qh6.js → chunk-3nhw50tg.js} +1 -1
  9. package/dist/{chunk-yfjs6pf8.js → chunk-4260bzp9.js} +1 -1
  10. package/dist/{chunk-agevsn2e.js → chunk-4vh3dxeg.js} +1 -1
  11. package/dist/{chunk-cb0f54ar.js → chunk-5e2s5jvw.js} +1 -1
  12. package/dist/{chunk-1rcc9xzn.js → chunk-5kcxxes1.js} +1 -1
  13. package/dist/{chunk-5fe27s34.js → chunk-6t0qzren.js} +1 -1
  14. package/dist/{chunk-7qba2raw.js → chunk-74k5n8f5.js} +1 -1
  15. package/dist/chunk-780j97nd.js +1 -0
  16. package/dist/chunk-78t2g3ht.js +1 -0
  17. package/dist/{chunk-7cx9kda0.js → chunk-7d48d71t.js} +1 -1
  18. package/dist/{chunk-ctqtahz4.js → chunk-96b00ygr.js} +1 -1
  19. package/dist/{chunk-v0e9bsvt.js → chunk-9kbktaf8.js} +2 -2
  20. package/dist/{chunk-kgc6ws03.js → chunk-a4rvf135.js} +1 -1
  21. package/dist/{chunk-81b2s97q.js → chunk-ahsvdb98.js} +1 -1
  22. package/dist/{chunk-gphssgy6.js → chunk-an34z8wv.js} +1 -1
  23. package/dist/chunk-arm90pny.js +1 -0
  24. package/dist/{chunk-jd1razfg.js → chunk-avqzptcg.js} +2 -2
  25. package/dist/{chunk-pgnhcznr.js → chunk-b0yk07x5.js} +1 -1
  26. package/dist/{chunk-1gssqf6g.js → chunk-be8n8w26.js} +1 -1
  27. package/dist/{chunk-h7ypcqp3.js → chunk-bqkrynm6.js} +2 -2
  28. package/dist/chunk-bv28r5cf.js +1 -0
  29. package/dist/{chunk-0qz8rr2k.js → chunk-c59eqb10.js} +1 -1
  30. package/dist/{chunk-6j695pam.js → chunk-cbr2vrpt.js} +1 -1
  31. package/dist/{chunk-9011y634.js → chunk-csn4vg3d.js} +2 -2
  32. package/dist/{chunk-nt2yp4jh.js → chunk-df36fv24.js} +1 -1
  33. package/dist/{chunk-sv0k2v66.js → chunk-e3jv1c1w.js} +1 -1
  34. package/dist/{chunk-069q9hkz.js → chunk-e6m161vn.js} +1 -1
  35. package/dist/{chunk-dz9sqfph.js → chunk-eqetcfer.js} +1 -1
  36. package/dist/{chunk-492hjs9k.js → chunk-eze2fzrq.js} +1 -1
  37. package/dist/{chunk-qfa5v4n5.js → chunk-femf7e4d.js} +1 -1
  38. package/dist/{chunk-d2sr8fnm.js → chunk-fvg6pct8.js} +1 -1
  39. package/dist/{chunk-bk32cwxa.js → chunk-g2n6hnjp.js} +2 -2
  40. package/dist/{chunk-mv5m8bf4.js → chunk-ge071wp4.js} +2 -2
  41. package/dist/{chunk-mv8a5svx.js → chunk-h9w6y105.js} +1 -1
  42. package/dist/{chunk-e7mbewmw.js → chunk-hzxg9kx6.js} +1 -1
  43. package/dist/{chunk-q8zsxwd8.js → chunk-j2qd9mfs.js} +2 -2
  44. package/dist/{chunk-1d47g6nc.js → chunk-j40cj742.js} +1 -1
  45. package/dist/chunk-jbqqb1ht.js +2 -0
  46. package/dist/{chunk-zhqdp4ak.js → chunk-jz0kw4yt.js} +1 -1
  47. package/dist/{chunk-fkt5b511.js → chunk-kknfcsyy.js} +1 -1
  48. package/dist/{chunk-b175s7dm.js → chunk-kvnw06wg.js} +1 -1
  49. package/dist/{chunk-a0nr8jva.js → chunk-kyb15dg8.js} +1 -1
  50. package/dist/{chunk-snmkgfbe.js → chunk-mq4m1w4w.js} +1 -1
  51. package/dist/{chunk-tmyzfvsy.js → chunk-mqcbjght.js} +1 -1
  52. package/dist/{chunk-4eaqmt3c.js → chunk-mqm8wnc8.js} +1 -1
  53. package/dist/{chunk-h2hk7vx4.js → chunk-n7bpjcb0.js} +1 -1
  54. package/dist/{chunk-88w3txtb.js → chunk-ncaqgas1.js} +1 -1
  55. package/dist/{chunk-y524zd2h.js → chunk-nh11afw0.js} +1 -1
  56. package/dist/{chunk-2gprcgep.js → chunk-nwmvyez4.js} +2 -2
  57. package/dist/{chunk-3k3c686f.js → chunk-nzyvqxt4.js} +1 -1
  58. package/dist/{chunk-j8tq0e8m.js → chunk-p6c1xbd5.js} +2 -2
  59. package/dist/chunk-p75m7q2h.js +1 -0
  60. package/dist/{chunk-b0beqmg2.js → chunk-pffdbhs6.js} +1 -1
  61. package/dist/{chunk-em03xqy9.js → chunk-phw7yp5t.js} +1 -1
  62. package/dist/{chunk-akc3s5aw.js → chunk-q0452p0f.js} +1 -1
  63. package/dist/{chunk-jhxvctg5.js → chunk-r133z8tq.js} +1 -1
  64. package/dist/{chunk-c9yrpb3g.js → chunk-rqymdmqg.js} +3 -3
  65. package/dist/{chunk-ts4jreym.js → chunk-rr7h6wdp.js} +1 -1
  66. package/dist/{chunk-wd6s7gg7.js → chunk-s04zfe57.js} +1 -1
  67. package/dist/{chunk-kada5fyh.js → chunk-twhnh3dc.js} +1 -1
  68. package/dist/{chunk-d5gzkkgg.js → chunk-txnezkkt.js} +1 -1
  69. package/dist/{chunk-2bjeg40f.js → chunk-vttq7sqg.js} +1 -1
  70. package/dist/{chunk-0mq8786q.js → chunk-vvs5da2x.js} +2 -2
  71. package/dist/{chunk-5hqvapp1.js → chunk-w4tbr5h7.js} +1 -1
  72. package/dist/{chunk-yejgw2hm.js → chunk-wts8db9p.js} +1 -1
  73. package/dist/{chunk-4fs853nh.js → chunk-x17jyjan.js} +1 -1
  74. package/dist/{chunk-q8cfxky4.js → chunk-x7x7esvz.js} +2 -2
  75. package/dist/{chunk-mk8ggmt8.js → chunk-xprg4hxp.js} +6 -6
  76. package/dist/{chunk-ss4bh5wb.js → chunk-xrfpz1vw.js} +1 -1
  77. package/dist/{chunk-yb71zqvt.js → chunk-xtr6s7kh.js} +2 -2
  78. package/dist/{chunk-dh2f4xyb.js → chunk-y807k0kw.js} +1 -1
  79. package/dist/{chunk-43h0n2td.js → chunk-ycp2e43r.js} +1 -1
  80. package/dist/{chunk-n61yv4t5.js → chunk-yfv1xeeh.js} +1 -1
  81. package/dist/chunk-zxpb45tb.js +1 -0
  82. package/dist/cli.js +1 -1
  83. package/dist/nonInteractive.js +1 -1
  84. package/dist/zen-core.js +11 -394
  85. package/dist/zen-keyboard.js +1 -1
  86. package/package.json +1 -1
  87. package/dist/chunk-06trk066.js +0 -1
  88. package/dist/chunk-0kfw8bwn.js +0 -2
  89. package/dist/chunk-8ygdre0g.js +0 -1
  90. package/dist/chunk-dr32dt9y.js +0 -1
  91. package/dist/chunk-dv1vt080.js +0 -1
  92. package/dist/chunk-p7ew4trx.js +0 -1
  93. package/dist/chunk-qhzztj83.js +0 -1
  94. package/dist/chunk-zkd3m39v.js +0 -1
@@ -1,12 +1,12 @@
1
- import{bh as GV,ch as l_}from"./chunk-9011y634.js";import{uk as H0}from"./chunk-v0e9bsvt.js";import{Bl as T}from"./chunk-78ksrp8v.js";import{$l as D,Wl as Eq,Yl as k}from"./chunk-4fs853nh.js";var CX=k((GO,MX)=>{MX.exports=RX;function RX(q,J){if(q&&J)return RX(q)(J);if(typeof q!=="function")throw TypeError("need wrapper function");return Object.keys(q).forEach(function(Z){X[Z]=q[Z]}),X;function X(){var Z=Array(arguments.length);for(var Q=0;Q<Z.length;Q++)Z[Q]=arguments[Q];var $=q.apply(this,Z),Y=Z[Z.length-1];if(typeof $==="function"&&$!==Y)Object.keys(Y).forEach(function(H){$[H]=Y[H]});return $}}});var w3=k((WO,T3)=>{var FX=CX();T3.exports=FX(V8);T3.exports.strict=FX(kX);V8.proto=V8(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return V8(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return kX(this)},configurable:!0})});function V8(q){var J=function(){if(J.called)return J.value;return J.called=!0,J.value=q.apply(this,arguments)};return J.called=!1,J}function kX(q){var J=function(){if(J.called)throw Error(J.onceError);return J.called=!0,J.value=q.apply(this,arguments)},X=q.name||"Function wrapped with `once`";return J.onceError=X+" shouldn't be called more than once",J.called=!1,J}});var PX=k((UO,wX)=>{var J_=w3(),X_=function(){},Z_=global.Bare?queueMicrotask:process.nextTick.bind(process),Q_=function(q){return q.setHeader&&typeof q.abort==="function"},$_=function(q){return q.stdio&&Array.isArray(q.stdio)&&q.stdio.length===3},TX=function(q,J,X){if(typeof J==="function")return TX(q,null,J);if(!J)J={};X=J_(X||X_);var{_writableState:Z,_readableState:Q}=q,$=J.readable||J.readable!==!1&&q.readable,Y=J.writable||J.writable!==!1&&q.writable,H=!1,K=function(){if(!q.writable)G()},G=function(){if(Y=!1,!$)X.call(q)},V=function(){if($=!1,!Y)X.call(q)},W=function(x){X.call(q,x?Error("exited with error code: "+x):null)},U=function(x){X.call(q,x)},z=function(){Z_(_)},_=function(){if(H)return;if($&&!(Q&&(Q.ended&&!Q.destroyed)))return X.call(q,Error("premature close"));if(Y&&!(Z&&(Z.ended&&!Z.destroyed)))return X.call(q,Error("premature close"))},L=function(){q.req.on("finish",G)};if(Q_(q))if(q.on("complete",G),q.on("abort",z),q.req)L();else q.on("request",L);else if(Y&&!Z)q.on("end",K),q.on("close",K);if($_(q))q.on("exit",W);if(q.on("end",V),q.on("finish",G),J.error!==!1)q.on("error",U);return q.on("close",z),function(){if(H=!0,q.removeListener("complete",G),q.removeListener("abort",z),q.removeListener("request",L),q.req)q.req.removeListener("finish",G);q.removeListener("end",K),q.removeListener("close",K),q.removeListener("finish",G),q.removeListener("exit",W),q.removeListener("end",V),q.removeListener("error",U),q.removeListener("close",z)}};wX.exports=TX});var IX=k((zO,DX)=>{var Y_=w3(),H_=PX(),G8;try{G8=D("fs")}catch(q){}var T2=function(){},K_=typeof process>"u"?!1:/^v?\.0/.test(process.version),W8=function(q){return typeof q==="function"},V_=function(q){if(!K_)return!1;if(!G8)return!1;return(q instanceof(G8.ReadStream||T2)||q instanceof(G8.WriteStream||T2))&&W8(q.close)},G_=function(q){return q.setHeader&&W8(q.abort)},W_=function(q,J,X,Z){Z=Y_(Z);var Q=!1;q.on("close",function(){Q=!0}),H_(q,{readable:J,writable:X},function(Y){if(Y)return Z(Y);Q=!0,Z()});var $=!1;return function(Y){if(Q)return;if($)return;if($=!0,V_(q))return q.close(T2);if(G_(q))return q.abort();if(W8(q.destroy))return q.destroy();Z(Y||Error("stream was destroyed"))}},AX=function(q){q()},U_=function(q,J){return q.pipe(J)},z_=function(){var q=Array.prototype.slice.call(arguments),J=W8(q[q.length-1]||T2)&&q.pop()||T2;if(Array.isArray(q[0]))q=q[0];if(q.length<2)throw Error("pump requires two streams per minimum");var X,Z=q.map(function(Q,$){var Y=$<q.length-1,H=$>0;return W_(Q,Y,H,function(K){if(!X)X=K;if(K)Z.forEach(AX);if(Y)return;Z.forEach(AX),J(X)})});return q.reduce(U_)};DX.exports=z_});var vX=k((_O,OX)=>{var{PassThrough:__}=D("stream");OX.exports=(q)=>{q={...q};let{array:J}=q,{encoding:X}=q,Z=X==="buffer",Q=!1;if(J)Q=!(X||Z);else X=X||"utf8";if(Z)X=null;let $=new __({objectMode:Q});if(X)$.setEncoding(X);let Y=0,H=[];return $.on("data",(K)=>{if(H.push(K),Q)Y=H.length;else Y+=K.length}),$.getBufferedValue=()=>{if(J)return H;return Z?Buffer.concat(H,Y):H.join("")},$.getBufferedLength=()=>Y,$}});var NX=k((LO,b6)=>{var{constants:L_}=D("buffer"),B_=IX(),x_=vX();class P3 extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function U8(q,J){if(!q)return Promise.reject(Error("Expected a stream"));J={maxBuffer:1/0,...J};let{maxBuffer:X}=J,Z;return await new Promise((Q,$)=>{let Y=(H)=>{if(H&&Z.getBufferedLength()<=L_.MAX_LENGTH)H.bufferedData=Z.getBufferedValue();$(H)};Z=B_(q,x_(J),(H)=>{if(H){Y(H);return}Q()}),Z.on("data",()=>{if(Z.getBufferedLength()>X)Y(new P3)})}),Z.getBufferedValue()}b6.exports=U8;b6.exports.default=U8;b6.exports.buffer=(q,J)=>U8(q,{...J,encoding:"buffer"});b6.exports.array=(q,J)=>U8(q,{...J,array:!0});b6.exports.MaxBufferError=P3});var hX=k((BO,SX)=>{SX.exports=z8;function z8(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}z8.prototype.go=function(q){if(this.pending<this.max)yX(this,q);else this.waiting.push(q)};z8.prototype.wait=function(q){if(this.pending===0)q(this.error);else this.listeners.push(q)};z8.prototype.hold=function(){return EX(this)};function EX(q){q.pending+=1;var J=!1;return X;function X(Q){if(J)throw Error("callback called twice");if(J=!0,q.error=q.error||Q,q.pending-=1,q.waiting.length>0&&q.pending<q.max)yX(q,q.waiting.shift());else if(q.pending===0){var $=q.listeners;q.listeners=[],$.forEach(Z)}}function Z(Q){Q(q.error)}}function yX(q,J){J(EX(q))}});var gX=k((F_)=>{var w2=D("fs"),_8=D("util"),A3=D("stream"),bX=A3.Readable,D3=A3.Writable,j_=A3.PassThrough,R_=hX(),L8=D("events").EventEmitter;F_.createFromBuffer=M_;F_.createFromFd=C_;F_.BufferSlicer=c0;F_.FdSlicer=d0;_8.inherits(d0,L8);function d0(q,J){J=J||{},L8.call(this),this.fd=q,this.pend=new R_,this.pend.max=1,this.refCount=0,this.autoClose=!!J.autoClose}d0.prototype.read=function(q,J,X,Z,Q){var $=this;$.pend.go(function(Y){w2.read($.fd,q,J,X,Z,function(H,K,G){Y(),Q(H,K,G)})})};d0.prototype.write=function(q,J,X,Z,Q){var $=this;$.pend.go(function(Y){w2.write($.fd,q,J,X,Z,function(H,K,G){Y(),Q(H,K,G)})})};d0.prototype.createReadStream=function(q){return new B8(this,q)};d0.prototype.createWriteStream=function(q){return new x8(this,q)};d0.prototype.ref=function(){this.refCount+=1};d0.prototype.unref=function(){var q=this;if(q.refCount-=1,q.refCount>0)return;if(q.refCount<0)throw Error("invalid unref");if(q.autoClose)w2.close(q.fd,J);function J(X){if(X)q.emit("error",X);else q.emit("close")}};_8.inherits(B8,bX);function B8(q,J){J=J||{},bX.call(this,J),this.context=q,this.context.ref(),this.start=J.start||0,this.endOffset=J.end,this.pos=this.start,this.destroyed=!1}B8.prototype._read=function(q){var J=this;if(J.destroyed)return;var X=Math.min(J._readableState.highWaterMark,q);if(J.endOffset!=null)X=Math.min(X,J.endOffset-J.pos);if(X<=0){J.destroyed=!0,J.push(null),J.context.unref();return}J.context.pend.go(function(Z){if(J.destroyed)return Z();var Q=new Buffer(X);w2.read(J.context.fd,Q,0,X,J.pos,function($,Y){if($)J.destroy($);else if(Y===0)J.destroyed=!0,J.push(null),J.context.unref();else J.pos+=Y,J.push(Q.slice(0,Y));Z()})})};B8.prototype.destroy=function(q){if(this.destroyed)return;q=q||Error("stream destroyed"),this.destroyed=!0,this.emit("error",q),this.context.unref()};_8.inherits(x8,D3);function x8(q,J){J=J||{},D3.call(this,J),this.context=q,this.context.ref(),this.start=J.start||0,this.endOffset=J.end==null?1/0:+J.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}x8.prototype._write=function(q,J,X){var Z=this;if(Z.destroyed)return;if(Z.pos+q.length>Z.endOffset){var Q=Error("maximum file length exceeded");Q.code="ETOOBIG",Z.destroy(),X(Q);return}Z.context.pend.go(function($){if(Z.destroyed)return $();w2.write(Z.context.fd,q,0,q.length,Z.pos,function(Y,H){if(Y)Z.destroy(),$(),X(Y);else Z.bytesWritten+=H,Z.pos+=H,Z.emit("progress"),$(),X()})})};x8.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=!0,this.context.unref()};_8.inherits(c0,L8);function c0(q,J){L8.call(this),J=J||{},this.refCount=0,this.buffer=q,this.maxChunkSize=J.maxChunkSize||Number.MAX_SAFE_INTEGER}c0.prototype.read=function(q,J,X,Z,Q){var $=Z+X,Y=$-this.buffer.length,H=Y>0?Y:X;this.buffer.copy(q,J,Z,$),setImmediate(function(){Q(null,H)})};c0.prototype.write=function(q,J,X,Z,Q){q.copy(this.buffer,Z,J,J+X),setImmediate(function(){Q(null,X,q)})};c0.prototype.createReadStream=function(q){q=q||{};var J=new j_(q);J.destroyed=!1,J.start=q.start||0,J.endOffset=q.end,J.pos=J.endOffset||this.buffer.length;var X=this.buffer.slice(J.start,J.pos),Z=0;while(!0){var Q=Z+this.maxChunkSize;if(Q>=X.length){if(Z<X.length)J.write(X.slice(Z,X.length));break}J.write(X.slice(Z,Q)),Z=Q}return J.end(),J.destroy=function(){J.destroyed=!0},J};c0.prototype.createWriteStream=function(q){var J=this;q=q||{};var X=new D3(q);return X.start=q.start||0,X.endOffset=q.end==null?this.buffer.length:+q.end,X.bytesWritten=0,X.pos=X.start,X.destroyed=!1,X._write=function(Z,Q,$){if(X.destroyed)return;var Y=X.pos+Z.length;if(Y>X.endOffset){var H=Error("maximum file length exceeded");H.code="ETOOBIG",X.destroyed=!0,$(H);return}Z.copy(J.buffer,X.pos,0,Z.length),X.bytesWritten+=Z.length,X.pos=Y,X.emit("progress"),$()},X.destroy=function(){X.destroyed=!0},X};c0.prototype.ref=function(){this.refCount+=1};c0.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")};function M_(q,J){return new c0(q,J)}function C_(q,J){return new d0(q,J)}});var mX=k((jO,uX)=>{var s0=D("buffer").Buffer,I3=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array<"u")I3=new Int32Array(I3);function fX(q){if(s0.isBuffer(q))return q;var J=typeof s0.alloc==="function"&&typeof s0.from==="function";if(typeof q==="number")return J?s0.alloc(q):new s0(q);else if(typeof q==="string")return J?s0.from(q):new s0(q);else throw Error("input must be buffer, number, or string, received "+typeof q)}function A_(q){var J=fX(4);return J.writeInt32BE(q,0),J}function O3(q,J){if(q=fX(q),s0.isBuffer(J))J=J.readUInt32BE(0);var X=~~J^-1;for(var Z=0;Z<q.length;Z++)X=I3[(X^q[Z])&255]^X>>>8;return X^-1}function v3(){return A_(O3.apply(null,arguments))}v3.signed=function(){return O3.apply(null,arguments)};v3.unsigned=function(){return O3.apply(null,arguments)>>>0};uX.exports=v3});var aX=k((y_)=>{var N3=D("fs"),D_=D("zlib"),dX=gX(),I_=mX(),M8=D("util"),C8=D("events").EventEmitter,cX=D("stream").Transform,E3=D("stream").PassThrough,O_=D("stream").Writable;y_.open=v_;y_.fromFd=lX;y_.fromBuffer=N_;y_.fromRandomAccessReader=y3;y_.dosDateTimeToDate=nX;y_.validateFileName=iX;y_.ZipFile=t0;y_.Entry=P2;y_.RandomAccessReader=e0;function v_(q,J,X){if(typeof J==="function")X=J,J=null;if(J==null)J={};if(J.autoClose==null)J.autoClose=!0;if(J.lazyEntries==null)J.lazyEntries=!1;if(J.decodeStrings==null)J.decodeStrings=!0;if(J.validateEntrySizes==null)J.validateEntrySizes=!0;if(J.strictFileNames==null)J.strictFileNames=!1;if(X==null)X=R8;N3.open(q,"r",function(Z,Q){if(Z)return X(Z);lX(Q,J,function($,Y){if($)N3.close(Q,R8);X($,Y)})})}function lX(q,J,X){if(typeof J==="function")X=J,J=null;if(J==null)J={};if(J.autoClose==null)J.autoClose=!1;if(J.lazyEntries==null)J.lazyEntries=!1;if(J.decodeStrings==null)J.decodeStrings=!0;if(J.validateEntrySizes==null)J.validateEntrySizes=!0;if(J.strictFileNames==null)J.strictFileNames=!1;if(X==null)X=R8;N3.fstat(q,function(Z,Q){if(Z)return X(Z);var $=dX.createFromFd(q,{autoClose:!0});y3($,Q.size,J,X)})}function N_(q,J,X){if(typeof J==="function")X=J,J=null;if(J==null)J={};if(J.autoClose=!1,J.lazyEntries==null)J.lazyEntries=!1;if(J.decodeStrings==null)J.decodeStrings=!0;if(J.validateEntrySizes==null)J.validateEntrySizes=!0;if(J.strictFileNames==null)J.strictFileNames=!1;var Z=dX.createFromBuffer(q,{maxChunkSize:65536});y3(Z,q.length,J,X)}function y3(q,J,X,Z){if(typeof X==="function")Z=X,X=null;if(X==null)X={};if(X.autoClose==null)X.autoClose=!0;if(X.lazyEntries==null)X.lazyEntries=!1;if(X.decodeStrings==null)X.decodeStrings=!0;var Q=!!X.decodeStrings;if(X.validateEntrySizes==null)X.validateEntrySizes=!0;if(X.strictFileNames==null)X.strictFileNames=!1;if(Z==null)Z=R8;if(typeof J!=="number")throw Error("expected totalSize parameter to be a number");if(J>Number.MAX_SAFE_INTEGER)throw Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");q.ref();var $=22,Y=65535,H=Math.min($+Y,J),K=E0(H),G=J-K.length;g6(q,K,0,H,G,function(V){if(V)return Z(V);for(var W=H-$;W>=0;W-=1){if(K.readUInt32LE(W)!==101010256)continue;var U=K.slice(W),z=U.readUInt16LE(4);if(z!==0)return Z(Error("multi-disk zip files are not supported: found disk number: "+z));var _=U.readUInt16LE(10),L=U.readUInt32LE(16),x=U.readUInt16LE(20),B=U.length-$;if(x!==B)return Z(Error("invalid comment length. expected: "+B+". found: "+x));var j=Q?j8(U,22,U.length,!1):U.slice(22);if(!(_===65535||L===4294967295))return Z(null,new t0(q,L,J,_,j,X.autoClose,X.lazyEntries,Q,X.validateEntrySizes,X.strictFileNames));var R=E0(20),F=G+W-R.length;g6(q,R,0,R.length,F,function(C){if(C)return Z(C);if(R.readUInt32LE(0)!==117853008)return Z(Error("invalid zip64 end of central directory locator signature"));var y=f6(R,8),O=E0(56);g6(q,O,0,O.length,y,function(g){if(g)return Z(g);if(O.readUInt32LE(0)!==101075792)return Z(Error("invalid zip64 end of central directory record signature"));return _=f6(O,32),L=f6(O,48),Z(null,new t0(q,L,J,_,j,X.autoClose,X.lazyEntries,Q,X.validateEntrySizes,X.strictFileNames))})});return}Z(Error("end of central directory record signature not found"))})}M8.inherits(t0,C8);function t0(q,J,X,Z,Q,$,Y,H,K,G){var V=this;if(C8.call(V),V.reader=q,V.reader.on("error",function(W){pX(V,W)}),V.reader.once("close",function(){V.emit("close")}),V.readEntryCursor=J,V.fileSize=X,V.entryCount=Z,V.comment=Q,V.entriesRead=0,V.autoClose=!!$,V.lazyEntries=!!Y,V.decodeStrings=!!H,V.validateEntrySizes=!!K,V.strictFileNames=!!G,V.isOpen=!0,V.emittedError=!1,!V.lazyEntries)V._readEntry()}t0.prototype.close=function(){if(!this.isOpen)return;this.isOpen=!1,this.reader.unref()};function F0(q,J){if(q.autoClose)q.close();pX(q,J)}function pX(q,J){if(q.emittedError)return;q.emittedError=!0,q.emit("error",J)}t0.prototype.readEntry=function(){if(!this.lazyEntries)throw Error("readEntry() called without lazyEntries:true");this._readEntry()};t0.prototype._readEntry=function(){var q=this;if(q.entryCount===q.entriesRead){setImmediate(function(){if(q.autoClose)q.close();if(q.emittedError)return;q.emit("end")});return}if(q.emittedError)return;var J=E0(46);g6(q.reader,J,0,J.length,q.readEntryCursor,function(X){if(X)return F0(q,X);if(q.emittedError)return;var Z=new P2,Q=J.readUInt32LE(0);if(Q!==33639248)return F0(q,Error("invalid central directory file header signature: 0x"+Q.toString(16)));if(Z.versionMadeBy=J.readUInt16LE(4),Z.versionNeededToExtract=J.readUInt16LE(6),Z.generalPurposeBitFlag=J.readUInt16LE(8),Z.compressionMethod=J.readUInt16LE(10),Z.lastModFileTime=J.readUInt16LE(12),Z.lastModFileDate=J.readUInt16LE(14),Z.crc32=J.readUInt32LE(16),Z.compressedSize=J.readUInt32LE(20),Z.uncompressedSize=J.readUInt32LE(24),Z.fileNameLength=J.readUInt16LE(28),Z.extraFieldLength=J.readUInt16LE(30),Z.fileCommentLength=J.readUInt16LE(32),Z.internalFileAttributes=J.readUInt16LE(36),Z.externalFileAttributes=J.readUInt32LE(38),Z.relativeOffsetOfLocalHeader=J.readUInt32LE(42),Z.generalPurposeBitFlag&64)return F0(q,Error("strong encryption is not supported"));q.readEntryCursor+=46,J=E0(Z.fileNameLength+Z.extraFieldLength+Z.fileCommentLength),g6(q.reader,J,0,J.length,q.readEntryCursor,function($){if($)return F0(q,$);if(q.emittedError)return;var Y=(Z.generalPurposeBitFlag&2048)!==0;Z.fileName=q.decodeStrings?j8(J,0,Z.fileNameLength,Y):J.slice(0,Z.fileNameLength);var H=Z.fileNameLength+Z.extraFieldLength,K=J.slice(Z.fileNameLength,H);Z.extraFields=[];var G=0;while(G<K.length-3){var V=K.readUInt16LE(G+0),W=K.readUInt16LE(G+2),U=G+4,z=U+W;if(z>K.length)return F0(q,Error("extra field length exceeds extra field buffer size"));var _=E0(W);K.copy(_,0,U,z),Z.extraFields.push({id:V,data:_}),G=z}if(Z.fileComment=q.decodeStrings?j8(J,H,H+Z.fileCommentLength,Y):J.slice(H,H+Z.fileCommentLength),Z.comment=Z.fileComment,q.readEntryCursor+=J.length,q.entriesRead+=1,Z.uncompressedSize===4294967295||Z.compressedSize===4294967295||Z.relativeOffsetOfLocalHeader===4294967295){var L=null;for(var G=0;G<Z.extraFields.length;G++){var x=Z.extraFields[G];if(x.id===1){L=x.data;break}}if(L==null)return F0(q,Error("expected zip64 extended information extra field"));var B=0;if(Z.uncompressedSize===4294967295){if(B+8>L.length)return F0(q,Error("zip64 extended information extra field does not include uncompressed size"));Z.uncompressedSize=f6(L,B),B+=8}if(Z.compressedSize===4294967295){if(B+8>L.length)return F0(q,Error("zip64 extended information extra field does not include compressed size"));Z.compressedSize=f6(L,B),B+=8}if(Z.relativeOffsetOfLocalHeader===4294967295){if(B+8>L.length)return F0(q,Error("zip64 extended information extra field does not include relative header offset"));Z.relativeOffsetOfLocalHeader=f6(L,B),B+=8}}if(q.decodeStrings)for(var G=0;G<Z.extraFields.length;G++){var x=Z.extraFields[G];if(x.id===28789){if(x.data.length<6)continue;if(x.data.readUInt8(0)!==1)continue;var j=x.data.readUInt32LE(1);if(I_.unsigned(J.slice(0,Z.fileNameLength))!==j)continue;Z.fileName=j8(x.data,5,x.data.length,!0);break}}if(q.validateEntrySizes&&Z.compressionMethod===0){var R=Z.uncompressedSize;if(Z.isEncrypted())R+=12;if(Z.compressedSize!==R){var F="compressed/uncompressed size mismatch for stored file: "+Z.compressedSize+" != "+Z.uncompressedSize;return F0(q,Error(F))}}if(q.decodeStrings){if(!q.strictFileNames)Z.fileName=Z.fileName.replace(/\\/g,"/");var C=iX(Z.fileName,q.validateFileNameOptions);if(C!=null)return F0(q,Error(C))}if(q.emit("entry",Z),!q.lazyEntries)q._readEntry()})})};t0.prototype.openReadStream=function(q,J,X){var Z=this,Q=0,$=q.compressedSize;if(X==null)X=J,J={};else{if(J.decrypt!=null){if(!q.isEncrypted())throw Error("options.decrypt can only be specified for encrypted entries");if(J.decrypt!==!1)throw Error("invalid options.decrypt value: "+J.decrypt);if(q.isCompressed()){if(J.decompress!==!1)throw Error("entry is encrypted and compressed, and options.decompress !== false")}}if(J.decompress!=null){if(!q.isCompressed())throw Error("options.decompress can only be specified for compressed entries");if(!(J.decompress===!1||J.decompress===!0))throw Error("invalid options.decompress value: "+J.decompress)}if(J.start!=null||J.end!=null){if(q.isCompressed()&&J.decompress!==!1)throw Error("start/end range not allowed for compressed entry without options.decompress === false");if(q.isEncrypted()&&J.decrypt!==!1)throw Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(J.start!=null){if(Q=J.start,Q<0)throw Error("options.start < 0");if(Q>q.compressedSize)throw Error("options.start > entry.compressedSize")}if(J.end!=null){if($=J.end,$<0)throw Error("options.end < 0");if($>q.compressedSize)throw Error("options.end > entry.compressedSize");if($<Q)throw Error("options.end < options.start")}}if(!Z.isOpen)return X(Error("closed"));if(q.isEncrypted()){if(J.decrypt!==!1)return X(Error("entry is encrypted, and options.decrypt !== false"))}Z.reader.ref();var Y=E0(30);g6(Z.reader,Y,0,Y.length,q.relativeOffsetOfLocalHeader,function(H){try{if(H)return X(H);var K=Y.readUInt32LE(0);if(K!==67324752)return X(Error("invalid local file header signature: 0x"+K.toString(16)));var G=Y.readUInt16LE(26),V=Y.readUInt16LE(28),W=q.relativeOffsetOfLocalHeader+Y.length+G+V,U;if(q.compressionMethod===0)U=!1;else if(q.compressionMethod===8)U=J.decompress!=null?J.decompress:!0;else return X(Error("unsupported compression method: "+q.compressionMethod));var z=W,_=z+q.compressedSize;if(q.compressedSize!==0){if(_>Z.fileSize)return X(Error("file data overflows file bounds: "+z+" + "+q.compressedSize+" > "+Z.fileSize))}var L=Z.reader.createReadStream({start:z+Q,end:z+$}),x=L;if(U){var B=!1,j=D_.createInflateRaw();if(L.on("error",function(R){setImmediate(function(){if(!B)j.emit("error",R)})}),L.pipe(j),Z.validateEntrySizes)x=new A2(q.uncompressedSize),j.on("error",function(R){setImmediate(function(){if(!B)x.emit("error",R)})}),j.pipe(x);else x=j;x.destroy=function(){if(B=!0,j!==x)j.unpipe(x);L.unpipe(j),L.destroy()}}X(null,x)}finally{Z.reader.unref()}})};function P2(){}P2.prototype.getLastModDate=function(){return nX(this.lastModFileDate,this.lastModFileTime)};P2.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};P2.prototype.isCompressed=function(){return this.compressionMethod===8};function nX(q,J){var X=q&31,Z=(q>>5&15)-1,Q=(q>>9&127)+1980,$=0,Y=(J&31)*2,H=J>>5&63,K=J>>11&31;return new Date(Q,Z,X,K,H,Y,$)}function iX(q){if(q.indexOf("\\")!==-1)return"invalid characters in fileName: "+q;if(/^[a-zA-Z]:/.test(q)||/^\//.test(q))return"absolute path: "+q;if(q.split("/").indexOf("..")!==-1)return"invalid relative path: "+q;return null}function g6(q,J,X,Z,Q,$){if(Z===0)return setImmediate(function(){$(null,E0(0))});q.read(J,X,Z,Q,function(Y,H){if(Y)return $(Y);if(H<Z)return $(Error("unexpected EOF"));$()})}M8.inherits(A2,cX);function A2(q){cX.call(this),this.actualByteCount=0,this.expectedByteCount=q}A2.prototype._transform=function(q,J,X){if(this.actualByteCount+=q.length,this.actualByteCount>this.expectedByteCount){var Z="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return X(Error(Z))}X(null,q)};A2.prototype._flush=function(q){if(this.actualByteCount<this.expectedByteCount){var J="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return q(Error(J))}q()};M8.inherits(e0,C8);function e0(){C8.call(this),this.refCount=0}e0.prototype.ref=function(){this.refCount+=1};e0.prototype.unref=function(){var q=this;if(q.refCount-=1,q.refCount>0)return;if(q.refCount<0)throw Error("invalid unref");q.close(J);function J(X){if(X)return q.emit("error",X);q.emit("close")}};e0.prototype.createReadStream=function(q){var{start:J,end:X}=q;if(J===X){var Z=new E3;return setImmediate(function(){Z.end()}),Z}var Q=this._readStreamForRange(J,X),$=!1,Y=new F8(this);Q.on("error",function(K){setImmediate(function(){if(!$)Y.emit("error",K)})}),Y.destroy=function(){Q.unpipe(Y),Y.unref(),Q.destroy()};var H=new A2(X-J);return Y.on("error",function(K){setImmediate(function(){if(!$)H.emit("error",K)})}),H.destroy=function(){$=!0,Y.unpipe(H),Y.destroy()},Q.pipe(Y).pipe(H)};e0.prototype._readStreamForRange=function(q,J){throw Error("not implemented")};e0.prototype.read=function(q,J,X,Z,Q){var $=this.createReadStream({start:Z,end:Z+X}),Y=new O_,H=0;Y._write=function(K,G,V){K.copy(q,J+H,0,K.length),H+=K.length,V()},Y.on("finish",Q),$.on("error",function(K){Q(K)}),$.pipe(Y)};e0.prototype.close=function(q){setImmediate(q)};M8.inherits(F8,E3);function F8(q){E3.call(this),this.context=q,this.context.ref(),this.unreffedYet=!1}F8.prototype._flush=function(q){this.unref(),q()};F8.prototype.unref=function(q){if(this.unreffedYet)return;this.unreffedYet=!0,this.context.unref()};var E_="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function j8(q,J,X,Z){if(Z)return q.toString("utf8",J,X);else{var Q="";for(var $=J;$<X;$++)Q+=E_[q[$]];return Q}}function f6(q,J){var X=q.readUInt32LE(J),Z=q.readUInt32LE(J+4);return Z*4294967296+X}var E0;if(typeof Buffer.allocUnsafe==="function")E0=function(q){return Buffer.allocUnsafe(q)};else E0=function(q){return new Buffer(q)};function R8(q){if(q)throw q}});var sX=k((MO,rX)=>{var k0=l_()("extract-zip"),{createWriteStream:p_,promises:u6}=D("fs"),n_=NX(),B6=D("path"),{promisify:S3}=D("util"),i_=D("stream"),a_=aX(),o_=S3(a_.open),r_=S3(i_.pipeline);class oX{constructor(q,J){this.zipPath=q,this.opts=J}async extract(){return k0("opening",this.zipPath,"with opts",this.opts),this.zipfile=await o_(this.zipPath,{lazyEntries:!0}),this.canceled=!1,new Promise((q,J)=>{this.zipfile.on("error",(X)=>{this.canceled=!0,J(X)}),this.zipfile.readEntry(),this.zipfile.on("close",()=>{if(!this.canceled)k0("zip extraction complete"),q()}),this.zipfile.on("entry",async(X)=>{if(this.canceled){k0("skipping entry",X.fileName,{cancelled:this.canceled});return}if(k0("zipfile entry",X.fileName),X.fileName.startsWith("__MACOSX/")){this.zipfile.readEntry();return}let Z=B6.dirname(B6.join(this.opts.dir,X.fileName));try{await u6.mkdir(Z,{recursive:!0});let Q=await u6.realpath(Z);if(B6.relative(this.opts.dir,Q).split(B6.sep).includes(".."))throw Error(`Out of bound path "${Q}" found while processing file ${X.fileName}`);await this.extractEntry(X),k0("finished processing",X.fileName),this.zipfile.readEntry()}catch(Q){this.canceled=!0,this.zipfile.close(),J(Q)}})})}async extractEntry(q){if(this.canceled){k0("skipping entry extraction",q.fileName,{cancelled:this.canceled});return}if(this.opts.onEntry)this.opts.onEntry(q,this.zipfile);let J=B6.join(this.opts.dir,q.fileName),X=q.externalFileAttributes>>16&65535,Z=61440,Q=16384,$=40960,Y=(X&Z)===$,H=(X&Z)===Q;if(!H&&q.fileName.endsWith("/"))H=!0;let K=q.versionMadeBy>>8;if(!H)H=K===0&&q.externalFileAttributes===16;k0("extracting entry",{filename:q.fileName,isDir:H,isSymlink:Y});let G=this.getExtractedMode(X,H)&511,V=H?J:B6.dirname(J),W={recursive:!0};if(H)W.mode=G;if(k0("mkdir",{dir:V,...W}),await u6.mkdir(V,W),H)return;k0("opening read stream",J);let U=await S3(this.zipfile.openReadStream.bind(this.zipfile))(q);if(Y){let z=await n_(U);k0("creating symlink",z,J),await u6.symlink(z,J)}else await r_(U,p_(J,{mode:G}))}getExtractedMode(q,J){let X=q;if(X===0)if(J){if(this.opts.defaultDirMode)X=parseInt(this.opts.defaultDirMode,10);if(!X)X=493}else{if(this.opts.defaultFileMode)X=parseInt(this.opts.defaultFileMode,10);if(!X)X=420}return X}}rX.exports=async function(q,J){if(k0("creating target directory",J.dir),!B6.isAbsolute(J.dir))throw Error("Target directory is expected to be absolute");return await u6.mkdir(J.dir,{recursive:!0}),J.dir=await u6.realpath(J.dir),new oX(q,J).extract()}});var l=k((s_)=>{s_.fromCallback=function(q){return Object.defineProperty(function(...J){if(typeof J[J.length-1]==="function")q.apply(this,J);else return new Promise((X,Z)=>{J.push((Q,$)=>Q!=null?Z(Q):X($)),q.apply(this,J)})},"name",{value:q.name})};s_.fromPromise=function(q){return Object.defineProperty(function(...J){let X=J[J.length-1];if(typeof X!=="function")return q.apply(this,J);else J.pop(),q.apply(this,J).then((Z)=>X(null,Z),X)},"name",{value:q.name})}});var eX=k((FO,tX)=>{var q6=D("constants"),qL=process.cwd,k8=null,JL=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!k8)k8=qL.call(process);return k8};try{process.cwd()}catch(q){}if(typeof process.chdir==="function"){if(T8=process.chdir,process.chdir=function(q){k8=null,T8.call(process,q)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,T8)}var T8;tX.exports=XL;function XL(q){if(q6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))J(q);if(!q.lutimes)X(q);if(q.chown=$(q.chown),q.fchown=$(q.fchown),q.lchown=$(q.lchown),q.chmod=Z(q.chmod),q.fchmod=Z(q.fchmod),q.lchmod=Z(q.lchmod),q.chownSync=Y(q.chownSync),q.fchownSync=Y(q.fchownSync),q.lchownSync=Y(q.lchownSync),q.chmodSync=Q(q.chmodSync),q.fchmodSync=Q(q.fchmodSync),q.lchmodSync=Q(q.lchmodSync),q.stat=H(q.stat),q.fstat=H(q.fstat),q.lstat=H(q.lstat),q.statSync=K(q.statSync),q.fstatSync=K(q.fstatSync),q.lstatSync=K(q.lstatSync),q.chmod&&!q.lchmod)q.lchmod=function(V,W,U){if(U)process.nextTick(U)},q.lchmodSync=function(){};if(q.chown&&!q.lchown)q.lchown=function(V,W,U,z){if(z)process.nextTick(z)},q.lchownSync=function(){};if(JL==="win32")q.rename=typeof q.rename!=="function"?q.rename:function(V){function W(U,z,_){var L=Date.now(),x=0;V(U,z,function B(j){if(j&&(j.code==="EACCES"||j.code==="EPERM"||j.code==="EBUSY")&&Date.now()-L<60000){if(setTimeout(function(){q.stat(z,function(R,F){if(R&&R.code==="ENOENT")V(U,z,B);else _(j)})},x),x<100)x+=10;return}if(_)_(j)})}if(Object.setPrototypeOf)Object.setPrototypeOf(W,V);return W}(q.rename);q.read=typeof q.read!=="function"?q.read:function(V){function W(U,z,_,L,x,B){var j;if(B&&typeof B==="function"){var R=0;j=function(F,C,y){if(F&&F.code==="EAGAIN"&&R<10)return R++,V.call(q,U,z,_,L,x,j);B.apply(this,arguments)}}return V.call(q,U,z,_,L,x,j)}if(Object.setPrototypeOf)Object.setPrototypeOf(W,V);return W}(q.read),q.readSync=typeof q.readSync!=="function"?q.readSync:function(V){return function(W,U,z,_,L){var x=0;while(!0)try{return V.call(q,W,U,z,_,L)}catch(B){if(B.code==="EAGAIN"&&x<10){x++;continue}throw B}}}(q.readSync);function J(V){V.lchmod=function(W,U,z){V.open(W,q6.O_WRONLY|q6.O_SYMLINK,U,function(_,L){if(_){if(z)z(_);return}V.fchmod(L,U,function(x){V.close(L,function(B){if(z)z(x||B)})})})},V.lchmodSync=function(W,U){var z=V.openSync(W,q6.O_WRONLY|q6.O_SYMLINK,U),_=!0,L;try{L=V.fchmodSync(z,U),_=!1}finally{if(_)try{V.closeSync(z)}catch(x){}else V.closeSync(z)}return L}}function X(V){if(q6.hasOwnProperty("O_SYMLINK")&&V.futimes)V.lutimes=function(W,U,z,_){V.open(W,q6.O_SYMLINK,function(L,x){if(L){if(_)_(L);return}V.futimes(x,U,z,function(B){V.close(x,function(j){if(_)_(B||j)})})})},V.lutimesSync=function(W,U,z){var _=V.openSync(W,q6.O_SYMLINK),L,x=!0;try{L=V.futimesSync(_,U,z),x=!1}finally{if(x)try{V.closeSync(_)}catch(B){}else V.closeSync(_)}return L};else if(V.futimes)V.lutimes=function(W,U,z,_){if(_)process.nextTick(_)},V.lutimesSync=function(){}}function Z(V){if(!V)return V;return function(W,U,z){return V.call(q,W,U,function(_){if(G(_))_=null;if(z)z.apply(this,arguments)})}}function Q(V){if(!V)return V;return function(W,U){try{return V.call(q,W,U)}catch(z){if(!G(z))throw z}}}function $(V){if(!V)return V;return function(W,U,z,_){return V.call(q,W,U,z,function(L){if(G(L))L=null;if(_)_.apply(this,arguments)})}}function Y(V){if(!V)return V;return function(W,U,z){try{return V.call(q,W,U,z)}catch(_){if(!G(_))throw _}}}function H(V){if(!V)return V;return function(W,U,z){if(typeof U==="function")z=U,U=null;function _(L,x){if(x){if(x.uid<0)x.uid+=4294967296;if(x.gid<0)x.gid+=4294967296}if(z)z.apply(this,arguments)}return U?V.call(q,W,U,_):V.call(q,W,_)}}function K(V){if(!V)return V;return function(W,U){var z=U?V.call(q,W,U):V.call(q,W);if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}return z}}function G(V){if(!V)return!0;if(V.code==="ENOSYS")return!0;var W=!process.getuid||process.getuid()!==0;if(W){if(V.code==="EINVAL"||V.code==="EPERM")return!0}return!1}}});var XZ=k((kO,JZ)=>{var qZ=D("stream").Stream;JZ.exports=ZL;function ZL(q){return{ReadStream:J,WriteStream:X};function J(Z,Q){if(!(this instanceof J))return new J(Z,Q);qZ.call(this);var $=this;this.path=Z,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Q=Q||{};var Y=Object.keys(Q);for(var H=0,K=Y.length;H<K;H++){var G=Y[H];this[G]=Q[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){$._read()});return}q.open(this.path,this.flags,this.mode,function(V,W){if(V){$.emit("error",V),$.readable=!1;return}$.fd=W,$.emit("open",W),$._read()})}function X(Z,Q){if(!(this instanceof X))return new X(Z,Q);qZ.call(this),this.path=Z,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Q=Q||{};var $=Object.keys(Q);for(var Y=0,H=$.length;Y<H;Y++){var K=$[Y];this[K]=Q[K]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=q.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var QZ=k((TO,ZZ)=>{ZZ.exports=$L;var QL=Object.getPrototypeOf||function(q){return q.__proto__};function $L(q){if(q===null||typeof q!=="object")return q;if(q instanceof Object)var J={__proto__:QL(q)};else var J=Object.create(null);return Object.getOwnPropertyNames(q).forEach(function(X){Object.defineProperty(J,X,Object.getOwnPropertyDescriptor(q,X))}),J}});var d6=k((wO,f3)=>{var E=D("fs"),YL=eX(),HL=XZ(),KL=QZ(),w8=D("util"),s,A8;if(typeof Symbol==="function"&&typeof Symbol.for==="function")s=Symbol.for("graceful-fs.queue"),A8=Symbol.for("graceful-fs.previous");else s="___graceful-fs.queue",A8="___graceful-fs.previous";function VL(){}function YZ(q,J){Object.defineProperty(q,s,{get:function(){return J}})}var x6=VL;if(w8.debuglog)x6=w8.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))x6=function(){var q=w8.format.apply(w8,arguments);q="GFS4: "+q.split(/\n/).join(`
2
- GFS4: `),console.error(q)};if(!E[s]){if(h3=global[s]||[],YZ(E,h3),E.close=function(q){function J(X,Z){return q.call(E,X,function(Q){if(!Q)$Z();if(typeof Z==="function")Z.apply(this,arguments)})}return Object.defineProperty(J,A8,{value:q}),J}(E.close),E.closeSync=function(q){function J(X){q.apply(E,arguments),$Z()}return Object.defineProperty(J,A8,{value:q}),J}(E.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){x6(E[s]),D("assert").equal(E[s].length,0)})}var h3;if(!global[s])YZ(global,E[s]);f3.exports=b3(KL(E));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!E.__patched)f3.exports=b3(E),E.__patched=!0;function b3(q){YL(q),q.gracefulify=b3,q.createReadStream=C,q.createWriteStream=y;var J=q.readFile;q.readFile=X;function X(M,P,A){if(typeof P==="function")A=P,P=null;return n(M,P,A);function n(i,u,N,S){return J(i,u,function(I){if(I&&(I.code==="EMFILE"||I.code==="ENFILE"))m6([n,[i,u,N],I,S||Date.now(),Date.now()]);else if(typeof N==="function")N.apply(this,arguments)})}}var Z=q.writeFile;q.writeFile=Q;function Q(M,P,A,n){if(typeof A==="function")n=A,A=null;return i(M,P,A,n);function i(u,N,S,I,a){return Z(u,N,S,function(v){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))m6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var $=q.appendFile;if($)q.appendFile=Y;function Y(M,P,A,n){if(typeof A==="function")n=A,A=null;return i(M,P,A,n);function i(u,N,S,I,a){return $(u,N,S,function(v){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))m6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var H=q.copyFile;if(H)q.copyFile=K;function K(M,P,A,n){if(typeof A==="function")n=A,A=0;return i(M,P,A,n);function i(u,N,S,I,a){return H(u,N,S,function(v){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))m6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var G=q.readdir;q.readdir=W;var V=/^v[0-5]\./;function W(M,P,A){if(typeof P==="function")A=P,P=null;var n=V.test(process.version)?function(N,S,I,a){return G(N,i(N,S,I,a))}:function(N,S,I,a){return G(N,S,i(N,S,I,a))};return n(M,P,A);function i(u,N,S,I){return function(a,v){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))m6([n,[u,N,S],a,I||Date.now(),Date.now()]);else{if(v&&v.sort)v.sort();if(typeof S==="function")S.call(this,a,v)}}}}if(process.version.substr(0,4)==="v0.8"){var U=HL(q);B=U.ReadStream,R=U.WriteStream}var z=q.ReadStream;if(z)B.prototype=Object.create(z.prototype),B.prototype.open=j;var _=q.WriteStream;if(_)R.prototype=Object.create(_.prototype),R.prototype.open=F;Object.defineProperty(q,"ReadStream",{get:function(){return B},set:function(M){B=M},enumerable:!0,configurable:!0}),Object.defineProperty(q,"WriteStream",{get:function(){return R},set:function(M){R=M},enumerable:!0,configurable:!0});var L=B;Object.defineProperty(q,"FileReadStream",{get:function(){return L},set:function(M){L=M},enumerable:!0,configurable:!0});var x=R;Object.defineProperty(q,"FileWriteStream",{get:function(){return x},set:function(M){x=M},enumerable:!0,configurable:!0});function B(M,P){if(this instanceof B)return z.apply(this,arguments),this;else return B.apply(Object.create(B.prototype),arguments)}function j(){var M=this;g(M.path,M.flags,M.mode,function(P,A){if(P){if(M.autoClose)M.destroy();M.emit("error",P)}else M.fd=A,M.emit("open",A),M.read()})}function R(M,P){if(this instanceof R)return _.apply(this,arguments),this;else return R.apply(Object.create(R.prototype),arguments)}function F(){var M=this;g(M.path,M.flags,M.mode,function(P,A){if(P)M.destroy(),M.emit("error",P);else M.fd=A,M.emit("open",A)})}function C(M,P){return new q.ReadStream(M,P)}function y(M,P){return new q.WriteStream(M,P)}var O=q.open;q.open=g;function g(M,P,A,n){if(typeof A==="function")n=A,A=null;return i(M,P,A,n);function i(u,N,S,I,a){return O(u,N,S,function(v,tx){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))m6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}return q}function m6(q){x6("ENQUEUE",q[0].name,q[1]),E[s].push(q),g3()}var P8;function $Z(){var q=Date.now();for(var J=0;J<E[s].length;++J)if(E[s][J].length>2)E[s][J][3]=q,E[s][J][4]=q;g3()}function g3(){if(clearTimeout(P8),P8=void 0,E[s].length===0)return;var q=E[s].shift(),J=q[0],X=q[1],Z=q[2],Q=q[3],$=q[4];if(Q===void 0)x6("RETRY",J.name,X),J.apply(null,X);else if(Date.now()-Q>=60000){x6("TIMEOUT",J.name,X);var Y=X.pop();if(typeof Y==="function")Y.call(null,Z)}else{var H=Date.now()-$,K=Math.max($-Q,1),G=Math.min(K*1.2,100);if(H>=G)x6("RETRY",J.name,X),J.apply(null,X.concat([Q]));else E[s].push(q)}if(P8===void 0)P8=setTimeout(g3,0)}});var Q0=k((u3)=>{var HZ=l().fromCallback,Z0=d6(),GL=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((q)=>{return typeof Z0[q]==="function"});Object.assign(u3,Z0);GL.forEach((q)=>{u3[q]=HZ(Z0[q])});u3.exists=function(q,J){if(typeof J==="function")return Z0.exists(q,J);return new Promise((X)=>{return Z0.exists(q,X)})};u3.read=function(q,J,X,Z,Q,$){if(typeof $==="function")return Z0.read(q,J,X,Z,Q,$);return new Promise((Y,H)=>{Z0.read(q,J,X,Z,Q,(K,G,V)=>{if(K)return H(K);Y({bytesRead:G,buffer:V})})})};u3.write=function(q,J,...X){if(typeof X[X.length-1]==="function")return Z0.write(q,J,...X);return new Promise((Z,Q)=>{Z0.write(q,J,...X,($,Y,H)=>{if($)return Q($);Z({bytesWritten:Y,buffer:H})})})};u3.readv=function(q,J,...X){if(typeof X[X.length-1]==="function")return Z0.readv(q,J,...X);return new Promise((Z,Q)=>{Z0.readv(q,J,...X,($,Y,H)=>{if($)return Q($);Z({bytesRead:Y,buffers:H})})})};u3.writev=function(q,J,...X){if(typeof X[X.length-1]==="function")return Z0.writev(q,J,...X);return new Promise((Z,Q)=>{Z0.writev(q,J,...X,($,Y,H)=>{if($)return Q($);Z({bytesWritten:Y,buffers:H})})})};if(typeof Z0.realpath.native==="function")u3.realpath.native=HZ(Z0.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var VZ=k((xL,KZ)=>{var BL=D("path");xL.checkPath=function(J){if(process.platform==="win32"){if(/[<>:"|?*]/.test(J.replace(BL.parse(J).root,""))){let Z=Error(`Path contains invalid characters: ${J}`);throw Z.code="EINVAL",Z}}}});var zZ=k((RL,m3)=>{var GZ=Q0(),{checkPath:WZ}=VZ(),UZ=(q)=>{let J={mode:511};if(typeof q==="number")return q;return{...J,...q}.mode};RL.makeDir=async(q,J)=>{return WZ(q),GZ.mkdir(q,{mode:UZ(J),recursive:!0})};RL.makeDirSync=(q,J)=>{return WZ(q),GZ.mkdirSync(q,{mode:UZ(J),recursive:!0})}});var T0=k((DO,_Z)=>{var FL=l().fromPromise,{makeDir:kL,makeDirSync:d3}=zZ(),c3=FL(kL);_Z.exports={mkdirs:c3,mkdirsSync:d3,mkdirp:c3,mkdirpSync:d3,ensureDir:c3,ensureDirSync:d3}});var J6=k((IO,BZ)=>{var TL=l().fromPromise,LZ=Q0();function wL(q){return LZ.access(q).then(()=>!0).catch(()=>!1)}BZ.exports={pathExists:TL(wL),pathExistsSync:LZ.existsSync}});var l3=k((OO,xZ)=>{var c6=Q0(),PL=l().fromPromise;async function AL(q,J,X){let Z=await c6.open(q,"r+"),Q=null;try{await c6.futimes(Z,J,X)}finally{try{await c6.close(Z)}catch($){Q=$}}if(Q)throw Q}function DL(q,J,X){let Z=c6.openSync(q,"r+");return c6.futimesSync(Z,J,X),c6.closeSync(Z)}xZ.exports={utimesMillis:PL(AL),utimesMillisSync:DL}});var j6=k((vO,CZ)=>{var l6=Q0(),p=D("path"),jZ=l().fromPromise;function IL(q,J,X){let Z=X.dereference?(Q)=>l6.stat(Q,{bigint:!0}):(Q)=>l6.lstat(Q,{bigint:!0});return Promise.all([Z(q),Z(J).catch((Q)=>{if(Q.code==="ENOENT")return null;throw Q})]).then(([Q,$])=>({srcStat:Q,destStat:$}))}function OL(q,J,X){let Z,Q=X.dereference?(Y)=>l6.statSync(Y,{bigint:!0}):(Y)=>l6.lstatSync(Y,{bigint:!0}),$=Q(q);try{Z=Q(J)}catch(Y){if(Y.code==="ENOENT")return{srcStat:$,destStat:null};throw Y}return{srcStat:$,destStat:Z}}async function vL(q,J,X,Z){let{srcStat:Q,destStat:$}=await IL(q,J,Z);if($){if(D2(Q,$)){let Y=p.basename(q),H=p.basename(J);if(X==="move"&&Y!==H&&Y.toLowerCase()===H.toLowerCase())return{srcStat:Q,destStat:$,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!$.isDirectory())throw Error(`Cannot overwrite non-directory '${J}' with directory '${q}'.`);if(!Q.isDirectory()&&$.isDirectory())throw Error(`Cannot overwrite directory '${J}' with non-directory '${q}'.`)}if(Q.isDirectory()&&p3(q,J))throw Error(D8(q,J,X));return{srcStat:Q,destStat:$}}function NL(q,J,X,Z){let{srcStat:Q,destStat:$}=OL(q,J,Z);if($){if(D2(Q,$)){let Y=p.basename(q),H=p.basename(J);if(X==="move"&&Y!==H&&Y.toLowerCase()===H.toLowerCase())return{srcStat:Q,destStat:$,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!$.isDirectory())throw Error(`Cannot overwrite non-directory '${J}' with directory '${q}'.`);if(!Q.isDirectory()&&$.isDirectory())throw Error(`Cannot overwrite directory '${J}' with non-directory '${q}'.`)}if(Q.isDirectory()&&p3(q,J))throw Error(D8(q,J,X));return{srcStat:Q,destStat:$}}async function RZ(q,J,X,Z){let Q=p.resolve(p.dirname(q)),$=p.resolve(p.dirname(X));if($===Q||$===p.parse($).root)return;let Y;try{Y=await l6.stat($,{bigint:!0})}catch(H){if(H.code==="ENOENT")return;throw H}if(D2(J,Y))throw Error(D8(q,X,Z));return RZ(q,J,$,Z)}function MZ(q,J,X,Z){let Q=p.resolve(p.dirname(q)),$=p.resolve(p.dirname(X));if($===Q||$===p.parse($).root)return;let Y;try{Y=l6.statSync($,{bigint:!0})}catch(H){if(H.code==="ENOENT")return;throw H}if(D2(J,Y))throw Error(D8(q,X,Z));return MZ(q,J,$,Z)}function D2(q,J){return J.ino!==void 0&&J.dev!==void 0&&J.ino===q.ino&&J.dev===q.dev}function p3(q,J){let X=p.resolve(q).split(p.sep).filter((Q)=>Q),Z=p.resolve(J).split(p.sep).filter((Q)=>Q);return X.every((Q,$)=>Z[$]===Q)}function D8(q,J,X){return`Cannot ${X} '${q}' to a subdirectory of itself, '${J}'.`}CZ.exports={checkPaths:jZ(vL),checkPathsSync:NL,checkParentPaths:jZ(RZ),checkParentPathsSync:MZ,isSrcSubdir:p3,areIdentical:D2}});var kZ=k((NO,FZ)=>{async function EL(q,J){let X=[];for await(let Z of q)X.push(J(Z).then(()=>null,(Q)=>Q??Error("unknown error")));await Promise.all(X.map((Z)=>Z.then((Q)=>{if(Q!==null)throw Q})))}FZ.exports={asyncIteratorConcurrentProcess:EL}});var DZ=k((EO,AZ)=>{var e=Q0(),I2=D("path"),{mkdirs:yL}=T0(),{pathExists:SL}=J6(),{utimesMillis:hL}=l3(),O2=j6(),{asyncIteratorConcurrentProcess:bL}=kZ();async function gL(q,J,X={}){if(typeof X==="function")X={filter:X};if(X.clobber="clobber"in X?!!X.clobber:!0,X.overwrite="overwrite"in X?!!X.overwrite:X.clobber,X.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
1
+ import{Zg as MV,_g as qL}from"./chunk-csn4vg3d.js";import{qk as H0}from"./chunk-9kbktaf8.js";import{xl as T}from"./chunk-0pzpg2ra.js";import{Rl as D4,Tl as k,Wl as D}from"./chunk-x17jyjan.js";var AX=k((FO,PX)=>{PX.exports=wX;function wX(q,J){if(q&&J)return wX(q)(J);if(typeof q!=="function")throw TypeError("need wrapper function");return Object.keys(q).forEach(function(Z){X[Z]=q[Z]}),X;function X(){var Z=Array(arguments.length);for(var Q=0;Q<Z.length;Q++)Z[Q]=arguments[Q];var $=q.apply(this,Z),Y=Z[Z.length-1];if(typeof $==="function"&&$!==Y)Object.keys(Y).forEach(function(H){$[H]=Y[H]});return $}}});var A3=k((kO,P3)=>{var DX=AX();P3.exports=DX(G8);P3.exports.strict=DX(IX);G8.proto=G8(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return G8(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return IX(this)},configurable:!0})});function G8(q){var J=function(){if(J.called)return J.value;return J.called=!0,J.value=q.apply(this,arguments)};return J.called=!1,J}function IX(q){var J=function(){if(J.called)throw Error(J.onceError);return J.called=!0,J.value=q.apply(this,arguments)},X=q.name||"Function wrapped with `once`";return J.onceError=X+" shouldn't be called more than once",J.called=!1,J}});var NX=k((TO,vX)=>{var W_=A3(),U_=function(){},z_=global.Bare?queueMicrotask:process.nextTick.bind(process),__=function(q){return q.setHeader&&typeof q.abort==="function"},L_=function(q){return q.stdio&&Array.isArray(q.stdio)&&q.stdio.length===3},OX=function(q,J,X){if(typeof J==="function")return OX(q,null,J);if(!J)J={};X=W_(X||U_);var{_writableState:Z,_readableState:Q}=q,$=J.readable||J.readable!==!1&&q.readable,Y=J.writable||J.writable!==!1&&q.writable,H=!1,K=function(){if(!q.writable)G()},G=function(){if(Y=!1,!$)X.call(q)},V=function(){if($=!1,!Y)X.call(q)},W=function(x){X.call(q,x?Error("exited with error code: "+x):null)},U=function(x){X.call(q,x)},z=function(){z_(_)},_=function(){if(H)return;if($&&!(Q&&(Q.ended&&!Q.destroyed)))return X.call(q,Error("premature close"));if(Y&&!(Z&&(Z.ended&&!Z.destroyed)))return X.call(q,Error("premature close"))},L=function(){q.req.on("finish",G)};if(__(q))if(q.on("complete",G),q.on("abort",z),q.req)L();else q.on("request",L);else if(Y&&!Z)q.on("end",K),q.on("close",K);if(L_(q))q.on("exit",W);if(q.on("end",V),q.on("finish",G),J.error!==!1)q.on("error",U);return q.on("close",z),function(){if(H=!0,q.removeListener("complete",G),q.removeListener("abort",z),q.removeListener("request",L),q.req)q.req.removeListener("finish",G);q.removeListener("end",K),q.removeListener("close",K),q.removeListener("finish",G),q.removeListener("exit",W),q.removeListener("end",V),q.removeListener("error",U),q.removeListener("close",z)}};vX.exports=OX});var SX=k((wO,yX)=>{var B_=A3(),x_=NX(),W8;try{W8=D("fs")}catch(q){}var w2=function(){},j_=typeof process>"u"?!1:/^v?\.0/.test(process.version),U8=function(q){return typeof q==="function"},R_=function(q){if(!j_)return!1;if(!W8)return!1;return(q instanceof(W8.ReadStream||w2)||q instanceof(W8.WriteStream||w2))&&U8(q.close)},M_=function(q){return q.setHeader&&U8(q.abort)},C_=function(q,J,X,Z){Z=B_(Z);var Q=!1;q.on("close",function(){Q=!0}),x_(q,{readable:J,writable:X},function(Y){if(Y)return Z(Y);Q=!0,Z()});var $=!1;return function(Y){if(Q)return;if($)return;if($=!0,R_(q))return q.close(w2);if(M_(q))return q.abort();if(U8(q.destroy))return q.destroy();Z(Y||Error("stream was destroyed"))}},EX=function(q){q()},F_=function(q,J){return q.pipe(J)},k_=function(){var q=Array.prototype.slice.call(arguments),J=U8(q[q.length-1]||w2)&&q.pop()||w2;if(Array.isArray(q[0]))q=q[0];if(q.length<2)throw Error("pump requires two streams per minimum");var X,Z=q.map(function(Q,$){var Y=$<q.length-1,H=$>0;return C_(Q,Y,H,function(K){if(!X)X=K;if(K)Z.forEach(EX);if(Y)return;Z.forEach(EX),J(X)})});return q.reduce(F_)};yX.exports=k_});var bX=k((PO,hX)=>{var{PassThrough:T_}=D("stream");hX.exports=(q)=>{q={...q};let{array:J}=q,{encoding:X}=q,Z=X==="buffer",Q=!1;if(J)Q=!(X||Z);else X=X||"utf8";if(Z)X=null;let $=new T_({objectMode:Q});if(X)$.setEncoding(X);let Y=0,H=[];return $.on("data",(K)=>{if(H.push(K),Q)Y=H.length;else Y+=K.length}),$.getBufferedValue=()=>{if(J)return H;return Z?Buffer.concat(H,Y):H.join("")},$.getBufferedLength=()=>Y,$}});var gX=k((AO,f6)=>{var{constants:w_}=D("buffer"),P_=SX(),A_=bX();class D3 extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function z8(q,J){if(!q)return Promise.reject(Error("Expected a stream"));J={maxBuffer:1/0,...J};let{maxBuffer:X}=J,Z;return await new Promise((Q,$)=>{let Y=(H)=>{if(H&&Z.getBufferedLength()<=w_.MAX_LENGTH)H.bufferedData=Z.getBufferedValue();$(H)};Z=P_(q,A_(J),(H)=>{if(H){Y(H);return}Q()}),Z.on("data",()=>{if(Z.getBufferedLength()>X)Y(new D3)})}),Z.getBufferedValue()}f6.exports=z8;f6.exports.default=z8;f6.exports.buffer=(q,J)=>z8(q,{...J,encoding:"buffer"});f6.exports.array=(q,J)=>z8(q,{...J,array:!0});f6.exports.MaxBufferError=D3});var dX=k((DO,mX)=>{mX.exports=_8;function _8(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}_8.prototype.go=function(q){if(this.pending<this.max)uX(this,q);else this.waiting.push(q)};_8.prototype.wait=function(q){if(this.pending===0)q(this.error);else this.listeners.push(q)};_8.prototype.hold=function(){return fX(this)};function fX(q){q.pending+=1;var J=!1;return X;function X(Q){if(J)throw Error("callback called twice");if(J=!0,q.error=q.error||Q,q.pending-=1,q.waiting.length>0&&q.pending<q.max)uX(q,q.waiting.shift());else if(q.pending===0){var $=q.listeners;q.listeners=[],$.forEach(Z)}}function Z(Q){Q(q.error)}}function uX(q,J){J(fX(q))}});var lX=k((N_)=>{var P2=D("fs"),L8=D("util"),I3=D("stream"),cX=I3.Readable,O3=I3.Writable,D_=I3.PassThrough,I_=dX(),B8=D("events").EventEmitter;N_.createFromBuffer=O_;N_.createFromFd=v_;N_.BufferSlicer=c0;N_.FdSlicer=d0;L8.inherits(d0,B8);function d0(q,J){J=J||{},B8.call(this),this.fd=q,this.pend=new I_,this.pend.max=1,this.refCount=0,this.autoClose=!!J.autoClose}d0.prototype.read=function(q,J,X,Z,Q){var $=this;$.pend.go(function(Y){P2.read($.fd,q,J,X,Z,function(H,K,G){Y(),Q(H,K,G)})})};d0.prototype.write=function(q,J,X,Z,Q){var $=this;$.pend.go(function(Y){P2.write($.fd,q,J,X,Z,function(H,K,G){Y(),Q(H,K,G)})})};d0.prototype.createReadStream=function(q){return new x8(this,q)};d0.prototype.createWriteStream=function(q){return new j8(this,q)};d0.prototype.ref=function(){this.refCount+=1};d0.prototype.unref=function(){var q=this;if(q.refCount-=1,q.refCount>0)return;if(q.refCount<0)throw Error("invalid unref");if(q.autoClose)P2.close(q.fd,J);function J(X){if(X)q.emit("error",X);else q.emit("close")}};L8.inherits(x8,cX);function x8(q,J){J=J||{},cX.call(this,J),this.context=q,this.context.ref(),this.start=J.start||0,this.endOffset=J.end,this.pos=this.start,this.destroyed=!1}x8.prototype._read=function(q){var J=this;if(J.destroyed)return;var X=Math.min(J._readableState.highWaterMark,q);if(J.endOffset!=null)X=Math.min(X,J.endOffset-J.pos);if(X<=0){J.destroyed=!0,J.push(null),J.context.unref();return}J.context.pend.go(function(Z){if(J.destroyed)return Z();var Q=new Buffer(X);P2.read(J.context.fd,Q,0,X,J.pos,function($,Y){if($)J.destroy($);else if(Y===0)J.destroyed=!0,J.push(null),J.context.unref();else J.pos+=Y,J.push(Q.slice(0,Y));Z()})})};x8.prototype.destroy=function(q){if(this.destroyed)return;q=q||Error("stream destroyed"),this.destroyed=!0,this.emit("error",q),this.context.unref()};L8.inherits(j8,O3);function j8(q,J){J=J||{},O3.call(this,J),this.context=q,this.context.ref(),this.start=J.start||0,this.endOffset=J.end==null?1/0:+J.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}j8.prototype._write=function(q,J,X){var Z=this;if(Z.destroyed)return;if(Z.pos+q.length>Z.endOffset){var Q=Error("maximum file length exceeded");Q.code="ETOOBIG",Z.destroy(),X(Q);return}Z.context.pend.go(function($){if(Z.destroyed)return $();P2.write(Z.context.fd,q,0,q.length,Z.pos,function(Y,H){if(Y)Z.destroy(),$(),X(Y);else Z.bytesWritten+=H,Z.pos+=H,Z.emit("progress"),$(),X()})})};j8.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=!0,this.context.unref()};L8.inherits(c0,B8);function c0(q,J){B8.call(this),J=J||{},this.refCount=0,this.buffer=q,this.maxChunkSize=J.maxChunkSize||Number.MAX_SAFE_INTEGER}c0.prototype.read=function(q,J,X,Z,Q){var $=Z+X,Y=$-this.buffer.length,H=Y>0?Y:X;this.buffer.copy(q,J,Z,$),setImmediate(function(){Q(null,H)})};c0.prototype.write=function(q,J,X,Z,Q){q.copy(this.buffer,Z,J,J+X),setImmediate(function(){Q(null,X,q)})};c0.prototype.createReadStream=function(q){q=q||{};var J=new D_(q);J.destroyed=!1,J.start=q.start||0,J.endOffset=q.end,J.pos=J.endOffset||this.buffer.length;var X=this.buffer.slice(J.start,J.pos),Z=0;while(!0){var Q=Z+this.maxChunkSize;if(Q>=X.length){if(Z<X.length)J.write(X.slice(Z,X.length));break}J.write(X.slice(Z,Q)),Z=Q}return J.end(),J.destroy=function(){J.destroyed=!0},J};c0.prototype.createWriteStream=function(q){var J=this;q=q||{};var X=new O3(q);return X.start=q.start||0,X.endOffset=q.end==null?this.buffer.length:+q.end,X.bytesWritten=0,X.pos=X.start,X.destroyed=!1,X._write=function(Z,Q,$){if(X.destroyed)return;var Y=X.pos+Z.length;if(Y>X.endOffset){var H=Error("maximum file length exceeded");H.code="ETOOBIG",X.destroyed=!0,$(H);return}Z.copy(J.buffer,X.pos,0,Z.length),X.bytesWritten+=Z.length,X.pos=Y,X.emit("progress"),$()},X.destroy=function(){X.destroyed=!0},X};c0.prototype.ref=function(){this.refCount+=1};c0.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")};function O_(q,J){return new c0(q,J)}function v_(q,J){return new d0(q,J)}});var iX=k((OO,nX)=>{var t0=D("buffer").Buffer,v3=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array<"u")v3=new Int32Array(v3);function pX(q){if(t0.isBuffer(q))return q;var J=typeof t0.alloc==="function"&&typeof t0.from==="function";if(typeof q==="number")return J?t0.alloc(q):new t0(q);else if(typeof q==="string")return J?t0.from(q):new t0(q);else throw Error("input must be buffer, number, or string, received "+typeof q)}function b_(q){var J=pX(4);return J.writeInt32BE(q,0),J}function N3(q,J){if(q=pX(q),t0.isBuffer(J))J=J.readUInt32BE(0);var X=~~J^-1;for(var Z=0;Z<q.length;Z++)X=v3[(X^q[Z])&255]^X>>>8;return X^-1}function E3(){return b_(N3.apply(null,arguments))}E3.signed=function(){return N3.apply(null,arguments)};E3.unsigned=function(){return N3.apply(null,arguments)>>>0};nX.exports=E3});var qZ=k((l_)=>{var y3=D("fs"),g_=D("zlib"),aX=lX(),f_=iX(),C8=D("util"),F8=D("events").EventEmitter,oX=D("stream").Transform,S3=D("stream").PassThrough,u_=D("stream").Writable;l_.open=m_;l_.fromFd=rX;l_.fromBuffer=d_;l_.fromRandomAccessReader=h3;l_.dosDateTimeToDate=tX;l_.validateFileName=eX;l_.ZipFile=e0;l_.Entry=A2;l_.RandomAccessReader=q6;function m_(q,J,X){if(typeof J==="function")X=J,J=null;if(J==null)J={};if(J.autoClose==null)J.autoClose=!0;if(J.lazyEntries==null)J.lazyEntries=!1;if(J.decodeStrings==null)J.decodeStrings=!0;if(J.validateEntrySizes==null)J.validateEntrySizes=!0;if(J.strictFileNames==null)J.strictFileNames=!1;if(X==null)X=M8;y3.open(q,"r",function(Z,Q){if(Z)return X(Z);rX(Q,J,function($,Y){if($)y3.close(Q,M8);X($,Y)})})}function rX(q,J,X){if(typeof J==="function")X=J,J=null;if(J==null)J={};if(J.autoClose==null)J.autoClose=!1;if(J.lazyEntries==null)J.lazyEntries=!1;if(J.decodeStrings==null)J.decodeStrings=!0;if(J.validateEntrySizes==null)J.validateEntrySizes=!0;if(J.strictFileNames==null)J.strictFileNames=!1;if(X==null)X=M8;y3.fstat(q,function(Z,Q){if(Z)return X(Z);var $=aX.createFromFd(q,{autoClose:!0});h3($,Q.size,J,X)})}function d_(q,J,X){if(typeof J==="function")X=J,J=null;if(J==null)J={};if(J.autoClose=!1,J.lazyEntries==null)J.lazyEntries=!1;if(J.decodeStrings==null)J.decodeStrings=!0;if(J.validateEntrySizes==null)J.validateEntrySizes=!0;if(J.strictFileNames==null)J.strictFileNames=!1;var Z=aX.createFromBuffer(q,{maxChunkSize:65536});h3(Z,q.length,J,X)}function h3(q,J,X,Z){if(typeof X==="function")Z=X,X=null;if(X==null)X={};if(X.autoClose==null)X.autoClose=!0;if(X.lazyEntries==null)X.lazyEntries=!1;if(X.decodeStrings==null)X.decodeStrings=!0;var Q=!!X.decodeStrings;if(X.validateEntrySizes==null)X.validateEntrySizes=!0;if(X.strictFileNames==null)X.strictFileNames=!1;if(Z==null)Z=M8;if(typeof J!=="number")throw Error("expected totalSize parameter to be a number");if(J>Number.MAX_SAFE_INTEGER)throw Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");q.ref();var $=22,Y=65535,H=Math.min($+Y,J),K=E0(H),G=J-K.length;u6(q,K,0,H,G,function(V){if(V)return Z(V);for(var W=H-$;W>=0;W-=1){if(K.readUInt32LE(W)!==101010256)continue;var U=K.slice(W),z=U.readUInt16LE(4);if(z!==0)return Z(Error("multi-disk zip files are not supported: found disk number: "+z));var _=U.readUInt16LE(10),L=U.readUInt32LE(16),x=U.readUInt16LE(20),B=U.length-$;if(x!==B)return Z(Error("invalid comment length. expected: "+B+". found: "+x));var j=Q?R8(U,22,U.length,!1):U.slice(22);if(!(_===65535||L===4294967295))return Z(null,new e0(q,L,J,_,j,X.autoClose,X.lazyEntries,Q,X.validateEntrySizes,X.strictFileNames));var R=E0(20),F=G+W-R.length;u6(q,R,0,R.length,F,function(C){if(C)return Z(C);if(R.readUInt32LE(0)!==117853008)return Z(Error("invalid zip64 end of central directory locator signature"));var y=m6(R,8),O=E0(56);u6(q,O,0,O.length,y,function(g){if(g)return Z(g);if(O.readUInt32LE(0)!==101075792)return Z(Error("invalid zip64 end of central directory record signature"));return _=m6(O,32),L=m6(O,48),Z(null,new e0(q,L,J,_,j,X.autoClose,X.lazyEntries,Q,X.validateEntrySizes,X.strictFileNames))})});return}Z(Error("end of central directory record signature not found"))})}C8.inherits(e0,F8);function e0(q,J,X,Z,Q,$,Y,H,K,G){var V=this;if(F8.call(V),V.reader=q,V.reader.on("error",function(W){sX(V,W)}),V.reader.once("close",function(){V.emit("close")}),V.readEntryCursor=J,V.fileSize=X,V.entryCount=Z,V.comment=Q,V.entriesRead=0,V.autoClose=!!$,V.lazyEntries=!!Y,V.decodeStrings=!!H,V.validateEntrySizes=!!K,V.strictFileNames=!!G,V.isOpen=!0,V.emittedError=!1,!V.lazyEntries)V._readEntry()}e0.prototype.close=function(){if(!this.isOpen)return;this.isOpen=!1,this.reader.unref()};function F0(q,J){if(q.autoClose)q.close();sX(q,J)}function sX(q,J){if(q.emittedError)return;q.emittedError=!0,q.emit("error",J)}e0.prototype.readEntry=function(){if(!this.lazyEntries)throw Error("readEntry() called without lazyEntries:true");this._readEntry()};e0.prototype._readEntry=function(){var q=this;if(q.entryCount===q.entriesRead){setImmediate(function(){if(q.autoClose)q.close();if(q.emittedError)return;q.emit("end")});return}if(q.emittedError)return;var J=E0(46);u6(q.reader,J,0,J.length,q.readEntryCursor,function(X){if(X)return F0(q,X);if(q.emittedError)return;var Z=new A2,Q=J.readUInt32LE(0);if(Q!==33639248)return F0(q,Error("invalid central directory file header signature: 0x"+Q.toString(16)));if(Z.versionMadeBy=J.readUInt16LE(4),Z.versionNeededToExtract=J.readUInt16LE(6),Z.generalPurposeBitFlag=J.readUInt16LE(8),Z.compressionMethod=J.readUInt16LE(10),Z.lastModFileTime=J.readUInt16LE(12),Z.lastModFileDate=J.readUInt16LE(14),Z.crc32=J.readUInt32LE(16),Z.compressedSize=J.readUInt32LE(20),Z.uncompressedSize=J.readUInt32LE(24),Z.fileNameLength=J.readUInt16LE(28),Z.extraFieldLength=J.readUInt16LE(30),Z.fileCommentLength=J.readUInt16LE(32),Z.internalFileAttributes=J.readUInt16LE(36),Z.externalFileAttributes=J.readUInt32LE(38),Z.relativeOffsetOfLocalHeader=J.readUInt32LE(42),Z.generalPurposeBitFlag&64)return F0(q,Error("strong encryption is not supported"));q.readEntryCursor+=46,J=E0(Z.fileNameLength+Z.extraFieldLength+Z.fileCommentLength),u6(q.reader,J,0,J.length,q.readEntryCursor,function($){if($)return F0(q,$);if(q.emittedError)return;var Y=(Z.generalPurposeBitFlag&2048)!==0;Z.fileName=q.decodeStrings?R8(J,0,Z.fileNameLength,Y):J.slice(0,Z.fileNameLength);var H=Z.fileNameLength+Z.extraFieldLength,K=J.slice(Z.fileNameLength,H);Z.extraFields=[];var G=0;while(G<K.length-3){var V=K.readUInt16LE(G+0),W=K.readUInt16LE(G+2),U=G+4,z=U+W;if(z>K.length)return F0(q,Error("extra field length exceeds extra field buffer size"));var _=E0(W);K.copy(_,0,U,z),Z.extraFields.push({id:V,data:_}),G=z}if(Z.fileComment=q.decodeStrings?R8(J,H,H+Z.fileCommentLength,Y):J.slice(H,H+Z.fileCommentLength),Z.comment=Z.fileComment,q.readEntryCursor+=J.length,q.entriesRead+=1,Z.uncompressedSize===4294967295||Z.compressedSize===4294967295||Z.relativeOffsetOfLocalHeader===4294967295){var L=null;for(var G=0;G<Z.extraFields.length;G++){var x=Z.extraFields[G];if(x.id===1){L=x.data;break}}if(L==null)return F0(q,Error("expected zip64 extended information extra field"));var B=0;if(Z.uncompressedSize===4294967295){if(B+8>L.length)return F0(q,Error("zip64 extended information extra field does not include uncompressed size"));Z.uncompressedSize=m6(L,B),B+=8}if(Z.compressedSize===4294967295){if(B+8>L.length)return F0(q,Error("zip64 extended information extra field does not include compressed size"));Z.compressedSize=m6(L,B),B+=8}if(Z.relativeOffsetOfLocalHeader===4294967295){if(B+8>L.length)return F0(q,Error("zip64 extended information extra field does not include relative header offset"));Z.relativeOffsetOfLocalHeader=m6(L,B),B+=8}}if(q.decodeStrings)for(var G=0;G<Z.extraFields.length;G++){var x=Z.extraFields[G];if(x.id===28789){if(x.data.length<6)continue;if(x.data.readUInt8(0)!==1)continue;var j=x.data.readUInt32LE(1);if(f_.unsigned(J.slice(0,Z.fileNameLength))!==j)continue;Z.fileName=R8(x.data,5,x.data.length,!0);break}}if(q.validateEntrySizes&&Z.compressionMethod===0){var R=Z.uncompressedSize;if(Z.isEncrypted())R+=12;if(Z.compressedSize!==R){var F="compressed/uncompressed size mismatch for stored file: "+Z.compressedSize+" != "+Z.uncompressedSize;return F0(q,Error(F))}}if(q.decodeStrings){if(!q.strictFileNames)Z.fileName=Z.fileName.replace(/\\/g,"/");var C=eX(Z.fileName,q.validateFileNameOptions);if(C!=null)return F0(q,Error(C))}if(q.emit("entry",Z),!q.lazyEntries)q._readEntry()})})};e0.prototype.openReadStream=function(q,J,X){var Z=this,Q=0,$=q.compressedSize;if(X==null)X=J,J={};else{if(J.decrypt!=null){if(!q.isEncrypted())throw Error("options.decrypt can only be specified for encrypted entries");if(J.decrypt!==!1)throw Error("invalid options.decrypt value: "+J.decrypt);if(q.isCompressed()){if(J.decompress!==!1)throw Error("entry is encrypted and compressed, and options.decompress !== false")}}if(J.decompress!=null){if(!q.isCompressed())throw Error("options.decompress can only be specified for compressed entries");if(!(J.decompress===!1||J.decompress===!0))throw Error("invalid options.decompress value: "+J.decompress)}if(J.start!=null||J.end!=null){if(q.isCompressed()&&J.decompress!==!1)throw Error("start/end range not allowed for compressed entry without options.decompress === false");if(q.isEncrypted()&&J.decrypt!==!1)throw Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(J.start!=null){if(Q=J.start,Q<0)throw Error("options.start < 0");if(Q>q.compressedSize)throw Error("options.start > entry.compressedSize")}if(J.end!=null){if($=J.end,$<0)throw Error("options.end < 0");if($>q.compressedSize)throw Error("options.end > entry.compressedSize");if($<Q)throw Error("options.end < options.start")}}if(!Z.isOpen)return X(Error("closed"));if(q.isEncrypted()){if(J.decrypt!==!1)return X(Error("entry is encrypted, and options.decrypt !== false"))}Z.reader.ref();var Y=E0(30);u6(Z.reader,Y,0,Y.length,q.relativeOffsetOfLocalHeader,function(H){try{if(H)return X(H);var K=Y.readUInt32LE(0);if(K!==67324752)return X(Error("invalid local file header signature: 0x"+K.toString(16)));var G=Y.readUInt16LE(26),V=Y.readUInt16LE(28),W=q.relativeOffsetOfLocalHeader+Y.length+G+V,U;if(q.compressionMethod===0)U=!1;else if(q.compressionMethod===8)U=J.decompress!=null?J.decompress:!0;else return X(Error("unsupported compression method: "+q.compressionMethod));var z=W,_=z+q.compressedSize;if(q.compressedSize!==0){if(_>Z.fileSize)return X(Error("file data overflows file bounds: "+z+" + "+q.compressedSize+" > "+Z.fileSize))}var L=Z.reader.createReadStream({start:z+Q,end:z+$}),x=L;if(U){var B=!1,j=g_.createInflateRaw();if(L.on("error",function(R){setImmediate(function(){if(!B)j.emit("error",R)})}),L.pipe(j),Z.validateEntrySizes)x=new D2(q.uncompressedSize),j.on("error",function(R){setImmediate(function(){if(!B)x.emit("error",R)})}),j.pipe(x);else x=j;x.destroy=function(){if(B=!0,j!==x)j.unpipe(x);L.unpipe(j),L.destroy()}}X(null,x)}finally{Z.reader.unref()}})};function A2(){}A2.prototype.getLastModDate=function(){return tX(this.lastModFileDate,this.lastModFileTime)};A2.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};A2.prototype.isCompressed=function(){return this.compressionMethod===8};function tX(q,J){var X=q&31,Z=(q>>5&15)-1,Q=(q>>9&127)+1980,$=0,Y=(J&31)*2,H=J>>5&63,K=J>>11&31;return new Date(Q,Z,X,K,H,Y,$)}function eX(q){if(q.indexOf("\\")!==-1)return"invalid characters in fileName: "+q;if(/^[a-zA-Z]:/.test(q)||/^\//.test(q))return"absolute path: "+q;if(q.split("/").indexOf("..")!==-1)return"invalid relative path: "+q;return null}function u6(q,J,X,Z,Q,$){if(Z===0)return setImmediate(function(){$(null,E0(0))});q.read(J,X,Z,Q,function(Y,H){if(Y)return $(Y);if(H<Z)return $(Error("unexpected EOF"));$()})}C8.inherits(D2,oX);function D2(q){oX.call(this),this.actualByteCount=0,this.expectedByteCount=q}D2.prototype._transform=function(q,J,X){if(this.actualByteCount+=q.length,this.actualByteCount>this.expectedByteCount){var Z="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return X(Error(Z))}X(null,q)};D2.prototype._flush=function(q){if(this.actualByteCount<this.expectedByteCount){var J="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return q(Error(J))}q()};C8.inherits(q6,F8);function q6(){F8.call(this),this.refCount=0}q6.prototype.ref=function(){this.refCount+=1};q6.prototype.unref=function(){var q=this;if(q.refCount-=1,q.refCount>0)return;if(q.refCount<0)throw Error("invalid unref");q.close(J);function J(X){if(X)return q.emit("error",X);q.emit("close")}};q6.prototype.createReadStream=function(q){var{start:J,end:X}=q;if(J===X){var Z=new S3;return setImmediate(function(){Z.end()}),Z}var Q=this._readStreamForRange(J,X),$=!1,Y=new k8(this);Q.on("error",function(K){setImmediate(function(){if(!$)Y.emit("error",K)})}),Y.destroy=function(){Q.unpipe(Y),Y.unref(),Q.destroy()};var H=new D2(X-J);return Y.on("error",function(K){setImmediate(function(){if(!$)H.emit("error",K)})}),H.destroy=function(){$=!0,Y.unpipe(H),Y.destroy()},Q.pipe(Y).pipe(H)};q6.prototype._readStreamForRange=function(q,J){throw Error("not implemented")};q6.prototype.read=function(q,J,X,Z,Q){var $=this.createReadStream({start:Z,end:Z+X}),Y=new u_,H=0;Y._write=function(K,G,V){K.copy(q,J+H,0,K.length),H+=K.length,V()},Y.on("finish",Q),$.on("error",function(K){Q(K)}),$.pipe(Y)};q6.prototype.close=function(q){setImmediate(q)};C8.inherits(k8,S3);function k8(q){S3.call(this),this.context=q,this.context.ref(),this.unreffedYet=!1}k8.prototype._flush=function(q){this.unref(),q()};k8.prototype.unref=function(q){if(this.unreffedYet)return;this.unreffedYet=!0,this.context.unref()};var c_="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function R8(q,J,X,Z){if(Z)return q.toString("utf8",J,X);else{var Q="";for(var $=J;$<X;$++)Q+=c_[q[$]];return Q}}function m6(q,J){var X=q.readUInt32LE(J),Z=q.readUInt32LE(J+4);return Z*4294967296+X}var E0;if(typeof Buffer.allocUnsafe==="function")E0=function(q){return Buffer.allocUnsafe(q)};else E0=function(q){return new Buffer(q)};function M8(q){if(q)throw q}});var ZZ=k((NO,XZ)=>{var k0=qL()("extract-zip"),{createWriteStream:JL,promises:d6}=D("fs"),XL=gX(),j6=D("path"),{promisify:b3}=D("util"),ZL=D("stream"),QL=qZ(),$L=b3(QL.open),YL=b3(ZL.pipeline);class JZ{constructor(q,J){this.zipPath=q,this.opts=J}async extract(){return k0("opening",this.zipPath,"with opts",this.opts),this.zipfile=await $L(this.zipPath,{lazyEntries:!0}),this.canceled=!1,new Promise((q,J)=>{this.zipfile.on("error",(X)=>{this.canceled=!0,J(X)}),this.zipfile.readEntry(),this.zipfile.on("close",()=>{if(!this.canceled)k0("zip extraction complete"),q()}),this.zipfile.on("entry",async(X)=>{if(this.canceled){k0("skipping entry",X.fileName,{cancelled:this.canceled});return}if(k0("zipfile entry",X.fileName),X.fileName.startsWith("__MACOSX/")){this.zipfile.readEntry();return}let Z=j6.dirname(j6.join(this.opts.dir,X.fileName));try{await d6.mkdir(Z,{recursive:!0});let Q=await d6.realpath(Z);if(j6.relative(this.opts.dir,Q).split(j6.sep).includes(".."))throw Error(`Out of bound path "${Q}" found while processing file ${X.fileName}`);await this.extractEntry(X),k0("finished processing",X.fileName),this.zipfile.readEntry()}catch(Q){this.canceled=!0,this.zipfile.close(),J(Q)}})})}async extractEntry(q){if(this.canceled){k0("skipping entry extraction",q.fileName,{cancelled:this.canceled});return}if(this.opts.onEntry)this.opts.onEntry(q,this.zipfile);let J=j6.join(this.opts.dir,q.fileName),X=q.externalFileAttributes>>16&65535,Z=61440,Q=16384,$=40960,Y=(X&Z)===$,H=(X&Z)===Q;if(!H&&q.fileName.endsWith("/"))H=!0;let K=q.versionMadeBy>>8;if(!H)H=K===0&&q.externalFileAttributes===16;k0("extracting entry",{filename:q.fileName,isDir:H,isSymlink:Y});let G=this.getExtractedMode(X,H)&511,V=H?J:j6.dirname(J),W={recursive:!0};if(H)W.mode=G;if(k0("mkdir",{dir:V,...W}),await d6.mkdir(V,W),H)return;k0("opening read stream",J);let U=await b3(this.zipfile.openReadStream.bind(this.zipfile))(q);if(Y){let z=await XL(U);k0("creating symlink",z,J),await d6.symlink(z,J)}else await YL(U,JL(J,{mode:G}))}getExtractedMode(q,J){let X=q;if(X===0)if(J){if(this.opts.defaultDirMode)X=parseInt(this.opts.defaultDirMode,10);if(!X)X=493}else{if(this.opts.defaultFileMode)X=parseInt(this.opts.defaultFileMode,10);if(!X)X=420}return X}}XZ.exports=async function(q,J){if(k0("creating target directory",J.dir),!j6.isAbsolute(J.dir))throw Error("Target directory is expected to be absolute");return await d6.mkdir(J.dir,{recursive:!0}),J.dir=await d6.realpath(J.dir),new JZ(q,J).extract()}});var l=k((HL)=>{HL.fromCallback=function(q){return Object.defineProperty(function(...J){if(typeof J[J.length-1]==="function")q.apply(this,J);else return new Promise((X,Z)=>{J.push((Q,$)=>Q!=null?Z(Q):X($)),q.apply(this,J)})},"name",{value:q.name})};HL.fromPromise=function(q){return Object.defineProperty(function(...J){let X=J[J.length-1];if(typeof X!=="function")return q.apply(this,J);else J.pop(),q.apply(this,J).then((Z)=>X(null,Z),X)},"name",{value:q.name})}});var $Z=k((yO,QZ)=>{var J6=D("constants"),GL=process.cwd,T8=null,WL=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!T8)T8=GL.call(process);return T8};try{process.cwd()}catch(q){}if(typeof process.chdir==="function"){if(w8=process.chdir,process.chdir=function(q){T8=null,w8.call(process,q)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,w8)}var w8;QZ.exports=UL;function UL(q){if(J6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))J(q);if(!q.lutimes)X(q);if(q.chown=$(q.chown),q.fchown=$(q.fchown),q.lchown=$(q.lchown),q.chmod=Z(q.chmod),q.fchmod=Z(q.fchmod),q.lchmod=Z(q.lchmod),q.chownSync=Y(q.chownSync),q.fchownSync=Y(q.fchownSync),q.lchownSync=Y(q.lchownSync),q.chmodSync=Q(q.chmodSync),q.fchmodSync=Q(q.fchmodSync),q.lchmodSync=Q(q.lchmodSync),q.stat=H(q.stat),q.fstat=H(q.fstat),q.lstat=H(q.lstat),q.statSync=K(q.statSync),q.fstatSync=K(q.fstatSync),q.lstatSync=K(q.lstatSync),q.chmod&&!q.lchmod)q.lchmod=function(V,W,U){if(U)process.nextTick(U)},q.lchmodSync=function(){};if(q.chown&&!q.lchown)q.lchown=function(V,W,U,z){if(z)process.nextTick(z)},q.lchownSync=function(){};if(WL==="win32")q.rename=typeof q.rename!=="function"?q.rename:function(V){function W(U,z,_){var L=Date.now(),x=0;V(U,z,function B(j){if(j&&(j.code==="EACCES"||j.code==="EPERM"||j.code==="EBUSY")&&Date.now()-L<60000){if(setTimeout(function(){q.stat(z,function(R,F){if(R&&R.code==="ENOENT")V(U,z,B);else _(j)})},x),x<100)x+=10;return}if(_)_(j)})}if(Object.setPrototypeOf)Object.setPrototypeOf(W,V);return W}(q.rename);q.read=typeof q.read!=="function"?q.read:function(V){function W(U,z,_,L,x,B){var j;if(B&&typeof B==="function"){var R=0;j=function(F,C,y){if(F&&F.code==="EAGAIN"&&R<10)return R++,V.call(q,U,z,_,L,x,j);B.apply(this,arguments)}}return V.call(q,U,z,_,L,x,j)}if(Object.setPrototypeOf)Object.setPrototypeOf(W,V);return W}(q.read),q.readSync=typeof q.readSync!=="function"?q.readSync:function(V){return function(W,U,z,_,L){var x=0;while(!0)try{return V.call(q,W,U,z,_,L)}catch(B){if(B.code==="EAGAIN"&&x<10){x++;continue}throw B}}}(q.readSync);function J(V){V.lchmod=function(W,U,z){V.open(W,J6.O_WRONLY|J6.O_SYMLINK,U,function(_,L){if(_){if(z)z(_);return}V.fchmod(L,U,function(x){V.close(L,function(B){if(z)z(x||B)})})})},V.lchmodSync=function(W,U){var z=V.openSync(W,J6.O_WRONLY|J6.O_SYMLINK,U),_=!0,L;try{L=V.fchmodSync(z,U),_=!1}finally{if(_)try{V.closeSync(z)}catch(x){}else V.closeSync(z)}return L}}function X(V){if(J6.hasOwnProperty("O_SYMLINK")&&V.futimes)V.lutimes=function(W,U,z,_){V.open(W,J6.O_SYMLINK,function(L,x){if(L){if(_)_(L);return}V.futimes(x,U,z,function(B){V.close(x,function(j){if(_)_(B||j)})})})},V.lutimesSync=function(W,U,z){var _=V.openSync(W,J6.O_SYMLINK),L,x=!0;try{L=V.futimesSync(_,U,z),x=!1}finally{if(x)try{V.closeSync(_)}catch(B){}else V.closeSync(_)}return L};else if(V.futimes)V.lutimes=function(W,U,z,_){if(_)process.nextTick(_)},V.lutimesSync=function(){}}function Z(V){if(!V)return V;return function(W,U,z){return V.call(q,W,U,function(_){if(G(_))_=null;if(z)z.apply(this,arguments)})}}function Q(V){if(!V)return V;return function(W,U){try{return V.call(q,W,U)}catch(z){if(!G(z))throw z}}}function $(V){if(!V)return V;return function(W,U,z,_){return V.call(q,W,U,z,function(L){if(G(L))L=null;if(_)_.apply(this,arguments)})}}function Y(V){if(!V)return V;return function(W,U,z){try{return V.call(q,W,U,z)}catch(_){if(!G(_))throw _}}}function H(V){if(!V)return V;return function(W,U,z){if(typeof U==="function")z=U,U=null;function _(L,x){if(x){if(x.uid<0)x.uid+=4294967296;if(x.gid<0)x.gid+=4294967296}if(z)z.apply(this,arguments)}return U?V.call(q,W,U,_):V.call(q,W,_)}}function K(V){if(!V)return V;return function(W,U){var z=U?V.call(q,W,U):V.call(q,W);if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}return z}}function G(V){if(!V)return!0;if(V.code==="ENOSYS")return!0;var W=!process.getuid||process.getuid()!==0;if(W){if(V.code==="EINVAL"||V.code==="EPERM")return!0}return!1}}});var KZ=k((SO,HZ)=>{var YZ=D("stream").Stream;HZ.exports=zL;function zL(q){return{ReadStream:J,WriteStream:X};function J(Z,Q){if(!(this instanceof J))return new J(Z,Q);YZ.call(this);var $=this;this.path=Z,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Q=Q||{};var Y=Object.keys(Q);for(var H=0,K=Y.length;H<K;H++){var G=Y[H];this[G]=Q[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){$._read()});return}q.open(this.path,this.flags,this.mode,function(V,W){if(V){$.emit("error",V),$.readable=!1;return}$.fd=W,$.emit("open",W),$._read()})}function X(Z,Q){if(!(this instanceof X))return new X(Z,Q);YZ.call(this),this.path=Z,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Q=Q||{};var $=Object.keys(Q);for(var Y=0,H=$.length;Y<H;Y++){var K=$[Y];this[K]=Q[K]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=q.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var GZ=k((hO,VZ)=>{VZ.exports=LL;var _L=Object.getPrototypeOf||function(q){return q.__proto__};function LL(q){if(q===null||typeof q!=="object")return q;if(q instanceof Object)var J={__proto__:_L(q)};else var J=Object.create(null);return Object.getOwnPropertyNames(q).forEach(function(X){Object.defineProperty(J,X,Object.getOwnPropertyDescriptor(q,X))}),J}});var l6=k((bO,m3)=>{var E=D("fs"),BL=$Z(),xL=KZ(),jL=GZ(),P8=D("util"),s,D8;if(typeof Symbol==="function"&&typeof Symbol.for==="function")s=Symbol.for("graceful-fs.queue"),D8=Symbol.for("graceful-fs.previous");else s="___graceful-fs.queue",D8="___graceful-fs.previous";function RL(){}function UZ(q,J){Object.defineProperty(q,s,{get:function(){return J}})}var R6=RL;if(P8.debuglog)R6=P8.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))R6=function(){var q=P8.format.apply(P8,arguments);q="GFS4: "+q.split(/\n/).join(`
2
+ GFS4: `),console.error(q)};if(!E[s]){if(g3=global[s]||[],UZ(E,g3),E.close=function(q){function J(X,Z){return q.call(E,X,function(Q){if(!Q)WZ();if(typeof Z==="function")Z.apply(this,arguments)})}return Object.defineProperty(J,D8,{value:q}),J}(E.close),E.closeSync=function(q){function J(X){q.apply(E,arguments),WZ()}return Object.defineProperty(J,D8,{value:q}),J}(E.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){R6(E[s]),D("assert").equal(E[s].length,0)})}var g3;if(!global[s])UZ(global,E[s]);m3.exports=f3(jL(E));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!E.__patched)m3.exports=f3(E),E.__patched=!0;function f3(q){BL(q),q.gracefulify=f3,q.createReadStream=C,q.createWriteStream=y;var J=q.readFile;q.readFile=X;function X(M,P,A){if(typeof P==="function")A=P,P=null;return n(M,P,A);function n(i,u,N,S){return J(i,u,function(I){if(I&&(I.code==="EMFILE"||I.code==="ENFILE"))c6([n,[i,u,N],I,S||Date.now(),Date.now()]);else if(typeof N==="function")N.apply(this,arguments)})}}var Z=q.writeFile;q.writeFile=Q;function Q(M,P,A,n){if(typeof A==="function")n=A,A=null;return i(M,P,A,n);function i(u,N,S,I,a){return Z(u,N,S,function(v){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))c6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var $=q.appendFile;if($)q.appendFile=Y;function Y(M,P,A,n){if(typeof A==="function")n=A,A=null;return i(M,P,A,n);function i(u,N,S,I,a){return $(u,N,S,function(v){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))c6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var H=q.copyFile;if(H)q.copyFile=K;function K(M,P,A,n){if(typeof A==="function")n=A,A=0;return i(M,P,A,n);function i(u,N,S,I,a){return H(u,N,S,function(v){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))c6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var G=q.readdir;q.readdir=W;var V=/^v[0-5]\./;function W(M,P,A){if(typeof P==="function")A=P,P=null;var n=V.test(process.version)?function(N,S,I,a){return G(N,i(N,S,I,a))}:function(N,S,I,a){return G(N,S,i(N,S,I,a))};return n(M,P,A);function i(u,N,S,I){return function(a,v){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))c6([n,[u,N,S],a,I||Date.now(),Date.now()]);else{if(v&&v.sort)v.sort();if(typeof S==="function")S.call(this,a,v)}}}}if(process.version.substr(0,4)==="v0.8"){var U=xL(q);B=U.ReadStream,R=U.WriteStream}var z=q.ReadStream;if(z)B.prototype=Object.create(z.prototype),B.prototype.open=j;var _=q.WriteStream;if(_)R.prototype=Object.create(_.prototype),R.prototype.open=F;Object.defineProperty(q,"ReadStream",{get:function(){return B},set:function(M){B=M},enumerable:!0,configurable:!0}),Object.defineProperty(q,"WriteStream",{get:function(){return R},set:function(M){R=M},enumerable:!0,configurable:!0});var L=B;Object.defineProperty(q,"FileReadStream",{get:function(){return L},set:function(M){L=M},enumerable:!0,configurable:!0});var x=R;Object.defineProperty(q,"FileWriteStream",{get:function(){return x},set:function(M){x=M},enumerable:!0,configurable:!0});function B(M,P){if(this instanceof B)return z.apply(this,arguments),this;else return B.apply(Object.create(B.prototype),arguments)}function j(){var M=this;g(M.path,M.flags,M.mode,function(P,A){if(P){if(M.autoClose)M.destroy();M.emit("error",P)}else M.fd=A,M.emit("open",A),M.read()})}function R(M,P){if(this instanceof R)return _.apply(this,arguments),this;else return R.apply(Object.create(R.prototype),arguments)}function F(){var M=this;g(M.path,M.flags,M.mode,function(P,A){if(P)M.destroy(),M.emit("error",P);else M.fd=A,M.emit("open",A)})}function C(M,P){return new q.ReadStream(M,P)}function y(M,P){return new q.WriteStream(M,P)}var O=q.open;q.open=g;function g(M,P,A,n){if(typeof A==="function")n=A,A=null;return i(M,P,A,n);function i(u,N,S,I,a){return O(u,N,S,function(v,Gj){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))c6([i,[u,N,S,I],v,a||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}return q}function c6(q){R6("ENQUEUE",q[0].name,q[1]),E[s].push(q),u3()}var A8;function WZ(){var q=Date.now();for(var J=0;J<E[s].length;++J)if(E[s][J].length>2)E[s][J][3]=q,E[s][J][4]=q;u3()}function u3(){if(clearTimeout(A8),A8=void 0,E[s].length===0)return;var q=E[s].shift(),J=q[0],X=q[1],Z=q[2],Q=q[3],$=q[4];if(Q===void 0)R6("RETRY",J.name,X),J.apply(null,X);else if(Date.now()-Q>=60000){R6("TIMEOUT",J.name,X);var Y=X.pop();if(typeof Y==="function")Y.call(null,Z)}else{var H=Date.now()-$,K=Math.max($-Q,1),G=Math.min(K*1.2,100);if(H>=G)R6("RETRY",J.name,X),J.apply(null,X.concat([Q]));else E[s].push(q)}if(A8===void 0)A8=setTimeout(u3,0)}});var Q0=k((d3)=>{var zZ=l().fromCallback,Z0=l6(),ML=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((q)=>{return typeof Z0[q]==="function"});Object.assign(d3,Z0);ML.forEach((q)=>{d3[q]=zZ(Z0[q])});d3.exists=function(q,J){if(typeof J==="function")return Z0.exists(q,J);return new Promise((X)=>{return Z0.exists(q,X)})};d3.read=function(q,J,X,Z,Q,$){if(typeof $==="function")return Z0.read(q,J,X,Z,Q,$);return new Promise((Y,H)=>{Z0.read(q,J,X,Z,Q,(K,G,V)=>{if(K)return H(K);Y({bytesRead:G,buffer:V})})})};d3.write=function(q,J,...X){if(typeof X[X.length-1]==="function")return Z0.write(q,J,...X);return new Promise((Z,Q)=>{Z0.write(q,J,...X,($,Y,H)=>{if($)return Q($);Z({bytesWritten:Y,buffer:H})})})};d3.readv=function(q,J,...X){if(typeof X[X.length-1]==="function")return Z0.readv(q,J,...X);return new Promise((Z,Q)=>{Z0.readv(q,J,...X,($,Y,H)=>{if($)return Q($);Z({bytesRead:Y,buffers:H})})})};d3.writev=function(q,J,...X){if(typeof X[X.length-1]==="function")return Z0.writev(q,J,...X);return new Promise((Z,Q)=>{Z0.writev(q,J,...X,($,Y,H)=>{if($)return Q($);Z({bytesWritten:Y,buffers:H})})})};if(typeof Z0.realpath.native==="function")d3.realpath.native=zZ(Z0.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var LZ=k((AL,_Z)=>{var PL=D("path");AL.checkPath=function(J){if(process.platform==="win32"){if(/[<>:"|?*]/.test(J.replace(PL.parse(J).root,""))){let Z=Error(`Path contains invalid characters: ${J}`);throw Z.code="EINVAL",Z}}}});var RZ=k((IL,c3)=>{var BZ=Q0(),{checkPath:xZ}=LZ(),jZ=(q)=>{let J={mode:511};if(typeof q==="number")return q;return{...J,...q}.mode};IL.makeDir=async(q,J)=>{return xZ(q),BZ.mkdir(q,{mode:jZ(J),recursive:!0})};IL.makeDirSync=(q,J)=>{return xZ(q),BZ.mkdirSync(q,{mode:jZ(J),recursive:!0})}});var T0=k((uO,MZ)=>{var NL=l().fromPromise,{makeDir:EL,makeDirSync:l3}=RZ(),p3=NL(EL);MZ.exports={mkdirs:p3,mkdirsSync:l3,mkdirp:p3,mkdirpSync:l3,ensureDir:p3,ensureDirSync:l3}});var X6=k((mO,FZ)=>{var yL=l().fromPromise,CZ=Q0();function SL(q){return CZ.access(q).then(()=>!0).catch(()=>!1)}FZ.exports={pathExists:yL(SL),pathExistsSync:CZ.existsSync}});var n3=k((dO,kZ)=>{var p6=Q0(),hL=l().fromPromise;async function bL(q,J,X){let Z=await p6.open(q,"r+"),Q=null;try{await p6.futimes(Z,J,X)}finally{try{await p6.close(Z)}catch($){Q=$}}if(Q)throw Q}function gL(q,J,X){let Z=p6.openSync(q,"r+");return p6.futimesSync(Z,J,X),p6.closeSync(Z)}kZ.exports={utimesMillis:hL(bL),utimesMillisSync:gL}});var M6=k((cO,AZ)=>{var n6=Q0(),p=D("path"),TZ=l().fromPromise;function fL(q,J,X){let Z=X.dereference?(Q)=>n6.stat(Q,{bigint:!0}):(Q)=>n6.lstat(Q,{bigint:!0});return Promise.all([Z(q),Z(J).catch((Q)=>{if(Q.code==="ENOENT")return null;throw Q})]).then(([Q,$])=>({srcStat:Q,destStat:$}))}function uL(q,J,X){let Z,Q=X.dereference?(Y)=>n6.statSync(Y,{bigint:!0}):(Y)=>n6.lstatSync(Y,{bigint:!0}),$=Q(q);try{Z=Q(J)}catch(Y){if(Y.code==="ENOENT")return{srcStat:$,destStat:null};throw Y}return{srcStat:$,destStat:Z}}async function mL(q,J,X,Z){let{srcStat:Q,destStat:$}=await fL(q,J,Z);if($){if(I2(Q,$)){let Y=p.basename(q),H=p.basename(J);if(X==="move"&&Y!==H&&Y.toLowerCase()===H.toLowerCase())return{srcStat:Q,destStat:$,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!$.isDirectory())throw Error(`Cannot overwrite non-directory '${J}' with directory '${q}'.`);if(!Q.isDirectory()&&$.isDirectory())throw Error(`Cannot overwrite directory '${J}' with non-directory '${q}'.`)}if(Q.isDirectory()&&i3(q,J))throw Error(I8(q,J,X));return{srcStat:Q,destStat:$}}function dL(q,J,X,Z){let{srcStat:Q,destStat:$}=uL(q,J,Z);if($){if(I2(Q,$)){let Y=p.basename(q),H=p.basename(J);if(X==="move"&&Y!==H&&Y.toLowerCase()===H.toLowerCase())return{srcStat:Q,destStat:$,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(Q.isDirectory()&&!$.isDirectory())throw Error(`Cannot overwrite non-directory '${J}' with directory '${q}'.`);if(!Q.isDirectory()&&$.isDirectory())throw Error(`Cannot overwrite directory '${J}' with non-directory '${q}'.`)}if(Q.isDirectory()&&i3(q,J))throw Error(I8(q,J,X));return{srcStat:Q,destStat:$}}async function wZ(q,J,X,Z){let Q=p.resolve(p.dirname(q)),$=p.resolve(p.dirname(X));if($===Q||$===p.parse($).root)return;let Y;try{Y=await n6.stat($,{bigint:!0})}catch(H){if(H.code==="ENOENT")return;throw H}if(I2(J,Y))throw Error(I8(q,X,Z));return wZ(q,J,$,Z)}function PZ(q,J,X,Z){let Q=p.resolve(p.dirname(q)),$=p.resolve(p.dirname(X));if($===Q||$===p.parse($).root)return;let Y;try{Y=n6.statSync($,{bigint:!0})}catch(H){if(H.code==="ENOENT")return;throw H}if(I2(J,Y))throw Error(I8(q,X,Z));return PZ(q,J,$,Z)}function I2(q,J){return J.ino!==void 0&&J.dev!==void 0&&J.ino===q.ino&&J.dev===q.dev}function i3(q,J){let X=p.resolve(q).split(p.sep).filter((Q)=>Q),Z=p.resolve(J).split(p.sep).filter((Q)=>Q);return X.every((Q,$)=>Z[$]===Q)}function I8(q,J,X){return`Cannot ${X} '${q}' to a subdirectory of itself, '${J}'.`}AZ.exports={checkPaths:TZ(mL),checkPathsSync:dL,checkParentPaths:TZ(wZ),checkParentPathsSync:PZ,isSrcSubdir:i3,areIdentical:I2}});var IZ=k((lO,DZ)=>{async function cL(q,J){let X=[];for await(let Z of q)X.push(J(Z).then(()=>null,(Q)=>Q??Error("unknown error")));await Promise.all(X.map((Z)=>Z.then((Q)=>{if(Q!==null)throw Q})))}DZ.exports={asyncIteratorConcurrentProcess:cL}});var yZ=k((pO,EZ)=>{var e=Q0(),O2=D("path"),{mkdirs:lL}=T0(),{pathExists:pL}=X6(),{utimesMillis:nL}=n3(),v2=M6(),{asyncIteratorConcurrentProcess:iL}=IZ();async function aL(q,J,X={}){if(typeof X==="function")X={filter:X};if(X.clobber="clobber"in X?!!X.clobber:!0,X.overwrite="overwrite"in X?!!X.overwrite:X.clobber,X.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
3
3
 
4
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:Z,destStat:Q}=await O2.checkPaths(q,J,"copy",X);if(await O2.checkParentPaths(q,Z,J,"copy"),!await wZ(q,J,X))return;let Y=I2.dirname(J);if(!await SL(Y))await yL(Y);await PZ(Q,q,J,X)}async function wZ(q,J,X){if(!X.filter)return!0;return X.filter(q,J)}async function PZ(q,J,X,Z){let $=await(Z.dereference?e.stat:e.lstat)(J);if($.isDirectory())return dL($,q,J,X,Z);if($.isFile()||$.isCharacterDevice()||$.isBlockDevice())return fL($,q,J,X,Z);if($.isSymbolicLink())return cL(q,J,X,Z);if($.isSocket())throw Error(`Cannot copy a socket file: ${J}`);if($.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${J}`);throw Error(`Unknown file: ${J}`)}async function fL(q,J,X,Z,Q){if(!J)return TZ(q,X,Z,Q);if(Q.overwrite)return await e.unlink(Z),TZ(q,X,Z,Q);if(Q.errorOnExist)throw Error(`'${Z}' already exists`)}async function TZ(q,J,X,Z){if(await e.copyFile(J,X),Z.preserveTimestamps){if(uL(q.mode))await mL(X,q.mode);let Q=await e.stat(J);await hL(X,Q.atime,Q.mtime)}return e.chmod(X,q.mode)}function uL(q){return(q&128)===0}function mL(q,J){return e.chmod(q,J|128)}async function dL(q,J,X,Z,Q){if(!J)await e.mkdir(Z);if(await bL(await e.opendir(X),async($)=>{let Y=I2.join(X,$.name),H=I2.join(Z,$.name);if(await wZ(Y,H,Q)){let{destStat:G}=await O2.checkPaths(Y,H,"copy",Q);await PZ(G,Y,H,Q)}}),!J)await e.chmod(Z,q.mode)}async function cL(q,J,X,Z){let Q=await e.readlink(J);if(Z.dereference)Q=I2.resolve(process.cwd(),Q);if(!q)return e.symlink(Q,X);let $=null;try{$=await e.readlink(X)}catch(Y){if(Y.code==="EINVAL"||Y.code==="UNKNOWN")return e.symlink(Q,X);throw Y}if(Z.dereference)$=I2.resolve(process.cwd(),$);if(Q!==$){if(O2.isSrcSubdir(Q,$))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${$}'.`);if(O2.isSrcSubdir($,Q))throw Error(`Cannot overwrite '${$}' with '${Q}'.`)}return await e.unlink(X),e.symlink(Q,X)}AZ.exports=gL});var EZ=k((yO,NZ)=>{var $0=d6(),v2=D("path"),lL=T0().mkdirsSync,pL=l3().utimesMillisSync,N2=j6();function nL(q,J,X){if(typeof X==="function")X={filter:X};if(X=X||{},X.clobber="clobber"in X?!!X.clobber:!0,X.overwrite="overwrite"in X?!!X.overwrite:X.clobber,X.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
4
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:Z,destStat:Q}=await v2.checkPaths(q,J,"copy",X);if(await v2.checkParentPaths(q,Z,J,"copy"),!await vZ(q,J,X))return;let Y=O2.dirname(J);if(!await pL(Y))await lL(Y);await NZ(Q,q,J,X)}async function vZ(q,J,X){if(!X.filter)return!0;return X.filter(q,J)}async function NZ(q,J,X,Z){let $=await(Z.dereference?e.stat:e.lstat)(J);if($.isDirectory())return tL($,q,J,X,Z);if($.isFile()||$.isCharacterDevice()||$.isBlockDevice())return oL($,q,J,X,Z);if($.isSymbolicLink())return eL(q,J,X,Z);if($.isSocket())throw Error(`Cannot copy a socket file: ${J}`);if($.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${J}`);throw Error(`Unknown file: ${J}`)}async function oL(q,J,X,Z,Q){if(!J)return OZ(q,X,Z,Q);if(Q.overwrite)return await e.unlink(Z),OZ(q,X,Z,Q);if(Q.errorOnExist)throw Error(`'${Z}' already exists`)}async function OZ(q,J,X,Z){if(await e.copyFile(J,X),Z.preserveTimestamps){if(rL(q.mode))await sL(X,q.mode);let Q=await e.stat(J);await nL(X,Q.atime,Q.mtime)}return e.chmod(X,q.mode)}function rL(q){return(q&128)===0}function sL(q,J){return e.chmod(q,J|128)}async function tL(q,J,X,Z,Q){if(!J)await e.mkdir(Z);if(await iL(await e.opendir(X),async($)=>{let Y=O2.join(X,$.name),H=O2.join(Z,$.name);if(await vZ(Y,H,Q)){let{destStat:G}=await v2.checkPaths(Y,H,"copy",Q);await NZ(G,Y,H,Q)}}),!J)await e.chmod(Z,q.mode)}async function eL(q,J,X,Z){let Q=await e.readlink(J);if(Z.dereference)Q=O2.resolve(process.cwd(),Q);if(!q)return e.symlink(Q,X);let $=null;try{$=await e.readlink(X)}catch(Y){if(Y.code==="EINVAL"||Y.code==="UNKNOWN")return e.symlink(Q,X);throw Y}if(Z.dereference)$=O2.resolve(process.cwd(),$);if(Q!==$){if(v2.isSrcSubdir(Q,$))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${$}'.`);if(v2.isSrcSubdir($,Q))throw Error(`Cannot overwrite '${$}' with '${Q}'.`)}return await e.unlink(X),e.symlink(Q,X)}EZ.exports=aL});var fZ=k((nO,gZ)=>{var $0=l6(),N2=D("path"),qB=T0().mkdirsSync,JB=n3().utimesMillisSync,E2=M6();function XB(q,J,X){if(typeof X==="function")X={filter:X};if(X=X||{},X.clobber="clobber"in X?!!X.clobber:!0,X.overwrite="overwrite"in X?!!X.overwrite:X.clobber,X.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
5
5
 
6
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:Z,destStat:Q}=N2.checkPathsSync(q,J,"copy",X);if(N2.checkParentPathsSync(q,Z,J,"copy"),X.filter&&!X.filter(q,J))return;let $=v2.dirname(J);if(!$0.existsSync($))lL($);return IZ(Q,q,J,X)}function IZ(q,J,X,Z){let $=(Z.dereference?$0.statSync:$0.lstatSync)(J);if($.isDirectory())return eL($,q,J,X,Z);else if($.isFile()||$.isCharacterDevice()||$.isBlockDevice())return iL($,q,J,X,Z);else if($.isSymbolicLink())return XB(q,J,X,Z);else if($.isSocket())throw Error(`Cannot copy a socket file: ${J}`);else if($.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${J}`);throw Error(`Unknown file: ${J}`)}function iL(q,J,X,Z,Q){if(!J)return OZ(q,X,Z,Q);return aL(q,X,Z,Q)}function aL(q,J,X,Z){if(Z.overwrite)return $0.unlinkSync(X),OZ(q,J,X,Z);else if(Z.errorOnExist)throw Error(`'${X}' already exists`)}function OZ(q,J,X,Z){if($0.copyFileSync(J,X),Z.preserveTimestamps)oL(q.mode,J,X);return n3(X,q.mode)}function oL(q,J,X){if(rL(q))sL(X,q);return tL(J,X)}function rL(q){return(q&128)===0}function sL(q,J){return n3(q,J|128)}function n3(q,J){return $0.chmodSync(q,J)}function tL(q,J){let X=$0.statSync(q);return pL(J,X.atime,X.mtime)}function eL(q,J,X,Z,Q){if(!J)return qB(q.mode,X,Z,Q);return vZ(X,Z,Q)}function qB(q,J,X,Z){return $0.mkdirSync(X),vZ(J,X,Z),n3(X,q)}function vZ(q,J,X){let Z=$0.opendirSync(q);try{let Q;while((Q=Z.readSync())!==null)JB(Q.name,q,J,X)}finally{Z.closeSync()}}function JB(q,J,X,Z){let Q=v2.join(J,q),$=v2.join(X,q);if(Z.filter&&!Z.filter(Q,$))return;let{destStat:Y}=N2.checkPathsSync(Q,$,"copy",Z);return IZ(Y,Q,$,Z)}function XB(q,J,X,Z){let Q=$0.readlinkSync(J);if(Z.dereference)Q=v2.resolve(process.cwd(),Q);if(!q)return $0.symlinkSync(Q,X);else{let $;try{$=$0.readlinkSync(X)}catch(Y){if(Y.code==="EINVAL"||Y.code==="UNKNOWN")return $0.symlinkSync(Q,X);throw Y}if(Z.dereference)$=v2.resolve(process.cwd(),$);if(Q!==$){if(N2.isSrcSubdir(Q,$))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${$}'.`);if(N2.isSrcSubdir($,Q))throw Error(`Cannot overwrite '${$}' with '${Q}'.`)}return ZB(Q,X)}}function ZB(q,J){return $0.unlinkSync(J),$0.symlinkSync(q,J)}NZ.exports=nL});var I8=k((SO,yZ)=>{var QB=l().fromPromise;yZ.exports={copy:QB(DZ()),copySync:EZ()}});var E2=k((hO,hZ)=>{var SZ=d6(),$B=l().fromCallback;function YB(q,J){SZ.rm(q,{recursive:!0,force:!0},J)}function HB(q){SZ.rmSync(q,{recursive:!0,force:!0})}hZ.exports={remove:$B(YB),removeSync:HB}});var lZ=k((bO,cZ)=>{var KB=l().fromPromise,fZ=Q0(),uZ=D("path"),mZ=T0(),dZ=E2(),bZ=KB(async function(J){let X;try{X=await fZ.readdir(J)}catch{return mZ.mkdirs(J)}return Promise.all(X.map((Z)=>dZ.remove(uZ.join(J,Z))))});function gZ(q){let J;try{J=fZ.readdirSync(q)}catch{return mZ.mkdirsSync(q)}J.forEach((X)=>{X=uZ.join(q,X),dZ.removeSync(X)})}cZ.exports={emptyDirSync:gZ,emptydirSync:gZ,emptyDir:bZ,emptydir:bZ}});var aZ=k((gO,iZ)=>{var VB=l().fromPromise,pZ=D("path"),l0=Q0(),nZ=T0();async function GB(q){let J;try{J=await l0.stat(q)}catch{}if(J&&J.isFile())return;let X=pZ.dirname(q),Z=null;try{Z=await l0.stat(X)}catch(Q){if(Q.code==="ENOENT"){await nZ.mkdirs(X),await l0.writeFile(q,"");return}else throw Q}if(Z.isDirectory())await l0.writeFile(q,"");else await l0.readdir(X)}function WB(q){let J;try{J=l0.statSync(q)}catch{}if(J&&J.isFile())return;let X=pZ.dirname(q);try{if(!l0.statSync(X).isDirectory())l0.readdirSync(X)}catch(Z){if(Z&&Z.code==="ENOENT")nZ.mkdirsSync(X);else throw Z}l0.writeFileSync(q,"")}iZ.exports={createFile:VB(GB),createFileSync:WB}});var eZ=k((fO,tZ)=>{var UB=l().fromPromise,oZ=D("path"),X6=Q0(),rZ=T0(),{pathExists:zB}=J6(),{areIdentical:sZ}=j6();async function _B(q,J){let X;try{X=await X6.lstat(J)}catch{}let Z;try{Z=await X6.lstat(q)}catch(Y){throw Y.message=Y.message.replace("lstat","ensureLink"),Y}if(X&&sZ(Z,X))return;let Q=oZ.dirname(J);if(!await zB(Q))await rZ.mkdirs(Q);await X6.link(q,J)}function LB(q,J){let X;try{X=X6.lstatSync(J)}catch{}try{let $=X6.lstatSync(q);if(X&&sZ($,X))return}catch($){throw $.message=$.message.replace("lstat","ensureLink"),$}let Z=oZ.dirname(J);if(X6.existsSync(Z))return X6.linkSync(q,J);return rZ.mkdirsSync(Z),X6.linkSync(q,J)}tZ.exports={createLink:UB(_B),createLinkSync:LB}});var JQ=k((uO,qQ)=>{var Z6=D("path"),y2=Q0(),{pathExists:BB}=J6(),xB=l().fromPromise;async function jB(q,J){if(Z6.isAbsolute(q)){try{await y2.lstat(q)}catch($){throw $.message=$.message.replace("lstat","ensureSymlink"),$}return{toCwd:q,toDst:q}}let X=Z6.dirname(J),Z=Z6.join(X,q);if(await BB(Z))return{toCwd:Z,toDst:q};try{await y2.lstat(q)}catch($){throw $.message=$.message.replace("lstat","ensureSymlink"),$}return{toCwd:q,toDst:Z6.relative(X,q)}}function RB(q,J){if(Z6.isAbsolute(q)){if(!y2.existsSync(q))throw Error("absolute srcpath does not exist");return{toCwd:q,toDst:q}}let X=Z6.dirname(J),Z=Z6.join(X,q);if(y2.existsSync(Z))return{toCwd:Z,toDst:q};if(!y2.existsSync(q))throw Error("relative srcpath does not exist");return{toCwd:q,toDst:Z6.relative(X,q)}}qQ.exports={symlinkPaths:xB(jB),symlinkPathsSync:RB}});var QQ=k((mO,ZQ)=>{var XQ=Q0(),MB=l().fromPromise;async function CB(q,J){if(J)return J;let X;try{X=await XQ.lstat(q)}catch{return"file"}return X&&X.isDirectory()?"dir":"file"}function FB(q,J){if(J)return J;let X;try{X=XQ.lstatSync(q)}catch{return"file"}return X&&X.isDirectory()?"dir":"file"}ZQ.exports={symlinkType:MB(CB),symlinkTypeSync:FB}});var KQ=k((dO,HQ)=>{var kB=l().fromPromise,$Q=D("path"),y0=Q0(),{mkdirs:TB,mkdirsSync:wB}=T0(),{symlinkPaths:PB,symlinkPathsSync:AB}=JQ(),{symlinkType:DB,symlinkTypeSync:IB}=QQ(),{pathExists:OB}=J6(),{areIdentical:YQ}=j6();async function vB(q,J,X){let Z;try{Z=await y0.lstat(J)}catch{}if(Z&&Z.isSymbolicLink()){let[H,K]=await Promise.all([y0.stat(q),y0.stat(J)]);if(YQ(H,K))return}let Q=await PB(q,J);q=Q.toDst;let $=await DB(Q.toCwd,X),Y=$Q.dirname(J);if(!await OB(Y))await TB(Y);return y0.symlink(q,J,$)}function NB(q,J,X){let Z;try{Z=y0.lstatSync(J)}catch{}if(Z&&Z.isSymbolicLink()){let H=y0.statSync(q),K=y0.statSync(J);if(YQ(H,K))return}let Q=AB(q,J);q=Q.toDst,X=IB(Q.toCwd,X);let $=$Q.dirname(J);if(y0.existsSync($))return y0.symlinkSync(q,J,X);return wB($),y0.symlinkSync(q,J,X)}HQ.exports={createSymlink:kB(vB),createSymlinkSync:NB}});var BQ=k((cO,LQ)=>{var{createFile:VQ,createFileSync:GQ}=aZ(),{createLink:WQ,createLinkSync:UQ}=eZ(),{createSymlink:zQ,createSymlinkSync:_Q}=KQ();LQ.exports={createFile:VQ,createFileSync:GQ,ensureFile:VQ,ensureFileSync:GQ,createLink:WQ,createLinkSync:UQ,ensureLink:WQ,ensureLinkSync:UQ,createSymlink:zQ,createSymlinkSync:_Q,ensureSymlink:zQ,ensureSymlinkSync:_Q}});var O8=k((lO,xQ)=>{function EB(q,{EOL:J=`
7
- `,finalEOL:X=!0,replacer:Z=null,spaces:Q}={}){let $=X?J:"";return JSON.stringify(q,Z,Q).replace(/\n/g,J)+$}function yB(q){if(Buffer.isBuffer(q))q=q.toString("utf8");return q.replace(/^\uFEFF/,"")}xQ.exports={stringify:EB,stripBom:yB}});var CQ=k((pO,MQ)=>{var p6;try{p6=d6()}catch(q){p6=D("fs")}var v8=l(),{stringify:jQ,stripBom:RQ}=O8();async function SB(q,J={}){if(typeof J==="string")J={encoding:J};let X=J.fs||p6,Z="throws"in J?J.throws:!0,Q=await v8.fromCallback(X.readFile)(q,J);Q=RQ(Q);let $;try{$=JSON.parse(Q,J?J.reviver:null)}catch(Y){if(Z)throw Y.message=`${q}: ${Y.message}`,Y;else return null}return $}var hB=v8.fromPromise(SB);function bB(q,J={}){if(typeof J==="string")J={encoding:J};let X=J.fs||p6,Z="throws"in J?J.throws:!0;try{let Q=X.readFileSync(q,J);return Q=RQ(Q),JSON.parse(Q,J.reviver)}catch(Q){if(Z)throw Q.message=`${q}: ${Q.message}`,Q;else return null}}async function gB(q,J,X={}){let Z=X.fs||p6,Q=jQ(J,X);await v8.fromCallback(Z.writeFile)(q,Q,X)}var fB=v8.fromPromise(gB);function uB(q,J,X={}){let Z=X.fs||p6,Q=jQ(J,X);return Z.writeFileSync(q,Q,X)}MQ.exports={readFile:hB,readFileSync:bB,writeFile:fB,writeFileSync:uB}});var kQ=k((nO,FQ)=>{var N8=CQ();FQ.exports={readJson:N8.readFile,readJsonSync:N8.readFileSync,writeJson:N8.writeFile,writeJsonSync:N8.writeFileSync}});var E8=k((iO,PQ)=>{var mB=l().fromPromise,i3=Q0(),TQ=D("path"),wQ=T0(),dB=J6().pathExists;async function cB(q,J,X="utf-8"){let Z=TQ.dirname(q);if(!await dB(Z))await wQ.mkdirs(Z);return i3.writeFile(q,J,X)}function lB(q,...J){let X=TQ.dirname(q);if(!i3.existsSync(X))wQ.mkdirsSync(X);i3.writeFileSync(q,...J)}PQ.exports={outputFile:mB(cB),outputFileSync:lB}});var DQ=k((aO,AQ)=>{var{stringify:pB}=O8(),{outputFile:nB}=E8();async function iB(q,J,X={}){let Z=pB(J,X);await nB(q,Z,X)}AQ.exports=iB});var OQ=k((oO,IQ)=>{var{stringify:aB}=O8(),{outputFileSync:oB}=E8();function rB(q,J,X){let Z=aB(J,X);oB(q,Z,X)}IQ.exports=rB});var NQ=k((rO,vQ)=>{var sB=l().fromPromise,Y0=kQ();Y0.outputJson=sB(DQ());Y0.outputJsonSync=OQ();Y0.outputJSON=Y0.outputJson;Y0.outputJSONSync=Y0.outputJsonSync;Y0.writeJSON=Y0.writeJson;Y0.writeJSONSync=Y0.writeJsonSync;Y0.readJSON=Y0.readJson;Y0.readJSONSync=Y0.readJsonSync;vQ.exports=Y0});var bQ=k((sO,hQ)=>{var tB=Q0(),EQ=D("path"),{copy:eB}=I8(),{remove:SQ}=E2(),{mkdirp:qx}=T0(),{pathExists:Jx}=J6(),yQ=j6();async function Xx(q,J,X={}){let Z=X.overwrite||X.clobber||!1,{srcStat:Q,isChangingCase:$=!1}=await yQ.checkPaths(q,J,"move",X);await yQ.checkParentPaths(q,Q,J,"move");let Y=EQ.dirname(J);if(EQ.parse(Y).root!==Y)await qx(Y);return Zx(q,J,Z,$)}async function Zx(q,J,X,Z){if(!Z){if(X)await SQ(J);else if(await Jx(J))throw Error("dest already exists.")}try{await tB.rename(q,J)}catch(Q){if(Q.code!=="EXDEV")throw Q;await Qx(q,J,X)}}async function Qx(q,J,X){return await eB(q,J,{overwrite:X,errorOnExist:!0,preserveTimestamps:!0}),SQ(q)}hQ.exports=Xx});var dQ=k((tO,mQ)=>{var fQ=d6(),o3=D("path"),$x=I8().copySync,uQ=E2().removeSync,Yx=T0().mkdirpSync,gQ=j6();function Hx(q,J,X){X=X||{};let Z=X.overwrite||X.clobber||!1,{srcStat:Q,isChangingCase:$=!1}=gQ.checkPathsSync(q,J,"move",X);if(gQ.checkParentPathsSync(q,Q,J,"move"),!Kx(J))Yx(o3.dirname(J));return Vx(q,J,Z,$)}function Kx(q){let J=o3.dirname(q);return o3.parse(J).root===J}function Vx(q,J,X,Z){if(Z)return a3(q,J,X);if(X)return uQ(J),a3(q,J,X);if(fQ.existsSync(J))throw Error("dest already exists.");return a3(q,J,X)}function a3(q,J,X){try{fQ.renameSync(q,J)}catch(Z){if(Z.code!=="EXDEV")throw Z;return Gx(q,J,X)}}function Gx(q,J,X){return $x(q,J,{overwrite:X,errorOnExist:!0,preserveTimestamps:!0}),uQ(q)}mQ.exports=Hx});var lQ=k((eO,cQ)=>{var Wx=l().fromPromise;cQ.exports={move:Wx(bQ()),moveSync:dQ()}});var Ux=k((qv,pQ)=>{pQ.exports={...Q0(),...I8(),...lZ(),...BQ(),...NQ(),...T0(),...lQ(),...E8(),...J6(),...E2()}});var $6=new Map;import{promises as n6}from"fs";import{resolve as G$,join as W$}from"path";var U$=T.object({operation:T.enum(["create","list","exists"]).describe("The folder operation to perform"),folder_path:T.string().describe("The path to the folder (absolute or relative to cwd)"),description:T.string().optional().describe("What you want to do"),recursive:T.boolean().default(!0).optional().describe("For create: create parent directories if they do not exist")}).strict(),X7=H0(async({operation:q,folder_path:J,recursive:X=!0},Z)=>{if(!Z.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");try{let Q=G$(Z.state.cwd,J);switch(q){case"create":return await n6.mkdir(Q,{recursive:X}),`✓ Folder created successfully at: ${Q}`;case"exists":try{await n6.access(Q);let $=await n6.stat(Q);return`✓ Folder exists at: ${Q}
8
- Type: ${$.isDirectory()?"Directory":"File"}`}catch{return`✗ Folder does not exist at: ${Q}`}case"list":try{let $=await n6.readdir(Q,{withFileTypes:!0});if($.length===0)return`Folder is empty: ${Q}`;let Y=[];Y.push(`\uD83D\uDCC1 ${Q}
9
- `);let H=[],K=[];for(let G of $){let V=W$(Q,G.name);try{let W=await n6.stat(V),U=W.size,z=W.mtime.toLocaleDateString(),L=`${G.isDirectory()?"\uD83D\uDCC1":"\uD83D\uDCC4"} ${G.name}${G.isDirectory()?"/":""} (${U} bytes, ${z})`;if(G.isDirectory())H.push(L);else K.push(L)}catch(W){K.push(`⚠️ ${G.name} (unreadable)`)}}if(H.length>0)Y.push("Directories:"),H.forEach((G)=>Y.push(` ${G}`)),Y.push("");if(K.length>0)Y.push("Files:"),K.forEach((G)=>Y.push(` ${G}`));return Y.push(`
6
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:Z,destStat:Q}=E2.checkPathsSync(q,J,"copy",X);if(E2.checkParentPathsSync(q,Z,J,"copy"),X.filter&&!X.filter(q,J))return;let $=N2.dirname(J);if(!$0.existsSync($))qB($);return SZ(Q,q,J,X)}function SZ(q,J,X,Z){let $=(Z.dereference?$0.statSync:$0.lstatSync)(J);if($.isDirectory())return VB($,q,J,X,Z);else if($.isFile()||$.isCharacterDevice()||$.isBlockDevice())return ZB($,q,J,X,Z);else if($.isSymbolicLink())return UB(q,J,X,Z);else if($.isSocket())throw Error(`Cannot copy a socket file: ${J}`);else if($.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${J}`);throw Error(`Unknown file: ${J}`)}function ZB(q,J,X,Z,Q){if(!J)return hZ(q,X,Z,Q);return QB(q,X,Z,Q)}function QB(q,J,X,Z){if(Z.overwrite)return $0.unlinkSync(X),hZ(q,J,X,Z);else if(Z.errorOnExist)throw Error(`'${X}' already exists`)}function hZ(q,J,X,Z){if($0.copyFileSync(J,X),Z.preserveTimestamps)$B(q.mode,J,X);return a3(X,q.mode)}function $B(q,J,X){if(YB(q))HB(X,q);return KB(J,X)}function YB(q){return(q&128)===0}function HB(q,J){return a3(q,J|128)}function a3(q,J){return $0.chmodSync(q,J)}function KB(q,J){let X=$0.statSync(q);return JB(J,X.atime,X.mtime)}function VB(q,J,X,Z,Q){if(!J)return GB(q.mode,X,Z,Q);return bZ(X,Z,Q)}function GB(q,J,X,Z){return $0.mkdirSync(X),bZ(J,X,Z),a3(X,q)}function bZ(q,J,X){let Z=$0.opendirSync(q);try{let Q;while((Q=Z.readSync())!==null)WB(Q.name,q,J,X)}finally{Z.closeSync()}}function WB(q,J,X,Z){let Q=N2.join(J,q),$=N2.join(X,q);if(Z.filter&&!Z.filter(Q,$))return;let{destStat:Y}=E2.checkPathsSync(Q,$,"copy",Z);return SZ(Y,Q,$,Z)}function UB(q,J,X,Z){let Q=$0.readlinkSync(J);if(Z.dereference)Q=N2.resolve(process.cwd(),Q);if(!q)return $0.symlinkSync(Q,X);else{let $;try{$=$0.readlinkSync(X)}catch(Y){if(Y.code==="EINVAL"||Y.code==="UNKNOWN")return $0.symlinkSync(Q,X);throw Y}if(Z.dereference)$=N2.resolve(process.cwd(),$);if(Q!==$){if(E2.isSrcSubdir(Q,$))throw Error(`Cannot copy '${Q}' to a subdirectory of itself, '${$}'.`);if(E2.isSrcSubdir($,Q))throw Error(`Cannot overwrite '${$}' with '${Q}'.`)}return zB(Q,X)}}function zB(q,J){return $0.unlinkSync(J),$0.symlinkSync(q,J)}gZ.exports=XB});var O8=k((iO,uZ)=>{var _B=l().fromPromise;uZ.exports={copy:_B(yZ()),copySync:fZ()}});var y2=k((aO,dZ)=>{var mZ=l6(),LB=l().fromCallback;function BB(q,J){mZ.rm(q,{recursive:!0,force:!0},J)}function xB(q){mZ.rmSync(q,{recursive:!0,force:!0})}dZ.exports={remove:LB(BB),removeSync:xB}});var rZ=k((oO,oZ)=>{var jB=l().fromPromise,pZ=Q0(),nZ=D("path"),iZ=T0(),aZ=y2(),cZ=jB(async function(J){let X;try{X=await pZ.readdir(J)}catch{return iZ.mkdirs(J)}return Promise.all(X.map((Z)=>aZ.remove(nZ.join(J,Z))))});function lZ(q){let J;try{J=pZ.readdirSync(q)}catch{return iZ.mkdirsSync(q)}J.forEach((X)=>{X=nZ.join(q,X),aZ.removeSync(X)})}oZ.exports={emptyDirSync:lZ,emptydirSync:lZ,emptyDir:cZ,emptydir:cZ}});var qQ=k((rO,eZ)=>{var RB=l().fromPromise,sZ=D("path"),l0=Q0(),tZ=T0();async function MB(q){let J;try{J=await l0.stat(q)}catch{}if(J&&J.isFile())return;let X=sZ.dirname(q),Z=null;try{Z=await l0.stat(X)}catch(Q){if(Q.code==="ENOENT"){await tZ.mkdirs(X),await l0.writeFile(q,"");return}else throw Q}if(Z.isDirectory())await l0.writeFile(q,"");else await l0.readdir(X)}function CB(q){let J;try{J=l0.statSync(q)}catch{}if(J&&J.isFile())return;let X=sZ.dirname(q);try{if(!l0.statSync(X).isDirectory())l0.readdirSync(X)}catch(Z){if(Z&&Z.code==="ENOENT")tZ.mkdirsSync(X);else throw Z}l0.writeFileSync(q,"")}eZ.exports={createFile:RB(MB),createFileSync:CB}});var $Q=k((sO,QQ)=>{var FB=l().fromPromise,JQ=D("path"),Z6=Q0(),XQ=T0(),{pathExists:kB}=X6(),{areIdentical:ZQ}=M6();async function TB(q,J){let X;try{X=await Z6.lstat(J)}catch{}let Z;try{Z=await Z6.lstat(q)}catch(Y){throw Y.message=Y.message.replace("lstat","ensureLink"),Y}if(X&&ZQ(Z,X))return;let Q=JQ.dirname(J);if(!await kB(Q))await XQ.mkdirs(Q);await Z6.link(q,J)}function wB(q,J){let X;try{X=Z6.lstatSync(J)}catch{}try{let $=Z6.lstatSync(q);if(X&&ZQ($,X))return}catch($){throw $.message=$.message.replace("lstat","ensureLink"),$}let Z=JQ.dirname(J);if(Z6.existsSync(Z))return Z6.linkSync(q,J);return XQ.mkdirsSync(Z),Z6.linkSync(q,J)}QQ.exports={createLink:FB(TB),createLinkSync:wB}});var HQ=k((tO,YQ)=>{var Q6=D("path"),S2=Q0(),{pathExists:PB}=X6(),AB=l().fromPromise;async function DB(q,J){if(Q6.isAbsolute(q)){try{await S2.lstat(q)}catch($){throw $.message=$.message.replace("lstat","ensureSymlink"),$}return{toCwd:q,toDst:q}}let X=Q6.dirname(J),Z=Q6.join(X,q);if(await PB(Z))return{toCwd:Z,toDst:q};try{await S2.lstat(q)}catch($){throw $.message=$.message.replace("lstat","ensureSymlink"),$}return{toCwd:q,toDst:Q6.relative(X,q)}}function IB(q,J){if(Q6.isAbsolute(q)){if(!S2.existsSync(q))throw Error("absolute srcpath does not exist");return{toCwd:q,toDst:q}}let X=Q6.dirname(J),Z=Q6.join(X,q);if(S2.existsSync(Z))return{toCwd:Z,toDst:q};if(!S2.existsSync(q))throw Error("relative srcpath does not exist");return{toCwd:q,toDst:Q6.relative(X,q)}}YQ.exports={symlinkPaths:AB(DB),symlinkPathsSync:IB}});var GQ=k((eO,VQ)=>{var KQ=Q0(),OB=l().fromPromise;async function vB(q,J){if(J)return J;let X;try{X=await KQ.lstat(q)}catch{return"file"}return X&&X.isDirectory()?"dir":"file"}function NB(q,J){if(J)return J;let X;try{X=KQ.lstatSync(q)}catch{return"file"}return X&&X.isDirectory()?"dir":"file"}VQ.exports={symlinkType:OB(vB),symlinkTypeSync:NB}});var _Q=k((qv,zQ)=>{var EB=l().fromPromise,WQ=D("path"),y0=Q0(),{mkdirs:yB,mkdirsSync:SB}=T0(),{symlinkPaths:hB,symlinkPathsSync:bB}=HQ(),{symlinkType:gB,symlinkTypeSync:fB}=GQ(),{pathExists:uB}=X6(),{areIdentical:UQ}=M6();async function mB(q,J,X){let Z;try{Z=await y0.lstat(J)}catch{}if(Z&&Z.isSymbolicLink()){let[H,K]=await Promise.all([y0.stat(q),y0.stat(J)]);if(UQ(H,K))return}let Q=await hB(q,J);q=Q.toDst;let $=await gB(Q.toCwd,X),Y=WQ.dirname(J);if(!await uB(Y))await yB(Y);return y0.symlink(q,J,$)}function dB(q,J,X){let Z;try{Z=y0.lstatSync(J)}catch{}if(Z&&Z.isSymbolicLink()){let H=y0.statSync(q),K=y0.statSync(J);if(UQ(H,K))return}let Q=bB(q,J);q=Q.toDst,X=fB(Q.toCwd,X);let $=WQ.dirname(J);if(y0.existsSync($))return y0.symlinkSync(q,J,X);return SB($),y0.symlinkSync(q,J,X)}zQ.exports={createSymlink:EB(mB),createSymlinkSync:dB}});var FQ=k((Jv,CQ)=>{var{createFile:LQ,createFileSync:BQ}=qQ(),{createLink:xQ,createLinkSync:jQ}=$Q(),{createSymlink:RQ,createSymlinkSync:MQ}=_Q();CQ.exports={createFile:LQ,createFileSync:BQ,ensureFile:LQ,ensureFileSync:BQ,createLink:xQ,createLinkSync:jQ,ensureLink:xQ,ensureLinkSync:jQ,createSymlink:RQ,createSymlinkSync:MQ,ensureSymlink:RQ,ensureSymlinkSync:MQ}});var v8=k((Xv,kQ)=>{function cB(q,{EOL:J=`
7
+ `,finalEOL:X=!0,replacer:Z=null,spaces:Q}={}){let $=X?J:"";return JSON.stringify(q,Z,Q).replace(/\n/g,J)+$}function lB(q){if(Buffer.isBuffer(q))q=q.toString("utf8");return q.replace(/^\uFEFF/,"")}kQ.exports={stringify:cB,stripBom:lB}});var AQ=k((Zv,PQ)=>{var i6;try{i6=l6()}catch(q){i6=D("fs")}var N8=l(),{stringify:TQ,stripBom:wQ}=v8();async function pB(q,J={}){if(typeof J==="string")J={encoding:J};let X=J.fs||i6,Z="throws"in J?J.throws:!0,Q=await N8.fromCallback(X.readFile)(q,J);Q=wQ(Q);let $;try{$=JSON.parse(Q,J?J.reviver:null)}catch(Y){if(Z)throw Y.message=`${q}: ${Y.message}`,Y;else return null}return $}var nB=N8.fromPromise(pB);function iB(q,J={}){if(typeof J==="string")J={encoding:J};let X=J.fs||i6,Z="throws"in J?J.throws:!0;try{let Q=X.readFileSync(q,J);return Q=wQ(Q),JSON.parse(Q,J.reviver)}catch(Q){if(Z)throw Q.message=`${q}: ${Q.message}`,Q;else return null}}async function aB(q,J,X={}){let Z=X.fs||i6,Q=TQ(J,X);await N8.fromCallback(Z.writeFile)(q,Q,X)}var oB=N8.fromPromise(aB);function rB(q,J,X={}){let Z=X.fs||i6,Q=TQ(J,X);return Z.writeFileSync(q,Q,X)}PQ.exports={readFile:nB,readFileSync:iB,writeFile:oB,writeFileSync:rB}});var IQ=k((Qv,DQ)=>{var E8=AQ();DQ.exports={readJson:E8.readFile,readJsonSync:E8.readFileSync,writeJson:E8.writeFile,writeJsonSync:E8.writeFileSync}});var y8=k(($v,NQ)=>{var sB=l().fromPromise,o3=Q0(),OQ=D("path"),vQ=T0(),tB=X6().pathExists;async function eB(q,J,X="utf-8"){let Z=OQ.dirname(q);if(!await tB(Z))await vQ.mkdirs(Z);return o3.writeFile(q,J,X)}function qx(q,...J){let X=OQ.dirname(q);if(!o3.existsSync(X))vQ.mkdirsSync(X);o3.writeFileSync(q,...J)}NQ.exports={outputFile:sB(eB),outputFileSync:qx}});var yQ=k((Yv,EQ)=>{var{stringify:Jx}=v8(),{outputFile:Xx}=y8();async function Zx(q,J,X={}){let Z=Jx(J,X);await Xx(q,Z,X)}EQ.exports=Zx});var hQ=k((Hv,SQ)=>{var{stringify:Qx}=v8(),{outputFileSync:$x}=y8();function Yx(q,J,X){let Z=Qx(J,X);$x(q,Z,X)}SQ.exports=Yx});var gQ=k((Kv,bQ)=>{var Hx=l().fromPromise,Y0=IQ();Y0.outputJson=Hx(yQ());Y0.outputJsonSync=hQ();Y0.outputJSON=Y0.outputJson;Y0.outputJSONSync=Y0.outputJsonSync;Y0.writeJSON=Y0.writeJson;Y0.writeJSONSync=Y0.writeJsonSync;Y0.readJSON=Y0.readJson;Y0.readJSONSync=Y0.readJsonSync;bQ.exports=Y0});var cQ=k((Vv,dQ)=>{var Kx=Q0(),fQ=D("path"),{copy:Vx}=O8(),{remove:mQ}=y2(),{mkdirp:Gx}=T0(),{pathExists:Wx}=X6(),uQ=M6();async function Ux(q,J,X={}){let Z=X.overwrite||X.clobber||!1,{srcStat:Q,isChangingCase:$=!1}=await uQ.checkPaths(q,J,"move",X);await uQ.checkParentPaths(q,Q,J,"move");let Y=fQ.dirname(J);if(fQ.parse(Y).root!==Y)await Gx(Y);return zx(q,J,Z,$)}async function zx(q,J,X,Z){if(!Z){if(X)await mQ(J);else if(await Wx(J))throw Error("dest already exists.")}try{await Kx.rename(q,J)}catch(Q){if(Q.code!=="EXDEV")throw Q;await _x(q,J,X)}}async function _x(q,J,X){return await Vx(q,J,{overwrite:X,errorOnExist:!0,preserveTimestamps:!0}),mQ(q)}dQ.exports=Ux});var aQ=k((Gv,iQ)=>{var pQ=l6(),s3=D("path"),Lx=O8().copySync,nQ=y2().removeSync,Bx=T0().mkdirpSync,lQ=M6();function xx(q,J,X){X=X||{};let Z=X.overwrite||X.clobber||!1,{srcStat:Q,isChangingCase:$=!1}=lQ.checkPathsSync(q,J,"move",X);if(lQ.checkParentPathsSync(q,Q,J,"move"),!jx(J))Bx(s3.dirname(J));return Rx(q,J,Z,$)}function jx(q){let J=s3.dirname(q);return s3.parse(J).root===J}function Rx(q,J,X,Z){if(Z)return r3(q,J,X);if(X)return nQ(J),r3(q,J,X);if(pQ.existsSync(J))throw Error("dest already exists.");return r3(q,J,X)}function r3(q,J,X){try{pQ.renameSync(q,J)}catch(Z){if(Z.code!=="EXDEV")throw Z;return Mx(q,J,X)}}function Mx(q,J,X){return Lx(q,J,{overwrite:X,errorOnExist:!0,preserveTimestamps:!0}),nQ(q)}iQ.exports=xx});var rQ=k((Wv,oQ)=>{var Cx=l().fromPromise;oQ.exports={move:Cx(cQ()),moveSync:aQ()}});var tQ=k((Uv,sQ)=>{sQ.exports={...Q0(),...O8(),...rZ(),...FQ(),...gQ(),...T0(),...rQ(),...y8(),...X6(),...y2()}});var H6=new Map;import{promises as a6}from"fs";import{resolve as M$,join as C$}from"path";var F$=T.object({operation:T.enum(["create","list","exists"]).describe("The folder operation to perform"),folder_path:T.string().describe("The path to the folder (absolute or relative to cwd)"),description:T.string().optional().describe("What you want to do"),recursive:T.boolean().default(!0).optional().describe("For create: create parent directories if they do not exist")}).strict(),V7=H0(async({operation:q,folder_path:J,recursive:X=!0},Z)=>{if(!Z.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");try{let Q=M$(Z.state.cwd,J);switch(q){case"create":return await a6.mkdir(Q,{recursive:X}),`✓ Folder created successfully at: ${Q}`;case"exists":try{await a6.access(Q);let $=await a6.stat(Q);return`✓ Folder exists at: ${Q}
8
+ Type: ${$.isDirectory()?"Directory":"File"}`}catch{return`✗ Folder does not exist at: ${Q}`}case"list":try{let $=await a6.readdir(Q,{withFileTypes:!0});if($.length===0)return`Folder is empty: ${Q}`;let Y=[];Y.push(`\uD83D\uDCC1 ${Q}
9
+ `);let H=[],K=[];for(let G of $){let V=C$(Q,G.name);try{let W=await a6.stat(V),U=W.size,z=W.mtime.toLocaleDateString(),L=`${G.isDirectory()?"\uD83D\uDCC1":"\uD83D\uDCC4"} ${G.name}${G.isDirectory()?"/":""} (${U} bytes, ${z})`;if(G.isDirectory())H.push(L);else K.push(L)}catch(W){K.push(`⚠️ ${G.name} (unreadable)`)}}if(H.length>0)Y.push("Directories:"),H.forEach((G)=>Y.push(` ${G}`)),Y.push("");if(K.length>0)Y.push("Files:"),K.forEach((G)=>Y.push(` ${G}`));return Y.push(`
10
10
  Total: ${H.length} directories, ${K.length} files`),Y.join(`
11
11
  `)}catch($){if($.code==="ENOENT")return`✗ Folder not found: ${Q}`;if($.code==="ENOTDIR")return`✗ Path exists but is not a folder: ${Q}`;throw $}default:return`✗ Unknown operation: ${q}`}}catch(Q){if(Q.code==="ENOENT")return`✗ Folder not found: ${J}`;if(Q.code==="EACCES")return`✗ Permission denied: ${J}`;return`✗ Error: ${Q.message}`}},{name:"folder_operations",description:`Unified folder operations tool supporting create, list, and existence check. Relative paths are resolved based on the current working directory (cwd).
12
12
 
@@ -26,58 +26,58 @@ Total: ${H.length} directories, ${K.length} files`),Y.join(`
26
26
  - All folder paths can be absolute or relative to cwd
27
27
  - Create operation is recursive (creates parent directories if needed)
28
28
  - List operation shows file sizes and modification dates
29
- - Delete operations are not supported for safety reasons. Use terminal commands with user approval if needed.`,schema:U$});var f8=(q,J,X)=>{let Z=q instanceof RegExp?Z7(q,X):q,Q=J instanceof RegExp?Z7(J,X):J,$=Z!==null&&Q!=null&&z$(Z,Q,X);return $&&{start:$[0],end:$[1],pre:X.slice(0,$[0]),body:X.slice($[0]+Z.length,$[1]),post:X.slice($[1]+Q.length)}},Z7=(q,J)=>{let X=J.match(q);return X?X[0]:null},z$=(q,J,X)=>{let Z,Q,$,Y=void 0,H,K=X.indexOf(q),G=X.indexOf(J,K+1),V=K;if(K>=0&&G>0){if(q===J)return[K,G];Z=[],$=X.length;while(V>=0&&!H){if(V===K)Z.push(V),K=X.indexOf(q,V+1);else if(Z.length===1){let W=Z.pop();if(W!==void 0)H=[W,G]}else{if(Q=Z.pop(),Q!==void 0&&Q<$)$=Q,Y=G;G=X.indexOf(J,V+1)}V=K<G&&K>=0?K:G}if(Z.length&&Y!==void 0)H=[$,Y]}return H};var Q7="\x00SLASH"+Math.random()+"\x00",$7="\x00OPEN"+Math.random()+"\x00",m8="\x00CLOSE"+Math.random()+"\x00",Y7="\x00COMMA"+Math.random()+"\x00",H7="\x00PERIOD"+Math.random()+"\x00",_$=new RegExp(Q7,"g"),L$=new RegExp($7,"g"),B$=new RegExp(m8,"g"),x$=new RegExp(Y7,"g"),j$=new RegExp(H7,"g"),R$=/\\\\/g,M$=/\\{/g,C$=/\\}/g,F$=/\\,/g,k$=/\\./g,T$=1e5;function u8(q){return!isNaN(q)?parseInt(q,10):q.charCodeAt(0)}function w$(q){return q.replace(R$,Q7).replace(M$,$7).replace(C$,m8).replace(F$,Y7).replace(k$,H7)}function P$(q){return q.replace(_$,"\\").replace(L$,"{").replace(B$,"}").replace(x$,",").replace(j$,".")}function K7(q){if(!q)return[""];let J=[],X=f8("{","}",q);if(!X)return q.split(",");let{pre:Z,body:Q,post:$}=X,Y=Z.split(",");Y[Y.length-1]+="{"+Q+"}";let H=K7($);if($.length)Y[Y.length-1]+=H.shift(),Y.push.apply(Y,H);return J.push.apply(J,Y),J}function V7(q,J={}){if(!q)return[];let{max:X=T$}=J;if(q.slice(0,2)==="{}")q="\\{\\}"+q.slice(2);return i6(w$(q),X,!0).map(P$)}function A$(q){return"{"+q+"}"}function D$(q){return/^-?0\d/.test(q)}function I$(q,J){return q<=J}function O$(q,J){return q>=J}function i6(q,J,X){let Z=[],Q=f8("{","}",q);if(!Q)return[q];let $=Q.pre,Y=Q.post.length?i6(Q.post,J,!1):[""];if(/\$$/.test(Q.pre))for(let H=0;H<Y.length&&H<J;H++){let K=$+"{"+Q.body+"}"+Y[H];Z.push(K)}else{let H=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(Q.body),K=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(Q.body),G=H||K,V=Q.body.indexOf(",")>=0;if(!G&&!V){if(Q.post.match(/,(?!,).*\}/))return q=Q.pre+"{"+Q.body+m8+Q.post,i6(q,J,!0);return[q]}let W;if(G)W=Q.body.split(/\.\./);else if(W=K7(Q.body),W.length===1&&W[0]!==void 0){if(W=i6(W[0],J,!1).map(A$),W.length===1)return Y.map((z)=>Q.pre+W[0]+z)}let U;if(G&&W[0]!==void 0&&W[1]!==void 0){let z=u8(W[0]),_=u8(W[1]),L=Math.max(W[0].length,W[1].length),x=W.length===3&&W[2]!==void 0?Math.abs(u8(W[2])):1,B=I$;if(_<z)x*=-1,B=O$;let R=W.some(D$);U=[];for(let F=z;B(F,_);F+=x){let C;if(K){if(C=String.fromCharCode(F),C==="\\")C=""}else if(C=String(F),R){let y=L-C.length;if(y>0){let O=Array(y+1).join("0");if(F<0)C="-"+O+C.slice(1);else C=O+C}}U.push(C)}}else{U=[];for(let z=0;z<W.length;z++)U.push.apply(U,i6(W[z],J,!1))}for(let z=0;z<U.length;z++)for(let _=0;_<Y.length&&Z.length<J;_++){let L=$+U[z]+Y[_];if(!X||G||L)Z.push(L)}}return Z}var a6=(q)=>{if(typeof q!=="string")throw TypeError("invalid pattern");if(q.length>65536)throw TypeError("pattern is too long")};var v$={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},o6=(q)=>q.replace(/[[\]\\-]/g,"\\$&"),N$=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),G7=(q)=>q.join(""),W7=(q,J)=>{let X=J;if(q.charAt(X)!=="[")throw Error("not in a brace expression");let Z=[],Q=[],$=X+1,Y=!1,H=!1,K=!1,G=!1,V=X,W="";q:while($<q.length){let L=q.charAt($);if((L==="!"||L==="^")&&$===X+1){G=!0,$++;continue}if(L==="]"&&Y&&!K){V=$+1;break}if(Y=!0,L==="\\"){if(!K){K=!0,$++;continue}}if(L==="["&&!K){for(let[x,[B,j,R]]of Object.entries(v$))if(q.startsWith(x,$)){if(W)return["$.",!1,q.length-X,!0];if($+=x.length,R)Q.push(B);else Z.push(B);H=H||j;continue q}}if(K=!1,W){if(L>W)Z.push(o6(W)+"-"+o6(L));else if(L===W)Z.push(o6(L));W="",$++;continue}if(q.startsWith("-]",$+1)){Z.push(o6(L+"-")),$+=2;continue}if(q.startsWith("-",$+1)){W=L,$+=2;continue}Z.push(o6(L)),$++}if(V<$)return["",!1,0,!1];if(!Z.length&&!Q.length)return["$.",!1,q.length-X,!0];if(Q.length===0&&Z.length===1&&/^\\?.$/.test(Z[0])&&!G){let L=Z[0].length===2?Z[0].slice(-1):Z[0];return[N$(L),!1,V-X,!1]}let U="["+(G?"^":"")+G7(Z)+"]",z="["+(G?"":"^")+G7(Q)+"]";return[Z.length&&Q.length?"("+U+"|"+z+")":Z.length?U:z,H,V-X,!0]};var B0=(q,{windowsPathsNoEscape:J=!1,magicalBraces:X=!0}={})=>{if(X)return J?q.replace(/\[([^\/\\])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return J?q.replace(/\[([^\/\\{}])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};var E$=new Set(["!","?","+","*","@"]),U7=(q)=>E$.has(q),y$="(?!(?:^|/)\\.\\.?(?:$|/))",S2="(?!\\.)",S$=new Set(["[","."]),h$=new Set(["..","."]),b$=new Set("().*{}+?[]^$\\!"),g$=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d8="[^/]",z7=d8+"*?",_7=d8+"+?";class o{type;#q;#X;#J=!1;#Z=[];#$;#V;#U;#W=!1;#H;#_;#z=!1;constructor(q,J,X={}){if(this.type=q,q)this.#X=!0;if(this.#$=J,this.#q=this.#$?this.#$.#q:this,this.#H=this.#q===this?X:this.#q.#H,this.#U=this.#q===this?[]:this.#q.#U,q==="!"&&!this.#q.#W)this.#U.push(this);this.#V=this.#$?this.#$.#Z.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let q of this.#Z){if(typeof q==="string")continue;if(q.type||q.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#_!==void 0)return this.#_;if(!this.type)return this.#_=this.#Z.map((q)=>String(q)).join("");else return this.#_=this.type+"("+this.#Z.map((q)=>String(q)).join("|")+")"}#K(){if(this!==this.#q)throw Error("should only call on root");if(this.#W)return this;this.toString(),this.#W=!0;let q;while(q=this.#U.pop()){if(q.type!=="!")continue;let J=q,X=J.#$;while(X){for(let Z=J.#V+1;!X.type&&Z<X.#Z.length;Z++)for(let Q of q.#Z){if(typeof Q==="string")throw Error("string part in extglob AST??");Q.copyIn(X.#Z[Z])}J=X,X=J.#$}}return this}push(...q){for(let J of q){if(J==="")continue;if(typeof J!=="string"&&!(J instanceof o&&J.#$===this))throw Error("invalid part: "+J);this.#Z.push(J)}}toJSON(){let q=this.type===null?this.#Z.slice().map((J)=>typeof J==="string"?J:J.toJSON()):[this.type,...this.#Z.map((J)=>J.toJSON())];if(this.isStart()&&!this.type)q.unshift([]);if(this.isEnd()&&(this===this.#q||this.#q.#W&&this.#$?.type==="!"))q.push({});return q}isStart(){if(this.#q===this)return!0;if(!this.#$?.isStart())return!1;if(this.#V===0)return!0;let q=this.#$;for(let J=0;J<this.#V;J++){let X=q.#Z[J];if(!(X instanceof o&&X.type==="!"))return!1}return!0}isEnd(){if(this.#q===this)return!0;if(this.#$?.type==="!")return!0;if(!this.#$?.isEnd())return!1;if(!this.type)return this.#$?.isEnd();let q=this.#$?this.#$.#Z.length:0;return this.#V===q-1}copyIn(q){if(typeof q==="string")this.push(q);else this.push(q.clone(this))}clone(q){let J=new o(this.type,q);for(let X of this.#Z)J.copyIn(X);return J}static#Y(q,J,X,Z){let Q=!1,$=!1,Y=-1,H=!1;if(J.type===null){let U=X,z="";while(U<q.length){let _=q.charAt(U++);if(Q||_==="\\"){Q=!Q,z+=_;continue}if($){if(U===Y+1){if(_==="^"||_==="!")H=!0}else if(_==="]"&&!(U===Y+2&&H))$=!1;z+=_;continue}else if(_==="["){$=!0,Y=U,H=!1,z+=_;continue}if(!Z.noext&&U7(_)&&q.charAt(U)==="("){J.push(z),z="";let L=new o(_,J);U=o.#Y(q,L,U,Z),J.push(L);continue}z+=_}return J.push(z),U}let K=X+1,G=new o(null,J),V=[],W="";while(K<q.length){let U=q.charAt(K++);if(Q||U==="\\"){Q=!Q,W+=U;continue}if($){if(K===Y+1){if(U==="^"||U==="!")H=!0}else if(U==="]"&&!(K===Y+2&&H))$=!1;W+=U;continue}else if(U==="["){$=!0,Y=K,H=!1,W+=U;continue}if(U7(U)&&q.charAt(K)==="("){G.push(W),W="";let z=new o(U,G);G.push(z),K=o.#Y(q,z,K,Z);continue}if(U==="|"){G.push(W),W="",V.push(G),G=new o(null,J);continue}if(U===")"){if(W===""&&J.#Z.length===0)J.#z=!0;return G.push(W),W="",J.push(...V,G),K}W+=U}return J.type=null,J.#X=void 0,J.#Z=[q.substring(X-1)],K}static fromGlob(q,J={}){let X=new o(null,void 0,J);return o.#Y(q,X,0,J),X}toMMPattern(){if(this!==this.#q)return this.#q.toMMPattern();let q=this.toString(),[J,X,Z,Q]=this.toRegExpSource();if(!(Z||this.#X||this.#H.nocase&&!this.#H.nocaseMagicOnly&&q.toUpperCase()!==q.toLowerCase()))return X;let Y=(this.#H.nocase?"i":"")+(Q?"u":"");return Object.assign(new RegExp(`^${J}$`,Y),{_src:J,_glob:q})}get options(){return this.#H}toRegExpSource(q){let J=q??!!this.#H.dot;if(this.#q===this)this.#K();if(!this.type){let H=this.isStart()&&this.isEnd()&&!this.#Z.some((U)=>typeof U!=="string"),K=this.#Z.map((U)=>{let[z,_,L,x]=typeof U==="string"?o.#C(U,this.#X,H):U.toRegExpSource(q);return this.#X=this.#X||L,this.#J=this.#J||x,z}).join(""),G="";if(this.isStart()){if(typeof this.#Z[0]==="string"){if(!(this.#Z.length===1&&h$.has(this.#Z[0]))){let z=S$,_=J&&z.has(K.charAt(0))||K.startsWith("\\.")&&z.has(K.charAt(2))||K.startsWith("\\.\\.")&&z.has(K.charAt(4)),L=!J&&!q&&z.has(K.charAt(0));G=_?y$:L?S2:""}}}let V="";if(this.isEnd()&&this.#q.#W&&this.#$?.type==="!")V="(?:$|\\/)";return[G+K+V,B0(K),this.#X=!!this.#X,this.#J]}let X=this.type==="*"||this.type==="+",Z=this.type==="!"?"(?:(?!(?:":"(?:",Q=this.#L(J);if(this.isStart()&&this.isEnd()&&!Q&&this.type!=="!"){let H=this.toString();return this.#Z=[H],this.type=null,this.#X=void 0,[H,B0(this.toString()),!1,!1]}let $=!X||q||J||!S2?"":this.#L(!0);if($===Q)$="";if($)Q=`(?:${Q})(?:${$})*?`;let Y="";if(this.type==="!"&&this.#z)Y=(this.isStart()&&!J?S2:"")+_7;else{let H=this.type==="!"?"))"+(this.isStart()&&!J&&!q?S2:"")+z7+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&$?")":this.type==="*"&&$?")?":`)${this.type}`;Y=Z+Q+H}return[Y,B0(Q),this.#X=!!this.#X,this.#J]}#L(q){return this.#Z.map((J)=>{if(typeof J==="string")throw Error("string type in extglob ast??");let[X,Z,Q,$]=J.toRegExpSource(q);return this.#J=this.#J||$,X}).filter((J)=>!(this.isStart()&&this.isEnd())||!!J).join("|")}static#C(q,J,X=!1){let Z=!1,Q="",$=!1,Y=!1;for(let H=0;H<q.length;H++){let K=q.charAt(H);if(Z){Z=!1,Q+=(b$.has(K)?"\\":"")+K;continue}if(K==="*"){if(Y)continue;Y=!0,Q+=X&&/^[*]+$/.test(q)?_7:z7,J=!0;continue}else Y=!1;if(K==="\\"){if(H===q.length-1)Q+="\\\\";else Z=!0;continue}if(K==="["){let[G,V,W,U]=W7(q,H);if(W){Q+=G,$=$||V,H+=W-1,J=J||U;continue}}if(K==="?"){Q+=d8,J=!0;continue}Q+=g$(K)}return[Q,B0(q),!!J,$]}}var M6=(q,{windowsPathsNoEscape:J=!1,magicalBraces:X=!1}={})=>{if(X)return J?q.replace(/[?*()[\]{}]/g,"[$&]"):q.replace(/[?*()[\]\\{}]/g,"\\$&");return J?q.replace(/[?*()[\]]/g,"[$&]"):q.replace(/[?*()[\]\\]/g,"\\$&")};var q0=(q,J,X={})=>{if(a6(J),!X.nocomment&&J.charAt(0)==="#")return!1;return new W0(J,X).match(q)},f$=/^\*+([^+@!?\*\[\(]*)$/,u$=(q)=>(J)=>!J.startsWith(".")&&J.endsWith(q),m$=(q)=>(J)=>J.endsWith(q),d$=(q)=>{return q=q.toLowerCase(),(J)=>!J.startsWith(".")&&J.toLowerCase().endsWith(q)},c$=(q)=>{return q=q.toLowerCase(),(J)=>J.toLowerCase().endsWith(q)},l$=/^\*+\.\*+$/,p$=(q)=>!q.startsWith(".")&&q.includes("."),n$=(q)=>q!=="."&&q!==".."&&q.includes("."),i$=/^\.\*+$/,a$=(q)=>q!=="."&&q!==".."&&q.startsWith("."),o$=/^\*+$/,r$=(q)=>q.length!==0&&!q.startsWith("."),s$=(q)=>q.length!==0&&q!=="."&&q!=="..",t$=/^\?+([^+@!?\*\[\(]*)?$/,e$=([q,J=""])=>{let X=x7([q]);if(!J)return X;return J=J.toLowerCase(),(Z)=>X(Z)&&Z.toLowerCase().endsWith(J)},qY=([q,J=""])=>{let X=j7([q]);if(!J)return X;return J=J.toLowerCase(),(Z)=>X(Z)&&Z.toLowerCase().endsWith(J)},JY=([q,J=""])=>{let X=j7([q]);return!J?X:(Z)=>X(Z)&&Z.endsWith(J)},XY=([q,J=""])=>{let X=x7([q]);return!J?X:(Z)=>X(Z)&&Z.endsWith(J)},x7=([q])=>{let J=q.length;return(X)=>X.length===J&&!X.startsWith(".")},j7=([q])=>{let J=q.length;return(X)=>X.length===J&&X!=="."&&X!==".."},R7=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",L7={win32:{sep:"\\"},posix:{sep:"/"}},ZY=R7==="win32"?L7.win32.sep:L7.posix.sep;q0.sep=ZY;var r=Symbol("globstar **");q0.GLOBSTAR=r;var QY="[^/]",$Y=QY+"*?",YY="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",HY="(?:(?!(?:\\/|^)\\.).)*?",KY=(q,J={})=>(X)=>q0(X,q,J);q0.filter=KY;var G0=(q,J={})=>Object.assign({},q,J),VY=(q)=>{if(!q||typeof q!=="object"||!Object.keys(q).length)return q0;let J=q0;return Object.assign((Z,Q,$={})=>J(Z,Q,G0(q,$)),{Minimatch:class extends J.Minimatch{constructor(Q,$={}){super(Q,G0(q,$))}static defaults(Q){return J.defaults(G0(q,Q)).Minimatch}},AST:class extends J.AST{constructor(Q,$,Y={}){super(Q,$,G0(q,Y))}static fromGlob(Q,$={}){return J.AST.fromGlob(Q,G0(q,$))}},unescape:(Z,Q={})=>J.unescape(Z,G0(q,Q)),escape:(Z,Q={})=>J.escape(Z,G0(q,Q)),filter:(Z,Q={})=>J.filter(Z,G0(q,Q)),defaults:(Z)=>J.defaults(G0(q,Z)),makeRe:(Z,Q={})=>J.makeRe(Z,G0(q,Q)),braceExpand:(Z,Q={})=>J.braceExpand(Z,G0(q,Q)),match:(Z,Q,$={})=>J.match(Z,Q,G0(q,$)),sep:J.sep,GLOBSTAR:r})};q0.defaults=VY;var M7=(q,J={})=>{if(a6(q),J.nobrace||!/\{(?:(?!\{).)*\}/.test(q))return[q];return V7(q,{max:J.braceExpandMax})};q0.braceExpand=M7;var GY=(q,J={})=>new W0(q,J).makeRe();q0.makeRe=GY;var WY=(q,J,X={})=>{let Z=new W0(J,X);if(q=q.filter((Q)=>Z.match(Q)),Z.options.nonull&&!q.length)q.push(J);return q};q0.match=WY;var B7=/[?*]|[+@!]\(.*?\)|\[|\]/,UY=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class W0{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(q,J={}){a6(q),J=J||{},this.options=J,this.pattern=q,this.platform=J.platform||R7,this.isWindows=this.platform==="win32";let X="allowWindowsEscape";if(this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J[X]===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!J.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!J.nonegate,this.comment=!1,this.empty=!1,this.partial=!!J.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=J.windowsNoMagicRoot!==void 0?J.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let q of this.set)for(let J of q)if(typeof J!=="string")return!0;return!1}debug(...q){}make(){let q=this.pattern,J=this.options;if(!J.nocomment&&q.charAt(0)==="#"){this.comment=!0;return}if(!q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],J.debug)this.debug=(...Q)=>console.error(...Q);this.debug(this.pattern,this.globSet);let X=this.globSet.map((Q)=>this.slashSplit(Q));this.globParts=this.preprocess(X),this.debug(this.pattern,this.globParts);let Z=this.globParts.map((Q,$,Y)=>{if(this.isWindows&&this.windowsNoMagicRoot){let H=Q[0]===""&&Q[1]===""&&(Q[2]==="?"||!B7.test(Q[2]))&&!B7.test(Q[3]),K=/^[a-z]:/i.test(Q[0]);if(H)return[...Q.slice(0,4),...Q.slice(4).map((G)=>this.parse(G))];else if(K)return[Q[0],...Q.slice(1).map((G)=>this.parse(G))]}return Q.map((H)=>this.parse(H))});if(this.debug(this.pattern,Z),this.set=Z.filter((Q)=>Q.indexOf(!1)===-1),this.isWindows)for(let Q=0;Q<this.set.length;Q++){let $=this.set[Q];if($[0]===""&&$[1]===""&&this.globParts[Q][2]==="?"&&typeof $[3]==="string"&&/^[a-z]:$/i.test($[3]))$[2]="?"}this.debug(this.pattern,this.set)}preprocess(q){if(this.options.noglobstar){for(let X=0;X<q.length;X++)for(let Z=0;Z<q[X].length;Z++)if(q[X][Z]==="**")q[X][Z]="*"}let{optimizationLevel:J=1}=this.options;if(J>=2)q=this.firstPhasePreProcess(q),q=this.secondPhasePreProcess(q);else if(J>=1)q=this.levelOneOptimize(q);else q=this.adjascentGlobstarOptimize(q);return q}adjascentGlobstarOptimize(q){return q.map((J)=>{let X=-1;while((X=J.indexOf("**",X+1))!==-1){let Z=X;while(J[Z+1]==="**")Z++;if(Z!==X)J.splice(X,Z-X)}return J})}levelOneOptimize(q){return q.map((J)=>{return J=J.reduce((X,Z)=>{let Q=X[X.length-1];if(Z==="**"&&Q==="**")return X;if(Z===".."){if(Q&&Q!==".."&&Q!=="."&&Q!=="**")return X.pop(),X}return X.push(Z),X},[]),J.length===0?[""]:J})}levelTwoFileOptimize(q){if(!Array.isArray(q))q=this.slashSplit(q);let J=!1;do{if(J=!1,!this.preserveMultipleSlashes){for(let Z=1;Z<q.length-1;Z++){let Q=q[Z];if(Z===1&&Q===""&&q[0]==="")continue;if(Q==="."||Q==="")J=!0,q.splice(Z,1),Z--}if(q[0]==="."&&q.length===2&&(q[1]==="."||q[1]===""))J=!0,q.pop()}let X=0;while((X=q.indexOf("..",X+1))!==-1){let Z=q[X-1];if(Z&&Z!=="."&&Z!==".."&&Z!=="**")J=!0,q.splice(X-1,2),X-=2}}while(J);return q.length===0?[""]:q}firstPhasePreProcess(q){let J=!1;do{J=!1;for(let X of q){let Z=-1;while((Z=X.indexOf("**",Z+1))!==-1){let $=Z;while(X[$+1]==="**")$++;if($>Z)X.splice(Z+1,$-Z);let Y=X[Z+1],H=X[Z+2],K=X[Z+3];if(Y!=="..")continue;if(!H||H==="."||H===".."||!K||K==="."||K==="..")continue;J=!0,X.splice(Z,1);let G=X.slice(0);G[Z]="**",q.push(G),Z--}if(!this.preserveMultipleSlashes){for(let $=1;$<X.length-1;$++){let Y=X[$];if($===1&&Y===""&&X[0]==="")continue;if(Y==="."||Y==="")J=!0,X.splice($,1),$--}if(X[0]==="."&&X.length===2&&(X[1]==="."||X[1]===""))J=!0,X.pop()}let Q=0;while((Q=X.indexOf("..",Q+1))!==-1){let $=X[Q-1];if($&&$!=="."&&$!==".."&&$!=="**"){J=!0;let H=Q===1&&X[Q+1]==="**"?["."]:[];if(X.splice(Q-1,2,...H),X.length===0)X.push("");Q-=2}}}}while(J);return q}secondPhasePreProcess(q){for(let J=0;J<q.length-1;J++)for(let X=J+1;X<q.length;X++){let Z=this.partsMatch(q[J],q[X],!this.preserveMultipleSlashes);if(Z){q[J]=[],q[X]=Z;break}}return q.filter((J)=>J.length)}partsMatch(q,J,X=!1){let Z=0,Q=0,$=[],Y="";while(Z<q.length&&Q<J.length)if(q[Z]===J[Q])$.push(Y==="b"?J[Q]:q[Z]),Z++,Q++;else if(X&&q[Z]==="**"&&J[Q]===q[Z+1])$.push(q[Z]),Z++;else if(X&&J[Q]==="**"&&q[Z]===J[Q+1])$.push(J[Q]),Q++;else if(q[Z]==="*"&&J[Q]&&(this.options.dot||!J[Q].startsWith("."))&&J[Q]!=="**"){if(Y==="b")return!1;Y="a",$.push(q[Z]),Z++,Q++}else if(J[Q]==="*"&&q[Z]&&(this.options.dot||!q[Z].startsWith("."))&&q[Z]!=="**"){if(Y==="a")return!1;Y="b",$.push(J[Q]),Z++,Q++}else return!1;return q.length===J.length&&$}parseNegate(){if(this.nonegate)return;let q=this.pattern,J=!1,X=0;for(let Z=0;Z<q.length&&q.charAt(Z)==="!";Z++)J=!J,X++;if(X)this.pattern=q.slice(X);this.negate=J}matchOne(q,J,X=!1){let Z=this.options;if(this.isWindows){let _=typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0]),L=!_&&q[0]===""&&q[1]===""&&q[2]==="?"&&/^[a-z]:$/i.test(q[3]),x=typeof J[0]==="string"&&/^[a-z]:$/i.test(J[0]),B=!x&&J[0]===""&&J[1]===""&&J[2]==="?"&&typeof J[3]==="string"&&/^[a-z]:$/i.test(J[3]),j=L?3:_?0:void 0,R=B?3:x?0:void 0;if(typeof j==="number"&&typeof R==="number"){let[F,C]=[q[j],J[R]];if(F.toLowerCase()===C.toLowerCase()){if(J[R]=F,R>j)J=J.slice(R);else if(j>R)q=q.slice(j)}}}let{optimizationLevel:Q=1}=this.options;if(Q>=2)q=this.levelTwoFileOptimize(q);this.debug("matchOne",this,{file:q,pattern:J}),this.debug("matchOne",q.length,J.length);for(var $=0,Y=0,H=q.length,K=J.length;$<H&&Y<K;$++,Y++){this.debug("matchOne loop");var G=J[Y],V=q[$];if(this.debug(J,G,V),G===!1)return!1;if(G===r){this.debug("GLOBSTAR",[J,G,V]);var W=$,U=Y+1;if(U===K){this.debug("** at the end");for(;$<H;$++)if(q[$]==="."||q[$]===".."||!Z.dot&&q[$].charAt(0)===".")return!1;return!0}while(W<H){var z=q[W];if(this.debug(`
29
+ - Delete operations are not supported for safety reasons. Use terminal commands with user approval if needed.`,schema:F$});var u8=(q,J,X)=>{let Z=q instanceof RegExp?G7(q,X):q,Q=J instanceof RegExp?G7(J,X):J,$=Z!==null&&Q!=null&&k$(Z,Q,X);return $&&{start:$[0],end:$[1],pre:X.slice(0,$[0]),body:X.slice($[0]+Z.length,$[1]),post:X.slice($[1]+Q.length)}},G7=(q,J)=>{let X=J.match(q);return X?X[0]:null},k$=(q,J,X)=>{let Z,Q,$,Y=void 0,H,K=X.indexOf(q),G=X.indexOf(J,K+1),V=K;if(K>=0&&G>0){if(q===J)return[K,G];Z=[],$=X.length;while(V>=0&&!H){if(V===K)Z.push(V),K=X.indexOf(q,V+1);else if(Z.length===1){let W=Z.pop();if(W!==void 0)H=[W,G]}else{if(Q=Z.pop(),Q!==void 0&&Q<$)$=Q,Y=G;G=X.indexOf(J,V+1)}V=K<G&&K>=0?K:G}if(Z.length&&Y!==void 0)H=[$,Y]}return H};var W7="\x00SLASH"+Math.random()+"\x00",U7="\x00OPEN"+Math.random()+"\x00",d8="\x00CLOSE"+Math.random()+"\x00",z7="\x00COMMA"+Math.random()+"\x00",_7="\x00PERIOD"+Math.random()+"\x00",T$=new RegExp(W7,"g"),w$=new RegExp(U7,"g"),P$=new RegExp(d8,"g"),A$=new RegExp(z7,"g"),D$=new RegExp(_7,"g"),I$=/\\\\/g,O$=/\\{/g,v$=/\\}/g,N$=/\\,/g,E$=/\\./g,y$=1e5;function m8(q){return!isNaN(q)?parseInt(q,10):q.charCodeAt(0)}function S$(q){return q.replace(I$,W7).replace(O$,U7).replace(v$,d8).replace(N$,z7).replace(E$,_7)}function h$(q){return q.replace(T$,"\\").replace(w$,"{").replace(P$,"}").replace(A$,",").replace(D$,".")}function L7(q){if(!q)return[""];let J=[],X=u8("{","}",q);if(!X)return q.split(",");let{pre:Z,body:Q,post:$}=X,Y=Z.split(",");Y[Y.length-1]+="{"+Q+"}";let H=L7($);if($.length)Y[Y.length-1]+=H.shift(),Y.push.apply(Y,H);return J.push.apply(J,Y),J}function B7(q,J={}){if(!q)return[];let{max:X=y$}=J;if(q.slice(0,2)==="{}")q="\\{\\}"+q.slice(2);return o6(S$(q),X,!0).map(h$)}function b$(q){return"{"+q+"}"}function g$(q){return/^-?0\d/.test(q)}function f$(q,J){return q<=J}function u$(q,J){return q>=J}function o6(q,J,X){let Z=[],Q=u8("{","}",q);if(!Q)return[q];let $=Q.pre,Y=Q.post.length?o6(Q.post,J,!1):[""];if(/\$$/.test(Q.pre))for(let H=0;H<Y.length&&H<J;H++){let K=$+"{"+Q.body+"}"+Y[H];Z.push(K)}else{let H=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(Q.body),K=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(Q.body),G=H||K,V=Q.body.indexOf(",")>=0;if(!G&&!V){if(Q.post.match(/,(?!,).*\}/))return q=Q.pre+"{"+Q.body+d8+Q.post,o6(q,J,!0);return[q]}let W;if(G)W=Q.body.split(/\.\./);else if(W=L7(Q.body),W.length===1&&W[0]!==void 0){if(W=o6(W[0],J,!1).map(b$),W.length===1)return Y.map((z)=>Q.pre+W[0]+z)}let U;if(G&&W[0]!==void 0&&W[1]!==void 0){let z=m8(W[0]),_=m8(W[1]),L=Math.max(W[0].length,W[1].length),x=W.length===3&&W[2]!==void 0?Math.abs(m8(W[2])):1,B=f$;if(_<z)x*=-1,B=u$;let R=W.some(g$);U=[];for(let F=z;B(F,_);F+=x){let C;if(K){if(C=String.fromCharCode(F),C==="\\")C=""}else if(C=String(F),R){let y=L-C.length;if(y>0){let O=Array(y+1).join("0");if(F<0)C="-"+O+C.slice(1);else C=O+C}}U.push(C)}}else{U=[];for(let z=0;z<W.length;z++)U.push.apply(U,o6(W[z],J,!1))}for(let z=0;z<U.length;z++)for(let _=0;_<Y.length&&Z.length<J;_++){let L=$+U[z]+Y[_];if(!X||G||L)Z.push(L)}}return Z}var r6=(q)=>{if(typeof q!=="string")throw TypeError("invalid pattern");if(q.length>65536)throw TypeError("pattern is too long")};var m$={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},s6=(q)=>q.replace(/[[\]\\-]/g,"\\$&"),d$=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),x7=(q)=>q.join(""),j7=(q,J)=>{let X=J;if(q.charAt(X)!=="[")throw Error("not in a brace expression");let Z=[],Q=[],$=X+1,Y=!1,H=!1,K=!1,G=!1,V=X,W="";q:while($<q.length){let L=q.charAt($);if((L==="!"||L==="^")&&$===X+1){G=!0,$++;continue}if(L==="]"&&Y&&!K){V=$+1;break}if(Y=!0,L==="\\"){if(!K){K=!0,$++;continue}}if(L==="["&&!K){for(let[x,[B,j,R]]of Object.entries(m$))if(q.startsWith(x,$)){if(W)return["$.",!1,q.length-X,!0];if($+=x.length,R)Q.push(B);else Z.push(B);H=H||j;continue q}}if(K=!1,W){if(L>W)Z.push(s6(W)+"-"+s6(L));else if(L===W)Z.push(s6(L));W="",$++;continue}if(q.startsWith("-]",$+1)){Z.push(s6(L+"-")),$+=2;continue}if(q.startsWith("-",$+1)){W=L,$+=2;continue}Z.push(s6(L)),$++}if(V<$)return["",!1,0,!1];if(!Z.length&&!Q.length)return["$.",!1,q.length-X,!0];if(Q.length===0&&Z.length===1&&/^\\?.$/.test(Z[0])&&!G){let L=Z[0].length===2?Z[0].slice(-1):Z[0];return[d$(L),!1,V-X,!1]}let U="["+(G?"^":"")+x7(Z)+"]",z="["+(G?"":"^")+x7(Q)+"]";return[Z.length&&Q.length?"("+U+"|"+z+")":Z.length?U:z,H,V-X,!0]};var B0=(q,{windowsPathsNoEscape:J=!1,magicalBraces:X=!0}={})=>{if(X)return J?q.replace(/\[([^\/\\])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return J?q.replace(/\[([^\/\\{}])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};var c$=new Set(["!","?","+","*","@"]),R7=(q)=>c$.has(q),l$="(?!(?:^|/)\\.\\.?(?:$|/))",h2="(?!\\.)",p$=new Set(["[","."]),n$=new Set(["..","."]),i$=new Set("().*{}+?[]^$\\!"),a$=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c8="[^/]",M7=c8+"*?",C7=c8+"+?";class o{type;#q;#X;#J=!1;#Z=[];#$;#V;#U;#W=!1;#H;#_;#z=!1;constructor(q,J,X={}){if(this.type=q,q)this.#X=!0;if(this.#$=J,this.#q=this.#$?this.#$.#q:this,this.#H=this.#q===this?X:this.#q.#H,this.#U=this.#q===this?[]:this.#q.#U,q==="!"&&!this.#q.#W)this.#U.push(this);this.#V=this.#$?this.#$.#Z.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let q of this.#Z){if(typeof q==="string")continue;if(q.type||q.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#_!==void 0)return this.#_;if(!this.type)return this.#_=this.#Z.map((q)=>String(q)).join("");else return this.#_=this.type+"("+this.#Z.map((q)=>String(q)).join("|")+")"}#K(){if(this!==this.#q)throw Error("should only call on root");if(this.#W)return this;this.toString(),this.#W=!0;let q;while(q=this.#U.pop()){if(q.type!=="!")continue;let J=q,X=J.#$;while(X){for(let Z=J.#V+1;!X.type&&Z<X.#Z.length;Z++)for(let Q of q.#Z){if(typeof Q==="string")throw Error("string part in extglob AST??");Q.copyIn(X.#Z[Z])}J=X,X=J.#$}}return this}push(...q){for(let J of q){if(J==="")continue;if(typeof J!=="string"&&!(J instanceof o&&J.#$===this))throw Error("invalid part: "+J);this.#Z.push(J)}}toJSON(){let q=this.type===null?this.#Z.slice().map((J)=>typeof J==="string"?J:J.toJSON()):[this.type,...this.#Z.map((J)=>J.toJSON())];if(this.isStart()&&!this.type)q.unshift([]);if(this.isEnd()&&(this===this.#q||this.#q.#W&&this.#$?.type==="!"))q.push({});return q}isStart(){if(this.#q===this)return!0;if(!this.#$?.isStart())return!1;if(this.#V===0)return!0;let q=this.#$;for(let J=0;J<this.#V;J++){let X=q.#Z[J];if(!(X instanceof o&&X.type==="!"))return!1}return!0}isEnd(){if(this.#q===this)return!0;if(this.#$?.type==="!")return!0;if(!this.#$?.isEnd())return!1;if(!this.type)return this.#$?.isEnd();let q=this.#$?this.#$.#Z.length:0;return this.#V===q-1}copyIn(q){if(typeof q==="string")this.push(q);else this.push(q.clone(this))}clone(q){let J=new o(this.type,q);for(let X of this.#Z)J.copyIn(X);return J}static#Y(q,J,X,Z){let Q=!1,$=!1,Y=-1,H=!1;if(J.type===null){let U=X,z="";while(U<q.length){let _=q.charAt(U++);if(Q||_==="\\"){Q=!Q,z+=_;continue}if($){if(U===Y+1){if(_==="^"||_==="!")H=!0}else if(_==="]"&&!(U===Y+2&&H))$=!1;z+=_;continue}else if(_==="["){$=!0,Y=U,H=!1,z+=_;continue}if(!Z.noext&&R7(_)&&q.charAt(U)==="("){J.push(z),z="";let L=new o(_,J);U=o.#Y(q,L,U,Z),J.push(L);continue}z+=_}return J.push(z),U}let K=X+1,G=new o(null,J),V=[],W="";while(K<q.length){let U=q.charAt(K++);if(Q||U==="\\"){Q=!Q,W+=U;continue}if($){if(K===Y+1){if(U==="^"||U==="!")H=!0}else if(U==="]"&&!(K===Y+2&&H))$=!1;W+=U;continue}else if(U==="["){$=!0,Y=K,H=!1,W+=U;continue}if(R7(U)&&q.charAt(K)==="("){G.push(W),W="";let z=new o(U,G);G.push(z),K=o.#Y(q,z,K,Z);continue}if(U==="|"){G.push(W),W="",V.push(G),G=new o(null,J);continue}if(U===")"){if(W===""&&J.#Z.length===0)J.#z=!0;return G.push(W),W="",J.push(...V,G),K}W+=U}return J.type=null,J.#X=void 0,J.#Z=[q.substring(X-1)],K}static fromGlob(q,J={}){let X=new o(null,void 0,J);return o.#Y(q,X,0,J),X}toMMPattern(){if(this!==this.#q)return this.#q.toMMPattern();let q=this.toString(),[J,X,Z,Q]=this.toRegExpSource();if(!(Z||this.#X||this.#H.nocase&&!this.#H.nocaseMagicOnly&&q.toUpperCase()!==q.toLowerCase()))return X;let Y=(this.#H.nocase?"i":"")+(Q?"u":"");return Object.assign(new RegExp(`^${J}$`,Y),{_src:J,_glob:q})}get options(){return this.#H}toRegExpSource(q){let J=q??!!this.#H.dot;if(this.#q===this)this.#K();if(!this.type){let H=this.isStart()&&this.isEnd()&&!this.#Z.some((U)=>typeof U!=="string"),K=this.#Z.map((U)=>{let[z,_,L,x]=typeof U==="string"?o.#C(U,this.#X,H):U.toRegExpSource(q);return this.#X=this.#X||L,this.#J=this.#J||x,z}).join(""),G="";if(this.isStart()){if(typeof this.#Z[0]==="string"){if(!(this.#Z.length===1&&n$.has(this.#Z[0]))){let z=p$,_=J&&z.has(K.charAt(0))||K.startsWith("\\.")&&z.has(K.charAt(2))||K.startsWith("\\.\\.")&&z.has(K.charAt(4)),L=!J&&!q&&z.has(K.charAt(0));G=_?l$:L?h2:""}}}let V="";if(this.isEnd()&&this.#q.#W&&this.#$?.type==="!")V="(?:$|\\/)";return[G+K+V,B0(K),this.#X=!!this.#X,this.#J]}let X=this.type==="*"||this.type==="+",Z=this.type==="!"?"(?:(?!(?:":"(?:",Q=this.#L(J);if(this.isStart()&&this.isEnd()&&!Q&&this.type!=="!"){let H=this.toString();return this.#Z=[H],this.type=null,this.#X=void 0,[H,B0(this.toString()),!1,!1]}let $=!X||q||J||!h2?"":this.#L(!0);if($===Q)$="";if($)Q=`(?:${Q})(?:${$})*?`;let Y="";if(this.type==="!"&&this.#z)Y=(this.isStart()&&!J?h2:"")+C7;else{let H=this.type==="!"?"))"+(this.isStart()&&!J&&!q?h2:"")+M7+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&$?")":this.type==="*"&&$?")?":`)${this.type}`;Y=Z+Q+H}return[Y,B0(Q),this.#X=!!this.#X,this.#J]}#L(q){return this.#Z.map((J)=>{if(typeof J==="string")throw Error("string type in extglob ast??");let[X,Z,Q,$]=J.toRegExpSource(q);return this.#J=this.#J||$,X}).filter((J)=>!(this.isStart()&&this.isEnd())||!!J).join("|")}static#C(q,J,X=!1){let Z=!1,Q="",$=!1,Y=!1;for(let H=0;H<q.length;H++){let K=q.charAt(H);if(Z){Z=!1,Q+=(i$.has(K)?"\\":"")+K;continue}if(K==="*"){if(Y)continue;Y=!0,Q+=X&&/^[*]+$/.test(q)?C7:M7,J=!0;continue}else Y=!1;if(K==="\\"){if(H===q.length-1)Q+="\\\\";else Z=!0;continue}if(K==="["){let[G,V,W,U]=j7(q,H);if(W){Q+=G,$=$||V,H+=W-1,J=J||U;continue}}if(K==="?"){Q+=c8,J=!0;continue}Q+=a$(K)}return[Q,B0(q),!!J,$]}}var F6=(q,{windowsPathsNoEscape:J=!1,magicalBraces:X=!1}={})=>{if(X)return J?q.replace(/[?*()[\]{}]/g,"[$&]"):q.replace(/[?*()[\]\\{}]/g,"\\$&");return J?q.replace(/[?*()[\]]/g,"[$&]"):q.replace(/[?*()[\]\\]/g,"\\$&")};var q0=(q,J,X={})=>{if(r6(J),!X.nocomment&&J.charAt(0)==="#")return!1;return new W0(J,X).match(q)},o$=/^\*+([^+@!?\*\[\(]*)$/,r$=(q)=>(J)=>!J.startsWith(".")&&J.endsWith(q),s$=(q)=>(J)=>J.endsWith(q),t$=(q)=>{return q=q.toLowerCase(),(J)=>!J.startsWith(".")&&J.toLowerCase().endsWith(q)},e$=(q)=>{return q=q.toLowerCase(),(J)=>J.toLowerCase().endsWith(q)},qY=/^\*+\.\*+$/,JY=(q)=>!q.startsWith(".")&&q.includes("."),XY=(q)=>q!=="."&&q!==".."&&q.includes("."),ZY=/^\.\*+$/,QY=(q)=>q!=="."&&q!==".."&&q.startsWith("."),$Y=/^\*+$/,YY=(q)=>q.length!==0&&!q.startsWith("."),HY=(q)=>q.length!==0&&q!=="."&&q!=="..",KY=/^\?+([^+@!?\*\[\(]*)?$/,VY=([q,J=""])=>{let X=T7([q]);if(!J)return X;return J=J.toLowerCase(),(Z)=>X(Z)&&Z.toLowerCase().endsWith(J)},GY=([q,J=""])=>{let X=w7([q]);if(!J)return X;return J=J.toLowerCase(),(Z)=>X(Z)&&Z.toLowerCase().endsWith(J)},WY=([q,J=""])=>{let X=w7([q]);return!J?X:(Z)=>X(Z)&&Z.endsWith(J)},UY=([q,J=""])=>{let X=T7([q]);return!J?X:(Z)=>X(Z)&&Z.endsWith(J)},T7=([q])=>{let J=q.length;return(X)=>X.length===J&&!X.startsWith(".")},w7=([q])=>{let J=q.length;return(X)=>X.length===J&&X!=="."&&X!==".."},P7=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",F7={win32:{sep:"\\"},posix:{sep:"/"}},zY=P7==="win32"?F7.win32.sep:F7.posix.sep;q0.sep=zY;var r=Symbol("globstar **");q0.GLOBSTAR=r;var _Y="[^/]",LY=_Y+"*?",BY="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",xY="(?:(?!(?:\\/|^)\\.).)*?",jY=(q,J={})=>(X)=>q0(X,q,J);q0.filter=jY;var G0=(q,J={})=>Object.assign({},q,J),RY=(q)=>{if(!q||typeof q!=="object"||!Object.keys(q).length)return q0;let J=q0;return Object.assign((Z,Q,$={})=>J(Z,Q,G0(q,$)),{Minimatch:class extends J.Minimatch{constructor(Q,$={}){super(Q,G0(q,$))}static defaults(Q){return J.defaults(G0(q,Q)).Minimatch}},AST:class extends J.AST{constructor(Q,$,Y={}){super(Q,$,G0(q,Y))}static fromGlob(Q,$={}){return J.AST.fromGlob(Q,G0(q,$))}},unescape:(Z,Q={})=>J.unescape(Z,G0(q,Q)),escape:(Z,Q={})=>J.escape(Z,G0(q,Q)),filter:(Z,Q={})=>J.filter(Z,G0(q,Q)),defaults:(Z)=>J.defaults(G0(q,Z)),makeRe:(Z,Q={})=>J.makeRe(Z,G0(q,Q)),braceExpand:(Z,Q={})=>J.braceExpand(Z,G0(q,Q)),match:(Z,Q,$={})=>J.match(Z,Q,G0(q,$)),sep:J.sep,GLOBSTAR:r})};q0.defaults=RY;var A7=(q,J={})=>{if(r6(q),J.nobrace||!/\{(?:(?!\{).)*\}/.test(q))return[q];return B7(q,{max:J.braceExpandMax})};q0.braceExpand=A7;var MY=(q,J={})=>new W0(q,J).makeRe();q0.makeRe=MY;var CY=(q,J,X={})=>{let Z=new W0(J,X);if(q=q.filter((Q)=>Z.match(Q)),Z.options.nonull&&!q.length)q.push(J);return q};q0.match=CY;var k7=/[?*]|[+@!]\(.*?\)|\[|\]/,FY=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class W0{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(q,J={}){r6(q),J=J||{},this.options=J,this.pattern=q,this.platform=J.platform||P7,this.isWindows=this.platform==="win32";let X="allowWindowsEscape";if(this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J[X]===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!J.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!J.nonegate,this.comment=!1,this.empty=!1,this.partial=!!J.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=J.windowsNoMagicRoot!==void 0?J.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let q of this.set)for(let J of q)if(typeof J!=="string")return!0;return!1}debug(...q){}make(){let q=this.pattern,J=this.options;if(!J.nocomment&&q.charAt(0)==="#"){this.comment=!0;return}if(!q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],J.debug)this.debug=(...Q)=>console.error(...Q);this.debug(this.pattern,this.globSet);let X=this.globSet.map((Q)=>this.slashSplit(Q));this.globParts=this.preprocess(X),this.debug(this.pattern,this.globParts);let Z=this.globParts.map((Q,$,Y)=>{if(this.isWindows&&this.windowsNoMagicRoot){let H=Q[0]===""&&Q[1]===""&&(Q[2]==="?"||!k7.test(Q[2]))&&!k7.test(Q[3]),K=/^[a-z]:/i.test(Q[0]);if(H)return[...Q.slice(0,4),...Q.slice(4).map((G)=>this.parse(G))];else if(K)return[Q[0],...Q.slice(1).map((G)=>this.parse(G))]}return Q.map((H)=>this.parse(H))});if(this.debug(this.pattern,Z),this.set=Z.filter((Q)=>Q.indexOf(!1)===-1),this.isWindows)for(let Q=0;Q<this.set.length;Q++){let $=this.set[Q];if($[0]===""&&$[1]===""&&this.globParts[Q][2]==="?"&&typeof $[3]==="string"&&/^[a-z]:$/i.test($[3]))$[2]="?"}this.debug(this.pattern,this.set)}preprocess(q){if(this.options.noglobstar){for(let X=0;X<q.length;X++)for(let Z=0;Z<q[X].length;Z++)if(q[X][Z]==="**")q[X][Z]="*"}let{optimizationLevel:J=1}=this.options;if(J>=2)q=this.firstPhasePreProcess(q),q=this.secondPhasePreProcess(q);else if(J>=1)q=this.levelOneOptimize(q);else q=this.adjascentGlobstarOptimize(q);return q}adjascentGlobstarOptimize(q){return q.map((J)=>{let X=-1;while((X=J.indexOf("**",X+1))!==-1){let Z=X;while(J[Z+1]==="**")Z++;if(Z!==X)J.splice(X,Z-X)}return J})}levelOneOptimize(q){return q.map((J)=>{return J=J.reduce((X,Z)=>{let Q=X[X.length-1];if(Z==="**"&&Q==="**")return X;if(Z===".."){if(Q&&Q!==".."&&Q!=="."&&Q!=="**")return X.pop(),X}return X.push(Z),X},[]),J.length===0?[""]:J})}levelTwoFileOptimize(q){if(!Array.isArray(q))q=this.slashSplit(q);let J=!1;do{if(J=!1,!this.preserveMultipleSlashes){for(let Z=1;Z<q.length-1;Z++){let Q=q[Z];if(Z===1&&Q===""&&q[0]==="")continue;if(Q==="."||Q==="")J=!0,q.splice(Z,1),Z--}if(q[0]==="."&&q.length===2&&(q[1]==="."||q[1]===""))J=!0,q.pop()}let X=0;while((X=q.indexOf("..",X+1))!==-1){let Z=q[X-1];if(Z&&Z!=="."&&Z!==".."&&Z!=="**")J=!0,q.splice(X-1,2),X-=2}}while(J);return q.length===0?[""]:q}firstPhasePreProcess(q){let J=!1;do{J=!1;for(let X of q){let Z=-1;while((Z=X.indexOf("**",Z+1))!==-1){let $=Z;while(X[$+1]==="**")$++;if($>Z)X.splice(Z+1,$-Z);let Y=X[Z+1],H=X[Z+2],K=X[Z+3];if(Y!=="..")continue;if(!H||H==="."||H===".."||!K||K==="."||K==="..")continue;J=!0,X.splice(Z,1);let G=X.slice(0);G[Z]="**",q.push(G),Z--}if(!this.preserveMultipleSlashes){for(let $=1;$<X.length-1;$++){let Y=X[$];if($===1&&Y===""&&X[0]==="")continue;if(Y==="."||Y==="")J=!0,X.splice($,1),$--}if(X[0]==="."&&X.length===2&&(X[1]==="."||X[1]===""))J=!0,X.pop()}let Q=0;while((Q=X.indexOf("..",Q+1))!==-1){let $=X[Q-1];if($&&$!=="."&&$!==".."&&$!=="**"){J=!0;let H=Q===1&&X[Q+1]==="**"?["."]:[];if(X.splice(Q-1,2,...H),X.length===0)X.push("");Q-=2}}}}while(J);return q}secondPhasePreProcess(q){for(let J=0;J<q.length-1;J++)for(let X=J+1;X<q.length;X++){let Z=this.partsMatch(q[J],q[X],!this.preserveMultipleSlashes);if(Z){q[J]=[],q[X]=Z;break}}return q.filter((J)=>J.length)}partsMatch(q,J,X=!1){let Z=0,Q=0,$=[],Y="";while(Z<q.length&&Q<J.length)if(q[Z]===J[Q])$.push(Y==="b"?J[Q]:q[Z]),Z++,Q++;else if(X&&q[Z]==="**"&&J[Q]===q[Z+1])$.push(q[Z]),Z++;else if(X&&J[Q]==="**"&&q[Z]===J[Q+1])$.push(J[Q]),Q++;else if(q[Z]==="*"&&J[Q]&&(this.options.dot||!J[Q].startsWith("."))&&J[Q]!=="**"){if(Y==="b")return!1;Y="a",$.push(q[Z]),Z++,Q++}else if(J[Q]==="*"&&q[Z]&&(this.options.dot||!q[Z].startsWith("."))&&q[Z]!=="**"){if(Y==="a")return!1;Y="b",$.push(J[Q]),Z++,Q++}else return!1;return q.length===J.length&&$}parseNegate(){if(this.nonegate)return;let q=this.pattern,J=!1,X=0;for(let Z=0;Z<q.length&&q.charAt(Z)==="!";Z++)J=!J,X++;if(X)this.pattern=q.slice(X);this.negate=J}matchOne(q,J,X=!1){let Z=this.options;if(this.isWindows){let _=typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0]),L=!_&&q[0]===""&&q[1]===""&&q[2]==="?"&&/^[a-z]:$/i.test(q[3]),x=typeof J[0]==="string"&&/^[a-z]:$/i.test(J[0]),B=!x&&J[0]===""&&J[1]===""&&J[2]==="?"&&typeof J[3]==="string"&&/^[a-z]:$/i.test(J[3]),j=L?3:_?0:void 0,R=B?3:x?0:void 0;if(typeof j==="number"&&typeof R==="number"){let[F,C]=[q[j],J[R]];if(F.toLowerCase()===C.toLowerCase()){if(J[R]=F,R>j)J=J.slice(R);else if(j>R)q=q.slice(j)}}}let{optimizationLevel:Q=1}=this.options;if(Q>=2)q=this.levelTwoFileOptimize(q);this.debug("matchOne",this,{file:q,pattern:J}),this.debug("matchOne",q.length,J.length);for(var $=0,Y=0,H=q.length,K=J.length;$<H&&Y<K;$++,Y++){this.debug("matchOne loop");var G=J[Y],V=q[$];if(this.debug(J,G,V),G===!1)return!1;if(G===r){this.debug("GLOBSTAR",[J,G,V]);var W=$,U=Y+1;if(U===K){this.debug("** at the end");for(;$<H;$++)if(q[$]==="."||q[$]===".."||!Z.dot&&q[$].charAt(0)===".")return!1;return!0}while(W<H){var z=q[W];if(this.debug(`
30
30
  globstar while`,q,W,J,U,z),this.matchOne(q.slice(W),J.slice(U),X))return this.debug("globstar found match!",W,H,z),!0;else{if(z==="."||z===".."||!Z.dot&&z.charAt(0)==="."){this.debug("dot detected!",q,W,J,U);break}this.debug("globstar swallow a segment, and continue"),W++}}if(X){if(this.debug(`
31
- >>> no match, partial?`,q,W,J,U),W===H)return!0}return!1}let _;if(typeof G==="string")_=V===G,this.debug("string match",G,V,_);else _=G.test(V),this.debug("pattern match",G,V,_);if(!_)return!1}if($===H&&Y===K)return!0;else if($===H)return X;else if(Y===K)return $===H-1&&q[$]==="";else throw Error("wtf?")}braceExpand(){return M7(this.pattern,this.options)}parse(q){a6(q);let J=this.options;if(q==="**")return r;if(q==="")return"";let X,Z=null;if(X=q.match(o$))Z=J.dot?s$:r$;else if(X=q.match(f$))Z=(J.nocase?J.dot?c$:d$:J.dot?m$:u$)(X[1]);else if(X=q.match(t$))Z=(J.nocase?J.dot?qY:e$:J.dot?JY:XY)(X);else if(X=q.match(l$))Z=J.dot?n$:p$;else if(X=q.match(i$))Z=a$;let Q=o.fromGlob(q,this.options).toMMPattern();if(Z&&typeof Q==="object")Reflect.defineProperty(Q,"test",{value:Z});return Q}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let q=this.set;if(!q.length)return this.regexp=!1,this.regexp;let J=this.options,X=J.noglobstar?$Y:J.dot?YY:HY,Z=new Set(J.nocase?["i"]:[]),Q=q.map((H)=>{let K=H.map((V)=>{if(V instanceof RegExp)for(let W of V.flags.split(""))Z.add(W);return typeof V==="string"?UY(V):V===r?r:V._src});K.forEach((V,W)=>{let U=K[W+1],z=K[W-1];if(V!==r||z===r)return;if(z===void 0)if(U!==void 0&&U!==r)K[W+1]="(?:\\/|"+X+"\\/)?"+U;else K[W]=X;else if(U===void 0)K[W-1]=z+"(?:\\/|\\/"+X+")?";else if(U!==r)K[W-1]=z+"(?:\\/|\\/"+X+"\\/)"+U,K[W+1]=r});let G=K.filter((V)=>V!==r);if(this.partial&&G.length>=1){let V=[];for(let W=1;W<=G.length;W++)V.push(G.slice(0,W).join("/"));return"(?:"+V.join("|")+")"}return G.join("/")}).join("|"),[$,Y]=q.length>1?["(?:",")"]:["",""];if(Q="^"+$+Q+Y+"$",this.partial)Q="^(?:\\/|"+$+Q.slice(1,-1)+Y+")$";if(this.negate)Q="^(?!"+Q+").+$";try{this.regexp=new RegExp(Q,[...Z].join(""))}catch(H){this.regexp=!1}return this.regexp}slashSplit(q){if(this.preserveMultipleSlashes)return q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(q))return["",...q.split(/\/+/)];else return q.split(/\/+/)}match(q,J=this.partial){if(this.debug("match",q,this.pattern),this.comment)return!1;if(this.empty)return q==="";if(q==="/"&&J)return!0;let X=this.options;if(this.isWindows)q=q.split("\\").join("/");let Z=this.slashSplit(q);this.debug(this.pattern,"split",Z);let Q=this.set;this.debug(this.pattern,"set",Q);let $=Z[Z.length-1];if(!$)for(let Y=Z.length-2;!$&&Y>=0;Y--)$=Z[Y];for(let Y=0;Y<Q.length;Y++){let H=Q[Y],K=Z;if(X.matchBase&&H.length===1)K=[$];if(this.matchOne(K,H,J)){if(X.flipNegate)return!0;return!this.negate}}if(X.flipNegate)return!1;return this.negate}static defaults(q){return q0.defaults(q).Minimatch}}q0.AST=o;q0.Minimatch=W0;q0.escape=M6;q0.unescape=B0;import{fileURLToPath as nY}from"node:url";var zY=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,F7=new Set,c8=typeof process=="object"&&process?process:{},k7=(q,J,X,Z)=>{typeof c8.emitWarning=="function"?c8.emitWarning(q,J,X,Z):console.error(`[${X}] ${J}: ${q}`)},b2=globalThis.AbortController,C7=globalThis.AbortSignal;if(typeof b2>"u"){C7=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(X,Z){this._onabort.push(Z)}},b2=class{constructor(){J()}signal=new C7;abort(X){if(!this.signal.aborted){this.signal.reason=X,this.signal.aborted=!0;for(let Z of this.signal._onabort)Z(X);this.signal.onabort?.(X)}}};let q=c8.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",J=()=>{q&&(q=!1,k7("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",J))}}var _Y=(q)=>!F7.has(q),wj=Symbol("type"),p0=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),T7=(q)=>p0(q)?q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?h2:null:null,h2=class extends Array{constructor(q){super(q),this.fill(0)}},LY=class q{heap;length;static#q=!1;static create(J){let X=T7(J);if(!X)return[];q.#q=!0;let Z=new q(J,X);return q.#q=!1,Z}constructor(J,X){if(!q.#q)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new X(J),this.length=0}push(J){this.heap[this.length++]=J}pop(){return this.heap[--this.length]}},r6=class q{#q;#X;#J;#Z;#$;#V;#U;#W;get perf(){return this.#W}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#H;#_;#z;#K;#Y;#L;#C;#M;#B;#D;#x;#T;#w;#j;#R;#F;#P;#Q;#y;static unsafeExposeInternals(J){return{starts:J.#w,ttls:J.#j,autopurgeTimers:J.#R,sizes:J.#T,keyMap:J.#z,keyList:J.#K,valList:J.#Y,next:J.#L,prev:J.#C,get head(){return J.#M},get tail(){return J.#B},free:J.#D,isBackgroundFetch:(X)=>J.#G(X),backgroundFetch:(X,Z,Q,$)=>J.#d(X,Z,Q,$),moveToTail:(X)=>J.#h(X),indexes:(X)=>J.#O(X),rindexes:(X)=>J.#v(X),isStale:(X)=>J.#k(X)}}get max(){return this.#q}get maxSize(){return this.#X}get calculatedSize(){return this.#_}get size(){return this.#H}get fetchMethod(){return this.#V}get memoMethod(){return this.#U}get dispose(){return this.#J}get onInsert(){return this.#Z}get disposeAfter(){return this.#$}constructor(J){let{max:X=0,ttl:Z,ttlResolution:Q=1,ttlAutopurge:$,updateAgeOnGet:Y,updateAgeOnHas:H,allowStale:K,dispose:G,onInsert:V,disposeAfter:W,noDisposeOnSet:U,noUpdateTTL:z,maxSize:_=0,maxEntrySize:L=0,sizeCalculation:x,fetchMethod:B,memoMethod:j,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:y,ignoreFetchAbort:O,perf:g}=J;if(g!==void 0&&typeof g?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#W=g??zY,X!==0&&!p0(X))throw TypeError("max option must be a nonnegative integer");let M=X?T7(X):Array;if(!M)throw Error("invalid max value: "+X);if(this.#q=X,this.#X=_,this.maxEntrySize=L||this.#X,this.sizeCalculation=x,this.sizeCalculation){if(!this.#X&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(j!==void 0&&typeof j!="function")throw TypeError("memoMethod must be a function if defined");if(this.#U=j,B!==void 0&&typeof B!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#V=B,this.#P=!!B,this.#z=new Map,this.#K=Array(X).fill(void 0),this.#Y=Array(X).fill(void 0),this.#L=new M(X),this.#C=new M(X),this.#M=0,this.#B=0,this.#D=LY.create(X),this.#H=0,this.#_=0,typeof G=="function"&&(this.#J=G),typeof V=="function"&&(this.#Z=V),typeof W=="function"?(this.#$=W,this.#x=[]):(this.#$=void 0,this.#x=void 0),this.#F=!!this.#J,this.#y=!!this.#Z,this.#Q=!!this.#$,this.noDisposeOnSet=!!U,this.noUpdateTTL=!!z,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!y,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#X!==0&&!p0(this.#X))throw TypeError("maxSize must be a positive integer if specified");if(!p0(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#l()}if(this.allowStale=!!K,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!H,this.ttlResolution=p0(Q)||Q===0?Q:1,this.ttlAutopurge=!!$,this.ttl=Z||0,this.ttl){if(!p0(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#q===0&&this.ttl===0&&this.#X===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#X){let P="LRU_CACHE_UNBOUNDED";_Y(P)&&(F7.add(P),k7("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,q))}}getRemainingTTL(J){return this.#z.has(J)?1/0:0}#N(){let J=new h2(this.#q),X=new h2(this.#q);this.#j=J,this.#w=X;let Z=this.ttlAutopurge?Array(this.#q):void 0;this.#R=Z,this.#g=(Y,H,K=this.#W.now())=>{if(X[Y]=H!==0?K:0,J[Y]=H,Z?.[Y]&&(clearTimeout(Z[Y]),Z[Y]=void 0),H!==0&&Z){let G=setTimeout(()=>{this.#k(Y)&&this.#I(this.#K[Y],"expire")},H+1);G.unref&&G.unref(),Z[Y]=G}},this.#A=(Y)=>{X[Y]=J[Y]!==0?this.#W.now():0},this.#E=(Y,H)=>{if(J[H]){let K=J[H],G=X[H];if(!K||!G)return;Y.ttl=K,Y.start=G,Y.now=Q||$();let V=Y.now-G;Y.remainingTTL=K-V}};let Q=0,$=()=>{let Y=this.#W.now();if(this.ttlResolution>0){Q=Y;let H=setTimeout(()=>Q=0,this.ttlResolution);H.unref&&H.unref()}return Y};this.getRemainingTTL=(Y)=>{let H=this.#z.get(Y);if(H===void 0)return 0;let K=J[H],G=X[H];if(!K||!G)return 1/0;let V=(Q||$())-G;return K-V},this.#k=(Y)=>{let H=X[Y],K=J[Y];return!!K&&!!H&&(Q||$())-H>K}}#A=()=>{};#E=()=>{};#g=()=>{};#k=()=>!1;#l(){let J=new h2(this.#q);this.#_=0,this.#T=J,this.#b=(X)=>{this.#_-=J[X],J[X]=0},this.#f=(X,Z,Q,$)=>{if(this.#G(Z))return 0;if(!p0(Q))if($){if(typeof $!="function")throw TypeError("sizeCalculation must be a function");if(Q=$(Z,X),!p0(Q))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return Q},this.#S=(X,Z,Q)=>{if(J[X]=Z,this.#X){let $=this.#X-J[X];for(;this.#_>$;)this.#m(!0)}this.#_+=J[X],Q&&(Q.entrySize=Z,Q.totalCalculatedSize=this.#_)}}#b=(J)=>{};#S=(J,X,Z)=>{};#f=(J,X,Z,Q)=>{if(Z||Q)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:J=this.allowStale}={}){if(this.#H)for(let X=this.#B;!(!this.#u(X)||((J||!this.#k(X))&&(yield X),X===this.#M));)X=this.#C[X]}*#v({allowStale:J=this.allowStale}={}){if(this.#H)for(let X=this.#M;!(!this.#u(X)||((J||!this.#k(X))&&(yield X),X===this.#B));)X=this.#L[X]}#u(J){return J!==void 0&&this.#z.get(this.#K[J])===J}*entries(){for(let J of this.#O())this.#Y[J]!==void 0&&this.#K[J]!==void 0&&!this.#G(this.#Y[J])&&(yield[this.#K[J],this.#Y[J]])}*rentries(){for(let J of this.#v())this.#Y[J]!==void 0&&this.#K[J]!==void 0&&!this.#G(this.#Y[J])&&(yield[this.#K[J],this.#Y[J]])}*keys(){for(let J of this.#O()){let X=this.#K[J];X!==void 0&&!this.#G(this.#Y[J])&&(yield X)}}*rkeys(){for(let J of this.#v()){let X=this.#K[J];X!==void 0&&!this.#G(this.#Y[J])&&(yield X)}}*values(){for(let J of this.#O())this.#Y[J]!==void 0&&!this.#G(this.#Y[J])&&(yield this.#Y[J])}*rvalues(){for(let J of this.#v())this.#Y[J]!==void 0&&!this.#G(this.#Y[J])&&(yield this.#Y[J])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(J,X={}){for(let Z of this.#O()){let Q=this.#Y[Z],$=this.#G(Q)?Q.__staleWhileFetching:Q;if($!==void 0&&J($,this.#K[Z],this))return this.get(this.#K[Z],X)}}forEach(J,X=this){for(let Z of this.#O()){let Q=this.#Y[Z],$=this.#G(Q)?Q.__staleWhileFetching:Q;$!==void 0&&J.call(X,$,this.#K[Z],this)}}rforEach(J,X=this){for(let Z of this.#v()){let Q=this.#Y[Z],$=this.#G(Q)?Q.__staleWhileFetching:Q;$!==void 0&&J.call(X,$,this.#K[Z],this)}}purgeStale(){let J=!1;for(let X of this.#v({allowStale:!0}))this.#k(X)&&(this.#I(this.#K[X],"expire"),J=!0);return J}info(J){let X=this.#z.get(J);if(X===void 0)return;let Z=this.#Y[X],Q=this.#G(Z)?Z.__staleWhileFetching:Z;if(Q===void 0)return;let $={value:Q};if(this.#j&&this.#w){let Y=this.#j[X],H=this.#w[X];if(Y&&H){let K=Y-(this.#W.now()-H);$.ttl=K,$.start=Date.now()}}return this.#T&&($.size=this.#T[X]),$}dump(){let J=[];for(let X of this.#O({allowStale:!0})){let Z=this.#K[X],Q=this.#Y[X],$=this.#G(Q)?Q.__staleWhileFetching:Q;if($===void 0||Z===void 0)continue;let Y={value:$};if(this.#j&&this.#w){Y.ttl=this.#j[X];let H=this.#W.now()-this.#w[X];Y.start=Math.floor(Date.now()-H)}this.#T&&(Y.size=this.#T[X]),J.unshift([Z,Y])}return J}load(J){this.clear();for(let[X,Z]of J){if(Z.start){let Q=Date.now()-Z.start;Z.start=this.#W.now()-Q}this.set(X,Z.value,Z)}}set(J,X,Z={}){if(X===void 0)return this.delete(J),this;let{ttl:Q=this.ttl,start:$,noDisposeOnSet:Y=this.noDisposeOnSet,sizeCalculation:H=this.sizeCalculation,status:K}=Z,{noUpdateTTL:G=this.noUpdateTTL}=Z,V=this.#f(J,X,Z.size||0,H);if(this.maxEntrySize&&V>this.maxEntrySize)return K&&(K.set="miss",K.maxEntrySizeExceeded=!0),this.#I(J,"set"),this;let W=this.#H===0?void 0:this.#z.get(J);if(W===void 0)W=this.#H===0?this.#B:this.#D.length!==0?this.#D.pop():this.#H===this.#q?this.#m(!1):this.#H,this.#K[W]=J,this.#Y[W]=X,this.#z.set(J,W),this.#L[this.#B]=W,this.#C[W]=this.#B,this.#B=W,this.#H++,this.#S(W,V,K),K&&(K.set="add"),G=!1,this.#y&&this.#Z?.(X,J,"add");else{this.#h(W);let U=this.#Y[W];if(X!==U){if(this.#P&&this.#G(U)){U.__abortController.abort(Error("replaced"));let{__staleWhileFetching:z}=U;z!==void 0&&!Y&&(this.#F&&this.#J?.(z,J,"set"),this.#Q&&this.#x?.push([z,J,"set"]))}else Y||(this.#F&&this.#J?.(U,J,"set"),this.#Q&&this.#x?.push([U,J,"set"]));if(this.#b(W),this.#S(W,V,K),this.#Y[W]=X,K){K.set="replace";let z=U&&this.#G(U)?U.__staleWhileFetching:U;z!==void 0&&(K.oldValue=z)}}else K&&(K.set="update");this.#y&&this.onInsert?.(X,J,X===U?"update":"replace")}if(Q!==0&&!this.#j&&this.#N(),this.#j&&(G||this.#g(W,Q,$),K&&this.#E(K,W)),!Y&&this.#Q&&this.#x){let U=this.#x,z;for(;z=U?.shift();)this.#$?.(...z)}return this}pop(){try{for(;this.#H;){let J=this.#Y[this.#M];if(this.#m(!0),this.#G(J)){if(J.__staleWhileFetching)return J.__staleWhileFetching}else if(J!==void 0)return J}}finally{if(this.#Q&&this.#x){let J=this.#x,X;for(;X=J?.shift();)this.#$?.(...X)}}}#m(J){let X=this.#M,Z=this.#K[X],Q=this.#Y[X];return this.#P&&this.#G(Q)?Q.__abortController.abort(Error("evicted")):(this.#F||this.#Q)&&(this.#F&&this.#J?.(Q,Z,"evict"),this.#Q&&this.#x?.push([Q,Z,"evict"])),this.#b(X),this.#R?.[X]&&(clearTimeout(this.#R[X]),this.#R[X]=void 0),J&&(this.#K[X]=void 0,this.#Y[X]=void 0,this.#D.push(X)),this.#H===1?(this.#M=this.#B=0,this.#D.length=0):this.#M=this.#L[X],this.#z.delete(Z),this.#H--,X}has(J,X={}){let{updateAgeOnHas:Z=this.updateAgeOnHas,status:Q}=X,$=this.#z.get(J);if($!==void 0){let Y=this.#Y[$];if(this.#G(Y)&&Y.__staleWhileFetching===void 0)return!1;if(this.#k($))Q&&(Q.has="stale",this.#E(Q,$));else return Z&&this.#A($),Q&&(Q.has="hit",this.#E(Q,$)),!0}else Q&&(Q.has="miss");return!1}peek(J,X={}){let{allowStale:Z=this.allowStale}=X,Q=this.#z.get(J);if(Q===void 0||!Z&&this.#k(Q))return;let $=this.#Y[Q];return this.#G($)?$.__staleWhileFetching:$}#d(J,X,Z,Q){let $=X===void 0?void 0:this.#Y[X];if(this.#G($))return $;let Y=new b2,{signal:H}=Z;H?.addEventListener("abort",()=>Y.abort(H.reason),{signal:Y.signal});let K={signal:Y.signal,options:Z,context:Q},G=(L,x=!1)=>{let{aborted:B}=Y.signal,j=Z.ignoreFetchAbort&&L!==void 0,R=Z.ignoreFetchAbort||!!(Z.allowStaleOnFetchAbort&&L!==void 0);if(Z.status&&(B&&!x?(Z.status.fetchAborted=!0,Z.status.fetchError=Y.signal.reason,j&&(Z.status.fetchAbortIgnored=!0)):Z.status.fetchResolved=!0),B&&!j&&!x)return W(Y.signal.reason,R);let F=z,C=this.#Y[X];return(C===z||j&&x&&C===void 0)&&(L===void 0?F.__staleWhileFetching!==void 0?this.#Y[X]=F.__staleWhileFetching:this.#I(J,"fetch"):(Z.status&&(Z.status.fetchUpdated=!0),this.set(J,L,K.options))),L},V=(L)=>(Z.status&&(Z.status.fetchRejected=!0,Z.status.fetchError=L),W(L,!1)),W=(L,x)=>{let{aborted:B}=Y.signal,j=B&&Z.allowStaleOnFetchAbort,R=j||Z.allowStaleOnFetchRejection,F=R||Z.noDeleteOnFetchRejection,C=z;if(this.#Y[X]===z&&(!F||!x&&C.__staleWhileFetching===void 0?this.#I(J,"fetch"):j||(this.#Y[X]=C.__staleWhileFetching)),R)return Z.status&&C.__staleWhileFetching!==void 0&&(Z.status.returnedStale=!0),C.__staleWhileFetching;if(C.__returned===C)throw L},U=(L,x)=>{let B=this.#V?.(J,$,K);B&&B instanceof Promise&&B.then((j)=>L(j===void 0?void 0:j),x),Y.signal.addEventListener("abort",()=>{(!Z.ignoreFetchAbort||Z.allowStaleOnFetchAbort)&&(L(void 0),Z.allowStaleOnFetchAbort&&(L=(j)=>G(j,!0)))})};Z.status&&(Z.status.fetchDispatched=!0);let z=new Promise(U).then(G,V),_=Object.assign(z,{__abortController:Y,__staleWhileFetching:$,__returned:void 0});return X===void 0?(this.set(J,_,{...K.options,status:void 0}),X=this.#z.get(J)):this.#Y[X]=_,_}#G(J){if(!this.#P)return!1;let X=J;return!!X&&X instanceof Promise&&X.hasOwnProperty("__staleWhileFetching")&&X.__abortController instanceof b2}async fetch(J,X={}){let{allowStale:Z=this.allowStale,updateAgeOnGet:Q=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:H=this.noDisposeOnSet,size:K=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:V=this.noUpdateTTL,noDeleteOnFetchRejection:W=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:U=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:L,forceRefresh:x=!1,status:B,signal:j}=X;if(!this.#P)return B&&(B.fetch="get"),this.get(J,{allowStale:Z,updateAgeOnGet:Q,noDeleteOnStaleGet:$,status:B});let R={allowStale:Z,updateAgeOnGet:Q,noDeleteOnStaleGet:$,ttl:Y,noDisposeOnSet:H,size:K,sizeCalculation:G,noUpdateTTL:V,noDeleteOnFetchRejection:W,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:_,ignoreFetchAbort:z,status:B,signal:j},F=this.#z.get(J);if(F===void 0){B&&(B.fetch="miss");let C=this.#d(J,F,R,L);return C.__returned=C}else{let C=this.#Y[F];if(this.#G(C)){let M=Z&&C.__staleWhileFetching!==void 0;return B&&(B.fetch="inflight",M&&(B.returnedStale=!0)),M?C.__staleWhileFetching:C.__returned=C}let y=this.#k(F);if(!x&&!y)return B&&(B.fetch="hit"),this.#h(F),Q&&this.#A(F),B&&this.#E(B,F),C;let O=this.#d(J,F,R,L),g=O.__staleWhileFetching!==void 0&&Z;return B&&(B.fetch=y?"stale":"refresh",g&&y&&(B.returnedStale=!0)),g?O.__staleWhileFetching:O.__returned=O}}async forceFetch(J,X={}){let Z=await this.fetch(J,X);if(Z===void 0)throw Error("fetch() returned undefined");return Z}memo(J,X={}){let Z=this.#U;if(!Z)throw Error("no memoMethod provided to constructor");let{context:Q,forceRefresh:$,...Y}=X,H=this.get(J,Y);if(!$&&H!==void 0)return H;let K=Z(J,H,{options:Y,context:Q});return this.set(J,K,Y),K}get(J,X={}){let{allowStale:Z=this.allowStale,updateAgeOnGet:Q=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,status:Y}=X,H=this.#z.get(J);if(H!==void 0){let K=this.#Y[H],G=this.#G(K);return Y&&this.#E(Y,H),this.#k(H)?(Y&&(Y.get="stale"),G?(Y&&Z&&K.__staleWhileFetching!==void 0&&(Y.returnedStale=!0),Z?K.__staleWhileFetching:void 0):($||this.#I(J,"expire"),Y&&Z&&(Y.returnedStale=!0),Z?K:void 0)):(Y&&(Y.get="hit"),G?K.__staleWhileFetching:(this.#h(H),Q&&this.#A(H),K))}else Y&&(Y.get="miss")}#c(J,X){this.#C[X]=J,this.#L[J]=X}#h(J){J!==this.#B&&(J===this.#M?this.#M=this.#L[J]:this.#c(this.#C[J],this.#L[J]),this.#c(this.#B,J),this.#B=J)}delete(J){return this.#I(J,"delete")}#I(J,X){let Z=!1;if(this.#H!==0){let Q=this.#z.get(J);if(Q!==void 0)if(this.#R?.[Q]&&(clearTimeout(this.#R?.[Q]),this.#R[Q]=void 0),Z=!0,this.#H===1)this.#p(X);else{this.#b(Q);let $=this.#Y[Q];if(this.#G($)?$.__abortController.abort(Error("deleted")):(this.#F||this.#Q)&&(this.#F&&this.#J?.($,J,X),this.#Q&&this.#x?.push([$,J,X])),this.#z.delete(J),this.#K[Q]=void 0,this.#Y[Q]=void 0,Q===this.#B)this.#B=this.#C[Q];else if(Q===this.#M)this.#M=this.#L[Q];else{let Y=this.#C[Q];this.#L[Y]=this.#L[Q];let H=this.#L[Q];this.#C[H]=this.#C[Q]}this.#H--,this.#D.push(Q)}}if(this.#Q&&this.#x?.length){let Q=this.#x,$;for(;$=Q?.shift();)this.#$?.(...$)}return Z}clear(){return this.#p("delete")}#p(J){for(let X of this.#v({allowStale:!0})){let Z=this.#Y[X];if(this.#G(Z))Z.__abortController.abort(Error("deleted"));else{let Q=this.#K[X];this.#F&&this.#J?.(Z,Q,J),this.#Q&&this.#x?.push([Z,Q,J])}}if(this.#z.clear(),this.#Y.fill(void 0),this.#K.fill(void 0),this.#j&&this.#w){this.#j.fill(0),this.#w.fill(0);for(let X of this.#R??[])X!==void 0&&clearTimeout(X);this.#R?.fill(void 0)}if(this.#T&&this.#T.fill(0),this.#M=0,this.#B=0,this.#D.length=0,this.#_=0,this.#H=0,this.#Q&&this.#x){let X=this.#x,Z;for(;Z=X?.shift();)this.#$?.(...Z)}}};import{posix as PY,win32 as e8}from"node:path";import{fileURLToPath as AY}from"node:url";import{lstatSync as DY,readdir as IY,readdirSync as OY,readlinkSync as vY,realpathSync as NY}from"fs";import*as EY from"node:fs";import{lstat as SY,readdir as hY,readlink as bY,realpath as gY}from"node:fs/promises";import{EventEmitter as o8}from"node:events";import I7 from"node:stream";import{StringDecoder as BY}from"node:string_decoder";var w7=typeof process==="object"&&process?process:{stdout:null,stderr:null},xY=(q)=>!!q&&typeof q==="object"&&(q instanceof H6||q instanceof I7||jY(q)||RY(q)),jY=(q)=>!!q&&typeof q==="object"&&q instanceof o8&&typeof q.pipe==="function"&&q.pipe!==I7.Writable.prototype.pipe,RY=(q)=>!!q&&typeof q==="object"&&q instanceof o8&&typeof q.write==="function"&&typeof q.end==="function",S0=Symbol("EOF"),h0=Symbol("maybeEmitEnd"),n0=Symbol("emittedEnd"),g2=Symbol("emittingEnd"),s6=Symbol("emittedError"),f2=Symbol("closed"),P7=Symbol("read"),u2=Symbol("flush"),A7=Symbol("flushChunk"),x0=Symbol("encoding"),C6=Symbol("decoder"),m=Symbol("flowing"),t6=Symbol("paused"),F6=Symbol("resume"),d=Symbol("buffer"),J0=Symbol("pipes"),c=Symbol("bufferLength"),l8=Symbol("bufferPush"),m2=Symbol("bufferShift"),t=Symbol("objectMode"),h=Symbol("destroyed"),p8=Symbol("error"),n8=Symbol("emitData"),D7=Symbol("emitEnd"),i8=Symbol("emitEnd2"),w0=Symbol("async"),a8=Symbol("abort"),d2=Symbol("aborted"),e6=Symbol("signal"),Y6=Symbol("dataListeners"),K0=Symbol("discarded"),q2=(q)=>Promise.resolve().then(q),MY=(q)=>q(),CY=(q)=>q==="end"||q==="finish"||q==="prefinish",FY=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,kY=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class r8{src;dest;opts;ondrain;constructor(q,J,X){this.src=q,this.dest=J,this.opts=X,this.ondrain=()=>q[F6](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class O7 extends r8{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,J,X){super(q,J,X);this.proxyErrors=(Z)=>this.dest.emit("error",Z),q.on("error",this.proxyErrors)}}var TY=(q)=>!!q.objectMode,wY=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class H6 extends o8{[m]=!1;[t6]=!1;[J0]=[];[d]=[];[t];[x0];[w0];[C6];[S0]=!1;[n0]=!1;[g2]=!1;[f2]=!1;[s6]=null;[c]=0;[h]=!1;[e6];[d2]=!1;[Y6]=0;[K0]=!1;writable=!0;readable=!0;constructor(...q){let J=q[0]||{};super();if(J.objectMode&&typeof J.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(TY(J))this[t]=!0,this[x0]=null;else if(wY(J))this[x0]=J.encoding,this[t]=!1;else this[t]=!1,this[x0]=null;if(this[w0]=!!J.async,this[C6]=this[x0]?new BY(this[x0]):null,J&&J.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[d]});if(J&&J.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[J0]});let{signal:X}=J;if(X)if(this[e6]=X,X.aborted)this[a8]();else X.addEventListener("abort",()=>this[a8]())}get bufferLength(){return this[c]}get encoding(){return this[x0]}set encoding(q){throw Error("Encoding must be set at instantiation time")}setEncoding(q){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[t]}set objectMode(q){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[w0]}set["async"](q){this[w0]=this[w0]||!!q}[a8](){this[d2]=!0,this.emit("abort",this[e6]?.reason),this.destroy(this[e6]?.reason)}get aborted(){return this[d2]}set aborted(q){}write(q,J,X){if(this[d2])return!1;if(this[S0])throw Error("write after end");if(this[h])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof J==="function")X=J,J="utf8";if(!J)J="utf8";let Z=this[w0]?q2:MY;if(!this[t]&&!Buffer.isBuffer(q)){if(kY(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(FY(q))q=Buffer.from(q);else if(typeof q!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[t]){if(this[m]&&this[c]!==0)this[u2](!0);if(this[m])this.emit("data",q);else this[l8](q);if(this[c]!==0)this.emit("readable");if(X)Z(X);return this[m]}if(!q.length){if(this[c]!==0)this.emit("readable");if(X)Z(X);return this[m]}if(typeof q==="string"&&!(J===this[x0]&&!this[C6]?.lastNeed))q=Buffer.from(q,J);if(Buffer.isBuffer(q)&&this[x0])q=this[C6].write(q);if(this[m]&&this[c]!==0)this[u2](!0);if(this[m])this.emit("data",q);else this[l8](q);if(this[c]!==0)this.emit("readable");if(X)Z(X);return this[m]}read(q){if(this[h])return null;if(this[K0]=!1,this[c]===0||q===0||q&&q>this[c])return this[h0](),null;if(this[t])q=null;if(this[d].length>1&&!this[t])this[d]=[this[x0]?this[d].join(""):Buffer.concat(this[d],this[c])];let J=this[P7](q||null,this[d][0]);return this[h0](),J}[P7](q,J){if(this[t])this[m2]();else{let X=J;if(q===X.length||q===null)this[m2]();else if(typeof X==="string")this[d][0]=X.slice(q),J=X.slice(0,q),this[c]-=q;else this[d][0]=X.subarray(q),J=X.subarray(0,q),this[c]-=q}if(this.emit("data",J),!this[d].length&&!this[S0])this.emit("drain");return J}end(q,J,X){if(typeof q==="function")X=q,q=void 0;if(typeof J==="function")X=J,J="utf8";if(q!==void 0)this.write(q,J);if(X)this.once("end",X);if(this[S0]=!0,this.writable=!1,this[m]||!this[t6])this[h0]();return this}[F6](){if(this[h])return;if(!this[Y6]&&!this[J0].length)this[K0]=!0;if(this[t6]=!1,this[m]=!0,this.emit("resume"),this[d].length)this[u2]();else if(this[S0])this[h0]();else this.emit("drain")}resume(){return this[F6]()}pause(){this[m]=!1,this[t6]=!0,this[K0]=!1}get destroyed(){return this[h]}get flowing(){return this[m]}get paused(){return this[t6]}[l8](q){if(this[t])this[c]+=1;else this[c]+=q.length;this[d].push(q)}[m2](){if(this[t])this[c]-=1;else this[c]-=this[d][0].length;return this[d].shift()}[u2](q=!1){do;while(this[A7](this[m2]())&&this[d].length);if(!q&&!this[d].length&&!this[S0])this.emit("drain")}[A7](q){return this.emit("data",q),this[m]}pipe(q,J){if(this[h])return q;this[K0]=!1;let X=this[n0];if(J=J||{},q===w7.stdout||q===w7.stderr)J.end=!1;else J.end=J.end!==!1;if(J.proxyErrors=!!J.proxyErrors,X){if(J.end)q.end()}else if(this[J0].push(!J.proxyErrors?new r8(this,q,J):new O7(this,q,J)),this[w0])q2(()=>this[F6]());else this[F6]();return q}unpipe(q){let J=this[J0].find((X)=>X.dest===q);if(J){if(this[J0].length===1){if(this[m]&&this[Y6]===0)this[m]=!1;this[J0]=[]}else this[J0].splice(this[J0].indexOf(J),1);J.unpipe()}}addListener(q,J){return this.on(q,J)}on(q,J){let X=super.on(q,J);if(q==="data"){if(this[K0]=!1,this[Y6]++,!this[J0].length&&!this[m])this[F6]()}else if(q==="readable"&&this[c]!==0)super.emit("readable");else if(CY(q)&&this[n0])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[s6]){let Z=J;if(this[w0])q2(()=>Z.call(this,this[s6]));else Z.call(this,this[s6])}return X}removeListener(q,J){return this.off(q,J)}off(q,J){let X=super.off(q,J);if(q==="data"){if(this[Y6]=this.listeners("data").length,this[Y6]===0&&!this[K0]&&!this[J0].length)this[m]=!1}return X}removeAllListeners(q){let J=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[Y6]=0,!this[K0]&&!this[J0].length)this[m]=!1}return J}get emittedEnd(){return this[n0]}[h0](){if(!this[g2]&&!this[n0]&&!this[h]&&this[d].length===0&&this[S0]){if(this[g2]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f2])this.emit("close");this[g2]=!1}}emit(q,...J){let X=J[0];if(q!=="error"&&q!=="close"&&q!==h&&this[h])return!1;else if(q==="data")return!this[t]&&!X?!1:this[w0]?(q2(()=>this[n8](X)),!0):this[n8](X);else if(q==="end")return this[D7]();else if(q==="close"){if(this[f2]=!0,!this[n0]&&!this[h])return!1;let Q=super.emit("close");return this.removeAllListeners("close"),Q}else if(q==="error"){this[s6]=X,super.emit(p8,X);let Q=!this[e6]||this.listeners("error").length?super.emit("error",X):!1;return this[h0](),Q}else if(q==="resume"){let Q=super.emit("resume");return this[h0](),Q}else if(q==="finish"||q==="prefinish"){let Q=super.emit(q);return this.removeAllListeners(q),Q}let Z=super.emit(q,...J);return this[h0](),Z}[n8](q){for(let X of this[J0])if(X.dest.write(q)===!1)this.pause();let J=this[K0]?!1:super.emit("data",q);return this[h0](),J}[D7](){if(this[n0])return!1;return this[n0]=!0,this.readable=!1,this[w0]?(q2(()=>this[i8]()),!0):this[i8]()}[i8](){if(this[C6]){let J=this[C6].end();if(J){for(let X of this[J0])X.dest.write(J);if(!this[K0])super.emit("data",J)}}for(let J of this[J0])J.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[t])q.dataLength=0;let J=this.promise();return this.on("data",(X)=>{if(q.push(X),!this[t])q.dataLength+=X.length}),await J,q}async concat(){if(this[t])throw Error("cannot concat in objectMode");let q=await this.collect();return this[x0]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,J)=>{this.on(h,()=>J(Error("stream destroyed"))),this.on("error",(X)=>J(X)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[K0]=!1;let q=!1,J=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return J();let Z=this.read();if(Z!==null)return Promise.resolve({done:!1,value:Z});if(this[S0])return J();let Q,$,Y=(V)=>{this.off("data",H),this.off("end",K),this.off(h,G),J(),$(V)},H=(V)=>{this.off("error",Y),this.off("end",K),this.off(h,G),this.pause(),Q({value:V,done:!!this[S0]})},K=()=>{this.off("error",Y),this.off("data",H),this.off(h,G),J(),Q({done:!0,value:void 0})},G=()=>Y(Error("stream destroyed"));return new Promise((V,W)=>{$=W,Q=V,this.once(h,G),this.once("error",Y),this.once("end",K),this.once("data",H)})},throw:J,return:J,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[K0]=!1;let q=!1,J=()=>{return this.pause(),this.off(p8,J),this.off(h,J),this.off("end",J),q=!0,{done:!0,value:void 0}},X=()=>{if(q)return J();let Z=this.read();return Z===null?J():{done:!1,value:Z}};return this.once("end",J),this.once(p8,J),this.once(h,J),{next:X,throw:J,return:J,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(q){if(this[h]){if(q)this.emit("error",q);else this.emit(h);return this}this[h]=!0,this[K0]=!0,this[d].length=0,this[c]=0;let J=this;if(typeof J.close==="function"&&!this[f2])J.close();if(q)this.emit("error",q);else this.emit(h);return this}static get isStream(){return xY}}var yY=NY.native,X2={lstatSync:DY,readdir:IY,readdirSync:OY,readlinkSync:vY,realpathSync:yY,promises:{lstat:SY,readdir:hY,readlink:bY,realpath:gY}},S7=(q)=>!q||q===X2||q===EY?X2:{...X2,...q,promises:{...X2.promises,...q.promises||{}}},h7=/^\\\\\?\\([a-z]:)\\?$/i,fY=(q)=>q.replace(/\//g,"\\").replace(h7,"$1\\"),uY=/[\\\/]/,z0=0,b7=1,g7=2,P0=4,f7=6,u7=8,K6=10,m7=12,U0=15,J2=~U0,s8=16,v7=32,Z2=64,j0=128,c2=256,p2=512,N7=Z2|j0|p2,mY=1023,t8=(q)=>q.isFile()?u7:q.isDirectory()?P0:q.isSymbolicLink()?K6:q.isCharacterDevice()?g7:q.isBlockDevice()?f7:q.isSocket()?m7:q.isFIFO()?b7:z0,E7=new r6({max:4096}),Q2=(q)=>{let J=E7.get(q);if(J)return J;let X=q.normalize("NFKD");return E7.set(q,X),X},y7=new r6({max:4096}),l2=(q)=>{let J=y7.get(q);if(J)return J;let X=Q2(q.toLowerCase());return y7.set(q,X),X};class q4 extends r6{constructor(){super({max:256})}}class d7 extends r6{constructor(q=16384){super({maxSize:q,sizeCalculation:(J)=>J.length+1})}}var c7=Symbol("PathScurry setAsCwd");class X0{name;root;roots;parent;nocase;isCWD=!1;#q;#X;get dev(){return this.#X}#J;get mode(){return this.#J}#Z;get nlink(){return this.#Z}#$;get uid(){return this.#$}#V;get gid(){return this.#V}#U;get rdev(){return this.#U}#W;get blksize(){return this.#W}#H;get ino(){return this.#H}#_;get size(){return this.#_}#z;get blocks(){return this.#z}#K;get atimeMs(){return this.#K}#Y;get mtimeMs(){return this.#Y}#L;get ctimeMs(){return this.#L}#C;get birthtimeMs(){return this.#C}#M;get atime(){return this.#M}#B;get mtime(){return this.#B}#D;get ctime(){return this.#D}#x;get birthtime(){return this.#x}#T;#w;#j;#R;#F;#P;#Q;#y;#N;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(q,J=z0,X,Z,Q,$,Y){if(this.name=q,this.#T=Q?l2(q):Q2(q),this.#Q=J&mY,this.nocase=Q,this.roots=Z,this.root=X||this,this.#y=$,this.#j=Y.fullpath,this.#F=Y.relative,this.#P=Y.relativePosix,this.parent=Y.parent,this.parent)this.#q=this.parent.#q;else this.#q=S7(Y.fs)}depth(){if(this.#w!==void 0)return this.#w;if(!this.parent)return this.#w=0;return this.#w=this.parent.depth()+1}childrenCache(){return this.#y}resolve(q){if(!q)return this;let J=this.getRootString(q),Z=q.substring(J.length).split(this.splitSep);return J?this.getRoot(J).#E(Z):this.#E(Z)}#E(q){let J=this;for(let X of q)J=J.child(X);return J}children(){let q=this.#y.get(this);if(q)return q;let J=Object.assign([],{provisional:0});return this.#y.set(this,J),this.#Q&=~s8,J}child(q,J){if(q===""||q===".")return this;if(q==="..")return this.parent||this;let X=this.children(),Z=this.nocase?l2(q):Q2(q);for(let H of X)if(H.#T===Z)return H;let Q=this.parent?this.sep:"",$=this.#j?this.#j+Q+q:void 0,Y=this.newChild(q,z0,{...J,parent:this,fullpath:$});if(!this.canReaddir())Y.#Q|=j0;return X.push(Y),Y}relative(){if(this.isCWD)return"";if(this.#F!==void 0)return this.#F;let q=this.name,J=this.parent;if(!J)return this.#F=this.name;let X=J.relative();return X+(!X||!J.parent?"":this.sep)+q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let q=this.name,J=this.parent;if(!J)return this.#P=this.fullpathPosix();let X=J.relativePosix();return X+(!X||!J.parent?"":"/")+q}fullpath(){if(this.#j!==void 0)return this.#j;let q=this.name,J=this.parent;if(!J)return this.#j=this.name;let Z=J.fullpath()+(!J.parent?"":this.sep)+q;return this.#j=Z}fullpathPosix(){if(this.#R!==void 0)return this.#R;if(this.sep==="/")return this.#R=this.fullpath();if(!this.parent){let Z=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(Z))return this.#R=`//?/${Z}`;else return this.#R=Z}let q=this.parent,J=q.fullpathPosix(),X=J+(!J||!q.parent?"":"/")+this.name;return this.#R=X}isUnknown(){return(this.#Q&U0)===z0}isType(q){return this[`is${q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Q&U0)===u7}isDirectory(){return(this.#Q&U0)===P0}isCharacterDevice(){return(this.#Q&U0)===g7}isBlockDevice(){return(this.#Q&U0)===f7}isFIFO(){return(this.#Q&U0)===b7}isSocket(){return(this.#Q&U0)===m7}isSymbolicLink(){return(this.#Q&K6)===K6}lstatCached(){return this.#Q&v7?this:void 0}readlinkCached(){return this.#N}realpathCached(){return this.#A}readdirCached(){let q=this.children();return q.slice(0,q.provisional)}canReadlink(){if(this.#N)return!0;if(!this.parent)return!1;let q=this.#Q&U0;return!(q!==z0&&q!==K6||this.#Q&c2||this.#Q&j0)}calledReaddir(){return!!(this.#Q&s8)}isENOENT(){return!!(this.#Q&j0)}isNamed(q){return!this.nocase?this.#T===Q2(q):this.#T===l2(q)}async readlink(){let q=this.#N;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let J=await this.#q.promises.readlink(this.fullpath()),X=(await this.parent.realpath())?.resolve(J);if(X)return this.#N=X}catch(J){this.#v(J.code);return}}readlinkSync(){let q=this.#N;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let J=this.#q.readlinkSync(this.fullpath()),X=this.parent.realpathSync()?.resolve(J);if(X)return this.#N=X}catch(J){this.#v(J.code);return}}#g(q){this.#Q|=s8;for(let J=q.provisional;J<q.length;J++){let X=q[J];if(X)X.#k()}}#k(){if(this.#Q&j0)return;this.#Q=(this.#Q|j0)&J2,this.#l()}#l(){let q=this.children();q.provisional=0;for(let J of q)J.#k()}#b(){this.#Q|=p2,this.#S()}#S(){if(this.#Q&Z2)return;let q=this.#Q;if((q&U0)===P0)q&=J2;this.#Q=q|Z2,this.#l()}#f(q=""){if(q==="ENOTDIR"||q==="EPERM")this.#S();else if(q==="ENOENT")this.#k();else this.children().provisional=0}#O(q=""){if(q==="ENOTDIR")this.parent.#S();else if(q==="ENOENT")this.#k()}#v(q=""){let J=this.#Q;if(J|=c2,q==="ENOENT")J|=j0;if(q==="EINVAL"||q==="UNKNOWN")J&=J2;if(this.#Q=J,q==="ENOTDIR"&&this.parent)this.parent.#S()}#u(q,J){return this.#d(q,J)||this.#m(q,J)}#m(q,J){let X=t8(q),Z=this.newChild(q.name,X,{parent:this}),Q=Z.#Q&U0;if(Q!==P0&&Q!==K6&&Q!==z0)Z.#Q|=Z2;return J.unshift(Z),J.provisional++,Z}#d(q,J){for(let X=J.provisional;X<J.length;X++){let Z=J[X];if((this.nocase?l2(q.name):Q2(q.name))!==Z.#T)continue;return this.#G(q,Z,X,J)}}#G(q,J,X,Z){let Q=J.name;if(J.#Q=J.#Q&J2|t8(q),Q!==q.name)J.name=q.name;if(X!==Z.provisional){if(X===Z.length-1)Z.pop();else Z.splice(X,1);Z.unshift(J)}return Z.provisional++,J}async lstat(){if((this.#Q&j0)===0)try{return this.#c(await this.#q.promises.lstat(this.fullpath())),this}catch(q){this.#O(q.code)}}lstatSync(){if((this.#Q&j0)===0)try{return this.#c(this.#q.lstatSync(this.fullpath())),this}catch(q){this.#O(q.code)}}#c(q){let{atime:J,atimeMs:X,birthtime:Z,birthtimeMs:Q,blksize:$,blocks:Y,ctime:H,ctimeMs:K,dev:G,gid:V,ino:W,mode:U,mtime:z,mtimeMs:_,nlink:L,rdev:x,size:B,uid:j}=q;this.#M=J,this.#K=X,this.#x=Z,this.#C=Q,this.#W=$,this.#z=Y,this.#D=H,this.#L=K,this.#X=G,this.#V=V,this.#H=W,this.#J=U,this.#B=z,this.#Y=_,this.#Z=L,this.#U=x,this.#_=B,this.#$=j;let R=t8(q);if(this.#Q=this.#Q&J2|R|v7,R!==z0&&R!==P0&&R!==K6)this.#Q|=Z2}#h=[];#I=!1;#p(q){this.#I=!1;let J=this.#h.slice();this.#h.length=0,J.forEach((X)=>X(null,q))}readdirCB(q,J=!1){if(!this.canReaddir()){if(J)q(null,[]);else queueMicrotask(()=>q(null,[]));return}let X=this.children();if(this.calledReaddir()){let Q=X.slice(0,X.provisional);if(J)q(null,Q);else queueMicrotask(()=>q(null,Q));return}if(this.#h.push(q),this.#I)return;this.#I=!0;let Z=this.fullpath();this.#q.readdir(Z,{withFileTypes:!0},(Q,$)=>{if(Q)this.#f(Q.code),X.provisional=0;else{for(let Y of $)this.#u(Y,X);this.#g(X)}this.#p(X.slice(0,X.provisional));return})}#n;async readdir(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let J=this.fullpath();if(this.#n)await this.#n;else{let X=()=>{};this.#n=new Promise((Z)=>X=Z);try{for(let Z of await this.#q.promises.readdir(J,{withFileTypes:!0}))this.#u(Z,q);this.#g(q)}catch(Z){this.#f(Z.code),q.provisional=0}this.#n=void 0,X()}return q.slice(0,q.provisional)}readdirSync(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let J=this.fullpath();try{for(let X of this.#q.readdirSync(J,{withFileTypes:!0}))this.#u(X,q);this.#g(q)}catch(X){this.#f(X.code),q.provisional=0}return q.slice(0,q.provisional)}canReaddir(){if(this.#Q&N7)return!1;let q=U0&this.#Q;if(!(q===z0||q===P0||q===K6))return!1;return!0}shouldWalk(q,J){return(this.#Q&P0)===P0&&!(this.#Q&N7)&&!q.has(this)&&(!J||J(this))}async realpath(){if(this.#A)return this.#A;if((p2|c2|j0)&this.#Q)return;try{let q=await this.#q.promises.realpath(this.fullpath());return this.#A=this.resolve(q)}catch(q){this.#b()}}realpathSync(){if(this.#A)return this.#A;if((p2|c2|j0)&this.#Q)return;try{let q=this.#q.realpathSync(this.fullpath());return this.#A=this.resolve(q)}catch(q){this.#b()}}[c7](q){if(q===this)return;q.isCWD=!1,this.isCWD=!0;let J=new Set([]),X=[],Z=this;while(Z&&Z.parent)J.add(Z),Z.#F=X.join(this.sep),Z.#P=X.join("/"),Z=Z.parent,X.push("..");Z=q;while(Z&&Z.parent&&!J.has(Z))Z.#F=void 0,Z.#P=void 0,Z=Z.parent}}class n2 extends X0{sep="\\";splitSep=uY;constructor(q,J=z0,X,Z,Q,$,Y){super(q,J,X,Z,Q,$,Y)}newChild(q,J=z0,X={}){return new n2(q,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}getRootString(q){return e8.parse(q).root}getRoot(q){if(q=fY(q.toUpperCase()),q===this.root.name)return this.root;for(let[J,X]of Object.entries(this.roots))if(this.sameRoot(q,J))return this.roots[q]=X;return this.roots[q]=new $2(q,this).root}sameRoot(q,J=this.root.name){return q=q.toUpperCase().replace(/\//g,"\\").replace(h7,"$1\\"),q===J}}class i2 extends X0{splitSep="/";sep="/";constructor(q,J=z0,X,Z,Q,$,Y){super(q,J,X,Z,Q,$,Y)}getRootString(q){return q.startsWith("/")?"/":""}getRoot(q){return this.root}newChild(q,J=z0,X={}){return new i2(q,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}}class J4{root;rootPath;roots;cwd;#q;#X;#J;nocase;#Z;constructor(q=process.cwd(),J,X,{nocase:Z,childrenCacheSize:Q=16384,fs:$=X2}={}){if(this.#Z=S7($),q instanceof URL||q.startsWith("file://"))q=AY(q);let Y=J.resolve(q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(Y),this.#q=new q4,this.#X=new q4,this.#J=new d7(Q);let H=Y.substring(this.rootPath.length).split(X);if(H.length===1&&!H[0])H.pop();if(Z===void 0)throw TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=Z,this.root=this.newRoot(this.#Z),this.roots[this.rootPath]=this.root;let K=this.root,G=H.length-1,V=J.sep,W=this.rootPath,U=!1;for(let z of H){let _=G--;K=K.child(z,{relative:Array(_).fill("..").join(V),relativePosix:Array(_).fill("..").join("/"),fullpath:W+=(U?"":V)+z}),U=!0}this.cwd=K}depth(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.depth()}childrenCache(){return this.#J}resolve(...q){let J="";for(let Q=q.length-1;Q>=0;Q--){let $=q[Q];if(!$||$===".")continue;if(J=J?`${$}/${J}`:$,this.isAbsolute($))break}let X=this.#q.get(J);if(X!==void 0)return X;let Z=this.cwd.resolve(J).fullpath();return this.#q.set(J,Z),Z}resolvePosix(...q){let J="";for(let Q=q.length-1;Q>=0;Q--){let $=q[Q];if(!$||$===".")continue;if(J=J?`${$}/${J}`:$,this.isAbsolute($))break}let X=this.#X.get(J);if(X!==void 0)return X;let Z=this.cwd.resolve(J).fullpathPosix();return this.#X.set(J,Z),Z}relative(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relative()}relativePosix(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relativePosix()}basename(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.name}dirname(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return(q.parent||q).fullpath()}async readdir(q=this.cwd,J={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X}=J;if(!q.canReaddir())return[];else{let Z=await q.readdir();return X?Z:Z.map((Q)=>Q.name)}}readdirSync(q=this.cwd,J={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0}=J;if(!q.canReaddir())return[];else if(X)return q.readdirSync();else return q.readdirSync().map((Z)=>Z.name)}async lstat(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstat()}lstatSync(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstatSync()}async readlink(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=await q.readlink();return J?X:X?.fullpath()}readlinkSync(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=q.readlinkSync();return J?X:X?.fullpath()}async realpath(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=await q.realpath();return J?X:X?.fullpath()}realpathSync(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=q.realpathSync();return J?X:X?.fullpath()}async walk(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=[];if(!Q||Q(q))Y.push(X?q:q.fullpath());let H=new Set,K=(V,W)=>{H.add(V),V.readdirCB((U,z)=>{if(U)return W(U);let _=z.length;if(!_)return W();let L=()=>{if(--_===0)W()};for(let x of z){if(!Q||Q(x))Y.push(X?x:x.fullpath());if(Z&&x.isSymbolicLink())x.realpath().then((B)=>B?.isUnknown()?B.lstat():B).then((B)=>B?.shouldWalk(H,$)?K(B,L):L());else if(x.shouldWalk(H,$))K(x,L);else L()}},!0)},G=q;return new Promise((V,W)=>{K(G,(U)=>{if(U)return W(U);V(Y)})})}walkSync(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=[];if(!Q||Q(q))Y.push(X?q:q.fullpath());let H=new Set([q]);for(let K of H){let G=K.readdirSync();for(let V of G){if(!Q||Q(V))Y.push(X?V:V.fullpath());let W=V;if(V.isSymbolicLink()){if(!(Z&&(W=V.realpathSync())))continue;if(W.isUnknown())W.lstatSync()}if(W.shouldWalk(H,$))H.add(W)}}return Y}[Symbol.asyncIterator](){return this.iterate()}iterate(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;return this.stream(q,J)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J;if(!Q||Q(q))yield X?q:q.fullpath();let Y=new Set([q]);for(let H of Y){let K=H.readdirSync();for(let G of K){if(!Q||Q(G))yield X?G:G.fullpath();let V=G;if(G.isSymbolicLink()){if(!(Z&&(V=G.realpathSync())))continue;if(V.isUnknown())V.lstatSync()}if(V.shouldWalk(Y,$))Y.add(V)}}}stream(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=new H6({objectMode:!0});if(!Q||Q(q))Y.write(X?q:q.fullpath());let H=new Set,K=[q],G=0,V=()=>{let W=!1;while(!W){let U=K.shift();if(!U){if(G===0)Y.end();return}G++,H.add(U);let z=(L,x,B=!1)=>{if(L)return Y.emit("error",L);if(Z&&!B){let j=[];for(let R of x)if(R.isSymbolicLink())j.push(R.realpath().then((F)=>F?.isUnknown()?F.lstat():F));if(j.length){Promise.all(j).then(()=>z(null,x,!0));return}}for(let j of x)if(j&&(!Q||Q(j))){if(!Y.write(X?j:j.fullpath()))W=!0}G--;for(let j of x){let R=j.realpathCached()||j;if(R.shouldWalk(H,$))K.push(R)}if(W&&!Y.flowing)Y.once("drain",V);else if(!_)V()},_=!0;U.readdirCB(z,!0),_=!1}};return V(),Y}streamSync(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=new H6({objectMode:!0}),H=new Set;if(!Q||Q(q))Y.write(X?q:q.fullpath());let K=[q],G=0,V=()=>{let W=!1;while(!W){let U=K.shift();if(!U){if(G===0)Y.end();return}G++,H.add(U);let z=U.readdirSync();for(let _ of z)if(!Q||Q(_)){if(!Y.write(X?_:_.fullpath()))W=!0}G--;for(let _ of z){let L=_;if(_.isSymbolicLink()){if(!(Z&&(L=_.realpathSync())))continue;if(L.isUnknown())L.lstatSync()}if(L.shouldWalk(H,$))K.push(L)}}if(W&&!Y.flowing)Y.once("drain",V)};return V(),Y}chdir(q=this.cwd){let J=this.cwd;this.cwd=typeof q==="string"?this.cwd.resolve(q):q,this.cwd[c7](J)}}class $2 extends J4{sep="\\";constructor(q=process.cwd(),J={}){let{nocase:X=!0}=J;super(q,e8,"\\",{...J,nocase:X});this.nocase=X;for(let Z=this.cwd;Z;Z=Z.parent)Z.nocase=this.nocase}parseRootPath(q){return e8.parse(q).root.toUpperCase()}newRoot(q){return new n2(this.rootPath,P0,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")||q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(q)}}class Y2 extends J4{sep="/";constructor(q=process.cwd(),J={}){let{nocase:X=!1}=J;super(q,PY,"/",{...J,nocase:X});this.nocase=X}parseRootPath(q){return"/"}newRoot(q){return new i2(this.rootPath,P0,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")}}class a2 extends Y2{constructor(q=process.cwd(),J={}){let{nocase:X=!0}=J;super(q,{...J,nocase:X})}}var uj=process.platform==="win32"?n2:i2,l7=process.platform==="win32"?$2:process.platform==="darwin"?a2:Y2;var dY=(q)=>q.length>=1,cY=(q)=>q.length>=1;class k6{#q;#X;#J;length;#Z;#$;#V;#U;#W;#H;#_=!0;constructor(q,J,X,Z){if(!dY(q))throw TypeError("empty pattern list");if(!cY(J))throw TypeError("empty glob list");if(J.length!==q.length)throw TypeError("mismatched pattern list and glob list lengths");if(this.length=q.length,X<0||X>=this.length)throw TypeError("index out of range");if(this.#q=q,this.#X=J,this.#J=X,this.#Z=Z,this.#J===0){if(this.isUNC()){let[Q,$,Y,H,...K]=this.#q,[G,V,W,U,...z]=this.#X;if(K[0]==="")K.shift(),z.shift();let _=[Q,$,Y,H,""].join("/"),L=[G,V,W,U,""].join("/");this.#q=[_,...K],this.#X=[L,...z],this.length=this.#q.length}else if(this.isDrive()||this.isAbsolute()){let[Q,...$]=this.#q,[Y,...H]=this.#X;if($[0]==="")$.shift(),H.shift();let K=Q+"/",G=Y+"/";this.#q=[K,...$],this.#X=[G,...H],this.length=this.#q.length}}}pattern(){return this.#q[this.#J]}isString(){return typeof this.#q[this.#J]==="string"}isGlobstar(){return this.#q[this.#J]===r}isRegExp(){return this.#q[this.#J]instanceof RegExp}globString(){return this.#V=this.#V||(this.#J===0?this.isAbsolute()?this.#X[0]+this.#X.slice(1).join("/"):this.#X.join("/"):this.#X.slice(this.#J).join("/"))}hasMore(){return this.length>this.#J+1}rest(){if(this.#$!==void 0)return this.#$;if(!this.hasMore())return this.#$=null;return this.#$=new k6(this.#q,this.#X,this.#J+1,this.#Z),this.#$.#H=this.#H,this.#$.#W=this.#W,this.#$.#U=this.#U,this.#$}isUNC(){let q=this.#q;return this.#W!==void 0?this.#W:this.#W=this.#Z==="win32"&&this.#J===0&&q[0]===""&&q[1]===""&&typeof q[2]==="string"&&!!q[2]&&typeof q[3]==="string"&&!!q[3]}isDrive(){let q=this.#q;return this.#U!==void 0?this.#U:this.#U=this.#Z==="win32"&&this.#J===0&&this.length>1&&typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0])}isAbsolute(){let q=this.#q;return this.#H!==void 0?this.#H:this.#H=q[0]===""&&q.length>1||this.isDrive()||this.isUNC()}root(){let q=this.#q[0];return typeof q==="string"&&this.isAbsolute()&&this.#J===0?q:""}checkFollowGlobstar(){return!(this.#J===0||!this.isGlobstar()||!this.#_)}markFollowGlobstar(){if(this.#J===0||!this.isGlobstar()||!this.#_)return!1;return this.#_=!1,!0}}var lY=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class H2{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(q,{nobrace:J,nocase:X,noext:Z,noglobstar:Q,platform:$=lY}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=$,this.mmopts={dot:!0,nobrace:J,nocase:X,noext:Z,noglobstar:Q,optimizationLevel:2,platform:$,nocomment:!0,nonegate:!0};for(let Y of q)this.add(Y)}add(q){let J=new W0(q,this.mmopts);for(let X=0;X<J.set.length;X++){let Z=J.set[X],Q=J.globParts[X];if(!Z||!Q)throw Error("invalid pattern object");while(Z[0]==="."&&Q[0]===".")Z.shift(),Q.shift();let $=new k6(Z,Q,0,this.platform),Y=new W0($.globString(),this.mmopts),H=Q[Q.length-1]==="**",K=$.isAbsolute();if(K)this.absolute.push(Y);else this.relative.push(Y);if(H)if(K)this.absoluteChildren.push(Y);else this.relativeChildren.push(Y)}}ignored(q){let J=q.fullpath(),X=`${J}/`,Z=q.relative()||".",Q=`${Z}/`;for(let $ of this.relative)if($.match(Z)||$.match(Q))return!0;for(let $ of this.absolute)if($.match(J)||$.match(X))return!0;return!1}childrenIgnored(q){let J=q.fullpath()+"/",X=(q.relative()||".")+"/";for(let Z of this.relativeChildren)if(Z.match(X))return!0;for(let Z of this.absoluteChildren)if(Z.match(J))return!0;return!1}}class X4{store;constructor(q=new Map){this.store=q}copy(){return new X4(new Map(this.store))}hasWalked(q,J){return this.store.get(q.fullpath())?.has(J.globString())}storeWalked(q,J){let X=q.fullpath(),Z=this.store.get(X);if(Z)Z.add(J.globString());else this.store.set(X,new Set([J.globString()]))}}class p7{store=new Map;add(q,J,X){let Z=(J?2:0)|(X?1:0),Q=this.store.get(q);this.store.set(q,Q===void 0?Z:Z&Q)}entries(){return[...this.store.entries()].map(([q,J])=>[q,!!(J&2),!!(J&1)])}}class n7{store=new Map;add(q,J){if(!q.canReaddir())return;let X=this.store.get(q);if(X){if(!X.find((Z)=>Z.globString()===J.globString()))X.push(J)}else this.store.set(q,[J])}get(q){let J=this.store.get(q);if(!J)throw Error("attempting to walk unknown path");return J}entries(){return this.keys().map((q)=>[q,this.store.get(q)])}keys(){return[...this.store.keys()].filter((q)=>q.canReaddir())}}class K2{hasWalkedCache;matches=new p7;subwalks=new n7;patterns;follow;dot;opts;constructor(q,J){this.opts=q,this.follow=!!q.follow,this.dot=!!q.dot,this.hasWalkedCache=J?J.copy():new X4}processPatterns(q,J){this.patterns=J;let X=J.map((Z)=>[q,Z]);for(let[Z,Q]of X){this.hasWalkedCache.storeWalked(Z,Q);let $=Q.root(),Y=Q.isAbsolute()&&this.opts.absolute!==!1;if($){Z=Z.resolve($==="/"&&this.opts.root!==void 0?this.opts.root:$);let V=Q.rest();if(!V){this.matches.add(Z,!0,!1);continue}else Q=V}if(Z.isENOENT())continue;let H,K,G=!1;while(typeof(H=Q.pattern())==="string"&&(K=Q.rest()))Z=Z.resolve(H),Q=K,G=!0;if(H=Q.pattern(),K=Q.rest(),G){if(this.hasWalkedCache.hasWalked(Z,Q))continue;this.hasWalkedCache.storeWalked(Z,Q)}if(typeof H==="string"){let V=H===".."||H===""||H===".";this.matches.add(Z.resolve(H),Y,V);continue}else if(H===r){if(!Z.isSymbolicLink()||this.follow||Q.checkFollowGlobstar())this.subwalks.add(Z,Q);let V=K?.pattern(),W=K?.rest();if(!K||(V===""||V===".")&&!W)this.matches.add(Z,Y,V===""||V===".");else if(V===".."){let U=Z.parent||Z;if(!W)this.matches.add(U,Y,!0);else if(!this.hasWalkedCache.hasWalked(U,W))this.subwalks.add(U,W)}}else if(H instanceof RegExp)this.subwalks.add(Z,Q)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new K2(this.opts,this.hasWalkedCache)}filterEntries(q,J){let X=this.subwalks.get(q),Z=this.child();for(let Q of J)for(let $ of X){let Y=$.isAbsolute(),H=$.pattern(),K=$.rest();if(H===r)Z.testGlobstar(Q,$,K,Y);else if(H instanceof RegExp)Z.testRegExp(Q,H,K,Y);else Z.testString(Q,H,K,Y)}return Z}testGlobstar(q,J,X,Z){if(this.dot||!q.name.startsWith(".")){if(!J.hasMore())this.matches.add(q,Z,!1);if(q.canReaddir()){if(this.follow||!q.isSymbolicLink())this.subwalks.add(q,J);else if(q.isSymbolicLink()){if(X&&J.checkFollowGlobstar())this.subwalks.add(q,X);else if(J.markFollowGlobstar())this.subwalks.add(q,J)}}}if(X){let Q=X.pattern();if(typeof Q==="string"&&Q!==".."&&Q!==""&&Q!==".")this.testString(q,Q,X.rest(),Z);else if(Q===".."){let $=q.parent||q;this.subwalks.add($,X)}else if(Q instanceof RegExp)this.testRegExp(q,Q,X.rest(),Z)}}testRegExp(q,J,X,Z){if(!J.test(q.name))return;if(!X)this.matches.add(q,Z,!1);else this.subwalks.add(q,X)}testString(q,J,X,Z){if(!q.isNamed(J))return;if(!X)this.matches.add(q,Z,!1);else this.subwalks.add(q,X)}}var pY=(q,J)=>typeof q==="string"?new H2([q],J):Array.isArray(q)?new H2(q,J):q;class Z4{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#q=[];#X;#J;signal;maxDepth;includeChildMatches;constructor(q,J,X){if(this.patterns=q,this.path=J,this.opts=X,this.#J=!X.posix&&X.platform==="win32"?"\\":"/",this.includeChildMatches=X.includeChildMatches!==!1,X.ignore||!this.includeChildMatches){if(this.#X=pY(X.ignore??[],X),!this.includeChildMatches&&typeof this.#X.add!=="function")throw Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=X.maxDepth||1/0,X.signal)this.signal=X.signal,this.signal.addEventListener("abort",()=>{this.#q.length=0})}#Z(q){return this.seen.has(q)||!!this.#X?.ignored?.(q)}#$(q){return!!this.#X?.childrenIgnored?.(q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let q=void 0;while(!this.paused&&(q=this.#q.shift()))q()}onResume(q){if(this.signal?.aborted)return;if(!this.paused)q();else this.#q.push(q)}async matchCheck(q,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=q.realpathCached()||await q.realpath(),!X)return;q=X}let Q=q.isUnknown()||this.opts.stat?await q.lstat():q;if(this.opts.follow&&this.opts.nodir&&Q?.isSymbolicLink()){let $=await Q.realpath();if($&&($.isUnknown()||this.opts.stat))await $.lstat()}return this.matchCheckTest(Q,J)}matchCheckTest(q,J){return q&&(this.maxDepth===1/0||q.depth()<=this.maxDepth)&&(!J||q.canReaddir())&&(!this.opts.nodir||!q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!q.isSymbolicLink()||!q.realpathCached()?.isDirectory())&&!this.#Z(q)?q:void 0}matchCheckSync(q,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=q.realpathCached()||q.realpathSync(),!X)return;q=X}let Q=q.isUnknown()||this.opts.stat?q.lstatSync():q;if(this.opts.follow&&this.opts.nodir&&Q?.isSymbolicLink()){let $=Q.realpathSync();if($&&($?.isUnknown()||this.opts.stat))$.lstatSync()}return this.matchCheckTest(Q,J)}matchFinish(q,J){if(this.#Z(q))return;if(!this.includeChildMatches&&this.#X?.add){let Q=`${q.relativePosix()}/**`;this.#X.add(Q)}let X=this.opts.absolute===void 0?J:this.opts.absolute;this.seen.add(q);let Z=this.opts.mark&&q.isDirectory()?this.#J:"";if(this.opts.withFileTypes)this.matchEmit(q);else if(X){let Q=this.opts.posix?q.fullpathPosix():q.fullpath();this.matchEmit(Q+Z)}else{let Q=this.opts.posix?q.relativePosix():q.relative(),$=this.opts.dotRelative&&!Q.startsWith(".."+this.#J)?"."+this.#J:"";this.matchEmit(!Q?"."+Z:$+Q+Z)}}async match(q,J,X){let Z=await this.matchCheck(q,X);if(Z)this.matchFinish(Z,J)}matchSync(q,J,X){let Z=this.matchCheckSync(q,X);if(Z)this.matchFinish(Z,J)}walkCB(q,J,X){if(this.signal?.aborted)X();this.walkCB2(q,J,new K2(this.opts),X)}walkCB2(q,J,X,Z){if(this.#$(q))return Z();if(this.signal?.aborted)Z();if(this.paused){this.onResume(()=>this.walkCB2(q,J,X,Z));return}X.processPatterns(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;Q++,this.match(Y,H,K).then(()=>$())}for(let Y of X.subwalkTargets()){if(this.maxDepth!==1/0&&Y.depth()>=this.maxDepth)continue;Q++;let H=Y.readdirCached();if(Y.calledReaddir())this.walkCB3(Y,H,X,$);else Y.readdirCB((K,G)=>this.walkCB3(Y,G,X,$),!0)}$()}walkCB3(q,J,X,Z){X=X.filterEntries(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;Q++,this.match(Y,H,K).then(()=>$())}for(let[Y,H]of X.subwalks.entries())Q++,this.walkCB2(Y,H,X.child(),$);$()}walkCBSync(q,J,X){if(this.signal?.aborted)X();this.walkCB2Sync(q,J,new K2(this.opts),X)}walkCB2Sync(q,J,X,Z){if(this.#$(q))return Z();if(this.signal?.aborted)Z();if(this.paused){this.onResume(()=>this.walkCB2Sync(q,J,X,Z));return}X.processPatterns(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;this.matchSync(Y,H,K)}for(let Y of X.subwalkTargets()){if(this.maxDepth!==1/0&&Y.depth()>=this.maxDepth)continue;Q++;let H=Y.readdirSync();this.walkCB3Sync(Y,H,X,$)}$()}walkCB3Sync(q,J,X,Z){X=X.filterEntries(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;this.matchSync(Y,H,K)}for(let[Y,H]of X.subwalks.entries())Q++,this.walkCB2Sync(Y,H,X.child(),$);$()}}class o2 extends Z4{matches=new Set;constructor(q,J,X){super(q,J,X)}matchEmit(q){this.matches.add(q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((q,J)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)J(this.signal.reason);else q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class r2 extends Z4{results;constructor(q,J,X){super(q,J,X);this.results=new H6({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(q){if(this.results.write(q),!this.results.flowing)this.pause()}stream(){let q=this.path;if(q.isUnknown())q.lstat().then(()=>{this.walkCB(q,this.patterns,()=>this.results.end())});else this.walkCB(q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var iY=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class A0{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(q,J){if(!J)throw TypeError("glob options required");if(this.withFileTypes=!!J.withFileTypes,this.signal=J.signal,this.follow=!!J.follow,this.dot=!!J.dot,this.dotRelative=!!J.dotRelative,this.nodir=!!J.nodir,this.mark=!!J.mark,!J.cwd)this.cwd="";else if(J.cwd instanceof URL||J.cwd.startsWith("file://"))J.cwd=nY(J.cwd);if(this.cwd=J.cwd||"",this.root=J.root,this.magicalBraces=!!J.magicalBraces,this.nobrace=!!J.nobrace,this.noext=!!J.noext,this.realpath=!!J.realpath,this.absolute=J.absolute,this.includeChildMatches=J.includeChildMatches!==!1,this.noglobstar=!!J.noglobstar,this.matchBase=!!J.matchBase,this.maxDepth=typeof J.maxDepth==="number"?J.maxDepth:1/0,this.stat=!!J.stat,this.ignore=J.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error("cannot set absolute and withFileTypes:true");if(typeof q==="string")q=[q];if(this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J.allowWindowsEscape===!1,this.windowsPathsNoEscape)q=q.map((H)=>H.replace(/\\/g,"/"));if(this.matchBase){if(J.noglobstar)throw TypeError("base matching requires globstar");q=q.map((H)=>H.includes("/")?H:`./**/${H}`)}if(this.pattern=q,this.platform=J.platform||iY,this.opts={...J,platform:this.platform},J.scurry){if(this.scurry=J.scurry,J.nocase!==void 0&&J.nocase!==J.scurry.nocase)throw Error("nocase option contradicts provided scurry option")}else{let H=J.platform==="win32"?$2:J.platform==="darwin"?a2:J.platform?Y2:l7;this.scurry=new H(this.cwd,{nocase:J.nocase,fs:J.fs})}this.nocase=this.scurry.nocase;let X=this.platform==="darwin"||this.platform==="win32",Z={...J,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:X,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},Q=this.pattern.map((H)=>new W0(H,Z)),[$,Y]=Q.reduce((H,K)=>{return H[0].push(...K.set),H[1].push(...K.globParts),H},[[],[]]);this.patterns=$.map((H,K)=>{let G=Y[K];if(!G)throw Error("invalid pattern object");return new k6(H,G,0,this.platform)})}async walk(){return[...await new o2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new o2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new r2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new r2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var Q4=(q,J={})=>{if(!Array.isArray(q))q=[q];for(let X of q)if(new W0(X,J).hasMagic())return!0;return!1};function t2(q,J={}){return new A0(q,J).streamSync()}function a7(q,J={}){return new A0(q,J).stream()}function o7(q,J={}){return new A0(q,J).walkSync()}async function i7(q,J={}){return new A0(q,J).walk()}function e2(q,J={}){return new A0(q,J).iterateSync()}function r7(q,J={}){return new A0(q,J).iterate()}var aY=t2,oY=Object.assign(a7,{sync:t2}),rY=e2,sY=Object.assign(r7,{sync:e2}),tY=Object.assign(o7,{stream:t2,iterate:e2}),s2=Object.assign(i7,{glob:i7,globSync:o7,sync:tY,globStream:a7,stream:oY,globStreamSync:t2,streamSync:aY,globIterate:r7,iterate:sY,globIterateSync:e2,iterateSync:rY,Glob:A0,hasMagic:Q4,escape:M6,unescape:B0});s2.glob=s2;import{resolve as eY}from"path";var qH=T.object({description:T.string().optional().describe("what you want to do"),pattern:T.string().describe("The glob pattern to match files against"),path:T.string().optional().describe('The directory to search in. Can be absolute or relative to cwd. If not specified, the current working directory (cwd) will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.')}),s7=H0(async({pattern:q,path:J},X)=>{if(!X.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");let Z=J?eY(X.state.cwd,J):X.state.cwd,Q=await s2(q,{ignore:["node_modules",".git","dist","build",".next",".turbo","coverage",".nyc_output","temp",".cache","vendor","venv","__pycache__","*.pyc","target","out",".output"],cwd:Z,absolute:!0});if(Q.length===0)return"No files found.";return Q.join(`
31
+ >>> no match, partial?`,q,W,J,U),W===H)return!0}return!1}let _;if(typeof G==="string")_=V===G,this.debug("string match",G,V,_);else _=G.test(V),this.debug("pattern match",G,V,_);if(!_)return!1}if($===H&&Y===K)return!0;else if($===H)return X;else if(Y===K)return $===H-1&&q[$]==="";else throw Error("wtf?")}braceExpand(){return A7(this.pattern,this.options)}parse(q){r6(q);let J=this.options;if(q==="**")return r;if(q==="")return"";let X,Z=null;if(X=q.match($Y))Z=J.dot?HY:YY;else if(X=q.match(o$))Z=(J.nocase?J.dot?e$:t$:J.dot?s$:r$)(X[1]);else if(X=q.match(KY))Z=(J.nocase?J.dot?GY:VY:J.dot?WY:UY)(X);else if(X=q.match(qY))Z=J.dot?XY:JY;else if(X=q.match(ZY))Z=QY;let Q=o.fromGlob(q,this.options).toMMPattern();if(Z&&typeof Q==="object")Reflect.defineProperty(Q,"test",{value:Z});return Q}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let q=this.set;if(!q.length)return this.regexp=!1,this.regexp;let J=this.options,X=J.noglobstar?LY:J.dot?BY:xY,Z=new Set(J.nocase?["i"]:[]),Q=q.map((H)=>{let K=H.map((V)=>{if(V instanceof RegExp)for(let W of V.flags.split(""))Z.add(W);return typeof V==="string"?FY(V):V===r?r:V._src});K.forEach((V,W)=>{let U=K[W+1],z=K[W-1];if(V!==r||z===r)return;if(z===void 0)if(U!==void 0&&U!==r)K[W+1]="(?:\\/|"+X+"\\/)?"+U;else K[W]=X;else if(U===void 0)K[W-1]=z+"(?:\\/|\\/"+X+")?";else if(U!==r)K[W-1]=z+"(?:\\/|\\/"+X+"\\/)"+U,K[W+1]=r});let G=K.filter((V)=>V!==r);if(this.partial&&G.length>=1){let V=[];for(let W=1;W<=G.length;W++)V.push(G.slice(0,W).join("/"));return"(?:"+V.join("|")+")"}return G.join("/")}).join("|"),[$,Y]=q.length>1?["(?:",")"]:["",""];if(Q="^"+$+Q+Y+"$",this.partial)Q="^(?:\\/|"+$+Q.slice(1,-1)+Y+")$";if(this.negate)Q="^(?!"+Q+").+$";try{this.regexp=new RegExp(Q,[...Z].join(""))}catch(H){this.regexp=!1}return this.regexp}slashSplit(q){if(this.preserveMultipleSlashes)return q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(q))return["",...q.split(/\/+/)];else return q.split(/\/+/)}match(q,J=this.partial){if(this.debug("match",q,this.pattern),this.comment)return!1;if(this.empty)return q==="";if(q==="/"&&J)return!0;let X=this.options;if(this.isWindows)q=q.split("\\").join("/");let Z=this.slashSplit(q);this.debug(this.pattern,"split",Z);let Q=this.set;this.debug(this.pattern,"set",Q);let $=Z[Z.length-1];if(!$)for(let Y=Z.length-2;!$&&Y>=0;Y--)$=Z[Y];for(let Y=0;Y<Q.length;Y++){let H=Q[Y],K=Z;if(X.matchBase&&H.length===1)K=[$];if(this.matchOne(K,H,J)){if(X.flipNegate)return!0;return!this.negate}}if(X.flipNegate)return!1;return this.negate}static defaults(q){return q0.defaults(q).Minimatch}}q0.AST=o;q0.Minimatch=W0;q0.escape=F6;q0.unescape=B0;import{fileURLToPath as XH}from"node:url";var kY=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,I7=new Set,l8=typeof process=="object"&&process?process:{},O7=(q,J,X,Z)=>{typeof l8.emitWarning=="function"?l8.emitWarning(q,J,X,Z):console.error(`[${X}] ${J}: ${q}`)},g2=globalThis.AbortController,D7=globalThis.AbortSignal;if(typeof g2>"u"){D7=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(X,Z){this._onabort.push(Z)}},g2=class{constructor(){J()}signal=new D7;abort(X){if(!this.signal.aborted){this.signal.reason=X,this.signal.aborted=!0;for(let Z of this.signal._onabort)Z(X);this.signal.onabort?.(X)}}};let q=l8.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",J=()=>{q&&(q=!1,O7("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",J))}}var TY=(q)=>!I7.has(q),bj=Symbol("type"),p0=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),v7=(q)=>p0(q)?q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?b2:null:null,b2=class extends Array{constructor(q){super(q),this.fill(0)}},wY=class q{heap;length;static#q=!1;static create(J){let X=v7(J);if(!X)return[];q.#q=!0;let Z=new q(J,X);return q.#q=!1,Z}constructor(J,X){if(!q.#q)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new X(J),this.length=0}push(J){this.heap[this.length++]=J}pop(){return this.heap[--this.length]}},t6=class q{#q;#X;#J;#Z;#$;#V;#U;#W;get perf(){return this.#W}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#H;#_;#z;#K;#Y;#L;#C;#M;#B;#D;#x;#T;#w;#j;#R;#F;#P;#Q;#y;static unsafeExposeInternals(J){return{starts:J.#w,ttls:J.#j,autopurgeTimers:J.#R,sizes:J.#T,keyMap:J.#z,keyList:J.#K,valList:J.#Y,next:J.#L,prev:J.#C,get head(){return J.#M},get tail(){return J.#B},free:J.#D,isBackgroundFetch:(X)=>J.#G(X),backgroundFetch:(X,Z,Q,$)=>J.#d(X,Z,Q,$),moveToTail:(X)=>J.#h(X),indexes:(X)=>J.#O(X),rindexes:(X)=>J.#v(X),isStale:(X)=>J.#k(X)}}get max(){return this.#q}get maxSize(){return this.#X}get calculatedSize(){return this.#_}get size(){return this.#H}get fetchMethod(){return this.#V}get memoMethod(){return this.#U}get dispose(){return this.#J}get onInsert(){return this.#Z}get disposeAfter(){return this.#$}constructor(J){let{max:X=0,ttl:Z,ttlResolution:Q=1,ttlAutopurge:$,updateAgeOnGet:Y,updateAgeOnHas:H,allowStale:K,dispose:G,onInsert:V,disposeAfter:W,noDisposeOnSet:U,noUpdateTTL:z,maxSize:_=0,maxEntrySize:L=0,sizeCalculation:x,fetchMethod:B,memoMethod:j,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:y,ignoreFetchAbort:O,perf:g}=J;if(g!==void 0&&typeof g?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#W=g??kY,X!==0&&!p0(X))throw TypeError("max option must be a nonnegative integer");let M=X?v7(X):Array;if(!M)throw Error("invalid max value: "+X);if(this.#q=X,this.#X=_,this.maxEntrySize=L||this.#X,this.sizeCalculation=x,this.sizeCalculation){if(!this.#X&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(j!==void 0&&typeof j!="function")throw TypeError("memoMethod must be a function if defined");if(this.#U=j,B!==void 0&&typeof B!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#V=B,this.#P=!!B,this.#z=new Map,this.#K=Array(X).fill(void 0),this.#Y=Array(X).fill(void 0),this.#L=new M(X),this.#C=new M(X),this.#M=0,this.#B=0,this.#D=wY.create(X),this.#H=0,this.#_=0,typeof G=="function"&&(this.#J=G),typeof V=="function"&&(this.#Z=V),typeof W=="function"?(this.#$=W,this.#x=[]):(this.#$=void 0,this.#x=void 0),this.#F=!!this.#J,this.#y=!!this.#Z,this.#Q=!!this.#$,this.noDisposeOnSet=!!U,this.noUpdateTTL=!!z,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!y,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#X!==0&&!p0(this.#X))throw TypeError("maxSize must be a positive integer if specified");if(!p0(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#l()}if(this.allowStale=!!K,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!H,this.ttlResolution=p0(Q)||Q===0?Q:1,this.ttlAutopurge=!!$,this.ttl=Z||0,this.ttl){if(!p0(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#q===0&&this.ttl===0&&this.#X===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#X){let P="LRU_CACHE_UNBOUNDED";TY(P)&&(I7.add(P),O7("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,q))}}getRemainingTTL(J){return this.#z.has(J)?1/0:0}#N(){let J=new b2(this.#q),X=new b2(this.#q);this.#j=J,this.#w=X;let Z=this.ttlAutopurge?Array(this.#q):void 0;this.#R=Z,this.#g=(Y,H,K=this.#W.now())=>{if(X[Y]=H!==0?K:0,J[Y]=H,Z?.[Y]&&(clearTimeout(Z[Y]),Z[Y]=void 0),H!==0&&Z){let G=setTimeout(()=>{this.#k(Y)&&this.#I(this.#K[Y],"expire")},H+1);G.unref&&G.unref(),Z[Y]=G}},this.#A=(Y)=>{X[Y]=J[Y]!==0?this.#W.now():0},this.#E=(Y,H)=>{if(J[H]){let K=J[H],G=X[H];if(!K||!G)return;Y.ttl=K,Y.start=G,Y.now=Q||$();let V=Y.now-G;Y.remainingTTL=K-V}};let Q=0,$=()=>{let Y=this.#W.now();if(this.ttlResolution>0){Q=Y;let H=setTimeout(()=>Q=0,this.ttlResolution);H.unref&&H.unref()}return Y};this.getRemainingTTL=(Y)=>{let H=this.#z.get(Y);if(H===void 0)return 0;let K=J[H],G=X[H];if(!K||!G)return 1/0;let V=(Q||$())-G;return K-V},this.#k=(Y)=>{let H=X[Y],K=J[Y];return!!K&&!!H&&(Q||$())-H>K}}#A=()=>{};#E=()=>{};#g=()=>{};#k=()=>!1;#l(){let J=new b2(this.#q);this.#_=0,this.#T=J,this.#b=(X)=>{this.#_-=J[X],J[X]=0},this.#f=(X,Z,Q,$)=>{if(this.#G(Z))return 0;if(!p0(Q))if($){if(typeof $!="function")throw TypeError("sizeCalculation must be a function");if(Q=$(Z,X),!p0(Q))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return Q},this.#S=(X,Z,Q)=>{if(J[X]=Z,this.#X){let $=this.#X-J[X];for(;this.#_>$;)this.#m(!0)}this.#_+=J[X],Q&&(Q.entrySize=Z,Q.totalCalculatedSize=this.#_)}}#b=(J)=>{};#S=(J,X,Z)=>{};#f=(J,X,Z,Q)=>{if(Z||Q)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:J=this.allowStale}={}){if(this.#H)for(let X=this.#B;!(!this.#u(X)||((J||!this.#k(X))&&(yield X),X===this.#M));)X=this.#C[X]}*#v({allowStale:J=this.allowStale}={}){if(this.#H)for(let X=this.#M;!(!this.#u(X)||((J||!this.#k(X))&&(yield X),X===this.#B));)X=this.#L[X]}#u(J){return J!==void 0&&this.#z.get(this.#K[J])===J}*entries(){for(let J of this.#O())this.#Y[J]!==void 0&&this.#K[J]!==void 0&&!this.#G(this.#Y[J])&&(yield[this.#K[J],this.#Y[J]])}*rentries(){for(let J of this.#v())this.#Y[J]!==void 0&&this.#K[J]!==void 0&&!this.#G(this.#Y[J])&&(yield[this.#K[J],this.#Y[J]])}*keys(){for(let J of this.#O()){let X=this.#K[J];X!==void 0&&!this.#G(this.#Y[J])&&(yield X)}}*rkeys(){for(let J of this.#v()){let X=this.#K[J];X!==void 0&&!this.#G(this.#Y[J])&&(yield X)}}*values(){for(let J of this.#O())this.#Y[J]!==void 0&&!this.#G(this.#Y[J])&&(yield this.#Y[J])}*rvalues(){for(let J of this.#v())this.#Y[J]!==void 0&&!this.#G(this.#Y[J])&&(yield this.#Y[J])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(J,X={}){for(let Z of this.#O()){let Q=this.#Y[Z],$=this.#G(Q)?Q.__staleWhileFetching:Q;if($!==void 0&&J($,this.#K[Z],this))return this.get(this.#K[Z],X)}}forEach(J,X=this){for(let Z of this.#O()){let Q=this.#Y[Z],$=this.#G(Q)?Q.__staleWhileFetching:Q;$!==void 0&&J.call(X,$,this.#K[Z],this)}}rforEach(J,X=this){for(let Z of this.#v()){let Q=this.#Y[Z],$=this.#G(Q)?Q.__staleWhileFetching:Q;$!==void 0&&J.call(X,$,this.#K[Z],this)}}purgeStale(){let J=!1;for(let X of this.#v({allowStale:!0}))this.#k(X)&&(this.#I(this.#K[X],"expire"),J=!0);return J}info(J){let X=this.#z.get(J);if(X===void 0)return;let Z=this.#Y[X],Q=this.#G(Z)?Z.__staleWhileFetching:Z;if(Q===void 0)return;let $={value:Q};if(this.#j&&this.#w){let Y=this.#j[X],H=this.#w[X];if(Y&&H){let K=Y-(this.#W.now()-H);$.ttl=K,$.start=Date.now()}}return this.#T&&($.size=this.#T[X]),$}dump(){let J=[];for(let X of this.#O({allowStale:!0})){let Z=this.#K[X],Q=this.#Y[X],$=this.#G(Q)?Q.__staleWhileFetching:Q;if($===void 0||Z===void 0)continue;let Y={value:$};if(this.#j&&this.#w){Y.ttl=this.#j[X];let H=this.#W.now()-this.#w[X];Y.start=Math.floor(Date.now()-H)}this.#T&&(Y.size=this.#T[X]),J.unshift([Z,Y])}return J}load(J){this.clear();for(let[X,Z]of J){if(Z.start){let Q=Date.now()-Z.start;Z.start=this.#W.now()-Q}this.set(X,Z.value,Z)}}set(J,X,Z={}){if(X===void 0)return this.delete(J),this;let{ttl:Q=this.ttl,start:$,noDisposeOnSet:Y=this.noDisposeOnSet,sizeCalculation:H=this.sizeCalculation,status:K}=Z,{noUpdateTTL:G=this.noUpdateTTL}=Z,V=this.#f(J,X,Z.size||0,H);if(this.maxEntrySize&&V>this.maxEntrySize)return K&&(K.set="miss",K.maxEntrySizeExceeded=!0),this.#I(J,"set"),this;let W=this.#H===0?void 0:this.#z.get(J);if(W===void 0)W=this.#H===0?this.#B:this.#D.length!==0?this.#D.pop():this.#H===this.#q?this.#m(!1):this.#H,this.#K[W]=J,this.#Y[W]=X,this.#z.set(J,W),this.#L[this.#B]=W,this.#C[W]=this.#B,this.#B=W,this.#H++,this.#S(W,V,K),K&&(K.set="add"),G=!1,this.#y&&this.#Z?.(X,J,"add");else{this.#h(W);let U=this.#Y[W];if(X!==U){if(this.#P&&this.#G(U)){U.__abortController.abort(Error("replaced"));let{__staleWhileFetching:z}=U;z!==void 0&&!Y&&(this.#F&&this.#J?.(z,J,"set"),this.#Q&&this.#x?.push([z,J,"set"]))}else Y||(this.#F&&this.#J?.(U,J,"set"),this.#Q&&this.#x?.push([U,J,"set"]));if(this.#b(W),this.#S(W,V,K),this.#Y[W]=X,K){K.set="replace";let z=U&&this.#G(U)?U.__staleWhileFetching:U;z!==void 0&&(K.oldValue=z)}}else K&&(K.set="update");this.#y&&this.onInsert?.(X,J,X===U?"update":"replace")}if(Q!==0&&!this.#j&&this.#N(),this.#j&&(G||this.#g(W,Q,$),K&&this.#E(K,W)),!Y&&this.#Q&&this.#x){let U=this.#x,z;for(;z=U?.shift();)this.#$?.(...z)}return this}pop(){try{for(;this.#H;){let J=this.#Y[this.#M];if(this.#m(!0),this.#G(J)){if(J.__staleWhileFetching)return J.__staleWhileFetching}else if(J!==void 0)return J}}finally{if(this.#Q&&this.#x){let J=this.#x,X;for(;X=J?.shift();)this.#$?.(...X)}}}#m(J){let X=this.#M,Z=this.#K[X],Q=this.#Y[X];return this.#P&&this.#G(Q)?Q.__abortController.abort(Error("evicted")):(this.#F||this.#Q)&&(this.#F&&this.#J?.(Q,Z,"evict"),this.#Q&&this.#x?.push([Q,Z,"evict"])),this.#b(X),this.#R?.[X]&&(clearTimeout(this.#R[X]),this.#R[X]=void 0),J&&(this.#K[X]=void 0,this.#Y[X]=void 0,this.#D.push(X)),this.#H===1?(this.#M=this.#B=0,this.#D.length=0):this.#M=this.#L[X],this.#z.delete(Z),this.#H--,X}has(J,X={}){let{updateAgeOnHas:Z=this.updateAgeOnHas,status:Q}=X,$=this.#z.get(J);if($!==void 0){let Y=this.#Y[$];if(this.#G(Y)&&Y.__staleWhileFetching===void 0)return!1;if(this.#k($))Q&&(Q.has="stale",this.#E(Q,$));else return Z&&this.#A($),Q&&(Q.has="hit",this.#E(Q,$)),!0}else Q&&(Q.has="miss");return!1}peek(J,X={}){let{allowStale:Z=this.allowStale}=X,Q=this.#z.get(J);if(Q===void 0||!Z&&this.#k(Q))return;let $=this.#Y[Q];return this.#G($)?$.__staleWhileFetching:$}#d(J,X,Z,Q){let $=X===void 0?void 0:this.#Y[X];if(this.#G($))return $;let Y=new g2,{signal:H}=Z;H?.addEventListener("abort",()=>Y.abort(H.reason),{signal:Y.signal});let K={signal:Y.signal,options:Z,context:Q},G=(L,x=!1)=>{let{aborted:B}=Y.signal,j=Z.ignoreFetchAbort&&L!==void 0,R=Z.ignoreFetchAbort||!!(Z.allowStaleOnFetchAbort&&L!==void 0);if(Z.status&&(B&&!x?(Z.status.fetchAborted=!0,Z.status.fetchError=Y.signal.reason,j&&(Z.status.fetchAbortIgnored=!0)):Z.status.fetchResolved=!0),B&&!j&&!x)return W(Y.signal.reason,R);let F=z,C=this.#Y[X];return(C===z||j&&x&&C===void 0)&&(L===void 0?F.__staleWhileFetching!==void 0?this.#Y[X]=F.__staleWhileFetching:this.#I(J,"fetch"):(Z.status&&(Z.status.fetchUpdated=!0),this.set(J,L,K.options))),L},V=(L)=>(Z.status&&(Z.status.fetchRejected=!0,Z.status.fetchError=L),W(L,!1)),W=(L,x)=>{let{aborted:B}=Y.signal,j=B&&Z.allowStaleOnFetchAbort,R=j||Z.allowStaleOnFetchRejection,F=R||Z.noDeleteOnFetchRejection,C=z;if(this.#Y[X]===z&&(!F||!x&&C.__staleWhileFetching===void 0?this.#I(J,"fetch"):j||(this.#Y[X]=C.__staleWhileFetching)),R)return Z.status&&C.__staleWhileFetching!==void 0&&(Z.status.returnedStale=!0),C.__staleWhileFetching;if(C.__returned===C)throw L},U=(L,x)=>{let B=this.#V?.(J,$,K);B&&B instanceof Promise&&B.then((j)=>L(j===void 0?void 0:j),x),Y.signal.addEventListener("abort",()=>{(!Z.ignoreFetchAbort||Z.allowStaleOnFetchAbort)&&(L(void 0),Z.allowStaleOnFetchAbort&&(L=(j)=>G(j,!0)))})};Z.status&&(Z.status.fetchDispatched=!0);let z=new Promise(U).then(G,V),_=Object.assign(z,{__abortController:Y,__staleWhileFetching:$,__returned:void 0});return X===void 0?(this.set(J,_,{...K.options,status:void 0}),X=this.#z.get(J)):this.#Y[X]=_,_}#G(J){if(!this.#P)return!1;let X=J;return!!X&&X instanceof Promise&&X.hasOwnProperty("__staleWhileFetching")&&X.__abortController instanceof g2}async fetch(J,X={}){let{allowStale:Z=this.allowStale,updateAgeOnGet:Q=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:H=this.noDisposeOnSet,size:K=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:V=this.noUpdateTTL,noDeleteOnFetchRejection:W=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:U=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:L,forceRefresh:x=!1,status:B,signal:j}=X;if(!this.#P)return B&&(B.fetch="get"),this.get(J,{allowStale:Z,updateAgeOnGet:Q,noDeleteOnStaleGet:$,status:B});let R={allowStale:Z,updateAgeOnGet:Q,noDeleteOnStaleGet:$,ttl:Y,noDisposeOnSet:H,size:K,sizeCalculation:G,noUpdateTTL:V,noDeleteOnFetchRejection:W,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:_,ignoreFetchAbort:z,status:B,signal:j},F=this.#z.get(J);if(F===void 0){B&&(B.fetch="miss");let C=this.#d(J,F,R,L);return C.__returned=C}else{let C=this.#Y[F];if(this.#G(C)){let M=Z&&C.__staleWhileFetching!==void 0;return B&&(B.fetch="inflight",M&&(B.returnedStale=!0)),M?C.__staleWhileFetching:C.__returned=C}let y=this.#k(F);if(!x&&!y)return B&&(B.fetch="hit"),this.#h(F),Q&&this.#A(F),B&&this.#E(B,F),C;let O=this.#d(J,F,R,L),g=O.__staleWhileFetching!==void 0&&Z;return B&&(B.fetch=y?"stale":"refresh",g&&y&&(B.returnedStale=!0)),g?O.__staleWhileFetching:O.__returned=O}}async forceFetch(J,X={}){let Z=await this.fetch(J,X);if(Z===void 0)throw Error("fetch() returned undefined");return Z}memo(J,X={}){let Z=this.#U;if(!Z)throw Error("no memoMethod provided to constructor");let{context:Q,forceRefresh:$,...Y}=X,H=this.get(J,Y);if(!$&&H!==void 0)return H;let K=Z(J,H,{options:Y,context:Q});return this.set(J,K,Y),K}get(J,X={}){let{allowStale:Z=this.allowStale,updateAgeOnGet:Q=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,status:Y}=X,H=this.#z.get(J);if(H!==void 0){let K=this.#Y[H],G=this.#G(K);return Y&&this.#E(Y,H),this.#k(H)?(Y&&(Y.get="stale"),G?(Y&&Z&&K.__staleWhileFetching!==void 0&&(Y.returnedStale=!0),Z?K.__staleWhileFetching:void 0):($||this.#I(J,"expire"),Y&&Z&&(Y.returnedStale=!0),Z?K:void 0)):(Y&&(Y.get="hit"),G?K.__staleWhileFetching:(this.#h(H),Q&&this.#A(H),K))}else Y&&(Y.get="miss")}#c(J,X){this.#C[X]=J,this.#L[J]=X}#h(J){J!==this.#B&&(J===this.#M?this.#M=this.#L[J]:this.#c(this.#C[J],this.#L[J]),this.#c(this.#B,J),this.#B=J)}delete(J){return this.#I(J,"delete")}#I(J,X){let Z=!1;if(this.#H!==0){let Q=this.#z.get(J);if(Q!==void 0)if(this.#R?.[Q]&&(clearTimeout(this.#R?.[Q]),this.#R[Q]=void 0),Z=!0,this.#H===1)this.#p(X);else{this.#b(Q);let $=this.#Y[Q];if(this.#G($)?$.__abortController.abort(Error("deleted")):(this.#F||this.#Q)&&(this.#F&&this.#J?.($,J,X),this.#Q&&this.#x?.push([$,J,X])),this.#z.delete(J),this.#K[Q]=void 0,this.#Y[Q]=void 0,Q===this.#B)this.#B=this.#C[Q];else if(Q===this.#M)this.#M=this.#L[Q];else{let Y=this.#C[Q];this.#L[Y]=this.#L[Q];let H=this.#L[Q];this.#C[H]=this.#C[Q]}this.#H--,this.#D.push(Q)}}if(this.#Q&&this.#x?.length){let Q=this.#x,$;for(;$=Q?.shift();)this.#$?.(...$)}return Z}clear(){return this.#p("delete")}#p(J){for(let X of this.#v({allowStale:!0})){let Z=this.#Y[X];if(this.#G(Z))Z.__abortController.abort(Error("deleted"));else{let Q=this.#K[X];this.#F&&this.#J?.(Z,Q,J),this.#Q&&this.#x?.push([Z,Q,J])}}if(this.#z.clear(),this.#Y.fill(void 0),this.#K.fill(void 0),this.#j&&this.#w){this.#j.fill(0),this.#w.fill(0);for(let X of this.#R??[])X!==void 0&&clearTimeout(X);this.#R?.fill(void 0)}if(this.#T&&this.#T.fill(0),this.#M=0,this.#B=0,this.#D.length=0,this.#_=0,this.#H=0,this.#Q&&this.#x){let X=this.#x,Z;for(;Z=X?.shift();)this.#$?.(...Z)}}};import{posix as hY,win32 as q4}from"node:path";import{fileURLToPath as bY}from"node:url";import{lstatSync as gY,readdir as fY,readdirSync as uY,readlinkSync as mY,realpathSync as dY}from"fs";import*as cY from"node:fs";import{lstat as pY,readdir as nY,readlink as iY,realpath as aY}from"node:fs/promises";import{EventEmitter as r8}from"node:events";import h7 from"node:stream";import{StringDecoder as PY}from"node:string_decoder";var N7=typeof process==="object"&&process?process:{stdout:null,stderr:null},AY=(q)=>!!q&&typeof q==="object"&&(q instanceof V6||q instanceof h7||DY(q)||IY(q)),DY=(q)=>!!q&&typeof q==="object"&&q instanceof r8&&typeof q.pipe==="function"&&q.pipe!==h7.Writable.prototype.pipe,IY=(q)=>!!q&&typeof q==="object"&&q instanceof r8&&typeof q.write==="function"&&typeof q.end==="function",S0=Symbol("EOF"),h0=Symbol("maybeEmitEnd"),n0=Symbol("emittedEnd"),f2=Symbol("emittingEnd"),e6=Symbol("emittedError"),u2=Symbol("closed"),E7=Symbol("read"),m2=Symbol("flush"),y7=Symbol("flushChunk"),x0=Symbol("encoding"),k6=Symbol("decoder"),m=Symbol("flowing"),q2=Symbol("paused"),T6=Symbol("resume"),d=Symbol("buffer"),J0=Symbol("pipes"),c=Symbol("bufferLength"),p8=Symbol("bufferPush"),d2=Symbol("bufferShift"),t=Symbol("objectMode"),h=Symbol("destroyed"),n8=Symbol("error"),i8=Symbol("emitData"),S7=Symbol("emitEnd"),a8=Symbol("emitEnd2"),w0=Symbol("async"),o8=Symbol("abort"),c2=Symbol("aborted"),J2=Symbol("signal"),K6=Symbol("dataListeners"),K0=Symbol("discarded"),X2=(q)=>Promise.resolve().then(q),OY=(q)=>q(),vY=(q)=>q==="end"||q==="finish"||q==="prefinish",NY=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,EY=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class s8{src;dest;opts;ondrain;constructor(q,J,X){this.src=q,this.dest=J,this.opts=X,this.ondrain=()=>q[T6](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class b7 extends s8{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,J,X){super(q,J,X);this.proxyErrors=(Z)=>this.dest.emit("error",Z),q.on("error",this.proxyErrors)}}var yY=(q)=>!!q.objectMode,SY=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class V6 extends r8{[m]=!1;[q2]=!1;[J0]=[];[d]=[];[t];[x0];[w0];[k6];[S0]=!1;[n0]=!1;[f2]=!1;[u2]=!1;[e6]=null;[c]=0;[h]=!1;[J2];[c2]=!1;[K6]=0;[K0]=!1;writable=!0;readable=!0;constructor(...q){let J=q[0]||{};super();if(J.objectMode&&typeof J.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(yY(J))this[t]=!0,this[x0]=null;else if(SY(J))this[x0]=J.encoding,this[t]=!1;else this[t]=!1,this[x0]=null;if(this[w0]=!!J.async,this[k6]=this[x0]?new PY(this[x0]):null,J&&J.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[d]});if(J&&J.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[J0]});let{signal:X}=J;if(X)if(this[J2]=X,X.aborted)this[o8]();else X.addEventListener("abort",()=>this[o8]())}get bufferLength(){return this[c]}get encoding(){return this[x0]}set encoding(q){throw Error("Encoding must be set at instantiation time")}setEncoding(q){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[t]}set objectMode(q){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[w0]}set["async"](q){this[w0]=this[w0]||!!q}[o8](){this[c2]=!0,this.emit("abort",this[J2]?.reason),this.destroy(this[J2]?.reason)}get aborted(){return this[c2]}set aborted(q){}write(q,J,X){if(this[c2])return!1;if(this[S0])throw Error("write after end");if(this[h])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof J==="function")X=J,J="utf8";if(!J)J="utf8";let Z=this[w0]?X2:OY;if(!this[t]&&!Buffer.isBuffer(q)){if(EY(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(NY(q))q=Buffer.from(q);else if(typeof q!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[t]){if(this[m]&&this[c]!==0)this[m2](!0);if(this[m])this.emit("data",q);else this[p8](q);if(this[c]!==0)this.emit("readable");if(X)Z(X);return this[m]}if(!q.length){if(this[c]!==0)this.emit("readable");if(X)Z(X);return this[m]}if(typeof q==="string"&&!(J===this[x0]&&!this[k6]?.lastNeed))q=Buffer.from(q,J);if(Buffer.isBuffer(q)&&this[x0])q=this[k6].write(q);if(this[m]&&this[c]!==0)this[m2](!0);if(this[m])this.emit("data",q);else this[p8](q);if(this[c]!==0)this.emit("readable");if(X)Z(X);return this[m]}read(q){if(this[h])return null;if(this[K0]=!1,this[c]===0||q===0||q&&q>this[c])return this[h0](),null;if(this[t])q=null;if(this[d].length>1&&!this[t])this[d]=[this[x0]?this[d].join(""):Buffer.concat(this[d],this[c])];let J=this[E7](q||null,this[d][0]);return this[h0](),J}[E7](q,J){if(this[t])this[d2]();else{let X=J;if(q===X.length||q===null)this[d2]();else if(typeof X==="string")this[d][0]=X.slice(q),J=X.slice(0,q),this[c]-=q;else this[d][0]=X.subarray(q),J=X.subarray(0,q),this[c]-=q}if(this.emit("data",J),!this[d].length&&!this[S0])this.emit("drain");return J}end(q,J,X){if(typeof q==="function")X=q,q=void 0;if(typeof J==="function")X=J,J="utf8";if(q!==void 0)this.write(q,J);if(X)this.once("end",X);if(this[S0]=!0,this.writable=!1,this[m]||!this[q2])this[h0]();return this}[T6](){if(this[h])return;if(!this[K6]&&!this[J0].length)this[K0]=!0;if(this[q2]=!1,this[m]=!0,this.emit("resume"),this[d].length)this[m2]();else if(this[S0])this[h0]();else this.emit("drain")}resume(){return this[T6]()}pause(){this[m]=!1,this[q2]=!0,this[K0]=!1}get destroyed(){return this[h]}get flowing(){return this[m]}get paused(){return this[q2]}[p8](q){if(this[t])this[c]+=1;else this[c]+=q.length;this[d].push(q)}[d2](){if(this[t])this[c]-=1;else this[c]-=this[d][0].length;return this[d].shift()}[m2](q=!1){do;while(this[y7](this[d2]())&&this[d].length);if(!q&&!this[d].length&&!this[S0])this.emit("drain")}[y7](q){return this.emit("data",q),this[m]}pipe(q,J){if(this[h])return q;this[K0]=!1;let X=this[n0];if(J=J||{},q===N7.stdout||q===N7.stderr)J.end=!1;else J.end=J.end!==!1;if(J.proxyErrors=!!J.proxyErrors,X){if(J.end)q.end()}else if(this[J0].push(!J.proxyErrors?new s8(this,q,J):new b7(this,q,J)),this[w0])X2(()=>this[T6]());else this[T6]();return q}unpipe(q){let J=this[J0].find((X)=>X.dest===q);if(J){if(this[J0].length===1){if(this[m]&&this[K6]===0)this[m]=!1;this[J0]=[]}else this[J0].splice(this[J0].indexOf(J),1);J.unpipe()}}addListener(q,J){return this.on(q,J)}on(q,J){let X=super.on(q,J);if(q==="data"){if(this[K0]=!1,this[K6]++,!this[J0].length&&!this[m])this[T6]()}else if(q==="readable"&&this[c]!==0)super.emit("readable");else if(vY(q)&&this[n0])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[e6]){let Z=J;if(this[w0])X2(()=>Z.call(this,this[e6]));else Z.call(this,this[e6])}return X}removeListener(q,J){return this.off(q,J)}off(q,J){let X=super.off(q,J);if(q==="data"){if(this[K6]=this.listeners("data").length,this[K6]===0&&!this[K0]&&!this[J0].length)this[m]=!1}return X}removeAllListeners(q){let J=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[K6]=0,!this[K0]&&!this[J0].length)this[m]=!1}return J}get emittedEnd(){return this[n0]}[h0](){if(!this[f2]&&!this[n0]&&!this[h]&&this[d].length===0&&this[S0]){if(this[f2]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[u2])this.emit("close");this[f2]=!1}}emit(q,...J){let X=J[0];if(q!=="error"&&q!=="close"&&q!==h&&this[h])return!1;else if(q==="data")return!this[t]&&!X?!1:this[w0]?(X2(()=>this[i8](X)),!0):this[i8](X);else if(q==="end")return this[S7]();else if(q==="close"){if(this[u2]=!0,!this[n0]&&!this[h])return!1;let Q=super.emit("close");return this.removeAllListeners("close"),Q}else if(q==="error"){this[e6]=X,super.emit(n8,X);let Q=!this[J2]||this.listeners("error").length?super.emit("error",X):!1;return this[h0](),Q}else if(q==="resume"){let Q=super.emit("resume");return this[h0](),Q}else if(q==="finish"||q==="prefinish"){let Q=super.emit(q);return this.removeAllListeners(q),Q}let Z=super.emit(q,...J);return this[h0](),Z}[i8](q){for(let X of this[J0])if(X.dest.write(q)===!1)this.pause();let J=this[K0]?!1:super.emit("data",q);return this[h0](),J}[S7](){if(this[n0])return!1;return this[n0]=!0,this.readable=!1,this[w0]?(X2(()=>this[a8]()),!0):this[a8]()}[a8](){if(this[k6]){let J=this[k6].end();if(J){for(let X of this[J0])X.dest.write(J);if(!this[K0])super.emit("data",J)}}for(let J of this[J0])J.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[t])q.dataLength=0;let J=this.promise();return this.on("data",(X)=>{if(q.push(X),!this[t])q.dataLength+=X.length}),await J,q}async concat(){if(this[t])throw Error("cannot concat in objectMode");let q=await this.collect();return this[x0]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,J)=>{this.on(h,()=>J(Error("stream destroyed"))),this.on("error",(X)=>J(X)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[K0]=!1;let q=!1,J=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return J();let Z=this.read();if(Z!==null)return Promise.resolve({done:!1,value:Z});if(this[S0])return J();let Q,$,Y=(V)=>{this.off("data",H),this.off("end",K),this.off(h,G),J(),$(V)},H=(V)=>{this.off("error",Y),this.off("end",K),this.off(h,G),this.pause(),Q({value:V,done:!!this[S0]})},K=()=>{this.off("error",Y),this.off("data",H),this.off(h,G),J(),Q({done:!0,value:void 0})},G=()=>Y(Error("stream destroyed"));return new Promise((V,W)=>{$=W,Q=V,this.once(h,G),this.once("error",Y),this.once("end",K),this.once("data",H)})},throw:J,return:J,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[K0]=!1;let q=!1,J=()=>{return this.pause(),this.off(n8,J),this.off(h,J),this.off("end",J),q=!0,{done:!0,value:void 0}},X=()=>{if(q)return J();let Z=this.read();return Z===null?J():{done:!1,value:Z}};return this.once("end",J),this.once(n8,J),this.once(h,J),{next:X,throw:J,return:J,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(q){if(this[h]){if(q)this.emit("error",q);else this.emit(h);return this}this[h]=!0,this[K0]=!0,this[d].length=0,this[c]=0;let J=this;if(typeof J.close==="function"&&!this[u2])J.close();if(q)this.emit("error",q);else this.emit(h);return this}static get isStream(){return AY}}var lY=dY.native,Q2={lstatSync:gY,readdir:fY,readdirSync:uY,readlinkSync:mY,realpathSync:lY,promises:{lstat:pY,readdir:nY,readlink:iY,realpath:aY}},d7=(q)=>!q||q===Q2||q===cY?Q2:{...Q2,...q,promises:{...Q2.promises,...q.promises||{}}},c7=/^\\\\\?\\([a-z]:)\\?$/i,oY=(q)=>q.replace(/\//g,"\\").replace(c7,"$1\\"),rY=/[\\\/]/,z0=0,l7=1,p7=2,P0=4,n7=6,i7=8,G6=10,a7=12,U0=15,Z2=~U0,t8=16,g7=32,$2=64,j0=128,l2=256,n2=512,f7=$2|j0|n2,sY=1023,e8=(q)=>q.isFile()?i7:q.isDirectory()?P0:q.isSymbolicLink()?G6:q.isCharacterDevice()?p7:q.isBlockDevice()?n7:q.isSocket()?a7:q.isFIFO()?l7:z0,u7=new t6({max:4096}),Y2=(q)=>{let J=u7.get(q);if(J)return J;let X=q.normalize("NFKD");return u7.set(q,X),X},m7=new t6({max:4096}),p2=(q)=>{let J=m7.get(q);if(J)return J;let X=Y2(q.toLowerCase());return m7.set(q,X),X};class J4 extends t6{constructor(){super({max:256})}}class o7 extends t6{constructor(q=16384){super({maxSize:q,sizeCalculation:(J)=>J.length+1})}}var r7=Symbol("PathScurry setAsCwd");class X0{name;root;roots;parent;nocase;isCWD=!1;#q;#X;get dev(){return this.#X}#J;get mode(){return this.#J}#Z;get nlink(){return this.#Z}#$;get uid(){return this.#$}#V;get gid(){return this.#V}#U;get rdev(){return this.#U}#W;get blksize(){return this.#W}#H;get ino(){return this.#H}#_;get size(){return this.#_}#z;get blocks(){return this.#z}#K;get atimeMs(){return this.#K}#Y;get mtimeMs(){return this.#Y}#L;get ctimeMs(){return this.#L}#C;get birthtimeMs(){return this.#C}#M;get atime(){return this.#M}#B;get mtime(){return this.#B}#D;get ctime(){return this.#D}#x;get birthtime(){return this.#x}#T;#w;#j;#R;#F;#P;#Q;#y;#N;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(q,J=z0,X,Z,Q,$,Y){if(this.name=q,this.#T=Q?p2(q):Y2(q),this.#Q=J&sY,this.nocase=Q,this.roots=Z,this.root=X||this,this.#y=$,this.#j=Y.fullpath,this.#F=Y.relative,this.#P=Y.relativePosix,this.parent=Y.parent,this.parent)this.#q=this.parent.#q;else this.#q=d7(Y.fs)}depth(){if(this.#w!==void 0)return this.#w;if(!this.parent)return this.#w=0;return this.#w=this.parent.depth()+1}childrenCache(){return this.#y}resolve(q){if(!q)return this;let J=this.getRootString(q),Z=q.substring(J.length).split(this.splitSep);return J?this.getRoot(J).#E(Z):this.#E(Z)}#E(q){let J=this;for(let X of q)J=J.child(X);return J}children(){let q=this.#y.get(this);if(q)return q;let J=Object.assign([],{provisional:0});return this.#y.set(this,J),this.#Q&=~t8,J}child(q,J){if(q===""||q===".")return this;if(q==="..")return this.parent||this;let X=this.children(),Z=this.nocase?p2(q):Y2(q);for(let H of X)if(H.#T===Z)return H;let Q=this.parent?this.sep:"",$=this.#j?this.#j+Q+q:void 0,Y=this.newChild(q,z0,{...J,parent:this,fullpath:$});if(!this.canReaddir())Y.#Q|=j0;return X.push(Y),Y}relative(){if(this.isCWD)return"";if(this.#F!==void 0)return this.#F;let q=this.name,J=this.parent;if(!J)return this.#F=this.name;let X=J.relative();return X+(!X||!J.parent?"":this.sep)+q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let q=this.name,J=this.parent;if(!J)return this.#P=this.fullpathPosix();let X=J.relativePosix();return X+(!X||!J.parent?"":"/")+q}fullpath(){if(this.#j!==void 0)return this.#j;let q=this.name,J=this.parent;if(!J)return this.#j=this.name;let Z=J.fullpath()+(!J.parent?"":this.sep)+q;return this.#j=Z}fullpathPosix(){if(this.#R!==void 0)return this.#R;if(this.sep==="/")return this.#R=this.fullpath();if(!this.parent){let Z=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(Z))return this.#R=`//?/${Z}`;else return this.#R=Z}let q=this.parent,J=q.fullpathPosix(),X=J+(!J||!q.parent?"":"/")+this.name;return this.#R=X}isUnknown(){return(this.#Q&U0)===z0}isType(q){return this[`is${q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Q&U0)===i7}isDirectory(){return(this.#Q&U0)===P0}isCharacterDevice(){return(this.#Q&U0)===p7}isBlockDevice(){return(this.#Q&U0)===n7}isFIFO(){return(this.#Q&U0)===l7}isSocket(){return(this.#Q&U0)===a7}isSymbolicLink(){return(this.#Q&G6)===G6}lstatCached(){return this.#Q&g7?this:void 0}readlinkCached(){return this.#N}realpathCached(){return this.#A}readdirCached(){let q=this.children();return q.slice(0,q.provisional)}canReadlink(){if(this.#N)return!0;if(!this.parent)return!1;let q=this.#Q&U0;return!(q!==z0&&q!==G6||this.#Q&l2||this.#Q&j0)}calledReaddir(){return!!(this.#Q&t8)}isENOENT(){return!!(this.#Q&j0)}isNamed(q){return!this.nocase?this.#T===Y2(q):this.#T===p2(q)}async readlink(){let q=this.#N;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let J=await this.#q.promises.readlink(this.fullpath()),X=(await this.parent.realpath())?.resolve(J);if(X)return this.#N=X}catch(J){this.#v(J.code);return}}readlinkSync(){let q=this.#N;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let J=this.#q.readlinkSync(this.fullpath()),X=this.parent.realpathSync()?.resolve(J);if(X)return this.#N=X}catch(J){this.#v(J.code);return}}#g(q){this.#Q|=t8;for(let J=q.provisional;J<q.length;J++){let X=q[J];if(X)X.#k()}}#k(){if(this.#Q&j0)return;this.#Q=(this.#Q|j0)&Z2,this.#l()}#l(){let q=this.children();q.provisional=0;for(let J of q)J.#k()}#b(){this.#Q|=n2,this.#S()}#S(){if(this.#Q&$2)return;let q=this.#Q;if((q&U0)===P0)q&=Z2;this.#Q=q|$2,this.#l()}#f(q=""){if(q==="ENOTDIR"||q==="EPERM")this.#S();else if(q==="ENOENT")this.#k();else this.children().provisional=0}#O(q=""){if(q==="ENOTDIR")this.parent.#S();else if(q==="ENOENT")this.#k()}#v(q=""){let J=this.#Q;if(J|=l2,q==="ENOENT")J|=j0;if(q==="EINVAL"||q==="UNKNOWN")J&=Z2;if(this.#Q=J,q==="ENOTDIR"&&this.parent)this.parent.#S()}#u(q,J){return this.#d(q,J)||this.#m(q,J)}#m(q,J){let X=e8(q),Z=this.newChild(q.name,X,{parent:this}),Q=Z.#Q&U0;if(Q!==P0&&Q!==G6&&Q!==z0)Z.#Q|=$2;return J.unshift(Z),J.provisional++,Z}#d(q,J){for(let X=J.provisional;X<J.length;X++){let Z=J[X];if((this.nocase?p2(q.name):Y2(q.name))!==Z.#T)continue;return this.#G(q,Z,X,J)}}#G(q,J,X,Z){let Q=J.name;if(J.#Q=J.#Q&Z2|e8(q),Q!==q.name)J.name=q.name;if(X!==Z.provisional){if(X===Z.length-1)Z.pop();else Z.splice(X,1);Z.unshift(J)}return Z.provisional++,J}async lstat(){if((this.#Q&j0)===0)try{return this.#c(await this.#q.promises.lstat(this.fullpath())),this}catch(q){this.#O(q.code)}}lstatSync(){if((this.#Q&j0)===0)try{return this.#c(this.#q.lstatSync(this.fullpath())),this}catch(q){this.#O(q.code)}}#c(q){let{atime:J,atimeMs:X,birthtime:Z,birthtimeMs:Q,blksize:$,blocks:Y,ctime:H,ctimeMs:K,dev:G,gid:V,ino:W,mode:U,mtime:z,mtimeMs:_,nlink:L,rdev:x,size:B,uid:j}=q;this.#M=J,this.#K=X,this.#x=Z,this.#C=Q,this.#W=$,this.#z=Y,this.#D=H,this.#L=K,this.#X=G,this.#V=V,this.#H=W,this.#J=U,this.#B=z,this.#Y=_,this.#Z=L,this.#U=x,this.#_=B,this.#$=j;let R=e8(q);if(this.#Q=this.#Q&Z2|R|g7,R!==z0&&R!==P0&&R!==G6)this.#Q|=$2}#h=[];#I=!1;#p(q){this.#I=!1;let J=this.#h.slice();this.#h.length=0,J.forEach((X)=>X(null,q))}readdirCB(q,J=!1){if(!this.canReaddir()){if(J)q(null,[]);else queueMicrotask(()=>q(null,[]));return}let X=this.children();if(this.calledReaddir()){let Q=X.slice(0,X.provisional);if(J)q(null,Q);else queueMicrotask(()=>q(null,Q));return}if(this.#h.push(q),this.#I)return;this.#I=!0;let Z=this.fullpath();this.#q.readdir(Z,{withFileTypes:!0},(Q,$)=>{if(Q)this.#f(Q.code),X.provisional=0;else{for(let Y of $)this.#u(Y,X);this.#g(X)}this.#p(X.slice(0,X.provisional));return})}#n;async readdir(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let J=this.fullpath();if(this.#n)await this.#n;else{let X=()=>{};this.#n=new Promise((Z)=>X=Z);try{for(let Z of await this.#q.promises.readdir(J,{withFileTypes:!0}))this.#u(Z,q);this.#g(q)}catch(Z){this.#f(Z.code),q.provisional=0}this.#n=void 0,X()}return q.slice(0,q.provisional)}readdirSync(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let J=this.fullpath();try{for(let X of this.#q.readdirSync(J,{withFileTypes:!0}))this.#u(X,q);this.#g(q)}catch(X){this.#f(X.code),q.provisional=0}return q.slice(0,q.provisional)}canReaddir(){if(this.#Q&f7)return!1;let q=U0&this.#Q;if(!(q===z0||q===P0||q===G6))return!1;return!0}shouldWalk(q,J){return(this.#Q&P0)===P0&&!(this.#Q&f7)&&!q.has(this)&&(!J||J(this))}async realpath(){if(this.#A)return this.#A;if((n2|l2|j0)&this.#Q)return;try{let q=await this.#q.promises.realpath(this.fullpath());return this.#A=this.resolve(q)}catch(q){this.#b()}}realpathSync(){if(this.#A)return this.#A;if((n2|l2|j0)&this.#Q)return;try{let q=this.#q.realpathSync(this.fullpath());return this.#A=this.resolve(q)}catch(q){this.#b()}}[r7](q){if(q===this)return;q.isCWD=!1,this.isCWD=!0;let J=new Set([]),X=[],Z=this;while(Z&&Z.parent)J.add(Z),Z.#F=X.join(this.sep),Z.#P=X.join("/"),Z=Z.parent,X.push("..");Z=q;while(Z&&Z.parent&&!J.has(Z))Z.#F=void 0,Z.#P=void 0,Z=Z.parent}}class i2 extends X0{sep="\\";splitSep=rY;constructor(q,J=z0,X,Z,Q,$,Y){super(q,J,X,Z,Q,$,Y)}newChild(q,J=z0,X={}){return new i2(q,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}getRootString(q){return q4.parse(q).root}getRoot(q){if(q=oY(q.toUpperCase()),q===this.root.name)return this.root;for(let[J,X]of Object.entries(this.roots))if(this.sameRoot(q,J))return this.roots[q]=X;return this.roots[q]=new H2(q,this).root}sameRoot(q,J=this.root.name){return q=q.toUpperCase().replace(/\//g,"\\").replace(c7,"$1\\"),q===J}}class a2 extends X0{splitSep="/";sep="/";constructor(q,J=z0,X,Z,Q,$,Y){super(q,J,X,Z,Q,$,Y)}getRootString(q){return q.startsWith("/")?"/":""}getRoot(q){return this.root}newChild(q,J=z0,X={}){return new a2(q,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}}class X4{root;rootPath;roots;cwd;#q;#X;#J;nocase;#Z;constructor(q=process.cwd(),J,X,{nocase:Z,childrenCacheSize:Q=16384,fs:$=Q2}={}){if(this.#Z=d7($),q instanceof URL||q.startsWith("file://"))q=bY(q);let Y=J.resolve(q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(Y),this.#q=new J4,this.#X=new J4,this.#J=new o7(Q);let H=Y.substring(this.rootPath.length).split(X);if(H.length===1&&!H[0])H.pop();if(Z===void 0)throw TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=Z,this.root=this.newRoot(this.#Z),this.roots[this.rootPath]=this.root;let K=this.root,G=H.length-1,V=J.sep,W=this.rootPath,U=!1;for(let z of H){let _=G--;K=K.child(z,{relative:Array(_).fill("..").join(V),relativePosix:Array(_).fill("..").join("/"),fullpath:W+=(U?"":V)+z}),U=!0}this.cwd=K}depth(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.depth()}childrenCache(){return this.#J}resolve(...q){let J="";for(let Q=q.length-1;Q>=0;Q--){let $=q[Q];if(!$||$===".")continue;if(J=J?`${$}/${J}`:$,this.isAbsolute($))break}let X=this.#q.get(J);if(X!==void 0)return X;let Z=this.cwd.resolve(J).fullpath();return this.#q.set(J,Z),Z}resolvePosix(...q){let J="";for(let Q=q.length-1;Q>=0;Q--){let $=q[Q];if(!$||$===".")continue;if(J=J?`${$}/${J}`:$,this.isAbsolute($))break}let X=this.#X.get(J);if(X!==void 0)return X;let Z=this.cwd.resolve(J).fullpathPosix();return this.#X.set(J,Z),Z}relative(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relative()}relativePosix(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relativePosix()}basename(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.name}dirname(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return(q.parent||q).fullpath()}async readdir(q=this.cwd,J={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X}=J;if(!q.canReaddir())return[];else{let Z=await q.readdir();return X?Z:Z.map((Q)=>Q.name)}}readdirSync(q=this.cwd,J={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0}=J;if(!q.canReaddir())return[];else if(X)return q.readdirSync();else return q.readdirSync().map((Z)=>Z.name)}async lstat(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstat()}lstatSync(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstatSync()}async readlink(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=await q.readlink();return J?X:X?.fullpath()}readlinkSync(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=q.readlinkSync();return J?X:X?.fullpath()}async realpath(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=await q.realpath();return J?X:X?.fullpath()}realpathSync(q=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q.withFileTypes,q=this.cwd;let X=q.realpathSync();return J?X:X?.fullpath()}async walk(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=[];if(!Q||Q(q))Y.push(X?q:q.fullpath());let H=new Set,K=(V,W)=>{H.add(V),V.readdirCB((U,z)=>{if(U)return W(U);let _=z.length;if(!_)return W();let L=()=>{if(--_===0)W()};for(let x of z){if(!Q||Q(x))Y.push(X?x:x.fullpath());if(Z&&x.isSymbolicLink())x.realpath().then((B)=>B?.isUnknown()?B.lstat():B).then((B)=>B?.shouldWalk(H,$)?K(B,L):L());else if(x.shouldWalk(H,$))K(x,L);else L()}},!0)},G=q;return new Promise((V,W)=>{K(G,(U)=>{if(U)return W(U);V(Y)})})}walkSync(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=[];if(!Q||Q(q))Y.push(X?q:q.fullpath());let H=new Set([q]);for(let K of H){let G=K.readdirSync();for(let V of G){if(!Q||Q(V))Y.push(X?V:V.fullpath());let W=V;if(V.isSymbolicLink()){if(!(Z&&(W=V.realpathSync())))continue;if(W.isUnknown())W.lstatSync()}if(W.shouldWalk(H,$))H.add(W)}}return Y}[Symbol.asyncIterator](){return this.iterate()}iterate(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;return this.stream(q,J)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J;if(!Q||Q(q))yield X?q:q.fullpath();let Y=new Set([q]);for(let H of Y){let K=H.readdirSync();for(let G of K){if(!Q||Q(G))yield X?G:G.fullpath();let V=G;if(G.isSymbolicLink()){if(!(Z&&(V=G.realpathSync())))continue;if(V.isUnknown())V.lstatSync()}if(V.shouldWalk(Y,$))Y.add(V)}}}stream(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=new V6({objectMode:!0});if(!Q||Q(q))Y.write(X?q:q.fullpath());let H=new Set,K=[q],G=0,V=()=>{let W=!1;while(!W){let U=K.shift();if(!U){if(G===0)Y.end();return}G++,H.add(U);let z=(L,x,B=!1)=>{if(L)return Y.emit("error",L);if(Z&&!B){let j=[];for(let R of x)if(R.isSymbolicLink())j.push(R.realpath().then((F)=>F?.isUnknown()?F.lstat():F));if(j.length){Promise.all(j).then(()=>z(null,x,!0));return}}for(let j of x)if(j&&(!Q||Q(j))){if(!Y.write(X?j:j.fullpath()))W=!0}G--;for(let j of x){let R=j.realpathCached()||j;if(R.shouldWalk(H,$))K.push(R)}if(W&&!Y.flowing)Y.once("drain",V);else if(!_)V()},_=!0;U.readdirCB(z,!0),_=!1}};return V(),Y}streamSync(q=this.cwd,J={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof X0))J=q,q=this.cwd;let{withFileTypes:X=!0,follow:Z=!1,filter:Q,walkFilter:$}=J,Y=new V6({objectMode:!0}),H=new Set;if(!Q||Q(q))Y.write(X?q:q.fullpath());let K=[q],G=0,V=()=>{let W=!1;while(!W){let U=K.shift();if(!U){if(G===0)Y.end();return}G++,H.add(U);let z=U.readdirSync();for(let _ of z)if(!Q||Q(_)){if(!Y.write(X?_:_.fullpath()))W=!0}G--;for(let _ of z){let L=_;if(_.isSymbolicLink()){if(!(Z&&(L=_.realpathSync())))continue;if(L.isUnknown())L.lstatSync()}if(L.shouldWalk(H,$))K.push(L)}}if(W&&!Y.flowing)Y.once("drain",V)};return V(),Y}chdir(q=this.cwd){let J=this.cwd;this.cwd=typeof q==="string"?this.cwd.resolve(q):q,this.cwd[r7](J)}}class H2 extends X4{sep="\\";constructor(q=process.cwd(),J={}){let{nocase:X=!0}=J;super(q,q4,"\\",{...J,nocase:X});this.nocase=X;for(let Z=this.cwd;Z;Z=Z.parent)Z.nocase=this.nocase}parseRootPath(q){return q4.parse(q).root.toUpperCase()}newRoot(q){return new i2(this.rootPath,P0,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")||q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(q)}}class K2 extends X4{sep="/";constructor(q=process.cwd(),J={}){let{nocase:X=!1}=J;super(q,hY,"/",{...J,nocase:X});this.nocase=X}parseRootPath(q){return"/"}newRoot(q){return new a2(this.rootPath,P0,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")}}class o2 extends K2{constructor(q=process.cwd(),J={}){let{nocase:X=!0}=J;super(q,{...J,nocase:X})}}var tj=process.platform==="win32"?i2:a2,s7=process.platform==="win32"?H2:process.platform==="darwin"?o2:K2;var tY=(q)=>q.length>=1,eY=(q)=>q.length>=1;class w6{#q;#X;#J;length;#Z;#$;#V;#U;#W;#H;#_=!0;constructor(q,J,X,Z){if(!tY(q))throw TypeError("empty pattern list");if(!eY(J))throw TypeError("empty glob list");if(J.length!==q.length)throw TypeError("mismatched pattern list and glob list lengths");if(this.length=q.length,X<0||X>=this.length)throw TypeError("index out of range");if(this.#q=q,this.#X=J,this.#J=X,this.#Z=Z,this.#J===0){if(this.isUNC()){let[Q,$,Y,H,...K]=this.#q,[G,V,W,U,...z]=this.#X;if(K[0]==="")K.shift(),z.shift();let _=[Q,$,Y,H,""].join("/"),L=[G,V,W,U,""].join("/");this.#q=[_,...K],this.#X=[L,...z],this.length=this.#q.length}else if(this.isDrive()||this.isAbsolute()){let[Q,...$]=this.#q,[Y,...H]=this.#X;if($[0]==="")$.shift(),H.shift();let K=Q+"/",G=Y+"/";this.#q=[K,...$],this.#X=[G,...H],this.length=this.#q.length}}}pattern(){return this.#q[this.#J]}isString(){return typeof this.#q[this.#J]==="string"}isGlobstar(){return this.#q[this.#J]===r}isRegExp(){return this.#q[this.#J]instanceof RegExp}globString(){return this.#V=this.#V||(this.#J===0?this.isAbsolute()?this.#X[0]+this.#X.slice(1).join("/"):this.#X.join("/"):this.#X.slice(this.#J).join("/"))}hasMore(){return this.length>this.#J+1}rest(){if(this.#$!==void 0)return this.#$;if(!this.hasMore())return this.#$=null;return this.#$=new w6(this.#q,this.#X,this.#J+1,this.#Z),this.#$.#H=this.#H,this.#$.#W=this.#W,this.#$.#U=this.#U,this.#$}isUNC(){let q=this.#q;return this.#W!==void 0?this.#W:this.#W=this.#Z==="win32"&&this.#J===0&&q[0]===""&&q[1]===""&&typeof q[2]==="string"&&!!q[2]&&typeof q[3]==="string"&&!!q[3]}isDrive(){let q=this.#q;return this.#U!==void 0?this.#U:this.#U=this.#Z==="win32"&&this.#J===0&&this.length>1&&typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0])}isAbsolute(){let q=this.#q;return this.#H!==void 0?this.#H:this.#H=q[0]===""&&q.length>1||this.isDrive()||this.isUNC()}root(){let q=this.#q[0];return typeof q==="string"&&this.isAbsolute()&&this.#J===0?q:""}checkFollowGlobstar(){return!(this.#J===0||!this.isGlobstar()||!this.#_)}markFollowGlobstar(){if(this.#J===0||!this.isGlobstar()||!this.#_)return!1;return this.#_=!1,!0}}var qH=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class V2{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(q,{nobrace:J,nocase:X,noext:Z,noglobstar:Q,platform:$=qH}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=$,this.mmopts={dot:!0,nobrace:J,nocase:X,noext:Z,noglobstar:Q,optimizationLevel:2,platform:$,nocomment:!0,nonegate:!0};for(let Y of q)this.add(Y)}add(q){let J=new W0(q,this.mmopts);for(let X=0;X<J.set.length;X++){let Z=J.set[X],Q=J.globParts[X];if(!Z||!Q)throw Error("invalid pattern object");while(Z[0]==="."&&Q[0]===".")Z.shift(),Q.shift();let $=new w6(Z,Q,0,this.platform),Y=new W0($.globString(),this.mmopts),H=Q[Q.length-1]==="**",K=$.isAbsolute();if(K)this.absolute.push(Y);else this.relative.push(Y);if(H)if(K)this.absoluteChildren.push(Y);else this.relativeChildren.push(Y)}}ignored(q){let J=q.fullpath(),X=`${J}/`,Z=q.relative()||".",Q=`${Z}/`;for(let $ of this.relative)if($.match(Z)||$.match(Q))return!0;for(let $ of this.absolute)if($.match(J)||$.match(X))return!0;return!1}childrenIgnored(q){let J=q.fullpath()+"/",X=(q.relative()||".")+"/";for(let Z of this.relativeChildren)if(Z.match(X))return!0;for(let Z of this.absoluteChildren)if(Z.match(J))return!0;return!1}}class Z4{store;constructor(q=new Map){this.store=q}copy(){return new Z4(new Map(this.store))}hasWalked(q,J){return this.store.get(q.fullpath())?.has(J.globString())}storeWalked(q,J){let X=q.fullpath(),Z=this.store.get(X);if(Z)Z.add(J.globString());else this.store.set(X,new Set([J.globString()]))}}class t7{store=new Map;add(q,J,X){let Z=(J?2:0)|(X?1:0),Q=this.store.get(q);this.store.set(q,Q===void 0?Z:Z&Q)}entries(){return[...this.store.entries()].map(([q,J])=>[q,!!(J&2),!!(J&1)])}}class e7{store=new Map;add(q,J){if(!q.canReaddir())return;let X=this.store.get(q);if(X){if(!X.find((Z)=>Z.globString()===J.globString()))X.push(J)}else this.store.set(q,[J])}get(q){let J=this.store.get(q);if(!J)throw Error("attempting to walk unknown path");return J}entries(){return this.keys().map((q)=>[q,this.store.get(q)])}keys(){return[...this.store.keys()].filter((q)=>q.canReaddir())}}class G2{hasWalkedCache;matches=new t7;subwalks=new e7;patterns;follow;dot;opts;constructor(q,J){this.opts=q,this.follow=!!q.follow,this.dot=!!q.dot,this.hasWalkedCache=J?J.copy():new Z4}processPatterns(q,J){this.patterns=J;let X=J.map((Z)=>[q,Z]);for(let[Z,Q]of X){this.hasWalkedCache.storeWalked(Z,Q);let $=Q.root(),Y=Q.isAbsolute()&&this.opts.absolute!==!1;if($){Z=Z.resolve($==="/"&&this.opts.root!==void 0?this.opts.root:$);let V=Q.rest();if(!V){this.matches.add(Z,!0,!1);continue}else Q=V}if(Z.isENOENT())continue;let H,K,G=!1;while(typeof(H=Q.pattern())==="string"&&(K=Q.rest()))Z=Z.resolve(H),Q=K,G=!0;if(H=Q.pattern(),K=Q.rest(),G){if(this.hasWalkedCache.hasWalked(Z,Q))continue;this.hasWalkedCache.storeWalked(Z,Q)}if(typeof H==="string"){let V=H===".."||H===""||H===".";this.matches.add(Z.resolve(H),Y,V);continue}else if(H===r){if(!Z.isSymbolicLink()||this.follow||Q.checkFollowGlobstar())this.subwalks.add(Z,Q);let V=K?.pattern(),W=K?.rest();if(!K||(V===""||V===".")&&!W)this.matches.add(Z,Y,V===""||V===".");else if(V===".."){let U=Z.parent||Z;if(!W)this.matches.add(U,Y,!0);else if(!this.hasWalkedCache.hasWalked(U,W))this.subwalks.add(U,W)}}else if(H instanceof RegExp)this.subwalks.add(Z,Q)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new G2(this.opts,this.hasWalkedCache)}filterEntries(q,J){let X=this.subwalks.get(q),Z=this.child();for(let Q of J)for(let $ of X){let Y=$.isAbsolute(),H=$.pattern(),K=$.rest();if(H===r)Z.testGlobstar(Q,$,K,Y);else if(H instanceof RegExp)Z.testRegExp(Q,H,K,Y);else Z.testString(Q,H,K,Y)}return Z}testGlobstar(q,J,X,Z){if(this.dot||!q.name.startsWith(".")){if(!J.hasMore())this.matches.add(q,Z,!1);if(q.canReaddir()){if(this.follow||!q.isSymbolicLink())this.subwalks.add(q,J);else if(q.isSymbolicLink()){if(X&&J.checkFollowGlobstar())this.subwalks.add(q,X);else if(J.markFollowGlobstar())this.subwalks.add(q,J)}}}if(X){let Q=X.pattern();if(typeof Q==="string"&&Q!==".."&&Q!==""&&Q!==".")this.testString(q,Q,X.rest(),Z);else if(Q===".."){let $=q.parent||q;this.subwalks.add($,X)}else if(Q instanceof RegExp)this.testRegExp(q,Q,X.rest(),Z)}}testRegExp(q,J,X,Z){if(!J.test(q.name))return;if(!X)this.matches.add(q,Z,!1);else this.subwalks.add(q,X)}testString(q,J,X,Z){if(!q.isNamed(J))return;if(!X)this.matches.add(q,Z,!1);else this.subwalks.add(q,X)}}var JH=(q,J)=>typeof q==="string"?new V2([q],J):Array.isArray(q)?new V2(q,J):q;class Q4{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#q=[];#X;#J;signal;maxDepth;includeChildMatches;constructor(q,J,X){if(this.patterns=q,this.path=J,this.opts=X,this.#J=!X.posix&&X.platform==="win32"?"\\":"/",this.includeChildMatches=X.includeChildMatches!==!1,X.ignore||!this.includeChildMatches){if(this.#X=JH(X.ignore??[],X),!this.includeChildMatches&&typeof this.#X.add!=="function")throw Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=X.maxDepth||1/0,X.signal)this.signal=X.signal,this.signal.addEventListener("abort",()=>{this.#q.length=0})}#Z(q){return this.seen.has(q)||!!this.#X?.ignored?.(q)}#$(q){return!!this.#X?.childrenIgnored?.(q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let q=void 0;while(!this.paused&&(q=this.#q.shift()))q()}onResume(q){if(this.signal?.aborted)return;if(!this.paused)q();else this.#q.push(q)}async matchCheck(q,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=q.realpathCached()||await q.realpath(),!X)return;q=X}let Q=q.isUnknown()||this.opts.stat?await q.lstat():q;if(this.opts.follow&&this.opts.nodir&&Q?.isSymbolicLink()){let $=await Q.realpath();if($&&($.isUnknown()||this.opts.stat))await $.lstat()}return this.matchCheckTest(Q,J)}matchCheckTest(q,J){return q&&(this.maxDepth===1/0||q.depth()<=this.maxDepth)&&(!J||q.canReaddir())&&(!this.opts.nodir||!q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!q.isSymbolicLink()||!q.realpathCached()?.isDirectory())&&!this.#Z(q)?q:void 0}matchCheckSync(q,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=q.realpathCached()||q.realpathSync(),!X)return;q=X}let Q=q.isUnknown()||this.opts.stat?q.lstatSync():q;if(this.opts.follow&&this.opts.nodir&&Q?.isSymbolicLink()){let $=Q.realpathSync();if($&&($?.isUnknown()||this.opts.stat))$.lstatSync()}return this.matchCheckTest(Q,J)}matchFinish(q,J){if(this.#Z(q))return;if(!this.includeChildMatches&&this.#X?.add){let Q=`${q.relativePosix()}/**`;this.#X.add(Q)}let X=this.opts.absolute===void 0?J:this.opts.absolute;this.seen.add(q);let Z=this.opts.mark&&q.isDirectory()?this.#J:"";if(this.opts.withFileTypes)this.matchEmit(q);else if(X){let Q=this.opts.posix?q.fullpathPosix():q.fullpath();this.matchEmit(Q+Z)}else{let Q=this.opts.posix?q.relativePosix():q.relative(),$=this.opts.dotRelative&&!Q.startsWith(".."+this.#J)?"."+this.#J:"";this.matchEmit(!Q?"."+Z:$+Q+Z)}}async match(q,J,X){let Z=await this.matchCheck(q,X);if(Z)this.matchFinish(Z,J)}matchSync(q,J,X){let Z=this.matchCheckSync(q,X);if(Z)this.matchFinish(Z,J)}walkCB(q,J,X){if(this.signal?.aborted)X();this.walkCB2(q,J,new G2(this.opts),X)}walkCB2(q,J,X,Z){if(this.#$(q))return Z();if(this.signal?.aborted)Z();if(this.paused){this.onResume(()=>this.walkCB2(q,J,X,Z));return}X.processPatterns(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;Q++,this.match(Y,H,K).then(()=>$())}for(let Y of X.subwalkTargets()){if(this.maxDepth!==1/0&&Y.depth()>=this.maxDepth)continue;Q++;let H=Y.readdirCached();if(Y.calledReaddir())this.walkCB3(Y,H,X,$);else Y.readdirCB((K,G)=>this.walkCB3(Y,G,X,$),!0)}$()}walkCB3(q,J,X,Z){X=X.filterEntries(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;Q++,this.match(Y,H,K).then(()=>$())}for(let[Y,H]of X.subwalks.entries())Q++,this.walkCB2(Y,H,X.child(),$);$()}walkCBSync(q,J,X){if(this.signal?.aborted)X();this.walkCB2Sync(q,J,new G2(this.opts),X)}walkCB2Sync(q,J,X,Z){if(this.#$(q))return Z();if(this.signal?.aborted)Z();if(this.paused){this.onResume(()=>this.walkCB2Sync(q,J,X,Z));return}X.processPatterns(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;this.matchSync(Y,H,K)}for(let Y of X.subwalkTargets()){if(this.maxDepth!==1/0&&Y.depth()>=this.maxDepth)continue;Q++;let H=Y.readdirSync();this.walkCB3Sync(Y,H,X,$)}$()}walkCB3Sync(q,J,X,Z){X=X.filterEntries(q,J);let Q=1,$=()=>{if(--Q===0)Z()};for(let[Y,H,K]of X.matches.entries()){if(this.#Z(Y))continue;this.matchSync(Y,H,K)}for(let[Y,H]of X.subwalks.entries())Q++,this.walkCB2Sync(Y,H,X.child(),$);$()}}class r2 extends Q4{matches=new Set;constructor(q,J,X){super(q,J,X)}matchEmit(q){this.matches.add(q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((q,J)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)J(this.signal.reason);else q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class s2 extends Q4{results;constructor(q,J,X){super(q,J,X);this.results=new V6({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(q){if(this.results.write(q),!this.results.flowing)this.pause()}stream(){let q=this.path;if(q.isUnknown())q.lstat().then(()=>{this.walkCB(q,this.patterns,()=>this.results.end())});else this.walkCB(q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var ZH=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class A0{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(q,J){if(!J)throw TypeError("glob options required");if(this.withFileTypes=!!J.withFileTypes,this.signal=J.signal,this.follow=!!J.follow,this.dot=!!J.dot,this.dotRelative=!!J.dotRelative,this.nodir=!!J.nodir,this.mark=!!J.mark,!J.cwd)this.cwd="";else if(J.cwd instanceof URL||J.cwd.startsWith("file://"))J.cwd=XH(J.cwd);if(this.cwd=J.cwd||"",this.root=J.root,this.magicalBraces=!!J.magicalBraces,this.nobrace=!!J.nobrace,this.noext=!!J.noext,this.realpath=!!J.realpath,this.absolute=J.absolute,this.includeChildMatches=J.includeChildMatches!==!1,this.noglobstar=!!J.noglobstar,this.matchBase=!!J.matchBase,this.maxDepth=typeof J.maxDepth==="number"?J.maxDepth:1/0,this.stat=!!J.stat,this.ignore=J.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error("cannot set absolute and withFileTypes:true");if(typeof q==="string")q=[q];if(this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J.allowWindowsEscape===!1,this.windowsPathsNoEscape)q=q.map((H)=>H.replace(/\\/g,"/"));if(this.matchBase){if(J.noglobstar)throw TypeError("base matching requires globstar");q=q.map((H)=>H.includes("/")?H:`./**/${H}`)}if(this.pattern=q,this.platform=J.platform||ZH,this.opts={...J,platform:this.platform},J.scurry){if(this.scurry=J.scurry,J.nocase!==void 0&&J.nocase!==J.scurry.nocase)throw Error("nocase option contradicts provided scurry option")}else{let H=J.platform==="win32"?H2:J.platform==="darwin"?o2:J.platform?K2:s7;this.scurry=new H(this.cwd,{nocase:J.nocase,fs:J.fs})}this.nocase=this.scurry.nocase;let X=this.platform==="darwin"||this.platform==="win32",Z={...J,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:X,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},Q=this.pattern.map((H)=>new W0(H,Z)),[$,Y]=Q.reduce((H,K)=>{return H[0].push(...K.set),H[1].push(...K.globParts),H},[[],[]]);this.patterns=$.map((H,K)=>{let G=Y[K];if(!G)throw Error("invalid pattern object");return new w6(H,G,0,this.platform)})}async walk(){return[...await new r2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new r2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new s2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new s2(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var $4=(q,J={})=>{if(!Array.isArray(q))q=[q];for(let X of q)if(new W0(X,J).hasMagic())return!0;return!1};function e2(q,J={}){return new A0(q,J).streamSync()}function J5(q,J={}){return new A0(q,J).stream()}function X5(q,J={}){return new A0(q,J).walkSync()}async function q5(q,J={}){return new A0(q,J).walk()}function q1(q,J={}){return new A0(q,J).iterateSync()}function Z5(q,J={}){return new A0(q,J).iterate()}var QH=e2,$H=Object.assign(J5,{sync:e2}),YH=q1,HH=Object.assign(Z5,{sync:q1}),KH=Object.assign(X5,{stream:e2,iterate:q1}),t2=Object.assign(q5,{glob:q5,globSync:X5,sync:KH,globStream:J5,stream:$H,globStreamSync:e2,streamSync:QH,globIterate:Z5,iterate:HH,globIterateSync:q1,iterateSync:YH,Glob:A0,hasMagic:$4,escape:F6,unescape:B0});t2.glob=t2;import{resolve as VH}from"path";var GH=T.object({description:T.string().optional().describe("what you want to do"),pattern:T.string().describe("The glob pattern to match files against"),path:T.string().optional().describe('The directory to search in. Can be absolute or relative to cwd. If not specified, the current working directory (cwd) will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.')}),Q5=H0(async({pattern:q,path:J},X)=>{if(!X.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");let Z=J?VH(X.state.cwd,J):X.state.cwd,Q=await t2(q,{ignore:["node_modules",".git","dist","build",".next",".turbo","coverage",".nyc_output","temp",".cache","vendor","venv","__pycache__","*.pyc","target","out",".output"],cwd:Z,absolute:!0});if(Q.length===0)return"No files found.";return Q.join(`
32
32
  `)},{name:"glob_files",description:`- Fast file pattern matching tool that works with any codebase size
33
33
  - Supports glob patterns like "**/*.js" or "src/**/*.ts"
34
34
  - Returns matching file paths sorted by modification time
35
35
  - Use this tool when you need to find files by name patterns
36
36
  - When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Agent tool instead
37
- - You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches as a batch that are potentially useful.`,schema:qH});function b(q){if(typeof q!=="object"||q===null)return!1;let J=Object.getPrototypeOf(q);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in q)&&!(Symbol.iterator in q)}import{fileURLToPath as JH}from"node:url";var T6=(q,J)=>{let X=Y4(XH(q));if(typeof X!=="string")throw TypeError(`${J} must be a string or a file URL: ${X}.`);return X},XH=(q)=>$4(q)?q.toString():q,$4=(q)=>typeof q!=="string"&&q&&Object.getPrototypeOf(q)===String.prototype,Y4=(q)=>q instanceof URL?JH(q):q;var q1=(q,J=[],X={})=>{let Z=T6(q,"First argument"),[Q,$]=b(J)?[[],J]:[J,X];if(!Array.isArray(Q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${Q}`);if(Q.some((K)=>typeof K==="object"&&K!==null))throw TypeError(`Second argument must be an array of strings: ${Q}`);let Y=Q.map(String),H=Y.find((K)=>K.includes("\x00"));if(H!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${H}`);if(!b($))throw TypeError(`Last argument must be an options object: ${$}`);return[Z,Y,$]};import{ChildProcess as VH}from"node:child_process";import{StringDecoder as ZH}from"node:string_decoder";var{toString:t7}=Object.prototype,e7=(q)=>t7.call(q)==="[object ArrayBuffer]",f=(q)=>t7.call(q)==="[object Uint8Array]",b0=(q)=>new Uint8Array(q.buffer,q.byteOffset,q.byteLength),QH=new TextEncoder,q5=(q)=>QH.encode(q),$H=new TextDecoder,J1=(q)=>$H.decode(q),J5=(q,J)=>{return YH(q,J).join("")},YH=(q,J)=>{if(J==="utf8"&&q.every(($)=>typeof $==="string"))return q;let X=new ZH(J),Z=q.map(($)=>typeof $==="string"?q5($):$).map(($)=>X.write($)),Q=X.end();return Q===""?Z:[...Z,Q]},V2=(q)=>{if(q.length===1&&f(q[0]))return q[0];return H4(HH(q))},HH=(q)=>q.map((J)=>typeof J==="string"?q5(J):J),H4=(q)=>{let J=new Uint8Array(KH(q)),X=0;for(let Z of q)J.set(Z,X),X+=Z.length;return J},KH=(q)=>{let J=0;for(let X of q)J+=X.length;return J};var $5=(q)=>Array.isArray(q)&&Array.isArray(q.raw),Y5=(q,J)=>{let X=[];for(let[$,Y]of q.entries())X=GH({templates:q,expressions:J,tokens:X,index:$,template:Y});if(X.length===0)throw TypeError("Template script must not be empty");let[Z,...Q]=X;return[Z,Q,{}]},GH=({templates:q,expressions:J,tokens:X,index:Z,template:Q})=>{if(Q===void 0)throw TypeError(`Invalid backslash sequence: ${q.raw[Z]}`);let{nextTokens:$,leadingWhitespaces:Y,trailingWhitespaces:H}=WH(Q,q.raw[Z]),K=Z5(X,$,Y);if(Z===J.length)return K;let G=J[Z],V=Array.isArray(G)?G.map((W)=>Q5(W)):[Q5(G)];return Z5(K,V,H)},WH=(q,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let X=[],Z=0,Q=X5.has(J[0]);for(let Y=0,H=0;Y<q.length;Y+=1,H+=1){let K=J[H];if(X5.has(K)){if(Z!==Y)X.push(q.slice(Z,Y));Z=Y+1}else if(K==="\\"){let G=J[H+1];if(G===`
38
- `)Y-=1,H+=1;else if(G==="u"&&J[H+2]==="{")H=J.indexOf("}",H+3);else H+=UH[G]??1}}let $=Z===q.length;if(!$)X.push(q.slice(Z));return{nextTokens:X,leadingWhitespaces:Q,trailingWhitespaces:$}},X5=new Set([" ","\t","\r",`
39
- `]),UH={x:3,u:5},Z5=(q,J,X)=>X||q.length===0||J.length===0?[...q,...J]:[...q.slice(0,-1),`${q.at(-1)}${J[0]}`,...J.slice(1)],Q5=(q)=>{let J=typeof q;if(J==="string")return q;if(J==="number")return String(q);if(b(q)&&(("stdout"in q)||("isMaxBuffer"in q)))return zH(q);if(q instanceof VH||Object.prototype.toString.call(q)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${J}" in template expression`)},zH=({stdout:q})=>{if(typeof q==="string")return q;if(f(q))return J1(q);if(q===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof q}" stdout in template expression`)};import{spawnSync as nW}from"node:child_process";import{debuglog as _H}from"node:util";import K4 from"node:process";var R0=(q)=>X1.includes(q),X1=[K4.stdin,K4.stdout,K4.stderr],_0=["stdin","stdout","stderr"],Z1=(q)=>_0[q]??`stdio[${q}]`;var K5=(q)=>{let J={...q};for(let X of W4)J[X]=V4(q,X);return J},V4=(q,J)=>{let X=Array.from({length:LH(q)+1}),Z=BH(q[J],X,J);return CH(Z,J)},LH=({stdio:q})=>Array.isArray(q)?Math.max(q.length,_0.length):_0.length,BH=(q,J,X)=>b(q)?xH(q,J,X):J.fill(q),xH=(q,J,X)=>{for(let Z of Object.keys(q).sort(jH))for(let Q of RH(Z,X,J))J[Q]=q[Z];return J},jH=(q,J)=>H5(q)<H5(J)?1:-1,H5=(q)=>{if(q==="stdout"||q==="stderr")return 0;return q==="all"?2:1},RH=(q,J,X)=>{if(q==="ipc")return[X.length-1];let Z=G4(q);if(Z===void 0||Z===0)throw TypeError(`"${J}.${q}" is invalid.
37
+ - You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches as a batch that are potentially useful.`,schema:GH});function b(q){if(typeof q!=="object"||q===null)return!1;let J=Object.getPrototypeOf(q);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in q)&&!(Symbol.iterator in q)}import{fileURLToPath as WH}from"node:url";var P6=(q,J)=>{let X=H4(UH(q));if(typeof X!=="string")throw TypeError(`${J} must be a string or a file URL: ${X}.`);return X},UH=(q)=>Y4(q)?q.toString():q,Y4=(q)=>typeof q!=="string"&&q&&Object.getPrototypeOf(q)===String.prototype,H4=(q)=>q instanceof URL?WH(q):q;var J1=(q,J=[],X={})=>{let Z=P6(q,"First argument"),[Q,$]=b(J)?[[],J]:[J,X];if(!Array.isArray(Q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${Q}`);if(Q.some((K)=>typeof K==="object"&&K!==null))throw TypeError(`Second argument must be an array of strings: ${Q}`);let Y=Q.map(String),H=Y.find((K)=>K.includes("\x00"));if(H!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${H}`);if(!b($))throw TypeError(`Last argument must be an options object: ${$}`);return[Z,Y,$]};import{ChildProcess as RH}from"node:child_process";import{StringDecoder as zH}from"node:string_decoder";var{toString:$5}=Object.prototype,Y5=(q)=>$5.call(q)==="[object ArrayBuffer]",f=(q)=>$5.call(q)==="[object Uint8Array]",b0=(q)=>new Uint8Array(q.buffer,q.byteOffset,q.byteLength),_H=new TextEncoder,H5=(q)=>_H.encode(q),LH=new TextDecoder,X1=(q)=>LH.decode(q),K5=(q,J)=>{return BH(q,J).join("")},BH=(q,J)=>{if(J==="utf8"&&q.every(($)=>typeof $==="string"))return q;let X=new zH(J),Z=q.map(($)=>typeof $==="string"?H5($):$).map(($)=>X.write($)),Q=X.end();return Q===""?Z:[...Z,Q]},W2=(q)=>{if(q.length===1&&f(q[0]))return q[0];return K4(xH(q))},xH=(q)=>q.map((J)=>typeof J==="string"?H5(J):J),K4=(q)=>{let J=new Uint8Array(jH(q)),X=0;for(let Z of q)J.set(Z,X),X+=Z.length;return J},jH=(q)=>{let J=0;for(let X of q)J+=X.length;return J};var U5=(q)=>Array.isArray(q)&&Array.isArray(q.raw),z5=(q,J)=>{let X=[];for(let[$,Y]of q.entries())X=MH({templates:q,expressions:J,tokens:X,index:$,template:Y});if(X.length===0)throw TypeError("Template script must not be empty");let[Z,...Q]=X;return[Z,Q,{}]},MH=({templates:q,expressions:J,tokens:X,index:Z,template:Q})=>{if(Q===void 0)throw TypeError(`Invalid backslash sequence: ${q.raw[Z]}`);let{nextTokens:$,leadingWhitespaces:Y,trailingWhitespaces:H}=CH(Q,q.raw[Z]),K=G5(X,$,Y);if(Z===J.length)return K;let G=J[Z],V=Array.isArray(G)?G.map((W)=>W5(W)):[W5(G)];return G5(K,V,H)},CH=(q,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let X=[],Z=0,Q=V5.has(J[0]);for(let Y=0,H=0;Y<q.length;Y+=1,H+=1){let K=J[H];if(V5.has(K)){if(Z!==Y)X.push(q.slice(Z,Y));Z=Y+1}else if(K==="\\"){let G=J[H+1];if(G===`
38
+ `)Y-=1,H+=1;else if(G==="u"&&J[H+2]==="{")H=J.indexOf("}",H+3);else H+=FH[G]??1}}let $=Z===q.length;if(!$)X.push(q.slice(Z));return{nextTokens:X,leadingWhitespaces:Q,trailingWhitespaces:$}},V5=new Set([" ","\t","\r",`
39
+ `]),FH={x:3,u:5},G5=(q,J,X)=>X||q.length===0||J.length===0?[...q,...J]:[...q.slice(0,-1),`${q.at(-1)}${J[0]}`,...J.slice(1)],W5=(q)=>{let J=typeof q;if(J==="string")return q;if(J==="number")return String(q);if(b(q)&&(("stdout"in q)||("isMaxBuffer"in q)))return kH(q);if(q instanceof RH||Object.prototype.toString.call(q)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${J}" in template expression`)},kH=({stdout:q})=>{if(typeof q==="string")return q;if(f(q))return X1(q);if(q===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof q}" stdout in template expression`)};import{spawnSync as XU}from"node:child_process";import{debuglog as TH}from"node:util";import V4 from"node:process";var R0=(q)=>Z1.includes(q),Z1=[V4.stdin,V4.stdout,V4.stderr],_0=["stdin","stdout","stderr"],Q1=(q)=>_0[q]??`stdio[${q}]`;var L5=(q)=>{let J={...q};for(let X of U4)J[X]=G4(q,X);return J},G4=(q,J)=>{let X=Array.from({length:wH(q)+1}),Z=PH(q[J],X,J);return vH(Z,J)},wH=({stdio:q})=>Array.isArray(q)?Math.max(q.length,_0.length):_0.length,PH=(q,J,X)=>b(q)?AH(q,J,X):J.fill(q),AH=(q,J,X)=>{for(let Z of Object.keys(q).sort(DH))for(let Q of IH(Z,X,J))J[Q]=q[Z];return J},DH=(q,J)=>_5(q)<_5(J)?1:-1,_5=(q)=>{if(q==="stdout"||q==="stderr")return 0;return q==="all"?2:1},IH=(q,J,X)=>{if(q==="ipc")return[X.length-1];let Z=W4(q);if(Z===void 0||Z===0)throw TypeError(`"${J}.${q}" is invalid.
40
40
  It must be "${J}.stdout", "${J}.stderr", "${J}.all", "${J}.ipc", or "${J}.fd3", "${J}.fd4" (and so on).`);if(Z>=X.length)throw TypeError(`"${J}.${q}" is invalid: that file descriptor does not exist.
41
- Please set the "stdio" option to ensure that file descriptor exists.`);return Z==="all"?[1,2]:[Z]},G4=(q)=>{if(q==="all")return q;if(_0.includes(q))return _0.indexOf(q);let J=MH.exec(q);if(J!==null)return Number(J[1])},MH=/^fd(\d+)$/,CH=(q,J)=>q.map((X)=>X===void 0?kH[J]:X),FH=_H("execa").enabled?"full":"none",kH={lines:!1,buffer:!0,maxBuffer:1e8,verbose:FH,stripFinalNewline:!0},W4=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],g0=(q,J)=>J==="ipc"?q.at(-1):q[J];var w6=({verbose:q},J)=>U4(q,J)!=="none",P6=({verbose:q},J)=>!["none","short"].includes(U4(q,J)),V5=({verbose:q},J)=>{let X=U4(q,J);return Q1(X)?X:void 0},U4=(q,J)=>J===void 0?TH(q):g0(q,J),TH=(q)=>q.find((J)=>Q1(J))??$1.findLast((J)=>q.includes(J)),Q1=(q)=>typeof q==="function",$1=["none","short","full"];import{inspect as nH}from"node:util";import{platform as wH}from"node:process";import{stripVTControlCharacters as PH}from"node:util";var G5=(q,J)=>{let X=[q,...J],Z=X.join(" "),Q=X.map(($)=>NH(W5($))).join(" ");return{command:Z,escapedCommand:Q}},G2=(q)=>PH(q).split(`
42
- `).map((J)=>W5(J)).join(`
43
- `),W5=(q)=>q.replaceAll(IH,(J)=>AH(J)),AH=(q)=>{let J=OH[q];if(J!==void 0)return J;let X=q.codePointAt(0),Z=X.toString(16);return X<=vH?`\\u${Z.padStart(4,"0")}`:`\\U${Z}`},DH=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},IH=DH(),OH={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},vH=65535,NH=(q)=>{if(EH.test(q))return q;return wH==="win32"?`"${q.replaceAll('"','""')}"`:`'${q.replaceAll("'","'\\''")}'`},EH=/^[\w./-]+$/;import U5 from"node:process";function z4(){let{env:q}=U5,{TERM:J,TERM_PROGRAM:X}=q;if(U5.platform!=="win32")return J!=="linux";return Boolean(q.WT_SESSION)||Boolean(q.TERMINUS_SUBLIME)||q.ConEmuTask==="{cmd::Cmder}"||X==="Terminus-Sublime"||X==="vscode"||J==="xterm-256color"||J==="alacritty"||J==="rxvt-unicode"||J==="rxvt-unicode-256color"||q.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var z5={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},_5={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},yH={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},SH={...z5,..._5},hH={...z5,...yH},bH=z4(),gH=bH?SH:hH,Y1=gH,iR=Object.entries(_5);import fH from"node:tty";var uH=fH?.WriteStream?.prototype?.hasColors?.()??!1,w=(q,J)=>{if(!uH)return(Q)=>Q;let X=`\x1B[${q}m`,Z=`\x1B[${J}m`;return(Q)=>{let $=Q+"",Y=$.indexOf(Z);if(Y===-1)return X+$+Z;let H=X,K=0,V=(J===22?Z:"")+X;while(Y!==-1)H+=$.slice(K,Y)+V,K=Y+Z.length,Y=$.indexOf(Z,K);return H+=$.slice(K)+Z,H}},rR=w(0,0),L5=w(1,22),sR=w(2,22),tR=w(3,23),eR=w(4,24),qM=w(53,55),JM=w(7,27),XM=w(8,28),ZM=w(9,29),QM=w(30,39),$M=w(31,39),YM=w(32,39),HM=w(33,39),KM=w(34,39),VM=w(35,39),GM=w(36,39),WM=w(37,39),H1=w(90,39),UM=w(40,49),zM=w(41,49),_M=w(42,49),LM=w(43,49),BM=w(44,49),xM=w(45,49),jM=w(46,49),RM=w(47,49),MM=w(100,49),B5=w(91,39),CM=w(92,39),x5=w(93,39),FM=w(94,39),kM=w(95,39),TM=w(96,39),wM=w(97,39),PM=w(101,49),AM=w(102,49),DM=w(103,49),IM=w(104,49),OM=w(105,49),vM=w(106,49),NM=w(107,49);var M5=({type:q,message:J,timestamp:X,piped:Z,commandId:Q,result:{failed:$=!1}={},options:{reject:Y=!0}})=>{let H=mH(X),K=dH[q]({failed:$,reject:Y,piped:Z}),G=cH[q]({reject:Y});return`${H1(`[${H}]`)} ${H1(`[${Q}]`)} ${G(K)} ${G(J)}`},mH=(q)=>`${K1(q.getHours(),2)}:${K1(q.getMinutes(),2)}:${K1(q.getSeconds(),2)}.${K1(q.getMilliseconds(),3)}`,K1=(q,J)=>String(q).padStart(J,"0"),j5=({failed:q,reject:J})=>{if(!q)return Y1.tick;return J?Y1.cross:Y1.warning},dH={command:({piped:q})=>q?"|":"$",output:()=>" ",ipc:()=>"*",error:j5,duration:j5},R5=(q)=>q,cH={command:()=>L5,output:()=>R5,ipc:()=>R5,error:({reject:q})=>q?B5:x5,duration:()=>H1};var C5=(q,J,X)=>{let Z=V5(J,X);return q.map(({verboseLine:Q,verboseObject:$})=>lH(Q,$,Z)).filter((Q)=>Q!==void 0).map((Q)=>pH(Q)).join("")},lH=(q,J,X)=>{if(X===void 0)return q;let Z=X(q,J);if(typeof Z==="string")return Z},pH=(q)=>q.endsWith(`
41
+ Please set the "stdio" option to ensure that file descriptor exists.`);return Z==="all"?[1,2]:[Z]},W4=(q)=>{if(q==="all")return q;if(_0.includes(q))return _0.indexOf(q);let J=OH.exec(q);if(J!==null)return Number(J[1])},OH=/^fd(\d+)$/,vH=(q,J)=>q.map((X)=>X===void 0?EH[J]:X),NH=TH("execa").enabled?"full":"none",EH={lines:!1,buffer:!0,maxBuffer:1e8,verbose:NH,stripFinalNewline:!0},U4=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],g0=(q,J)=>J==="ipc"?q.at(-1):q[J];var A6=({verbose:q},J)=>z4(q,J)!=="none",D6=({verbose:q},J)=>!["none","short"].includes(z4(q,J)),B5=({verbose:q},J)=>{let X=z4(q,J);return $1(X)?X:void 0},z4=(q,J)=>J===void 0?yH(q):g0(q,J),yH=(q)=>q.find((J)=>$1(J))??Y1.findLast((J)=>q.includes(J)),$1=(q)=>typeof q==="function",Y1=["none","short","full"];import{inspect as XK}from"node:util";import{platform as SH}from"node:process";import{stripVTControlCharacters as hH}from"node:util";var x5=(q,J)=>{let X=[q,...J],Z=X.join(" "),Q=X.map(($)=>dH(j5($))).join(" ");return{command:Z,escapedCommand:Q}},U2=(q)=>hH(q).split(`
42
+ `).map((J)=>j5(J)).join(`
43
+ `),j5=(q)=>q.replaceAll(fH,(J)=>bH(J)),bH=(q)=>{let J=uH[q];if(J!==void 0)return J;let X=q.codePointAt(0),Z=X.toString(16);return X<=mH?`\\u${Z.padStart(4,"0")}`:`\\U${Z}`},gH=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},fH=gH(),uH={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},mH=65535,dH=(q)=>{if(cH.test(q))return q;return SH==="win32"?`"${q.replaceAll('"','""')}"`:`'${q.replaceAll("'","'\\''")}'`},cH=/^[\w./-]+$/;import R5 from"node:process";function _4(){let{env:q}=R5,{TERM:J,TERM_PROGRAM:X}=q;if(R5.platform!=="win32")return J!=="linux";return Boolean(q.WT_SESSION)||Boolean(q.TERMINUS_SUBLIME)||q.ConEmuTask==="{cmd::Cmder}"||X==="Terminus-Sublime"||X==="vscode"||J==="xterm-256color"||J==="alacritty"||J==="rxvt-unicode"||J==="rxvt-unicode-256color"||q.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var M5={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},C5={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},lH={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},pH={...M5,...C5},nH={...M5,...lH},iH=_4(),aH=iH?pH:nH,H1=aH,$M=Object.entries(C5);import oH from"node:tty";var rH=oH?.WriteStream?.prototype?.hasColors?.()??!1,w=(q,J)=>{if(!rH)return(Q)=>Q;let X=`\x1B[${q}m`,Z=`\x1B[${J}m`;return(Q)=>{let $=Q+"",Y=$.indexOf(Z);if(Y===-1)return X+$+Z;let H=X,K=0,V=(J===22?Z:"")+X;while(Y!==-1)H+=$.slice(K,Y)+V,K=Y+Z.length,Y=$.indexOf(Z,K);return H+=$.slice(K)+Z,H}},KM=w(0,0),F5=w(1,22),VM=w(2,22),GM=w(3,23),WM=w(4,24),UM=w(53,55),zM=w(7,27),_M=w(8,28),LM=w(9,29),BM=w(30,39),xM=w(31,39),jM=w(32,39),RM=w(33,39),MM=w(34,39),CM=w(35,39),FM=w(36,39),kM=w(37,39),K1=w(90,39),TM=w(40,49),wM=w(41,49),PM=w(42,49),AM=w(43,49),DM=w(44,49),IM=w(45,49),OM=w(46,49),vM=w(47,49),NM=w(100,49),k5=w(91,39),EM=w(92,39),T5=w(93,39),yM=w(94,39),SM=w(95,39),hM=w(96,39),bM=w(97,39),gM=w(101,49),fM=w(102,49),uM=w(103,49),mM=w(104,49),dM=w(105,49),cM=w(106,49),lM=w(107,49);var A5=({type:q,message:J,timestamp:X,piped:Z,commandId:Q,result:{failed:$=!1}={},options:{reject:Y=!0}})=>{let H=sH(X),K=tH[q]({failed:$,reject:Y,piped:Z}),G=eH[q]({reject:Y});return`${K1(`[${H}]`)} ${K1(`[${Q}]`)} ${G(K)} ${G(J)}`},sH=(q)=>`${V1(q.getHours(),2)}:${V1(q.getMinutes(),2)}:${V1(q.getSeconds(),2)}.${V1(q.getMilliseconds(),3)}`,V1=(q,J)=>String(q).padStart(J,"0"),w5=({failed:q,reject:J})=>{if(!q)return H1.tick;return J?H1.cross:H1.warning},tH={command:({piped:q})=>q?"|":"$",output:()=>" ",ipc:()=>"*",error:w5,duration:w5},P5=(q)=>q,eH={command:()=>F5,output:()=>P5,ipc:()=>P5,error:({reject:q})=>q?k5:T5,duration:()=>K1};var D5=(q,J,X)=>{let Z=B5(J,X);return q.map(({verboseLine:Q,verboseObject:$})=>qK(Q,$,Z)).filter((Q)=>Q!==void 0).map((Q)=>JK(Q)).join("")},qK=(q,J,X)=>{if(X===void 0)return q;let Z=X(q,J);if(typeof Z==="string")return Z},JK=(q)=>q.endsWith(`
44
44
  `)?q:`${q}
45
- `;var D0=({type:q,verboseMessage:J,fdNumber:X,verboseInfo:Z,result:Q})=>{let $=iH({type:q,result:Q,verboseInfo:Z}),Y=aH(J,$),H=C5(Y,Z,X);if(H!=="")console.warn(H.slice(0,-1))},iH=({type:q,result:J,verboseInfo:{escapedCommand:X,commandId:Z,rawOptions:{piped:Q=!1,...$}}})=>({type:q,escapedCommand:X,commandId:`${Z}`,timestamp:new Date,piped:Q,result:J,options:$}),aH=(q,J)=>q.split(`
46
- `).map((X)=>oH({...J,message:X})),oH=(q)=>{return{verboseLine:M5(q),verboseObject:q}},V1=(q)=>{let J=typeof q==="string"?q:nH(q);return G2(J).replaceAll("\t"," ".repeat(rH))},rH=2;var F5=(q,J)=>{if(!w6(J))return;D0({type:"command",verboseMessage:q,verboseInfo:J})};var k5=(q,J,X)=>{eH(q);let Z=sH(q);return{verbose:q,escapedCommand:J,commandId:Z,rawOptions:X}},sH=(q)=>w6({verbose:q})?tH++:void 0,tH=0n,eH=(q)=>{for(let J of q){if(J===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(J===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!$1.includes(J)&&!Q1(J)){let X=$1.map((Z)=>`'${Z}'`).join(", ");throw TypeError(`The "verbose" option must not be ${J}. Allowed values are: ${X} or a function.`)}}};import{hrtime as T5}from"node:process";var G1=()=>T5.bigint(),_4=(q)=>Number(T5.bigint()-q)/1e6;var W1=(q,J,X)=>{let Z=G1(),{command:Q,escapedCommand:$}=G5(q,J),Y=V4(X,"verbose"),H=k5(Y,$,{...X});return F5($,H),{command:Q,escapedCommand:$,startTime:Z,verboseInfo:H}};var Sq=Eq(GV(),1);import WV from"node:path";import yq from"node:process";import _1 from"node:process";import V6 from"node:path";function U1(q={}){let{env:J=process.env,platform:X=process.platform}=q;if(X!=="win32")return"PATH";return Object.keys(J).reverse().find((Z)=>Z.toUpperCase()==="PATH")||"Path"}import{promisify as qK}from"node:util";import{execFile as JK,execFileSync as YC}from"node:child_process";import w5 from"node:path";import{fileURLToPath as XK}from"node:url";var VC=qK(JK);function z1(q){return q instanceof URL?XK(q):q}function P5(q){return{*[Symbol.iterator](){let J=w5.resolve(z1(q)),X;while(X!==J)yield J,X=J,J=w5.resolve(J,"..")}}}var ZK=({cwd:q=_1.cwd(),path:J=_1.env[U1()],preferLocal:X=!0,execPath:Z=_1.execPath,addExecPath:Q=!0}={})=>{let $=V6.resolve(z1(q)),Y=[],H=J.split(V6.delimiter);if(X)QK(Y,H,$);if(Q)$K(Y,H,Z,$);return J===""||J===V6.delimiter?`${Y.join(V6.delimiter)}${J}`:[...Y,J].join(V6.delimiter)},QK=(q,J,X)=>{for(let Z of P5(X)){let Q=V6.join(Z,"node_modules/.bin");if(!J.includes(Q))q.push(Q)}},$K=(q,J,X,Z)=>{let Q=V6.resolve(Z,z1(X),"..");if(!J.includes(Q))q.push(Q)},A5=({env:q=_1.env,...J}={})=>{q={...q};let X=U1({env:q});return J.path=q[X],q[X]=ZK(J),q};import{setTimeout as MK}from"node:timers/promises";var D5=(q,J,X)=>{let Z=X?B1:L1,Q=q instanceof I0?{}:{cause:q};return new Z(J,Q)};class I0 extends Error{}var I5=(q,J)=>{Object.defineProperty(q.prototype,"name",{value:J,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,v5,{value:!0,writable:!1,enumerable:!1,configurable:!1})},O5=(q)=>x1(q)&&(v5 in q),v5=Symbol("isExecaError"),x1=(q)=>Object.prototype.toString.call(q)==="[object Error]";class L1 extends Error{}I5(L1,L1.name);class B1 extends Error{}I5(B1,B1.name);import{constants as W2}from"node:os";import{constants as VK}from"node:os";var N5=()=>{let q=L4-E5+1;return Array.from({length:q},YK)},YK=(q,J)=>({name:`SIGRT${J+1}`,number:E5+J,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),E5=34,L4=64;import{constants as HK}from"node:os";var y5=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var B4=()=>{let q=N5();return[...y5,...q].map(KK)},KK=({name:q,number:J,description:X,action:Z,forced:Q=!1,standard:$})=>{let{signals:{[q]:Y}}=HK,H=Y!==void 0;return{name:q,number:H?Y:J,description:X,supported:H,action:Z,forced:Q,standard:$}};var GK=()=>{let q=B4();return Object.fromEntries(q.map(WK))},WK=({name:q,number:J,description:X,supported:Z,action:Q,forced:$,standard:Y})=>[q,{name:q,number:J,description:X,supported:Z,action:Q,forced:$,standard:Y}],S5=GK(),UK=()=>{let q=B4(),J=L4+1,X=Array.from({length:J},(Z,Q)=>zK(Q,q));return Object.assign({},...X)},zK=(q,J)=>{let X=_K(q,J);if(X===void 0)return{};let{name:Z,description:Q,supported:$,action:Y,forced:H,standard:K}=X;return{[q]:{name:Z,number:q,description:Q,supported:$,action:Y,forced:H,standard:K}}},_K=(q,J)=>{let X=J.find(({name:Z})=>VK.signals[Z]===q);if(X!==void 0)return X;return J.find((Z)=>Z.number===q)},AC=UK();var b5=(q)=>{if(q===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return f5(q,"option `killSignal`")},g5=(q)=>q===0?q:f5(q,"`subprocess.kill()`'s argument"),f5=(q,J)=>{if(Number.isInteger(q))return LK(q,J);if(typeof q==="string")return xK(q,J);throw TypeError(`Invalid ${J} ${String(q)}: it must be a string or an integer.
47
- ${x4()}`)},LK=(q,J)=>{if(h5.has(q))return h5.get(q);throw TypeError(`Invalid ${J} ${q}: this signal integer does not exist.
48
- ${x4()}`)},BK=()=>new Map(Object.entries(W2.signals).reverse().map(([q,J])=>[J,q])),h5=BK(),xK=(q,J)=>{if(q in W2.signals)return q;if(q.toUpperCase()in W2.signals)throw TypeError(`Invalid ${J} '${q}': please rename it to '${q.toUpperCase()}'.`);throw TypeError(`Invalid ${J} '${q}': this signal name does not exist.
49
- ${x4()}`)},x4=()=>`Available signal names: ${jK()}.
50
- Available signal numbers: ${RK()}.`,jK=()=>Object.keys(W2.signals).sort().map((q)=>`'${q}'`).join(", "),RK=()=>[...new Set(Object.values(W2.signals).sort((q,J)=>q-J))].join(", "),j1=(q)=>S5[q].description;var u5=(q)=>{if(q===!1)return q;if(q===!0)return CK;if(!Number.isFinite(q)||q<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${q}\` (${typeof q})`);return q},CK=5000,m5=({kill:q,options:{forceKillAfterDelay:J,killSignal:X},onInternalError:Z,context:Q,controller:$},Y,H)=>{let{signal:K,error:G}=FK(Y,H,X);kK(G,Z);let V=q(K);return TK({kill:q,signal:K,forceKillAfterDelay:J,killSignal:X,killResult:V,context:Q,controller:$}),V},FK=(q,J,X)=>{let[Z=X,Q]=x1(q)?[void 0,q]:[q,J];if(typeof Z!=="string"&&!Number.isInteger(Z))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(Z)}`);if(Q!==void 0&&!x1(Q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${Q}`);return{signal:g5(Z),error:Q}},kK=(q,J)=>{if(q!==void 0)J.reject(q)},TK=async({kill:q,signal:J,forceKillAfterDelay:X,killSignal:Z,killResult:Q,context:$,controller:Y})=>{if(J===Z&&Q)j4({kill:q,forceKillAfterDelay:X,context:$,controllerSignal:Y.signal})},j4=async({kill:q,forceKillAfterDelay:J,context:X,controllerSignal:Z})=>{if(J===!1)return;try{if(await MK(J,void 0,{signal:Z}),q("SIGKILL"))X.isForcefullyTerminated??=!0}catch{}};import{once as wK}from"node:events";var R1=async(q,J)=>{if(!q.aborted)await wK(q,"abort",{signal:J})};var d5=({cancelSignal:q})=>{if(q!==void 0&&Object.prototype.toString.call(q)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(q)}`)},c5=({subprocess:q,cancelSignal:J,gracefulCancel:X,context:Z,controller:Q})=>J===void 0||X?[]:[PK(q,J,Z,Q)],PK=async(q,J,X,{signal:Z})=>{throw await R1(J,Z),X.terminationReason??="cancel",q.kill(),J.reason};import{scheduler as iK}from"node:timers/promises";import{promisify as lK}from"node:util";var A6=({methodName:q,isSubprocess:J,ipc:X,isConnected:Z})=>{AK(q,J,X),R4(q,J,Z)},AK=(q,J,X)=>{if(!X)throw Error(`${M0(q,J)} can only be used if the \`ipc\` option is \`true\`.`)},R4=(q,J,X)=>{if(!X)throw Error(`${M0(q,J)} cannot be used: the ${i0(J)} has already exited or disconnected.`)},l5=(q)=>{throw Error(`${M0("getOneMessage",q)} could not complete: the ${i0(q)} exited or disconnected.`)},p5=(q)=>{throw Error(`${M0("sendMessage",q)} failed: the ${i0(q)} is sending a message too, instead of listening to incoming messages.
45
+ `;var D0=({type:q,verboseMessage:J,fdNumber:X,verboseInfo:Z,result:Q})=>{let $=ZK({type:q,result:Q,verboseInfo:Z}),Y=QK(J,$),H=D5(Y,Z,X);if(H!=="")console.warn(H.slice(0,-1))},ZK=({type:q,result:J,verboseInfo:{escapedCommand:X,commandId:Z,rawOptions:{piped:Q=!1,...$}}})=>({type:q,escapedCommand:X,commandId:`${Z}`,timestamp:new Date,piped:Q,result:J,options:$}),QK=(q,J)=>q.split(`
46
+ `).map((X)=>$K({...J,message:X})),$K=(q)=>{return{verboseLine:A5(q),verboseObject:q}},G1=(q)=>{let J=typeof q==="string"?q:XK(q);return U2(J).replaceAll("\t"," ".repeat(YK))},YK=2;var I5=(q,J)=>{if(!A6(J))return;D0({type:"command",verboseMessage:q,verboseInfo:J})};var O5=(q,J,X)=>{VK(q);let Z=HK(q);return{verbose:q,escapedCommand:J,commandId:Z,rawOptions:X}},HK=(q)=>A6({verbose:q})?KK++:void 0,KK=0n,VK=(q)=>{for(let J of q){if(J===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(J===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Y1.includes(J)&&!$1(J)){let X=Y1.map((Z)=>`'${Z}'`).join(", ");throw TypeError(`The "verbose" option must not be ${J}. Allowed values are: ${X} or a function.`)}}};import{hrtime as v5}from"node:process";var W1=()=>v5.bigint(),L4=(q)=>Number(v5.bigint()-q)/1e6;var U1=(q,J,X)=>{let Z=W1(),{command:Q,escapedCommand:$}=x5(q,J),Y=G4(X,"verbose"),H=O5(Y,$,{...X});return I5($,H),{command:Q,escapedCommand:$,startTime:Z,verboseInfo:H}};var mq=D4(MV(),1);import CV from"node:path";import uq from"node:process";import L1 from"node:process";import W6 from"node:path";function z1(q={}){let{env:J=process.env,platform:X=process.platform}=q;if(X!=="win32")return"PATH";return Object.keys(J).reverse().find((Z)=>Z.toUpperCase()==="PATH")||"Path"}import{promisify as GK}from"node:util";import{execFile as WK,execFileSync as jC}from"node:child_process";import N5 from"node:path";import{fileURLToPath as UK}from"node:url";var CC=GK(WK);function _1(q){return q instanceof URL?UK(q):q}function E5(q){return{*[Symbol.iterator](){let J=N5.resolve(_1(q)),X;while(X!==J)yield J,X=J,J=N5.resolve(J,"..")}}}var zK=({cwd:q=L1.cwd(),path:J=L1.env[z1()],preferLocal:X=!0,execPath:Z=L1.execPath,addExecPath:Q=!0}={})=>{let $=W6.resolve(_1(q)),Y=[],H=J.split(W6.delimiter);if(X)_K(Y,H,$);if(Q)LK(Y,H,Z,$);return J===""||J===W6.delimiter?`${Y.join(W6.delimiter)}${J}`:[...Y,J].join(W6.delimiter)},_K=(q,J,X)=>{for(let Z of E5(X)){let Q=W6.join(Z,"node_modules/.bin");if(!J.includes(Q))q.push(Q)}},LK=(q,J,X,Z)=>{let Q=W6.resolve(Z,_1(X),"..");if(!J.includes(Q))q.push(Q)},y5=({env:q=L1.env,...J}={})=>{q={...q};let X=z1({env:q});return J.path=q[X],q[X]=zK(J),q};import{setTimeout as OK}from"node:timers/promises";var S5=(q,J,X)=>{let Z=X?x1:B1,Q=q instanceof I0?{}:{cause:q};return new Z(J,Q)};class I0 extends Error{}var h5=(q,J)=>{Object.defineProperty(q.prototype,"name",{value:J,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,g5,{value:!0,writable:!1,enumerable:!1,configurable:!1})},b5=(q)=>j1(q)&&(g5 in q),g5=Symbol("isExecaError"),j1=(q)=>Object.prototype.toString.call(q)==="[object Error]";class B1 extends Error{}h5(B1,B1.name);class x1 extends Error{}h5(x1,x1.name);import{constants as z2}from"node:os";import{constants as RK}from"node:os";var f5=()=>{let q=B4-u5+1;return Array.from({length:q},BK)},BK=(q,J)=>({name:`SIGRT${J+1}`,number:u5+J,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),u5=34,B4=64;import{constants as xK}from"node:os";var m5=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var x4=()=>{let q=f5();return[...m5,...q].map(jK)},jK=({name:q,number:J,description:X,action:Z,forced:Q=!1,standard:$})=>{let{signals:{[q]:Y}}=xK,H=Y!==void 0;return{name:q,number:H?Y:J,description:X,supported:H,action:Z,forced:Q,standard:$}};var MK=()=>{let q=x4();return Object.fromEntries(q.map(CK))},CK=({name:q,number:J,description:X,supported:Z,action:Q,forced:$,standard:Y})=>[q,{name:q,number:J,description:X,supported:Z,action:Q,forced:$,standard:Y}],d5=MK(),FK=()=>{let q=x4(),J=B4+1,X=Array.from({length:J},(Z,Q)=>kK(Q,q));return Object.assign({},...X)},kK=(q,J)=>{let X=TK(q,J);if(X===void 0)return{};let{name:Z,description:Q,supported:$,action:Y,forced:H,standard:K}=X;return{[q]:{name:Z,number:q,description:Q,supported:$,action:Y,forced:H,standard:K}}},TK=(q,J)=>{let X=J.find(({name:Z})=>RK.signals[Z]===q);if(X!==void 0)return X;return J.find((Z)=>Z.number===q)},fC=FK();var l5=(q)=>{if(q===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return n5(q,"option `killSignal`")},p5=(q)=>q===0?q:n5(q,"`subprocess.kill()`'s argument"),n5=(q,J)=>{if(Number.isInteger(q))return wK(q,J);if(typeof q==="string")return AK(q,J);throw TypeError(`Invalid ${J} ${String(q)}: it must be a string or an integer.
47
+ ${j4()}`)},wK=(q,J)=>{if(c5.has(q))return c5.get(q);throw TypeError(`Invalid ${J} ${q}: this signal integer does not exist.
48
+ ${j4()}`)},PK=()=>new Map(Object.entries(z2.signals).reverse().map(([q,J])=>[J,q])),c5=PK(),AK=(q,J)=>{if(q in z2.signals)return q;if(q.toUpperCase()in z2.signals)throw TypeError(`Invalid ${J} '${q}': please rename it to '${q.toUpperCase()}'.`);throw TypeError(`Invalid ${J} '${q}': this signal name does not exist.
49
+ ${j4()}`)},j4=()=>`Available signal names: ${DK()}.
50
+ Available signal numbers: ${IK()}.`,DK=()=>Object.keys(z2.signals).sort().map((q)=>`'${q}'`).join(", "),IK=()=>[...new Set(Object.values(z2.signals).sort((q,J)=>q-J))].join(", "),R1=(q)=>d5[q].description;var i5=(q)=>{if(q===!1)return q;if(q===!0)return vK;if(!Number.isFinite(q)||q<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${q}\` (${typeof q})`);return q},vK=5000,a5=({kill:q,options:{forceKillAfterDelay:J,killSignal:X},onInternalError:Z,context:Q,controller:$},Y,H)=>{let{signal:K,error:G}=NK(Y,H,X);EK(G,Z);let V=q(K);return yK({kill:q,signal:K,forceKillAfterDelay:J,killSignal:X,killResult:V,context:Q,controller:$}),V},NK=(q,J,X)=>{let[Z=X,Q]=j1(q)?[void 0,q]:[q,J];if(typeof Z!=="string"&&!Number.isInteger(Z))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(Z)}`);if(Q!==void 0&&!j1(Q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${Q}`);return{signal:p5(Z),error:Q}},EK=(q,J)=>{if(q!==void 0)J.reject(q)},yK=async({kill:q,signal:J,forceKillAfterDelay:X,killSignal:Z,killResult:Q,context:$,controller:Y})=>{if(J===Z&&Q)R4({kill:q,forceKillAfterDelay:X,context:$,controllerSignal:Y.signal})},R4=async({kill:q,forceKillAfterDelay:J,context:X,controllerSignal:Z})=>{if(J===!1)return;try{if(await OK(J,void 0,{signal:Z}),q("SIGKILL"))X.isForcefullyTerminated??=!0}catch{}};import{once as SK}from"node:events";var M1=async(q,J)=>{if(!q.aborted)await SK(q,"abort",{signal:J})};var o5=({cancelSignal:q})=>{if(q!==void 0&&Object.prototype.toString.call(q)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(q)}`)},r5=({subprocess:q,cancelSignal:J,gracefulCancel:X,context:Z,controller:Q})=>J===void 0||X?[]:[hK(q,J,Z,Q)],hK=async(q,J,X,{signal:Z})=>{throw await M1(J,Z),X.terminationReason??="cancel",q.kill(),J.reason};import{scheduler as ZV}from"node:timers/promises";import{promisify as qV}from"node:util";var I6=({methodName:q,isSubprocess:J,ipc:X,isConnected:Z})=>{bK(q,J,X),M4(q,J,Z)},bK=(q,J,X)=>{if(!X)throw Error(`${M0(q,J)} can only be used if the \`ipc\` option is \`true\`.`)},M4=(q,J,X)=>{if(!X)throw Error(`${M0(q,J)} cannot be used: the ${i0(J)} has already exited or disconnected.`)},s5=(q)=>{throw Error(`${M0("getOneMessage",q)} could not complete: the ${i0(q)} exited or disconnected.`)},t5=(q)=>{throw Error(`${M0("sendMessage",q)} failed: the ${i0(q)} is sending a message too, instead of listening to incoming messages.
51
51
  This can be fixed by both sending a message and listening to incoming messages at the same time:
52
52
 
53
53
  const [receivedMessage] = await Promise.all([
54
54
  ${M0("getOneMessage",q)},
55
55
  ${M0("sendMessage",q,"message, {strict: true}")},
56
- ]);`)},M1=(q,J)=>Error(`${M0("sendMessage",J)} failed when sending an acknowledgment response to the ${i0(J)}.`,{cause:q}),n5=(q)=>{throw Error(`${M0("sendMessage",q)} failed: the ${i0(q)} is not listening to incoming messages.`)},i5=(q)=>{throw Error(`${M0("sendMessage",q)} failed: the ${i0(q)} exited without listening to incoming messages.`)},a5=()=>Error(`\`cancelSignal\` aborted: the ${i0(!0)} disconnected.`),o5=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},r5=({error:q,methodName:J,isSubprocess:X})=>{if(q.code==="EPIPE")throw Error(`${M0(J,X)} cannot be used: the ${i0(X)} is disconnecting.`,{cause:q})},s5=({error:q,methodName:J,isSubprocess:X,message:Z})=>{if(DK(q))throw Error(`${M0(J,X)}'s argument type is invalid: the message cannot be serialized: ${String(Z)}.`,{cause:q})},DK=({code:q,message:J})=>IK.has(q)||OK.some((X)=>J.includes(X)),IK=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),OK=["could not be cloned","circular structure","call stack size exceeded"],M0=(q,J,X="")=>q==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${vK(J)}${q}(${X})`,vK=(q)=>q?"":"subprocess.",i0=(q)=>q?"parent process":"subprocess",D6=(q)=>{if(q.connected)q.disconnect()};var O0=()=>{let q={},J=new Promise((X,Z)=>{Object.assign(q,{resolve:X,reject:Z})});return Object.assign(J,q)};var F1=(q,J="stdin")=>{let{options:Z,fileDescriptors:Q}=v0.get(q),$=t5(Q,J,!0),Y=q.stdio[$];if(Y===null)throw TypeError(e5($,J,Z,!0));return Y},I6=(q,J="stdout")=>{let{options:Z,fileDescriptors:Q}=v0.get(q),$=t5(Q,J,!1),Y=$==="all"?q.all:q.stdio[$];if(Y===null||Y===void 0)throw TypeError(e5($,J,Z,!1));return Y},v0=new WeakMap,t5=(q,J,X)=>{let Z=NK(J,X);return EK(Z,J,X,q),Z},NK=(q,J)=>{let X=G4(q);if(X!==void 0)return X;let{validOptions:Z,defaultValue:Q}=J?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${U2(J)}" must not be "${q}".
56
+ ]);`)},C1=(q,J)=>Error(`${M0("sendMessage",J)} failed when sending an acknowledgment response to the ${i0(J)}.`,{cause:q}),e5=(q)=>{throw Error(`${M0("sendMessage",q)} failed: the ${i0(q)} is not listening to incoming messages.`)},qq=(q)=>{throw Error(`${M0("sendMessage",q)} failed: the ${i0(q)} exited without listening to incoming messages.`)},Jq=()=>Error(`\`cancelSignal\` aborted: the ${i0(!0)} disconnected.`),Xq=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Zq=({error:q,methodName:J,isSubprocess:X})=>{if(q.code==="EPIPE")throw Error(`${M0(J,X)} cannot be used: the ${i0(X)} is disconnecting.`,{cause:q})},Qq=({error:q,methodName:J,isSubprocess:X,message:Z})=>{if(gK(q))throw Error(`${M0(J,X)}'s argument type is invalid: the message cannot be serialized: ${String(Z)}.`,{cause:q})},gK=({code:q,message:J})=>fK.has(q)||uK.some((X)=>J.includes(X)),fK=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),uK=["could not be cloned","circular structure","call stack size exceeded"],M0=(q,J,X="")=>q==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${mK(J)}${q}(${X})`,mK=(q)=>q?"":"subprocess.",i0=(q)=>q?"parent process":"subprocess",O6=(q)=>{if(q.connected)q.disconnect()};var O0=()=>{let q={},J=new Promise((X,Z)=>{Object.assign(q,{resolve:X,reject:Z})});return Object.assign(J,q)};var k1=(q,J="stdin")=>{let{options:Z,fileDescriptors:Q}=v0.get(q),$=$q(Q,J,!0),Y=q.stdio[$];if(Y===null)throw TypeError(Yq($,J,Z,!0));return Y},v6=(q,J="stdout")=>{let{options:Z,fileDescriptors:Q}=v0.get(q),$=$q(Q,J,!1),Y=$==="all"?q.all:q.stdio[$];if(Y===null||Y===void 0)throw TypeError(Yq($,J,Z,!1));return Y},v0=new WeakMap,$q=(q,J,X)=>{let Z=dK(J,X);return cK(Z,J,X,q),Z},dK=(q,J)=>{let X=W4(q);if(X!==void 0)return X;let{validOptions:Z,defaultValue:Q}=J?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${_2(J)}" must not be "${q}".
57
57
  It must be ${Z} or "fd3", "fd4" (and so on).
58
- It is optional and defaults to "${Q}".`)},EK=(q,J,X,Z)=>{let Q=Z[qq(q)];if(Q===void 0)throw TypeError(`"${U2(X)}" must not be ${J}. That file descriptor does not exist.
59
- Please set the "stdio" option to ensure that file descriptor exists.`);if(Q.direction==="input"&&!X)throw TypeError(`"${U2(X)}" must not be ${J}. It must be a readable stream, not writable.`);if(Q.direction!=="input"&&X)throw TypeError(`"${U2(X)}" must not be ${J}. It must be a writable stream, not readable.`)},e5=(q,J,X,Z)=>{if(q==="all"&&!X.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:Q,optionValue:$}=yK(q,X);return`The "${Q}: ${C1($)}" option is incompatible with using "${U2(Z)}: ${C1(J)}".
60
- Please set this option with "pipe" instead.`},yK=(q,{stdin:J,stdout:X,stderr:Z,stdio:Q})=>{let $=qq(q);if($===0&&J!==void 0)return{optionName:"stdin",optionValue:J};if($===1&&X!==void 0)return{optionName:"stdout",optionValue:X};if($===2&&Z!==void 0)return{optionName:"stderr",optionValue:Z};return{optionName:`stdio[${$}]`,optionValue:Q[$]}},qq=(q)=>q==="all"?1:q,U2=(q)=>q?"to":"from",C1=(q)=>{if(typeof q==="string")return`'${q}'`;return typeof q==="number"?`${q}`:"Stream"};import{once as uK}from"node:events";import{addAbortListener as SK}from"node:events";var G6=(q,J,X)=>{let Z=q.getMaxListeners();if(Z===0||Z===Number.POSITIVE_INFINITY)return;q.setMaxListeners(Z+J),SK(X,()=>{q.setMaxListeners(q.getMaxListeners()-J)})};import{EventEmitter as gK}from"node:events";import{once as hK}from"node:events";import{scheduler as bK}from"node:timers/promises";var k1=(q,J)=>{if(J)M4(q)},M4=(q)=>{q.refCounted()},T1=(q,J)=>{if(J)C4(q)},C4=(q)=>{q.unrefCounted()},Jq=(q,J)=>{if(J)C4(q),C4(q)},Xq=(q,J)=>{if(J)M4(q),M4(q)};var Zq=async({anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z},Q)=>{if(Yq(Q)||Kq(Q))return;if(!w1.has(q))w1.set(q,[]);let $=w1.get(q);if($.push(Q),$.length>1)return;while($.length>0){await Hq(q,Z,Q),await bK.yield();let Y=await $q({wrappedMessage:$[0],anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z});$.shift(),Z.emit("message",Y),Z.emit("message:done")}},Qq=async({anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z,boundOnMessage:Q})=>{F4();let $=w1.get(q);while($?.length>0)await hK(Z,"message:done");q.removeListener("message",Q),Xq(J,X),Z.connected=!1,Z.emit("disconnect")},w1=new WeakMap;var a0=(q,J,X)=>{if(P1.has(q))return P1.get(q);let Z=new gK;return Z.connected=!0,P1.set(q,Z),fK({ipcEmitter:Z,anyProcess:q,channel:J,isSubprocess:X}),Z},P1=new WeakMap,fK=({ipcEmitter:q,anyProcess:J,channel:X,isSubprocess:Z})=>{let Q=Zq.bind(void 0,{anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:q});J.on("message",Q),J.once("disconnect",Qq.bind(void 0,{anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:q,boundOnMessage:Q})),Jq(X,Z)},A1=(q)=>{let J=P1.get(q);return J===void 0?q.channel!==null:J.connected};var Vq=({anyProcess:q,channel:J,isSubprocess:X,message:Z,strict:Q})=>{if(!Q)return Z;let $=a0(q,J,X),Y=O1(q,$);return{id:mK++,type:I1,message:Z,hasListeners:Y}},mK=0n,Gq=(q,J)=>{if(J?.type!==I1||J.hasListeners)return;for(let{id:X}of q)if(X!==void 0)D1[X].resolve({isDeadlock:!0,hasListeners:!1})},$q=async({wrappedMessage:q,anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:Q})=>{if(q?.type!==I1||!J.connected)return q;let{id:$,message:Y}=q,H={id:$,type:Uq,message:O1(J,Q)};try{await v1({anyProcess:J,channel:X,isSubprocess:Z,ipc:!0},H)}catch(K){Q.emit("strict:error",K)}return Y},Yq=(q)=>{if(q?.type!==Uq)return!1;let{id:J,message:X}=q;return D1[J]?.resolve({isDeadlock:!1,hasListeners:X}),!0},Wq=async(q,J,X)=>{if(q?.type!==I1)return;let Z=O0();D1[q.id]=Z;let Q=new AbortController;try{let{isDeadlock:$,hasListeners:Y}=await Promise.race([Z,dK(J,X,Q)]);if($)p5(X);if(!Y)n5(X)}finally{Q.abort(),delete D1[q.id]}},D1={},dK=async(q,J,{signal:X})=>{G6(q,1,X),await uK(q,"disconnect",{signal:X}),i5(J)},I1="execa:ipc:request",Uq="execa:ipc:response";var zq=(q,J,X)=>{if(!z2.has(q))z2.set(q,new Set);let Z=z2.get(q),Q=O0(),$=X?J.id:void 0,Y={onMessageSent:Q,id:$};return Z.add(Y),{outgoingMessages:Z,outgoingMessage:Y}},_q=({outgoingMessages:q,outgoingMessage:J})=>{q.delete(J),J.onMessageSent.resolve()},Hq=async(q,J,X)=>{while(!O1(q,J)&&z2.get(q)?.size>0){let Z=[...z2.get(q)];Gq(Z,X),await Promise.all(Z.map(({onMessageSent:Q})=>Q))}},z2=new WeakMap,O1=(q,J)=>J.listenerCount("message")>cK(q),cK=(q)=>v0.has(q)&&!g0(v0.get(q).options.buffer,"ipc")?1:0;var v1=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z},Q,{strict:$=!1}={})=>{return A6({methodName:"sendMessage",isSubprocess:X,ipc:Z,isConnected:q.connected}),pK({anyProcess:q,channel:J,methodName:"sendMessage",isSubprocess:X,message:Q,strict:$})},pK=async({anyProcess:q,channel:J,methodName:X,isSubprocess:Z,message:Q,strict:$})=>{let Y=Vq({anyProcess:q,channel:J,isSubprocess:Z,message:Q,strict:$}),H=zq(q,Y,$);try{await T4({anyProcess:q,methodName:X,isSubprocess:Z,wrappedMessage:Y,message:Q})}catch(K){throw D6(q),K}finally{_q(H)}},T4=async({anyProcess:q,methodName:J,isSubprocess:X,wrappedMessage:Z,message:Q})=>{let $=nK(q);try{await Promise.all([Wq(Z,q,X),$(Z)])}catch(Y){throw r5({error:Y,methodName:J,isSubprocess:X}),s5({error:Y,methodName:J,isSubprocess:X,message:Q}),Y}},nK=(q)=>{if(k4.has(q))return k4.get(q);let J=lK(q.send.bind(q));return k4.set(q,J),J},k4=new WeakMap;var Bq=(q,J)=>{return R4("cancelSignal",!1,q.connected),T4({anyProcess:q,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:jq,message:J},message:J})},xq=async({anyProcess:q,channel:J,isSubprocess:X,ipc:Z})=>{return await aK({anyProcess:q,channel:J,isSubprocess:X,ipc:Z}),w4.signal},aK=async({anyProcess:q,channel:J,isSubprocess:X,ipc:Z})=>{if(Lq)return;if(Lq=!0,!Z){o5();return}if(J===null){F4();return}a0(q,J,X),await iK.yield()},Lq=!1,Kq=(q)=>{if(q?.type!==jq)return!1;return w4.abort(q.message),!0},jq="execa:ipc:cancel",F4=()=>{w4.abort(a5())},w4=new AbortController;var Rq=({gracefulCancel:q,cancelSignal:J,ipc:X,serialization:Z})=>{if(!q)return;if(J===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!X)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(Z==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},Mq=({subprocess:q,cancelSignal:J,gracefulCancel:X,forceKillAfterDelay:Z,context:Q,controller:$})=>X?[oK({subprocess:q,cancelSignal:J,forceKillAfterDelay:Z,context:Q,controller:$})]:[],oK=async({subprocess:q,cancelSignal:J,forceKillAfterDelay:X,context:Z,controller:{signal:Q}})=>{await R1(J,Q);let $=rK(J);throw await Bq(q,$),j4({kill:q.kill,forceKillAfterDelay:X,context:Z,controllerSignal:Q}),Z.terminationReason??="gracefulCancel",J.reason},rK=({reason:q})=>{if(!(q instanceof DOMException))return q;let J=Error(q.message);return Object.defineProperty(J,"stack",{value:q.stack,enumerable:!1,configurable:!0,writable:!0}),J};import{setTimeout as sK}from"node:timers/promises";var Cq=({timeout:q})=>{if(q!==void 0&&(!Number.isFinite(q)||q<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${q}\` (${typeof q})`)},Fq=(q,J,X,Z)=>J===0||J===void 0?[]:[tK(q,J,X,Z)],tK=async(q,J,X,{signal:Z})=>{throw await sK(J,void 0,{signal:Z}),X.terminationReason??="timeout",q.kill(),new I0};import{execPath as eK,execArgv as qV}from"node:process";import kq from"node:path";var Tq=({options:q})=>{if(q.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...q,node:!0}}},wq=(q,J,{node:X=!1,nodePath:Z=eK,nodeOptions:Q=qV.filter((K)=>!K.startsWith("--inspect")),cwd:$,execPath:Y,...H})=>{if(Y!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let K=T6(Z,'The "nodePath" option'),G=kq.resolve($,K),V={...H,nodePath:G,node:X,cwd:$};if(!X)return[q,J,V];if(kq.basename(q,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[G,[...Q,q,...J],{ipc:!0,...V,shell:!1}]};import{serialize as JV}from"node:v8";var Pq=({ipcInput:q,ipc:J,serialization:X})=>{if(q===void 0)return;if(!J)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");QV[X](q)},XV=(q)=>{try{JV(q)}catch(J){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:J})}},ZV=(q)=>{try{JSON.stringify(q)}catch(J){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:J})}},QV={advanced:XV,json:ZV},Aq=async(q,J)=>{if(J===void 0)return;await q.sendMessage(J)};var Iq=({encoding:q})=>{if(P4.has(q))return;let J=YV(q);if(J!==void 0)throw TypeError(`Invalid option \`encoding: ${N1(q)}\`.
61
- Please rename it to ${N1(J)}.`);let X=[...P4].map((Z)=>N1(Z)).join(", ");throw TypeError(`Invalid option \`encoding: ${N1(q)}\`.
62
- Please rename it to one of: ${X}.`)},$V=new Set(["utf8","utf16le"]),V0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),P4=new Set([...$V,...V0]),YV=(q)=>{if(q===null)return"buffer";if(typeof q!=="string")return;let J=q.toLowerCase();if(J in Dq)return Dq[J];if(P4.has(J))return J},Dq={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},N1=(q)=>typeof q==="string"?`"${q}"`:String(q);import{statSync as HV}from"node:fs";import KV from"node:path";import VV from"node:process";var Oq=(q=vq())=>{let J=T6(q,'The "cwd" option');return KV.resolve(J)},vq=()=>{try{return VV.cwd()}catch(q){throw q.message=`The current directory does not exist.
63
- ${q.message}`,q}},Nq=(q,J)=>{if(J===vq())return q;let X;try{X=HV(J)}catch(Z){return`The "cwd" option is invalid: ${J}.
58
+ It is optional and defaults to "${Q}".`)},cK=(q,J,X,Z)=>{let Q=Z[Hq(q)];if(Q===void 0)throw TypeError(`"${_2(X)}" must not be ${J}. That file descriptor does not exist.
59
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(Q.direction==="input"&&!X)throw TypeError(`"${_2(X)}" must not be ${J}. It must be a readable stream, not writable.`);if(Q.direction!=="input"&&X)throw TypeError(`"${_2(X)}" must not be ${J}. It must be a writable stream, not readable.`)},Yq=(q,J,X,Z)=>{if(q==="all"&&!X.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:Q,optionValue:$}=lK(q,X);return`The "${Q}: ${F1($)}" option is incompatible with using "${_2(Z)}: ${F1(J)}".
60
+ Please set this option with "pipe" instead.`},lK=(q,{stdin:J,stdout:X,stderr:Z,stdio:Q})=>{let $=Hq(q);if($===0&&J!==void 0)return{optionName:"stdin",optionValue:J};if($===1&&X!==void 0)return{optionName:"stdout",optionValue:X};if($===2&&Z!==void 0)return{optionName:"stderr",optionValue:Z};return{optionName:`stdio[${$}]`,optionValue:Q[$]}},Hq=(q)=>q==="all"?1:q,_2=(q)=>q?"to":"from",F1=(q)=>{if(typeof q==="string")return`'${q}'`;return typeof q==="number"?`${q}`:"Stream"};import{once as rK}from"node:events";import{addAbortListener as pK}from"node:events";var U6=(q,J,X)=>{let Z=q.getMaxListeners();if(Z===0||Z===Number.POSITIVE_INFINITY)return;q.setMaxListeners(Z+J),pK(X,()=>{q.setMaxListeners(q.getMaxListeners()-J)})};import{EventEmitter as aK}from"node:events";import{once as nK}from"node:events";import{scheduler as iK}from"node:timers/promises";var T1=(q,J)=>{if(J)C4(q)},C4=(q)=>{q.refCounted()},w1=(q,J)=>{if(J)F4(q)},F4=(q)=>{q.unrefCounted()},Kq=(q,J)=>{if(J)F4(q),F4(q)},Vq=(q,J)=>{if(J)C4(q),C4(q)};var Gq=async({anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z},Q)=>{if(zq(Q)||Lq(Q))return;if(!P1.has(q))P1.set(q,[]);let $=P1.get(q);if($.push(Q),$.length>1)return;while($.length>0){await _q(q,Z,Q),await iK.yield();let Y=await Uq({wrappedMessage:$[0],anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z});$.shift(),Z.emit("message",Y),Z.emit("message:done")}},Wq=async({anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z,boundOnMessage:Q})=>{k4();let $=P1.get(q);while($?.length>0)await nK(Z,"message:done");q.removeListener("message",Q),Vq(J,X),Z.connected=!1,Z.emit("disconnect")},P1=new WeakMap;var a0=(q,J,X)=>{if(A1.has(q))return A1.get(q);let Z=new aK;return Z.connected=!0,A1.set(q,Z),oK({ipcEmitter:Z,anyProcess:q,channel:J,isSubprocess:X}),Z},A1=new WeakMap,oK=({ipcEmitter:q,anyProcess:J,channel:X,isSubprocess:Z})=>{let Q=Gq.bind(void 0,{anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:q});J.on("message",Q),J.once("disconnect",Wq.bind(void 0,{anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:q,boundOnMessage:Q})),Kq(X,Z)},D1=(q)=>{let J=A1.get(q);return J===void 0?q.channel!==null:J.connected};var Bq=({anyProcess:q,channel:J,isSubprocess:X,message:Z,strict:Q})=>{if(!Q)return Z;let $=a0(q,J,X),Y=v1(q,$);return{id:sK++,type:O1,message:Z,hasListeners:Y}},sK=0n,xq=(q,J)=>{if(J?.type!==O1||J.hasListeners)return;for(let{id:X}of q)if(X!==void 0)I1[X].resolve({isDeadlock:!0,hasListeners:!1})},Uq=async({wrappedMessage:q,anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:Q})=>{if(q?.type!==O1||!J.connected)return q;let{id:$,message:Y}=q,H={id:$,type:Rq,message:v1(J,Q)};try{await N1({anyProcess:J,channel:X,isSubprocess:Z,ipc:!0},H)}catch(K){Q.emit("strict:error",K)}return Y},zq=(q)=>{if(q?.type!==Rq)return!1;let{id:J,message:X}=q;return I1[J]?.resolve({isDeadlock:!1,hasListeners:X}),!0},jq=async(q,J,X)=>{if(q?.type!==O1)return;let Z=O0();I1[q.id]=Z;let Q=new AbortController;try{let{isDeadlock:$,hasListeners:Y}=await Promise.race([Z,tK(J,X,Q)]);if($)t5(X);if(!Y)e5(X)}finally{Q.abort(),delete I1[q.id]}},I1={},tK=async(q,J,{signal:X})=>{U6(q,1,X),await rK(q,"disconnect",{signal:X}),qq(J)},O1="execa:ipc:request",Rq="execa:ipc:response";var Mq=(q,J,X)=>{if(!L2.has(q))L2.set(q,new Set);let Z=L2.get(q),Q=O0(),$=X?J.id:void 0,Y={onMessageSent:Q,id:$};return Z.add(Y),{outgoingMessages:Z,outgoingMessage:Y}},Cq=({outgoingMessages:q,outgoingMessage:J})=>{q.delete(J),J.onMessageSent.resolve()},_q=async(q,J,X)=>{while(!v1(q,J)&&L2.get(q)?.size>0){let Z=[...L2.get(q)];xq(Z,X),await Promise.all(Z.map(({onMessageSent:Q})=>Q))}},L2=new WeakMap,v1=(q,J)=>J.listenerCount("message")>eK(q),eK=(q)=>v0.has(q)&&!g0(v0.get(q).options.buffer,"ipc")?1:0;var N1=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z},Q,{strict:$=!1}={})=>{return I6({methodName:"sendMessage",isSubprocess:X,ipc:Z,isConnected:q.connected}),JV({anyProcess:q,channel:J,methodName:"sendMessage",isSubprocess:X,message:Q,strict:$})},JV=async({anyProcess:q,channel:J,methodName:X,isSubprocess:Z,message:Q,strict:$})=>{let Y=Bq({anyProcess:q,channel:J,isSubprocess:Z,message:Q,strict:$}),H=Mq(q,Y,$);try{await w4({anyProcess:q,methodName:X,isSubprocess:Z,wrappedMessage:Y,message:Q})}catch(K){throw O6(q),K}finally{Cq(H)}},w4=async({anyProcess:q,methodName:J,isSubprocess:X,wrappedMessage:Z,message:Q})=>{let $=XV(q);try{await Promise.all([jq(Z,q,X),$(Z)])}catch(Y){throw Zq({error:Y,methodName:J,isSubprocess:X}),Qq({error:Y,methodName:J,isSubprocess:X,message:Q}),Y}},XV=(q)=>{if(T4.has(q))return T4.get(q);let J=qV(q.send.bind(q));return T4.set(q,J),J},T4=new WeakMap;var kq=(q,J)=>{return M4("cancelSignal",!1,q.connected),w4({anyProcess:q,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:wq,message:J},message:J})},Tq=async({anyProcess:q,channel:J,isSubprocess:X,ipc:Z})=>{return await QV({anyProcess:q,channel:J,isSubprocess:X,ipc:Z}),P4.signal},QV=async({anyProcess:q,channel:J,isSubprocess:X,ipc:Z})=>{if(Fq)return;if(Fq=!0,!Z){Xq();return}if(J===null){k4();return}a0(q,J,X),await ZV.yield()},Fq=!1,Lq=(q)=>{if(q?.type!==wq)return!1;return P4.abort(q.message),!0},wq="execa:ipc:cancel",k4=()=>{P4.abort(Jq())},P4=new AbortController;var Pq=({gracefulCancel:q,cancelSignal:J,ipc:X,serialization:Z})=>{if(!q)return;if(J===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!X)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(Z==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},Aq=({subprocess:q,cancelSignal:J,gracefulCancel:X,forceKillAfterDelay:Z,context:Q,controller:$})=>X?[$V({subprocess:q,cancelSignal:J,forceKillAfterDelay:Z,context:Q,controller:$})]:[],$V=async({subprocess:q,cancelSignal:J,forceKillAfterDelay:X,context:Z,controller:{signal:Q}})=>{await M1(J,Q);let $=YV(J);throw await kq(q,$),R4({kill:q.kill,forceKillAfterDelay:X,context:Z,controllerSignal:Q}),Z.terminationReason??="gracefulCancel",J.reason},YV=({reason:q})=>{if(!(q instanceof DOMException))return q;let J=Error(q.message);return Object.defineProperty(J,"stack",{value:q.stack,enumerable:!1,configurable:!0,writable:!0}),J};import{setTimeout as HV}from"node:timers/promises";var Dq=({timeout:q})=>{if(q!==void 0&&(!Number.isFinite(q)||q<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${q}\` (${typeof q})`)},Iq=(q,J,X,Z)=>J===0||J===void 0?[]:[KV(q,J,X,Z)],KV=async(q,J,X,{signal:Z})=>{throw await HV(J,void 0,{signal:Z}),X.terminationReason??="timeout",q.kill(),new I0};import{execPath as VV,execArgv as GV}from"node:process";import Oq from"node:path";var vq=({options:q})=>{if(q.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...q,node:!0}}},Nq=(q,J,{node:X=!1,nodePath:Z=VV,nodeOptions:Q=GV.filter((K)=>!K.startsWith("--inspect")),cwd:$,execPath:Y,...H})=>{if(Y!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let K=P6(Z,'The "nodePath" option'),G=Oq.resolve($,K),V={...H,nodePath:G,node:X,cwd:$};if(!X)return[q,J,V];if(Oq.basename(q,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[G,[...Q,q,...J],{ipc:!0,...V,shell:!1}]};import{serialize as WV}from"node:v8";var Eq=({ipcInput:q,ipc:J,serialization:X})=>{if(q===void 0)return;if(!J)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");_V[X](q)},UV=(q)=>{try{WV(q)}catch(J){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:J})}},zV=(q)=>{try{JSON.stringify(q)}catch(J){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:J})}},_V={advanced:UV,json:zV},yq=async(q,J)=>{if(J===void 0)return;await q.sendMessage(J)};var hq=({encoding:q})=>{if(A4.has(q))return;let J=BV(q);if(J!==void 0)throw TypeError(`Invalid option \`encoding: ${E1(q)}\`.
61
+ Please rename it to ${E1(J)}.`);let X=[...A4].map((Z)=>E1(Z)).join(", ");throw TypeError(`Invalid option \`encoding: ${E1(q)}\`.
62
+ Please rename it to one of: ${X}.`)},LV=new Set(["utf8","utf16le"]),V0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),A4=new Set([...LV,...V0]),BV=(q)=>{if(q===null)return"buffer";if(typeof q!=="string")return;let J=q.toLowerCase();if(J in Sq)return Sq[J];if(A4.has(J))return J},Sq={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},E1=(q)=>typeof q==="string"?`"${q}"`:String(q);import{statSync as xV}from"node:fs";import jV from"node:path";import RV from"node:process";var bq=(q=gq())=>{let J=P6(q,'The "cwd" option');return jV.resolve(J)},gq=()=>{try{return RV.cwd()}catch(q){throw q.message=`The current directory does not exist.
63
+ ${q.message}`,q}},fq=(q,J)=>{if(J===gq())return q;let X;try{X=xV(J)}catch(Z){return`The "cwd" option is invalid: ${J}.
64
64
  ${Z.message}
65
65
  ${q}`}if(!X.isDirectory())return`The "cwd" option is not a directory: ${J}.
66
- ${q}`;return q};var E1=(q,J,X)=>{X.cwd=Oq(X.cwd);let[Z,Q,$]=wq(q,J,X),{command:Y,args:H,options:K}=Sq.default._parse(Z,Q,$),G=K5(K),V=UV(G);if(Cq(V),Iq(V),Pq(V),d5(V),Rq(V),V.shell=Y4(V.shell),V.env=zV(V),V.killSignal=b5(V.killSignal),V.forceKillAfterDelay=u5(V.forceKillAfterDelay),V.lines=V.lines.map((W,U)=>W&&!V0.has(V.encoding)&&V.buffer[U]),yq.platform==="win32"&&WV.basename(Y,".exe")==="cmd")H.unshift("/q");return{file:Y,commandArguments:H,options:V}},UV=({extendEnv:q=!0,preferLocal:J=!1,cwd:X,localDir:Z=X,encoding:Q="utf8",reject:$=!0,cleanup:Y=!0,all:H=!1,windowsHide:K=!0,killSignal:G="SIGTERM",forceKillAfterDelay:V=!0,gracefulCancel:W=!1,ipcInput:U,ipc:z=U!==void 0||W,serialization:_="advanced",...L})=>({...L,extendEnv:q,preferLocal:J,cwd:X,localDirectory:Z,encoding:Q,reject:$,cleanup:Y,all:H,windowsHide:K,killSignal:G,forceKillAfterDelay:V,gracefulCancel:W,ipcInput:U,ipc:z,serialization:_}),zV=({env:q,extendEnv:J,preferLocal:X,node:Z,localDirectory:Q,nodePath:$})=>{let Y=J?{...yq.env,...q}:q;if(X||Z)return A5({env:Y,cwd:Q,execPath:$,preferLocal:X,addExecPath:Z});return Y};var y1=(q,J,X)=>X.shell&&J.length>0?[[q,...J].join(" "),[],X]:[q,J,X];import{inspect as iV}from"node:util";function O6(q){if(typeof q==="string")return _V(q);if(!(ArrayBuffer.isView(q)&&q.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return LV(q)}var _V=(q)=>q.at(-1)===hq?q.slice(0,q.at(-2)===bq?-2:-1):q,LV=(q)=>q.at(-1)===BV?q.subarray(0,q.at(-2)===xV?-2:-1):q,hq=`
67
- `,BV=hq.codePointAt(0),bq="\r",xV=bq.codePointAt(0);import{on as cV}from"node:events";import{finished as lV}from"node:stream/promises";function C0(q,{checkOpen:J=!0}={}){return q!==null&&typeof q==="object"&&(q.writable||q.readable||!J||q.writable===void 0&&q.readable===void 0)&&typeof q.pipe==="function"}function A4(q,{checkOpen:J=!0}={}){return C0(q,{checkOpen:J})&&(q.writable||!J)&&typeof q.write==="function"&&typeof q.end==="function"&&typeof q.writable==="boolean"&&typeof q.writableObjectMode==="boolean"&&typeof q.destroy==="function"&&typeof q.destroyed==="boolean"}function W6(q,{checkOpen:J=!0}={}){return C0(q,{checkOpen:J})&&(q.readable||!J)&&typeof q.read==="function"&&typeof q.readable==="boolean"&&typeof q.readableObjectMode==="boolean"&&typeof q.destroy==="function"&&typeof q.destroyed==="boolean"}function D4(q,J){return A4(q,J)&&W6(q,J)}var jV=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class gq{#q;#X;#J=!1;#Z=void 0;constructor(q,J){this.#q=q,this.#X=J}next(){let q=()=>this.#$();return this.#Z=this.#Z?this.#Z.then(q,q):q(),this.#Z}return(q){let J=()=>this.#V(q);return this.#Z?this.#Z.then(J,J):J()}async#$(){if(this.#J)return{done:!0,value:void 0};let q;try{q=await this.#q.read()}catch(J){throw this.#Z=void 0,this.#J=!0,this.#q.releaseLock(),J}return q.done&&(this.#Z=void 0,this.#J=!0,this.#q.releaseLock()),q}async#V(q){if(this.#J)return{done:!0,value:q};if(this.#J=!0,!this.#X){let J=this.#q.cancel(q);return this.#q.releaseLock(),await J,{done:!0,value:q}}return this.#q.releaseLock(),{done:!0,value:q}}}var I4=Symbol();function fq(){return this[I4].next()}Object.defineProperty(fq,"name",{value:"next"});function uq(q){return this[I4].return(q)}Object.defineProperty(uq,"name",{value:"return"});var RV=Object.create(jV,{next:{enumerable:!0,configurable:!0,writable:!0,value:fq},return:{enumerable:!0,configurable:!0,writable:!0,value:uq}});function O4({preventCancel:q=!1}={}){let J=this.getReader(),X=new gq(J,q),Z=Object.create(RV);return Z[I4]=X,Z}var mq=(q)=>{if(W6(q,{checkOpen:!1})&&_2.on!==void 0)return CV(q);if(typeof q?.[Symbol.asyncIterator]==="function")return q;if(MV.call(q)==="[object ReadableStream]")return O4.call(q);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:MV}=Object.prototype,CV=async function*(q){let J=new AbortController,X={};FV(q,J,X);try{for await(let[Z]of _2.on(q,"data",{signal:J.signal}))yield Z}catch(Z){if(X.error!==void 0)throw X.error;else if(!J.signal.aborted)throw Z}finally{q.destroy()}},FV=async(q,J,X)=>{try{await _2.finished(q,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(Z){X.error=Z}finally{J.abort()}},_2={};var v6=async(q,{init:J,convertChunk:X,getSize:Z,truncateChunk:Q,addChunk:$,getFinalChunk:Y,finalize:H},{maxBuffer:K=Number.POSITIVE_INFINITY}={})=>{let G=mq(q),V=J();V.length=0;try{for await(let W of G){let U=TV(W),z=X[U](W,V);lq({convertedChunk:z,state:V,getSize:Z,truncateChunk:Q,addChunk:$,maxBuffer:K})}return kV({state:V,convertChunk:X,getSize:Z,truncateChunk:Q,addChunk:$,getFinalChunk:Y,maxBuffer:K}),H(V)}catch(W){let U=typeof W==="object"&&W!==null?W:Error(W);throw U.bufferedData=H(V),U}},kV=({state:q,getSize:J,truncateChunk:X,addChunk:Z,getFinalChunk:Q,maxBuffer:$})=>{let Y=Q(q);if(Y!==void 0)lq({convertedChunk:Y,state:q,getSize:J,truncateChunk:X,addChunk:Z,maxBuffer:$})},lq=({convertedChunk:q,state:J,getSize:X,truncateChunk:Z,addChunk:Q,maxBuffer:$})=>{let Y=X(q),H=J.length+Y;if(H<=$){dq(q,J,Q,H);return}let K=Z(q,$-J.length);if(K!==void 0)dq(K,J,Q,$);throw new f0},dq=(q,J,X,Z)=>{J.contents=X(q,J,Z),J.length=Z},TV=(q)=>{let J=typeof q;if(J==="string")return"string";if(J!=="object"||q===null)return"others";if(globalThis.Buffer?.isBuffer(q))return"buffer";let X=cq.call(q);if(X==="[object ArrayBuffer]")return"arrayBuffer";if(X==="[object DataView]")return"dataView";if(Number.isInteger(q.byteLength)&&Number.isInteger(q.byteOffset)&&cq.call(q.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:cq}=Object.prototype;class f0 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var u0=(q)=>q,L2=()=>{return},S1=({contents:q})=>q,h1=(q)=>{throw Error(`Streams in object mode are not supported: ${String(q)}`)},b1=(q)=>q.length;async function g1(q,J){return v6(q,DV,J)}var wV=()=>({contents:[]}),PV=()=>1,AV=(q,{contents:J})=>{return J.push(q),J},DV={init:wV,convertChunk:{string:u0,buffer:u0,arrayBuffer:u0,dataView:u0,typedArray:u0,others:u0},getSize:PV,truncateChunk:L2,addChunk:AV,getFinalChunk:L2,finalize:S1};async function f1(q,J){return v6(q,bV,J)}var IV=()=>({contents:new ArrayBuffer(0)}),OV=(q)=>vV.encode(q),vV=new TextEncoder,pq=(q)=>new Uint8Array(q),nq=(q)=>new Uint8Array(q.buffer,q.byteOffset,q.byteLength),NV=(q,J)=>q.slice(0,J),EV=(q,{contents:J,length:X},Z)=>{let Q=oq()?SV(J,Z):yV(J,Z);return new Uint8Array(Q).set(q,X),Q},yV=(q,J)=>{if(J<=q.byteLength)return q;let X=new ArrayBuffer(aq(J));return new Uint8Array(X).set(new Uint8Array(q),0),X},SV=(q,J)=>{if(J<=q.maxByteLength)return q.resize(J),q;let X=new ArrayBuffer(J,{maxByteLength:aq(J)});return new Uint8Array(X).set(new Uint8Array(q),0),X},aq=(q)=>iq**Math.ceil(Math.log(q)/Math.log(iq)),iq=2,hV=({contents:q,length:J})=>oq()?q:q.slice(0,J),oq=()=>("resize"in ArrayBuffer.prototype),bV={init:IV,convertChunk:{string:OV,buffer:pq,arrayBuffer:pq,dataView:nq,typedArray:nq,others:h1},getSize:b1,truncateChunk:NV,addChunk:EV,getFinalChunk:L2,finalize:hV};async function m1(q,J){return v6(q,dV,J)}var gV=()=>({contents:"",textDecoder:new TextDecoder}),u1=(q,{textDecoder:J})=>J.decode(q,{stream:!0}),fV=(q,{contents:J})=>J+q,uV=(q,J)=>q.slice(0,J),mV=({textDecoder:q})=>{let J=q.decode();return J===""?void 0:J},dV={init:gV,convertChunk:{string:u0,buffer:u1,arrayBuffer:u1,dataView:u1,typedArray:u1,others:h1},getSize:b1,truncateChunk:uV,addChunk:fV,getFinalChunk:mV,finalize:S1};Object.assign(_2,{on:cV,finished:lV});var rq=({error:q,stream:J,readableObjectMode:X,lines:Z,encoding:Q,fdNumber:$})=>{if(!(q instanceof f0))throw q;if($==="all")return q;let Y=pV(X,Z,Q);throw q.maxBufferInfo={fdNumber:$,unit:Y},J.destroy(),q},pV=(q,J,X)=>{if(q)return"objects";if(J)return"lines";if(X==="buffer")return"bytes";return"characters"},sq=(q,J,X)=>{if(J.length!==X)return;let Z=new f0;throw Z.maxBufferInfo={fdNumber:"ipc"},Z},tq=(q,J)=>{let{streamName:X,threshold:Z,unit:Q}=nV(q,J);return`Command's ${X} was larger than ${Z} ${Q}`},nV=(q,J)=>{if(q?.maxBufferInfo===void 0)return{streamName:"output",threshold:J[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:X,unit:Z}}=q;delete q.maxBufferInfo;let Q=g0(J,X);if(X==="ipc")return{streamName:"IPC output",threshold:Q,unit:"messages"};return{streamName:Z1(X),threshold:Q,unit:Z}},eq=(q,J,X)=>q?.code==="ENOBUFS"&&J!==null&&J.some((Z)=>Z!==null&&Z.length>d1(X)),q9=(q,J,X)=>{if(!J)return q;let Z=d1(X);return q.length>Z?q.slice(0,Z):q},d1=([,q])=>q;var X9=({stdio:q,all:J,ipcOutput:X,originalError:Z,signal:Q,signalDescription:$,exitCode:Y,escapedCommand:H,timedOut:K,isCanceled:G,isGracefullyCanceled:V,isMaxBuffer:W,isForcefullyTerminated:U,forceKillAfterDelay:z,killSignal:_,maxBuffer:L,timeout:x,cwd:B})=>{let j=Z?.code,R=aV({originalError:Z,timedOut:K,timeout:x,isMaxBuffer:W,maxBuffer:L,errorCode:j,signal:Q,signalDescription:$,exitCode:Y,isCanceled:G,isGracefullyCanceled:V,isForcefullyTerminated:U,forceKillAfterDelay:z,killSignal:_}),F=rV(Z,B),C=F===void 0?"":`
68
- ${F}`,y=`${R}: ${H}${C}`,O=J===void 0?[q[2],q[1]]:[J],g=[y,...O,...q.slice(3),X.map((M)=>sV(M)).join(`
69
- `)].map((M)=>G2(O6(tV(M)))).filter(Boolean).join(`
70
-
71
- `);return{originalMessage:F,shortMessage:y,message:g}},aV=({originalError:q,timedOut:J,timeout:X,isMaxBuffer:Z,maxBuffer:Q,errorCode:$,signal:Y,signalDescription:H,exitCode:K,isCanceled:G,isGracefullyCanceled:V,isForcefullyTerminated:W,forceKillAfterDelay:U,killSignal:z})=>{let _=oV(W,U);if(J)return`Command timed out after ${X} milliseconds${_}`;if(V){if(Y===void 0)return`Command was gracefully canceled with exit code ${K}`;return W?`Command was gracefully canceled${_}`:`Command was gracefully canceled with ${Y} (${H})`}if(G)return`Command was canceled${_}`;if(Z)return`${tq(q,Q)}${_}`;if($!==void 0)return`Command failed with ${$}${_}`;if(W)return`Command was killed with ${z} (${j1(z)})${_}`;if(Y!==void 0)return`Command was killed with ${Y} (${H})`;if(K!==void 0)return`Command failed with exit code ${K}`;return"Command failed"},oV=(q,J)=>q?` and was forcefully terminated after ${J} milliseconds`:"",rV=(q,J)=>{if(q instanceof I0)return;let X=O5(q)?q.originalMessage:String(q?.message??q),Z=G2(Nq(X,J));return Z===""?void 0:Z},sV=(q)=>typeof q==="string"?q:iV(q),tV=(q)=>Array.isArray(q)?q.map((J)=>O6(J9(J))).filter(Boolean).join(`
72
- `):J9(q),J9=(q)=>{if(typeof q==="string")return q;if(f(q))return J1(q);return""};var c1=({command:q,escapedCommand:J,stdio:X,all:Z,ipcOutput:Q,options:{cwd:$},startTime:Y})=>Z9({command:q,escapedCommand:J,cwd:$,durationMs:_4(Y),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:X[1],stderr:X[2],all:Z,stdio:X,ipcOutput:Q,pipedFrom:[]}),N6=({error:q,command:J,escapedCommand:X,fileDescriptors:Z,options:Q,startTime:$,isSync:Y})=>B2({error:q,command:J,escapedCommand:X,startTime:$,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:Z.length}),ipcOutput:[],options:Q,isSync:Y}),B2=({error:q,command:J,escapedCommand:X,startTime:Z,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:G,signal:V,stdio:W,all:U,ipcOutput:z,options:{timeoutDuration:_,timeout:L=_,forceKillAfterDelay:x,killSignal:B,cwd:j,maxBuffer:R},isSync:F})=>{let{exitCode:C,signal:y,signalDescription:O}=qG(G,V),{originalMessage:g,shortMessage:M,message:P}=X9({stdio:W,all:U,ipcOutput:z,originalError:q,signal:y,signalDescription:O,exitCode:C,escapedCommand:X,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,forceKillAfterDelay:x,killSignal:B,maxBuffer:R,timeout:L,cwd:j}),A=D5(q,P,F);return Object.assign(A,eV({error:A,command:J,escapedCommand:X,startTime:Z,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:C,signal:y,signalDescription:O,stdio:W,all:U,ipcOutput:z,cwd:j,originalMessage:g,shortMessage:M})),A},eV=({error:q,command:J,escapedCommand:X,startTime:Z,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:G,signal:V,signalDescription:W,stdio:U,all:z,ipcOutput:_,cwd:L,originalMessage:x,shortMessage:B})=>Z9({shortMessage:B,originalMessage:x,command:J,escapedCommand:X,cwd:L,durationMs:_4(Z),failed:!0,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isTerminated:V!==void 0,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:G,signal:V,signalDescription:W,code:q.cause?.code,stdout:U[1],stderr:U[2],all:z,stdio:U,ipcOutput:_,pipedFrom:[]}),Z9=(q)=>Object.fromEntries(Object.entries(q).filter(([,J])=>J!==void 0)),qG=(q,J)=>{let X=q===null?void 0:q,Z=J===null?void 0:J,Q=Z===void 0?void 0:j1(J);return{exitCode:X,signal:Z,signalDescription:Q}};var Q9=(q)=>Number.isFinite(q)?q:0;function JG(q){return{days:Math.trunc(q/86400000),hours:Math.trunc(q/3600000%24),minutes:Math.trunc(q/60000%60),seconds:Math.trunc(q/1000%60),milliseconds:Math.trunc(q%1000),microseconds:Math.trunc(Q9(q*1000)%1000),nanoseconds:Math.trunc(Q9(q*1e6)%1000)}}function XG(q){return{days:q/86400000n,hours:q/3600000n%24n,minutes:q/60000n%60n,seconds:q/1000n%60n,milliseconds:q%1000n,microseconds:0n,nanoseconds:0n}}function v4(q){switch(typeof q){case"number":{if(Number.isFinite(q))return JG(q);break}case"bigint":return XG(q)}throw TypeError("Expected a finite number or bigint")}var ZG=(q)=>q===0||q===0n,QG=(q,J)=>J===1||J===1n?q:`${q}s`,$G=0.0000001,YG=24n*60n*60n*1000n;function N4(q,J){let X=typeof q==="bigint";if(!X&&!Number.isFinite(q))throw TypeError("Expected a finite number or bigint");J={...J};let Z=q<0?"-":"";if(q=q<0?-q:q,J.colonNotation)J.compact=!1,J.formatSubMilliseconds=!1,J.separateMilliseconds=!1,J.verbose=!1;if(J.compact)J.unitCount=1,J.secondsDecimalDigits=0,J.millisecondsDecimalDigits=0;let Q=[],$=(V,W)=>{let U=Math.floor(V*10**W+$G);return(Math.round(U)/10**W).toFixed(W)},Y=(V,W,U,z)=>{if((Q.length===0||!J.colonNotation)&&ZG(V)&&!(J.colonNotation&&U==="m"))return;if(z??=String(V),J.colonNotation){let _=z.includes(".")?z.split(".")[0].length:z.length,L=Q.length>0?2:1;z="0".repeat(Math.max(0,L-_))+z}else z+=J.verbose?" "+QG(W,V):U;Q.push(z)},H=v4(q),K=BigInt(H.days);if(J.hideYearAndDays)Y(BigInt(K)*24n+BigInt(H.hours),"hour","h");else{if(J.hideYear)Y(K,"day","d");else Y(K/365n,"year","y"),Y(K%365n,"day","d");Y(Number(H.hours),"hour","h")}if(Y(Number(H.minutes),"minute","m"),!J.hideSeconds)if(J.separateMilliseconds||J.formatSubMilliseconds||!J.colonNotation&&q<1000&&!J.subSecondsAsDecimals){let V=Number(H.seconds),W=Number(H.milliseconds),U=Number(H.microseconds),z=Number(H.nanoseconds);if(Y(V,"second","s"),J.formatSubMilliseconds)Y(W,"millisecond","ms"),Y(U,"microsecond","µs"),Y(z,"nanosecond","ns");else{let _=W+U/1000+z/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,x=_>=1?Math.round(_):Math.ceil(_),B=L?_.toFixed(L):x;Y(Number.parseFloat(B),"millisecond","ms",B)}}else{let V=(X?Number(q%YG):q)/1000%60,W=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,U=$(V,W),z=J.keepDecimalsOnWholeSeconds?U:U.replace(/\.0+$/,"");Y(Number.parseFloat(z),"second","s",z)}if(Q.length===0)return Z+"0"+(J.verbose?" milliseconds":"ms");let G=J.colonNotation?":":" ";if(typeof J.unitCount==="number")Q=Q.slice(0,Math.max(J.unitCount,1));return Z+Q.join(G)}var $9=(q,J)=>{if(q.failed)D0({type:"error",verboseMessage:q.shortMessage,verboseInfo:J,result:q})};var Y9=(q,J)=>{if(!w6(J))return;$9(q,J),HG(q,J)},HG=(q,J)=>{let X=`(done in ${N4(q.durationMs)})`;D0({type:"duration",verboseMessage:X,verboseInfo:J,result:q})};var E6=(q,J,{reject:X})=>{if(Y9(q,J),q.failed&&X)throw q;return q};import{readFileSync as E9}from"node:fs";var V9=(q,J)=>{if(U6(q))return"asyncGenerator";if(U9(q))return"generator";if(l1(q))return"fileUrl";if(UG(q))return"filePath";if(LG(q))return"webStream";if(C0(q,{checkOpen:!1}))return"native";if(f(q))return"uint8Array";if(BG(q))return"asyncIterable";if(xG(q))return"iterable";if(S4(q))return G9({transform:q},J);if(WG(q))return KG(q,J);return"native"},KG=(q,J)=>{if(D4(q.transform,{checkOpen:!1}))return VG(q,J);if(S4(q.transform))return G9(q,J);return GG(q,J)},VG=(q,J)=>{return W9(q,J,"Duplex stream"),"duplex"},G9=(q,J)=>{return W9(q,J,"web TransformStream"),"webTransform"},W9=({final:q,binary:J,objectMode:X},Z,Q)=>{H9(q,`${Z}.final`,Q),H9(J,`${Z}.binary`,Q),E4(X,`${Z}.objectMode`)},H9=(q,J,X)=>{if(q!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${X}.`)},GG=({transform:q,final:J,binary:X,objectMode:Z},Q)=>{if(q!==void 0&&!K9(q))throw TypeError(`The \`${Q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(D4(J,{checkOpen:!1}))throw TypeError(`The \`${Q}.final\` option must not be a Duplex stream.`);if(S4(J))throw TypeError(`The \`${Q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!K9(J))throw TypeError(`The \`${Q}.final\` option must be a generator.`);return E4(X,`${Q}.binary`),E4(Z,`${Q}.objectMode`),U6(q)||U6(J)?"asyncGenerator":"generator"},E4=(q,J)=>{if(q!==void 0&&typeof q!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},K9=(q)=>U6(q)||U9(q),U6=(q)=>Object.prototype.toString.call(q)==="[object AsyncGeneratorFunction]",U9=(q)=>Object.prototype.toString.call(q)==="[object GeneratorFunction]",WG=(q)=>b(q)&&(q.transform!==void 0||q.final!==void 0),l1=(q)=>Object.prototype.toString.call(q)==="[object URL]",z9=(q)=>l1(q)&&q.protocol!=="file:",UG=(q)=>b(q)&&Object.keys(q).length>0&&Object.keys(q).every((J)=>zG.has(J))&&y4(q.file),zG=new Set(["file","append"]),y4=(q)=>typeof q==="string",_9=(q,J)=>q==="native"&&typeof J==="string"&&!_G.has(J),_G=new Set(["ipc","ignore","inherit","overlapped","pipe"]),L9=(q)=>Object.prototype.toString.call(q)==="[object ReadableStream]",p1=(q)=>Object.prototype.toString.call(q)==="[object WritableStream]",LG=(q)=>L9(q)||p1(q),S4=(q)=>L9(q?.readable)&&p1(q?.writable),BG=(q)=>B9(q)&&typeof q[Symbol.asyncIterator]==="function",xG=(q)=>B9(q)&&typeof q[Symbol.iterator]==="function",B9=(q)=>typeof q==="object"&&q!==null,L0=new Set(["generator","asyncGenerator","duplex","webTransform"]),n1=new Set(["fileUrl","filePath","fileNumber"]),h4=new Set(["fileUrl","filePath"]),x9=new Set([...h4,"webStream","nodeStream"]),j9=new Set(["webTransform","duplex"]),o0={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var b4=(q,J,X,Z)=>Z==="output"?jG(q,J,X):RG(q,J,X),jG=(q,J,X)=>{let Z=J!==0&&X[J-1].value.readableObjectMode;return{writableObjectMode:Z,readableObjectMode:q??Z}},RG=(q,J,X)=>{let Z=J===0?q===!0:X[J-1].value.readableObjectMode,Q=J!==X.length-1&&(q??Z);return{writableObjectMode:Z,readableObjectMode:Q}},R9=(q,J)=>{let X=q.findLast(({type:Z})=>L0.has(Z));if(X===void 0)return!1;return J==="input"?X.value.writableObjectMode:X.value.readableObjectMode};var M9=(q,J,X,Z)=>[...q.filter(({type:Q})=>!L0.has(Q)),...MG(q,J,X,Z)],MG=(q,J,X,{encoding:Z})=>{let Q=q.filter(({type:Y})=>L0.has(Y)),$=Array.from({length:Q.length});for(let[Y,H]of Object.entries(Q))$[Y]=CG({stdioItem:H,index:Number(Y),newTransforms:$,optionName:J,direction:X,encoding:Z});return wG($,X)},CG=({stdioItem:q,stdioItem:{type:J},index:X,newTransforms:Z,optionName:Q,direction:$,encoding:Y})=>{if(J==="duplex")return FG({stdioItem:q,optionName:Q});if(J==="webTransform")return kG({stdioItem:q,index:X,newTransforms:Z,direction:$});return TG({stdioItem:q,index:X,newTransforms:Z,direction:$,encoding:Y})},FG=({stdioItem:q,stdioItem:{value:{transform:J,transform:{writableObjectMode:X,readableObjectMode:Z},objectMode:Q=Z}},optionName:$})=>{if(Q&&!Z)throw TypeError(`The \`${$}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!Q&&Z)throw TypeError(`The \`${$}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...q,value:{transform:J,writableObjectMode:X,readableObjectMode:Z}}},kG=({stdioItem:q,stdioItem:{value:J},index:X,newTransforms:Z,direction:Q})=>{let{transform:$,objectMode:Y}=b(J)?J:{transform:J},{writableObjectMode:H,readableObjectMode:K}=b4(Y,X,Z,Q);return{...q,value:{transform:$,writableObjectMode:H,readableObjectMode:K}}},TG=({stdioItem:q,stdioItem:{value:J},index:X,newTransforms:Z,direction:Q,encoding:$})=>{let{transform:Y,final:H,binary:K=!1,preserveNewlines:G=!1,objectMode:V}=b(J)?J:{transform:J},W=K||V0.has($),{writableObjectMode:U,readableObjectMode:z}=b4(V,X,Z,Q);return{...q,value:{transform:Y,final:H,binary:W,preserveNewlines:G,writableObjectMode:U,readableObjectMode:z}}},wG=(q,J)=>J==="input"?q.reverse():q;import g4 from"node:process";var C9=(q,J,X)=>{let Z=q.map((Q)=>PG(Q,J));if(Z.includes("input")&&Z.includes("output"))throw TypeError(`The \`${X}\` option must not be an array of both readable and writable values.`);return Z.find(Boolean)??IG},PG=({type:q,value:J},X)=>AG[X]??F9[q](J),AG=["input","output","output"],y6=()=>{return},f4=()=>"input",F9={generator:y6,asyncGenerator:y6,fileUrl:y6,filePath:y6,iterable:f4,asyncIterable:f4,uint8Array:f4,webStream:(q)=>p1(q)?"output":"input",nodeStream(q){if(!W6(q,{checkOpen:!1}))return"output";return A4(q,{checkOpen:!1})?void 0:"input"},webTransform:y6,duplex:y6,native(q){let J=DG(q);if(J!==void 0)return J;if(C0(q,{checkOpen:!1}))return F9.nodeStream(q)}},DG=(q)=>{if([0,g4.stdin].includes(q))return"input";if([1,2,g4.stdout,g4.stderr].includes(q))return"output"},IG="output";var k9=(q,J)=>J&&!q.includes("ipc")?[...q,"ipc"]:q;var T9=({stdio:q,ipc:J,buffer:X,...Z},Q,$)=>{let Y=OG(q,Z).map((H,K)=>w9(H,K));return $?NG(Y,X,Q):k9(Y,J)},OG=(q,J)=>{if(q===void 0)return _0.map((Z)=>J[Z]);if(vG(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${_0.map((Z)=>`\`${Z}\``).join(", ")}`);if(typeof q==="string")return[q,q,q];if(!Array.isArray(q))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof q}\``);let X=Math.max(q.length,_0.length);return Array.from({length:X},(Z,Q)=>q[Q])},vG=(q)=>_0.some((J)=>q[J]!==void 0),w9=(q,J)=>{if(Array.isArray(q))return q.map((X)=>w9(X,J));if(q===null||q===void 0)return J>=_0.length?"ignore":"pipe";return q},NG=(q,J,X)=>q.map((Z,Q)=>!J[Q]&&Q!==0&&!P6(X,Q)&&EG(Z)?"ignore":Z),EG=(q)=>q==="pipe"||Array.isArray(q)&&q.every((J)=>J==="pipe");import{readFileSync as yG}from"node:fs";import SG from"node:tty";var A9=({stdioItem:q,stdioItem:{type:J},isStdioArray:X,fdNumber:Z,direction:Q,isSync:$})=>{if(!X||J!=="native")return q;return $?hG({stdioItem:q,fdNumber:Z,direction:Q}):fG({stdioItem:q,fdNumber:Z})},hG=({stdioItem:q,stdioItem:{value:J,optionName:X},fdNumber:Z,direction:Q})=>{let $=bG({value:J,optionName:X,fdNumber:Z,direction:Q});if($!==void 0)return $;if(C0(J,{checkOpen:!1}))throw TypeError(`The \`${X}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return q},bG=({value:q,optionName:J,fdNumber:X,direction:Z})=>{let Q=gG(q,X);if(Q===void 0)return;if(Z==="output")return{type:"fileNumber",value:Q,optionName:J};if(SG.isatty(Q))throw TypeError(`The \`${J}: ${C1(q)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:b0(yG(Q)),optionName:J}},gG=(q,J)=>{if(q==="inherit")return J;if(typeof q==="number")return q;let X=X1.indexOf(q);if(X!==-1)return X},fG=({stdioItem:q,stdioItem:{value:J,optionName:X},fdNumber:Z})=>{if(J==="inherit")return{type:"nodeStream",value:P9(Z,J,X),optionName:X};if(typeof J==="number")return{type:"nodeStream",value:P9(J,J,X),optionName:X};if(C0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:X};return q},P9=(q,J,X)=>{let Z=X1[q];if(Z===void 0)throw TypeError(`The \`${X}: ${J}\` option is invalid: no such standard stream.`);return Z};var D9=({input:q,inputFile:J},X)=>X===0?[...uG(q),...dG(J)]:[],uG=(q)=>q===void 0?[]:[{type:mG(q),value:q,optionName:"input"}],mG=(q)=>{if(W6(q,{checkOpen:!1}))return"nodeStream";if(typeof q==="string")return"string";if(f(q))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},dG=(q)=>q===void 0?[]:[{...cG(q),optionName:"inputFile"}],cG=(q)=>{if(l1(q))return{type:"fileUrl",value:q};if(y4(q))return{type:"filePath",value:{file:q}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var I9=(q)=>q.filter((J,X)=>q.every((Z,Q)=>J.value!==Z.value||X>=Q||J.type==="generator"||J.type==="asyncGenerator")),O9=({stdioItem:{type:q,value:J,optionName:X},direction:Z,fileDescriptors:Q,isSync:$})=>{let Y=lG(Q,q);if(Y.length===0)return;if($){pG({otherStdioItems:Y,type:q,value:J,optionName:X,direction:Z});return}if(x9.has(q))return v9({otherStdioItems:Y,type:q,value:J,optionName:X,direction:Z});if(j9.has(q))iG({otherStdioItems:Y,type:q,value:J,optionName:X})},lG=(q,J)=>q.flatMap(({direction:X,stdioItems:Z})=>Z.filter((Q)=>Q.type===J).map((Q)=>({...Q,direction:X}))),pG=({otherStdioItems:q,type:J,value:X,optionName:Z,direction:Q})=>{if(h4.has(J))v9({otherStdioItems:q,type:J,value:X,optionName:Z,direction:Q})},v9=({otherStdioItems:q,type:J,value:X,optionName:Z,direction:Q})=>{let $=q.filter((H)=>nG(H,X));if($.length===0)return;let Y=$.find((H)=>H.direction!==Q);return N9(Y,Z,J),Q==="output"?$[0].stream:void 0},nG=({type:q,value:J},X)=>{if(q==="filePath")return J.file===X.file;if(q==="fileUrl")return J.href===X.href;return J===X},iG=({otherStdioItems:q,type:J,value:X,optionName:Z})=>{let Q=q.find(({value:{transform:$}})=>$===X.transform);N9(Q,Z,J)},N9=(q,J,X)=>{if(q!==void 0)throw TypeError(`The \`${q.optionName}\` and \`${J}\` options must not target ${o0[X]} that is the same.`)};var i1=(q,J,X,Z)=>{let $=T9(J,X,Z).map((H,K)=>aG({stdioOption:H,fdNumber:K,options:J,isSync:Z})),Y=XW({initialFileDescriptors:$,addProperties:q,options:J,isSync:Z});return J.stdio=Y.map(({stdioItems:H})=>$W(H)),Y},aG=({stdioOption:q,fdNumber:J,options:X,isSync:Z})=>{let Q=Z1(J),{stdioItems:$,isStdioArray:Y}=oG({stdioOption:q,fdNumber:J,options:X,optionName:Q}),H=C9($,J,Q),K=$.map((W)=>A9({stdioItem:W,isStdioArray:Y,fdNumber:J,direction:H,isSync:Z})),G=M9(K,Q,H,X),V=R9(G,H);return JW(G,V),{direction:H,objectMode:V,stdioItems:G}},oG=({stdioOption:q,fdNumber:J,options:X,optionName:Z})=>{let $=[...(Array.isArray(q)?q:[q]).map((K)=>rG(K,Z)),...D9(X,J)],Y=I9($),H=Y.length>1;return sG(Y,H,Z),eG(Y),{stdioItems:Y,isStdioArray:H}},rG=(q,J)=>({type:V9(q,J),value:q,optionName:J}),sG=(q,J,X)=>{if(q.length===0)throw TypeError(`The \`${X}\` option must not be an empty array.`);if(!J)return;for(let{value:Z,optionName:Q}of q)if(tG.has(Z))throw Error(`The \`${Q}\` option must not include \`${Z}\`.`)},tG=new Set(["ignore","ipc"]),eG=(q)=>{for(let J of q)qW(J)},qW=({type:q,value:J,optionName:X})=>{if(z9(J))throw TypeError(`The \`${X}: URL\` option must use the \`file:\` scheme.
73
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(_9(q,J))throw TypeError(`The \`${X}: { file: '...' }\` option must be used instead of \`${X}: '...'\`.`)},JW=(q,J)=>{if(!J)return;let X=q.find(({type:Z})=>n1.has(Z));if(X!==void 0)throw TypeError(`The \`${X.optionName}\` option cannot use both files and transforms in objectMode.`)},XW=({initialFileDescriptors:q,addProperties:J,options:X,isSync:Z})=>{let Q=[];try{for(let $ of q)Q.push(ZW({fileDescriptor:$,fileDescriptors:Q,addProperties:J,options:X,isSync:Z}));return Q}catch($){throw u4(Q),$}},ZW=({fileDescriptor:{direction:q,objectMode:J,stdioItems:X},fileDescriptors:Z,addProperties:Q,options:$,isSync:Y})=>{let H=X.map((K)=>QW({stdioItem:K,addProperties:Q,direction:q,options:$,fileDescriptors:Z,isSync:Y}));return{direction:q,objectMode:J,stdioItems:H}},QW=({stdioItem:q,addProperties:J,direction:X,options:Z,fileDescriptors:Q,isSync:$})=>{let Y=O9({stdioItem:q,direction:X,fileDescriptors:Q,isSync:$});if(Y!==void 0)return{...q,stream:Y};return{...q,...J[X][q.type](q,Z)}},u4=(q)=>{for(let{stdioItems:J}of q)for(let{stream:X}of J)if(X!==void 0&&!R0(X))X.destroy()},$W=(q)=>{if(q.length>1)return q.some(({value:Z})=>Z==="overlapped")?"overlapped":"pipe";let[{type:J,value:X}]=q;return J==="native"?X:"pipe"};var S9=(q,J)=>i1(HW,q,J,!0),N0=({type:q,optionName:J})=>{h9(J,o0[q])},YW=({optionName:q,value:J})=>{if(J==="ipc"||J==="overlapped")h9(q,`"${J}"`);return{}},h9=(q,J)=>{throw TypeError(`The \`${q}\` option cannot be ${J} with synchronous methods.`)},y9={generator(){},asyncGenerator:N0,webStream:N0,nodeStream:N0,webTransform:N0,duplex:N0,asyncIterable:N0,native:YW},HW={input:{...y9,fileUrl:({value:q})=>({contents:[b0(E9(q))]}),filePath:({value:{file:q}})=>({contents:[b0(E9(q))]}),fileNumber:N0,iterable:({value:q})=>({contents:[...q]}),string:({value:q})=>({contents:[q]}),uint8Array:({value:q})=>({contents:[q]})},output:{...y9,fileUrl:({value:q})=>({path:q}),filePath:({value:{file:q,append:J}})=>({path:q,append:J}),fileNumber:({value:q})=>({path:q}),iterable:N0,string:N0,uint8Array:N0}};var m0=(q,{stripFinalNewline:J},X)=>m4(J,X)&&q!==void 0&&!Array.isArray(q)?O6(q):q,m4=(q,J)=>J==="all"?q[1]||q[2]:q[J];import{Transform as DW,getDefaultHighWaterMark as i9}from"node:stream";var a1=(q,J,X,Z)=>q||X?void 0:g9(J,Z),c4=(q,J,X)=>X?q.flatMap((Z)=>b9(Z,J)):b9(q,J),b9=(q,J)=>{let{transform:X,final:Z}=g9(J,{});return[...X(q),...Z()]},g9=(q,J)=>{return J.previousChunks="",{transform:KW.bind(void 0,J,q),final:GW.bind(void 0,J)}},KW=function*(q,J,X){if(typeof X!=="string"){yield X;return}let{previousChunks:Z}=q,Q=-1;for(let $=0;$<X.length;$+=1)if(X[$]===`
74
- `){let Y=VW(X,$,J,q),H=X.slice(Q+1,$+1-Y);if(Z.length>0)H=d4(Z,H),Z="";yield H,Q=$}if(Q!==X.length-1)Z=d4(Z,X.slice(Q+1));q.previousChunks=Z},VW=(q,J,X,Z)=>{if(X)return 0;return Z.isWindowsNewline=J!==0&&q[J-1]==="\r",Z.isWindowsNewline?2:1},GW=function*({previousChunks:q}){if(q.length>0)yield q},f9=({binary:q,preserveNewlines:J,readableObjectMode:X,state:Z})=>q||J||X?void 0:{transform:WW.bind(void 0,Z)},WW=function*({isWindowsNewline:q=!1},J){let{unixNewline:X,windowsNewline:Z,LF:Q,concatBytes:$}=typeof J==="string"?UW:_W;if(J.at(-1)===Q){yield J;return}yield $(J,q?Z:X)},d4=(q,J)=>`${q}${J}`,UW={windowsNewline:`\r
66
+ ${q}`;return q};var y1=(q,J,X)=>{X.cwd=bq(X.cwd);let[Z,Q,$]=Nq(q,J,X),{command:Y,args:H,options:K}=mq.default._parse(Z,Q,$),G=L5(K),V=FV(G);if(Dq(V),hq(V),Eq(V),o5(V),Pq(V),V.shell=H4(V.shell),V.env=kV(V),V.killSignal=l5(V.killSignal),V.forceKillAfterDelay=i5(V.forceKillAfterDelay),V.lines=V.lines.map((W,U)=>W&&!V0.has(V.encoding)&&V.buffer[U]),uq.platform==="win32"&&CV.basename(Y,".exe")==="cmd")H.unshift("/q");return{file:Y,commandArguments:H,options:V}},FV=({extendEnv:q=!0,preferLocal:J=!1,cwd:X,localDir:Z=X,encoding:Q="utf8",reject:$=!0,cleanup:Y=!0,all:H=!1,windowsHide:K=!0,killSignal:G="SIGTERM",forceKillAfterDelay:V=!0,gracefulCancel:W=!1,ipcInput:U,ipc:z=U!==void 0||W,serialization:_="advanced",...L})=>({...L,extendEnv:q,preferLocal:J,cwd:X,localDirectory:Z,encoding:Q,reject:$,cleanup:Y,all:H,windowsHide:K,killSignal:G,forceKillAfterDelay:V,gracefulCancel:W,ipcInput:U,ipc:z,serialization:_}),kV=({env:q,extendEnv:J,preferLocal:X,node:Z,localDirectory:Q,nodePath:$})=>{let Y=J?{...uq.env,...q}:q;if(X||Z)return y5({env:Y,cwd:Q,execPath:$,preferLocal:X,addExecPath:Z});return Y};var S1=(q,J,X)=>X.shell&&J.length>0?[[q,...J].join(" "),[],X]:[q,J,X];import{inspect as ZG}from"node:util";function N6(q){if(typeof q==="string")return TV(q);if(!(ArrayBuffer.isView(q)&&q.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return wV(q)}var TV=(q)=>q.at(-1)===dq?q.slice(0,q.at(-2)===cq?-2:-1):q,wV=(q)=>q.at(-1)===PV?q.subarray(0,q.at(-2)===AV?-2:-1):q,dq=`
67
+ `,PV=dq.codePointAt(0),cq="\r",AV=cq.codePointAt(0);import{on as eV}from"node:events";import{finished as qG}from"node:stream/promises";function C0(q,{checkOpen:J=!0}={}){return q!==null&&typeof q==="object"&&(q.writable||q.readable||!J||q.writable===void 0&&q.readable===void 0)&&typeof q.pipe==="function"}function I4(q,{checkOpen:J=!0}={}){return C0(q,{checkOpen:J})&&(q.writable||!J)&&typeof q.write==="function"&&typeof q.end==="function"&&typeof q.writable==="boolean"&&typeof q.writableObjectMode==="boolean"&&typeof q.destroy==="function"&&typeof q.destroyed==="boolean"}function z6(q,{checkOpen:J=!0}={}){return C0(q,{checkOpen:J})&&(q.readable||!J)&&typeof q.read==="function"&&typeof q.readable==="boolean"&&typeof q.readableObjectMode==="boolean"&&typeof q.destroy==="function"&&typeof q.destroyed==="boolean"}function O4(q,J){return I4(q,J)&&z6(q,J)}var DV=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class lq{#q;#X;#J=!1;#Z=void 0;constructor(q,J){this.#q=q,this.#X=J}next(){let q=()=>this.#$();return this.#Z=this.#Z?this.#Z.then(q,q):q(),this.#Z}return(q){let J=()=>this.#V(q);return this.#Z?this.#Z.then(J,J):J()}async#$(){if(this.#J)return{done:!0,value:void 0};let q;try{q=await this.#q.read()}catch(J){throw this.#Z=void 0,this.#J=!0,this.#q.releaseLock(),J}return q.done&&(this.#Z=void 0,this.#J=!0,this.#q.releaseLock()),q}async#V(q){if(this.#J)return{done:!0,value:q};if(this.#J=!0,!this.#X){let J=this.#q.cancel(q);return this.#q.releaseLock(),await J,{done:!0,value:q}}return this.#q.releaseLock(),{done:!0,value:q}}}var v4=Symbol();function pq(){return this[v4].next()}Object.defineProperty(pq,"name",{value:"next"});function nq(q){return this[v4].return(q)}Object.defineProperty(nq,"name",{value:"return"});var IV=Object.create(DV,{next:{enumerable:!0,configurable:!0,writable:!0,value:pq},return:{enumerable:!0,configurable:!0,writable:!0,value:nq}});function N4({preventCancel:q=!1}={}){let J=this.getReader(),X=new lq(J,q),Z=Object.create(IV);return Z[v4]=X,Z}var iq=(q)=>{if(z6(q,{checkOpen:!1})&&B2.on!==void 0)return vV(q);if(typeof q?.[Symbol.asyncIterator]==="function")return q;if(OV.call(q)==="[object ReadableStream]")return N4.call(q);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:OV}=Object.prototype,vV=async function*(q){let J=new AbortController,X={};NV(q,J,X);try{for await(let[Z]of B2.on(q,"data",{signal:J.signal}))yield Z}catch(Z){if(X.error!==void 0)throw X.error;else if(!J.signal.aborted)throw Z}finally{q.destroy()}},NV=async(q,J,X)=>{try{await B2.finished(q,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(Z){X.error=Z}finally{J.abort()}},B2={};var E6=async(q,{init:J,convertChunk:X,getSize:Z,truncateChunk:Q,addChunk:$,getFinalChunk:Y,finalize:H},{maxBuffer:K=Number.POSITIVE_INFINITY}={})=>{let G=iq(q),V=J();V.length=0;try{for await(let W of G){let U=yV(W),z=X[U](W,V);rq({convertedChunk:z,state:V,getSize:Z,truncateChunk:Q,addChunk:$,maxBuffer:K})}return EV({state:V,convertChunk:X,getSize:Z,truncateChunk:Q,addChunk:$,getFinalChunk:Y,maxBuffer:K}),H(V)}catch(W){let U=typeof W==="object"&&W!==null?W:Error(W);throw U.bufferedData=H(V),U}},EV=({state:q,getSize:J,truncateChunk:X,addChunk:Z,getFinalChunk:Q,maxBuffer:$})=>{let Y=Q(q);if(Y!==void 0)rq({convertedChunk:Y,state:q,getSize:J,truncateChunk:X,addChunk:Z,maxBuffer:$})},rq=({convertedChunk:q,state:J,getSize:X,truncateChunk:Z,addChunk:Q,maxBuffer:$})=>{let Y=X(q),H=J.length+Y;if(H<=$){aq(q,J,Q,H);return}let K=Z(q,$-J.length);if(K!==void 0)aq(K,J,Q,$);throw new f0},aq=(q,J,X,Z)=>{J.contents=X(q,J,Z),J.length=Z},yV=(q)=>{let J=typeof q;if(J==="string")return"string";if(J!=="object"||q===null)return"others";if(globalThis.Buffer?.isBuffer(q))return"buffer";let X=oq.call(q);if(X==="[object ArrayBuffer]")return"arrayBuffer";if(X==="[object DataView]")return"dataView";if(Number.isInteger(q.byteLength)&&Number.isInteger(q.byteOffset)&&oq.call(q.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:oq}=Object.prototype;class f0 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var u0=(q)=>q,x2=()=>{return},h1=({contents:q})=>q,b1=(q)=>{throw Error(`Streams in object mode are not supported: ${String(q)}`)},g1=(q)=>q.length;async function f1(q,J){return E6(q,gV,J)}var SV=()=>({contents:[]}),hV=()=>1,bV=(q,{contents:J})=>{return J.push(q),J},gV={init:SV,convertChunk:{string:u0,buffer:u0,arrayBuffer:u0,dataView:u0,typedArray:u0,others:u0},getSize:hV,truncateChunk:x2,addChunk:bV,getFinalChunk:x2,finalize:h1};async function u1(q,J){return E6(q,iV,J)}var fV=()=>({contents:new ArrayBuffer(0)}),uV=(q)=>mV.encode(q),mV=new TextEncoder,sq=(q)=>new Uint8Array(q),tq=(q)=>new Uint8Array(q.buffer,q.byteOffset,q.byteLength),dV=(q,J)=>q.slice(0,J),cV=(q,{contents:J,length:X},Z)=>{let Q=J9()?pV(J,Z):lV(J,Z);return new Uint8Array(Q).set(q,X),Q},lV=(q,J)=>{if(J<=q.byteLength)return q;let X=new ArrayBuffer(q9(J));return new Uint8Array(X).set(new Uint8Array(q),0),X},pV=(q,J)=>{if(J<=q.maxByteLength)return q.resize(J),q;let X=new ArrayBuffer(J,{maxByteLength:q9(J)});return new Uint8Array(X).set(new Uint8Array(q),0),X},q9=(q)=>eq**Math.ceil(Math.log(q)/Math.log(eq)),eq=2,nV=({contents:q,length:J})=>J9()?q:q.slice(0,J),J9=()=>("resize"in ArrayBuffer.prototype),iV={init:fV,convertChunk:{string:uV,buffer:sq,arrayBuffer:sq,dataView:tq,typedArray:tq,others:b1},getSize:g1,truncateChunk:dV,addChunk:cV,getFinalChunk:x2,finalize:nV};async function d1(q,J){return E6(q,tV,J)}var aV=()=>({contents:"",textDecoder:new TextDecoder}),m1=(q,{textDecoder:J})=>J.decode(q,{stream:!0}),oV=(q,{contents:J})=>J+q,rV=(q,J)=>q.slice(0,J),sV=({textDecoder:q})=>{let J=q.decode();return J===""?void 0:J},tV={init:aV,convertChunk:{string:u0,buffer:m1,arrayBuffer:m1,dataView:m1,typedArray:m1,others:b1},getSize:g1,truncateChunk:rV,addChunk:oV,getFinalChunk:sV,finalize:h1};Object.assign(B2,{on:eV,finished:qG});var X9=({error:q,stream:J,readableObjectMode:X,lines:Z,encoding:Q,fdNumber:$})=>{if(!(q instanceof f0))throw q;if($==="all")return q;let Y=JG(X,Z,Q);throw q.maxBufferInfo={fdNumber:$,unit:Y},J.destroy(),q},JG=(q,J,X)=>{if(q)return"objects";if(J)return"lines";if(X==="buffer")return"bytes";return"characters"},Z9=(q,J,X)=>{if(J.length!==X)return;let Z=new f0;throw Z.maxBufferInfo={fdNumber:"ipc"},Z},Q9=(q,J)=>{let{streamName:X,threshold:Z,unit:Q}=XG(q,J);return`Command's ${X} was larger than ${Z} ${Q}`},XG=(q,J)=>{if(q?.maxBufferInfo===void 0)return{streamName:"output",threshold:J[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:X,unit:Z}}=q;delete q.maxBufferInfo;let Q=g0(J,X);if(X==="ipc")return{streamName:"IPC output",threshold:Q,unit:"messages"};return{streamName:Q1(X),threshold:Q,unit:Z}},$9=(q,J,X)=>q?.code==="ENOBUFS"&&J!==null&&J.some((Z)=>Z!==null&&Z.length>c1(X)),Y9=(q,J,X)=>{if(!J)return q;let Z=c1(X);return q.length>Z?q.slice(0,Z):q},c1=([,q])=>q;var K9=({stdio:q,all:J,ipcOutput:X,originalError:Z,signal:Q,signalDescription:$,exitCode:Y,escapedCommand:H,timedOut:K,isCanceled:G,isGracefullyCanceled:V,isMaxBuffer:W,isForcefullyTerminated:U,forceKillAfterDelay:z,killSignal:_,maxBuffer:L,timeout:x,cwd:B})=>{let j=Z?.code,R=QG({originalError:Z,timedOut:K,timeout:x,isMaxBuffer:W,maxBuffer:L,errorCode:j,signal:Q,signalDescription:$,exitCode:Y,isCanceled:G,isGracefullyCanceled:V,isForcefullyTerminated:U,forceKillAfterDelay:z,killSignal:_}),F=YG(Z,B),C=F===void 0?"":`
68
+ ${F}`,y=`${R}: ${H}${C}`,O=J===void 0?[q[2],q[1]]:[J],g=[y,...O,...q.slice(3),X.map((M)=>HG(M)).join(`
69
+ `)].map((M)=>U2(N6(KG(M)))).filter(Boolean).join(`
70
+
71
+ `);return{originalMessage:F,shortMessage:y,message:g}},QG=({originalError:q,timedOut:J,timeout:X,isMaxBuffer:Z,maxBuffer:Q,errorCode:$,signal:Y,signalDescription:H,exitCode:K,isCanceled:G,isGracefullyCanceled:V,isForcefullyTerminated:W,forceKillAfterDelay:U,killSignal:z})=>{let _=$G(W,U);if(J)return`Command timed out after ${X} milliseconds${_}`;if(V){if(Y===void 0)return`Command was gracefully canceled with exit code ${K}`;return W?`Command was gracefully canceled${_}`:`Command was gracefully canceled with ${Y} (${H})`}if(G)return`Command was canceled${_}`;if(Z)return`${Q9(q,Q)}${_}`;if($!==void 0)return`Command failed with ${$}${_}`;if(W)return`Command was killed with ${z} (${R1(z)})${_}`;if(Y!==void 0)return`Command was killed with ${Y} (${H})`;if(K!==void 0)return`Command failed with exit code ${K}`;return"Command failed"},$G=(q,J)=>q?` and was forcefully terminated after ${J} milliseconds`:"",YG=(q,J)=>{if(q instanceof I0)return;let X=b5(q)?q.originalMessage:String(q?.message??q),Z=U2(fq(X,J));return Z===""?void 0:Z},HG=(q)=>typeof q==="string"?q:ZG(q),KG=(q)=>Array.isArray(q)?q.map((J)=>N6(H9(J))).filter(Boolean).join(`
72
+ `):H9(q),H9=(q)=>{if(typeof q==="string")return q;if(f(q))return X1(q);return""};var l1=({command:q,escapedCommand:J,stdio:X,all:Z,ipcOutput:Q,options:{cwd:$},startTime:Y})=>V9({command:q,escapedCommand:J,cwd:$,durationMs:L4(Y),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:X[1],stderr:X[2],all:Z,stdio:X,ipcOutput:Q,pipedFrom:[]}),y6=({error:q,command:J,escapedCommand:X,fileDescriptors:Z,options:Q,startTime:$,isSync:Y})=>j2({error:q,command:J,escapedCommand:X,startTime:$,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:Z.length}),ipcOutput:[],options:Q,isSync:Y}),j2=({error:q,command:J,escapedCommand:X,startTime:Z,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:G,signal:V,stdio:W,all:U,ipcOutput:z,options:{timeoutDuration:_,timeout:L=_,forceKillAfterDelay:x,killSignal:B,cwd:j,maxBuffer:R},isSync:F})=>{let{exitCode:C,signal:y,signalDescription:O}=GG(G,V),{originalMessage:g,shortMessage:M,message:P}=K9({stdio:W,all:U,ipcOutput:z,originalError:q,signal:y,signalDescription:O,exitCode:C,escapedCommand:X,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,forceKillAfterDelay:x,killSignal:B,maxBuffer:R,timeout:L,cwd:j}),A=S5(q,P,F);return Object.assign(A,VG({error:A,command:J,escapedCommand:X,startTime:Z,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:C,signal:y,signalDescription:O,stdio:W,all:U,ipcOutput:z,cwd:j,originalMessage:g,shortMessage:M})),A},VG=({error:q,command:J,escapedCommand:X,startTime:Z,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:G,signal:V,signalDescription:W,stdio:U,all:z,ipcOutput:_,cwd:L,originalMessage:x,shortMessage:B})=>V9({shortMessage:B,originalMessage:x,command:J,escapedCommand:X,cwd:L,durationMs:L4(Z),failed:!0,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isTerminated:V!==void 0,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:G,signal:V,signalDescription:W,code:q.cause?.code,stdout:U[1],stderr:U[2],all:z,stdio:U,ipcOutput:_,pipedFrom:[]}),V9=(q)=>Object.fromEntries(Object.entries(q).filter(([,J])=>J!==void 0)),GG=(q,J)=>{let X=q===null?void 0:q,Z=J===null?void 0:J,Q=Z===void 0?void 0:R1(J);return{exitCode:X,signal:Z,signalDescription:Q}};var G9=(q)=>Number.isFinite(q)?q:0;function WG(q){return{days:Math.trunc(q/86400000),hours:Math.trunc(q/3600000%24),minutes:Math.trunc(q/60000%60),seconds:Math.trunc(q/1000%60),milliseconds:Math.trunc(q%1000),microseconds:Math.trunc(G9(q*1000)%1000),nanoseconds:Math.trunc(G9(q*1e6)%1000)}}function UG(q){return{days:q/86400000n,hours:q/3600000n%24n,minutes:q/60000n%60n,seconds:q/1000n%60n,milliseconds:q%1000n,microseconds:0n,nanoseconds:0n}}function E4(q){switch(typeof q){case"number":{if(Number.isFinite(q))return WG(q);break}case"bigint":return UG(q)}throw TypeError("Expected a finite number or bigint")}var zG=(q)=>q===0||q===0n,_G=(q,J)=>J===1||J===1n?q:`${q}s`,LG=0.0000001,BG=24n*60n*60n*1000n;function y4(q,J){let X=typeof q==="bigint";if(!X&&!Number.isFinite(q))throw TypeError("Expected a finite number or bigint");J={...J};let Z=q<0?"-":"";if(q=q<0?-q:q,J.colonNotation)J.compact=!1,J.formatSubMilliseconds=!1,J.separateMilliseconds=!1,J.verbose=!1;if(J.compact)J.unitCount=1,J.secondsDecimalDigits=0,J.millisecondsDecimalDigits=0;let Q=[],$=(V,W)=>{let U=Math.floor(V*10**W+LG);return(Math.round(U)/10**W).toFixed(W)},Y=(V,W,U,z)=>{if((Q.length===0||!J.colonNotation)&&zG(V)&&!(J.colonNotation&&U==="m"))return;if(z??=String(V),J.colonNotation){let _=z.includes(".")?z.split(".")[0].length:z.length,L=Q.length>0?2:1;z="0".repeat(Math.max(0,L-_))+z}else z+=J.verbose?" "+_G(W,V):U;Q.push(z)},H=E4(q),K=BigInt(H.days);if(J.hideYearAndDays)Y(BigInt(K)*24n+BigInt(H.hours),"hour","h");else{if(J.hideYear)Y(K,"day","d");else Y(K/365n,"year","y"),Y(K%365n,"day","d");Y(Number(H.hours),"hour","h")}if(Y(Number(H.minutes),"minute","m"),!J.hideSeconds)if(J.separateMilliseconds||J.formatSubMilliseconds||!J.colonNotation&&q<1000&&!J.subSecondsAsDecimals){let V=Number(H.seconds),W=Number(H.milliseconds),U=Number(H.microseconds),z=Number(H.nanoseconds);if(Y(V,"second","s"),J.formatSubMilliseconds)Y(W,"millisecond","ms"),Y(U,"microsecond","µs"),Y(z,"nanosecond","ns");else{let _=W+U/1000+z/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,x=_>=1?Math.round(_):Math.ceil(_),B=L?_.toFixed(L):x;Y(Number.parseFloat(B),"millisecond","ms",B)}}else{let V=(X?Number(q%BG):q)/1000%60,W=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,U=$(V,W),z=J.keepDecimalsOnWholeSeconds?U:U.replace(/\.0+$/,"");Y(Number.parseFloat(z),"second","s",z)}if(Q.length===0)return Z+"0"+(J.verbose?" milliseconds":"ms");let G=J.colonNotation?":":" ";if(typeof J.unitCount==="number")Q=Q.slice(0,Math.max(J.unitCount,1));return Z+Q.join(G)}var W9=(q,J)=>{if(q.failed)D0({type:"error",verboseMessage:q.shortMessage,verboseInfo:J,result:q})};var U9=(q,J)=>{if(!A6(J))return;W9(q,J),xG(q,J)},xG=(q,J)=>{let X=`(done in ${y4(q.durationMs)})`;D0({type:"duration",verboseMessage:X,verboseInfo:J,result:q})};var S6=(q,J,{reject:X})=>{if(U9(q,J),q.failed&&X)throw q;return q};import{readFileSync as f9}from"node:fs";var L9=(q,J)=>{if(_6(q))return"asyncGenerator";if(j9(q))return"generator";if(p1(q))return"fileUrl";if(FG(q))return"filePath";if(wG(q))return"webStream";if(C0(q,{checkOpen:!1}))return"native";if(f(q))return"uint8Array";if(PG(q))return"asyncIterable";if(AG(q))return"iterable";if(b4(q))return B9({transform:q},J);if(CG(q))return jG(q,J);return"native"},jG=(q,J)=>{if(O4(q.transform,{checkOpen:!1}))return RG(q,J);if(b4(q.transform))return B9(q,J);return MG(q,J)},RG=(q,J)=>{return x9(q,J,"Duplex stream"),"duplex"},B9=(q,J)=>{return x9(q,J,"web TransformStream"),"webTransform"},x9=({final:q,binary:J,objectMode:X},Z,Q)=>{z9(q,`${Z}.final`,Q),z9(J,`${Z}.binary`,Q),S4(X,`${Z}.objectMode`)},z9=(q,J,X)=>{if(q!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${X}.`)},MG=({transform:q,final:J,binary:X,objectMode:Z},Q)=>{if(q!==void 0&&!_9(q))throw TypeError(`The \`${Q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(O4(J,{checkOpen:!1}))throw TypeError(`The \`${Q}.final\` option must not be a Duplex stream.`);if(b4(J))throw TypeError(`The \`${Q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!_9(J))throw TypeError(`The \`${Q}.final\` option must be a generator.`);return S4(X,`${Q}.binary`),S4(Z,`${Q}.objectMode`),_6(q)||_6(J)?"asyncGenerator":"generator"},S4=(q,J)=>{if(q!==void 0&&typeof q!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},_9=(q)=>_6(q)||j9(q),_6=(q)=>Object.prototype.toString.call(q)==="[object AsyncGeneratorFunction]",j9=(q)=>Object.prototype.toString.call(q)==="[object GeneratorFunction]",CG=(q)=>b(q)&&(q.transform!==void 0||q.final!==void 0),p1=(q)=>Object.prototype.toString.call(q)==="[object URL]",R9=(q)=>p1(q)&&q.protocol!=="file:",FG=(q)=>b(q)&&Object.keys(q).length>0&&Object.keys(q).every((J)=>kG.has(J))&&h4(q.file),kG=new Set(["file","append"]),h4=(q)=>typeof q==="string",M9=(q,J)=>q==="native"&&typeof J==="string"&&!TG.has(J),TG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),C9=(q)=>Object.prototype.toString.call(q)==="[object ReadableStream]",n1=(q)=>Object.prototype.toString.call(q)==="[object WritableStream]",wG=(q)=>C9(q)||n1(q),b4=(q)=>C9(q?.readable)&&n1(q?.writable),PG=(q)=>F9(q)&&typeof q[Symbol.asyncIterator]==="function",AG=(q)=>F9(q)&&typeof q[Symbol.iterator]==="function",F9=(q)=>typeof q==="object"&&q!==null,L0=new Set(["generator","asyncGenerator","duplex","webTransform"]),i1=new Set(["fileUrl","filePath","fileNumber"]),g4=new Set(["fileUrl","filePath"]),k9=new Set([...g4,"webStream","nodeStream"]),T9=new Set(["webTransform","duplex"]),o0={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var f4=(q,J,X,Z)=>Z==="output"?DG(q,J,X):IG(q,J,X),DG=(q,J,X)=>{let Z=J!==0&&X[J-1].value.readableObjectMode;return{writableObjectMode:Z,readableObjectMode:q??Z}},IG=(q,J,X)=>{let Z=J===0?q===!0:X[J-1].value.readableObjectMode,Q=J!==X.length-1&&(q??Z);return{writableObjectMode:Z,readableObjectMode:Q}},w9=(q,J)=>{let X=q.findLast(({type:Z})=>L0.has(Z));if(X===void 0)return!1;return J==="input"?X.value.writableObjectMode:X.value.readableObjectMode};var P9=(q,J,X,Z)=>[...q.filter(({type:Q})=>!L0.has(Q)),...OG(q,J,X,Z)],OG=(q,J,X,{encoding:Z})=>{let Q=q.filter(({type:Y})=>L0.has(Y)),$=Array.from({length:Q.length});for(let[Y,H]of Object.entries(Q))$[Y]=vG({stdioItem:H,index:Number(Y),newTransforms:$,optionName:J,direction:X,encoding:Z});return SG($,X)},vG=({stdioItem:q,stdioItem:{type:J},index:X,newTransforms:Z,optionName:Q,direction:$,encoding:Y})=>{if(J==="duplex")return NG({stdioItem:q,optionName:Q});if(J==="webTransform")return EG({stdioItem:q,index:X,newTransforms:Z,direction:$});return yG({stdioItem:q,index:X,newTransforms:Z,direction:$,encoding:Y})},NG=({stdioItem:q,stdioItem:{value:{transform:J,transform:{writableObjectMode:X,readableObjectMode:Z},objectMode:Q=Z}},optionName:$})=>{if(Q&&!Z)throw TypeError(`The \`${$}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!Q&&Z)throw TypeError(`The \`${$}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...q,value:{transform:J,writableObjectMode:X,readableObjectMode:Z}}},EG=({stdioItem:q,stdioItem:{value:J},index:X,newTransforms:Z,direction:Q})=>{let{transform:$,objectMode:Y}=b(J)?J:{transform:J},{writableObjectMode:H,readableObjectMode:K}=f4(Y,X,Z,Q);return{...q,value:{transform:$,writableObjectMode:H,readableObjectMode:K}}},yG=({stdioItem:q,stdioItem:{value:J},index:X,newTransforms:Z,direction:Q,encoding:$})=>{let{transform:Y,final:H,binary:K=!1,preserveNewlines:G=!1,objectMode:V}=b(J)?J:{transform:J},W=K||V0.has($),{writableObjectMode:U,readableObjectMode:z}=f4(V,X,Z,Q);return{...q,value:{transform:Y,final:H,binary:W,preserveNewlines:G,writableObjectMode:U,readableObjectMode:z}}},SG=(q,J)=>J==="input"?q.reverse():q;import u4 from"node:process";var A9=(q,J,X)=>{let Z=q.map((Q)=>hG(Q,J));if(Z.includes("input")&&Z.includes("output"))throw TypeError(`The \`${X}\` option must not be an array of both readable and writable values.`);return Z.find(Boolean)??fG},hG=({type:q,value:J},X)=>bG[X]??D9[q](J),bG=["input","output","output"],h6=()=>{return},m4=()=>"input",D9={generator:h6,asyncGenerator:h6,fileUrl:h6,filePath:h6,iterable:m4,asyncIterable:m4,uint8Array:m4,webStream:(q)=>n1(q)?"output":"input",nodeStream(q){if(!z6(q,{checkOpen:!1}))return"output";return I4(q,{checkOpen:!1})?void 0:"input"},webTransform:h6,duplex:h6,native(q){let J=gG(q);if(J!==void 0)return J;if(C0(q,{checkOpen:!1}))return D9.nodeStream(q)}},gG=(q)=>{if([0,u4.stdin].includes(q))return"input";if([1,2,u4.stdout,u4.stderr].includes(q))return"output"},fG="output";var I9=(q,J)=>J&&!q.includes("ipc")?[...q,"ipc"]:q;var O9=({stdio:q,ipc:J,buffer:X,...Z},Q,$)=>{let Y=uG(q,Z).map((H,K)=>v9(H,K));return $?dG(Y,X,Q):I9(Y,J)},uG=(q,J)=>{if(q===void 0)return _0.map((Z)=>J[Z]);if(mG(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${_0.map((Z)=>`\`${Z}\``).join(", ")}`);if(typeof q==="string")return[q,q,q];if(!Array.isArray(q))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof q}\``);let X=Math.max(q.length,_0.length);return Array.from({length:X},(Z,Q)=>q[Q])},mG=(q)=>_0.some((J)=>q[J]!==void 0),v9=(q,J)=>{if(Array.isArray(q))return q.map((X)=>v9(X,J));if(q===null||q===void 0)return J>=_0.length?"ignore":"pipe";return q},dG=(q,J,X)=>q.map((Z,Q)=>!J[Q]&&Q!==0&&!D6(X,Q)&&cG(Z)?"ignore":Z),cG=(q)=>q==="pipe"||Array.isArray(q)&&q.every((J)=>J==="pipe");import{readFileSync as lG}from"node:fs";import pG from"node:tty";var E9=({stdioItem:q,stdioItem:{type:J},isStdioArray:X,fdNumber:Z,direction:Q,isSync:$})=>{if(!X||J!=="native")return q;return $?nG({stdioItem:q,fdNumber:Z,direction:Q}):oG({stdioItem:q,fdNumber:Z})},nG=({stdioItem:q,stdioItem:{value:J,optionName:X},fdNumber:Z,direction:Q})=>{let $=iG({value:J,optionName:X,fdNumber:Z,direction:Q});if($!==void 0)return $;if(C0(J,{checkOpen:!1}))throw TypeError(`The \`${X}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return q},iG=({value:q,optionName:J,fdNumber:X,direction:Z})=>{let Q=aG(q,X);if(Q===void 0)return;if(Z==="output")return{type:"fileNumber",value:Q,optionName:J};if(pG.isatty(Q))throw TypeError(`The \`${J}: ${F1(q)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:b0(lG(Q)),optionName:J}},aG=(q,J)=>{if(q==="inherit")return J;if(typeof q==="number")return q;let X=Z1.indexOf(q);if(X!==-1)return X},oG=({stdioItem:q,stdioItem:{value:J,optionName:X},fdNumber:Z})=>{if(J==="inherit")return{type:"nodeStream",value:N9(Z,J,X),optionName:X};if(typeof J==="number")return{type:"nodeStream",value:N9(J,J,X),optionName:X};if(C0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:X};return q},N9=(q,J,X)=>{let Z=Z1[q];if(Z===void 0)throw TypeError(`The \`${X}: ${J}\` option is invalid: no such standard stream.`);return Z};var y9=({input:q,inputFile:J},X)=>X===0?[...rG(q),...tG(J)]:[],rG=(q)=>q===void 0?[]:[{type:sG(q),value:q,optionName:"input"}],sG=(q)=>{if(z6(q,{checkOpen:!1}))return"nodeStream";if(typeof q==="string")return"string";if(f(q))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},tG=(q)=>q===void 0?[]:[{...eG(q),optionName:"inputFile"}],eG=(q)=>{if(p1(q))return{type:"fileUrl",value:q};if(h4(q))return{type:"filePath",value:{file:q}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var S9=(q)=>q.filter((J,X)=>q.every((Z,Q)=>J.value!==Z.value||X>=Q||J.type==="generator"||J.type==="asyncGenerator")),h9=({stdioItem:{type:q,value:J,optionName:X},direction:Z,fileDescriptors:Q,isSync:$})=>{let Y=qW(Q,q);if(Y.length===0)return;if($){JW({otherStdioItems:Y,type:q,value:J,optionName:X,direction:Z});return}if(k9.has(q))return b9({otherStdioItems:Y,type:q,value:J,optionName:X,direction:Z});if(T9.has(q))ZW({otherStdioItems:Y,type:q,value:J,optionName:X})},qW=(q,J)=>q.flatMap(({direction:X,stdioItems:Z})=>Z.filter((Q)=>Q.type===J).map((Q)=>({...Q,direction:X}))),JW=({otherStdioItems:q,type:J,value:X,optionName:Z,direction:Q})=>{if(g4.has(J))b9({otherStdioItems:q,type:J,value:X,optionName:Z,direction:Q})},b9=({otherStdioItems:q,type:J,value:X,optionName:Z,direction:Q})=>{let $=q.filter((H)=>XW(H,X));if($.length===0)return;let Y=$.find((H)=>H.direction!==Q);return g9(Y,Z,J),Q==="output"?$[0].stream:void 0},XW=({type:q,value:J},X)=>{if(q==="filePath")return J.file===X.file;if(q==="fileUrl")return J.href===X.href;return J===X},ZW=({otherStdioItems:q,type:J,value:X,optionName:Z})=>{let Q=q.find(({value:{transform:$}})=>$===X.transform);g9(Q,Z,J)},g9=(q,J,X)=>{if(q!==void 0)throw TypeError(`The \`${q.optionName}\` and \`${J}\` options must not target ${o0[X]} that is the same.`)};var a1=(q,J,X,Z)=>{let $=O9(J,X,Z).map((H,K)=>QW({stdioOption:H,fdNumber:K,options:J,isSync:Z})),Y=UW({initialFileDescriptors:$,addProperties:q,options:J,isSync:Z});return J.stdio=Y.map(({stdioItems:H})=>LW(H)),Y},QW=({stdioOption:q,fdNumber:J,options:X,isSync:Z})=>{let Q=Q1(J),{stdioItems:$,isStdioArray:Y}=$W({stdioOption:q,fdNumber:J,options:X,optionName:Q}),H=A9($,J,Q),K=$.map((W)=>E9({stdioItem:W,isStdioArray:Y,fdNumber:J,direction:H,isSync:Z})),G=P9(K,Q,H,X),V=w9(G,H);return WW(G,V),{direction:H,objectMode:V,stdioItems:G}},$W=({stdioOption:q,fdNumber:J,options:X,optionName:Z})=>{let $=[...(Array.isArray(q)?q:[q]).map((K)=>YW(K,Z)),...y9(X,J)],Y=S9($),H=Y.length>1;return HW(Y,H,Z),VW(Y),{stdioItems:Y,isStdioArray:H}},YW=(q,J)=>({type:L9(q,J),value:q,optionName:J}),HW=(q,J,X)=>{if(q.length===0)throw TypeError(`The \`${X}\` option must not be an empty array.`);if(!J)return;for(let{value:Z,optionName:Q}of q)if(KW.has(Z))throw Error(`The \`${Q}\` option must not include \`${Z}\`.`)},KW=new Set(["ignore","ipc"]),VW=(q)=>{for(let J of q)GW(J)},GW=({type:q,value:J,optionName:X})=>{if(R9(J))throw TypeError(`The \`${X}: URL\` option must use the \`file:\` scheme.
73
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(M9(q,J))throw TypeError(`The \`${X}: { file: '...' }\` option must be used instead of \`${X}: '...'\`.`)},WW=(q,J)=>{if(!J)return;let X=q.find(({type:Z})=>i1.has(Z));if(X!==void 0)throw TypeError(`The \`${X.optionName}\` option cannot use both files and transforms in objectMode.`)},UW=({initialFileDescriptors:q,addProperties:J,options:X,isSync:Z})=>{let Q=[];try{for(let $ of q)Q.push(zW({fileDescriptor:$,fileDescriptors:Q,addProperties:J,options:X,isSync:Z}));return Q}catch($){throw d4(Q),$}},zW=({fileDescriptor:{direction:q,objectMode:J,stdioItems:X},fileDescriptors:Z,addProperties:Q,options:$,isSync:Y})=>{let H=X.map((K)=>_W({stdioItem:K,addProperties:Q,direction:q,options:$,fileDescriptors:Z,isSync:Y}));return{direction:q,objectMode:J,stdioItems:H}},_W=({stdioItem:q,addProperties:J,direction:X,options:Z,fileDescriptors:Q,isSync:$})=>{let Y=h9({stdioItem:q,direction:X,fileDescriptors:Q,isSync:$});if(Y!==void 0)return{...q,stream:Y};return{...q,...J[X][q.type](q,Z)}},d4=(q)=>{for(let{stdioItems:J}of q)for(let{stream:X}of J)if(X!==void 0&&!R0(X))X.destroy()},LW=(q)=>{if(q.length>1)return q.some(({value:Z})=>Z==="overlapped")?"overlapped":"pipe";let[{type:J,value:X}]=q;return J==="native"?X:"pipe"};var m9=(q,J)=>a1(xW,q,J,!0),N0=({type:q,optionName:J})=>{d9(J,o0[q])},BW=({optionName:q,value:J})=>{if(J==="ipc"||J==="overlapped")d9(q,`"${J}"`);return{}},d9=(q,J)=>{throw TypeError(`The \`${q}\` option cannot be ${J} with synchronous methods.`)},u9={generator(){},asyncGenerator:N0,webStream:N0,nodeStream:N0,webTransform:N0,duplex:N0,asyncIterable:N0,native:BW},xW={input:{...u9,fileUrl:({value:q})=>({contents:[b0(f9(q))]}),filePath:({value:{file:q}})=>({contents:[b0(f9(q))]}),fileNumber:N0,iterable:({value:q})=>({contents:[...q]}),string:({value:q})=>({contents:[q]}),uint8Array:({value:q})=>({contents:[q]})},output:{...u9,fileUrl:({value:q})=>({path:q}),filePath:({value:{file:q,append:J}})=>({path:q,append:J}),fileNumber:({value:q})=>({path:q}),iterable:N0,string:N0,uint8Array:N0}};var m0=(q,{stripFinalNewline:J},X)=>c4(J,X)&&q!==void 0&&!Array.isArray(q)?N6(q):q,c4=(q,J)=>J==="all"?q[1]||q[2]:q[J];import{Transform as gW,getDefaultHighWaterMark as e9}from"node:stream";var o1=(q,J,X,Z)=>q||X?void 0:l9(J,Z),p4=(q,J,X)=>X?q.flatMap((Z)=>c9(Z,J)):c9(q,J),c9=(q,J)=>{let{transform:X,final:Z}=l9(J,{});return[...X(q),...Z()]},l9=(q,J)=>{return J.previousChunks="",{transform:jW.bind(void 0,J,q),final:MW.bind(void 0,J)}},jW=function*(q,J,X){if(typeof X!=="string"){yield X;return}let{previousChunks:Z}=q,Q=-1;for(let $=0;$<X.length;$+=1)if(X[$]===`
74
+ `){let Y=RW(X,$,J,q),H=X.slice(Q+1,$+1-Y);if(Z.length>0)H=l4(Z,H),Z="";yield H,Q=$}if(Q!==X.length-1)Z=l4(Z,X.slice(Q+1));q.previousChunks=Z},RW=(q,J,X,Z)=>{if(X)return 0;return Z.isWindowsNewline=J!==0&&q[J-1]==="\r",Z.isWindowsNewline?2:1},MW=function*({previousChunks:q}){if(q.length>0)yield q},p9=({binary:q,preserveNewlines:J,readableObjectMode:X,state:Z})=>q||J||X?void 0:{transform:CW.bind(void 0,Z)},CW=function*({isWindowsNewline:q=!1},J){let{unixNewline:X,windowsNewline:Z,LF:Q,concatBytes:$}=typeof J==="string"?FW:TW;if(J.at(-1)===Q){yield J;return}yield $(J,q?Z:X)},l4=(q,J)=>`${q}${J}`,FW={windowsNewline:`\r
75
75
  `,unixNewline:`
76
76
  `,LF:`
77
- `,concatBytes:d4},zW=(q,J)=>{let X=new Uint8Array(q.length+J.length);return X.set(q,0),X.set(J,q.length),X},_W={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:zW};import{Buffer as LW}from"node:buffer";var u9=(q,J)=>q?void 0:BW.bind(void 0,J),BW=function*(q,J){if(typeof J!=="string"&&!f(J)&&!LW.isBuffer(J))throw TypeError(`The \`${q}\` option's transform must use "objectMode: true" to receive as input: ${typeof J}.`);yield J},m9=(q,J)=>q?xW.bind(void 0,J):jW.bind(void 0,J),xW=function*(q,J){d9(q,J),yield J},jW=function*(q,J){if(d9(q,J),typeof J!=="string"&&!f(J))throw TypeError(`The \`${q}\` option's function must yield a string or an Uint8Array, not ${typeof J}.`);yield J},d9=(q,J)=>{if(J===null||J===void 0)throw TypeError(`The \`${q}\` option's function must not call \`yield ${J}\`.
77
+ `,concatBytes:l4},kW=(q,J)=>{let X=new Uint8Array(q.length+J.length);return X.set(q,0),X.set(J,q.length),X},TW={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:kW};import{Buffer as wW}from"node:buffer";var n9=(q,J)=>q?void 0:PW.bind(void 0,J),PW=function*(q,J){if(typeof J!=="string"&&!f(J)&&!wW.isBuffer(J))throw TypeError(`The \`${q}\` option's transform must use "objectMode: true" to receive as input: ${typeof J}.`);yield J},i9=(q,J)=>q?AW.bind(void 0,J):DW.bind(void 0,J),AW=function*(q,J){a9(q,J),yield J},DW=function*(q,J){if(a9(q,J),typeof J!=="string"&&!f(J))throw TypeError(`The \`${q}\` option's function must yield a string or an Uint8Array, not ${typeof J}.`);yield J},a9=(q,J)=>{if(J===null||J===void 0)throw TypeError(`The \`${q}\` option's function must not call \`yield ${J}\`.
78
78
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
79
- if (condition) { yield value; }`)};import{Buffer as RW}from"node:buffer";import{StringDecoder as MW}from"node:string_decoder";var o1=(q,J,X)=>{if(X)return;if(q)return{transform:CW.bind(void 0,new TextEncoder)};let Z=new MW(J);return{transform:FW.bind(void 0,Z),final:kW.bind(void 0,Z)}},CW=function*(q,J){if(RW.isBuffer(J))yield b0(J);else if(typeof J==="string")yield q.encode(J);else yield J},FW=function*(q,J){yield f(J)?q.write(J):J},kW=function*(q){let J=q.end();if(J!=="")yield J};import{callbackify as c9}from"node:util";var l4=c9(async(q,J,X,Z)=>{J.currentIterable=q(...X);try{for await(let Q of J.currentIterable)Z.push(Q)}finally{delete J.currentIterable}}),r1=async function*(q,J,X){if(X===J.length){yield q;return}let{transform:Z=wW}=J[X];for await(let Q of Z(q))yield*r1(Q,J,X+1)},l9=async function*(q){for(let[J,{final:X}]of Object.entries(q))yield*TW(X,Number(J),q)},TW=async function*(q,J,X){if(q===void 0)return;for await(let Z of q())yield*r1(Z,X,J+1)},p9=c9(async({currentIterable:q},J)=>{if(q!==void 0){await(J?q.throw(J):q.return());return}if(J)throw J}),wW=function*(q){yield q};var p4=(q,J,X,Z)=>{try{for(let Q of q(...J))X.push(Q);Z()}catch(Q){Z(Q)}},n9=(q,J)=>[...J.flatMap((X)=>[...z6(X,q,0)]),...x2(q)],z6=function*(q,J,X){if(X===J.length){yield q;return}let{transform:Z=AW}=J[X];for(let Q of Z(q))yield*z6(Q,J,X+1)},x2=function*(q){for(let[J,{final:X}]of Object.entries(q))yield*PW(X,Number(J),q)},PW=function*(q,J,X){if(q===void 0)return;for(let Z of q())yield*z6(Z,X,J+1)},AW=function*(q){yield q};var n4=({value:q,value:{transform:J,final:X,writableObjectMode:Z,readableObjectMode:Q},optionName:$},{encoding:Y})=>{let H={},K=a9(q,Y,$),G=U6(J),V=U6(X),W=G?l4.bind(void 0,r1,H):p4.bind(void 0,z6),U=G||V?l4.bind(void 0,l9,H):p4.bind(void 0,x2),z=G||V?p9.bind(void 0,H):void 0;return{stream:new DW({writableObjectMode:Z,writableHighWaterMark:i9(Z),readableObjectMode:Q,readableHighWaterMark:i9(Q),transform(L,x,B){W([L,K,0],this,B)},flush(L){U([K],this,L)},destroy:z})}},s1=(q,J,X,Z)=>{let Q=J.filter(({type:Y})=>Y==="generator"),$=Z?Q.reverse():Q;for(let{value:Y,optionName:H}of $){let K=a9(Y,X,H);q=n9(K,q)}return q},a9=({transform:q,final:J,binary:X,writableObjectMode:Z,readableObjectMode:Q,preserveNewlines:$},Y,H)=>{let K={};return[{transform:u9(Z,H)},o1(X,Y,Z),a1(X,$,Z,K),{transform:q,final:J},{transform:m9(Q,H)},f9({binary:X,preserveNewlines:$,readableObjectMode:Q,state:K})].filter(Boolean)};var o9=(q,J)=>{for(let X of IW(q))OW(q,X,J)},IW=(q)=>new Set(Object.entries(q).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),OW=(q,J,X)=>{let{stdioItems:Z}=q[J],Q=Z.filter(({contents:H})=>H!==void 0);if(Q.length===0)return;if(J!==0){let[{type:H,optionName:K}]=Q;throw TypeError(`Only the \`stdin\` option, not \`${K}\`, can be ${o0[H]} with synchronous methods.`)}let Y=Q.map(({contents:H})=>H).map((H)=>vW(H,Z));X.input=V2(Y)},vW=(q,J)=>{let X=s1(q,J,"utf8",!0);return NW(X),V2(X)},NW=(q)=>{let J=q.find((X)=>typeof X!=="string"&&!f(X));if(J!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${J}.`)};import{writeFileSync as hW,appendFileSync as bW}from"node:fs";var t1=({stdioItems:q,encoding:J,verboseInfo:X,fdNumber:Z})=>Z!=="all"&&P6(X,Z)&&!V0.has(J)&&EW(Z)&&(q.some(({type:Q,value:$})=>Q==="native"&&yW.has($))||q.every(({type:Q})=>L0.has(Q))),EW=(q)=>q===1||q===2,yW=new Set(["pipe","overlapped"]),r9=async(q,J,X,Z)=>{for await(let Q of q)if(!SW(J))t9(Q,X,Z)},s9=(q,J,X)=>{for(let Z of q)t9(Z,J,X)},SW=(q)=>q._readableState.pipes.length>0,t9=(q,J,X)=>{let Z=V1(q);D0({type:"output",verboseMessage:Z,fdNumber:J,verboseInfo:X})};var e9=({fileDescriptors:q,syncResult:{output:J},options:X,isMaxBuffer:Z,verboseInfo:Q})=>{if(J===null)return{output:Array.from({length:3})};let $={},Y=new Set([]);return{output:J.map((K,G)=>gW({result:K,fileDescriptors:q,fdNumber:G,state:$,outputFiles:Y,isMaxBuffer:Z,verboseInfo:Q},X)),...$}},gW=({result:q,fileDescriptors:J,fdNumber:X,state:Z,outputFiles:Q,isMaxBuffer:$,verboseInfo:Y},{buffer:H,encoding:K,lines:G,stripFinalNewline:V,maxBuffer:W})=>{if(q===null)return;let U=q9(q,$,W),z=b0(U),{stdioItems:_,objectMode:L}=J[X],x=fW([z],_,K,Z),{serializedResult:B,finalResult:j=B}=uW({chunks:x,objectMode:L,encoding:K,lines:G,stripFinalNewline:V,fdNumber:X});mW({serializedResult:B,fdNumber:X,state:Z,verboseInfo:Y,encoding:K,stdioItems:_,objectMode:L});let R=H[X]?j:void 0;try{if(Z.error===void 0)dW(B,_,Q);return R}catch(F){return Z.error=F,R}},fW=(q,J,X,Z)=>{try{return s1(q,J,X,!1)}catch(Q){return Z.error=Q,q}},uW=({chunks:q,objectMode:J,encoding:X,lines:Z,stripFinalNewline:Q,fdNumber:$})=>{if(J)return{serializedResult:q};if(X==="buffer")return{serializedResult:V2(q)};let Y=J5(q,X);if(Z[$])return{serializedResult:Y,finalResult:c4(Y,!Q[$],J)};return{serializedResult:Y}},mW=({serializedResult:q,fdNumber:J,state:X,verboseInfo:Z,encoding:Q,stdioItems:$,objectMode:Y})=>{if(!t1({stdioItems:$,encoding:Q,verboseInfo:Z,fdNumber:J}))return;let H=c4(q,!1,Y);try{s9(H,J,Z)}catch(K){X.error??=K}},dW=(q,J,X)=>{for(let{path:Z,append:Q}of J.filter(({type:$})=>n1.has($))){let $=typeof Z==="string"?Z:Z.toString();if(Q||X.has($))bW(Z,q);else X.add($),hW(Z,q)}};var qJ=([,q,J],X)=>{if(!X.all)return;if(q===void 0)return J;if(J===void 0)return q;if(Array.isArray(q))return Array.isArray(J)?[...q,...J]:[...q,m0(J,X,"all")];if(Array.isArray(J))return[m0(q,X,"all"),...J];if(f(q)&&f(J))return H4([q,J]);return`${q}${J}`};import{once as i4}from"node:events";var JJ=async(q,J)=>{let[X,Z]=await cW(q);return J.isForcefullyTerminated??=!1,[X,Z]},cW=async(q)=>{let[J,X]=await Promise.allSettled([i4(q,"spawn"),i4(q,"exit")]);if(J.status==="rejected")return[];return X.status==="rejected"?XJ(q):X.value},XJ=async(q)=>{try{return await i4(q,"exit")}catch{return XJ(q)}},ZJ=async(q)=>{let[J,X]=await q;if(!lW(J,X)&&a4(J,X))throw new I0;return[J,X]},lW=(q,J)=>q===void 0&&J===void 0,a4=(q,J)=>q!==0||J!==null;var QJ=({error:q,status:J,signal:X,output:Z},{maxBuffer:Q})=>{let $=pW(q,J,X),Y=$?.code==="ETIMEDOUT",H=eq($,Z,Q);return{resultError:$,exitCode:J,signal:X,timedOut:Y,isMaxBuffer:H}},pW=(q,J,X)=>{if(q!==void 0)return q;return a4(J,X)?new I0:void 0};var $J=(q,J,X)=>{let{file:Z,commandArguments:Q,command:$,escapedCommand:Y,startTime:H,verboseInfo:K,options:G,fileDescriptors:V}=iW(q,J,X),W=rW({file:Z,commandArguments:Q,options:G,command:$,escapedCommand:Y,verboseInfo:K,fileDescriptors:V,startTime:H});return E6(W,K,G)},iW=(q,J,X)=>{let{command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y}=W1(q,J,X),H=aW(X),{file:K,commandArguments:G,options:V}=E1(q,J,H);oW(V);let W=S9(V,Y);return{file:K,commandArguments:G,command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y,options:V,fileDescriptors:W}},aW=(q)=>q.node&&!q.ipc?{...q,ipc:!1}:q,oW=({ipc:q,ipcInput:J,detached:X,cancelSignal:Z})=>{if(J)e1("ipcInput");if(q)e1("ipc: true");if(X)e1("detached: true");if(Z)e1("cancelSignal")},e1=(q)=>{throw TypeError(`The "${q}" option cannot be used with synchronous methods.`)},rW=({file:q,commandArguments:J,options:X,command:Z,escapedCommand:Q,verboseInfo:$,fileDescriptors:Y,startTime:H})=>{let K=sW({file:q,commandArguments:J,options:X,command:Z,escapedCommand:Q,fileDescriptors:Y,startTime:H});if(K.failed)return K;let{resultError:G,exitCode:V,signal:W,timedOut:U,isMaxBuffer:z}=QJ(K,X),{output:_,error:L=G}=e9({fileDescriptors:Y,syncResult:K,options:X,isMaxBuffer:z,verboseInfo:$}),x=_.map((j,R)=>m0(j,X,R)),B=m0(qJ(_,X),X,"all");return eW({error:L,exitCode:V,signal:W,timedOut:U,isMaxBuffer:z,stdio:x,all:B,options:X,command:Z,escapedCommand:Q,startTime:H})},sW=({file:q,commandArguments:J,options:X,command:Z,escapedCommand:Q,fileDescriptors:$,startTime:Y})=>{try{o9($,X);let H=tW(X);return nW(...y1(q,J,H))}catch(H){return N6({error:H,command:Z,escapedCommand:Q,fileDescriptors:$,options:X,startTime:Y,isSync:!0})}},tW=({encoding:q,maxBuffer:J,...X})=>({...X,encoding:"buffer",maxBuffer:d1(J)}),eW=({error:q,exitCode:J,signal:X,timedOut:Z,isMaxBuffer:Q,stdio:$,all:Y,options:H,command:K,escapedCommand:G,startTime:V})=>q===void 0?c1({command:K,escapedCommand:G,stdio:$,all:Y,ipcOutput:[],options:H,startTime:V}):B2({error:q,command:K,escapedCommand:G,timedOut:Z,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:Q,isForcefullyTerminated:!1,exitCode:J,signal:X,stdio:$,all:Y,ipcOutput:[],options:H,startTime:V,isSync:!0});import{setMaxListeners as uz}from"node:events";import{spawn as mz}from"node:child_process";import GJ from"node:process";import{once as o4,on as qU}from"node:events";var YJ=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z},{reference:Q=!0,filter:$}={})=>{return A6({methodName:"getOneMessage",isSubprocess:X,ipc:Z,isConnected:A1(q)}),JU({anyProcess:q,channel:J,isSubprocess:X,filter:$,reference:Q})},JU=async({anyProcess:q,channel:J,isSubprocess:X,filter:Z,reference:Q})=>{k1(J,Q);let $=a0(q,J,X),Y=new AbortController;try{return await Promise.race([XU($,Z,Y),ZU($,X,Y),QU($,X,Y)])}catch(H){throw D6(q),H}finally{Y.abort(),T1(J,Q)}},XU=async(q,J,{signal:X})=>{if(J===void 0){let[Z]=await o4(q,"message",{signal:X});return Z}for await(let[Z]of qU(q,"message",{signal:X}))if(J(Z))return Z},ZU=async(q,J,{signal:X})=>{await o4(q,"disconnect",{signal:X}),l5(J)},QU=async(q,J,{signal:X})=>{let[Z]=await o4(q,"strict:error",{signal:X});throw M1(Z,J)};import{once as KJ,on as $U}from"node:events";var VJ=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z},{reference:Q=!0}={})=>r4({anyProcess:q,channel:J,isSubprocess:X,ipc:Z,shouldAwait:!X,reference:Q}),r4=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z,shouldAwait:Q,reference:$})=>{A6({methodName:"getEachMessage",isSubprocess:X,ipc:Z,isConnected:A1(q)}),k1(J,$);let Y=a0(q,J,X),H=new AbortController,K={};return YU(q,Y,H),HU({ipcEmitter:Y,isSubprocess:X,controller:H,state:K}),KU({anyProcess:q,channel:J,ipcEmitter:Y,isSubprocess:X,shouldAwait:Q,controller:H,state:K,reference:$})},YU=async(q,J,X)=>{try{await KJ(J,"disconnect",{signal:X.signal}),X.abort()}catch{}},HU=async({ipcEmitter:q,isSubprocess:J,controller:X,state:Z})=>{try{let[Q]=await KJ(q,"strict:error",{signal:X.signal});Z.error=M1(Q,J),X.abort()}catch{}},KU=async function*({anyProcess:q,channel:J,ipcEmitter:X,isSubprocess:Z,shouldAwait:Q,controller:$,state:Y,reference:H}){try{for await(let[K]of $U(X,"message",{signal:$.signal}))HJ(Y),yield K}catch{HJ(Y)}finally{if($.abort(),T1(J,H),!Z)D6(q);if(Q)await q}},HJ=({error:q})=>{if(q)throw q};var WJ=(q,{ipc:J})=>{Object.assign(q,zJ(q,!1,J))},UJ=()=>{let q=GJ,J=!0,X=GJ.channel!==void 0;return{...zJ(q,!0,X),getCancelSignal:xq.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:!0,ipc:X})}},zJ=(q,J,X)=>({sendMessage:v1.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:J,ipc:X}),getOneMessage:YJ.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:J,ipc:X}),getEachMessage:VJ.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:J,ipc:X})});import{ChildProcess as VU}from"node:child_process";import{PassThrough as GU,Readable as WU,Writable as UU,Duplex as zU}from"node:stream";var _J=({error:q,command:J,escapedCommand:X,fileDescriptors:Z,options:Q,startTime:$,verboseInfo:Y})=>{u4(Z);let H=new VU;_U(H,Z),Object.assign(H,{readable:LU,writable:BU,duplex:xU});let K=N6({error:q,command:J,escapedCommand:X,fileDescriptors:Z,options:Q,startTime:$,isSync:!1}),G=jU(K,Y,Q);return{subprocess:H,promise:G}},_U=(q,J)=>{let X=j2(),Z=j2(),Q=j2(),$=Array.from({length:J.length-3},j2),Y=j2(),H=[X,Z,Q,...$];Object.assign(q,{stdin:X,stdout:Z,stderr:Q,all:Y,stdio:H})},j2=()=>{let q=new GU;return q.end(),q},LU=()=>new WU({read(){}}),BU=()=>new UU({write(){}}),xU=()=>new zU({read(){},write(){}}),jU=async(q,J,X)=>E6(q,J,X);import{createReadStream as LJ,createWriteStream as BJ}from"node:fs";import{Buffer as RU}from"node:buffer";import{Readable as R2,Writable as MU,Duplex as CU}from"node:stream";var jJ=(q,J)=>i1(FU,q,J,!1),M2=({type:q,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${o0[q]}.`)},xJ={fileNumber:M2,generator:n4,asyncGenerator:n4,nodeStream:({value:q})=>({stream:q}),webTransform({value:{transform:q,writableObjectMode:J,readableObjectMode:X}}){let Z=J||X;return{stream:CU.fromWeb(q,{objectMode:Z})}},duplex:({value:{transform:q}})=>({stream:q}),native(){}},FU={input:{...xJ,fileUrl:({value:q})=>({stream:LJ(q)}),filePath:({value:{file:q}})=>({stream:LJ(q)}),webStream:({value:q})=>({stream:R2.fromWeb(q)}),iterable:({value:q})=>({stream:R2.from(q)}),asyncIterable:({value:q})=>({stream:R2.from(q)}),string:({value:q})=>({stream:R2.from(q)}),uint8Array:({value:q})=>({stream:R2.from(RU.from(q))})},output:{...xJ,fileUrl:({value:q})=>({stream:BJ(q)}),filePath:({value:{file:q,append:J}})=>({stream:BJ(q,J?{flags:"a"}:{})}),webStream:({value:q})=>({stream:MU.fromWeb(q)}),iterable:M2,asyncIterable:M2,string:M2,uint8Array:M2}};import{on as kU,once as RJ}from"node:events";import{PassThrough as TU,getDefaultHighWaterMark as wU}from"node:stream";import{finished as FJ}from"node:stream/promises";function _6(q){if(!Array.isArray(q))throw TypeError(`Expected an array, got \`${typeof q}\`.`);for(let Q of q)s4(Q);let J=q.some(({readableObjectMode:Q})=>Q),X=PU(q,J),Z=new kJ({objectMode:J,writableHighWaterMark:X,readableHighWaterMark:X});for(let Q of q)Z.add(Q);return Z}var PU=(q,J)=>{if(q.length===0)return wU(J);let X=q.filter(({readableObjectMode:Z})=>Z===J).map(({readableHighWaterMark:Z})=>Z);return Math.max(...X)};class kJ extends TU{#q=new Set([]);#X=new Set([]);#J=new Set([]);#Z;#$=Symbol("unpipe");#V=new WeakMap;add(q){if(s4(q),this.#q.has(q))return;this.#q.add(q),this.#Z??=AU(this,this.#q,this.#$);let J=OU({passThroughStream:this,stream:q,streams:this.#q,ended:this.#X,aborted:this.#J,onFinished:this.#Z,unpipeEvent:this.#$});this.#V.set(q,J),q.pipe(this,{end:!1})}async remove(q){if(s4(q),!this.#q.has(q))return!1;let J=this.#V.get(q);if(J===void 0)return!1;return this.#V.delete(q),q.unpipe(this),await J,!0}}var AU=async(q,J,X)=>{q8(q,MJ);let Z=new AbortController;try{await Promise.race([DU(q,Z),IU(q,J,X,Z)])}finally{Z.abort(),q8(q,-MJ)}},DU=async(q,{signal:J})=>{try{await FJ(q,{signal:J,cleanup:!0})}catch(X){throw TJ(q,X),X}},IU=async(q,J,X,{signal:Z})=>{for await(let[Q]of kU(q,"unpipe",{signal:Z}))if(J.has(Q))Q.emit(X)},s4=(q)=>{if(typeof q?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof q}\`.`)},OU=async({passThroughStream:q,stream:J,streams:X,ended:Z,aborted:Q,onFinished:$,unpipeEvent:Y})=>{q8(q,CJ);let H=new AbortController;try{await Promise.race([vU($,J,H),NU({passThroughStream:q,stream:J,streams:X,ended:Z,aborted:Q,controller:H}),EU({stream:J,streams:X,ended:Z,aborted:Q,unpipeEvent:Y,controller:H})])}finally{H.abort(),q8(q,-CJ)}if(X.size>0&&X.size===Z.size+Q.size)if(Z.size===0&&Q.size>0)t4(q);else yU(q)},vU=async(q,J,{signal:X})=>{try{if(await q,!X.aborted)t4(J)}catch(Z){if(!X.aborted)TJ(J,Z)}},NU=async({passThroughStream:q,stream:J,streams:X,ended:Z,aborted:Q,controller:{signal:$}})=>{try{if(await FJ(J,{signal:$,cleanup:!0,readable:!0,writable:!1}),X.has(J))Z.add(J)}catch(Y){if($.aborted||!X.has(J))return;if(wJ(Y))Q.add(J);else PJ(q,Y)}},EU=async({stream:q,streams:J,ended:X,aborted:Z,unpipeEvent:Q,controller:{signal:$}})=>{if(await RJ(q,Q,{signal:$}),!q.readable)return RJ($,"abort",{signal:$});J.delete(q),X.delete(q),Z.delete(q)},yU=(q)=>{if(q.writable)q.end()},TJ=(q,J)=>{if(wJ(J))t4(q);else PJ(q,J)},wJ=(q)=>q?.code==="ERR_STREAM_PREMATURE_CLOSE",t4=(q)=>{if(q.readable||q.writable)q.destroy()},PJ=(q,J)=>{if(!q.destroyed)q.once("error",SU),q.destroy(J)},SU=()=>{},q8=(q,J)=>{let X=q.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)q.setMaxListeners(X+J)},MJ=2,CJ=1;import{finished as AJ}from"node:stream/promises";var S6=(q,J)=>{q.pipe(J),hU(q,J),bU(q,J)},hU=async(q,J)=>{if(R0(q)||R0(J))return;try{await AJ(q,{cleanup:!0,readable:!0,writable:!1})}catch{}e4(J)},e4=(q)=>{if(q.writable)q.end()},bU=async(q,J)=>{if(R0(q)||R0(J))return;try{await AJ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}q3(q)},q3=(q)=>{if(q.readable)q.destroy()};var DJ=(q,J,X)=>{let Z=new Map;for(let[Q,{stdioItems:$,direction:Y}]of Object.entries(J)){for(let{stream:H}of $.filter(({type:K})=>L0.has(K)))gU(q,H,Y,Q);for(let{stream:H}of $.filter(({type:K})=>!L0.has(K)))uU({subprocess:q,stream:H,direction:Y,fdNumber:Q,pipeGroups:Z,controller:X})}for(let[Q,$]of Z.entries()){let Y=$.length===1?$[0]:_6($);S6(Y,Q)}},gU=(q,J,X,Z)=>{if(X==="output")S6(q.stdio[Z],J);else S6(J,q.stdio[Z]);let Q=fU[Z];if(Q!==void 0)q[Q]=J;q.stdio[Z]=J},fU=["stdin","stdout","stderr"],uU=({subprocess:q,stream:J,direction:X,fdNumber:Z,pipeGroups:Q,controller:$})=>{if(J===void 0)return;mU(J,$);let[Y,H]=X==="output"?[J,q.stdio[Z]]:[q.stdio[Z],J],K=Q.get(Y)??[];Q.set(Y,[...K,H])},mU=(q,{signal:J})=>{if(R0(q))G6(q,dU,J)},dU=2;import{addAbortListener as pU}from"node:events";var L6=[];L6.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")L6.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")L6.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var J8=(q)=>!!q&&typeof q==="object"&&typeof q.removeListener==="function"&&typeof q.emit==="function"&&typeof q.reallyExit==="function"&&typeof q.listeners==="function"&&typeof q.kill==="function"&&typeof q.pid==="number"&&typeof q.on==="function",J3=Symbol.for("signal-exit emitter"),X3=globalThis,cU=Object.defineProperty.bind(Object);class IJ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(X3[J3])return X3[J3];cU(X3,J3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(q,J){this.listeners[q].push(J)}removeListener(q,J){let X=this.listeners[q],Z=X.indexOf(J);if(Z===-1)return;if(Z===0&&X.length===1)X.length=0;else X.splice(Z,1)}emit(q,J,X){if(this.emitted[q])return!1;this.emitted[q]=!0;let Z=!1;for(let Q of this.listeners[q])Z=Q(J,X)===!0||Z;if(q==="exit")Z=this.emit("afterExit",J,X)||Z;return Z}}class Q3{}var lU=(q)=>{return{onExit(J,X){return q.onExit(J,X)},load(){return q.load()},unload(){return q.unload()}}};class OJ extends Q3{onExit(){return()=>{}}load(){}unload(){}}class vJ extends Q3{#q=Z3.platform==="win32"?"SIGINT":"SIGHUP";#X=new IJ;#J;#Z;#$;#V={};#U=!1;constructor(q){super();this.#J=q,this.#V={};for(let J of L6)this.#V[J]=()=>{let X=this.#J.listeners(J),{count:Z}=this.#X,Q=q;if(typeof Q.__signal_exit_emitter__==="object"&&typeof Q.__signal_exit_emitter__.count==="number")Z+=Q.__signal_exit_emitter__.count;if(X.length===Z){this.unload();let $=this.#X.emit("exit",null,J),Y=J==="SIGHUP"?this.#q:J;if(!$)q.kill(q.pid,Y)}};this.#$=q.reallyExit,this.#Z=q.emit}onExit(q,J){if(!J8(this.#J))return()=>{};if(this.#U===!1)this.load();let X=J?.alwaysLast?"afterExit":"exit";return this.#X.on(X,q),()=>{if(this.#X.removeListener(X,q),this.#X.listeners.exit.length===0&&this.#X.listeners.afterExit.length===0)this.unload()}}load(){if(this.#U)return;this.#U=!0,this.#X.count+=1;for(let q of L6)try{let J=this.#V[q];if(J)this.#J.on(q,J)}catch(J){}this.#J.emit=(q,...J)=>{return this.#H(q,...J)},this.#J.reallyExit=(q)=>{return this.#W(q)}}unload(){if(!this.#U)return;this.#U=!1,L6.forEach((q)=>{let J=this.#V[q];if(!J)throw Error("Listener not defined for signal: "+q);try{this.#J.removeListener(q,J)}catch(X){}}),this.#J.emit=this.#Z,this.#J.reallyExit=this.#$,this.#X.count-=1}#W(q){if(!J8(this.#J))return 0;return this.#J.exitCode=q||0,this.#X.emit("exit",this.#J.exitCode,null),this.#$.call(this.#J,this.#J.exitCode)}#H(q,...J){let X=this.#Z;if(q==="exit"&&J8(this.#J)){if(typeof J[0]==="number")this.#J.exitCode=J[0];let Z=X.call(this.#J,q,...J);return this.#X.emit("exit",this.#J.exitCode,null),Z}else return X.call(this.#J,q,...J)}}var Z3=globalThis.process,{onExit:NJ,load:GA,unload:WA}=lU(J8(Z3)?new vJ(Z3):new OJ);var EJ=(q,{cleanup:J,detached:X},{signal:Z})=>{if(!J||X)return;let Q=NJ(()=>{q.kill()});pU(Z,()=>{Q()})};var SJ=({source:q,sourcePromise:J,boundOptions:X,createNested:Z},...Q)=>{let $=G1(),{destination:Y,destinationStream:H,destinationError:K,from:G,unpipeSignal:V}=nU(X,Z,Q),{sourceStream:W,sourceError:U}=aU(q,G),{options:z,fileDescriptors:_}=v0.get(q);return{sourcePromise:J,sourceStream:W,sourceOptions:z,sourceError:U,destination:Y,destinationStream:H,destinationError:K,unpipeSignal:V,fileDescriptors:_,startTime:$}},nU=(q,J,X)=>{try{let{destination:Z,pipeOptions:{from:Q,to:$,unpipeSignal:Y}={}}=iU(q,J,...X),H=F1(Z,$);return{destination:Z,destinationStream:H,from:Q,unpipeSignal:Y}}catch(Z){return{destinationError:Z}}},iU=(q,J,X,...Z)=>{if(Array.isArray(X))return{destination:J(yJ,q)(X,...Z),pipeOptions:q};if(typeof X==="string"||X instanceof URL||$4(X)){if(Object.keys(q).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[Q,$,Y]=q1(X,...Z);return{destination:J(yJ)(Q,$,Y),pipeOptions:Y}}if(v0.has(X)){if(Object.keys(q).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:X,pipeOptions:Z[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${X}`)},yJ=({options:q})=>({options:{...q,stdin:"pipe",piped:!0}}),aU=(q,J)=>{try{return{sourceStream:I6(q,J)}}catch(X){return{sourceError:X}}};var bJ=({sourceStream:q,sourceError:J,destinationStream:X,destinationError:Z,fileDescriptors:Q,sourceOptions:$,startTime:Y})=>{let H=oU({sourceStream:q,sourceError:J,destinationStream:X,destinationError:Z});if(H!==void 0)throw $3({error:H,fileDescriptors:Q,sourceOptions:$,startTime:Y})},oU=({sourceStream:q,sourceError:J,destinationStream:X,destinationError:Z})=>{if(J!==void 0&&Z!==void 0)return Z;if(Z!==void 0)return q3(q),Z;if(J!==void 0)return e4(X),J},$3=({error:q,fileDescriptors:J,sourceOptions:X,startTime:Z})=>N6({error:q,command:hJ,escapedCommand:hJ,fileDescriptors:J,options:X,startTime:Z,isSync:!1}),hJ="source.pipe(destination)";var gJ=async(q)=>{let[{status:J,reason:X,value:Z=X},{status:Q,reason:$,value:Y=$}]=await q;if(!Y.pipedFrom.includes(Z))Y.pipedFrom.push(Z);if(Q==="rejected")throw Y;if(J==="rejected")throw Z;return Y};import{finished as rU}from"node:stream/promises";var fJ=(q,J,X)=>{let Z=X8.has(J)?tU(q,J):sU(q,J);return G6(q,qz,X.signal),G6(J,Jz,X.signal),eU(J),Z},sU=(q,J)=>{let X=_6([q]);return S6(X,J),X8.set(J,X),X},tU=(q,J)=>{let X=X8.get(J);return X.add(q),X},eU=async(q)=>{try{await rU(q,{cleanup:!0,readable:!1,writable:!0})}catch{}X8.delete(q)},X8=new WeakMap,qz=2,Jz=1;import{aborted as Xz}from"node:util";var uJ=(q,J)=>q===void 0?[]:[Zz(q,J)],Zz=async(q,{sourceStream:J,mergedStream:X,fileDescriptors:Z,sourceOptions:Q,startTime:$})=>{await Xz(q,J),await X.remove(J);let Y=Error("Pipe canceled by `unpipeSignal` option.");throw $3({error:Y,fileDescriptors:Z,sourceOptions:Q,startTime:$})};var Z8=(q,...J)=>{if(b(J[0]))return Z8.bind(void 0,{...q,boundOptions:{...q.boundOptions,...J[0]}});let{destination:X,...Z}=SJ(q,...J),Q=Qz({...Z,destination:X});return Q.pipe=Z8.bind(void 0,{...q,source:X,sourcePromise:Q,boundOptions:{}}),Q},Qz=async({sourcePromise:q,sourceStream:J,sourceOptions:X,sourceError:Z,destination:Q,destinationStream:$,destinationError:Y,unpipeSignal:H,fileDescriptors:K,startTime:G})=>{let V=$z(q,Q);bJ({sourceStream:J,sourceError:Z,destinationStream:$,destinationError:Y,fileDescriptors:K,sourceOptions:X,startTime:G});let W=new AbortController;try{let U=fJ(J,$,W);return await Promise.race([gJ(V),...uJ(H,{sourceStream:J,mergedStream:U,sourceOptions:X,fileDescriptors:K,startTime:G})])}finally{W.abort()}},$z=(q,J)=>Promise.allSettled([q,J]);import{setImmediate as Uz}from"node:timers/promises";import{on as Yz}from"node:events";import{getDefaultHighWaterMark as Hz}from"node:stream";var Q8=({subprocessStdout:q,subprocess:J,binary:X,shouldEncode:Z,encoding:Q,preserveNewlines:$})=>{let Y=new AbortController;return Kz(J,Y),dJ({stream:q,controller:Y,binary:X,shouldEncode:!q.readableObjectMode&&Z,encoding:Q,shouldSplit:!q.readableObjectMode,preserveNewlines:$})},Kz=async(q,J)=>{try{await q}catch{}finally{J.abort()}},Y3=({stream:q,onStreamEnd:J,lines:X,encoding:Z,stripFinalNewline:Q,allMixed:$})=>{let Y=new AbortController;Vz(J,Y,q);let H=q.readableObjectMode&&!$;return dJ({stream:q,controller:Y,binary:Z==="buffer",shouldEncode:!H,encoding:Z,shouldSplit:!H&&X,preserveNewlines:!Q})},Vz=async(q,J,X)=>{try{await q}catch{X.destroy()}finally{J.abort()}},dJ=({stream:q,controller:J,binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y})=>{let H=Yz(q,"data",{signal:J.signal,highWaterMark:mJ,highWatermark:mJ});return Gz({onStdoutChunk:H,controller:J,binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y})},H3=Hz(!0),mJ=H3,Gz=async function*({onStdoutChunk:q,controller:J,binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y}){let H=Wz({binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y});try{for await(let[K]of q)yield*z6(K,H,0)}catch(K){if(!J.signal.aborted)throw K}finally{yield*x2(H)}},Wz=({binary:q,shouldEncode:J,encoding:X,shouldSplit:Z,preserveNewlines:Q})=>[o1(q,X,!J),a1(q,Q,!Z,{})].filter(Boolean);var cJ=async({stream:q,onStreamEnd:J,fdNumber:X,encoding:Z,buffer:Q,maxBuffer:$,lines:Y,allMixed:H,stripFinalNewline:K,verboseInfo:G,streamInfo:V})=>{let W=zz({stream:q,onStreamEnd:J,fdNumber:X,encoding:Z,allMixed:H,verboseInfo:G,streamInfo:V});if(!Q){await Promise.all([_z(q),W]);return}let U=m4(K,X),z=Y3({stream:q,onStreamEnd:J,lines:Y,encoding:Z,stripFinalNewline:U,allMixed:H}),[_]=await Promise.all([Lz({stream:q,iterable:z,fdNumber:X,encoding:Z,maxBuffer:$,lines:Y}),W]);return _},zz=async({stream:q,onStreamEnd:J,fdNumber:X,encoding:Z,allMixed:Q,verboseInfo:$,streamInfo:{fileDescriptors:Y}})=>{if(!t1({stdioItems:Y[X]?.stdioItems,encoding:Z,verboseInfo:$,fdNumber:X}))return;let H=Y3({stream:q,onStreamEnd:J,lines:!0,encoding:Z,stripFinalNewline:!0,allMixed:Q});await r9(H,q,X,$)},_z=async(q)=>{if(await Uz(),q.readableFlowing===null)q.resume()},Lz=async({stream:q,stream:{readableObjectMode:J},iterable:X,fdNumber:Z,encoding:Q,maxBuffer:$,lines:Y})=>{try{if(J||Y)return await g1(X,{maxBuffer:$});if(Q==="buffer")return new Uint8Array(await f1(X,{maxBuffer:$}));return await m1(X,{maxBuffer:$})}catch(H){return lJ(rq({error:H,stream:q,readableObjectMode:J,lines:Y,encoding:Q,fdNumber:Z}))}},K3=async(q)=>{try{return await q}catch(J){return lJ(J)}},lJ=({bufferedData:q})=>e7(q)?new Uint8Array(q):q;import{finished as Bz}from"node:stream/promises";var C2=async(q,J,X,{isSameDirection:Z,stopOnExit:Q=!1}={})=>{let $=xz(q,X),Y=new AbortController;try{await Promise.race([...Q?[X.exitPromise]:[],Bz(q,{cleanup:!0,signal:Y.signal})])}catch(H){if(!$.stdinCleanedUp)Mz(H,J,X,Z)}finally{Y.abort()}},xz=(q,{originalStreams:[J],subprocess:X})=>{let Z={stdinCleanedUp:!1};if(q===J)jz(q,X,Z);return Z},jz=(q,J,X)=>{let{_destroy:Z}=q;q._destroy=(...Q)=>{Rz(J,X),Z.call(q,...Q)}},Rz=({exitCode:q,signalCode:J},X)=>{if(q!==null||J!==null)X.stdinCleanedUp=!0},Mz=(q,J,X,Z)=>{if(!Cz(q,J,X,Z))throw q},Cz=(q,J,X,Z=!0)=>{if(X.propagating)return pJ(q)||$8(q);return X.propagating=!0,V3(X,J)===Z?pJ(q):$8(q)},V3=({fileDescriptors:q},J)=>J!=="all"&&q[J].direction==="input",$8=(q)=>q?.code==="ERR_STREAM_PREMATURE_CLOSE",pJ=(q)=>q?.code==="EPIPE";var nJ=({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>q.stdio.map((K,G)=>G3({stream:K,fdNumber:G,encoding:J,buffer:X[G],maxBuffer:Z[G],lines:Q[G],allMixed:!1,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})),G3=async({stream:q,fdNumber:J,encoding:X,buffer:Z,maxBuffer:Q,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:G})=>{if(!q)return;let V=C2(q,J,G);if(V3(G,J)){await V;return}let[W]=await Promise.all([cJ({stream:q,onStreamEnd:V,fdNumber:J,encoding:X,buffer:Z,maxBuffer:Q,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:G}),V]);return W};var iJ=({stdout:q,stderr:J},{all:X})=>X&&(q||J)?_6([q,J].filter(Boolean)):void 0,aJ=({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>G3({...Fz(q,X),fdNumber:"all",encoding:J,maxBuffer:Z[1]+Z[2],lines:Q[1]||Q[2],allMixed:kz(q),stripFinalNewline:$,verboseInfo:Y,streamInfo:H}),Fz=({stdout:q,stderr:J,all:X},[,Z,Q])=>{let $=Z||Q;if(!$)return{stream:X,buffer:$};if(!Z)return{stream:J,buffer:$};if(!Q)return{stream:q,buffer:$};return{stream:X,buffer:$}},kz=({all:q,stdout:J,stderr:X})=>q&&J&&X&&J.readableObjectMode!==X.readableObjectMode;import{once as Tz}from"node:events";var oJ=(q)=>P6(q,"ipc"),rJ=(q,J)=>{let X=V1(q);D0({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:J})};var sJ=async({subprocess:q,buffer:J,maxBuffer:X,ipc:Z,ipcOutput:Q,verboseInfo:$})=>{if(!Z)return Q;let Y=oJ($),H=g0(J,"ipc"),K=g0(X,"ipc");for await(let G of r4({anyProcess:q,channel:q.channel,isSubprocess:!1,ipc:Z,shouldAwait:!1,reference:!0})){if(H)sq(q,Q,K),Q.push(G);if(Y)rJ(G,$)}return Q},tJ=async(q,J)=>{return await Promise.allSettled([q]),J};var eJ=async({subprocess:q,options:{encoding:J,buffer:X,maxBuffer:Z,lines:Q,timeoutDuration:$,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,stripFinalNewline:G,ipc:V,ipcInput:W},context:U,verboseInfo:z,fileDescriptors:_,originalStreams:L,onInternalError:x,controller:B})=>{let j=JJ(q,U),R={originalStreams:L,fileDescriptors:_,subprocess:q,exitPromise:j,propagating:!1},F=nJ({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:G,verboseInfo:z,streamInfo:R}),C=aJ({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:G,verboseInfo:z,streamInfo:R}),y=[],O=sJ({subprocess:q,buffer:X,maxBuffer:Z,ipc:V,ipcOutput:y,verboseInfo:z}),g=wz(L,q,R),M=Pz(_,R);try{return await Promise.race([Promise.all([{},ZJ(j),Promise.all(F),C,O,Aq(q,W),...g,...M]),x,Az(q,B),...Fq(q,$,U,B),...c5({subprocess:q,cancelSignal:Y,gracefulCancel:H,context:U,controller:B}),...Mq({subprocess:q,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,context:U,controller:B})])}catch(P){return U.terminationReason??="other",Promise.all([{error:P},j,Promise.all(F.map((A)=>K3(A))),K3(C),tJ(O,y),Promise.allSettled(g),Promise.allSettled(M)])}},wz=(q,J,X)=>q.map((Z,Q)=>Z===J.stdio[Q]?void 0:C2(Z,Q,X)),Pz=(q,J)=>q.flatMap(({stdioItems:X},Z)=>X.filter(({value:Q,stream:$=Q})=>C0($,{checkOpen:!1})&&!R0($)).map(({type:Q,value:$,stream:Y=$})=>C2(Y,Z,J,{isSameDirection:L0.has(Q),stopOnExit:Q==="native"}))),Az=async(q,{signal:J})=>{let[X]=await Tz(q,"error",{signal:J});throw X};var qX=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),F2=(q,J,X)=>{let Z=q[X];if(!Z.has(J))Z.set(J,[]);let Q=Z.get(J),$=O0();return Q.push($),{resolve:$.resolve.bind($),promises:Q}},h6=async({resolve:q,promises:J},X)=>{q();let[Z]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...J])]);return!Z};import{Readable as Dz}from"node:stream";import{callbackify as Iz}from"node:util";import{finished as JX}from"node:stream/promises";var W3=async(q)=>{if(q===void 0)return;try{await U3(q)}catch{}},XX=async(q)=>{if(q===void 0)return;try{await z3(q)}catch{}},U3=async(q)=>{await JX(q,{cleanup:!0,readable:!1,writable:!0})},z3=async(q)=>{await JX(q,{cleanup:!0,readable:!0,writable:!1})},Y8=async(q,J)=>{if(await q,J)throw J},H8=(q,J,X)=>{if(X&&!$8(X))q.destroy(X);else if(J)q.destroy()};var ZX=({subprocess:q,concurrentStreams:J,encoding:X},{from:Z,binary:Q=!0,preserveNewlines:$=!0}={})=>{let Y=Q||V0.has(X),{subprocessStdout:H,waitReadableDestroy:K}=_3(q,Z,J),{readableEncoding:G,readableObjectMode:V,readableHighWaterMark:W}=L3(H,Y),{read:U,onStdoutDataDone:z}=B3({subprocessStdout:H,subprocess:q,binary:Y,encoding:X,preserveNewlines:$}),_=new Dz({read:U,destroy:Iz(j3.bind(void 0,{subprocessStdout:H,subprocess:q,waitReadableDestroy:K})),highWaterMark:W,objectMode:V,encoding:G});return x3({subprocessStdout:H,onStdoutDataDone:z,readable:_,subprocess:q}),_},_3=(q,J,X)=>{let Z=I6(q,J),Q=F2(X,Z,"readableDestroy");return{subprocessStdout:Z,waitReadableDestroy:Q}},L3=({readableEncoding:q,readableObjectMode:J,readableHighWaterMark:X},Z)=>Z?{readableEncoding:q,readableObjectMode:J,readableHighWaterMark:X}:{readableEncoding:q,readableObjectMode:!0,readableHighWaterMark:H3},B3=({subprocessStdout:q,subprocess:J,binary:X,encoding:Z,preserveNewlines:Q})=>{let $=O0(),Y=Q8({subprocessStdout:q,subprocess:J,binary:X,shouldEncode:!X,encoding:Z,preserveNewlines:Q});return{read(){Oz(this,Y,$)},onStdoutDataDone:$}},Oz=async(q,J,X)=>{try{let{value:Z,done:Q}=await J.next();if(Q)X.resolve();else q.push(Z)}catch{}},x3=async({subprocessStdout:q,onStdoutDataDone:J,readable:X,subprocess:Z,subprocessStdin:Q})=>{try{if(await z3(q),await Z,await W3(Q),await J,X.readable)X.push(null)}catch($){await W3(Q),QX(X,$)}},j3=async({subprocessStdout:q,subprocess:J,waitReadableDestroy:X},Z)=>{if(await h6(X,J))QX(q,Z),await Y8(J,Z)},QX=(q,J)=>{H8(q,q.readable,J)};import{Writable as vz}from"node:stream";import{callbackify as $X}from"node:util";var YX=({subprocess:q,concurrentStreams:J},{to:X}={})=>{let{subprocessStdin:Z,waitWritableFinal:Q,waitWritableDestroy:$}=R3(q,X,J),Y=new vz({...M3(Z,q,Q),destroy:$X(F3.bind(void 0,{subprocessStdin:Z,subprocess:q,waitWritableFinal:Q,waitWritableDestroy:$})),highWaterMark:Z.writableHighWaterMark,objectMode:Z.writableObjectMode});return C3(Z,Y),Y},R3=(q,J,X)=>{let Z=F1(q,J),Q=F2(X,Z,"writableFinal"),$=F2(X,Z,"writableDestroy");return{subprocessStdin:Z,waitWritableFinal:Q,waitWritableDestroy:$}},M3=(q,J,X)=>({write:Nz.bind(void 0,q),final:$X(Ez.bind(void 0,q,J,X))}),Nz=(q,J,X,Z)=>{if(q.write(J,X))Z();else q.once("drain",Z)},Ez=async(q,J,X)=>{if(await h6(X,J)){if(q.writable)q.end();await J}},C3=async(q,J,X)=>{try{if(await U3(q),J.writable)J.end()}catch(Z){await XX(X),HX(J,Z)}},F3=async({subprocessStdin:q,subprocess:J,waitWritableFinal:X,waitWritableDestroy:Z},Q)=>{if(await h6(X,J),await h6(Z,J))HX(q,Q),await Y8(J,Q)},HX=(q,J)=>{H8(q,q.writable,J)};import{Duplex as yz}from"node:stream";import{callbackify as Sz}from"node:util";var KX=({subprocess:q,concurrentStreams:J,encoding:X},{from:Z,to:Q,binary:$=!0,preserveNewlines:Y=!0}={})=>{let H=$||V0.has(X),{subprocessStdout:K,waitReadableDestroy:G}=_3(q,Z,J),{subprocessStdin:V,waitWritableFinal:W,waitWritableDestroy:U}=R3(q,Q,J),{readableEncoding:z,readableObjectMode:_,readableHighWaterMark:L}=L3(K,H),{read:x,onStdoutDataDone:B}=B3({subprocessStdout:K,subprocess:q,binary:H,encoding:X,preserveNewlines:Y}),j=new yz({read:x,...M3(V,q,W),destroy:Sz(hz.bind(void 0,{subprocessStdout:K,subprocessStdin:V,subprocess:q,waitReadableDestroy:G,waitWritableFinal:W,waitWritableDestroy:U})),readableHighWaterMark:L,writableHighWaterMark:V.writableHighWaterMark,readableObjectMode:_,writableObjectMode:V.writableObjectMode,encoding:z});return x3({subprocessStdout:K,onStdoutDataDone:B,readable:j,subprocess:q,subprocessStdin:V}),C3(V,j,K),j},hz=async({subprocessStdout:q,subprocessStdin:J,subprocess:X,waitReadableDestroy:Z,waitWritableFinal:Q,waitWritableDestroy:$},Y)=>{await Promise.all([j3({subprocessStdout:q,subprocess:X,waitReadableDestroy:Z},Y),F3({subprocessStdin:J,subprocess:X,waitWritableFinal:Q,waitWritableDestroy:$},Y)])};var k3=(q,J,{from:X,binary:Z=!1,preserveNewlines:Q=!1}={})=>{let $=Z||V0.has(J),Y=I6(q,X),H=Q8({subprocessStdout:Y,subprocess:q,binary:$,shouldEncode:!0,encoding:J,preserveNewlines:Q});return bz(H,Y,q)},bz=async function*(q,J,X){try{yield*q}finally{if(J.readable)J.destroy();await X}};var VX=(q,{encoding:J})=>{let X=qX();q.readable=ZX.bind(void 0,{subprocess:q,concurrentStreams:X,encoding:J}),q.writable=YX.bind(void 0,{subprocess:q,concurrentStreams:X}),q.duplex=KX.bind(void 0,{subprocess:q,concurrentStreams:X,encoding:J}),q.iterable=k3.bind(void 0,q,J),q[Symbol.asyncIterator]=k3.bind(void 0,q,J,{})};var GX=(q,J)=>{for(let[X,Z]of fz){let Q=Z.value.bind(J);Reflect.defineProperty(q,X,{...Z,value:Q})}},gz=(async()=>{})().constructor.prototype,fz=["then","catch","finally"].map((q)=>[q,Reflect.getOwnPropertyDescriptor(gz,q)]);var WX=(q,J,X,Z)=>{let{file:Q,commandArguments:$,command:Y,escapedCommand:H,startTime:K,verboseInfo:G,options:V,fileDescriptors:W}=dz(q,J,X),{subprocess:U,promise:z}=lz({file:Q,commandArguments:$,options:V,startTime:K,verboseInfo:G,command:Y,escapedCommand:H,fileDescriptors:W});return U.pipe=Z8.bind(void 0,{source:U,sourcePromise:z,boundOptions:{},createNested:Z}),GX(U,z),v0.set(U,{options:V,fileDescriptors:W}),U},dz=(q,J,X)=>{let{command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y}=W1(q,J,X),{file:H,commandArguments:K,options:G}=E1(q,J,X),V=cz(G),W=jJ(V,Y);return{file:H,commandArguments:K,command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y,options:V,fileDescriptors:W}},cz=({timeout:q,signal:J,...X})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:q}},lz=({file:q,commandArguments:J,options:X,startTime:Z,verboseInfo:Q,command:$,escapedCommand:Y,fileDescriptors:H})=>{let K;try{K=mz(...y1(q,J,X))}catch(_){return _J({error:_,command:$,escapedCommand:Y,fileDescriptors:H,options:X,startTime:Z,verboseInfo:Q})}let G=new AbortController;uz(Number.POSITIVE_INFINITY,G.signal);let V=[...K.stdio];DJ(K,H,G),EJ(K,X,G);let W={},U=O0();K.kill=m5.bind(void 0,{kill:K.kill.bind(K),options:X,onInternalError:U,context:W,controller:G}),K.all=iJ(K,X),VX(K,X),WJ(K,X);let z=pz({subprocess:K,options:X,startTime:Z,verboseInfo:Q,fileDescriptors:H,originalStreams:V,command:$,escapedCommand:Y,context:W,onInternalError:U,controller:G});return{subprocess:K,promise:z}},pz=async({subprocess:q,options:J,startTime:X,verboseInfo:Z,fileDescriptors:Q,originalStreams:$,command:Y,escapedCommand:H,context:K,onInternalError:G,controller:V})=>{let[W,[U,z],_,L,x]=await eJ({subprocess:q,options:J,context:K,verboseInfo:Z,fileDescriptors:Q,originalStreams:$,onInternalError:G,controller:V});V.abort(),G.resolve();let B=_.map((F,C)=>m0(F,J,C)),j=m0(L,J,"all"),R=nz({errorInfo:W,exitCode:U,signal:z,stdio:B,all:j,ipcOutput:x,context:K,options:J,command:Y,escapedCommand:H,startTime:X});return E6(R,Z,J)},nz=({errorInfo:q,exitCode:J,signal:X,stdio:Z,all:Q,ipcOutput:$,context:Y,options:H,command:K,escapedCommand:G,startTime:V})=>("error"in q)?B2({error:q.error,command:K,escapedCommand:G,timedOut:Y.terminationReason==="timeout",isCanceled:Y.terminationReason==="cancel"||Y.terminationReason==="gracefulCancel",isGracefullyCanceled:Y.terminationReason==="gracefulCancel",isMaxBuffer:q.error instanceof f0,isForcefullyTerminated:Y.isForcefullyTerminated,exitCode:J,signal:X,stdio:Z,all:Q,ipcOutput:$,options:H,startTime:V,isSync:!1}):c1({command:K,escapedCommand:G,stdio:Z,all:Q,ipcOutput:$,options:H,startTime:V});var K8=(q,J)=>{let X=Object.fromEntries(Object.entries(J).map(([Z,Q])=>[Z,iz(Z,q[Z],Q)]));return{...q,...X}},iz=(q,J,X)=>{if(az.has(q)&&b(J)&&b(X))return{...J,...X};return X},az=new Set(["env",...W4]);var r0=(q,J,X,Z)=>{let Q=(Y,H,K)=>r0(Y,H,X,K),$=(...Y)=>oz({mapArguments:q,deepOptions:X,boundOptions:J,setBoundExeca:Z,createNested:Q},...Y);if(Z!==void 0)Z($,Q,J);return $},oz=({mapArguments:q,deepOptions:J={},boundOptions:X={},setBoundExeca:Z,createNested:Q},$,...Y)=>{if(b($))return Q(q,K8(X,$),Z);let{file:H,commandArguments:K,options:G,isSync:V}=rz({mapArguments:q,firstArgument:$,nextArguments:Y,deepOptions:J,boundOptions:X});return V?$J(H,K,G):WX(H,K,G,Q)},rz=({mapArguments:q,firstArgument:J,nextArguments:X,deepOptions:Z,boundOptions:Q})=>{let $=$5(J)?Y5(J,X):[J,...X],[Y,H,K]=q1(...$),G=K8(K8(Z,Q),K),{file:V=Y,commandArguments:W=H,options:U=G,isSync:z=!1}=q({file:Y,commandArguments:H,options:G});return{file:V,commandArguments:W,options:U,isSync:z}};var UX=({file:q,commandArguments:J})=>_X(q,J),zX=({file:q,commandArguments:J})=>({..._X(q,J),isSync:!0}),_X=(q,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${q} ${J}.`);let[X,...Z]=sz(q);return{file:X,commandArguments:Z}},sz=(q)=>{if(typeof q!=="string")throw TypeError(`The command must be a string: ${String(q)}.`);let J=q.trim();if(J==="")return[];let X=[];for(let Z of J.split(tz)){let Q=X.at(-1);if(Q&&Q.endsWith("\\"))X[X.length-1]=`${Q.slice(0,-1)} ${Z}`;else X.push(Z)}return X},tz=/ +/g;var LX=(q,J,X)=>{q.sync=J(ez,X),q.s=q.sync},BX=({options:q})=>xX(q),ez=({options:q})=>({...xX(q),isSync:!0}),xX=(q)=>({options:{...q_(q),...q}}),q_=({input:q,inputFile:J,stdio:X})=>q===void 0&&J===void 0&&X===void 0?{stdin:"inherit"}:{},jX={preferLocal:!0};var k2=r0(()=>({})),qO=r0(()=>({isSync:!0})),JO=r0(UX),XO=r0(zX),ZO=r0(Tq),QO=r0(BX,{},jX,LX),{sendMessage:$O,getOneMessage:YO,getEachMessage:HO,getCancelSignal:KO}=UJ();var bx=Eq(sX(),1);import{dirname as gx,join as fx}from"node:path";import{fileURLToPath as ux}from"node:url";import Xv,{promises as zx}from"node:fs";async function _x(q){try{return await zx.access(q),!0}catch{return!1}}import t3 from"node:fs";import S8 from"node:path";import Ix from"node:stream";import{promisify as Ox}from"node:util";import{promisify as Lx}from"util";import r3 from"crypto";var nQ=Lx(r3.randomBytes),Bx="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),xx="0123456789".split(""),jx="CDEHKMPRTUWXY012458".split(""),Rx="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),Mx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Cx=(q,J)=>{let X=J.length,Z=Math.floor(65536/X)*X-1,Q=2*Math.ceil(1.1*q),$="",Y=0;while(Y<q){let H=r3.randomBytes(Q),K=0;while(K<Q&&Y<q){let G=H.readUInt16LE(K);if(K+=2,G>Z)continue;$+=J[G%X],Y++}}return $},Fx=async(q,J)=>{let X=J.length,Z=Math.floor(65536/X)*X-1,Q=2*Math.ceil(1.1*q),$="",Y=0;while(Y<q){let H=await nQ(Q),K=0;while(K<Q&&Y<q){let G=H.readUInt16LE(K);if(K+=2,G>Z)continue;$+=J[G%X],Y++}}return $},kx=(q,J,X)=>r3.randomBytes(q).toString(J).slice(0,X),Tx=async(q,J,X)=>{return(await nQ(q)).toString(J).slice(0,X)},wx=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),iQ=(q,J)=>({length:X,type:Z,characters:Q})=>{if(!(X>=0&&Number.isFinite(X)))throw TypeError("Expected a `length` to be a non-negative finite number");if(Z!==void 0&&Q!==void 0)throw TypeError("Expected either `type` or `characters`");if(Q!==void 0&&typeof Q!=="string")throw TypeError("Expected `characters` to be string");if(!wx.has(Z))throw TypeError(`Unknown type: ${Z}`);if(Z===void 0&&Q===void 0)Z="hex";if(Z==="hex"||Z===void 0&&Q===void 0)return J(Math.ceil(X*0.5),"hex",X);if(Z==="base64")return J(Math.ceil(X*0.75),"base64",X);if(Z==="url-safe")return q(X,Bx);if(Z==="numeric")return q(X,xx);if(Z==="distinguishable")return q(X,jx);if(Z==="ascii-printable")return q(X,Rx);if(Z==="alphanumeric")return q(X,Mx);if(Q.length===0)throw TypeError("Expected `characters` string length to be greater than or equal to 1");if(Q.length>65536)throw TypeError("Expected `characters` string length to be less or equal to 65536");return q(X,Q.split(""))},aQ=iQ(Cx,kx);aQ.async=iQ(Fx,Tx);var oQ=aQ;function s3(){return oQ({length:32})}import{promises as Px}from"node:fs";import Ax from"node:os";var Dx=await Px.realpath(Ax.tmpdir()),y8=Dx;var Cv=Ox(Ix.pipeline);function h8(q){if(typeof q!=="string")throw TypeError(`Expected a string, got ${typeof q}`);let J=q.trim();if(!(J!==""&&J!=="."&&J!==".."&&!q.includes("/")&&!q.includes("\\")&&!q.includes("\x00")))throw Error(`Unsafe path component: ${JSON.stringify(q)}`)}function vx(q,J){h8(q);let X=J??y8,Z=S8.join(X,q);return t3.mkdirSync(Z,{recursive:!0}),Z}var rQ=(q="",{parentDirectory:J,rootDirectory:X}={})=>{if(q)h8(q);if(X!==void 0){if(!S8.isAbsolute(X))throw Error("The `rootDirectory` option must be an absolute path");t3.mkdirSync(X,{recursive:!0})}let Z=J?vx(J,X):X??y8;return S8.join(Z,q+s3())};function Fv({name:q,extension:J,parentDirectory:X,rootDirectory:Z}={}){if(q!==void 0&&q!==null){if(J!==void 0&&J!==null)throw Error("The `name` and `extension` options are mutually exclusive");return h8(q),S8.join(Nx({parentDirectory:X,rootDirectory:Z}),q)}if(J!==void 0&&J!==null)h8(J);return rQ("",{parentDirectory:X,rootDirectory:Z})+(J===void 0||J===null?"":"."+J.replace(/^\./,""))}function Nx({prefix:q="",parentDirectory:J,rootDirectory:X}={}){let Z=rQ(q,{parentDirectory:J,rootDirectory:X});return t3.mkdirSync(Z,{recursive:!0}),Z}import Ex from"os";import b8 from"path";var Q6=Ex.homedir(),{env:R6}=process,sQ=R6.XDG_DATA_HOME||(Q6?b8.join(Q6,".local","share"):void 0),tQ=R6.XDG_CONFIG_HOME||(Q6?b8.join(Q6,".config"):void 0),Av=R6.XDG_STATE_HOME||(Q6?b8.join(Q6,".local","state"):void 0),yx=R6.XDG_CACHE_HOME||(Q6?b8.join(Q6,".cache"):void 0),Dv=R6.XDG_RUNTIME_DIR||void 0,Sx=(R6.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(sQ)Sx.unshift(sQ);var hx=(R6.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(tQ)hx.unshift(tQ);var mx=gx(ux(import.meta.url));var yv=process.env.RIPGREP_VERSION||"v15.0.0";var eQ=fx(mx,`rg${process.platform==="win32"?".exe":""}`);import{resolve as dx}from"path";var cx=async(q,J,X={})=>{let{timeout:Z=15000,cwd:Q}=X;try{let $=await k2(q,J,{cwd:Q||process.cwd(),timeout:Z,reject:!1,stripFinalNewline:!1,stdio:["pipe","pipe","pipe"],env:process.env});return{code:$.exitCode??0,stdout:$.stdout,stderr:$.stderr}}catch($){if($.timedOut)return{code:124,stdout:$.stdout||"",stderr:($.stderr||"")+`
80
- Process timed out`};return{code:$.exitCode||1,stdout:$.stdout||"",stderr:$.stderr||$.message||"Unknown error"}}},q$=H0(async({args:q,head_limit:J},X)=>{if(!X.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");if(!q||q.length===0)return"Error: No arguments provided. Please provide ripgrep arguments.";if(!J&&!q.includes("--max-count"))J=500;let Z=q[q.length-1],Q=[...q];if(Z&&!Z.startsWith("-"))Q[Q.length-1]=dx(X.state.cwd,Z);let $=await cx(eQ,Q,{timeout:15000,cwd:X.state.cwd});if(J&&$.stdout){let Y=$.stdout.split(`
79
+ if (condition) { yield value; }`)};import{Buffer as IW}from"node:buffer";import{StringDecoder as OW}from"node:string_decoder";var r1=(q,J,X)=>{if(X)return;if(q)return{transform:vW.bind(void 0,new TextEncoder)};let Z=new OW(J);return{transform:NW.bind(void 0,Z),final:EW.bind(void 0,Z)}},vW=function*(q,J){if(IW.isBuffer(J))yield b0(J);else if(typeof J==="string")yield q.encode(J);else yield J},NW=function*(q,J){yield f(J)?q.write(J):J},EW=function*(q){let J=q.end();if(J!=="")yield J};import{callbackify as o9}from"node:util";var n4=o9(async(q,J,X,Z)=>{J.currentIterable=q(...X);try{for await(let Q of J.currentIterable)Z.push(Q)}finally{delete J.currentIterable}}),s1=async function*(q,J,X){if(X===J.length){yield q;return}let{transform:Z=SW}=J[X];for await(let Q of Z(q))yield*s1(Q,J,X+1)},r9=async function*(q){for(let[J,{final:X}]of Object.entries(q))yield*yW(X,Number(J),q)},yW=async function*(q,J,X){if(q===void 0)return;for await(let Z of q())yield*s1(Z,X,J+1)},s9=o9(async({currentIterable:q},J)=>{if(q!==void 0){await(J?q.throw(J):q.return());return}if(J)throw J}),SW=function*(q){yield q};var i4=(q,J,X,Z)=>{try{for(let Q of q(...J))X.push(Q);Z()}catch(Q){Z(Q)}},t9=(q,J)=>[...J.flatMap((X)=>[...L6(X,q,0)]),...R2(q)],L6=function*(q,J,X){if(X===J.length){yield q;return}let{transform:Z=bW}=J[X];for(let Q of Z(q))yield*L6(Q,J,X+1)},R2=function*(q){for(let[J,{final:X}]of Object.entries(q))yield*hW(X,Number(J),q)},hW=function*(q,J,X){if(q===void 0)return;for(let Z of q())yield*L6(Z,X,J+1)},bW=function*(q){yield q};var a4=({value:q,value:{transform:J,final:X,writableObjectMode:Z,readableObjectMode:Q},optionName:$},{encoding:Y})=>{let H={},K=qJ(q,Y,$),G=_6(J),V=_6(X),W=G?n4.bind(void 0,s1,H):i4.bind(void 0,L6),U=G||V?n4.bind(void 0,r9,H):i4.bind(void 0,R2),z=G||V?s9.bind(void 0,H):void 0;return{stream:new gW({writableObjectMode:Z,writableHighWaterMark:e9(Z),readableObjectMode:Q,readableHighWaterMark:e9(Q),transform(L,x,B){W([L,K,0],this,B)},flush(L){U([K],this,L)},destroy:z})}},t1=(q,J,X,Z)=>{let Q=J.filter(({type:Y})=>Y==="generator"),$=Z?Q.reverse():Q;for(let{value:Y,optionName:H}of $){let K=qJ(Y,X,H);q=t9(K,q)}return q},qJ=({transform:q,final:J,binary:X,writableObjectMode:Z,readableObjectMode:Q,preserveNewlines:$},Y,H)=>{let K={};return[{transform:n9(Z,H)},r1(X,Y,Z),o1(X,$,Z,K),{transform:q,final:J},{transform:i9(Q,H)},p9({binary:X,preserveNewlines:$,readableObjectMode:Q,state:K})].filter(Boolean)};var JJ=(q,J)=>{for(let X of fW(q))uW(q,X,J)},fW=(q)=>new Set(Object.entries(q).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),uW=(q,J,X)=>{let{stdioItems:Z}=q[J],Q=Z.filter(({contents:H})=>H!==void 0);if(Q.length===0)return;if(J!==0){let[{type:H,optionName:K}]=Q;throw TypeError(`Only the \`stdin\` option, not \`${K}\`, can be ${o0[H]} with synchronous methods.`)}let Y=Q.map(({contents:H})=>H).map((H)=>mW(H,Z));X.input=W2(Y)},mW=(q,J)=>{let X=t1(q,J,"utf8",!0);return dW(X),W2(X)},dW=(q)=>{let J=q.find((X)=>typeof X!=="string"&&!f(X));if(J!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${J}.`)};import{writeFileSync as nW,appendFileSync as iW}from"node:fs";var e1=({stdioItems:q,encoding:J,verboseInfo:X,fdNumber:Z})=>Z!=="all"&&D6(X,Z)&&!V0.has(J)&&cW(Z)&&(q.some(({type:Q,value:$})=>Q==="native"&&lW.has($))||q.every(({type:Q})=>L0.has(Q))),cW=(q)=>q===1||q===2,lW=new Set(["pipe","overlapped"]),XJ=async(q,J,X,Z)=>{for await(let Q of q)if(!pW(J))QJ(Q,X,Z)},ZJ=(q,J,X)=>{for(let Z of q)QJ(Z,J,X)},pW=(q)=>q._readableState.pipes.length>0,QJ=(q,J,X)=>{let Z=G1(q);D0({type:"output",verboseMessage:Z,fdNumber:J,verboseInfo:X})};var $J=({fileDescriptors:q,syncResult:{output:J},options:X,isMaxBuffer:Z,verboseInfo:Q})=>{if(J===null)return{output:Array.from({length:3})};let $={},Y=new Set([]);return{output:J.map((K,G)=>aW({result:K,fileDescriptors:q,fdNumber:G,state:$,outputFiles:Y,isMaxBuffer:Z,verboseInfo:Q},X)),...$}},aW=({result:q,fileDescriptors:J,fdNumber:X,state:Z,outputFiles:Q,isMaxBuffer:$,verboseInfo:Y},{buffer:H,encoding:K,lines:G,stripFinalNewline:V,maxBuffer:W})=>{if(q===null)return;let U=Y9(q,$,W),z=b0(U),{stdioItems:_,objectMode:L}=J[X],x=oW([z],_,K,Z),{serializedResult:B,finalResult:j=B}=rW({chunks:x,objectMode:L,encoding:K,lines:G,stripFinalNewline:V,fdNumber:X});sW({serializedResult:B,fdNumber:X,state:Z,verboseInfo:Y,encoding:K,stdioItems:_,objectMode:L});let R=H[X]?j:void 0;try{if(Z.error===void 0)tW(B,_,Q);return R}catch(F){return Z.error=F,R}},oW=(q,J,X,Z)=>{try{return t1(q,J,X,!1)}catch(Q){return Z.error=Q,q}},rW=({chunks:q,objectMode:J,encoding:X,lines:Z,stripFinalNewline:Q,fdNumber:$})=>{if(J)return{serializedResult:q};if(X==="buffer")return{serializedResult:W2(q)};let Y=K5(q,X);if(Z[$])return{serializedResult:Y,finalResult:p4(Y,!Q[$],J)};return{serializedResult:Y}},sW=({serializedResult:q,fdNumber:J,state:X,verboseInfo:Z,encoding:Q,stdioItems:$,objectMode:Y})=>{if(!e1({stdioItems:$,encoding:Q,verboseInfo:Z,fdNumber:J}))return;let H=p4(q,!1,Y);try{ZJ(H,J,Z)}catch(K){X.error??=K}},tW=(q,J,X)=>{for(let{path:Z,append:Q}of J.filter(({type:$})=>i1.has($))){let $=typeof Z==="string"?Z:Z.toString();if(Q||X.has($))iW(Z,q);else X.add($),nW(Z,q)}};var YJ=([,q,J],X)=>{if(!X.all)return;if(q===void 0)return J;if(J===void 0)return q;if(Array.isArray(q))return Array.isArray(J)?[...q,...J]:[...q,m0(J,X,"all")];if(Array.isArray(J))return[m0(q,X,"all"),...J];if(f(q)&&f(J))return K4([q,J]);return`${q}${J}`};import{once as o4}from"node:events";var HJ=async(q,J)=>{let[X,Z]=await eW(q);return J.isForcefullyTerminated??=!1,[X,Z]},eW=async(q)=>{let[J,X]=await Promise.allSettled([o4(q,"spawn"),o4(q,"exit")]);if(J.status==="rejected")return[];return X.status==="rejected"?KJ(q):X.value},KJ=async(q)=>{try{return await o4(q,"exit")}catch{return KJ(q)}},VJ=async(q)=>{let[J,X]=await q;if(!qU(J,X)&&r4(J,X))throw new I0;return[J,X]},qU=(q,J)=>q===void 0&&J===void 0,r4=(q,J)=>q!==0||J!==null;var GJ=({error:q,status:J,signal:X,output:Z},{maxBuffer:Q})=>{let $=JU(q,J,X),Y=$?.code==="ETIMEDOUT",H=$9($,Z,Q);return{resultError:$,exitCode:J,signal:X,timedOut:Y,isMaxBuffer:H}},JU=(q,J,X)=>{if(q!==void 0)return q;return r4(J,X)?new I0:void 0};var WJ=(q,J,X)=>{let{file:Z,commandArguments:Q,command:$,escapedCommand:Y,startTime:H,verboseInfo:K,options:G,fileDescriptors:V}=ZU(q,J,X),W=YU({file:Z,commandArguments:Q,options:G,command:$,escapedCommand:Y,verboseInfo:K,fileDescriptors:V,startTime:H});return S6(W,K,G)},ZU=(q,J,X)=>{let{command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y}=U1(q,J,X),H=QU(X),{file:K,commandArguments:G,options:V}=y1(q,J,H);$U(V);let W=m9(V,Y);return{file:K,commandArguments:G,command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y,options:V,fileDescriptors:W}},QU=(q)=>q.node&&!q.ipc?{...q,ipc:!1}:q,$U=({ipc:q,ipcInput:J,detached:X,cancelSignal:Z})=>{if(J)q8("ipcInput");if(q)q8("ipc: true");if(X)q8("detached: true");if(Z)q8("cancelSignal")},q8=(q)=>{throw TypeError(`The "${q}" option cannot be used with synchronous methods.`)},YU=({file:q,commandArguments:J,options:X,command:Z,escapedCommand:Q,verboseInfo:$,fileDescriptors:Y,startTime:H})=>{let K=HU({file:q,commandArguments:J,options:X,command:Z,escapedCommand:Q,fileDescriptors:Y,startTime:H});if(K.failed)return K;let{resultError:G,exitCode:V,signal:W,timedOut:U,isMaxBuffer:z}=GJ(K,X),{output:_,error:L=G}=$J({fileDescriptors:Y,syncResult:K,options:X,isMaxBuffer:z,verboseInfo:$}),x=_.map((j,R)=>m0(j,X,R)),B=m0(YJ(_,X),X,"all");return VU({error:L,exitCode:V,signal:W,timedOut:U,isMaxBuffer:z,stdio:x,all:B,options:X,command:Z,escapedCommand:Q,startTime:H})},HU=({file:q,commandArguments:J,options:X,command:Z,escapedCommand:Q,fileDescriptors:$,startTime:Y})=>{try{JJ($,X);let H=KU(X);return XU(...S1(q,J,H))}catch(H){return y6({error:H,command:Z,escapedCommand:Q,fileDescriptors:$,options:X,startTime:Y,isSync:!0})}},KU=({encoding:q,maxBuffer:J,...X})=>({...X,encoding:"buffer",maxBuffer:c1(J)}),VU=({error:q,exitCode:J,signal:X,timedOut:Z,isMaxBuffer:Q,stdio:$,all:Y,options:H,command:K,escapedCommand:G,startTime:V})=>q===void 0?l1({command:K,escapedCommand:G,stdio:$,all:Y,ipcOutput:[],options:H,startTime:V}):j2({error:q,command:K,escapedCommand:G,timedOut:Z,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:Q,isForcefullyTerminated:!1,exitCode:J,signal:X,stdio:$,all:Y,ipcOutput:[],options:H,startTime:V,isSync:!0});import{setMaxListeners as rz}from"node:events";import{spawn as sz}from"node:child_process";import BJ from"node:process";import{once as s4,on as GU}from"node:events";var UJ=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z},{reference:Q=!0,filter:$}={})=>{return I6({methodName:"getOneMessage",isSubprocess:X,ipc:Z,isConnected:D1(q)}),WU({anyProcess:q,channel:J,isSubprocess:X,filter:$,reference:Q})},WU=async({anyProcess:q,channel:J,isSubprocess:X,filter:Z,reference:Q})=>{T1(J,Q);let $=a0(q,J,X),Y=new AbortController;try{return await Promise.race([UU($,Z,Y),zU($,X,Y),_U($,X,Y)])}catch(H){throw O6(q),H}finally{Y.abort(),w1(J,Q)}},UU=async(q,J,{signal:X})=>{if(J===void 0){let[Z]=await s4(q,"message",{signal:X});return Z}for await(let[Z]of GU(q,"message",{signal:X}))if(J(Z))return Z},zU=async(q,J,{signal:X})=>{await s4(q,"disconnect",{signal:X}),s5(J)},_U=async(q,J,{signal:X})=>{let[Z]=await s4(q,"strict:error",{signal:X});throw C1(Z,J)};import{once as _J,on as LU}from"node:events";var LJ=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z},{reference:Q=!0}={})=>t4({anyProcess:q,channel:J,isSubprocess:X,ipc:Z,shouldAwait:!X,reference:Q}),t4=({anyProcess:q,channel:J,isSubprocess:X,ipc:Z,shouldAwait:Q,reference:$})=>{I6({methodName:"getEachMessage",isSubprocess:X,ipc:Z,isConnected:D1(q)}),T1(J,$);let Y=a0(q,J,X),H=new AbortController,K={};return BU(q,Y,H),xU({ipcEmitter:Y,isSubprocess:X,controller:H,state:K}),jU({anyProcess:q,channel:J,ipcEmitter:Y,isSubprocess:X,shouldAwait:Q,controller:H,state:K,reference:$})},BU=async(q,J,X)=>{try{await _J(J,"disconnect",{signal:X.signal}),X.abort()}catch{}},xU=async({ipcEmitter:q,isSubprocess:J,controller:X,state:Z})=>{try{let[Q]=await _J(q,"strict:error",{signal:X.signal});Z.error=C1(Q,J),X.abort()}catch{}},jU=async function*({anyProcess:q,channel:J,ipcEmitter:X,isSubprocess:Z,shouldAwait:Q,controller:$,state:Y,reference:H}){try{for await(let[K]of LU(X,"message",{signal:$.signal}))zJ(Y),yield K}catch{zJ(Y)}finally{if($.abort(),w1(J,H),!Z)O6(q);if(Q)await q}},zJ=({error:q})=>{if(q)throw q};var xJ=(q,{ipc:J})=>{Object.assign(q,RJ(q,!1,J))},jJ=()=>{let q=BJ,J=!0,X=BJ.channel!==void 0;return{...RJ(q,!0,X),getCancelSignal:Tq.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:!0,ipc:X})}},RJ=(q,J,X)=>({sendMessage:N1.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:J,ipc:X}),getOneMessage:UJ.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:J,ipc:X}),getEachMessage:LJ.bind(void 0,{anyProcess:q,channel:q.channel,isSubprocess:J,ipc:X})});import{ChildProcess as RU}from"node:child_process";import{PassThrough as MU,Readable as CU,Writable as FU,Duplex as kU}from"node:stream";var MJ=({error:q,command:J,escapedCommand:X,fileDescriptors:Z,options:Q,startTime:$,verboseInfo:Y})=>{d4(Z);let H=new RU;TU(H,Z),Object.assign(H,{readable:wU,writable:PU,duplex:AU});let K=y6({error:q,command:J,escapedCommand:X,fileDescriptors:Z,options:Q,startTime:$,isSync:!1}),G=DU(K,Y,Q);return{subprocess:H,promise:G}},TU=(q,J)=>{let X=M2(),Z=M2(),Q=M2(),$=Array.from({length:J.length-3},M2),Y=M2(),H=[X,Z,Q,...$];Object.assign(q,{stdin:X,stdout:Z,stderr:Q,all:Y,stdio:H})},M2=()=>{let q=new MU;return q.end(),q},wU=()=>new CU({read(){}}),PU=()=>new FU({write(){}}),AU=()=>new kU({read(){},write(){}}),DU=async(q,J,X)=>S6(q,J,X);import{createReadStream as CJ,createWriteStream as FJ}from"node:fs";import{Buffer as IU}from"node:buffer";import{Readable as C2,Writable as OU,Duplex as vU}from"node:stream";var TJ=(q,J)=>a1(NU,q,J,!1),F2=({type:q,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${o0[q]}.`)},kJ={fileNumber:F2,generator:a4,asyncGenerator:a4,nodeStream:({value:q})=>({stream:q}),webTransform({value:{transform:q,writableObjectMode:J,readableObjectMode:X}}){let Z=J||X;return{stream:vU.fromWeb(q,{objectMode:Z})}},duplex:({value:{transform:q}})=>({stream:q}),native(){}},NU={input:{...kJ,fileUrl:({value:q})=>({stream:CJ(q)}),filePath:({value:{file:q}})=>({stream:CJ(q)}),webStream:({value:q})=>({stream:C2.fromWeb(q)}),iterable:({value:q})=>({stream:C2.from(q)}),asyncIterable:({value:q})=>({stream:C2.from(q)}),string:({value:q})=>({stream:C2.from(q)}),uint8Array:({value:q})=>({stream:C2.from(IU.from(q))})},output:{...kJ,fileUrl:({value:q})=>({stream:FJ(q)}),filePath:({value:{file:q,append:J}})=>({stream:FJ(q,J?{flags:"a"}:{})}),webStream:({value:q})=>({stream:OU.fromWeb(q)}),iterable:F2,asyncIterable:F2,string:F2,uint8Array:F2}};import{on as EU,once as wJ}from"node:events";import{PassThrough as yU,getDefaultHighWaterMark as SU}from"node:stream";import{finished as DJ}from"node:stream/promises";function B6(q){if(!Array.isArray(q))throw TypeError(`Expected an array, got \`${typeof q}\`.`);for(let Q of q)e4(Q);let J=q.some(({readableObjectMode:Q})=>Q),X=hU(q,J),Z=new IJ({objectMode:J,writableHighWaterMark:X,readableHighWaterMark:X});for(let Q of q)Z.add(Q);return Z}var hU=(q,J)=>{if(q.length===0)return SU(J);let X=q.filter(({readableObjectMode:Z})=>Z===J).map(({readableHighWaterMark:Z})=>Z);return Math.max(...X)};class IJ extends yU{#q=new Set([]);#X=new Set([]);#J=new Set([]);#Z;#$=Symbol("unpipe");#V=new WeakMap;add(q){if(e4(q),this.#q.has(q))return;this.#q.add(q),this.#Z??=bU(this,this.#q,this.#$);let J=uU({passThroughStream:this,stream:q,streams:this.#q,ended:this.#X,aborted:this.#J,onFinished:this.#Z,unpipeEvent:this.#$});this.#V.set(q,J),q.pipe(this,{end:!1})}async remove(q){if(e4(q),!this.#q.has(q))return!1;let J=this.#V.get(q);if(J===void 0)return!1;return this.#V.delete(q),q.unpipe(this),await J,!0}}var bU=async(q,J,X)=>{J8(q,PJ);let Z=new AbortController;try{await Promise.race([gU(q,Z),fU(q,J,X,Z)])}finally{Z.abort(),J8(q,-PJ)}},gU=async(q,{signal:J})=>{try{await DJ(q,{signal:J,cleanup:!0})}catch(X){throw OJ(q,X),X}},fU=async(q,J,X,{signal:Z})=>{for await(let[Q]of EU(q,"unpipe",{signal:Z}))if(J.has(Q))Q.emit(X)},e4=(q)=>{if(typeof q?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof q}\`.`)},uU=async({passThroughStream:q,stream:J,streams:X,ended:Z,aborted:Q,onFinished:$,unpipeEvent:Y})=>{J8(q,AJ);let H=new AbortController;try{await Promise.race([mU($,J,H),dU({passThroughStream:q,stream:J,streams:X,ended:Z,aborted:Q,controller:H}),cU({stream:J,streams:X,ended:Z,aborted:Q,unpipeEvent:Y,controller:H})])}finally{H.abort(),J8(q,-AJ)}if(X.size>0&&X.size===Z.size+Q.size)if(Z.size===0&&Q.size>0)q3(q);else lU(q)},mU=async(q,J,{signal:X})=>{try{if(await q,!X.aborted)q3(J)}catch(Z){if(!X.aborted)OJ(J,Z)}},dU=async({passThroughStream:q,stream:J,streams:X,ended:Z,aborted:Q,controller:{signal:$}})=>{try{if(await DJ(J,{signal:$,cleanup:!0,readable:!0,writable:!1}),X.has(J))Z.add(J)}catch(Y){if($.aborted||!X.has(J))return;if(vJ(Y))Q.add(J);else NJ(q,Y)}},cU=async({stream:q,streams:J,ended:X,aborted:Z,unpipeEvent:Q,controller:{signal:$}})=>{if(await wJ(q,Q,{signal:$}),!q.readable)return wJ($,"abort",{signal:$});J.delete(q),X.delete(q),Z.delete(q)},lU=(q)=>{if(q.writable)q.end()},OJ=(q,J)=>{if(vJ(J))q3(q);else NJ(q,J)},vJ=(q)=>q?.code==="ERR_STREAM_PREMATURE_CLOSE",q3=(q)=>{if(q.readable||q.writable)q.destroy()},NJ=(q,J)=>{if(!q.destroyed)q.once("error",pU),q.destroy(J)},pU=()=>{},J8=(q,J)=>{let X=q.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)q.setMaxListeners(X+J)},PJ=2,AJ=1;import{finished as EJ}from"node:stream/promises";var b6=(q,J)=>{q.pipe(J),nU(q,J),iU(q,J)},nU=async(q,J)=>{if(R0(q)||R0(J))return;try{await EJ(q,{cleanup:!0,readable:!0,writable:!1})}catch{}J3(J)},J3=(q)=>{if(q.writable)q.end()},iU=async(q,J)=>{if(R0(q)||R0(J))return;try{await EJ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}X3(q)},X3=(q)=>{if(q.readable)q.destroy()};var yJ=(q,J,X)=>{let Z=new Map;for(let[Q,{stdioItems:$,direction:Y}]of Object.entries(J)){for(let{stream:H}of $.filter(({type:K})=>L0.has(K)))aU(q,H,Y,Q);for(let{stream:H}of $.filter(({type:K})=>!L0.has(K)))rU({subprocess:q,stream:H,direction:Y,fdNumber:Q,pipeGroups:Z,controller:X})}for(let[Q,$]of Z.entries()){let Y=$.length===1?$[0]:B6($);b6(Y,Q)}},aU=(q,J,X,Z)=>{if(X==="output")b6(q.stdio[Z],J);else b6(J,q.stdio[Z]);let Q=oU[Z];if(Q!==void 0)q[Q]=J;q.stdio[Z]=J},oU=["stdin","stdout","stderr"],rU=({subprocess:q,stream:J,direction:X,fdNumber:Z,pipeGroups:Q,controller:$})=>{if(J===void 0)return;sU(J,$);let[Y,H]=X==="output"?[J,q.stdio[Z]]:[q.stdio[Z],J],K=Q.get(Y)??[];Q.set(Y,[...K,H])},sU=(q,{signal:J})=>{if(R0(q))U6(q,tU,J)},tU=2;import{addAbortListener as Jz}from"node:events";var x6=[];x6.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")x6.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")x6.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var X8=(q)=>!!q&&typeof q==="object"&&typeof q.removeListener==="function"&&typeof q.emit==="function"&&typeof q.reallyExit==="function"&&typeof q.listeners==="function"&&typeof q.kill==="function"&&typeof q.pid==="number"&&typeof q.on==="function",Z3=Symbol.for("signal-exit emitter"),Q3=globalThis,eU=Object.defineProperty.bind(Object);class SJ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Q3[Z3])return Q3[Z3];eU(Q3,Z3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(q,J){this.listeners[q].push(J)}removeListener(q,J){let X=this.listeners[q],Z=X.indexOf(J);if(Z===-1)return;if(Z===0&&X.length===1)X.length=0;else X.splice(Z,1)}emit(q,J,X){if(this.emitted[q])return!1;this.emitted[q]=!0;let Z=!1;for(let Q of this.listeners[q])Z=Q(J,X)===!0||Z;if(q==="exit")Z=this.emit("afterExit",J,X)||Z;return Z}}class Y3{}var qz=(q)=>{return{onExit(J,X){return q.onExit(J,X)},load(){return q.load()},unload(){return q.unload()}}};class hJ extends Y3{onExit(){return()=>{}}load(){}unload(){}}class bJ extends Y3{#q=$3.platform==="win32"?"SIGINT":"SIGHUP";#X=new SJ;#J;#Z;#$;#V={};#U=!1;constructor(q){super();this.#J=q,this.#V={};for(let J of x6)this.#V[J]=()=>{let X=this.#J.listeners(J),{count:Z}=this.#X,Q=q;if(typeof Q.__signal_exit_emitter__==="object"&&typeof Q.__signal_exit_emitter__.count==="number")Z+=Q.__signal_exit_emitter__.count;if(X.length===Z){this.unload();let $=this.#X.emit("exit",null,J),Y=J==="SIGHUP"?this.#q:J;if(!$)q.kill(q.pid,Y)}};this.#$=q.reallyExit,this.#Z=q.emit}onExit(q,J){if(!X8(this.#J))return()=>{};if(this.#U===!1)this.load();let X=J?.alwaysLast?"afterExit":"exit";return this.#X.on(X,q),()=>{if(this.#X.removeListener(X,q),this.#X.listeners.exit.length===0&&this.#X.listeners.afterExit.length===0)this.unload()}}load(){if(this.#U)return;this.#U=!0,this.#X.count+=1;for(let q of x6)try{let J=this.#V[q];if(J)this.#J.on(q,J)}catch(J){}this.#J.emit=(q,...J)=>{return this.#H(q,...J)},this.#J.reallyExit=(q)=>{return this.#W(q)}}unload(){if(!this.#U)return;this.#U=!1,x6.forEach((q)=>{let J=this.#V[q];if(!J)throw Error("Listener not defined for signal: "+q);try{this.#J.removeListener(q,J)}catch(X){}}),this.#J.emit=this.#Z,this.#J.reallyExit=this.#$,this.#X.count-=1}#W(q){if(!X8(this.#J))return 0;return this.#J.exitCode=q||0,this.#X.emit("exit",this.#J.exitCode,null),this.#$.call(this.#J,this.#J.exitCode)}#H(q,...J){let X=this.#Z;if(q==="exit"&&X8(this.#J)){if(typeof J[0]==="number")this.#J.exitCode=J[0];let Z=X.call(this.#J,q,...J);return this.#X.emit("exit",this.#J.exitCode,null),Z}else return X.call(this.#J,q,...J)}}var $3=globalThis.process,{onExit:gJ,load:FA,unload:kA}=qz(X8($3)?new bJ($3):new hJ);var fJ=(q,{cleanup:J,detached:X},{signal:Z})=>{if(!J||X)return;let Q=gJ(()=>{q.kill()});Jz(Z,()=>{Q()})};var mJ=({source:q,sourcePromise:J,boundOptions:X,createNested:Z},...Q)=>{let $=W1(),{destination:Y,destinationStream:H,destinationError:K,from:G,unpipeSignal:V}=Xz(X,Z,Q),{sourceStream:W,sourceError:U}=Qz(q,G),{options:z,fileDescriptors:_}=v0.get(q);return{sourcePromise:J,sourceStream:W,sourceOptions:z,sourceError:U,destination:Y,destinationStream:H,destinationError:K,unpipeSignal:V,fileDescriptors:_,startTime:$}},Xz=(q,J,X)=>{try{let{destination:Z,pipeOptions:{from:Q,to:$,unpipeSignal:Y}={}}=Zz(q,J,...X),H=k1(Z,$);return{destination:Z,destinationStream:H,from:Q,unpipeSignal:Y}}catch(Z){return{destinationError:Z}}},Zz=(q,J,X,...Z)=>{if(Array.isArray(X))return{destination:J(uJ,q)(X,...Z),pipeOptions:q};if(typeof X==="string"||X instanceof URL||Y4(X)){if(Object.keys(q).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[Q,$,Y]=J1(X,...Z);return{destination:J(uJ)(Q,$,Y),pipeOptions:Y}}if(v0.has(X)){if(Object.keys(q).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:X,pipeOptions:Z[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${X}`)},uJ=({options:q})=>({options:{...q,stdin:"pipe",piped:!0}}),Qz=(q,J)=>{try{return{sourceStream:v6(q,J)}}catch(X){return{sourceError:X}}};var cJ=({sourceStream:q,sourceError:J,destinationStream:X,destinationError:Z,fileDescriptors:Q,sourceOptions:$,startTime:Y})=>{let H=$z({sourceStream:q,sourceError:J,destinationStream:X,destinationError:Z});if(H!==void 0)throw H3({error:H,fileDescriptors:Q,sourceOptions:$,startTime:Y})},$z=({sourceStream:q,sourceError:J,destinationStream:X,destinationError:Z})=>{if(J!==void 0&&Z!==void 0)return Z;if(Z!==void 0)return X3(q),Z;if(J!==void 0)return J3(X),J},H3=({error:q,fileDescriptors:J,sourceOptions:X,startTime:Z})=>y6({error:q,command:dJ,escapedCommand:dJ,fileDescriptors:J,options:X,startTime:Z,isSync:!1}),dJ="source.pipe(destination)";var lJ=async(q)=>{let[{status:J,reason:X,value:Z=X},{status:Q,reason:$,value:Y=$}]=await q;if(!Y.pipedFrom.includes(Z))Y.pipedFrom.push(Z);if(Q==="rejected")throw Y;if(J==="rejected")throw Z;return Y};import{finished as Yz}from"node:stream/promises";var pJ=(q,J,X)=>{let Z=Z8.has(J)?Kz(q,J):Hz(q,J);return U6(q,Gz,X.signal),U6(J,Wz,X.signal),Vz(J),Z},Hz=(q,J)=>{let X=B6([q]);return b6(X,J),Z8.set(J,X),X},Kz=(q,J)=>{let X=Z8.get(J);return X.add(q),X},Vz=async(q)=>{try{await Yz(q,{cleanup:!0,readable:!1,writable:!0})}catch{}Z8.delete(q)},Z8=new WeakMap,Gz=2,Wz=1;import{aborted as Uz}from"node:util";var nJ=(q,J)=>q===void 0?[]:[zz(q,J)],zz=async(q,{sourceStream:J,mergedStream:X,fileDescriptors:Z,sourceOptions:Q,startTime:$})=>{await Uz(q,J),await X.remove(J);let Y=Error("Pipe canceled by `unpipeSignal` option.");throw H3({error:Y,fileDescriptors:Z,sourceOptions:Q,startTime:$})};var Q8=(q,...J)=>{if(b(J[0]))return Q8.bind(void 0,{...q,boundOptions:{...q.boundOptions,...J[0]}});let{destination:X,...Z}=mJ(q,...J),Q=_z({...Z,destination:X});return Q.pipe=Q8.bind(void 0,{...q,source:X,sourcePromise:Q,boundOptions:{}}),Q},_z=async({sourcePromise:q,sourceStream:J,sourceOptions:X,sourceError:Z,destination:Q,destinationStream:$,destinationError:Y,unpipeSignal:H,fileDescriptors:K,startTime:G})=>{let V=Lz(q,Q);cJ({sourceStream:J,sourceError:Z,destinationStream:$,destinationError:Y,fileDescriptors:K,sourceOptions:X,startTime:G});let W=new AbortController;try{let U=pJ(J,$,W);return await Promise.race([lJ(V),...nJ(H,{sourceStream:J,mergedStream:U,sourceOptions:X,fileDescriptors:K,startTime:G})])}finally{W.abort()}},Lz=(q,J)=>Promise.allSettled([q,J]);import{setImmediate as Fz}from"node:timers/promises";import{on as Bz}from"node:events";import{getDefaultHighWaterMark as xz}from"node:stream";var $8=({subprocessStdout:q,subprocess:J,binary:X,shouldEncode:Z,encoding:Q,preserveNewlines:$})=>{let Y=new AbortController;return jz(J,Y),aJ({stream:q,controller:Y,binary:X,shouldEncode:!q.readableObjectMode&&Z,encoding:Q,shouldSplit:!q.readableObjectMode,preserveNewlines:$})},jz=async(q,J)=>{try{await q}catch{}finally{J.abort()}},K3=({stream:q,onStreamEnd:J,lines:X,encoding:Z,stripFinalNewline:Q,allMixed:$})=>{let Y=new AbortController;Rz(J,Y,q);let H=q.readableObjectMode&&!$;return aJ({stream:q,controller:Y,binary:Z==="buffer",shouldEncode:!H,encoding:Z,shouldSplit:!H&&X,preserveNewlines:!Q})},Rz=async(q,J,X)=>{try{await q}catch{X.destroy()}finally{J.abort()}},aJ=({stream:q,controller:J,binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y})=>{let H=Bz(q,"data",{signal:J.signal,highWaterMark:iJ,highWatermark:iJ});return Mz({onStdoutChunk:H,controller:J,binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y})},V3=xz(!0),iJ=V3,Mz=async function*({onStdoutChunk:q,controller:J,binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y}){let H=Cz({binary:X,shouldEncode:Z,encoding:Q,shouldSplit:$,preserveNewlines:Y});try{for await(let[K]of q)yield*L6(K,H,0)}catch(K){if(!J.signal.aborted)throw K}finally{yield*R2(H)}},Cz=({binary:q,shouldEncode:J,encoding:X,shouldSplit:Z,preserveNewlines:Q})=>[r1(q,X,!J),o1(q,Q,!Z,{})].filter(Boolean);var oJ=async({stream:q,onStreamEnd:J,fdNumber:X,encoding:Z,buffer:Q,maxBuffer:$,lines:Y,allMixed:H,stripFinalNewline:K,verboseInfo:G,streamInfo:V})=>{let W=kz({stream:q,onStreamEnd:J,fdNumber:X,encoding:Z,allMixed:H,verboseInfo:G,streamInfo:V});if(!Q){await Promise.all([Tz(q),W]);return}let U=c4(K,X),z=K3({stream:q,onStreamEnd:J,lines:Y,encoding:Z,stripFinalNewline:U,allMixed:H}),[_]=await Promise.all([wz({stream:q,iterable:z,fdNumber:X,encoding:Z,maxBuffer:$,lines:Y}),W]);return _},kz=async({stream:q,onStreamEnd:J,fdNumber:X,encoding:Z,allMixed:Q,verboseInfo:$,streamInfo:{fileDescriptors:Y}})=>{if(!e1({stdioItems:Y[X]?.stdioItems,encoding:Z,verboseInfo:$,fdNumber:X}))return;let H=K3({stream:q,onStreamEnd:J,lines:!0,encoding:Z,stripFinalNewline:!0,allMixed:Q});await XJ(H,q,X,$)},Tz=async(q)=>{if(await Fz(),q.readableFlowing===null)q.resume()},wz=async({stream:q,stream:{readableObjectMode:J},iterable:X,fdNumber:Z,encoding:Q,maxBuffer:$,lines:Y})=>{try{if(J||Y)return await f1(X,{maxBuffer:$});if(Q==="buffer")return new Uint8Array(await u1(X,{maxBuffer:$}));return await d1(X,{maxBuffer:$})}catch(H){return rJ(X9({error:H,stream:q,readableObjectMode:J,lines:Y,encoding:Q,fdNumber:Z}))}},G3=async(q)=>{try{return await q}catch(J){return rJ(J)}},rJ=({bufferedData:q})=>Y5(q)?new Uint8Array(q):q;import{finished as Pz}from"node:stream/promises";var k2=async(q,J,X,{isSameDirection:Z,stopOnExit:Q=!1}={})=>{let $=Az(q,X),Y=new AbortController;try{await Promise.race([...Q?[X.exitPromise]:[],Pz(q,{cleanup:!0,signal:Y.signal})])}catch(H){if(!$.stdinCleanedUp)Oz(H,J,X,Z)}finally{Y.abort()}},Az=(q,{originalStreams:[J],subprocess:X})=>{let Z={stdinCleanedUp:!1};if(q===J)Dz(q,X,Z);return Z},Dz=(q,J,X)=>{let{_destroy:Z}=q;q._destroy=(...Q)=>{Iz(J,X),Z.call(q,...Q)}},Iz=({exitCode:q,signalCode:J},X)=>{if(q!==null||J!==null)X.stdinCleanedUp=!0},Oz=(q,J,X,Z)=>{if(!vz(q,J,X,Z))throw q},vz=(q,J,X,Z=!0)=>{if(X.propagating)return sJ(q)||Y8(q);return X.propagating=!0,W3(X,J)===Z?sJ(q):Y8(q)},W3=({fileDescriptors:q},J)=>J!=="all"&&q[J].direction==="input",Y8=(q)=>q?.code==="ERR_STREAM_PREMATURE_CLOSE",sJ=(q)=>q?.code==="EPIPE";var tJ=({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>q.stdio.map((K,G)=>U3({stream:K,fdNumber:G,encoding:J,buffer:X[G],maxBuffer:Z[G],lines:Q[G],allMixed:!1,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})),U3=async({stream:q,fdNumber:J,encoding:X,buffer:Z,maxBuffer:Q,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:G})=>{if(!q)return;let V=k2(q,J,G);if(W3(G,J)){await V;return}let[W]=await Promise.all([oJ({stream:q,onStreamEnd:V,fdNumber:J,encoding:X,buffer:Z,maxBuffer:Q,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:G}),V]);return W};var eJ=({stdout:q,stderr:J},{all:X})=>X&&(q||J)?B6([q,J].filter(Boolean)):void 0,qX=({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>U3({...Nz(q,X),fdNumber:"all",encoding:J,maxBuffer:Z[1]+Z[2],lines:Q[1]||Q[2],allMixed:Ez(q),stripFinalNewline:$,verboseInfo:Y,streamInfo:H}),Nz=({stdout:q,stderr:J,all:X},[,Z,Q])=>{let $=Z||Q;if(!$)return{stream:X,buffer:$};if(!Z)return{stream:J,buffer:$};if(!Q)return{stream:q,buffer:$};return{stream:X,buffer:$}},Ez=({all:q,stdout:J,stderr:X})=>q&&J&&X&&J.readableObjectMode!==X.readableObjectMode;import{once as yz}from"node:events";var JX=(q)=>D6(q,"ipc"),XX=(q,J)=>{let X=G1(q);D0({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:J})};var ZX=async({subprocess:q,buffer:J,maxBuffer:X,ipc:Z,ipcOutput:Q,verboseInfo:$})=>{if(!Z)return Q;let Y=JX($),H=g0(J,"ipc"),K=g0(X,"ipc");for await(let G of t4({anyProcess:q,channel:q.channel,isSubprocess:!1,ipc:Z,shouldAwait:!1,reference:!0})){if(H)Z9(q,Q,K),Q.push(G);if(Y)XX(G,$)}return Q},QX=async(q,J)=>{return await Promise.allSettled([q]),J};var $X=async({subprocess:q,options:{encoding:J,buffer:X,maxBuffer:Z,lines:Q,timeoutDuration:$,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,stripFinalNewline:G,ipc:V,ipcInput:W},context:U,verboseInfo:z,fileDescriptors:_,originalStreams:L,onInternalError:x,controller:B})=>{let j=HJ(q,U),R={originalStreams:L,fileDescriptors:_,subprocess:q,exitPromise:j,propagating:!1},F=tJ({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:G,verboseInfo:z,streamInfo:R}),C=qX({subprocess:q,encoding:J,buffer:X,maxBuffer:Z,lines:Q,stripFinalNewline:G,verboseInfo:z,streamInfo:R}),y=[],O=ZX({subprocess:q,buffer:X,maxBuffer:Z,ipc:V,ipcOutput:y,verboseInfo:z}),g=Sz(L,q,R),M=hz(_,R);try{return await Promise.race([Promise.all([{},VJ(j),Promise.all(F),C,O,yq(q,W),...g,...M]),x,bz(q,B),...Iq(q,$,U,B),...r5({subprocess:q,cancelSignal:Y,gracefulCancel:H,context:U,controller:B}),...Aq({subprocess:q,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,context:U,controller:B})])}catch(P){return U.terminationReason??="other",Promise.all([{error:P},j,Promise.all(F.map((A)=>G3(A))),G3(C),QX(O,y),Promise.allSettled(g),Promise.allSettled(M)])}},Sz=(q,J,X)=>q.map((Z,Q)=>Z===J.stdio[Q]?void 0:k2(Z,Q,X)),hz=(q,J)=>q.flatMap(({stdioItems:X},Z)=>X.filter(({value:Q,stream:$=Q})=>C0($,{checkOpen:!1})&&!R0($)).map(({type:Q,value:$,stream:Y=$})=>k2(Y,Z,J,{isSameDirection:L0.has(Q),stopOnExit:Q==="native"}))),bz=async(q,{signal:J})=>{let[X]=await yz(q,"error",{signal:J});throw X};var YX=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),T2=(q,J,X)=>{let Z=q[X];if(!Z.has(J))Z.set(J,[]);let Q=Z.get(J),$=O0();return Q.push($),{resolve:$.resolve.bind($),promises:Q}},g6=async({resolve:q,promises:J},X)=>{q();let[Z]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...J])]);return!Z};import{Readable as gz}from"node:stream";import{callbackify as fz}from"node:util";import{finished as HX}from"node:stream/promises";var z3=async(q)=>{if(q===void 0)return;try{await _3(q)}catch{}},KX=async(q)=>{if(q===void 0)return;try{await L3(q)}catch{}},_3=async(q)=>{await HX(q,{cleanup:!0,readable:!1,writable:!0})},L3=async(q)=>{await HX(q,{cleanup:!0,readable:!0,writable:!1})},H8=async(q,J)=>{if(await q,J)throw J},K8=(q,J,X)=>{if(X&&!Y8(X))q.destroy(X);else if(J)q.destroy()};var VX=({subprocess:q,concurrentStreams:J,encoding:X},{from:Z,binary:Q=!0,preserveNewlines:$=!0}={})=>{let Y=Q||V0.has(X),{subprocessStdout:H,waitReadableDestroy:K}=B3(q,Z,J),{readableEncoding:G,readableObjectMode:V,readableHighWaterMark:W}=x3(H,Y),{read:U,onStdoutDataDone:z}=j3({subprocessStdout:H,subprocess:q,binary:Y,encoding:X,preserveNewlines:$}),_=new gz({read:U,destroy:fz(M3.bind(void 0,{subprocessStdout:H,subprocess:q,waitReadableDestroy:K})),highWaterMark:W,objectMode:V,encoding:G});return R3({subprocessStdout:H,onStdoutDataDone:z,readable:_,subprocess:q}),_},B3=(q,J,X)=>{let Z=v6(q,J),Q=T2(X,Z,"readableDestroy");return{subprocessStdout:Z,waitReadableDestroy:Q}},x3=({readableEncoding:q,readableObjectMode:J,readableHighWaterMark:X},Z)=>Z?{readableEncoding:q,readableObjectMode:J,readableHighWaterMark:X}:{readableEncoding:q,readableObjectMode:!0,readableHighWaterMark:V3},j3=({subprocessStdout:q,subprocess:J,binary:X,encoding:Z,preserveNewlines:Q})=>{let $=O0(),Y=$8({subprocessStdout:q,subprocess:J,binary:X,shouldEncode:!X,encoding:Z,preserveNewlines:Q});return{read(){uz(this,Y,$)},onStdoutDataDone:$}},uz=async(q,J,X)=>{try{let{value:Z,done:Q}=await J.next();if(Q)X.resolve();else q.push(Z)}catch{}},R3=async({subprocessStdout:q,onStdoutDataDone:J,readable:X,subprocess:Z,subprocessStdin:Q})=>{try{if(await L3(q),await Z,await z3(Q),await J,X.readable)X.push(null)}catch($){await z3(Q),GX(X,$)}},M3=async({subprocessStdout:q,subprocess:J,waitReadableDestroy:X},Z)=>{if(await g6(X,J))GX(q,Z),await H8(J,Z)},GX=(q,J)=>{K8(q,q.readable,J)};import{Writable as mz}from"node:stream";import{callbackify as WX}from"node:util";var UX=({subprocess:q,concurrentStreams:J},{to:X}={})=>{let{subprocessStdin:Z,waitWritableFinal:Q,waitWritableDestroy:$}=C3(q,X,J),Y=new mz({...F3(Z,q,Q),destroy:WX(T3.bind(void 0,{subprocessStdin:Z,subprocess:q,waitWritableFinal:Q,waitWritableDestroy:$})),highWaterMark:Z.writableHighWaterMark,objectMode:Z.writableObjectMode});return k3(Z,Y),Y},C3=(q,J,X)=>{let Z=k1(q,J),Q=T2(X,Z,"writableFinal"),$=T2(X,Z,"writableDestroy");return{subprocessStdin:Z,waitWritableFinal:Q,waitWritableDestroy:$}},F3=(q,J,X)=>({write:dz.bind(void 0,q),final:WX(cz.bind(void 0,q,J,X))}),dz=(q,J,X,Z)=>{if(q.write(J,X))Z();else q.once("drain",Z)},cz=async(q,J,X)=>{if(await g6(X,J)){if(q.writable)q.end();await J}},k3=async(q,J,X)=>{try{if(await _3(q),J.writable)J.end()}catch(Z){await KX(X),zX(J,Z)}},T3=async({subprocessStdin:q,subprocess:J,waitWritableFinal:X,waitWritableDestroy:Z},Q)=>{if(await g6(X,J),await g6(Z,J))zX(q,Q),await H8(J,Q)},zX=(q,J)=>{K8(q,q.writable,J)};import{Duplex as lz}from"node:stream";import{callbackify as pz}from"node:util";var _X=({subprocess:q,concurrentStreams:J,encoding:X},{from:Z,to:Q,binary:$=!0,preserveNewlines:Y=!0}={})=>{let H=$||V0.has(X),{subprocessStdout:K,waitReadableDestroy:G}=B3(q,Z,J),{subprocessStdin:V,waitWritableFinal:W,waitWritableDestroy:U}=C3(q,Q,J),{readableEncoding:z,readableObjectMode:_,readableHighWaterMark:L}=x3(K,H),{read:x,onStdoutDataDone:B}=j3({subprocessStdout:K,subprocess:q,binary:H,encoding:X,preserveNewlines:Y}),j=new lz({read:x,...F3(V,q,W),destroy:pz(nz.bind(void 0,{subprocessStdout:K,subprocessStdin:V,subprocess:q,waitReadableDestroy:G,waitWritableFinal:W,waitWritableDestroy:U})),readableHighWaterMark:L,writableHighWaterMark:V.writableHighWaterMark,readableObjectMode:_,writableObjectMode:V.writableObjectMode,encoding:z});return R3({subprocessStdout:K,onStdoutDataDone:B,readable:j,subprocess:q,subprocessStdin:V}),k3(V,j,K),j},nz=async({subprocessStdout:q,subprocessStdin:J,subprocess:X,waitReadableDestroy:Z,waitWritableFinal:Q,waitWritableDestroy:$},Y)=>{await Promise.all([M3({subprocessStdout:q,subprocess:X,waitReadableDestroy:Z},Y),T3({subprocessStdin:J,subprocess:X,waitWritableFinal:Q,waitWritableDestroy:$},Y)])};var w3=(q,J,{from:X,binary:Z=!1,preserveNewlines:Q=!1}={})=>{let $=Z||V0.has(J),Y=v6(q,X),H=$8({subprocessStdout:Y,subprocess:q,binary:$,shouldEncode:!0,encoding:J,preserveNewlines:Q});return iz(H,Y,q)},iz=async function*(q,J,X){try{yield*q}finally{if(J.readable)J.destroy();await X}};var LX=(q,{encoding:J})=>{let X=YX();q.readable=VX.bind(void 0,{subprocess:q,concurrentStreams:X,encoding:J}),q.writable=UX.bind(void 0,{subprocess:q,concurrentStreams:X}),q.duplex=_X.bind(void 0,{subprocess:q,concurrentStreams:X,encoding:J}),q.iterable=w3.bind(void 0,q,J),q[Symbol.asyncIterator]=w3.bind(void 0,q,J,{})};var BX=(q,J)=>{for(let[X,Z]of oz){let Q=Z.value.bind(J);Reflect.defineProperty(q,X,{...Z,value:Q})}},az=(async()=>{})().constructor.prototype,oz=["then","catch","finally"].map((q)=>[q,Reflect.getOwnPropertyDescriptor(az,q)]);var xX=(q,J,X,Z)=>{let{file:Q,commandArguments:$,command:Y,escapedCommand:H,startTime:K,verboseInfo:G,options:V,fileDescriptors:W}=tz(q,J,X),{subprocess:U,promise:z}=q_({file:Q,commandArguments:$,options:V,startTime:K,verboseInfo:G,command:Y,escapedCommand:H,fileDescriptors:W});return U.pipe=Q8.bind(void 0,{source:U,sourcePromise:z,boundOptions:{},createNested:Z}),BX(U,z),v0.set(U,{options:V,fileDescriptors:W}),U},tz=(q,J,X)=>{let{command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y}=U1(q,J,X),{file:H,commandArguments:K,options:G}=y1(q,J,X),V=ez(G),W=TJ(V,Y);return{file:H,commandArguments:K,command:Z,escapedCommand:Q,startTime:$,verboseInfo:Y,options:V,fileDescriptors:W}},ez=({timeout:q,signal:J,...X})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:q}},q_=({file:q,commandArguments:J,options:X,startTime:Z,verboseInfo:Q,command:$,escapedCommand:Y,fileDescriptors:H})=>{let K;try{K=sz(...S1(q,J,X))}catch(_){return MJ({error:_,command:$,escapedCommand:Y,fileDescriptors:H,options:X,startTime:Z,verboseInfo:Q})}let G=new AbortController;rz(Number.POSITIVE_INFINITY,G.signal);let V=[...K.stdio];yJ(K,H,G),fJ(K,X,G);let W={},U=O0();K.kill=a5.bind(void 0,{kill:K.kill.bind(K),options:X,onInternalError:U,context:W,controller:G}),K.all=eJ(K,X),LX(K,X),xJ(K,X);let z=J_({subprocess:K,options:X,startTime:Z,verboseInfo:Q,fileDescriptors:H,originalStreams:V,command:$,escapedCommand:Y,context:W,onInternalError:U,controller:G});return{subprocess:K,promise:z}},J_=async({subprocess:q,options:J,startTime:X,verboseInfo:Z,fileDescriptors:Q,originalStreams:$,command:Y,escapedCommand:H,context:K,onInternalError:G,controller:V})=>{let[W,[U,z],_,L,x]=await $X({subprocess:q,options:J,context:K,verboseInfo:Z,fileDescriptors:Q,originalStreams:$,onInternalError:G,controller:V});V.abort(),G.resolve();let B=_.map((F,C)=>m0(F,J,C)),j=m0(L,J,"all"),R=X_({errorInfo:W,exitCode:U,signal:z,stdio:B,all:j,ipcOutput:x,context:K,options:J,command:Y,escapedCommand:H,startTime:X});return S6(R,Z,J)},X_=({errorInfo:q,exitCode:J,signal:X,stdio:Z,all:Q,ipcOutput:$,context:Y,options:H,command:K,escapedCommand:G,startTime:V})=>("error"in q)?j2({error:q.error,command:K,escapedCommand:G,timedOut:Y.terminationReason==="timeout",isCanceled:Y.terminationReason==="cancel"||Y.terminationReason==="gracefulCancel",isGracefullyCanceled:Y.terminationReason==="gracefulCancel",isMaxBuffer:q.error instanceof f0,isForcefullyTerminated:Y.isForcefullyTerminated,exitCode:J,signal:X,stdio:Z,all:Q,ipcOutput:$,options:H,startTime:V,isSync:!1}):l1({command:K,escapedCommand:G,stdio:Z,all:Q,ipcOutput:$,options:H,startTime:V});var V8=(q,J)=>{let X=Object.fromEntries(Object.entries(J).map(([Z,Q])=>[Z,Z_(Z,q[Z],Q)]));return{...q,...X}},Z_=(q,J,X)=>{if(Q_.has(q)&&b(J)&&b(X))return{...J,...X};return X},Q_=new Set(["env",...U4]);var r0=(q,J,X,Z)=>{let Q=(Y,H,K)=>r0(Y,H,X,K),$=(...Y)=>$_({mapArguments:q,deepOptions:X,boundOptions:J,setBoundExeca:Z,createNested:Q},...Y);if(Z!==void 0)Z($,Q,J);return $},$_=({mapArguments:q,deepOptions:J={},boundOptions:X={},setBoundExeca:Z,createNested:Q},$,...Y)=>{if(b($))return Q(q,V8(X,$),Z);let{file:H,commandArguments:K,options:G,isSync:V}=Y_({mapArguments:q,firstArgument:$,nextArguments:Y,deepOptions:J,boundOptions:X});return V?WJ(H,K,G):xX(H,K,G,Q)},Y_=({mapArguments:q,firstArgument:J,nextArguments:X,deepOptions:Z,boundOptions:Q})=>{let $=U5(J)?z5(J,X):[J,...X],[Y,H,K]=J1(...$),G=V8(V8(Z,Q),K),{file:V=Y,commandArguments:W=H,options:U=G,isSync:z=!1}=q({file:Y,commandArguments:H,options:G});return{file:V,commandArguments:W,options:U,isSync:z}};var jX=({file:q,commandArguments:J})=>MX(q,J),RX=({file:q,commandArguments:J})=>({...MX(q,J),isSync:!0}),MX=(q,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${q} ${J}.`);let[X,...Z]=H_(q);return{file:X,commandArguments:Z}},H_=(q)=>{if(typeof q!=="string")throw TypeError(`The command must be a string: ${String(q)}.`);let J=q.trim();if(J==="")return[];let X=[];for(let Z of J.split(K_)){let Q=X.at(-1);if(Q&&Q.endsWith("\\"))X[X.length-1]=`${Q.slice(0,-1)} ${Z}`;else X.push(Z)}return X},K_=/ +/g;var CX=(q,J,X)=>{q.sync=J(V_,X),q.s=q.sync},FX=({options:q})=>kX(q),V_=({options:q})=>({...kX(q),isSync:!0}),kX=(q)=>({options:{...G_(q),...q}}),G_=({input:q,inputFile:J,stdio:X})=>q===void 0&&J===void 0&&X===void 0?{stdin:"inherit"}:{},TX={preferLocal:!0};var s0=r0(()=>({})),UO=r0(()=>({isSync:!0})),zO=r0(jX),_O=r0(RX),LO=r0(vq),BO=r0(FX,{},TX,CX),{sendMessage:xO,getOneMessage:jO,getEachMessage:RO,getCancelSignal:MO}=jJ();var K$=D4(ZZ(),1),V$=D4(tQ(),1);import*as Y6 from"node:os";import{dirname as lx,join as Z7}from"node:path";import{pipeline as px}from"node:stream/promises";import _v,{promises as Fx}from"node:fs";async function t3(q){try{return await Fx.access(q),!0}catch{return!1}}import J7 from"node:fs";import h8 from"node:path";import bx from"node:stream";import{promisify as gx}from"node:util";import{promisify as kx}from"util";import e3 from"crypto";var eQ=kx(e3.randomBytes),Tx="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),wx="0123456789".split(""),Px="CDEHKMPRTUWXY012458".split(""),Ax="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),Dx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Ix=(q,J)=>{let X=J.length,Z=Math.floor(65536/X)*X-1,Q=2*Math.ceil(1.1*q),$="",Y=0;while(Y<q){let H=e3.randomBytes(Q),K=0;while(K<Q&&Y<q){let G=H.readUInt16LE(K);if(K+=2,G>Z)continue;$+=J[G%X],Y++}}return $},Ox=async(q,J)=>{let X=J.length,Z=Math.floor(65536/X)*X-1,Q=2*Math.ceil(1.1*q),$="",Y=0;while(Y<q){let H=await eQ(Q),K=0;while(K<Q&&Y<q){let G=H.readUInt16LE(K);if(K+=2,G>Z)continue;$+=J[G%X],Y++}}return $},vx=(q,J,X)=>e3.randomBytes(q).toString(J).slice(0,X),Nx=async(q,J,X)=>{return(await eQ(q)).toString(J).slice(0,X)},Ex=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),q$=(q,J)=>({length:X,type:Z,characters:Q})=>{if(!(X>=0&&Number.isFinite(X)))throw TypeError("Expected a `length` to be a non-negative finite number");if(Z!==void 0&&Q!==void 0)throw TypeError("Expected either `type` or `characters`");if(Q!==void 0&&typeof Q!=="string")throw TypeError("Expected `characters` to be string");if(!Ex.has(Z))throw TypeError(`Unknown type: ${Z}`);if(Z===void 0&&Q===void 0)Z="hex";if(Z==="hex"||Z===void 0&&Q===void 0)return J(Math.ceil(X*0.5),"hex",X);if(Z==="base64")return J(Math.ceil(X*0.75),"base64",X);if(Z==="url-safe")return q(X,Tx);if(Z==="numeric")return q(X,wx);if(Z==="distinguishable")return q(X,Px);if(Z==="ascii-printable")return q(X,Ax);if(Z==="alphanumeric")return q(X,Dx);if(Q.length===0)throw TypeError("Expected `characters` string length to be greater than or equal to 1");if(Q.length>65536)throw TypeError("Expected `characters` string length to be less or equal to 65536");return q(X,Q.split(""))},J$=q$(Ix,vx);J$.async=q$(Ox,Nx);var X$=J$;function q7(){return X$({length:32})}import{promises as yx}from"node:fs";import Sx from"node:os";var hx=await yx.realpath(Sx.tmpdir()),S8=hx;var Ev=gx(bx.pipeline);function b8(q){if(typeof q!=="string")throw TypeError(`Expected a string, got ${typeof q}`);let J=q.trim();if(!(J!==""&&J!=="."&&J!==".."&&!q.includes("/")&&!q.includes("\\")&&!q.includes("\x00")))throw Error(`Unsafe path component: ${JSON.stringify(q)}`)}function fx(q,J){b8(q);let X=J??S8,Z=h8.join(X,q);return J7.mkdirSync(Z,{recursive:!0}),Z}var Z$=(q="",{parentDirectory:J,rootDirectory:X}={})=>{if(q)b8(q);if(X!==void 0){if(!h8.isAbsolute(X))throw Error("The `rootDirectory` option must be an absolute path");J7.mkdirSync(X,{recursive:!0})}let Z=J?fx(J,X):X??S8;return h8.join(Z,q+q7())};function Q$({name:q,extension:J,parentDirectory:X,rootDirectory:Z}={}){if(q!==void 0&&q!==null){if(J!==void 0&&J!==null)throw Error("The `name` and `extension` options are mutually exclusive");return b8(q),h8.join(ux({parentDirectory:X,rootDirectory:Z}),q)}if(J!==void 0&&J!==null)b8(J);return Z$("",{parentDirectory:X,rootDirectory:Z})+(J===void 0||J===null?"":"."+J.replace(/^\./,""))}function ux({prefix:q="",parentDirectory:J,rootDirectory:X}={}){let Z=Z$(q,{parentDirectory:J,rootDirectory:X});return J7.mkdirSync(Z,{recursive:!0}),Z}import mx from"os";import g8 from"path";var $6=mx.homedir(),{env:C6}=process,$$=C6.XDG_DATA_HOME||($6?g8.join($6,".local","share"):void 0),Y$=C6.XDG_CONFIG_HOME||($6?g8.join($6,".config"):void 0),gv=C6.XDG_STATE_HOME||($6?g8.join($6,".local","state"):void 0),H$=C6.XDG_CACHE_HOME||($6?g8.join($6,".cache"):void 0),fv=C6.XDG_RUNTIME_DIR||void 0,dx=(C6.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if($$)dx.unshift($$);var cx=(C6.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(Y$)cx.unshift(Y$);var{mkdir:Q7,createWriteStream:nx,move:ix}=V$.default,ax="microsoft/ripgrep-prebuilt",X7=process.env.RIPGREP_VERSION||"v15.0.0",ox=()=>{let q=process.env.npm_config_arch||Y6.arch(),J=process.env.platform||Y6.platform();switch(J){case"darwin":switch(q){case"arm64":return"aarch64-apple-darwin.tar.gz";default:return"x86_64-apple-darwin.tar.gz"}case"win32":switch(q){case"x64":return"x86_64-pc-windows-msvc.zip";case"arm":return"aarch64-pc-windows-msvc.zip";default:return"i686-pc-windows-msvc.zip"}case"linux":switch(q){case"x64":return"x86_64-unknown-linux-musl.tar.gz";case"arm":case"armv7l":return"arm-unknown-linux-gnueabihf.tar.gz";case"arm64":return"aarch64-unknown-linux-gnu.tar.gz";case"ppc64":return"powerpc64le-unknown-linux-gnu.tar.gz";case"s390x":return"s390x-unknown-linux-gnu.tar.gz";default:return"i686-unknown-linux-musl.tar.gz"}default:throw Error("Unknown platform: "+J)}},rx=async(q,J)=>{try{let X=Q$(),Z=await fetch(q);if(!Z.ok)throw Error(`HTTP ${Z.status}: ${Z.statusText}`);await px(Z.body,nx(X)),await Q7(lx(J),{recursive:!0}),await ix(X,J)}catch(X){throw console.error(`Failed to download "${q}"`),X}},sx=async(q,J)=>{try{await Q7(J,{recursive:!0}),await K$.default(q,{dir:J})}catch(X){throw console.error(`Failed to unzip "${q}"`),X}},tx=async(q,J)=>{try{await Q7(J,{recursive:!0}),await s0("tar",["xvf",q,"-C",J])}catch(X){throw console.error(`Failed to extract "${q}"`),X}},ex=async(q)=>{if(q==="android")try{return await s0("pkg",["install","ripgrep","-y"]),!0}catch(J){return console.info("Could not install ripgrep via pkg. Falling back to download."),!1}return!1},$7=Z7(Z7(Y6.homedir(),".zen-core"),`rg${process.platform==="win32"?".exe":""}`),iv=async()=>{if(await t3($7)){console.log("rg cached");return}let q=process.env.platform||Y6.platform();if(q==="android"){if(await ex(q))return}let J=ox(),Z=`${process.env.RIPGREP_PREBUILT_BINARIES_MIRROR||`https://v6.gh-proxy.org/https://github.com/${ax}/releases/download`}/${X7}/ripgrep-${X7}-${J}`,Q=`${H$}/vscode-ripgrep/ripgrep-${X7}-${J}`,$=Z7(Y6.homedir(),".zen-core");if(!await t3(Q))await rx(Z,Q);else console.info(`File ${Q} has been cached`);if(Q.endsWith(".tar.gz"))await tx(Q,$);else if(Q.endsWith(".zip"))await sx(Q,$);else throw Error(`Invalid downloadPath ${Q}`)};import{resolve as qj}from"path";var Jj=async(q,J,X={})=>{let{timeout:Z=15000,cwd:Q}=X;try{let $=await s0(q,J,{cwd:Q||process.cwd(),timeout:Z,reject:!1,stripFinalNewline:!1,stdio:["pipe","pipe","pipe"],env:process.env});return{code:$.exitCode??0,stdout:$.stdout,stderr:$.stderr}}catch($){if($.timedOut)return{code:124,stdout:$.stdout||"",stderr:($.stderr||"")+`
80
+ Process timed out`};return{code:$.exitCode||1,stdout:$.stdout||"",stderr:$.stderr||$.message||"Unknown error"}}},G$=H0(async({args:q,head_limit:J},X)=>{if(!X.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");if(!q||q.length===0)return"Error: No arguments provided. Please provide ripgrep arguments.";if(!J&&!q.includes("--max-count"))J=500;let Z=q[q.length-1],Q=[...q];if(Z&&!Z.startsWith("-"))Q[Q.length-1]=qj(X.state.cwd,Z);let $=await Jj($7,Q,{timeout:15000,cwd:X.state.cwd});if(J&&$.stdout){let Y=$.stdout.split(`
81
81
  `);if(Y.length>J)$.stdout=Y.slice(0,J).join(`
82
82
  `)}if($.code!==0&&$.stderr){if($.code===1&&$.stdout==="")return"No matches found.";if($.code===124||$.stderr.includes("timeout")||$.stderr.includes("timed out"))return"Error: Search timed out after 15 seconds. Please use a more specific pattern or limit the search scope with type/glob/path parameters.";return`Error executing ripgrep: ${$.stderr}`}return $.stdout||"No matches found."},{name:"search_files_rg",description:`Ripgrep (rg) - A fast text search tool that recursively searches directories for regex patterns
83
83
 
@@ -125,11 +125,11 @@ Performance:
125
125
  - 15 second timeout per search
126
126
  - Results limited to 500 lines by default (use head_limit parameter)
127
127
  - Respects .gitignore by default (use --no-ignore to override)
128
- `,schema:T.object({description:T.string().optional().describe("what you want to do"),args:T.array(T.string()).describe('Ripgrep (rg) command arguments as array. Format: [OPTIONS...] PATTERN [PATH...]. MUST include path at end! Examples: ["import", "./"] (search "import" in current dir), ["-n", "-i", "function", "./"] (search "function" with line numbers, case insensitive), ["--type", "ts", "export", "src/"] (search "export" in TypeScript files in src/).'),head_limit:T.number().optional().describe("Limit output to first N lines. If not specified and no --max-count in args, defaults to 500 lines for performance.")})});import{promises as J$}from"fs";import{resolve as X$}from"path";var e3=2000,lx=T.object({description:T.string().optional().describe("what you want to do"),file_path:T.string().describe("The path to the file to read (absolute or relative to cwd)"),offset:T.number().default(0).optional().describe("The line number to start reading from. Only provide if the file is too large to read at once"),limit:T.number().default(e3).optional().describe("The number of lines to read. Only provide if the file is too large to read at once.")}),px=new Set([".png",".jpg",".jpeg",".gif",".bmp",".ico",".webp",".svg",".tiff",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".zip",".rar",".7z",".tar",".gz",".mp3",".wav",".ogg",".flac",".mp4",".avi",".mkv",".mov",".exe",".dll",".so",".dylib",".bin",".class",".ipynb"]);function nx(q){let J=q.toLowerCase().split(".").pop();if(J&&px.has("."+J))return!0;return!1}function ix(q){let J=q.toLowerCase().split(".").pop();return J?`.${J}`:""}var Z$=H0(async({file_path:q,offset:J,limit:X},Z)=>{try{if(!Z.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");let Q=X$(Z.state.cwd,q),$=ix(Q);if(nx(Q))if($===".pdf")return`[PDF FILE DETECTED]
128
+ `,schema:T.object({description:T.string().optional().describe("what you want to do"),args:T.array(T.string()).describe('Ripgrep (rg) command arguments as array. Format: [OPTIONS...] PATTERN [PATH...]. MUST include path at end! Examples: ["import", "./"] (search "import" in current dir), ["-n", "-i", "function", "./"] (search "function" with line numbers, case insensitive), ["--type", "ts", "export", "src/"] (search "export" in TypeScript files in src/).'),head_limit:T.number().optional().describe("Limit output to first N lines. If not specified and no --max-count in args, defaults to 500 lines for performance.")})});import{promises as W$}from"fs";import{resolve as U$}from"path";var Y7=2000,Xj=T.object({description:T.string().optional().describe("what you want to do"),file_path:T.string().describe("The path to the file to read (absolute or relative to cwd)"),offset:T.number().default(0).optional().describe("The line number to start reading from. Only provide if the file is too large to read at once"),limit:T.number().default(Y7).optional().describe("The number of lines to read. Only provide if the file is too large to read at once.")}),Zj=new Set([".png",".jpg",".jpeg",".gif",".bmp",".ico",".webp",".svg",".tiff",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".zip",".rar",".7z",".tar",".gz",".mp3",".wav",".ogg",".flac",".mp4",".avi",".mkv",".mov",".exe",".dll",".so",".dylib",".bin",".class",".ipynb"]);function Qj(q){let J=q.toLowerCase().split(".").pop();if(J&&Zj.has("."+J))return!0;return!1}function $j(q){let J=q.toLowerCase().split(".").pop();return J?`.${J}`:""}var z$=H0(async({file_path:q,offset:J,limit:X},Z)=>{try{if(!Z.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");let Q=U$(Z.state.cwd,q),$=$j(Q);if(Qj(Q))if($===".pdf")return`[PDF FILE DETECTED]
129
129
 
130
130
  This is a PDF file. The file path is: ${Q}
131
131
 
132
- Note: PDF processing requires specialized libraries like pdf-parse. For now, this file can be processed by a dedicated PDF reading tool or middleware.`;else if($===".ipynb")try{let G=(await J$.readFile(Q)).toString("utf-8"),V=JSON.parse(G),W=`[JUPYTER NOTEBOOK]
132
+ Note: PDF processing requires specialized libraries like pdf-parse. For now, this file can be processed by a dedicated PDF reading tool or middleware.`;else if($===".ipynb")try{let G=(await W$.readFile(Q)).toString("utf-8"),V=JSON.parse(G),W=`[JUPYTER NOTEBOOK]
133
133
 
134
134
  Path: ${Q}
135
135
 
@@ -147,13 +147,13 @@ ${K.message}`}else return`[BINARY FILE DETECTED]
147
147
  File type: ${$}
148
148
  File path: ${Q}
149
149
 
150
- This is a binary file. The file was detected but cannot be displayed as text. For images, this tool supports visual rendering in a multimodal context. For other binary formats, specialized processing tools may be required.`;let H=(await J$.readFile(Q,"utf-8")).split(`
150
+ This is a binary file. The file was detected but cannot be displayed as text. For images, this tool supports visual rendering in a multimodal context. For other binary formats, specialized processing tools may be required.`;let H=(await W$.readFile(Q,"utf-8")).split(`
151
151
  `);if(J)H=H.slice(J-1);if(X)H=H.slice(0,X);return H.join(`
152
152
  `)}catch(Q){if(Q.code==="ENOENT")return`Error: File not found at ${q}`;if(Q.code==="ERR_INVALID_UTF8"||Q.message.includes("Invalid"))return`[UNABLE TO DECODE AS TEXT]
153
153
 
154
154
  The file could not be decoded as UTF-8. This may be a binary file.
155
155
 
156
- File path: ${X$(Z.state.cwd||"",q)}
156
+ File path: ${U$(Z.state.cwd||"",q)}
157
157
 
158
158
  If this is a text file with a different encoding, it may need special handling.`;throw Q}},{name:"read_file",description:`Reads a file from the local filesystem. Relative paths are resolved based on the current working directory (cwd).
159
159
  Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.
@@ -161,22 +161,22 @@ Assume this tool is able to read all files on the machine. If the User provides
161
161
  Usage:
162
162
  - The file_path parameter can be either an absolute path or a relative path
163
163
  - Relative paths are resolved relative to the current working directory (cwd)
164
- - By default, it reads up to ${e3} lines starting from the beginning of the file
164
+ - By default, it reads up to ${Y7} lines starting from the beginning of the file
165
165
  - You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters
166
- - Any lines longer than ${e3} characters will be truncated
166
+ - Any lines longer than ${Y7} characters will be truncated
167
167
  - Results are returned using cat -n format, with line numbers starting at 1
168
168
  - This tool allows You to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually as You is a multimodal LLM.
169
169
  - This tool can read PDF files (.pdf). PDFs are processed page by page, extracting both text and visual content for analysis.
170
170
  - This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs, combining code, text, and visualizations.
171
171
  - You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.
172
172
  - You will regularly be asked to read screenshots. If the user provides a path to a screenshot ALWAYS use this tool to view the file at the path. This tool will work with all temporary file paths like /var/folders/123/abc/T/TemporaryItems/NSIRD_screencaptureui_ZfB1tD/Screenshot.png
173
- - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.`,schema:lx});import{promises as ax}from"fs";import{resolve as ox}from"path";var Q$=H0(async({file_path:q,content:J},X)=>{if(!X.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");try{let Z=ox(X.state.cwd,q);return await ax.writeFile(Z,J,"utf-8"),`File ${Z} has been written successfully.`}catch(Z){return`Error writing file: ${Z.message}`}},{name:"write_file",description:`Writes a file to the local filesystem. Relative paths are resolved based on the current working directory (cwd).
173
+ - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.`,schema:Xj});import{promises as Yj}from"fs";import{resolve as Hj}from"path";var _$=H0(async({file_path:q,content:J},X)=>{if(!X.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");try{let Z=Hj(X.state.cwd,q);return await Yj.writeFile(Z,J,"utf-8"),`File ${Z} has been written successfully.`}catch(Z){return`Error writing file: ${Z.message}`}},{name:"write_file",description:`Writes a file to the local filesystem. Relative paths are resolved based on the current working directory (cwd).
174
174
  Usage:
175
175
  - This tool will overwrite the existing file if there is one at the provided path.
176
176
  - If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.
177
177
  - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
178
178
  - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.
179
- - Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.`,schema:T.object({description:T.string().optional().describe("what you want to do"),file_path:T.string().describe("The path to the file to write (absolute or relative to cwd)"),content:T.string().describe("The content to write to the file")})});import{promises as q7}from"fs";import{resolve as rx}from"path";var sx=T.object({description:T.string().optional().describe("what you want to do"),file_path:T.string().describe("The path to the file to modify (absolute or relative to cwd)"),old_string:T.string().describe("The text to replace"),new_string:T.string().describe("The text to replace it with (must be different from old_string)"),replace_all:T.boolean().optional().default(!1).describe("Replace all occurences of old_string (default false)")}),$$=H0(async({file_path:q,old_string:J,new_string:X,replace_all:Z=!1},Q)=>{try{if(!Q.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");let $=rx(Q.state.cwd,q),Y=await q7.readFile($,"utf-8");if(Z){if(!Y.includes(J))return`Error: old_string not found in ${$}`;let H=Y.split(J).join(X);return await q7.writeFile($,H,"utf-8"),`File ${$} has been edited successfully. Replaced all occurrences of old_string.`}else{let H=Y.split(J);if(H.length===1)return`Error: old_string not found in ${$}`;if(H.length>2)return`Error: old_string is not unique in ${$} (found ${H.length-1} occurrences). Please provide more context or set replace_all to true.`;let K=Y.replace(J,X);return await q7.writeFile($,K,"utf-8"),`File ${$} has been edited successfully. Replaced single occurrence of old_string.`}}catch($){if($.code==="ENOENT")return`Error: File not found at ${q}`;throw $}},{name:"edit_file",description:`Performs exact string replacements in files. Relative paths are resolved based on the current working directory (cwd).
179
+ - Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.`,schema:T.object({description:T.string().optional().describe("what you want to do"),file_path:T.string().describe("The path to the file to write (absolute or relative to cwd)"),content:T.string().describe("The content to write to the file")})});import{promises as H7}from"fs";import{resolve as Kj}from"path";var Vj=T.object({description:T.string().optional().describe("what you want to do"),file_path:T.string().describe("The path to the file to modify (absolute or relative to cwd)"),old_string:T.string().describe("The text to replace"),new_string:T.string().describe("The text to replace it with (must be different from old_string)"),replace_all:T.boolean().optional().default(!1).describe("Replace all occurences of old_string (default false)")}),L$=H0(async({file_path:q,old_string:J,new_string:X,replace_all:Z=!1},Q)=>{try{if(!Q.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");let $=Kj(Q.state.cwd,q),Y=await H7.readFile($,"utf-8");if(Z){if(!Y.includes(J))return`Error: old_string not found in ${$}`;let H=Y.split(J).join(X);return await H7.writeFile($,H,"utf-8"),`File ${$} has been edited successfully. Replaced all occurrences of old_string.`}else{let H=Y.split(J);if(H.length===1)return`Error: old_string not found in ${$}`;if(H.length>2)return`Error: old_string is not unique in ${$} (found ${H.length-1} occurrences). Please provide more context or set replace_all to true.`;let K=Y.replace(J,X);return await H7.writeFile($,K,"utf-8"),`File ${$} has been edited successfully. Replaced single occurrence of old_string.`}}catch($){if($.code==="ENOENT")return`Error: File not found at ${q}`;throw $}},{name:"edit_file",description:`Performs exact string replacements in files. Relative paths are resolved based on the current working directory (cwd).
180
180
 
181
181
  Usage:
182
182
  - You must use your \`Read\` tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.
@@ -184,7 +184,7 @@ Usage:
184
184
  - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
185
185
  - Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
186
186
  - The edit will FAIL if \`old_string\` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use \`replace_all\` to change every instance of \`old_string\`.
187
- - Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.`,schema:sx});class Y${name="FilesystemMiddleware";contextSchema=void 0;stateSchema=void 0;tools=[Z$,Q$,$$,s7,q$,X7];async execute(){return this}}var g8=process.platform==="win32",H$=g8?"cmd.exe":"/bin/bash",K$=g8?["/d","/s","/c"]:["-c"],J7=H0(async({command:q,timeout:J,run_in_background:X,kill_process_id:Z,get_output_id:Q,filter:$},Y)=>{if(Z){let H=parseInt(Z,10),K=$6.get(H);if(!K)return`Error: No background process found with ID ${Z}.`;return K.process.kill(),$6.delete(H),`Successfully killed process with ID ${Z}.`}if(Q){let H=parseInt(Q,10),K=$6.get(H);if(!K)return`Error: No background process found with ID ${Q}.`;let G=K.stdout.join(""),V=K.stderr.join("");if(K.stdout=[],K.stderr=[],$){let U=new RegExp($);G=G.split(`
187
+ - Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.`,schema:Vj});class B${name="FilesystemMiddleware";contextSchema=void 0;stateSchema=void 0;tools=[z$,_$,L$,Q5,G$,V7];async execute(){return this}}var f8=process.platform==="win32",x$=f8?"cmd.exe":"/bin/bash",j$=f8?["/d","/s","/c"]:["-c"],K7=H0(async({command:q,timeout:J,run_in_background:X,kill_process_id:Z,get_output_id:Q,filter:$},Y)=>{if(Z){let H=parseInt(Z,10),K=H6.get(H);if(!K)return`Error: No background process found with ID ${Z}.`;return K.process.kill(),H6.delete(H),`Successfully killed process with ID ${Z}.`}if(Q){let H=parseInt(Q,10),K=H6.get(H);if(!K)return`Error: No background process found with ID ${Q}.`;let G=K.stdout.join(""),V=K.stderr.join("");if(K.stdout=[],K.stderr=[],$){let U=new RegExp($);G=G.split(`
188
188
  `).filter((z)=>U.test(z)).join(`
189
189
  `),V=V.split(`
190
190
  `).filter((z)=>U.test(z)).join(`
@@ -192,7 +192,7 @@ Usage:
192
192
  ${G}
193
193
  `;if(V)W+=`STDERR:
194
194
  ${V}
195
- `;return W||"No new output since last check."}if(!q)return"Error: 'command' argument is required unless using 'kill_process_id' or 'get_output_id'.";if(!Y.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");if(X)try{let H=k2(H$,[...K$,q],{cwd:Y.state.cwd,timeout:J??20000,reject:!1,windowsVerbatimArguments:g8});if(!H.pid)return"Failed to start command in background.";let K={process:H,stdout:[],stderr:[],command:q,startTime:Date.now()};return $6.set(H.pid,K),H.stdout?.on("data",(G)=>{K.stdout.push(G.toString())}),H.stderr?.on("data",(G)=>{K.stderr.push(G.toString())}),H.on("close",()=>{}),`Command started in background with ID: ${H.pid}`}catch(H){return`Error starting background command: ${H}`}else try{let H=await k2(H$,[...K$,q],{cwd:Y.state.cwd,timeout:J??20000,reject:!1,windowsVerbatimArguments:g8});if(H.exitCode!==0)return H.stderr;return H.stdout}catch(H){return`Error executing command: ${H}`}},{name:"terminal",description:`Executes commands in a persistent shell session (Bash on Linux/macOS, CMD on Windows). Commands are executed in the current working directory (cwd).
195
+ `;return W||"No new output since last check."}if(!q)return"Error: 'command' argument is required unless using 'kill_process_id' or 'get_output_id'.";if(!Y.state.cwd)throw Error("Current working directory (cwd) is not set in the agent state.");if(X)try{let H=s0(x$,[...j$,q],{cwd:Y.state.cwd,timeout:J??20000,reject:!1,windowsVerbatimArguments:f8});if(!H.pid)return"Failed to start command in background.";let K={process:H,stdout:[],stderr:[],command:q,startTime:Date.now()};return H6.set(H.pid,K),H.stdout?.on("data",(G)=>{K.stdout.push(G.toString())}),H.stderr?.on("data",(G)=>{K.stderr.push(G.toString())}),H.on("close",()=>{}),`Command started in background with ID: ${H.pid}`}catch(H){return`Error starting background command: ${H}`}else try{let H=await s0(x$,[...j$,q],{cwd:Y.state.cwd,timeout:J??20000,reject:!1,windowsVerbatimArguments:f8});if(H.exitCode!==0)return H.stderr;return H.stdout}catch(H){return`Error executing command: ${H}`}},{name:"terminal",description:`Executes commands in a persistent shell session (Bash on Linux/macOS, CMD on Windows). Commands are executed in the current working directory (cwd).
196
196
  Features:
197
197
  - Run commands (foreground or background)
198
198
  - Retrieve background process output
@@ -210,4 +210,4 @@ Notes:
210
210
  - Avoid interactive commands (like top, vim)
211
211
  - Use '&&' or ';' to chain commands (PowerShell/CMD syntax varies, simple chaining often works)
212
212
  - CAN'T BATCH CALL THIS TOOL!
213
- `,schema:T.object({description:T.string().describe("what you want to do"),command:T.string().optional().describe("The command to execute (required for running commands)"),timeout:T.number().optional().describe("Timeout in ms (default: 20000)"),run_in_background:T.boolean().optional().describe("Run command in background"),kill_process_id:T.string().optional().describe("ID of process to kill"),get_output_id:T.string().optional().describe("ID of process to get output from"),filter:T.string().optional().describe("Regex to filter output (only for get_output_id)")})});class V${name="TerminalMiddleware";contextSchema=void 0;stateSchema=void 0;tools=[J7];async execute(){return this}}export{X7 as Og,s7 as Pg,k2 as Qg,qO as Rg,sX as Sg,Ux as Tg,_x as Ug,s3 as Vg,Fv as Wg,yx as Xg,Z$ as Yg,$$ as Zg,Y$ as _g,$6 as $g,V$ as ah};
213
+ `,schema:T.object({description:T.string().describe("what you want to do"),command:T.string().optional().describe("The command to execute (required for running commands)"),timeout:T.number().optional().describe("Timeout in ms (default: 20000)"),run_in_background:T.boolean().optional().describe("Run command in background"),kill_process_id:T.string().optional().describe("ID of process to kill"),get_output_id:T.string().optional().describe("ID of process to get output from"),filter:T.string().optional().describe("Regex to filter output (only for get_output_id)")})});class R${name="TerminalMiddleware";contextSchema=void 0;stateSchema=void 0;tools=[K7];async execute(){return this}}export{V7 as Og,Q5 as Pg,s0 as Qg,UO as Rg,q7 as Sg,iv as Tg,z$ as Ug,L$ as Vg,B$ as Wg,H6 as Xg,R$ as Yg};