monocart-reporter 2.4.7 → 2.4.8

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.
@@ -1,35 +1,35 @@
1
- var rs=Object.create;var Ee=Object.defineProperty;var ns=Object.getOwnPropertyDescriptor;var is=Object.getOwnPropertyNames;var ss=Object.getPrototypeOf,os=Object.prototype.hasOwnProperty;var m=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),as=(r,e)=>{for(var t in e)Ee(r,t,{get:e[t],enumerable:!0})},nr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of is(e))!os.call(r,i)&&i!==t&&Ee(r,i,{get:()=>e[i],enumerable:!(n=ns(e,i))||n.enumerable});return r};var $=(r,e,t)=>(t=r!=null?rs(ss(r)):{},nr(e||!r||!r.__esModule?Ee(t,"default",{value:r,enumerable:!0}):t,r)),us=r=>nr(Ee({},"__esModule",{value:!0}),r);var sr=m((au,ir)=>{"use strict";var ls=/[|\\{}()[\]^$+*?.-]/g;ir.exports=r=>{if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(ls,"\\$&")}});var lr=m((uu,ur)=>{"use strict";var cs=sr(),fs=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",ar=[].concat(require("module").builtinModules,"bootstrap_node","node").map(r=>new RegExp(`(?:\\((?:node:)?${r}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${r}(?:\\.js)?:\\d+:\\d+$)`));ar.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Je=class r{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=r.nodeInternals()),"cwd"in e||(e.cwd=fs),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,hs(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...ar]}clean(e,t=0){t=" ".repeat(t),Array.isArray(e)||(e=e.split(`
2
- `)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let n=!1,i=null,s=[];return e.forEach(o=>{if(o=o.replace(/\\/g,"/"),this._internals.some(a=>a.test(o)))return;let u=/^\s*at /.test(o);n?o=o.trimEnd().replace(/^(\s+)at /,"$1"):(o=o.trim(),u&&(o=o.slice(3))),o=o.replace(`${this._cwd}/`,""),o&&(u?(i&&(s.push(i),i=null),s.push(o)):(n=!0,i=o))}),s.map(o=>`${t}${o}
3
- `).join("")}captureString(e,t=this.captureString){typeof e=="function"&&(t=e,e=1/0);let{stackTraceLimit:n}=Error;e&&(Error.stackTraceLimit=e);let i={};Error.captureStackTrace(i,t);let{stack:s}=i;return Error.stackTraceLimit=n,this.clean(s)}capture(e,t=this.capture){typeof e=="function"&&(t=e,e=1/0);let{prepareStackTrace:n,stackTraceLimit:i}=Error;Error.prepareStackTrace=(u,a)=>this._wrapCallSite?a.map(this._wrapCallSite):a,e&&(Error.stackTraceLimit=e);let s={};Error.captureStackTrace(s,t);let{stack:o}=s;return Object.assign(Error,{prepareStackTrace:n,stackTraceLimit:i}),o}at(e=this.at){let[t]=this.capture(1,e);if(!t)return{};let n={line:t.getLineNumber(),column:t.getColumnNumber()};or(n,t.getFileName(),this._cwd),t.isConstructor()&&Object.defineProperty(n,"constructor",{value:!0,configurable:!0}),t.isEval()&&(n.evalOrigin=t.getEvalOrigin()),t.isNative()&&(n.native=!0);let i;try{i=t.getTypeName()}catch{}i&&i!=="Object"&&i!=="[object Object]"&&(n.type=i);let s=t.getFunctionName();s&&(n.function=s);let o=t.getMethodName();return o&&s!==o&&(n.method=o),n}parseLine(e){let t=e&&e.match(ds);if(!t)return null;let n=t[1]==="new",i=t[2],s=t[3],o=t[4],u=Number(t[5]),a=Number(t[6]),l=t[7],c=t[8],f=t[9],g=t[10]==="native",b=t[11]===")",p,h={};if(c&&(h.line=Number(c)),f&&(h.column=Number(f)),b&&l){let _=0;for(let y=l.length-1;y>0;y--)if(l.charAt(y)===")")_++;else if(l.charAt(y)==="("&&l.charAt(y-1)===" "&&(_--,_===-1&&l.charAt(y-1)===" ")){let U=l.slice(0,y-1);l=l.slice(y+1),i+=` (${U}`;break}}if(i){let _=i.match(ps);_&&(i=_[1],p=_[2])}return or(h,l,this._cwd),n&&Object.defineProperty(h,"constructor",{value:!0,configurable:!0}),s&&(h.evalOrigin=s,h.evalLine=u,h.evalColumn=a,h.evalFile=o&&o.replace(/\\/g,"/")),g&&(h.native=!0),i&&(h.function=i),p&&i!==p&&(h.method=p),h}};function or(r,e,t){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${t}/`)&&(e=e.slice(t.length+1)),r.file=e)}function hs(r){if(r.length===0)return[];let e=r.map(t=>cs(t));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var ds=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),ps=/^(.*?) \[as (.*?)\]$/;ur.exports=Je});var cr=m(Oe=>{Object.defineProperty(Oe,"__esModule",{value:!0});Oe.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;Oe.matchToToken=function(r){var e={type:"invalid",value:r[0],closed:void 0};return r[1]?(e.type="string",e.closed=!!(r[3]||r[4])):r[5]?e.type="comment":r[6]?(e.type="comment",e.closed=!!r[7]):r[8]?e.type="regex":r[9]?e.type="number":r[10]?e.type="name":r[11]?e.type="punctuator":r[12]&&(e.type="whitespace"),e}});var mr=m(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.isIdentifierChar=pr;oe.isIdentifierName=bs;oe.isIdentifierStart=dr;var Qe="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",fr="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",ms=new RegExp("["+Qe+"]"),gs=new RegExp("["+Qe+fr+"]");Qe=fr=null;var hr=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],_s=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function Ze(r,e){let t=65536;for(let n=0,i=e.length;n<i;n+=2){if(t+=e[n],t>r)return!1;if(t+=e[n+1],t>=r)return!0}return!1}function dr(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&ms.test(String.fromCharCode(r)):Ze(r,hr)}function pr(r){return r<48?r===36:r<58?!0:r<65?!1:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&gs.test(String.fromCharCode(r)):Ze(r,hr)||Ze(r,_s)}function bs(r){let e=!0;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if((n&64512)===55296&&t+1<r.length){let i=r.charCodeAt(++t);(i&64512)===56320&&(n=65536+((n&1023)<<10)+(i&1023))}if(e){if(e=!1,!dr(n))return!1}else if(!pr(n))return!1}return!e}});var vr=m(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.isKeyword=Ss;G.isReservedWord=gr;G.isStrictBindOnlyReservedWord=br;G.isStrictBindReservedWord=ws;G.isStrictReservedWord=_r;var et={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},vs=new Set(et.keyword),ys=new Set(et.strict),xs=new Set(et.strictBind);function gr(r,e){return e&&r==="await"||r==="enum"}function _r(r,e){return gr(r,e)||ys.has(r)}function br(r){return xs.has(r)}function ws(r,e){return _r(r,e)||br(r)}function Ss(r){return vs.has(r)}});var yr=m(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});Object.defineProperty(L,"isIdentifierChar",{enumerable:!0,get:function(){return tt.isIdentifierChar}});Object.defineProperty(L,"isIdentifierName",{enumerable:!0,get:function(){return tt.isIdentifierName}});Object.defineProperty(L,"isIdentifierStart",{enumerable:!0,get:function(){return tt.isIdentifierStart}});Object.defineProperty(L,"isKeyword",{enumerable:!0,get:function(){return ae.isKeyword}});Object.defineProperty(L,"isReservedWord",{enumerable:!0,get:function(){return ae.isReservedWord}});Object.defineProperty(L,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return ae.isStrictBindOnlyReservedWord}});Object.defineProperty(L,"isStrictBindReservedWord",{enumerable:!0,get:function(){return ae.isStrictBindReservedWord}});Object.defineProperty(L,"isStrictReservedWord",{enumerable:!0,get:function(){return ae.isStrictReservedWord}});var tt=mr(),ae=vr()});var nt=m((du,rt)=>{var Es=require("tty"),Os=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Es.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),v=(r,e,t=r)=>n=>{let i=""+n,s=i.indexOf(e,r.length);return~s?r+xr(i,e,t,s)+e:r+i+e},xr=(r,e,t,n)=>{let i=r.substring(0,n)+t,s=r.substring(n+e.length),o=s.indexOf(e);return~o?i+xr(s,e,t,o):i+s},wr=(r=Os)=>({isColorSupported:r,reset:r?e=>`\x1B[0m${e}\x1B[0m`:String,bold:r?v("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:r?v("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:r?v("\x1B[3m","\x1B[23m"):String,underline:r?v("\x1B[4m","\x1B[24m"):String,inverse:r?v("\x1B[7m","\x1B[27m"):String,hidden:r?v("\x1B[8m","\x1B[28m"):String,strikethrough:r?v("\x1B[9m","\x1B[29m"):String,black:r?v("\x1B[30m","\x1B[39m"):String,red:r?v("\x1B[31m","\x1B[39m"):String,green:r?v("\x1B[32m","\x1B[39m"):String,yellow:r?v("\x1B[33m","\x1B[39m"):String,blue:r?v("\x1B[34m","\x1B[39m"):String,magenta:r?v("\x1B[35m","\x1B[39m"):String,cyan:r?v("\x1B[36m","\x1B[39m"):String,white:r?v("\x1B[37m","\x1B[39m"):String,gray:r?v("\x1B[90m","\x1B[39m"):String,bgBlack:r?v("\x1B[40m","\x1B[49m"):String,bgRed:r?v("\x1B[41m","\x1B[49m"):String,bgGreen:r?v("\x1B[42m","\x1B[49m"):String,bgYellow:r?v("\x1B[43m","\x1B[49m"):String,bgBlue:r?v("\x1B[44m","\x1B[49m"):String,bgMagenta:r?v("\x1B[45m","\x1B[49m"):String,bgCyan:r?v("\x1B[46m","\x1B[49m"):String,bgWhite:r?v("\x1B[47m","\x1B[49m"):String});rt.exports=wr();rt.exports.createColors=wr});var Er=m((pu,Sr)=>{"use strict";var Cs=/[|\\{}()[\]^$+*?.]/g;Sr.exports=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(Cs,"\\$&")}});var Cr=m((mu,Or)=>{"use strict";Or.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 it=m((gu,Pr)=>{var z=Cr(),Tr={};for(Ce in z)z.hasOwnProperty(Ce)&&(Tr[z[Ce]]=Ce);var Ce,d=Pr.exports={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"]}};for(C in d)if(d.hasOwnProperty(C)){if(!("channels"in d[C]))throw new Error("missing channels property: "+C);if(!("labels"in d[C]))throw new Error("missing channel labels property: "+C);if(d[C].labels.length!==d[C].channels)throw new Error("channel and label counts mismatch: "+C);kr=d[C].channels,Ar=d[C].labels,delete d[C].channels,delete d[C].labels,Object.defineProperty(d[C],"channels",{value:kr}),Object.defineProperty(d[C],"labels",{value:Ar})}var kr,Ar,C;d.rgb.hsl=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),s=Math.max(e,t,n),o=s-i,u,a,l;return s===i?u=0:e===s?u=(t-n)/o:t===s?u=2+(n-e)/o:n===s&&(u=4+(e-t)/o),u=Math.min(u*60,360),u<0&&(u+=360),l=(i+s)/2,s===i?a=0:l<=.5?a=o/(s+i):a=o/(2-s-i),[u,a*100,l*100]};d.rgb.hsv=function(r){var e,t,n,i,s,o=r[0]/255,u=r[1]/255,a=r[2]/255,l=Math.max(o,u,a),c=l-Math.min(o,u,a),f=function(g){return(l-g)/6/c+1/2};return c===0?i=s=0:(s=c/l,e=f(o),t=f(u),n=f(a),o===l?i=n-t:u===l?i=1/3+e-n:a===l&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,l*100]};d.rgb.hwb=function(r){var e=r[0],t=r[1],n=r[2],i=d.rgb.hsl(r)[0],s=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[i,s*100,n*100]};d.rgb.cmyk=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i,s,o,u;return u=Math.min(1-e,1-t,1-n),i=(1-e-u)/(1-u)||0,s=(1-t-u)/(1-u)||0,o=(1-n-u)/(1-u)||0,[i*100,s*100,o*100,u*100]};function ks(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}d.rgb.keyword=function(r){var e=Tr[r];if(e)return e;var t=1/0,n;for(var i in z)if(z.hasOwnProperty(i)){var s=z[i],o=ks(r,s);o<t&&(t=o,n=i)}return n};d.keyword.rgb=function(r){return z[r]};d.rgb.xyz=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+t*.3576+n*.1805,s=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[i*100,s*100,o*100]};d.rgb.lab=function(r){var e=d.rgb.xyz(r),t=e[0],n=e[1],i=e[2],s,o,u;return t/=95.047,n/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=116*n-16,o=500*(t-n),u=200*(n-i),[s,o,u]};d.hsl.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i,s,o,u,a;if(t===0)return a=n*255,[a,a,a];n<.5?s=n*(1+t):s=n+t-n*t,i=2*n-s,u=[0,0,0];for(var l=0;l<3;l++)o=e+1/3*-(l-1),o<0&&o++,o>1&&o--,6*o<1?a=i+(s-i)*6*o:2*o<1?a=s:3*o<2?a=i+(s-i)*(2/3-o)*6:a=i,u[l]=a*255;return u};d.hsl.hsv=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=t,s=Math.max(n,.01),o,u;return n*=2,t*=n<=1?n:2-n,i*=s<=1?s:2-s,u=(n+t)/2,o=n===0?2*i/(s+i):2*t/(n+t),[e,o*100,u*100]};d.hsv.rgb=function(r){var e=r[0]/60,t=r[1]/100,n=r[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-t),u=255*n*(1-t*s),a=255*n*(1-t*(1-s));switch(n*=255,i){case 0:return[n,a,o];case 1:return[u,n,o];case 2:return[o,n,a];case 3:return[o,u,n];case 4:return[a,o,n];case 5:return[n,o,u]}};d.hsv.hsl=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=Math.max(n,.01),s,o,u;return u=(2-t)*n,s=(2-t)*i,o=t*i,o/=s<=1?s:2-s,o=o||0,u/=2,[e,o*100,u*100]};d.hwb.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i=t+n,s,o,u,a;i>1&&(t/=i,n/=i),s=Math.floor(6*e),o=1-n,u=6*e-s,s&1&&(u=1-u),a=t+u*(o-t);var l,c,f;switch(s){default:case 6:case 0:l=o,c=a,f=t;break;case 1:l=a,c=o,f=t;break;case 2:l=t,c=o,f=a;break;case 3:l=t,c=a,f=o;break;case 4:l=a,c=t,f=o;break;case 5:l=o,c=t,f=a;break}return[l*255,c*255,f*255]};d.cmyk.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i=r[3]/100,s,o,u;return s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,t*(1-i)+i),u=1-Math.min(1,n*(1-i)+i),[s*255,o*255,u*255]};d.xyz.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i,s,o;return i=e*3.2406+t*-1.5372+n*-.4986,s=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};d.xyz.lab=function(r){var e=r[0],t=r[1],n=r[2],i,s,o;return e/=95.047,t/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*t-16,s=500*(e-t),o=200*(t-n),[i,s,o]};d.lab.xyz=function(r){var e=r[0],t=r[1],n=r[2],i,s,o;s=(e+16)/116,i=t/500+s,o=s-n/200;var u=Math.pow(s,3),a=Math.pow(i,3),l=Math.pow(o,3);return s=u>.008856?u:(s-16/116)/7.787,i=a>.008856?a:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};d.lab.lch=function(r){var e=r[0],t=r[1],n=r[2],i,s,o;return i=Math.atan2(n,t),s=i*360/2/Math.PI,s<0&&(s+=360),o=Math.sqrt(t*t+n*n),[e,o,s]};d.lch.lab=function(r){var e=r[0],t=r[1],n=r[2],i,s,o;return o=n/360*2*Math.PI,i=t*Math.cos(o),s=t*Math.sin(o),[e,i,s]};d.rgb.ansi16=function(r){var e=r[0],t=r[1],n=r[2],i=1 in arguments?arguments[1]:d.rgb.hsv(r)[2];if(i=Math.round(i/50),i===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return i===2&&(s+=60),s};d.hsv.ansi16=function(r){return d.rgb.ansi16(d.hsv.rgb(r),r[2])};d.rgb.ansi256=function(r){var e=r[0],t=r[1],n=r[2];if(e===t&&t===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return i};d.ansi16.rgb=function(r){var e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(r>50)+1)*.5,n=(e&1)*t*255,i=(e>>1&1)*t*255,s=(e>>2&1)*t*255;return[n,i,s]};d.ansi256.rgb=function(r){if(r>=232){var e=(r-232)*10+8;return[e,e,e]}r-=16;var t,n=Math.floor(r/36)/5*255,i=Math.floor((t=r%36)/6)/5*255,s=t%6/5*255;return[n,i,s]};d.rgb.hex=function(r){var e=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};d.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(u){return u+u}).join(""));var n=parseInt(t,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};d.rgb.hcg=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.max(Math.max(e,t),n),s=Math.min(Math.min(e,t),n),o=i-s,u,a;return o<1?u=s/(1-o):u=0,o<=0?a=0:i===e?a=(t-n)/o%6:i===t?a=2+(n-e)/o:a=4+(e-t)/o+4,a/=6,a%=1,[a*360,o*100,u*100]};d.hsl.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1,i=0;return t<.5?n=2*e*t:n=2*e*(1-t),n<1&&(i=(t-.5*n)/(1-n)),[r[0],n*100,i*100]};d.hsv.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=e*t,i=0;return n<1&&(i=(t-n)/(1-n)),[r[0],n*100,i*100]};d.hcg.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100;if(t===0)return[n*255,n*255,n*255];var i=[0,0,0],s=e%1*6,o=s%1,u=1-o,a=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return a=(1-t)*n,[(t*i[0]+a)*255,(t*i[1]+a)*255,(t*i[2]+a)*255]};d.hcg.hsv=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e),i=0;return n>0&&(i=e/n),[r[0],i*100,n*100]};d.hcg.hsl=function(r){var e=r[1]/100,t=r[2]/100,n=t*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[r[0],i*100,n*100]};d.hcg.hwb=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e);return[r[0],(n-e)*100,(1-n)*100]};d.hwb.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1-t,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[r[0],i*100,s*100]};d.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};d.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};d.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};d.gray.hsl=d.gray.hsv=function(r){return[0,0,r[0]]};d.gray.hwb=function(r){return[0,100,r[0]]};d.gray.cmyk=function(r){return[0,0,0,r[0]]};d.gray.lab=function(r){return[r[0],0,0]};d.gray.hex=function(r){var e=Math.round(r[0]/100*255)&255,t=(e<<16)+(e<<8)+e,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};d.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}});var Nr=m((_u,Mr)=>{var ke=it();function As(){for(var r={},e=Object.keys(ke),t=e.length,n=0;n<t;n++)r[e[n]]={distance:-1,parent:null};return r}function Ts(r){var e=As(),t=[r];for(e[r].distance=0;t.length;)for(var n=t.pop(),i=Object.keys(ke[n]),s=i.length,o=0;o<s;o++){var u=i[o],a=e[u];a.distance===-1&&(a.distance=e[n].distance+1,a.parent=n,t.unshift(u))}return e}function Ps(r,e){return function(t){return e(r(t))}}function Ms(r,e){for(var t=[e[r].parent,r],n=ke[e[r].parent][r],i=e[r].parent;e[i].parent;)t.unshift(e[i].parent),n=Ps(ke[e[i].parent][i],n),i=e[i].parent;return n.conversion=t,n}Mr.exports=function(r){for(var e=Ts(r),t={},n=Object.keys(e),i=n.length,s=0;s<i;s++){var o=n[s],u=e[o];u.parent!==null&&(t[o]=Ms(o,e))}return t}});var $r=m((bu,Rr)=>{var st=it(),Ns=Nr(),J={},Rs=Object.keys(st);function $s(r){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Ls(r){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=r(t);if(typeof n=="object")for(var i=n.length,s=0;s<i;s++)n[s]=Math.round(n[s]);return n};return"conversion"in r&&(e.conversion=r.conversion),e}Rs.forEach(function(r){J[r]={},Object.defineProperty(J[r],"channels",{value:st[r].channels}),Object.defineProperty(J[r],"labels",{value:st[r].labels});var e=Ns(r),t=Object.keys(e);t.forEach(function(n){var i=e[n];J[r][n]=Ls(i),J[r][n].raw=$s(i)})});Rr.exports=J});var Ir=m((vu,Lr)=>{"use strict";var Z=$r(),Ae=(r,e)=>function(){return`\x1B[${r.apply(Z,arguments)+e}m`},Te=(r,e)=>function(){let t=r.apply(Z,arguments);return`\x1B[${38+e};5;${t}m`},Pe=(r,e)=>function(){let t=r.apply(Z,arguments);return`\x1B[${38+e};2;${t[0]};${t[1]};${t[2]}m`};function Is(){let r=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],gray:[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.grey=e.color.gray;for(let i of Object.keys(e)){let s=e[i];for(let o of Object.keys(s)){let u=s[o];e[o]={open:`\x1B[${u[0]}m`,close:`\x1B[${u[1]}m`},s[o]=e[o],r.set(u[0],u[1])}Object.defineProperty(e,i,{value:s,enumerable:!1}),Object.defineProperty(e,"codes",{value:r,enumerable:!1})}let t=i=>i,n=(i,s,o)=>[i,s,o];e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi={ansi:Ae(t,0)},e.color.ansi256={ansi256:Te(t,0)},e.color.ansi16m={rgb:Pe(n,0)},e.bgColor.ansi={ansi:Ae(t,10)},e.bgColor.ansi256={ansi256:Te(t,10)},e.bgColor.ansi16m={rgb:Pe(n,10)};for(let i of Object.keys(Z)){if(typeof Z[i]!="object")continue;let s=Z[i];i==="ansi16"&&(i="ansi"),"ansi16"in s&&(e.color.ansi[i]=Ae(s.ansi16,0),e.bgColor.ansi[i]=Ae(s.ansi16,10)),"ansi256"in s&&(e.color.ansi256[i]=Te(s.ansi256,0),e.bgColor.ansi256[i]=Te(s.ansi256,10)),"rgb"in s&&(e.color.ansi16m[i]=Pe(s.rgb,0),e.bgColor.ansi16m[i]=Pe(s.rgb,10))}return e}Object.defineProperty(Lr,"exports",{enumerable:!0,get:Is})});var Br=m((yu,Fr)=>{"use strict";Fr.exports=(r,e)=>{e=e||process.argv;let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1?!0:n<i)}});var jr=m((xu,Wr)=>{"use strict";var Fs=require("os"),M=Br(),E=process.env,Q;M("no-color")||M("no-colors")||M("color=false")?Q=!1:(M("color")||M("colors")||M("color=true")||M("color=always"))&&(Q=!0);"FORCE_COLOR"in E&&(Q=E.FORCE_COLOR.length===0||parseInt(E.FORCE_COLOR,10)!==0);function Bs(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Ws(r){if(Q===!1)return 0;if(M("color=16m")||M("color=full")||M("color=truecolor"))return 3;if(M("color=256"))return 2;if(r&&!r.isTTY&&Q!==!0)return 0;let e=Q?1:0;if(process.platform==="win32"){let t=Fs.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in E)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in E)||E.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in E)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E.TEAMCITY_VERSION)?1:0;if(E.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in E){let t=parseInt((E.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(E.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(E.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E.TERM)||"COLORTERM"in E?1:(E.TERM==="dumb",e)}function ot(r){let e=Ws(r);return Bs(e)}Wr.exports={supportsColor:ot,stdout:ot(process.stdout),stderr:ot(process.stderr)}});var Hr=m((wu,Ur)=>{"use strict";var js=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Dr=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Ds=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,qs=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,Vs=new Map([["n",`
4
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Vr(r){return r[0]==="u"&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):Vs.get(r)||r}function Us(r,e){let t=[],n=e.trim().split(/\s*,\s*/g),i;for(let s of n)if(!isNaN(s))t.push(Number(s));else if(i=s.match(Ds))t.push(i[2].replace(qs,(o,u,a)=>u?Vr(u):a));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${r}')`);return t}function Hs(r){Dr.lastIndex=0;let e=[],t;for(;(t=Dr.exec(r))!==null;){let n=t[1];if(t[2]){let i=Us(n,t[2]);e.push([n].concat(i))}else e.push([n])}return e}function qr(r,e){let t={};for(let i of e)for(let s of i.styles)t[s[0]]=i.inverse?null:s.slice(1);let n=r;for(let i of Object.keys(t))if(Array.isArray(t[i])){if(!(i in n))throw new Error(`Unknown Chalk style: ${i}`);t[i].length>0?n=n[i].apply(n,t[i]):n=n[i]}return n}Ur.exports=(r,e)=>{let t=[],n=[],i=[];if(e.replace(js,(s,o,u,a,l,c)=>{if(o)i.push(Vr(o));else if(a){let f=i.join("");i=[],n.push(t.length===0?f:qr(r,t)(f)),t.push({inverse:u,styles:Hs(a)})}else if(l){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(qr(r,t)(i.join(""))),i=[],t.pop()}else i.push(c)}),n.push(i.join("")),t.length>0){let s=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var Xr=m((Su,le)=>{"use strict";var ut=Er(),S=Ir(),at=jr().stdout,Gs=Hr(),zr=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),Yr=["ansi","ansi","ansi256","ansi16m"],Kr=new Set(["gray"]),ee=Object.create(null);function Gr(r,e){e=e||{};let t=at?at.level:0;r.level=e.level===void 0?t:e.level,r.enabled="enabled"in e?e.enabled:r.level>0}function ue(r){if(!this||!(this instanceof ue)||this.template){let e={};return Gr(e,r),e.template=function(){let t=[].slice.call(arguments);return Ks.apply(null,[e.template].concat(t))},Object.setPrototypeOf(e,ue.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=ue,e.template}Gr(this,r)}zr&&(S.blue.open="\x1B[94m");for(let r of Object.keys(S))S[r].closeRe=new RegExp(ut(S[r].close),"g"),ee[r]={get(){let e=S[r];return Me.call(this,this._styles?this._styles.concat(e):[e],this._empty,r)}};ee.visible={get(){return Me.call(this,this._styles||[],!0,"visible")}};S.color.closeRe=new RegExp(ut(S.color.close),"g");for(let r of Object.keys(S.color.ansi))Kr.has(r)||(ee[r]={get(){let e=this.level;return function(){let n={open:S.color[Yr[e]][r].apply(null,arguments),close:S.color.close,closeRe:S.color.closeRe};return Me.call(this,this._styles?this._styles.concat(n):[n],this._empty,r)}}});S.bgColor.closeRe=new RegExp(ut(S.bgColor.close),"g");for(let r of Object.keys(S.bgColor.ansi)){if(Kr.has(r))continue;let e="bg"+r[0].toUpperCase()+r.slice(1);ee[e]={get(){let t=this.level;return function(){let i={open:S.bgColor[Yr[t]][r].apply(null,arguments),close:S.bgColor.close,closeRe:S.bgColor.closeRe};return Me.call(this,this._styles?this._styles.concat(i):[i],this._empty,r)}}}}var zs=Object.defineProperties(()=>{},ee);function Me(r,e,t){let n=function(){return Ys.apply(n,arguments)};n._styles=r,n._empty=e;let i=this;return Object.defineProperty(n,"level",{enumerable:!0,get(){return i.level},set(s){i.level=s}}),Object.defineProperty(n,"enabled",{enumerable:!0,get(){return i.enabled},set(s){i.enabled=s}}),n.hasGrey=this.hasGrey||t==="gray"||t==="grey",n.__proto__=zs,n}function Ys(){let r=arguments,e=r.length,t=String(arguments[0]);if(e===0)return"";if(e>1)for(let i=1;i<e;i++)t+=" "+r[i];if(!this.enabled||this.level<=0||!t)return this._empty?"":t;let n=S.dim.open;zr&&this.hasGrey&&(S.dim.open="");for(let i of this._styles.slice().reverse())t=i.open+t.replace(i.closeRe,i.open)+i.close,t=t.replace(/\r?\n/g,`${i.close}$&${i.open}`);return S.dim.open=n,t}function Ks(r,e){if(!Array.isArray(e))return[].slice.call(arguments,1).join(" ");let t=[].slice.call(arguments,2),n=[e.raw[0]];for(let i=1;i<e.length;i++)n.push(String(t[i-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(e.raw[i]));return Gs(r,n.join(""))}Object.defineProperties(ue.prototype,ee);le.exports=ue();le.exports.supportsColor=at;le.exports.default=le.exports});var sn=m(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.default=no;ce.shouldHighlight=nn;var Jr=cr(),Zr=yr(),ct=Xs(nt(),!0);function en(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(en=function(n){return n?t:e})(r)}function Xs(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=en(e);if(t&&t.has(r))return t.get(r);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&{}.hasOwnProperty.call(r,s)){var o=i?Object.getOwnPropertyDescriptor(r,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=r[s]}return n.default=r,t&&t.set(r,n),n}var tn=typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?(0,ct.createColors)(!1):ct.default,Qr=(r,e)=>t=>r(e(t)),Js=new Set(["as","async","from","get","of","set"]);function Zs(r){return{keyword:r.cyan,capitalized:r.yellow,jsxIdentifier:r.yellow,punctuator:r.yellow,number:r.magenta,string:r.green,regex:r.magenta,comment:r.gray,invalid:Qr(Qr(r.white,r.bgRed),r.bold)}}var Qs=/\r\n|[\n\r\u2028\u2029]/,eo=/^[()[\]{}]$/,rn;{let r=/^[a-z][\w-]*$/i,e=function(t,n,i){if(t.type==="name"){if((0,Zr.isKeyword)(t.value)||(0,Zr.isStrictReservedWord)(t.value,!0)||Js.has(t.value))return"keyword";if(r.test(t.value)&&(i[n-1]==="<"||i.slice(n-2,n)==="</"))return"jsxIdentifier";if(t.value[0]!==t.value[0].toLowerCase())return"capitalized"}return t.type==="punctuator"&&eo.test(t.value)?"bracket":t.type==="invalid"&&(t.value==="@"||t.value==="#")?"punctuator":t.type};rn=function*(t){let n;for(;n=Jr.default.exec(t);){let i=Jr.matchToToken(n);yield{type:e(i,n.index,t),value:i.value}}}}function to(r,e){let t="";for(let{type:n,value:i}of rn(e)){let s=r[n];s?t+=i.split(Qs).map(o=>s(o)).join(`
5
- `):t+=i}return t}function nn(r){return tn.isColorSupported||r.forceColor}var lt;function ro(r){if(r){var e;return(e=lt)!=null||(lt=(0,ct.createColors)(!0)),lt}return tn}function no(r,e={}){if(r!==""&&nn(e)){let t=Zs(ro(e.forceColor));return to(t,r)}else return r}{let r,e;ce.getChalk=({forceColor:t})=>{var n;if((n=r)!=null||(r=Xr()),t){var i;return(i=e)!=null||(e=new r.constructor({enabled:!0,level:1})),e}return r}}});var hn=m(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.codeFrameColumns=fn;Ne.default=lo;var on=sn(),ht=io(nt(),!0);function cn(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(cn=function(n){return n?t:e})(r)}function io(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=cn(e);if(t&&t.has(r))return t.get(r);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s)){var o=i?Object.getOwnPropertyDescriptor(r,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=r[s]}return n.default=r,t&&t.set(r,n),n}var so=typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?(0,ht.createColors)(!1):ht.default,an=(r,e)=>t=>r(e(t)),ft;function oo(r){if(r){var e;return(e=ft)!=null||(ft=(0,ht.createColors)(!0)),ft}return so}var un=!1;function ao(r){return{gutter:r.gray,marker:an(r.red,r.bold),message:an(r.red,r.bold)}}var ln=/\r\n|[\n\r\u2028\u2029]/;function uo(r,e,t){let n=Object.assign({column:0,line:-1},r.start),i=Object.assign({},n,r.end),{linesAbove:s=2,linesBelow:o=3}=t||{},u=n.line,a=n.column,l=i.line,c=i.column,f=Math.max(u-(s+1),0),g=Math.min(e.length,l+o);u===-1&&(f=0),l===-1&&(g=e.length);let b=l-u,p={};if(b)for(let h=0;h<=b;h++){let _=h+u;if(!a)p[_]=!0;else if(h===0){let y=e[_-1].length;p[_]=[a,y-a+1]}else if(h===b)p[_]=[0,c];else{let y=e[_-h].length;p[_]=[0,y]}}else a===c?a?p[u]=[a,0]:p[u]=!0:p[u]=[a,c-a];return{start:f,end:g,markerLines:p}}function fn(r,e,t={}){let n=(t.highlightCode||t.forceColor)&&(0,on.shouldHighlight)(t),i=oo(t.forceColor),s=ao(i),o=(h,_)=>n?h(_):_,u=r.split(ln),{start:a,end:l,markerLines:c}=uo(e,u,t),f=e.start&&typeof e.start.column=="number",g=String(l).length,p=(n?(0,on.default)(r,t):r).split(ln,l).slice(a,l).map((h,_)=>{let y=a+1+_,R=` ${` ${y}`.slice(-g)} |`,A=c[y],we=!c[y+1];if(A){let H="";if(Array.isArray(A)){let Se=h.slice(0,Math.max(A[0]-1,0)).replace(/[^\t]/g," "),se=A[1]||1;H=[`
6
- `,o(s.gutter,R.replace(/\d/g," "))," ",Se,o(s.marker,"^").repeat(se)].join(""),we&&t.message&&(H+=" "+o(s.message,t.message))}return[o(s.marker,">"),o(s.gutter,R),h.length>0?` ${h}`:"",H].join("")}else return` ${o(s.gutter,R)}${h.length>0?` ${h}`:""}`}).join(`
1
+ var rs=Object.create;var Ee=Object.defineProperty;var ns=Object.getOwnPropertyDescriptor;var is=Object.getOwnPropertyNames;var ss=Object.getPrototypeOf,as=Object.prototype.hasOwnProperty;var m=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),os=(r,e)=>{for(var t in e)Ee(r,t,{get:e[t],enumerable:!0})},nr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of is(e))!as.call(r,i)&&i!==t&&Ee(r,i,{get:()=>e[i],enumerable:!(n=ns(e,i))||n.enumerable});return r};var R=(r,e,t)=>(t=r!=null?rs(ss(r)):{},nr(e||!r||!r.__esModule?Ee(t,"default",{value:r,enumerable:!0}):t,r)),us=r=>nr(Ee({},"__esModule",{value:!0}),r);var sr=m((uu,ir)=>{"use strict";var ls=/[|\\{}()[\]^$+*?.-]/g;ir.exports=r=>{if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(ls,"\\$&")}});var lr=m((lu,ur)=>{"use strict";var cs=sr(),fs=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",or=[].concat(require("module").builtinModules,"bootstrap_node","node").map(r=>new RegExp(`(?:\\((?:node:)?${r}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${r}(?:\\.js)?:\\d+:\\d+$)`));or.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Je=class r{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=r.nodeInternals()),"cwd"in e||(e.cwd=fs),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,hs(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...or]}clean(e,t=0){t=" ".repeat(t),Array.isArray(e)||(e=e.split(`
2
+ `)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let n=!1,i=null,s=[];return e.forEach(a=>{if(a=a.replace(/\\/g,"/"),this._internals.some(o=>o.test(a)))return;let u=/^\s*at /.test(a);n?a=a.trimEnd().replace(/^(\s+)at /,"$1"):(a=a.trim(),u&&(a=a.slice(3))),a=a.replace(`${this._cwd}/`,""),a&&(u?(i&&(s.push(i),i=null),s.push(a)):(n=!0,i=a))}),s.map(a=>`${t}${a}
3
+ `).join("")}captureString(e,t=this.captureString){typeof e=="function"&&(t=e,e=1/0);let{stackTraceLimit:n}=Error;e&&(Error.stackTraceLimit=e);let i={};Error.captureStackTrace(i,t);let{stack:s}=i;return Error.stackTraceLimit=n,this.clean(s)}capture(e,t=this.capture){typeof e=="function"&&(t=e,e=1/0);let{prepareStackTrace:n,stackTraceLimit:i}=Error;Error.prepareStackTrace=(u,o)=>this._wrapCallSite?o.map(this._wrapCallSite):o,e&&(Error.stackTraceLimit=e);let s={};Error.captureStackTrace(s,t);let{stack:a}=s;return Object.assign(Error,{prepareStackTrace:n,stackTraceLimit:i}),a}at(e=this.at){let[t]=this.capture(1,e);if(!t)return{};let n={line:t.getLineNumber(),column:t.getColumnNumber()};ar(n,t.getFileName(),this._cwd),t.isConstructor()&&Object.defineProperty(n,"constructor",{value:!0,configurable:!0}),t.isEval()&&(n.evalOrigin=t.getEvalOrigin()),t.isNative()&&(n.native=!0);let i;try{i=t.getTypeName()}catch{}i&&i!=="Object"&&i!=="[object Object]"&&(n.type=i);let s=t.getFunctionName();s&&(n.function=s);let a=t.getMethodName();return a&&s!==a&&(n.method=a),n}parseLine(e){let t=e&&e.match(ds);if(!t)return null;let n=t[1]==="new",i=t[2],s=t[3],a=t[4],u=Number(t[5]),o=Number(t[6]),l=t[7],c=t[8],f=t[9],g=t[10]==="native",b=t[11]===")",p,h={};if(c&&(h.line=Number(c)),f&&(h.column=Number(f)),b&&l){let _=0;for(let v=l.length-1;v>0;v--)if(l.charAt(v)===")")_++;else if(l.charAt(v)==="("&&l.charAt(v-1)===" "&&(_--,_===-1&&l.charAt(v-1)===" ")){let V=l.slice(0,v-1);l=l.slice(v+1),i+=` (${V}`;break}}if(i){let _=i.match(ps);_&&(i=_[1],p=_[2])}return ar(h,l,this._cwd),n&&Object.defineProperty(h,"constructor",{value:!0,configurable:!0}),s&&(h.evalOrigin=s,h.evalLine=u,h.evalColumn=o,h.evalFile=a&&a.replace(/\\/g,"/")),g&&(h.native=!0),i&&(h.function=i),p&&i!==p&&(h.method=p),h}};function ar(r,e,t){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${t}/`)&&(e=e.slice(t.length+1)),r.file=e)}function hs(r){if(r.length===0)return[];let e=r.map(t=>cs(t));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var ds=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),ps=/^(.*?) \[as (.*?)\]$/;ur.exports=Je});var cr=m(Oe=>{Object.defineProperty(Oe,"__esModule",{value:!0});Oe.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;Oe.matchToToken=function(r){var e={type:"invalid",value:r[0],closed:void 0};return r[1]?(e.type="string",e.closed=!!(r[3]||r[4])):r[5]?e.type="comment":r[6]?(e.type="comment",e.closed=!!r[7]):r[8]?e.type="regex":r[9]?e.type="number":r[10]?e.type="name":r[11]?e.type="punctuator":r[12]&&(e.type="whitespace"),e}});var mr=m(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.isIdentifierChar=pr;se.isIdentifierName=bs;se.isIdentifierStart=dr;var Qe="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",fr="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",ms=new RegExp("["+Qe+"]"),gs=new RegExp("["+Qe+fr+"]");Qe=fr=null;var hr=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],_s=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function Ze(r,e){let t=65536;for(let n=0,i=e.length;n<i;n+=2){if(t+=e[n],t>r)return!1;if(t+=e[n+1],t>=r)return!0}return!1}function dr(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&ms.test(String.fromCharCode(r)):Ze(r,hr)}function pr(r){return r<48?r===36:r<58?!0:r<65?!1:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&gs.test(String.fromCharCode(r)):Ze(r,hr)||Ze(r,_s)}function bs(r){let e=!0;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if((n&64512)===55296&&t+1<r.length){let i=r.charCodeAt(++t);(i&64512)===56320&&(n=65536+((n&1023)<<10)+(i&1023))}if(e){if(e=!1,!dr(n))return!1}else if(!pr(n))return!1}return!e}});var vr=m(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.isKeyword=Es;H.isReservedWord=gr;H.isStrictBindOnlyReservedWord=br;H.isStrictBindReservedWord=ws;H.isStrictReservedWord=_r;var et={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},vs=new Set(et.keyword),ys=new Set(et.strict),xs=new Set(et.strictBind);function gr(r,e){return e&&r==="await"||r==="enum"}function _r(r,e){return gr(r,e)||ys.has(r)}function br(r){return xs.has(r)}function ws(r,e){return _r(r,e)||br(r)}function Es(r){return vs.has(r)}});var yr=m($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});Object.defineProperty($,"isIdentifierChar",{enumerable:!0,get:function(){return tt.isIdentifierChar}});Object.defineProperty($,"isIdentifierName",{enumerable:!0,get:function(){return tt.isIdentifierName}});Object.defineProperty($,"isIdentifierStart",{enumerable:!0,get:function(){return tt.isIdentifierStart}});Object.defineProperty($,"isKeyword",{enumerable:!0,get:function(){return ae.isKeyword}});Object.defineProperty($,"isReservedWord",{enumerable:!0,get:function(){return ae.isReservedWord}});Object.defineProperty($,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return ae.isStrictBindOnlyReservedWord}});Object.defineProperty($,"isStrictBindReservedWord",{enumerable:!0,get:function(){return ae.isStrictBindReservedWord}});Object.defineProperty($,"isStrictReservedWord",{enumerable:!0,get:function(){return ae.isStrictReservedWord}});var tt=mr(),ae=vr()});var nt=m((pu,rt)=>{var xr=process.argv||[],Se=process.env,Os=!("NO_COLOR"in Se||xr.includes("--no-color"))&&("FORCE_COLOR"in Se||xr.includes("--color")||process.platform==="win32"||require!=null&&require("tty").isatty(1)&&Se.TERM!=="dumb"||"CI"in Se),Ss=(r,e,t=r)=>n=>{let i=""+n,s=i.indexOf(e,r.length);return~s?r+Cs(i,e,t,s)+e:r+i+e},Cs=(r,e,t,n)=>{let i="",s=0;do i+=r.substring(s,n)+t,s=n+e.length,n=r.indexOf(e,s);while(~n);return i+r.substring(s)},wr=(r=Os)=>{let e=r?Ss:()=>String;return{isColorSupported:r,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m")}};rt.exports=wr();rt.exports.createColors=wr});var Or=m((mu,Er)=>{"use strict";var ks=/[|\\{}()[\]^$+*?.]/g;Er.exports=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(ks,"\\$&")}});var Cr=m((gu,Sr)=>{"use strict";Sr.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 it=m((_u,Pr)=>{var G=Cr(),Tr={};for(Ce in G)G.hasOwnProperty(Ce)&&(Tr[G[Ce]]=Ce);var Ce,d=Pr.exports={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"]}};for(S in d)if(d.hasOwnProperty(S)){if(!("channels"in d[S]))throw new Error("missing channels property: "+S);if(!("labels"in d[S]))throw new Error("missing channel labels property: "+S);if(d[S].labels.length!==d[S].channels)throw new Error("channel and label counts mismatch: "+S);kr=d[S].channels,Ar=d[S].labels,delete d[S].channels,delete d[S].labels,Object.defineProperty(d[S],"channels",{value:kr}),Object.defineProperty(d[S],"labels",{value:Ar})}var kr,Ar,S;d.rgb.hsl=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),s=Math.max(e,t,n),a=s-i,u,o,l;return s===i?u=0:e===s?u=(t-n)/a:t===s?u=2+(n-e)/a:n===s&&(u=4+(e-t)/a),u=Math.min(u*60,360),u<0&&(u+=360),l=(i+s)/2,s===i?o=0:l<=.5?o=a/(s+i):o=a/(2-s-i),[u,o*100,l*100]};d.rgb.hsv=function(r){var e,t,n,i,s,a=r[0]/255,u=r[1]/255,o=r[2]/255,l=Math.max(a,u,o),c=l-Math.min(a,u,o),f=function(g){return(l-g)/6/c+1/2};return c===0?i=s=0:(s=c/l,e=f(a),t=f(u),n=f(o),a===l?i=n-t:u===l?i=1/3+e-n:o===l&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,l*100]};d.rgb.hwb=function(r){var e=r[0],t=r[1],n=r[2],i=d.rgb.hsl(r)[0],s=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[i,s*100,n*100]};d.rgb.cmyk=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i,s,a,u;return u=Math.min(1-e,1-t,1-n),i=(1-e-u)/(1-u)||0,s=(1-t-u)/(1-u)||0,a=(1-n-u)/(1-u)||0,[i*100,s*100,a*100,u*100]};function As(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}d.rgb.keyword=function(r){var e=Tr[r];if(e)return e;var t=1/0,n;for(var i in G)if(G.hasOwnProperty(i)){var s=G[i],a=As(r,s);a<t&&(t=a,n=i)}return n};d.keyword.rgb=function(r){return G[r]};d.rgb.xyz=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+t*.3576+n*.1805,s=e*.2126+t*.7152+n*.0722,a=e*.0193+t*.1192+n*.9505;return[i*100,s*100,a*100]};d.rgb.lab=function(r){var e=d.rgb.xyz(r),t=e[0],n=e[1],i=e[2],s,a,u;return t/=95.047,n/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=116*n-16,a=500*(t-n),u=200*(n-i),[s,a,u]};d.hsl.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i,s,a,u,o;if(t===0)return o=n*255,[o,o,o];n<.5?s=n*(1+t):s=n+t-n*t,i=2*n-s,u=[0,0,0];for(var l=0;l<3;l++)a=e+1/3*-(l-1),a<0&&a++,a>1&&a--,6*a<1?o=i+(s-i)*6*a:2*a<1?o=s:3*a<2?o=i+(s-i)*(2/3-a)*6:o=i,u[l]=o*255;return u};d.hsl.hsv=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=t,s=Math.max(n,.01),a,u;return n*=2,t*=n<=1?n:2-n,i*=s<=1?s:2-s,u=(n+t)/2,a=n===0?2*i/(s+i):2*t/(n+t),[e,a*100,u*100]};d.hsv.rgb=function(r){var e=r[0]/60,t=r[1]/100,n=r[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),a=255*n*(1-t),u=255*n*(1-t*s),o=255*n*(1-t*(1-s));switch(n*=255,i){case 0:return[n,o,a];case 1:return[u,n,a];case 2:return[a,n,o];case 3:return[a,u,n];case 4:return[o,a,n];case 5:return[n,a,u]}};d.hsv.hsl=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=Math.max(n,.01),s,a,u;return u=(2-t)*n,s=(2-t)*i,a=t*i,a/=s<=1?s:2-s,a=a||0,u/=2,[e,a*100,u*100]};d.hwb.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i=t+n,s,a,u,o;i>1&&(t/=i,n/=i),s=Math.floor(6*e),a=1-n,u=6*e-s,s&1&&(u=1-u),o=t+u*(a-t);var l,c,f;switch(s){default:case 6:case 0:l=a,c=o,f=t;break;case 1:l=o,c=a,f=t;break;case 2:l=t,c=a,f=o;break;case 3:l=t,c=o,f=a;break;case 4:l=o,c=t,f=a;break;case 5:l=a,c=t,f=o;break}return[l*255,c*255,f*255]};d.cmyk.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i=r[3]/100,s,a,u;return s=1-Math.min(1,e*(1-i)+i),a=1-Math.min(1,t*(1-i)+i),u=1-Math.min(1,n*(1-i)+i),[s*255,a*255,u*255]};d.xyz.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i,s,a;return i=e*3.2406+t*-1.5372+n*-.4986,s=e*-.9689+t*1.8758+n*.0415,a=e*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),[i*255,s*255,a*255]};d.xyz.lab=function(r){var e=r[0],t=r[1],n=r[2],i,s,a;return e/=95.047,t/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*t-16,s=500*(e-t),a=200*(t-n),[i,s,a]};d.lab.xyz=function(r){var e=r[0],t=r[1],n=r[2],i,s,a;s=(e+16)/116,i=t/500+s,a=s-n/200;var u=Math.pow(s,3),o=Math.pow(i,3),l=Math.pow(a,3);return s=u>.008856?u:(s-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,a=l>.008856?l:(a-16/116)/7.787,i*=95.047,s*=100,a*=108.883,[i,s,a]};d.lab.lch=function(r){var e=r[0],t=r[1],n=r[2],i,s,a;return i=Math.atan2(n,t),s=i*360/2/Math.PI,s<0&&(s+=360),a=Math.sqrt(t*t+n*n),[e,a,s]};d.lch.lab=function(r){var e=r[0],t=r[1],n=r[2],i,s,a;return a=n/360*2*Math.PI,i=t*Math.cos(a),s=t*Math.sin(a),[e,i,s]};d.rgb.ansi16=function(r){var e=r[0],t=r[1],n=r[2],i=1 in arguments?arguments[1]:d.rgb.hsv(r)[2];if(i=Math.round(i/50),i===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return i===2&&(s+=60),s};d.hsv.ansi16=function(r){return d.rgb.ansi16(d.hsv.rgb(r),r[2])};d.rgb.ansi256=function(r){var e=r[0],t=r[1],n=r[2];if(e===t&&t===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return i};d.ansi16.rgb=function(r){var e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(r>50)+1)*.5,n=(e&1)*t*255,i=(e>>1&1)*t*255,s=(e>>2&1)*t*255;return[n,i,s]};d.ansi256.rgb=function(r){if(r>=232){var e=(r-232)*10+8;return[e,e,e]}r-=16;var t,n=Math.floor(r/36)/5*255,i=Math.floor((t=r%36)/6)/5*255,s=t%6/5*255;return[n,i,s]};d.rgb.hex=function(r){var e=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};d.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(u){return u+u}).join(""));var n=parseInt(t,16),i=n>>16&255,s=n>>8&255,a=n&255;return[i,s,a]};d.rgb.hcg=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.max(Math.max(e,t),n),s=Math.min(Math.min(e,t),n),a=i-s,u,o;return a<1?u=s/(1-a):u=0,a<=0?o=0:i===e?o=(t-n)/a%6:i===t?o=2+(n-e)/a:o=4+(e-t)/a+4,o/=6,o%=1,[o*360,a*100,u*100]};d.hsl.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1,i=0;return t<.5?n=2*e*t:n=2*e*(1-t),n<1&&(i=(t-.5*n)/(1-n)),[r[0],n*100,i*100]};d.hsv.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=e*t,i=0;return n<1&&(i=(t-n)/(1-n)),[r[0],n*100,i*100]};d.hcg.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100;if(t===0)return[n*255,n*255,n*255];var i=[0,0,0],s=e%1*6,a=s%1,u=1-a,o=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return o=(1-t)*n,[(t*i[0]+o)*255,(t*i[1]+o)*255,(t*i[2]+o)*255]};d.hcg.hsv=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e),i=0;return n>0&&(i=e/n),[r[0],i*100,n*100]};d.hcg.hsl=function(r){var e=r[1]/100,t=r[2]/100,n=t*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[r[0],i*100,n*100]};d.hcg.hwb=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e);return[r[0],(n-e)*100,(1-n)*100]};d.hwb.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1-t,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[r[0],i*100,s*100]};d.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};d.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};d.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};d.gray.hsl=d.gray.hsv=function(r){return[0,0,r[0]]};d.gray.hwb=function(r){return[0,100,r[0]]};d.gray.cmyk=function(r){return[0,0,0,r[0]]};d.gray.lab=function(r){return[r[0],0,0]};d.gray.hex=function(r){var e=Math.round(r[0]/100*255)&255,t=(e<<16)+(e<<8)+e,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};d.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}});var Nr=m((bu,Mr)=>{var ke=it();function Ts(){for(var r={},e=Object.keys(ke),t=e.length,n=0;n<t;n++)r[e[n]]={distance:-1,parent:null};return r}function Ps(r){var e=Ts(),t=[r];for(e[r].distance=0;t.length;)for(var n=t.pop(),i=Object.keys(ke[n]),s=i.length,a=0;a<s;a++){var u=i[a],o=e[u];o.distance===-1&&(o.distance=e[n].distance+1,o.parent=n,t.unshift(u))}return e}function Ms(r,e){return function(t){return e(r(t))}}function Ns(r,e){for(var t=[e[r].parent,r],n=ke[e[r].parent][r],i=e[r].parent;e[i].parent;)t.unshift(e[i].parent),n=Ms(ke[e[i].parent][i],n),i=e[i].parent;return n.conversion=t,n}Mr.exports=function(r){for(var e=Ps(r),t={},n=Object.keys(e),i=n.length,s=0;s<i;s++){var a=n[s],u=e[a];u.parent!==null&&(t[a]=Ns(a,e))}return t}});var $r=m((vu,Rr)=>{var st=it(),Rs=Nr(),X={},$s=Object.keys(st);function Ls(r){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Is(r){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=r(t);if(typeof n=="object")for(var i=n.length,s=0;s<i;s++)n[s]=Math.round(n[s]);return n};return"conversion"in r&&(e.conversion=r.conversion),e}$s.forEach(function(r){X[r]={},Object.defineProperty(X[r],"channels",{value:st[r].channels}),Object.defineProperty(X[r],"labels",{value:st[r].labels});var e=Rs(r),t=Object.keys(e);t.forEach(function(n){var i=e[n];X[r][n]=Is(i),X[r][n].raw=Ls(i)})});Rr.exports=X});var Ir=m((yu,Lr)=>{"use strict";var J=$r(),Ae=(r,e)=>function(){return`\x1B[${r.apply(J,arguments)+e}m`},Te=(r,e)=>function(){let t=r.apply(J,arguments);return`\x1B[${38+e};5;${t}m`},Pe=(r,e)=>function(){let t=r.apply(J,arguments);return`\x1B[${38+e};2;${t[0]};${t[1]};${t[2]}m`};function Fs(){let r=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],gray:[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.grey=e.color.gray;for(let i of Object.keys(e)){let s=e[i];for(let a of Object.keys(s)){let u=s[a];e[a]={open:`\x1B[${u[0]}m`,close:`\x1B[${u[1]}m`},s[a]=e[a],r.set(u[0],u[1])}Object.defineProperty(e,i,{value:s,enumerable:!1}),Object.defineProperty(e,"codes",{value:r,enumerable:!1})}let t=i=>i,n=(i,s,a)=>[i,s,a];e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi={ansi:Ae(t,0)},e.color.ansi256={ansi256:Te(t,0)},e.color.ansi16m={rgb:Pe(n,0)},e.bgColor.ansi={ansi:Ae(t,10)},e.bgColor.ansi256={ansi256:Te(t,10)},e.bgColor.ansi16m={rgb:Pe(n,10)};for(let i of Object.keys(J)){if(typeof J[i]!="object")continue;let s=J[i];i==="ansi16"&&(i="ansi"),"ansi16"in s&&(e.color.ansi[i]=Ae(s.ansi16,0),e.bgColor.ansi[i]=Ae(s.ansi16,10)),"ansi256"in s&&(e.color.ansi256[i]=Te(s.ansi256,0),e.bgColor.ansi256[i]=Te(s.ansi256,10)),"rgb"in s&&(e.color.ansi16m[i]=Pe(s.rgb,0),e.bgColor.ansi16m[i]=Pe(s.rgb,10))}return e}Object.defineProperty(Lr,"exports",{enumerable:!0,get:Fs})});var Br=m((xu,Fr)=>{"use strict";Fr.exports=(r,e)=>{e=e||process.argv;let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1?!0:n<i)}});var jr=m((wu,Wr)=>{"use strict";var Bs=require("os"),P=Br(),E=process.env,Z;P("no-color")||P("no-colors")||P("color=false")?Z=!1:(P("color")||P("colors")||P("color=true")||P("color=always"))&&(Z=!0);"FORCE_COLOR"in E&&(Z=E.FORCE_COLOR.length===0||parseInt(E.FORCE_COLOR,10)!==0);function Ws(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function js(r){if(Z===!1)return 0;if(P("color=16m")||P("color=full")||P("color=truecolor"))return 3;if(P("color=256"))return 2;if(r&&!r.isTTY&&Z!==!0)return 0;let e=Z?1:0;if(process.platform==="win32"){let t=Bs.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in E)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in E)||E.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in E)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E.TEAMCITY_VERSION)?1:0;if(E.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in E){let t=parseInt((E.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(E.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(E.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E.TERM)||"COLORTERM"in E?1:(E.TERM==="dumb",e)}function at(r){let e=js(r);return Ws(e)}Wr.exports={supportsColor:at,stdout:at(process.stdout),stderr:at(process.stderr)}});var Hr=m((Eu,Ur)=>{"use strict";var Ds=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Dr=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,qs=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Vs=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,Us=new Map([["n",`
4
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Vr(r){return r[0]==="u"&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):Us.get(r)||r}function Hs(r,e){let t=[],n=e.trim().split(/\s*,\s*/g),i;for(let s of n)if(!isNaN(s))t.push(Number(s));else if(i=s.match(qs))t.push(i[2].replace(Vs,(a,u,o)=>u?Vr(u):o));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${r}')`);return t}function Gs(r){Dr.lastIndex=0;let e=[],t;for(;(t=Dr.exec(r))!==null;){let n=t[1];if(t[2]){let i=Hs(n,t[2]);e.push([n].concat(i))}else e.push([n])}return e}function qr(r,e){let t={};for(let i of e)for(let s of i.styles)t[s[0]]=i.inverse?null:s.slice(1);let n=r;for(let i of Object.keys(t))if(Array.isArray(t[i])){if(!(i in n))throw new Error(`Unknown Chalk style: ${i}`);t[i].length>0?n=n[i].apply(n,t[i]):n=n[i]}return n}Ur.exports=(r,e)=>{let t=[],n=[],i=[];if(e.replace(Ds,(s,a,u,o,l,c)=>{if(a)i.push(Vr(a));else if(o){let f=i.join("");i=[],n.push(t.length===0?f:qr(r,t)(f)),t.push({inverse:u,styles:Gs(o)})}else if(l){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(qr(r,t)(i.join(""))),i=[],t.pop()}else i.push(c)}),n.push(i.join("")),t.length>0){let s=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var Xr=m((Ou,ue)=>{"use strict";var ut=Or(),w=Ir(),ot=jr().stdout,zs=Hr(),zr=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),Yr=["ansi","ansi","ansi256","ansi16m"],Kr=new Set(["gray"]),Q=Object.create(null);function Gr(r,e){e=e||{};let t=ot?ot.level:0;r.level=e.level===void 0?t:e.level,r.enabled="enabled"in e?e.enabled:r.level>0}function oe(r){if(!this||!(this instanceof oe)||this.template){let e={};return Gr(e,r),e.template=function(){let t=[].slice.call(arguments);return Xs.apply(null,[e.template].concat(t))},Object.setPrototypeOf(e,oe.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=oe,e.template}Gr(this,r)}zr&&(w.blue.open="\x1B[94m");for(let r of Object.keys(w))w[r].closeRe=new RegExp(ut(w[r].close),"g"),Q[r]={get(){let e=w[r];return Me.call(this,this._styles?this._styles.concat(e):[e],this._empty,r)}};Q.visible={get(){return Me.call(this,this._styles||[],!0,"visible")}};w.color.closeRe=new RegExp(ut(w.color.close),"g");for(let r of Object.keys(w.color.ansi))Kr.has(r)||(Q[r]={get(){let e=this.level;return function(){let n={open:w.color[Yr[e]][r].apply(null,arguments),close:w.color.close,closeRe:w.color.closeRe};return Me.call(this,this._styles?this._styles.concat(n):[n],this._empty,r)}}});w.bgColor.closeRe=new RegExp(ut(w.bgColor.close),"g");for(let r of Object.keys(w.bgColor.ansi)){if(Kr.has(r))continue;let e="bg"+r[0].toUpperCase()+r.slice(1);Q[e]={get(){let t=this.level;return function(){let i={open:w.bgColor[Yr[t]][r].apply(null,arguments),close:w.bgColor.close,closeRe:w.bgColor.closeRe};return Me.call(this,this._styles?this._styles.concat(i):[i],this._empty,r)}}}}var Ys=Object.defineProperties(()=>{},Q);function Me(r,e,t){let n=function(){return Ks.apply(n,arguments)};n._styles=r,n._empty=e;let i=this;return Object.defineProperty(n,"level",{enumerable:!0,get(){return i.level},set(s){i.level=s}}),Object.defineProperty(n,"enabled",{enumerable:!0,get(){return i.enabled},set(s){i.enabled=s}}),n.hasGrey=this.hasGrey||t==="gray"||t==="grey",n.__proto__=Ys,n}function Ks(){let r=arguments,e=r.length,t=String(arguments[0]);if(e===0)return"";if(e>1)for(let i=1;i<e;i++)t+=" "+r[i];if(!this.enabled||this.level<=0||!t)return this._empty?"":t;let n=w.dim.open;zr&&this.hasGrey&&(w.dim.open="");for(let i of this._styles.slice().reverse())t=i.open+t.replace(i.closeRe,i.open)+i.close,t=t.replace(/\r?\n/g,`${i.close}$&${i.open}`);return w.dim.open=n,t}function Xs(r,e){if(!Array.isArray(e))return[].slice.call(arguments,1).join(" ");let t=[].slice.call(arguments,2),n=[e.raw[0]];for(let i=1;i<e.length;i++)n.push(String(t[i-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(e.raw[i]));return zs(r,n.join(""))}Object.defineProperties(oe.prototype,Q);ue.exports=oe();ue.exports.supportsColor=ot;ue.exports.default=ue.exports});var sn=m(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.default=ia;le.shouldHighlight=nn;var Jr=cr(),Zr=yr(),ct=Js(nt(),!0);function en(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(en=function(n){return n?t:e})(r)}function Js(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=en(e);if(t&&t.has(r))return t.get(r);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&{}.hasOwnProperty.call(r,s)){var a=i?Object.getOwnPropertyDescriptor(r,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=r[s]}return n.default=r,t&&t.set(r,n),n}var tn=typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?(0,ct.createColors)(!1):ct.default,Qr=(r,e)=>t=>r(e(t)),Zs=new Set(["as","async","from","get","of","set"]);function Qs(r){return{keyword:r.cyan,capitalized:r.yellow,jsxIdentifier:r.yellow,punctuator:r.yellow,number:r.magenta,string:r.green,regex:r.magenta,comment:r.gray,invalid:Qr(Qr(r.white,r.bgRed),r.bold)}}var ea=/\r\n|[\n\r\u2028\u2029]/,ta=/^[()[\]{}]$/,rn;{let r=/^[a-z][\w-]*$/i,e=function(t,n,i){if(t.type==="name"){if((0,Zr.isKeyword)(t.value)||(0,Zr.isStrictReservedWord)(t.value,!0)||Zs.has(t.value))return"keyword";if(r.test(t.value)&&(i[n-1]==="<"||i.slice(n-2,n)==="</"))return"jsxIdentifier";if(t.value[0]!==t.value[0].toLowerCase())return"capitalized"}return t.type==="punctuator"&&ta.test(t.value)?"bracket":t.type==="invalid"&&(t.value==="@"||t.value==="#")?"punctuator":t.type};rn=function*(t){let n;for(;n=Jr.default.exec(t);){let i=Jr.matchToToken(n);yield{type:e(i,n.index,t),value:i.value}}}}function ra(r,e){let t="";for(let{type:n,value:i}of rn(e)){let s=r[n];s?t+=i.split(ea).map(a=>s(a)).join(`
5
+ `):t+=i}return t}function nn(r){return tn.isColorSupported||r.forceColor}var lt;function na(r){if(r){var e;return(e=lt)!=null||(lt=(0,ct.createColors)(!0)),lt}return tn}function ia(r,e={}){if(r!==""&&nn(e)){let t=Qs(na(e.forceColor));return ra(t,r)}else return r}{let r,e;le.getChalk=({forceColor:t})=>{var n;if((n=r)!=null||(r=Xr()),t){var i;return(i=e)!=null||(e=new r.constructor({enabled:!0,level:1})),e}return r}}});var hn=m(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.codeFrameColumns=fn;Ne.default=ca;var an=sn(),ht=sa(nt(),!0);function cn(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(cn=function(n){return n?t:e})(r)}function sa(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=cn(e);if(t&&t.has(r))return t.get(r);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&{}.hasOwnProperty.call(r,s)){var a=i?Object.getOwnPropertyDescriptor(r,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=r[s]}return n.default=r,t&&t.set(r,n),n}var aa=typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?(0,ht.createColors)(!1):ht.default,on=(r,e)=>t=>r(e(t)),ft;function oa(r){if(r){var e;return(e=ft)!=null||(ft=(0,ht.createColors)(!0)),ft}return aa}var un=!1;function ua(r){return{gutter:r.gray,marker:on(r.red,r.bold),message:on(r.red,r.bold)}}var ln=/\r\n|[\n\r\u2028\u2029]/;function la(r,e,t){let n=Object.assign({column:0,line:-1},r.start),i=Object.assign({},n,r.end),{linesAbove:s=2,linesBelow:a=3}=t||{},u=n.line,o=n.column,l=i.line,c=i.column,f=Math.max(u-(s+1),0),g=Math.min(e.length,l+a);u===-1&&(f=0),l===-1&&(g=e.length);let b=l-u,p={};if(b)for(let h=0;h<=b;h++){let _=h+u;if(!o)p[_]=!0;else if(h===0){let v=e[_-1].length;p[_]=[o,v-o+1]}else if(h===b)p[_]=[0,c];else{let v=e[_-h].length;p[_]=[0,v]}}else o===c?o?p[u]=[o,0]:p[u]=!0:p[u]=[o,c-o];return{start:f,end:g,markerLines:p}}function fn(r,e,t={}){let n=(t.highlightCode||t.forceColor)&&(0,an.shouldHighlight)(t),i=oa(t.forceColor),s=ua(i),a=(h,_)=>n?h(_):_,u=r.split(ln),{start:o,end:l,markerLines:c}=la(e,u,t),f=e.start&&typeof e.start.column=="number",g=String(l).length,p=(n?(0,an.default)(r,t):r).split(ln,l).slice(o,l).map((h,_)=>{let v=o+1+_,N=` ${` ${v}`.slice(-g)} |`,k=c[v],xe=!c[v+1];if(k){let U="";if(Array.isArray(k)){let we=h.slice(0,Math.max(k[0]-1,0)).replace(/[^\t]/g," "),ie=k[1]||1;U=[`
6
+ `,a(s.gutter,N.replace(/\d/g," "))," ",we,a(s.marker,"^").repeat(ie)].join(""),xe&&t.message&&(U+=" "+a(s.message,t.message))}return[a(s.marker,">"),a(s.gutter,N),h.length>0?` ${h}`:"",U].join("")}else return` ${a(s.gutter,N)}${h.length>0?` ${h}`:""}`}).join(`
7
7
  `);return t.message&&!f&&(p=`${" ".repeat(g+1)}${t.message}
8
- ${p}`),n?i.reset(p):p}function lo(r,e,t,n={}){if(!un){un=!0;let s="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(s,"DeprecationWarning");else{let o=new Error(s);o.name="DeprecationWarning",console.warn(new Error(s))}}return t=Math.max(t,0),fn(r,{start:{column:t,line:e}},n)}});var gn=m((Cu,mn)=>{"use strict";var{Duplex:co}=require("stream");function dn(r){r.emit("close")}function fo(){!this.destroyed&&this._writableState.finished&&this.destroy()}function pn(r){this.removeListener("error",pn),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function ho(r,e){let t=!0,n=new co({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let u=!o&&n._readableState.objectMode?s.toString():s;n.push(u)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(dn,n);return}let o=!1;r.once("error",function(a){o=!0,s(a)}),r.once("close",function(){o||s(i),process.nextTick(dn,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",fo),n.on("error",pn),n}mn.exports=ho});var D=m((ku,_n)=>{"use strict";_n.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var fe=m((Au,Re)=>{"use strict";var{EMPTY_BUFFER:po}=D(),dt=Buffer[Symbol.species];function mo(r,e){if(r.length===0)return po;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new dt(t.buffer,t.byteOffset,n):t}function bn(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function vn(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function go(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function pt(r){if(pt.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new dt(r):ArrayBuffer.isView(r)?e=new dt(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),pt.readOnly=!1),e}Re.exports={concat:mo,mask:bn,toArrayBuffer:go,toBuffer:pt,unmask:vn};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=require("bufferutil");Re.exports.mask=function(e,t,n,i,s){s<48?bn(e,t,n,i,s):r.mask(e,t,n,i,s)},Re.exports.unmask=function(e,t){e.length<32?vn(e,t):r.unmask(e,t)}}catch{}});var wn=m((Tu,xn)=>{"use strict";var yn=Symbol("kDone"),mt=Symbol("kRun"),gt=class{constructor(e){this[yn]=()=>{this.pending--,this[mt]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[mt]()}[mt](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[yn])}}};xn.exports=gt});var pe=m((Pu,Cn)=>{"use strict";var he=require("zlib"),Sn=fe(),_o=wn(),{kStatusCode:En}=D(),bo=Buffer[Symbol.species],vo=Buffer.from([0,0,255,255]),Ie=Symbol("permessage-deflate"),F=Symbol("total-length"),de=Symbol("callback"),q=Symbol("buffers"),Le=Symbol("error"),$e,_t=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!$e){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;$e=new _o(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[de];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){$e.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){$e.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?he.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=he.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Ie]=this,this._inflate[F]=0,this._inflate[q]=[],this._inflate.on("error",xo),this._inflate.on("data",On)}this._inflate[de]=n,this._inflate.write(e),t&&this._inflate.write(vo),this._inflate.flush(()=>{let s=this._inflate[Le];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=Sn.concat(this._inflate[q],this._inflate[F]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[F]=0,this._inflate[q]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?he.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=he.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[F]=0,this._deflate[q]=[],this._deflate.on("data",yo)}this._deflate[de]=n,this._deflate.write(e),this._deflate.flush(he.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Sn.concat(this._deflate[q],this._deflate[F]);t&&(s=new bo(s.buffer,s.byteOffset,s.length-4)),this._deflate[de]=null,this._deflate[F]=0,this._deflate[q]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Cn.exports=_t;function yo(r){this[q].push(r),this[F]+=r.length}function On(r){if(this[F]+=r.length,this[Ie]._maxPayload<1||this[F]<=this[Ie]._maxPayload){this[q].push(r);return}this[Le]=new RangeError("Max payload size exceeded"),this[Le].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Le][En]=1009,this.removeListener("data",On),this.reset()}function xo(r){this[Ie]._inflate=null,r[En]=1007,this[de](r)}});var me=m((Mu,Fe)=>{"use strict";var{isUtf8:kn}=require("buffer"),wo=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function So(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function bt(r){let e=r.length,t=0;for(;t<e;)if(!(r[t]&128))t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}Fe.exports={isValidStatusCode:So,isValidUTF8:bt,tokenChars:wo};if(kn)Fe.exports.isValidUTF8=function(r){return r.length<24?bt(r):kn(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=require("utf-8-validate");Fe.exports.isValidUTF8=function(e){return e.length<32?bt(e):r(e)}}catch{}});var St=m((Nu,$n)=>{"use strict";var{Writable:Eo}=require("stream"),An=pe(),{BINARY_TYPES:Oo,EMPTY_BUFFER:Tn,kStatusCode:Co,kWebSocket:ko}=D(),{concat:vt,toArrayBuffer:Ao,unmask:To}=fe(),{isValidStatusCode:Po,isValidUTF8:Pn}=me(),Be=Buffer[Symbol.species],T=0,Mn=1,Nn=2,Rn=3,yt=4,xt=5,We=6,wt=class extends Eo{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Oo[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[ko]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=T}_write(e,t,n){if(this._opcode===8&&this._state==T)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Be(n.buffer,n.byteOffset+e,n.length-e),new Be(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Be(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case T:this.getInfo(e);break;case Mn:this.getPayloadLength16(e);break;case Nn:this.getPayloadLength64(e);break;case Rn:this.getMask();break;case yt:this.getData(e);break;case xt:case We:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[An.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=Mn:this._payloadLength===127?this._state=Nn:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=Rn:this._state=yt}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=yt}getData(e){let t=Tn;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&To(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=xt,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[An.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===T&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=T;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=vt(n,t):this._binaryType==="arraybuffer"?i=Ao(vt(n,t)):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=T):(this._state=We,setImmediate(()=>{this.emit("message",i,!0),this._state=T,this.startLoop(e)}))}else{let i=vt(n,t);if(!this._skipUTF8Validation&&!Pn(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===xt||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=T):(this._state=We,setImmediate(()=>{this.emit("message",i,!1),this._state=T,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Tn),this.end();else{let n=e.readUInt16BE(0);if(!Po(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Be(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Pn(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=T;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=T):(this._state=We,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=T,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[Co]=i,o}};$n.exports=wt});var Ot=m(($u,Fn)=>{"use strict";var{Duplex:Ru}=require("stream"),{randomFillSync:Mo}=require("crypto"),Ln=pe(),{EMPTY_BUFFER:No}=D(),{isValidStatusCode:Ro}=me(),{mask:In,toBuffer:te}=fe(),N=Symbol("kByteLength"),$o=Buffer.alloc(4),Et=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||$o,t.generateMask?t.generateMask(n):Mo(n,0,4),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let u;typeof e=="string"?(!t.mask||o)&&t[N]!==void 0?u=t[N]:(e=Buffer.from(e),u=e.length):(u=e.length,i=t.mask&&t.readOnly&&!o);let a=u;u>=65536?(s+=8,a=127):u>125&&(s+=2,a=126);let l=Buffer.allocUnsafe(i?u+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=a,a===126?l.writeUInt16BE(u,2):a===127&&(l[2]=l[3]=0,l.writeUIntBE(u,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(In(e,n,l,s,u),[l]):(In(e,n,e,0,u),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=No;else{if(typeof e!="number"||!Ro(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let u=Buffer.byteLength(t);if(u>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+u),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[N]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):(e=te(e),i=e.length,s=te.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[N]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):(e=te(e),i=e.length,s=te.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[N]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[Ln.extensionName],s=t.binary?2:1,o=t.compress,u,a;if(typeof e=="string"?(u=Buffer.byteLength(e),a=!1):(e=te(e),u=e.length,a=te.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=u>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0),i){let l={[N]:u,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:a,rsv1:o};this._deflating?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}else this.sendFrame(r.frame(e,{[N]:u,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:a,rsv1:!1}),n)}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[Ln.extensionName];this._bufferedBytes+=n[N],this._deflating=!0,s.compress(e,n.fin,(o,u)=>{if(this._socket.destroyed){let a=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(a);for(let l=0;l<this._queue.length;l++){let c=this._queue[l],f=c[c.length-1];typeof f=="function"&&f(a)}return}this._bufferedBytes-=n[N],this._deflating=!1,n.readOnly=!1,this.sendFrame(r.frame(u,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][N],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][N],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};Fn.exports=Et});var Gn=m((Lu,Hn)=>{"use strict";var{kForOnEventAttribute:ge,kListener:Ct}=D(),Bn=Symbol("kCode"),Wn=Symbol("kData"),jn=Symbol("kError"),Dn=Symbol("kMessage"),qn=Symbol("kReason"),re=Symbol("kTarget"),Vn=Symbol("kType"),Un=Symbol("kWasClean"),B=class{constructor(e){this[re]=null,this[Vn]=e}get target(){return this[re]}get type(){return this[Vn]}};Object.defineProperty(B.prototype,"target",{enumerable:!0});Object.defineProperty(B.prototype,"type",{enumerable:!0});var Y=class extends B{constructor(e,t={}){super(e),this[Bn]=t.code===void 0?0:t.code,this[qn]=t.reason===void 0?"":t.reason,this[Un]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Bn]}get reason(){return this[qn]}get wasClean(){return this[Un]}};Object.defineProperty(Y.prototype,"code",{enumerable:!0});Object.defineProperty(Y.prototype,"reason",{enumerable:!0});Object.defineProperty(Y.prototype,"wasClean",{enumerable:!0});var ne=class extends B{constructor(e,t={}){super(e),this[jn]=t.error===void 0?null:t.error,this[Dn]=t.message===void 0?"":t.message}get error(){return this[jn]}get message(){return this[Dn]}};Object.defineProperty(ne.prototype,"error",{enumerable:!0});Object.defineProperty(ne.prototype,"message",{enumerable:!0});var _e=class extends B{constructor(e,t={}){super(e),this[Wn]=t.data===void 0?null:t.data}get data(){return this[Wn]}};Object.defineProperty(_e.prototype,"data",{enumerable:!0});var Lo={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[ge]&&i[Ct]===e&&!i[ge])return;let n;if(r==="message")n=function(s,o){let u=new _e("message",{data:o?s:s.toString()});u[re]=this,je(e,this,u)};else if(r==="close")n=function(s,o){let u=new Y("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});u[re]=this,je(e,this,u)};else if(r==="error")n=function(s){let o=new ne("error",{error:s,message:s.message});o[re]=this,je(e,this,o)};else if(r==="open")n=function(){let s=new B("open");s[re]=this,je(e,this,s)};else return;n[ge]=!!t[ge],n[Ct]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Ct]===e&&!t[ge]){this.removeListener(r,t);break}}};Hn.exports={CloseEvent:Y,ErrorEvent:ne,Event:B,EventTarget:Lo,MessageEvent:_e};function je(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var kt=m((Iu,zn)=>{"use strict";var{tokenChars:be}=me();function I(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function Io(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,u,a=-1,l=-1,c=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(c===-1&&be[l]===1)a===-1&&(a=f);else if(f!==0&&(l===32||l===9))c===-1&&a!==-1&&(c=f);else if(l===59||l===44){if(a===-1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1&&(c=f);let b=r.slice(a,c);l===44?(I(e,b,t),t=Object.create(null)):o=b,a=c=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===void 0)if(c===-1&&be[l]===1)a===-1&&(a=f);else if(l===32||l===9)c===-1&&a!==-1&&(c=f);else if(l===59||l===44){if(a===-1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1&&(c=f),I(t,r.slice(a,c),!0),l===44&&(I(e,o,t),t=Object.create(null),o=void 0),a=c=-1}else if(l===61&&a!==-1&&c===-1)u=r.slice(a,f),a=c=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(be[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);a===-1?a=f:n||(n=!0),i=!1}else if(s)if(be[l]===1)a===-1&&(a=f);else if(l===34&&a!==-1)s=!1,c=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(c===-1&&be[l]===1)a===-1&&(a=f);else if(a!==-1&&(l===32||l===9))c===-1&&(c=f);else if(l===59||l===44){if(a===-1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1&&(c=f);let b=r.slice(a,c);n&&(b=b.replace(/\\/g,""),n=!1),I(t,u,b),l===44&&(I(e,o,t),t=Object.create(null),o=void 0),u=void 0,a=c=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(a===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");c===-1&&(c=f);let g=r.slice(a,c);return o===void 0?I(e,g,t):(u===void 0?I(t,g,!0):n?I(t,u,g.replace(/\\/g,"")):I(t,u,g),I(e,o,t)),e}function Fo(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}zn.exports={format:Fo,parse:Io}});var Nt=m((Wu,ii)=>{"use strict";var Bo=require("events"),Wo=require("https"),jo=require("http"),Xn=require("net"),Do=require("tls"),{randomBytes:qo,createHash:Vo}=require("crypto"),{Duplex:Fu,Readable:Bu}=require("stream"),{URL:At}=require("url"),V=pe(),Uo=St(),Ho=Ot(),{BINARY_TYPES:Yn,EMPTY_BUFFER:De,GUID:Go,kForOnEventAttribute:Tt,kListener:zo,kStatusCode:Yo,kWebSocket:O,NOOP:Jn}=D(),{EventTarget:{addEventListener:Ko,removeEventListener:Xo}}=Gn(),{format:Jo,parse:Zo}=kt(),{toBuffer:Qo}=fe(),ea=30*1e3,Zn=Symbol("kAborted"),Pt=[8,13],W=["CONNECTING","OPEN","CLOSING","CLOSED"],ta=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,w=class r extends Bo{constructor(e,t,n){super(),this._binaryType=Yn[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=De,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),Qn(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Yn.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new Uo({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new Ho(e,this._extensions,n.generateMask),this._receiver=i,this._socket=e,i[O]=this,e[O]=this,i.on("conclude",ia),i.on("drain",sa),i.on("error",oa),i.on("message",aa),i.on("ping",ua),i.on("pong",la),e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",ti),e.on("data",Ve),e.on("end",ri),e.on("error",ni),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[V.extensionName]&&this._extensions[V.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){k(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),ea)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mt(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||De,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mt(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||De,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mt(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[V.extensionName]||(i.compress=!1),this._sender.send(e||De,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){k(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(w,"CONNECTING",{enumerable:!0,value:W.indexOf("CONNECTING")});Object.defineProperty(w.prototype,"CONNECTING",{enumerable:!0,value:W.indexOf("CONNECTING")});Object.defineProperty(w,"OPEN",{enumerable:!0,value:W.indexOf("OPEN")});Object.defineProperty(w.prototype,"OPEN",{enumerable:!0,value:W.indexOf("OPEN")});Object.defineProperty(w,"CLOSING",{enumerable:!0,value:W.indexOf("CLOSING")});Object.defineProperty(w.prototype,"CLOSING",{enumerable:!0,value:W.indexOf("CLOSING")});Object.defineProperty(w,"CLOSED",{enumerable:!0,value:W.indexOf("CLOSED")});Object.defineProperty(w.prototype,"CLOSED",{enumerable:!0,value:W.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(w.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(w.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Tt])return e[zo];return null},set(e){for(let t of this.listeners(r))if(t[Tt]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Tt]:!0})}})});w.prototype.addEventListener=Ko;w.prototype.removeEventListener=Xo;ii.exports=w;function Qn(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Pt[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Pt.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Pt.join(", ")})`);let s;if(e instanceof At)s=e;else try{s=new At(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",u=s.protocol==="ws+unix:",a;if(s.protocol!=="ws:"&&!o&&!u?a=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:u&&!s.pathname?a="The URL's pathname is empty":s.hash&&(a="The URL contains a fragment identifier"),a){let h=new SyntaxError(a);if(r._redirects===0)throw h;qe(r,h);return}let l=o?443:80,c=qo(16).toString("base64"),f=o?Wo.request:jo.request,g=new Set,b;if(i.createConnection=i.createConnection||(o?na:ra),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(b=new V(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=Jo({[V.extensionName]:b.offer()})),t.length){for(let h of t){if(typeof h!="string"||!ta.test(h)||g.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");g.add(h)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),u){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}let p;if(i.followRedirects){if(r._redirects===0){r._originalIpc=u,r._originalSecure=o,r._originalHostOrSocketPath=u?i.socketPath:s.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[_,y]of Object.entries(h))n.headers[_.toLowerCase()]=y}else if(r.listenerCount("redirect")===0){let h=u?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!h||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),p=r._req=f(i),r._redirects&&r.emit("redirect",r.url,p)}else p=r._req=f(i);i.timeout&&p.on("timeout",()=>{k(r,p,"Opening handshake has timed out")}),p.on("error",h=>{p===null||p[Zn]||(p=r._req=null,qe(r,h))}),p.on("response",h=>{let _=h.headers.location,y=h.statusCode;if(_&&i.followRedirects&&y>=300&&y<400){if(++r._redirects>i.maxRedirects){k(r,p,"Maximum redirects exceeded");return}p.abort();let U;try{U=new At(_,e)}catch{let A=new SyntaxError(`Invalid URL: ${_}`);qe(r,A);return}Qn(r,U,t,n)}else r.emit("unexpected-response",p,h)||k(r,p,`Unexpected server response: ${h.statusCode}`)}),p.on("upgrade",(h,_,y)=>{if(r.emit("upgrade",h),r.readyState!==w.CONNECTING)return;if(p=r._req=null,h.headers.upgrade.toLowerCase()!=="websocket"){k(r,_,"Invalid Upgrade header");return}let U=Vo("sha1").update(c+Go).digest("base64");if(h.headers["sec-websocket-accept"]!==U){k(r,_,"Invalid Sec-WebSocket-Accept header");return}let R=h.headers["sec-websocket-protocol"],A;if(R!==void 0?g.size?g.has(R)||(A="Server sent an invalid subprotocol"):A="Server sent a subprotocol but none was requested":g.size&&(A="Server sent no subprotocol"),A){k(r,_,A);return}R&&(r._protocol=R);let we=h.headers["sec-websocket-extensions"];if(we!==void 0){if(!b){k(r,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let H;try{H=Zo(we)}catch{k(r,_,"Invalid Sec-WebSocket-Extensions header");return}let Se=Object.keys(H);if(Se.length!==1||Se[0]!==V.extensionName){k(r,_,"Server indicated an extension that was not requested");return}try{b.accept(H[V.extensionName])}catch{k(r,_,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[V.extensionName]=b}r.setSocket(_,y,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(p,r):p.end()}function qe(r,e){r._readyState=w.CLOSING,r.emit("error",e),r.emitClose()}function ra(r){return r.path=r.socketPath,Xn.connect(r)}function na(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Xn.isIP(r.host)?"":r.host),Do.connect(r)}function k(r,e,t){r._readyState=w.CLOSING;let n=new Error(t);Error.captureStackTrace(n,k),e.setHeader?(e[Zn]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(qe,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Mt(r,e,t){if(e){let n=Qo(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${W[r.readyState]})`);process.nextTick(t,n)}}function ia(r,e){let t=this[O];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[O]!==void 0&&(t._socket.removeListener("data",Ve),process.nextTick(ei,t._socket),r===1005?t.close():t.close(r,e))}function sa(){let r=this[O];r.isPaused||r._socket.resume()}function oa(r){let e=this[O];e._socket[O]!==void 0&&(e._socket.removeListener("data",Ve),process.nextTick(ei,e._socket),e.close(r[Yo])),e.emit("error",r)}function Kn(){this[O].emitClose()}function aa(r,e){this[O].emit("message",r,e)}function ua(r){let e=this[O];e._autoPong&&e.pong(r,!this._isServer,Jn),e.emit("ping",r)}function la(r){this[O].emit("pong",r)}function ei(r){r.resume()}function ti(){let r=this[O];this.removeListener("close",ti),this.removeListener("data",Ve),this.removeListener("end",ri),r._readyState=w.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[O]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Kn),r._receiver.on("finish",Kn))}function Ve(r){this[O]._receiver.write(r)||this.pause()}function ri(){let r=this[O];r._readyState=w.CLOSING,r._receiver.end(),this.end()}function ni(){let r=this[O];this.removeListener("error",ni),this.on("error",Jn),r&&(r._readyState=w.CLOSING,this.destroy())}});var oi=m((ju,si)=>{"use strict";var{tokenChars:ca}=me();function fa(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&ca[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let u=r.slice(t,n);if(e.has(u))throw new SyntaxError(`The "${u}" subprotocol is duplicated`);e.add(u),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}si.exports={parse:fa}});var di=m((qu,hi)=>{"use strict";var ha=require("events"),Ue=require("http"),{Duplex:Du}=require("stream"),{createHash:da}=require("crypto"),ai=kt(),K=pe(),pa=oi(),ma=Nt(),{GUID:ga,kWebSocket:_a}=D(),ba=/^[+/0-9A-Za-z]{22}==$/,ui=0,li=1,fi=2,Rt=class extends ha{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:ma,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Ue.createServer((n,i)=>{let s=Ue.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=va(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ui}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===fi){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(ve,this);return}if(e&&this.once("close",e),this._state!==li)if(this._state=li,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(ve,this):process.nextTick(ve,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{ve(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",ci);let s=e.headers["sec-websocket-key"],o=+e.headers["sec-websocket-version"];if(e.method!=="GET"){X(this,e,t,405,"Invalid HTTP method");return}if(e.headers.upgrade.toLowerCase()!=="websocket"){X(this,e,t,400,"Invalid Upgrade header");return}if(!s||!ba.test(s)){X(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(o!==8&&o!==13){X(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){ye(t,400);return}let u=e.headers["sec-websocket-protocol"],a=new Set;if(u!==void 0)try{a=pa.parse(u)}catch{X(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],c={};if(this.options.perMessageDeflate&&l!==void 0){let f=new K(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=ai.parse(l);g[K.extensionName]&&(f.accept(g[K.extensionName]),c[K.extensionName]=f)}catch{X(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:e.headers[`${o===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(g,b,p,h)=>{if(!g)return ye(t,b||401,p,h);this.completeUpgrade(c,s,a,e,t,n,i)});return}if(!this.options.verifyClient(f))return ye(t,401)}this.completeUpgrade(c,s,a,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,u){if(!s.readable||!s.writable)return s.destroy();if(s[_a])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ui)return ye(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${da("sha1").update(t+ga).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),c._protocol=f)}if(e[K.extensionName]){let f=e[K.extensionName].params,g=ai.format({[K.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${g}`),c._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
8
+ ${p}`),n?i.reset(p):p}function ca(r,e,t,n={}){if(!un){un=!0;let s="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(s,"DeprecationWarning");else{let a=new Error(s);a.name="DeprecationWarning",console.warn(new Error(s))}}return t=Math.max(t,0),fn(r,{start:{column:t,line:e}},n)}});var gn=m((ku,mn)=>{"use strict";var{Duplex:fa}=require("stream");function dn(r){r.emit("close")}function ha(){!this.destroyed&&this._writableState.finished&&this.destroy()}function pn(r){this.removeListener("error",pn),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function da(r,e){let t=!0,n=new fa({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,a){let u=!a&&n._readableState.objectMode?s.toString():s;n.push(u)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(dn,n);return}let a=!1;r.once("error",function(o){a=!0,s(o)}),r.once("close",function(){a||s(i),process.nextTick(dn,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,a){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,a)});return}r.send(i,a)},n.on("end",ha),n.on("error",pn),n}mn.exports=da});var j=m((Au,_n)=>{"use strict";_n.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ce=m((Tu,Re)=>{"use strict";var{EMPTY_BUFFER:pa}=j(),dt=Buffer[Symbol.species];function ma(r,e){if(r.length===0)return pa;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new dt(t.buffer,t.byteOffset,n):t}function bn(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function vn(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function ga(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function pt(r){if(pt.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new dt(r):ArrayBuffer.isView(r)?e=new dt(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),pt.readOnly=!1),e}Re.exports={concat:ma,mask:bn,toArrayBuffer:ga,toBuffer:pt,unmask:vn};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=require("bufferutil");Re.exports.mask=function(e,t,n,i,s){s<48?bn(e,t,n,i,s):r.mask(e,t,n,i,s)},Re.exports.unmask=function(e,t){e.length<32?vn(e,t):r.unmask(e,t)}}catch{}});var wn=m((Pu,xn)=>{"use strict";var yn=Symbol("kDone"),mt=Symbol("kRun"),gt=class{constructor(e){this[yn]=()=>{this.pending--,this[mt]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[mt]()}[mt](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[yn])}}};xn.exports=gt});var de=m((Mu,Cn)=>{"use strict";var fe=require("zlib"),En=ce(),_a=wn(),{kStatusCode:On}=j(),ba=Buffer[Symbol.species],va=Buffer.from([0,0,255,255]),Ie=Symbol("permessage-deflate"),I=Symbol("total-length"),he=Symbol("callback"),D=Symbol("buffers"),Le=Symbol("error"),$e,_t=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!$e){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;$e=new _a(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[he];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){$e.add(i=>{this._decompress(e,t,(s,a)=>{i(),n(s,a)})})}compress(e,t,n){$e.add(i=>{this._compress(e,t,(s,a)=>{i(),n(s,a)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,a=typeof this.params[s]!="number"?fe.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=fe.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[Ie]=this,this._inflate[I]=0,this._inflate[D]=[],this._inflate.on("error",xa),this._inflate.on("data",Sn)}this._inflate[he]=n,this._inflate.write(e),t&&this._inflate.write(va),this._inflate.flush(()=>{let s=this._inflate[Le];if(s){this._inflate.close(),this._inflate=null,n(s);return}let a=En.concat(this._inflate[D],this._inflate[I]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[I]=0,this._inflate[D]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,a)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,a=typeof this.params[s]!="number"?fe.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=fe.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[I]=0,this._deflate[D]=[],this._deflate.on("data",ya)}this._deflate[he]=n,this._deflate.write(e),this._deflate.flush(fe.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=En.concat(this._deflate[D],this._deflate[I]);t&&(s=new ba(s.buffer,s.byteOffset,s.length-4)),this._deflate[he]=null,this._deflate[I]=0,this._deflate[D]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Cn.exports=_t;function ya(r){this[D].push(r),this[I]+=r.length}function Sn(r){if(this[I]+=r.length,this[Ie]._maxPayload<1||this[I]<=this[Ie]._maxPayload){this[D].push(r);return}this[Le]=new RangeError("Max payload size exceeded"),this[Le].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Le][On]=1009,this.removeListener("data",Sn),this.reset()}function xa(r){this[Ie]._inflate=null,r[On]=1007,this[he](r)}});var pe=m((Nu,Fe)=>{"use strict";var{isUtf8:kn}=require("buffer"),wa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Ea(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function bt(r){let e=r.length,t=0;for(;t<e;)if(!(r[t]&128))t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}Fe.exports={isValidStatusCode:Ea,isValidUTF8:bt,tokenChars:wa};if(kn)Fe.exports.isValidUTF8=function(r){return r.length<24?bt(r):kn(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=require("utf-8-validate");Fe.exports.isValidUTF8=function(e){return e.length<32?bt(e):r(e)}}catch{}});var Et=m((Ru,$n)=>{"use strict";var{Writable:Oa}=require("stream"),An=de(),{BINARY_TYPES:Sa,EMPTY_BUFFER:Tn,kStatusCode:Ca,kWebSocket:ka}=j(),{concat:vt,toArrayBuffer:Aa,unmask:Ta}=ce(),{isValidStatusCode:Pa,isValidUTF8:Pn}=pe(),Be=Buffer[Symbol.species],A=0,Mn=1,Nn=2,Rn=3,yt=4,xt=5,We=6,wt=class extends Oa{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Sa[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[ka]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=A}_write(e,t,n){if(this._opcode===8&&this._state==A)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Be(n.buffer,n.byteOffset+e,n.length-e),new Be(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Be(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case A:this.getInfo(e);break;case Mn:this.getPayloadLength16(e);break;case Nn:this.getPayloadLength64(e);break;case Rn:this.getMask();break;case yt:this.getData(e);break;case xt:case We:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[An.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=Mn:this._payloadLength===127?this._state=Nn:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=Rn:this._state=yt}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=yt}getData(e){let t=Tn;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&Ta(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=xt,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[An.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let a=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(a);return}this._fragments.push(s)}this.dataMessage(t),this._state===A&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=A;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=vt(n,t):this._binaryType==="arraybuffer"?i=Aa(vt(n,t)):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=A):(this._state=We,setImmediate(()=>{this.emit("message",i,!0),this._state=A,this.startLoop(e)}))}else{let i=vt(n,t);if(!this._skipUTF8Validation&&!Pn(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===xt||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=A):(this._state=We,setImmediate(()=>{this.emit("message",i,!1),this._state=A,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Tn),this.end();else{let n=e.readUInt16BE(0);if(!Pa(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Be(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Pn(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=A;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=A):(this._state=We,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=A,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let a=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,this.createError),a.code=s,a[Ca]=i,a}};$n.exports=wt});var St=m((Lu,Fn)=>{"use strict";var{Duplex:$u}=require("stream"),{randomFillSync:Ma}=require("crypto"),Ln=de(),{EMPTY_BUFFER:Na}=j(),{isValidStatusCode:Ra}=pe(),{mask:In,toBuffer:ee}=ce(),M=Symbol("kByteLength"),$a=Buffer.alloc(4),Ot=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,i=!1,s=2,a=!1;t.mask&&(n=t.maskBuffer||$a,t.generateMask?t.generateMask(n):Ma(n,0,4),a=(n[0]|n[1]|n[2]|n[3])===0,s=6);let u;typeof e=="string"?(!t.mask||a)&&t[M]!==void 0?u=t[M]:(e=Buffer.from(e),u=e.length):(u=e.length,i=t.mask&&t.readOnly&&!a);let o=u;u>=65536?(s+=8,o=127):u>125&&(s+=2,o=126);let l=Buffer.allocUnsafe(i?u+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=o,o===126?l.writeUInt16BE(u,2):o===127&&(l[2]=l[3]=0,l.writeUIntBE(u,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],a?[l,e]:i?(In(e,n,l,s,u),[l]):(In(e,n,e,0,u),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=Na;else{if(typeof e!="number"||!Ra(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let u=Buffer.byteLength(t);if(u>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+u),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let a={[M]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,a,i]):this.sendFrame(r.frame(s,a),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):(e=ee(e),i=e.length,s=ee.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[M]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,a,n]):this.sendFrame(r.frame(e,a),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):(e=ee(e),i=e.length,s=ee.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[M]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,a,n]):this.sendFrame(r.frame(e,a),n)}send(e,t,n){let i=this._extensions[Ln.extensionName],s=t.binary?2:1,a=t.compress,u,o;if(typeof e=="string"?(u=Buffer.byteLength(e),o=!1):(e=ee(e),u=e.length,o=ee.readOnly),this._firstFragment?(this._firstFragment=!1,a&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=u>=i._threshold),this._compress=a):(a=!1,s=0),t.fin&&(this._firstFragment=!0),i){let l={[M]:u,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:o,rsv1:a};this._deflating?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}else this.sendFrame(r.frame(e,{[M]:u,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:o,rsv1:!1}),n)}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[Ln.extensionName];this._bufferedBytes+=n[M],this._deflating=!0,s.compress(e,n.fin,(a,u)=>{if(this._socket.destroyed){let o=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(o);for(let l=0;l<this._queue.length;l++){let c=this._queue[l],f=c[c.length-1];typeof f=="function"&&f(o)}return}this._bufferedBytes-=n[M],this._deflating=!1,n.readOnly=!1,this.sendFrame(r.frame(u,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][M],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][M],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};Fn.exports=Ot});var Gn=m((Iu,Hn)=>{"use strict";var{kForOnEventAttribute:me,kListener:Ct}=j(),Bn=Symbol("kCode"),Wn=Symbol("kData"),jn=Symbol("kError"),Dn=Symbol("kMessage"),qn=Symbol("kReason"),te=Symbol("kTarget"),Vn=Symbol("kType"),Un=Symbol("kWasClean"),F=class{constructor(e){this[te]=null,this[Vn]=e}get target(){return this[te]}get type(){return this[Vn]}};Object.defineProperty(F.prototype,"target",{enumerable:!0});Object.defineProperty(F.prototype,"type",{enumerable:!0});var z=class extends F{constructor(e,t={}){super(e),this[Bn]=t.code===void 0?0:t.code,this[qn]=t.reason===void 0?"":t.reason,this[Un]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Bn]}get reason(){return this[qn]}get wasClean(){return this[Un]}};Object.defineProperty(z.prototype,"code",{enumerable:!0});Object.defineProperty(z.prototype,"reason",{enumerable:!0});Object.defineProperty(z.prototype,"wasClean",{enumerable:!0});var re=class extends F{constructor(e,t={}){super(e),this[jn]=t.error===void 0?null:t.error,this[Dn]=t.message===void 0?"":t.message}get error(){return this[jn]}get message(){return this[Dn]}};Object.defineProperty(re.prototype,"error",{enumerable:!0});Object.defineProperty(re.prototype,"message",{enumerable:!0});var ge=class extends F{constructor(e,t={}){super(e),this[Wn]=t.data===void 0?null:t.data}get data(){return this[Wn]}};Object.defineProperty(ge.prototype,"data",{enumerable:!0});var La={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[me]&&i[Ct]===e&&!i[me])return;let n;if(r==="message")n=function(s,a){let u=new ge("message",{data:a?s:s.toString()});u[te]=this,je(e,this,u)};else if(r==="close")n=function(s,a){let u=new z("close",{code:s,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});u[te]=this,je(e,this,u)};else if(r==="error")n=function(s){let a=new re("error",{error:s,message:s.message});a[te]=this,je(e,this,a)};else if(r==="open")n=function(){let s=new F("open");s[te]=this,je(e,this,s)};else return;n[me]=!!t[me],n[Ct]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Ct]===e&&!t[me]){this.removeListener(r,t);break}}};Hn.exports={CloseEvent:z,ErrorEvent:re,Event:F,EventTarget:La,MessageEvent:ge};function je(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var kt=m((Fu,zn)=>{"use strict";var{tokenChars:_e}=pe();function L(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function Ia(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,a,u,o=-1,l=-1,c=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),a===void 0)if(c===-1&&_e[l]===1)o===-1&&(o=f);else if(f!==0&&(l===32||l===9))c===-1&&o!==-1&&(c=f);else if(l===59||l===44){if(o===-1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1&&(c=f);let b=r.slice(o,c);l===44?(L(e,b,t),t=Object.create(null)):a=b,o=c=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===void 0)if(c===-1&&_e[l]===1)o===-1&&(o=f);else if(l===32||l===9)c===-1&&o!==-1&&(c=f);else if(l===59||l===44){if(o===-1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1&&(c=f),L(t,r.slice(o,c),!0),l===44&&(L(e,a,t),t=Object.create(null),a=void 0),o=c=-1}else if(l===61&&o!==-1&&c===-1)u=r.slice(o,f),o=c=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(_e[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);o===-1?o=f:n||(n=!0),i=!1}else if(s)if(_e[l]===1)o===-1&&(o=f);else if(l===34&&o!==-1)s=!1,c=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(c===-1&&_e[l]===1)o===-1&&(o=f);else if(o!==-1&&(l===32||l===9))c===-1&&(c=f);else if(l===59||l===44){if(o===-1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1&&(c=f);let b=r.slice(o,c);n&&(b=b.replace(/\\/g,""),n=!1),L(t,u,b),l===44&&(L(e,a,t),t=Object.create(null),a=void 0),u=void 0,o=c=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(o===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");c===-1&&(c=f);let g=r.slice(o,c);return a===void 0?L(e,g,t):(u===void 0?L(t,g,!0):n?L(t,u,g.replace(/\\/g,"")):L(t,u,g),L(e,a,t)),e}function Fa(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(a=>a===!0?i:`${i}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}zn.exports={format:Fa,parse:Ia}});var Nt=m((ju,ii)=>{"use strict";var Ba=require("events"),Wa=require("https"),ja=require("http"),Xn=require("net"),Da=require("tls"),{randomBytes:qa,createHash:Va}=require("crypto"),{Duplex:Bu,Readable:Wu}=require("stream"),{URL:At}=require("url"),q=de(),Ua=Et(),Ha=St(),{BINARY_TYPES:Yn,EMPTY_BUFFER:De,GUID:Ga,kForOnEventAttribute:Tt,kListener:za,kStatusCode:Ya,kWebSocket:O,NOOP:Jn}=j(),{EventTarget:{addEventListener:Ka,removeEventListener:Xa}}=Gn(),{format:Ja,parse:Za}=kt(),{toBuffer:Qa}=ce(),eo=30*1e3,Zn=Symbol("kAborted"),Pt=[8,13],B=["CONNECTING","OPEN","CLOSING","CLOSED"],to=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,x=class r extends Ba{constructor(e,t,n){super(),this._binaryType=Yn[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=De,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),Qn(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Yn.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new Ua({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new Ha(e,this._extensions,n.generateMask),this._receiver=i,this._socket=e,i[O]=this,e[O]=this,i.on("conclude",io),i.on("drain",so),i.on("error",ao),i.on("message",oo),i.on("ping",uo),i.on("pong",lo),e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",ti),e.on("data",Ve),e.on("end",ri),e.on("error",ni),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[q.extensionName]&&this._extensions[q.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){C(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),eo)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mt(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||De,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mt(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||De,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mt(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[q.extensionName]||(i.compress=!1),this._sender.send(e||De,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){C(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(x,"CONNECTING",{enumerable:!0,value:B.indexOf("CONNECTING")});Object.defineProperty(x.prototype,"CONNECTING",{enumerable:!0,value:B.indexOf("CONNECTING")});Object.defineProperty(x,"OPEN",{enumerable:!0,value:B.indexOf("OPEN")});Object.defineProperty(x.prototype,"OPEN",{enumerable:!0,value:B.indexOf("OPEN")});Object.defineProperty(x,"CLOSING",{enumerable:!0,value:B.indexOf("CLOSING")});Object.defineProperty(x.prototype,"CLOSING",{enumerable:!0,value:B.indexOf("CLOSING")});Object.defineProperty(x,"CLOSED",{enumerable:!0,value:B.indexOf("CLOSED")});Object.defineProperty(x.prototype,"CLOSED",{enumerable:!0,value:B.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(x.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(x.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Tt])return e[za];return null},set(e){for(let t of this.listeners(r))if(t[Tt]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Tt]:!0})}})});x.prototype.addEventListener=Ka;x.prototype.removeEventListener=Xa;ii.exports=x;function Qn(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Pt[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Pt.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Pt.join(", ")})`);let s;if(e instanceof At)s=e;else try{s=new At(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let a=s.protocol==="wss:",u=s.protocol==="ws+unix:",o;if(s.protocol!=="ws:"&&!a&&!u?o=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:u&&!s.pathname?o="The URL's pathname is empty":s.hash&&(o="The URL contains a fragment identifier"),o){let h=new SyntaxError(o);if(r._redirects===0)throw h;qe(r,h);return}let l=a?443:80,c=qa(16).toString("base64"),f=a?Wa.request:ja.request,g=new Set,b;if(i.createConnection=i.createConnection||(a?no:ro),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(b=new q(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=Ja({[q.extensionName]:b.offer()})),t.length){for(let h of t){if(typeof h!="string"||!to.test(h)||g.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");g.add(h)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),u){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}let p;if(i.followRedirects){if(r._redirects===0){r._originalIpc=u,r._originalSecure=a,r._originalHostOrSocketPath=u?i.socketPath:s.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[_,v]of Object.entries(h))n.headers[_.toLowerCase()]=v}else if(r.listenerCount("redirect")===0){let h=u?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!h||r._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),p=r._req=f(i),r._redirects&&r.emit("redirect",r.url,p)}else p=r._req=f(i);i.timeout&&p.on("timeout",()=>{C(r,p,"Opening handshake has timed out")}),p.on("error",h=>{p===null||p[Zn]||(p=r._req=null,qe(r,h))}),p.on("response",h=>{let _=h.headers.location,v=h.statusCode;if(_&&i.followRedirects&&v>=300&&v<400){if(++r._redirects>i.maxRedirects){C(r,p,"Maximum redirects exceeded");return}p.abort();let V;try{V=new At(_,e)}catch{let k=new SyntaxError(`Invalid URL: ${_}`);qe(r,k);return}Qn(r,V,t,n)}else r.emit("unexpected-response",p,h)||C(r,p,`Unexpected server response: ${h.statusCode}`)}),p.on("upgrade",(h,_,v)=>{if(r.emit("upgrade",h),r.readyState!==x.CONNECTING)return;if(p=r._req=null,h.headers.upgrade.toLowerCase()!=="websocket"){C(r,_,"Invalid Upgrade header");return}let V=Va("sha1").update(c+Ga).digest("base64");if(h.headers["sec-websocket-accept"]!==V){C(r,_,"Invalid Sec-WebSocket-Accept header");return}let N=h.headers["sec-websocket-protocol"],k;if(N!==void 0?g.size?g.has(N)||(k="Server sent an invalid subprotocol"):k="Server sent a subprotocol but none was requested":g.size&&(k="Server sent no subprotocol"),k){C(r,_,k);return}N&&(r._protocol=N);let xe=h.headers["sec-websocket-extensions"];if(xe!==void 0){if(!b){C(r,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=Za(xe)}catch{C(r,_,"Invalid Sec-WebSocket-Extensions header");return}let we=Object.keys(U);if(we.length!==1||we[0]!==q.extensionName){C(r,_,"Server indicated an extension that was not requested");return}try{b.accept(U[q.extensionName])}catch{C(r,_,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[q.extensionName]=b}r.setSocket(_,v,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(p,r):p.end()}function qe(r,e){r._readyState=x.CLOSING,r.emit("error",e),r.emitClose()}function ro(r){return r.path=r.socketPath,Xn.connect(r)}function no(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Xn.isIP(r.host)?"":r.host),Da.connect(r)}function C(r,e,t){r._readyState=x.CLOSING;let n=new Error(t);Error.captureStackTrace(n,C),e.setHeader?(e[Zn]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(qe,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Mt(r,e,t){if(e){let n=Qa(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${B[r.readyState]})`);process.nextTick(t,n)}}function io(r,e){let t=this[O];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[O]!==void 0&&(t._socket.removeListener("data",Ve),process.nextTick(ei,t._socket),r===1005?t.close():t.close(r,e))}function so(){let r=this[O];r.isPaused||r._socket.resume()}function ao(r){let e=this[O];e._socket[O]!==void 0&&(e._socket.removeListener("data",Ve),process.nextTick(ei,e._socket),e.close(r[Ya])),e.emit("error",r)}function Kn(){this[O].emitClose()}function oo(r,e){this[O].emit("message",r,e)}function uo(r){let e=this[O];e._autoPong&&e.pong(r,!this._isServer,Jn),e.emit("ping",r)}function lo(r){this[O].emit("pong",r)}function ei(r){r.resume()}function ti(){let r=this[O];this.removeListener("close",ti),this.removeListener("data",Ve),this.removeListener("end",ri),r._readyState=x.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[O]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Kn),r._receiver.on("finish",Kn))}function Ve(r){this[O]._receiver.write(r)||this.pause()}function ri(){let r=this[O];r._readyState=x.CLOSING,r._receiver.end(),this.end()}function ni(){let r=this[O];this.removeListener("error",ni),this.on("error",Jn),r&&(r._readyState=x.CLOSING,this.destroy())}});var ai=m((Du,si)=>{"use strict";var{tokenChars:co}=pe();function fo(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let a=r.charCodeAt(i);if(n===-1&&co[a]===1)t===-1&&(t=i);else if(i!==0&&(a===32||a===9))n===-1&&t!==-1&&(n=i);else if(a===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let u=r.slice(t,n);if(e.has(u))throw new SyntaxError(`The "${u}" subprotocol is duplicated`);e.add(u),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}si.exports={parse:fo}});var di=m((Vu,hi)=>{"use strict";var ho=require("events"),Ue=require("http"),{Duplex:qu}=require("stream"),{createHash:po}=require("crypto"),oi=kt(),Y=de(),mo=ai(),go=Nt(),{GUID:_o,kWebSocket:bo}=j(),vo=/^[+/0-9A-Za-z]{22}==$/,ui=0,li=1,fi=2,Rt=class extends ho{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:go,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Ue.createServer((n,i)=>{let s=Ue.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=yo(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,a)=>{this.handleUpgrade(i,s,a,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ui}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===fi){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(be,this);return}if(e&&this.once("close",e),this._state!==li)if(this._state=li,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(be,this):process.nextTick(be,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{be(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",ci);let s=e.headers["sec-websocket-key"],a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){K(this,e,t,405,"Invalid HTTP method");return}if(e.headers.upgrade.toLowerCase()!=="websocket"){K(this,e,t,400,"Invalid Upgrade header");return}if(!s||!vo.test(s)){K(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==8&&a!==13){K(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){ve(t,400);return}let u=e.headers["sec-websocket-protocol"],o=new Set;if(u!==void 0)try{o=mo.parse(u)}catch{K(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],c={};if(this.options.perMessageDeflate&&l!==void 0){let f=new Y(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=oi.parse(l);g[Y.extensionName]&&(f.accept(g[Y.extensionName]),c[Y.extensionName]=f)}catch{K(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(g,b,p,h)=>{if(!g)return ve(t,b||401,p,h);this.completeUpgrade(c,s,o,e,t,n,i)});return}if(!this.options.verifyClient(f))return ve(t,401)}this.completeUpgrade(c,s,o,e,t,n,i)}completeUpgrade(e,t,n,i,s,a,u){if(!s.readable||!s.writable)return s.destroy();if(s[bo])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ui)return ve(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${po("sha1").update(t+_o).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),c._protocol=f)}if(e[Y.extensionName]){let f=e[Y.extensionName].params,g=oi.format({[Y.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${g}`),c._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
9
9
  `).join(`\r
10
- `)),s.removeListener("error",ci),c.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(c),c.on("close",()=>{this.clients.delete(c),this._shouldEmitClose&&!this.clients.size&&process.nextTick(ve,this)})),u(c,i)}};hi.exports=Rt;function va(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function ve(r){r._state=fi,r.emit("close")}function ci(){this.destroy()}function ye(r,e,t,n){t=t||Ue.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Ue.STATUS_CODES[e]}\r
10
+ `)),s.removeListener("error",ci),c.setSocket(s,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(c),c.on("close",()=>{this.clients.delete(c),this._shouldEmitClose&&!this.clients.size&&process.nextTick(be,this)})),u(c,i)}};hi.exports=Rt;function yo(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function be(r){r._state=fi,r.emit("close")}function ci(){this.destroy()}function ve(r,e,t,n){t=t||Ue.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Ue.STATUS_CODES[e]}\r
11
11
  `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
12
12
  `)+`\r
13
13
  \r
14
- `+t)}function X(r,e,t,n,i){if(r.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,X),r.emit("wsClientError",s,t,e)}else ye(t,n,i)}});var _i=m((Uu,gi)=>{"use strict";function Sa(r){return r>=55296&&r<=56319}function Ea(r){return r>=56320&&r<=57343}gi.exports=function(e,t,n){if(typeof t!="string")throw new Error("Input must be string");for(var i=t.length,s=0,o,u,a=0;a<i;a+=1){if(o=t.charCodeAt(a),u=t[a],Sa(o)&&Ea(t.charCodeAt(a+1))&&(a+=1,u+=t[a]),s+=e(u),s===n)return t.slice(0,a+1);if(s>n)return t.slice(0,a-u.length+1)}return t}});var vi=m((Hu,bi)=>{"use strict";var Oa=_i(),Ca=Buffer.byteLength.bind(Buffer);bi.exports=Oa.bind(null,Ca)});var wi=m((Gu,xi)=>{"use strict";var ka=vi(),Aa=/[\/\?<>\\:\*\|"]/g,Ta=/[\x00-\x1f\x80-\x9f]/g,Pa=/^\.+$/,Ma=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Na=/[\. ]+$/;function yi(r,e){if(typeof r!="string")throw new Error("Input must be string");var t=r.replace(Aa,e).replace(Ta,e).replace(Pa,e).replace(Ma,e).replace(Na,e);return ka(t,255)}xi.exports=function(r,e){var t=e&&e.replacement||"",n=yi(r,t);return t===""?n:yi(n,"")}});var xe=m(It=>{var He=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Lt=class extends He{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};It.CommanderError=He;It.InvalidArgumentError=Lt});var Ge=m(Bt=>{var{InvalidArgumentError:Ra}=xe(),Ft=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Ra(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function $a(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Bt.Argument=Ft;Bt.humanReadableArgName=$a});var jt=m(Si=>{var{humanReadableArgName:La}=Ge(),Wt=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?t.push(n):n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>La(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,t.subcommandTerm(i).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,t.argumentTerm(i).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth||80,s=2,o=2;function u(p,h){if(h){let _=`${p.padEnd(n+o)}${h}`;return t.wrap(_,i-s,n+o)}return p}function a(p){return p.join(`
15
- `).replace(/^/gm," ".repeat(s))}let l=[`Usage: ${t.commandUsage(e)}`,""],c=t.commandDescription(e);c.length>0&&(l=l.concat([t.wrap(c,i,0),""]));let f=t.visibleArguments(e).map(p=>u(t.argumentTerm(p),t.argumentDescription(p)));f.length>0&&(l=l.concat(["Arguments:",a(f),""]));let g=t.visibleOptions(e).map(p=>u(t.optionTerm(p),t.optionDescription(p)));if(g.length>0&&(l=l.concat(["Options:",a(g),""])),this.showGlobalOptions){let p=t.visibleGlobalOptions(e).map(h=>u(t.optionTerm(h),t.optionDescription(h)));p.length>0&&(l=l.concat(["Global Options:",a(p),""]))}let b=t.visibleCommands(e).map(p=>u(t.subcommandTerm(p),t.subcommandDescription(p)));return b.length>0&&(l=l.concat(["Commands:",a(b),""])),l.join(`
16
- `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,i=40){let s=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",o=new RegExp(`[\\n][${s}]+`);if(e.match(o))return e;let u=t-n;if(u<i)return e;let a=e.slice(0,n),l=e.slice(n).replace(`\r
14
+ `+t)}function K(r,e,t,n,i){if(r.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,K),r.emit("wsClientError",s,t,e)}else ve(t,n,i)}});var _i=m((Hu,gi)=>{"use strict";function Oo(r){return r>=55296&&r<=56319}function So(r){return r>=56320&&r<=57343}gi.exports=function(e,t,n){if(typeof t!="string")throw new Error("Input must be string");for(var i=t.length,s=0,a,u,o=0;o<i;o+=1){if(a=t.charCodeAt(o),u=t[o],Oo(a)&&So(t.charCodeAt(o+1))&&(o+=1,u+=t[o]),s+=e(u),s===n)return t.slice(0,o+1);if(s>n)return t.slice(0,o-u.length+1)}return t}});var vi=m((Gu,bi)=>{"use strict";var Co=_i(),ko=Buffer.byteLength.bind(Buffer);bi.exports=Co.bind(null,ko)});var wi=m((zu,xi)=>{"use strict";var Ao=vi(),To=/[\/\?<>\\:\*\|"]/g,Po=/[\x00-\x1f\x80-\x9f]/g,Mo=/^\.+$/,No=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Ro=/[\. ]+$/;function yi(r,e){if(typeof r!="string")throw new Error("Input must be string");var t=r.replace(To,e).replace(Po,e).replace(Mo,e).replace(No,e).replace(Ro,e);return Ao(t,255)}xi.exports=function(r,e){var t=e&&e.replacement||"",n=yi(r,t);return t===""?n:yi(n,"")}});var ye=m(It=>{var He=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Lt=class extends He{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};It.CommanderError=He;It.InvalidArgumentError=Lt});var Ge=m(Bt=>{var{InvalidArgumentError:$o}=ye(),Ft=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new $o(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Lo(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Bt.Argument=Ft;Bt.humanReadableArgName=Lo});var jt=m(Ei=>{var{humanReadableArgName:Io}=Ge(),Wt=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?t.push(n):n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>Io(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,t.subcommandTerm(i).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,t.argumentTerm(i).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth||80,s=2,a=2;function u(p,h){if(h){let _=`${p.padEnd(n+a)}${h}`;return t.wrap(_,i-s,n+a)}return p}function o(p){return p.join(`
15
+ `).replace(/^/gm," ".repeat(s))}let l=[`Usage: ${t.commandUsage(e)}`,""],c=t.commandDescription(e);c.length>0&&(l=l.concat([t.wrap(c,i,0),""]));let f=t.visibleArguments(e).map(p=>u(t.argumentTerm(p),t.argumentDescription(p)));f.length>0&&(l=l.concat(["Arguments:",o(f),""]));let g=t.visibleOptions(e).map(p=>u(t.optionTerm(p),t.optionDescription(p)));if(g.length>0&&(l=l.concat(["Options:",o(g),""])),this.showGlobalOptions){let p=t.visibleGlobalOptions(e).map(h=>u(t.optionTerm(h),t.optionDescription(h)));p.length>0&&(l=l.concat(["Global Options:",o(p),""]))}let b=t.visibleCommands(e).map(p=>u(t.subcommandTerm(p),t.subcommandDescription(p)));return b.length>0&&(l=l.concat(["Commands:",o(b),""])),l.join(`
16
+ `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,i=40){let s=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",a=new RegExp(`[\\n][${s}]+`);if(e.match(a))return e;let u=t-n;if(u<i)return e;let o=e.slice(0,n),l=e.slice(n).replace(`\r
17
17
  `,`
18
18
  `),c=" ".repeat(n),g="\\s\u200B",b=new RegExp(`
19
- |.{1,${u-1}}([${g}]|$)|[^${g}]+?([${g}]|$)`,"g"),p=l.match(b)||[];return a+p.map((h,_)=>h===`
19
+ |.{1,${u-1}}([${g}]|$)|[^${g}]+?([${g}]|$)`,"g"),p=l.match(b)||[];return o+p.map((h,_)=>h===`
20
20
  `?"":(_>0?c:"")+h.trimEnd()).join(`
21
- `)}};Si.Help=Wt});var Ut=m(Vt=>{var{InvalidArgumentError:Ia}=xe(),Dt=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Ba(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Ia(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Fa(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},qt=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return t.negate===(s===e)}};function Fa(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Ba(r){let e,t,n=r.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),t=n.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}Vt.Option=Dt;Vt.DualOptions=qt});var Oi=m(Ei=>{function Wa(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=r.length;i++){let s=1;r[i-1]===e[n-1]?s=0:s=1,t[i][n]=Math.min(t[i-1][n]+1,t[i][n-1]+1,t[i-1][n-1]+s),i>1&&n>1&&r[i-1]===e[n-2]&&r[i-2]===e[n-1]&&(t[i][n]=Math.min(t[i][n],t[i-2][n-2]+1))}return t[r.length][e.length]}function ja(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(o=>o.slice(2)));let n=[],i=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let u=Wa(r,o),a=Math.max(r.length,o.length);(a-u)/a>s&&(u<i?(i=u,n=[o]):u===i&&n.push(o))}),n.sort((o,u)=>o.localeCompare(u)),t&&(n=n.map(o=>`--${o}`)),n.length>1?`
21
+ `)}};Ei.Help=Wt});var Ut=m(Vt=>{var{InvalidArgumentError:Fo}=ye(),Dt=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Wo(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Fo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Bo(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},qt=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return t.negate===(s===e)}};function Bo(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Wo(r){let e,t,n=r.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),t=n.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}Vt.Option=Dt;Vt.DualOptions=qt});var Si=m(Oi=>{function jo(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=r.length;i++){let s=1;r[i-1]===e[n-1]?s=0:s=1,t[i][n]=Math.min(t[i-1][n]+1,t[i][n-1]+1,t[i-1][n-1]+s),i>1&&n>1&&r[i-1]===e[n-2]&&r[i-2]===e[n-1]&&(t[i][n]=Math.min(t[i][n],t[i-2][n-2]+1))}return t[r.length][e.length]}function Do(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(a=>a.slice(2)));let n=[],i=3,s=.4;return e.forEach(a=>{if(a.length<=1)return;let u=jo(r,a),o=Math.max(r.length,a.length);(o-u)/o>s&&(u<i?(i=u,n=[a]):u===i&&n.push(a))}),n.sort((a,u)=>a.localeCompare(u)),t&&(n=n.map(a=>`--${a}`)),n.length>1?`
22
22
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
23
- (Did you mean ${n[0]}?)`:""}Ei.suggestSimilar=ja});var Pi=m(Ti=>{var Da=require("node:events").EventEmitter,Ht=require("node:child_process"),j=require("node:path"),Gt=require("node:fs"),x=require("node:process"),{Argument:qa,humanReadableArgName:Va}=Ge(),{CommanderError:zt}=xe(),{Help:Ua}=jt(),{Option:Ci,DualOptions:Ha}=Ut(),{suggestSimilar:ki}=Oi(),Yt=class r extends Da{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>x.stdout.write(t),writeErr:t=>x.stderr.write(t),getOutHelpWidth:()=>x.stdout.isTTY?x.stdout.columns:void 0,getErrHelpWidth:()=>x.stderr.isTTY?x.stderr.columns:void 0,outputError:(t,n)=>n(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let i=t,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,o,u]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return i&&(a.description(i),a._executableHandler=!0),s.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(s.noHelp||s.hidden),a._executableFile=s.executableFile||null,u&&a.arguments(u),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),i?this:a}createCommand(e){return new r(e)}createHelp(){return Object.assign(new Ua,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
24
- - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new qa(e,t)}argument(e,t,n,i){let s=this.createArgument(e,t);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",o=this.createCommand(n);return o.helpOption(!1),i&&o.arguments(i),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
25
- Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new zt(e,t,n)),x.exit(e)}action(e){let t=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new Ci(e,t)}_callParseArg(e,t,n,i){try{return e.parseArg(t,n)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${i} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
26
- - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),n=t(e).find(i=>this._findCommand(i));if(n){let i=t(this._findCommand(n)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(s,o,u)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let a=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,a,o):s!==null&&e.variadic&&(s=e._concatValue(s,a)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,u)};return this.on("option:"+t,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,o,"env")}),this}_optionEx(e,t,n,i,s){if(typeof t=="object"&&t instanceof Ci)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(t,n);if(o.makeOptionMandatory(!!e.mandatory),typeof i=="function")o.default(s).argParser(i);else if(i instanceof RegExp){let u=i;i=(a,l)=>{let c=u.exec(a);return c?c[0]:l},o.default(s).argParser(i)}else o.default(i);return this.addOption(o)}option(e,t,n,i){return this._optionEx({},e,t,n,i)}requiredOption(e,t,n,i){return this._optionEx({mandatory:!0},e,t,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){var i;if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){(i=x.versions)!=null&&i.electron&&(t.from="electron");let s=x.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(t.from="eval")}e===void 0&&(e=x.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":x.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(c,f){let g=j.resolve(c,f);if(Gt.existsSync(g))return g;if(i.includes(j.extname(f)))return;let b=i.find(p=>Gt.existsSync(`${g}${p}`));if(b)return`${g}${b}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let c;try{c=Gt.realpathSync(this._scriptPath)}catch{c=this._scriptPath}u=j.resolve(j.dirname(c),u)}if(u){let c=s(u,o);if(!c&&!e._executableFile&&this._scriptPath){let f=j.basename(this._scriptPath,j.extname(this._scriptPath));f!==this._name&&(c=s(u,`${f}-${e._name}`))}o=c||o}n=i.includes(j.extname(o));let a;x.platform!=="win32"?n?(t.unshift(o),t=Ai(x.execArgv).concat(t),a=Ht.spawn(x.argv[0],t,{stdio:"inherit"})):a=Ht.spawn(o,t,{stdio:"inherit"}):(t.unshift(o),t=Ai(x.execArgv).concat(t),a=Ht.spawn(x.execPath,t,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{x.on(f,()=>{a.killed===!1&&a.exitCode===null&&a.kill(f)})});let l=this._exitCallback;a.on("close",c=>{c=c??1,l?l(new zt(c,"commander.executeSubCommandAsync","(close)")):x.exit(c)}),a.on("error",c=>{if(c.code==="ENOENT"){let f=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",g=`'${o}' does not exist
23
+ (Did you mean ${n[0]}?)`:""}Oi.suggestSimilar=Do});var Pi=m(Ti=>{var qo=require("node:events").EventEmitter,Ht=require("node:child_process"),W=require("node:path"),Gt=require("node:fs"),y=require("node:process"),{Argument:Vo,humanReadableArgName:Uo}=Ge(),{CommanderError:zt}=ye(),{Help:Ho}=jt(),{Option:Ci,DualOptions:Go}=Ut(),{suggestSimilar:ki}=Si(),Yt=class r extends qo{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>y.stdout.write(t),writeErr:t=>y.stderr.write(t),getOutHelpWidth:()=>y.stdout.isTTY?y.stdout.columns:void 0,getErrHelpWidth:()=>y.stderr.isTTY?y.stderr.columns:void 0,outputError:(t,n)=>n(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let i=t,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,a,u]=e.match(/([^ ]+) *(.*)/),o=this.createCommand(a);return i&&(o.description(i),o._executableHandler=!0),s.isDefault&&(this._defaultCommandName=o._name),o._hidden=!!(s.noHelp||s.hidden),o._executableFile=s.executableFile||null,u&&o.arguments(u),this._registerCommand(o),o.parent=this,o.copyInheritedSettings(this),i?this:o}createCommand(e){return new r(e)}createHelp(){return Object.assign(new Ho,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
24
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Vo(e,t)}argument(e,t,n,i){let s=this.createArgument(e,t);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",a=this.createCommand(n);return a.helpOption(!1),i&&a.arguments(i),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
25
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new zt(e,t,n)),y.exit(e)}action(e){let t=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new Ci(e,t)}_callParseArg(e,t,n,i){try{return e.parseArg(t,n)}catch(s){if(s.code==="commander.invalidArgument"){let a=`${i} ${s.message}`;this.error(a,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
26
+ - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),n=t(e).find(i=>this._findCommand(i));if(n){let i=t(this._findCommand(n)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(s,a,u)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let o=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,o,a):s!==null&&e.variadic&&(s=e._concatValue(s,o)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,u)};return this.on("option:"+t,s=>{let a=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,a,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{let a=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,a,"env")}),this}_optionEx(e,t,n,i,s){if(typeof t=="object"&&t instanceof Ci)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof i=="function")a.default(s).argParser(i);else if(i instanceof RegExp){let u=i;i=(o,l)=>{let c=u.exec(o);return c?c[0]:l},a.default(s).argParser(i)}else a.default(i);return this.addOption(a)}option(e,t,n,i){return this._optionEx({},e,t,n,i)}requiredOption(e,t,n,i){return this._optionEx({mandatory:!0},e,t,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){var i;if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){(i=y.versions)!=null&&i.electron&&(t.from="electron");let s=y.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(t.from="eval")}e===void 0&&(e=y.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":y.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(c,f){let g=W.resolve(c,f);if(Gt.existsSync(g))return g;if(i.includes(W.extname(f)))return;let b=i.find(p=>Gt.existsSync(`${g}${p}`));if(b)return`${g}${b}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let c;try{c=Gt.realpathSync(this._scriptPath)}catch{c=this._scriptPath}u=W.resolve(W.dirname(c),u)}if(u){let c=s(u,a);if(!c&&!e._executableFile&&this._scriptPath){let f=W.basename(this._scriptPath,W.extname(this._scriptPath));f!==this._name&&(c=s(u,`${f}-${e._name}`))}a=c||a}n=i.includes(W.extname(a));let o;y.platform!=="win32"?n?(t.unshift(a),t=Ai(y.execArgv).concat(t),o=Ht.spawn(y.argv[0],t,{stdio:"inherit"})):o=Ht.spawn(a,t,{stdio:"inherit"}):(t.unshift(a),t=Ai(y.execArgv).concat(t),o=Ht.spawn(y.execPath,t,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{y.on(f,()=>{o.killed===!1&&o.exitCode===null&&o.kill(f)})});let l=this._exitCallback;o.on("close",c=>{c=c??1,l?l(new zt(c,"commander.executeSubCommandAsync","(close)")):y.exit(c)}),o.on("error",c=>{if(c.code==="ENOENT"){let f=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",g=`'${a}' does not exist
27
27
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
28
28
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
29
- - ${f}`;throw new Error(g)}else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)x.exit(1);else{let f=new zt(1,"commander.executeSubCommandAsync","(error)");f.nestedError=c,l(f)}}),this.runningCommand=a}_dispatchSubcommand(e,t,n){let i=this._findCommand(e);i||this.help({error:!0});let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(n));else return i._parseCommand(t,n)}),s}_dispatchHelpCommand(e){var n,i;e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[((n=this._getHelpOption())==null?void 0:n.long)??((i=this._getHelpOption())==null?void 0:i.short)??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,s)=>{let o=i;if(i!==null&&n.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,i,s,u)}return o};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((o,u)=>e(n,u,o),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=e(n,s,n.defaultValue))),t[i]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(o=>{i.push({hookedCommand:s,callback:o})})}),t==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,t))}),i}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,t)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],i=t,s=e.slice();function o(a){return a.length>1&&a[0]==="-"}let u=null;for(;s.length;){let a=s.shift();if(a==="--"){i===n&&i.push(a),i.push(...s);break}if(u&&!o(a)){this.emit(`option:${u.name()}`,a);continue}if(u=null,o(a)){let l=this._findOption(a);if(l){if(l.required){let c=s.shift();c===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,c)}else if(l.optional){let c=null;s.length>0&&!o(s[0])&&(c=s.shift()),this.emit(`option:${l.name()}`,c)}else this.emit(`option:${l.name()}`);u=l.variadic?l:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let l=this._findOption(`-${a[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,a.slice(2)):(this.emit(`option:${l.name()}`),s.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let l=a.indexOf("="),c=this._findOption(a.slice(0,l));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,a.slice(l+1));continue}}if(o(a)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(a)){t.push(a),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){t.push(a),s.length>0&&t.push(...s);break}else if(this._defaultCommandName){n.push(a),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){i.push(a),s.length>0&&i.push(...s);break}i.push(a)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
29
+ - ${f}`;throw new Error(g)}else if(c.code==="EACCES")throw new Error(`'${a}' not executable`);if(!l)y.exit(1);else{let f=new zt(1,"commander.executeSubCommandAsync","(error)");f.nestedError=c,l(f)}}),this.runningCommand=o}_dispatchSubcommand(e,t,n){let i=this._findCommand(e);i||this.help({error:!0});let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(n));else return i._parseCommand(t,n)}),s}_dispatchHelpCommand(e){var n,i;e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[((n=this._getHelpOption())==null?void 0:n.long)??((i=this._getHelpOption())==null?void 0:i.short)??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,s)=>{let a=i;if(i!==null&&n.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;a=this._callParseArg(n,i,s,u)}return a};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((a,u)=>e(n,u,a),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=e(n,s,n.defaultValue))),t[i]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(a=>{i.push({hookedCommand:s,callback:a})})}),t==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,t))}),i}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(s,e,t)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],i=t,s=e.slice();function a(o){return o.length>1&&o[0]==="-"}let u=null;for(;s.length;){let o=s.shift();if(o==="--"){i===n&&i.push(o),i.push(...s);break}if(u&&!a(o)){this.emit(`option:${u.name()}`,o);continue}if(u=null,a(o)){let l=this._findOption(o);if(l){if(l.required){let c=s.shift();c===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,c)}else if(l.optional){let c=null;s.length>0&&!a(s[0])&&(c=s.shift()),this.emit(`option:${l.name()}`,c)}else this.emit(`option:${l.name()}`);u=l.variadic?l:null;continue}}if(o.length>2&&o[0]==="-"&&o[1]!=="-"){let l=this._findOption(`-${o[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,o.slice(2)):(this.emit(`option:${l.name()}`),s.unshift(`-${o.slice(2)}`));continue}}if(/^--[^=]+=/.test(o)){let l=o.indexOf("="),c=this._findOption(o.slice(0,l));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,o.slice(l+1));continue}}if(a(o)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(o)){t.push(o),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&o===this._getHelpCommand().name()){t.push(o),s.length>0&&t.push(...s);break}else if(this._defaultCommandName){n.push(o),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){i.push(o),s.length>0&&i.push(...s);break}i.push(o)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
30
30
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
31
31
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
32
- `),this.outputHelp({error:!0}));let n=t||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in x.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,x.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ha(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=o=>{let u=o.attributeName(),a=this.getOptionValue(u),l=this.options.find(f=>f.negate&&u===f.attributeName()),c=this.options.find(f=>!f.negate&&u===f.attributeName());return l&&(l.presetArg===void 0&&a===!1||l.presetArg!==void 0&&a===l.presetArg)?l:c||o},i=o=>{let u=n(o),a=u.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},s=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(u=>u.long).map(u=>u.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);t=ki(e,i)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),t=ki(e,i)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let i=this.createOption(t,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
33
- `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){var i;if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=(i=this.parent)==null?void 0:i._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>Va(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=j.basename(e,j.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},n;return t.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),t.write=e.write||n,t.command=this,t}outputHelp(e){var s;let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(t&&(i=t(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),(s=this._getHelpOption())!=null&&s.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=x.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
34
- Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let o;typeof t=="function"?o=t({error:s.error,command:s.command}):o=t,o&&s.write(`${o}
35
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ai(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],n=s[3],i=s[4]),t&&i!=="0"?`${t}=${n}:${parseInt(i)+1}`:e})}Ti.Command=Yt});var $i=m(P=>{var{Argument:Mi}=Ge(),{Command:Kt}=Pi(),{CommanderError:Ga,InvalidArgumentError:Ni}=xe(),{Help:za}=jt(),{Option:Ri}=Ut();P.program=new Kt;P.createCommand=r=>new Kt(r);P.createOption=(r,e)=>new Ri(r,e);P.createArgument=(r,e)=>new Mi(r,e);P.Command=Kt;P.Option=Ri;P.Argument=Mi;P.Help=za;P.CommanderError=Ga;P.InvalidArgumentError=Ni;P.InvalidOptionArgumentError=Ni});var Jt=m((fl,Bi)=>{"use strict";var Fi=require("fs"),Xt;function Ya(){try{return Fi.statSync("/.dockerenv"),!0}catch{return!1}}function Ka(){try{return Fi.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Bi.exports=()=>(Xt===void 0&&(Xt=Ya()||Ka()),Xt)});var Di=m((hl,Zt)=>{"use strict";var Xa=require("os"),Ja=require("fs"),Wi=Jt(),ji=()=>{if(process.platform!=="linux")return!1;if(Xa.release().toLowerCase().includes("microsoft"))return!Wi();try{return Ja.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Wi():!1}catch{return!1}};process.env.__IS_WSL_TEST__?Zt.exports=ji:Zt.exports=ji()});var Vi=m((dl,qi)=>{"use strict";qi.exports=(r,e,t)=>{let n=i=>Object.defineProperty(r,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get(){let i=t();return n(i),i},set(i){n(i)}}),r}});var Xi=m((pl,Ki)=>{var Za=require("path"),Qa=require("child_process"),{promises:Ye,constants:Yi}=require("fs"),ze=Di(),eu=Jt(),er=Vi(),Ui=Za.join(__dirname,"xdg-open"),{platform:ie,arch:Hi}=process,tu=()=>{try{return Ye.statSync("/run/.containerenv"),!0}catch{return!1}},Qt;function ru(){return Qt===void 0&&(Qt=tu()||eu()),Qt}var nu=(()=>{let r="/mnt/",e;return async function(){if(e)return e;let t="/etc/wsl.conf",n=!1;try{await Ye.access(t,Yi.F_OK),n=!0}catch{}if(!n)return r;let i=await Ye.readFile(t,{encoding:"utf8"}),s=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):r}})(),Gi=async(r,e)=>{let t;for(let n of r)try{return await e(n)}catch(i){t=i}throw t},Ke=async r=>{if(r={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...r},Array.isArray(r.app))return Gi(r.app,u=>Ke({...r,app:u}));let{name:e,arguments:t=[]}=r.app||{};if(t=[...t],Array.isArray(e))return Gi(e,u=>Ke({...r,app:{name:u,arguments:t}}));let n,i=[],s={};if(ie==="darwin")n="open",r.wait&&i.push("--wait-apps"),r.background&&i.push("--background"),r.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(ie==="win32"||ze&&!ru()&&!e){let u=await nu();n=ze?`${u}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),ze||(s.windowsVerbatimArguments=!0);let a=["Start"];r.wait&&a.push("-Wait"),e?(a.push(`"\`"${e}\`""`,"-ArgumentList"),r.target&&t.unshift(r.target)):r.target&&a.push(`"${r.target}"`),t.length>0&&(t=t.map(l=>`"\`"${l}\`""`),a.push(t.join(","))),r.target=Buffer.from(a.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let u=!__dirname||__dirname==="/",a=!1;try{await Ye.access(Ui,Yi.X_OK),a=!0}catch{}n=process.versions.electron||ie==="android"||u||!a?"xdg-open":Ui}t.length>0&&i.push(...t),r.wait||(s.stdio="ignore",s.detached=!0)}r.target&&i.push(r.target),ie==="darwin"&&t.length>0&&i.push("--args",...t);let o=Qa.spawn(n,i,s);return r.wait?new Promise((u,a)=>{o.once("error",a),o.once("close",l=>{if(!r.allowNonzeroExitCode&&l>0){a(new Error(`Exited with code ${l}`));return}u(o)})}):(o.unref(),o)},tr=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a `target`");return Ke({...e,target:r})},iu=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a `name`");let{arguments:t=[]}=e||{};if(t!=null&&!Array.isArray(t))throw new TypeError("Expected `appArguments` as Array type");return Ke({...e,app:{name:r,arguments:t}})};function zi(r){if(typeof r=="string"||Array.isArray(r))return r;let{[Hi]:e}=r;if(!e)throw new Error(`${Hi} is not supported`);return e}function rr({[ie]:r},{wsl:e}){if(e&&ze)return zi(e);if(!r)throw new Error(`${ie} is not supported`);return zi(r)}var Xe={};er(Xe,"chrome",()=>rr({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));er(Xe,"firefox",()=>rr({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));er(Xe,"edge",()=>rr({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));tr.apps=Xe;tr.openApp=iu;Ki.exports=tr});var su={};as(su,{StackUtils:()=>Ji.default,WebSocket:()=>mi,WebSocketServer:()=>$t.default,codeFrameColumns:()=>Zi.codeFrameColumns,open:()=>es.default,program:()=>Ii,sanitize:()=>Qi.default});module.exports=us(su);var Ji=$(lr()),Zi=$(hn());var ya=$(gn(),1),xa=$(St(),1),wa=$(Ot(),1),pi=$(Nt(),1),$t=$(di(),1);var mi=pi.default;var Qi=$(wi());var Li=$($i(),1),{program:Ii,createCommand:el,createArgument:tl,createOption:rl,CommanderError:nl,InvalidArgumentError:il,InvalidOptionArgumentError:sl,Command:ol,Argument:al,Option:ul,Help:ll}=Li.default;var es=$(Xi());0&&(module.exports={StackUtils,WebSocket,WebSocketServer,codeFrameColumns,open,program,sanitize});
32
+ `),this.outputHelp({error:!0}));let n=t||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in y.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,y.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Go(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=a=>{let u=a.attributeName(),o=this.getOptionValue(u),l=this.options.find(f=>f.negate&&u===f.attributeName()),c=this.options.find(f=>!f.negate&&u===f.attributeName());return l&&(l.presetArg===void 0&&o===!1||l.presetArg!==void 0&&o===l.presetArg)?l:c||a},i=a=>{let u=n(a),o=u.attributeName();return this.getOptionValueSource(o)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},s=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let a=s.createHelp().visibleOptions(s).filter(u=>u.long).map(u=>u.long);i=i.concat(a),s=s.parent}while(s&&!s._enablePositionalOptions);t=ki(e,i)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),t=ki(e,i)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let i=this.createOption(t,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
33
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){var i;if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=(i=this.parent)==null?void 0:i._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>Uo(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=W.basename(e,W.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},n;return t.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),t.write=e.write||n,t.command=this,t}outputHelp(e){var s;let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(t&&(i=t(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),(s=this._getHelpOption())!=null&&s.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=y.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
34
+ Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let a;typeof t=="function"?a=t({error:s.error,command:s.command}):a=t,a&&s.write(`${a}
35
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ai(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],n=s[3],i=s[4]),t&&i!=="0"?`${t}=${n}:${parseInt(i)+1}`:e})}Ti.Command=Yt});var $i=m(T=>{var{Argument:Mi}=Ge(),{Command:Kt}=Pi(),{CommanderError:zo,InvalidArgumentError:Ni}=ye(),{Help:Yo}=jt(),{Option:Ri}=Ut();T.program=new Kt;T.createCommand=r=>new Kt(r);T.createOption=(r,e)=>new Ri(r,e);T.createArgument=(r,e)=>new Mi(r,e);T.Command=Kt;T.Option=Ri;T.Argument=Mi;T.Help=Yo;T.CommanderError=zo;T.InvalidArgumentError=Ni;T.InvalidOptionArgumentError=Ni});var Jt=m((hl,Bi)=>{"use strict";var Fi=require("fs"),Xt;function Ko(){try{return Fi.statSync("/.dockerenv"),!0}catch{return!1}}function Xo(){try{return Fi.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Bi.exports=()=>(Xt===void 0&&(Xt=Ko()||Xo()),Xt)});var Di=m((dl,Zt)=>{"use strict";var Jo=require("os"),Zo=require("fs"),Wi=Jt(),ji=()=>{if(process.platform!=="linux")return!1;if(Jo.release().toLowerCase().includes("microsoft"))return!Wi();try{return Zo.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Wi():!1}catch{return!1}};process.env.__IS_WSL_TEST__?Zt.exports=ji:Zt.exports=ji()});var Vi=m((pl,qi)=>{"use strict";qi.exports=(r,e,t)=>{let n=i=>Object.defineProperty(r,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get(){let i=t();return n(i),i},set(i){n(i)}}),r}});var Xi=m((ml,Ki)=>{var Qo=require("path"),eu=require("child_process"),{promises:Ye,constants:Yi}=require("fs"),ze=Di(),tu=Jt(),er=Vi(),Ui=Qo.join(__dirname,"xdg-open"),{platform:ne,arch:Hi}=process,ru=()=>{try{return Ye.statSync("/run/.containerenv"),!0}catch{return!1}},Qt;function nu(){return Qt===void 0&&(Qt=ru()||tu()),Qt}var iu=(()=>{let r="/mnt/",e;return async function(){if(e)return e;let t="/etc/wsl.conf",n=!1;try{await Ye.access(t,Yi.F_OK),n=!0}catch{}if(!n)return r;let i=await Ye.readFile(t,{encoding:"utf8"}),s=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):r}})(),Gi=async(r,e)=>{let t;for(let n of r)try{return await e(n)}catch(i){t=i}throw t},Ke=async r=>{if(r={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...r},Array.isArray(r.app))return Gi(r.app,u=>Ke({...r,app:u}));let{name:e,arguments:t=[]}=r.app||{};if(t=[...t],Array.isArray(e))return Gi(e,u=>Ke({...r,app:{name:u,arguments:t}}));let n,i=[],s={};if(ne==="darwin")n="open",r.wait&&i.push("--wait-apps"),r.background&&i.push("--background"),r.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(ne==="win32"||ze&&!nu()&&!e){let u=await iu();n=ze?`${u}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),ze||(s.windowsVerbatimArguments=!0);let o=["Start"];r.wait&&o.push("-Wait"),e?(o.push(`"\`"${e}\`""`,"-ArgumentList"),r.target&&t.unshift(r.target)):r.target&&o.push(`"${r.target}"`),t.length>0&&(t=t.map(l=>`"\`"${l}\`""`),o.push(t.join(","))),r.target=Buffer.from(o.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let u=!__dirname||__dirname==="/",o=!1;try{await Ye.access(Ui,Yi.X_OK),o=!0}catch{}n=process.versions.electron||ne==="android"||u||!o?"xdg-open":Ui}t.length>0&&i.push(...t),r.wait||(s.stdio="ignore",s.detached=!0)}r.target&&i.push(r.target),ne==="darwin"&&t.length>0&&i.push("--args",...t);let a=eu.spawn(n,i,s);return r.wait?new Promise((u,o)=>{a.once("error",o),a.once("close",l=>{if(!r.allowNonzeroExitCode&&l>0){o(new Error(`Exited with code ${l}`));return}u(a)})}):(a.unref(),a)},tr=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a `target`");return Ke({...e,target:r})},su=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a `name`");let{arguments:t=[]}=e||{};if(t!=null&&!Array.isArray(t))throw new TypeError("Expected `appArguments` as Array type");return Ke({...e,app:{name:r,arguments:t}})};function zi(r){if(typeof r=="string"||Array.isArray(r))return r;let{[Hi]:e}=r;if(!e)throw new Error(`${Hi} is not supported`);return e}function rr({[ne]:r},{wsl:e}){if(e&&ze)return zi(e);if(!r)throw new Error(`${ne} is not supported`);return zi(r)}var Xe={};er(Xe,"chrome",()=>rr({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));er(Xe,"firefox",()=>rr({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));er(Xe,"edge",()=>rr({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));tr.apps=Xe;tr.openApp=su;Ki.exports=tr});var au={};os(au,{StackUtils:()=>Ji.default,WebSocket:()=>mi,WebSocketServer:()=>$t.default,codeFrameColumns:()=>Zi.codeFrameColumns,open:()=>es.default,program:()=>Ii,sanitize:()=>Qi.default});module.exports=us(au);var Ji=R(lr()),Zi=R(hn());var xo=R(gn(),1),wo=R(Et(),1),Eo=R(St(),1),pi=R(Nt(),1),$t=R(di(),1);var mi=pi.default;var Qi=R(wi());var Li=R($i(),1),{program:Ii,createCommand:tl,createArgument:rl,createOption:nl,CommanderError:il,InvalidArgumentError:sl,InvalidOptionArgumentError:al,Command:ol,Argument:ul,Option:ll,Help:cl}=Li.default;var es=R(Xi());0&&(module.exports={StackUtils,WebSocket,WebSocketServer,codeFrameColumns,open,program,sanitize});