@prisma/cli-dev
Version:
Dev CLI for Prisma
32 lines (30 loc) • 42 kB
JavaScript
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
var B={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},P={silent:{level:-1},fatal:{level:B.fatal},error:{level:B.error},warn:{level:B.warn},log:{level:B.log},info:{level:B.info},success:{level:B.success},fail:{level:B.fail},ready:{level:B.info},start:{level:B.info},box:{level:B.info},debug:{level:B.debug},trace:{level:B.trace},verbose:{level:B.verbose}};function x(u){if(u===null||typeof u!="object")return!1;let D=Object.getPrototypeOf(u);return D!==null&&D!==Object.prototype&&Object.getPrototypeOf(D)!==null||Symbol.iterator in u?!1:Symbol.toStringTag in u?Object.prototype.toString.call(u)==="[object Module]":!0}function M(u,D,e=".",F){if(!x(D))return M(u,{},e,F);let t=Object.assign({},D);for(let r in u){if(r==="__proto__"||r==="constructor")continue;let o=u[r];o!=null&&(F&&F(t,r,o,e)||(Array.isArray(o)&&Array.isArray(t[r])?t[r]=[...o,...t[r]]:x(o)&&x(t[r])?t[r]=M(o,t[r],(e?`${e}.`:"")+r.toString(),F):t[r]=o))}return t}function cu(u){return(...D)=>D.reduce((e,F)=>M(e,F,"",u),{})}var fu=cu();function Bu(u){return Object.prototype.toString.call(u)==="[object Object]"}function Au(u){return!(!Bu(u)||!u.message&&!u.args||u.stack)}var N=!1,Z=[],f=class u{options;_lastLog;_mockFn;constructor(D={}){let e=D.types||P;this.options=fu({...D,defaults:{...D.defaults},level:$(D.level,e),reporters:[...D.reporters||[]]},{types:P,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let F in e){let t={type:F,...this.options.defaults,...e[F]};this[F]=this._wrapLogFn(t),this[F].raw=this._wrapLogFn(t,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(D){this.options.level=$(D,this.options.types,this.options.level)}prompt(D,e){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(D,e)}create(D){let e=new u({...this.options,...D});return this._mockFn&&e.mockTypes(this._mockFn),e}withDefaults(D){return this.create({...this.options,defaults:{...this.options.defaults,...D}})}withTag(D){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+D:D})}addReporter(D){return this.options.reporters.push(D),this}removeReporter(D){if(D){let e=this.options.reporters.indexOf(D);if(e!==-1)return this.options.reporters.splice(e,1)}else this.options.reporters.splice(0);return this}setReporters(D){return this.options.reporters=Array.isArray(D)?D:[D],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let D in this.options.types)console["__"+D]||(console["__"+D]=console[D]),console[D]=this[D].raw}restoreConsole(){for(let D in this.options.types)console["__"+D]&&(console[D]=console["__"+D],delete console["__"+D])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(D,e){D&&(D.__write||(D.__write=D.write),D.write=F=>{this[e].raw(String(F).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(D){D&&D.__write&&(D.write=D.__write,delete D.__write)}pauseLogs(){N=!0}resumeLogs(){N=!1;let D=Z.splice(0);for(let e of D)e[0]._logFn(e[1],e[2])}mockTypes(D){let e=D||this.options.mockFn;if(this._mockFn=e,typeof e=="function")for(let F in this.options.types)this[F]=e(F,this.options.types[F])||this[F],this[F].raw=this[F]}_wrapLogFn(D,e){return(...F)=>{if(N){Z.push([this,D,F,e]);return}return this._logFn(D,F,e)}}_logFn(D,e,F){if((D.level||0)>this.level)return!1;let t={date:new Date,args:[],...D,level:$(D.level,this.options.types)};!F&&e.length===1&&Au(e[0])?Object.assign(t,e[0]):t.args=[...e],t.message&&(t.args.unshift(t.message),delete t.message),t.additional&&(Array.isArray(t.additional)||(t.additional=t.additional.split(`
`)),t.args.push(`
`+t.additional.join(`
`)),delete t.additional),t.type=typeof t.type=="string"?t.type.toLowerCase():"log",t.tag=typeof t.tag=="string"?t.tag:"";let r=(n=!1)=>{let s=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&s>0){let a=[...this._lastLog.object.args];s>1&&a.push(`(repeated ${s} times)`),this._log({...this._lastLog.object,args:a}),this._lastLog.count=1}n&&(this._lastLog.object=t,this._log(t))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&t.date?t.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=t.date,o<this.options.throttle)try{let n=JSON.stringify([t.type,t.tag,t.args]),s=this._lastLog.serialized===n;if(this._lastLog.serialized=n,s&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(r,this.options.throttle);return}}catch{}r(!0)}_log(D){for(let e of this.options.reporters)e.log(D,{options:this.options})}};function $(u,D={},e=3){return u===void 0?e:typeof u=="number"?u:D[u]&&D[u].level!==void 0?D[u].level:e}f.prototype.add=f.prototype.addReporter;f.prototype.remove=f.prototype.removeReporter;f.prototype.clear=f.prototype.removeReporter;f.prototype.withScope=f.prototype.withTag;f.prototype.mock=f.prototype.mockTypes;f.prototype.pause=f.prototype.pauseLogs;f.prototype.resume=f.prototype.resumeLogs;function K(u={}){return new f(u)}import{formatWithOptions as J}from"util";import{sep as pu}from"path";function k(u,D){let e=process.cwd()+pu;return u.split(`
`).splice(D.split(`
`).length).map(t=>t.trim().replace("file://","").replace(e,""))}function gu(u,D){return(D.__write||D.write).call(D,u)}var U=u=>u?`[${u}]`:"",I=class{formatStack(D,e,F){let t=" ".repeat((F?.errorLevel||0)+1);return t+k(D,e).join(`
${t}`)}formatError(D,e){let F=D.message??J(e,D),t=D.stack?this.formatStack(D.stack,F,e):"",r=e?.errorLevel||0,o=r>0?`${" ".repeat(r)}[cause]: `:"",n=D.cause?`
`+this.formatError(D.cause,{...e,errorLevel:r+1}):"";return o+F+`
`+t+n}formatArgs(D,e){let F=D.map(t=>t&&typeof t.stack=="string"?this.formatError(t,e):t);return J(e,...F)}formatDate(D,e){return e.date?D.toLocaleTimeString():""}filterAndJoin(D){return D.filter(Boolean).join(" ")}formatLogObj(D,e){let F=this.formatArgs(D.args,e);return D.type==="box"?`
`+[U(D.tag),D.title&&D.title,...F.split(`
`)].filter(Boolean).map(t=>" > "+t).join(`
`)+`
`:this.filterAndJoin([U(D.type),U(D.tag),F])}log(D,e){let F=this.formatLogObj(D,{columns:e.options.stdout.columns||0,...e.options.formatOptions});return gu(F+`
`,D.level<2?e.options.stderr||process.stderr:e.options.stdout||process.stdout)}};import tu from"process";import*as v from"tty";var{env:y={},argv:uu=[],platform:hu=""}=typeof process>"u"?{}:process,du="NO_COLOR"in y||uu.includes("--no-color"),mu="FORCE_COLOR"in y||uu.includes("--color"),_u=hu==="win32",Du=y.TERM==="dumb",yu=v&&v.isatty&&v.isatty(1)&&y.TERM&&!Du,bu="CI"in y&&("GITHUB_ACTIONS"in y||"GITLAB_CI"in y||"CIRCLECI"in y),Lu=!du&&(mu||_u&&!Du||yu||bu);function eu(u,D,e,F,t=D.slice(0,Math.max(0,u))+F,r=D.slice(Math.max(0,u+e.length)),o=r.indexOf(e)){return t+(o<0?r:eu(o,r,e,F))}function wu(u,D,e,F,t){return u<0?e+D+F:e+eu(u,D,F,t)+F}function Tu(u,D,e=u,F=u.length+1){return t=>t||!(t===""||t===void 0)?wu((""+t).indexOf(D,F),t,u,D,e):""}function E(u,D,e){return Tu(`\x1B[${u}m`,`\x1B[${D}m`,e)}var X={reset:E(0,0),bold:E(1,22,"\x1B[22m\x1B[1m"),dim:E(2,22,"\x1B[22m\x1B[2m"),italic:E(3,23),underline:E(4,24),inverse:E(7,27),hidden:E(8,28),strikethrough:E(9,29),black:E(30,39),red:E(31,39),green:E(32,39),yellow:E(33,39),blue:E(34,39),magenta:E(35,39),cyan:E(36,39),white:E(37,39),gray:E(90,39),bgBlack:E(40,49),bgRed:E(41,49),bgGreen:E(42,49),bgYellow:E(43,49),bgBlue:E(44,49),bgMagenta:E(45,49),bgCyan:E(46,49),bgWhite:E(47,49),blackBright:E(90,39),redBright:E(91,39),greenBright:E(92,39),yellowBright:E(93,39),blueBright:E(94,39),magentaBright:E(95,39),cyanBright:E(96,39),whiteBright:E(97,39),bgBlackBright:E(100,49),bgRedBright:E(101,49),bgGreenBright:E(102,49),bgYellowBright:E(103,49),bgBlueBright:E(104,49),bgMagentaBright:E(105,49),bgCyanBright:E(106,49),bgWhiteBright:E(107,49)};function Iu(u=Lu){return u?X:Object.fromEntries(Object.keys(X).map(D=>[D,String]))}var l=Iu();function j(u,D="reset"){return l[u]||l[D]}function Su(u,D){return j(u)(D)}var vu=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function _(u){return u.replace(new RegExp(vu,"g"),"")}var Q={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},Ru={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function W(u,D={}){let e={...D,style:{...Ru,...D.style}},F=u.split(`
`),t=[],r=j(e.style.borderColor),o={...typeof e.style.borderStyle=="string"?Q[e.style.borderStyle]||Q.solid:e.style.borderStyle};if(r)for(let i in o)o[i]=r(o[i]);let n=e.style.padding%2===0?e.style.padding:e.style.padding+1,s=F.length+n,a=Math.max(...F.map(i=>_(i).length),e.title?_(e.title).length:0)+n,C=a+n,A=e.style.marginLeft>0?" ".repeat(e.style.marginLeft):"";if(e.style.marginTop>0&&t.push("".repeat(e.style.marginTop)),e.title){let i=r?r(e.title):e.title,c=o.h.repeat(Math.floor((a-_(e.title).length)/2)),p=o.h.repeat(a-_(e.title).length-_(c).length+n);t.push(`${A}${o.tl}${c}${i}${p}${o.tr}`)}else t.push(`${A}${o.tl}${o.h.repeat(C)}${o.tr}`);let g=e.style.valign==="center"?Math.floor((s-F.length)/2):e.style.valign==="top"?s-F.length-n:s-F.length;for(let i=0;i<s;i++)if(i<g||i>=g+F.length)t.push(`${A}${o.v}${" ".repeat(C)}${o.v}`);else{let c=F[i-g],p=" ".repeat(n),m=" ".repeat(a-_(c).length);t.push(`${A}${o.v}${p}${c}${m}${o.v}`)}return t.push(`${A}${o.bl}${o.h.repeat(C)}${o.br}`),e.style.marginBottom>0&&t.push("".repeat(e.style.marginBottom)),t.join(`
`)}import"util";import"path";import"tty";var O=Object.create(null),S=u=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(u?O:globalThis),b=new Proxy(O,{get(u,D){return S()[D]??O[D]},has(u,D){let e=S();return D in e||D in O},set(u,D,e){let F=S(!0);return F[D]=e,!0},deleteProperty(u,D){if(!D)return!1;let e=S(!0);return delete e[D],!0},ownKeys(){let u=S(!0);return Object.keys(u)}}),Ou=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",xu=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Nu(){if(globalThis.process?.env)for(let u of xu){let D=u[1]||u[0];if(globalThis.process?.env[D])return{name:u[0].toLowerCase(),...u[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var ou=Nu();ou.name;function w(u){return u?u!=="false":!1}var $u=globalThis.process?.platform||"",Y=w(b.CI)||ou.ci!==!1,su=w(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),Pu=w(b.DEBUG),V=Ou==="test"||w(b.TEST);w(b.MINIMAL);var Mu=/^win/i.test($u);!w(b.NO_COLOR)&&(w(b.FORCE_COLOR)||(su||Mu)&&b.TERM);var Uu=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Uu?.split(".")[0]);var ku=globalThis.process||Object.create(null),Fu={versions:{}};new Proxy(ku,{get(u,D){if(D==="env")return b;if(D in u)return u[D];if(D in Fu)return Fu[D]}});var ju=globalThis.process?.release?.name==="node",Wu=!!globalThis.Bun||!!globalThis.process?.versions?.bun,Gu=!!globalThis.Deno,Yu=!!globalThis.fastly,Vu=!!globalThis.Netlify,Hu=!!globalThis.EdgeRuntime,qu=globalThis.navigator?.userAgent==="Cloudflare-Workers",zu=[[Vu,"netlify"],[Hu,"edge-light"],[qu,"workerd"],[Yu,"fastly"],[Gu,"deno"],[Wu,"bun"],[ju,"node"]];function Zu(){let u=zu.find(D=>D[0]);if(u)return{name:u[1]}}var Ku=Zu();Ku?.name;function Ju({onlyFirst:u=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,u?void 0:"g")}var Xu=Ju();function Qu(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Xu,"")}function uD(u){return u===161||u===164||u===167||u===168||u===170||u===173||u===174||u>=176&&u<=180||u>=182&&u<=186||u>=188&&u<=191||u===198||u===208||u===215||u===216||u>=222&&u<=225||u===230||u>=232&&u<=234||u===236||u===237||u===240||u===242||u===243||u>=247&&u<=250||u===252||u===254||u===257||u===273||u===275||u===283||u===294||u===295||u===299||u>=305&&u<=307||u===312||u>=319&&u<=322||u===324||u>=328&&u<=331||u===333||u===338||u===339||u===358||u===359||u===363||u===462||u===464||u===466||u===468||u===470||u===472||u===474||u===476||u===593||u===609||u===708||u===711||u>=713&&u<=715||u===717||u===720||u>=728&&u<=731||u===733||u===735||u>=768&&u<=879||u>=913&&u<=929||u>=931&&u<=937||u>=945&&u<=961||u>=963&&u<=969||u===1025||u>=1040&&u<=1103||u===1105||u===8208||u>=8211&&u<=8214||u===8216||u===8217||u===8220||u===8221||u>=8224&&u<=8226||u>=8228&&u<=8231||u===8240||u===8242||u===8243||u===8245||u===8251||u===8254||u===8308||u===8319||u>=8321&&u<=8324||u===8364||u===8451||u===8453||u===8457||u===8467||u===8470||u===8481||u===8482||u===8486||u===8491||u===8531||u===8532||u>=8539&&u<=8542||u>=8544&&u<=8555||u>=8560&&u<=8569||u===8585||u>=8592&&u<=8601||u===8632||u===8633||u===8658||u===8660||u===8679||u===8704||u===8706||u===8707||u===8711||u===8712||u===8715||u===8719||u===8721||u===8725||u===8730||u>=8733&&u<=8736||u===8739||u===8741||u>=8743&&u<=8748||u===8750||u>=8756&&u<=8759||u===8764||u===8765||u===8776||u===8780||u===8786||u===8800||u===8801||u>=8804&&u<=8807||u===8810||u===8811||u===8814||u===8815||u===8834||u===8835||u===8838||u===8839||u===8853||u===8857||u===8869||u===8895||u===8978||u>=9312&&u<=9449||u>=9451&&u<=9547||u>=9552&&u<=9587||u>=9600&&u<=9615||u>=9618&&u<=9621||u===9632||u===9633||u>=9635&&u<=9641||u===9650||u===9651||u===9654||u===9655||u===9660||u===9661||u===9664||u===9665||u>=9670&&u<=9672||u===9675||u>=9678&&u<=9681||u>=9698&&u<=9701||u===9711||u===9733||u===9734||u===9737||u===9742||u===9743||u===9756||u===9758||u===9792||u===9794||u===9824||u===9825||u>=9827&&u<=9829||u>=9831&&u<=9834||u===9836||u===9837||u===9839||u===9886||u===9887||u===9919||u>=9926&&u<=9933||u>=9935&&u<=9939||u>=9941&&u<=9953||u===9955||u===9960||u===9961||u>=9963&&u<=9969||u===9972||u>=9974&&u<=9977||u===9979||u===9980||u===9982||u===9983||u===10045||u>=10102&&u<=10111||u>=11094&&u<=11097||u>=12872&&u<=12879||u>=57344&&u<=63743||u>=65024&&u<=65039||u===65533||u>=127232&&u<=127242||u>=127248&&u<=127277||u>=127280&&u<=127337||u>=127344&&u<=127373||u===127375||u===127376||u>=127387&&u<=127404||u>=917760&&u<=917999||u>=983040&&u<=1048573||u>=1048576&&u<=1114109}function DD(u){return u===12288||u>=65281&&u<=65376||u>=65504&&u<=65510}function eD(u){return u>=4352&&u<=4447||u===8986||u===8987||u===9001||u===9002||u>=9193&&u<=9196||u===9200||u===9203||u===9725||u===9726||u===9748||u===9749||u>=9776&&u<=9783||u>=9800&&u<=9811||u===9855||u>=9866&&u<=9871||u===9875||u===9889||u===9898||u===9899||u===9917||u===9918||u===9924||u===9925||u===9934||u===9940||u===9962||u===9970||u===9971||u===9973||u===9978||u===9981||u===9989||u===9994||u===9995||u===10024||u===10060||u===10062||u>=10067&&u<=10069||u===10071||u>=10133&&u<=10135||u===10160||u===10175||u===11035||u===11036||u===11088||u===11093||u>=11904&&u<=11929||u>=11931&&u<=12019||u>=12032&&u<=12245||u>=12272&&u<=12287||u>=12289&&u<=12350||u>=12353&&u<=12438||u>=12441&&u<=12543||u>=12549&&u<=12591||u>=12593&&u<=12686||u>=12688&&u<=12773||u>=12783&&u<=12830||u>=12832&&u<=12871||u>=12880&&u<=42124||u>=42128&&u<=42182||u>=43360&&u<=43388||u>=44032&&u<=55203||u>=63744&&u<=64255||u>=65040&&u<=65049||u>=65072&&u<=65106||u>=65108&&u<=65126||u>=65128&&u<=65131||u>=94176&&u<=94180||u===94192||u===94193||u>=94208&&u<=100343||u>=100352&&u<=101589||u>=101631&&u<=101640||u>=110576&&u<=110579||u>=110581&&u<=110587||u===110589||u===110590||u>=110592&&u<=110882||u===110898||u>=110928&&u<=110930||u===110933||u>=110948&&u<=110951||u>=110960&&u<=111355||u>=119552&&u<=119638||u>=119648&&u<=119670||u===126980||u===127183||u===127374||u>=127377&&u<=127386||u>=127488&&u<=127490||u>=127504&&u<=127547||u>=127552&&u<=127560||u===127568||u===127569||u>=127584&&u<=127589||u>=127744&&u<=127776||u>=127789&&u<=127797||u>=127799&&u<=127868||u>=127870&&u<=127891||u>=127904&&u<=127946||u>=127951&&u<=127955||u>=127968&&u<=127984||u===127988||u>=127992&&u<=128062||u===128064||u>=128066&&u<=128252||u>=128255&&u<=128317||u>=128331&&u<=128334||u>=128336&&u<=128359||u===128378||u===128405||u===128406||u===128420||u>=128507&&u<=128591||u>=128640&&u<=128709||u===128716||u>=128720&&u<=128722||u>=128725&&u<=128727||u>=128732&&u<=128735||u===128747||u===128748||u>=128756&&u<=128764||u>=128992&&u<=129003||u===129008||u>=129292&&u<=129338||u>=129340&&u<=129349||u>=129351&&u<=129535||u>=129648&&u<=129660||u>=129664&&u<=129673||u>=129679&&u<=129734||u>=129742&&u<=129756||u>=129759&&u<=129769||u>=129776&&u<=129784||u>=131072&&u<=196605||u>=196608&&u<=262141}function tD(u){if(!Number.isSafeInteger(u))throw new TypeError(`Expected a code point, got \`${typeof u}\`.`)}function FD(u,{ambiguousAsWide:D=!1}={}){return tD(u),DD(u)||eD(u)||D&&uD(u)?2:1}var nD=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?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?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,rD=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:u=>u.split("")},oD=/^\p{Default_Ignorable_Code_Point}$/u;function sD(u,D={}){if(typeof u!="string"||u.length===0)return 0;let{ambiguousIsNarrow:e=!0,countAnsiEscapeCodes:F=!1}=D;if(F||(u=Qu(u)),u.length===0)return 0;let t=0,r={ambiguousAsWide:!e};for(let{segment:o}of rD.segment(u)){let n=o.codePointAt(0);if(!(n<=31||n>=127&&n<=159)&&!(n>=8203&&n<=8207||n===65279)&&!(n>=768&&n<=879||n>=6832&&n<=6911||n>=7616&&n<=7679||n>=8400&&n<=8447||n>=65056&&n<=65071)&&!(n>=55296&&n<=57343)&&!(n>=65024&&n<=65039)&&!oD.test(o)){if(nD().test(o)){t+=2;continue}t+=FD(n,r)}}return t}function iD(){let{env:u}=tu,{TERM:D,TERM_PROGRAM:e}=u;return tu.platform!=="win32"?D!=="linux":!!u.WT_SESSION||!!u.TERMINUS_SUBLIME||u.ConEmuTask==="{cmd::Cmder}"||e==="Terminus-Sublime"||e==="vscode"||D==="xterm-256color"||D==="alacritty"||D==="rxvt-unicode"||D==="rxvt-unicode-256color"||u.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var aD={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},ED={0:"red",1:"yellow"},CD=iD(),d=(u,D)=>CD?u:D,nu={error:d("\u2716","\xD7"),fatal:d("\u2716","\xD7"),ready:d("\u2714","\u221A"),warn:d("\u26A0","\u203C"),info:d("\u2139","i"),success:d("\u2714","\u221A"),debug:d("\u2699","D"),trace:d("\u2192","\u2192"),fail:d("\u2716","\xD7"),start:d("\u25D0","o"),log:""};function ru(u){return!(typeof Intl=="object")||!Intl.Segmenter?_(u).length:sD(u)}var G=class extends I{formatStack(D,e,F){let t=" ".repeat((F?.errorLevel||0)+1);return`
${t}`+k(D,e).map(r=>" "+r.replace(/^at +/,o=>l.gray(o)).replace(/\((.+)\)/,(o,n)=>`(${l.cyan(n)})`)).join(`
${t}`)}formatType(D,e,F){let t=aD[D.type]||ED[D.level]||"gray";if(e)return cD(t)(l.black(` ${D.type.toUpperCase()} `));let r=typeof nu[D.type]=="string"?nu[D.type]:D.icon||D.type;return r?lD(t)(r):""}formatLogObj(D,e){let[F,...t]=this.formatArgs(D.args,e).split(`
`);if(D.type==="box")return W(R(F+(t.length>0?`
`+t.join(`
`):"")),{title:D.title?R(D.title):void 0,style:D.style});let r=this.formatDate(D.date,e),o=r&&l.gray(r),n=D.badge??D.level<2,s=this.formatType(D,n,e),a=D.tag?l.gray(D.tag):"",C,A=this.filterAndJoin([s,R(F)]),g=this.filterAndJoin(e.columns?[a,o]:[a]),i=(e.columns||0)-ru(A)-ru(g)-2;if(C=i>0&&(e.columns||0)>=80?A+" ".repeat(i)+g:(g?`${l.gray(`[${g}]`)} `:"")+A,C+=R(t.length>0?`
`+t.join(`
`):""),D.type==="trace"){let c=new Error("Trace: "+D.message);C+=this.formatStack(c.stack||"",c.message)}return n?`
`+C+`
`:C}};function R(u){return u.replace(/`([^`]+)`/gm,(D,e)=>l.cyan(e)).replace(/\s+_([^_]+)_\s+/gm,(D,e)=>` ${l.underline(e)} `)}function lD(u="white"){return l[u]||l.white}function cD(u="bgWhite"){return l[`bg${u[0].toUpperCase()}${u.slice(1)}`]||l.bgWhite}function fD(u={}){let D=BD();return process.env.CONSOLA_LEVEL&&(D=Number.parseInt(process.env.CONSOLA_LEVEL)??D),K({level:D,defaults:{level:D},stdout:process.stdout,stderr:process.stderr,prompt:(...F)=>import("./prompt-KJRFDAR5.js").then(t=>t.prompt(...F)),reporters:u.reporters||[u.fancy??!(Y||V)?new G:new I],...u})}function BD(){return Pu?B.debug:V?B.warn:B.info}var T=fD();import"tty";function AD(u){return Array.isArray(u)?u:u===void 0?[]:[u]}function H(u,D=""){let e=[];for(let F of u)for(let[t,r]of F.entries())e[t]=Math.max(e[t]||0,r.length);return u.map(F=>F.map((t,r)=>D+t[r===0?"padStart":"padEnd"](e[r])).join(" ")).join(`
`)}function h(u){return typeof u=="function"?u():u}var L=class extends Error{constructor(D,e){super(D),this.code=e,this.name="CLIError"}},pD=/\d/,gD=["-","_","/","."];function hD(u=""){if(!pD.test(u))return u!==u.toLowerCase()}function iu(u,D){let e=D??gD,F=[];if(!u||typeof u!="string")return F;let t="",r,o;for(let n of u){let s=e.includes(n);if(s===!0){F.push(t),t="",r=void 0;continue}let a=hD(n);if(o===!1){if(r===!1&&a===!0){F.push(t),t=n,r=a;continue}if(r===!0&&a===!1&&t.length>1){let C=t.at(-1);F.push(t.slice(0,Math.max(0,t.length-1))),t=C+n,r=a;continue}}t+=n,r=a,o=s}return F.push(t),F}function dD(u){return u?u[0].toUpperCase()+u.slice(1):""}function mD(u){return u?u[0].toLowerCase()+u.slice(1):""}function _D(u,D){return u?(Array.isArray(u)?u:iu(u)).map(e=>dD(D?.normalize?e.toLowerCase():e)).join(""):""}function yD(u,D){return mD(_D(u||"",D))}function bD(u,D){return u?(Array.isArray(u)?u:iu(u)).map(e=>e.toLowerCase()).join(D??"-"):""}function q(u){return u==null?[]:Array.isArray(u)?u:[u]}function LD(u,D,e,F){let t,r=u[D],o=~F.string.indexOf(D)?e==null||e===!0?"":String(e):typeof e=="boolean"?e:~F.boolean.indexOf(D)?e==="false"?!1:e==="true"||(u._.push((t=+e,t*0===0?t:e)),!!e):(t=+e,t*0===0?t:e);u[D]=r==null?o:Array.isArray(r)?r.concat(o):[r,o]}function wD(u=[],D={}){let e,F,t,r,o,n={_:[]},s=0,a=0,C=0,A=u.length,g=D.alias!==void 0,i=D.unknown!==void 0,c=D.default!==void 0;if(D.alias=D.alias||{},D.string=q(D.string),D.boolean=q(D.boolean),g)for(e in D.alias)for(F=D.alias[e]=q(D.alias[e]),s=0;s<F.length;s++)(D.alias[F[s]]=F.concat(e)).splice(s,1);for(s=D.boolean.length;s-- >0;)for(F=D.alias[D.boolean[s]]||[],a=F.length;a-- >0;)D.boolean.push(F[a]);for(s=D.string.length;s-- >0;)for(F=D.alias[D.string[s]]||[],a=F.length;a-- >0;)D.string.push(F[a]);if(c){for(e in D.default)if(r=typeof D.default[e],F=D.alias[e]=D.alias[e]||[],D[r]!==void 0)for(D[r].push(e),s=0;s<F.length;s++)D[r].push(F[s])}let p=i?Object.keys(D.alias):[];for(s=0;s<A;s++){if(t=u[s],t==="--"){n._=n._.concat(u.slice(++s));break}for(a=0;a<t.length&&t.charCodeAt(a)===45;a++);if(a===0)n._.push(t);else if(t.substring(a,a+3)==="no-"){if(r=t.slice(Math.max(0,a+3)),i&&!~p.indexOf(r))return D.unknown(t);n[r]=!1}else{for(C=a+1;C<t.length&&t.charCodeAt(C)!==61;C++);for(r=t.substring(a,C),o=t.slice(Math.max(0,++C))||s+1===A||(""+u[s+1]).charCodeAt(0)===45||u[++s],F=a===2?[r]:r,C=0;C<F.length;C++){if(r=F[C],i&&!~p.indexOf(r))return D.unknown("-".repeat(a)+r);LD(n,r,C+1<F.length||o,D)}}}if(c)for(e in D.default)n[e]===void 0&&(n[e]=D.default[e]);if(g)for(e in n)for(F=D.alias[e]||[];F.length>0;)n[F.shift()]=n[e];return n}function TD(u,D){let e={boolean:[],string:[],mixed:[],alias:{},default:{}},F=au(D);for(let n of F)n.type!=="positional"&&(n.type==="string"?e.string.push(n.name):n.type==="boolean"&&e.boolean.push(n.name),n.default!==void 0&&(e.default[n.name]=n.default),n.alias&&(e.alias[n.name]=n.alias));let t=wD(u,e),[...r]=t._,o=new Proxy(t,{get(n,s){return n[s]??n[yD(s)]??n[bD(s)]}});for(let[,n]of F.entries())if(n.type==="positional"){let s=r.shift();if(s!==void 0)o[n.name]=s;else{if(n.default===void 0&&n.required!==!1)throw new L(`Missing required positional argument: ${n.name.toUpperCase()}`,"EARG");o[n.name]=n.default}}else if(n.required&&o[n.name]===void 0)throw new L(`Missing required argument: --${n.name}`,"EARG");return o}function au(u){let D=[];for(let[e,F]of Object.entries(u||{}))D.push({...F,name:e,alias:AD(F.alias)});return D}async function Eu(u,D){let e=await h(u.args||{}),F=TD(D.rawArgs,e),t={rawArgs:D.rawArgs,args:F,data:D.data,cmd:u};typeof u.setup=="function"&&await u.setup(t);let r;try{let o=await h(u.subCommands);if(o&&Object.keys(o).length>0){let n=D.rawArgs.findIndex(a=>!a.startsWith("-")),s=D.rawArgs[n];if(s){if(!o[s])throw new L(`Unknown command \`${s}\``,"E_UNKNOWN_COMMAND");let a=await h(o[s]);a&&await Eu(a,{rawArgs:D.rawArgs.slice(n+1)})}else if(!u.run)throw new L("No command specified.","E_NO_COMMAND")}typeof u.run=="function"&&(r=await u.run(t))}finally{typeof u.cleanup=="function"&&await u.cleanup(t)}return{result:r}}async function z(u,D,e){let F=await h(u.subCommands);if(F&&Object.keys(F).length>0){let t=D.findIndex(n=>!n.startsWith("-")),r=D[t],o=await h(F[r]);if(o)return z(o,D.slice(t+1),u)}return[u,e]}async function ID(u,D){try{T.log(await SD(u,D)+`
`)}catch(e){T.error(e)}}async function SD(u,D){let e=await h(u.meta||{}),F=au(await h(u.args||{})),t=await h(D?.meta||{}),r=`${t.name?`${t.name} `:""}`+(e.name||process.argv[1]),o=[],n=[],s=[],a=[];for(let i of F)if(i.type==="positional"){let c=i.name.toUpperCase(),p=i.required!==!1&&i.default===void 0,m=i.default?`="${i.default}"`:"";n.push(["`"+c+m+"`",i.description||"",i.valueHint?`<${i.valueHint}>`:""]),a.push(p?`<${c}>`:`[${c}]`)}else{let c=i.required===!0&&i.default===void 0,p=(i.type==="boolean"&&i.default===!0?[...(i.alias||[]).map(m=>`--no-${m}`),`--no-${i.name}`].join(", "):[...(i.alias||[]).map(m=>`-${m}`),`--${i.name}`].join(", "))+(i.type==="string"&&(i.valueHint||i.default)?`=${i.valueHint?`<${i.valueHint}>`:`"${i.default||""}"`}`:"");o.push(["`"+p+(c?" (required)":"")+"`",i.description||""]),c&&a.push(p)}if(u.subCommands){let i=[],c=await h(u.subCommands);for(let[p,m]of Object.entries(c)){let Cu=await h(m),lu=await h(Cu?.meta);s.push([`\`${p}\``,lu?.description||""]),i.push(p)}a.push(i.join("|"))}let C=[],A=e.version||t.version;C.push(l.gray(`${e.description} (${r+(A?` v${A}`:"")})`),"");let g=o.length>0||n.length>0;return C.push(`${l.underline(l.bold("USAGE"))} \`${r}${g?" [OPTIONS]":""} ${a.join(" ")}\``,""),n.length>0&&(C.push(l.underline(l.bold("ARGUMENTS")),""),C.push(H(n," ")),C.push("")),o.length>0&&(C.push(l.underline(l.bold("OPTIONS")),""),C.push(H(o," ")),C.push("")),s.length>0&&(C.push(l.underline(l.bold("COMMANDS")),""),C.push(H(s," ")),C.push("",`Use \`${r} <command> --help\` for more information about a command.`)),C.filter(i=>typeof i=="string").join(`
`)}async function De(u,D={}){let e=D.rawArgs||process.argv.slice(2),F=D.showUsage||ID;try{if(e.includes("--help")||e.includes("-h"))await F(...await z(u,e)),process.exit(0);else if(e.length===1&&e[0]==="--version"){let t=typeof u.meta=="function"?await u.meta():await u.meta;if(!t?.version)throw new L("No version specified","E_NO_VERSION");T.log(t.version)}else await Eu(u,{rawArgs:e})}catch(t){let r=t instanceof L;r||T.error(t,`
`),r&&await F(...await z(u,e)),T.error(t.message),process.exit(1)}}var te={debug:{default:!1,description:"Enable debug logging. Defaults to `false`.",required:!1,type:"boolean"}};export{B as a,Su as b,W as c,T as d,De as e,te as f};