@under_koen/bsm 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +28 -26
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -1,29 +1,31 @@
1
1
  #! /usr/bin/env node
2
- "use strict";var Cn=Object.create;var oe=Object.defineProperty;var Fn=Object.getOwnPropertyDescriptor;var bn=Object.getOwnPropertyNames;var Bn=Object.getPrototypeOf,yn=Object.prototype.hasOwnProperty;var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),An=(t,e)=>{for(var n in e)oe(t,n,{get:e[n],enumerable:!0})},nt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of bn(e))!yn.call(t,u)&&u!==n&&oe(t,u,{get:()=>e[u],enumerable:!(r=Fn(e,u))||r.enumerable});return t};var x=(t,e,n)=>(n=t!=null?Cn(Bn(t)):{},nt(e||!t||!t.__esModule?oe(n,"default",{value:t,enumerable:!0}):n,t)),wn=t=>nt(oe({},"__esModule",{value:!0}),t);var ot=v((Er,it)=>{"use strict";function vn(t,e){var n=t;e.slice(0,-1).forEach(function(u){n=n[u]||{}});var r=e[e.length-1];return r in n}function rt(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function ut(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}it.exports=function(t,e){e||(e={});var n={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(n.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?n.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(f){n.bools[f]=!0});var r={};function u(f){return r[f].some(function(g){return n.bools[g]})}Object.keys(e.alias||{}).forEach(function(f){r[f]=[].concat(e.alias[f]),r[f].forEach(function(g){r[g]=[f].concat(r[f].filter(function(R){return g!==R}))})}),[].concat(e.string).filter(Boolean).forEach(function(f){n.strings[f]=!0,r[f]&&[].concat(r[f]).forEach(function(g){n.strings[g]=!0})});var i=e.default||{},o={_:[]};function s(f,g){return n.allBools&&/^--[^=]+$/.test(g)||n.strings[f]||n.bools[f]||r[f]}function D(f,g,R){for(var C=f,M=0;M<g.length-1;M++){var T=g[M];if(ut(C,T))return;C[T]===void 0&&(C[T]={}),(C[T]===Object.prototype||C[T]===Number.prototype||C[T]===String.prototype)&&(C[T]={}),C[T]===Array.prototype&&(C[T]=[]),C=C[T]}var y=g[g.length-1];ut(C,y)||((C===Object.prototype||C===Number.prototype||C===String.prototype)&&(C={}),C===Array.prototype&&(C=[]),C[y]===void 0||n.bools[y]||typeof C[y]=="boolean"?C[y]=R:Array.isArray(C[y])?C[y].push(R):C[y]=[C[y],R])}function l(f,g,R){if(!(R&&n.unknownFn&&!s(f,R)&&n.unknownFn(R)===!1)){var C=!n.strings[f]&&rt(g)?Number(g):g;D(o,f.split("."),C),(r[f]||[]).forEach(function(M){D(o,M.split("."),C)})}}Object.keys(n.bools).forEach(function(f){l(f,i[f]===void 0?!1:i[f])});var p=[];t.indexOf("--")!==-1&&(p=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var m=0;m<t.length;m++){var a=t[m],F,A;if(/^--.+=/.test(a)){var k=a.match(/^--([^=]+)=([\s\S]*)$/);F=k[1];var L=k[2];n.bools[F]&&(L=L!=="false"),l(F,L,a)}else if(/^--no-.+/.test(a))F=a.match(/^--no-(.+)/)[1],l(F,!1,a);else if(/^--.+/.test(a))F=a.match(/^--(.+)/)[1],A=t[m+1],A!==void 0&&!/^(-|--)[^-]/.test(A)&&!n.bools[F]&&!n.allBools&&(!r[F]||!u(F))?(l(F,A,a),m+=1):/^(true|false)$/.test(A)?(l(F,A==="true",a),m+=1):l(F,n.strings[F]?"":!0,a);else if(/^-[^-]+/.test(a)){for(var S=a.slice(1,-1).split(""),j=!1,B=0;B<S.length;B++){if(A=a.slice(B+2),A==="-"){l(S[B],A,a);continue}if(/[A-Za-z]/.test(S[B])&&A[0]==="="){l(S[B],A.slice(1),a),j=!0;break}if(/[A-Za-z]/.test(S[B])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(A)){l(S[B],A,a),j=!0;break}if(S[B+1]&&S[B+1].match(/\W/)){l(S[B],a.slice(B+2),a),j=!0;break}else l(S[B],n.strings[S[B]]?"":!0,a)}F=a.slice(-1)[0],!j&&F!=="-"&&(t[m+1]&&!/^(-|--)[^-]/.test(t[m+1])&&!n.bools[F]&&(!r[F]||!u(F))?(l(F,t[m+1],a),m+=1):t[m+1]&&/^(true|false)$/.test(t[m+1])?(l(F,t[m+1]==="true",a),m+=1):l(F,n.strings[F]?"":!0,a))}else if((!n.unknownFn||n.unknownFn(a)!==!1)&&o._.push(n.strings._||!rt(a)?a:Number(a)),e.stopEarly){o._.push.apply(o._,t.slice(m+1));break}}return Object.keys(i).forEach(function(f){vn(o,f.split("."))||(D(o,f.split("."),i[f]),(r[f]||[]).forEach(function(g){D(o,g.split("."),i[f])}))}),e["--"]?o["--"]=p.slice():p.forEach(function(f){o._.push(f)}),o}});var ht=v((Tr,pt)=>{var Te=require("node:tty"),at,he,ft,Rn=((ft=(he=(at=Te==null?void 0:Te.WriteStream)==null?void 0:at.prototype)==null?void 0:he.hasColors)==null?void 0:ft.call(he))??!1,d=(t,e)=>{if(!Rn)return u=>u;let n=`\x1B[${t}m`,r=`\x1B[${e}m`;return u=>{let i=u+"",o=i.indexOf(r);if(o===-1)return n+i+r;let s=n,D=0;for(;o!==-1;)s+=i.slice(D,o)+n,D=o+r.length,o=i.indexOf(r,D);return s+=i.slice(D)+r,s}},h={};h.reset=d(0,0);h.bold=d(1,22);h.dim=d(2,22);h.italic=d(3,23);h.underline=d(4,24);h.overline=d(53,55);h.inverse=d(7,27);h.hidden=d(8,28);h.strikethrough=d(9,29);h.black=d(30,39);h.red=d(31,39);h.green=d(32,39);h.yellow=d(33,39);h.blue=d(34,39);h.magenta=d(35,39);h.cyan=d(36,39);h.white=d(37,39);h.gray=d(90,39);h.bgBlack=d(40,49);h.bgRed=d(41,49);h.bgGreen=d(42,49);h.bgYellow=d(43,49);h.bgBlue=d(44,49);h.bgMagenta=d(45,49);h.bgCyan=d(46,49);h.bgWhite=d(47,49);h.bgGray=d(100,49);h.redBright=d(91,39);h.greenBright=d(92,39);h.yellowBright=d(93,39);h.blueBright=d(94,39);h.magentaBright=d(95,39);h.cyanBright=d(96,39);h.whiteBright=d(97,39);h.bgRedBright=d(101,49);h.bgGreenBright=d(102,49);h.bgYellowBright=d(103,49);h.bgBlueBright=d(104,49);h.bgMagentaBright=d(105,49);h.bgCyanBright=d(106,49);h.bgWhiteBright=d(107,49);pt.exports=h});var Et=v((Jr,gt)=>{"use strict";gt.exports=jn;function Mn(t){let e={defaultWidth:0,output:process.stdout,tty:require("tty")};return t?(Object.keys(e).forEach(function(n){t[n]||(t[n]=e[n])}),t):e}function jn(t){let e=Mn(t);if(e.output.getWindowSize)return e.output.getWindowSize()[0]||e.defaultWidth;if(e.tty.getWindowSize)return e.tty.getWindowSize()[1]||e.defaultWidth;if(e.output.columns)return e.output.columns;if(process.env.CLI_WIDTH){let n=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(n)&&n!==0)return n}return e.defaultWidth}});var Ft=v((Xr,Ct)=>{"use strict";Ct.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Pe=v((Zr,bt)=>{"use strict";var Nn=Ft();bt.exports=t=>typeof t=="string"?t.replace(Nn(),""):t});var yt=v((eu,ke)=>{"use strict";var Bt=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);ke.exports=Bt;ke.exports.default=Bt});var wt=v((tu,At)=>{"use strict";At.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var St=v((nu,Me)=>{"use strict";var $n=Pe(),Hn=yt(),Gn=wt(),vt=t=>{if(typeof t!="string"||t.length===0||(t=$n(t),t.length===0))return 0;t=t.replace(Gn()," ");let e=0;for(let n=0;n<t.length;n++){let r=t.codePointAt(n);r<=31||r>=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,e+=Hn(r)?2:1)}return e};Me.exports=vt;Me.exports.default=vt});var Rt=v((ru,xt)=>{"use strict";xt.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var je=v((uu,It)=>{var ne=Rt(),Lt={};for(let t of Object.keys(ne))Lt[ne[t]]=t;var c={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};It.exports=c;for(let t of Object.keys(c)){if(!("channels"in c[t]))throw new Error("missing channels property: "+t);if(!("labels"in c[t]))throw new Error("missing channel labels property: "+t);if(c[t].labels.length!==c[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=c[t];delete c[t].channels,delete c[t].labels,Object.defineProperty(c[t],"channels",{value:e}),Object.defineProperty(c[t],"labels",{value:n})}c.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,u=Math.min(e,n,r),i=Math.max(e,n,r),o=i-u,s,D;i===u?s=0:e===i?s=(n-r)/o:n===i?s=2+(r-e)/o:r===i&&(s=4+(e-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(u+i)/2;return i===u?D=0:l<=.5?D=o/(i+u):D=o/(2-i-u),[s,D*100,l*100]};c.rgb.hsv=function(t){let e,n,r,u,i,o=t[0]/255,s=t[1]/255,D=t[2]/255,l=Math.max(o,s,D),p=l-Math.min(o,s,D),m=function(a){return(l-a)/6/p+1/2};return p===0?(u=0,i=0):(i=p/l,e=m(o),n=m(s),r=m(D),o===l?u=r-n:s===l?u=1/3+e-r:D===l&&(u=2/3+n-e),u<0?u+=1:u>1&&(u-=1)),[u*360,i*100,l*100]};c.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],u=c.rgb.hsl(t)[0],i=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[u,i*100,r*100]};c.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,u=Math.min(1-e,1-n,1-r),i=(1-e-u)/(1-u)||0,o=(1-n-u)/(1-u)||0,s=(1-r-u)/(1-u)||0;return[i*100,o*100,s*100,u*100]};function qn(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}c.rgb.keyword=function(t){let e=Lt[t];if(e)return e;let n=1/0,r;for(let u of Object.keys(ne)){let i=ne[u],o=qn(t,i);o<n&&(n=o,r=u)}return r};c.keyword.rgb=function(t){return ne[t]};c.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let u=e*.4124+n*.3576+r*.1805,i=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[u*100,i*100,o*100]};c.rgb.lab=function(t){let e=c.rgb.xyz(t),n=e[0],r=e[1],u=e[2];n/=95.047,r/=100,u/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let i=116*r-16,o=500*(n-r),s=200*(r-u);return[i,o,s]};c.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,u,i,o;if(n===0)return o=r*255,[o,o,o];r<.5?u=r*(1+n):u=r+n-r*n;let s=2*r-u,D=[0,0,0];for(let l=0;l<3;l++)i=e+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?o=s+(u-s)*6*i:2*i<1?o=u:3*i<2?o=s+(u-s)*(2/3-i)*6:o=s,D[l]=o*255;return D};c.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,u=n,i=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,u*=i<=1?i:2-i;let o=(r+n)/2,s=r===0?2*u/(i+u):2*n/(r+n);return[e,s*100,o*100]};c.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,u=Math.floor(e)%6,i=e-Math.floor(e),o=255*r*(1-n),s=255*r*(1-n*i),D=255*r*(1-n*(1-i));switch(r*=255,u){case 0:return[r,D,o];case 1:return[s,r,o];case 2:return[o,r,D];case 3:return[o,s,r];case 4:return[D,o,r];case 5:return[r,o,s]}};c.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,u=Math.max(r,.01),i,o;o=(2-n)*r;let s=(2-n)*u;return i=n*u,i/=s<=1?s:2-s,i=i||0,o/=2,[e,i*100,o*100]};c.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,u=n+r,i;u>1&&(n/=u,r/=u);let o=Math.floor(6*e),s=1-r;i=6*e-o,(o&1)!==0&&(i=1-i);let D=n+i*(s-n),l,p,m;switch(o){default:case 6:case 0:l=s,p=D,m=n;break;case 1:l=D,p=s,m=n;break;case 2:l=n,p=s,m=D;break;case 3:l=n,p=D,m=s;break;case 4:l=D,p=n,m=s;break;case 5:l=s,p=n,m=D;break}return[l*255,p*255,m*255]};c.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,u=t[3]/100,i=1-Math.min(1,e*(1-u)+u),o=1-Math.min(1,n*(1-u)+u),s=1-Math.min(1,r*(1-u)+u);return[i*255,o*255,s*255]};c.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,u,i,o;return u=e*3.2406+n*-1.5372+r*-.4986,i=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,u=Math.min(Math.max(0,u),1),i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),[u*255,i*255,o*255]};c.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let u=116*n-16,i=500*(e-n),o=200*(n-r);return[u,i,o]};c.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],u,i,o;i=(e+16)/116,u=n/500+i,o=i-r/200;let s=i**3,D=u**3,l=o**3;return i=s>.008856?s:(i-16/116)/7.787,u=D>.008856?D:(u-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,u*=95.047,i*=100,o*=108.883,[u,i,o]};c.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],u;u=Math.atan2(r,n)*360/2/Math.PI,u<0&&(u+=360);let o=Math.sqrt(n*n+r*r);return[e,o,u]};c.lch.lab=function(t){let e=t[0],n=t[1],u=t[2]/360*2*Math.PI,i=n*Math.cos(u),o=n*Math.sin(u);return[e,i,o]};c.rgb.ansi16=function(t,e=null){let[n,r,u]=t,i=e===null?c.rgb.hsv(t)[2]:e;if(i=Math.round(i/50),i===0)return 30;let o=30+(Math.round(u/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return i===2&&(o+=60),o};c.hsv.ansi16=function(t){return c.rgb.ansi16(c.hsv.rgb(t),t[2])};c.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};c.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,u=(e>>1&1)*n*255,i=(e>>2&1)*n*255;return[r,u,i]};c.ansi256.rgb=function(t){if(t>=232){let i=(t-232)*10+8;return[i,i,i]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,u=e%6/5*255;return[n,r,u]};c.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};c.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(s=>s+s).join(""));let r=parseInt(n,16),u=r>>16&255,i=r>>8&255,o=r&255;return[u,i,o]};c.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,u=Math.max(Math.max(e,n),r),i=Math.min(Math.min(e,n),r),o=u-i,s,D;return o<1?s=i/(1-o):s=0,o<=0?D=0:u===e?D=(n-r)/o%6:u===n?D=2+(r-e)/o:D=4+(e-n)/o,D/=6,D%=1,[D*360,o*100,s*100]};c.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),u=0;return r<1&&(u=(n-.5*r)/(1-r)),[t[0],r*100,u*100]};c.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,u=0;return r<1&&(u=(n-r)/(1-r)),[t[0],r*100,u*100]};c.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let u=[0,0,0],i=e%1*6,o=i%1,s=1-o,D=0;switch(Math.floor(i)){case 0:u[0]=1,u[1]=o,u[2]=0;break;case 1:u[0]=s,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=o;break;case 3:u[0]=0,u[1]=s,u[2]=1;break;case 4:u[0]=o,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=s}return D=(1-n)*r,[(n*u[0]+D)*255,(n*u[1]+D)*255,(n*u[2]+D)*255]};c.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),u=0;return r>0&&(u=e/r),[t[0],u*100,r*100]};c.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,u=0;return r>0&&r<.5?u=e/(2*r):r>=.5&&r<1&&(u=e/(2*(1-r))),[t[0],u*100,r*100]};c.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};c.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,u=r-e,i=0;return u<1&&(i=(r-u)/(1-u)),[t[0],u*100,i*100]};c.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};c.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};c.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};c.gray.hsl=function(t){return[0,0,t[0]]};c.gray.hsv=c.gray.hsl;c.gray.hwb=function(t){return[0,100,t[0]]};c.gray.cmyk=function(t){return[0,0,0,t[0]]};c.gray.lab=function(t){return[t[0],0,0]};c.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};c.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var _t=v((iu,Tt)=>{var me=je();function Vn(){let t={},e=Object.keys(me);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function Wn(t){let e=Vn(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),u=Object.keys(me[r]);for(let i=u.length,o=0;o<i;o++){let s=u[o],D=e[s];D.distance===-1&&(D.distance=e[r].distance+1,D.parent=r,n.unshift(s))}}return e}function Kn(t,e){return function(n){return e(t(n))}}function Qn(t,e){let n=[e[t].parent,t],r=me[e[t].parent][t],u=e[t].parent;for(;e[u].parent;)n.unshift(e[u].parent),r=Kn(me[e[u].parent][u],r),u=e[u].parent;return r.conversion=n,r}Tt.exports=function(t){let e=Wn(t),n={},r=Object.keys(e);for(let u=r.length,i=0;i<u;i++){let o=r[i];e[o].parent!==null&&(n[o]=Qn(o,e))}return n}});var Ut=v((ou,Ot)=>{var Ne=je(),Yn=_t(),J={},zn=Object.keys(Ne);function Jn(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function Xn(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let u=t(n);if(typeof u=="object")for(let i=u.length,o=0;o<i;o++)u[o]=Math.round(u[o]);return u};return"conversion"in t&&(e.conversion=t.conversion),e}zn.forEach(t=>{J[t]={},Object.defineProperty(J[t],"channels",{value:Ne[t].channels}),Object.defineProperty(J[t],"labels",{value:Ne[t].labels});let e=Yn(t);Object.keys(e).forEach(r=>{let u=e[r];J[t][r]=Xn(u),J[t][r].raw=Jn(u)})});Ot.exports=J});var $t=v((su,Nt)=>{"use strict";var Pt=(t,e)=>(...n)=>`\x1B[${t(...n)+e}m`,kt=(t,e)=>(...n)=>{let r=t(...n);return`\x1B[${38+e};5;${r}m`},Mt=(t,e)=>(...n)=>{let r=t(...n);return`\x1B[${38+e};2;${r[0]};${r[1]};${r[2]}m`},ge=t=>t,jt=(t,e,n)=>[t,e,n],X=(t,e,n)=>{Object.defineProperty(t,e,{get:()=>{let r=n();return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},$e,Z=(t,e,n,r)=>{$e===void 0&&($e=Ut());let u=r?10:0,i={};for(let[o,s]of Object.entries($e)){let D=o==="ansi16"?"ansi":o;o===e?i[D]=t(n,u):typeof s=="object"&&(i[D]=t(s[e],u))}return i};function Zn(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[n,r]of Object.entries(e)){for(let[u,i]of Object.entries(r))e[u]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[u]=e[u],t.set(i[0],i[1]);Object.defineProperty(e,n,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",X(e.color,"ansi",()=>Z(Pt,"ansi16",ge,!1)),X(e.color,"ansi256",()=>Z(kt,"ansi256",ge,!1)),X(e.color,"ansi16m",()=>Z(Mt,"rgb",jt,!1)),X(e.bgColor,"ansi",()=>Z(Pt,"ansi16",ge,!0)),X(e.bgColor,"ansi256",()=>Z(kt,"ansi256",ge,!0)),X(e.bgColor,"ansi16m",()=>Z(Mt,"rgb",jt,!0)),e}Object.defineProperty(Nt,"exports",{enumerable:!0,get:Zn})});var qt=v((Du,Gt)=>{"use strict";var re=St(),er=Pe(),tr=$t(),Ge=new Set(["\x1B","\x9B"]),nr=39,Ht=t=>`${Ge.values().next().value}[${t}m`,rr=t=>t.split(" ").map(e=>re(e)),He=(t,e,n)=>{let r=[...e],u=!1,i=re(er(t[t.length-1]));for(let[o,s]of r.entries()){let D=re(s);if(i+D<=n?t[t.length-1]+=s:(t.push(s),i=0),Ge.has(s))u=!0;else if(u&&s==="m"){u=!1;continue}u||(i+=D,i===n&&o<r.length-1&&(t.push(""),i=0))}!i&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},ur=t=>{let e=t.split(" "),n=e.length;for(;n>0&&!(re(e[n-1])>0);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},ir=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let r="",u="",i,o=rr(t),s=[""];for(let[D,l]of t.split(" ").entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimLeft());let p=re(s[s.length-1]);if(D!==0&&(p>=e&&(n.wordWrap===!1||n.trim===!1)&&(s.push(""),p=0),(p>0||n.trim===!1)&&(s[s.length-1]+=" ",p++)),n.hard&&o[D]>e){let m=e-p,a=1+Math.floor((o[D]-m-1)/e);Math.floor((o[D]-1)/e)<a&&s.push(""),He(s,l,e);continue}if(p+o[D]>e&&p>0&&o[D]>0){if(n.wordWrap===!1&&p<e){He(s,l,e);continue}s.push("")}if(p+o[D]>e&&n.wordWrap===!1){He(s,l,e);continue}s[s.length-1]+=l}n.trim!==!1&&(s=s.map(ur)),r=s.join(`
3
- `);for(let[D,l]of[...r].entries()){if(u+=l,Ge.has(l)){let m=parseFloat(/\d[^m]*/.exec(r.slice(D,D+4)));i=m===nr?null:m}let p=tr.codes.get(Number(i));i&&p&&(r[D+1]===`
4
- `?u+=Ht(p):l===`
5
- `&&(u+=Ht(i)))}return u};Gt.exports=(t,e,n)=>String(t).normalize().replace(/\r\n/g,`
2
+ "use strict";var er=Object.create;var le=Object.defineProperty;var ir=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var nr=Object.getPrototypeOf,rr=Object.prototype.hasOwnProperty;var _=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports),or=(s,t)=>{for(var e in t)le(s,e,{get:t[e],enumerable:!0})},qi=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sr(t))!rr.call(s,n)&&n!==e&&le(s,n,{get:()=>t[n],enumerable:!(i=ir(t,n))||i.enumerable});return s};var M=(s,t,e)=>(e=s!=null?er(nr(s)):{},qi(t||!s||!s.__esModule?le(e,"default",{value:s,enumerable:!0}):e,s)),ur=s=>qi(le({},"__esModule",{value:!0}),s);var Qi=_((xu,Yi)=>{"use strict";function ar(s,t){var e=s;t.slice(0,-1).forEach(function(n){e=e[n]||{}});var i=t[t.length-1];return i in e}function Vi(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function Ki(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}Yi.exports=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(p){e.bools[p]=!0});var i={};function n(p){return i[p].some(function(w){return e.bools[w]})}Object.keys(t.alias||{}).forEach(function(p){i[p]=[].concat(t.alias[p]),i[p].forEach(function(w){i[w]=[p].concat(i[p].filter(function(R){return w!==R}))})}),[].concat(t.string).filter(Boolean).forEach(function(p){e.strings[p]=!0,i[p]&&[].concat(i[p]).forEach(function(w){e.strings[w]=!0})});var r=t.default||{},o={_:[]};function u(p,w){return e.allBools&&/^--[^=]+$/.test(w)||e.strings[p]||e.bools[p]||i[p]}function a(p,w,R){for(var y=p,W=0;W<w.length-1;W++){var N=w[W];if(Ki(y,N))return;y[N]===void 0&&(y[N]={}),(y[N]===Object.prototype||y[N]===Number.prototype||y[N]===String.prototype)&&(y[N]={}),y[N]===Array.prototype&&(y[N]=[]),y=y[N]}var A=w[w.length-1];Ki(y,A)||((y===Object.prototype||y===Number.prototype||y===String.prototype)&&(y={}),y===Array.prototype&&(y=[]),y[A]===void 0||e.bools[A]||typeof y[A]=="boolean"?y[A]=R:Array.isArray(y[A])?y[A].push(R):y[A]=[y[A],R])}function l(p,w,R){if(!(R&&e.unknownFn&&!u(p,R)&&e.unknownFn(R)===!1)){var y=!e.strings[p]&&Vi(w)?Number(w):w;a(o,p.split("."),y),(i[p]||[]).forEach(function(W){a(o,W.split("."),y)})}}Object.keys(e.bools).forEach(function(p){l(p,r[p]===void 0?!1:r[p])});var h=[];s.indexOf("--")!==-1&&(h=s.slice(s.indexOf("--")+1),s=s.slice(0,s.indexOf("--")));for(var c=0;c<s.length;c++){var f=s[c],D,g;if(/^--.+=/.test(f)){var d=f.match(/^--([^=]+)=([\s\S]*)$/);D=d[1];var b=d[2];e.bools[D]&&(b=b!=="false"),l(D,b,f)}else if(/^--no-.+/.test(f))D=f.match(/^--no-(.+)/)[1],l(D,!1,f);else if(/^--.+/.test(f))D=f.match(/^--(.+)/)[1],g=s[c+1],g!==void 0&&!/^(-|--)[^-]/.test(g)&&!e.bools[D]&&!e.allBools&&(!i[D]||!n(D))?(l(D,g,f),c+=1):/^(true|false)$/.test(g)?(l(D,g==="true",f),c+=1):l(D,e.strings[D]?"":!0,f);else if(/^-[^-]+/.test(f)){for(var m=f.slice(1,-1).split(""),F=!1,E=0;E<m.length;E++){if(g=f.slice(E+2),g==="-"){l(m[E],g,f);continue}if(/[A-Za-z]/.test(m[E])&&g[0]==="="){l(m[E],g.slice(1),f),F=!0;break}if(/[A-Za-z]/.test(m[E])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(g)){l(m[E],g,f),F=!0;break}if(m[E+1]&&m[E+1].match(/\W/)){l(m[E],f.slice(E+2),f),F=!0;break}else l(m[E],e.strings[m[E]]?"":!0,f)}D=f.slice(-1)[0],!F&&D!=="-"&&(s[c+1]&&!/^(-|--)[^-]/.test(s[c+1])&&!e.bools[D]&&(!i[D]||!n(D))?(l(D,s[c+1],f),c+=1):s[c+1]&&/^(true|false)$/.test(s[c+1])?(l(D,s[c+1]==="true",f),c+=1):l(D,e.strings[D]?"":!0,f))}else if((!e.unknownFn||e.unknownFn(f)!==!1)&&o._.push(e.strings._||!Vi(f)?f:Number(f)),t.stopEarly){o._.push.apply(o._,s.slice(c+1));break}}return Object.keys(r).forEach(function(p){ar(o,p.split("."))||(a(o,p.split("."),r[p]),(i[p]||[]).forEach(function(w){a(o,w.split("."),r[p])}))}),t["--"]?o["--"]=h.slice():h.forEach(function(p){o._.push(p)}),o}});var ns=_(($u,ss)=>{var ei=require("node:tty"),es,ge,is,cr=((is=(ge=(es=ei==null?void 0:ei.WriteStream)==null?void 0:es.prototype)==null?void 0:ge.hasColors)==null?void 0:is.call(ge))??!1,x=(s,t)=>{if(!cr)return n=>n;let e=`\x1B[${s}m`,i=`\x1B[${t}m`;return n=>{let r=n+"",o=r.indexOf(i);if(o===-1)return e+r+i;let u=e,a=0;for(;o!==-1;)u+=r.slice(a,o)+e,a=o+i.length,o=r.indexOf(i,a);return u+=r.slice(a)+i,u}},S={};S.reset=x(0,0);S.bold=x(1,22);S.dim=x(2,22);S.italic=x(3,23);S.underline=x(4,24);S.overline=x(53,55);S.inverse=x(7,27);S.hidden=x(8,28);S.strikethrough=x(9,29);S.black=x(30,39);S.red=x(31,39);S.green=x(32,39);S.yellow=x(33,39);S.blue=x(34,39);S.magenta=x(35,39);S.cyan=x(36,39);S.white=x(37,39);S.gray=x(90,39);S.bgBlack=x(40,49);S.bgRed=x(41,49);S.bgGreen=x(42,49);S.bgYellow=x(43,49);S.bgBlue=x(44,49);S.bgMagenta=x(45,49);S.bgCyan=x(46,49);S.bgWhite=x(47,49);S.bgGray=x(100,49);S.redBright=x(91,39);S.greenBright=x(92,39);S.yellowBright=x(93,39);S.blueBright=x(94,39);S.magentaBright=x(95,39);S.cyanBright=x(96,39);S.whiteBright=x(97,39);S.bgRedBright=x(101,49);S.bgGreenBright=x(102,49);S.bgYellowBright=x(103,49);S.bgBlueBright=x(104,49);S.bgMagentaBright=x(105,49);S.bgCyanBright=x(106,49);S.bgWhiteBright=x(107,49);ss.exports=S});var as=_((oa,us)=>{"use strict";us.exports=Cr;function wr(s){let t={defaultWidth:0,output:process.stdout,tty:require("tty")};return s?(Object.keys(t).forEach(function(e){s[e]||(s[e]=t[e])}),s):t}function Cr(s){let t=wr(s);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}});var hs=_((ua,ls)=>{"use strict";ls.exports=({onlyFirst:s=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,s?void 0:"g")}});var ri=_((aa,cs)=>{"use strict";var Fr=hs();cs.exports=s=>typeof s=="string"?s.replace(Fr(),""):s});var Ds=_((la,oi)=>{"use strict";var fs=s=>Number.isNaN(s)?!1:s>=4352&&(s<=4447||s===9001||s===9002||11904<=s&&s<=12871&&s!==12351||12880<=s&&s<=19903||19968<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65131||65281<=s&&s<=65376||65504<=s&&s<=65510||110592<=s&&s<=110593||127488<=s&&s<=127569||131072<=s&&s<=262141);oi.exports=fs;oi.exports.default=fs});var ps=_((ha,ds)=>{"use strict";ds.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var gs=_((ca,ui)=>{"use strict";var yr=ri(),Sr=Ds(),xr=ps(),ms=s=>{if(typeof s!="string"||s.length===0||(s=yr(s),s.length===0))return 0;s=s.replace(xr()," ");let t=0;for(let e=0;e<s.length;e++){let i=s.codePointAt(e);i<=31||i>=127&&i<=159||i>=768&&i<=879||(i>65535&&e++,t+=Sr(i)?2:1)}return t};ui.exports=ms;ui.exports.default=ms});var bs=_((fa,Es)=>{"use strict";Es.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ai=_((Da,Cs)=>{var Gt=bs(),ws={};for(let s of Object.keys(Gt))ws[Gt[s]]=s;var C={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Cs.exports=C;for(let s of Object.keys(C)){if(!("channels"in C[s]))throw new Error("missing channels property: "+s);if(!("labels"in C[s]))throw new Error("missing channel labels property: "+s);if(C[s].labels.length!==C[s].channels)throw new Error("channel and label counts mismatch: "+s);let{channels:t,labels:e}=C[s];delete C[s].channels,delete C[s].labels,Object.defineProperty(C[s],"channels",{value:t}),Object.defineProperty(C[s],"labels",{value:e})}C.rgb.hsl=function(s){let t=s[0]/255,e=s[1]/255,i=s[2]/255,n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,u,a;r===n?u=0:t===r?u=(e-i)/o:e===r?u=2+(i-t)/o:i===r&&(u=4+(t-e)/o),u=Math.min(u*60,360),u<0&&(u+=360);let l=(n+r)/2;return r===n?a=0:l<=.5?a=o/(r+n):a=o/(2-r-n),[u,a*100,l*100]};C.rgb.hsv=function(s){let t,e,i,n,r,o=s[0]/255,u=s[1]/255,a=s[2]/255,l=Math.max(o,u,a),h=l-Math.min(o,u,a),c=function(f){return(l-f)/6/h+1/2};return h===0?(n=0,r=0):(r=h/l,t=c(o),e=c(u),i=c(a),o===l?n=i-e:u===l?n=1/3+t-i:a===l&&(n=2/3+e-t),n<0?n+=1:n>1&&(n-=1)),[n*360,r*100,l*100]};C.rgb.hwb=function(s){let t=s[0],e=s[1],i=s[2],n=C.rgb.hsl(s)[0],r=1/255*Math.min(t,Math.min(e,i));return i=1-1/255*Math.max(t,Math.max(e,i)),[n,r*100,i*100]};C.rgb.cmyk=function(s){let t=s[0]/255,e=s[1]/255,i=s[2]/255,n=Math.min(1-t,1-e,1-i),r=(1-t-n)/(1-n)||0,o=(1-e-n)/(1-n)||0,u=(1-i-n)/(1-n)||0;return[r*100,o*100,u*100,n*100]};function vr(s,t){return(s[0]-t[0])**2+(s[1]-t[1])**2+(s[2]-t[2])**2}C.rgb.keyword=function(s){let t=ws[s];if(t)return t;let e=1/0,i;for(let n of Object.keys(Gt)){let r=Gt[n],o=vr(s,r);o<e&&(e=o,i=n)}return i};C.keyword.rgb=function(s){return Gt[s]};C.rgb.xyz=function(s){let t=s[0]/255,e=s[1]/255,i=s[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let n=t*.4124+e*.3576+i*.1805,r=t*.2126+e*.7152+i*.0722,o=t*.0193+e*.1192+i*.9505;return[n*100,r*100,o*100]};C.rgb.lab=function(s){let t=C.rgb.xyz(s),e=t[0],i=t[1],n=t[2];e/=95.047,i/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let r=116*i-16,o=500*(e-i),u=200*(i-n);return[r,o,u]};C.hsl.rgb=function(s){let t=s[0]/360,e=s[1]/100,i=s[2]/100,n,r,o;if(e===0)return o=i*255,[o,o,o];i<.5?n=i*(1+e):n=i+e-i*e;let u=2*i-n,a=[0,0,0];for(let l=0;l<3;l++)r=t+1/3*-(l-1),r<0&&r++,r>1&&r--,6*r<1?o=u+(n-u)*6*r:2*r<1?o=n:3*r<2?o=u+(n-u)*(2/3-r)*6:o=u,a[l]=o*255;return a};C.hsl.hsv=function(s){let t=s[0],e=s[1]/100,i=s[2]/100,n=e,r=Math.max(i,.01);i*=2,e*=i<=1?i:2-i,n*=r<=1?r:2-r;let o=(i+e)/2,u=i===0?2*n/(r+n):2*e/(i+e);return[t,u*100,o*100]};C.hsv.rgb=function(s){let t=s[0]/60,e=s[1]/100,i=s[2]/100,n=Math.floor(t)%6,r=t-Math.floor(t),o=255*i*(1-e),u=255*i*(1-e*r),a=255*i*(1-e*(1-r));switch(i*=255,n){case 0:return[i,a,o];case 1:return[u,i,o];case 2:return[o,i,a];case 3:return[o,u,i];case 4:return[a,o,i];case 5:return[i,o,u]}};C.hsv.hsl=function(s){let t=s[0],e=s[1]/100,i=s[2]/100,n=Math.max(i,.01),r,o;o=(2-e)*i;let u=(2-e)*n;return r=e*n,r/=u<=1?u:2-u,r=r||0,o/=2,[t,r*100,o*100]};C.hwb.rgb=function(s){let t=s[0]/360,e=s[1]/100,i=s[2]/100,n=e+i,r;n>1&&(e/=n,i/=n);let o=Math.floor(6*t),u=1-i;r=6*t-o,(o&1)!==0&&(r=1-r);let a=e+r*(u-e),l,h,c;switch(o){default:case 6:case 0:l=u,h=a,c=e;break;case 1:l=a,h=u,c=e;break;case 2:l=e,h=u,c=a;break;case 3:l=e,h=a,c=u;break;case 4:l=a,h=e,c=u;break;case 5:l=u,h=e,c=a;break}return[l*255,h*255,c*255]};C.cmyk.rgb=function(s){let t=s[0]/100,e=s[1]/100,i=s[2]/100,n=s[3]/100,r=1-Math.min(1,t*(1-n)+n),o=1-Math.min(1,e*(1-n)+n),u=1-Math.min(1,i*(1-n)+n);return[r*255,o*255,u*255]};C.xyz.rgb=function(s){let t=s[0]/100,e=s[1]/100,i=s[2]/100,n,r,o;return n=t*3.2406+e*-1.5372+i*-.4986,r=t*-.9689+e*1.8758+i*.0415,o=t*.0557+e*-.204+i*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,n=Math.min(Math.max(0,n),1),r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),[n*255,r*255,o*255]};C.xyz.lab=function(s){let t=s[0],e=s[1],i=s[2];t/=95.047,e/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*e-16,r=500*(t-e),o=200*(e-i);return[n,r,o]};C.lab.xyz=function(s){let t=s[0],e=s[1],i=s[2],n,r,o;r=(t+16)/116,n=e/500+r,o=r-i/200;let u=r**3,a=n**3,l=o**3;return r=u>.008856?u:(r-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,n*=95.047,r*=100,o*=108.883,[n,r,o]};C.lab.lch=function(s){let t=s[0],e=s[1],i=s[2],n;n=Math.atan2(i,e)*360/2/Math.PI,n<0&&(n+=360);let o=Math.sqrt(e*e+i*i);return[t,o,n]};C.lch.lab=function(s){let t=s[0],e=s[1],n=s[2]/360*2*Math.PI,r=e*Math.cos(n),o=e*Math.sin(n);return[t,r,o]};C.rgb.ansi16=function(s,t=null){let[e,i,n]=s,r=t===null?C.rgb.hsv(s)[2]:t;if(r=Math.round(r/50),r===0)return 30;let o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(e/255));return r===2&&(o+=60),o};C.hsv.ansi16=function(s){return C.rgb.ansi16(C.hsv.rgb(s),s[2])};C.rgb.ansi256=function(s){let t=s[0],e=s[1],i=s[2];return t===e&&e===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5)};C.ansi16.rgb=function(s){let t=s%10;if(t===0||t===7)return s>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let e=(~~(s>50)+1)*.5,i=(t&1)*e*255,n=(t>>1&1)*e*255,r=(t>>2&1)*e*255;return[i,n,r]};C.ansi256.rgb=function(s){if(s>=232){let r=(s-232)*10+8;return[r,r,r]}s-=16;let t,e=Math.floor(s/36)/5*255,i=Math.floor((t=s%36)/6)/5*255,n=t%6/5*255;return[e,i,n]};C.rgb.hex=function(s){let e=(((Math.round(s[0])&255)<<16)+((Math.round(s[1])&255)<<8)+(Math.round(s[2])&255)).toString(16).toUpperCase();return"000000".substring(e.length)+e};C.hex.rgb=function(s){let t=s.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let e=t[0];t[0].length===3&&(e=e.split("").map(u=>u+u).join(""));let i=parseInt(e,16),n=i>>16&255,r=i>>8&255,o=i&255;return[n,r,o]};C.rgb.hcg=function(s){let t=s[0]/255,e=s[1]/255,i=s[2]/255,n=Math.max(Math.max(t,e),i),r=Math.min(Math.min(t,e),i),o=n-r,u,a;return o<1?u=r/(1-o):u=0,o<=0?a=0:n===t?a=(e-i)/o%6:n===e?a=2+(i-t)/o:a=4+(t-e)/o,a/=6,a%=1,[a*360,o*100,u*100]};C.hsl.hcg=function(s){let t=s[1]/100,e=s[2]/100,i=e<.5?2*t*e:2*t*(1-e),n=0;return i<1&&(n=(e-.5*i)/(1-i)),[s[0],i*100,n*100]};C.hsv.hcg=function(s){let t=s[1]/100,e=s[2]/100,i=t*e,n=0;return i<1&&(n=(e-i)/(1-i)),[s[0],i*100,n*100]};C.hcg.rgb=function(s){let t=s[0]/360,e=s[1]/100,i=s[2]/100;if(e===0)return[i*255,i*255,i*255];let n=[0,0,0],r=t%1*6,o=r%1,u=1-o,a=0;switch(Math.floor(r)){case 0:n[0]=1,n[1]=o,n[2]=0;break;case 1:n[0]=u,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=o;break;case 3:n[0]=0,n[1]=u,n[2]=1;break;case 4:n[0]=o,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=u}return a=(1-e)*i,[(e*n[0]+a)*255,(e*n[1]+a)*255,(e*n[2]+a)*255]};C.hcg.hsv=function(s){let t=s[1]/100,e=s[2]/100,i=t+e*(1-t),n=0;return i>0&&(n=t/i),[s[0],n*100,i*100]};C.hcg.hsl=function(s){let t=s[1]/100,i=s[2]/100*(1-t)+.5*t,n=0;return i>0&&i<.5?n=t/(2*i):i>=.5&&i<1&&(n=t/(2*(1-i))),[s[0],n*100,i*100]};C.hcg.hwb=function(s){let t=s[1]/100,e=s[2]/100,i=t+e*(1-t);return[s[0],(i-t)*100,(1-i)*100]};C.hwb.hcg=function(s){let t=s[1]/100,i=1-s[2]/100,n=i-t,r=0;return n<1&&(r=(i-n)/(1-n)),[s[0],n*100,r*100]};C.apple.rgb=function(s){return[s[0]/65535*255,s[1]/65535*255,s[2]/65535*255]};C.rgb.apple=function(s){return[s[0]/255*65535,s[1]/255*65535,s[2]/255*65535]};C.gray.rgb=function(s){return[s[0]/100*255,s[0]/100*255,s[0]/100*255]};C.gray.hsl=function(s){return[0,0,s[0]]};C.gray.hsv=C.gray.hsl;C.gray.hwb=function(s){return[0,100,s[0]]};C.gray.cmyk=function(s){return[0,0,0,s[0]]};C.gray.lab=function(s){return[s[0],0,0]};C.gray.hex=function(s){let t=Math.round(s[0]/100*255)&255,i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(i.length)+i};C.rgb.gray=function(s){return[(s[0]+s[1]+s[2])/3/255*100]}});var ys=_((da,Fs)=>{var be=ai();function Br(){let s={},t=Object.keys(be);for(let e=t.length,i=0;i<e;i++)s[t[i]]={distance:-1,parent:null};return s}function Ar(s){let t=Br(),e=[s];for(t[s].distance=0;e.length;){let i=e.pop(),n=Object.keys(be[i]);for(let r=n.length,o=0;o<r;o++){let u=n[o],a=t[u];a.distance===-1&&(a.distance=t[i].distance+1,a.parent=i,e.unshift(u))}}return t}function Tr(s,t){return function(e){return t(s(e))}}function Rr(s,t){let e=[t[s].parent,s],i=be[t[s].parent][s],n=t[s].parent;for(;t[n].parent;)e.unshift(t[n].parent),i=Tr(be[t[n].parent][n],i),n=t[n].parent;return i.conversion=e,i}Fs.exports=function(s){let t=Ar(s),e={},i=Object.keys(t);for(let n=i.length,r=0;r<n;r++){let o=i[r];t[o].parent!==null&&(e[o]=Rr(o,t))}return e}});var xs=_((pa,Ss)=>{var li=ai(),Or=ys(),Bt={},Lr=Object.keys(li);function _r(s){let t=function(...e){let i=e[0];return i==null?i:(i.length>1&&(e=i),s(e))};return"conversion"in s&&(t.conversion=s.conversion),t}function Ir(s){let t=function(...e){let i=e[0];if(i==null)return i;i.length>1&&(e=i);let n=s(e);if(typeof n=="object")for(let r=n.length,o=0;o<r;o++)n[o]=Math.round(n[o]);return n};return"conversion"in s&&(t.conversion=s.conversion),t}Lr.forEach(s=>{Bt[s]={},Object.defineProperty(Bt[s],"channels",{value:li[s].channels}),Object.defineProperty(Bt[s],"labels",{value:li[s].labels});let t=Or(s);Object.keys(t).forEach(i=>{let n=t[i];Bt[s][i]=Ir(n),Bt[s][i].raw=_r(n)})});Ss.exports=Bt});var Os=_((ma,Rs)=>{"use strict";var vs=(s,t)=>(...e)=>`\x1B[${s(...e)+t}m`,Bs=(s,t)=>(...e)=>{let i=s(...e);return`\x1B[${38+t};5;${i}m`},As=(s,t)=>(...e)=>{let i=s(...e);return`\x1B[${38+t};2;${i[0]};${i[1]};${i[2]}m`},we=s=>s,Ts=(s,t,e)=>[s,t,e],At=(s,t,e)=>{Object.defineProperty(s,t,{get:()=>{let i=e();return Object.defineProperty(s,t,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})},hi,Tt=(s,t,e,i)=>{hi===void 0&&(hi=xs());let n=i?10:0,r={};for(let[o,u]of Object.entries(hi)){let a=o==="ansi16"?"ansi":o;o===t?r[a]=s(e,n):typeof u=="object"&&(r[a]=s(u[t],n))}return r};function kr(){let s=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[e,i]of Object.entries(t)){for(let[n,r]of Object.entries(i))t[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},i[n]=t[n],s.set(r[0],r[1]);Object.defineProperty(t,e,{value:i,enumerable:!1})}return Object.defineProperty(t,"codes",{value:s,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",At(t.color,"ansi",()=>Tt(vs,"ansi16",we,!1)),At(t.color,"ansi256",()=>Tt(Bs,"ansi256",we,!1)),At(t.color,"ansi16m",()=>Tt(As,"rgb",Ts,!1)),At(t.bgColor,"ansi",()=>Tt(vs,"ansi16",we,!0)),At(t.bgColor,"ansi256",()=>Tt(Bs,"ansi256",we,!0)),At(t.bgColor,"ansi16m",()=>Tt(As,"rgb",Ts,!0)),t}Object.defineProperty(Rs,"exports",{enumerable:!0,get:kr})});var Is=_((ga,_s)=>{"use strict";var zt=gs(),Ur=ri(),Mr=Os(),fi=new Set(["\x1B","\x9B"]),Pr=39,Ls=s=>`${fi.values().next().value}[${s}m`,Nr=s=>s.split(" ").map(t=>zt(t)),ci=(s,t,e)=>{let i=[...t],n=!1,r=zt(Ur(s[s.length-1]));for(let[o,u]of i.entries()){let a=zt(u);if(r+a<=e?s[s.length-1]+=u:(s.push(u),r=0),fi.has(u))n=!0;else if(n&&u==="m"){n=!1;continue}n||(r+=a,r===e&&o<i.length-1&&(s.push(""),r=0))}!r&&s[s.length-1].length>0&&s.length>1&&(s[s.length-2]+=s.pop())},jr=s=>{let t=s.split(" "),e=t.length;for(;e>0&&!(zt(t[e-1])>0);)e--;return e===t.length?s:t.slice(0,e).join(" ")+t.slice(e).join("")},$r=(s,t,e={})=>{if(e.trim!==!1&&s.trim()==="")return"";let i="",n="",r,o=Nr(s),u=[""];for(let[a,l]of s.split(" ").entries()){e.trim!==!1&&(u[u.length-1]=u[u.length-1].trimLeft());let h=zt(u[u.length-1]);if(a!==0&&(h>=t&&(e.wordWrap===!1||e.trim===!1)&&(u.push(""),h=0),(h>0||e.trim===!1)&&(u[u.length-1]+=" ",h++)),e.hard&&o[a]>t){let c=t-h,f=1+Math.floor((o[a]-c-1)/t);Math.floor((o[a]-1)/t)<f&&u.push(""),ci(u,l,t);continue}if(h+o[a]>t&&h>0&&o[a]>0){if(e.wordWrap===!1&&h<t){ci(u,l,t);continue}u.push("")}if(h+o[a]>t&&e.wordWrap===!1){ci(u,l,t);continue}u[u.length-1]+=l}e.trim!==!1&&(u=u.map(jr)),i=u.join(`
3
+ `);for(let[a,l]of[...i].entries()){if(n+=l,fi.has(l)){let c=parseFloat(/\d[^m]*/.exec(i.slice(a,a+4)));r=c===Pr?null:c}let h=Mr.codes.get(Number(r));r&&h&&(i[a+1]===`
4
+ `?n+=Ls(h):l===`
5
+ `&&(n+=Ls(r)))}return n};_s.exports=(s,t,e)=>String(s).normalize().replace(/\r\n/g,`
6
6
  `).split(`
7
- `).map(r=>ir(r,e,n)).join(`
8
- `)});var Qt=v((Bu,Kt)=>{var or=require("stream"),Ve=class extends or{#n=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,n){return this._dest?this._dest[e]:this._src?this._src[e]:n}#e(e,...n){var r,u;typeof((r=this._dest)==null?void 0:r[e])=="function"&&this._dest[e](...n),typeof((u=this._src)==null?void 0:u[e])=="function"&&this._src[e](...n)}get isTTY(){return this.#n!==null?this.#n:this.#t("isTTY",!1)}set isTTY(e){this.#n=e}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,n){return this._dest=e,super.pipe(e,n)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return e.indexOf(this._prompt)===0&&(e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit("data",e);this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit("data",e)}end(e){this.muted&&(e&&this.replace?e=e.toString().replace(/./g,this.replace):e=null),e&&this.emit("data",e),this.emit("end")}destroy(...e){return this.#e("destroy",...e)}destroySoon(...e){return this.#e("destroySoon",...e)}close(...e){return this.#e("close",...e)}};Kt.exports=Ve});var Jt=v((xu,Xe)=>{"use strict";var E=Xe.exports;Xe.exports.default=E;var b="\x1B[",ue="\x1B]",ee="\x07",be=";",zt=process.env.TERM_PROGRAM==="Apple_Terminal";E.cursorTo=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?b+(t+1)+"G":b+(e+1)+";"+(t+1)+"H"};E.cursorMove=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");let n="";return t<0?n+=b+-t+"D":t>0&&(n+=b+t+"C"),e<0?n+=b+-e+"A":e>0&&(n+=b+e+"B"),n};E.cursorUp=(t=1)=>b+t+"A";E.cursorDown=(t=1)=>b+t+"B";E.cursorForward=(t=1)=>b+t+"C";E.cursorBackward=(t=1)=>b+t+"D";E.cursorLeft=b+"G";E.cursorSavePosition=zt?"\x1B7":b+"s";E.cursorRestorePosition=zt?"\x1B8":b+"u";E.cursorGetPosition=b+"6n";E.cursorNextLine=b+"E";E.cursorPrevLine=b+"F";E.cursorHide=b+"?25l";E.cursorShow=b+"?25h";E.eraseLines=t=>{let e="";for(let n=0;n<t;n++)e+=E.eraseLine+(n<t-1?E.cursorUp():"");return t&&(e+=E.cursorLeft),e};E.eraseEndLine=b+"K";E.eraseStartLine=b+"1K";E.eraseLine=b+"2K";E.eraseDown=b+"J";E.eraseUp=b+"1J";E.eraseScreen=b+"2J";E.scrollUp=b+"S";E.scrollDown=b+"T";E.clearScreen="\x1Bc";E.clearTerminal=process.platform==="win32"?`${E.eraseScreen}${b}0f`:`${E.eraseScreen}${b}3J${b}H`;E.beep=ee;E.link=(t,e)=>[ue,"8",be,be,e,ee,t,ue,"8",be,be,ee].join("");E.image=(t,e={})=>{let n=`${ue}1337;File=inline=1`;return e.width&&(n+=`;width=${e.width}`),e.height&&(n+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(n+=";preserveAspectRatio=0"),n+":"+t.toString("base64")+ee};E.iTerm={setCwd:(t=process.cwd())=>`${ue}50;CurrentDir=${t}${ee}`,annotation:(t,e={})=>{let n=`${ue}1337;`,r=typeof e.x<"u",u=typeof e.y<"u";if((r||u)&&!(r&&u&&typeof e.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return t=t.replace(/\|/g,""),n+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?n+=(r?[t,e.length,e.x,e.y]:[e.length,t]).join("|"):n+=t,n+ee}}});var un=v((ni,ar)=>{ar.exports={name:"@under_koen/bsm",version:"1.7.0",description:"BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",license:"MIT",author:"Koen van Staveren <koen@underkoen.nl>",homepage:"https://github.com/UnderKoen/bsm#readme",repository:{type:"git",url:"https://github.com/UnderKoen/bsm.git"},bugs:{url:"https://github.com/UnderKoen/bsm/issues"},main:"dist/index.js",bin:{bsm:"./dist/index.js"},files:["dist"],scripts:{build:"bsm","build:dev":"bsm","build:prod":"bsm","build:watch":"bsm",lint:"bsm",prettier:"bsm",prepublishOnly:"bsm build.prod",test:"bsm","test:cov":"bsm test.cov"},devDependencies:{"@eslint/js":"^9.21.0","@inquirer/core":"^10.1.7","@semantic-release/changelog":"^6.0.3","@semantic-release/exec":"^7.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@types/minimist":"^1.2.5","@types/node":"^22.13.9","@types/sinon":"^17.0.4","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","@under_koen/bsm":"^1.6.2",c8:"^10.1.3","ci-info":"^4.1.0","cpy-cli":"^5.0.0",defu:"^6.1.4",esbuild:"^0.25.0",eslint:"^9.21.0","eslint-config-prettier":"^10.0.2",globals:"^16.0.0",minimist:"^1.2.8",prettier:"^3.5.3","prettier-package-json":"^2.8.0",rimraf:"^6.0.1","semantic-release":"^24.2.3",sinon:"^19.0.2",tsm:"^2.3.0",typescript:"^5.8.2","typescript-eslint":"^8.26.0",uvu:"^0.5.6"},keywords:["script","scripting"]}});var on=v((ui,fr)=>{fr.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var ln=v(P=>{"use strict";var sn=on(),w=process.env;Object.defineProperty(P,"_vendors",{value:sn.map(function(t){return t.constant})});P.name=null;P.isPR=null;P.id=null;sn.forEach(function(t){let n=(Array.isArray(t.env)?t.env:[t.env]).every(function(r){return Dn(r)});P[t.constant]=n,n&&(P.name=t.name,P.isPR=pr(t),P.id=t.constant)});P.isCI=!!(w.CI!=="false"&&(w.BUILD_ID||w.BUILD_NUMBER||w.CI||w.CI_APP_ID||w.CI_BUILD_ID||w.CI_BUILD_NUMBER||w.CI_NAME||w.CONTINUOUS_INTEGRATION||w.RUN_ID||P.name));function Dn(t){return typeof t=="string"?!!w[t]:"env"in t?w[t.env]&&w[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!w[e]}):Object.keys(t).every(function(e){return w[e]===t[e]})}function pr(t){switch(typeof t.pr){case"string":return!!w[t.pr];case"object":return"env"in t.pr?"any"in t.pr?t.pr.any.some(function(e){return w[t.pr.env]===e}):t.pr.env in w&&w[t.pr.env]!==t.pr.ne:"any"in t.pr?t.pr.any.some(function(e){return!!w[e]}):Dn(t.pr);default:return null}}});var mr={};An(mr,{main:()=>En});module.exports=wn(mr);var gn=x(ot());function Se(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function xe(t,e,n=".",r){if(!Se(e))return xe(t,{},n,r);let u=Object.assign({},e);for(let i in t){if(i==="__proto__"||i==="constructor")continue;let o=t[i];o!=null&&(r&&r(u,i,o,n)||(Array.isArray(o)&&Array.isArray(u[i])?u[i]=[...o,...u[i]]:Se(o)&&Se(u[i])?u[i]=xe(o,u[i],(n?`${n}.`:"")+i.toString(),r):u[i]=o))}return u}function Re(t){return(...e)=>e.reduce((n,r)=>xe(n,r,"",t),{})}var st=Re(),Cr=Re((t,e,n)=>{if(t[e]!==void 0&&typeof n=="function")return t[e]=n(t[e]),!0}),Fr=Re((t,e,n)=>{if(Array.isArray(t[e])&&typeof n=="function")return t[e]=n(t[e]),!0});var Sn=Object.freeze({scripts:{},config:{defaultHelpBehavior:"help",caseInsensitive:!1,idempotency:{location:"./node_modules/.cache/bsm/idempotency",useFileContent:!1}}}),I=class{static getSource(e){return Array.isArray(e)?e[0]:e}static async loadExtensions(e){return!Object.hasOwn(e,"extends")||!e.extends?[]:(await Promise.all([...e.extends].map(n=>this.loadFile(n,!1)))).filter(n=>n!==void 0)}static async loadFile(e,n=!0){var u,i;if(!e)return;let r=this.getSource(e);try{r=require.resolve(r,{paths:[process.cwd()]});let o=require(r);typeof o=="function"&&(o=await o(...Array.isArray(e)?e.slice(1):[]));let s=await this.loadExtensions(o);return st(o,...s,Sn)}catch(o){let s=o,D=(i=(u=s.requireStack)==null?void 0:u[0])==null?void 0:i.replaceAll("\\","/");if(s.code==="MODULE_NOT_FOUND"&&(D!=null&&D.includes("bsm/dist/index.js"))){if(n)return;console.error(`\x1B[31mCannot find config '${r}' to extend\x1B[0m`),process.exit(1)}else console.error(o),Array.isArray(e)&&(e=e[0]),console.error(`\x1B[31mError loading config '${e}'\x1B[0m`),process.exit(1)}}static async load(e){let n=[e.config,process.env.BSM_CONFIG,"./package.scripts.js","./package.scripts.json"].filter(r=>r!==void 0);for(let r of n){let u=await this.loadFile(r);if(u)return process.env.BSM_CONFIG=r,this._config=u,u}console.error(`\x1B[31mCannot find config ${n.map(r=>`'${r}'`).join(" or ")}\x1B[0m`),process.exit(1)}static _config;static get config(){if(this._config)return this._config;throw new Error("Config not loaded")}};var se=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e==null?void 0:e.cause}},De=class extends Error{name="CancelPromptError";message="Prompt was canceled"},le=class extends Error{name="ExitPromptError"},ce=class extends Error{name="HookError"},ae=class extends Error{name="ValidationError"};var fe=require("node:async_hooks");var Dt=new fe.AsyncLocalStorage;function xn(t){return{rl:t,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function lt(t,e){let n=xn(t);return Dt.run(n,()=>{function r(u){n.handleChange=()=>{n.index=0,u()},n.handleChange()}return e(r)})}function W(){let t=Dt.getStore();if(!t)throw new ce("[Inquirer] Hook functions can only be called from within a prompt");return t}function Le(){return W().rl}function Ie(t){let e=(...n)=>{let r=W(),u=!1,i=r.handleChange;r.handleChange=()=>{u=!0};let o=t(...n);return u&&i(),r.handleChange=i,o};return fe.AsyncResource.bind(e)}function z(t){let e=W(),{index:n}=e,r={get(){return e.hooks[n]},set(i){e.hooks[n]=i},initialized:n in e.hooks},u=t(r);return e.index++,u}function ct(){W().handleChange()}var K={queue(t){let e=W(),{index:n}=e;e.hooksEffect.push(()=>{var u,i;(i=(u=e.hooksCleanup)[n])==null||i.call(u);let r=t(Le());if(r!=null&&typeof r!="function")throw new ae("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[n]=r})},run(){let t=W();Ie(()=>{t.hooksEffect.forEach(e=>{e()}),t.hooksEffect.length=0})()},clearAll(){let t=W();t.hooksCleanup.forEach(e=>{e==null||e()}),t.hooksEffect.length=0,t.hooksCleanup.length=0}};function N(t){return z(e=>{let n=u=>{e.get()!==u&&(e.set(u),ct())};if(e.initialized)return[e.get(),n];let r=typeof t=="function"?t():t;return e.set(r),[r,n]})}function pe(t,e){z(n=>{let r=n.get();(!Array.isArray(r)||e.some((i,o)=>!Object.is(i,r[o])))&&K.queue(t),n.set(e)})}var _=x(ht(),1);var O=x(require("node:process"),1);function Ln(){return O.default.platform!=="win32"?O.default.env.TERM!=="linux":!!O.default.env.WT_SESSION||!!O.default.env.TERMINUS_SUBLIME||O.default.env.ConEmuTask==="{cmd::Cmder}"||O.default.env.TERM_PROGRAM==="Terminus-Sublime"||O.default.env.TERM_PROGRAM==="vscode"||O.default.env.TERM==="xterm-256color"||O.default.env.TERM==="alacritty"||O.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var dt={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"},mt={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"},In={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"},Tn={...dt,...mt},_n={...dt,...In},On=Ln(),Un=On?Tn:_n,_e=Un,_r=Object.entries(mt);var Pn={prefix:{idle:_.default.blue("?"),done:_.default.green(_e.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(t=>_.default.yellow(t))},style:{answer:_.default.cyan,message:_.default.bold,error:t=>_.default.red(`> ${t}`),defaultAnswer:t=>_.default.dim(`(${t})`),help:_.default.dim,highlight:_.default.cyan,key:t=>_.default.cyan(_.default.bold(`<${t}>`))}};function Oe(t,e){return z(n=>{let r=n.get();if(!r||r.dependencies.length!==e.length||r.dependencies.some((u,i)=>u!==e[i])){let u=t();return n.set({value:u,dependencies:e}),u}return r.value})}function de(t){return N({current:t})[0]}function Ue(t){let e=de(t);e.current=t,pe(n=>{let r=!1,u=Ie((i,o)=>{r||e.current(o,n)});return n.input.on("keypress",u),()=>{r=!0,n.input.removeListener("keypress",u)}},[])}var Vt=x(Et(),1),Wt=x(qt(),1);function Ee(t,e){return t.split(`
9
- `).flatMap(n=>(0,Wt.default)(n,e,{trim:!1,hard:!0}).split(`
10
- `).map(r=>r.trimEnd())).join(`
11
- `)}function qe(){return(0,Vt.default)({defaultWidth:80,output:Le().output})}var tn=x(require("node:readline"),1),nn=require("node:async_hooks"),rn=x(Qt(),1);var Q=[];Q.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Q.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Q.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ce=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",We=Symbol.for("signal-exit emitter"),Ke=globalThis,sr=Object.defineProperty.bind(Object),Qe=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ke[We])return Ke[We];sr(Ke,We,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){let r=this.listeners[e],u=r.indexOf(n);u!==-1&&(u===0&&r.length===1?r.length=0:r.splice(u,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let u=!1;for(let i of this.listeners[e])u=i(n,r)===!0||u;return e==="exit"&&(u=this.emit("afterExit",n,r)||u),u}},Fe=class{},Dr=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}}),Ye=class extends Fe{onExit(){return()=>{}}load(){}unload(){}},ze=class extends Fe{#n=Je.platform==="win32"?"SIGINT":"SIGHUP";#t=new Qe;#e;#i;#o;#u={};#r=!1;constructor(e){super(),this.#e=e,this.#u={};for(let n of Q)this.#u[n]=()=>{let r=this.#e.listeners(n),{count:u}=this.#t,i=e;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(u+=i.__signal_exit_emitter__.count),r.length===u){this.unload();let o=this.#t.emit("exit",null,n),s=n==="SIGHUP"?this.#n:n;o||e.kill(e.pid,s)}};this.#o=e.reallyExit,this.#i=e.emit}onExit(e,n){if(!Ce(this.#e))return()=>{};this.#r===!1&&this.load();let r=n!=null&&n.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#t.count+=1;for(let e of Q)try{let n=this.#u[e];n&&this.#e.on(e,n)}catch{}this.#e.emit=(e,...n)=>this.#D(e,...n),this.#e.reallyExit=e=>this.#s(e)}}unload(){this.#r&&(this.#r=!1,Q.forEach(e=>{let n=this.#u[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,n)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#o,this.#t.count-=1)}#s(e){return Ce(this.#e)?(this.#e.exitCode=e||0,this.#t.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#D(e,...n){let r=this.#i;if(e==="exit"&&Ce(this.#e)){typeof n[0]=="number"&&(this.#e.exitCode=n[0]);let u=r.call(this.#e,e,...n);return this.#t.emit("exit",this.#e.exitCode,null),u}else return r.call(this.#e,e,...n)}},Je=globalThis.process,{onExit:Yt,load:wu,unload:vu}=Dr(Ce(Je)?new ze(Je):new Ye);var en=require("node:util"),H=x(Jt(),1);var Xt=t=>t.split(`
12
- `).length,lr=t=>t.split(`
13
- `).pop()??"";function Zt(t){return t>0?H.default.cursorDown(t):""}var ie=class{rl;height=0;extraLinesUnderPrompt=0;cursorPos;constructor(e){this.rl=e,this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,n=""){let r=lr(e),u=(0,en.stripVTControlCharacters)(r),i=u;this.rl.line.length>0&&(i=i.slice(0,-this.rl.line.length)),this.rl.setPrompt(i),this.cursorPos=this.rl.getCursorPos();let o=qe();e=Ee(e,o),n=Ee(n,o),u.length%o===0&&(e+=`
14
- `);let s=e+(n?`
15
- `+n:""),l=Math.floor(u.length/o)-this.cursorPos.rows+(n?Xt(n):0);l>0&&(s+=H.default.cursorUp(l)),s+=H.default.cursorTo(this.cursorPos.cols),this.write(Zt(this.extraLinesUnderPrompt)+H.default.eraseLines(this.height)+s),this.extraLinesUnderPrompt=l,this.height=Xt(s)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(H.default.cursorTo(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let n=Zt(this.extraLinesUnderPrompt);n+=e?H.default.eraseLines(this.height):`
16
- `,n+=H.default.cursorShow,this.write(n),this.rl.close()}};var Be=class extends Promise{static withResolver(){let e,n;return{promise:new Promise((u,i)=>{e=u,n=i}),resolve:e,reject:n}}};function cr(){let t=Error.prepareStackTrace;try{let e=[];return Error.prepareStackTrace=(n,r)=>{let u=r.slice(1);return e=u,u},new Error().stack,e}finally{Error.prepareStackTrace=t}}function Ze(t){var u,i;let n=(i=(u=cr()[1])==null?void 0:u.getFileName)==null?void 0:i.call(u);return(o,s={})=>{let{input:D=process.stdin,signal:l}=s,p=new Set,m=new rn.default;m.pipe(s.output??process.stdout);let a=tn.createInterface({terminal:!0,input:D,output:m}),F=new ie(a),{promise:A,resolve:k,reject:L}=Be.withResolver(),S=()=>L(new De);if(l){let B=()=>L(new se({cause:l.reason}));if(l.aborted)return B(),Object.assign(A,{cancel:S});l.addEventListener("abort",B),p.add(()=>l.removeEventListener("abort",B))}p.add(Yt((B,f)=>{L(new le(`User force closed the prompt with ${B} ${f}`))}));let j=()=>F.checkCursorPos();return a.input.on("keypress",j),p.add(()=>a.input.removeListener("keypress",j)),lt(a,B=>{let f=nn.AsyncResource.bind(()=>K.clearAll());return a.on("close",f),p.add(()=>a.removeListener("close",f)),B(()=>{try{let g=t(o,M=>{setImmediate(()=>k(M))});if(g===void 0)throw new Error(`Prompt functions must return a string.
17
- at ${n}`);let[R,C]=typeof g=="string"?[g]:g;F.render(R,C),K.run()}catch(g){L(g)}}),Object.assign(A.then(g=>(K.clearAll(),g),g=>{throw K.clearAll(),g}).finally(()=>{p.forEach(g=>g()),F.done({clearContent:!!s.clearPromptOnDone}),m.end()}).then(()=>A),{cancel:S})})}}var U=class t{static printHelp(e,n){let r=n._;if(r.length===0)console.log(`
18
- \x1B[1mAvailable commands:\x1B[0m`),t.printCommands(e.scripts);else for(let u of r){console.log(`
19
- \x1B[1mAvailable commands: \x1B[90m${u}\x1B[0m`);let i=u.split("."),o=[[e.scripts,[],i]];for(;o.length>0;){let s=o.shift();if(s[2].length===0)t.printCommands(s[0],s[1]);else if(s[2][0]==="*"){if(typeof s[0]=="object")if(Array.isArray(s[0]))for(let D=0;D<s[0].length;D++)o.push([s[0][D],[...s[1],D.toString()],[]]);else for(let D in s[0])Object.hasOwn(s[0],D)&&o.push([s[0][D],[...s[1],D],s[2].slice(1)])}else{let D=s[2][0];if(typeof s[0]=="object")if(Array.isArray(s[0])){let l=parseInt(D);o.push([s[0][l],[...s[1],l.toString()],s[2].slice(1)])}else o.push([s[0][D],[...s[1],D],s[2].slice(1)])}}}process.exit(0)}static printCommands(e,n=[],r=!0){if(Array.isArray(e))e.forEach((u,i)=>{t.printCommand(u,[...n,i.toString()])});else if(typeof e=="object"){r&&n.length>0&&t.printCommand(e,[...n]);for(let u in e)Object.hasOwn(e,u)&&t.printCommand(e[u],[...n,u])}else t.printCommand(e,n)}static printCommand(e,n){if(e===void 0){console.error(`\x1B[31mScript '${n.join(".")}' not found\x1B[0m`);return}let r=t.getCommandHelp(e,n);r&&console.log(r)}static getCommandHelp(e,n){if(n[n.length-1]==="$description")return;let r=`\x1B[92m${n.join(".")}\x1B[0m\x1B[90m - \x1B[0m`,u;return typeof e=="string"?u=e:typeof e=="function"?u="\x1B[90m<function>\x1B[0m":Array.isArray(e)?u=`\x1B[90m[${e.length}]\x1B[0m`:Object.hasOwn(e,"$description")?u=`\x1B[90m${e.$description}\x1B[0m`:u=`\x1B[90m{${Object.keys(e).join(", ")}}\x1B[0m`,`${r}${u}`}static printVersion(){let e=un();console.log(e.version),process.exit(0)}};var fn=x(require("node:child_process")),pn=x(ln());var hn=x(require("path")),ye=x(require("fs"));var cn=require("node:crypto");var G=x(require("fs")),an=x(require("path")),$=class{static get useFileContent(){var e,n;return((n=(e=I.config.config)==null?void 0:e.idempotency)==null?void 0:n.useFileContent)??!1}static get location(){var e,n;return((n=(e=I.config.config)==null?void 0:e.idempotency)==null?void 0:n.location)??"./node_modules/.cache/bsm/idempotency"}static updateHashForFile(e,n){try{if(this.useFileContent){let r=G.default.readFileSync(n);e.update(r)}else{let r=G.default.lstatSync(n);e.update(r.ctimeMs.toString()),e.update(r.mtimeMs.toString())}}catch{}}static updateHashForDir(e,n){try{G.default.readdirSync(n,{withFileTypes:!0,recursive:!0}).forEach(r=>{if(r.name==null)return;let u=an.default.join(r.path??n,r.name).replace(/\\/g,"/");e.update(u),r.isFile()&&this.updateHashForFile(e,u)})}catch{}}static calculateIdempotencyHash(e,n){var i;let r=[];if(Array.isArray(e))r.push(...e);else if(typeof e=="string")r.push(e);else for(let o of Object.values(e))Array.isArray(o)?r.push(...o):r.push(o);let u=(0,cn.createHash)("sha256");for(let o of r){let s=o.split(":")[0],D=o.substring(s.length+1);switch(s){case"static":u.update(D);break;case"env":u.update(D),u.update(((i=n==null?void 0:n.env)==null?void 0:i[D])??process.env[D]??Buffer.of());break;case"file":this.updateHashForFile(u,D);break;case"dir":this.updateHashForDir(u,D);break;default:console.log(`\x1B[33m[Idempotency]\x1B[0m Unknown type: ${s}, using value as static`),u.update(o)}}return u.digest("hex")}static getFileName(e){let n=e.join(".");return`${this.location}/${n}.hash`.replaceAll("*","__all__")}static saveIdempotencyHash(e,n){G.default.mkdirSync(this.location,{recursive:!0}),G.default.writeFileSync(this.getFileName(n),e)}static getSavedIdempotencyHash(e){let n=this.getFileName(e);if(G.default.existsSync(n))return G.default.readFileSync(n,"utf-8")}static checkIdempotency(e,n,r){let u=e.$idempotency,i=this.calculateIdempotencyHash(u,r);return this.getSavedIdempotencyHash(n)===i}static saveIdempotency(e,n){let r=e.$idempotency,u=this.calculateIdempotencyHash(r);this.saveIdempotencyHash(u,n)}static hasIdempotencyEnabled(e){return process.env.BSM_DISABLE_IDEMPOTENCY==="true"||!Object.hasOwn(e,"$idempotency")?!1:Object.hasOwn(e,"$idempotencyEnabled")?!!e.$idempotencyEnabled:!0}};var q=class extends Error{constructor(n,r){super();this.code=n;this.script=r}},te=class extends q{constructor(n,r){super(1,r);this.func=n;this.script=r}};var V=class t{static async run(e){let n=I.config;await t.runScript(n.scripts,e.split("."),[],{})}static async runScript(e,n,r,u){typeof e=="function"?await t.executeFunction(e,n,r,u):typeof e=="string"?await t.executeString(e,n,r,u):typeof e=="object"?Array.isArray(e)?await t.executeArray(e,n,r,u):await t.executeObject(e,n,r,u):await t.notFound(r,u)}static async notFound(e,n,r){var u;if(!n.ignoreNotFound){if(r){let i=e[e.length-1],o=e.slice(0,-1);if(o.length===0?console.error(`\x1B[31mScript '${i}' does not exist\x1B[0m`):console.error(`\x1B[31mScript '${o.join(".")}' does not have a '${i}' script\x1B[0m`),((u=I.config.config)==null?void 0:u.defaultHelpBehavior)==="interactive"){let s=await Y.selectScript(I.config,{_:[e.join(".")]});await this.run(s[0]),process.exit(0)}else console.log(),Object.hasOwn(r,"$description")&&(U.printCommand(r,o),console.log()),console.log("\x1B[1mTry one of the following:\x1B[0m"),U.printCommands(r,o,!1)}else console.error(`\x1B[31mScript '${e.join(".")}' not found\x1B[0m`);process.exit(127)}}static async executeFunction(e,n,r,u){var s;console.log(`> \x1B[93mExecuting JavaScript function\x1B[0m \x1B[90m(${[...r].join(".")})\x1B[0m`);let i,o=process.env;try{process.env={...process.env,...u.env},i=await e.call(null,process.argv)}catch(D){throw D instanceof Error&&(D.stack=(s=D.stack)==null?void 0:s.split(" at executeFunction")[0]),new te(D,r.join("."))}finally{process.env=o}if(i==null){n.length>0&&await t.notFound([...r,...n],u);return}await t.runScript(i,n,r,{...u,excludeArgs:!0})}static async executeString(e,n,r,u){if(n.length>0){await t.notFound([...r,...n],u);return}!u.excludeArgs&&process.argv.length&&(e+=" "+process.argv.join(" ")),console.log(`> ${e} \x1B[90m(${r.join(".")})\x1B[0m`),process.env.BSM_LOG_FILE&&ye.default.appendFileSync(process.env.BSM_LOG_FILE,`${new Date().toISOString()} ${e} ${r.join(".")} ${process.cwd()}
20
- `),e!==""&&(e=e.replace(/bsm ~/g,"bsm \\~"),await new Promise((i,o)=>{fn.default.spawn(e,[],{stdio:"inherit",shell:!0,env:{...process.env,...u.env,BSM_PATH:r.slice(0,-1).join("."),BSM_SCRIPT:r.join(".")}}).on("close",D=>{D===0?i():o(new q(D,r.join(".")))})}))}static async executeArray(e,n,r,u){if(n.length===0||n[0]==="*")for(let i=0;i<e.length;i++)await t.runScript(e[i],n.slice(1),[...r,i.toString()],{...u,ignoreNotFound:n[0]==="*"?!0:u.ignoreNotFound});else{let i=n[0],o=t.subscript(e,i);if(o)await t.runScript(o[1],n.slice(1),[...r,o[0]],u);else{await t.notFound([...r,i],u,e);return}}}static shouldRun(e,n,r,u){return $.hasIdempotencyEnabled(e)&&$.checkIdempotency(e,[...r,...n],u)?(console.log(`\x1B[90mNot running ${[...r,...n].join(".")} because the idempotency hash is the same\x1B[0m`),!1):!0}static async executeObject(e,n,r,u){try{if(Object.hasOwn(e,"$env")&&(u.env={...u.env,...t.getEnv(e.$env)}),!t.shouldRun(e,n,r,u))return;if(await t.executeHook(e,"_pre",r,u),n.length===0)await t.runObject(e,r,u);else if(n[0]==="*")for(let i in e)i.startsWith("_")||i.startsWith("$")||Object.hasOwn(e,i)&&await t.runScript(e[i],n.slice(1),[...r,i],{...u,ignoreNotFound:!0});else{let i=n[0],o=t.subscript(e,i);if(o)await t.runScript(o[1],n.slice(1),[...r,o[0]],u);else{await t.notFound([...r,i],u,e);return}}await t.executeHook(e,"_post",r,u),$.hasIdempotencyEnabled(e)&&$.saveIdempotency(e,[...r,...n])}catch(i){if(i instanceof q?process.env.BSM_ERROR=i.code.toString():process.env.BSM_ERROR="1",await t.executeHook(e,"_onError",r,u),!await t.executeHook(e,"_catch",r,u))throw i;$.hasIdempotencyEnabled(e)&&$.saveIdempotency(e,[...r,...n])}finally{await t.executeHook(e,"_finally",r,u)}}static subscript(e,n,r=!0){if(typeof e=="object"&&(Object.hasOwn(e,n)||(n=function(){var i;if((i=I.config.config)!=null&&i.caseInsensitive){let o=Object.keys(e).find(s=>s.toLowerCase()===n.toLowerCase());if(o)return o}if(r){let o=t.resolveAlias(e,n);if(o)return o}}()??n),!!Object.hasOwn(e,n)))if(Array.isArray(e)){let u=parseInt(n);return[n,e[u]]}else return[n,e[n]]}static resolveAlias(e,n){var r;for(let[u,i]of Object.entries(e)){if(typeof i!="object"||Array.isArray(i)||!Object.hasOwn(i,"$alias"))continue;let o=t.getAliases(i.$alias);if(o.includes(n)||(r=I.config.config)!=null&&r.caseInsensitive&&o.map(s=>s.toLowerCase()).includes(n.toLowerCase()))return u}}static getAliases(e){return typeof e=="string"?[e]:Array.isArray(e)?e.flatMap(t.getAliases):(console.error(`\x1B[31mAlias with type ${typeof e} is not supported\x1B[0m`),[])}static getEnv(e){if(typeof e=="string"){if(e==="")return{};if(e.startsWith("file:")){let n=hn.default.join(process.cwd(),e.slice(5));if(!ye.default.existsSync(n))return console.error(`\x1B[31mFile '${n}' does not exist\x1B[0m
7
+ `).map(i=>$r(i,t,e)).join(`
8
+ `)});var Ps=_((Oa,Ms)=>{var Wr=require("stream"),di=class extends Wr{#t=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#e(t,e){return this._dest?this._dest[t]:this._src?this._src[t]:e}#i(t,...e){var i,n;typeof((i=this._dest)==null?void 0:i[t])=="function"&&this._dest[t](...e),typeof((n=this._src)==null?void 0:n[t])=="function"&&this._src[t](...e)}get isTTY(){return this.#t!==null?this.#t:this.#e("isTTY",!1)}set isTTY(t){this.#t=t}get rows(){return this.#e("rows")}get columns(){return this.#e("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,e){return this._dest=t,super.pipe(t,e)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#i("destroy",...t)}destroySoon(...t){return this.#i("destroySoon",...t)}close(...t){return this.#i("close",...t)}};Ms.exports=di});var $s=_((Ma,Ci)=>{"use strict";var B=Ci.exports;Ci.exports.default=B;var T="\x1B[",Ht="\x1B]",Rt="\x07",Se=";",js=process.env.TERM_PROGRAM==="Apple_Terminal";B.cursorTo=(s,t)=>{if(typeof s!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?T+(s+1)+"G":T+(t+1)+";"+(s+1)+"H"};B.cursorMove=(s,t)=>{if(typeof s!="number")throw new TypeError("The `x` argument is required");let e="";return s<0?e+=T+-s+"D":s>0&&(e+=T+s+"C"),t<0?e+=T+-t+"A":t>0&&(e+=T+t+"B"),e};B.cursorUp=(s=1)=>T+s+"A";B.cursorDown=(s=1)=>T+s+"B";B.cursorForward=(s=1)=>T+s+"C";B.cursorBackward=(s=1)=>T+s+"D";B.cursorLeft=T+"G";B.cursorSavePosition=js?"\x1B7":T+"s";B.cursorRestorePosition=js?"\x1B8":T+"u";B.cursorGetPosition=T+"6n";B.cursorNextLine=T+"E";B.cursorPrevLine=T+"F";B.cursorHide=T+"?25l";B.cursorShow=T+"?25h";B.eraseLines=s=>{let t="";for(let e=0;e<s;e++)t+=B.eraseLine+(e<s-1?B.cursorUp():"");return s&&(t+=B.cursorLeft),t};B.eraseEndLine=T+"K";B.eraseStartLine=T+"1K";B.eraseLine=T+"2K";B.eraseDown=T+"J";B.eraseUp=T+"1J";B.eraseScreen=T+"2J";B.scrollUp=T+"S";B.scrollDown=T+"T";B.clearScreen="\x1Bc";B.clearTerminal=process.platform==="win32"?`${B.eraseScreen}${T}0f`:`${B.eraseScreen}${T}3J${T}H`;B.beep=Rt;B.link=(s,t)=>[Ht,"8",Se,Se,t,Rt,s,Ht,"8",Se,Se,Rt].join("");B.image=(s,t={})=>{let e=`${Ht}1337;File=inline=1`;return t.width&&(e+=`;width=${t.width}`),t.height&&(e+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(e+=";preserveAspectRatio=0"),e+":"+s.toString("base64")+Rt};B.iTerm={setCwd:(s=process.cwd())=>`${Ht}50;CurrentDir=${s}${Rt}`,annotation:(s,t={})=>{let e=`${Ht}1337;`,i=typeof t.x<"u",n=typeof t.y<"u";if((i||n)&&!(i&&n&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return s=s.replace(/\|/g,""),e+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?e+=(i?[s,t.length,t.x,t.y]:[t.length,s]).join("|"):e+=s,e+Rt}}});var Ks=_((cl,Vr)=>{Vr.exports={name:"@under_koen/bsm",version:"1.9.0",description:"BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",license:"MIT",author:"Koen van Staveren <koen@underkoen.nl>",homepage:"https://github.com/UnderKoen/bsm#readme",repository:{type:"git",url:"https://github.com/UnderKoen/bsm.git"},bugs:{url:"https://github.com/UnderKoen/bsm/issues"},main:"dist/index.js",bin:{bsm:"./dist/index.js"},files:["dist"],scripts:{build:"bsm","build:dev":"bsm","build:prod":"bsm","build:watch":"bsm",lint:"bsm",prettier:"bsm",prepublishOnly:"bsm build.prod",test:"bsm","test:cov":"bsm test.cov"},devDependencies:{"@eslint/js":"^9.21.0","@inquirer/core":"^10.1.7","@semantic-release/changelog":"^6.0.3","@semantic-release/exec":"^7.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@types/minimist":"^1.2.5","@types/node":"^22.13.9","@types/sinon":"^17.0.4","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","@under_koen/bsm":"^1.6.2",c8:"^10.1.3","ci-info":"^4.1.0","cpy-cli":"^5.0.0",defu:"^6.1.4",esbuild:"^0.25.0",eslint:"^9.21.0","eslint-config-prettier":"^10.0.2",glob:"^11.0.3",globals:"^16.0.0",minimist:"^1.2.8",prettier:"^3.5.3","prettier-package-json":"^2.8.0",rimraf:"^6.0.1","semantic-release":"^24.2.3",sinon:"^19.0.2",tsm:"^2.3.0",typescript:"^5.8.2","typescript-eslint":"^8.26.0",uvu:"^0.5.6"},keywords:["script","scripting"]}});var Ys=_((dl,Kr)=>{Kr.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Xs=_(tt=>{"use strict";var Qs=Ys(),L=process.env;Object.defineProperty(tt,"_vendors",{value:Qs.map(function(s){return s.constant})});tt.name=null;tt.isPR=null;tt.id=null;Qs.forEach(function(s){let e=(Array.isArray(s.env)?s.env:[s.env]).every(function(i){return Js(i)});tt[s.constant]=e,e&&(tt.name=s.name,tt.isPR=Yr(s),tt.id=s.constant)});tt.isCI=!!(L.CI!=="false"&&(L.BUILD_ID||L.BUILD_NUMBER||L.CI||L.CI_APP_ID||L.CI_BUILD_ID||L.CI_BUILD_NUMBER||L.CI_NAME||L.CONTINUOUS_INTEGRATION||L.RUN_ID||tt.name));function Js(s){return typeof s=="string"?!!L[s]:"env"in s?L[s.env]&&L[s.env].includes(s.includes):"any"in s?s.any.some(function(t){return!!L[t]}):Object.keys(s).every(function(t){return L[t]===s[t]})}function Yr(s){switch(typeof s.pr){case"string":return!!L[s.pr];case"object":return"env"in s.pr?"any"in s.pr?s.pr.any.some(function(t){return L[s.pr.env]===t}):s.pr.env in L&&L[s.pr.env]!==s.pr.ne:"any"in s.pr?s.pr.any.some(function(t){return!!L[t]}):Js(s.pr);default:return null}}});var yu={};or(yu,{main:()=>tr});module.exports=ur(yu);var Zn=M(Qi());function Qe(s){if(s===null||typeof s!="object")return!1;let t=Object.getPrototypeOf(s);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in s?!1:Symbol.toStringTag in s?Object.prototype.toString.call(s)==="[object Module]":!0}function Je(s,t,e=".",i){if(!Qe(t))return Je(s,{},e,i);let n=Object.assign({},t);for(let r in s){if(r==="__proto__"||r==="constructor")continue;let o=s[r];o!=null&&(i&&i(n,r,o,e)||(Array.isArray(o)&&Array.isArray(n[r])?n[r]=[...o,...n[r]]:Qe(o)&&Qe(n[r])?n[r]=Je(o,n[r],(e?`${e}.`:"")+r.toString(),i):n[r]=o))}return n}function Xe(s){return(...t)=>t.reduce((e,i)=>Je(e,i,"",s),{})}var Ji=Xe(),vu=Xe((s,t,e)=>{if(s[t]!==void 0&&typeof e=="function")return s[t]=e(s[t]),!0}),Bu=Xe((s,t,e)=>{if(Array.isArray(s[t])&&typeof e=="function")return s[t]=e(s[t]),!0});var v=class{static silent=!1;static silence(){this.silent=!0}static log(...t){this.silent||console.log(...t)}static error(...t){this.silent||console.error(...t)}};var lr=Object.freeze({scripts:{},config:{defaultHelpBehavior:"help",caseInsensitive:!1,idempotency:{location:"./node_modules/.cache/bsm/idempotency",useFileContent:!1}}}),H=class{static getSource(t){return Array.isArray(t)?t[0]:t}static async loadExtensions(t){return!Object.hasOwn(t,"extends")||!t.extends?[]:(await Promise.all([...t.extends].map(e=>this.loadFile(e,!1)))).filter(e=>e!==void 0)}static async loadFile(t,e=!0){var n,r;if(!t)return;let i=this.getSource(t);try{i=require.resolve(i,{paths:[process.cwd()]});let o=require(i);typeof o=="function"&&(o=await o(...Array.isArray(t)?t.slice(1):[]));let u=await this.loadExtensions(o);return Ji(o,...u,lr)}catch(o){let u=o,a=(r=(n=u.requireStack)==null?void 0:n[0])==null?void 0:r.replaceAll("\\","/");if(u.code==="MODULE_NOT_FOUND"&&(a!=null&&a.includes("bsm/dist/index.js"))){if(e)return;v.error(`\x1B[31mCannot find config '${i}' to extend\x1B[0m`),process.exit(1)}else v.error(o),Array.isArray(t)&&(t=t[0]),v.error(`\x1B[31mError loading config '${t}'\x1B[0m`),process.exit(1)}}static async load(t){let e=[t.config,process.env.BSM_CONFIG,"./package.scripts.js","./package.scripts.json"].filter(i=>i!==void 0);for(let i of e){let n=await this.loadFile(i);if(n)return process.env.BSM_CONFIG=i,this._config=n,n}v.error(`\x1B[31mCannot find config ${e.map(i=>`'${i}'`).join(" or ")}\x1B[0m`),process.exit(1)}static _config;static get config(){if(this._config)return this._config;throw new Error("Config not loaded")}};var he=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t==null?void 0:t.cause}},ce=class extends Error{name="CancelPromptError";message="Prompt was canceled"},fe=class extends Error{name="ExitPromptError"},De=class extends Error{name="HookError"},de=class extends Error{name="ValidationError"};var pe=require("node:async_hooks");var Xi=new pe.AsyncLocalStorage;function hr(s){return{rl:s,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Zi(s,t){let e=hr(s);return Xi.run(e,()=>{function i(n){e.handleChange=()=>{e.index=0,n()},e.handleChange()}return t(i)})}function wt(){let s=Xi.getStore();if(!s)throw new De("[Inquirer] Hook functions can only be called from within a prompt");return s}function Ze(){return wt().rl}function ti(s){let t=(...e)=>{let i=wt(),n=!1,r=i.handleChange;i.handleChange=()=>{n=!0};let o=s(...e);return n&&r(),i.handleChange=r,o};return pe.AsyncResource.bind(t)}function vt(s){let t=wt(),{index:e}=t,i={get(){return t.hooks[e]},set(r){t.hooks[e]=r},initialized:e in t.hooks},n=s(i);return t.index++,n}function ts(){wt().handleChange()}var Ct={queue(s){let t=wt(),{index:e}=t;t.hooksEffect.push(()=>{var n,r;(r=(n=t.hooksCleanup)[e])==null||r.call(n);let i=s(Ze());if(i!=null&&typeof i!="function")throw new de("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[e]=i})},run(){let s=wt();ti(()=>{s.hooksEffect.forEach(t=>{t()}),s.hooksEffect.length=0})()},clearAll(){let s=wt();s.hooksCleanup.forEach(t=>{t==null||t()}),s.hooksEffect.length=0,s.hooksCleanup.length=0}};function at(s){return vt(t=>{let e=n=>{t.get()!==n&&(t.set(n),ts())};if(t.initialized)return[t.get(),e];let i=typeof s=="function"?s():s;return t.set(i),[i,e]})}function me(s,t){vt(e=>{let i=e.get();(!Array.isArray(i)||t.some((r,o)=>!Object.is(r,i[o])))&&Ct.queue(s),e.set(t)})}var K=M(ns(),1);var X=M(require("node:process"),1);function fr(){return X.default.platform!=="win32"?X.default.env.TERM!=="linux":!!X.default.env.WT_SESSION||!!X.default.env.TERMINUS_SUBLIME||X.default.env.ConEmuTask==="{cmd::Cmder}"||X.default.env.TERM_PROGRAM==="Terminus-Sublime"||X.default.env.TERM_PROGRAM==="vscode"||X.default.env.TERM==="xterm-256color"||X.default.env.TERM==="alacritty"||X.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var rs={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"},os={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"},Dr={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"},dr={...rs,...os},pr={...rs,...Dr},mr=fr(),gr=mr?dr:pr,ii=gr,Wu=Object.entries(os);var Er={prefix:{idle:K.default.blue("?"),done:K.default.green(ii.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(s=>K.default.yellow(s))},style:{answer:K.default.cyan,message:K.default.bold,error:s=>K.default.red(`> ${s}`),defaultAnswer:s=>K.default.dim(`(${s})`),help:K.default.dim,highlight:K.default.cyan,key:s=>K.default.cyan(K.default.bold(`<${s}>`))}};function si(s,t){return vt(e=>{let i=e.get();if(!i||i.dependencies.length!==t.length||i.dependencies.some((n,r)=>n!==t[r])){let n=s();return e.set({value:n,dependencies:t}),n}return i.value})}function Ee(s){return at({current:s})[0]}function ni(s){let t=Ee(s);t.current=s,me(e=>{let i=!1,n=ti((r,o)=>{i||t.current(o,e)});return e.input.on("keypress",n),()=>{i=!0,e.input.removeListener("keypress",n)}},[])}var ks=M(as(),1),Us=M(Is(),1);function Ce(s,t){return s.split(`
9
+ `).flatMap(e=>(0,Us.default)(e,t,{trim:!1,hard:!0}).split(`
10
+ `).map(i=>i.trimEnd())).join(`
11
+ `)}function Di(){return(0,ks.default)({defaultWidth:80,output:Ze().output})}var Hs=M(require("node:readline"),1),qs=require("node:async_hooks"),Vs=M(Ps(),1);var Ft=[];Ft.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ft.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ft.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Fe=s=>!!s&&typeof s=="object"&&typeof s.removeListener=="function"&&typeof s.emit=="function"&&typeof s.reallyExit=="function"&&typeof s.listeners=="function"&&typeof s.kill=="function"&&typeof s.pid=="number"&&typeof s.on=="function",pi=Symbol.for("signal-exit emitter"),mi=globalThis,Gr=Object.defineProperty.bind(Object),gi=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(mi[pi])return mi[pi];Gr(mi,pi,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,e){this.listeners[t].push(e)}removeListener(t,e){let i=this.listeners[t],n=i.indexOf(e);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(t,e,i){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(let r of this.listeners[t])n=r(e,i)===!0||n;return t==="exit"&&(n=this.emit("afterExit",e,i)||n),n}},ye=class{},zr=s=>({onExit(t,e){return s.onExit(t,e)},load(){return s.load()},unload(){return s.unload()}}),Ei=class extends ye{onExit(){return()=>{}}load(){}unload(){}},bi=class extends ye{#t=wi.platform==="win32"?"SIGINT":"SIGHUP";#e=new gi;#i;#s;#o;#f={};#u=!1;constructor(t){super(),this.#i=t,this.#f={};for(let e of Ft)this.#f[e]=()=>{let i=this.#i.listeners(e),{count:n}=this.#e,r=t;if(typeof r.__signal_exit_emitter__=="object"&&typeof r.__signal_exit_emitter__.count=="number"&&(n+=r.__signal_exit_emitter__.count),i.length===n){this.unload();let o=this.#e.emit("exit",null,e),u=e==="SIGHUP"?this.#t:e;o||t.kill(t.pid,u)}};this.#o=t.reallyExit,this.#s=t.emit}onExit(t,e){if(!Fe(this.#i))return()=>{};this.#u===!1&&this.load();let i=e!=null&&e.alwaysLast?"afterExit":"exit";return this.#e.on(i,t),()=>{this.#e.removeListener(i,t),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#u){this.#u=!0,this.#e.count+=1;for(let t of Ft)try{let e=this.#f[t];e&&this.#i.on(t,e)}catch{}this.#i.emit=(t,...e)=>this.#a(t,...e),this.#i.reallyExit=t=>this.#c(t)}}unload(){this.#u&&(this.#u=!1,Ft.forEach(t=>{let e=this.#f[t];if(!e)throw new Error("Listener not defined for signal: "+t);try{this.#i.removeListener(t,e)}catch{}}),this.#i.emit=this.#s,this.#i.reallyExit=this.#o,this.#e.count-=1)}#c(t){return Fe(this.#i)?(this.#i.exitCode=t||0,this.#e.emit("exit",this.#i.exitCode,null),this.#o.call(this.#i,this.#i.exitCode)):0}#a(t,...e){let i=this.#s;if(t==="exit"&&Fe(this.#i)){typeof e[0]=="number"&&(this.#i.exitCode=e[0]);let n=i.call(this.#i,t,...e);return this.#e.emit("exit",this.#i.exitCode,null),n}else return i.call(this.#i,t,...e)}},wi=globalThis.process,{onExit:Ns,load:Ia,unload:ka}=zr(Fe(wi)?new bi(wi):new Ei);var zs=require("node:util"),ft=M($s(),1);var Ws=s=>s.split(`
12
+ `).length,Hr=s=>s.split(`
13
+ `).pop()??"";function Gs(s){return s>0?ft.default.cursorDown(s):""}var qt=class{rl;height=0;extraLinesUnderPrompt=0;cursorPos;constructor(t){this.rl=t,this.rl=t,this.cursorPos=t.getCursorPos()}write(t){this.rl.output.unmute(),this.rl.output.write(t),this.rl.output.mute()}render(t,e=""){let i=Hr(t),n=(0,zs.stripVTControlCharacters)(i),r=n;this.rl.line.length>0&&(r=r.slice(0,-this.rl.line.length)),this.rl.setPrompt(r),this.cursorPos=this.rl.getCursorPos();let o=Di();t=Ce(t,o),e=Ce(e,o),n.length%o===0&&(t+=`
14
+ `);let u=t+(e?`
15
+ `+e:""),l=Math.floor(n.length/o)-this.cursorPos.rows+(e?Ws(e):0);l>0&&(u+=ft.default.cursorUp(l)),u+=ft.default.cursorTo(this.cursorPos.cols),this.write(Gs(this.extraLinesUnderPrompt)+ft.default.eraseLines(this.height)+u),this.extraLinesUnderPrompt=l,this.height=Ws(u)}checkCursorPos(){let t=this.rl.getCursorPos();t.cols!==this.cursorPos.cols&&(this.write(ft.default.cursorTo(t.cols)),this.cursorPos=t)}done({clearContent:t}){this.rl.setPrompt("");let e=Gs(this.extraLinesUnderPrompt);e+=t?ft.default.eraseLines(this.height):`
16
+ `,e+=ft.default.cursorShow,this.write(e),this.rl.close()}};var xe=class extends Promise{static withResolver(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}};function qr(){let s=Error.prepareStackTrace;try{let t=[];return Error.prepareStackTrace=(e,i)=>{let n=i.slice(1);return t=n,n},new Error().stack,t}finally{Error.prepareStackTrace=s}}function Fi(s){var n,r;let e=(r=(n=qr()[1])==null?void 0:n.getFileName)==null?void 0:r.call(n);return(o,u={})=>{let{input:a=process.stdin,signal:l}=u,h=new Set,c=new Vs.default;c.pipe(u.output??process.stdout);let f=Hs.createInterface({terminal:!0,input:a,output:c}),D=new qt(f),{promise:g,resolve:d,reject:b}=xe.withResolver(),m=()=>b(new ce);if(l){let E=()=>b(new he({cause:l.reason}));if(l.aborted)return E(),Object.assign(g,{cancel:m});l.addEventListener("abort",E),h.add(()=>l.removeEventListener("abort",E))}h.add(Ns((E,p)=>{b(new fe(`User force closed the prompt with ${E} ${p}`))}));let F=()=>D.checkCursorPos();return f.input.on("keypress",F),h.add(()=>f.input.removeListener("keypress",F)),Zi(f,E=>{let p=qs.AsyncResource.bind(()=>Ct.clearAll());return f.on("close",p),h.add(()=>f.removeListener("close",p)),E(()=>{try{let w=s(o,W=>{setImmediate(()=>d(W))});if(w===void 0)throw new Error(`Prompt functions must return a string.
17
+ at ${e}`);let[R,y]=typeof w=="string"?[w]:w;D.render(R,y),Ct.run()}catch(w){b(w)}}),Object.assign(g.then(w=>(Ct.clearAll(),w),w=>{throw Ct.clearAll(),w}).finally(()=>{h.forEach(w=>w()),D.done({clearContent:!!u.clearPromptOnDone}),c.end()}).then(()=>g),{cancel:m})})}}var Z=class s{static printHelp(t,e){let i=e._;if(i.length===0)v.log(`
18
+ \x1B[1mAvailable commands:\x1B[0m`),s.printCommands(t.scripts);else for(let n of i){v.log(`
19
+ \x1B[1mAvailable commands: \x1B[90m${n}\x1B[0m`);let r=n.split("."),o=[[t.scripts,[],r]];for(;o.length>0;){let u=o.shift();if(u[2].length===0)s.printCommands(u[0],u[1]);else if(u[2][0]==="*"){if(typeof u[0]=="object")if(Array.isArray(u[0]))for(let a=0;a<u[0].length;a++)o.push([u[0][a],[...u[1],a.toString()],[]]);else for(let a in u[0])Object.hasOwn(u[0],a)&&o.push([u[0][a],[...u[1],a],u[2].slice(1)])}else{let a=u[2][0];if(typeof u[0]=="object")if(Array.isArray(u[0])){let l=parseInt(a);o.push([u[0][l],[...u[1],l.toString()],u[2].slice(1)])}else o.push([u[0][a],[...u[1],a],u[2].slice(1)])}}}process.exit(0)}static printCommands(t,e=[],i=!0){if(Array.isArray(t))t.forEach((n,r)=>{s.printCommand(n,[...e,r.toString()])});else if(typeof t=="object"){i&&e.length>0&&s.printCommand(t,[...e]);for(let n in t)Object.hasOwn(t,n)&&s.printCommand(t[n],[...e,n])}else s.printCommand(t,e)}static printCommand(t,e){if(t===void 0){v.error(`\x1B[31mScript '${e.join(".")}' not found\x1B[0m`);return}let i=s.getCommandHelp(t,e);i&&v.log(i)}static getCommandHelp(t,e){if(e[e.length-1]==="$description")return;let i=`\x1B[92m${e.join(".")}\x1B[0m\x1B[90m - \x1B[0m`,n;return typeof t=="string"?n=t:typeof t=="function"?n="\x1B[90m<function>\x1B[0m":Array.isArray(t)?n=`\x1B[90m[${t.length}]\x1B[0m`:Object.hasOwn(t,"$description")?n=`\x1B[90m${t.$description}\x1B[0m`:n=`\x1B[90m{${Object.keys(t).join(", ")}}\x1B[0m`,`${i}${n}`}static printVersion(){let t=Ks();v.log(t.version),process.exit(0)}};var Kn=M(require("node:child_process")),Yn=M(Xs());var Qn=M(require("path")),qe=M(require("fs"));var Vn=require("node:crypto");var gt=M(require("fs")),Gi=M(require("path"));var yi=(s,t,e)=>{let i=s instanceof RegExp?Zs(s,e):s,n=t instanceof RegExp?Zs(t,e):t,r=i!==null&&n!=null&&Qr(i,n,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+i.length,r[1]),post:e.slice(r[1]+n.length)}},Zs=(s,t)=>{let e=t.match(s);return e?e[0]:null},Qr=(s,t,e)=>{let i,n,r,o,u,a=e.indexOf(s),l=e.indexOf(t,a+1),h=a;if(a>=0&&l>0){if(s===t)return[a,l];for(i=[],r=e.length;h>=0&&!u;){if(h===a)i.push(h),a=e.indexOf(s,h+1);else if(i.length===1){let c=i.pop();c!==void 0&&(u=[c,l])}else n=i.pop(),n!==void 0&&n<r&&(r=n,o=l),l=e.indexOf(t,h+1);h=a<l&&a>=0?a:l}i.length&&o!==void 0&&(u=[r,o])}return u};var tn="\0SLASH"+Math.random()+"\0",en="\0OPEN"+Math.random()+"\0",xi="\0CLOSE"+Math.random()+"\0",sn="\0COMMA"+Math.random()+"\0",nn="\0PERIOD"+Math.random()+"\0",Jr=new RegExp(tn,"g"),Xr=new RegExp(en,"g"),Zr=new RegExp(xi,"g"),to=new RegExp(sn,"g"),eo=new RegExp(nn,"g"),io=/\\\\/g,so=/\\{/g,no=/\\}/g,ro=/\\,/g,oo=/\\./g;function Si(s){return isNaN(s)?s.charCodeAt(0):parseInt(s,10)}function uo(s){return s.replace(io,tn).replace(so,en).replace(no,xi).replace(ro,sn).replace(oo,nn)}function ao(s){return s.replace(Jr,"\\").replace(Xr,"{").replace(Zr,"}").replace(to,",").replace(eo,".")}function rn(s){if(!s)return[""];let t=[],e=yi("{","}",s);if(!e)return s.split(",");let{pre:i,body:n,post:r}=e,o=i.split(",");o[o.length-1]+="{"+n+"}";let u=rn(r);return r.length&&(o[o.length-1]+=u.shift(),o.push.apply(o,u)),t.push.apply(t,o),t}function on(s){return s?(s.slice(0,2)==="{}"&&(s="\\{\\}"+s.slice(2)),Vt(uo(s),!0).map(ao)):[]}function lo(s){return"{"+s+"}"}function ho(s){return/^-?0\d/.test(s)}function co(s,t){return s<=t}function fo(s,t){return s>=t}function Vt(s,t){let e=[],i=yi("{","}",s);if(!i)return[s];let n=i.pre,r=i.post.length?Vt(i.post,!1):[""];if(/\$$/.test(i.pre))for(let o=0;o<r.length;o++){let u=n+"{"+i.body+"}"+r[o];e.push(u)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),a=o||u,l=i.body.indexOf(",")>=0;if(!a&&!l)return i.post.match(/,(?!,).*\}/)?(s=i.pre+"{"+i.body+xi+i.post,Vt(s)):[s];let h;if(a)h=i.body.split(/\.\./);else if(h=rn(i.body),h.length===1&&h[0]!==void 0&&(h=Vt(h[0],!1).map(lo),h.length===1))return r.map(f=>i.pre+h[0]+f);let c;if(a&&h[0]!==void 0&&h[1]!==void 0){let f=Si(h[0]),D=Si(h[1]),g=Math.max(h[0].length,h[1].length),d=h.length===3&&h[2]!==void 0?Math.abs(Si(h[2])):1,b=co;D<f&&(d*=-1,b=fo);let F=h.some(ho);c=[];for(let E=f;b(E,D);E+=d){let p;if(u)p=String.fromCharCode(E),p==="\\"&&(p="");else if(p=String(E),F){let w=g-p.length;if(w>0){let R=new Array(w+1).join("0");E<0?p="-"+R+p.slice(1):p=R+p}}c.push(p)}}else{c=[];for(let f=0;f<h.length;f++)c.push.apply(c,Vt(h[f],!1))}for(let f=0;f<c.length;f++)for(let D=0;D<r.length;D++){let g=n+c[f]+r[D];(!t||a||g)&&e.push(g)}}return e}var Kt=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")};var Do={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Yt=s=>s.replace(/[[\]\\-]/g,"\\$&"),po=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),un=s=>s.join(""),an=(s,t)=>{let e=t;if(s.charAt(e)!=="[")throw new Error("not in a brace expression");let i=[],n=[],r=e+1,o=!1,u=!1,a=!1,l=!1,h=e,c="";t:for(;r<s.length;){let d=s.charAt(r);if((d==="!"||d==="^")&&r===e+1){l=!0,r++;continue}if(d==="]"&&o&&!a){h=r+1;break}if(o=!0,d==="\\"&&!a){a=!0,r++;continue}if(d==="["&&!a){for(let[b,[m,F,E]]of Object.entries(Do))if(s.startsWith(b,r)){if(c)return["$.",!1,s.length-e,!0];r+=b.length,E?n.push(m):i.push(m),u=u||F;continue t}}if(a=!1,c){d>c?i.push(Yt(c)+"-"+Yt(d)):d===c&&i.push(Yt(d)),c="",r++;continue}if(s.startsWith("-]",r+1)){i.push(Yt(d+"-")),r+=2;continue}if(s.startsWith("-",r+1)){c=d,r+=2;continue}i.push(Yt(d)),r++}if(h<r)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,s.length-e,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let d=i[0].length===2?i[0].slice(-1):i[0];return[po(d),!1,h-e,!1]}let f="["+(l?"^":"")+un(i)+"]",D="["+(l?"":"^")+un(n)+"]";return[i.length&&n.length?"("+f+"|"+D+")":i.length?f:D,u,h-e,!0]};var et=(s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var mo=new Set(["!","?","+","*","@"]),ln=s=>mo.has(s),go="(?!(?:^|/)\\.\\.?(?:$|/))",ve="(?!\\.)",Eo=new Set(["[","."]),bo=new Set(["..","."]),wo=new Set("().*{}+?[]^$\\!"),Co=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vi="[^/]",hn=vi+"*?",cn=vi+"+?",Ot=class s{type;#t;#e;#i=!1;#s=[];#o;#f;#u;#c=!1;#a;#l;#r=!1;constructor(t,e,i={}){this.type=t,t&&(this.#e=!0),this.#o=e,this.#t=this.#o?this.#o.#t:this,this.#a=this.#t===this?i:this.#t.#a,this.#u=this.#t===this?[]:this.#t.#u,t==="!"&&!this.#t.#c&&this.#u.push(this),this.#f=this.#o?this.#o.#s.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let t of this.#s)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#s.map(t=>String(t)).join("|")+")":this.#l=this.#s.map(t=>String(t)).join("")}#g(){if(this!==this.#t)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#u.pop();){if(t.type!=="!")continue;let e=t,i=e.#o;for(;i;){for(let n=e.#f+1;!i.type&&n<i.#s.length;n++)for(let r of t.#s){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(i.#s[n])}e=i,i=e.#o}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof s&&e.#o===this))throw new Error("invalid part: "+e);this.#s.push(e)}}toJSON(){var e;let t=this.type===null?this.#s.slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...this.#s.map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#c&&((e=this.#o)==null?void 0:e.type)==="!")&&t.push({}),t}isStart(){var e;if(this.#t===this)return!0;if(!((e=this.#o)!=null&&e.isStart()))return!1;if(this.#f===0)return!0;let t=this.#o;for(let i=0;i<this.#f;i++){let n=t.#s[i];if(!(n instanceof s&&n.type==="!"))return!1}return!0}isEnd(){var e,i,n;if(this.#t===this||((e=this.#o)==null?void 0:e.type)==="!")return!0;if(!((i=this.#o)!=null&&i.isEnd()))return!1;if(!this.type)return(n=this.#o)==null?void 0:n.isEnd();let t=this.#o?this.#o.#s.length:0;return this.#f===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new s(this.type,t);for(let i of this.#s)e.copyIn(i);return e}static#E(t,e,i,n){let r=!1,o=!1,u=-1,a=!1;if(e.type===null){let D=i,g="";for(;D<t.length;){let d=t.charAt(D++);if(r||d==="\\"){r=!r,g+=d;continue}if(o){D===u+1?(d==="^"||d==="!")&&(a=!0):d==="]"&&!(D===u+2&&a)&&(o=!1),g+=d;continue}else if(d==="["){o=!0,u=D,a=!1,g+=d;continue}if(!n.noext&&ln(d)&&t.charAt(D)==="("){e.push(g),g="";let b=new s(d,e);D=s.#E(t,b,D,n),e.push(b);continue}g+=d}return e.push(g),D}let l=i+1,h=new s(null,e),c=[],f="";for(;l<t.length;){let D=t.charAt(l++);if(r||D==="\\"){r=!r,f+=D;continue}if(o){l===u+1?(D==="^"||D==="!")&&(a=!0):D==="]"&&!(l===u+2&&a)&&(o=!1),f+=D;continue}else if(D==="["){o=!0,u=l,a=!1,f+=D;continue}if(ln(D)&&t.charAt(l)==="("){h.push(f),f="";let g=new s(D,h);h.push(g),l=s.#E(t,g,l,n);continue}if(D==="|"){h.push(f),f="",c.push(h),h=new s(null,e);continue}if(D===")")return f===""&&e.#s.length===0&&(e.#r=!0),h.push(f),f="",e.push(...c,h),l;f+=D}return e.type=null,e.#e=void 0,e.#s=[t.substring(i-1)],l}static fromGlob(t,e={}){let i=new s(null,void 0,e);return s.#E(t,i,0,e),i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,i,n,r]=this.toRegExpSource();if(!(n||this.#e||this.#a.nocase&&!this.#a.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let u=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,u),{_src:e,_glob:t})}get options(){return this.#a}toRegExpSource(t){var a;let e=t??!!this.#a.dot;if(this.#t===this&&this.#g(),!this.type){let l=this.isStart()&&this.isEnd(),h=this.#s.map(g=>{let[d,b,m,F]=typeof g=="string"?s.#D(g,this.#e,l):g.toRegExpSource(t);return this.#e=this.#e||m,this.#i=this.#i||F,d}).join(""),c="";if(this.isStart()&&typeof this.#s[0]=="string"&&!(this.#s.length===1&&bo.has(this.#s[0]))){let d=Eo,b=e&&d.has(h.charAt(0))||h.startsWith("\\.")&&d.has(h.charAt(2))||h.startsWith("\\.\\.")&&d.has(h.charAt(4)),m=!e&&!t&&d.has(h.charAt(0));c=b?go:m?ve:""}let f="";return this.isEnd()&&this.#t.#c&&((a=this.#o)==null?void 0:a.type)==="!"&&(f="(?:$|\\/)"),[c+h+f,et(h),this.#e=!!this.#e,this.#i]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#d(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let l=this.toString();return this.#s=[l],this.type=null,this.#e=void 0,[l,et(this.toString()),!1,!1]}let o=!i||t||e||!ve?"":this.#d(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let u="";if(this.type==="!"&&this.#r)u=(this.isStart()&&!e?ve:"")+cn;else{let l=this.type==="!"?"))"+(this.isStart()&&!e&&!t?ve:"")+hn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;u=n+r+l}return[u,et(r),this.#e=!!this.#e,this.#i]}#d(t){return this.#s.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[i,n,r,o]=e.toRegExpSource(t);return this.#i=this.#i||o,i}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#D(t,e,i=!1){let n=!1,r="",o=!1;for(let u=0;u<t.length;u++){let a=t.charAt(u);if(n){n=!1,r+=(wo.has(a)?"\\":"")+a;continue}if(a==="\\"){u===t.length-1?r+="\\\\":n=!0;continue}if(a==="["){let[l,h,c,f]=an(t,u);if(c){r+=l,o=o||h,u+=c-1,e=e||f;continue}}if(a==="*"){i&&t==="*"?r+=cn:r+=hn,e=!0;continue}if(a==="?"){r+=vi,e=!0;continue}r+=Co(a)}return[r,et(t),!!e,o]}};var Lt=(s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&");var G=(s,t,e={})=>(Kt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new q(t,e).match(s)),Fo=/^\*+([^+@!?\*\[\(]*)$/,yo=s=>t=>!t.startsWith(".")&&t.endsWith(s),So=s=>t=>t.endsWith(s),xo=s=>(s=s.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(s)),vo=s=>(s=s.toLowerCase(),t=>t.toLowerCase().endsWith(s)),Bo=/^\*+\.\*+$/,Ao=s=>!s.startsWith(".")&&s.includes("."),To=s=>s!=="."&&s!==".."&&s.includes("."),Ro=/^\.\*+$/,Oo=s=>s!=="."&&s!==".."&&s.startsWith("."),Lo=/^\*+$/,_o=s=>s.length!==0&&!s.startsWith("."),Io=s=>s.length!==0&&s!=="."&&s!=="..",ko=/^\?+([^+@!?\*\[\(]*)?$/,Uo=([s,t=""])=>{let e=dn([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},Mo=([s,t=""])=>{let e=pn([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},Po=([s,t=""])=>{let e=pn([s]);return t?i=>e(i)&&i.endsWith(t):e},No=([s,t=""])=>{let e=dn([s]);return t?i=>e(i)&&i.endsWith(t):e},dn=([s])=>{let t=s.length;return e=>e.length===t&&!e.startsWith(".")},pn=([s])=>{let t=s.length;return e=>e.length===t&&e!=="."&&e!==".."},mn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fn={win32:{sep:"\\"},posix:{sep:"/"}},jo=mn==="win32"?fn.win32.sep:fn.posix.sep;G.sep=jo;var P=Symbol("globstar **");G.GLOBSTAR=P;var $o="[^/]",Wo=$o+"*?",Go="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",zo="(?:(?!(?:\\/|^)\\.).)*?",Ho=(s,t={})=>e=>G(e,s,t);G.filter=Ho;var Y=(s,t={})=>Object.assign({},s,t),qo=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return G;let t=G;return Object.assign((i,n,r={})=>t(i,n,Y(s,r)),{Minimatch:class extends t.Minimatch{constructor(n,r={}){super(n,Y(s,r))}static defaults(n){return t.defaults(Y(s,n)).Minimatch}},AST:class extends t.AST{constructor(n,r,o={}){super(n,r,Y(s,o))}static fromGlob(n,r={}){return t.AST.fromGlob(n,Y(s,r))}},unescape:(i,n={})=>t.unescape(i,Y(s,n)),escape:(i,n={})=>t.escape(i,Y(s,n)),filter:(i,n={})=>t.filter(i,Y(s,n)),defaults:i=>t.defaults(Y(s,i)),makeRe:(i,n={})=>t.makeRe(i,Y(s,n)),braceExpand:(i,n={})=>t.braceExpand(i,Y(s,n)),match:(i,n,r={})=>t.match(i,n,Y(s,r)),sep:t.sep,GLOBSTAR:P})};G.defaults=qo;var gn=(s,t={})=>(Kt(s),t.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:on(s));G.braceExpand=gn;var Vo=(s,t={})=>new q(s,t).makeRe();G.makeRe=Vo;var Ko=(s,t,e={})=>{let i=new q(t,e);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(t),s};G.match=Ko;var Dn=/[?*]|[+@!]\(.*?\)|\[|\]/,Yo=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),q=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){Kt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||mn,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,u)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=r[0]===""&&r[1]===""&&(r[2]==="?"||!Dn.test(r[2]))&&!Dn.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(a)return[...r.slice(0,4),...r.slice(4).map(h=>this.parse(h))];if(l)return[r[0],...r.slice(1).map(h=>this.parse(h))]}return r.map(a=>this.parse(a))});if(this.debug(this.pattern,n),this.set=n.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i=0;i<t.length;i++)for(let n=0;n<t[i].length;n++)t[i][n]==="**"&&(t[i][n]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let i=-1;for(;(i=e.indexOf("**",i+1))!==-1;){let n=i;for(;e[n+1]==="**";)n++;n!==i&&e.splice(i,n-i)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((i,n)=>{let r=i[i.length-1];return n==="**"&&r==="**"?i:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){let r=t[n];n===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let n=t[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(e=!0,t.splice(i-1,2),i-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let i of t){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let o=n;for(;i[o+1]==="**";)o++;o>n&&i.splice(n+1,o-n);let u=i[n+1],a=i[n+2],l=i[n+3];if(u!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;e=!0,i.splice(n,1);let h=i.slice(0);h[n]="**",t.push(h),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let u=i[o];o===1&&u===""&&i[0]===""||(u==="."||u==="")&&(e=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(e=!0,i.pop())}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){let o=i[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let a=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...a),i.length===0&&i.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let i=e+1;i<t.length;i++){let n=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(n){t[e]=[],t[i]=n;break}}return t.filter(e=>e.length)}partsMatch(t,e,i=!1){let n=0,r=0,o=[],u="";for(;n<t.length&&r<e.length;)if(t[n]===e[r])o.push(u==="b"?e[r]:t[n]),n++,r++;else if(i&&t[n]==="**"&&e[r]===t[n+1])o.push(t[n]),n++;else if(i&&e[r]==="**"&&t[n]===e[r+1])o.push(e[r]),r++;else if(t[n]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(u==="b")return!1;u="a",o.push(t[n]),n++,r++}else if(e[r]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(u==="a")return!1;u="b",o.push(e[r]),n++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,i=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,i++;i&&(this.pattern=t.slice(i)),this.negate=e}matchOne(t,e,i=!1){let n=this.options;if(this.isWindows){let d=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!d&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),F=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),E=b?3:d?0:void 0,p=F?3:m?0:void 0;if(typeof E=="number"&&typeof p=="number"){let[w,R]=[t[E],e[p]];w.toLowerCase()===R.toLowerCase()&&(e[p]=w,p>E?e=e.slice(p):E>p&&(t=t.slice(E)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,u=0,a=t.length,l=e.length;o<a&&u<l;o++,u++){this.debug("matchOne loop");var h=e[u],c=t[o];if(this.debug(e,h,c),h===!1)return!1;if(h===P){this.debug("GLOBSTAR",[e,h,c]);var f=o,D=u+1;if(D===l){for(this.debug("** at the end");o<a;o++)if(t[o]==="."||t[o]===".."||!n.dot&&t[o].charAt(0)===".")return!1;return!0}for(;f<a;){var g=t[f];if(this.debug(`
20
+ globstar while`,t,f,e,D,g),this.matchOne(t.slice(f),e.slice(D),i))return this.debug("globstar found match!",f,a,g),!0;if(g==="."||g===".."||!n.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,f,e,D);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(i&&(this.debug(`
21
+ >>> no match, partial?`,t,f,e,D),f===a))}let d;if(typeof h=="string"?(d=c===h,this.debug("string match",h,c,d)):(d=h.test(c),this.debug("pattern match",h,c,d)),!d)return!1}if(o===a&&u===l)return!0;if(o===a)return i;if(u===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return gn(this.pattern,this.options)}parse(t){Kt(t);let e=this.options;if(t==="**")return P;if(t==="")return"";let i,n=null;(i=t.match(Lo))?n=e.dot?Io:_o:(i=t.match(Fo))?n=(e.nocase?e.dot?vo:xo:e.dot?So:yo)(i[1]):(i=t.match(ko))?n=(e.nocase?e.dot?Mo:Uo:e.dot?Po:No)(i):(i=t.match(Bo))?n=e.dot?To:Ao:(i=t.match(Ro))&&(n=Oo);let r=Ot.fromGlob(t,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,i=e.noglobstar?Wo:e.dot?Go:zo,n=new Set(e.nocase?["i"]:[]),r=t.map(a=>{let l=a.map(h=>{if(h instanceof RegExp)for(let c of h.flags.split(""))n.add(c);return typeof h=="string"?Yo(h):h===P?P:h._src});return l.forEach((h,c)=>{let f=l[c+1],D=l[c-1];h!==P||D===P||(D===void 0?f!==void 0&&f!==P?l[c+1]="(?:\\/|"+i+"\\/)?"+f:l[c]=i:f===void 0?l[c-1]=D+"(?:\\/|"+i+")?":f!==P&&(l[c-1]=D+"(?:\\/|\\/"+i+"\\/)"+f,l[c+1]=P))}),l.filter(h=>h!==P).join("/")}).join("|"),[o,u]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+u+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let n=this.slashSplit(t);this.debug(this.pattern,"split",n);let r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let u=n.length-2;!o&&u>=0;u--)o=n[u];for(let u=0;u<r.length;u++){let a=r[u],l=n;if(i.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,e))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return G.defaults(t).Minimatch}};G.AST=Ot;G.Minimatch=q;G.escape=Lt;G.unescape=et;var Wn=require("node:url");var _t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,wn=new Set,Bi=typeof process=="object"&&process?process:{},Cn=(s,t,e,i)=>{typeof Bi.emitWarning=="function"?Bi.emitWarning(s,t,e,i):console.error(`[${e}] ${t}: ${s}`)},Be=globalThis.AbortController,En=globalThis.AbortSignal,bn;if(typeof Be>"u"){En=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},Be=class{constructor(){t()}signal=new En;abort(i){var n,r;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let o of this.signal._onabort)o(i);(r=(n=this.signal).onabort)==null||r.call(n,i)}}};let s=((bn=Bi.env)==null?void 0:bn.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{s&&(s=!1,Cn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Qo=s=>!wn.has(s),Nl=Symbol("type"),Dt=s=>s&&s===Math.floor(s)&&s>0&&isFinite(s),Fn=s=>Dt(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?It:null:null,It=class extends Array{constructor(t){super(t),this.fill(0)}},Ai=class s{heap;length;static#t=!1;static create(t){let e=Fn(t);if(!e)return[];s.#t=!0;let i=new s(t,e);return s.#t=!1,i}constructor(t,e){if(!s.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Qt=class s{#t;#e;#i;#s;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#c;#a;#l;#r;#g;#E;#d;#D;#y;#m;#S;#x;#w;#C;#F;#p;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#w,sizes:t.#S,keyMap:t.#a,keyList:t.#l,valList:t.#r,next:t.#g,prev:t.#E,get head(){return t.#d},get tail(){return t.#D},free:t.#y,isBackgroundFetch:e=>t.#h(e),backgroundFetch:(e,i,n,r)=>t.#P(e,i,n,r),moveToTail:e=>t.#j(e),indexes:e=>t.#B(e),rindexes:e=>t.#A(e),isStale:e=>t.#b(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#c}get size(){return this.#u}get fetchMethod(){return this.#o}get memoMethod(){return this.#f}get dispose(){return this.#i}get disposeAfter(){return this.#s}constructor(t){let{max:e=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:a,dispose:l,disposeAfter:h,noDisposeOnSet:c,noUpdateTTL:f,maxSize:D=0,maxEntrySize:g=0,sizeCalculation:d,fetchMethod:b,memoMethod:m,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=t;if(e!==0&&!Dt(e))throw new TypeError("max option must be a nonnegative integer");let y=e?Fn(e):Array;if(!y)throw new Error("invalid max value: "+e);if(this.#t=e,this.#e=D,this.maxEntrySize=g||this.#e,this.sizeCalculation=d,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=m,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=b,this.#F=!!b,this.#a=new Map,this.#l=new Array(e).fill(void 0),this.#r=new Array(e).fill(void 0),this.#g=new y(e),this.#E=new y(e),this.#d=0,this.#D=0,this.#y=Ai.create(e),this.#u=0,this.#c=0,typeof l=="function"&&(this.#i=l),typeof h=="function"?(this.#s=h,this.#m=[]):(this.#s=void 0,this.#m=void 0),this.#C=!!this.#i,this.#p=!!this.#s,this.noDisposeOnSet=!!c,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#e!==0&&!Dt(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!Dt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=Dt(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!Dt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let W="LRU_CACHE_UNBOUNDED";Qo(W)&&(wn.add(W),Cn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",W,s))}}getRemainingTTL(t){return this.#a.has(t)?1/0:0}#T(){let t=new It(this.#t),e=new It(this.#t);this.#w=t,this.#x=e,this.#L=(r,o,u=_t.now())=>{if(e[r]=o!==0?u:0,t[r]=o,o!==0&&this.ttlAutopurge){let a=setTimeout(()=>{this.#b(r)&&this.#O(this.#l[r],"expire")},o+1);a.unref&&a.unref()}},this.#v=r=>{e[r]=t[r]!==0?_t.now():0},this.#n=(r,o)=>{if(t[o]){let u=t[o],a=e[o];if(!u||!a)return;r.ttl=u,r.start=a,r.now=i||n();let l=r.now-a;r.remainingTTL=u-l}};let i=0,n=()=>{let r=_t.now();if(this.ttlResolution>0){i=r;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return r};this.getRemainingTTL=r=>{let o=this.#a.get(r);if(o===void 0)return 0;let u=t[o],a=e[o];if(!u||!a)return 1/0;let l=(i||n())-a;return u-l},this.#b=r=>{let o=e[r],u=t[r];return!!u&&!!o&&(i||n())-o>u}}#v=()=>{};#n=()=>{};#L=()=>{};#b=()=>!1;#R(){let t=new It(this.#t);this.#c=0,this.#S=t,this.#_=e=>{this.#c-=t[e],t[e]=0},this.#k=(e,i,n,r)=>{if(this.#h(i))return 0;if(!Dt(n))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(i,e),!Dt(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#I=(e,i,n)=>{if(t[e]=i,this.#e){let r=this.#e-t[e];for(;this.#c>r;)this.#M(!0)}this.#c+=t[e],n&&(n.entrySize=i,n.totalCalculatedSize=this.#c)}}#_=t=>{};#I=(t,e,i)=>{};#k=(t,e,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#B({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#D;!(!this.#U(e)||((t||!this.#b(e))&&(yield e),e===this.#d));)e=this.#E[e]}*#A({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#d;!(!this.#U(e)||((t||!this.#b(e))&&(yield e),e===this.#D));)e=this.#g[e]}#U(t){return t!==void 0&&this.#a.get(this.#l[t])===t}*entries(){for(let t of this.#B())this.#r[t]!==void 0&&this.#l[t]!==void 0&&!this.#h(this.#r[t])&&(yield[this.#l[t],this.#r[t]])}*rentries(){for(let t of this.#A())this.#r[t]!==void 0&&this.#l[t]!==void 0&&!this.#h(this.#r[t])&&(yield[this.#l[t],this.#r[t]])}*keys(){for(let t of this.#B()){let e=this.#l[t];e!==void 0&&!this.#h(this.#r[t])&&(yield e)}}*rkeys(){for(let t of this.#A()){let e=this.#l[t];e!==void 0&&!this.#h(this.#r[t])&&(yield e)}}*values(){for(let t of this.#B())this.#r[t]!==void 0&&!this.#h(this.#r[t])&&(yield this.#r[t])}*rvalues(){for(let t of this.#A())this.#r[t]!==void 0&&!this.#h(this.#r[t])&&(yield this.#r[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#B()){let n=this.#r[i],r=this.#h(n)?n.__staleWhileFetching:n;if(r!==void 0&&t(r,this.#l[i],this))return this.get(this.#l[i],e)}}forEach(t,e=this){for(let i of this.#B()){let n=this.#r[i],r=this.#h(n)?n.__staleWhileFetching:n;r!==void 0&&t.call(e,r,this.#l[i],this)}}rforEach(t,e=this){for(let i of this.#A()){let n=this.#r[i],r=this.#h(n)?n.__staleWhileFetching:n;r!==void 0&&t.call(e,r,this.#l[i],this)}}purgeStale(){let t=!1;for(let e of this.#A({allowStale:!0}))this.#b(e)&&(this.#O(this.#l[e],"expire"),t=!0);return t}info(t){let e=this.#a.get(t);if(e===void 0)return;let i=this.#r[e],n=this.#h(i)?i.__staleWhileFetching:i;if(n===void 0)return;let r={value:n};if(this.#w&&this.#x){let o=this.#w[e],u=this.#x[e];if(o&&u){let a=o-(_t.now()-u);r.ttl=a,r.start=Date.now()}}return this.#S&&(r.size=this.#S[e]),r}dump(){let t=[];for(let e of this.#B({allowStale:!0})){let i=this.#l[e],n=this.#r[e],r=this.#h(n)?n.__staleWhileFetching:n;if(r===void 0||i===void 0)continue;let o={value:r};if(this.#w&&this.#x){o.ttl=this.#w[e];let u=_t.now()-this.#x[e];o.start=Math.floor(Date.now()-u)}this.#S&&(o.size=this.#S[e]),t.unshift([i,o])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let n=Date.now()-i.start;i.start=_t.now()-n}this.set(e,i.value,i)}}set(t,e,i={}){var f,D,g,d,b;if(e===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:a}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,h=this.#k(t,e,i.size||0,u);if(this.maxEntrySize&&h>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#O(t,"set"),this;let c=this.#u===0?void 0:this.#a.get(t);if(c===void 0)c=this.#u===0?this.#D:this.#y.length!==0?this.#y.pop():this.#u===this.#t?this.#M(!1):this.#u,this.#l[c]=t,this.#r[c]=e,this.#a.set(t,c),this.#g[this.#D]=c,this.#E[c]=this.#D,this.#D=c,this.#u++,this.#I(c,h,a),a&&(a.set="add"),l=!1;else{this.#j(c);let m=this.#r[c];if(e!==m){if(this.#F&&this.#h(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:F}=m;F!==void 0&&!o&&(this.#C&&((f=this.#i)==null||f.call(this,F,t,"set")),this.#p&&((D=this.#m)==null||D.push([F,t,"set"])))}else o||(this.#C&&((g=this.#i)==null||g.call(this,m,t,"set")),this.#p&&((d=this.#m)==null||d.push([m,t,"set"])));if(this.#_(c),this.#I(c,h,a),this.#r[c]=e,a){a.set="replace";let F=m&&this.#h(m)?m.__staleWhileFetching:m;F!==void 0&&(a.oldValue=F)}}else a&&(a.set="update")}if(n!==0&&!this.#w&&this.#T(),this.#w&&(l||this.#L(c,n,r),a&&this.#n(a,c)),!o&&this.#p&&this.#m){let m=this.#m,F;for(;F=m==null?void 0:m.shift();)(b=this.#s)==null||b.call(this,...F)}return this}pop(){var t;try{for(;this.#u;){let e=this.#r[this.#d];if(this.#M(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,i;for(;i=e==null?void 0:e.shift();)(t=this.#s)==null||t.call(this,...i)}}}#M(t){var r,o;let e=this.#d,i=this.#l[e],n=this.#r[e];return this.#F&&this.#h(n)?n.__abortController.abort(new Error("evicted")):(this.#C||this.#p)&&(this.#C&&((r=this.#i)==null||r.call(this,n,i,"evict")),this.#p&&((o=this.#m)==null||o.push([n,i,"evict"]))),this.#_(e),t&&(this.#l[e]=void 0,this.#r[e]=void 0,this.#y.push(e)),this.#u===1?(this.#d=this.#D=0,this.#y.length=0):this.#d=this.#g[e],this.#a.delete(i),this.#u--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=e,r=this.#a.get(t);if(r!==void 0){let o=this.#r[r];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(r))n&&(n.has="stale",this.#n(n,r));else return i&&this.#v(r),n&&(n.has="hit",this.#n(n,r)),!0}else n&&(n.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,n=this.#a.get(t);if(n===void 0||!i&&this.#b(n))return;let r=this.#r[n];return this.#h(r)?r.__staleWhileFetching:r}#P(t,e,i,n){let r=e===void 0?void 0:this.#r[e];if(this.#h(r))return r;let o=new Be,{signal:u}=i;u==null||u.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let a={signal:o.signal,options:i,context:n},l=(d,b=!1)=>{let{aborted:m}=o.signal,F=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(m&&!b?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,F&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),m&&!F&&!b)return c(o.signal.reason);let E=D;return this.#r[e]===D&&(d===void 0?E.__staleWhileFetching?this.#r[e]=E.__staleWhileFetching:this.#O(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,d,a.options))),d},h=d=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=d),c(d)),c=d=>{let{aborted:b}=o.signal,m=b&&i.allowStaleOnFetchAbort,F=m||i.allowStaleOnFetchRejection,E=F||i.noDeleteOnFetchRejection,p=D;if(this.#r[e]===D&&(!E||p.__staleWhileFetching===void 0?this.#O(t,"fetch"):m||(this.#r[e]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw d},f=(d,b)=>{var F;let m=(F=this.#o)==null?void 0:F.call(this,t,r,a);m&&m instanceof Promise&&m.then(E=>d(E===void 0?void 0:E),b),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=E=>l(E,!0)))})};i.status&&(i.status.fetchDispatched=!0);let D=new Promise(f).then(l,h),g=Object.assign(D,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,g,{...a.options,status:void 0}),e=this.#a.get(t)):this.#r[e]=g,g}#h(t){if(!this.#F)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Be}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:D=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=!1,status:m,signal:F}=e;if(!this.#F)return m&&(m.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:m});let E={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:u,size:a,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:D,status:m,signal:F},p=this.#a.get(t);if(p===void 0){m&&(m.fetch="miss");let w=this.#P(t,p,E,d);return w.__returned=w}else{let w=this.#r[p];if(this.#h(w)){let A=i&&w.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",A&&(m.returnedStale=!0)),A?w.__staleWhileFetching:w.__returned=w}let R=this.#b(p);if(!b&&!R)return m&&(m.fetch="hit"),this.#j(p),n&&this.#v(p),m&&this.#n(m,p),w;let y=this.#P(t,p,E,d),N=y.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=R?"stale":"refresh",N&&R&&(m.returnedStale=!0)),N?y.__staleWhileFetching:y.__returned=y}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#f;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:r,...o}=e,u=this.get(t,o);if(!r&&u!==void 0)return u;let a=i(t,u,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=e,u=this.#a.get(t);if(u!==void 0){let a=this.#r[u],l=this.#h(a);return o&&this.#n(o,u),this.#b(u)?(o&&(o.get="stale"),l?(o&&i&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?a.__staleWhileFetching:void 0):(r||this.#O(t,"expire"),o&&i&&(o.returnedStale=!0),i?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#j(u),n&&this.#v(u),a))}else o&&(o.get="miss")}#N(t,e){this.#E[e]=t,this.#g[t]=e}#j(t){t!==this.#D&&(t===this.#d?this.#d=this.#g[t]:this.#N(this.#E[t],this.#g[t]),this.#N(this.#D,t),this.#D=t)}delete(t){return this.#O(t,"delete")}#O(t,e){var n,r,o,u;let i=!1;if(this.#u!==0){let a=this.#a.get(t);if(a!==void 0)if(i=!0,this.#u===1)this.#$(e);else{this.#_(a);let l=this.#r[a];if(this.#h(l)?l.__abortController.abort(new Error("deleted")):(this.#C||this.#p)&&(this.#C&&((n=this.#i)==null||n.call(this,l,t,e)),this.#p&&((r=this.#m)==null||r.push([l,t,e]))),this.#a.delete(t),this.#l[a]=void 0,this.#r[a]=void 0,a===this.#D)this.#D=this.#E[a];else if(a===this.#d)this.#d=this.#g[a];else{let h=this.#E[a];this.#g[h]=this.#g[a];let c=this.#g[a];this.#E[c]=this.#E[a]}this.#u--,this.#y.push(a)}}if(this.#p&&((o=this.#m)!=null&&o.length)){let a=this.#m,l;for(;l=a==null?void 0:a.shift();)(u=this.#s)==null||u.call(this,...l)}return i}clear(){return this.#$("delete")}#$(t){var e,i,n;for(let r of this.#A({allowStale:!0})){let o=this.#r[r];if(this.#h(o))o.__abortController.abort(new Error("deleted"));else{let u=this.#l[r];this.#C&&((e=this.#i)==null||e.call(this,o,u,t)),this.#p&&((i=this.#m)==null||i.push([o,u,t]))}}if(this.#a.clear(),this.#r.fill(void 0),this.#l.fill(void 0),this.#w&&this.#x&&(this.#w.fill(0),this.#x.fill(0)),this.#S&&this.#S.fill(0),this.#d=0,this.#D=0,this.#y.length=0,this.#c=0,this.#u=0,this.#p&&this.#m){let r=this.#m,o;for(;o=r==null?void 0:r.shift();)(n=this.#s)==null||n.call(this,...o)}}};var Mt=require("node:path"),Ln=require("node:url"),ut=require("fs"),ou=M(require("node:fs"),1),mt=require("node:fs/promises");var Ie=require("node:events"),ki=M(require("node:stream"),1),Bn=require("node:string_decoder"),yn=typeof process=="object"&&process?process:{stdout:null,stderr:null},Jo=s=>!!s&&typeof s=="object"&&(s instanceof pt||s instanceof ki.default||Xo(s)||Zo(s)),Xo=s=>!!s&&typeof s=="object"&&s instanceof Ie.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==ki.default.Writable.prototype.pipe,Zo=s=>!!s&&typeof s=="object"&&s instanceof Ie.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function",lt=Symbol("EOF"),ht=Symbol("maybeEmitEnd"),dt=Symbol("emittedEnd"),Ae=Symbol("emittingEnd"),Jt=Symbol("emittedError"),Te=Symbol("closed"),Sn=Symbol("read"),Re=Symbol("flush"),xn=Symbol("flushChunk"),it=Symbol("encoding"),kt=Symbol("decoder"),I=Symbol("flowing"),Xt=Symbol("paused"),Ut=Symbol("resume"),k=Symbol("buffer"),z=Symbol("pipes"),U=Symbol("bufferLength"),Ti=Symbol("bufferPush"),Oe=Symbol("bufferShift"),j=Symbol("objectMode"),O=Symbol("destroyed"),Ri=Symbol("error"),Oi=Symbol("emitData"),vn=Symbol("emitEnd"),Li=Symbol("emitEnd2"),rt=Symbol("async"),_i=Symbol("abort"),Le=Symbol("aborted"),Zt=Symbol("signal"),yt=Symbol("dataListeners"),V=Symbol("discarded"),te=s=>Promise.resolve().then(s),tu=s=>s(),eu=s=>s==="end"||s==="finish"||s==="prefinish",iu=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,su=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),_e=class{src;dest;opts;ondrain;constructor(t,e,i){this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[Ut](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ii=class extends _e{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,i){super(t,e,i),this.proxyErrors=n=>e.emit("error",n),t.on("error",this.proxyErrors)}},nu=s=>!!s.objectMode,ru=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",pt=class extends Ie.EventEmitter{[I]=!1;[Xt]=!1;[z]=[];[k]=[];[j];[it];[rt];[kt];[lt]=!1;[dt]=!1;[Ae]=!1;[Te]=!1;[Jt]=null;[U]=0;[O]=!1;[Zt];[Le]=!1;[yt]=0;[V]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");nu(e)?(this[j]=!0,this[it]=null):ru(e)?(this[it]=e.encoding,this[j]=!1):(this[j]=!1,this[it]=null),this[rt]=!!e.async,this[kt]=this[it]?new Bn.StringDecoder(this[it]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[z]});let{signal:i}=e;i&&(this[Zt]=i,i.aborted?this[_i]():i.addEventListener("abort",()=>this[_i]()))}get bufferLength(){return this[U]}get encoding(){return this[it]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[j]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[rt]}set async(t){this[rt]=this[rt]||!!t}[_i](){var t,e;this[Le]=!0,this.emit("abort",(t=this[Zt])==null?void 0:t.reason),this.destroy((e=this[Zt])==null?void 0:e.reason)}get aborted(){return this[Le]}set aborted(t){}write(t,e,i){var r;if(this[Le])return!1;if(this[lt])throw new Error("write after end");if(this[O])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(i=e,e="utf8"),e||(e="utf8");let n=this[rt]?te:tu;if(!this[j]&&!Buffer.isBuffer(t)){if(su(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(iu(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[j]?(this[I]&&this[U]!==0&&this[Re](!0),this[I]?this.emit("data",t):this[Ti](t),this[U]!==0&&this.emit("readable"),i&&n(i),this[I]):t.length?(typeof t=="string"&&!(e===this[it]&&!((r=this[kt])!=null&&r.lastNeed))&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[it]&&(t=this[kt].write(t)),this[I]&&this[U]!==0&&this[Re](!0),this[I]?this.emit("data",t):this[Ti](t),this[U]!==0&&this.emit("readable"),i&&n(i),this[I]):(this[U]!==0&&this.emit("readable"),i&&n(i),this[I])}read(t){if(this[O])return null;if(this[V]=!1,this[U]===0||t===0||t&&t>this[U])return this[ht](),null;this[j]&&(t=null),this[k].length>1&&!this[j]&&(this[k]=[this[it]?this[k].join(""):Buffer.concat(this[k],this[U])]);let e=this[Sn](t||null,this[k][0]);return this[ht](),e}[Sn](t,e){if(this[j])this[Oe]();else{let i=e;t===i.length||t===null?this[Oe]():typeof i=="string"?(this[k][0]=i.slice(t),e=i.slice(0,t),this[U]-=t):(this[k][0]=i.subarray(t),e=i.subarray(0,t),this[U]-=t)}return this.emit("data",e),!this[k].length&&!this[lt]&&this.emit("drain"),e}end(t,e,i){return typeof t=="function"&&(i=t,t=void 0),typeof e=="function"&&(i=e,e="utf8"),t!==void 0&&this.write(t,e),i&&this.once("end",i),this[lt]=!0,this.writable=!1,(this[I]||!this[Xt])&&this[ht](),this}[Ut](){this[O]||(!this[yt]&&!this[z].length&&(this[V]=!0),this[Xt]=!1,this[I]=!0,this.emit("resume"),this[k].length?this[Re]():this[lt]?this[ht]():this.emit("drain"))}resume(){return this[Ut]()}pause(){this[I]=!1,this[Xt]=!0,this[V]=!1}get destroyed(){return this[O]}get flowing(){return this[I]}get paused(){return this[Xt]}[Ti](t){this[j]?this[U]+=1:this[U]+=t.length,this[k].push(t)}[Oe](){return this[j]?this[U]-=1:this[U]-=this[k][0].length,this[k].shift()}[Re](t=!1){do;while(this[xn](this[Oe]())&&this[k].length);!t&&!this[k].length&&!this[lt]&&this.emit("drain")}[xn](t){return this.emit("data",t),this[I]}pipe(t,e){if(this[O])return t;this[V]=!1;let i=this[dt];return e=e||{},t===yn.stdout||t===yn.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,i?e.end&&t.end():(this[z].push(e.proxyErrors?new Ii(this,t,e):new _e(this,t,e)),this[rt]?te(()=>this[Ut]()):this[Ut]()),t}unpipe(t){let e=this[z].find(i=>i.dest===t);e&&(this[z].length===1?(this[I]&&this[yt]===0&&(this[I]=!1),this[z]=[]):this[z].splice(this[z].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let i=super.on(t,e);if(t==="data")this[V]=!1,this[yt]++,!this[z].length&&!this[I]&&this[Ut]();else if(t==="readable"&&this[U]!==0)super.emit("readable");else if(eu(t)&&this[dt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Jt]){let n=e;this[rt]?te(()=>n.call(this,this[Jt])):n.call(this,this[Jt])}return i}removeListener(t,e){return this.off(t,e)}off(t,e){let i=super.off(t,e);return t==="data"&&(this[yt]=this.listeners("data").length,this[yt]===0&&!this[V]&&!this[z].length&&(this[I]=!1)),i}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[yt]=0,!this[V]&&!this[z].length&&(this[I]=!1)),e}get emittedEnd(){return this[dt]}[ht](){!this[Ae]&&!this[dt]&&!this[O]&&this[k].length===0&&this[lt]&&(this[Ae]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Te]&&this.emit("close"),this[Ae]=!1)}emit(t,...e){let i=e[0];if(t!=="error"&&t!=="close"&&t!==O&&this[O])return!1;if(t==="data")return!this[j]&&!i?!1:this[rt]?(te(()=>this[Oi](i)),!0):this[Oi](i);if(t==="end")return this[vn]();if(t==="close"){if(this[Te]=!0,!this[dt]&&!this[O])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(t==="error"){this[Jt]=i,super.emit(Ri,i);let r=!this[Zt]||this.listeners("error").length?super.emit("error",i):!1;return this[ht](),r}else if(t==="resume"){let r=super.emit("resume");return this[ht](),r}else if(t==="finish"||t==="prefinish"){let r=super.emit(t);return this.removeAllListeners(t),r}let n=super.emit(t,...e);return this[ht](),n}[Oi](t){for(let i of this[z])i.dest.write(t)===!1&&this.pause();let e=this[V]?!1:super.emit("data",t);return this[ht](),e}[vn](){return this[dt]?!1:(this[dt]=!0,this.readable=!1,this[rt]?(te(()=>this[Li]()),!0):this[Li]())}[Li](){if(this[kt]){let e=this[kt].end();if(e){for(let i of this[z])i.dest.write(e);this[V]||super.emit("data",e)}}for(let e of this[z])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[j]||(t.dataLength=0);let e=this.promise();return this.on("data",i=>{t.push(i),this[j]||(t.dataLength+=i.length)}),await e,t}async concat(){if(this[j])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[it]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(O,()=>e(new Error("stream destroyed"))),this.on("error",i=>e(i)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[V]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[lt])return e();let r,o,u=c=>{this.off("data",a),this.off("end",l),this.off(O,h),e(),o(c)},a=c=>{this.off("error",u),this.off("end",l),this.off(O,h),this.pause(),r({value:c,done:!!this[lt]})},l=()=>{this.off("error",u),this.off("data",a),this.off(O,h),e(),r({done:!0,value:void 0})},h=()=>u(new Error("stream destroyed"));return new Promise((c,f)=>{o=f,r=c,this.once(O,h),this.once("error",u),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[V]=!1;let t=!1,e=()=>(this.pause(),this.off(Ri,e),this.off(O,e),this.off("end",e),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return e();let n=this.read();return n===null?e():{done:!1,value:n}};return this.once("end",e),this.once(Ri,e),this.once(O,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[O])return t?this.emit("error",t):this.emit(O),this;this[O]=!0,this[V]=!0,this[k].length=0,this[U]=0;let e=this;return typeof e.close=="function"&&!this[Te]&&e.close(),t?this.emit("error",t):this.emit(O),this}static get isStream(){return Jo}};var uu=ut.realpathSync.native,ie={lstatSync:ut.lstatSync,readdir:ut.readdir,readdirSync:ut.readdirSync,readlinkSync:ut.readlinkSync,realpathSync:uu,promises:{lstat:mt.lstat,readdir:mt.readdir,readlink:mt.readlink,realpath:mt.realpath}},_n=s=>!s||s===ie||s===ou?ie:{...ie,...s,promises:{...ie.promises,...s.promises||{}}},In=/^\\\\\?\\([a-z]:)\\?$/i,au=s=>s.replace(/\//g,"\\").replace(In,"$1\\"),lu=/[\\\/]/,J=0,kn=1,Un=2,ot=4,Mn=6,Pn=8,St=10,Nn=12,Q=15,ee=~Q,Ui=16,An=32,se=64,st=128,ke=256,Me=512,Tn=se|st|Me,hu=1023,Mi=s=>s.isFile()?Pn:s.isDirectory()?ot:s.isSymbolicLink()?St:s.isCharacterDevice()?Un:s.isBlockDevice()?Mn:s.isSocket()?Nn:s.isFIFO()?kn:J,Rn=new Map,ne=s=>{let t=Rn.get(s);if(t)return t;let e=s.normalize("NFKD");return Rn.set(s,e),e},On=new Map,Ue=s=>{let t=On.get(s);if(t)return t;let e=ne(s.toLowerCase());return On.set(s,e),e},Pe=class extends Qt{constructor(){super({max:256})}},Pi=class extends Qt{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},jn=Symbol("PathScurry setAsCwd"),$=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#i;get mode(){return this.#i}#s;get nlink(){return this.#s}#o;get uid(){return this.#o}#f;get gid(){return this.#f}#u;get rdev(){return this.#u}#c;get blksize(){return this.#c}#a;get ino(){return this.#a}#l;get size(){return this.#l}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#E;get mtimeMs(){return this.#E}#d;get ctimeMs(){return this.#d}#D;get birthtimeMs(){return this.#D}#y;get atime(){return this.#y}#m;get mtime(){return this.#m}#S;get ctime(){return this.#S}#x;get birthtime(){return this.#x}#w;#C;#F;#p;#T;#v;#n;#L;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=J,i,n,r,o,u){this.name=t,this.#w=r?Ue(t):ne(t),this.#n=e&hu,this.nocase=r,this.roots=n,this.root=i||this,this.#L=o,this.#F=u.fullpath,this.#T=u.relative,this.#v=u.relativePosix,this.parent=u.parent,this.parent?this.#t=this.parent.#t:this.#t=_n(u.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#L}resolve(t){if(!t)return this;let e=this.getRootString(t),n=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#_(n):this.#_(n)}#_(t){let e=this;for(let i of t)e=e.child(i);return e}children(){let t=this.#L.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#L.set(this,e),this.#n&=~Ui,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let i=this.children(),n=this.nocase?Ue(t):ne(t);for(let a of i)if(a.#w===n)return a;let r=this.parent?this.sep:"",o=this.#F?this.#F+r+t:void 0,u=this.newChild(t,J,{...e,parent:this,fullpath:o});return this.canReaddir()||(u.#n|=st),i.push(u),u}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let t=this.name,e=this.parent;if(!e)return this.#T=this.name;let i=e.relative();return i+(!i||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.fullpathPosix();let i=e.relativePosix();return i+(!i||!e.parent?"":"/")+t}fullpath(){if(this.#F!==void 0)return this.#F;let t=this.name,e=this.parent;if(!e)return this.#F=this.name;let n=e.fullpath()+(e.parent?this.sep:"")+t;return this.#F=n}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#p=`//?/${n}`:this.#p=n}let t=this.parent,e=t.fullpathPosix(),i=e+(!e||!t.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#n&Q)===J}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Q)===Pn}isDirectory(){return(this.#n&Q)===ot}isCharacterDevice(){return(this.#n&Q)===Un}isBlockDevice(){return(this.#n&Q)===Mn}isFIFO(){return(this.#n&Q)===kn}isSocket(){return(this.#n&Q)===Nn}isSymbolicLink(){return(this.#n&St)===St}lstatCached(){return this.#n&An?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let t=this.#n&Q;return!(t!==J&&t!==St||this.#n&ke||this.#n&st)}calledReaddir(){return!!(this.#n&Ui)}isENOENT(){return!!(this.#n&st)}isNamed(t){return this.nocase?this.#w===Ue(t):this.#w===ne(t)}async readlink(){var e;let t=this.#b;if(t)return t;if(this.canReadlink()&&this.parent)try{let i=await this.#t.promises.readlink(this.fullpath()),n=(e=await this.parent.realpath())==null?void 0:e.resolve(i);if(n)return this.#b=n}catch(i){this.#h(i.code);return}}readlinkSync(){var e;let t=this.#b;if(t)return t;if(this.canReadlink()&&this.parent)try{let i=this.#t.readlinkSync(this.fullpath()),n=(e=this.parent.realpathSync())==null?void 0:e.resolve(i);if(n)return this.#b=n}catch(i){this.#h(i.code);return}}#I(t){this.#n|=Ui;for(let e=t.provisional;e<t.length;e++){let i=t[e];i&&i.#k()}}#k(){this.#n&st||(this.#n=(this.#n|st)&ee,this.#B())}#B(){let t=this.children();t.provisional=0;for(let e of t)e.#k()}#A(){this.#n|=Me,this.#U()}#U(){if(this.#n&se)return;let t=this.#n;(t&Q)===ot&&(t&=ee),this.#n=t|se,this.#B()}#M(t=""){t==="ENOTDIR"||t==="EPERM"?this.#U():t==="ENOENT"?this.#k():this.children().provisional=0}#P(t=""){t==="ENOTDIR"?this.parent.#U():t==="ENOENT"&&this.#k()}#h(t=""){let e=this.#n;e|=ke,t==="ENOENT"&&(e|=st),(t==="EINVAL"||t==="UNKNOWN")&&(e&=ee),this.#n=e,t==="ENOTDIR"&&this.parent&&this.parent.#U()}#N(t,e){return this.#O(t,e)||this.#j(t,e)}#j(t,e){let i=Mi(t),n=this.newChild(t.name,i,{parent:this}),r=n.#n&Q;return r!==ot&&r!==St&&r!==J&&(n.#n|=se),e.unshift(n),e.provisional++,n}#O(t,e){for(let i=e.provisional;i<e.length;i++){let n=e[i];if((this.nocase?Ue(t.name):ne(t.name))===n.#w)return this.#$(t,n,i,e)}}#$(t,e,i,n){let r=e.name;return e.#n=e.#n&ee|Mi(t),r!==t.name&&(e.name=t.name),i!==n.provisional&&(i===n.length-1?n.pop():n.splice(i,1),n.unshift(e)),n.provisional++,e}async lstat(){if((this.#n&st)===0)try{return this.#H(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#P(t.code)}}lstatSync(){if((this.#n&st)===0)try{return this.#H(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#P(t.code)}}#H(t){let{atime:e,atimeMs:i,birthtime:n,birthtimeMs:r,blksize:o,blocks:u,ctime:a,ctimeMs:l,dev:h,gid:c,ino:f,mode:D,mtime:g,mtimeMs:d,nlink:b,rdev:m,size:F,uid:E}=t;this.#y=e,this.#g=i,this.#x=n,this.#D=r,this.#c=o,this.#r=u,this.#S=a,this.#d=l,this.#e=h,this.#f=c,this.#a=f,this.#i=D,this.#m=g,this.#E=d,this.#s=b,this.#u=m,this.#l=F,this.#o=E;let p=Mi(t);this.#n=this.#n&ee|p|An,p!==J&&p!==ot&&p!==St&&(this.#n|=se)}#G=[];#z=!1;#q(t){this.#z=!1;let e=this.#G.slice();this.#G.length=0,e.forEach(i=>i(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let i=this.children();if(this.calledReaddir()){let r=i.slice(0,i.provisional);e?t(null,r):queueMicrotask(()=>t(null,r));return}if(this.#G.push(t),this.#z)return;this.#z=!0;let n=this.fullpath();this.#t.readdir(n,{withFileTypes:!0},(r,o)=>{if(r)this.#M(r.code),i.provisional=0;else{for(let u of o)this.#N(u,i);this.#I(i)}this.#q(i.slice(0,i.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#W)await this.#W;else{let i=()=>{};this.#W=new Promise(n=>i=n);try{for(let n of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#N(n,t);this.#I(t)}catch(n){this.#M(n.code),t.provisional=0}this.#W=void 0,i()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let i of this.#t.readdirSync(e,{withFileTypes:!0}))this.#N(i,t);this.#I(t)}catch(i){this.#M(i.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#n&Tn)return!1;let t=Q&this.#n;return t===J||t===ot||t===St}shouldWalk(t,e){return(this.#n&ot)===ot&&!(this.#n&Tn)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#R)return this.#R;if(!((Me|ke|st)&this.#n))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#R=this.resolve(t)}catch{this.#A()}}realpathSync(){if(this.#R)return this.#R;if(!((Me|ke|st)&this.#n))try{let t=this.#t.realpathSync(this.fullpath());return this.#R=this.resolve(t)}catch{this.#A()}}[jn](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),i=[],n=this;for(;n&&n.parent;)e.add(n),n.#T=i.join(this.sep),n.#v=i.join("/"),n=n.parent,i.push("..");for(n=t;n&&n.parent&&!e.has(n);)n.#T=void 0,n.#v=void 0,n=n.parent}},Ne=class s extends ${sep="\\";splitSep=lu;constructor(t,e=J,i,n,r,o,u){super(t,e,i,n,r,o,u)}newChild(t,e=J,i={}){return new s(t,e,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(t){return Mt.win32.parse(t).root}getRoot(t){if(t=au(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,i]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=i;return this.roots[t]=new Pt(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(In,"$1\\"),t===e}},je=class s extends ${splitSep="/";sep="/";constructor(t,e=J,i,n,r,o,u){super(t,e,i,n,r,o,u)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=J,i={}){return new s(t,e,this.root,this.roots,this.nocase,this.childrenCache(),i)}},$e=class{root;rootPath;roots;cwd;#t;#e;#i;nocase;#s;constructor(t=process.cwd(),e,i,{nocase:n,childrenCacheSize:r=16*1024,fs:o=ie}={}){this.#s=_n(o),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Ln.fileURLToPath)(t));let u=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(u),this.#t=new Pe,this.#e=new Pe,this.#i=new Pi(r);let a=u.substring(this.rootPath.length).split(i);if(a.length===1&&!a[0]&&a.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let l=this.root,h=a.length-1,c=e.sep,f=this.rootPath,D=!1;for(let g of a){let d=h--;l=l.child(g,{relative:new Array(d).fill("..").join(c),relativePosix:new Array(d).fill("..").join("/"),fullpath:f+=(D?"":c)+g}),D=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#i}resolve(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let i=this.#t.get(e);if(i!==void 0)return i;let n=this.cwd.resolve(e).fullpath();return this.#t.set(e,n),n}resolvePosix(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let i=this.#e.get(e);if(i!==void 0)return i;let n=this.cwd.resolve(e).fullpathPosix();return this.#e.set(e,n),n}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd);let{withFileTypes:i}=e;if(t.canReaddir()){let n=await t.readdir();return i?n:n.map(r=>r.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd);let{withFileTypes:i=!0}=e;return t.canReaddir()?i?t.readdirSync():t.readdirSync().map(n=>n.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t.withFileTypes,t=this.cwd);let i=await t.readlink();return e?i:i==null?void 0:i.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t.withFileTypes,t=this.cwd);let i=t.readlinkSync();return e?i:i==null?void 0:i.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t.withFileTypes,t=this.cwd);let i=await t.realpath();return e?i:i==null?void 0:i.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t.withFileTypes,t=this.cwd);let i=t.realpathSync();return e?i:i==null?void 0:i.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:r,walkFilter:o}=e,u=[];(!r||r(t))&&u.push(i?t:t.fullpath());let a=new Set,l=(c,f)=>{a.add(c),c.readdirCB((D,g)=>{if(D)return f(D);let d=g.length;if(!d)return f();let b=()=>{--d===0&&f()};for(let m of g)(!r||r(m))&&u.push(i?m:m.fullpath()),n&&m.isSymbolicLink()?m.realpath().then(F=>F!=null&&F.isUnknown()?F.lstat():F).then(F=>F!=null&&F.shouldWalk(a,o)?l(F,b):b()):m.shouldWalk(a,o)?l(m,b):b()},!0)},h=t;return new Promise((c,f)=>{l(h,D=>{if(D)return f(D);c(u)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:r,walkFilter:o}=e,u=[];(!r||r(t))&&u.push(i?t:t.fullpath());let a=new Set([t]);for(let l of a){let h=l.readdirSync();for(let c of h){(!r||r(c))&&u.push(i?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(n&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}return u}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:r,walkFilter:o}=e;(!r||r(t))&&(yield i?t:t.fullpath());let u=new Set([t]);for(let a of u){let l=a.readdirSync();for(let h of l){(!r||r(h))&&(yield i?h:h.fullpath());let c=h;if(h.isSymbolicLink()){if(!(n&&(c=h.realpathSync())))continue;c.isUnknown()&&c.lstatSync()}c.shouldWalk(u,o)&&u.add(c)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:r,walkFilter:o}=e,u=new pt({objectMode:!0});(!r||r(t))&&u.write(i?t:t.fullpath());let a=new Set,l=[t],h=0,c=()=>{let f=!1;for(;!f;){let D=l.shift();if(!D){h===0&&u.end();return}h++,a.add(D);let g=(b,m,F=!1)=>{if(b)return u.emit("error",b);if(n&&!F){let E=[];for(let p of m)p.isSymbolicLink()&&E.push(p.realpath().then(w=>w!=null&&w.isUnknown()?w.lstat():w));if(E.length){Promise.all(E).then(()=>g(null,m,!0));return}}for(let E of m)E&&(!r||r(E))&&(u.write(i?E:E.fullpath())||(f=!0));h--;for(let E of m){let p=E.realpathCached()||E;p.shouldWalk(a,o)&&l.push(p)}f&&!u.flowing?u.once("drain",c):d||c()},d=!0;D.readdirCB(g,!0),d=!1}};return c(),u}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof $||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:r,walkFilter:o}=e,u=new pt({objectMode:!0}),a=new Set;(!r||r(t))&&u.write(i?t:t.fullpath());let l=[t],h=0,c=()=>{let f=!1;for(;!f;){let D=l.shift();if(!D){h===0&&u.end();return}h++,a.add(D);let g=D.readdirSync();for(let d of g)(!r||r(d))&&(u.write(i?d:d.fullpath())||(f=!0));h--;for(let d of g){let b=d;if(d.isSymbolicLink()){if(!(n&&(b=d.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(a,o)&&l.push(b)}}f&&!u.flowing&&u.once("drain",c)};return c(),u}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[jn](e)}},Pt=class extends $e{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:i=!0}=e;super(t,Mt.win32,"\\",{...e,nocase:i}),this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(t){return Mt.win32.parse(t).root.toUpperCase()}newRoot(t){return new Ne(this.rootPath,ot,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},Nt=class extends $e{sep="/";constructor(t=process.cwd(),e={}){let{nocase:i=!1}=e;super(t,Mt.posix,"/",{...e,nocase:i}),this.nocase=i}parseRootPath(t){return"/"}newRoot(t){return new je(this.rootPath,ot,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},re=class extends Nt{constructor(t=process.cwd(),e={}){let{nocase:i=!0}=e;super(t,{...e,nocase:i})}},zl=process.platform==="win32"?Ne:je,$n=process.platform==="win32"?Pt:process.platform==="darwin"?re:Nt;var cu=s=>s.length>=1,fu=s=>s.length>=1,jt=class s{#t;#e;#i;length;#s;#o;#f;#u;#c;#a;#l=!0;constructor(t,e,i,n){if(!cu(t))throw new TypeError("empty pattern list");if(!fu(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#e=e,this.#i=i,this.#s=n,this.#i===0){if(this.isUNC()){let[r,o,u,a,...l]=this.#t,[h,c,f,D,...g]=this.#e;l[0]===""&&(l.shift(),g.shift());let d=[r,o,u,a,""].join("/"),b=[h,c,f,D,""].join("/");this.#t=[d,...l],this.#e=[b,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#t,[u,...a]=this.#e;o[0]===""&&(o.shift(),a.shift());let l=r+"/",h=u+"/";this.#t=[l,...o],this.#e=[h,...a],this.length=this.#t.length}}}pattern(){return this.#t[this.#i]}isString(){return typeof this.#t[this.#i]=="string"}isGlobstar(){return this.#t[this.#i]===P}isRegExp(){return this.#t[this.#i]instanceof RegExp}globString(){return this.#f=this.#f||(this.#i===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new s(this.#t,this.#e,this.#i+1,this.#s),this.#o.#a=this.#a,this.#o.#c=this.#c,this.#o.#u=this.#u,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#c!==void 0?this.#c:this.#c=this.#s==="win32"&&this.#i===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#s==="win32"&&this.#i===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#a!==void 0?this.#a:this.#a=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#i===0?t:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var Du=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$t=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:i,noext:n,noglobstar:r,platform:o=Du}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:e,nocase:i,noext:n,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let u of t)this.add(u)}add(t){let e=new q(t,this.mmopts);for(let i=0;i<e.set.length;i++){let n=e.set[i],r=e.globParts[i];if(!n||!r)throw new Error("invalid pattern object");for(;n[0]==="."&&r[0]===".";)n.shift(),r.shift();let o=new jt(n,r,0,this.platform),u=new q(o.globString(),this.mmopts),a=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(u):this.relative.push(u),a&&(l?this.absoluteChildren.push(u):this.relativeChildren.push(u))}}ignored(t){let e=t.fullpath(),i=`${e}/`,n=t.relative()||".",r=`${n}/`;for(let o of this.relative)if(o.match(n)||o.match(r))return!0;for(let o of this.absolute)if(o.match(e)||o.match(i))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",i=(t.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(i))return!0;for(let n of this.absoluteChildren)if(n.match(e))return!0;return!1}};var Ni=class s{store;constructor(t=new Map){this.store=t}copy(){return new s(new Map(this.store))}hasWalked(t,e){var i;return(i=this.store.get(t.fullpath()))==null?void 0:i.has(e.globString())}storeWalked(t,e){let i=t.fullpath(),n=this.store.get(i);n?n.add(e.globString()):this.store.set(i,new Set([e.globString()]))}},ji=class{store=new Map;add(t,e,i){let n=(e?2:0)|(i?1:0),r=this.store.get(t);this.store.set(t,r===void 0?n:n&r)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},$i=class{store=new Map;add(t,e){if(!t.canReaddir())return;let i=this.store.get(t);i?i.find(n=>n.globString()===e.globString())||i.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},oe=class s{hasWalkedCache;matches=new ji;subwalks=new $i;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new Ni}processPatterns(t,e){this.patterns=e;let i=e.map(n=>[t,n]);for(let[n,r]of i){this.hasWalkedCache.storeWalked(n,r);let o=r.root(),u=r.isAbsolute()&&this.opts.absolute!==!1;if(o){n=n.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let c=r.rest();if(c)r=c;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let a,l,h=!1;for(;typeof(a=r.pattern())=="string"&&(l=r.rest());)n=n.resolve(a),r=l,h=!0;if(a=r.pattern(),l=r.rest(),h){if(this.hasWalkedCache.hasWalked(n,r))continue;this.hasWalkedCache.storeWalked(n,r)}if(typeof a=="string"){let c=a===".."||a===""||a===".";this.matches.add(n.resolve(a),u,c);continue}else if(a===P){(!n.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(n,r);let c=l==null?void 0:l.pattern(),f=l==null?void 0:l.rest();if(!l||(c===""||c===".")&&!f)this.matches.add(n,u,c===""||c===".");else if(c===".."){let D=n.parent||n;f?this.hasWalkedCache.hasWalked(D,f)||this.subwalks.add(D,f):this.matches.add(D,u,!0)}}else a instanceof RegExp&&this.subwalks.add(n,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new s(this.opts,this.hasWalkedCache)}filterEntries(t,e){let i=this.subwalks.get(t),n=this.child();for(let r of e)for(let o of i){let u=o.isAbsolute(),a=o.pattern(),l=o.rest();a===P?n.testGlobstar(r,o,l,u):a instanceof RegExp?n.testRegExp(r,a,l,u):n.testString(r,a,l,u)}return n}testGlobstar(t,e,i,n){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,n,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(i&&e.checkFollowGlobstar()?this.subwalks.add(t,i):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),i){let r=i.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(t,r,i.rest(),n);else if(r===".."){let o=t.parent||t;this.subwalks.add(o,i)}else r instanceof RegExp&&this.testRegExp(t,r,i.rest(),n)}}testRegExp(t,e,i,n){e.test(t.name)&&(i?this.subwalks.add(t,i):this.matches.add(t,n,!1))}testString(t,e,i,n){t.isNamed(e)&&(i?this.subwalks.add(t,i):this.matches.add(t,n,!1))}};var du=(s,t)=>typeof s=="string"?new $t([s],t):Array.isArray(s)?new $t(s,t):s,We=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#i;signal;maxDepth;includeChildMatches;constructor(t,e,i){if(this.patterns=t,this.path=e,this.opts=i,this.#i=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#e=du(i.ignore??[],i),!this.includeChildMatches&&typeof this.#e.add!="function")){let n="cannot ignore child matches, ignore lacks add() method.";throw new Error(n)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#s(t){var e,i;return this.seen.has(t)||!!((i=(e=this.#e)==null?void 0:e.ignored)!=null&&i.call(e,t))}#o(t){var e,i;return!!((i=(e=this.#e)==null?void 0:e.childrenIgnored)!=null&&i.call(e,t))}pause(){this.paused=!0}resume(){var e;if((e=this.signal)!=null&&e.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){var e;(e=this.signal)!=null&&e.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||await t.realpath(),!i)return;t=i}let r=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(r!=null&&r.isSymbolicLink())){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,e)}matchCheckTest(t,e){var i;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((i=t.realpathCached())!=null&&i.isDirectory()))&&!this.#s(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||t.realpathSync(),!i)return;t=i}let r=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(r!=null&&r.isSymbolicLink())){let o=r.realpathSync();o&&(o!=null&&o.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,e)}matchFinish(t,e){var r;if(this.#s(t))return;if(!this.includeChildMatches&&((r=this.#e)!=null&&r.add)){let o=`${t.relativePosix()}/**`;this.#e.add(o)}let i=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let n=this.opts.mark&&t.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(i){let o=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(o+n)}else{let o=this.opts.posix?t.relativePosix():t.relative(),u=this.opts.dotRelative&&!o.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(o?u+o+n:"."+n)}}async match(t,e,i){let n=await this.matchCheck(t,i);n&&this.matchFinish(n,e)}matchSync(t,e,i){let n=this.matchCheckSync(t,i);n&&this.matchFinish(n,e)}walkCB(t,e,i){var n;(n=this.signal)!=null&&n.aborted&&i(),this.walkCB2(t,e,new oe(this.opts),i)}walkCB2(t,e,i,n){var u;if(this.#o(t))return n();if((u=this.signal)!=null&&u.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(t,e,i,n));return}i.processPatterns(t,e);let r=1,o=()=>{--r===0&&n()};for(let[a,l,h]of i.matches.entries())this.#s(a)||(r++,this.match(a,l,h).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let l=a.readdirCached();a.calledReaddir()?this.walkCB3(a,l,i,o):a.readdirCB((h,c)=>this.walkCB3(a,c,i,o),!0)}o()}walkCB3(t,e,i,n){i=i.filterEntries(t,e);let r=1,o=()=>{--r===0&&n()};for(let[u,a,l]of i.matches.entries())this.#s(u)||(r++,this.match(u,a,l).then(()=>o()));for(let[u,a]of i.subwalks.entries())r++,this.walkCB2(u,a,i.child(),o);o()}walkCBSync(t,e,i){var n;(n=this.signal)!=null&&n.aborted&&i(),this.walkCB2Sync(t,e,new oe(this.opts),i)}walkCB2Sync(t,e,i,n){var u;if(this.#o(t))return n();if((u=this.signal)!=null&&u.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,i,n));return}i.processPatterns(t,e);let r=1,o=()=>{--r===0&&n()};for(let[a,l,h]of i.matches.entries())this.#s(a)||this.matchSync(a,l,h);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let l=a.readdirSync();this.walkCB3Sync(a,l,i,o)}o()}walkCB3Sync(t,e,i,n){i=i.filterEntries(t,e);let r=1,o=()=>{--r===0&&n()};for(let[u,a,l]of i.matches.entries())this.#s(u)||this.matchSync(u,a,l);for(let[u,a]of i.subwalks.entries())r++,this.walkCB2Sync(u,a,i.child(),o);o()}},ue=class extends We{matches=new Set;constructor(t,e,i){super(t,e,i)}matchEmit(t){this.matches.add(t)}async walk(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,i)=>{this.walkCB(this.path,this.patterns,()=>{var n;(n=this.signal)!=null&&n.aborted?i(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason}),this.matches}},ae=class extends We{results;constructor(t,e,i){super(t,e,i),this.results=new pt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var pu=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nt=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,Wn.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=e.platform||pu,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=e.platform==="win32"?Pt:e.platform==="darwin"?re:e.platform?Nt:$n;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(a=>new q(a,n)),[o,u]=r.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=o.map((a,l)=>{let h=u[l];if(!h)throw new Error("invalid pattern object");return new jt(a,h,0,this.platform)})}async walk(){return[...await new ue(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ue(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ae(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ae(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Wi=(s,t={})=>{Array.isArray(s)||(s=[s]);for(let e of s)if(new q(e,t).hasMagic())return!0;return!1};function Ge(s,t={}){return new nt(s,t).streamSync()}function Hn(s,t={}){return new nt(s,t).stream()}function ze(s,t={}){return new nt(s,t).walkSync()}async function Gn(s,t={}){return new nt(s,t).walk()}function He(s,t={}){return new nt(s,t).iterateSync()}function qn(s,t={}){return new nt(s,t).iterate()}var mu=Ge,gu=Object.assign(Hn,{sync:Ge}),Eu=He,bu=Object.assign(qn,{sync:He}),wu=Object.assign(ze,{stream:Ge,iterate:He}),zn=Object.assign(Gn,{glob:Gn,globSync:ze,sync:wu,globStream:Hn,stream:gu,globStreamSync:Ge,streamSync:mu,globIterate:qn,iterate:bu,globIterateSync:He,iterateSync:Eu,Glob:nt,hasMagic:Wi,escape:Lt,unescape:et});zn.glob=zn;var ct=class{static get useFileContent(){var t,e;return((e=(t=H.config.config)==null?void 0:t.idempotency)==null?void 0:e.useFileContent)??!1}static get location(){var t,e;return((e=(t=H.config.config)==null?void 0:t.idempotency)==null?void 0:e.location)??"./node_modules/.cache/bsm/idempotency"}static updateHashForFile(t,e){try{if(this.useFileContent){let i=gt.default.readFileSync(e);t.update(i)}else{let i=gt.default.lstatSync(e);t.update(i.ctimeMs.toString()),t.update(i.mtimeMs.toString())}}catch{}}static updateHashForDir(t,e){try{gt.default.readdirSync(e,{withFileTypes:!0,recursive:!0}).forEach(i=>{if(i.name==null)return;let n=Gi.default.join(i.path??e,i.name).replace(/\\/g,"/");t.update(n),i.isFile()&&this.updateHashForFile(t,n)})}catch{}}static updateHashForGlob(t,e){try{let i=ze(e,{withFileTypes:!0});for(let n of i){let r=Gi.default.relative(process.cwd(),n.fullpath());n.isFile()?this.updateHashForFile(t,r):this.updateHashForDir(t,r)}}catch{}}static calculateIdempotencyHash(t,e){var r;let i=[];if(Array.isArray(t))i.push(...t);else if(typeof t=="string")i.push(t);else for(let o of Object.values(t))Array.isArray(o)?i.push(...o):i.push(o);let n=(0,Vn.createHash)("sha256");for(let o of i){let u=o.split(":")[0],a=o.substring(u.length+1);switch(u){case"static":n.update(a);break;case"env":n.update(a),n.update(((r=e==null?void 0:e.env)==null?void 0:r[a])??process.env[a]??Buffer.of());break;case"file":this.updateHashForFile(n,a);break;case"dir":this.updateHashForDir(n,a);break;case"glob":this.updateHashForGlob(n,a);break;default:v.log(`\x1B[33m[Idempotency]\x1B[0m Unknown type: ${u}, using value as static`),n.update(o)}}return n.digest("hex")}static getFileName(t){let e=t.join(".");return`${this.location}/${e}.hash`.replaceAll("*","__all__")}static saveIdempotencyHash(t,e){gt.default.mkdirSync(this.location,{recursive:!0}),gt.default.writeFileSync(this.getFileName(e),t)}static getSavedIdempotencyHash(t){let e=this.getFileName(t);if(gt.default.existsSync(e))return gt.default.readFileSync(e,"utf-8")}static checkIdempotency(t,e,i){let n=t.$idempotency,r=this.calculateIdempotencyHash(n,i);return this.getSavedIdempotencyHash(e)===r}static saveIdempotency(t,e){let i=t.$idempotency,n=this.calculateIdempotencyHash(i);this.saveIdempotencyHash(n,e)}static hasIdempotencyEnabled(t){return process.env.BSM_DISABLE_IDEMPOTENCY==="true"||!Object.hasOwn(t,"$idempotency")?!1:Object.hasOwn(t,"$idempotencyEnabled")?!!t.$idempotencyEnabled:!0}};var Et=class extends Error{constructor(e,i){super();this.code=e;this.script=i}},Wt=class extends Et{constructor(e,i){super(1,i);this.func=e;this.script=i}};var bt=class s{static async run(t){let e=H.config;await s.runScript(e.scripts,t.split("."),[],{})}static async runScript(t,e,i,n){typeof t=="function"?await s.executeFunction(t,e,i,n):typeof t=="string"?await s.executeString(t,e,i,n):typeof t=="object"?Array.isArray(t)?await s.executeArray(t,e,i,n):await s.executeObject(t,e,i,n):await s.notFound(i,n)}static async notFound(t,e,i){var n;if(!e.ignoreNotFound){if(i){let r=t[t.length-1],o=t.slice(0,-1);if(o.length===0?v.error(`\x1B[31mScript '${r}' does not exist\x1B[0m`):v.error(`\x1B[31mScript '${o.join(".")}' does not have a '${r}' script\x1B[0m`),((n=H.config.config)==null?void 0:n.defaultHelpBehavior)==="interactive"){let u=await xt.selectScript(H.config,{_:[t.join(".")]});await this.run(u[0]),process.exit(0)}else v.log(),Object.hasOwn(i,"$description")&&(Z.printCommand(i,o),v.log()),v.log("\x1B[1mTry one of the following:\x1B[0m"),Z.printCommands(i,o,!1)}else v.error(`\x1B[31mScript '${t.join(".")}' not found\x1B[0m`);process.exit(127)}}static async executeFunction(t,e,i,n){var u;v.log(`> \x1B[93mExecuting JavaScript function\x1B[0m \x1B[90m(${[...i].join(".")})\x1B[0m`);let r,o=process.env;try{process.env={...process.env,...n.env},r=await t.call(null,process.argv)}catch(a){throw a instanceof Error&&(a.stack=(u=a.stack)==null?void 0:u.split(" at executeFunction")[0]),new Wt(a,i.join("."))}finally{process.env=o}if(r==null){e.length>0&&await s.notFound([...i,...e],n);return}await s.runScript(r,e,i,{...n,excludeArgs:!0})}static async executeString(t,e,i,n){if(e.length>0){await s.notFound([...i,...e],n);return}!n.excludeArgs&&process.argv.length&&(t+=" "+process.argv.join(" ")),v.log(`> ${t} \x1B[90m(${i.join(".")})\x1B[0m`),process.env.BSM_LOG_FILE&&qe.default.appendFileSync(process.env.BSM_LOG_FILE,`${new Date().toISOString()} ${t} ${i.join(".")} ${process.cwd()}
22
+ `),t!==""&&(t=t.replace(/bsm ~/g,"bsm \\~"),await new Promise((r,o)=>{Kn.default.spawn(t,[],{stdio:"inherit",shell:!0,env:{...process.env,...n.env,BSM_PATH:i.slice(0,-1).join("."),BSM_SCRIPT:i.join(".")}}).on("close",a=>{a===0?r():o(new Et(a,i.join(".")))})}))}static async executeArray(t,e,i,n){if(e.length===0||e[0]==="*")for(let r=0;r<t.length;r++)await s.runScript(t[r],e.slice(1),[...i,r.toString()],{...n,ignoreNotFound:e[0]==="*"?!0:n.ignoreNotFound});else{let r=e[0],o=s.subscript(t,r);if(o)await s.runScript(o[1],e.slice(1),[...i,o[0]],n);else{await s.notFound([...i,r],n,t);return}}}static shouldRun(t,e,i,n){return ct.hasIdempotencyEnabled(t)&&ct.checkIdempotency(t,[...i,...e],n)?(v.log(`\x1B[90mNot running ${[...i,...e].join(".")} because the idempotency hash is the same\x1B[0m`),!1):!0}static async executeObject(t,e,i,n){try{if(Object.hasOwn(t,"$env")&&(n.env={...n.env,...s.getEnv(t.$env)}),!s.shouldRun(t,e,i,n))return;if(await s.executeHook(t,"_pre",i,n),e.length===0)await s.runObject(t,i,n);else if(e[0]==="*")for(let r in t)r.startsWith("_")||r.startsWith("$")||Object.hasOwn(t,r)&&await s.runScript(t[r],e.slice(1),[...i,r],{...n,ignoreNotFound:!0});else{let r=e[0],o=s.subscript(t,r);if(o)await s.runScript(o[1],e.slice(1),[...i,o[0]],n);else{await s.notFound([...i,r],n,t);return}}await s.executeHook(t,"_post",i,n),ct.hasIdempotencyEnabled(t)&&ct.saveIdempotency(t,[...i,...e])}catch(r){if(r instanceof Et?process.env.BSM_ERROR=r.code.toString():process.env.BSM_ERROR="1",await s.executeHook(t,"_onError",i,n),!await s.executeHook(t,"_catch",i,n))throw r;ct.hasIdempotencyEnabled(t)&&ct.saveIdempotency(t,[...i,...e])}finally{await s.executeHook(t,"_finally",i,n)}}static subscript(t,e,i=!0){if(typeof t=="object"&&(Object.hasOwn(t,e)||(e=function(){var r;if((r=H.config.config)!=null&&r.caseInsensitive){let o=Object.keys(t).find(u=>u.toLowerCase()===e.toLowerCase());if(o)return o}if(i){let o=s.resolveAlias(t,e);if(o)return o}}()??e),!!Object.hasOwn(t,e)))if(Array.isArray(t)){let n=parseInt(e);return[e,t[n]]}else return[e,t[e]]}static resolveAlias(t,e){var i;for(let[n,r]of Object.entries(t)){if(typeof r!="object"||Array.isArray(r)||!Object.hasOwn(r,"$alias"))continue;let o=s.getAliases(r.$alias);if(o.includes(e)||(i=H.config.config)!=null&&i.caseInsensitive&&o.map(u=>u.toLowerCase()).includes(e.toLowerCase()))return n}}static getAliases(t){return typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(s.getAliases):(v.error(`\x1B[31mAlias with type ${typeof t} is not supported\x1B[0m`),[])}static getEnv(t){if(typeof t=="string"){if(t==="")return{};if(t.startsWith("file:")){let e=Qn.default.join(process.cwd(),t.slice(5));if(!qe.default.existsSync(e))return v.error(`\x1B[31mFile '${e}' does not exist\x1B[0m
21
23
  \x1B[1mRunning script without these environment variables\x1B[0m
22
- `),{};let u=ye.default.readFileSync(n,"utf-8").replaceAll("\r","").split(`
23
- `).filter(o=>!o.startsWith("#")&&o.trim()!==""),i={};for(let o of u){let D=/^([^=]+)=(['"])?(.+)\2$/g.exec(o);if(D){let l=D[3];D[2]==='"'&&(l=l.replaceAll(/(?<=(?<!\\)(\\\\)*)\\n/g,`
24
- `).replaceAll(/(?<=(?<!\\)(\\\\)*)\\t/g," ").replaceAll(/(?<=(?<!\\)(\\\\)*)\\r/g,"\r").replaceAll(/(?<=(?<!\\)(\\\\)*)\\\\/g,"\\")),i[D[1]]=l}}return i}else return console.error(`\x1B[31mCurrently only 'file:' is supported for environment variables\x1B[0m
25
- `),{}}else if(typeof e=="object")if(Array.isArray(e)){let n={};for(let r of e)n={...n,...t.getEnv(r)};return n}else return e;else{let n=e.call(null,process.argv);return n===void 0?{}:t.getEnv(n)}}static async executeHook(e,n,r,u){return Object.hasOwn(e,n)?(await t.runScript(e[n],[],[...r,n],{...u,excludeArgs:!0}),!0):!1}static get _isCI(){return pn.isCI}static get objectScripts(){let e=[`_${process.platform}`,`_${process.arch}`,"_default"];return t._isCI&&e.unshift("_ci"),e}static async runObject(e,n,r){for(let u of t.objectScripts)if(Object.hasOwn(e,u)){await t.runScript(e[u],[],[...n,u],r);return}await t.notFound([...n,"_default"],r,e)}static isExecutable(e){if(typeof e=="function"||typeof e=="string")return!0;if(typeof e!="object")return!1;if(Array.isArray(e))return!0;for(let n of t.objectScripts)if(Object.hasOwn(e,n))return!0;return!1}};var Y=class{static async selectScript(e,n){var s;let u=(((s=n._[0])==null?void 0:s.replace(/^~/,process.env.BSM_PATH??"~"))??"").split("."),i=[],o=e.scripts;for(let D of u){let l;if(Array.isArray(o)?l=o[Number.parseInt(D)]:l=o[D],typeof l!="object")break;i.push([D,o]),o=l}return Ze((D,l)=>{let[p,m]=N(i),[a,F]=N(o),A=Oe(()=>typeof a=="string"||typeof a=="function"?[]:Object.entries(a).map(y=>[y[0],y[1],U.getCommandHelp(y[1],[y[0]])]).filter(y=>y[2]!==void 0),[a,p]),[k,L]=N(0),[S,j]=N(!1),B=A.length,f=A[k][0],g=A[k][1],R=[...p.map(y=>y[0]),f].join("."),C=`
26
- \x1B[1mRun command \xBB \x1B[90m${R}\x1B[0m`;if(S)return l([R]),C;function M(){typeof g=="object"&&(L(0),m([...p,[f,a]]),F(g))}Ue(y=>{if(y.name==="up")L((k-1+B)%B);else if(y.name==="down")L((k+1)%B);else if(y.name==="left"){if(p.length===0)return;let we=p.slice(0,-1),ve=p[p.length-1];L(Object.keys(ve[1]).indexOf(ve[0])),m(we),F(ve[1])}else y.name==="right"?M():y.name==="return"&&(V.isExecutable(g)?j(!0):M())});let T=A.map((y,we)=>`${we===k?"\x1B[32m\x1B[1m> \x1B[4m":" "}${y[2]}`).join(`
27
- `);return`${C}
28
- ${T}\x1B[?25l`})({message:"test"}).catch(()=>process.exit(1))}};var et=x(require("path"));function dn(t){return Array.isArray(t)?t:Object.entries(t).filter(([e])=>!e.startsWith("$")).map(([,e])=>e)}function hr(t,e){if(!e)return;let n=process.platform==="win32"?";":":",r=e.join(n);!process.env.Path||process.env.Path.includes(r)||(t.Path=`${process.env.Path}${n}${r}`)}function dr(){let t=[],e=process.cwd();do t.push(et.default.join(e,"node_modules/.bin"));while(e!==(e=et.default.join(e,"../")));return t}function mn(t,e){if(e.length===0)return t;if(typeof t!="object")return;let n=e[0],r=V.subscript(t,n,!1);if(r)return mn(r[1],e.slice(1))}var Ae=class{constructor(e,n){this.config=e;this.argv=n}async run(){this.handleDebug(),this.argv.version&&U.printVersion(),this.argv.help&&U.printHelp(this.config,this.argv),this.argv.interactive&&(this.argv._=await Y.selectScript(this.config,this.argv)),this.argv.force&&(process.env.BSM_DISABLE_IDEMPOTENCY="true"),await this.handleNoArgs(),hr(process.env,dr());for(let e of this.argv._){if(e=e.replace(/^\\~/g,"~"),e.startsWith("~")&&process.env.BSM_PATH){let n=process.env.BSM_PATH.split("."),r=mn(this.config.scripts,n);if(r){await V.runScript(r,e.split(".").splice(1),n,{});continue}}await V.run(e)}}handleDebug(){if(this.argv.debug)switch(this.argv.debug){case"extends":{let e=this.config.extends;if(e)for(let n of e)console.log(typeof n=="string"?n:n[0]);return process.exit(0)}case"scripts":{let e=[...dn(this.config.scripts)],n=[];for(;e.length>0;){let r=e.shift();r&&(typeof r=="string"?n.push(r):typeof r=="object"&&e.push(...dn(r)))}return console.log(n.join(`
29
- `)),process.exit(0)}}}async handleNoArgs(){var r,u;if(this.argv._.length>0)return;let e=process.env.npm_lifecycle_event;if(e&&e!=="npx"){this.argv._=[e.replaceAll(":",".")];return}(((r=this.config.config)==null?void 0:r.defaultNoArgsBehavior)??((u=this.config.config)==null?void 0:u.defaultHelpBehavior)??"help")==="interactive"?this.argv._=await Y.selectScript(this.config,this.argv):U.printHelp(this.config,this.argv)}};var tt=(0,gn.default)(process.argv.slice(2),{"--":!0,boolean:["interactive","help","version"],alias:{help:"h",version:"v",interactive:"i",force:"f"}});process.argv=tt["--"]??[];async function En(){let t=await I.load(tt);await new Ae(t,tt).run()}En().catch(t=>{t instanceof te&&(console.error(t.func),console.error(`\x1B[31mError executing function '${t.script}'\x1B[0m`),process.exit(1)),t instanceof q&&(console.error(`\x1B[31mScript failed with code ${t.code}\x1B[0m \x1B[90m(${t.script})\x1B[0m`),process.exit(t.code)),console.error(t),console.error("\x1B[31mScript failed\x1B[0m"),process.exit(1)});0&&(module.exports={main});
24
+ `),{};let n=qe.default.readFileSync(e,"utf-8").replaceAll("\r","").split(`
25
+ `).filter(o=>!o.startsWith("#")&&o.trim()!==""),r={};for(let o of n){let a=/^([^=]+)=(['"])?(.+)\2$/g.exec(o);if(a){let l=a[3];a[2]==='"'&&(l=l.replaceAll(/(?<=(?<!\\)(\\\\)*)\\n/g,`
26
+ `).replaceAll(/(?<=(?<!\\)(\\\\)*)\\t/g," ").replaceAll(/(?<=(?<!\\)(\\\\)*)\\r/g,"\r").replaceAll(/(?<=(?<!\\)(\\\\)*)\\\\/g,"\\")),r[a[1]]=l}}return r}else return v.error(`\x1B[31mCurrently only 'file:' is supported for environment variables\x1B[0m
27
+ `),{}}else if(typeof t=="object")if(Array.isArray(t)){let e={};for(let i of t)e={...e,...s.getEnv(i)};return e}else return t;else{let e=t.call(null,process.argv);return e===void 0?{}:s.getEnv(e)}}static async executeHook(t,e,i,n){return Object.hasOwn(t,e)?(await s.runScript(t[e],[],[...i,e],{...n,excludeArgs:!0}),!0):!1}static get _isCI(){return Yn.isCI}static get objectScripts(){let t=[`_${process.platform}`,`_${process.arch}`,"_default"];return s._isCI&&t.unshift("_ci"),t}static async runObject(t,e,i){for(let n of s.objectScripts)if(Object.hasOwn(t,n)){await s.runScript(t[n],[],[...e,n],i);return}await s.notFound([...e,"_default"],i,t)}static isExecutable(t){if(typeof t=="function"||typeof t=="string")return!0;if(typeof t!="object")return!1;if(Array.isArray(t))return!0;for(let e of s.objectScripts)if(Object.hasOwn(t,e))return!0;return!1}};var xt=class{static async selectScript(t,e){var u;let n=(((u=e._[0])==null?void 0:u.replace(/^~/,process.env.BSM_PATH??"~"))??"").split("."),r=[],o=t.scripts;for(let a of n){let l;if(Array.isArray(o)?l=o[Number.parseInt(a)]:l=o[a],typeof l!="object")break;r.push([a,o]),o=l}return Fi((a,l)=>{let[h,c]=at(r),[f,D]=at(o),g=si(()=>typeof f=="string"||typeof f=="function"?[]:Object.entries(f).map(A=>[A[0],A[1],Z.getCommandHelp(A[1],[A[0]])]).filter(A=>A[2]!==void 0),[f,h]),[d,b]=at(0),[m,F]=at(!1),E=g.length,p=g[d][0],w=g[d][1],R=[...h.map(A=>A[0]),p].join("."),y=`
28
+ \x1B[1mRun command \xBB \x1B[90m${R}\x1B[0m`;if(m)return l([R]),y;function W(){typeof w=="object"&&(b(0),c([...h,[p,f]]),D(w))}ni(A=>{if(A.name==="up")b((d-1+E)%E);else if(A.name==="down")b((d+1)%E);else if(A.name==="left"){if(h.length===0)return;let Ke=h.slice(0,-1),Ye=h[h.length-1];b(Object.keys(Ye[1]).indexOf(Ye[0])),c(Ke),D(Ye[1])}else A.name==="right"?W():A.name==="return"&&(bt.isExecutable(w)?F(!0):W())});let N=g.map((A,Ke)=>`${Ke===d?"\x1B[32m\x1B[1m> \x1B[4m":" "}${A[2]}`).join(`
29
+ `);return`${y}
30
+ ${N}\x1B[?25l`})({message:"test"}).catch(()=>process.exit(1))}};var zi=M(require("path"));function Jn(s){return Array.isArray(s)?s:Object.entries(s).filter(([t])=>!t.startsWith("$")).map(([,t])=>t)}function Cu(s,t){if(!t)return;let e=process.platform==="win32"?";":":",i=t.join(e);!process.env.Path||process.env.Path.includes(i)||(s.Path=`${process.env.Path}${e}${i}`)}function Fu(){let s=[],t=process.cwd();do s.push(zi.default.join(t,"node_modules/.bin"));while(t!==(t=zi.default.join(t,"../")));return s}function Xn(s,t){if(t.length===0)return s;if(typeof s!="object")return;let e=t[0],i=bt.subscript(s,e,!1);if(i)return Xn(i[1],t.slice(1))}var Ve=class{constructor(t,e){this.config=t;this.argv=e}async run(){this.argv.silent&&v.silence(),this.handleDebug(),this.argv.version&&Z.printVersion(),this.argv.help&&Z.printHelp(this.config,this.argv),this.argv.interactive&&(this.argv._=await xt.selectScript(this.config,this.argv)),this.argv.force&&(process.env.BSM_DISABLE_IDEMPOTENCY="true"),await this.handleNoArgs(),Cu(process.env,Fu());for(let t of this.argv._){if(t=t.replace(/^\\~/g,"~"),t.startsWith("~")&&process.env.BSM_PATH){let e=process.env.BSM_PATH.split("."),i=Xn(this.config.scripts,e);if(i){await bt.runScript(i,t.split(".").splice(1),e,{});continue}}await bt.run(t)}}handleDebug(){if(this.argv.debug)switch(this.argv.debug){case"extends":{let t=this.config.extends;if(t)for(let e of t)typeof e=="string"?v.log(e):v.log(e[0]);return process.exit(0)}case"scripts":{let t=[...Jn(this.config.scripts)],e=[];for(;t.length>0;){let i=t.shift();i&&(typeof i=="string"?e.push(i):typeof i=="object"&&t.push(...Jn(i)))}return v.log(e.join(`
31
+ `)),process.exit(0)}}}async handleNoArgs(){var i,n;if(this.argv._.length>0)return;let t=process.env.npm_lifecycle_event;if(t&&t!=="npx"){this.argv._=[t.replaceAll(":",".")];return}(((i=this.config.config)==null?void 0:i.defaultNoArgsBehavior)??((n=this.config.config)==null?void 0:n.defaultHelpBehavior)??"help")==="interactive"?this.argv._=await xt.selectScript(this.config,this.argv):Z.printHelp(this.config,this.argv)}};var Hi=(0,Zn.default)(process.argv.slice(2),{"--":!0,boolean:["interactive","help","version","silent"],alias:{help:"h",version:"v",interactive:"i",force:"f",silent:"s"}});process.argv=Hi["--"]??[];async function tr(){let s=await H.load(Hi);await new Ve(s,Hi).run()}tr().catch(s=>{s instanceof Wt&&(v.error(s.func),v.error(`\x1B[31mError executing function '${s.script}'\x1B[0m`),process.exit(1)),s instanceof Et&&(v.error(`\x1B[31mScript failed with code ${s.code}\x1B[0m \x1B[90m(${s.script})\x1B[0m`),process.exit(s.code)),v.error(s),v.error("\x1B[31mScript failed\x1B[0m"),process.exit(1)});0&&(module.exports={main});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@under_koen/bsm",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",
5
5
  "license": "MIT",
6
6
  "author": "Koen van Staveren <koen@underkoen.nl>",
@@ -50,6 +50,7 @@
50
50
  "esbuild": "^0.25.0",
51
51
  "eslint": "^9.21.0",
52
52
  "eslint-config-prettier": "^10.0.2",
53
+ "glob": "^11.0.3",
53
54
  "globals": "^16.0.0",
54
55
  "minimist": "^1.2.8",
55
56
  "prettier": "^3.5.3",