mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-19 16:50:12 +01:00
101 lines
209 KiB
JavaScript
101 lines
209 KiB
JavaScript
|
|
"use strict";var Pl=Object.create;var Wt=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var kl=Object.getOwnPropertyNames;var Ml=Object.getPrototypeOf,$l=Object.prototype.hasOwnProperty;var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qs=(t,e)=>{for(var r in e)Wt(t,r,{get:e[r],enumerable:!0})},Xs=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of kl(e))!$l.call(t,s)&&s!==r&&Wt(t,s,{get:()=>e[s],enumerable:!(i=Il(e,s))||i.enumerable});return t};var Et=(t,e,r)=>(r=t!=null?Pl(Ml(t)):{},Xs(e||!t||!t.__esModule?Wt(r,"default",{value:t,enumerable:!0}):r,t)),Hl=t=>Xs(Wt({},"__esModule",{value:!0}),t);var Zs=y((Cp,Ut)=>{Ut.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;Ut.exports.ID_Start=/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u
|
|||
|
|
`?(He++,Fe=0):t?Fe+=t.length:Fe++,t&&(Vt+=t.length),t}var tn={default(){switch(I){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|||
|
|
`:case"\r":case"\u2028":case"\u2029":C();return;case"/":C(),T="comment";return;case void 0:return C(),U("eof")}if(re.isSpaceSeparator(I)){C();return}return tn[fe]()},comment(){switch(I){case"*":C(),T="multiLineComment";return;case"/":C(),T="singleLineComment";return}throw z(C())},multiLineComment(){switch(I){case"*":C(),T="multiLineCommentAsterisk";return;case void 0:throw z(C())}C()},multiLineCommentAsterisk(){switch(I){case"*":C();return;case"/":C(),T="default";return;case void 0:throw z(C())}C(),T="multiLineComment"},singleLineComment(){switch(I){case`
|
|||
|
|
`:case"\r":case"\u2028":case"\u2029":C(),T="default";return;case void 0:return C(),U("eof")}C()},value(){switch(I){case"{":case"[":return U("punctuator",C());case"n":return C(),Ve("ull"),U("null",null);case"t":return C(),Ve("rue"),U("boolean",!0);case"f":return C(),Ve("alse"),U("boolean",!1);case"-":case"+":C()==="-"&&(Le=-1),T="sign";return;case".":L=C(),T="decimalPointLeading";return;case"0":L=C(),T="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":L=C(),T="decimalInteger";return;case"I":return C(),Ve("nfinity"),U("numeric",1/0);case"N":return C(),Ve("aN"),U("numeric",NaN);case'"':case"'":Ct=C()==='"',L="",T="string";return}throw z(C())},identifierNameStartEscape(){if(I!=="u")throw z(C());C();let t=Pr();switch(t){case"$":case"_":break;default:if(!re.isIdStartChar(t))throw en();break}L+=t,T="identifierName"},identifierName(){switch(I){case"$":case"_":case"\u200C":case"\u200D":L+=C();return;case"\\":C(),T="identifierNameEscape";return}if(re.isIdContinueChar(I)){L+=C();return}return U("identifier",L)},identifierNameEscape(){if(I!=="u")throw z(C());C();let t=Pr();switch(t){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!re.isIdContinueChar(t))throw en();break}L+=t,T="identifierName"},sign(){switch(I){case".":L=C(),T="decimalPointLeading";return;case"0":L=C(),T="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":L=C(),T="decimalInteger";return;case"I":return C(),Ve("nfinity"),U("numeric",Le*(1/0));case"N":return C(),Ve("aN"),U("numeric",NaN)}throw z(C())},zero(){switch(I){case".":L+=C(),T="decimalPoint";return;case"e":case"E":L+=C(),T="decimalExponent";return;case"x":case"X":L+=C(),T="hexadecimal";return}return U("numeric",Le*0)},decimalInteger(){switch(I){case".":L+=C(),T="decimalPoint";return;case"e":case"E":L+=C(),T="decimalExponent";return}if(re.isDigit(I)){L+=C();return}return U("numeric",Le*Number(L))},decimalPointLeading(){if(re.isDigit(I)){L+=C(),T="decimalFraction";return}throw z(C())},decimalPoint(){switch(I){case"e":case"E":L+=C(),T="decimalExponent";return}if(re.isDigit(I)){L+=C(),T="decimalFraction";return}return U("numeric",Le*Number(L))},decimalFraction(){switch(I){case"e":case"E":L+=C(),T="decimalExponent";return}if(re.isDigit(I)){L+=C();return}return U("numeric",Le*Number(L))},decimalExponent(){switch(I){case"+":case"-":L+=C(),T="decimalExponentSign";return}if(re.isDigit(I)){L+=C(),T="decimalExponentInteger";return}throw z(C())},decimalExponentSign(){if(re.isDigit(I)){L+=C(),T="decimalExponentInteger";return}throw z(C())},decimalExponentInteger(){if(re.isDigit(I)){L+=C();return}return U("numeric",Le*Number(L))},hexadecimal(){if(re.isHexDigit(I)){L+=C(),T="hexadecimalInteger";return}throw z(C())},hexadecimalInteger(){if(re.isHexDigit(I)){L+=C();return}return U("numeric",Le*Number(L))},string(){switch(I){case"\\":C(),L+=jl();return;case'"':if(Ct)return C(),U("string",L);L+=C();return;case"'":if(!Ct)return C(),U("string",L);L+=C();return;case`
|
|||
|
|
`:case"\r":throw z(C());case"\u2028":case"\u2029":Ul(I);break;case void 0:throw z(C())}L+=C()},start(){switch(I){case"{":case"[":return U("punctuator",C())}T="value"},beforePropertyName(){switch(I){case"$":case"_":L=C(),T="identifierName";return;case"\\":C(),T="identifierNameStartEscape";return;case"}":return U("punctuator",C());case'"':case"'":Ct=C()==='"',T="string";return}if(re.isIdStartChar(I)){L+=C(),T="identifierName";return}throw z(C())},afterPropertyName(){if(I===":")return U("punctuator",C());throw z(C())},beforePropertyValue(){T="value"},afterPropertyValue(){switch(I){case",":case"}":return U("punctuator",C())}throw z(C())},beforeArrayValue(){if(I==="]")return U("punctuator",C());T="value"},afterArrayValue(){switch(I){case",":case"]":return U("punctuator",C())}throw z(C())},end(){throw z(C())}};function U(t,e){return{type:t,value:e,line:He,column:Fe}}function Ve(t){for(let e of t){if(Ne()!==e)throw z(C());C()}}function jl(){switch(Ne()){case"b":return C(),"\b";case"f":return C(),"\f";case"n":return C(),`
|
|||
|
|
`;case"r":return C(),"\r";case"t":return C()," ";case"v":return C(),"\v";case"0":if(C(),re.isDigit(Ne()))throw z(C());return"\0";case"x":return C(),Gl();case"u":return C(),Pr();case`
|
|||
|
|
`:case"\u2028":case"\u2029":return C(),"";case"\r":return C(),Ne()===`
|
|||
|
|
`&&C(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw z(C());case void 0:throw z(C())}return C()}function Gl(){let t="",e=Ne();if(!re.isHexDigit(e)||(t+=C(),e=Ne(),!re.isHexDigit(e)))throw z(C());return t+=C(),String.fromCodePoint(parseInt(t,16))}function Pr(){let t="",e=4;for(;e-- >0;){let r=Ne();if(!re.isHexDigit(r))throw z(C());t+=C()}return String.fromCodePoint(parseInt(t,16))}var Wl={start(){if(ie.type==="eof")throw Ke();Lr()},beforePropertyName(){switch(ie.type){case"identifier":case"string":Ir=ie.value,fe="afterPropertyName";return;case"punctuator":zt();return;case"eof":throw Ke()}},afterPropertyName(){if(ie.type==="eof")throw Ke();fe="beforePropertyValue"},beforePropertyValue(){if(ie.type==="eof")throw Ke();Lr()},beforeArrayValue(){if(ie.type==="eof")throw Ke();if(ie.type==="punctuator"&&ie.value==="]"){zt();return}Lr()},afterPropertyValue(){if(ie.type==="eof")throw Ke();switch(ie.value){case",":fe="beforePropertyName";return;case"}":zt()}},afterArrayValue(){if(ie.type==="eof")throw Ke();switch(ie.value){case",":fe="beforeArrayValue";return;case"]":zt()}},end(){}};function Lr(){let t;switch(ie.type){case"punctuator":switch(ie.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=ie.value;break}if(At===void 0)At=t;else{let e=Te[Te.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,Ir,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")Te.push(t),Array.isArray(t)?fe="beforeArrayValue":fe="beforePropertyName";else{let e=Te[Te.length-1];e==null?fe="end":Array.isArray(e)?fe="afterArrayValue":fe="afterPropertyValue"}}function zt(){Te.pop();let t=Te[Te.length-1];t==null?fe="end":Array.isArray(t)?fe="afterArrayValue":fe="afterPropertyValue"}function z(t){return Kt(t===void 0?`JSON5: invalid end of input at ${He}:${Fe}`:`JSON5: invalid character '${rn(t)}' at ${He}:${Fe}`)}function Ke(){return Kt(`JSON5: invalid end of input at ${He}:${Fe}`)}function en(){return Fe-=5,Kt(`JSON5: invalid identifier character at ${He}:${Fe}`)}function Ul(t){console.warn(`JSON5: '${rn(t)}' in strings is not valid ECMAScript; consider escaping`)}function rn(t){let e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){let r=t.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return t}function Kt(t){let e=new SyntaxError(t);return e.lineNumber=He,e.columnNumber=Fe,e}});var on=y((Fp,un)=>{var kr=Or();un.exports=function(e,r,i){let s=[],n="",u,o,a="",l;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(i=r.space,l=r.quote,r=r.replacer),typeof r=="function")o=r;else if(Array.isArray(r)){u=[];for(let d of r){let v;typeof d=="string"?v=d:(typeof d=="number"||d instanceof String||d instanceof Number)&&(v=String(d)),v!==void 0&&u.indexOf(v)<0&&u.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),a=" ".substr(0,i)):typeof i=="string"&&(a=i.substr(0,10)),c("",{"":e});function c(d,v){let g=v[d];switch(g!=null&&(typeof g.toJSON5=="function"?g=g.toJSON5(d):typeof g.toJSON=="function"&&(g=g.toJSON(d))),o&&(g=o.call(v,d,g)),g instanceof Number?g=Number(g):g instanceof String?g=String(g):g instanceof Boolean&&(g=g.valueOf()),g){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof g=="string")return h(g,!1);if(typeof g=="number")return String(g);if(typeof g=="object")return Array.isArray(g)?D(g):f(g)}function h(d){let v={"'":.1,'"':.2},g={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},w="";for(let B=0;B<d.length;B++){let O=d[B];switch(O){case"'":case'"':v[O]++,w+=O;continue;case"\0":if(kr.isDigit(d[B+1])){w+="\\x00";continue}}if(g[O]){w+=g[O];continue}if(O<" "){let q=O.charCodeAt(0).toString(16);w+="\\x"+("00"+q).substring(q.length);continue}w+=O}let F=l||Object.keys(v).reduce((B
|
|||
|
|
`+n;B=w.join(O),F=`{
|
|||
|
|
`+n+B+`,
|
|||
|
|
`+v+"}"}}return s.pop(),n=v,F}function p(d){if(d.length===0)return h(d,!0);let v=String.fromCodePoint(d.codePointAt(0));if(!kr.isIdStartChar(v))return h(d,!0);for(let g=v.length;g<d.length;g++)if(!kr.isIdContinueChar(String.fromCodePoint(d.codePointAt(g))))return h(d,!0);return d}function D(d){if(s.indexOf(d)>=0)throw TypeError("Converting circular structure to JSON5");s.push(d);let v=n;n=n+a;let g=[];for(let F=0;F<d.length;F++){let B=c(String(F),d);g.push(B!==void 0?B:"null")}let w;if(g.length===0)w="[]";else if(a==="")w="["+g.join(",")+"]";else{let F=`,
|
|||
|
|
`+n,B=g.join(F);w=`[
|
|||
|
|
`+n+B+`,
|
|||
|
|
`+v+"]"}return s.pop(),n=v,w}}});var ln=y((wp,an)=>{var zl=nn(),Vl=on(),Kl={parse:zl,stringify:Vl};an.exports=Kl});var hn=y(Mr=>{var cn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Mr.encode=function(t){if(0<=t&&t<cn.length)return cn[t];throw new TypeError("Must be between 0 and 63: "+t)};Mr.decode=function(t){var e=65,r=90,i=97,s=122,n=48,u=57,o=43,a=47,l=26,c=52;return e<=t&&t<=r?t-e:i<=t&&t<=s?t-i+l:n<=t&&t<=u?t-n+c:t==o?62:t==a?63:-1}});var qr=y(Hr=>{var fn=hn(),$r=5,dn=1<<$r,pn=dn-1,Dn=dn;function Yl(t){return t<0?(-t<<1)+1:(t<<1)+0}function Ql(t){var e=(t&1)===1,r=t>>1;return e?-r:r}Hr.encode=function(e){var r="",i,s=Yl(e);do i=s&pn,s>>>=$r,s>0&&(i|=Dn),r+=fn.encode(i);while(s>0);return r};Hr.decode=function(e,r,i){var s=e.length,n=0,u=0,o,a;do{if(r>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(a=fn.decode(e.charCodeAt(r++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));o=!!(a&Dn),a&=pn,n=n+(a<<u),u+=$r}while(o);i.value=Ql(n),i.rest=r}});var ot=y(ae=>{function Xl(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}ae.getArg=Xl;var gn=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Zl=/^data:.+\,.+$/;function yt(t){var e=t.match(gn);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}ae.urlParse=yt;function nt(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}ae.urlGenerate=nt;function jr(t){var e=t,r=yt(t);if(r){if(!r.path)return t;e=r.path}for(var i=ae.isAbsolute(e),s=e.split(/\/+/),n,u=0,o=s.length-1;o>=0;o--)n=s[o],n==="."?s.splice(o,1):n===".."?u++:u>0&&(n===""?(s.splice(o+1,u),u=0):(s.splice(o,2),u--));return e=s.join("/"),e===""&&(e=i?"/":"."),r?(r.path=e,nt(r)):e}ae.normalize=jr;function mn(t,e){t===""&&(t="."),e===""&&(e=".");var r=yt(e),i=yt(t);if(i&&(t=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),nt(r);if(r||e.match(Zl))return e;if(i&&!i.host&&!i.path)return i.host=e,nt(i);var s=e.charAt(0)==="/"?e:jr(t.replace(/\/+$/,"")+"/"+e);return i?(i.path=s,nt(i)):s}ae.join=mn;ae.isAbsolute=function(t){return t.charAt(0)==="/"||gn.test(t)};function Jl(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var i=t.lastIndexOf("/");if(i<0||(t=t.slice(0,i),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}ae.relative=Jl;var En=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Cn(t){return t}function ec(t){return An(t)?"$"+t:t}ae.toSetString=En?Cn:ec;function tc(t){return An(t)?t.slice(1):t}ae.fromSetString=En?Cn:tc;function An(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function rc(t,e,r){var i=ut(t.source,e.source);return i!==0||(i=t.originalLine-e.originalLine,i!==0)||(i=t.originalColumn-e.originalColumn,i!==0||r)||(i=t.generatedColumn-e.generatedColumn,i!==0)||(i=t.generatedLine-e.generatedLine,i!==0)?i:ut(t.name,e.name)}ae.compareByOriginalPositions=rc;function ic(t,e,r){var i=t.generatedLine-e.generatedLine;return i!==0||(i=t.generatedColumn-e.generatedColumn,i!==0||r)||(i=ut(t.source,e.source),i!==0)||(i=t.originalLine-e.originalLine,i!==0)||(i=t.originalColumn-e.originalColumn,i!==0)?i:ut(t.name,e.name)}ae.compareByGeneratedPositionsDeflated=ic;function ut(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function sc(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=ut(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:ut(t.name,e.name)}ae.compareByGeneratedPositionsInflated=sc;function nc(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}ae.pa
|
|||
|
|
at `+qn(e[o],n)),n.nextPosition=n.curPosition;return n.curPosition=n.nextPosition=null,s+u.reverse().join("")}function jn(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],i=+e[2],s=+e[3],n=Xe[r];if(!n&&Re&&Re.existsSync(r))try{n=Re.readFileSync(r,"utf8")}catch{n=""}if(n){var u=n.split(/(?:\r\n|\r|\n)/)[i-1];if(u)return r+":"+i+`
|
|||
|
|
`+u+`
|
|||
|
|
`+new Array(s).join(" ")+"^"}}return null}function Bc(t){var e=jn(t),r=_c();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),bc(1)}function Rc(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,i=this.listeners(e).length>0;if(r&&!i)return Bc(arguments[1])}return t.apply(this,arguments)}}var Oc=qe.slice(0),Lc=je.slice(0);Ze.wrapCallSite=qn;Ze.getErrorSource=jn;Ze.mapSourcePosition=ni;Ze.retrieveSourceMap=si;Ze.install=function(t){if(t=t||{},t.environment&&(_t=t.environment,["node","browser","auto"].indexOf(_t)===-1))throw new Error("environment "+_t+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(qe.length=0),qe.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(je.length=0),je.unshift(t.retrieveSourceMap)),t.hookRequire&&!ri()){var e=In(ti,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(n,u){return Xe[u]=n,bt[u]=void 0,r.call(this,n,u)},e.prototype._compile.__sourceMapSupport=!0)}if(Jr||(Jr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),kn||(kn=!0,Error.prepareStackTrace=Sc),!Mn){var i="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var s=In(ti,"worker_threads");s.isMainThread===!1&&(i=!1)}catch{}i&&Fc()&&(Mn=!0,Rc())}};Ze.resetRetrieveHandlers=function(){qe.length=0,je.length=0,qe=Oc.slice(0),je=Lc.slice(0),si=er(je),ii=er(qe)}});var Un=y((Ip,Wn)=>{"use strict";var Tc=require("https");Wn.exports=(t,e)=>{e=typeof e=="undefined"?1/0:e;let r=new Map,i=!1,s=!0;return t instanceof Tc.Server?t.on("secureConnection",n):t.on("connection",n),t.on("request",u),t.stop=o,t._pendingSockets=r,t;function n(c){r.set(c,0),c.once("close",()=>r.delete(c))}function u(c,h){r.set(c.socket,r.get(c.socket)+1),h.once("finish",()=>{let f=r.get(c.socket)-1;r.set(c.socket,f),i&&f===0&&c.socket.end()})}function o(c){setImmediate(()=>{i=!0,e<1/0&&setTimeout(l,e).unref(),t.close(h=>{c&&c(h,s)}),r.forEach(a)})}function a(c,h){c===0&&h.end()}function l(){s=!1,r.forEach((c,h)=>h.end()),setImmediate(()=>{r.forEach((c,h)=>h.destroy())})}}});var Yn=y((kp,vt)=>{"use strict";var Nc=typeof process!="undefined"&&process.env.TERM_PROGRAM==="Hyper",Pc=typeof process!="undefined"&&process.platform==="win32",zn=typeof process!="undefined"&&process.platform==="linux",ui={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",question:"?",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},Vn=Object.assign({},ui,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),Kn=Object.assign({},ui,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:zn?"\u25B8":"\u276F",pointerSmall:zn?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});vt.exports=Pc&&!Nc?Vn:Kn;Reflect.defineProperty(vt.exports,"common",{enumerable:!1,value:ui});Reflect.defineProperty(vt.exports,"windows",{enumerable:!1,value:Vn});Reflect.defineProperty(vt.exports,"other",{enumerable:!1,value:Kn})});var _e=y((Mp,oi)=>{"use strict";var Ic=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),kc=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,Mc=()=>typeof process!="undefined"?process.env.FORCE_COLOR!=="0":!1,Qn=()=>{let t={enabled:Mc(),visible:!0,styles:{},keys:{}},e=n=>{let u=n.open=`\x1B[${n.codes[0]}m`,o=n.close=`\x1B[${n.codes[1]}m`,a=n.regex=new RegExp(`\\u001b\\[${n.code
|
|||
|
|
`),l=u.length;for(l>0&&u.includes("unstyle")&&(u=[...new Set(["unstyle",...u])].reverse());l-- >0;)o=r(t.styles[u[l]],o,a);return o},s=(n,u,o)=>{t.styles[n]=e({name:n,codes:u}),(t.keys[o]||(t.keys[o]=[])).push(n),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(l){t.alias(n,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,t),l.stack=this.stack?this.stack.concat(n):[n],l}})};return s("reset",[0,0],"modifier"),s("bold",[1,22],"modifier"),s("dim",[2,22],"modifier"),s("italic",[3,23],"modifier"),s("underline",[4,24],"modifier"),s("inverse",[7,27],"modifier"),s("hidden",[8,28],"modifier"),s("strikethrough",[9,29],"modifier"),s("black",[30,39],"color"),s("red",[31,39],"color"),s("green",[32,39],"color"),s("yellow",[33,39],"color"),s("blue",[34,39],"color"),s("magenta",[35,39],"color"),s("cyan",[36,39],"color"),s("white",[37,39],"color"),s("gray",[90,39],"color"),s("grey",[90,39],"color"),s("bgBlack",[40,49],"bg"),s("bgRed",[41,49],"bg"),s("bgGreen",[42,49],"bg"),s("bgYellow",[43,49],"bg"),s("bgBlue",[44,49],"bg"),s("bgMagenta",[45,49],"bg"),s("bgCyan",[46,49],"bg"),s("bgWhite",[47,49],"bg"),s("blackBright",[90,39],"bright"),s("redBright",[91,39],"bright"),s("greenBright",[92,39],"bright"),s("yellowBright",[93,39],"bright"),s("blueBright",[94,39],"bright"),s("magentaBright",[95,39],"bright"),s("cyanBright",[96,39],"bright"),s("whiteBright",[97,39],"bright"),s("bgBlackBright",[100,49],"bgBright"),s("bgRedBright",[101,49],"bgBright"),s("bgGreenBright",[102,49],"bgBright"),s("bgYellowBright",[103,49],"bgBright"),s("bgBlueBright",[104,49],"bgBright"),s("bgMagentaBright",[105,49],"bgBright"),s("bgCyanBright",[106,49],"bgBright"),s("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=kc,t.hasColor=t.hasAnsi=n=>(t.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&t.ansiRegex.test(n)),t.alias=(n,u)=>{let o=typeof u=="string"?t[u]:u;if(typeof o!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");o.stack||(Reflect.defineProperty(o,"name",{value:n}),t.styles[n]=o,o.stack=[n]),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(a){t.alias(n,a)},get(){let a=l=>i(l,a.stack);return Reflect.setPrototypeOf(a,t),a.stack=this.stack?this.stack.concat(o.stack):o.stack,a}})},t.theme=n=>{if(!Ic(n))throw new TypeError("Expected theme to be an object");for(let u of Object.keys(n))t.alias(u,n[u]);return t},t.alias("unstyle",n=>typeof n=="string"&&n!==""?(t.ansiRegex.lastIndex=0,n.replace(t.ansiRegex,"")):""),t.alias("noop",n=>n),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=Yn(),t.define=s,t};oi.exports=Qn();oi.exports.create=Qn});var le=y(k=>{"use strict";var $c=Object.prototype.toString,Ae=_e(),Xn=!1,ai=[],Zn={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};k.longest=(t,e)=>t.reduce((r,i)=>Math.max(r,e?i[e].length:i.length),0);k.hasColor=t=>!!t&&Ae.hasColor(t);var tr=k.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);k.nativeType=t=>$c.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");k.isAsyncFn=t=>k.nativeType(t)==="asyncfunction";k.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";k.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;k.scrollDown=(t=[])=>[...t.slice(1),t[0]];k.scrollUp=(t=[])=>[t.pop(),...t];k.reorder=(t=[])=>{let e=t.slice();return e.sort((r,i)=>r.index>i.index?1:r.index<i.index?-1:0),e};k.swap=(t,e,r)=>{let i=t.length,s=r===i?0:r<0?i-1:r,n=t[e];t[e]=t[s],t[s]=n};k.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};k.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};k.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:i=`
|
|||
|
|
`+r,width:s=80}=e,n=(i+r).match(/[^\S\n]/g)||[];s-=n.length;let u=`.{1,${s}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,o=t.trim(),a=new RegExp(u,"g"),l=o.match(a)||[];return l=l.map(c=>c.replace(/\n$/,"")),e.padEnd&&(l=l.map(c=>c.padEnd(s," "))),e.padStart&&(l=l.map(c=>c.padStart(s," "))),r+l.join(i)};k.unmute=t=>{let e=t.stack.find(i=>Ae.keys.color.includes(i));return e?Ae[e]:t.stack.find(i=>i.slice(2)==="bg")?Ae[e.slice(2)]:i=>i};k.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";k.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Ae.keys.color.includes(i));if(e){let i=Ae["bg"+k.pascal(e)];return i?i.black:t}let r=t.stack.find(i=>i.slice(0,2)==="bg");return r?Ae[r.slice(2).toLowerCase()]||t:Ae.none};k.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Ae.keys.color.includes(i)),r=t.stack.find(i=>i.slice(0,2)==="bg");if(e&&!r)return Ae[Zn[e]||e];if(r){let i=r.slice(2).toLowerCase(),s=Zn[i];return s&&Ae["bg"+k.pascal(s)]||t}return Ae.none};k.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),i=e>=12?"pm":"am";e=e%12;let s=e===0?12:e,n=r<10?"0"+r:r;return s+":"+n+" "+i};k.set=(t={},e="",r)=>e.split(".").reduce((i,s,n,u)=>{let o=u.length-1>n?i[s]||{}:r;return!k.isObject(o)&&n<u.length-1&&(o={}),i[s]=o},t);k.get=(t={},e="",r)=>{let i=t[e]==null?e.split(".").reduce((s,n)=>s&&s[n],t):t[e];return i==null?r:i};k.mixin=(t,e)=>{if(!tr(t))return e;if(!tr(e))return t;for(let r of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&tr(i.value)){let s=Object.getOwnPropertyDescriptor(t,r);tr(s.value)?t[r]=k.merge({},t[r],e[r]):Reflect.defineProperty(t,r,i)}else Reflect.defineProperty(t,r,i);else Reflect.defineProperty(t,r,i)}return t};k.merge=(...t)=>{let e={};for(let r of t)k.mixin(e,r);return e};k.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let i of Object.keys(r)){let s=r[i];typeof s=="function"?k.define(t,i,s.bind(e)):k.define(t,i,s)}};k.onExit=t=>{let e=(r,i)=>{Xn||(Xn=!0,ai.forEach(s=>s()),r===!0&&process.exit(128+i))};ai.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),ai.push(t)};k.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};k.defineExport=(t,e,r)=>{let i;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(s){i=s},get(){return i?i():r()}})}});var Jn=y(ct=>{"use strict";ct.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};ct.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};ct.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};ct.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};ct.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var ru=y((qp,tu)=>{"use strict";var eu=require("readline"),Hc=Jn(),qc=/^(?:\x1b)([a-zA-Z0-9])$/,jc=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,Gc={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"d
|
|||
|
|
`)i.name="enter";else if(t===" ")i.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x1B\x7F"||t==="\x1B\b")i.name="backspace",i.meta=t.charAt(0)==="\x1B";else if(t==="\x1B"||t==="\x1B\x1B")i.name="escape",i.meta=t.length===2;else if(t===" "||t==="\x1B ")i.name="space",i.meta=t.length===2;else if(t<="")i.name=String.fromCharCode(t.charCodeAt(0)+97-1),i.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")i.name="number";else if(t.length===1&&t>="a"&&t<="z")i.name=t;else if(t.length===1&&t>="A"&&t<="Z")i.name=t.toLowerCase(),i.shift=!0;else if(r=qc.exec(t))i.meta=!0,i.shift=/^[A-Z]$/.test(r[1]);else if(r=jc.exec(t)){let s=[...t];s[0]==="\x1B"&&s[1]==="\x1B"&&(i.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),u=(r[3]||r[5]||1)-1;i.ctrl=!!(u&4),i.meta=!!(u&10),i.shift=!!(u&1),i.code=n,i.name=Gc[n],i.shift=Wc(n)||i.shift,i.ctrl=Uc(n)||i.ctrl}return i};rr.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let i=eu.createInterface({terminal:!0,input:r});eu.emitKeypressEvents(r,i);let s=(o,a)=>e(o,rr(o,a),i),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",s),i.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener("keypress",s),i.pause(),i.close()}};rr.action=(t,e,r)=>{let i={...Hc,...r};return e.ctrl?(e.action=i.ctrl[e.name],e):e.option&&i.option?(e.action=i.option[e.name],e):e.shift?(e.action=i.shift[e.name],e):(e.action=i.keys[e.name],e)};tu.exports=rr});var su=y((jp,iu)=>{"use strict";iu.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(e)for(let r of Object.keys(e)){let i=e[r];typeof i=="number"&&(i={interval:i}),zc(t,r,i)}};function zc(t,e,r={}){let i=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},s=r.interval||120;i.frames=r.frames||[],i.loading=!0;let n=setInterval(()=>{i.ms=Date.now()-i.start,i.tick++,t.render()},s);return i.stop=()=>{i.loading=!1,clearInterval(n)},Reflect.defineProperty(i,"interval",{value:n}),t.once("close",()=>i.stop()),i.stop}});var uu=y((Gp,nu)=>{"use strict";var{define:Vc,width:Kc}=le(),li=class{constructor(e){let r=e.options;Vc(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=Kc(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r=="function"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};nu.exports=li});var au=y((Wp,ou)=>{"use strict";var ci=le(),oe=_e(),hi={default:oe.noop,noop:oe.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||ci.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||ci.complement(this.primary)},primary:oe.cyan,success:oe.green,danger:oe.magenta,strong:oe.bold,warning:oe.yellow,muted:oe.dim,disabled:oe.gray,dark:oe.dim.gray,underline:oe.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set plac
|
|||
|
|
`),l=a[0],c=a[a.length-1],f=(i+(r?" "+r:"")).length,p=f<l.length?l.slice(f+1):"";return{header:u,prompt:l,after:p,rest:a.slice(1),last:c}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`
|
|||
|
|
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
|
|||
|
|
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(et.cursor.down(e.rest.length)),this.write(`
|
|||
|
|
`.repeat(r))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=mi.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let s=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await s(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,i){let{options:s,state:n,symbols:u,timers:o}=this,a=o&&o[e];n.timer=a;let l=s[e]||n[e]||u[e],c=r&&r[e]!=null?r[e]:await l;if(c==="")return c;let h=await this.resolve(c,n,r,i);return!h&&r&&r[e]?this.resolve(l,n,r,i):h}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,i=this.state;return i.timer=r,de.isObject(e)&&(e=e[i.status]||e.pending),de.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return de.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,i=this.state;i.timer=r;let s=e[i.status]||e.pending||i.separator,n=await this.resolve(s,i);return de.isObject(n)&&(n=n[i.status]||n.pending),de.hasColor(n)?n:this.styles.muted(n)}async pointer(e,r){let i=await this.element("pointer",e,r);if(typeof i=="string"&&de.hasColor(i))return i;if(i){let s=this.styles,n=this.index===r,u=n?s.primary:l=>l,o=await this.resolve(i[n?"on":"off"]||i,this.state),a=de.hasColor(o)?o:u(o);return n?a:" ".repeat(o.length)}}async indicator(e,r){let i=await this.element("indicator",e,r);if(typeof i=="string"&&de.hasColor(i))return i;if(i){let s=this.styles,n=e.enabled===!0,u=n?s.success:s.dark,o=i[n?"on":"off"]||i;return de.hasColor(o)?o:u(o)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return de.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...r){return de.resolve(this,e,...r)}get base(){return t.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||de.height(this.stdout,25)}get width(){return this.options.columns||de.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,i=[r,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function sh(t){let e=s=>t[s]===void 0||typeof t[s]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let s of Object.keys(t.options)){if(r.includes(s)||/^on[A-Z]/.test(s))continue;let n=t.options[s];typeof n=="function"&&e(s)?i.includes(s)||(t[s]=n.bind(t)):typeof t[s]!="function"&&(t[s]=n)}}function nh(t){type
|
|||
|
|
`:" ",i=[];for(let s=0;s<4;s++){let n=r(s);e[s]?i.push(n.repeat(e[s])):i.push("")}return i}Cu.exports=Ei});var Fu=y((Kp,yu)=>{"use strict";var uh=le(),Au={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return Au.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};yu.exports=(t,e={})=>{let r=uh.merge({},Au,e.roles);return r[t]||r.default}});var xt=y((Yp,bu)=>{"use strict";var oh=_e(),ah=ht(),lh=Fu(),ir=le(),{reorder:Ci,scrollUp:ch,scrollDown:hh,isObject:wu,swap:fh}=ir,Ai=class extends ah{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:i,suggest:s}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof s!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");wu(r)&&(r=Object.keys(r)),Array.isArray(r)?(i!=null&&(this.index=this.findIndex(i)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(i!=null&&(r=i),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let i=[],s=0,n=async(u,o)=>{typeof u=="function"&&(u=await u.call(this)),u instanceof Promise&&(u=await u);for(let a=0;a<u.length;a++){let l=u[a]=await this.toChoice(u[a],s++,o);i.push(l),l.choices&&await n(l.choices,l)}return i};return n(e,r).then(u=>(this.state.loadingChoices=!1,u))}async toChoice(e,r,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let s=e.value;if(e=lh(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=r,e.cursor=0,ir.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+" ":e.indent||""),e.path=i?i.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,oh.unstyle(e.message).length));let u={...e};return e.reset=(o=u.input,a=u.value)=>{for(let l of Object.keys(u))e[l]=u[l];e.input=o,e.value=a},s==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,i){let s=await this.toChoice(e,r,i);return this.choices.push(s),this.index=this.choices.length-1,this.limit=this.choices.length,s}async newItem(e,r,i){let s={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(s,r,i);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(this.multiple&&this[r.name]
|
|||
|
|
`),s;return this.options.choicesHeader&&(s=await this.resolve(this.options.choicesHeader,this.state)),[s,i].filter(Boolean).join(`
|
|||
|
|
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,i="",s=await this.header(),n=await this.prefix(),u=await this.separator(),o=await this.message();this.options.promptLine!==!1&&(i=[n,o,u,""].join(" "),this.state.prompt=i);let a=await this.format(),l=await this.error()||await this.hint(),c=await this.renderChoices(),h=await this.footer();a&&(i+=a),l&&!i.includes(l)&&(i+=" "+l),e&&!a&&!c.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(r),this.write([s,i,c,h].filter(Boolean).join(`
|
|||
|
|
`)),this.write(this.margin[2]),this.restore()}};vu.exports=Fi});var Su=y((Xp,xu)=>{"use strict";var ph=We(),Dh=(t,e)=>{let r=t.toLowerCase();return i=>{let n=i.toLowerCase().indexOf(r),u=e(i.slice(n,n+r.length));return n>=0?i.slice(0,n)+u+i.slice(n+r.length):i}},wi=class extends ph{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:i}=this.state;return this.input=i.slice(0,r)+e+i.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let i=e.toLowerCase();return r.filter(s=>s.message.toLowerCase().includes(i))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=Dh(this.input,e),i=this.choices;this.choices=i.map(s=>({...s,message:r(s.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};xu.exports=wi});var bi=y((Zp,Bu)=>{"use strict";var _i=le();Bu.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:i="",pos:s,showCursor:n=!0,color:u}=e,o=u||t.styles.placeholder,a=_i.inverse(t.styles.primary),l=d=>a(t.styles.black(d)),c=r,h=" ",f=l(h);if(t.blink&&t.blink.off===!0&&(l=d=>d,f=""),n&&s===0&&i===""&&r==="")return l(h);if(n&&s===0&&(r===i||r===""))return l(i[0])+o(i.slice(1));i=_i.isPrimitive(i)?`${i}`:"",r=_i.isPrimitive(r)?`${r}`:"";let p=i&&i.startsWith(r)&&i!==r,D=p?l(i[r.length]):f;if(s!==r.length&&n===!0&&(c=r.slice(0,s)+l(r[s])+r.slice(s+1),D=""),n===!1&&(D=""),p){let d=t.styles.unstyle(c+D);return c+D+o(i.slice(d.length))}return c+D}});var sr=y((Jp,Ru)=>{"use strict";var gh=_e(),mh=We(),Eh=bi(),vi=class extends mh{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:i,input:s}=r;return r.value=r.input=s.slice(0,i)+e+s.slice(i),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:i}=e;return e.value=e.input=i.slice(0,r-1)+i.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:i}=e;if(i[r]===void 0)return this.alert();let s=`${i}`.slice(0,r)+`${i}`.slice(r+1);return e.value=e.input=s,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:i}=e;return r&&r.startsWith(i)&&i!==r?(e.value=e.inp
|
|||
|
|
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};Iu.exports=Si});var Mu=y((iD,ku)=>{"use strict";var vh=nr(),Bi=class extends vh{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};ku.exports=Bi});var Hu=y((sD,$u)=>{"use strict";var xh=We(),Sh=sr(),ft=Sh.prototype,Ri=class extends xh{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let i=this.focused,s=i.parent||{};return!i.editable&&!s.editable&&(e==="a"||e==="i")?super[e]():ft.dispatch.call(this,e,r)}append(e,r){return ft.append.call(this,e,r)}delete(e,r){return ft.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?ft.next.call(this):super.next()}prev(){return this.focused.editable?ft.prev.call(this):super.prev()}async indicator(e,r){let i=e.indicator||"",s=e.editable?i:super.indicator(e,r);return await this.resolve(s,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?ft.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let i=r.parent?this.value[r.parent.name]:this.value;if(r.editable?i=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(i=r.enabled===!0),e=await r.validate(i,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};$u.exports=Ri});var tt=y((nD,qu)=>{"use strict";var Bh=ht(),Rh=bi(),{isPrimitive:Oh}=le(),Oi=class extends Bh{constructor(e){super(e),this.initial=Oh(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let i=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!i||i.name!=="return")?this.append(`
|
|||
|
|
`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:i}=this.state;this.input=`${i}`.slice(0,r)+e+`${i}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),i=this.input.slice(e),s=r.split(" ");this.state.clipboard.push(s.pop()),this.input=s.join(" "),this.cursor=this.input.length,this.input+=i,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):Rh(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),i=await this.separator(),s=await this.message(),n=[r,s,i].filter(Boolean).join(" ");this.state.prompt=n;let u=await this.header(),o=await this.format(),a=await this.error()||await this.hint(),l=await this.footer();a&&!o.includes(a)&&(o+=" "+a),n+=" "+o,this.clear(e),this.write([u,n,l].filter(Boolean).join(`
|
|||
|
|
`)),this.restore()}};qu.exports=Oi});var Gu=y((uD,ju)=>{"use strict";var Lh=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),ur=t=>Lh(t).filter(Boolean);ju.exports=(t,e={},r="")=>{let{past:i=[],present:s=""}=e,n,u;switch(t){case"prev":case"undo":return n=i.slice(0,i.length-1),u=i[i.length-1]||"",{past:ur([r,...n]),present:u};case"next":case"redo":return n=i.slice(1),u=i[0]||"",{past:ur([...n,r]),present:u};case"save":return{past:ur([...i,r]),present:""};case"remove":return u=ur(i.filter(o=>o!==r)),s="",u.length&&(s=u.pop()),{past:u,present:s};default:throw new Error(`Invalid action: "${t}"`)}}});var Ti=y((oD,Uu)=>{"use strict";var Th=tt(),Wu=Gu(),Li=class extends Th{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let i=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Wu(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=Wu("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Uu.exports=Li});var Vu=y((aD,zu)=>{"use strict";var Nh=tt(),Ni=class extends Nh{format(){return""}};zu.exports=Ni});var Yu=y((lD,Ku)=>{"use strict";var Ph=tt(),Pi=class extends Ph{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};Ku.exports=Pi});var Xu=y((cD,Qu)=>{"use strict";var Ih=We(),Ii=class extends Ih{constructor(e){super({...e,multiple:!0})}};Qu.exports=Ii});var Mi=y((hD,Zu)=>{"use strict";var kh=tt(),ki=class extends kh{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,i=this.toNumber(this.input);return i>this.max+r?this.alert():(this.input=`${i+r}`,this.render())}down(e){let r=e||this.minor,i=this.toNumber(this.input);return i<this.min-r?this.alert():(this.input=`${i-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};Zu.exports=ki});var eo=y((fD,Ju)=>{Ju.exports=Mi()});var ro=y((dD,to)=>{"use strict";var Mh=tt(),$i=class extends Mh{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};to.exports=$i});var no=y((pD,so)=>{"use strict";var $h=_e(),Hh=xt(),io=le(),Hi=class extends Hh{constr
|
|||
|
|
`;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,s)=>({name:s+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let i=0;i<this.scale.length;i++)r.scale.push({index:i})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,i){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(i=>` ${i.name} - ${i.message}`)].map(i=>this.styles.muted(i)).join(`
|
|||
|
|
`)}renderScaleHeading(e){let r=this.scale.map(a=>a.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-r.join("").length,s=Math.round(i/(r.length-1)),u=r.map(a=>this.styles.strong(a)).join(" ".repeat(s)),o=" ".repeat(this.widths[0]);return this.margin[3]+o+this.margin[1]+u}scaleIndicator(e,r,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,i);let s=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):s?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let i=e.scale.map(n=>this.scaleIndicator(e,n,r)),s=this.term==="Hyper"?"":" ";return i.join(s+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,s=await this.pointer(e,r),n=await e.hint;n&&!io.hasColor(n)&&(n=this.styles.muted(n));let u=D=>this.margin[3]+D.replace(/\s+$/,"").padEnd(this.widths[0]," "),o=this.newline,a=this.indent(e),l=await this.resolve(e.message,this.state,e,r),c=await this.renderScale(e,r),h=this.margin[1]+this.margin[3];this.scaleLength=$h.unstyle(c).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-h.length);let p=io.wordWrap(l,{width:this.widths[0],newline:o}).split(`
|
|||
|
|
`).map(D=>u(D)+this.margin[1]);return i&&(c=this.styles.info(c),p=p.map(D=>this.styles.info(D))),p[0]+=c,this.linebreak&&p.push(""),[a+s,p.join(`
|
|||
|
|
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(s,n)=>await this.renderChoice(s,n)),r=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...r.map(s=>s.join(" "))].join(`
|
|||
|
|
`)}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),s=await this.separator(),n=await this.message(),u="";this.options.promptLine!==!1&&(u=[i,n,s,""].join(" "),this.state.prompt=u);let o=await this.header(),a=await this.format(),l=await this.renderScaleKey(),c=await this.error()||await this.hint(),h=await this.renderChoices(),f=await this.footer(),p=this.emptyError;a&&(u+=a),c&&!u.includes(c)&&(u+=" "+c),e&&!a&&!h.trim()&&this.multiple&&p!=null&&(u+=this.styles.danger(p)),this.clear(r),this.write([o,u,l,h,f].filter(Boolean).join(`
|
|||
|
|
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};so.exports=Hi});var ao=y((DD,oo)=>{"use strict";var uo=_e(),qh=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",ji=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=qh(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},jh=async(t={},e={},r=i=>i)=>{let i=new Set,s=t.fields||[],n=t.template,u=[],o=[],a=[],l=1;typeof n=="function"&&(n=await n());let c=-1,h=()=>n[++c],f=()=>n[c+1],p=D=>{D.line=l,u.push(D)};for(p({type:"bos",value:""});c<n.length-1;){let D=h();if(/^[^\S\n ]$/.test(D)){p({type:"text",value:D});continue}if(D===`
|
|||
|
|
`){p({type:"newline",value:D}),l++;continue}if(D==="\\"){D+=h(),p({type:"text",value:D});continue}if((D==="$"||D==="#"||D==="{")&&f()==="{"){let v=h();D+=v;let g={type:"template",open:D,inner:"",close:"",value:D},w;for(;w=h();){if(w==="}"){f()==="}"&&(w+=h()),g.value+=w,g.close=w;break}w===":"?(g.initial="",g.key=g.inner):g.initial!==void 0&&(g.initial+=w),g.value+=w,g.inner+=w}g.template=g.open+(g.initial||g.inner)+g.close,g.key=g.key||g.inner,e.hasOwnProperty(g.key)&&(g.initial=e[g.key]),g=r(g),p(g),a.push(g.key),i.add(g.key);let F=o.find(B=>B.name===g.key);g.field=s.find(B=>B.name===g.key),F||(F=new ji(g),o.push(F)),F.lines.push(g.line-1);continue}let d=u[u.length-1];d.type==="text"&&d.line===l?d.value+=D:p({type:"text",value:D})}return p({type:"eos",value:""}),{input:n,tabstops:u,unique:i,keys:a,items:o}};oo.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),i={...e.values,...e.initial},{tabstops:s,items:n,keys:u}=await jh(e,i),o=qi("result",t,e),a=qi("format",t,e),l=qi("validate",t,e,!0),c=t.isValue.bind(t);return async(h={},f=!1)=>{let p=0;h.required=r,h.items=n,h.keys=u,h.output="";let D=async(w,F,B,O)=>{let q=await l(w,F,B,O);return q===!1?"Invalid field "+B.name:q};for(let w of s){let F=w.value,B=w.key;if(w.type!=="template"){F&&(h.output+=F);continue}if(w.type==="template"){let O=n.find(j=>j.name===B);e.required===!0&&h.required.add(O.name);let q=[O.input,h.values[O.value],O.value,F].find(c),R=(O.field||{}).message||w.inner;if(f){let j=await D(h.values[B],h,O,p);if(j&&typeof j=="string"||j===!1){h.invalid.set(B,j);continue}h.invalid.delete(B);let A=await o(h.values[B],h,O,p);h.output+=uo.unstyle(A);continue}O.placeholder=!1;let M=F;F=await a(F,h,O,p),q!==F?(h.values[B]=q,F=t.styles.typing(q),h.missing.delete(R)):(h.values[B]=void 0,q=`<${R}>`,F=t.styles.primary(q),O.placeholder=!0,h.required.has(B)&&h.missing.add(R)),h.missing.has(R)&&h.validating&&(F=t.styles.warning(q)),h.invalid.has(B)&&h.validating&&(F=t.styles.danger(q)),p===h.index&&(M!==F?F=t.styles.underline(F):F=t.styles.heading(uo.unstyle(F))),p++}F&&(h.output+=F)}let d=h.output.split(`
|
|||
|
|
`).map(w=>" "+w),v=n.length,g=0;for(let w of n)h.invalid.has(w.name)&&w.lines.forEach(F=>{d[F][0]===" "&&(d[F]=h.styles.danger(h.symbols.bullet)+d[F].slice(1))}),t.isValue(h.values[w.name])&&g++;return h.completed=(g/v*100).toFixed(0),h.output=d.join(`
|
|||
|
|
`),h.output}};function qi(t,e,r,i){return(s,n,u,o)=>typeof u.field[t]=="function"?u.field[t].call(e,s,n,u,o):[i,s].find(a=>e.isValue(a))}});var co=y((gD,lo)=>{"use strict";var Gh=_e(),Wh=ao(),Uh=ht(),Gi=class extends Uh{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Wh(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let i=this.getItem(),s=i.input.slice(0,this.cursor),n=i.input.slice(this.cursor);this.input=i.input=`${s}${e}${n}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:i,size:s}=this.state,n=[this.options.newline,`
|
|||
|
|
`].find(w=>w!=null),u=await this.prefix(),o=await this.separator(),a=await this.message(),l=[u,a,o].filter(Boolean).join(" ");this.state.prompt=l;let c=await this.header(),h=await this.error()||"",f=await this.hint()||"",p=i?"":await this.interpolate(this.state),D=this.state.key=r[e]||"",d=await this.format(D),v=await this.footer();d&&(l+=" "+d),f&&!d&&this.state.completed===0&&(l+=" "+f),this.clear(s);let g=[c,l,p,v,h.trim()];this.write(g.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:r,keys:i,index:s}=this.state,n=r.find(u=>u.name===i[s]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:i,values:s}=this.state;if(e.size){let o="";for(let[a,l]of e)o+=`Invalid ${a}: ${l}
|
|||
|
|
`;return this.state.error=o,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let u=Gh.unstyle(i).split(`
|
|||
|
|
`).map(o=>o.slice(1)).join(`
|
|||
|
|
`);return this.value={values:s,result:u},super.submit()}};lo.exports=Gi});var fo=y((mD,ho)=>{"use strict";var zh="(Use <shift>+<up/down> to sort)",Vh=We(),Wi=class extends Vh{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,zh].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let i=await super.renderChoice(e,r),s=this.symbols.identicalTo+" ",n=this.index===r&&this.sorting?this.styles.muted(s):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${r+1} - `+i:n+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};ho.exports=Wi});var Do=y((ED,po)=>{"use strict";var Kh=xt(),Ui=class extends Kh{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(i=>this.styles.muted(i)),this.state.header=r.join(`
|
|||
|
|
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let i of r)i.scale=Yh(5,this.options),i.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],i=r.selected;return e.scale.forEach(s=>s.selected=!1),r.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,s=this.term==="Hyper",n=s?9:8,u=s?"":" ",o=this.symbols.line.repeat(n),a=" ".repeat(n+(s?0:1)),l=F=>(F?this.styles.success("\u25C9"):"\u25EF")+u,c=r+1+".",h=i?this.styles.heading:this.styles.noop,f=await this.resolve(e.message,this.state,e,r),p=this.indent(e),D=p+e.scale.map((F,B)=>l(B===e.scaleIdx)).join(o),d=F=>F===e.scaleIdx?h(F):F,v=p+e.scale.map((F,B)=>d(B)).join(a),g=()=>[c,f].filter(Boolean).join(" "),w=()=>[g(),D,v," "].filter(Boolean).join(`
|
|||
|
|
`);return i&&(D=this.styles.cyan(D),v=this.styles.cyan(v)),w()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,s)=>await this.renderChoice(i,s)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
|
|||
|
|
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),s=await this.separator(),n=await this.message(),u=[i,n,s].filter(Boolean).join(" ");this.state.prompt=u;let o=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.renderChoices(),h=await this.footer();(a||!l)&&(u+=" "+a),l&&!u.includes(l)&&(u+=" "+l),e&&!a&&!c&&this.multiple&&this.type!=="form"&&(u+=this.styles.danger(this.emptyError)),this.clear(r),this.write([u,o,c,h].filter(Boolean).join(`
|
|||
|
|
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function Yh(t,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>({...i}));let r=[];for(let i=1;i<t+1;i++)r.push({i,selected:!1});return r}po.exports=Ui});var mo=y((CD,go)=>{go.exports=Ti()});var Co=y((AD,Eo)=>{"use strict";var Qh=nr(),zi=class extends Qh{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",r){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=i=>this.styles.primary.underline(i);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,r=await this.header(),i=await this.prefix(),s=await this.separator(),n=await this.message(),u=await this.format(),o=await this.error()||await this.hint(),a=await this.footer(),l=[i,n,s,u].join(" ");this.state.prompt=l,o&&!l.includes(o)&&(l+=" "+o),this.clear(e),this.write([r,l,a].filter(Boolean).join(`
|
|||
|
|
`)),this.write(this.margin[2]),this.restore()}};Eo.exports=zi});var yo=y((yD,Ao)=>{"use strict";var Xh=We(),Vi=class extends Xh{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,r){let i=await super.toChoices(e,r);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Ao.exports=Vi});var wo=y(Ki=>{"use strict";var Fo=le(),ee=(t,e)=>{Fo.defineExport(Ki,t,e),Fo.defineExport(Ki,t.toLowerCase(),e)};ee("AutoComplete",()=>Su());ee("BasicAuth",()=>Pu());ee("Confirm",()=>Mu());ee("Editable",()=>Hu());ee("Form",()=>sr());ee("Input",()=>Ti());ee("Invisible",()=>Vu());ee("List",()=>Yu());ee("MultiSelect",()=>Xu());ee("Numeral",()=>eo());ee("Password",()=>ro());ee("Scale",()=>no());ee("Select",()=>We());ee("Snippet",()=>co());ee("Sort",()=>fo());ee("Survey",()=>Do());ee("Text",()=>mo());ee("Toggle",()=>Co());ee("Quiz",()=>yo())});var bo=y((wD,_o)=>{_o.exports={ArrayPrompt:xt(),AuthPrompt:xi(),BooleanPrompt:nr(),NumberPrompt:Mi(),StringPrompt:tt()}});var So=y((_D,xo)=>{"use strict";var vo=require("assert"),Qi=require("events"),Ue=le(),ve=class extends Qi{constructor(e,r){super(),this.options=Ue.merge({},e),this.answers={...r}}register(e,r){if(Ue.isObject(e)){for(let s of Object.keys(e))this.register(s,e[s]);return this}vo.equal(typeof r,"function","expected a function");let i=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[i]=r:this.prompts[i]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(Ue.merge({},this.options,r))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=Ue.merge({},this.options,e),{type:i,name:s}=e,{set:n,get:u}=Ue;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[s];vo(this.prompts[i],`Prompt "${i}" is not registered`);let o=new this.prompts[i](r),a=u(this.answers,s);o.state.answers=this.answers,o.enquirer=this,s&&o.on("submit",c=>{this.emit("answer",s,c,o),n(this.answers,s,c)});let l=o.emit.bind(o);return o.emit=(...c)=>(this.emit.call(this,...c),l(...c)),this.emit("prompt",o,this),r.autofill&&a!=null?(o.value=o.input=a,r.autofill==="show"&&await o.submit()):a=o.value=await o.run(),a}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||ht()}static get prompts(){return wo()}static get types(){return bo()}static get prompt(){let e=(r,...i)=>{let s=new this(...i),n=s.emit.bind(s);return s.emit=(...u)=>(e.emit(...u),n(...u)),s.prompt(r)};return Ue.mixinEmitter(e,new Qi),e}};Ue.mixinEmitter(ve,new Qi);var Yi=ve.prompts;for(let t of Object.keys(Yi)){let e=t.toLowerCase(),r=i=>new Yi[t](i).run();ve.prompt[e]=r,ve[e]=r,ve[t]||Reflect.defineProperty(ve,t,{get:()=>Yi[t]})}var St=t=>{Ue.defineExport(ve,t,()=>ve.types[t])};St("ArrayPrompt");St("AuthPrompt");St("BooleanPrompt");St("NumberPrompt");St("StringPrompt");xo.exports=ve});var Bt=y((bD,To)=>{"use strict";var Zh=require("path"),Oe="\\\\/",Bo=`[^${Oe}]`,ke="\\.",Jh="\\+",ef="\\?",or="\\/",tf="(?=.)",Ro="[^/]",Xi=`(?:${or}|$)`,Oo=`(?:^|${or})`,Zi=`${ke}{1,2}${Xi}`,rf=`(?!${ke})`,sf=`(?!${Oo}${Zi})`,nf=`(?!${ke}{0,1}${Xi})`,uf=`(?!${Zi})`,of=`[^.${or}]`,af=`${Ro}*?`,Lo={DOT_LITERAL:ke,PLUS_LITERAL:Jh,QMARK_LITERAL:ef,SLASH_LITERAL:or,ONE_CHAR:tf,QMARK:Ro,END_ANCHOR:Xi,DOTS_SLASH:Zi,NO_DOT:rf,NO_DOTS:sf,NO_DOT_SLASH:nf,NO_DOTS_SLASH:uf,QMARK_NO_DOT:of,STAR:af,STAR
|
|||
|
|
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Va=y((WD,za)=>{"use strict";var y0=gr(),{MAX_LENGTH:Ga,CHAR_BACKSLASH:Es,CHAR_BACKTICK:F0,CHAR_COMMA:w0,CHAR_DOT:_0,CHAR_LEFT_PARENTHESES:b0,CHAR_RIGHT_PARENTHESES:v0,CHAR_LEFT_CURLY_BRACE:x0,CHAR_RIGHT_CURLY_BRACE:S0,CHAR_LEFT_SQUARE_BRACKET:Wa,CHAR_RIGHT_SQUARE_BRACKET:Ua,CHAR_DOUBLE_QUOTE:B0,CHAR_SINGLE_QUOTE:R0,CHAR_NO_BREAK_SPACE:O0,CHAR_ZERO_WIDTH_NOBREAK_SPACE:L0}=ja(),T0=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},i=typeof r.maxLength=="number"?Math.min(Ga,r.maxLength):Ga;if(t.length>i)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${i})`);let s={type:"root",input:t,nodes:[]},n=[s],u=s,o=s,a=0,l=t.length,c=0,h=0,f,p=()=>t[c++],D=d=>{if(d.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&d.type==="text"){o.value+=d.value;return}return u.nodes.push(d),d.parent=u,d.prev=o,o=d,d};for(D({type:"bos"});c<l;)if(u=n[n.length-1],f=p(),!(f===L0||f===O0)){if(f===Es){D({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===Ua){D({type:"text",value:"\\"+f});continue}if(f===Wa){a++;let d;for(;c<l&&(d=p());){if(f+=d,d===Wa){a++;continue}if(d===Es){f+=p();continue}if(d===Ua&&(a--,a===0))break}D({type:"text",value:f});continue}if(f===b0){u=D({type:"paren",nodes:[]}),n.push(u),D({type:"text",value:f});continue}if(f===v0){if(u.type!=="paren"){D({type:"text",value:f});continue}u=n.pop(),D({type:"text",value:f}),u=n[n.length-1];continue}if(f===B0||f===R0||f===F0){let d=f,v;for(e.keepQuotes!==!0&&(f="");c<l&&(v=p());){if(v===Es){f+=v+p();continue}if(v===d){e.keepQuotes===!0&&(f+=v);break}f+=v}D({type:"text",value:f});continue}if(f===x0){h++;let v={type:"brace",open:!0,close:!1,dollar:o.value&&o.value.slice(-1)==="$"||u.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};u=D(v),n.push(u),D({type:"open",value:f});continue}if(f===S0){if(u.type!=="brace"){D({type:"text",value:f});continue}let d="close";u=n.pop(),u.close=!0,D({type:d,value:f}),h--,u=n[n.length-1];continue}if(f===w0&&h>0){if(u.ranges>0){u.ranges=0;let d=u.nodes.shift();u.nodes=[d,{type:"text",value:y0(u)}]}D({type:"comma",value:f}),u.commas++;continue}if(f===_0&&h>0&&u.commas===0){let d=u.nodes;if(h===0||d.length===0){D({type:"text",value:f});continue}if(o.type==="dot"){if(u.range=[],o.value+=f,o.type="range",u.nodes.length!==3&&u.nodes.length!==5){u.invalid=!0,u.ranges=0,o.type="text";continue}u.ranges++,u.args=[];continue}if(o.type==="range"){d.pop();let v=d[d.length-1];v.value+=o.value+f,o=v,u.ranges--;continue}D({type:"dot",value:f});continue}D({type:"text",value:f})}do if(u=n.pop(),u.type!=="root"){u.nodes.forEach(g=>{g.nodes||(g.type==="open"&&(g.isOpen=!0),g.type==="close"&&(g.isClose=!0),g.nodes||(g.type="text"),g.invalid=!0)});let d=n[n.length-1],v=d.nodes.indexOf(u);d.nodes.splice(v,1,...u.nodes)}while(n.length>0);return D({type:"eos"}),s};za.exports=T0});var Qa=y((UD,Ya)=>{"use strict";var Ka=gr(),N0=ka(),P0=Ha(),I0=Va(),Ee=(t,e={})=>{let r=[];if(Array.isArray(t))for(let i of t){let s=Ee.create(i,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(Ee.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Ee.parse=(t,e={})=>I0(t,e);Ee.stringify=(t,e={})=>Ka(typeof t=="string"?Ee.parse(t,e):t,e);Ee.compile=(t,e={})=>(typeof t=="string"&&(t=Ee.parse(t,e)),N0(t,e));Ee.expand=(t,e={})=>{typeof t=="string"&&(t=Ee.parse(t,e));let r=P0(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Ee.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Ee.compile(t,e):Ee.expand(t,e);Ya.exports=Ee});var Xa=y((zD,k0)=>{k0.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","ca
|
|||
|
|
/*! Bundled license information:
|
|||
|
|
|
|||
|
|
normalize-path/index.js:
|
|||
|
|
(*!
|
|||
|
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-extglob/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|||
|
|
* Licensed under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-glob/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-number/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
to-regex-range/index.js:
|
|||
|
|
(*!
|
|||
|
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
fill-range/index.js:
|
|||
|
|
(*!
|
|||
|
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
|
* Licensed under the MIT License.
|
|||
|
|
*)
|
|||
|
|
*/
|