azamat-ui-kit-cli 0.2.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/index.cjs +452 -0
- package/package.json +2 -2
- package/vendor/src/components/actions/action-menu.tsx +21 -18
- package/vendor/src/components/calendar/calendar.tsx +153 -102
- package/vendor/src/components/calendar/date-picker.tsx +24 -14
- package/vendor/src/components/calendar/date-range-picker.tsx +137 -58
- package/vendor/src/components/charts/charts.tsx +32 -21
- package/vendor/src/components/command/command-palette.tsx +68 -57
- package/vendor/src/components/data-table/data-table-bulk-actions.tsx +23 -20
- package/vendor/src/components/data-table/data-table-column-visibility-menu.tsx +21 -10
- package/vendor/src/components/data-table/data-table-pagination.tsx +6 -6
- package/vendor/src/components/data-table/data-table-toolbar.tsx +72 -44
- package/vendor/src/components/data-table/data-table.tsx +15 -11
- package/vendor/src/components/data-table/table-export-menu.tsx +1 -1
- package/vendor/src/components/data-table/table-import-button.tsx +1 -1
- package/vendor/src/components/display/data-state.tsx +20 -8
- package/vendor/src/components/display/index.ts +19 -15
- package/vendor/src/components/display/metric-card.tsx +35 -0
- package/vendor/src/components/display/progress-circle.tsx +24 -0
- package/vendor/src/components/display/smart-card.tsx +49 -27
- package/vendor/src/components/display/status-dot.tsx +45 -0
- package/vendor/src/components/display/user-card.tsx +30 -0
- package/vendor/src/components/feedback/alert.tsx +21 -11
- package/vendor/src/components/feedback/empty-state.tsx +2 -2
- package/vendor/src/components/feedback/loading-state.tsx +2 -2
- package/vendor/src/components/feedback/page-state.tsx +19 -15
- package/vendor/src/components/feedback/status-badge.tsx +43 -43
- package/vendor/src/components/form/form-app-input.tsx +147 -0
- package/vendor/src/components/form/form-date-input.tsx +16 -19
- package/vendor/src/components/form/form-field-shell.tsx +11 -8
- package/vendor/src/components/form/form-field-utils.ts +76 -0
- package/vendor/src/components/form/form-input.tsx +423 -44
- package/vendor/src/components/form/form-number-input.tsx +16 -15
- package/vendor/src/components/form/form-phone-input.tsx +15 -9
- package/vendor/src/components/form/form-search-input.tsx +16 -19
- package/vendor/src/components/form/form-select.tsx +4 -3
- package/vendor/src/components/form/public.ts +16 -14
- package/vendor/src/components/form/smart-form-shell.tsx +13 -12
- package/vendor/src/components/inputs/app-input.tsx +27 -0
- package/vendor/src/components/inputs/async-select.tsx +113 -84
- package/vendor/src/components/inputs/clearable-input.tsx +81 -61
- package/vendor/src/components/inputs/date-input.tsx +21 -17
- package/vendor/src/components/inputs/date-range-input.tsx +10 -10
- package/vendor/src/components/inputs/index.ts +1 -0
- package/vendor/src/components/inputs/input-decorator.tsx +101 -57
- package/vendor/src/components/inputs/masked-input.tsx +20 -20
- package/vendor/src/components/inputs/money-input.tsx +2 -2
- package/vendor/src/components/inputs/number-input.tsx +29 -19
- package/vendor/src/components/inputs/password-input.tsx +82 -45
- package/vendor/src/components/inputs/phone-input.tsx +24 -2
- package/vendor/src/components/inputs/quantity-input.tsx +2 -2
- package/vendor/src/components/inputs/search-input.tsx +54 -3
- package/vendor/src/components/inputs/simple-select.tsx +110 -22
- package/vendor/src/components/layout/app-shell.tsx +2 -2
- package/vendor/src/components/layout/index.ts +5 -4
- package/vendor/src/components/layout/page-header.tsx +79 -35
- package/vendor/src/components/layout/public.ts +12 -10
- package/vendor/src/components/layout/section-header.tsx +56 -0
- package/vendor/src/components/layout/stack.tsx +106 -0
- package/vendor/src/components/layout/stat-card.tsx +66 -29
- package/vendor/src/components/navigation/index.ts +1 -0
- package/vendor/src/components/navigation/nav-tabs.tsx +60 -0
- package/vendor/src/components/navigation/page-tabs.tsx +41 -26
- package/vendor/src/components/navigation/pagination.tsx +14 -10
- package/vendor/src/components/overlay/alert-dialog.tsx +65 -0
- package/vendor/src/components/overlay/drawer.tsx +71 -0
- package/vendor/src/components/overlay/index.ts +4 -2
- package/vendor/src/components/patterns/data-view.tsx +13 -8
- package/vendor/src/components/ui/badge.tsx +96 -52
- package/vendor/src/components/ui/button.tsx +99 -61
- package/vendor/src/components/ui/card.tsx +84 -25
- package/vendor/src/components/ui/checkbox.tsx +68 -68
- package/vendor/src/components/ui/command.tsx +32 -32
- package/vendor/src/components/ui/dialog.tsx +135 -138
- package/vendor/src/components/ui/dropdown-menu.tsx +21 -21
- package/vendor/src/components/ui/hover-card.tsx +49 -0
- package/vendor/src/components/ui/input-primitive.tsx +24 -0
- package/vendor/src/components/ui/input.tsx +191 -20
- package/vendor/src/components/ui/kbd.tsx +33 -0
- package/vendor/src/components/ui/popover.tsx +11 -11
- package/vendor/src/components/ui/radio-group.tsx +102 -0
- package/vendor/src/components/ui/right-click-menu.tsx +60 -0
- package/vendor/src/components/ui/scroll-box.tsx +27 -0
- package/vendor/src/components/ui/segmented-control.tsx +21 -17
- package/vendor/src/components/ui/select.tsx +187 -189
- package/vendor/src/components/ui/skeleton.tsx +2 -2
- package/vendor/src/components/ui/switch.tsx +60 -60
- package/vendor/src/components/ui/table.tsx +114 -114
- package/vendor/src/components/ui/tabs.tsx +2 -2
- package/vendor/src/components/ui/textarea.tsx +1 -1
- package/vendor/src/components/upload/file-dropzone.tsx +38 -0
- package/vendor/src/components/upload/file-upload.tsx +4 -4
- package/vendor/src/components/upload/image-upload.tsx +22 -19
- package/vendor/src/components/upload/index.ts +2 -0
- package/vendor/src/families/catalog.ts +1 -0
- package/vendor/src/families/docs-groups.ts +10 -1
- package/vendor/src/families/member-metadata.ts +24 -0
- package/vendor/src/families/member-snippets.ts +41 -2
- package/vendor/src/families/migration-map.ts +3 -0
- package/vendor/src/index.ts +23 -18
- package/vendor/templates/styles/globals.css +253 -0
- package/dist/index.js +0 -432
package/dist/index.js
DELETED
|
@@ -1,432 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {on as on$1,EventEmitter,setMaxListeners,once,addAbortListener}from'events';import Rn,{execFile,spawn,spawnSync,ChildProcess}from'child_process';import ne from'path';import Gr,{appendFileSync,writeFileSync,statSync,readFileSync,createWriteStream,createReadStream}from'fs';import _,{hrtime,execPath,execArgv,platform}from'process';import {debuglog,promisify,callbackify,stripVTControlCharacters,aborted,inspect}from'util';import {fileURLToPath}from'url';import {StringDecoder}from'string_decoder';import RE from'tty';import {scheduler,setTimeout as setTimeout$1,setImmediate}from'timers/promises';import {constants}from'os';import {serialize}from'v8';import {finished}from'stream/promises';import {getDefaultHighWaterMark,Duplex,Writable,Readable,PassThrough,Transform}from'stream';import {Buffer as Buffer$1}from'buffer';var Rb=Object.create;var Na=Object.defineProperty;var Fb=Object.getOwnPropertyDescriptor;var Lb=Object.getOwnPropertyNames;var qb=Object.getPrototypeOf,jb=Object.prototype.hasOwnProperty;var T=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Nb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Lb(e))!jb.call(t,n)&&n!==r&&Na(t,n,{get:()=>e[n],enumerable:!(i=Fb(e,n))||i.enumerable});return t};var Ie=(t,e,r)=>(r=t!=null?Rb(qb(t)):{},Nb(Na(r,"default",{value:t,enumerable:true}),t));var V=m(Fn=>{Fn.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,i)=>{e.push((n,s)=>n!=null?i(n):r(s)),t.apply(this,e);})},"name",{value:t.name})};Fn.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(i=>r(null,i),r);},"name",{value:t.name})};});var Wa=m((DP,Va)=>{var Je=T("constants"),Hb=process.cwd,Vr=null,zb=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Vr||(Vr=Hb.call(process)),Vr};try{process.cwd();}catch{}typeof process.chdir=="function"&&(Ln=process.chdir,process.chdir=function(t){Vr=null,Ln.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ln));var Ln;Va.exports=Yb;function Yb(t){Je.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,d,h){h&&process.nextTick(h);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,d,h,p){p&&process.nextTick(p);},t.lchownSync=function(){}),zb==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function d(h,p,g){var y=Date.now(),w=0;l(h,p,function b(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(p,function(k,$){k&&k.code==="ENOENT"?l(h,p,b):g(S);});},w),w<100&&(w+=10);return}g&&g(S);});}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function d(h,p,g,y,w,b){var S;if(b&&typeof b=="function"){var k=0;S=function($,oe,le){if($&&$.code==="EAGAIN"&&k<10)return k++,l.call(t,h,p,g,y,w,S);b.apply(this,arguments);};}return l.call(t,h,p,g,y,w,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(d,h,p,g,y){for(var w=0;;)try{return l.call(t,d,h,p,g,y)}catch(b){if(b.code==="EAGAIN"&&w<10){w++;continue}throw b}}})(t.readSync);function e(l){l.lchmod=function(d,h,p){l.open(d,Je.O_WRONLY|Je.O_SYMLINK,h,function(g,y){if(g){p&&p(g);return}l.fchmod(y,h,function(w){l.close(y,function(b){p&&p(w||b);});});});},l.lchmodSync=function(d,h){var p=l.openSync(d,Je.O_WRONLY|Je.O_SYMLINK,h),g=true,y;try{y=l.fchmodSync(p,h),g=!1;}finally{if(g)try{l.closeSync(p);}catch{}else l.closeSync(p);}return y};}function r(l){Je.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(d,h,p,g){l.open(d,Je.O_SYMLINK,function(y,w){if(y){g&&g(y);return}l.futimes(w,h,p,function(b){l.close(w,function(S){g&&g(b||S);});});});},l.lutimesSync=function(d,h,p){var g=l.openSync(d,Je.O_SYMLINK),y,w=true;try{y=l.futimesSync(g,h,p),w=!1;}finally{if(w)try{l.closeSync(g);}catch{}else l.closeSync(g);}return y}):l.futimes&&(l.lutimes=function(d,h,p,g){g&&process.nextTick(g);},l.lutimesSync=function(){});}function i(l){return l&&function(d,h,p){return l.call(t,d,h,function(g){u(g)&&(g=null),p&&p.apply(this,arguments);})}}function n(l){return l&&function(d,h){try{return l.call(t,d,h)}catch(p){if(!u(p))throw p}}}function s(l){return l&&function(d,h,p,g){return l.call(t,d,h,p,function(y){u(y)&&(y=null),g&&g.apply(this,arguments);})}}function o(l){return l&&function(d,h,p){try{return l.call(t,d,h,p)}catch(g){if(!u(g))throw g}}}function a(l){return l&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function g(y,w){w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),p&&p.apply(this,arguments);}return h?l.call(t,d,h,g):l.call(t,d,g)}}function c(l){return l&&function(d,h){var p=h?l.call(t,d,h):l.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function u(l){if(!l||l.code==="ENOSYS")return true;var d=!process.getuid||process.getuid()!==0;return !!(d&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Ya=m((_P,za)=>{var Ha=T("stream").Stream;za.exports=Jb;function Jb(t){return {ReadStream:e,WriteStream:r};function e(i,n){if(!(this instanceof e))return new e(i,n);Ha.call(this);var s=this;this.path=i,this.fd=null,this.readable=true,this.paused=false,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),a=0,c=o.length;a<c;a++){var u=o[a];this[u]=n[u];}if(this.encoding&&this.setEncoding(this.encoding),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 new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){s._read();});return}t.open(this.path,this.flags,this.mode,function(l,d){if(l){s.emit("error",l),s.readable=false;return}s.fd=d,s.emit("open",d),s._read();});}function r(i,n){if(!(this instanceof r))return new r(i,n);Ha.call(this),this.path=i,this.fd=null,this.writable=true,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o<a;o++){var c=s[o];this[c]=n[c];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=false,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var Ka=m((TP,Ja)=>{Ja.exports=Zb;var Kb=Object.getPrototypeOf||function(t){return t.__proto__};function Zb(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Kb(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var At=m((AP,Nn)=>{var F=T("fs"),Xb=Wa(),Qb=Ya(),ew=Ka(),Wr=T("util"),J,zr;typeof Symbol=="function"&&typeof Symbol.for=="function"?(J=Symbol.for("graceful-fs.queue"),zr=Symbol.for("graceful-fs.previous")):(J="___graceful-fs.queue",zr="___graceful-fs.previous");function tw(){}function Qa(t,e){Object.defineProperty(t,J,{get:function(){return e}});}var dt=tw;Wr.debuglog?dt=Wr.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(dt=function(){var t=Wr.format.apply(Wr,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
3
|
-
GFS4: `),console.error(t);});F[J]||(Za=global[J]||[],Qa(F,Za),F.close=(function(t){function e(r,i){return t.call(F,r,function(n){n||Xa(),typeof i=="function"&&i.apply(this,arguments);})}return Object.defineProperty(e,zr,{value:t}),e})(F.close),F.closeSync=(function(t){function e(r){t.apply(F,arguments),Xa();}return Object.defineProperty(e,zr,{value:t}),e})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){dt(F[J]),T("assert").equal(F[J].length,0);}));var Za;global[J]||Qa(global,F[J]);Nn.exports=qn(ew(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(Nn.exports=qn(F),F.__patched=true);function qn(t){Xb(t),t.gracefulify=qn,t.createReadStream=oe,t.createWriteStream=le;var e=t.readFile;t.readFile=r;function r(x,D,O){return typeof D=="function"&&(O=D,D=null),H(x,D,O);function H(z,G,R,j){return e(z,G,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?Tt([H,[z,G,R],P,j||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments);})}}var i=t.writeFile;t.writeFile=n;function n(x,D,O,H){return typeof O=="function"&&(H=O,O=null),z(x,D,O,H);function z(G,R,j,P,Y){return i(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Tt([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var s=t.appendFile;s&&(t.appendFile=o);function o(x,D,O,H){return typeof O=="function"&&(H=O,O=null),z(x,D,O,H);function z(G,R,j,P,Y){return s(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Tt([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=c);function c(x,D,O,H){return typeof O=="function"&&(H=O,O=0),z(x,D,O,H);function z(G,R,j,P,Y){return a(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Tt([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var u=t.readdir;t.readdir=d;var l=/^v[0-5]\./;function d(x,D,O){typeof D=="function"&&(O=D,D=null);var H=l.test(process.version)?function(R,j,P,Y){return u(R,z(R,j,P,Y))}:function(R,j,P,Y){return u(R,j,z(R,j,P,Y))};return H(x,D,O);function z(G,R,j,P){return function(Y,M){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Tt([H,[G,R,j],Y,P||Date.now(),Date.now()]):(M&&M.sort&&M.sort(),typeof j=="function"&&j.call(this,Y,M));}}}if(process.version.substr(0,4)==="v0.8"){var h=Qb(t);b=h.ReadStream,k=h.WriteStream;}var p=t.ReadStream;p&&(b.prototype=Object.create(p.prototype),b.prototype.open=S);var g=t.WriteStream;g&&(k.prototype=Object.create(g.prototype),k.prototype.open=$),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(x){b=x;},enumerable:true,configurable:true}),Object.defineProperty(t,"WriteStream",{get:function(){return k},set:function(x){k=x;},enumerable:true,configurable:true});var y=b;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(x){y=x;},enumerable:true,configurable:true});var w=k;Object.defineProperty(t,"FileWriteStream",{get:function(){return w},set:function(x){w=x;},enumerable:true,configurable:true});function b(x,D){return this instanceof b?(p.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function S(){var x=this;be(x.path,x.flags,x.mode,function(D,O){D?(x.autoClose&&x.destroy(),x.emit("error",D)):(x.fd=O,x.emit("open",O),x.read());});}function k(x,D){return this instanceof k?(g.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function $(){var x=this;be(x.path,x.flags,x.mode,function(D,O){D?(x.destroy(),x.emit("error",D)):(x.fd=O,x.emit("open",O));});}function oe(x,D){return new t.ReadStream(x,D)}function le(x,D){return new t.WriteStream(x,D)}var Pe=t.open;t.open=be;function be(x,D,O,H){return typeof O=="function"&&(H=O,O=null),z(x,D,O,H);function z(G,R,j,P,Y){return Pe(G,R,j,function(M,KA){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Tt([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}return t}function Tt(t){dt("ENQUEUE",t[0].name,t[1]),F[J].push(t),jn();}var Hr;function Xa(){for(var t=Date.now(),e=0;e<F[J].length;++e)F[J][e].length>2&&(F[J][e][3]=t,F[J][e][4]=t);jn();}function jn(){if(clearTimeout(Hr),Hr=void 0,F[J].length!==0){var t=F[J].shift(),e=t[0],r=t[1],i=t[2],n=t[3],s=t[4];if(n===void 0)dt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-n>=6e4){dt("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,i);}else {var a=Date.now()-s,c=Math.max(s-n,1),u=Math.min(c*1.2,100);a>=u?(dt("RETRY",e.name,r),e.apply(null,r.concat([n]))):F[J].push(t);}Hr===void 0&&(Hr=setTimeout(jn,0));}}});var X=m(Me=>{var ec=V().fromCallback,Z=At(),rw=["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(t=>typeof Z[t]=="function");Object.assign(Me,Z);rw.forEach(t=>{Me[t]=ec(Z[t]);});Me.exists=function(t,e){return typeof e=="function"?Z.exists(t,e):new Promise(r=>Z.exists(t,r))};Me.read=function(t,e,r,i,n,s){return typeof s=="function"?Z.read(t,e,r,i,n,s):new Promise((o,a)=>{Z.read(t,e,r,i,n,(c,u,l)=>{if(c)return a(c);o({bytesRead:u,buffer:l});});})};Me.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.write(t,e,...r):new Promise((i,n)=>{Z.write(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffer:a});});})};Me.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.readv(t,e,...r):new Promise((i,n)=>{Z.readv(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesRead:o,buffers:a});});})};Me.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.writev(t,e,...r):new Promise((i,n)=>{Z.writev(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffers:a});});})};typeof Z.realpath.native=="function"?Me.realpath.native=ec(Z.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var rc=m((IP,tc)=>{var iw=T("path");tc.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(iw.parse(e).root,""))){let i=new Error(`Path contains invalid characters: ${e}`);throw i.code="EINVAL",i}};});var oc=m(($P,Bn)=>{var ic=X(),{checkPath:nc}=rc(),sc=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Bn.exports.makeDir=async(t,e)=>(nc(t),ic.mkdir(t,{mode:sc(e),recursive:true}));Bn.exports.makeDirSync=(t,e)=>(nc(t),ic.mkdirSync(t,{mode:sc(e),recursive:true}));});var ue=m((MP,ac)=>{var nw=V().fromPromise,{makeDir:sw,makeDirSync:Un}=oc(),Gn=nw(sw);ac.exports={mkdirs:Gn,mkdirsSync:Un,mkdirp:Gn,mkdirpSync:Un,ensureDir:Gn,ensureDirSync:Un};});var Ke=m((RP,lc)=>{var ow=V().fromPromise,cc=X();function aw(t){return cc.access(t).then(()=>true).catch(()=>false)}lc.exports={pathExists:ow(aw),pathExistsSync:cc.existsSync};});var Vn=m((FP,uc)=>{var Pt=X(),cw=V().fromPromise;async function lw(t,e,r){let i=await Pt.open(t,"r+"),n=null;try{await Pt.futimes(i,e,r);}catch(s){n=s;}finally{try{await Pt.close(i);}catch(s){n||(n=s);}}if(n)throw n}function uw(t,e,r){let i=Pt.openSync(t,"r+"),n=null;try{Pt.futimesSync(i,e,r);}catch(s){n=s;}finally{try{Pt.closeSync(i);}catch(s){n||(n=s);}}if(n)throw n}uc.exports={utimesMillis:cw(lw),utimesMillisSync:uw};});var ht=m((LP,fc)=>{var It=X(),W=T("path"),dc=V().fromPromise;function dw(t,e,r){let i=r.dereference?n=>It.stat(n,{bigint:true}):n=>It.lstat(n,{bigint:true});return Promise.all([i(t),i(e).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,s])=>({srcStat:n,destStat:s}))}function hw(t,e,r){let i,n=r.dereference?o=>It.statSync(o,{bigint:true}):o=>It.lstatSync(o,{bigint:true}),s=n(t);try{i=n(e);}catch(o){if(o.code==="ENOENT")return {srcStat:s,destStat:null};throw o}return {srcStat:s,destStat:i}}async function pw(t,e,r,i){let{srcStat:n,destStat:s}=await dw(t,e,i);if(s){if(rr(n,s)){let o=W.basename(t),a=W.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:s,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Wn(t,e))throw new Error(Yr(t,e,r));return {srcStat:n,destStat:s}}function fw(t,e,r,i){let{srcStat:n,destStat:s}=hw(t,e,i);if(s){if(rr(n,s)){let o=W.basename(t),a=W.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:s,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Wn(t,e))throw new Error(Yr(t,e,r));return {srcStat:n,destStat:s}}async function hc(t,e,r,i){let n=W.resolve(W.dirname(t)),s=W.resolve(W.dirname(r));if(s===n||s===W.parse(s).root)return;let o;try{o=await It.stat(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(rr(e,o))throw new Error(Yr(t,r,i));return hc(t,e,s,i)}function pc(t,e,r,i){let n=W.resolve(W.dirname(t)),s=W.resolve(W.dirname(r));if(s===n||s===W.parse(s).root)return;let o;try{o=It.statSync(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(rr(e,o))throw new Error(Yr(t,r,i));return pc(t,e,s,i)}function rr(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function Wn(t,e){let r=W.resolve(t).split(W.sep).filter(n=>n),i=W.resolve(e).split(W.sep).filter(n=>n);return r.every((n,s)=>i[s]===n)}function Yr(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}fc.exports={checkPaths:dc(pw),checkPathsSync:fw,checkParentPaths:dc(hc),checkParentPathsSync:pc,isSrcSubdir:Wn,areIdentical:rr};});var gc=m((qP,mc)=>{async function mw(t,e){let r=[];for await(let i of t)r.push(e(i).then(()=>null,n=>n??new Error("unknown error")));await Promise.all(r.map(i=>i.then(n=>{if(n!==null)throw n})));}mc.exports={asyncIteratorConcurrentProcess:mw};});var Sc=m((jP,xc)=>{var K=X(),ir=T("path"),{mkdirs:gw}=ue(),{pathExists:yw}=Ke(),{utimesMillis:bw}=Vn(),nr=ht(),{asyncIteratorConcurrentProcess:ww}=gc();async function xw(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
4
|
-
|
|
5
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await nr.checkPaths(t,e,"copy",r);if(await nr.checkParentPaths(t,i,e,"copy"),!await bc(t,e,r))return;let o=ir.dirname(e);await yw(o)||await gw(o),await wc(n,t,e,r);}async function bc(t,e,r){return r.filter?r.filter(t,e):true}async function wc(t,e,r,i){let s=await(i.dereference?K.stat:K.lstat)(e);if(s.isDirectory())return Ow(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Sw(s,t,e,r,i);if(s.isSymbolicLink())return Cw(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function Sw(t,e,r,i,n){if(!e)return yc(t,r,i,n);if(n.overwrite)return await K.unlink(i),yc(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function yc(t,e,r,i){if(await K.copyFile(e,r),i.preserveTimestamps){vw(t.mode)&&await Ew(r,t.mode);let n=await K.stat(e);await bw(r,n.atime,n.mtime);}return K.chmod(r,t.mode)}function vw(t){return (t&128)===0}function Ew(t,e){return K.chmod(t,e|128)}async function Ow(t,e,r,i,n){e||await K.mkdir(i),await ww(await K.opendir(r),async s=>{let o=ir.join(r,s.name),a=ir.join(i,s.name);if(await bc(o,a,n)){let{destStat:u}=await nr.checkPaths(o,a,"copy",n);await wc(u,o,a,n);}}),e||await K.chmod(i,t.mode);}async function Cw(t,e,r,i){let n=await K.readlink(e);if(i.dereference&&(n=ir.resolve(process.cwd(),n)),!t)return K.symlink(n,r);let s=null;try{s=await K.readlink(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return K.symlink(n,r);throw o}if(i.dereference&&(s=ir.resolve(process.cwd(),s)),n!==s){if(nr.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(nr.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`)}return await K.unlink(r),K.symlink(n,r)}xc.exports=xw;});var kc=m((NP,Cc)=>{var Q=At(),sr=T("path"),kw=ue().mkdirsSync,Dw=Vn().utimesMillisSync,or=ht();function _w(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
6
|
-
|
|
7
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=or.checkPathsSync(t,e,"copy",r);if(or.checkParentPathsSync(t,i,e,"copy"),r.filter&&!r.filter(t,e))return;let s=sr.dirname(e);return Q.existsSync(s)||kw(s),vc(n,t,e,r)}function vc(t,e,r,i){let s=(i.dereference?Q.statSync:Q.lstatSync)(e);if(s.isDirectory())return Rw(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Tw(s,t,e,r,i);if(s.isSymbolicLink())return qw(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function Tw(t,e,r,i,n){return e?Aw(t,r,i,n):Ec(t,r,i,n)}function Aw(t,e,r,i){if(i.overwrite)return Q.unlinkSync(r),Ec(t,e,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function Ec(t,e,r,i){return Q.copyFileSync(e,r),i.preserveTimestamps&&Pw(t.mode,e,r),Hn(r,t.mode)}function Pw(t,e,r){return Iw(t)&&$w(r,t),Mw(e,r)}function Iw(t){return (t&128)===0}function $w(t,e){return Hn(t,e|128)}function Hn(t,e){return Q.chmodSync(t,e)}function Mw(t,e){let r=Q.statSync(t);return Dw(e,r.atime,r.mtime)}function Rw(t,e,r,i,n){return e?Oc(r,i,n):Fw(t.mode,r,i,n)}function Fw(t,e,r,i){return Q.mkdirSync(r),Oc(e,r,i),Hn(r,t)}function Oc(t,e,r){let i=Q.opendirSync(t);try{let n;for(;(n=i.readSync())!==null;)Lw(n.name,t,e,r);}finally{i.closeSync();}}function Lw(t,e,r,i){let n=sr.join(e,t),s=sr.join(r,t);if(i.filter&&!i.filter(n,s))return;let{destStat:o}=or.checkPathsSync(n,s,"copy",i);return vc(o,n,s,i)}function qw(t,e,r,i){let n=Q.readlinkSync(e);if(i.dereference&&(n=sr.resolve(process.cwd(),n)),t){let s;try{s=Q.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Q.symlinkSync(n,r);throw o}if(i.dereference&&(s=sr.resolve(process.cwd(),s)),n!==s){if(or.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(or.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`)}return jw(n,r)}else return Q.symlinkSync(n,r)}function jw(t,e){return Q.unlinkSync(e),Q.symlinkSync(t,e)}Cc.exports=_w;});var Jr=m((BP,Dc)=>{var Nw=V().fromPromise;Dc.exports={copy:Nw(Sc()),copySync:kc()};});var ar=m((UP,Tc)=>{var _c=At(),Bw=V().fromCallback;function Uw(t,e){_c.rm(t,{recursive:true,force:true},e);}function Gw(t){_c.rmSync(t,{recursive:true,force:true});}Tc.exports={remove:Bw(Uw),removeSync:Gw};});var Lc=m((GP,Fc)=>{var Vw=V().fromPromise,Ic=X(),$c=T("path"),Mc=ue(),Rc=ar(),Ac=Vw(async function(e){let r;try{r=await Ic.readdir(e);}catch{return Mc.mkdirs(e)}return Promise.all(r.map(i=>Rc.remove($c.join(e,i))))});function Pc(t){let e;try{e=Ic.readdirSync(t);}catch{return Mc.mkdirsSync(t)}e.forEach(r=>{r=$c.join(t,r),Rc.removeSync(r);});}Fc.exports={emptyDirSync:Pc,emptydirSync:Pc,emptyDir:Ac,emptydir:Ac};});var Bc=m((VP,Nc)=>{var Ww=V().fromPromise,qc=T("path"),Re=X(),jc=ue();async function Hw(t){let e;try{e=await Re.stat(t);}catch{}if(e&&e.isFile())return;let r=qc.dirname(t),i=null;try{i=await Re.stat(r);}catch(n){if(n.code==="ENOENT"){await jc.mkdirs(r),await Re.writeFile(t,"");return}else throw n}i.isDirectory()?await Re.writeFile(t,""):await Re.readdir(r);}function zw(t){let e;try{e=Re.statSync(t);}catch{}if(e&&e.isFile())return;let r=qc.dirname(t);try{Re.statSync(r).isDirectory()||Re.readdirSync(r);}catch(i){if(i&&i.code==="ENOENT")jc.mkdirsSync(r);else throw i}Re.writeFileSync(t,"");}Nc.exports={createFile:Ww(Hw),createFileSync:zw};});var Hc=m((WP,Wc)=>{var Yw=V().fromPromise,Uc=T("path"),Ze=X(),Gc=ue(),{pathExists:Jw}=Ke(),{areIdentical:Vc}=ht();async function Kw(t,e){let r;try{r=await Ze.lstat(e,{bigint:!0});}catch{}let i;try{i=await Ze.lstat(t,{bigint:!0});}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(r&&Vc(i,r))return;let n=Uc.dirname(e);await Jw(n)||await Gc.mkdirs(n),await Ze.link(t,e);}function Zw(t,e){let r;try{r=Ze.lstatSync(e,{bigint:!0});}catch{}try{let s=Ze.lstatSync(t,{bigint:!0});if(r&&Vc(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let i=Uc.dirname(e);return Ze.existsSync(i)||Gc.mkdirsSync(i),Ze.linkSync(t,e)}Wc.exports={createLink:Yw(Kw),createLinkSync:Zw};});var Yc=m((HP,zc)=>{var Xe=T("path"),cr=X(),{pathExists:Xw}=Ke(),Qw=V().fromPromise;async function ex(t,e){if(Xe.isAbsolute(t)){try{await cr.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:t}}let r=Xe.dirname(e),i=Xe.join(r,t);if(await Xw(i))return {toCwd:i,toDst:t};try{await cr.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:Xe.relative(r,t)}}function tx(t,e){if(Xe.isAbsolute(t)){if(!cr.existsSync(t))throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}let r=Xe.dirname(e),i=Xe.join(r,t);if(cr.existsSync(i))return {toCwd:i,toDst:t};if(!cr.existsSync(t))throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:Xe.relative(r,t)}}zc.exports={symlinkPaths:Qw(ex),symlinkPathsSync:tx};});var Zc=m((zP,Kc)=>{var Jc=X(),rx=V().fromPromise;async function ix(t,e){if(e)return e;let r;try{r=await Jc.lstat(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function nx(t,e){if(e)return e;let r;try{r=Jc.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Kc.exports={symlinkType:rx(ix),symlinkTypeSync:nx};});var el=m((YP,Qc)=>{var sx=V().fromPromise,Qe=T("path"),te=X(),{mkdirs:ox,mkdirsSync:ax}=ue(),{symlinkPaths:cx,symlinkPathsSync:lx}=Yc(),{symlinkType:ux,symlinkTypeSync:dx}=Zc(),{pathExists:hx}=Ke(),{areIdentical:Xc}=ht();async function px(t,e,r){let i;try{i=await te.lstat(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(Qe.isAbsolute(t))a=await te.stat(t,{bigint:true});else {let u=Qe.dirname(e),l=Qe.join(u,t);try{a=await te.stat(l,{bigint:!0});}catch{a=await te.stat(t,{bigint:true});}}let c=await te.stat(e,{bigint:true});if(Xc(a,c))return}let n=await cx(t,e);t=n.toDst;let s=await ux(n.toCwd,r),o=Qe.dirname(e);return await hx(o)||await ox(o),te.symlink(t,e,s)}function fx(t,e,r){let i;try{i=te.lstatSync(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(Qe.isAbsolute(t))a=te.statSync(t,{bigint:true});else {let u=Qe.dirname(e),l=Qe.join(u,t);try{a=te.statSync(l,{bigint:!0});}catch{a=te.statSync(t,{bigint:true});}}let c=te.statSync(e,{bigint:true});if(Xc(a,c))return}let n=lx(t,e);t=n.toDst,r=dx(n.toCwd,r);let s=Qe.dirname(e);return te.existsSync(s)||ax(s),te.symlinkSync(t,e,r)}Qc.exports={createSymlink:sx(px),createSymlinkSync:fx};});var cl=m((JP,al)=>{var{createFile:tl,createFileSync:rl}=Bc(),{createLink:il,createLinkSync:nl}=Hc(),{createSymlink:sl,createSymlinkSync:ol}=el();al.exports={createFile:tl,createFileSync:rl,ensureFile:tl,ensureFileSync:rl,createLink:il,createLinkSync:nl,ensureLink:il,ensureLinkSync:nl,createSymlink:sl,createSymlinkSync:ol,ensureSymlink:sl,ensureSymlinkSync:ol};});var Kr=m((KP,ll)=>{function mx(t,{EOL:e=`
|
|
8
|
-
`,finalEOL:r=true,replacer:i=null,spaces:n}={}){let s=r?e:"",o=JSON.stringify(t,i,n);if(o===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return o.replace(/\n/g,e)+s}function gx(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}ll.exports={stringify:mx,stripBom:gx};});var pl=m((ZP,hl)=>{var $t;try{$t=At();}catch{$t=T("fs");}var Zr=V(),{stringify:ul,stripBom:dl}=Kr();async function yx(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||$t,i="throws"in e?e.throws:true,n=await Zr.fromCallback(r.readFile)(t,e);n=dl(n);let s;try{s=JSON.parse(n,e?e.reviver:null);}catch(o){if(i)throw o.message=`${t}: ${o.message}`,o;return null}return s}var bx=Zr.fromPromise(yx);function wx(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||$t,i="throws"in e?e.throws:true;try{let n=r.readFileSync(t,e);return n=dl(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${t}: ${n.message}`,n;return null}}async function xx(t,e,r={}){let i=r.fs||$t,n=ul(e,r);await Zr.fromCallback(i.writeFile)(t,n,r);}var Sx=Zr.fromPromise(xx);function vx(t,e,r={}){let i=r.fs||$t,n=ul(e,r);return i.writeFileSync(t,n,r)}hl.exports={readFile:bx,readFileSync:wx,writeFile:Sx,writeFileSync:vx};});var ml=m((XP,fl)=>{var Xr=pl();fl.exports={readJson:Xr.readFile,readJsonSync:Xr.readFileSync,writeJson:Xr.writeFile,writeJsonSync:Xr.writeFileSync};});var Qr=m((QP,bl)=>{var Ex=V().fromPromise,zn=X(),gl=T("path"),yl=ue(),Ox=Ke().pathExists;async function Cx(t,e,r="utf-8"){let i=gl.dirname(t);return await Ox(i)||await yl.mkdirs(i),zn.writeFile(t,e,r)}function kx(t,...e){let r=gl.dirname(t);zn.existsSync(r)||yl.mkdirsSync(r),zn.writeFileSync(t,...e);}bl.exports={outputFile:Ex(Cx),outputFileSync:kx};});var xl=m((eI,wl)=>{var{stringify:Dx}=Kr(),{outputFile:_x}=Qr();async function Tx(t,e,r={}){let i=Dx(e,r);await _x(t,i,r);}wl.exports=Tx;});var vl=m((tI,Sl)=>{var{stringify:Ax}=Kr(),{outputFileSync:Px}=Qr();function Ix(t,e,r){let i=Ax(e,r);Px(t,i,r);}Sl.exports=Ix;});var Ol=m((rI,El)=>{var $x=V().fromPromise,ee=ml();ee.outputJson=$x(xl());ee.outputJsonSync=vl();ee.outputJSON=ee.outputJson;ee.outputJSONSync=ee.outputJsonSync;ee.writeJSON=ee.writeJson;ee.writeJSONSync=ee.writeJsonSync;ee.readJSON=ee.readJson;ee.readJSONSync=ee.readJsonSync;El.exports=ee;});var Tl=m((iI,_l)=>{var Mx=X(),Cl=T("path"),{copy:Rx}=Jr(),{remove:Dl}=ar(),{mkdirp:Fx}=ue(),{pathExists:Lx}=Ke(),kl=ht();async function qx(t,e,r={}){let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:s=false}=await kl.checkPaths(t,e,"move",r);await kl.checkParentPaths(t,n,e,"move");let o=Cl.dirname(e);return Cl.parse(o).root!==o&&await Fx(o),jx(t,e,i,s)}async function jx(t,e,r,i){if(!i){if(r)await Dl(e);else if(await Lx(e))throw new Error("dest already exists.")}try{await Mx.rename(t,e);}catch(n){if(n.code!=="EXDEV")throw n;await Nx(t,e,r);}}async function Nx(t,e,r){return await Rx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Dl(t)}_l.exports=qx;});var Ml=m((nI,$l)=>{var Pl=At(),Jn=T("path"),Bx=Jr().copySync,Il=ar().removeSync,Ux=ue().mkdirpSync,Al=ht();function Gx(t,e,r){r=r||{};let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:s=false}=Al.checkPathsSync(t,e,"move",r);return Al.checkParentPathsSync(t,n,e,"move"),Vx(e)||Ux(Jn.dirname(e)),Wx(t,e,i,s)}function Vx(t){let e=Jn.dirname(t);return Jn.parse(e).root===e}function Wx(t,e,r,i){if(i)return Yn(t,e,r);if(r)return Il(e),Yn(t,e,r);if(Pl.existsSync(e))throw new Error("dest already exists.");return Yn(t,e,r)}function Yn(t,e,r){try{Pl.renameSync(t,e);}catch(i){if(i.code!=="EXDEV")throw i;return Hx(t,e,r)}}function Hx(t,e,r){return Bx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Il(t)}$l.exports=Gx;});var Fl=m((sI,Rl)=>{var zx=V().fromPromise;Rl.exports={move:zx(Tl()),moveSync:Ml()};});var et=m((oI,Ll)=>{Ll.exports={...X(),...Jr(),...Lc(),...cl(),...Ol(),...ue(),...Fl(),...Qr(),...Ke(),...ar()};});var L=m((aI,jl)=>{var{FORCE_COLOR:Yx,NODE_DISABLE_COLORS:Jx,TERM:Kx}=process.env,A={enabled:!Jx&&Kx!=="dumb"&&Yx!=="0",reset:I(0,0),bold:I(1,22),dim:I(2,22),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),grey:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49)};function ql(t,e){let r=0,i,n="",s="";for(;r<t.length;r++)i=t[r],n+=i.open,s+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return n+e+s}function Zx(t,e){let r={has:t,keys:e};return r.reset=A.reset.bind(r),r.bold=A.bold.bind(r),r.dim=A.dim.bind(r),r.italic=A.italic.bind(r),r.underline=A.underline.bind(r),r.inverse=A.inverse.bind(r),r.hidden=A.hidden.bind(r),r.strikethrough=A.strikethrough.bind(r),r.black=A.black.bind(r),r.red=A.red.bind(r),r.green=A.green.bind(r),r.yellow=A.yellow.bind(r),r.blue=A.blue.bind(r),r.magenta=A.magenta.bind(r),r.cyan=A.cyan.bind(r),r.white=A.white.bind(r),r.gray=A.gray.bind(r),r.grey=A.grey.bind(r),r.bgBlack=A.bgBlack.bind(r),r.bgRed=A.bgRed.bind(r),r.bgGreen=A.bgGreen.bind(r),r.bgYellow=A.bgYellow.bind(r),r.bgBlue=A.bgBlue.bind(r),r.bgMagenta=A.bgMagenta.bind(r),r.bgCyan=A.bgCyan.bind(r),r.bgWhite=A.bgWhite.bind(r),r}function I(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:A.enabled?ql(this.keys,i+""):i+""):i===void 0?Zx([t],[r]):A.enabled?ql([r],i+""):i+""}}jl.exports=A;});var Bl=m((cI,Nl)=>{Nl.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var ei=m((lI,Ul)=>{Ul.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var q=m((uI,Gl)=>{var Kn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Xx={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Qx={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Kn.up():"");return t&&(e+=Kn.left),e}};Gl.exports={cursor:Kn,scroll:Xx,erase:Qx,beep:"\x07"};});var Yl=m((dI,zl)=>{function eS(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=tS(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var u=r.next();return s=u.done,u},e:function(u){o=true,a=u;},f:function(){try{!s&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function tS(t,e){if(t){if(typeof t=="string")return Vl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vl(t,e)}}function Vl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var rS=ei(),Hl=q(),Wl=Hl.erase,iS=Hl.cursor,nS=t=>[...rS(t)].length;zl.exports=function(t,e){if(!e)return Wl.line+iS.to(0);let r=0,i=t.split(/\r?\n/);var n=eS(i),s;try{for(n.s();!(s=n.n()).done;){let o=s.value;r+=1+Math.floor(Math.max(nS(o)-1,0)/e);}}catch(o){n.e(o);}finally{n.f();}return Wl.lines(r)};});var Zn=m((hI,Jl)=>{var lr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},sS={arrowUp:lr.arrowUp,arrowDown:lr.arrowDown,arrowLeft:lr.arrowLeft,arrowRight:lr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},oS=process.platform==="win32"?sS:lr;Jl.exports=oS;});var Zl=m((pI,Kl)=>{var Mt=L(),pt=Zn(),Xn=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),aS=t=>Xn[t]||Xn.default,ur=Object.freeze({aborted:Mt.red(pt.cross),done:Mt.green(pt.tick),exited:Mt.yellow(pt.cross),default:Mt.cyan("?")}),cS=(t,e,r)=>e?ur.aborted:r?ur.exited:t?ur.done:ur.default,lS=t=>Mt.gray(t?pt.ellipsis:pt.pointerSmall),uS=(t,e)=>Mt.gray(t?e?pt.pointerSmall:"+":pt.line);Kl.exports={styles:Xn,render:aS,symbols:ur,symbol:cS,delimiter:lS,item:uS};});var Ql=m((fI,Xl)=>{var dS=ei();Xl.exports=function(t,e){let r=String(dS(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var tu=m((mI,eu)=>{eu.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=i||s[s.length-1].length+o.length+1<i?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
|
|
10
|
-
`)).join(`
|
|
11
|
-
`)};});var iu=m((gI,ru)=>{ru.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var de=m((yI,nu)=>{nu.exports={action:Bl(),clear:Yl(),style:Zl(),strip:ei(),figures:Zn(),lines:Ql(),wrap:tu(),entriesToDisplay:iu()};});var Fe=m((bI,au)=>{var su=T("readline"),hS=de(),pS=hS.action,fS=T("events"),ou=q(),mS=ou.beep,gS=ou.cursor,yS=L(),Qn=class extends fS{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=su.createInterface({input:this.in,escapeCodeTimeout:50});su.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(s,o)=>{let a=pS(o,i);a===false?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(gS.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(mS);}render(){this.onRender(yS),this.firstRender&&(this.firstRender=false);}};au.exports=Qn;});var hu=m((wI,du)=>{function cu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function lu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){cu(s,i,n,o,a,"next",c);}function a(c){cu(s,i,n,o,a,"throw",c);}o(void 0);})}}var ti=L(),bS=Fe(),uu=q(),wS=uu.erase,dr=uu.cursor,ri=de(),es=ri.style,ts=ri.clear,xS=ri.lines,SS=ri.figures,rs=class extends bS{constructor(e={}){super(e),this.transform=es.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=ts("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ti.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
|
|
12
|
-
`),this.close();}validate(){var e=this;return lu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return lu(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=true,e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
|
|
13
|
-
`),e.close();})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(dr.down(xS(this.outputError,this.out.columns)-1)+ts(this.outputError,this.out.columns)),this.out.write(ts(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[es.symbol(this.done,this.aborted),ti.bold(this.msg),es.delimiter(this.done),this.red?ti.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
14
|
-
`).reduce((e,r,i)=>e+`
|
|
15
|
-
${i?" ":SS.pointerSmall} ${ti.red().italic(r)}`,"")),this.out.write(wS.line+dr.to(0)+this.outputText+dr.save+this.outputError+dr.restore+dr.move(this.cursorOffset,0)));}};du.exports=rs;});var gu=m((xI,mu)=>{var Le=L(),vS=Fe(),hr=de(),pu=hr.style,fu=hr.clear,ii=hr.figures,ES=hr.wrap,OS=hr.entriesToDisplay,CS=q(),kS=CS.cursor,is=class extends vS{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=fu("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
16
|
-
`),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
17
|
-
`),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(kS.hide):this.out.write(fu(this.outputText,this.out.columns)),super.render();let e=OS(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[pu.symbol(this.done,this.aborted),Le.bold(this.msg),pu.delimiter(false),this.done?this.selection.title:this.selection.disabled?Le.yellow(this.warn):Le.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
18
|
-
`;for(let n=r;n<i;n++){let s,o,a="",c=this.choices[n];n===r&&r>0?o=ii.arrowUp:n===i-1&&i<this.choices.length?o=ii.arrowDown:o=" ",c.disabled?(s=this.cursor===n?Le.gray().underline(c.title):Le.strikethrough().gray(c.title),o=(this.cursor===n?Le.bold().gray(ii.pointer)+" ":" ")+o):(s=this.cursor===n?Le.cyan().underline(c.title):c.title,o=(this.cursor===n?Le.cyan(ii.pointer)+" ":" ")+o,c.description&&this.cursor===n&&(a=` - ${c.description}`,(o.length+s.length+a.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(a=`
|
|
19
|
-
`+ES(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${s}${Le.gray(a)}
|
|
20
|
-
`;}}this.out.write(this.outputText);}};mu.exports=is;});var vu=m((SI,Su)=>{var ni=L(),DS=Fe(),wu=de(),yu=wu.style,_S=wu.clear,xu=q(),bu=xu.cursor,TS=xu.erase,ns=class extends DS{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
21
|
-
`),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
22
|
-
`),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(bu.hide):this.out.write(_S(this.outputText,this.out.columns)),super.render(),this.outputText=[yu.symbol(this.done,this.aborted),ni.bold(this.msg),yu.delimiter(this.done),this.value?this.inactive:ni.cyan().underline(this.inactive),ni.gray("/"),this.value?ni.cyan().underline(this.active):this.active].join(" "),this.out.write(TS.line+bu.to(0)+this.outputText));}};Su.exports=ns;});var we=m((vI,Eu)=>{var ss=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};Eu.exports=ss;});var Cu=m((EI,Ou)=>{var AS=we(),os=class extends AS{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Ou.exports=os;});var Du=m((OI,ku)=>{var PS=we(),IS=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),as=class extends PS{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+IS(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};ku.exports=as;});var Tu=m((CI,_u)=>{var $S=we(),cs=class extends $S{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};_u.exports=cs;});var Pu=m((kI,Au)=>{var MS=we(),ls=class extends MS{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Au.exports=ls;});var $u=m((DI,Iu)=>{var RS=we(),us=class extends RS{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Iu.exports=us;});var Ru=m((_I,Mu)=>{var FS=we(),ds=class extends FS{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Mu.exports=ds;});var Lu=m((TI,Fu)=>{var LS=we(),hs=class extends LS{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Fu.exports=hs;});var ju=m((AI,qu)=>{var qS=we(),ps=class extends qS{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};qu.exports=ps;});var Bu=m((PI,Nu)=>{Nu.exports={DatePart:we(),Meridiem:Cu(),Day:Du(),Hours:Tu(),Milliseconds:Pu(),Minutes:$u(),Month:Ru(),Seconds:Lu(),Year:ju()};});var Zu=m((II,Ku)=>{function Uu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Gu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){Uu(s,i,n,o,a,"next",c);}function a(c){Uu(s,i,n,o,a,"throw",c);}o(void 0);})}}var fs=L(),jS=Fe(),gs=de(),Vu=gs.style,Wu=gs.clear,NS=gs.figures,Ju=q(),BS=Ju.erase,Hu=Ju.cursor,qe=Bu(),zu=qe.DatePart,US=qe.Meridiem,GS=qe.Day,VS=qe.Hours,WS=qe.Milliseconds,HS=qe.Minutes,zS=qe.Month,YS=qe.Seconds,JS=qe.Year,KS=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Yu={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new GS(t),3:t=>new zS(t),4:t=>new JS(t),5:t=>new US(t),6:t=>new VS(t),7:t=>new HS(t),8:t=>new YS(t),9:t=>new WS(t)},ZS={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},ms=class extends jS{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ZS,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Wu("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=KS.exec(e);){let n=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in Yu?Yu[s]({token:r[s]||n,date:this.date,parts:this.parts,locales:this.locales}):r[s]||n);}let i=this.parts.reduce((n,s)=>(typeof s=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=s:n.push(s),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof zu)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
|
|
23
|
-
`),this.close();}validate(){var e=this;return Gu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return Gu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
|
|
24
|
-
`),e.close();})()}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof zu)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(Hu.hide):this.out.write(Wu(this.outputText,this.out.columns)),super.render(),this.outputText=[Vu.symbol(this.done,this.aborted),fs.bold(this.msg),Vu.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?fs.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
25
|
-
`).reduce((e,r,i)=>e+`
|
|
26
|
-
${i?" ":NS.pointerSmall} ${fs.red().italic(r)}`,"")),this.out.write(BS.line+Hu.to(0)+this.outputText));}};Ku.exports=ms;});var nd=m(($I,id)=>{function Xu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Qu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){Xu(s,i,n,o,a,"next",c);}function a(c){Xu(s,i,n,o,a,"throw",c);}o(void 0);})}}var si=L(),XS=Fe(),rd=q(),oi=rd.cursor,QS=rd.erase,ai=de(),ys=ai.style,ev=ai.figures,ed=ai.clear,tv=ai.lines,rv=/[0-9]/,bs=t=>t!==void 0,td=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},ws=class extends XS{constructor(e={}){super(e),this.transform=ys.render(e.style),this.msg=e.message,this.initial=bs(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=bs(e.min)?e.min:-1/0,this.max=bs(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=si.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${td(e,this.round)}`),this._value=td(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||rv.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
|
|
27
|
-
`),this.close();}validate(){var e=this;return Qu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return Qu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=true,e.aborted=false,e.error=false,e.fire(),e.render(),e.out.write(`
|
|
28
|
-
`),e.close();})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(oi.down(tv(this.outputError,this.out.columns)-1)+ed(this.outputError,this.out.columns)),this.out.write(ed(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ys.symbol(this.done,this.aborted),si.bold(this.msg),ys.delimiter(this.done),!this.done||!this.done&&!this.placeholder?si[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
29
|
-
`).reduce((e,r,i)=>e+`
|
|
30
|
-
${i?" ":ev.pointerSmall} ${si.red().italic(r)}`,"")),this.out.write(QS.line+oi.to(0)+this.outputText+oi.save+this.outputError+oi.restore));}};id.exports=ws;});var Ss=m((MI,ad)=>{var xe=L(),iv=q(),nv=iv.cursor,sv=Fe(),pr=de(),sd=pr.clear,tt=pr.figures,od=pr.style,ov=pr.wrap,av=pr.entriesToDisplay,xs=class extends sv{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=sd("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
31
|
-
`),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
32
|
-
`),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
33
|
-
Instructions:
|
|
34
|
-
${tt.arrowUp}/${tt.arrowDown}: Highlight option
|
|
35
|
-
${tt.arrowLeft}/${tt.arrowRight}/[space]: Toggle selection
|
|
36
|
-
`+(this.maxChoices===void 0?` a: Toggle all
|
|
37
|
-
`:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let s=(r.selected?xe.green(tt.radioOn):tt.radioOff)+" "+n+" ",o,a;return r.disabled?o=e===i?xe.gray().underline(r.title):xe.strikethrough().gray(r.title):(o=e===i?xe.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(s.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
|
|
38
|
-
`+ov(r.description,{margin:s.length,width:this.out.columns})))),s+o+xe.gray(a||"")}paginateOptions(e){if(e.length===0)return xe.red("No matches for this query.");let r=av(this.cursor,e.length,this.optionsPerPage),i=r.startIndex,n=r.endIndex,s,o=[];for(let a=i;a<n;a++)a===i&&i>0?s=tt.arrowUp:a===n-1&&n<e.length?s=tt.arrowDown:s=" ",o.push(this.renderOption(this.cursor,e[a],a,s));return `
|
|
39
|
-
`+o.join(`
|
|
40
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[xe.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(xe.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(nv.hide),super.render();let e=[od.symbol(this.done,this.aborted),xe.bold(this.msg),od.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=xe.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=sd(e,this.out.columns);}};ad.exports=xs;});var fd=m((RI,pd)=>{function cd(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function cv(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){cd(s,i,n,o,a,"next",c);}function a(c){cd(s,i,n,o,a,"throw",c);}o(void 0);})}}var fr=L(),lv=Fe(),hd=q(),uv=hd.erase,ld=hd.cursor,mr=de(),vs=mr.style,ud=mr.clear,Es=mr.figures,dv=mr.wrap,hv=mr.entriesToDisplay,dd=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),pv=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),fv=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},Os=class extends lv{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:fv(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=vs.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ud("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=dd(this.suggestions,e):this.value=this.fallback.value,this.fire();}complete(e){var r=this;return cv(function*(){let i=r.completing=r.suggest(r.input,r.choices),n=yield i;if(r.completing!==i)return;r.suggestions=n.map((o,a,c)=>({title:pv(c,a),value:dd(c,a),description:o.description})),r.completing=false;let s=Math.max(n.length-1,0);r.moveSelect(Math.min(s,r.select)),e&&e();})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
41
|
-
`),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
|
|
42
|
-
`),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
|
|
43
|
-
`),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let s,o=i?Es.arrowUp:n?Es.arrowDown:" ",a=r?fr.cyan().underline(e.title):e.title;return o=(r?fr.cyan(Es.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
|
|
44
|
-
`+dv(e.description,{margin:3,width:this.out.columns}))),o+" "+a+fr.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ld.hide):this.out.write(ud(this.outputText,this.out.columns)),super.render();let e=hv(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[vs.symbol(this.done,this.aborted,this.exited),fr.bold(this.msg),vs.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(r,i).map((s,o)=>this.renderOption(s,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length)).join(`
|
|
45
|
-
`);this.outputText+=`
|
|
46
|
-
`+(n||fr.gray(this.fallback.title));}this.out.write(uv.line+ld.to(0)+this.outputText);}};pd.exports=Os;});var bd=m((FI,yd)=>{var je=L(),mv=q(),gv=mv.cursor,yv=Ss(),ks=de(),md=ks.clear,gd=ks.style,Rt=ks.figures,Cs=class extends yv{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=md("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
47
|
-
Instructions:
|
|
48
|
-
${Rt.arrowUp}/${Rt.arrowDown}: Highlight option
|
|
49
|
-
${Rt.arrowLeft}/${Rt.arrowRight}/[space]: Toggle selection
|
|
50
|
-
[a,b,c]/delete: Filter choices
|
|
51
|
-
enter/return: Complete answer
|
|
52
|
-
`:""}renderCurrentInput(){return `
|
|
53
|
-
Filtered results for: ${this.inputValue?this.inputValue:je.gray("Enter something to filter")}
|
|
54
|
-
`}renderOption(e,r,i){let n;return r.disabled?n=e===i?je.gray().underline(r.title):je.strikethrough().gray(r.title):n=e===i?je.cyan().underline(r.title):r.title,(r.selected?je.green(Rt.radioOn):Rt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[je.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(je.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(gv.hide),super.render();let e=[gd.symbol(this.done,this.aborted),je.bold(this.msg),gd.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=je.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=md(e,this.out.columns);}};yd.exports=Cs;});var Cd=m((LI,Od)=>{var wd=L(),bv=Fe(),vd=de(),xd=vd.style,wv=vd.clear,Ed=q(),xv=Ed.erase,Sd=Ed.cursor,Ds=class extends bv{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
55
|
-
`),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
56
|
-
`),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Sd.hide):this.out.write(wv(this.outputText,this.out.columns)),super.render(),this.outputText=[xd.symbol(this.done,this.aborted),wd.bold(this.msg),xd.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:wd.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(xv.line+Sd.to(0)+this.outputText));}};Od.exports=Ds;});var Dd=m((qI,kd)=>{kd.exports={TextPrompt:hu(),SelectPrompt:gu(),TogglePrompt:vu(),DatePrompt:Zu(),NumberPrompt:nd(),MultiselectPrompt:Ss(),AutocompletePrompt:fd(),AutocompleteMultiselectPrompt:bd(),ConfirmPrompt:Cd()};});var Td=m(_d=>{var re=_d,Sv=Dd(),ci=t=>t;function Se(t,e,r={}){return new Promise((i,n)=>{let s=new Sv[t](e),o=r.onAbort||ci,a=r.onSubmit||ci,c=r.onExit||ci;s.on("state",e.onState||ci),s.on("submit",u=>i(a(u))),s.on("exit",u=>i(c(u))),s.on("abort",u=>n(o(u)));})}re.text=t=>Se("TextPrompt",t);re.password=t=>(t.style="password",re.text(t));re.invisible=t=>(t.style="invisible",re.text(t));re.number=t=>Se("NumberPrompt",t);re.date=t=>Se("DatePrompt",t);re.confirm=t=>Se("ConfirmPrompt",t);re.list=t=>{let e=t.separator||",";return Se("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};re.toggle=t=>Se("TogglePrompt",t);re.select=t=>Se("SelectPrompt",t);re.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Se("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};re.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Se("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var vv=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));re.autocomplete=t=>(t.suggest=t.suggest||vv,t.choices=[].concat(t.choices||[]),Se("AutocompletePrompt",t));});var Ld=m((NI,Fd)=>{function Ad(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i);}return r}function Pd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ad(Object(r),true).forEach(function(i){Ev(t,i,r[i]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ad(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i));});}return t}function Ev(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true}):t[e]=r,t}function Ov(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Cv(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
57
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var u=r.next();return s=u.done,u},e:function(u){o=true,a=u;},f:function(){try{!s&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function Cv(t,e){if(t){if(typeof t=="string")return Id(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Id(t,e)}}function Id(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function $d(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Md(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){$d(s,i,n,o,a,"next",c);}function a(c){$d(s,i,n,o,a,"throw",c);}o(void 0);})}}var _s=Td(),kv=["suggest","format","onState","validate","onRender","type"],Rd=()=>{};function rt(){return Ts.apply(this,arguments)}function Ts(){return Ts=Md(function*(t=[],{onSubmit:e=Rd,onCancel:r=Rd}={}){let i={},n=rt._override||{};t=[].concat(t);let s,o,a,c,u,l,d=(function(){var w=Md(function*(b,S,k=false){if(!(!k&&b.validate&&b.validate(S)!==true))return b.format?yield b.format(S,i):S});return function(S,k){return w.apply(this,arguments)}})();var h=Ov(t),p;try{for(h.s();!(p=h.n()).done;){o=p.value;var g=o;if(c=g.name,u=g.type,typeof u=="function"&&(u=yield u(s,Pd({},i),o),o.type=u),!!u){for(let w in o){if(kv.includes(w))continue;let b=o[w];o[w]=typeof b=="function"?yield b(s,Pd({},i),l):b;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");var y=o;if(c=y.name,u=y.type,_s[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[o.name]!==void 0&&(s=yield d(o,n[o.name]),s!==void 0)){i[c]=s;continue}try{s=rt._injected?Dv(rt._injected,o.initial):yield _s[u](o),i[c]=s=yield d(o,s,!0),a=yield e(o,s,i);}catch{a=!(yield r(o,i));}if(a)return i}}}catch(w){h.e(w);}finally{h.f();}return i}),Ts.apply(this,arguments)}function Dv(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function _v(t){rt._injected=(rt._injected||[]).concat(t);}function Tv(t){rt._override=Object.assign({},t);}Fd.exports=Object.assign(rt,{prompt:rt,prompts:_s,inject:_v,override:Tv});});var jd=m((BI,qd)=>{qd.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var li=m((UI,Nd)=>{Nd.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var Gd=m((GI,Ud)=>{var Av=li(),{erase:Bd,cursor:Pv}=q(),Iv=t=>[...Av(t)].length;Ud.exports=function(t,e){if(!e)return Bd.line+Pv.to(0);let r=0,i=t.split(/\r?\n/);for(let n of i)r+=1+Math.floor(Math.max(Iv(n)-1,0)/e);return Bd.lines(r)};});var As=m((VI,Vd)=>{var gr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},$v={arrowUp:gr.arrowUp,arrowDown:gr.arrowDown,arrowLeft:gr.arrowLeft,arrowRight:gr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Mv=process.platform==="win32"?$v:gr;Vd.exports=Mv;});var Hd=m((WI,Wd)=>{var Ft=L(),ft=As(),Ps=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Rv=t=>Ps[t]||Ps.default,yr=Object.freeze({aborted:Ft.red(ft.cross),done:Ft.green(ft.tick),exited:Ft.yellow(ft.cross),default:Ft.cyan("?")}),Fv=(t,e,r)=>e?yr.aborted:r?yr.exited:t?yr.done:yr.default,Lv=t=>Ft.gray(t?ft.ellipsis:ft.pointerSmall),qv=(t,e)=>Ft.gray(t?e?ft.pointerSmall:"+":ft.line);Wd.exports={styles:Ps,render:Rv,symbols:yr,symbol:Fv,delimiter:Lv,item:qv};});var Yd=m((HI,zd)=>{var jv=li();zd.exports=function(t,e){let r=String(jv(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var Kd=m((zI,Jd)=>{Jd.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=i||s[s.length-1].length+o.length+1<i?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
|
|
58
|
-
`)).join(`
|
|
59
|
-
`)};});var Xd=m((YI,Zd)=>{Zd.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var he=m((JI,Qd)=>{Qd.exports={action:jd(),clear:Gd(),style:Hd(),strip:li(),figures:As(),lines:Yd(),wrap:Kd(),entriesToDisplay:Xd()};});var Ne=m((KI,th)=>{var eh=T("readline"),{action:Nv}=he(),Bv=T("events"),{beep:Uv,cursor:Gv}=q(),Vv=L(),Is=class extends Bv{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=eh.createInterface({input:this.in,escapeCodeTimeout:50});eh.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(s,o)=>{let a=Nv(o,i);a===false?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(Gv.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(Uv);}render(){this.onRender(Vv),this.firstRender&&(this.firstRender=false);}};th.exports=Is;});var ih=m((ZI,rh)=>{var ui=L(),Wv=Ne(),{erase:Hv,cursor:br}=q(),{style:$s,clear:Ms,lines:zv,figures:Yv}=he(),Rs=class extends Wv{constructor(e={}){super(e),this.transform=$s.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Ms("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ui.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
|
|
60
|
-
`),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=true,this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
61
|
-
`),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(br.down(zv(this.outputError,this.out.columns)-1)+Ms(this.outputError,this.out.columns)),this.out.write(Ms(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[$s.symbol(this.done,this.aborted),ui.bold(this.msg),$s.delimiter(this.done),this.red?ui.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
62
|
-
`).reduce((e,r,i)=>e+`
|
|
63
|
-
${i?" ":Yv.pointerSmall} ${ui.red().italic(r)}`,"")),this.out.write(Hv.line+br.to(0)+this.outputText+br.save+this.outputError+br.restore+br.move(this.cursorOffset,0)));}};rh.exports=Rs;});var ah=m((XI,oh)=>{var Be=L(),Jv=Ne(),{style:nh,clear:sh,figures:di,wrap:Kv,entriesToDisplay:Zv}=he(),{cursor:Xv}=q(),Fs=class extends Jv{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=sh("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
64
|
-
`),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
65
|
-
`),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Xv.hide):this.out.write(sh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Zv(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[nh.symbol(this.done,this.aborted),Be.bold(this.msg),nh.delimiter(false),this.done?this.selection.title:this.selection.disabled?Be.yellow(this.warn):Be.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
66
|
-
`;for(let i=e;i<r;i++){let n,s,o="",a=this.choices[i];i===e&&e>0?s=di.arrowUp:i===r-1&&r<this.choices.length?s=di.arrowDown:s=" ",a.disabled?(n=this.cursor===i?Be.gray().underline(a.title):Be.strikethrough().gray(a.title),s=(this.cursor===i?Be.bold().gray(di.pointer)+" ":" ")+s):(n=this.cursor===i?Be.cyan().underline(a.title):a.title,s=(this.cursor===i?Be.cyan(di.pointer)+" ":" ")+s,a.description&&this.cursor===i&&(o=` - ${a.description}`,(s.length+n.length+o.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(o=`
|
|
67
|
-
`+Kv(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${n}${Be.gray(o)}
|
|
68
|
-
`;}}this.out.write(this.outputText);}};oh.exports=Fs;});var dh=m((QI,uh)=>{var hi=L(),Qv=Ne(),{style:ch,clear:e0}=he(),{cursor:lh,erase:t0}=q(),Ls=class extends Qv{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
69
|
-
`),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
70
|
-
`),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(lh.hide):this.out.write(e0(this.outputText,this.out.columns)),super.render(),this.outputText=[ch.symbol(this.done,this.aborted),hi.bold(this.msg),ch.delimiter(this.done),this.value?this.inactive:hi.cyan().underline(this.inactive),hi.gray("/"),this.value?hi.cyan().underline(this.active):this.active].join(" "),this.out.write(t0.line+lh.to(0)+this.outputText));}};uh.exports=Ls;});var ve=m((e1,hh)=>{var qs=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};hh.exports=qs;});var fh=m((t1,ph)=>{var r0=ve(),js=class extends r0{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};ph.exports=js;});var gh=m((r1,mh)=>{var i0=ve(),n0=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),Ns=class extends i0{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+n0(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};mh.exports=Ns;});var bh=m((i1,yh)=>{var s0=ve(),Bs=class extends s0{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};yh.exports=Bs;});var xh=m((n1,wh)=>{var o0=ve(),Us=class extends o0{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};wh.exports=Us;});var vh=m((s1,Sh)=>{var a0=ve(),Gs=class extends a0{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Sh.exports=Gs;});var Oh=m((o1,Eh)=>{var c0=ve(),Vs=class extends c0{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Eh.exports=Vs;});var kh=m((a1,Ch)=>{var l0=ve(),Ws=class extends l0{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ch.exports=Ws;});var _h=m((c1,Dh)=>{var u0=ve(),Hs=class extends u0{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Dh.exports=Hs;});var Ah=m((l1,Th)=>{Th.exports={DatePart:ve(),Meridiem:fh(),Day:gh(),Hours:bh(),Milliseconds:xh(),Minutes:vh(),Month:Oh(),Seconds:kh(),Year:_h()};});var Lh=m((u1,Fh)=>{var zs=L(),d0=Ne(),{style:Ph,clear:Ih,figures:h0}=he(),{erase:p0,cursor:$h}=q(),{DatePart:Mh,Meridiem:f0,Day:m0,Hours:g0,Milliseconds:y0,Minutes:b0,Month:w0,Seconds:x0,Year:S0}=Ah(),v0=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Rh={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new m0(t),3:t=>new w0(t),4:t=>new S0(t),5:t=>new f0(t),6:t=>new g0(t),7:t=>new b0(t),8:t=>new x0(t),9:t=>new y0(t)},E0={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Ys=class extends d0{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(E0,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Ih("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=v0.exec(e);){let n=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in Rh?Rh[s]({token:r[s]||n,date:this.date,parts:this.parts,locales:this.locales}):r[s]||n);}let i=this.parts.reduce((n,s)=>(typeof s=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=s:n.push(s),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Mh)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
|
|
71
|
-
`),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
72
|
-
`),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Mh)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write($h.hide):this.out.write(Ih(this.outputText,this.out.columns)),super.render(),this.outputText=[Ph.symbol(this.done,this.aborted),zs.bold(this.msg),Ph.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?zs.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
73
|
-
`).reduce((e,r,i)=>e+`
|
|
74
|
-
${i?" ":h0.pointerSmall} ${zs.red().italic(r)}`,"")),this.out.write(p0.line+$h.to(0)+this.outputText));}};Fh.exports=Ys;});var Bh=m((d1,Nh)=>{var pi=L(),O0=Ne(),{cursor:fi,erase:C0}=q(),{style:Js,figures:k0,clear:qh,lines:D0}=he(),_0=/[0-9]/,Ks=t=>t!==void 0,jh=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Zs=class extends O0{constructor(e={}){super(e),this.transform=Js.render(e.style),this.msg=e.message,this.initial=Ks(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Ks(e.min)?e.min:-1/0,this.max=Ks(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=pi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${jh(e,this.round)}`),this._value=jh(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||_0.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
|
|
75
|
-
`),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=true,this.aborted=false,this.error=false,this.fire(),this.render(),this.out.write(`
|
|
76
|
-
`),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fi.down(D0(this.outputError,this.out.columns)-1)+qh(this.outputError,this.out.columns)),this.out.write(qh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Js.symbol(this.done,this.aborted),pi.bold(this.msg),Js.delimiter(this.done),!this.done||!this.done&&!this.placeholder?pi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
77
|
-
`).reduce((e,r,i)=>e+`
|
|
78
|
-
${i?" ":k0.pointerSmall} ${pi.red().italic(r)}`,"")),this.out.write(C0.line+fi.to(0)+this.outputText+fi.save+this.outputError+fi.restore));}};Nh.exports=Zs;});var Qs=m((h1,Vh)=>{var Ee=L(),{cursor:T0}=q(),A0=Ne(),{clear:Uh,figures:it,style:Gh,wrap:P0,entriesToDisplay:I0}=he(),Xs=class extends A0{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=Uh("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
79
|
-
`),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
80
|
-
`),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
81
|
-
Instructions:
|
|
82
|
-
${it.arrowUp}/${it.arrowDown}: Highlight option
|
|
83
|
-
${it.arrowLeft}/${it.arrowRight}/[space]: Toggle selection
|
|
84
|
-
`+(this.maxChoices===void 0?` a: Toggle all
|
|
85
|
-
`:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let s=(r.selected?Ee.green(it.radioOn):it.radioOff)+" "+n+" ",o,a;return r.disabled?o=e===i?Ee.gray().underline(r.title):Ee.strikethrough().gray(r.title):(o=e===i?Ee.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(s.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
|
|
86
|
-
`+P0(r.description,{margin:s.length,width:this.out.columns})))),s+o+Ee.gray(a||"")}paginateOptions(e){if(e.length===0)return Ee.red("No matches for this query.");let{startIndex:r,endIndex:i}=I0(this.cursor,e.length,this.optionsPerPage),n,s=[];for(let o=r;o<i;o++)o===r&&r>0?n=it.arrowUp:o===i-1&&i<e.length?n=it.arrowDown:n=" ",s.push(this.renderOption(this.cursor,e[o],o,n));return `
|
|
87
|
-
`+s.join(`
|
|
88
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ee.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Ee.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(T0.hide),super.render();let e=[Gh.symbol(this.done,this.aborted),Ee.bold(this.msg),Gh.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ee.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Uh(e,this.out.columns);}};Vh.exports=Xs;});var Jh=m((p1,Yh)=>{var wr=L(),$0=Ne(),{erase:M0,cursor:Wh}=q(),{style:eo,clear:Hh,figures:to,wrap:R0,entriesToDisplay:F0}=he(),zh=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),L0=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),q0=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},ro=class extends $0{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:q0(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=eo.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Hh("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=zh(this.suggestions,e):this.value=this.fallback.value,this.fire();}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((s,o,a)=>({title:L0(a,o),value:zh(a,o),description:s.description})),this.completing=false;let n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),e&&e();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
89
|
-
`),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
|
|
90
|
-
`),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
|
|
91
|
-
`),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let s,o=i?to.arrowUp:n?to.arrowDown:" ",a=r?wr.cyan().underline(e.title):e.title;return o=(r?wr.cyan(to.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
|
|
92
|
-
`+R0(e.description,{margin:3,width:this.out.columns}))),o+" "+a+wr.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Wh.hide):this.out.write(Hh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=F0(this.select,this.choices.length,this.limit);if(this.outputText=[eo.symbol(this.done,this.aborted,this.exited),wr.bold(this.msg),eo.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(e,r).map((n,s)=>this.renderOption(n,this.select===s+e,s===0&&e>0,s+e===r-1&&r<this.choices.length)).join(`
|
|
93
|
-
`);this.outputText+=`
|
|
94
|
-
`+(i||wr.gray(this.fallback.title));}this.out.write(M0.line+Wh.to(0)+this.outputText);}};Yh.exports=ro;});var Qh=m((f1,Xh)=>{var Ue=L(),{cursor:j0}=q(),N0=Qs(),{clear:Kh,style:Zh,figures:Lt}=he(),io=class extends N0{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=Kh("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
95
|
-
Instructions:
|
|
96
|
-
${Lt.arrowUp}/${Lt.arrowDown}: Highlight option
|
|
97
|
-
${Lt.arrowLeft}/${Lt.arrowRight}/[space]: Toggle selection
|
|
98
|
-
[a,b,c]/delete: Filter choices
|
|
99
|
-
enter/return: Complete answer
|
|
100
|
-
`:""}renderCurrentInput(){return `
|
|
101
|
-
Filtered results for: ${this.inputValue?this.inputValue:Ue.gray("Enter something to filter")}
|
|
102
|
-
`}renderOption(e,r,i){let n;return r.disabled?n=e===i?Ue.gray().underline(r.title):Ue.strikethrough().gray(r.title):n=e===i?Ue.cyan().underline(r.title):r.title,(r.selected?Ue.green(Lt.radioOn):Lt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ue.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Ue.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(j0.hide),super.render();let e=[Zh.symbol(this.done,this.aborted),Ue.bold(this.msg),Zh.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ue.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Kh(e,this.out.columns);}};Xh.exports=io;});var np=m((m1,ip)=>{var ep=L(),B0=Ne(),{style:tp,clear:U0}=he(),{erase:G0,cursor:rp}=q(),no=class extends B0{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
|
|
103
|
-
`),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
|
|
104
|
-
`),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(rp.hide):this.out.write(U0(this.outputText,this.out.columns)),super.render(),this.outputText=[tp.symbol(this.done,this.aborted),ep.bold(this.msg),tp.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ep.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(G0.line+rp.to(0)+this.outputText));}};ip.exports=no;});var op=m((g1,sp)=>{sp.exports={TextPrompt:ih(),SelectPrompt:ah(),TogglePrompt:dh(),DatePrompt:Lh(),NumberPrompt:Bh(),MultiselectPrompt:Qs(),AutocompletePrompt:Jh(),AutocompleteMultiselectPrompt:Qh(),ConfirmPrompt:np()};});var cp=m(ap=>{var ie=ap,V0=op(),mi=t=>t;function Oe(t,e,r={}){return new Promise((i,n)=>{let s=new V0[t](e),o=r.onAbort||mi,a=r.onSubmit||mi,c=r.onExit||mi;s.on("state",e.onState||mi),s.on("submit",u=>i(a(u))),s.on("exit",u=>i(c(u))),s.on("abort",u=>n(o(u)));})}ie.text=t=>Oe("TextPrompt",t);ie.password=t=>(t.style="password",ie.text(t));ie.invisible=t=>(t.style="invisible",ie.text(t));ie.number=t=>Oe("NumberPrompt",t);ie.date=t=>Oe("DatePrompt",t);ie.confirm=t=>Oe("ConfirmPrompt",t);ie.list=t=>{let e=t.separator||",";return Oe("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};ie.toggle=t=>Oe("TogglePrompt",t);ie.select=t=>Oe("SelectPrompt",t);ie.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Oe("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};ie.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Oe("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var W0=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));ie.autocomplete=t=>(t.suggest=t.suggest||W0,t.choices=[].concat(t.choices||[]),Oe("AutocompletePrompt",t));});var dp=m((b1,up)=>{var so=cp(),H0=["suggest","format","onState","validate","onRender","type"],lp=()=>{};async function nt(t=[],{onSubmit:e=lp,onCancel:r=lp}={}){let i={},n=nt._override||{};t=[].concat(t);let s,o,a,c,u,l,d=async(h,p,g=false)=>{if(!(!g&&h.validate&&h.validate(p)!==true))return h.format?await h.format(p,i):p};for(o of t)if({name:c,type:u}=o,typeof u=="function"&&(u=await u(s,{...i},o),o.type=u),!!u){for(let h in o){if(H0.includes(h))continue;let p=o[h];o[h]=typeof p=="function"?await p(s,{...i},l):p;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:c,type:u}=o,so[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[o.name]!==void 0&&(s=await d(o,n[o.name]),s!==void 0)){i[c]=s;continue}try{s=nt._injected?z0(nt._injected,o.initial):await so[u](o),i[c]=s=await d(o,s,!0),a=await e(o,s,i);}catch{a=!await r(o,i);}if(a)return i}return i}function z0(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Y0(t){nt._injected=(nt._injected||[]).concat(t);}function J0(t){nt._override=Object.assign({},t);}up.exports=Object.assign(nt,{prompt:nt,prompts:so,inject:Y0,override:J0});});var pp=m((w1,hp)=>{function K0(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return false;if(t[e]>r[e])return true}return false}hp.exports=K0("8.6.0")?Ld():dp();});var Kp=m((GM,Jp)=>{Jp.exports=Yp;Yp.sync=ZE;var Hp=T("fs");function KE(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return true;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return true}return false}function zp(t,e,r){return !t.isSymbolicLink()&&!t.isFile()?false:KE(e,r)}function Yp(t,e,r){Hp.stat(t,function(i,n){r(i,i?false:zp(n,t,e));});}function ZE(t,e){return zp(Hp.statSync(t),t,e)}});var tf=m((VM,ef)=>{ef.exports=Xp;Xp.sync=XE;var Zp=T("fs");function Xp(t,e,r){Zp.stat(t,function(i,n){r(i,i?false:Qp(n,e));});}function XE(t,e){return Qp(Zp.statSync(t),e)}function Qp(t,e){return t.isFile()&&QE(t,e)}function QE(t,e){var r=t.mode,i=t.uid,n=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=r&u||r&c&&n===o||r&a&&i===s||r&l&&s===0;return d}});var nf=m((HM,rf)=>{T("fs");var Ai;process.platform==="win32"||global.TESTING_WINDOWS?Ai=Kp():Ai=tf();rf.exports=yo;yo.sync=eO;function yo(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){yo(t,e||{},function(s,o){s?n(s):i(o);});})}Ai(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=false),r(i,n);});}function eO(t,e){try{return Ai.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return false;throw r}}});var df=m((zM,uf)=>{var Ut=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",sf=T("path"),tO=Ut?";":":",of=nf(),af=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),cf=(t,e)=>{let r=e.colon||tO,i=t.match(/\//)||Ut&&t.match(/\\/)?[""]:[...Ut?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=Ut?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ut?n.split(r):[""];return Ut&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},lf=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=cf(t,e),o=[],a=u=>new Promise((l,d)=>{if(u===i.length)return e.all&&o.length?l(o):d(af(t));let h=i[u],p=/^".*"$/.test(h)?h.slice(1,-1):h,g=sf.join(p,t),y=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+g:g;l(c(y,u,0));}),c=(u,l,d)=>new Promise((h,p)=>{if(d===n.length)return h(a(l+1));let g=n[d];of(u+g,{pathExt:s},(y,w)=>{if(!y&&w)if(e.all)o.push(u+g);else return h(u+g);return h(c(u,l,d+1))});});return r?a(0).then(u=>r(null,u),r):a(0)},rO=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=cf(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=sf.join(c,t),l=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let d=0;d<i.length;d++){let h=l+i[d];try{if(of.sync(h,{pathExt:n}))if(e.all)s.push(h);else return h}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw af(t)};uf.exports=lf;lf.sync=rO;});var pf=m((YM,bo)=>{var hf=(t={})=>{let e=t.env||process.env;return (t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};bo.exports=hf;bo.exports.default=hf;});var yf=m((JM,gf)=>{var ff=T("path"),iO=df(),nO=pf();function mf(t,e){let r=t.options.env||process.env,i=process.cwd(),n=t.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd);}catch{}let o;try{o=iO.sync(t.command,{path:r[nO({env:r})],pathExt:e?ff.delimiter:void 0});}catch{}finally{s&&process.chdir(i);}return o&&(o=ff.resolve(n?t.options.cwd:"",o)),o}function sO(t){return mf(t)||mf(t,true)}gf.exports=sO;});var bf=m((KM,xo)=>{var wo=/([()\][%!^"`<>&|;, *?])/g;function oO(t){return t=t.replace(wo,"^$1"),t}function aO(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(wo,"^$1"),e&&(t=t.replace(wo,"^$1")),t}xo.exports.command=oO;xo.exports.argument=aO;});var xf=m((ZM,wf)=>{wf.exports=/^#!(.*)/;});var vf=m((XM,Sf)=>{var cO=xf();Sf.exports=(t="")=>{let e=t.match(cO);if(!e)return null;let[r,i]=e[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n};});var Of=m((QM,Ef)=>{var So=T("fs"),lO=vf();function uO(t){let r=Buffer.alloc(150),i;try{i=So.openSync(t,"r"),So.readSync(i,r,0,150,0),So.closeSync(i);}catch{}return lO(r.toString())}Ef.exports=uO;});var _f=m((eR,Df)=>{var dO=T("path"),Cf=yf(),kf=bf(),hO=Of(),pO=process.platform==="win32",fO=/\.(?:com|exe)$/i,mO=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gO(t){t.file=Cf(t);let e=t.file&&hO(t.file);return e?(t.args.unshift(t.file),t.command=e,Cf(t)):t.file}function yO(t){if(!pO)return t;let e=gO(t),r=!fO.test(e);if(t.options.forceShell||r){let i=mO.test(e);t.command=dO.normalize(t.command),t.command=kf.command(t.command),t.args=t.args.map(s=>kf.argument(s,i));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=true;}return t}function bO(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let i={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?i:yO(i)}Df.exports=bO;});var Pf=m((tR,Af)=>{var vo=process.platform==="win32";function Eo(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function wO(t,e){if(!vo)return;let r=t.emit;t.emit=function(i,n){if(i==="exit"){let s=Tf(n,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)};}function Tf(t,e){return vo&&t===1&&!e.file?Eo(e.original,"spawn"):null}function xO(t,e){return vo&&t===1&&!e.file?Eo(e.original,"spawnSync"):null}Af.exports={hookChildProcess:wO,verifyENOENT:Tf,verifyENOENTSync:xO,notFoundError:Eo};});var Mf=m((rR,Gt)=>{var If=T("child_process"),Oo=_f(),Co=Pf();function $f(t,e,r){let i=Oo(t,e,r),n=If.spawn(i.command,i.args,i.options);return Co.hookChildProcess(n,i),n}function SO(t,e,r){let i=Oo(t,e,r),n=If.spawnSync(i.command,i.args,i.options);return n.error=n.error||Co.verifyENOENTSync(n.status,i),n}Gt.exports=$f;Gt.exports.spawn=$f;Gt.exports.sync=SO;Gt.exports._parse=Oo;Gt.exports._enoent=Co;});var Ye=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0;}},ut=class extends Ye{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var er=class{constructor(e,r){switch(this.description=r||"",this.variadic=false,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case "<":this.required=true,this._name=e.slice(1,-1);break;case "[":this.required=false,this._name=e.slice(1,-1);break;default:this.required=true,this._name=e;break}this._name.endsWith("...")&&(this.variadic=true,this._name=this._name.slice(0,-3));}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=true,this}argOptional(){return this.required=false,this}};function Br(t){let e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}var tr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=false,this.sortOptions=false,this.showGlobalOptions=false;}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80;}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),s=i.long&&e._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(e.createOption(i.long,i.description)):i.short&&!n&&r.push(e.createOption(i.short,i.description));}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return [];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n);}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||"";}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>Br(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let n=new Map;return e.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]);}),r.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]),n.get(o).push(s);}),n}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth??80;function s(d,h){return r.formatItem(d,i,h,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let c=r.visibleArguments(e).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let p=d.map(g=>s(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));o=o.concat(this.formatItemList(h,p,r));}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));o=o.concat(this.formatItemList("Global Options:",d,r));}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let p=d.map(g=>s(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));o=o.concat(this.formatItemList(h,p,r));}),o.join(`
|
|
105
|
-
`)}displayWidth(e){return stripVTControlCharacters(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return /\n[^\S\r\n]/.test(e)}formatItem(e,r,i,n){let o=" ".repeat(2);if(!i)return o+e;let a=e.padEnd(r+e.length-n.displayWidth(e)),c=2,l=(this.helpWidth??80)-r-c-2,d;return l<this.minWidthToWrap||n.preformatted(i)?d=i:d=n.boxWrap(i,l).replace(/\n/g,`
|
|
106
|
-
`+" ".repeat(r+c)),o+a+" ".repeat(c)+d.replace(/\n/g,`
|
|
107
|
-
${o}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(o=>{let a=o.match(n);if(a===null){s.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let d=this.displayWidth(l);if(u+d<=r){c.push(l),u+=d;return}s.push(c.join(""));let h=l.trimStart();c=[h],u=this.displayWidth(h);}),s.push(c.join(""));}),s.join(`
|
|
108
|
-
`)}};var Dt=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=false;let i=Ub(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=false,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=false,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0;}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:true}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=true){return this.mandatory=!!e,this}hideHelp(e=true){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ba(this.name().replace(/^no-/,"")):Ba(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return !this.required&&!this.optional&&!this.negate}},Ur=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r);}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i);});}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return true;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:false;return r.negate===(s===e)}};function Ba(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Ub(t){let e,r,i=/^-[^-]$/,n=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(e=s.shift()),n.test(s[0])&&(r=s.shift()),!e&&i.test(s[0])&&(e=s.shift()),!e&&n.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${t}'`;throw /^-[^-][^-]/.test(o)?new Error(`${a}
|
|
109
|
-
- a short flag is a single dash and a single character
|
|
110
|
-
- either use a single dash and a single character (for a short flag)
|
|
111
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(o)?new Error(`${a}
|
|
112
|
-
- too many short flags`):n.test(o)?new Error(`${a}
|
|
113
|
-
- too many long flags`):new Error(`${a}
|
|
114
|
-
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return {shortFlag:e,longFlag:r}}function Gb(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let s;t[n-1]===e[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1));}return r[t.length][e.length]}function Mn(t,e){if(!e||e.length===0)return "";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let i=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=Gb(t,o),c=Math.max(t.length,o.length);(c-a)/c>s&&(a<n?(n=a,i=[o]):a===n&&i.push(o));}),i.sort((o,a)=>o.localeCompare(a)),r&&(i=i.map(o=>`--${o}`)),i.length>1?`
|
|
115
|
-
(Did you mean one of ${i.join(", ")}?)`:i.length===1?`
|
|
116
|
-
(Did you mean ${i[0]}?)`:""}var _t=class t extends EventEmitter{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=false,this._allowExcessArguments=false,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=false,this._actionHandler=null,this._executableHandler=false,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=true,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=false,this._passThroughOptions=false,this._lifeCycleHooks={},this._showHelpAfterError=false,this._showSuggestionAfterError=true,this._savedState=null,this._outputConfiguration={writeOut:r=>_.stdout.write(r),writeErr:r=>_.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>_.stdout.isTTY?_.stdout.columns:void 0,getErrHelpWidth:()=>_.stderr.isTTY?_.stderr.columns:void 0,getOutHasColors:()=>Ga()??(_.stdout.isTTY&&_.stdout.hasColors?.()),getErrHasColors:()=>Ga()??(_.stderr.isTTY&&_.stderr.hasColors?.()),stripColor:r=>stripVTControlCharacters(r)},this._hidden=false,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0;}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return n&&(c.description(n),c._executableHandler=true),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new tr,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=true){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=true){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
117
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=true),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new er(e,r)}argument(e,r,i,n){let s=this.createArgument(e,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r);}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,n,s]=i.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(n);return a.helpOption(false),s&&a.arguments(s),o&&a.description(o),this._addImplicitHelpCommand=true,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=true,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
118
|
-
Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new Ye(e,r,i)),_.exit(e);}action(e){let r=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new Dt(e,r)}_callParseArg(e,r,i,n){try{return e.parseArg(r,i)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${n} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code});}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
|
|
119
|
-
- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e);}_registerCommand(e){let r=n=>[n.name()].concat(n.aliases()),i=r(e).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e);}addOption(e){this._registerOption(e);let r=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let c=this.getOptionValue(i);s!==null&&e.parseArg?s=this._callParseArg(e,s,c,o):s!==null&&e.variadic&&(s=e._collectValue(s,c)),s==null&&(e.negate?s=false:e.isBoolean()||e.optional?s=true:s=""),this.setOptionValueWithSource(i,s,a);};return this.on("option:"+r,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;n(s,o,"cli");}),e.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;n(s,o,"env");}),this}_optionEx(e,r,i,n,s){if(typeof r=="object"&&r instanceof Dt)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,i);if(o.makeOptionMandatory(!!e.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,u)=>{let l=a.exec(c);return l?l[0]:u},o.default(s).argParser(n);}else o.default(n);return this.addOption(o)}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:true},e,r,i,n)}combineFlagAndOptionalValue(e=true){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=true){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=true){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=true){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=true){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=true){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e));}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){_.versions?.electron&&(r.from="electron");let n=_.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval");}e===void 0&&(e=_.argv),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case "node":this._scriptPath=e[1],i=e.slice(2);break;case "electron":_.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case "user":i=e.slice(0);break;case "eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return !this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let r=e.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(e.attributeName(),true,"default");}),this.saveStateBeforeParse()):this.restoreStateBeforeParse();}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}};}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
120
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[];}_checkForMissingExecutable(e,r,i){if(Gr.existsSync(e))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
|
|
121
|
-
- if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
122
|
-
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
123
|
-
- ${n}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,d){let h=ne.resolve(l,d);if(Gr.existsSync(h))return h;if(i.includes(ne.extname(d)))return;let p=i.find(g=>Gr.existsSync(`${h}${g}`));if(p)return `${h}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,o=this._executableDir||"";if(this._scriptPath){let l;try{l=Gr.realpathSync(this._scriptPath);}catch{l=this._scriptPath;}o=ne.resolve(ne.dirname(l),o);}if(o){let l=n(o,s);if(!l&&!e._executableFile&&this._scriptPath){let d=ne.basename(this._scriptPath,ne.extname(this._scriptPath));d!==this._name&&(l=n(o,`${d}-${e._name}`));}s=l||s;}let a=i.includes(ne.extname(s)),c;_.platform!=="win32"?a?(r.unshift(s),r=Ua(_.execArgv).concat(r),c=Rn.spawn(_.argv[0],r,{stdio:"inherit"})):c=Rn.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,o,e._name),r.unshift(s),r=Ua(_.execArgv).concat(r),c=Rn.spawn(_.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{_.on(d,()=>{c.killed===false&&c.exitCode===null&&c.kill(d);});});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new Ye(l,"commander.executeSubCommandAsync","(close)")):_.exit(l);}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,o,e._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)_.exit(1);else {let d=new Ye(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d);}}),this.runningCommand=c;}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:true}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name());}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args);}_processArguments(){let e=(i,n,s)=>{let o=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;o=this._callParseArg(i,n,s,a);}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((o,a)=>e(i,a,o),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=e(i,s,i.defaultValue))),r[n]=s;}),this.processedArgs=r;}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{n.push({hookedCommand:s,callback:o});});}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this));}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,r));}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:true}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0]);},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,r);})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments());}else this.commands.length?(n(),this.help({error:true})):(n(),this._processArguments());}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r);});});}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?false:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n);});}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions();});}parseOptions(e){let r=[],i=[],n=r;function s(l){return l.length>1&&l[0]==="-"}let o=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):false,a=null,c=null,u=0;for(;u<e.length||c;){let l=c??e[u++];if(c=null,l==="--"){n===i&&n.push(l),n.push(...e.slice(u));break}if(a&&(!s(l)||o(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,s(l)){let d=this._findOption(l);if(d){if(d.required){let h=e[u++];h===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,h);}else if(d.optional){let h=null;u<e.length&&(!s(e[u])||o(e[u]))&&(h=e[u++]),this.emit(`option:${d.name()}`,h);}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),h=this._findOption(l.slice(0,d));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,l.slice(d+1));continue}}if(n===r&&s(l)&&!(this.commands.length===0&&o(l))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(u));break}else if(this._defaultCommandName){i.push(l,...e.slice(u));break}}if(this._passThroughOptions){n.push(l,...e.slice(u));break}n.push(l);}return {operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n];}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
124
|
-
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
125
|
-
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
126
|
-
`),this.outputHelp({error:true}));let i=r||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,e);}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in _.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,_.env[e.envVar]):this.emit(`optionEnv:${e.name()}`));}});}_parseOptionsImplied(){let e=new Ur(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied");});});}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"});}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"});}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"});}_conflictingOption(e,r){let i=o=>{let a=o.attributeName(),c=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&c===false||u.presetArg!==void 0&&c===u.presetArg)?u:l||o},n=o=>{let a=i(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"});}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent;}while(s&&!s._enablePositionalOptions);r=Mn(e,n);}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"});}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=e.length,s=this.parent?` for '${this.name()}'`:"",o=e.join(", "),a=`error: too many arguments${s}. Expected ${r} argument${i} but got ${n}: ${o}.`;this.error(a,{code:"commander.excessArguments"});}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias());}),r=Mn(e,n);}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"});}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
127
|
-
`),this._exit(0,"commander.version",e);}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>Br(i));return [].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup);}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup);}nameFromFilename(e){return this._name=ne.basename(e,ne.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),i=this._getOutputContext(e);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let r=!!e.error,i,n,s;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:s}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getOutputContext(e),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n));}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(_.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)");}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
128
|
-
Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
|
|
129
|
-
`);}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"));}};function Ua(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",s;return (s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}function Ga(){if(_.env.NO_COLOR||_.env.FORCE_COLOR==="0"||_.env.FORCE_COLOR==="false")return false;if(_.env.FORCE_COLOR||_.env.CLICOLOR_FORCE!==void 0)return true}new _t;var U=Ie(et()),kb=Ie(pp());var mt=true,qt=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},xr=0;if(qt.process&&qt.process.env&&qt.process.stdout){let{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:r,TERM:i,COLORTERM:n}=qt.process.env;e||r||t==="0"?mt=false:t==="1"||t==="2"||t==="3"?mt=true:i==="dumb"?mt=false:"CI"in qt.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in qt.process.env)?mt=true:mt=process.stdout.isTTY,mt&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?xr=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?xr=2:xr=1);}var fp={enabled:mt,supportLevel:xr};function E(t,e,r=1){let i=`\x1B[${t}m`,n=`\x1B[${e}m`,s=new RegExp(`\\x1b\\[${e}m`,"g");return o=>fp.enabled&&fp.supportLevel>=r?i+(""+o).replace(s,i)+n:""+o}var mp=E(31,39),gp=E(32,39),yp=E(33,39),bp=E(36,39);var C={info(t){console.log(bp(t));},success(t){console.log(gp(t));},warn(t){console.log(yp(t));},error(t){console.log(mp(t));}};var Sr=Ie(et());function yi(t){return Sr.default.existsSync(ne.join(t,"pnpm-lock.yaml"))?"pnpm":Sr.default.existsSync(ne.join(t,"yarn.lock"))?"yarn":Sr.default.existsSync(ne.join(t,"bun.lockb"))||Sr.default.existsSync(ne.join(t,"bun.lock"))?"bun":"npm"}function N(t){if(typeof t!="object"||t===null)return false;let e=Object.getPrototypeOf(t);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var jt=(t,e)=>{let r=ao(X0(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},X0=t=>oo(t)?t.toString():t,oo=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,ao=t=>t instanceof URL?fileURLToPath(t):t;var bi=(t,e=[],r={})=>{let i=jt(t,"First argument"),[n,s]=N(e)?[[],e]:[e,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let o=n.map(String),a=o.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!N(s))throw new TypeError(`Last argument must be an options object: ${s}`);return [i,o,s]};var{toString:wp}=Object.prototype,xp=t=>wp.call(t)==="[object ArrayBuffer]",B=t=>wp.call(t)==="[object Uint8Array]",Ge=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),eE=new TextEncoder,Sp=t=>eE.encode(t),tE=new TextDecoder,wi=t=>tE.decode(t),vp=(t,e)=>rE(t,e).join(""),rE=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;let r=new StringDecoder(e),i=t.map(s=>typeof s=="string"?Sp(s):s).map(s=>r.write(s)),n=r.end();return n===""?i:[...i,n]},vr=t=>t.length===1&&B(t[0])?t[0]:co(iE(t)),iE=t=>t.map(e=>typeof e=="string"?Sp(e):e),co=t=>{let e=new Uint8Array(nE(t)),r=0;for(let i of t)e.set(i,r),r+=i.length;return e},nE=t=>{let e=0;for(let r of t)e+=r.length;return e};var kp=t=>Array.isArray(t)&&Array.isArray(t.raw),Dp=(t,e)=>{let r=[];for(let[s,o]of t.entries())r=oE({templates:t,expressions:e,tokens:r,index:s,template:o});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return [i,n,{}]},oE=({templates:t,expressions:e,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[i]}`);let{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=aE(n,t.raw[i]),c=Op(r,s,o);if(i===e.length)return c;let u=e[i],l=Array.isArray(u)?u.map(d=>Cp(d)):[Cp(u)];return Op(c,l,a)},aE=(t,e)=>{if(e.length===0)return {nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false};let r=[],i=0,n=Ep.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){let c=e[a];if(Ep.has(c))i!==o&&r.push(t.slice(i,o)),i=o+1;else if(c==="\\"){let u=e[a+1];u===`
|
|
130
|
-
`?(o-=1,a+=1):u==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=cE[u]??1;}}let s=i===t.length;return s||r.push(t.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:s}},Ep=new Set([" "," ","\r",`
|
|
131
|
-
`]),cE={x:3,u:5},Op=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Cp=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(N(t)&&("stdout"in t||"isMaxBuffer"in t))return lE(t);throw t instanceof ChildProcess||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},lE=({stdout:t})=>{if(typeof t=="string")return t;if(B(t))return wi(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};var pe=t=>xi.includes(t),xi=[_.stdin,_.stdout,_.stderr],ae=["stdin","stdout","stderr"],Si=t=>ae[t]??`stdio[${t}]`;var Tp=t=>{let e={...t};for(let r of po)e[r]=uo(t,r);return e},uo=(t,e)=>{let r=Array.from({length:dE(t)+1}),i=hE(t[e],r,e);return yE(i,e)},dE=({stdio:t})=>Array.isArray(t)?Math.max(t.length,ae.length):ae.length,hE=(t,e,r)=>N(t)?pE(t,e,r):e.fill(t),pE=(t,e,r)=>{for(let i of Object.keys(t).sort(fE))for(let n of mE(i,r,e))e[n]=t[i];return e},fE=(t,e)=>_p(t)<_p(e)?1:-1,_p=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,mE=(t,e,r)=>{if(t==="ipc")return [r.length-1];let i=ho(t);if(i===void 0||i===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
132
|
-
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(i>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
133
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},ho=t=>{if(t==="all")return t;if(ae.includes(t))return ae.indexOf(t);let e=gE.exec(t);if(e!==null)return Number(e[1])},gE=/^fd(\d+)$/,yE=(t,e)=>t.map(r=>r===void 0?wE[e]:r),bE=debuglog("execa").enabled?"full":"none",wE={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:bE,stripFinalNewline:true},po=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ve=(t,e)=>e==="ipc"?t.at(-1):t[e];var Nt=({verbose:t},e)=>fo(t,e)!=="none",Bt=({verbose:t},e)=>!["none","short"].includes(fo(t,e)),Ap=({verbose:t},e)=>{let r=fo(t,e);return vi(r)?r:void 0},fo=(t,e)=>e===void 0?xE(t):Ve(t,e),xE=t=>t.find(e=>vi(e))??Ei.findLast(e=>t.includes(e)),vi=t=>typeof t=="function",Ei=["none","short","full"];var Pp=(t,e)=>{let r=[t,...e],i=r.join(" "),n=r.map(s=>_E(Ip(s))).join(" ");return {command:i,escapedCommand:n}},Er=t=>stripVTControlCharacters(t).split(`
|
|
134
|
-
`).map(e=>Ip(e)).join(`
|
|
135
|
-
`),Ip=t=>t.replaceAll(CE,e=>EE(e)),EE=t=>{let e=kE[t];if(e!==void 0)return e;let r=t.codePointAt(0),i=r.toString(16);return r<=DE?`\\u${i.padStart(4,"0")}`:`\\U${i}`},OE=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},CE=OE(),kE={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},DE=65535,_E=t=>TE.test(t)?t:platform==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,TE=/^[\w./-]+$/;function mo(){let{env:t}=_,{TERM:e,TERM_PROGRAM:r}=t;return _.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Mp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Rp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},AE={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},PE={...Mp,...Rp},IE={...Mp,...AE},$E=mo(),ME=$E?PE:IE,Oi=ME;var FE=RE?.WriteStream?.prototype?.hasColors?.()??false,v=(t,e)=>{if(!FE)return n=>n;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return n=>{let s=n+"",o=s.indexOf(i);if(o===-1)return r+s+i;let a=r,c=0,l=(e===22?i:"")+r;for(;o!==-1;)a+=s.slice(c,o)+l,c=o+i.length,o=s.indexOf(i,c);return a+=s.slice(c)+i,a}},Fp=v(1,22),Ci=v(90,39),Lp=v(91,39),qp=v(93,39);var Bp=({type:t,message:e,timestamp:r,piped:i,commandId:n,result:{failed:s=false}={},options:{reject:o=true}})=>{let a=LE(r),c=qE[t]({failed:s,reject:o,piped:i}),u=jE[t]({reject:o});return `${Ci(`[${a}]`)} ${Ci(`[${n}]`)} ${u(c)} ${u(e)}`},LE=t=>`${ki(t.getHours(),2)}:${ki(t.getMinutes(),2)}:${ki(t.getSeconds(),2)}.${ki(t.getMilliseconds(),3)}`,ki=(t,e)=>String(t).padStart(e,"0"),jp=({failed:t,reject:e})=>t?e?Oi.cross:Oi.warning:Oi.tick,qE={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:jp,duration:jp},Np=t=>t,jE={command:()=>Fp,output:()=>Np,ipc:()=>Np,error:({reject:t})=>t?Lp:qp,duration:()=>Ci};var Up=(t,e,r)=>{let i=Ap(e,r);return t.map(({verboseLine:n,verboseObject:s})=>NE(n,s,i)).filter(n=>n!==void 0).map(n=>BE(n)).join("")},NE=(t,e,r)=>{if(r===void 0)return t;let i=r(t,e);if(typeof i=="string")return i},BE=t=>t.endsWith(`
|
|
136
|
-
`)?t:`${t}
|
|
137
|
-
`;var Ce=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:i,result:n})=>{let s=GE({type:t,result:n,verboseInfo:i}),o=VE(e,s),a=Up(o,i,r);a!==""&&console.warn(a.slice(0,-1));},GE=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=false,...s}}})=>({type:t,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:e,options:s}),VE=(t,e)=>t.split(`
|
|
138
|
-
`).map(r=>WE({...e,message:r})),WE=t=>({verboseLine:Bp(t),verboseObject:t}),Di=t=>{let e=typeof t=="string"?t:inspect(t);return Er(e).replaceAll(" "," ".repeat(HE))},HE=2;var Gp=(t,e)=>{Nt(e)&&Ce({type:"command",verboseMessage:t,verboseInfo:e});};var Vp=(t,e,r)=>{JE(t);let i=zE(t);return {verbose:t,escapedCommand:e,commandId:i,rawOptions:r}},zE=t=>Nt({verbose:t})?YE++:void 0,YE=0n,JE=t=>{for(let e of t){if(e===false)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===true)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Ei.includes(e)&&!vi(e)){let r=Ei.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};var _i=()=>hrtime.bigint(),go=t=>Number(hrtime.bigint()-t)/1e6;var Ti=(t,e,r)=>{let i=_i(),{command:n,escapedCommand:s}=Pp(t,e),o=uo(r,"verbose"),a=Vp(o,s,{...r});return Gp(s,a),{command:n,escapedCommand:s,startTime:i,verboseInfo:a}};var Wm=Ie(Mf());function Pi(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}promisify(execFile);function Ii(t){return t instanceof URL?fileURLToPath(t):t}function Ff(t){return {*[Symbol.iterator](){let e=ne.resolve(Ii(t)),r;for(;r!==e;)yield e,r=e,e=ne.resolve(e,"..");}}}var CO=({cwd:t=_.cwd(),path:e=_.env[Pi()],preferLocal:r=true,execPath:i=_.execPath,addExecPath:n=true}={})=>{let s=ne.resolve(Ii(t)),o=[],a=e.split(ne.delimiter);return r&&kO(o,a,s),n&&DO(o,a,i,s),e===""||e===ne.delimiter?`${o.join(ne.delimiter)}${e}`:[...o,e].join(ne.delimiter)},kO=(t,e,r)=>{for(let i of Ff(r)){let n=ne.join(i,"node_modules/.bin");e.includes(n)||t.push(n);}},DO=(t,e,r,i)=>{let n=ne.resolve(i,Ii(r),"..");e.includes(n)||t.push(n);},Lf=({env:t=_.env,...e}={})=>{t={...t};let r=Pi({env:t});return e.path=t[r],t[r]=CO(e),t};var qf=(t,e,r)=>{let i=r?Cr:Or,n=t instanceof fe?{}:{cause:t};return new i(e,n)},fe=class extends Error{},jf=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:true,enumerable:false,configurable:true}),Object.defineProperty(t.prototype,Bf,{value:true,writable:false,enumerable:false,configurable:false});},Nf=t=>Mi(t)&&Bf in t,Bf=Symbol("isExecaError"),Mi=t=>Object.prototype.toString.call(t)==="[object Error]",Or=class extends Error{};jf(Or,Or.name);var Cr=class extends Error{};jf(Cr,Cr.name);var Uf=()=>{let t=Vf-Gf+1;return Array.from({length:t},_O)},_O=(t,e)=>({name:`SIGRT${e+1}`,number:Gf+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Gf=34,Vf=64;var Wf=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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 ko=()=>{let t=Uf();return [...Wf,...t].map(AO)},AO=({name:t,number:e,description:r,action:i,forced:n=false,standard:s})=>{let{signals:{[t]:o}}=constants,a=o!==void 0;return {name:t,number:a?o:e,description:r,supported:a,action:i,forced:n,standard:s}};var IO=()=>{let t=ko();return Object.fromEntries(t.map($O))},$O=({name:t,number:e,description:r,supported:i,action:n,forced:s,standard:o})=>[t,{name:t,number:e,description:r,supported:i,action:n,forced:s,standard:o}],Hf=IO(),MO=()=>{let t=ko(),e=65,r=Array.from({length:e},(i,n)=>RO(n,t));return Object.assign({},...r)},RO=(t,e)=>{let r=FO(t,e);if(r===void 0)return {};let{name:i,description:n,supported:s,action:o,forced:a,standard:c}=r;return {[t]:{name:i,number:t,description:n,supported:s,action:o,forced:a,standard:c}}},FO=(t,e)=>{let r=e.find(({name:i})=>constants.signals[i]===t);return r!==void 0?r:e.find(i=>i.number===t)};MO();var Yf=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return Kf(t,e)},Jf=t=>t===0?t:Kf(t,"`subprocess.kill()`'s argument"),Kf=(t,e)=>{if(Number.isInteger(t))return LO(t,e);if(typeof t=="string")return jO(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
139
|
-
${Do()}`)},LO=(t,e)=>{if(zf.has(t))return zf.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
140
|
-
${Do()}`)},qO=()=>new Map(Object.entries(constants.signals).reverse().map(([t,e])=>[e,t])),zf=qO(),jO=(t,e)=>{if(t in constants.signals)return t;throw t.toUpperCase()in constants.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
141
|
-
${Do()}`)},Do=()=>`Available signal names: ${NO()}.
|
|
142
|
-
Available signal numbers: ${BO()}.`,NO=()=>Object.keys(constants.signals).sort().map(t=>`'${t}'`).join(", "),BO=()=>[...new Set(Object.values(constants.signals).sort((t,e)=>t-e))].join(", "),Ri=t=>Hf[t].description;var Zf=t=>{if(t===false)return t;if(t===true)return GO;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},GO=1e3*5,Xf=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:i,context:n,controller:s},o,a)=>{let{signal:c,error:u}=VO(o,a,r);WO(u,i);let l=t(c);return HO({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:l,context:n,controller:s}),l},VO=(t,e,r)=>{let[i=r,n]=Mi(t)?[void 0,t]:[t,e];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Mi(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return {signal:Jf(i),error:n}},WO=(t,e)=>{t!==void 0&&e.reject(t);},HO=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:i,killResult:n,context:s,controller:o})=>{e===i&&n&&_o({kill:t,forceKillAfterDelay:r,context:s,controllerSignal:o.signal});},_o=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:i})=>{if(e!==false)try{await setTimeout$1(e,void 0,{signal:i}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0);}catch{}};var Fi=async(t,e)=>{t.aborted||await once(t,"abort",{signal:e});};var Qf=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},em=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:i,controller:n})=>e===void 0||r?[]:[YO(t,e,i,n)],YO=async(t,e,r,{signal:i})=>{throw await Fi(e,i),r.terminationReason??="cancel",t.kill(),e.reason};var Vt=({methodName:t,isSubprocess:e,ipc:r,isConnected:i})=>{JO(t,e,r),To(t,e,i);},JO=(t,e,r)=>{if(!r)throw new Error(`${me(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},To=(t,e,r)=>{if(!r)throw new Error(`${me(t,e)} cannot be used: the ${st(e)} has already exited or disconnected.`)},tm=t=>{throw new Error(`${me("getOneMessage",t)} could not complete: the ${st(t)} exited or disconnected.`)},rm=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} is sending a message too, instead of listening to incoming messages.
|
|
143
|
-
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
144
|
-
|
|
145
|
-
const [receivedMessage] = await Promise.all([
|
|
146
|
-
${me("getOneMessage",t)},
|
|
147
|
-
${me("sendMessage",t,"message, {strict: true}")},
|
|
148
|
-
]);`)},Li=(t,e)=>new Error(`${me("sendMessage",e)} failed when sending an acknowledgment response to the ${st(e)}.`,{cause:t}),im=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} is not listening to incoming messages.`)},nm=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} exited without listening to incoming messages.`)},sm=()=>new Error(`\`cancelSignal\` aborted: the ${st(true)} disconnected.`),om=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},am=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${me(e,r)} cannot be used: the ${st(r)} is disconnecting.`,{cause:t})},cm=({error:t,methodName:e,isSubprocess:r,message:i})=>{if(KO(t))throw new Error(`${me(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:t})},KO=({code:t,message:e})=>ZO.has(t)||XO.some(r=>e.includes(r)),ZO=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),XO=["could not be cloned","circular structure","call stack size exceeded"],me=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${QO(e)}${t}(${r})`,QO=t=>t?"":"subprocess.",st=t=>t?"parent process":"subprocess",Wt=t=>{t.connected&&t.disconnect();};var ke=()=>{let t={},e=new Promise((r,i)=>{Object.assign(t,{resolve:r,reject:i});});return Object.assign(e,t)};var ji=(t,e="stdin")=>{let{options:i,fileDescriptors:n}=De.get(t),s=lm(n,e,true),o=t.stdio[s];if(o===null)throw new TypeError(um(s,e,i,true));return o},Ht=(t,e="stdout")=>{let{options:i,fileDescriptors:n}=De.get(t),s=lm(n,e,false),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(um(s,e,i,false));return o},De=new WeakMap,lm=(t,e,r)=>{let i=eC(e,r);return tC(i,e,r,t),i},eC=(t,e)=>{let r=ho(t);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Dr(e)}" must not be "${t}".
|
|
149
|
-
It must be ${i} or "fd3", "fd4" (and so on).
|
|
150
|
-
It is optional and defaults to "${n}".`)},tC=(t,e,r,i)=>{let n=i[dm(t)];if(n===void 0)throw new TypeError(`"${Dr(r)}" must not be ${e}. That file descriptor does not exist.
|
|
151
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${Dr(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${Dr(r)}" must not be ${e}. It must be a writable stream, not readable.`)},um=(t,e,r,i)=>{if(t==="all"&&!r.all)return `The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:s}=rC(t,r);return `The "${n}: ${qi(s)}" option is incompatible with using "${Dr(i)}: ${qi(e)}".
|
|
152
|
-
Please set this option with "pipe" instead.`},rC=(t,{stdin:e,stdout:r,stderr:i,stdio:n})=>{let s=dm(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${s}]`,optionValue:n[s]}},dm=t=>t==="all"?1:t,Dr=t=>t?"to":"from",qi=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";var yt=(t,e,r)=>{let i=t.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(t.setMaxListeners(i+e),addAbortListener(r,()=>{t.setMaxListeners(t.getMaxListeners()-e);}));};var Ni=(t,e)=>{e&&Ao(t);},Ao=t=>{t.refCounted();},Bi=(t,e)=>{e&&Po(t);},Po=t=>{t.unrefCounted();},hm=(t,e)=>{e&&(Po(t),Po(t));},pm=(t,e)=>{e&&(Ao(t),Ao(t));};var fm=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i},n)=>{if(ym(n)||wm(n))return;Ui.has(t)||Ui.set(t,[]);let s=Ui.get(t);if(s.push(n),!(s.length>1))for(;s.length>0;){await bm(t,i,n),await scheduler.yield();let o=await gm({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i});s.shift(),i.emit("message",o),i.emit("message:done");}},mm=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Io();let s=Ui.get(t);for(;s?.length>0;)await once(i,"message:done");t.removeListener("message",n),pm(e,r),i.connected=false,i.emit("disconnect");},Ui=new WeakMap;var ot=(t,e,r)=>{if(Gi.has(t))return Gi.get(t);let i=new EventEmitter;return i.connected=true,Gi.set(t,i),aC({ipcEmitter:i,anyProcess:t,channel:e,isSubprocess:r}),i},Gi=new WeakMap,aC=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:i})=>{let n=fm.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t});e.on("message",n),e.once("disconnect",mm.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t,boundOnMessage:n})),hm(r,i);},Vi=t=>{let e=Gi.get(t);return e===void 0?t.channel!==null:e.connected};var xm=({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let s=ot(t,e,r),o=zi(t,s);return {id:lC++,type:Hi,message:i,hasListeners:o}},lC=0n,Sm=(t,e)=>{if(!(e?.type!==Hi||e.hasListeners))for(let{id:r}of t)r!==void 0&&Wi[r].resolve({isDeadlock:true,hasListeners:false});},gm=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(t?.type!==Hi||!e.connected)return t;let{id:s,message:o}=t,a={id:s,type:Em,message:zi(e,n)};try{await Yi({anyProcess:e,channel:r,isSubprocess:i,ipc:!0},a);}catch(c){n.emit("strict:error",c);}return o},ym=t=>{if(t?.type!==Em)return false;let{id:e,message:r}=t;return Wi[e]?.resolve({isDeadlock:false,hasListeners:r}),true},vm=async(t,e,r)=>{if(t?.type!==Hi)return;let i=ke();Wi[t.id]=i;let n=new AbortController;try{let{isDeadlock:s,hasListeners:o}=await Promise.race([i,uC(e,r,n)]);s&&rm(r),o||im(r);}finally{n.abort(),delete Wi[t.id];}},Wi={},uC=async(t,e,{signal:r})=>{yt(t,1,r),await once(t,"disconnect",{signal:r}),nm(e);},Hi="execa:ipc:request",Em="execa:ipc:response";var Om=(t,e,r)=>{_r.has(t)||_r.set(t,new Set);let i=_r.get(t),n=ke(),s=r?e.id:void 0,o={onMessageSent:n,id:s};return i.add(o),{outgoingMessages:i,outgoingMessage:o}},Cm=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve();},bm=async(t,e,r)=>{for(;!zi(t,e)&&_r.get(t)?.size>0;){let i=[..._r.get(t)];Sm(i,r),await Promise.all(i.map(({onMessageSent:n})=>n));}},_r=new WeakMap,zi=(t,e)=>e.listenerCount("message")>dC(t),dC=t=>De.has(t)&&!Ve(De.get(t).options.buffer,"ipc")?1:0;var Yi=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},n,{strict:s=false}={})=>{let o="sendMessage";return Vt({methodName:o,isSubprocess:r,ipc:i,isConnected:t.connected}),pC({anyProcess:t,channel:e,methodName:o,isSubprocess:r,message:n,strict:s})},pC=async({anyProcess:t,channel:e,methodName:r,isSubprocess:i,message:n,strict:s})=>{let o=xm({anyProcess:t,channel:e,isSubprocess:i,message:n,strict:s}),a=Om(t,o,s);try{await Mo({anyProcess:t,methodName:r,isSubprocess:i,wrappedMessage:o,message:n});}catch(c){throw Wt(t),c}finally{Cm(a);}},Mo=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:i,message:n})=>{let s=fC(t);try{await Promise.all([vm(i,t,r),s(i)]);}catch(o){throw am({error:o,methodName:e,isSubprocess:r}),cm({error:o,methodName:e,isSubprocess:r,message:n}),o}},fC=t=>{if($o.has(t))return $o.get(t);let e=promisify(t.send.bind(t));return $o.set(t,e),e},$o=new WeakMap;var Dm=(t,e)=>{let r="cancelSignal";return To(r,false,t.connected),Mo({anyProcess:t,methodName:r,isSubprocess:false,wrappedMessage:{type:Tm,message:e},message:e})},_m=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>(await gC({anyProcess:t,channel:e,isSubprocess:r,ipc:i}),Ro.signal),gC=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>{if(!km){if(km=true,!i){om();return}if(e===null){Io();return}ot(t,e,r),await scheduler.yield();}},km=false,wm=t=>t?.type!==Tm?false:(Ro.abort(t.message),true),Tm="execa:ipc:cancel",Io=()=>{Ro.abort(sm());},Ro=new AbortController;var Am=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:i})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Pm=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:s})=>r?[yC({subprocess:t,cancelSignal:e,forceKillAfterDelay:i,context:n,controller:s})]:[],yC=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Fi(e,n);let s=bC(e);throw await Dm(t,s),_o({kill:t.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",e.reason},bC=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:false,configurable:true,writable:true}),e};var Im=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},$m=(t,e,r,i)=>e===0||e===void 0?[]:[xC(t,e,r,i)],xC=async(t,e,r,{signal:i})=>{throw await setTimeout$1(e,void 0,{signal:i}),r.terminationReason??="timeout",t.kill(),new fe};var Rm=({options:t})=>{if(t.node===false)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return {options:{...t,node:true}}},Fm=(t,e,{node:r=false,nodePath:i=execPath,nodeOptions:n=execArgv.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:o,...a})=>{if(o!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=jt(i,'The "nodePath" option'),u=ne.resolve(s,c),l={...a,nodePath:u,node:r,cwd:s};if(!r)return [t,e,l];if(ne.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return [u,[...n,t,...e],{ipc:true,...l,shell:false}]};var Lm=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");kC[r](t);}},OC=t=>{try{serialize(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},CC=t=>{try{JSON.stringify(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},kC={advanced:OC,json:CC},qm=async(t,e)=>{e!==void 0&&await t.sendMessage(e);};var Nm=({encoding:t})=>{if(Fo.has(t))return;let e=_C(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ji(t)}\`.
|
|
153
|
-
Please rename it to ${Ji(e)}.`);let r=[...Fo].map(i=>Ji(i)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Ji(t)}\`.
|
|
154
|
-
Please rename it to one of: ${r}.`)},DC=new Set(["utf8","utf16le"]),se=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Fo=new Set([...DC,...se]),_C=t=>{if(t===null)return "buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in jm)return jm[e];if(Fo.has(e))return e},jm={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ji=t=>typeof t=="string"?`"${t}"`:String(t);var Bm=(t=Um())=>{let e=jt(t,'The "cwd" option');return ne.resolve(e)},Um=()=>{try{return _.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
155
|
-
${t.message}`,t}},Gm=(t,e)=>{if(e===Um())return t;let r;try{r=statSync(e);}catch(i){return `The "cwd" option is invalid: ${e}.
|
|
156
|
-
${i.message}
|
|
157
|
-
${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
158
|
-
${t}`};var Ki=(t,e,r)=>{r.cwd=Bm(r.cwd);let[i,n,s]=Fm(t,e,r),{command:o,args:a,options:c}=Wm.default._parse(i,n,s),u=Tp(c),l=$C(u);return Im(l),Nm(l),Lm(l),Qf(l),Am(l),l.shell=ao(l.shell),l.env=MC(l),l.killSignal=Yf(l.killSignal),l.forceKillAfterDelay=Zf(l.forceKillAfterDelay),l.lines=l.lines.map((d,h)=>d&&!se.has(l.encoding)&&l.buffer[h]),_.platform==="win32"&&ne.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},$C=({extendEnv:t=true,preferLocal:e=false,cwd:r,localDir:i=r,encoding:n="utf8",reject:s=true,cleanup:o=true,all:a=false,windowsHide:c=true,killSignal:u="SIGTERM",forceKillAfterDelay:l=true,gracefulCancel:d=false,ipcInput:h,ipc:p=h!==void 0||d,serialization:g="advanced",...y})=>({...y,extendEnv:t,preferLocal:e,cwd:r,localDirectory:i,encoding:n,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:h,ipc:p,serialization:g}),MC=({env:t,extendEnv:e,preferLocal:r,node:i,localDirectory:n,nodePath:s})=>{let o=e?{..._.env,...t}:t;return r||i?Lf({env:o,cwd:n,execPath:s,preferLocal:r,addExecPath:i}):o};var Zi=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];function zt(t){if(typeof t=="string")return RC(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return FC(t)}var RC=t=>t.at(-1)===Hm?t.slice(0,t.at(-2)===zm?-2:-1):t,FC=t=>t.at(-1)===LC?t.subarray(0,t.at(-2)===qC?-2:-1):t,Hm=`
|
|
159
|
-
`,LC=Hm.codePointAt(0),zm="\r",qC=zm.codePointAt(0);function ge(t,{checkOpen:e=true}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function Lo(t,{checkOpen:e=true}={}){return ge(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function bt(t,{checkOpen:e=true}={}){return ge(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function qo(t,e){return Lo(t,e)&&bt(t,e)}var jC=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),jo=class{#t;#r;#e=false;#i=void 0;constructor(e,r){this.#t=e,this.#r=r;}next(){let e=()=>this.#s();return this.#i=this.#i?this.#i.then(e,e):e(),this.#i}return(e){let r=()=>this.#n(e);return this.#i?this.#i.then(r,r):r()}async#s(){if(this.#e)return {done:true,value:void 0};let e;try{e=await this.#t.read();}catch(r){throw this.#i=void 0,this.#e=true,this.#t.releaseLock(),r}return e.done&&(this.#i=void 0,this.#e=true,this.#t.releaseLock()),e}async#n(e){if(this.#e)return {done:true,value:e};if(this.#e=true,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:true,value:e}}return this.#t.releaseLock(),{done:true,value:e}}},No=Symbol();function Ym(){return this[No].next()}Object.defineProperty(Ym,"name",{value:"next"});function Jm(t){return this[No].return(t)}Object.defineProperty(Jm,"name",{value:"return"});var NC=Object.create(jC,{next:{enumerable:true,configurable:true,writable:true,value:Ym},return:{enumerable:true,configurable:true,writable:true,value:Jm}});function Bo({preventCancel:t=false}={}){let e=this.getReader(),r=new jo(e,t),i=Object.create(NC);return i[No]=r,i}var Km=t=>{if(bt(t,{checkOpen:false})&&Tr.on!==void 0)return UC(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(BC.call(t)==="[object ReadableStream]")return Bo.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:BC}=Object.prototype,UC=async function*(t){let e=new AbortController,r={};GC(t,e,r);try{for await(let[i]of Tr.on(t,"data",{signal:e.signal}))yield i;}catch(i){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw i}finally{t.destroy();}},GC=async(t,e,r)=>{try{await Tr.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1});}catch(i){r.error=i;}finally{e.abort();}},Tr={};var Yt=async(t,{init:e,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=Km(t),l=e();l.length=0;try{for await(let d of u){let h=WC(d),p=r[h](d,l);Qm({convertedChunk:p,state:l,getSize:i,truncateChunk:n,addChunk:s,maxBuffer:c});}return VC({state:l,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(l)}catch(d){let h=typeof d=="object"&&d!==null?d:new Error(d);throw h.bufferedData=a(l),h}},VC=({state:t,getSize:e,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:s})=>{let o=n(t);o!==void 0&&Qm({convertedChunk:o,state:t,getSize:e,truncateChunk:r,addChunk:i,maxBuffer:s});},Qm=({convertedChunk:t,state:e,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:s})=>{let o=r(t),a=e.length+o;if(a<=s){Zm(t,e,n,a);return}let c=i(t,s-e.length);throw c!==void 0&&Zm(c,e,n,s),new _e},Zm=(t,e,r,i)=>{e.contents=r(t,e,i),e.length=i;},WC=t=>{let e=typeof t;if(e==="string")return "string";if(e!=="object"||t===null)return "others";if(globalThis.Buffer?.isBuffer(t))return "buffer";let r=Xm.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&Xm.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Xm}=Object.prototype,_e=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded");}};var We=t=>t,Ar=()=>{},Xi=({contents:t})=>t,Qi=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},en=t=>t.length;async function tn(t,e){return Yt(t,JC,e)}var HC=()=>({contents:[]}),zC=()=>1,YC=(t,{contents:e})=>(e.push(t),e),JC={init:HC,convertChunk:{string:We,buffer:We,arrayBuffer:We,dataView:We,typedArray:We,others:We},getSize:zC,truncateChunk:Ar,addChunk:YC,getFinalChunk:Ar,finalize:Xi};async function rn(t,e){return Yt(t,nk,e)}var KC=()=>({contents:new ArrayBuffer(0)}),ZC=t=>XC.encode(t),XC=new TextEncoder,eg=t=>new Uint8Array(t),tg=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QC=(t,e)=>t.slice(0,e),ek=(t,{contents:e,length:r},i)=>{let n=ng()?rk(e,i):tk(e,i);return new Uint8Array(n).set(t,r),n},tk=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(ig(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},rk=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:ig(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},ig=t=>rg**Math.ceil(Math.log(t)/Math.log(rg)),rg=2,ik=({contents:t,length:e})=>ng()?t:t.slice(0,e),ng=()=>"resize"in ArrayBuffer.prototype,nk={init:KC,convertChunk:{string:ZC,buffer:eg,arrayBuffer:eg,dataView:tg,typedArray:tg,others:Qi},getSize:en,truncateChunk:QC,addChunk:ek,getFinalChunk:Ar,finalize:ik};async function sn(t,e){return Yt(t,lk,e)}var sk=()=>({contents:"",textDecoder:new TextDecoder}),nn=(t,{textDecoder:e})=>e.decode(t,{stream:true}),ok=(t,{contents:e})=>e+t,ak=(t,e)=>t.slice(0,e),ck=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},lk={init:sk,convertChunk:{string:We,buffer:nn,arrayBuffer:nn,dataView:nn,typedArray:nn,others:Qi},getSize:en,truncateChunk:ak,addChunk:ok,getFinalChunk:ck,finalize:Xi};Object.assign(Tr,{on:on$1,finished:finished});var sg=({error:t,stream:e,readableObjectMode:r,lines:i,encoding:n,fdNumber:s})=>{if(!(t instanceof _e))throw t;if(s==="all")return t;let o=hk(r,i,n);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},hk=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",og=(t,e,r)=>{if(e.length!==r)return;let i=new _e;throw i.maxBufferInfo={fdNumber:"ipc"},i},ag=(t,e)=>{let{streamName:r,threshold:i,unit:n}=pk(t,e);return `Command's ${r} was larger than ${i} ${n}`},pk=(t,e)=>{if(t?.maxBufferInfo===void 0)return {streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=t;delete t.maxBufferInfo;let n=Ve(e,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:Si(r),threshold:n,unit:i}},cg=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(i=>i!==null&&i.length>on(r)),lg=(t,e,r)=>{if(!e)return t;let i=on(r);return t.length>i?t.slice(0,i):t},on=([,t])=>t;var dg=({stdio:t,all:e,ipcOutput:r,originalError:i,signal:n,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:g,maxBuffer:y,timeout:w,cwd:b})=>{let S=i?.code,k=mk({originalError:i,timedOut:c,timeout:w,isMaxBuffer:d,maxBuffer:y,errorCode:S,signal:n,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:g}),$=yk(i,b),oe=$===void 0?"":`
|
|
160
|
-
${$}`,le=`${k}: ${a}${oe}`,Pe=e===void 0?[t[2],t[1]]:[e],be=[le,...Pe,...t.slice(3),r.map(x=>bk(x)).join(`
|
|
161
|
-
`)].map(x=>Er(zt(wk(x)))).filter(Boolean).join(`
|
|
162
|
-
|
|
163
|
-
`);return {originalMessage:$,shortMessage:le,message:be}},mk=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:h,killSignal:p})=>{let g=gk(d,h);return e?`Command timed out after ${r} milliseconds${g}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${g}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${g}`:i?`${ag(t,n)}${g}`:s!==void 0?`Command failed with ${s}${g}`:d?`Command was killed with ${p} (${Ri(p)})${g}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},gk=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",yk=(t,e)=>{if(t instanceof fe)return;let r=Nf(t)?t.originalMessage:String(t?.message??t),i=Er(Gm(r,e));return i===""?void 0:i},bk=t=>typeof t=="string"?t:inspect(t),wk=t=>Array.isArray(t)?t.map(e=>zt(ug(e))).filter(Boolean).join(`
|
|
164
|
-
`):ug(t),ug=t=>typeof t=="string"?t:B(t)?wi(t):"";var an=({command:t,escapedCommand:e,stdio:r,all:i,ipcOutput:n,options:{cwd:s},startTime:o})=>hg({command:t,escapedCommand:e,cwd:s,durationMs:go(o),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Jt=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:o})=>Pr({error:t,command:e,escapedCommand:r,startTime:s,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:o}),Pr=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:h,ipcOutput:p,options:{timeoutDuration:g,timeout:y=g,forceKillAfterDelay:w,killSignal:b,cwd:S,maxBuffer:k},isSync:$})=>{let{exitCode:oe,signal:le,signalDescription:Pe}=Sk(u,l),{originalMessage:be,shortMessage:x,message:D}=dg({stdio:d,all:h,ipcOutput:p,originalError:t,signal:le,signalDescription:Pe,exitCode:oe,escapedCommand:r,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:w,killSignal:b,maxBuffer:k,timeout:y,cwd:S}),O=qf(t,D,$);return Object.assign(O,xk({error:O,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:oe,signal:le,signalDescription:Pe,stdio:d,all:h,ipcOutput:p,cwd:S,originalMessage:be,shortMessage:x})),O},xk=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:h,all:p,ipcOutput:g,cwd:y,originalMessage:w,shortMessage:b})=>hg({shortMessage:b,originalMessage:w,command:e,escapedCommand:r,cwd:y,durationMs:go(i),failed:true,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:h[1],stderr:h[2],all:p,stdio:h,ipcOutput:g,pipedFrom:[]}),hg=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Sk=(t,e)=>{let r=t===null?void 0:t,i=e===null?void 0:e,n=i===void 0?void 0:Ri(e);return {exitCode:r,signal:i,signalDescription:n}};var pg=t=>Number.isFinite(t)?t:0;function vk(t){return {days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(pg(t*1e3)%1e3),nanoseconds:Math.trunc(pg(t*1e6)%1e3)}}function Ek(t){return {days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Uo(t){switch(typeof t){case "number":{if(Number.isFinite(t))return vk(t);break}case "bigint":return Ek(t)}throw new TypeError("Expected a finite number or bigint")}var Ok=t=>t===0||t===0n,Ck=(t,e)=>e===1||e===1n?t:`${t}s`,kk=1e-7,Dk=24n*60n*60n*1000n;function Go(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let i=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=false,e.formatSubMilliseconds=false,e.separateMilliseconds=false,e.verbose=false),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let n=[],s=(l,d)=>{let h=Math.floor(l*10**d+kk);return (Math.round(h)/10**d).toFixed(d)},o=(l,d,h,p)=>{if(!((n.length===0||!e.colonNotation)&&Ok(l)&&!(e.colonNotation&&h==="m"))){if(p??=String(l),e.colonNotation){let g=p.includes(".")?p.split(".")[0].length:p.length,y=n.length>0?2:1;p="0".repeat(Math.max(0,y-g))+p;}else p+=e.verbose?" "+Ck(d,l):h;n.push(p);}},a=Uo(t),c=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(c,"day","d"):(o(c/365n,"year","y"),o(c%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),d=Number(a.milliseconds),h=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(h,"microsecond","\xB5s"),o(p,"nanosecond","ns");else {let g=d+h/1e3+p/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,w=g>=1?Math.round(g):Math.ceil(g),b=y?g.toFixed(y):w;o(Number.parseFloat(b),"millisecond","ms",b);}}else {let l=(r?Number(t%Dk):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=s(l,d),p=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p);}if(n.length===0)return i+"0"+(e.verbose?" milliseconds":"ms");let u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(n=n.slice(0,Math.max(e.unitCount,1))),i+n.join(u)}var fg=(t,e)=>{t.failed&&Ce({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t});};var mg=(t,e)=>{Nt(e)&&(fg(t,e),_k(t,e));},_k=(t,e)=>{let r=`(done in ${Go(t.durationMs)})`;Ce({type:"duration",verboseMessage:r,verboseInfo:e,result:t});};var Kt=(t,e,{reject:r})=>{if(mg(t,e),t.failed&&r)throw t;return t};var bg=(t,e)=>wt(t)?"asyncGenerator":Sg(t)?"generator":cn(t)?"fileUrl":$k(t)?"filePath":Fk(t)?"webStream":ge(t,{checkOpen:false})?"native":B(t)?"uint8Array":Lk(t)?"asyncIterable":qk(t)?"iterable":Ho(t)?wg({},e):Ik(t)?Tk(t,e):"native",Tk=(t,e)=>qo(t.transform,{checkOpen:false})?Ak(t,e):Ho(t.transform)?wg(t,e):Pk(t,e),Ak=(t,e)=>(xg(t,e,"Duplex stream"),"duplex"),wg=(t,e)=>(xg(t,e,"web TransformStream"),"webTransform"),xg=({final:t,binary:e,objectMode:r},i,n)=>{gg(t,`${i}.final`,n),gg(e,`${i}.binary`,n),Vo(r,`${i}.objectMode`);},gg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Pk=({transform:t,final:e,binary:r,objectMode:i},n)=>{if(t!==void 0&&!yg(t))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(qo(e,{checkOpen:false}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(Ho(e))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!yg(e))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return Vo(r,`${n}.binary`),Vo(i,`${n}.objectMode`),wt(t)||wt(e)?"asyncGenerator":"generator"},Vo=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},yg=t=>wt(t)||Sg(t),wt=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Sg=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Ik=t=>N(t)&&(t.transform!==void 0||t.final!==void 0),cn=t=>Object.prototype.toString.call(t)==="[object URL]",vg=t=>cn(t)&&t.protocol!=="file:",$k=t=>N(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Mk.has(e))&&Wo(t.file),Mk=new Set(["file","append"]),Wo=t=>typeof t=="string",Eg=(t,e)=>t==="native"&&typeof e=="string"&&!Rk.has(e),Rk=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Og=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",ln=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Fk=t=>Og(t)||ln(t),Ho=t=>Og(t?.readable)&&ln(t?.writable),Lk=t=>Cg(t)&&typeof t[Symbol.asyncIterator]=="function",qk=t=>Cg(t)&&typeof t[Symbol.iterator]=="function",Cg=t=>typeof t=="object"&&t!==null,ce=new Set(["generator","asyncGenerator","duplex","webTransform"]),un=new Set(["fileUrl","filePath","fileNumber"]),zo=new Set(["fileUrl","filePath"]),kg=new Set([...zo,"webStream","nodeStream"]),Dg=new Set(["webTransform","duplex"]),at={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 Yo=(t,e,r,i)=>i==="output"?jk(t,e,r):Nk(t,e,r),jk=(t,e,r)=>{let i=e!==0&&r[e-1].value.readableObjectMode;return {writableObjectMode:i,readableObjectMode:t??i}},Nk=(t,e,r)=>{let i=e===0?t===true:r[e-1].value.readableObjectMode,n=e!==r.length-1&&(t??i);return {writableObjectMode:i,readableObjectMode:n}},_g=(t,e)=>{let r=t.findLast(({type:i})=>ce.has(i));return r===void 0?false:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Tg=(t,e,r,i)=>[...t.filter(({type:n})=>!ce.has(n)),...Bk(t,e,r,i)],Bk=(t,e,r,{encoding:i})=>{let n=t.filter(({type:o})=>ce.has(o)),s=Array.from({length:n.length});for(let[o,a]of Object.entries(n))s[o]=Uk({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:r,encoding:i});return Hk(s,r)},Uk=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:i,optionName:n,direction:s,encoding:o})=>e==="duplex"?Gk({stdioItem:t,optionName:n}):e==="webTransform"?Vk({stdioItem:t,index:r,newTransforms:i,direction:s}):Wk({stdioItem:t,index:r,newTransforms:i,direction:s,encoding:o}),Gk=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:s})=>{if(n&&!i)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return {...t,value:{transform:e,writableObjectMode:r,readableObjectMode:i}}},Vk=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n})=>{let{transform:s,objectMode:o}=N(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=Yo(o,r,i,n);return {...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},Wk=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n,encoding:s})=>{let{transform:o,final:a,binary:c=false,preserveNewlines:u=false,objectMode:l}=N(e)?e:{transform:e},d=c||se.has(s),{writableObjectMode:h,readableObjectMode:p}=Yo(l,r,i,n);return {...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:h,readableObjectMode:p}}},Hk=(t,e)=>e==="input"?t.reverse():t;var Ag=(t,e,r)=>{let i=t.map(n=>zk(n,e));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??Kk},zk=({type:t,value:e},r)=>Yk[r]??Pg[t](e),Yk=["input","output","output"],Zt=()=>{},Ko=()=>"input",Pg={generator:Zt,asyncGenerator:Zt,fileUrl:Zt,filePath:Zt,iterable:Ko,asyncIterable:Ko,uint8Array:Ko,webStream:t=>ln(t)?"output":"input",nodeStream(t){return bt(t,{checkOpen:false})?Lo(t,{checkOpen:false})?void 0:"input":"output"},webTransform:Zt,duplex:Zt,native(t){let e=Jk(t);if(e!==void 0)return e;if(ge(t,{checkOpen:false}))return Pg.nodeStream(t)}},Jk=t=>{if([0,_.stdin].includes(t))return "input";if([1,2,_.stdout,_.stderr].includes(t))return "output"},Kk="output";var Ig=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var $g=({stdio:t,ipc:e,buffer:r,...i},n,s)=>{let o=Zk(t,i).map((a,c)=>Mg(a,c));return s?Qk(o,r,n):Ig(o,e)},Zk=(t,e)=>{if(t===void 0)return ae.map(i=>e[i]);if(Xk(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ae.map(i=>`\`${i}\``).join(", ")}`);if(typeof t=="string")return [t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,ae.length);return Array.from({length:r},(i,n)=>t[n])},Xk=t=>ae.some(e=>t[e]!==void 0),Mg=(t,e)=>Array.isArray(t)?t.map(r=>Mg(r,e)):t??(e>=ae.length?"ignore":"pipe"),Qk=(t,e,r)=>t.map((i,n)=>!e[n]&&n!==0&&!Bt(r,n)&&eD(i)?"ignore":i),eD=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var Fg=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:i,direction:n,isSync:s})=>!r||e!=="native"?t:s?iD({stdioItem:t,fdNumber:i,direction:n}):oD({stdioItem:t,fdNumber:i}),iD=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i,direction:n})=>{let s=nD({value:e,optionName:r,fdNumber:i,direction:n});if(s!==void 0)return s;if(ge(e,{checkOpen:false}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},nD=({value:t,optionName:e,fdNumber:r,direction:i})=>{let n=sD(t,r);if(n!==void 0){if(i==="output")return {type:"fileNumber",value:n,optionName:e};if(RE.isatty(n))throw new TypeError(`The \`${e}: ${qi(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return {type:"uint8Array",value:Ge(readFileSync(n)),optionName:e}}},sD=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=xi.indexOf(t);if(r!==-1)return r},oD=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i})=>e==="inherit"?{type:"nodeStream",value:Rg(i,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:Rg(e,e,r),optionName:r}:ge(e,{checkOpen:false})?{type:"nodeStream",value:e,optionName:r}:t,Rg=(t,e,r)=>{let i=xi[t];if(i===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return i};var Lg=({input:t,inputFile:e},r)=>r===0?[...aD(t),...lD(e)]:[],aD=t=>t===void 0?[]:[{type:cD(t),value:t,optionName:"input"}],cD=t=>{if(bt(t,{checkOpen:false}))return "nodeStream";if(typeof t=="string")return "string";if(B(t))return "uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lD=t=>t===void 0?[]:[{...uD(t),optionName:"inputFile"}],uD=t=>{if(cn(t))return {type:"fileUrl",value:t};if(Wo(t))return {type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var qg=t=>t.filter((e,r)=>t.every((i,n)=>e.value!==i.value||r>=n||e.type==="generator"||e.type==="asyncGenerator")),jg=({stdioItem:{type:t,value:e,optionName:r},direction:i,fileDescriptors:n,isSync:s})=>{let o=dD(n,t);if(o.length!==0){if(s){hD({otherStdioItems:o,type:t,value:e,optionName:r,direction:i});return}if(kg.has(t))return Ng({otherStdioItems:o,type:t,value:e,optionName:r,direction:i});Dg.has(t)&&fD({otherStdioItems:o,type:t,value:e,optionName:r});}},dD=(t,e)=>t.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===e).map((n=>({...n,direction:r})))),hD=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{zo.has(e)&&Ng({otherStdioItems:t,type:e,value:r,optionName:i,direction:n});},Ng=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{let s=t.filter(a=>pD(a,r));if(s.length===0)return;let o=s.find(a=>a.direction!==n);return Bg(o,i,e),n==="output"?s[0].stream:void 0},pD=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,fD=({otherStdioItems:t,type:e,value:r,optionName:i})=>{let n=t.find(({value:{transform:s}})=>s===r.transform);Bg(n,i,e);},Bg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${at[r]} that is the same.`)};var dn=(t,e,r,i)=>{let s=$g(e,r,i).map((a,c)=>mD({stdioOption:a,fdNumber:c,options:e,isSync:i})),o=ED({initialFileDescriptors:s,addProperties:t,options:e,isSync:i});return e.stdio=o.map(({stdioItems:a})=>kD(a)),o},mD=({stdioOption:t,fdNumber:e,options:r,isSync:i})=>{let n=Si(e),{stdioItems:s,isStdioArray:o}=gD({stdioOption:t,fdNumber:e,options:r,optionName:n}),a=Ag(s,e,n),c=s.map(d=>Fg({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:i})),u=Tg(c,n,a,r),l=_g(u,a);return vD(u,l),{direction:a,objectMode:l,stdioItems:u}},gD=({stdioOption:t,fdNumber:e,options:r,optionName:i})=>{let s=[...(Array.isArray(t)?t:[t]).map(c=>yD(c,i)),...Lg(r,e)],o=qg(s),a=o.length>1;return bD(o,a,i),xD(o),{stdioItems:o,isStdioArray:a}},yD=(t,e)=>({type:bg(t,e),value:t,optionName:e}),bD=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:i,optionName:n}of t)if(wD.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},wD=new Set(["ignore","ipc"]),xD=t=>{for(let e of t)SD(e);},SD=({type:t,value:e,optionName:r})=>{if(vg(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
165
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Eg(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},vD=(t,e)=>{if(!e)return;let r=t.find(({type:i})=>un.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},ED=({initialFileDescriptors:t,addProperties:e,options:r,isSync:i})=>{let n=[];try{for(let s of t)n.push(OD({fileDescriptor:s,fileDescriptors:n,addProperties:e,options:r,isSync:i}));return n}catch(s){throw Zo(n),s}},OD=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:i,addProperties:n,options:s,isSync:o})=>{let a=r.map(c=>CD({stdioItem:c,addProperties:n,direction:t,options:s,fileDescriptors:i,isSync:o}));return {direction:t,objectMode:e,stdioItems:a}},CD=({stdioItem:t,addProperties:e,direction:r,options:i,fileDescriptors:n,isSync:s})=>{let o=jg({stdioItem:t,direction:r,fileDescriptors:n,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[r][t.type](t,i)}},Zo=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!pe(r)&&r.destroy();},kD=t=>{if(t.length>1)return t.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var Vg=(t,e)=>dn(_D,t,e,true),Te=({type:t,optionName:e})=>{Wg(e,at[t]);},DD=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Wg(t,`"${e}"`),{}),Wg=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Gg={generator(){},asyncGenerator:Te,webStream:Te,nodeStream:Te,webTransform:Te,duplex:Te,asyncIterable:Te,native:DD},_D={input:{...Gg,fileUrl:({value:t})=>({contents:[Ge(readFileSync(t))]}),filePath:({value:{file:t}})=>({contents:[Ge(readFileSync(t))]}),fileNumber:Te,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Gg,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Te,string:Te,uint8Array:Te}};var He=(t,{stripFinalNewline:e},r)=>Xo(e,r)&&t!==void 0&&!Array.isArray(t)?zt(t):t,Xo=(t,e)=>e==="all"?t[1]||t[2]:t[e];var hn=(t,e,r,i)=>t||r?void 0:zg(e,i),ea=(t,e,r)=>r?t.flatMap(i=>Hg(i,e)):Hg(t,e),Hg=(t,e)=>{let{transform:r,final:i}=zg(e,{});return [...r(t),...i()]},zg=(t,e)=>(e.previousChunks="",{transform:TD.bind(void 0,e,t),final:PD.bind(void 0,e)}),TD=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=t,n=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
|
|
166
|
-
`){let o=AD(r,s,e,t),a=r.slice(n+1,s+1-o);i.length>0&&(a=Qo(i,a),i=""),yield a,n=s;}n!==r.length-1&&(i=Qo(i,r.slice(n+1))),t.previousChunks=i;},AD=(t,e,r,i)=>r?0:(i.isWindowsNewline=e!==0&&t[e-1]==="\r",i.isWindowsNewline?2:1),PD=function*({previousChunks:t}){t.length>0&&(yield t);},Yg=({binary:t,preserveNewlines:e,readableObjectMode:r,state:i})=>t||e||r?void 0:{transform:ID.bind(void 0,i)},ID=function*({isWindowsNewline:t=false},e){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:s}=typeof e=="string"?$D:RD;if(e.at(-1)===n){yield e;return}yield s(e,t?i:r);},Qo=(t,e)=>`${t}${e}`,$D={windowsNewline:`\r
|
|
167
|
-
`,unixNewline:`
|
|
168
|
-
`,LF:`
|
|
169
|
-
`,concatBytes:Qo},MD=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},RD={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:MD};var Jg=(t,e)=>t?void 0:LD.bind(void 0,e),LD=function*(t,e){if(typeof e!="string"&&!B(e)&&!Buffer$1.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e;},Kg=(t,e)=>t?qD.bind(void 0,e):jD.bind(void 0,e),qD=function*(t,e){Zg(t,e),yield e;},jD=function*(t,e){if(Zg(t,e),typeof e!="string"&&!B(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e;},Zg=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
170
|
-
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
171
|
-
if (condition) { yield value; }`)};var pn=(t,e,r)=>{if(r)return;if(t)return {transform:UD.bind(void 0,new TextEncoder)};let i=new StringDecoder(e);return {transform:GD.bind(void 0,i),final:VD.bind(void 0,i)}},UD=function*(t,e){Buffer$1.isBuffer(e)?yield Ge(e):typeof e=="string"?yield t.encode(e):yield e;},GD=function*(t,e){yield B(e)?t.write(e):e;},VD=function*(t){let e=t.end();e!==""&&(yield e);};var ta=callbackify(async(t,e,r,i)=>{e.currentIterable=t(...r);try{for await(let n of e.currentIterable)i.push(n);}finally{delete e.currentIterable;}}),fn=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=HD}=e[r];for await(let n of i(t))yield*fn(n,e,r+1);},Qg=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*WD(r,Number(e),t);},WD=async function*(t,e,r){if(t!==void 0)for await(let i of t())yield*fn(i,r,e+1);},ey=callbackify(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),HD=function*(t){yield t;};var ra=(t,e,r,i)=>{try{for(let n of t(...e))r.push(n);i();}catch(n){i(n);}},ty=(t,e)=>[...e.flatMap(r=>[...xt(r,t,0)]),...Ir(t)],xt=function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=YD}=e[r];for(let n of i(t))yield*xt(n,e,r+1);},Ir=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zD(r,Number(e),t);},zD=function*(t,e,r){if(t!==void 0)for(let i of t())yield*xt(i,r,e+1);},YD=function*(t){yield t;};var ia=({value:t,value:{transform:e,final:r,writableObjectMode:i,readableObjectMode:n},optionName:s},{encoding:o})=>{let a={},c=iy(t,o,s),u=wt(e),l=wt(r),d=u?ta.bind(void 0,fn,a):ra.bind(void 0,xt),h=u||l?ta.bind(void 0,Qg,a):ra.bind(void 0,Ir),p=u||l?ey.bind(void 0,a):void 0;return {stream:new Transform({writableObjectMode:i,writableHighWaterMark:getDefaultHighWaterMark(i),readableObjectMode:n,readableHighWaterMark:getDefaultHighWaterMark(n),transform(y,w,b){d([y,c,0],this,b);},flush(y){h([c],this,y);},destroy:p})}},mn=(t,e,r,i)=>{let n=e.filter(({type:o})=>o==="generator"),s=i?n.reverse():n;for(let{value:o,optionName:a}of s){let c=iy(o,r,a);t=ty(c,t);}return t},iy=({transform:t,final:e,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:s},o,a)=>{let c={};return [{transform:Jg(i,a)},pn(r,o,i),hn(r,s,i,c),{transform:t,final:e},{transform:Kg(n,a)},Yg({binary:r,preserveNewlines:s,readableObjectMode:n,state:c})].filter(Boolean)};var ny=(t,e)=>{for(let r of KD(t))ZD(t,r,e);},KD=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ZD=(t,e,r)=>{let{stdioItems:i}=t[e],n=i.filter(({contents:a})=>a!==void 0);if(n.length===0)return;if(e!==0){let[{type:a,optionName:c}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${at[a]} with synchronous methods.`)}let o=n.map(({contents:a})=>a).map(a=>XD(a,i));r.input=vr(o);},XD=(t,e)=>{let r=mn(t,e,"utf8",true);return QD(r),vr(r)},QD=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var gn=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:i})=>i!=="all"&&Bt(r,i)&&!se.has(e)&&e_(i)&&(t.some(({type:n,value:s})=>n==="native"&&t_.has(s))||t.every(({type:n})=>ce.has(n))),e_=t=>t===1||t===2,t_=new Set(["pipe","overlapped"]),sy=async(t,e,r,i)=>{for await(let n of t)r_(e)||ay(n,r,i);},oy=(t,e,r)=>{for(let i of t)ay(i,e,r);},r_=t=>t._readableState.pipes.length>0,ay=(t,e,r)=>{let i=Di(t);Ce({type:"output",verboseMessage:i,fdNumber:e,verboseInfo:r});};var cy=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(e===null)return {output:Array.from({length:3})};let s={},o=new Set([]);return {output:e.map((c,u)=>s_({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:i,verboseInfo:n},r)),...s}},s_=({result:t,fileDescriptors:e,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;let h=lg(t,s,d),p=Ge(h),{stdioItems:g,objectMode:y}=e[r],w=o_([p],g,c,i),{serializedResult:b,finalResult:S=b}=a_({chunks:w,objectMode:y,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});c_({serializedResult:b,fdNumber:r,state:i,verboseInfo:o,encoding:c,stdioItems:g,objectMode:y});let k=a[r]?S:void 0;try{return i.error===void 0&&l_(b,g,n),k}catch($){return i.error=$,k}},o_=(t,e,r,i)=>{try{return mn(t,e,r,!1)}catch(n){return i.error=n,t}},a_=({chunks:t,objectMode:e,encoding:r,lines:i,stripFinalNewline:n,fdNumber:s})=>{if(e)return {serializedResult:t};if(r==="buffer")return {serializedResult:vr(t)};let o=vp(t,r);return i[s]?{serializedResult:o,finalResult:ea(o,!n[s],e)}:{serializedResult:o}},c_=({serializedResult:t,fdNumber:e,state:r,verboseInfo:i,encoding:n,stdioItems:s,objectMode:o})=>{if(!gn({stdioItems:s,encoding:n,verboseInfo:i,fdNumber:e}))return;let a=ea(t,false,o);try{oy(a,e,i);}catch(c){r.error??=c;}},l_=(t,e,r)=>{for(let{path:i,append:n}of e.filter(({type:s})=>un.has(s))){let s=typeof i=="string"?i:i.toString();n||r.has(s)?appendFileSync(i,t):(r.add(s),writeFileSync(i,t));}};var ly=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,He(e,r,"all")]:Array.isArray(e)?[He(t,r,"all"),...e]:B(t)&&B(e)?co([t,e]):`${t}${e}`};var uy=async(t,e)=>{let[r,i]=await u_(t);return e.isForcefullyTerminated??=false,[r,i]},u_=async t=>{let[e,r]=await Promise.allSettled([once(t,"spawn"),once(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?dy(t):r.value},dy=async t=>{try{return await once(t,"exit")}catch{return dy(t)}},hy=async t=>{let[e,r]=await t;if(!d_(e,r)&&sa(e,r))throw new fe;return [e,r]},d_=(t,e)=>t===void 0&&e===void 0,sa=(t,e)=>t!==0||e!==null;var py=({error:t,status:e,signal:r,output:i},{maxBuffer:n})=>{let s=h_(t,e,r),o=s?.code==="ETIMEDOUT",a=cg(s,i,n);return {resultError:s,exitCode:e,signal:r,timedOut:o,isMaxBuffer:a}},h_=(t,e,r)=>t!==void 0?t:sa(e,r)?new fe:void 0;var fy=(t,e,r)=>{let{file:i,commandArguments:n,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=f_(t,e,r),d=y_({file:i,commandArguments:n,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return Kt(d,c,u)},f_=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:o}=Ti(t,e,r),a=m_(r),{file:c,commandArguments:u,options:l}=Ki(t,e,a);g_(l);let d=Vg(l,o);return {file:c,commandArguments:u,command:i,escapedCommand:n,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},m_=t=>t.node&&!t.ipc?{...t,ipc:false}:t,g_=({ipc:t,ipcInput:e,detached:r,cancelSignal:i})=>{e&&yn("ipcInput"),t&&yn("ipc: true"),r&&yn("detached: true"),i&&yn("cancelSignal");},yn=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},y_=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,verboseInfo:s,fileDescriptors:o,startTime:a})=>{let c=b_({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:o,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:d,timedOut:h,isMaxBuffer:p}=py(c,r),{output:g,error:y=u}=cy({fileDescriptors:o,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:s}),w=g.map((S,k)=>He(S,r,k)),b=He(ly(g,r),r,"all");return x_({error:y,exitCode:l,signal:d,timedOut:h,isMaxBuffer:p,stdio:w,all:b,options:r,command:i,escapedCommand:n,startTime:a})},b_=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:o})=>{try{ny(s,r);let a=w_(r);return spawnSync(...Zi(t,e,a))}catch(a){return Jt({error:a,command:i,escapedCommand:n,fileDescriptors:s,options:r,startTime:o,isSync:true})}},w_=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:on(e)}),x_=({error:t,exitCode:e,signal:r,timedOut:i,isMaxBuffer:n,stdio:s,all:o,options:a,command:c,escapedCommand:u,startTime:l})=>t===void 0?an({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):Pr({error:t,command:c,escapedCommand:u,timedOut:i,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:n,isForcefullyTerminated:false,exitCode:e,signal:r,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:true});var my=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true,filter:s}={})=>(Vt({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:Vi(t)}),v_({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:n})),v_=async({anyProcess:t,channel:e,isSubprocess:r,filter:i,reference:n})=>{Ni(e,n);let s=ot(t,e,r),o=new AbortController;try{return await Promise.race([E_(s,i,o),O_(s,r,o),C_(s,r,o)])}catch(a){throw Wt(t),a}finally{o.abort(),Bi(e,n);}},E_=async(t,e,{signal:r})=>{if(e===void 0){let[i]=await once(t,"message",{signal:r});return i}for await(let[i]of on$1(t,"message",{signal:r}))if(e(i))return i},O_=async(t,e,{signal:r})=>{await once(t,"disconnect",{signal:r}),tm(e);},C_=async(t,e,{signal:r})=>{let[i]=await once(t,"strict:error",{signal:r});throw Li(i,e)};var by=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true}={})=>aa({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),aa=({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:n,reference:s})=>{Vt({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:Vi(t)}),Ni(e,s);let o=ot(t,e,r),a=new AbortController,c={};return D_(t,o,a),__({ipcEmitter:o,isSubprocess:r,controller:a,state:c}),T_({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:r,shouldAwait:n,controller:a,state:c,reference:s})},D_=async(t,e,r)=>{try{await once(e,"disconnect",{signal:r.signal}),r.abort();}catch{}},__=async({ipcEmitter:t,isSubprocess:e,controller:r,state:i})=>{try{let[n]=await once(t,"strict:error",{signal:r.signal});i.error=Li(n,e),r.abort();}catch{}},T_=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:s,state:o,reference:a}){try{for await(let[c]of on$1(r,"message",{signal:s.signal}))gy(o),yield c;}catch{gy(o);}finally{s.abort(),Bi(e,a),i||Wt(t),n&&await t;}},gy=({error:t})=>{if(t)throw t};var xy=(t,{ipc:e})=>{Object.assign(t,vy(t,false,e));},Sy=()=>{let t=_,e=true,r=_.channel!==void 0;return {...vy(t,e,r),getCancelSignal:_m.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},vy=(t,e,r)=>({sendMessage:Yi.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:my.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:by.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var Ey=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,verboseInfo:o})=>{Zo(i);let a=new ChildProcess;R_(a,i),Object.assign(a,{readable:F_,writable:L_,duplex:q_});let c=Jt({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:false}),u=j_(c,o,n);return {subprocess:a,promise:u}},R_=(t,e)=>{let r=$r(),i=$r(),n=$r(),s=Array.from({length:e.length-3},$r),o=$r(),a=[r,i,n,...s];Object.assign(t,{stdin:r,stdout:i,stderr:n,all:o,stdio:a});},$r=()=>{let t=new PassThrough;return t.end(),t},F_=()=>new Readable({read(){}}),L_=()=>new Writable({write(){}}),q_=()=>new Duplex({read(){},write(){}}),j_=async(t,e,r)=>Kt(t,e,r);var Dy=(t,e)=>dn(G_,t,e,false),Rr=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${at[t]}.`)},ky={fileNumber:Rr,generator:ia,asyncGenerator:ia,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let i=e||r;return {stream:Duplex.fromWeb(t,{objectMode:i})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},G_={input:{...ky,fileUrl:({value:t})=>({stream:createReadStream(t)}),filePath:({value:{file:t}})=>({stream:createReadStream(t)}),webStream:({value:t})=>({stream:Readable.fromWeb(t)}),iterable:({value:t})=>({stream:Readable.from(t)}),asyncIterable:({value:t})=>({stream:Readable.from(t)}),string:({value:t})=>({stream:Readable.from(t)}),uint8Array:({value:t})=>({stream:Readable.from(Buffer$1.from(t))})},output:{...ky,fileUrl:({value:t})=>({stream:createWriteStream(t)}),filePath:({value:{file:t,append:e}})=>({stream:createWriteStream(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:Writable.fromWeb(t)}),iterable:Rr,asyncIterable:Rr,string:Rr,uint8Array:Rr}};function St(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let n of t)la(n);let e=t.some(({readableObjectMode:n})=>n),r=z_(t,e),i=new ca({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of t)i.add(n);return i}var z_=(t,e)=>{if(t.length===0)return getDefaultHighWaterMark(e);let r=t.filter(({readableObjectMode:i})=>i===e).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},ca=class extends PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#s=Symbol("unpipe");#n=new WeakMap;add(e){if(la(e),this.#t.has(e))return;this.#t.add(e),this.#i??=Y_(this,this.#t,this.#s);let r=Z_({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#s});this.#n.set(e,r),e.pipe(this,{end:false});}async remove(e){if(la(e),!this.#t.has(e))return false;let r=this.#n.get(e);return r===void 0?false:(this.#n.delete(e),e.unpipe(this),await r,true)}},Y_=async(t,e,r)=>{bn(t,Ty);let i=new AbortController;try{await Promise.race([J_(t,i),K_(t,e,r,i)]);}finally{i.abort(),bn(t,-Ty);}},J_=async(t,{signal:e})=>{try{await finished(t,{signal:e,cleanup:!0});}catch(r){throw Iy(t,r),r}},K_=async(t,e,r,{signal:i})=>{for await(let[n]of on$1(t,"unpipe",{signal:i}))e.has(n)&&n.emit(r);},la=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Z_=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,onFinished:s,unpipeEvent:o})=>{bn(t,Ay);let a=new AbortController;try{await Promise.race([X_(s,e,a),Q_({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:a}),eT({stream:e,streams:r,ended:i,aborted:n,unpipeEvent:o,controller:a})]);}finally{a.abort(),bn(t,-Ay);}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?ua(t):tT(t));},X_=async(t,e,{signal:r})=>{try{await t,r.aborted||ua(e);}catch(i){r.aborted||Iy(e,i);}},Q_=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:{signal:s}})=>{try{await finished(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&i.add(e);}catch(o){if(s.aborted||!r.has(e))return;$y(o)?n.add(e):My(t,o);}},eT=async({stream:t,streams:e,ended:r,aborted:i,unpipeEvent:n,controller:{signal:s}})=>{if(await once(t,n,{signal:s}),!t.readable)return once(s,"abort",{signal:s});e.delete(t),r.delete(t),i.delete(t);},tT=t=>{t.writable&&t.end();},Iy=(t,e)=>{$y(e)?ua(t):My(t,e);},$y=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",ua=t=>{(t.readable||t.writable)&&t.destroy();},My=(t,e)=>{t.destroyed||(t.once("error",rT),t.destroy(e));},rT=()=>{},bn=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e);},Ty=2,Ay=1;var Xt=(t,e)=>{t.pipe(e),iT(t,e),nT(t,e);},iT=async(t,e)=>{if(!(pe(t)||pe(e))){try{await finished(t,{cleanup:!0,readable:!0,writable:!1});}catch{}da(e);}},da=t=>{t.writable&&t.end();},nT=async(t,e)=>{if(!(pe(t)||pe(e))){try{await finished(e,{cleanup:!0,readable:!1,writable:!0});}catch{}ha(t);}},ha=t=>{t.readable&&t.destroy();};var Fy=(t,e,r)=>{let i=new Map;for(let[n,{stdioItems:s,direction:o}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:c})=>ce.has(c)))sT(t,a,o,n);for(let{stream:a}of s.filter(({type:c})=>!ce.has(c)))aT({subprocess:t,stream:a,direction:o,fdNumber:n,pipeGroups:i,controller:r});}for(let[n,s]of i.entries()){let o=s.length===1?s[0]:St(s);Xt(o,n);}},sT=(t,e,r,i)=>{r==="output"?Xt(t.stdio[i],e):Xt(e,t.stdio[i]);let n=oT[i];n!==void 0&&(t[n]=e),t.stdio[i]=e;},oT=["stdin","stdout","stderr"],aT=({subprocess:t,stream:e,direction:r,fdNumber:i,pipeGroups:n,controller:s})=>{if(e===void 0)return;cT(e,s);let[o,a]=r==="output"?[e,t.stdio[i]]:[t.stdio[i],e],c=n.get(o)??[];n.set(o,[...c,a]);},cT=(t,{signal:e})=>{pe(t)&&yt(t,lT,e);},lT=2;var vt=[];vt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&vt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&vt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wn=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",pa=Symbol.for("signal-exit emitter"),fa=globalThis,uT=Object.defineProperty.bind(Object),ma=class{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(fa[pa])return fa[pa];uT(fa,pa,{value:this,writable:false,enumerable:false,configurable:false});}on(e,r){this.listeners[e].push(r);}removeListener(e,r){let i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1));}emit(e,r,i){if(this.emitted[e])return false;this.emitted[e]=true;let n=false;for(let s of this.listeners[e])n=s(r,i)===true||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},xn=class{},dT=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),ga=class extends xn{onExit(){return ()=>{}}load(){}unload(){}},ya=class extends xn{#t=ba.platform==="win32"?"SIGINT":"SIGHUP";#r=new ma;#e;#i;#s;#n={};#o=false;constructor(e){super(),this.#e=e,this.#n={};for(let r of vt)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(n+=s.__signal_exit_emitter__.count),i.length===n){this.unload();let o=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;o||e.kill(e.pid,a);}};this.#s=e.reallyExit,this.#i=e.emit;}onExit(e,r){if(!wn(this.#e))return ()=>{};this.#o===false&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload();}}load(){if(!this.#o){this.#o=true,this.#r.count+=1;for(let e of vt)try{let r=this.#n[e];r&&this.#e.on(e,r);}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e);}}unload(){this.#o&&(this.#o=false,vt.forEach(e=>{let r=this.#n[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r);}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#r.count-=1);}#a(e){return wn(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let i=this.#i;if(e==="exit"&&wn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,e,...r)}},ba=globalThis.process,{onExit:Ly}=dT(wn(ba)?new ya(ba):new ga);var qy=(t,{cleanup:e,detached:r},{signal:i})=>{if(!e||r)return;let n=Ly(()=>{t.kill();});addAbortListener(i,()=>{n();});};var Ny=({source:t,sourcePromise:e,boundOptions:r,createNested:i},...n)=>{let s=_i(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=pT(r,i,n),{sourceStream:d,sourceError:h}=mT(t,u),{options:p,fileDescriptors:g}=De.get(t);return {sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:h,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:g,startTime:s}},pT=(t,e,r)=>{try{let{destination:i,pipeOptions:{from:n,to:s,unpipeSignal:o}={}}=fT(t,e,...r),a=ji(i,s);return {destination:i,destinationStream:a,from:n,unpipeSignal:o}}catch(i){return {destinationError:i}}},fT=(t,e,r,...i)=>{if(Array.isArray(r))return {destination:e(jy,t)(r,...i),pipeOptions:t};if(typeof r=="string"||r instanceof URL||oo(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,s,o]=bi(r,...i);return {destination:e(jy)(n,s,o),pipeOptions:o}}if(De.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return {destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},jy=({options:t})=>({options:{...t,stdin:"pipe",piped:true}}),mT=(t,e)=>{try{return {sourceStream:Ht(t,e)}}catch(r){return {sourceError:r}}};var Uy=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:s,startTime:o})=>{let a=gT({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i});if(a!==void 0)throw wa({error:a,fileDescriptors:n,sourceOptions:s,startTime:o})},gT=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i})=>{if(e!==void 0&&i!==void 0)return i;if(i!==void 0)return ha(t),i;if(e!==void 0)return da(r),e},wa=({error:t,fileDescriptors:e,sourceOptions:r,startTime:i})=>Jt({error:t,command:By,escapedCommand:By,fileDescriptors:e,options:r,startTime:i,isSync:false}),By="source.pipe(destination)";var Gy=async t=>{let[{status:e,reason:r,value:i=r},{status:n,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(i)||o.pipedFrom.push(i),n==="rejected")throw o;if(e==="rejected")throw i;return o};var Vy=(t,e,r)=>{let i=Sn.has(e)?wT(t,e):bT(t,e);return yt(t,ST,r.signal),yt(e,vT,r.signal),xT(e),i},bT=(t,e)=>{let r=St([t]);return Xt(r,e),Sn.set(e,r),r},wT=(t,e)=>{let r=Sn.get(e);return r.add(t),r},xT=async t=>{try{await finished(t,{cleanup:!0,readable:!1,writable:!0});}catch{}Sn.delete(t);},Sn=new WeakMap,ST=2,vT=1;var Wy=(t,e)=>t===void 0?[]:[OT(t,e)],OT=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:s})=>{await aborted(t,e),await r.remove(e);let o=new Error("Pipe canceled by `unpipeSignal` option.");throw wa({error:o,fileDescriptors:i,sourceOptions:n,startTime:s})};var vn=(t,...e)=>{if(N(e[0]))return vn.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...i}=Ny(t,...e),n=CT({...i,destination:r});return n.pipe=vn.bind(void 0,{...t,source:r,sourcePromise:n,boundOptions:{}}),n},CT=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:i,destination:n,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=kT(t,n);Uy({sourceStream:e,sourceError:i,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:r,startTime:u});let d=new AbortController;try{let h=Vy(e,s,d);return await Promise.race([Gy(l),...Wy(a,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{d.abort();}},kT=(t,e)=>Promise.allSettled([t,e]);var En=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:i,encoding:n,preserveNewlines:s})=>{let o=new AbortController;return TT(e,o),zy({stream:t,controller:o,binary:r,shouldEncode:!t.readableObjectMode&&i,encoding:n,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},TT=async(t,e)=>{try{await t;}catch{}finally{e.abort();}},xa=({stream:t,onStreamEnd:e,lines:r,encoding:i,stripFinalNewline:n,allMixed:s})=>{let o=new AbortController;AT(e,o,t);let a=t.readableObjectMode&&!s;return zy({stream:t,controller:o,binary:i==="buffer",shouldEncode:!a,encoding:i,shouldSplit:!a&&r,preserveNewlines:!n})},AT=async(t,e,r)=>{try{await t;}catch{r.destroy();}finally{e.abort();}},zy=({stream:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o})=>{let a=on$1(t,"data",{signal:e.signal,highWaterMark:Hy,highWatermark:Hy});return PT({onStdoutChunk:a,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o})},Sa=getDefaultHighWaterMark(true),Hy=Sa,PT=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o}){let a=IT({binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o});try{for await(let[c]of t)yield*xt(c,a,0);}catch(c){if(!e.signal.aborted)throw c}finally{yield*Ir(a);}},IT=({binary:t,shouldEncode:e,encoding:r,shouldSplit:i,preserveNewlines:n})=>[pn(t,r,!e),hn(t,n,!i,{})].filter(Boolean);var Yy=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,buffer:n,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let d=MT({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:a,verboseInfo:u,streamInfo:l});if(!n){await Promise.all([RT(t),d]);return}let h=Xo(c,r),p=xa({stream:t,onStreamEnd:e,lines:o,encoding:i,stripFinalNewline:h,allMixed:a}),[g]=await Promise.all([FT({stream:t,iterable:p,fdNumber:r,encoding:i,maxBuffer:s,lines:o}),d]);return g},MT=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:n,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!gn({stdioItems:o[r]?.stdioItems,encoding:i,verboseInfo:s,fdNumber:r}))return;let a=xa({stream:t,onStreamEnd:e,lines:true,encoding:i,stripFinalNewline:true,allMixed:n});await sy(a,t,r,s);},RT=async t=>{await setImmediate(),t.readableFlowing===null&&t.resume();},FT=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:i,encoding:n,maxBuffer:s,lines:o})=>{try{return e||o?await tn(r,{maxBuffer:s}):n==="buffer"?new Uint8Array(await rn(r,{maxBuffer:s})):await sn(r,{maxBuffer:s})}catch(a){return Jy(sg({error:a,stream:t,readableObjectMode:e,lines:o,encoding:n,fdNumber:i}))}},va=async t=>{try{return await t}catch(e){return Jy(e)}},Jy=({bufferedData:t})=>xp(t)?new Uint8Array(t):t;var Fr=async(t,e,r,{isSameDirection:i,stopOnExit:n=false}={})=>{let s=qT(t,r),o=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],finished(t,{cleanup:!0,signal:o.signal})]);}catch(a){s.stdinCleanedUp||BT(a,e,r,i);}finally{o.abort();}},qT=(t,{originalStreams:[e],subprocess:r})=>{let i={stdinCleanedUp:false};return t===e&&jT(t,r,i),i},jT=(t,e,r)=>{let{_destroy:i}=t;t._destroy=(...n)=>{NT(e,r),i.call(t,...n);};},NT=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=true);},BT=(t,e,r,i)=>{if(!UT(t,e,r,i))throw t},UT=(t,e,r,i=true)=>r.propagating?Ky(t)||On(t):(r.propagating=true,Ea(r,e)===i?Ky(t):On(t)),Ea=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",On=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Ky=t=>t?.code==="EPIPE";var Zy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>Oa({stream:c,fdNumber:u,encoding:e,buffer:r[u],maxBuffer:i[u],lines:n[u],allMixed:false,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),Oa=async({stream:t,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!t)return;let l=Fr(t,e,u);if(Ea(u,e)){await l;return}let[d]=await Promise.all([Yy({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return d};var Xy=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?St([t,e].filter(Boolean)):void 0,Qy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>Oa({...GT(t,r),fdNumber:"all",encoding:e,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:VT(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),GT=({stdout:t,stderr:e,all:r},[,i,n])=>{let s=i||n;return s?i?n?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},VT=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var eb=t=>Bt(t,"ipc"),tb=(t,e)=>{let r=Di(t);Ce({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e});};var rb=async({subprocess:t,buffer:e,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:s})=>{if(!i)return n;let o=eb(s),a=Ve(e,"ipc"),c=Ve(r,"ipc");for await(let u of aa({anyProcess:t,channel:t.channel,isSubprocess:false,ipc:i,shouldAwait:false,reference:true}))a&&(og(t,n,c),n.push(u)),o&&tb(u,s);return n},ib=async(t,e)=>(await Promise.allSettled([t]),e);var nb=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:i,lines:n,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:h,verboseInfo:p,fileDescriptors:g,originalStreams:y,onInternalError:w,controller:b})=>{let S=uy(t,h),k={originalStreams:y,fileDescriptors:g,subprocess:t,exitPromise:S,propagating:false},$=Zy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:u,verboseInfo:p,streamInfo:k}),oe=Qy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:u,verboseInfo:p,streamInfo:k}),le=[],Pe=rb({subprocess:t,buffer:r,maxBuffer:i,ipc:l,ipcOutput:le,verboseInfo:p}),be=HT(y,t,k),x=zT(g,k);try{return await Promise.race([Promise.all([{},hy(S),Promise.all($),oe,Pe,qm(t,d),...be,...x]),w,YT(t,b),...$m(t,s,h,b),...em({subprocess:t,cancelSignal:o,gracefulCancel:a,context:h,controller:b}),...Pm({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:h,controller:b})])}catch(D){return h.terminationReason??="other",Promise.all([{error:D},S,Promise.all($.map(O=>va(O))),va(oe),ib(Pe,le),Promise.allSettled(be),Promise.allSettled(x)])}},HT=(t,e,r)=>t.map((i,n)=>i===e.stdio[n]?void 0:Fr(i,n,r)),zT=(t,e)=>t.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:s=n})=>ge(s,{checkOpen:false})&&!pe(s)).map(({type:n,value:s,stream:o=s})=>Fr(o,i,e,{isSameDirection:ce.has(n),stopOnExit:n==="native"}))),YT=async(t,{signal:e})=>{let[r]=await once(t,"error",{signal:e});throw r};var sb=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Lr=(t,e,r)=>{let i=t[r];i.has(e)||i.set(e,[]);let n=i.get(e),s=ke();return n.push(s),{resolve:s.resolve.bind(s),promises:n}},Qt=async({resolve:t,promises:e},r)=>{t();let[i]=await Promise.race([Promise.allSettled([true,r]),Promise.all([false,...e])]);return !i};var Ca=async t=>{if(t!==void 0)try{await ka(t);}catch{}},ab=async t=>{if(t!==void 0)try{await Da(t);}catch{}},ka=async t=>{await finished(t,{cleanup:true,readable:false,writable:true});},Da=async t=>{await finished(t,{cleanup:true,readable:true,writable:false});},Cn=async(t,e)=>{if(await t,e)throw e},kn=(t,e,r)=>{r&&!On(r)?t.destroy(r):e&&t.destroy();};var cb=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,binary:n=true,preserveNewlines:s=true}={})=>{let o=n||se.has(r),{subprocessStdout:a,waitReadableDestroy:c}=_a(t,i,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=Ta(a,o),{read:h,onStdoutDataDone:p}=Aa({subprocessStdout:a,subprocess:t,binary:o,encoding:r,preserveNewlines:s}),g=new Readable({read:h,destroy:callbackify(Ia.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return Pa({subprocessStdout:a,onStdoutDataDone:p,readable:g,subprocess:t}),g},_a=(t,e,r)=>{let i=Ht(t,e),n=Lr(r,i,"readableDestroy");return {subprocessStdout:i,waitReadableDestroy:n}},Ta=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},i)=>i?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:true,readableHighWaterMark:Sa},Aa=({subprocessStdout:t,subprocess:e,binary:r,encoding:i,preserveNewlines:n})=>{let s=ke(),o=En({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return {read(){ZT(this,o,s);},onStdoutDataDone:s}},ZT=async(t,e,r)=>{try{let{value:i,done:n}=await e.next();n?r.resolve():t.push(i);}catch{}},Pa=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:i,subprocessStdin:n})=>{try{await Da(t),await i,await Ca(n),await e,r.readable&&r.push(null);}catch(s){await Ca(n),lb(r,s);}},Ia=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},i)=>{await Qt(r,e)&&(lb(t,i),await Cn(e,i));},lb=(t,e)=>{kn(t,t.readable,e);};var db=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}=$a(t,r,e),o=new Writable({...Ma(i,t,n),destroy:callbackify(Fa.bind(void 0,{subprocessStdin:i,subprocess:t,waitWritableFinal:n,waitWritableDestroy:s})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Ra(i,o),o},$a=(t,e,r)=>{let i=ji(t,e),n=Lr(r,i,"writableFinal"),s=Lr(r,i,"writableDestroy");return {subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}},Ma=(t,e,r)=>({write:QT.bind(void 0,t),final:callbackify(eA.bind(void 0,t,e,r))}),QT=(t,e,r,i)=>{t.write(e,r)?i():t.once("drain",i);},eA=async(t,e,r)=>{await Qt(r,e)&&(t.writable&&t.end(),await e);},Ra=async(t,e,r)=>{try{await ka(t),e.writable&&e.end();}catch(i){await ab(r),hb(e,i);}},Fa=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await Qt(r,e),await Qt(i,e)&&(hb(t,n),await Cn(e,n));},hb=(t,e)=>{kn(t,t.writable,e);};var pb=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,to:n,binary:s=true,preserveNewlines:o=true}={})=>{let a=s||se.has(r),{subprocessStdout:c,waitReadableDestroy:u}=_a(t,i,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:h}=$a(t,n,e),{readableEncoding:p,readableObjectMode:g,readableHighWaterMark:y}=Ta(c,a),{read:w,onStdoutDataDone:b}=Aa({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:o}),S=new Duplex({read:w,...Ma(l,t,d),destroy:callbackify(iA.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:h})),readableHighWaterMark:y,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:g,writableObjectMode:l.writableObjectMode,encoding:p});return Pa({subprocessStdout:c,onStdoutDataDone:b,readable:S,subprocess:t,subprocessStdin:l}),Ra(l,S,c),S},iA=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:s},o)=>{await Promise.all([Ia({subprocessStdout:t,subprocess:r,waitReadableDestroy:i},o),Fa({subprocessStdin:e,subprocess:r,waitWritableFinal:n,waitWritableDestroy:s},o)]);};var La=(t,e,{from:r,binary:i=false,preserveNewlines:n=false}={})=>{let s=i||se.has(e),o=Ht(t,r),a=En({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:true,encoding:e,preserveNewlines:n});return nA(a,o,t)},nA=async function*(t,e,r){try{yield*t;}finally{e.readable&&e.destroy(),await r;}};var fb=(t,{encoding:e})=>{let r=sb();t.readable=cb.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=db.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=pb.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=La.bind(void 0,t,e),t[Symbol.asyncIterator]=La.bind(void 0,t,e,{});};var mb=(t,e)=>{for(let[r,i]of oA){let n=i.value.bind(e);Reflect.defineProperty(t,r,{...i,value:n});}},sA=(async()=>{})().constructor.prototype,oA=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(sA,t)]);var gb=(t,e,r,i)=>{let{file:n,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=lA(t,e,r),{subprocess:h,promise:p}=dA({file:n,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return h.pipe=vn.bind(void 0,{source:h,sourcePromise:p,boundOptions:{},createNested:i}),mb(h,p),De.set(h,{options:l,fileDescriptors:d}),h},lA=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:o}=Ti(t,e,r),{file:a,commandArguments:c,options:u}=Ki(t,e,r),l=uA(u),d=Dy(l,o);return {file:a,commandArguments:c,command:i,escapedCommand:n,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},uA=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return {...r,timeoutDuration:t}},dA=({file:t,commandArguments:e,options:r,startTime:i,verboseInfo:n,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=spawn(...Zi(t,e,r));}catch(g){return Ey({error:g,command:s,escapedCommand:o,fileDescriptors:a,options:r,startTime:i,verboseInfo:n})}let u=new AbortController;setMaxListeners(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];Fy(c,a,u),qy(c,r,u);let d={},h=ke();c.kill=Xf.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:d,controller:u}),c.all=Xy(c,r),fb(c,r),xy(c,r);let p=hA({subprocess:c,options:r,startTime:i,verboseInfo:n,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:d,onInternalError:h,controller:u});return {subprocess:c,promise:p}},hA=async({subprocess:t,options:e,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[d,[h,p],g,y,w]=await nb({subprocess:t,options:e,context:c,verboseInfo:i,fileDescriptors:n,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();let b=g.map(($,oe)=>He($,e,oe)),S=He(y,e,"all"),k=pA({errorInfo:d,exitCode:h,signal:p,stdio:b,all:S,ipcOutput:w,context:c,options:e,command:o,escapedCommand:a,startTime:r});return Kt(k,i,e)},pA=({errorInfo:t,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:s,context:o,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in t?Pr({error:t.error,command:c,escapedCommand:u,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof _e,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:s,options:a,startTime:l,isSync:false}):an({command:c,escapedCommand:u,stdio:i,all:n,ipcOutput:s,options:a,startTime:l});var Dn=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([i,n])=>[i,fA(i,t[i],n)]));return {...t,...r}},fA=(t,e,r)=>mA.has(t)&&N(e)&&N(r)?{...e,...r}:r,mA=new Set(["env",...po]);var ct=(t,e,r,i)=>{let n=(o,a,c)=>ct(o,a,r,c),s=(...o)=>gA({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:i,createNested:n},...o);return i!==void 0&&i(s,n,e),s},gA=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:i,createNested:n},s,...o)=>{if(N(s))return n(t,Dn(r,s),i);let{file:a,commandArguments:c,options:u,isSync:l}=yA({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:r});return l?fy(a,c,u):gb(a,c,u,n)},yA=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:i,boundOptions:n})=>{let s=kp(e)?Dp(e,r):[e,...r],[o,a,c]=bi(...s),u=Dn(Dn(i,n),c),{file:l=o,commandArguments:d=a,options:h=u,isSync:p=false}=t({file:o,commandArguments:a,options:u});return {file:l,commandArguments:d,options:h,isSync:p}};var yb=({file:t,commandArguments:e})=>wb(t,e),bb=({file:t,commandArguments:e})=>({...wb(t,e),isSync:true}),wb=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...i]=bA(t);return {file:r,commandArguments:i}},bA=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return [];let r=[];for(let i of e.split(wA)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i);}return r},wA=/ +/g;var xb=(t,e,r)=>{t.sync=e(xA,r),t.s=t.sync;},Sb=({options:t})=>vb(t),xA=({options:t})=>({...vb(t),isSync:true}),vb=t=>({options:{...SA(t),...t}}),SA=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Eb={preferLocal:true};var Ob=ct(()=>({}));ct(()=>({isSync:true}));ct(yb);ct(bb);ct(Rm);ct(Sb,{},Eb,xb);Sy();async function qr({cwd:t,packageManager:e,packages:r,dev:i=false}){if(!r.length)return;let n={npm:"npm",pnpm:"pnpm",yarn:"yarn",bun:"bun"},s={npm:["install",...i?["-D"]:[],...r],pnpm:["add",...i?["-D"]:[],...r],yarn:["add",...i?["-D"]:[],...r],bun:["add",...i?["-d"]:[],...r]};await Ob(n[e],s[e],{cwd:t,stdio:"inherit"});}var Nr=Ie(et());var qa="/* azamat-ui-kit:start */",_n="/* azamat-ui-kit:end */";function Cb(t){return `${qa}
|
|
172
|
-
@import "tw-animate-css";
|
|
173
|
-
@import "shadcn/tailwind.css";
|
|
174
|
-
@import "@fontsource-variable/geist";
|
|
175
|
-
@source "${t}";
|
|
176
|
-
|
|
177
|
-
@custom-variant dark (&:is(.dark *));
|
|
178
|
-
|
|
179
|
-
@theme inline {
|
|
180
|
-
--font-heading: var(--font-sans);
|
|
181
|
-
--font-sans: 'Geist Variable', sans-serif;
|
|
182
|
-
|
|
183
|
-
--color-background: var(--background);
|
|
184
|
-
--color-foreground: var(--foreground);
|
|
185
|
-
--color-card: var(--card);
|
|
186
|
-
--color-card-foreground: var(--card-foreground);
|
|
187
|
-
--color-popover: var(--popover);
|
|
188
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
189
|
-
--color-primary: var(--primary);
|
|
190
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
191
|
-
--color-secondary: var(--secondary);
|
|
192
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
193
|
-
--color-muted: var(--muted);
|
|
194
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
195
|
-
--color-accent: var(--accent);
|
|
196
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
197
|
-
--color-destructive: var(--destructive);
|
|
198
|
-
--color-border: var(--border);
|
|
199
|
-
--color-input: var(--input);
|
|
200
|
-
--color-ring: var(--ring);
|
|
201
|
-
|
|
202
|
-
--color-sidebar: var(--sidebar);
|
|
203
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
204
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
205
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
206
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
207
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
208
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
209
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
210
|
-
|
|
211
|
-
--color-chart-1: var(--chart-1);
|
|
212
|
-
--color-chart-2: var(--chart-2);
|
|
213
|
-
--color-chart-3: var(--chart-3);
|
|
214
|
-
--color-chart-4: var(--chart-4);
|
|
215
|
-
--color-chart-5: var(--chart-5);
|
|
216
|
-
|
|
217
|
-
--radius-sm: calc(var(--radius) * 0.6);
|
|
218
|
-
--radius-md: calc(var(--radius) * 0.8);
|
|
219
|
-
--radius-lg: var(--radius);
|
|
220
|
-
--radius-xl: calc(var(--radius) * 1.4);
|
|
221
|
-
--radius-2xl: calc(var(--radius) * 1.8);
|
|
222
|
-
--radius-3xl: calc(var(--radius) * 2.2);
|
|
223
|
-
--radius-4xl: calc(var(--radius) * 2.6);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
:root,
|
|
227
|
-
.light {
|
|
228
|
-
--background: oklch(0.988 0.004 95);
|
|
229
|
-
--foreground: oklch(0.238 0.02 255);
|
|
230
|
-
--card: oklch(0.998 0.002 95);
|
|
231
|
-
--card-foreground: oklch(0.238 0.02 255);
|
|
232
|
-
--popover: oklch(0.998 0.002 95);
|
|
233
|
-
--popover-foreground: oklch(0.238 0.02 255);
|
|
234
|
-
--primary: oklch(0.312 0.05 255);
|
|
235
|
-
--primary-foreground: oklch(0.985 0.002 95);
|
|
236
|
-
--secondary: oklch(0.958 0.008 250);
|
|
237
|
-
--secondary-foreground: oklch(0.282 0.028 255);
|
|
238
|
-
--muted: oklch(0.964 0.006 250);
|
|
239
|
-
--muted-foreground: oklch(0.52 0.016 255);
|
|
240
|
-
--accent: oklch(0.948 0.014 220);
|
|
241
|
-
--accent-foreground: oklch(0.27 0.03 255);
|
|
242
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
243
|
-
--border: oklch(0.892 0.01 250);
|
|
244
|
-
--input: oklch(0.91 0.012 250);
|
|
245
|
-
--ring: oklch(0.66 0.035 245);
|
|
246
|
-
--chart-1: oklch(0.68 0.13 245);
|
|
247
|
-
--chart-2: oklch(0.74 0.1 205);
|
|
248
|
-
--chart-3: oklch(0.78 0.11 165);
|
|
249
|
-
--chart-4: oklch(0.72 0.15 45);
|
|
250
|
-
--chart-5: oklch(0.66 0.15 15);
|
|
251
|
-
--radius: 0.875rem;
|
|
252
|
-
--sidebar: oklch(0.982 0.006 250);
|
|
253
|
-
--sidebar-foreground: oklch(0.238 0.02 255);
|
|
254
|
-
--sidebar-primary: oklch(0.312 0.05 255);
|
|
255
|
-
--sidebar-primary-foreground: oklch(0.985 0.002 95);
|
|
256
|
-
--sidebar-accent: oklch(0.95 0.012 240);
|
|
257
|
-
--sidebar-accent-foreground: oklch(0.27 0.03 255);
|
|
258
|
-
--sidebar-border: oklch(0.89 0.012 250);
|
|
259
|
-
--sidebar-ring: oklch(0.66 0.035 245);
|
|
260
|
-
|
|
261
|
-
--aui-control-radius: var(--radius-xl);
|
|
262
|
-
--aui-control-shadow: 0 1px 0 oklch(1 0 0 / 60%), 0 8px 22px oklch(0.24 0.02 255 / 6%);
|
|
263
|
-
--aui-card-radius: var(--radius-2xl);
|
|
264
|
-
--aui-card-border: color-mix(in oklch, var(--border), white 12%);
|
|
265
|
-
--aui-card-shadow: 0 1px 0 oklch(1 0 0 / 75%), 0 18px 45px oklch(0.24 0.02 255 / 7%);
|
|
266
|
-
--aui-popover-shadow: 0 24px 70px oklch(0.24 0.02 255 / 18%);
|
|
267
|
-
--aui-table-header-bg: linear-gradient(180deg, oklch(0.972 0.008 250), oklch(0.954 0.01 250));
|
|
268
|
-
--aui-table-toolbar-bg: linear-gradient(180deg, oklch(0.996 0.002 95), oklch(0.978 0.006 250));
|
|
269
|
-
--aui-table-toolbar-border: color-mix(in oklch, var(--border), white 16%);
|
|
270
|
-
--aui-table-row-hover-bg: color-mix(in oklch, var(--accent), white 55%);
|
|
271
|
-
--aui-table-row-selected-bg: color-mix(in oklch, var(--primary), white 90%);
|
|
272
|
-
--aui-table-stripe-bg: oklch(0.978 0.004 250 / 55%);
|
|
273
|
-
--aui-table-footer-bg: linear-gradient(180deg, oklch(0.994 0.002 95), oklch(0.974 0.006 250));
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.dark {
|
|
277
|
-
--background: oklch(0.19 0.01 255);
|
|
278
|
-
--foreground: oklch(0.965 0.004 95);
|
|
279
|
-
--card: oklch(0.235 0.012 255);
|
|
280
|
-
--card-foreground: oklch(0.965 0.004 95);
|
|
281
|
-
--popover: oklch(0.235 0.012 255);
|
|
282
|
-
--popover-foreground: oklch(0.965 0.004 95);
|
|
283
|
-
--primary: oklch(0.82 0.04 235);
|
|
284
|
-
--primary-foreground: oklch(0.205 0.014 255);
|
|
285
|
-
--secondary: oklch(0.29 0.012 255);
|
|
286
|
-
--secondary-foreground: oklch(0.965 0.004 95);
|
|
287
|
-
--muted: oklch(0.29 0.012 255);
|
|
288
|
-
--muted-foreground: oklch(0.78 0.012 250);
|
|
289
|
-
--accent: oklch(0.31 0.018 235);
|
|
290
|
-
--accent-foreground: oklch(0.97 0.004 95);
|
|
291
|
-
--destructive: oklch(0.704 0.191 22.216);
|
|
292
|
-
--border: oklch(1 0 0 / 12%);
|
|
293
|
-
--input: oklch(1 0 0 / 14%);
|
|
294
|
-
--ring: oklch(0.68 0.03 235);
|
|
295
|
-
--chart-1: oklch(0.78 0.11 235);
|
|
296
|
-
--chart-2: oklch(0.74 0.1 205);
|
|
297
|
-
--chart-3: oklch(0.72 0.1 165);
|
|
298
|
-
--chart-4: oklch(0.76 0.11 45);
|
|
299
|
-
--chart-5: oklch(0.74 0.12 15);
|
|
300
|
-
--sidebar: oklch(0.215 0.012 255);
|
|
301
|
-
--sidebar-foreground: oklch(0.965 0.004 95);
|
|
302
|
-
--sidebar-primary: oklch(0.82 0.04 235);
|
|
303
|
-
--sidebar-primary-foreground: oklch(0.205 0.014 255);
|
|
304
|
-
--sidebar-accent: oklch(0.29 0.012 255);
|
|
305
|
-
--sidebar-accent-foreground: oklch(0.965 0.004 95);
|
|
306
|
-
--sidebar-border: oklch(1 0 0 / 12%);
|
|
307
|
-
--sidebar-ring: oklch(0.68 0.03 235);
|
|
308
|
-
|
|
309
|
-
--aui-card-border: oklch(1 0 0 / 9%);
|
|
310
|
-
--aui-card-shadow: 0 1px 0 oklch(1 0 0 / 5%), 0 24px 80px oklch(0 0 0 / 30%);
|
|
311
|
-
--aui-popover-shadow: 0 24px 80px oklch(0 0 0 / 48%);
|
|
312
|
-
--aui-table-header-bg: linear-gradient(180deg, oklch(0.255 0.012 255), oklch(0.225 0.012 255));
|
|
313
|
-
--aui-table-toolbar-bg: linear-gradient(180deg, oklch(0.24 0.012 255), oklch(0.215 0.012 255));
|
|
314
|
-
--aui-table-toolbar-border: oklch(1 0 0 / 9%);
|
|
315
|
-
--aui-table-row-hover-bg: oklch(1 0 0 / 5%);
|
|
316
|
-
--aui-table-row-selected-bg: color-mix(in oklch, var(--primary), transparent 84%);
|
|
317
|
-
--aui-table-stripe-bg: oklch(1 0 0 / 3%);
|
|
318
|
-
--aui-table-footer-bg: linear-gradient(180deg, oklch(0.245 0.012 255), oklch(0.215 0.012 255));
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
:root[data-radius="none"] { --radius: 0rem; }
|
|
322
|
-
:root[data-radius="sm"] { --radius: 0.375rem; }
|
|
323
|
-
:root[data-radius="md"] { --radius: 0.5rem; }
|
|
324
|
-
:root[data-radius="lg"] { --radius: 0.75rem; }
|
|
325
|
-
:root[data-radius="xl"] { --radius: 1rem; }
|
|
326
|
-
|
|
327
|
-
@layer base {
|
|
328
|
-
* {
|
|
329
|
-
@apply border-border outline-ring/50;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
html {
|
|
333
|
-
@apply font-sans;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
body {
|
|
337
|
-
@apply bg-background text-foreground;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
@layer components {
|
|
342
|
-
[data-slot="button"][data-slot="button"] {
|
|
343
|
-
border-radius: var(--aui-control-radius);
|
|
344
|
-
box-shadow: var(--aui-control-shadow);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
[data-slot="input"][data-slot="input"],
|
|
348
|
-
[data-slot="textarea"][data-slot="textarea"],
|
|
349
|
-
[data-slot="select-trigger"][data-slot="select-trigger"] {
|
|
350
|
-
border-radius: var(--aui-control-radius);
|
|
351
|
-
box-shadow: var(--aui-control-shadow);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
[data-slot="card"][data-slot="card"],
|
|
355
|
-
[data-slot="stat-card"][data-slot="stat-card"] {
|
|
356
|
-
border: 1px solid var(--aui-card-border);
|
|
357
|
-
border-radius: var(--aui-card-radius);
|
|
358
|
-
box-shadow: var(--aui-card-shadow);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
[data-slot="popover-content"][data-slot="popover-content"],
|
|
362
|
-
[data-slot="dropdown-menu-content"][data-slot="dropdown-menu-content"],
|
|
363
|
-
[data-slot="dialog-content"][data-slot="dialog-content"],
|
|
364
|
-
[data-slot="sheet-content"][data-slot="sheet-content"] {
|
|
365
|
-
box-shadow: var(--aui-popover-shadow);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
[data-slot="data-table-wrapper"][data-slot="data-table-wrapper"] {
|
|
369
|
-
box-shadow: var(--aui-card-shadow);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
[data-slot="data-table-toolbar"][data-slot="data-table-toolbar"] {
|
|
373
|
-
border: 1px solid var(--aui-table-toolbar-border);
|
|
374
|
-
border-radius: var(--aui-card-radius);
|
|
375
|
-
background: var(--aui-table-toolbar-bg);
|
|
376
|
-
box-shadow: var(--aui-card-shadow);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
[data-slot="data-table-wrapper"] thead {
|
|
380
|
-
background: var(--aui-table-header-bg);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
[data-slot="data-table-wrapper"] tbody tr:hover {
|
|
384
|
-
background: var(--aui-table-row-hover-bg);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
[data-slot="data-table-wrapper"] tbody tr[data-state="selected"] {
|
|
388
|
-
background: var(--aui-table-row-selected-bg);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
[data-slot="data-table-wrapper"] tbody tr[data-striped="true"] {
|
|
392
|
-
background: var(--aui-table-stripe-bg);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
[data-slot="data-table-pagination"][data-slot="data-table-pagination"] {
|
|
396
|
-
background: var(--aui-table-footer-bg);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
[data-slot="file-upload-dropzone"][data-dragging="true"] {
|
|
400
|
-
border-color: var(--primary);
|
|
401
|
-
background: color-mix(in oklch, var(--primary), transparent 93%);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
${_n}
|
|
405
|
-
`}function vA(t){return /@import\s+["']tailwindcss["'];?/.test(t)}function EA(t){return vA(t)?t:`@import "tailwindcss";
|
|
406
|
-
|
|
407
|
-
${t}`.trimEnd()+`
|
|
408
|
-
`}function OA(t,e){let r=t.indexOf(qa),i=t.indexOf(_n);if(r!==-1&&i!==-1&&i>r){let n=t.slice(0,r).trimEnd(),s=t.slice(i+_n.length).trimStart();return [n,e,s].filter(Boolean).join(`
|
|
409
|
-
|
|
410
|
-
`)+`
|
|
411
|
-
`}return `${t.trimEnd()}
|
|
412
|
-
|
|
413
|
-
${e}
|
|
414
|
-
`}function CA(t){return t.replaceAll("\\","/")}async function Tn({cwd:t,cssPath:e}){let r=ne.resolve(t,e),i=ne.dirname(r),n=CA(ne.relative(i,ne.join(t,"node_modules","azamat-ui-kit","dist","**","*.js")));await Nr.default.ensureDir(ne.dirname(r));let s=Nr.default.existsSync(r)?await Nr.default.readFile(r,"utf8"):"",o=EA(s),a=OA(o,Cb(n));return await Nr.default.writeFile(r,a),r}var An="azamat-ui-kit",kA="azamat-ui-kit-cli";function Ae(t=""){return `npx ${kA} ${t}`.trim()}var DA=[An,"@base-ui/react","@fontsource-variable/geist","clsx","tailwind-merge","class-variance-authority","lucide-react","tw-animate-css","@tanstack/react-table","react-hook-form"],_A={vite:["tailwindcss","@tailwindcss/vite"],next:["tailwindcss","@tailwindcss/postcss"]},TA=`// Generated by azamat-ui-kit init.
|
|
415
|
-
// Components added with the CLI will appear under this folder.
|
|
416
|
-
`;function AA(t){let i=t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1");return JSON.parse(i)}function PA(t,e,r,i){if(t==="vite"){let n=[e,r,i].map(o=>o.replaceAll("\\","/"));if(n.filter(o=>o.startsWith("src/")).length===n.length)return "./src/*"}return "./*"}async function IA({cwd:t,template:e,alias:r,componentsPath:i,hooksPath:n,utilsPath:s}){let o=ne.join(t,e==="vite"?"tsconfig.app.json":"tsconfig.json");if(!U.default.existsSync(o))return;let a=AA(await U.default.readFile(o,"utf8"));a.compilerOptions??={},a.compilerOptions.ignoreDeprecations??="6.0",a.compilerOptions.baseUrl=".";let c=a.compilerOptions.paths??{};c[`${r}/*`]=[PA(e,i,n,s)],a.compilerOptions.paths=c,await U.default.writeJson(o,a,{spaces:2});}async function $A({cwd:t,alias:e}){let r=ne.join(t,"vite.config.ts");if(!U.default.existsSync(r))return;let i=await U.default.readFile(r,"utf8"),n="import path from 'node:path'",s=` resolve: {
|
|
417
|
-
alias: {
|
|
418
|
-
'${e}': path.resolve(process.cwd(), 'src'),
|
|
419
|
-
},
|
|
420
|
-
},`,o=i;o.includes(n)||(o=`${n}
|
|
421
|
-
${o}`),!o.includes("resolve: {")&&o.includes("export default defineConfig({")&&(o=o.replace("export default defineConfig({",`export default defineConfig({
|
|
422
|
-
${s}`)),o.includes(`'${e}': path.resolve(process.cwd(), 'src')`)?o!==i&&await U.default.writeFile(r,o):await U.default.writeFile(r,o);}var MA={vite:{alias:"@",componentsPath:"src/components",uiPath:"src/components/ui",hooksPath:"src/hooks",utilsPath:"src/lib/utils.ts",globalCssPath:"src/index.css"},next:{alias:"@",componentsPath:"components",uiPath:"components/ui",hooksPath:"hooks",utilsPath:"lib/utils.ts",globalCssPath:"app/globals.css"}};function RA(t){return t==="next"||t==="vite"?t:(C.warn(`Unknown template '${t}'. Falling back to vite defaults.`),"vite")}function FA(t){let e=ne.join(t,"package.json"),r=U.default.readJsonSync(e);return new Set([...Object.keys(r.dependencies??{}),...Object.keys(r.devDependencies??{})])}async function Db(t={}){let e=process.cwd(),r=ne.join(e,"package.json");U.default.existsSync(r)||(C.error("package.json topilmadi / not found. Commandni React, Vite yoki Next project ichida ishlating."),process.exit(1));let i=RA(t.template),n=MA[i],s=FA(e),o=_A[i].filter($=>!s.has($)),a=t.defaults?{installDeps:!t.skipInstall,installTailwindDeps:o.length>0,alias:n.alias,componentsPath:n.componentsPath,uiPath:n.uiPath,hooksPath:n.hooksPath,utilsPath:n.utilsPath,globalCssPath:n.globalCssPath,writeThemeCss:true}:await(0, kb.default)([{type:"confirm",name:"installDeps",message:"Asosiy dependencylarni o\u2018rnataymi? / Install base dependencies?",initial:!t.skipInstall},{type:o.length>0?"confirm":null,name:"installTailwindDeps",message:`Tailwind paketlari topilmadi (${o.join(", ")}). O\u2018rnataymi? / Install Tailwind packages?`,initial:true},{type:"text",name:"alias",message:"Path alias qanday? / Path alias?",initial:n.alias},{type:"text",name:"componentsPath",message:"Component root qayerda? / Component root?",initial:n.componentsPath},{type:"text",name:"uiPath",message:"UI primitives qayerga yozilsin? / UI primitives path?",initial:n.uiPath},{type:"text",name:"hooksPath",message:"Hooks qayerga yozilsin? / Hooks path?",initial:n.hooksPath},{type:"text",name:"utilsPath",message:"utils.ts qayerga yozilsin? / utils.ts path?",initial:n.utilsPath},{type:"text",name:"globalCssPath",message:"Theme tokenlar qaysi global CSS faylga yozilsin? / Global CSS path?",initial:n.globalCssPath},{type:"confirm",name:"writeThemeCss",message:"Dark/light theme tokenlarni global CSS faylga yozaymi? / Write theme tokens?",initial:true}]),c=yi(e);C.info(`Package manager: ${c}`),!t.skipInstall&&a.installDeps&&await qr({cwd:e,packageManager:c,packages:DA}),!t.skipInstall&&o.length>0&&a.installTailwindDeps&&await qr({cwd:e,packageManager:c,packages:o,dev:true});let u=a.utilsPath||n.utilsPath,l=a.componentsPath||n.componentsPath,d=a.uiPath||n.uiPath,h=a.hooksPath||n.hooksPath,p=a.globalCssPath||n.globalCssPath,g={style:"default",alias:a.alias||n.alias,componentsPath:l,utilsPath:u,cssPath:p,globalCssPath:p,paths:{components:l,ui:d,hooks:h,lib:ne.dirname(u)}};await U.default.writeJson(ne.join(e,"azamat-ui.json"),g,{spaces:2});let y=ne.join(e,u),w=ne.join(e,l),b=ne.join(e,d),S=ne.join(e,h);await U.default.ensureDir(ne.dirname(y)),await U.default.ensureDir(w),await U.default.ensureDir(b),await U.default.ensureDir(S);let k=[ne.join(w,"index.ts"),ne.join(b,"index.ts"),ne.join(S,"index.ts")];for(let $ of k)U.default.existsSync($)||await U.default.writeFile($,TA);if(U.default.existsSync(y)||await U.default.writeFile(y,`import { clsx, type ClassValue } from "clsx"
|
|
423
|
-
import { twMerge } from "tailwind-merge"
|
|
424
|
-
|
|
425
|
-
export function cn(...inputs: ClassValue[]) {
|
|
426
|
-
return twMerge(clsx(inputs))
|
|
427
|
-
}
|
|
428
|
-
`),await IA({cwd:e,template:i,alias:g.alias,componentsPath:l,hooksPath:h,utilsPath:u}),i==="vite"&&await $A({cwd:e,alias:g.alias}),a.writeThemeCss&&p){let $=await Tn({cwd:e,cssPath:p});C.success(`Theme CSS yozildi / written: ${$}`);}C.success("Azamat UI Kit init qilindi / initialized."),C.info(`Component source root: ${l}`),C.info(`UI primitives path: ${d}`),C.info(`Hooks path: ${h}`),C.info("Componentlarni ko\u2018rish / list components:"),C.info(Ae("list")),C.info("Component qo\u2018shish / add components:"),C.info(Ae("add button input data-table")),o.length>0&&!a.installTailwindDeps&&C.warn(`Tailwind paketlari hali o\u2018rnatilmadi: ${o.join(", ")}`),C.info("Theme CSS ni yangilash / update theme CSS:"),C.info(Ae("theme"));}var lt=Ie(et());var f=(t,e)=>({source:t,target:e}),ze={utils:{name:"utils",category:"lib",dependencies:["clsx","tailwind-merge"],files:[f("src/lib/utils.ts","{utils}")]},button:{name:"button",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[f("src/components/ui/button.tsx","{ui}/button.tsx")]},input:{name:"input",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[f("src/components/ui/input.tsx","{ui}/input.tsx")]},textarea:{name:"textarea",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/textarea.tsx","{ui}/textarea.tsx")]},checkbox:{name:"checkbox",category:"ui",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/ui/checkbox.tsx","{ui}/checkbox.tsx")]},switch:{name:"switch",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/switch.tsx","{ui}/switch.tsx")]},badge:{name:"badge",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[f("src/components/ui/badge.tsx","{ui}/badge.tsx")]},card:{name:"card",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/card.tsx","{ui}/card.tsx")]},skeleton:{name:"skeleton",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/skeleton.tsx","{ui}/skeleton.tsx")]},tabs:{name:"tabs",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[f("src/components/ui/tabs.tsx","{ui}/tabs.tsx")]},dialog:{name:"dialog",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/ui/dialog.tsx","{ui}/dialog.tsx")]},"dropdown-menu":{name:"dropdown-menu",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[f("src/components/ui/dropdown-menu.tsx","{ui}/dropdown-menu.tsx")]},popover:{name:"popover",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[f("src/components/ui/popover.tsx","{ui}/popover.tsx")]},tooltip:{name:"tooltip",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/tooltip.tsx","{ui}/tooltip.tsx")]},select:{name:"select",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[f("src/components/ui/select.tsx","{ui}/select.tsx")]},table:{name:"table",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/table.tsx","{ui}/table.tsx")]},"segmented-control":{name:"segmented-control",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/segmented-control.tsx","{ui}/segmented-control.tsx")]},"dialog-actions":{name:"dialog-actions",category:"overlay",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/overlay/dialog-actions.tsx","{components}/overlay/dialog-actions.tsx")]},"modal-shell":{name:"modal-shell",category:"overlay",registryDependencies:["dialog","utils"],files:[f("src/components/overlay/modal-shell.tsx","{components}/overlay/modal-shell.tsx")]},"confirm-dialog":{name:"confirm-dialog",category:"overlay",registryDependencies:["modal-shell","dialog-actions"],files:[f("src/components/overlay/confirm-dialog.tsx","{components}/overlay/confirm-dialog.tsx")]},"sheet-shell":{name:"sheet-shell",category:"overlay",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/overlay/sheet-shell.tsx","{components}/overlay/sheet-shell.tsx")]},overlay:{name:"overlay",category:"group",registryDependencies:["dialog-actions","modal-shell","confirm-dialog","sheet-shell"],files:[f("src/components/overlay/index.ts","{components}/overlay/index.ts")]},pagination:{name:"pagination",category:"navigation",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/navigation/pagination.tsx","{components}/navigation/pagination.tsx")]},"input-decorator":{name:"input-decorator",category:"inputs",registryDependencies:["input","utils"],files:[f("src/components/inputs/input-decorator.tsx","{components}/inputs/input-decorator.tsx")]},"input-value":{name:"input-value",category:"inputs",files:[f("src/components/inputs/input-value.ts","{components}/inputs/input-value.ts")]},"clearable-input":{name:"clearable-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input-decorator","input-value"],files:[f("src/components/inputs/clearable-input.tsx","{components}/inputs/clearable-input.tsx")]},"search-input":{name:"search-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["clearable-input"],files:[f("src/components/inputs/search-input.tsx","{components}/inputs/search-input.tsx")]},"password-input":{name:"password-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input","utils"],files:[f("src/components/inputs/password-input.tsx","{components}/inputs/password-input.tsx")]},"number-input":{name:"number-input",category:"inputs",registryDependencies:["input"],files:[f("src/components/inputs/number-input.tsx","{components}/inputs/number-input.tsx")]},"date-input":{name:"date-input",category:"inputs",registryDependencies:["input"],files:[f("src/components/inputs/date-input.tsx","{components}/inputs/date-input.tsx")]},"date-range-input":{name:"date-range-input",category:"inputs",registryDependencies:["date-input","utils"],files:[f("src/components/inputs/date-range-input.tsx","{components}/inputs/date-range-input.tsx")]},"money-input":{name:"money-input",category:"inputs",registryDependencies:["input","utils"],files:[f("src/components/inputs/money-input.tsx","{components}/inputs/money-input.tsx")]},"quantity-input":{name:"quantity-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","utils"],files:[f("src/components/inputs/quantity-input.tsx","{components}/inputs/quantity-input.tsx")]},"masked-input":{name:"masked-input",category:"inputs",registryDependencies:["input","input-value"],files:[f("src/components/inputs/masked-input.tsx","{components}/inputs/masked-input.tsx")]},"phone-input":{name:"phone-input",category:"inputs",registryDependencies:["masked-input"],files:[f("src/components/inputs/phone-input.tsx","{components}/inputs/phone-input.tsx")]},"tag-input":{name:"tag-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["badge","input","utils"],files:[f("src/components/inputs/tag-input.tsx","{components}/inputs/tag-input.tsx")]},"simple-select":{name:"simple-select",category:"inputs",registryDependencies:["select","utils"],files:[f("src/components/inputs/simple-select.tsx","{components}/inputs/simple-select.tsx")]},"async-select":{name:"async-select",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","popover","utils"],files:[f("src/components/inputs/async-select.tsx","{components}/inputs/async-select.tsx")]},inputs:{name:"inputs",category:"group",registryDependencies:["clearable-input","search-input","password-input","number-input","date-input","date-range-input","money-input","quantity-input","masked-input","phone-input","tag-input","simple-select","async-select"],files:[f("src/components/inputs/index.ts","{components}/inputs/index.ts")]},"form-field-shell":{name:"form-field-shell",category:"form",registryDependencies:["utils"],files:[f("src/components/form/form-field-shell.tsx","{components}/form/form-field-shell.tsx")]},"form-input":{name:"form-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["input","search-input","password-input","number-input","phone-input","date-input","form-field-shell"],files:[f("src/components/form/form-input.tsx","{components}/form/form-input.tsx")]},"form-select":{name:"form-select",category:"form",dependencies:["react-hook-form"],registryDependencies:["simple-select","async-select","form-field-shell"],files:[f("src/components/form/form-select.tsx","{components}/form/form-select.tsx")]},"form-async-select":{name:"form-async-select",category:"form",dependencies:["react-hook-form"],registryDependencies:["async-select","form-field-shell"],files:[f("src/components/form/form-async-select.tsx","{components}/form/form-async-select.tsx")]},"form-textarea":{name:"form-textarea",category:"form",dependencies:["react-hook-form"],registryDependencies:["textarea","form-field-shell"],files:[f("src/components/form/form-textarea.tsx","{components}/form/form-textarea.tsx")]},"form-switch":{name:"form-switch",category:"form",dependencies:["react-hook-form"],registryDependencies:["switch","form-field-shell","utils"],files:[f("src/components/form/form-switch.tsx","{components}/form/form-switch.tsx")]},"form-search-input":{name:"form-search-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["search-input","form-field-shell"],files:[f("src/components/form/form-search-input.tsx","{components}/form/form-search-input.tsx")]},"form-password-input":{name:"form-password-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["password-input","form-field-shell"],files:[f("src/components/form/form-password-input.tsx","{components}/form/form-password-input.tsx")]},"form-number-input":{name:"form-number-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["number-input","form-field-shell"],files:[f("src/components/form/form-number-input.tsx","{components}/form/form-number-input.tsx")]},"form-phone-input":{name:"form-phone-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["phone-input","form-field-shell"],files:[f("src/components/form/form-phone-input.tsx","{components}/form/form-phone-input.tsx")]},"form-date-input":{name:"form-date-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-input","form-field-shell"],files:[f("src/components/form/form-date-input.tsx","{components}/form/form-date-input.tsx")]},"form-date-range-input":{name:"form-date-range-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-input","form-field-shell"],files:[f("src/components/form/form-date-range-input.tsx","{components}/form/form-date-range-input.tsx")]},"form-date-picker":{name:"form-date-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-picker","form-field-shell"],files:[f("src/components/form/form-date-picker.tsx","{components}/form/form-date-picker.tsx")]},"form-date-range-picker":{name:"form-date-range-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-picker","form-field-shell"],files:[f("src/components/form/form-date-range-picker.tsx","{components}/form/form-date-range-picker.tsx")]},"form-actions":{name:"form-actions",category:"form",registryDependencies:["button"],files:[f("src/components/form/form-actions.tsx","{components}/form/form-actions.tsx")]},"form-section":{name:"form-section",category:"form",registryDependencies:["utils"],files:[f("src/components/form/form-section.tsx","{components}/form/form-section.tsx")]},"smart-form-shell":{name:"smart-form-shell",category:"form",registryDependencies:["form-actions","form-section","utils"],files:[f("src/components/form/smart-form-shell.tsx","{components}/form/smart-form-shell.tsx")]},form:{name:"form",category:"group",registryDependencies:["form-field-shell","form-input","form-select","form-async-select","form-textarea","form-switch","form-search-input","form-password-input","form-number-input","form-phone-input","form-date-input","form-date-range-input","form-date-picker","form-date-range-picker","form-actions","form-section","smart-form-shell"],files:[f("src/components/form/index.ts","{components}/form/index.ts")]},"empty-state":{name:"empty-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/feedback/empty-state.tsx","{components}/feedback/empty-state.tsx")]},"loading-state":{name:"loading-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/feedback/loading-state.tsx","{components}/feedback/loading-state.tsx")]},"status-badge":{name:"status-badge",category:"feedback",registryDependencies:["badge","utils"],files:[f("src/components/feedback/status-badge.tsx","{components}/feedback/status-badge.tsx")]},"page-state":{name:"page-state",category:"feedback",registryDependencies:["button","utils"],files:[f("src/components/feedback/page-state.tsx","{components}/feedback/page-state.tsx")]},feedback:{name:"feedback",category:"group",registryDependencies:["empty-state","loading-state","status-badge","page-state"],files:[f("src/components/feedback/index.ts","{components}/feedback/index.ts")]},"description-list":{name:"description-list",category:"display",registryDependencies:["card","utils"],files:[f("src/components/display/description-list.tsx","{components}/display/description-list.tsx")]},progress:{name:"progress",category:"display",registryDependencies:["utils"],files:[f("src/components/display/progress.tsx","{components}/display/progress.tsx")]},result:{name:"result",category:"display",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/display/result.tsx","{components}/display/result.tsx")]},timeline:{name:"timeline",category:"display",registryDependencies:["utils"],files:[f("src/components/display/timeline.tsx","{components}/display/timeline.tsx")]},"metric-grid":{name:"metric-grid",category:"display",registryDependencies:["card","utils"],files:[f("src/components/display/metric-grid.tsx","{components}/display/metric-grid.tsx")]},"info-card":{name:"info-card",category:"display",registryDependencies:["card","skeleton","utils"],files:[f("src/components/display/smart-card.tsx","{components}/display/info-card.tsx")]},"activity-feed":{name:"activity-feed",category:"display",registryDependencies:["card","utils"],files:[f("src/components/display/activity-feed.tsx","{components}/display/activity-feed.tsx")]},"property-grid":{name:"property-grid",category:"display",registryDependencies:["utils"],files:[f("src/components/display/property-grid.tsx","{components}/display/property-grid.tsx")]},"smart-card":{name:"smart-card",category:"display",registryDependencies:["card","skeleton","utils"],files:[f("src/components/display/smart-card.tsx","{components}/display/smart-card.tsx")]},"entity-card":{name:"entity-card",category:"display",registryDependencies:["card","utils"],files:[f("src/components/display/entity-card.tsx","{components}/display/entity-card.tsx")]},"file-card":{name:"file-card",category:"display",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/display/file-card.tsx","{components}/display/file-card.tsx")]},display:{name:"display",category:"group",registryDependencies:["description-list","progress","result","timeline","metric-grid","info-card","activity-feed","property-grid","smart-card","entity-card","file-card"],files:[f("src/components/display/index.ts","{components}/display/index.ts")]},"action-menu":{name:"action-menu",category:"actions",dependencies:["lucide-react"],registryDependencies:["button","dropdown-menu","utils"],files:[f("src/components/actions/action-menu.tsx","{components}/actions/action-menu.tsx")]},"button-group":{name:"button-group",category:"actions",registryDependencies:["button","utils"],files:[f("src/components/actions/button-group.tsx","{components}/actions/button-group.tsx")]},"quick-action-grid":{name:"quick-action-grid",category:"actions",registryDependencies:["badge","utils"],files:[f("src/components/actions/quick-action-grid.tsx","{components}/actions/quick-action-grid.tsx")]},"action-system":{name:"action-system",category:"actions",dependencies:["lucide-react"],registryDependencies:["button","dropdown-menu","utils"],files:[f("src/components/patterns/action-system.tsx","{components}/patterns/action-system.tsx")]},actions:{name:"actions",category:"group",registryDependencies:["action-menu","button-group","quick-action-grid","action-system"],files:[f("src/components/actions/index.ts","{components}/actions/index.ts")]},"page-header":{name:"page-header",category:"layout",registryDependencies:["utils"],files:[f("src/components/layout/page-header.tsx","{components}/layout/page-header.tsx")]},"stat-card":{name:"stat-card",category:"layout",registryDependencies:["card","utils"],files:[f("src/components/layout/stat-card.tsx","{components}/layout/stat-card.tsx")]},"app-shell":{name:"app-shell",category:"layout",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/layout/app-shell.tsx","{components}/layout/app-shell.tsx")]},"app-header":{name:"app-header",category:"layout",registryDependencies:["utils"],files:[f("src/components/layout/app-header.tsx","{components}/layout/app-header.tsx")]},"app-sidebar":{name:"app-sidebar",category:"layout",registryDependencies:["utils"],files:[f("src/components/layout/app-sidebar.tsx","{components}/layout/app-sidebar.tsx")]},"sidebar-nav":{name:"sidebar-nav",category:"layout",registryDependencies:["badge","utils"],files:[f("src/components/layout/sidebar-nav.tsx","{components}/layout/sidebar-nav.tsx")]},breadcrumbs:{name:"breadcrumbs",category:"layout",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/layout/breadcrumbs.tsx","{components}/layout/breadcrumbs.tsx")]},"page-container":{name:"page-container",category:"layout",registryDependencies:["utils"],files:[f("src/components/layout/page-container.tsx","{components}/layout/page-container.tsx")]},section:{name:"section",category:"layout",registryDependencies:["utils"],files:[f("src/components/layout/section.tsx","{components}/layout/section.tsx")]},"workspace-shell":{name:"workspace-shell",category:"layout",registryDependencies:["utils"],files:[f("src/components/layout/workspace-shell.tsx","{components}/layout/workspace-shell.tsx")]},layout:{name:"layout",category:"group",registryDependencies:["app-shell","app-header","app-sidebar","page-header","stat-card","sidebar-nav","breadcrumbs","page-container","section","workspace-shell"],files:[f("src/components/layout/index.ts","{components}/layout/index.ts")]},"filter-bar":{name:"filter-bar",category:"filters",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/filters/filter-bar.tsx","{components}/filters/filter-bar.tsx")]},filters:{name:"filters",category:"group",registryDependencies:["filter-bar"],files:[f("src/components/filters/index.ts","{components}/filters/index.ts")]},"data-table-toolbar":{name:"data-table-toolbar",category:"data-table",registryDependencies:["utils"],files:[f("src/components/data-table/data-table-toolbar.tsx","{components}/data-table/data-table-toolbar.tsx")]},"data-table-pagination":{name:"data-table-pagination",category:"data-table",registryDependencies:["pagination","simple-select","utils"],files:[f("src/components/data-table/data-table-pagination.tsx","{components}/data-table/data-table-pagination.tsx")]},"data-table-column-visibility-menu":{name:"data-table-column-visibility-menu",category:"data-table",dependencies:["@tanstack/react-table","lucide-react"],registryDependencies:["button","dropdown-menu","utils"],files:[f("src/components/data-table/data-table-column-visibility-menu.tsx","{components}/data-table/data-table-column-visibility-menu.tsx")]},"data-table-select-column":{name:"data-table-select-column",category:"data-table",dependencies:["@tanstack/react-table"],registryDependencies:["checkbox","utils"],files:[f("src/components/data-table/data-table-select-column.tsx","{components}/data-table/data-table-select-column.tsx")]},"data-table-sortable-header":{name:"data-table-sortable-header",category:"data-table",dependencies:["@tanstack/react-table","lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/data-table/data-table-sortable-header.tsx","{components}/data-table/data-table-sortable-header.tsx")]},"data-table-row-actions":{name:"data-table-row-actions",category:"data-table",dependencies:["@tanstack/react-table"],registryDependencies:["action-menu"],files:[f("src/components/data-table/data-table-row-actions.tsx","{components}/data-table/data-table-row-actions.tsx")]},"data-table-actions-column":{name:"data-table-actions-column",category:"data-table",dependencies:["@tanstack/react-table"],registryDependencies:["data-table-row-actions","utils"],files:[f("src/components/data-table/data-table-actions-column.tsx","{components}/data-table/data-table-actions-column.tsx")]},"data-table-bulk-actions":{name:"data-table-bulk-actions",category:"data-table",dependencies:["lucide-react"],registryDependencies:["action-menu","button","utils"],files:[f("src/components/data-table/data-table-bulk-actions.tsx","{components}/data-table/data-table-bulk-actions.tsx")]},"data-table-view-presets":{name:"data-table-view-presets",category:"data-table",registryDependencies:["badge","button","utils"],files:[f("src/components/data-table/data-table-view-presets.tsx","{components}/data-table/data-table-view-presets.tsx")]},"table-export-menu":{name:"table-export-menu",category:"data-table",dependencies:["lucide-react"],registryDependencies:["button","dropdown-menu"],files:[f("src/components/data-table/table-export-menu.tsx","{components}/data-table/table-export-menu.tsx")]},"table-import-button":{name:"table-import-button",category:"data-table",dependencies:["lucide-react"],registryDependencies:["button"],files:[f("src/components/data-table/table-import-button.tsx","{components}/data-table/table-import-button.tsx")]},"data-table":{name:"data-table",category:"group",dependencies:["@tanstack/react-table"],registryDependencies:["table","empty-state","loading-state","search-input","data-table-toolbar","data-table-pagination","data-table-column-visibility-menu","data-table-select-column","data-table-sortable-header","data-table-row-actions","data-table-actions-column","data-table-bulk-actions","data-table-view-presets","table-export-menu","table-import-button","utils"],files:[f("src/components/data-table/data-table.tsx","{components}/data-table/data-table.tsx"),f("src/components/data-table/index.ts","{components}/data-table/index.ts")]},calendar:{name:"calendar",category:"calendar",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/calendar/date-utils.ts","{components}/calendar/date-utils.ts"),f("src/components/calendar/calendar.tsx","{components}/calendar/calendar.tsx")]},"date-picker":{name:"date-picker",category:"calendar",dependencies:["lucide-react"],registryDependencies:["calendar","button","popover","utils"],files:[f("src/components/calendar/date-picker.tsx","{components}/calendar/date-picker.tsx")]},"date-range-picker":{name:"date-range-picker",category:"calendar",dependencies:["lucide-react"],registryDependencies:["calendar","button","popover","utils"],files:[f("src/components/calendar/date-range-picker.tsx","{components}/calendar/date-range-picker.tsx")]},"calendar-kit":{name:"calendar-kit",category:"group",registryDependencies:["calendar","date-picker","date-range-picker"],files:[f("src/components/calendar/index.ts","{components}/calendar/index.ts")]},"file-upload":{name:"file-upload",category:"upload",registryDependencies:["button"],files:[f("src/components/upload/file-upload.tsx","{components}/upload/file-upload.tsx")]},"image-upload":{name:"image-upload",category:"upload",registryDependencies:["file-upload"],files:[f("src/components/upload/image-upload.tsx","{components}/upload/image-upload.tsx")]},upload:{name:"upload",category:"group",registryDependencies:["file-upload","image-upload"],files:[f("src/components/upload/index.ts","{components}/upload/index.ts")]},stepper:{name:"stepper",category:"wizard",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/wizard/stepper.tsx","{components}/wizard/stepper.tsx")]},wizard:{name:"wizard",category:"wizard",registryDependencies:["button","stepper","utils"],files:[f("src/components/wizard/wizard.tsx","{components}/wizard/wizard.tsx")]},"wizard-kit":{name:"wizard-kit",category:"group",registryDependencies:["stepper","wizard"],files:[f("src/components/wizard/index.ts","{components}/wizard/index.ts")]},toast:{name:"toast",category:"notifications",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/notifications/toast.tsx","{components}/notifications/toast.tsx")]},notifications:{name:"notifications",category:"group",registryDependencies:["toast"],files:[f("src/components/notifications/index.ts","{components}/notifications/index.ts")]},"command-palette":{name:"command-palette",category:"command",dependencies:["lucide-react"],registryDependencies:["dialog","input","utils"],files:[f("src/components/command/command-palette.tsx","{components}/command/command-palette.tsx")]},command:{name:"command",category:"group",registryDependencies:["command-palette"],files:[f("src/components/command/index.ts","{components}/command/index.ts")]},"resource-page":{name:"resource-page",category:"patterns",registryDependencies:["data-table","page-header","utils"],files:[f("src/components/patterns/resource-page.tsx","{components}/patterns/resource-page.tsx")]},"resource-detail-page":{name:"resource-detail-page",category:"patterns",registryDependencies:["button","description-list","page-header","utils"],files:[f("src/components/patterns/resource-detail-page.tsx","{components}/patterns/resource-detail-page.tsx")]},"form-builder":{name:"form-builder",category:"patterns",dependencies:["react-hook-form"],registryDependencies:["button","form-input","form-textarea","form-select","form-async-select","form-switch","form-number-input","form-phone-input","form-date-input","form-date-range-input","utils"],files:[f("src/components/patterns/form-builder.tsx","{components}/patterns/form-builder.tsx")]},"form-builder-presets":{name:"form-builder-presets",category:"patterns",dependencies:["react-hook-form"],registryDependencies:["form-builder"],files:[f("src/components/patterns/form-builder-presets.ts","{components}/patterns/form-builder-presets.ts")]},"status-system":{name:"status-system",category:"patterns",registryDependencies:["badge","utils"],files:[f("src/components/patterns/status-system.tsx","{components}/patterns/status-system.tsx")]},"filter-builder":{name:"filter-builder",category:"patterns",dependencies:["lucide-react"],registryDependencies:["button","input","utils"],files:[f("src/components/patterns/filter-builder.tsx","{components}/patterns/filter-builder.tsx")]},"data-view":{name:"data-view",category:"patterns",registryDependencies:["page-state","utils"],files:[f("src/components/patterns/data-view.tsx","{components}/patterns/data-view.tsx")]},"entity-details":{name:"entity-details",category:"patterns",registryDependencies:["property-grid","tabs","utils"],files:[f("src/components/patterns/entity-details.tsx","{components}/patterns/entity-details.tsx")]},"resource-system":{name:"resource-system",category:"patterns",registryDependencies:["data-view","entity-details","utils"],files:[f("src/components/patterns/resource-system.tsx","{components}/patterns/resource-system.tsx")]},"crud-system":{name:"crud-system",category:"patterns",registryDependencies:["resource-system","action-system","button","utils"],files:[f("src/components/patterns/crud-system.tsx","{components}/patterns/crud-system.tsx")]},patterns:{name:"patterns",category:"group",registryDependencies:["resource-page","resource-detail-page","form-builder","form-builder-presets","status-system","filter-builder","data-view","entity-details","resource-system","crud-system"],files:[f("src/components/patterns/index.ts","{components}/patterns/index.ts")]},"use-session-storage-state":{name:"use-session-storage-state",category:"hooks",files:[f("src/hooks/use-session-storage-state.ts","{hooks}/use-session-storage-state.ts")]},"use-before-unload-when-dirty":{name:"use-before-unload-when-dirty",category:"hooks",files:[f("src/hooks/use-before-unload-when-dirty.ts","{hooks}/use-before-unload-when-dirty.ts")]},"use-is-mobile":{name:"use-is-mobile",category:"hooks",files:[f("src/hooks/use-is-mobile.ts","{hooks}/use-is-mobile.ts")]},"use-disclosure":{name:"use-disclosure",category:"hooks",files:[f("src/hooks/use-disclosure.ts","{hooks}/use-disclosure.ts")]},"use-debounce":{name:"use-debounce",category:"hooks",files:[f("src/hooks/use-debounce.ts","{hooks}/use-debounce.ts")]},"use-data-table-view-state":{name:"use-data-table-view-state",category:"hooks",files:[f("src/hooks/use-data-table-view-state.ts","{hooks}/use-data-table-view-state.ts")]},hooks:{name:"hooks",category:"group",registryDependencies:["use-session-storage-state","use-before-unload-when-dirty","use-is-mobile","use-disclosure","use-debounce","use-data-table-view-state"],files:[f("src/hooks/index.ts","{hooks}/index.ts")]},dashboard:{name:"dashboard",category:"group",registryDependencies:["layout","actions","filters","feedback","display","data-table","inputs","form","patterns","notifications","command"]},all:{name:"all",category:"group",registryDependencies:["dashboard","overlay","calendar-kit","upload","wizard-kit","hooks"]}},Pn=Object.keys(ze);var In=Ie(et());function $n(t){let e=ne.dirname(fileURLToPath(t)),r=ne.resolve(e,"../vendor");if(In.default.existsSync(ne.join(r,"src")))return r;let i=[ne.resolve(e,"../.."),ne.resolve(e,".."),process.cwd()];for(let n of i){let s=ne.join(n,"package.json");if(In.default.existsSync(s))try{if(In.default.readJsonSync(s).name===An)return n}catch{}}return ne.resolve(e,"../..")}function qA(t){return t in ze}function jA(t){if(t.paths?.components)return t.paths.components;let e=t.componentsPath??"src/components/ui";return e.endsWith("/ui")||e.endsWith("\\ui")?ne.dirname(e):e}function NA(t,e){let r=jA(e),i=e.paths?.ui??e.componentsPath??ne.join(r,"ui"),n=e.paths?.hooks??"src/hooks",s=e.paths?.lib??ne.dirname(e.utilsPath??"src/lib/utils.ts"),o=e.utilsPath??ne.join(s,"utils.ts");return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{hooks}",n).replaceAll("{lib}",s).replaceAll("{utils}",o)}function BA(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function UA(t){let e=[],r=new Set;function i(n){if(r.has(n))return;let s=ze[n];s.registryDependencies?.forEach(i),r.add(n),e.push(s);}return t.forEach(i),e}function GA(){return Pn.filter(t=>ze[t].category!=="lib").sort().join(", ")}async function _b(t,e={}){let r=process.cwd(),i=ne.join(r,"azamat-ui.json");lt.default.existsSync(i)||(C.error("azamat-ui.json topilmadi. Avval init qiling:"),C.info(Ae("init")),process.exit(1)),t.length||(C.error("Component nomini kiriting:"),C.info(Ae("add data-table async-select form-input")),C.info(`Mavjud componentlar: ${GA()}`),process.exit(1));let n=[];for(let l of t){if(!qA(l)){C.warn(`${l} registry ichida mavjud emas.`);continue}n.push(l);}n.length||(C.error("Qo\u2018shish uchun valid component topilmadi."),process.exit(1));let s=await lt.default.readJson(i),o=$n(import.meta.url),a=yi(r),c=UA(n),u=new Set;for(let l of c){l.dependencies?.forEach(d=>u.add(d));for(let d of l.files??[]){let h=ne.join(o,d.source),p=ne.join(r,NA(d.target,s));if(!lt.default.existsSync(h)){C.warn(`${d.source} topilmadi. O\u2018tkazib yuborildi.`);continue}if(e.dryRun){C.info(`[dry-run] ${d.source} -> ${ne.relative(r,p)}`);continue}if(await lt.default.ensureDir(ne.dirname(p)),lt.default.existsSync(p)&&!e.overwrite){C.warn(`${ne.relative(r,p)} allaqachon mavjud. O\u2018tkazib yuborildi.`);continue}let g=await lt.default.readFile(h,"utf8");await lt.default.writeFile(p,BA(g,s.alias)),C.success(`${ne.relative(r,p)} qo\u2018shildi.`);}}!e.skipInstall&&u.size>0&&!e.dryRun&&await qr({cwd:r,packageManager:a,packages:Array.from(u)}),C.success("Componentlar muvaffaqiyatli qo\u2018shildi.");}var VA={utils:"internal",button:"stable",input:"stable",textarea:"stable",checkbox:"stable",switch:"stable",badge:"stable",card:"stable",dialog:"stable","dropdown-menu":"stable",popover:"stable",select:"stable",table:"stable","dialog-actions":"stable","modal-shell":"stable","confirm-dialog":"stable","sheet-shell":"stable",overlay:"stable",pagination:"stable","clearable-input":"preview","search-input":"preview","password-input":"preview","number-input":"preview","date-input":"preview","date-range-input":"preview","money-input":"preview","quantity-input":"preview","masked-input":"preview","phone-input":"preview","simple-select":"preview","async-select":"preview",inputs:"preview","form-field-shell":"preview","form-input":"preview","form-select":"preview","form-async-select":"preview","form-textarea":"preview","form-switch":"preview","form-search-input":"preview","form-password-input":"preview","form-number-input":"preview","form-phone-input":"preview","form-date-input":"preview","form-date-range-input":"preview","form-date-picker":"preview","form-date-range-picker":"preview",form:"preview","empty-state":"stable","loading-state":"stable","status-badge":"stable",feedback:"stable","description-list":"stable",progress:"stable",result:"stable",timeline:"stable","metric-grid":"stable","info-card":"stable","activity-feed":"stable",display:"stable","action-menu":"stable",actions:"stable","page-header":"stable","stat-card":"stable","app-shell":"stable","app-header":"stable","app-sidebar":"stable","sidebar-nav":"stable",breadcrumbs:"stable","page-container":"stable",layout:"stable","filter-bar":"stable",filters:"stable","data-table-toolbar":"preview","data-table-pagination":"preview","data-table-column-visibility-menu":"preview","data-table-select-column":"preview","data-table-sortable-header":"preview","data-table-row-actions":"preview","data-table-actions-column":"preview","data-table-bulk-actions":"preview","data-table-view-presets":"preview","data-table":"preview",calendar:"preview","date-picker":"preview","date-range-picker":"preview","calendar-kit":"preview","file-upload":"preview","image-upload":"preview",upload:"preview",stepper:"preview",wizard:"preview","wizard-kit":"preview",toast:"preview",notifications:"preview","command-palette":"preview",command:"preview","resource-page":"preview","resource-detail-page":"preview","form-builder":"experimental","form-builder-presets":"experimental",patterns:"preview","use-session-storage-state":"stable","use-before-unload-when-dirty":"stable","use-is-mobile":"stable","use-disclosure":"stable","use-debounce":"stable","use-data-table-view-state":"preview",hooks:"stable",dashboard:"preview",all:"preview"};function Tb(t){return VA[t]??"preview"}var WA={lib:"foundation",ui:"foundation",hooks:"foundation",overlay:"source-copy",navigation:"source-copy",inputs:"source-copy",form:"source-copy",feedback:"source-copy",display:"source-copy",actions:"source-copy",layout:"source-copy",filters:"source-copy","data-table":"system",calendar:"source-copy",upload:"source-copy",wizard:"source-copy",notifications:"source-copy",command:"source-copy",patterns:"system",group:"system"},HA={utils:"foundation",button:"foundation",input:"foundation",textarea:"foundation",checkbox:"foundation",switch:"foundation",badge:"foundation",card:"foundation",skeleton:"foundation",tabs:"foundation",dialog:"foundation","dropdown-menu":"foundation",popover:"foundation",select:"foundation",table:"foundation","use-session-storage-state":"foundation","use-before-unload-when-dirty":"foundation","use-is-mobile":"foundation","use-disclosure":"foundation","use-debounce":"foundation",hooks:"foundation","data-table":"system","form-builder":"system","form-builder-presets":"system","resource-page":"system","resource-detail-page":"system","action-system":"system","status-system":"system","filter-builder":"system","data-view":"system","entity-details":"system","resource-system":"system","crud-system":"system","calendar-kit":"system","wizard-kit":"system",dashboard:"system",all:"system"};function Ab(t,e){return HA[t]??WA[e]}function Pb(){let t=Pn.filter(e=>ze[e].category!=="lib").reduce((e,r)=>{let i=ze[r].category;return e[i]??=[],e[i].push(r),e},{});for(let[e,r]of Object.entries(t))console.log(`
|
|
429
|
-
${e}`),r.sort().forEach(i=>{let n=ze[i],s=Tb(i),o=Ab(i,n.category),a=n.registryDependencies?.length?` -> ${n.registryDependencies.join(", ")}`:"";console.log(` ${i} [${s}/${o}]${a}`);});console.log(`
|
|
430
|
-
Status:`),console.log(" stable = safe public API"),console.log(" preview = usable but API may change"),console.log(" experimental = not ready for stable app contracts"),console.log(" internal = helper metadata"),console.log(`
|
|
431
|
-
Distribution:`),console.log(" foundation = small runtime-safe primitives, hooks, and helpers"),console.log(" source-copy = copy into app source with init/add and edit locally"),console.log(" system = larger product surfaces, kits, and patterns; prefer source-copy only"),console.log(`
|
|
432
|
-
Usage:`),console.log(` ${Ae("add button input data-table")}`),console.log(` ${Ae("add form --overwrite")}`);}var ja=Ie(et());async function Ib(t){let e=process.cwd(),r=ne.join(e,"azamat-ui.json"),i=ja.default.existsSync(r)?await ja.default.readJson(r):{},n=t??i.cssPath??i.globalCssPath??"src/index.css",s=await Tn({cwd:e,cssPath:n});C.success(`Azamat UI theme CSS yangilandi: ${s}`);}var Ct=Ie(et());var $b={minimal:[{source:"src/lib/utils.ts",target:"{utils}"},{source:"src/components/ui/button.tsx",target:"{ui}/button.tsx"},{source:"src/components/ui/input.tsx",target:"{ui}/input.tsx"},{source:"src/components/ui/card.tsx",target:"{ui}/card.tsx"},{source:"src/components/ui/badge.tsx",target:"{ui}/badge.tsx"}],dashboard:[{source:"src/lib/utils.ts",target:"{utils}"},{source:"src/components/ui/button.tsx",target:"{ui}/button.tsx"},{source:"src/components/ui/input.tsx",target:"{ui}/input.tsx"},{source:"src/components/ui/card.tsx",target:"{ui}/card.tsx"},{source:"src/components/ui/badge.tsx",target:"{ui}/badge.tsx"},{source:"src/components/ui/dropdown-menu.tsx",target:"{ui}/dropdown-menu.tsx"},{source:"src/components/ui/skeleton.tsx",target:"{ui}/skeleton.tsx"},{source:"src/components/ui/tabs.tsx",target:"{ui}/tabs.tsx"},{source:"src/components/feedback/page-state.tsx",target:"{components}/feedback/page-state.tsx"},{source:"src/components/display/property-grid.tsx",target:"{components}/display/property-grid.tsx"},{source:"src/components/display/smart-card.tsx",target:"{components}/display/smart-card.tsx"},{source:"src/components/display/entity-card.tsx",target:"{components}/display/entity-card.tsx"},{source:"src/components/patterns/action-system.tsx",target:"{components}/patterns/action-system.tsx"},{source:"src/components/patterns/status-system.tsx",target:"{components}/patterns/status-system.tsx"},{source:"src/components/patterns/filter-builder.tsx",target:"{components}/patterns/filter-builder.tsx"},{source:"src/components/patterns/data-view.tsx",target:"{components}/patterns/data-view.tsx"},{source:"src/components/patterns/entity-details.tsx",target:"{components}/patterns/entity-details.tsx"},{source:"src/components/patterns/resource-system.tsx",target:"{components}/patterns/resource-system.tsx"},{source:"src/components/patterns/crud-system.tsx",target:"{components}/patterns/crud-system.tsx"},{source:"src/components/form/form-actions.tsx",target:"{components}/form/form-actions.tsx"},{source:"src/components/form/form-section.tsx",target:"{components}/form/form-section.tsx"},{source:"src/components/form/smart-form-shell.tsx",target:"{components}/form/smart-form-shell.tsx"},{source:"src/components/layout/workspace-shell.tsx",target:"{components}/layout/workspace-shell.tsx"}]};function YA(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function JA(t,e){let r=e.paths?.components??"src/components",i=e.paths?.ui??"src/components/ui",n=e.utilsPath??"src/lib/utils.ts";return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{utils}",n)}async function Mb(t,e={}){let r=$b[t];r||(C.error(`Preset topilmadi: ${t}`),process.exit(1));let i=process.cwd(),n=ne.join(i,"azamat-ui.json");Ct.default.existsSync(n)||(C.error("azamat-ui.json topilmadi. Avval init qiling."),process.exit(1));let s=await Ct.default.readJson(n),o=$n(import.meta.url);for(let a of r){let c=ne.join(o,a.source),u=ne.join(i,JA(a.target,s));if(e.dryRun){C.info(`[dry-run] ${a.source} -> ${ne.relative(i,u)}`);continue}if(Ct.default.existsSync(u)&&!e.overwrite){C.warn(`${ne.relative(i,u)} allaqachon mavjud.`);continue}await Ct.default.ensureDir(ne.dirname(u)),await Ct.default.writeFile(u,YA(await Ct.default.readFile(c,"utf8"),s.alias)),C.success(`${ne.relative(i,u)} qo\u2018shildi.`);}}var kt=new _t;kt.name("azamat-ui-kit").description("Azamat UI Kit CLI").version("0.2.1");kt.command("init").description("Initialize Azamat UI Kit in your project").option("--template <template>","Project defaults: vite or next","vite").option("--skip-install","Do not install base dependencies").option("-y, --defaults","Use template defaults without interactive prompts").action(Db);kt.command("preset").description("Add a source-copy preset to your project").argument("<name>","preset name: minimal or dashboard").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(Mb);kt.command("list").description("List available registry components").action(Pb);kt.command("add").description("Add components to your project").argument("[components...]","components to add").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(_b);kt.command("theme").description("Write or update Azamat UI theme CSS in your global CSS file").argument("[cssPath]","global CSS path, default from azamat-ui.json or src/index.css").action(Ib);kt.parse();
|