@sidgaikwad/orm-setup 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,70 +1,53 @@
1
1
  #!/usr/bin/env bun
2
- import{createRequire as QI}from"node:module";var JI=Object.create;var{getPrototypeOf:ZI,defineProperty:O1,getOwnPropertyNames:UI}=Object;var XI=Object.prototype.hasOwnProperty;var m=($,I,G)=>{G=$!=null?JI(ZI($)):{};let V=I||!$||!$.__esModule?O1(G,"default",{value:$,enumerable:!0}):G;for(let S of UI($))if(!XI.call(V,S))O1(V,S,{get:()=>$[S],enumerable:!0});return V};var j=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var w=QI(import.meta.url);var y$=j((m3,v1)=>{var z$={to($,I){if(!I)return`\x1B[${$+1}G`;return`\x1B[${I+1};${$+1}H`},move($,I){let G="";if($<0)G+=`\x1B[${-$}D`;else if($>0)G+=`\x1B[${$}C`;if(I<0)G+=`\x1B[${-I}A`;else if(I>0)G+=`\x1B[${I}B`;return G},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},WI={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},YI={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let I="";for(let G=0;G<$;G++)I+=this.line+(G<$-1?z$.up():"");if($)I+=z$.left;return I}};v1.exports={cursor:z$,scroll:WI,erase:YI,beep:"\x07"}});var O$=j((h3,_$)=>{var G$=process||{},x1=G$.argv||[],I$=G$.env||{},LI=!(!!I$.NO_COLOR||x1.includes("--no-color"))&&(!!I$.FORCE_COLOR||x1.includes("--color")||G$.platform==="win32"||(G$.stdout||{}).isTTY&&I$.TERM!=="dumb"||!!I$.CI),RI=($,I,G=$)=>(V)=>{let S=""+V,M=S.indexOf(I,$.length);return~M?$+bI(S,I,G,M)+I:$+S+I},bI=($,I,G,V)=>{let S="",M=0;do S+=$.substring(M,V)+G,M=V+I.length,V=$.indexOf(I,M);while(~V);return S+$.substring(M)},w1=($=LI)=>{let I=$?RI:()=>String;return{isColorSupported:$,reset:I("\x1B[0m","\x1B[0m"),bold:I("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:I("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:I("\x1B[3m","\x1B[23m"),underline:I("\x1B[4m","\x1B[24m"),inverse:I("\x1B[7m","\x1B[27m"),hidden:I("\x1B[8m","\x1B[28m"),strikethrough:I("\x1B[9m","\x1B[29m"),black:I("\x1B[30m","\x1B[39m"),red:I("\x1B[31m","\x1B[39m"),green:I("\x1B[32m","\x1B[39m"),yellow:I("\x1B[33m","\x1B[39m"),blue:I("\x1B[34m","\x1B[39m"),magenta:I("\x1B[35m","\x1B[39m"),cyan:I("\x1B[36m","\x1B[39m"),white:I("\x1B[37m","\x1B[39m"),gray:I("\x1B[90m","\x1B[39m"),bgBlack:I("\x1B[40m","\x1B[49m"),bgRed:I("\x1B[41m","\x1B[49m"),bgGreen:I("\x1B[42m","\x1B[49m"),bgYellow:I("\x1B[43m","\x1B[49m"),bgBlue:I("\x1B[44m","\x1B[49m"),bgMagenta:I("\x1B[45m","\x1B[49m"),bgCyan:I("\x1B[46m","\x1B[49m"),bgWhite:I("\x1B[47m","\x1B[49m"),blackBright:I("\x1B[90m","\x1B[39m"),redBright:I("\x1B[91m","\x1B[39m"),greenBright:I("\x1B[92m","\x1B[39m"),yellowBright:I("\x1B[93m","\x1B[39m"),blueBright:I("\x1B[94m","\x1B[39m"),magentaBright:I("\x1B[95m","\x1B[39m"),cyanBright:I("\x1B[96m","\x1B[39m"),whiteBright:I("\x1B[97m","\x1B[39m"),bgBlackBright:I("\x1B[100m","\x1B[49m"),bgRedBright:I("\x1B[101m","\x1B[49m"),bgGreenBright:I("\x1B[102m","\x1B[49m"),bgYellowBright:I("\x1B[103m","\x1B[49m"),bgBlueBright:I("\x1B[104m","\x1B[49m"),bgMagentaBright:I("\x1B[105m","\x1B[49m"),bgCyanBright:I("\x1B[106m","\x1B[49m"),bgWhiteBright:I("\x1B[107m","\x1B[49m")}};_$.exports=w1();_$.exports.createColors=w1});var w0=j((m4,x0)=>{x0.exports=v0;v0.sync=mG;var _0=w("fs");function CG($,I){var G=I.pathExt!==void 0?I.pathExt:process.env.PATHEXT;if(!G)return!0;if(G=G.split(";"),G.indexOf("")!==-1)return!0;for(var V=0;V<G.length;V++){var S=G[V].toLowerCase();if(S&&$.substr(-S.length).toLowerCase()===S)return!0}return!1}function O0($,I,G){if(!$.isSymbolicLink()&&!$.isFile())return!1;return CG(I,G)}function v0($,I,G){_0.stat($,function(V,S){G(V,V?!1:O0(S,$,I))})}function mG($,I){return O0(_0.statSync($),$,I)}});var m0=j((h4,C0)=>{C0.exports=E0;E0.sync=hG;var P0=w("fs");function E0($,I,G){P0.stat($,function(V,S){G(V,V?!1:c0(S,I))})}function hG($,I){return c0(P0.statSync($),I)}function c0($,I){return $.isFile()&&kG($,I)}function kG($,I){var{mode:G,uid:V,gid:S}=$,M=I.uid!==void 0?I.uid:process.getuid&&process.getuid(),q=I.gid!==void 0?I.gid:process.getgid&&process.getgid(),H=parseInt("100",8),Z=parseInt("010",8),J=parseInt("001",8),X=H|Z,Q=G&J||G&Z&&S===q||G&H&&V===M||G&X&&M===0;return Q}});var k0=j((n4,h0)=>{var k4=w("fs"),U$;if(process.platform==="win32"||global.TESTING_WINDOWS)U$=w0();else U$=m0();h0.exports=D$;D$.sync=nG;function D$($,I,G){if(typeof I==="function")G=I,I={};if(!G){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(V,S){D$($,I||{},function(M,q){if(M)S(M);else V(q)})})}U$($,I||{},function(V,S){if(V){if(V.code==="EACCES"||I&&I.ignoreErrors)V=null,S=!1}G(V,S)})}function nG($,I){try{return U$.sync($,I||{})}catch(G){if(I&&I.ignoreErrors||G.code==="EACCES")return!1;else throw G}}});var D0=j((F4,i0)=>{var g=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",n0=w("path"),FG=g?";":":",F0=k0(),u0=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),f0=($,I)=>{let G=I.colon||FG,V=$.match(/\//)||g&&$.match(/\\/)?[""]:[...g?[process.cwd()]:[],...(I.path||process.env.PATH||"").split(G)],S=g?I.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",M=g?S.split(G):[""];if(g){if($.indexOf(".")!==-1&&M[0]!=="")M.unshift("")}return{pathEnv:V,pathExt:M,pathExtExe:S}},g0=($,I,G)=>{if(typeof I==="function")G=I,I={};if(!I)I={};let{pathEnv:V,pathExt:S,pathExtExe:M}=f0($,I),q=[],H=(J)=>new Promise((X,Q)=>{if(J===V.length)return I.all&&q.length?X(q):Q(u0($));let W=V[J],A=/^".*"$/.test(W)?W.slice(1,-1):W,N=n0.join(A,$),x=!A&&/^\.[\\\/]/.test($)?$.slice(0,2)+N:N;X(Z(x,J,0))}),Z=(J,X,Q)=>new Promise((W,A)=>{if(Q===S.length)return W(H(X+1));let N=S[Q];F0(J+N,{pathExt:M},(x,C)=>{if(!x&&C)if(I.all)q.push(J+N);else return W(J+N);return W(Z(J,X,Q+1))})});return G?H(0).then((J)=>G(null,J),G):H(0)},uG=($,I)=>{I=I||{};let{pathEnv:G,pathExt:V,pathExtExe:S}=f0($,I),M=[];for(let q=0;q<G.length;q++){let H=G[q],Z=/^".*"$/.test(H)?H.slice(1,-1):H,J=n0.join(Z,$),X=!Z&&/^\.[\\\/]/.test($)?$.slice(0,2)+J:J;for(let Q=0;Q<V.length;Q++){let W=X+V[Q];try{if(F0.sync(W,{pathExt:S}))if(I.all)M.push(W);else return W}catch(A){}}}if(I.all&&M.length)return M;if(I.nothrow)return null;throw u0($)};i0.exports=g0;g0.sync=uG});var t0=j((u4,d$)=>{var d0=($={})=>{let I=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(I).reverse().find((V)=>V.toUpperCase()==="PATH")||"Path"};d$.exports=d0;d$.exports.default=d0});var o0=j((f4,r0)=>{var l0=w("path"),fG=D0(),gG=t0();function p0($,I){let G=$.options.env||process.env,V=process.cwd(),S=$.options.cwd!=null,M=S&&process.chdir!==void 0&&!process.chdir.disabled;if(M)try{process.chdir($.options.cwd)}catch(H){}let q;try{q=fG.sync($.command,{path:G[gG({env:G})],pathExt:I?l0.delimiter:void 0})}catch(H){}finally{if(M)process.chdir(V)}if(q)q=l0.resolve(S?$.options.cwd:"",q);return q}function iG($){return p0($)||p0($,!0)}r0.exports=iG});var a0=j((tG,l$)=>{var t$=/([()\][%!^"`<>&|;, *?])/g;function DG($){return $=$.replace(t$,"^$1"),$}function dG($,I){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(t$,"^$1"),I)$=$.replace(t$,"^$1");return $}tG.command=DG;tG.argument=dG});var e0=j((g4,s0)=>{s0.exports=/^#!(.*)/});var I2=j((i4,$2)=>{var rG=e0();$2.exports=($="")=>{let I=$.match(rG);if(!I)return null;let[G,V]=I[0].replace(/#! ?/,"").split(" "),S=G.split("/").pop();if(S==="env")return V;return V?`${S} ${V}`:S}});var q2=j((D4,G2)=>{var p$=w("fs"),oG=I2();function aG($){let G=Buffer.alloc(150),V;try{V=p$.openSync($,"r"),p$.readSync(V,G,0,150,0),p$.closeSync(V)}catch(S){}return oG(G.toString())}G2.exports=aG});var H2=j((d4,M2)=>{var sG=w("path"),V2=o0(),S2=a0(),eG=q2(),$9=process.platform==="win32",I9=/\.(?:com|exe)$/i,G9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function q9($){$.file=V2($);let I=$.file&&eG($.file);if(I)return $.args.unshift($.file),$.command=I,V2($);return $.file}function V9($){if(!$9)return $;let I=q9($),G=!I9.test(I);if($.options.forceShell||G){let V=G9.test(I);$.command=sG.normalize($.command),$.command=S2.command($.command),$.args=$.args.map((M)=>S2.argument(M,V));let S=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${S}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function S9($,I,G){if(I&&!Array.isArray(I))G=I,I=null;I=I?I.slice(0):[],G=Object.assign({},G);let V={command:$,args:I,options:G,file:void 0,original:{command:$,args:I}};return G.shell?V:V9(V)}M2.exports=S9});var U2=j((t4,Z2)=>{var r$=process.platform==="win32";function o$($,I){return Object.assign(Error(`${I} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${I} ${$.command}`,path:$.command,spawnargs:$.args})}function M9($,I){if(!r$)return;let G=$.emit;$.emit=function(V,S){if(V==="exit"){let M=J2(S,I);if(M)return G.call($,"error",M)}return G.apply($,arguments)}}function J2($,I){if(r$&&$===1&&!I.file)return o$(I.original,"spawn");return null}function H9($,I){if(r$&&$===1&&!I.file)return o$(I.original,"spawnSync");return null}Z2.exports={hookChildProcess:M9,verifyENOENT:J2,verifyENOENTSync:H9,notFoundError:o$}});var W2=j((l4,i)=>{var X2=w("child_process"),a$=H2(),s$=U2();function Q2($,I,G){let V=a$($,I,G),S=X2.spawn(V.command,V.args,V.options);return s$.hookChildProcess(S,V),S}function J9($,I,G){let V=a$($,I,G),S=X2.spawnSync(V.command,V.args,V.options);return S.error=S.error||s$.verifyENOENTSync(S.status,V),S}i.exports=Q2;i.exports.spawn=Q2;i.exports.sync=J9;i.exports._parse=a$;i.exports._enoent=s$});var i2=j((s5,g2)=>{var{PassThrough:M3}=w("stream");g2.exports=function(){var $=[],I=new M3({objectMode:!0});return I.setMaxListeners(0),I.add=G,I.isEmpty=V,I.on("unpipe",S),Array.prototype.slice.call(arguments).forEach(G),I;function G(M){if(Array.isArray(M))return M.forEach(G),this;return $.push(M),M.once("end",S.bind(null,M)),M.once("error",I.emit.bind(I,"error")),M.pipe(I,{end:!1}),this}function V(){return $.length==0}function S(M){if($=$.filter(function(q){return q!==M}),!$.length&&I.readable)I.end()}}});var z=m(y$(),1),V$=m(O$(),1);import{stdin as u1,stdout as f1}from"node:process";import*as P from"node:readline";import P1 from"node:readline";import{WriteStream as BI}from"node:tty";function KI({onlyFirst:$=!1}={}){let I=["[\\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(I,$?void 0:"g")}var AI=KI();function g1($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(AI,"")}function i1($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var D1={exports:{}};(function($){var I={};$.exports=I,I.eastAsianWidth=function(V){var S=V.charCodeAt(0),M=V.length==2?V.charCodeAt(1):0,q=S;return 55296<=S&&S<=56319&&56320<=M&&M<=57343&&(S&=1023,M&=1023,q=S<<10|M,q+=65536),q==12288||65281<=q&&q<=65376||65504<=q&&q<=65510?"F":q==8361||65377<=q&&q<=65470||65474<=q&&q<=65479||65482<=q&&q<=65487||65490<=q&&q<=65495||65498<=q&&q<=65500||65512<=q&&q<=65518?"H":4352<=q&&q<=4447||4515<=q&&q<=4519||4602<=q&&q<=4607||9001<=q&&q<=9002||11904<=q&&q<=11929||11931<=q&&q<=12019||12032<=q&&q<=12245||12272<=q&&q<=12283||12289<=q&&q<=12350||12353<=q&&q<=12438||12441<=q&&q<=12543||12549<=q&&q<=12589||12593<=q&&q<=12686||12688<=q&&q<=12730||12736<=q&&q<=12771||12784<=q&&q<=12830||12832<=q&&q<=12871||12880<=q&&q<=13054||13056<=q&&q<=19903||19968<=q&&q<=42124||42128<=q&&q<=42182||43360<=q&&q<=43388||44032<=q&&q<=55203||55216<=q&&q<=55238||55243<=q&&q<=55291||63744<=q&&q<=64255||65040<=q&&q<=65049||65072<=q&&q<=65106||65108<=q&&q<=65126||65128<=q&&q<=65131||110592<=q&&q<=110593||127488<=q&&q<=127490||127504<=q&&q<=127546||127552<=q&&q<=127560||127568<=q&&q<=127569||131072<=q&&q<=194367||177984<=q&&q<=196605||196608<=q&&q<=262141?"W":32<=q&&q<=126||162<=q&&q<=163||165<=q&&q<=166||q==172||q==175||10214<=q&&q<=10221||10629<=q&&q<=10630?"Na":q==161||q==164||167<=q&&q<=168||q==170||173<=q&&q<=174||176<=q&&q<=180||182<=q&&q<=186||188<=q&&q<=191||q==198||q==208||215<=q&&q<=216||222<=q&&q<=225||q==230||232<=q&&q<=234||236<=q&&q<=237||q==240||242<=q&&q<=243||247<=q&&q<=250||q==252||q==254||q==257||q==273||q==275||q==283||294<=q&&q<=295||q==299||305<=q&&q<=307||q==312||319<=q&&q<=322||q==324||328<=q&&q<=331||q==333||338<=q&&q<=339||358<=q&&q<=359||q==363||q==462||q==464||q==466||q==468||q==470||q==472||q==474||q==476||q==593||q==609||q==708||q==711||713<=q&&q<=715||q==717||q==720||728<=q&&q<=731||q==733||q==735||768<=q&&q<=879||913<=q&&q<=929||931<=q&&q<=937||945<=q&&q<=961||963<=q&&q<=969||q==1025||1040<=q&&q<=1103||q==1105||q==8208||8211<=q&&q<=8214||8216<=q&&q<=8217||8220<=q&&q<=8221||8224<=q&&q<=8226||8228<=q&&q<=8231||q==8240||8242<=q&&q<=8243||q==8245||q==8251||q==8254||q==8308||q==8319||8321<=q&&q<=8324||q==8364||q==8451||q==8453||q==8457||q==8467||q==8470||8481<=q&&q<=8482||q==8486||q==8491||8531<=q&&q<=8532||8539<=q&&q<=8542||8544<=q&&q<=8555||8560<=q&&q<=8569||q==8585||8592<=q&&q<=8601||8632<=q&&q<=8633||q==8658||q==8660||q==8679||q==8704||8706<=q&&q<=8707||8711<=q&&q<=8712||q==8715||q==8719||q==8721||q==8725||q==8730||8733<=q&&q<=8736||q==8739||q==8741||8743<=q&&q<=8748||q==8750||8756<=q&&q<=8759||8764<=q&&q<=8765||q==8776||q==8780||q==8786||8800<=q&&q<=8801||8804<=q&&q<=8807||8810<=q&&q<=8811||8814<=q&&q<=8815||8834<=q&&q<=8835||8838<=q&&q<=8839||q==8853||q==8857||q==8869||q==8895||q==8978||9312<=q&&q<=9449||9451<=q&&q<=9547||9552<=q&&q<=9587||9600<=q&&q<=9615||9618<=q&&q<=9621||9632<=q&&q<=9633||9635<=q&&q<=9641||9650<=q&&q<=9651||9654<=q&&q<=9655||9660<=q&&q<=9661||9664<=q&&q<=9665||9670<=q&&q<=9672||q==9675||9678<=q&&q<=9681||9698<=q&&q<=9701||q==9711||9733<=q&&q<=9734||q==9737||9742<=q&&q<=9743||9748<=q&&q<=9749||q==9756||q==9758||q==9792||q==9794||9824<=q&&q<=9825||9827<=q&&q<=9829||9831<=q&&q<=9834||9836<=q&&q<=9837||q==9839||9886<=q&&q<=9887||9918<=q&&q<=9919||9924<=q&&q<=9933||9935<=q&&q<=9953||q==9955||9960<=q&&q<=9983||q==10045||q==10071||10102<=q&&q<=10111||11093<=q&&q<=11097||12872<=q&&q<=12879||57344<=q&&q<=63743||65024<=q&&q<=65039||q==65533||127232<=q&&q<=127242||127248<=q&&q<=127277||127280<=q&&q<=127337||127344<=q&&q<=127386||917760<=q&&q<=917999||983040<=q&&q<=1048573||1048576<=q&&q<=1114109?"A":"N"},I.characterLength=function(V){var S=this.eastAsianWidth(V);return S=="F"||S=="W"||S=="A"?2:1};function G(V){return V.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}I.length=function(V){for(var S=G(V),M=0,q=0;q<S.length;q++)M=M+this.characterLength(S[q]);return M},I.slice=function(V,S,M){textLen=I.length(V),S=S||0,M=M||1,S<0&&(S=textLen+S),M<0&&(M=textLen+M);for(var q="",H=0,Z=G(V),J=0;J<Z.length;J++){var X=Z[J],Q=I.length(X);if(H>=S-(Q==2?1:0))if(H+Q<=M)q+=X;else break;H+=Q}return q}})(D1);var TI=D1.exports,NI=i1(TI),jI=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},zI=i1(jI);function D($,I={}){if(typeof $!="string"||$.length===0||(I={ambiguousIsNarrow:!0,...I},$=g1($),$.length===0))return 0;$=$.replace(zI()," ");let G=I.ambiguousIsNarrow?1:2,V=0;for(let S of $){let M=S.codePointAt(0);if(M<=31||M>=127&&M<=159||M>=768&&M<=879)continue;switch(NI.eastAsianWidth(S)){case"F":case"W":V+=2;break;case"A":V+=G;break;default:V+=1}}return V}var v$=10,E1=($=0)=>(I)=>`\x1B[${I+$}m`,c1=($=0)=>(I)=>`\x1B[${38+$};5;${I}m`,C1=($=0)=>(I,G,V)=>`\x1B[${38+$};2;${I};${G};${V}m`,L={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(L.modifier);var yI=Object.keys(L.color),_I=Object.keys(L.bgColor);[...yI,..._I];function OI(){let $=new Map;for(let[I,G]of Object.entries(L)){for(let[V,S]of Object.entries(G))L[V]={open:`\x1B[${S[0]}m`,close:`\x1B[${S[1]}m`},G[V]=L[V],$.set(S[0],S[1]);Object.defineProperty(L,I,{value:G,enumerable:!1})}return Object.defineProperty(L,"codes",{value:$,enumerable:!1}),L.color.close="\x1B[39m",L.bgColor.close="\x1B[49m",L.color.ansi=E1(),L.color.ansi256=c1(),L.color.ansi16m=C1(),L.bgColor.ansi=E1(v$),L.bgColor.ansi256=c1(v$),L.bgColor.ansi16m=C1(v$),Object.defineProperties(L,{rgbToAnsi256:{value:(I,G,V)=>I===G&&G===V?I<8?16:I>248?231:Math.round((I-8)/247*24)+232:16+36*Math.round(I/255*5)+6*Math.round(G/255*5)+Math.round(V/255*5),enumerable:!1},hexToRgb:{value:(I)=>{let G=/[a-f\d]{6}|[a-f\d]{3}/i.exec(I.toString(16));if(!G)return[0,0,0];let[V]=G;V.length===3&&(V=[...V].map((M)=>M+M).join(""));let S=Number.parseInt(V,16);return[S>>16&255,S>>8&255,S&255]},enumerable:!1},hexToAnsi256:{value:(I)=>L.rgbToAnsi256(...L.hexToRgb(I)),enumerable:!1},ansi256ToAnsi:{value:(I)=>{if(I<8)return 30+I;if(I<16)return 90+(I-8);let G,V,S;if(I>=232)G=((I-232)*10+8)/255,V=G,S=G;else{I-=16;let H=I%36;G=Math.floor(I/36)/5,V=Math.floor(H/6)/5,S=H%6/5}let M=Math.max(G,V,S)*2;if(M===0)return 30;let q=30+(Math.round(S)<<2|Math.round(V)<<1|Math.round(G));return M===2&&(q+=60),q},enumerable:!1},rgbToAnsi:{value:(I,G,V)=>L.ansi256ToAnsi(L.rgbToAnsi256(I,G,V)),enumerable:!1},hexToAnsi:{value:(I)=>L.ansi256ToAnsi(L.hexToAnsi256(I)),enumerable:!1}}),L}var vI=OI(),S$=new Set(["\x1B","›"]),xI=39,w$="\x07",d1="[",wI="]",t1="m",P$=`${wI}8;;`,m1=($)=>`${S$.values().next().value}${d1}${$}${t1}`,h1=($)=>`${S$.values().next().value}${P$}${$}${w$}`,PI=($)=>$.split(" ").map((I)=>D(I)),x$=($,I,G)=>{let V=[...I],S=!1,M=!1,q=D(g1($[$.length-1]));for(let[H,Z]of V.entries()){let J=D(Z);if(q+J<=G?$[$.length-1]+=Z:($.push(Z),q=0),S$.has(Z)&&(S=!0,M=V.slice(H+1).join("").startsWith(P$)),S){M?Z===w$&&(S=!1,M=!1):Z===t1&&(S=!1);continue}q+=J,q===G&&H<V.length-1&&($.push(""),q=0)}!q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},EI=($)=>{let I=$.split(" "),G=I.length;for(;G>0&&!(D(I[G-1])>0);)G--;return G===I.length?$:I.slice(0,G).join(" ")+I.slice(G).join("")},cI=($,I,G={})=>{if(G.trim!==!1&&$.trim()==="")return"";let V="",S,M,q=PI($),H=[""];for(let[J,X]of $.split(" ").entries()){G.trim!==!1&&(H[H.length-1]=H[H.length-1].trimStart());let Q=D(H[H.length-1]);if(J!==0&&(Q>=I&&(G.wordWrap===!1||G.trim===!1)&&(H.push(""),Q=0),(Q>0||G.trim===!1)&&(H[H.length-1]+=" ",Q++)),G.hard&&q[J]>I){let W=I-Q,A=1+Math.floor((q[J]-W-1)/I);Math.floor((q[J]-1)/I)<A&&H.push(""),x$(H,X,I);continue}if(Q+q[J]>I&&Q>0&&q[J]>0){if(G.wordWrap===!1&&Q<I){x$(H,X,I);continue}H.push("")}if(Q+q[J]>I&&G.wordWrap===!1){x$(H,X,I);continue}H[H.length-1]+=X}G.trim!==!1&&(H=H.map((J)=>EI(J)));let Z=[...H.join(`
3
- `)];for(let[J,X]of Z.entries()){if(V+=X,S$.has(X)){let{groups:W}=new RegExp(`(?:\\${d1}(?<code>\\d+)m|\\${P$}(?<uri>.*)${w$})`).exec(Z.slice(J).join(""))||{groups:{}};if(W.code!==void 0){let A=Number.parseFloat(W.code);S=A===xI?void 0:A}else W.uri!==void 0&&(M=W.uri.length===0?void 0:W.uri)}let Q=vI.codes.get(Number(S));Z[J+1]===`
4
- `?(M&&(V+=h1("")),S&&Q&&(V+=m1(Q))):X===`
5
- `&&(S&&Q&&(V+=m1(S)),M&&(V+=h1(M)))}return V};function k1($,I,G){return String($).normalize().replace(/\r\n/g,`
2
+ import{createRequire as V2}from"node:module";var c2=Object.create;var{getPrototypeOf:q2,defineProperty:B1,getOwnPropertyNames:n2}=Object;var M2=Object.prototype.hasOwnProperty;var f=($,b,i)=>{i=$!=null?c2(q2($)):{};let y=b||!$||!$.__esModule?B1(i,"default",{value:$,enumerable:!0}):i;for(let G of n2($))if(!M2.call(y,G))B1(y,G,{get:()=>$[G],enumerable:!0});return y};var z=($,b)=>()=>(b||$((b={exports:{}}).exports,b),b.exports);var v=V2(import.meta.url);var K$=z((Yy,Y1)=>{var W$={to($,b){if(!b)return`\x1B[${$+1}G`;return`\x1B[${b+1};${$+1}H`},move($,b){let i="";if($<0)i+=`\x1B[${-$}D`;else if($>0)i+=`\x1B[${$}C`;if(b<0)i+=`\x1B[${-b}A`;else if(b>0)i+=`\x1B[${b}B`;return i},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},U2={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},m2={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let b="";for(let i=0;i<$;i++)b+=this.line+(i<$-1?W$.up():"");if($)b+=W$.left;return b}};Y1.exports={cursor:W$,scroll:U2,erase:m2,beep:"\x07"}});var Y$=z((Ny,B$)=>{var i$=process||{},N1=i$.argv||[],b$=i$.env||{},R2=!(!!b$.NO_COLOR||N1.includes("--no-color"))&&(!!b$.FORCE_COLOR||N1.includes("--color")||i$.platform==="win32"||(i$.stdout||{}).isTTY&&b$.TERM!=="dumb"||!!b$.CI),L2=($,b,i=$)=>(y)=>{let G=""+y,S=G.indexOf(b,$.length);return~S?$+A2(G,b,i,S)+b:$+G+b},A2=($,b,i,y)=>{let G="",S=0;do G+=$.substring(S,y)+i,S=y+b.length,y=$.indexOf(b,S);while(~y);return G+$.substring(S)},j1=($=R2)=>{let b=$?L2:()=>String;return{isColorSupported:$,reset:b("\x1B[0m","\x1B[0m"),bold:b("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:b("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:b("\x1B[3m","\x1B[23m"),underline:b("\x1B[4m","\x1B[24m"),inverse:b("\x1B[7m","\x1B[27m"),hidden:b("\x1B[8m","\x1B[28m"),strikethrough:b("\x1B[9m","\x1B[29m"),black:b("\x1B[30m","\x1B[39m"),red:b("\x1B[31m","\x1B[39m"),green:b("\x1B[32m","\x1B[39m"),yellow:b("\x1B[33m","\x1B[39m"),blue:b("\x1B[34m","\x1B[39m"),magenta:b("\x1B[35m","\x1B[39m"),cyan:b("\x1B[36m","\x1B[39m"),white:b("\x1B[37m","\x1B[39m"),gray:b("\x1B[90m","\x1B[39m"),bgBlack:b("\x1B[40m","\x1B[49m"),bgRed:b("\x1B[41m","\x1B[49m"),bgGreen:b("\x1B[42m","\x1B[49m"),bgYellow:b("\x1B[43m","\x1B[49m"),bgBlue:b("\x1B[44m","\x1B[49m"),bgMagenta:b("\x1B[45m","\x1B[49m"),bgCyan:b("\x1B[46m","\x1B[49m"),bgWhite:b("\x1B[47m","\x1B[49m"),blackBright:b("\x1B[90m","\x1B[39m"),redBright:b("\x1B[91m","\x1B[39m"),greenBright:b("\x1B[92m","\x1B[39m"),yellowBright:b("\x1B[93m","\x1B[39m"),blueBright:b("\x1B[94m","\x1B[39m"),magentaBright:b("\x1B[95m","\x1B[39m"),cyanBright:b("\x1B[96m","\x1B[39m"),whiteBright:b("\x1B[97m","\x1B[39m"),bgBlackBright:b("\x1B[100m","\x1B[49m"),bgRedBright:b("\x1B[101m","\x1B[49m"),bgGreenBright:b("\x1B[102m","\x1B[49m"),bgYellowBright:b("\x1B[103m","\x1B[49m"),bgBlueBright:b("\x1B[104m","\x1B[49m"),bgMagentaBright:b("\x1B[105m","\x1B[49m"),bgCyanBright:b("\x1B[106m","\x1B[49m"),bgWhiteBright:b("\x1B[107m","\x1B[49m")}};B$.exports=j1();B$.exports.createColors=j1});var jb=z((jG,Nb)=>{Nb.exports=Yb;Yb.sync=Yi;var Kb=v("fs");function Bi($,b){var i=b.pathExt!==void 0?b.pathExt:process.env.PATHEXT;if(!i)return!0;if(i=i.split(";"),i.indexOf("")!==-1)return!0;for(var y=0;y<i.length;y++){var G=i[y].toLowerCase();if(G&&$.substr(-G.length).toLowerCase()===G)return!0}return!1}function Bb($,b,i){if(!$.isSymbolicLink()&&!$.isFile())return!1;return Bi(b,i)}function Yb($,b,i){Kb.stat($,function(y,G){i(y,y?!1:Bb(G,$,b))})}function Yi($,b){return Bb(Kb.statSync($),$,b)}});var xb=z((vG,Ob)=>{Ob.exports=wb;wb.sync=Ni;var vb=v("fs");function wb($,b,i){vb.stat($,function(y,G){i(y,y?!1:_b(G,b))})}function Ni($,b){return _b(vb.statSync($),b)}function _b($,b){return $.isFile()&&ji($,b)}function ji($,b){var{mode:i,uid:y,gid:G}=$,S=b.uid!==void 0?b.uid:process.getuid&&process.getuid(),I=b.gid!==void 0?b.gid:process.getgid&&process.getgid(),c=parseInt("100",8),M=parseInt("010",8),n=parseInt("001",8),V=c|M,U=i&n||i&M&&G===I||i&c&&y===S||i&V&&S===0;return U}});var fb=z((_G,Pb)=>{var wG=v("fs"),M$;if(process.platform==="win32"||global.TESTING_WINDOWS)M$=jb();else M$=xb();Pb.exports=g$;g$.sync=vi;function g$($,b,i){if(typeof b==="function")i=b,b={};if(!i){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(y,G){g$($,b||{},function(S,I){if(S)G(S);else y(I)})})}M$($,b||{},function(y,G){if(y){if(y.code==="EACCES"||b&&b.ignoreErrors)y=null,G=!1}i(y,G)})}function vi($,b){try{return M$.sync($,b||{})}catch(i){if(b&&b.ignoreErrors||i.code==="EACCES")return!1;else throw i}}});var gb=z((OG,ub)=>{var u=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",tb=v("path"),wi=u?";":":",hb=fb(),Eb=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),Cb=($,b)=>{let i=b.colon||wi,y=$.match(/\//)||u&&$.match(/\\/)?[""]:[...u?[process.cwd()]:[],...(b.path||process.env.PATH||"").split(i)],G=u?b.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",S=u?G.split(i):[""];if(u){if($.indexOf(".")!==-1&&S[0]!=="")S.unshift("")}return{pathEnv:y,pathExt:S,pathExtExe:G}},kb=($,b,i)=>{if(typeof b==="function")i=b,b={};if(!b)b={};let{pathEnv:y,pathExt:G,pathExtExe:S}=Cb($,b),I=[],c=(n)=>new Promise((V,U)=>{if(n===y.length)return b.all&&I.length?V(I):U(Eb($));let m=y[n],T=/^".*"$/.test(m)?m.slice(1,-1):m,X=tb.join(T,$),j=!T&&/^\.[\\\/]/.test($)?$.slice(0,2)+X:X;V(M(j,n,0))}),M=(n,V,U)=>new Promise((m,T)=>{if(U===G.length)return m(c(V+1));let X=G[U];hb(n+X,{pathExt:S},(j,P)=>{if(!j&&P)if(b.all)I.push(n+X);else return m(n+X);return m(M(n,V,U+1))})});return i?c(0).then((n)=>i(null,n),i):c(0)},_i=($,b)=>{b=b||{};let{pathEnv:i,pathExt:y,pathExtExe:G}=Cb($,b),S=[];for(let I=0;I<i.length;I++){let c=i[I],M=/^".*"$/.test(c)?c.slice(1,-1):c,n=tb.join(M,$),V=!M&&/^\.[\\\/]/.test($)?$.slice(0,2)+n:n;for(let U=0;U<y.length;U++){let m=V+y[U];try{if(hb.sync(m,{pathExt:G}))if(b.all)S.push(m);else return m}catch(T){}}}if(b.all&&S.length)return S;if(b.nothrow)return null;throw Eb($)};ub.exports=kb;kb.sync=_i});var lb=z((xG,F$)=>{var Fb=($={})=>{let b=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(b).reverse().find((y)=>y.toUpperCase()==="PATH")||"Path"};F$.exports=Fb;F$.exports.default=Fb});var ob=z((PG,rb)=>{var ab=v("path"),Oi=gb(),xi=lb();function db($,b){let i=$.options.env||process.env,y=process.cwd(),G=$.options.cwd!=null,S=G&&process.chdir!==void 0&&!process.chdir.disabled;if(S)try{process.chdir($.options.cwd)}catch(c){}let I;try{I=Oi.sync($.command,{path:i[xi({env:i})],pathExt:b?ab.delimiter:void 0})}catch(c){}finally{if(S)process.chdir(y)}if(I)I=ab.resolve(G?$.options.cwd:"",I);return I}function Pi($){return db($)||db($,!0)}rb.exports=Pi});var Db=z((hi,a$)=>{var l$=/([()\][%!^"`<>&|;, *?])/g;function fi($){return $=$.replace(l$,"^$1"),$}function ti($,b){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(l$,"^$1"),b)$=$.replace(l$,"^$1");return $}hi.command=fi;hi.argument=ti});var sb=z((fG,pb)=>{pb.exports=/^#!(.*)/});var $0=z((tG,eb)=>{var ki=sb();eb.exports=($="")=>{let b=$.match(ki);if(!b)return null;let[i,y]=b[0].replace(/#! ?/,"").split(" "),G=i.split("/").pop();if(G==="env")return y;return y?`${G} ${y}`:G}});var i0=z((hG,b0)=>{var d$=v("fs"),ui=$0();function gi($){let i=Buffer.alloc(150),y;try{y=d$.openSync($,"r"),d$.readSync(y,i,0,150,0),d$.closeSync(y)}catch(G){}return ui(i.toString())}b0.exports=gi});var S0=z((EG,G0)=>{var Fi=v("path"),I0=ob(),y0=Db(),li=i0(),ai=process.platform==="win32",di=/\.(?:com|exe)$/i,ri=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function oi($){$.file=I0($);let b=$.file&&li($.file);if(b)return $.args.unshift($.file),$.command=b,I0($);return $.file}function Di($){if(!ai)return $;let b=oi($),i=!di.test(b);if($.options.forceShell||i){let y=ri.test(b);$.command=Fi.normalize($.command),$.command=y0.command($.command),$.args=$.args.map((S)=>y0.argument(S,y));let G=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${G}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function pi($,b,i){if(b&&!Array.isArray(b))i=b,b=null;b=b?b.slice(0):[],i=Object.assign({},i);let y={command:$,args:b,options:i,file:void 0,original:{command:$,args:b}};return i.shell?y:Di(y)}G0.exports=pi});var n0=z((CG,q0)=>{var r$=process.platform==="win32";function o$($,b){return Object.assign(Error(`${b} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${b} ${$.command}`,path:$.command,spawnargs:$.args})}function si($,b){if(!r$)return;let i=$.emit;$.emit=function(y,G){if(y==="exit"){let S=c0(G,b);if(S)return i.call($,"error",S)}return i.apply($,arguments)}}function c0($,b){if(r$&&$===1&&!b.file)return o$(b.original,"spawn");return null}function ei($,b){if(r$&&$===1&&!b.file)return o$(b.original,"spawnSync");return null}q0.exports={hookChildProcess:si,verifyENOENT:c0,verifyENOENTSync:ei,notFoundError:o$}});var U0=z((kG,g)=>{var M0=v("child_process"),D$=S0(),p$=n0();function V0($,b,i){let y=D$($,b,i),G=M0.spawn(y.command,y.args,y.options);return p$.hookChildProcess(G,y),G}function $I($,b,i){let y=D$($,b,i),G=M0.spawnSync(y.command,y.args,y.options);return G.error=G.error||p$.verifyENOENTSync(G.status,y),G}g.exports=V0;g.exports.spawn=V0;g.exports.sync=$I;g.exports._parse=D$;g.exports._enoent=p$});var u0=z((aS,k0)=>{var{PassThrough:sI}=v("stream");k0.exports=function(){var $=[],b=new sI({objectMode:!0});return b.setMaxListeners(0),b.add=i,b.isEmpty=y,b.on("unpipe",G),Array.prototype.slice.call(arguments).forEach(i),b;function i(S){if(Array.isArray(S))return S.forEach(i),this;return $.push(S),S.once("end",G.bind(null,S)),S.once("error",b.emit.bind(b,"error")),S.pipe(b,{end:!1}),this}function y(){return $.length==0}function G(S){if($=$.filter(function(I){return I!==S}),!$.length&&b.readable)b.end()}}});var W=f(K$(),1),y$=f(Y$(),1);import{stdin as E1,stdout as C1}from"node:process";import*as _ from"node:readline";import v1 from"node:readline";import{WriteStream as H2}from"node:tty";function J2({onlyFirst:$=!1}={}){let b=["[\\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(b,$?void 0:"g")}var Q2=J2();function k1($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(Q2,"")}function u1($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var g1={exports:{}};(function($){var b={};$.exports=b,b.eastAsianWidth=function(y){var G=y.charCodeAt(0),S=y.length==2?y.charCodeAt(1):0,I=G;return 55296<=G&&G<=56319&&56320<=S&&S<=57343&&(G&=1023,S&=1023,I=G<<10|S,I+=65536),I==12288||65281<=I&&I<=65376||65504<=I&&I<=65510?"F":I==8361||65377<=I&&I<=65470||65474<=I&&I<=65479||65482<=I&&I<=65487||65490<=I&&I<=65495||65498<=I&&I<=65500||65512<=I&&I<=65518?"H":4352<=I&&I<=4447||4515<=I&&I<=4519||4602<=I&&I<=4607||9001<=I&&I<=9002||11904<=I&&I<=11929||11931<=I&&I<=12019||12032<=I&&I<=12245||12272<=I&&I<=12283||12289<=I&&I<=12350||12353<=I&&I<=12438||12441<=I&&I<=12543||12549<=I&&I<=12589||12593<=I&&I<=12686||12688<=I&&I<=12730||12736<=I&&I<=12771||12784<=I&&I<=12830||12832<=I&&I<=12871||12880<=I&&I<=13054||13056<=I&&I<=19903||19968<=I&&I<=42124||42128<=I&&I<=42182||43360<=I&&I<=43388||44032<=I&&I<=55203||55216<=I&&I<=55238||55243<=I&&I<=55291||63744<=I&&I<=64255||65040<=I&&I<=65049||65072<=I&&I<=65106||65108<=I&&I<=65126||65128<=I&&I<=65131||110592<=I&&I<=110593||127488<=I&&I<=127490||127504<=I&&I<=127546||127552<=I&&I<=127560||127568<=I&&I<=127569||131072<=I&&I<=194367||177984<=I&&I<=196605||196608<=I&&I<=262141?"W":32<=I&&I<=126||162<=I&&I<=163||165<=I&&I<=166||I==172||I==175||10214<=I&&I<=10221||10629<=I&&I<=10630?"Na":I==161||I==164||167<=I&&I<=168||I==170||173<=I&&I<=174||176<=I&&I<=180||182<=I&&I<=186||188<=I&&I<=191||I==198||I==208||215<=I&&I<=216||222<=I&&I<=225||I==230||232<=I&&I<=234||236<=I&&I<=237||I==240||242<=I&&I<=243||247<=I&&I<=250||I==252||I==254||I==257||I==273||I==275||I==283||294<=I&&I<=295||I==299||305<=I&&I<=307||I==312||319<=I&&I<=322||I==324||328<=I&&I<=331||I==333||338<=I&&I<=339||358<=I&&I<=359||I==363||I==462||I==464||I==466||I==468||I==470||I==472||I==474||I==476||I==593||I==609||I==708||I==711||713<=I&&I<=715||I==717||I==720||728<=I&&I<=731||I==733||I==735||768<=I&&I<=879||913<=I&&I<=929||931<=I&&I<=937||945<=I&&I<=961||963<=I&&I<=969||I==1025||1040<=I&&I<=1103||I==1105||I==8208||8211<=I&&I<=8214||8216<=I&&I<=8217||8220<=I&&I<=8221||8224<=I&&I<=8226||8228<=I&&I<=8231||I==8240||8242<=I&&I<=8243||I==8245||I==8251||I==8254||I==8308||I==8319||8321<=I&&I<=8324||I==8364||I==8451||I==8453||I==8457||I==8467||I==8470||8481<=I&&I<=8482||I==8486||I==8491||8531<=I&&I<=8532||8539<=I&&I<=8542||8544<=I&&I<=8555||8560<=I&&I<=8569||I==8585||8592<=I&&I<=8601||8632<=I&&I<=8633||I==8658||I==8660||I==8679||I==8704||8706<=I&&I<=8707||8711<=I&&I<=8712||I==8715||I==8719||I==8721||I==8725||I==8730||8733<=I&&I<=8736||I==8739||I==8741||8743<=I&&I<=8748||I==8750||8756<=I&&I<=8759||8764<=I&&I<=8765||I==8776||I==8780||I==8786||8800<=I&&I<=8801||8804<=I&&I<=8807||8810<=I&&I<=8811||8814<=I&&I<=8815||8834<=I&&I<=8835||8838<=I&&I<=8839||I==8853||I==8857||I==8869||I==8895||I==8978||9312<=I&&I<=9449||9451<=I&&I<=9547||9552<=I&&I<=9587||9600<=I&&I<=9615||9618<=I&&I<=9621||9632<=I&&I<=9633||9635<=I&&I<=9641||9650<=I&&I<=9651||9654<=I&&I<=9655||9660<=I&&I<=9661||9664<=I&&I<=9665||9670<=I&&I<=9672||I==9675||9678<=I&&I<=9681||9698<=I&&I<=9701||I==9711||9733<=I&&I<=9734||I==9737||9742<=I&&I<=9743||9748<=I&&I<=9749||I==9756||I==9758||I==9792||I==9794||9824<=I&&I<=9825||9827<=I&&I<=9829||9831<=I&&I<=9834||9836<=I&&I<=9837||I==9839||9886<=I&&I<=9887||9918<=I&&I<=9919||9924<=I&&I<=9933||9935<=I&&I<=9953||I==9955||9960<=I&&I<=9983||I==10045||I==10071||10102<=I&&I<=10111||11093<=I&&I<=11097||12872<=I&&I<=12879||57344<=I&&I<=63743||65024<=I&&I<=65039||I==65533||127232<=I&&I<=127242||127248<=I&&I<=127277||127280<=I&&I<=127337||127344<=I&&I<=127386||917760<=I&&I<=917999||983040<=I&&I<=1048573||1048576<=I&&I<=1114109?"A":"N"},b.characterLength=function(y){var G=this.eastAsianWidth(y);return G=="F"||G=="W"||G=="A"?2:1};function i(y){return y.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}b.length=function(y){for(var G=i(y),S=0,I=0;I<G.length;I++)S=S+this.characterLength(G[I]);return S},b.slice=function(y,G,S){textLen=b.length(y),G=G||0,S=S||1,G<0&&(G=textLen+G),S<0&&(S=textLen+S);for(var I="",c=0,M=i(y),n=0;n<M.length;n++){var V=M[n],U=b.length(V);if(c>=G-(U==2?1:0))if(c+U<=S)I+=V;else break;c+=U}return I}})(g1);var T2=g1.exports,Z2=u1(T2),X2=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},z2=u1(X2);function F($,b={}){if(typeof $!="string"||$.length===0||(b={ambiguousIsNarrow:!0,...b},$=k1($),$.length===0))return 0;$=$.replace(z2()," ");let i=b.ambiguousIsNarrow?1:2,y=0;for(let G of $){let S=G.codePointAt(0);if(S<=31||S>=127&&S<=159||S>=768&&S<=879)continue;switch(Z2.eastAsianWidth(G)){case"F":case"W":y+=2;break;case"A":y+=i;break;default:y+=1}}return y}var N$=10,w1=($=0)=>(b)=>`\x1B[${b+$}m`,_1=($=0)=>(b)=>`\x1B[${38+$};5;${b}m`,O1=($=0)=>(b,i,y)=>`\x1B[${38+$};2;${b};${i};${y}m`,L={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(L.modifier);var W2=Object.keys(L.color),K2=Object.keys(L.bgColor);[...W2,...K2];function B2(){let $=new Map;for(let[b,i]of Object.entries(L)){for(let[y,G]of Object.entries(i))L[y]={open:`\x1B[${G[0]}m`,close:`\x1B[${G[1]}m`},i[y]=L[y],$.set(G[0],G[1]);Object.defineProperty(L,b,{value:i,enumerable:!1})}return Object.defineProperty(L,"codes",{value:$,enumerable:!1}),L.color.close="\x1B[39m",L.bgColor.close="\x1B[49m",L.color.ansi=w1(),L.color.ansi256=_1(),L.color.ansi16m=O1(),L.bgColor.ansi=w1(N$),L.bgColor.ansi256=_1(N$),L.bgColor.ansi16m=O1(N$),Object.defineProperties(L,{rgbToAnsi256:{value:(b,i,y)=>b===i&&i===y?b<8?16:b>248?231:Math.round((b-8)/247*24)+232:16+36*Math.round(b/255*5)+6*Math.round(i/255*5)+Math.round(y/255*5),enumerable:!1},hexToRgb:{value:(b)=>{let i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(b.toString(16));if(!i)return[0,0,0];let[y]=i;y.length===3&&(y=[...y].map((S)=>S+S).join(""));let G=Number.parseInt(y,16);return[G>>16&255,G>>8&255,G&255]},enumerable:!1},hexToAnsi256:{value:(b)=>L.rgbToAnsi256(...L.hexToRgb(b)),enumerable:!1},ansi256ToAnsi:{value:(b)=>{if(b<8)return 30+b;if(b<16)return 90+(b-8);let i,y,G;if(b>=232)i=((b-232)*10+8)/255,y=i,G=i;else{b-=16;let c=b%36;i=Math.floor(b/36)/5,y=Math.floor(c/6)/5,G=c%6/5}let S=Math.max(i,y,G)*2;if(S===0)return 30;let I=30+(Math.round(G)<<2|Math.round(y)<<1|Math.round(i));return S===2&&(I+=60),I},enumerable:!1},rgbToAnsi:{value:(b,i,y)=>L.ansi256ToAnsi(L.rgbToAnsi256(b,i,y)),enumerable:!1},hexToAnsi:{value:(b)=>L.ansi256ToAnsi(L.hexToAnsi256(b)),enumerable:!1}}),L}var Y2=B2(),G$=new Set(["\x1B","›"]),N2=39,v$="\x07",F1="[",j2="]",l1="m",w$=`${j2}8;;`,x1=($)=>`${G$.values().next().value}${F1}${$}${l1}`,P1=($)=>`${G$.values().next().value}${w$}${$}${v$}`,v2=($)=>$.split(" ").map((b)=>F(b)),j$=($,b,i)=>{let y=[...b],G=!1,S=!1,I=F(k1($[$.length-1]));for(let[c,M]of y.entries()){let n=F(M);if(I+n<=i?$[$.length-1]+=M:($.push(M),I=0),G$.has(M)&&(G=!0,S=y.slice(c+1).join("").startsWith(w$)),G){S?M===v$&&(G=!1,S=!1):M===l1&&(G=!1);continue}I+=n,I===i&&c<y.length-1&&($.push(""),I=0)}!I&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},w2=($)=>{let b=$.split(" "),i=b.length;for(;i>0&&!(F(b[i-1])>0);)i--;return i===b.length?$:b.slice(0,i).join(" ")+b.slice(i).join("")},_2=($,b,i={})=>{if(i.trim!==!1&&$.trim()==="")return"";let y="",G,S,I=v2($),c=[""];for(let[n,V]of $.split(" ").entries()){i.trim!==!1&&(c[c.length-1]=c[c.length-1].trimStart());let U=F(c[c.length-1]);if(n!==0&&(U>=b&&(i.wordWrap===!1||i.trim===!1)&&(c.push(""),U=0),(U>0||i.trim===!1)&&(c[c.length-1]+=" ",U++)),i.hard&&I[n]>b){let m=b-U,T=1+Math.floor((I[n]-m-1)/b);Math.floor((I[n]-1)/b)<T&&c.push(""),j$(c,V,b);continue}if(U+I[n]>b&&U>0&&I[n]>0){if(i.wordWrap===!1&&U<b){j$(c,V,b);continue}c.push("")}if(U+I[n]>b&&i.wordWrap===!1){j$(c,V,b);continue}c[c.length-1]+=V}i.trim!==!1&&(c=c.map((n)=>w2(n)));let M=[...c.join(`
3
+ `)];for(let[n,V]of M.entries()){if(y+=V,G$.has(V)){let{groups:m}=new RegExp(`(?:\\${F1}(?<code>\\d+)m|\\${w$}(?<uri>.*)${v$})`).exec(M.slice(n).join(""))||{groups:{}};if(m.code!==void 0){let T=Number.parseFloat(m.code);G=T===N2?void 0:T}else m.uri!==void 0&&(S=m.uri.length===0?void 0:m.uri)}let U=Y2.codes.get(Number(G));M[n+1]===`
4
+ `?(S&&(y+=P1("")),G&&U&&(y+=x1(U))):V===`
5
+ `&&(G&&U&&(y+=x1(G)),S&&(y+=P1(S)))}return y};function f1($,b,i){return String($).normalize().replace(/\r\n/g,`
6
6
  `).split(`
7
- `).map((V)=>cI(V,I,G)).join(`
8
- `)}var CI=Object.defineProperty,mI=($,I,G)=>(I in $)?CI($,I,{enumerable:!0,configurable:!0,writable:!0,value:G}):$[I]=G,y=($,I,G)=>(mI($,typeof I!="symbol"?I+"":I,G),G);function hI($,I){if($===I)return;let G=$.split(`
9
- `),V=I.split(`
10
- `),S=[];for(let M=0;M<Math.max(G.length,V.length);M++)G[M]!==V[M]&&S.push(M);return S}var l1=Symbol("clack:cancel");function d($){return $===l1}function q$($,I){$.isTTY&&$.setRawMode(I)}var n1=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),kI=new Set(["up","down","left","right","space","enter"]);class M${constructor({render:$,input:I=u1,output:G=f1,...V},S=!0){y(this,"input"),y(this,"output"),y(this,"rl"),y(this,"opts"),y(this,"_track",!1),y(this,"_render"),y(this,"_cursor",0),y(this,"state","initial"),y(this,"value"),y(this,"error",""),y(this,"subscribers",new Map),y(this,"_prevFrame",""),this.opts=V,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=S,this.input=I,this.output=G}prompt(){let $=new BI(0);return $._write=(I,G,V)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),V()},this.input.pipe($),this.rl=P1.createInterface({input:this.input,output:$,tabSize:2,prompt:"",escapeCodeTimeout:50}),P1.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),q$(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((I,G)=>{this.once("submit",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),q$(this.input,!1),I(this.value)}),this.once("cancel",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),q$(this.input,!1),I(l1)})})}on($,I){let G=this.subscribers.get($)??[];G.push({cb:I}),this.subscribers.set($,G)}once($,I){let G=this.subscribers.get($)??[];G.push({cb:I,once:!0}),this.subscribers.set($,G)}emit($,...I){let G=this.subscribers.get($)??[],V=[];for(let S of G)S.cb(...I),S.once&&V.push(()=>G.splice(G.indexOf(S),1));for(let S of V)S()}unsubscribe(){this.subscribers.clear()}onKeypress($,I){if(this.state==="error"&&(this.state="active"),I?.name&&!this._track&&n1.has(I.name)&&this.emit("cursor",n1.get(I.name)),I?.name&&kI.has(I.name)&&this.emit("cursor",I.name),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),I?.name==="return"){if(this.opts.validate){let G=this.opts.validate(this.value);G&&(this.error=G,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}$==="\x03"&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
11
- `),q$(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=k1(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
12
- `).length-1;this.output.write(z.cursor.move(-999,$*-1))}render(){let $=k1(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(z.cursor.hide);else{let I=hI(this._prevFrame,$);if(this.restoreCursor(),I&&I?.length===1){let G=I[0];this.output.write(z.cursor.move(0,G)),this.output.write(z.erase.lines(1));let V=$.split(`
13
- `);this.output.write(V[G]),this._prevFrame=$,this.output.write(z.cursor.move(0,V.length-G-1));return}else if(I&&I?.length>1){let G=I[0];this.output.write(z.cursor.move(0,G)),this.output.write(z.erase.down());let V=$.split(`
14
- `).slice(G);this.output.write(V.join(`
15
- `)),this._prevFrame=$;return}this.output.write(z.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class E$ extends M${get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(I)=>{this.output.write(z.cursor.move(0,-1)),this.value=I,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var nI=Object.defineProperty,FI=($,I,G)=>(I in $)?nI($,I,{enumerable:!0,configurable:!0,writable:!0,value:G}):$[I]=G,F1=($,I,G)=>(FI($,typeof I!="symbol"?I+"":I,G),G),p1=class extends M${constructor($){super($,!1),F1(this,"options"),F1(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:I})=>I===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(I)=>{switch(I){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var uI=Object.defineProperty,fI=($,I,G)=>(I in $)?uI($,I,{enumerable:!0,configurable:!0,writable:!0,value:G}):$[I]=G,gI=($,I,G)=>(fI($,typeof I!="symbol"?I+"":I,G),G);class c$ extends M${constructor($){super($),gI(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=$.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${V$.default.inverse(V$.default.hidden("_"))}`;else{let I=this.value.slice(0,this.cursor),G=this.value.slice(this.cursor);this.valueWithCursor=`${I}${V$.default.inverse(G[0])}${G.slice(1)}`}})}get cursor(){return this._cursor}}var iI=globalThis.process.platform.startsWith("win");function r1({input:$=u1,output:I=f1,overwrite:G=!0,hideCursor:V=!0}={}){let S=P.createInterface({input:$,output:I,prompt:"",tabSize:1});P.emitKeypressEvents($,S),$.isTTY&&$.setRawMode(!0);let M=(q,{name:H})=>{if(String(q)==="\x03"){V&&I.write(z.cursor.show),process.exit(0);return}if(!G)return;P.moveCursor(I,H==="return"?0:-1,H==="return"?-1:0,()=>{P.clearLine(I,1,()=>{$.once("keypress",M)})})};return V&&I.write(z.cursor.hide),$.once("keypress",M),()=>{$.off("keypress",M),V&&I.write(z.cursor.show),$.isTTY&&!iI&&$.setRawMode(!1),S.terminal=!1,S.close()}}var U=m(O$(),1),h=m(y$(),1);import O from"node:process";function DI(){return O.platform!=="win32"?O.env.TERM!=="linux":Boolean(O.env.CI)||Boolean(O.env.WT_SESSION)||Boolean(O.env.TERMINUS_SUBLIME)||O.env.ConEmuTask==="{cmd::Cmder}"||O.env.TERM_PROGRAM==="Terminus-Sublime"||O.env.TERM_PROGRAM==="vscode"||O.env.TERM==="xterm-256color"||O.env.TERM==="alacritty"||O.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var C$=DI(),K=($,I)=>C$?$:I,dI=K("◆","*"),o1=K("■","x"),a1=K("▲","x"),k$=K("◇","o"),tI=K("┌","T"),B=K("│","|"),k=K("└","—"),m$=K("●",">"),h$=K("○"," "),p3=K("◻","[•]"),r3=K("◼","[+]"),o3=K("◻","[ ]"),a3=K("▪","•"),s3=K("─","-"),e3=K("╮","+"),$4=K("├","+"),I4=K("╯","+"),lI=K("●","•"),pI=K("◆","*"),rI=K("▲","!"),oI=K("■","x"),n$=($)=>{switch($){case"initial":case"active":return U.default.cyan(dI);case"cancel":return U.default.red(o1);case"error":return U.default.yellow(a1);case"submit":return U.default.green(k$)}},s1=($)=>new c$({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let I=`${U.default.gray(B)}
16
- ${n$(this.state)} ${$.message}
17
- `,G=$.placeholder?U.default.inverse($.placeholder[0])+U.default.dim($.placeholder.slice(1)):U.default.inverse(U.default.hidden("_")),V=this.value?this.valueWithCursor:G;switch(this.state){case"error":return`${I.trim()}
18
- ${U.default.yellow(B)} ${V}
19
- ${U.default.yellow(k)} ${U.default.yellow(this.error)}
20
- `;case"submit":return`${I}${U.default.gray(B)} ${U.default.dim(this.value||$.placeholder)}`;case"cancel":return`${I}${U.default.gray(B)} ${U.default.strikethrough(U.default.dim(this.value??""))}${this.value?.trim()?`
21
- `+U.default.gray(B):""}`;default:return`${I}${U.default.cyan(B)} ${V}
22
- ${U.default.cyan(k)}
23
- `}}}).prompt();var n=($)=>{let I=$.active??"Yes",G=$.inactive??"No";return new E$({active:I,inactive:G,initialValue:$.initialValue??!0,render(){let V=`${U.default.gray(B)}
24
- ${n$(this.state)} ${$.message}
25
- `,S=this.value?I:G;switch(this.state){case"submit":return`${V}${U.default.gray(B)} ${U.default.dim(S)}`;case"cancel":return`${V}${U.default.gray(B)} ${U.default.strikethrough(U.default.dim(S))}
26
- ${U.default.gray(B)}`;default:return`${V}${U.default.cyan(B)} ${this.value?`${U.default.green(m$)} ${I}`:`${U.default.dim(h$)} ${U.default.dim(I)}`} ${U.default.dim("/")} ${this.value?`${U.default.dim(h$)} ${U.default.dim(G)}`:`${U.default.green(m$)} ${G}`}
27
- ${U.default.cyan(k)}
28
- `}}}).prompt()},F$=($)=>{let I=(V,S)=>{let M=V.label??String(V.value);return S==="active"?`${U.default.green(m$)} ${M} ${V.hint?U.default.dim(`(${V.hint})`):""}`:S==="selected"?`${U.default.dim(M)}`:S==="cancelled"?`${U.default.strikethrough(U.default.dim(M))}`:`${U.default.dim(h$)} ${U.default.dim(M)}`},G=0;return new p1({options:$.options,initialValue:$.initialValue,render(){let V=`${U.default.gray(B)}
29
- ${n$(this.state)} ${$.message}
30
- `;switch(this.state){case"submit":return`${V}${U.default.gray(B)} ${I(this.options[this.cursor],"selected")}`;case"cancel":return`${V}${U.default.gray(B)} ${I(this.options[this.cursor],"cancelled")}
31
- ${U.default.gray(B)}`;default:{let S=$.maxItems===void 0?1/0:Math.max($.maxItems,5);this.cursor>=G+S-3?G=Math.max(Math.min(this.cursor-S+3,this.options.length-S),0):this.cursor<G+2&&(G=Math.max(this.cursor-2,0));let M=S<this.options.length&&G>0,q=S<this.options.length&&G+S<this.options.length;return`${V}${U.default.cyan(B)} ${this.options.slice(G,G+S).map((H,Z,J)=>Z===0&&M?U.default.dim("..."):Z===J.length-1&&q?U.default.dim("..."):I(H,Z+G===this.cursor?"active":"inactive")).join(`
32
- ${U.default.cyan(B)} `)}
33
- ${U.default.cyan(k)}
34
- `}}}}).prompt()};var e1=($="")=>{process.stdout.write(`${U.default.gray(k)} ${U.default.red($)}
35
-
36
- `)},$0=($="")=>{process.stdout.write(`${U.default.gray(tI)} ${$}
37
- `)},I0=($="")=>{process.stdout.write(`${U.default.gray(B)}
38
- ${U.default.gray(k)} ${$}
39
-
40
- `)},T={message:($="",{symbol:I=U.default.gray(B)}={})=>{let G=[`${U.default.gray(B)}`];if($){let[V,...S]=$.split(`
41
- `);G.push(`${I} ${V}`,...S.map((M)=>`${U.default.gray(B)} ${M}`))}process.stdout.write(`${G.join(`
7
+ `).map((y)=>_2(y,b,i)).join(`
8
+ `)}var O2=Object.defineProperty,x2=($,b,i)=>(b in $)?O2($,b,{enumerable:!0,configurable:!0,writable:!0,value:i}):$[b]=i,K=($,b,i)=>(x2($,typeof b!="symbol"?b+"":b,i),i);function P2($,b){if($===b)return;let i=$.split(`
9
+ `),y=b.split(`
10
+ `),G=[];for(let S=0;S<Math.max(i.length,y.length);S++)i[S]!==y[S]&&G.push(S);return G}var a1=Symbol("clack:cancel");function w($){return $===a1}function I$($,b){$.isTTY&&$.setRawMode(b)}var t1=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),f2=new Set(["up","down","left","right","space","enter"]);class S${constructor({render:$,input:b=E1,output:i=C1,...y},G=!0){K(this,"input"),K(this,"output"),K(this,"rl"),K(this,"opts"),K(this,"_track",!1),K(this,"_render"),K(this,"_cursor",0),K(this,"state","initial"),K(this,"value"),K(this,"error",""),K(this,"subscribers",new Map),K(this,"_prevFrame",""),this.opts=y,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=G,this.input=b,this.output=i}prompt(){let $=new H2(0);return $._write=(b,i,y)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),y()},this.input.pipe($),this.rl=v1.createInterface({input:this.input,output:$,tabSize:2,prompt:"",escapeCodeTimeout:50}),v1.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),I$(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((b,i)=>{this.once("submit",()=>{this.output.write(W.cursor.show),this.output.off("resize",this.render),I$(this.input,!1),b(this.value)}),this.once("cancel",()=>{this.output.write(W.cursor.show),this.output.off("resize",this.render),I$(this.input,!1),b(a1)})})}on($,b){let i=this.subscribers.get($)??[];i.push({cb:b}),this.subscribers.set($,i)}once($,b){let i=this.subscribers.get($)??[];i.push({cb:b,once:!0}),this.subscribers.set($,i)}emit($,...b){let i=this.subscribers.get($)??[],y=[];for(let G of i)G.cb(...b),G.once&&y.push(()=>i.splice(i.indexOf(G),1));for(let G of y)G()}unsubscribe(){this.subscribers.clear()}onKeypress($,b){if(this.state==="error"&&(this.state="active"),b?.name&&!this._track&&t1.has(b.name)&&this.emit("cursor",t1.get(b.name)),b?.name&&f2.has(b.name)&&this.emit("cursor",b.name),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),b?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}$==="\x03"&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
11
+ `),I$(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=f1(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
12
+ `).length-1;this.output.write(W.cursor.move(-999,$*-1))}render(){let $=f1(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(W.cursor.hide);else{let b=P2(this._prevFrame,$);if(this.restoreCursor(),b&&b?.length===1){let i=b[0];this.output.write(W.cursor.move(0,i)),this.output.write(W.erase.lines(1));let y=$.split(`
13
+ `);this.output.write(y[i]),this._prevFrame=$,this.output.write(W.cursor.move(0,y.length-i-1));return}else if(b&&b?.length>1){let i=b[0];this.output.write(W.cursor.move(0,i)),this.output.write(W.erase.down());let y=$.split(`
14
+ `).slice(i);this.output.write(y.join(`
15
+ `)),this._prevFrame=$;return}this.output.write(W.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class _$ extends S${get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(b)=>{this.output.write(W.cursor.move(0,-1)),this.value=b,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var t2=Object.defineProperty,h2=($,b,i)=>(b in $)?t2($,b,{enumerable:!0,configurable:!0,writable:!0,value:i}):$[b]=i,h1=($,b,i)=>(h2($,typeof b!="symbol"?b+"":b,i),i),d1=class extends S${constructor($){super($,!1),h1(this,"options"),h1(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:b})=>b===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(b)=>{switch(b){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var E2=Object.defineProperty,C2=($,b,i)=>(b in $)?E2($,b,{enumerable:!0,configurable:!0,writable:!0,value:i}):$[b]=i,k2=($,b,i)=>(C2($,typeof b!="symbol"?b+"":b,i),i);class O$ extends S${constructor($){super($),k2(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=$.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${y$.default.inverse(y$.default.hidden("_"))}`;else{let b=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.valueWithCursor=`${b}${y$.default.inverse(i[0])}${i.slice(1)}`}})}get cursor(){return this._cursor}}var u2=globalThis.process.platform.startsWith("win");function r1({input:$=E1,output:b=C1,overwrite:i=!0,hideCursor:y=!0}={}){let G=_.createInterface({input:$,output:b,prompt:"",tabSize:1});_.emitKeypressEvents($,G),$.isTTY&&$.setRawMode(!0);let S=(I,{name:c})=>{if(String(I)==="\x03"){y&&b.write(W.cursor.show),process.exit(0);return}if(!i)return;_.moveCursor(b,c==="return"?0:-1,c==="return"?-1:0,()=>{_.clearLine(b,1,()=>{$.once("keypress",S)})})};return y&&b.write(W.cursor.hide),$.once("keypress",S),()=>{$.off("keypress",S),y&&b.write(W.cursor.show),$.isTTY&&!u2&&$.setRawMode(!1),G.terminal=!1,G.close()}}var q=f(Y$(),1),t=f(K$(),1);import Y from"node:process";function g2(){return Y.platform!=="win32"?Y.env.TERM!=="linux":Boolean(Y.env.CI)||Boolean(Y.env.WT_SESSION)||Boolean(Y.env.TERMINUS_SUBLIME)||Y.env.ConEmuTask==="{cmd::Cmder}"||Y.env.TERM_PROGRAM==="Terminus-Sublime"||Y.env.TERM_PROGRAM==="vscode"||Y.env.TERM==="xterm-256color"||Y.env.TERM==="alacritty"||Y.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var x$=g2(),Q=($,b)=>x$?$:b,F2=Q("◆","*"),o1=Q("■","x"),D1=Q("▲","x"),t$=Q("◇","o"),l2=Q("┌","T"),J=Q("│","|"),h=Q("└","—"),P$=Q("●",">"),f$=Q("○"," "),Cy=Q("◻","[•]"),ky=Q("◼","[+]"),uy=Q("◻","[ ]"),gy=Q("▪","•"),Fy=Q("─","-"),ly=Q("╮","+"),ay=Q("├","+"),dy=Q("╯","+"),a2=Q("●","•"),d2=Q("◆","*"),r2=Q("▲","!"),o2=Q("■","x"),h$=($)=>{switch($){case"initial":case"active":return q.default.cyan(F2);case"cancel":return q.default.red(o1);case"error":return q.default.yellow(D1);case"submit":return q.default.green(t$)}},p1=($)=>new O$({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let b=`${q.default.gray(J)}
16
+ ${h$(this.state)} ${$.message}
17
+ `,i=$.placeholder?q.default.inverse($.placeholder[0])+q.default.dim($.placeholder.slice(1)):q.default.inverse(q.default.hidden("_")),y=this.value?this.valueWithCursor:i;switch(this.state){case"error":return`${b.trim()}
18
+ ${q.default.yellow(J)} ${y}
19
+ ${q.default.yellow(h)} ${q.default.yellow(this.error)}
20
+ `;case"submit":return`${b}${q.default.gray(J)} ${q.default.dim(this.value||$.placeholder)}`;case"cancel":return`${b}${q.default.gray(J)} ${q.default.strikethrough(q.default.dim(this.value??""))}${this.value?.trim()?`
21
+ `+q.default.gray(J):""}`;default:return`${b}${q.default.cyan(J)} ${y}
22
+ ${q.default.cyan(h)}
23
+ `}}}).prompt();var l=($)=>{let b=$.active??"Yes",i=$.inactive??"No";return new _$({active:b,inactive:i,initialValue:$.initialValue??!0,render(){let y=`${q.default.gray(J)}
24
+ ${h$(this.state)} ${$.message}
25
+ `,G=this.value?b:i;switch(this.state){case"submit":return`${y}${q.default.gray(J)} ${q.default.dim(G)}`;case"cancel":return`${y}${q.default.gray(J)} ${q.default.strikethrough(q.default.dim(G))}
26
+ ${q.default.gray(J)}`;default:return`${y}${q.default.cyan(J)} ${this.value?`${q.default.green(P$)} ${b}`:`${q.default.dim(f$)} ${q.default.dim(b)}`} ${q.default.dim("/")} ${this.value?`${q.default.dim(f$)} ${q.default.dim(i)}`:`${q.default.green(P$)} ${i}`}
27
+ ${q.default.cyan(h)}
28
+ `}}}).prompt()},c$=($)=>{let b=(y,G)=>{let S=y.label??String(y.value);return G==="active"?`${q.default.green(P$)} ${S} ${y.hint?q.default.dim(`(${y.hint})`):""}`:G==="selected"?`${q.default.dim(S)}`:G==="cancelled"?`${q.default.strikethrough(q.default.dim(S))}`:`${q.default.dim(f$)} ${q.default.dim(S)}`},i=0;return new d1({options:$.options,initialValue:$.initialValue,render(){let y=`${q.default.gray(J)}
29
+ ${h$(this.state)} ${$.message}
30
+ `;switch(this.state){case"submit":return`${y}${q.default.gray(J)} ${b(this.options[this.cursor],"selected")}`;case"cancel":return`${y}${q.default.gray(J)} ${b(this.options[this.cursor],"cancelled")}
31
+ ${q.default.gray(J)}`;default:{let G=$.maxItems===void 0?1/0:Math.max($.maxItems,5);this.cursor>=i+G-3?i=Math.max(Math.min(this.cursor-G+3,this.options.length-G),0):this.cursor<i+2&&(i=Math.max(this.cursor-2,0));let S=G<this.options.length&&i>0,I=G<this.options.length&&i+G<this.options.length;return`${y}${q.default.cyan(J)} ${this.options.slice(i,i+G).map((c,M,n)=>M===0&&S?q.default.dim("..."):M===n.length-1&&I?q.default.dim("..."):b(c,M+i===this.cursor?"active":"inactive")).join(`
32
+ ${q.default.cyan(J)} `)}
33
+ ${q.default.cyan(h)}
34
+ `}}}}).prompt()};var s1=($="")=>{process.stdout.write(`${q.default.gray(h)} ${q.default.red($)}
35
+
36
+ `)},e1=($="")=>{process.stdout.write(`${q.default.gray(l2)} ${$}
37
+ `)},$b=($="")=>{process.stdout.write(`${q.default.gray(J)}
38
+ ${q.default.gray(h)} ${$}
39
+
40
+ `)},Z={message:($="",{symbol:b=q.default.gray(J)}={})=>{let i=[`${q.default.gray(J)}`];if($){let[y,...G]=$.split(`
41
+ `);i.push(`${b} ${y}`,...G.map((S)=>`${q.default.gray(J)} ${S}`))}process.stdout.write(`${i.join(`
42
42
  `)}
43
- `)},info:($)=>{T.message($,{symbol:U.default.blue(lI)})},success:($)=>{T.message($,{symbol:U.default.green(pI)})},step:($)=>{T.message($,{symbol:U.default.green(k$)})},warn:($)=>{T.message($,{symbol:U.default.yellow(rI)})},warning:($)=>{T.warn($)},error:($)=>{T.message($,{symbol:U.default.red(oI)})}},G0=()=>{let $=C$?["◒","◐","◓","◑"]:["•","o","O","0"],I=C$?80:120,G,V,S=!1,M="",q=(X="")=>{S=!0,G=r1(),M=X.replace(/\.+$/,""),process.stdout.write(`${U.default.gray(B)}
44
- `);let Q=0,W=0;V=setInterval(()=>{let A=U.default.magenta($[Q]),N=".".repeat(Math.floor(W)).slice(0,3);process.stdout.write(h.cursor.move(-999,0)),process.stdout.write(h.erase.down(1)),process.stdout.write(`${A} ${M}${N}`),Q=Q+1<$.length?Q+1:0,W=W<$.length?W+0.125:0},I)},H=(X="",Q=0)=>{M=X??M,S=!1,clearInterval(V);let W=Q===0?U.default.green(k$):Q===1?U.default.red(o1):U.default.red(a1);process.stdout.write(h.cursor.move(-999,0)),process.stdout.write(h.erase.down(1)),process.stdout.write(`${W} ${M}
45
- `),G()},Z=(X="")=>{M=X??M},J=(X)=>{let Q=X>1?"Something went wrong":"Canceled";S&&H(Q,X)};return process.on("uncaughtExceptionMonitor",()=>J(2)),process.on("unhandledRejection",()=>J(2)),process.on("SIGINT",()=>J(1)),process.on("SIGTERM",()=>J(1)),process.on("exit",J),{start:q,stop:H,message:Z}};var q0=($=0)=>(I)=>`\x1B[${I+$}m`,V0=($=0)=>(I)=>`\x1B[${38+$};5;${I}m`,S0=($=0)=>(I,G,V)=>`\x1B[${38+$};2;${I};${G};${V}m`,R={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},V4=Object.keys(R.modifier),aI=Object.keys(R.color),sI=Object.keys(R.bgColor),S4=[...aI,...sI];function eI(){let $=new Map;for(let[I,G]of Object.entries(R)){for(let[V,S]of Object.entries(G))R[V]={open:`\x1B[${S[0]}m`,close:`\x1B[${S[1]}m`},G[V]=R[V],$.set(S[0],S[1]);Object.defineProperty(R,I,{value:G,enumerable:!1})}return Object.defineProperty(R,"codes",{value:$,enumerable:!1}),R.color.close="\x1B[39m",R.bgColor.close="\x1B[49m",R.color.ansi=q0(),R.color.ansi256=V0(),R.color.ansi16m=S0(),R.bgColor.ansi=q0(10),R.bgColor.ansi256=V0(10),R.bgColor.ansi16m=S0(10),Object.defineProperties(R,{rgbToAnsi256:{value(I,G,V){if(I===G&&G===V){if(I<8)return 16;if(I>248)return 231;return Math.round((I-8)/247*24)+232}return 16+36*Math.round(I/255*5)+6*Math.round(G/255*5)+Math.round(V/255*5)},enumerable:!1},hexToRgb:{value(I){let G=/[a-f\d]{6}|[a-f\d]{3}/i.exec(I.toString(16));if(!G)return[0,0,0];let[V]=G;if(V.length===3)V=[...V].map((M)=>M+M).join("");let S=Number.parseInt(V,16);return[S>>16&255,S>>8&255,S&255]},enumerable:!1},hexToAnsi256:{value:(I)=>R.rgbToAnsi256(...R.hexToRgb(I)),enumerable:!1},ansi256ToAnsi:{value(I){if(I<8)return 30+I;if(I<16)return 90+(I-8);let G,V,S;if(I>=232)G=((I-232)*10+8)/255,V=G,S=G;else{I-=16;let H=I%36;G=Math.floor(I/36)/5,V=Math.floor(H/6)/5,S=H%6/5}let M=Math.max(G,V,S)*2;if(M===0)return 30;let q=30+(Math.round(S)<<2|Math.round(V)<<1|Math.round(G));if(M===2)q+=60;return q},enumerable:!1},rgbToAnsi:{value:(I,G,V)=>R.ansi256ToAnsi(R.rgbToAnsi256(I,G,V)),enumerable:!1},hexToAnsi:{value:(I)=>R.ansi256ToAnsi(R.hexToAnsi256(I)),enumerable:!1}}),R}var $G=eI(),v=$G;import u$ from"node:process";import IG from"node:os";import M0 from"node:tty";function _($,I=globalThis.Deno?globalThis.Deno.args:u$.argv){let G=$.startsWith("-")?"":$.length===1?"-":"--",V=I.indexOf(G+$),S=I.indexOf("--");return V!==-1&&(S===-1||V<S)}var{env:b}=u$,H$;if(_("no-color")||_("no-colors")||_("color=false")||_("color=never"))H$=0;else if(_("color")||_("colors")||_("color=true")||_("color=always"))H$=1;function GG(){if("FORCE_COLOR"in b){if(b.FORCE_COLOR==="true")return 1;if(b.FORCE_COLOR==="false")return 0;return b.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(b.FORCE_COLOR,10),3)}}function qG($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function VG($,{streamIsTTY:I,sniffFlags:G=!0}={}){let V=GG();if(V!==void 0)H$=V;let S=G?H$:V;if(S===0)return 0;if(G){if(_("color=16m")||_("color=full")||_("color=truecolor"))return 3;if(_("color=256"))return 2}if("TF_BUILD"in b&&"AGENT_NAME"in b)return 1;if($&&!I&&S===void 0)return 0;let M=S||0;if(b.TERM==="dumb")return M;if(u$.platform==="win32"){let q=IG.release().split(".");if(Number(q[0])>=10&&Number(q[2])>=10586)return Number(q[2])>=14931?3:2;return 1}if("CI"in b){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((q)=>(q in b)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((q)=>(q in b))||b.CI_NAME==="codeship")return 1;return M}if("TEAMCITY_VERSION"in b)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(b.TEAMCITY_VERSION)?1:0;if(b.COLORTERM==="truecolor")return 3;if(b.TERM==="xterm-kitty")return 3;if(b.TERM==="xterm-ghostty")return 3;if(b.TERM==="wezterm")return 3;if("TERM_PROGRAM"in b){let q=Number.parseInt((b.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(b.TERM_PROGRAM){case"iTerm.app":return q>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(b.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(b.TERM))return 1;if("COLORTERM"in b)return 1;return M}function H0($,I={}){let G=VG($,{streamIsTTY:$&&$.isTTY,...I});return qG(G)}var SG={stdout:H0({isTTY:M0.isatty(1)}),stderr:H0({isTTY:M0.isatty(2)})},J0=SG;function Z0($,I,G){let V=$.indexOf(I);if(V===-1)return $;let S=I.length,M=0,q="";do q+=$.slice(M,V)+I+G,M=V+S,V=$.indexOf(I,M);while(V!==-1);return q+=$.slice(M),q}function U0($,I,G,V){let S=0,M="";do{let q=$[V-1]==="\r";M+=$.slice(S,q?V-1:V)+I+(q?`\r
43
+ `)},info:($)=>{Z.message($,{symbol:q.default.blue(a2)})},success:($)=>{Z.message($,{symbol:q.default.green(d2)})},step:($)=>{Z.message($,{symbol:q.default.green(t$)})},warn:($)=>{Z.message($,{symbol:q.default.yellow(r2)})},warning:($)=>{Z.warn($)},error:($)=>{Z.message($,{symbol:q.default.red(o2)})}},bb=()=>{let $=x$?["◒","◐","◓","◑"]:["•","o","O","0"],b=x$?80:120,i,y,G=!1,S="",I=(V="")=>{G=!0,i=r1(),S=V.replace(/\.+$/,""),process.stdout.write(`${q.default.gray(J)}
44
+ `);let U=0,m=0;y=setInterval(()=>{let T=q.default.magenta($[U]),X=".".repeat(Math.floor(m)).slice(0,3);process.stdout.write(t.cursor.move(-999,0)),process.stdout.write(t.erase.down(1)),process.stdout.write(`${T} ${S}${X}`),U=U+1<$.length?U+1:0,m=m<$.length?m+0.125:0},b)},c=(V="",U=0)=>{S=V??S,G=!1,clearInterval(y);let m=U===0?q.default.green(t$):U===1?q.default.red(o1):q.default.red(D1);process.stdout.write(t.cursor.move(-999,0)),process.stdout.write(t.erase.down(1)),process.stdout.write(`${m} ${S}
45
+ `),i()},M=(V="")=>{S=V??S},n=(V)=>{let U=V>1?"Something went wrong":"Canceled";G&&c(U,V)};return process.on("uncaughtExceptionMonitor",()=>n(2)),process.on("unhandledRejection",()=>n(2)),process.on("SIGINT",()=>n(1)),process.on("SIGTERM",()=>n(1)),process.on("exit",n),{start:I,stop:c,message:M}};var ib=($=0)=>(b)=>`\x1B[${b+$}m`,Ib=($=0)=>(b)=>`\x1B[${38+$};5;${b}m`,yb=($=0)=>(b,i,y)=>`\x1B[${38+$};2;${b};${i};${y}m`,A={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Dy=Object.keys(A.modifier),D2=Object.keys(A.color),p2=Object.keys(A.bgColor),py=[...D2,...p2];function s2(){let $=new Map;for(let[b,i]of Object.entries(A)){for(let[y,G]of Object.entries(i))A[y]={open:`\x1B[${G[0]}m`,close:`\x1B[${G[1]}m`},i[y]=A[y],$.set(G[0],G[1]);Object.defineProperty(A,b,{value:i,enumerable:!1})}return Object.defineProperty(A,"codes",{value:$,enumerable:!1}),A.color.close="\x1B[39m",A.bgColor.close="\x1B[49m",A.color.ansi=ib(),A.color.ansi256=Ib(),A.color.ansi16m=yb(),A.bgColor.ansi=ib(10),A.bgColor.ansi256=Ib(10),A.bgColor.ansi16m=yb(10),Object.defineProperties(A,{rgbToAnsi256:{value(b,i,y){if(b===i&&i===y){if(b<8)return 16;if(b>248)return 231;return Math.round((b-8)/247*24)+232}return 16+36*Math.round(b/255*5)+6*Math.round(i/255*5)+Math.round(y/255*5)},enumerable:!1},hexToRgb:{value(b){let i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(b.toString(16));if(!i)return[0,0,0];let[y]=i;if(y.length===3)y=[...y].map((S)=>S+S).join("");let G=Number.parseInt(y,16);return[G>>16&255,G>>8&255,G&255]},enumerable:!1},hexToAnsi256:{value:(b)=>A.rgbToAnsi256(...A.hexToRgb(b)),enumerable:!1},ansi256ToAnsi:{value(b){if(b<8)return 30+b;if(b<16)return 90+(b-8);let i,y,G;if(b>=232)i=((b-232)*10+8)/255,y=i,G=i;else{b-=16;let c=b%36;i=Math.floor(b/36)/5,y=Math.floor(c/6)/5,G=c%6/5}let S=Math.max(i,y,G)*2;if(S===0)return 30;let I=30+(Math.round(G)<<2|Math.round(y)<<1|Math.round(i));if(S===2)I+=60;return I},enumerable:!1},rgbToAnsi:{value:(b,i,y)=>A.ansi256ToAnsi(A.rgbToAnsi256(b,i,y)),enumerable:!1},hexToAnsi:{value:(b)=>A.ansi256ToAnsi(A.hexToAnsi256(b)),enumerable:!1}}),A}var e2=s2(),N=e2;import E$ from"node:process";import $i from"node:os";import Gb from"node:tty";function B($,b=globalThis.Deno?globalThis.Deno.args:E$.argv){let i=$.startsWith("-")?"":$.length===1?"-":"--",y=b.indexOf(i+$),G=b.indexOf("--");return y!==-1&&(G===-1||y<G)}var{env:H}=E$,q$;if(B("no-color")||B("no-colors")||B("color=false")||B("color=never"))q$=0;else if(B("color")||B("colors")||B("color=true")||B("color=always"))q$=1;function bi(){if("FORCE_COLOR"in H){if(H.FORCE_COLOR==="true")return 1;if(H.FORCE_COLOR==="false")return 0;return H.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(H.FORCE_COLOR,10),3)}}function ii($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function Ii($,{streamIsTTY:b,sniffFlags:i=!0}={}){let y=bi();if(y!==void 0)q$=y;let G=i?q$:y;if(G===0)return 0;if(i){if(B("color=16m")||B("color=full")||B("color=truecolor"))return 3;if(B("color=256"))return 2}if("TF_BUILD"in H&&"AGENT_NAME"in H)return 1;if($&&!b&&G===void 0)return 0;let S=G||0;if(H.TERM==="dumb")return S;if(E$.platform==="win32"){let I=$i.release().split(".");if(Number(I[0])>=10&&Number(I[2])>=10586)return Number(I[2])>=14931?3:2;return 1}if("CI"in H){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((I)=>(I in H)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((I)=>(I in H))||H.CI_NAME==="codeship")return 1;return S}if("TEAMCITY_VERSION"in H)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(H.TEAMCITY_VERSION)?1:0;if(H.COLORTERM==="truecolor")return 3;if(H.TERM==="xterm-kitty")return 3;if(H.TERM==="xterm-ghostty")return 3;if(H.TERM==="wezterm")return 3;if("TERM_PROGRAM"in H){let I=Number.parseInt((H.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(H.TERM_PROGRAM){case"iTerm.app":return I>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(H.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(H.TERM))return 1;if("COLORTERM"in H)return 1;return S}function Sb($,b={}){let i=Ii($,{streamIsTTY:$&&$.isTTY,...b});return ii(i)}var yi={stdout:Sb({isTTY:Gb.isatty(1)}),stderr:Sb({isTTY:Gb.isatty(2)})},cb=yi;function qb($,b,i){let y=$.indexOf(b);if(y===-1)return $;let G=b.length,S=0,I="";do I+=$.slice(S,y)+b+i,S=y+G,y=$.indexOf(b,S);while(y!==-1);return I+=$.slice(S),I}function nb($,b,i,y){let G=0,S="";do{let I=$[y-1]==="\r";S+=$.slice(G,I?y-1:y)+b+(I?`\r
46
46
  `:`
47
- `)+G,S=V+1,V=$.indexOf(`
48
- `,S)}while(V!==-1);return M+=$.slice(S),M}var{stdout:X0,stderr:Q0}=J0,f$=Symbol("GENERATOR"),F=Symbol("STYLER"),t=Symbol("IS_EMPTY"),W0=["ansi","ansi","ansi256","ansi16m"],u=Object.create(null),MG=($,I={})=>{if(I.level&&!(Number.isInteger(I.level)&&I.level>=0&&I.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let G=X0?X0.level:0;$.level=I.level===void 0?G:I.level};var HG=($)=>{let I=(...G)=>G.join(" ");return MG(I,$),Object.setPrototypeOf(I,l.prototype),I};function l($){return HG($)}Object.setPrototypeOf(l.prototype,Function.prototype);for(let[$,I]of Object.entries(v))u[$]={get(){let G=J$(this,i$(I.open,I.close,this[F]),this[t]);return Object.defineProperty(this,$,{value:G}),G}};u.visible={get(){let $=J$(this,this[F],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var g$=($,I,G,...V)=>{if($==="rgb"){if(I==="ansi16m")return v[G].ansi16m(...V);if(I==="ansi256")return v[G].ansi256(v.rgbToAnsi256(...V));return v[G].ansi(v.rgbToAnsi(...V))}if($==="hex")return g$("rgb",I,G,...v.hexToRgb(...V));return v[G][$](...V)},JG=["rgb","hex","ansi256"];for(let $ of JG){u[$]={get(){let{level:G}=this;return function(...V){let S=i$(g$($,W0[G],"color",...V),v.color.close,this[F]);return J$(this,S,this[t])}}};let I="bg"+$[0].toUpperCase()+$.slice(1);u[I]={get(){let{level:G}=this;return function(...V){let S=i$(g$($,W0[G],"bgColor",...V),v.bgColor.close,this[F]);return J$(this,S,this[t])}}}}var ZG=Object.defineProperties(()=>{},{...u,level:{enumerable:!0,get(){return this[f$].level},set($){this[f$].level=$}}}),i$=($,I,G)=>{let V,S;if(G===void 0)V=$,S=I;else V=G.openAll+$,S=I+G.closeAll;return{open:$,close:I,openAll:V,closeAll:S,parent:G}},J$=($,I,G)=>{let V=(...S)=>UG(V,S.length===1?""+S[0]:S.join(" "));return Object.setPrototypeOf(V,ZG),V[f$]=$,V[F]=I,V[t]=G,V},UG=($,I)=>{if($.level<=0||!I)return $[t]?"":I;let G=$[F];if(G===void 0)return I;let{openAll:V,closeAll:S}=G;if(I.includes("\x1B"))while(G!==void 0)I=Z0(I,G.close,G.open),G=G.parent;let M=I.indexOf(`
49
- `);if(M!==-1)I=U0(I,S,V,M);return V+I+S};Object.defineProperties(l.prototype,u);var XG=l(),L4=l({level:Q0?Q0.level:0});var Y=XG;import{readFile as QG,access as WG}from"node:fs/promises";async function E($){try{return await WG($),!0}catch{return!1}}async function YG(){if(await E("bun.lockb"))return"bun";if(await E("pnpm-lock.yaml"))return"pnpm";if(await E("yarn.lock"))return"yarn";return"npm"}async function LG(){if(await E("src"))return"src";if(await E("app"))return"app";return null}async function RG(){let $=[".env",".env.local",".env.development"];for(let I of $)try{let V=(await QG(I,"utf-8")).match(/DATABASE_URL=["']?([^"'\n]+)/);if(V){let S=V[1];return{type:S.includes("postgres")?"postgresql":S.includes("mysql")?"mysql":S.includes("sqlite")||S.includes(".db")?"sqlite":"unknown",url:S}}}catch{continue}return{type:"unknown",url:null}}async function bG(){let $=["drizzle.config.ts","drizzle.config.js","drizzle/migrations"];for(let I of $)if(await E(I))return!0;return!1}async function Y0(){let[$,I,G,V,S]=await Promise.all([E("tsconfig.json"),YG(),LG(),bG(),RG()]);return{hasTypescript:$,packageManager:I,srcDir:G,hasDrizzle:V,database:S}}async function L0($){let I=await F$({message:"Select your ORM",options:[{value:"drizzle",label:"Drizzle"},{value:"prisma",label:"Prisma"},{value:"kysely",label:"Kysely"}],initialValue:"drizzle"});if(d(I))process.exit(0);let G=I,V=await F$({message:"Select your database",options:[{value:"postgresql",label:"PostgreSQL"},{value:"mysql",label:"MySQL/MariaDB"},{value:"sqlite",label:"SQLite"}],initialValue:$.database.type!=="unknown"?$.database.type:"postgresql"});if(d(V))process.exit(0);let S=V,M=await n({message:"Include starter schema (User model)?",initialValue:!0}),q=!1;if(G==="drizzle")q=await n({message:"Include Drizzle Studio? (database GUI)",initialValue:!0});let H=await n({message:"Use custom path for database client?",initialValue:!1}),Z;if(H)Z=await s1({message:"Enter path (e.g., src/lib/database)",placeholder:$.srcDir?`${$.srcDir}/lib/db`:"lib/db"});return{orm:G,database:S,includeSchema:M,includeStudio:q,clientPath:Z}}function R0($,I){let G;if(I)G=I.replace(/\\/g,"/");else if($)G=`${$}/lib`;else G="lib";let V={clientDir:G,clientFile:`${G}/db.ts`,schemaDir:`${G}/db`,schemaFile:`${G}/db/schema.ts`,migrateFile:`${G}/db/migrate.ts`,configFile:"drizzle.config.ts",migrationsDir:"drizzle/migrations"};return console.log(`
50
- \uD83D\uDD0D Debug - Resolved paths:`),console.log(" Base directory:",G),console.log(" Client file:",V.clientFile),console.log(" Schema file:",V.schemaFile),console.log(""),V}import{mkdir as BG,writeFile as KG}from"node:fs/promises";import{dirname as AG,resolve as TG}from"node:path";async function NG($,I){try{let G=TG(process.cwd(),$),V=AG(G);await BG(V,{recursive:!0}),await KG(G,I,"utf-8")}catch(G){if(G instanceof Error)throw Error(`Failed to write file ${$}: ${G.message}`);throw G}}async function f($){for(let{path:I,content:G}of $)await NG(I,G)}function b0($,I){let G=$==="postgresql"?"pg-core":$==="mysql"?"mysql-core":"sqlite-core",V=$==="postgresql"?"pgTable":$==="mysql"?"mysqlTable":"sqliteTable",S=`import { ${V}, text, timestamp, integer } from 'drizzle-orm/${G}'`;if(!I)return`${S}
51
-
52
- // Define your schema here
53
- // Example:
54
- // export const users = ${V}('users', {
55
- // id: integer('id').primaryKey(),
56
- // email: text('email').notNull().unique(),
57
- // })
58
- `;return`${S}
59
-
60
- export const users = ${V}('users', {
61
- id: ${$==="sqlite"?"integer('id').primaryKey({ autoIncrement: true })":"text('id').primaryKey().$defaultFn(() => crypto.randomUUID())"},
62
- email: text('email').notNull().unique(),
63
- name: text('name'),
64
- createdAt: timestamp('created_at').defaultNow().notNull(),
65
- updatedAt: timestamp('updated_at').defaultNow().notNull(),
66
- })
67
- `}function B0($){if($==="postgresql")return`import { drizzle } from 'drizzle-orm/postgres-js'
47
+ `)+i,G=y+1,y=$.indexOf(`
48
+ `,G)}while(y!==-1);return S+=$.slice(G),S}var{stdout:Mb,stderr:Vb}=cb,C$=Symbol("GENERATOR"),E=Symbol("STYLER"),a=Symbol("IS_EMPTY"),Ub=["ansi","ansi","ansi256","ansi16m"],C=Object.create(null),Gi=($,b={})=>{if(b.level&&!(Number.isInteger(b.level)&&b.level>=0&&b.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let i=Mb?Mb.level:0;$.level=b.level===void 0?i:b.level};var Si=($)=>{let b=(...i)=>i.join(" ");return Gi(b,$),Object.setPrototypeOf(b,d.prototype),b};function d($){return Si($)}Object.setPrototypeOf(d.prototype,Function.prototype);for(let[$,b]of Object.entries(N))C[$]={get(){let i=n$(this,u$(b.open,b.close,this[E]),this[a]);return Object.defineProperty(this,$,{value:i}),i}};C.visible={get(){let $=n$(this,this[E],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var k$=($,b,i,...y)=>{if($==="rgb"){if(b==="ansi16m")return N[i].ansi16m(...y);if(b==="ansi256")return N[i].ansi256(N.rgbToAnsi256(...y));return N[i].ansi(N.rgbToAnsi(...y))}if($==="hex")return k$("rgb",b,i,...N.hexToRgb(...y));return N[i][$](...y)},ci=["rgb","hex","ansi256"];for(let $ of ci){C[$]={get(){let{level:i}=this;return function(...y){let G=u$(k$($,Ub[i],"color",...y),N.color.close,this[E]);return n$(this,G,this[a])}}};let b="bg"+$[0].toUpperCase()+$.slice(1);C[b]={get(){let{level:i}=this;return function(...y){let G=u$(k$($,Ub[i],"bgColor",...y),N.bgColor.close,this[E]);return n$(this,G,this[a])}}}}var qi=Object.defineProperties(()=>{},{...C,level:{enumerable:!0,get(){return this[C$].level},set($){this[C$].level=$}}}),u$=($,b,i)=>{let y,G;if(i===void 0)y=$,G=b;else y=i.openAll+$,G=b+i.closeAll;return{open:$,close:b,openAll:y,closeAll:G,parent:i}},n$=($,b,i)=>{let y=(...G)=>ni(y,G.length===1?""+G[0]:G.join(" "));return Object.setPrototypeOf(y,qi),y[C$]=$,y[E]=b,y[a]=i,y},ni=($,b)=>{if($.level<=0||!b)return $[a]?"":b;let i=$[E];if(i===void 0)return b;let{openAll:y,closeAll:G}=i;if(b.includes("\x1B"))while(i!==void 0)b=qb(b,i.close,i.open),i=i.parent;let S=b.indexOf(`
49
+ `);if(S!==-1)b=nb(b,G,y,S);return y+b+G};Object.defineProperties(d.prototype,C);var Mi=d(),cG=d({level:Vb?Vb.level:0});var R=Mi;import{readFile as Vi,access as Ui}from"node:fs/promises";async function O($){try{return await Ui($),!0}catch{return!1}}async function mi(){if(await O("bun.lockb"))return"bun";if(await O("pnpm-lock.yaml"))return"pnpm";if(await O("yarn.lock"))return"yarn";return"npm"}async function Ri(){if(await O("src"))return"src";if(await O("app"))return"app";return null}async function Li(){let $=[".env",".env.local",".env.development"];for(let b of $)try{let y=(await Vi(b,"utf-8")).match(/DATABASE_URL=["']?([^"'\n]+)/);if(y){let G=y[1];return{type:G.includes("postgres")?"postgresql":G.includes("mysql")?"mysql":G.includes("sqlite")||G.includes(".db")?"sqlite":"unknown",url:G}}}catch{continue}return{type:"unknown",url:null}}async function Ai(){let $=["drizzle.config.ts","drizzle.config.js","drizzle/migrations"];for(let b of $)if(await O(b))return!0;return!1}async function mb(){let[$,b,i,y,G]=await Promise.all([O("tsconfig.json"),mi(),Ri(),Ai(),Li()]);return{hasTypescript:$,packageManager:b,srcDir:i,hasDrizzle:y,database:G}}async function Rb($){let b=await c$({message:"Select your ORM",options:[{value:"drizzle",label:"Drizzle",hint:"TypeScript-first, lightweight"},{value:"prisma",label:"Prisma",hint:"Most popular, great DX"},{value:"kysely",label:"Kysely",hint:"Type-safe SQL builder"}],initialValue:"drizzle"});if(w(b))process.exit(0);let i=b,y=await c$({message:"Select your database",options:[{value:"postgresql",label:"PostgreSQL",hint:"Recommended for production"},{value:"mysql",label:"MySQL/MariaDB",hint:"Popular choice"},{value:"sqlite",label:"SQLite",hint:"Great for development"}],initialValue:$.database.type!=="unknown"?$.database.type:"postgresql"});if(w(y))process.exit(0);let G=y,S=await c$({message:"Choose your schema template",options:[{value:"starter",label:"\uD83D\uDCE6 Starter",hint:"User table only"},{value:"blog",label:"\uD83D\uDE80 Blog",hint:"User, Post, Comment, Category"},{value:"ecommerce",label:"\uD83D\uDED2 E-commerce",hint:"User, Product, Order, Cart"},{value:"saas",label:"\uD83D\uDCBC SaaS",hint:"User, Organization, Subscription"},{value:"empty",label:"❌ Empty",hint:"No tables, start from scratch"}],initialValue:"starter"});if(w(S))process.exit(0);let I=S,c=!1;if(i==="drizzle"){let V=await l({message:"Include Drizzle Studio? (database GUI)",initialValue:!0});if(w(V))process.exit(0);c=V}let M=await l({message:"Use custom path for database client?",initialValue:!1});if(w(M))process.exit(0);let n;if(M){let V=await p1({message:"Enter path (e.g., src/lib/database)",placeholder:$.srcDir?`${$.srcDir}/lib/db`:"lib/db"});if(w(V))process.exit(0);n=V}return{orm:i,database:G,template:I,includeStudio:c,clientPath:n}}function Lb($,b){let i;if(b)i=b.replace(/\\/g,"/");else if($)i=`${$}/lib`;else i="lib";let y={clientDir:i,clientFile:`${i}/db.ts`,schemaDir:`${i}/db`,schemaFile:`${i}/db/schema.ts`,migrateFile:`${i}/db/migrate.ts`,configFile:"drizzle.config.ts",migrationsDir:"drizzle/migrations"};return console.log(`
50
+ \uD83D\uDD0D Debug - Resolved paths:`),console.log(" Base directory:",i),console.log(" Client file:",y.clientFile),console.log(" Schema file:",y.schemaFile),console.log(""),y}import{mkdir as Hi,writeFile as Ji}from"node:fs/promises";import{dirname as Qi,resolve as Ti}from"node:path";async function Zi($,b){try{let i=Ti(process.cwd(),$),y=Qi(i);await Hi(y,{recursive:!0}),await Ji(i,b,"utf-8")}catch(i){if(i instanceof Error)throw Error(`Failed to write file ${$}: ${i.message}`);throw i}}async function k($){for(let{path:b,content:i}of $)await Zi(b,i)}function Ab($){if($==="postgresql")return`import { drizzle } from 'drizzle-orm/postgres-js'
68
51
  import postgres from 'postgres'
69
52
  import * as schema from './db/schema'
70
53
 
@@ -94,17 +77,17 @@ if (!process.env.DATABASE_URL) {
94
77
 
95
78
  const sqlite = new Database(process.env.DATABASE_URL)
96
79
  export const db = drizzle(sqlite, { schema })
97
- `}function K0($,I,G){return`import { defineConfig } from 'drizzle-kit'
80
+ `}function Hb($,b,i){return`import { defineConfig } from 'drizzle-kit'
98
81
 
99
82
  export default defineConfig({
100
- schema: './${I}',
101
- out: './${G}',
83
+ schema: './${b}',
84
+ out: './${i}',
102
85
  dialect: '${$==="postgresql"?"postgresql":$==="mysql"?"mysql":"sqlite"}',
103
86
  dbCredentials: {
104
87
  ${$==="sqlite"?"url: process.env.DATABASE_URL!":"url: process.env.DATABASE_URL!"},
105
88
  },
106
89
  })
107
- `}function A0($){if($==="postgresql")return`import { drizzle } from 'drizzle-orm/postgres-js'
90
+ `}function Jb($){if($==="postgresql")return`import { drizzle } from 'drizzle-orm/postgres-js'
108
91
  import { migrate } from 'drizzle-orm/postgres-js/migrator'
109
92
  import postgres from 'postgres'
110
93
 
@@ -137,22 +120,136 @@ migrate(db, { migrationsFolder: './drizzle/migrations' })
137
120
  sqlite.close()
138
121
 
139
122
  console.log('✅ Migrations complete!')
140
- `}async function T0($){let{paths:I,database:G,includeExamples:V}=$,S=[{path:I.schemaFile,content:b0(G,V)},{path:I.clientFile,content:B0(G)},{path:I.configFile,content:K0(G,I.schemaFile,I.migrationsDir)},{path:I.migrateFile,content:A0(G)}];await f(S)}async function N0($){let{paths:I,database:G,includeExamples:V}=$,S=[{path:"prisma/schema.prisma",content:jG(G,V)},{path:I.clientFile.replace("/db.ts","/prisma.ts"),content:zG()}];await f(S)}function jG($,I){let V=`datasource db {
141
- provider = "${$==="postgresql"?"postgresql":$==="mysql"?"mysql":"sqlite"}"
142
- url = env("DATABASE_URL")
123
+ `}function Qb($,b){let i=b==="postgresql"?"pg-core":b==="mysql"?"mysql-core":"sqlite-core",y=b==="postgresql"?"pgTable":b==="mysql"?"mysqlTable":"sqliteTable",G=`import { ${y}, text, timestamp, integer, boolean } from 'drizzle-orm/${i}'`;if($==="empty")return`${G}
124
+
125
+ // Define your schema here
126
+ // Example:
127
+ // export const users = ${y}('users', {
128
+ // id: text('id').primaryKey().$defaultFn(() => crypto.randomUUID()),
129
+ // email: text('email').notNull().unique(),
130
+ // })
131
+ `;let S=b==="sqlite"?"integer('id').primaryKey({ autoIncrement: true })":"text('id').primaryKey().$defaultFn(() => crypto.randomUUID())";if($==="starter")return`${G}
132
+
133
+ export const users = ${y}('users', {
134
+ id: ${S},
135
+ email: text('email').notNull().unique(),
136
+ name: text('name'),
137
+ createdAt: timestamp('created_at').defaultNow().notNull(),
138
+ updatedAt: timestamp('updated_at').defaultNow().notNull(),
139
+ })
140
+ `;if($==="blog")return`${G}
141
+
142
+ export const users = ${y}('users', {
143
+ id: ${S},
144
+ email: text('email').notNull().unique(),
145
+ name: text('name'),
146
+ createdAt: timestamp('created_at').defaultNow().notNull(),
147
+ updatedAt: timestamp('updated_at').defaultNow().notNull(),
148
+ })
149
+
150
+ export const posts = ${y}('posts', {
151
+ id: ${S},
152
+ title: text('title').notNull(),
153
+ slug: text('slug').notNull().unique(),
154
+ content: text('content'),
155
+ published: boolean('published').default(false),
156
+ authorId: text('author_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
157
+ createdAt: timestamp('created_at').defaultNow().notNull(),
158
+ updatedAt: timestamp('updated_at').defaultNow().notNull(),
159
+ })
160
+
161
+ export const comments = ${y}('comments', {
162
+ id: ${S},
163
+ content: text('content').notNull(),
164
+ postId: text('post_id').notNull().references(() => posts.id, { onDelete: 'cascade' }),
165
+ authorId: text('author_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
166
+ createdAt: timestamp('created_at').defaultNow().notNull(),
167
+ })
168
+
169
+ export const categories = ${y}('categories', {
170
+ id: ${S},
171
+ name: text('name').notNull().unique(),
172
+ slug: text('slug').notNull().unique(),
173
+ createdAt: timestamp('created_at').defaultNow().notNull(),
174
+ })
175
+ `;if($==="ecommerce")return`${G}
176
+ import { json } from 'drizzle-orm/${i}'
177
+
178
+ export const users = ${y}('users', {
179
+ id: ${S},
180
+ email: text('email').notNull().unique(),
181
+ name: text('name'),
182
+ createdAt: timestamp('created_at').defaultNow().notNull(),
183
+ })
184
+
185
+ export const products = ${y}('products', {
186
+ id: ${S},
187
+ name: text('name').notNull(),
188
+ slug: text('slug').notNull().unique(),
189
+ description: text('description'),
190
+ price: integer('price').notNull(), // in cents
191
+ inventory: integer('inventory').default(0),
192
+ images: json('images'),
193
+ createdAt: timestamp('created_at').defaultNow().notNull(),
194
+ })
195
+
196
+ export const orders = ${y}('orders', {
197
+ id: ${S},
198
+ orderNumber: text('order_number').notNull().unique(),
199
+ userId: text('user_id').notNull().references(() => users.id),
200
+ status: text('status').notNull().default('pending'),
201
+ total: integer('total').notNull(),
202
+ createdAt: timestamp('created_at').defaultNow().notNull(),
203
+ })
204
+ `;if($==="saas")return`${G}
205
+
206
+ export const users = ${y}('users', {
207
+ id: ${S},
208
+ email: text('email').notNull().unique(),
209
+ name: text('name'),
210
+ createdAt: timestamp('created_at').defaultNow().notNull(),
211
+ })
212
+
213
+ export const organizations = ${y}('organizations', {
214
+ id: ${S},
215
+ name: text('name').notNull(),
216
+ slug: text('slug').notNull().unique(),
217
+ plan: text('plan').default('free'),
218
+ createdAt: timestamp('created_at').defaultNow().notNull(),
219
+ })
220
+
221
+ export const memberships = ${y}('memberships', {
222
+ id: ${S},
223
+ userId: text('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
224
+ organizationId: text('organization_id').notNull().references(() => organizations.id, { onDelete: 'cascade' }),
225
+ role: text('role').notNull().default('member'),
226
+ createdAt: timestamp('created_at').defaultNow().notNull(),
227
+ })
228
+
229
+ export const subscriptions = ${y}('subscriptions', {
230
+ id: ${S},
231
+ organizationId: text('organization_id').notNull().references(() => organizations.id, { onDelete: 'cascade' }),
232
+ plan: text('plan').notNull(),
233
+ status: text('status').notNull().default('active'),
234
+ currentPeriodEnd: timestamp('current_period_end').notNull(),
235
+ createdAt: timestamp('created_at').defaultNow().notNull(),
236
+ })
237
+ `;return G}function Tb($,b){let y=`datasource db {
238
+ provider = "${b==="postgresql"?"postgresql":b==="mysql"?"mysql":"sqlite"}"
143
239
  }
144
240
 
145
241
  generator client {
146
242
  provider = "prisma-client-js"
147
243
  }
148
- `;if(!I)return`${V}
244
+ `;if($==="empty")return`${y}
149
245
  // Define your models here
150
246
  // Example:
151
247
  // model User {
152
248
  // id String @id @default(uuid())
153
249
  // email String @unique
154
250
  // }
155
- `;return`${V}${`
251
+ `;if($==="starter")return`${y}
252
+
156
253
  model User {
157
254
  id String @id @default(uuid())
158
255
  email String @unique
@@ -160,70 +257,223 @@ model User {
160
257
  createdAt DateTime @default(now())
161
258
  updatedAt DateTime @updatedAt
162
259
  }
163
- `}`}function zG(){return`import { PrismaClient } from '@prisma/client'
260
+ `;if($==="blog")return`${y}
164
261
 
165
- const globalForPrisma = globalThis as unknown as {
166
- prisma: PrismaClient | undefined
262
+ model User {
263
+ id String @id @default(uuid())
264
+ email String @unique
265
+ name String?
266
+ posts Post[]
267
+ comments Comment[]
268
+ createdAt DateTime @default(now())
269
+ updatedAt DateTime @updatedAt
167
270
  }
168
271
 
169
- export const prisma = globalForPrisma.prisma ?? new PrismaClient()
272
+ model Post {
273
+ id String @id @default(uuid())
274
+ title String
275
+ slug String @unique
276
+ content String?
277
+ published Boolean @default(false)
278
+ author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
279
+ authorId String
280
+ comments Comment[]
281
+ createdAt DateTime @default(now())
282
+ updatedAt DateTime @updatedAt
283
+
284
+ @@index([authorId])
285
+ }
170
286
 
171
- if (process.env.NODE_ENV !== 'production') {
172
- globalForPrisma.prisma = prisma
287
+ model Comment {
288
+ id String @id @default(uuid())
289
+ content String
290
+ post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
291
+ postId String
292
+ author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
293
+ authorId String
294
+ createdAt DateTime @default(now())
295
+
296
+ @@index([postId])
297
+ @@index([authorId])
298
+ }
299
+
300
+ model Category {
301
+ id String @id @default(uuid())
302
+ name String @unique
303
+ slug String @unique
304
+ createdAt DateTime @default(now())
173
305
  }
174
- `}function yG($,I){let G=I==="postgresql"?"pg-core":I==="mysql"?"mysql-core":"sqlite-core",V=I==="postgresql"?"pgTable":I==="mysql"?"mysqlTable":"sqliteTable",S=new Set(["text","timestamp"]);$.forEach((J)=>{J.fields.forEach((X)=>{let Q=j0(X);S.add(Q.split("(")[0])})});let M=`import { ${V}, ${Array.from(S).join(", ")} } from 'drizzle-orm/${G}'`,q=$.map((J)=>{let X=J.fields.map((Q)=>{return` ${Q.name}: ${_G(Q,I)},`}).join(`
175
- `);return`export const ${J.name} = ${V}('${J.name}', {
176
- ${X}
177
- })`}).join(`
306
+ `;if($==="ecommerce")return`${y}
178
307
 
179
- `),H=$.some((J)=>J.relations&&J.relations.length>0),Z="";if(H)Z=`
308
+ model User {
309
+ id String @id @default(uuid())
310
+ email String @unique
311
+ name String?
312
+ orders Order[]
313
+ createdAt DateTime @default(now())
314
+ }
180
315
 
181
- import { relations } from 'drizzle-orm'
316
+ model Product {
317
+ id String @id @default(uuid())
318
+ name String
319
+ slug String @unique
320
+ description String?
321
+ price Int
322
+ inventory Int @default(0)
323
+ images Json?
324
+ createdAt DateTime @default(now())
325
+ }
182
326
 
183
- `,Z+=$.filter((J)=>J.relations&&J.relations.length>0).map((J)=>{let X=J.relations.map((Q)=>{if(Q.type==="one-to-many")return` ${Q.fieldName}: many(${Q.toTable}),`;else if(Q.type==="many-to-one")return` ${Q.fieldName}: one(${Q.toTable}, {
184
- fields: [${J.name}.${Q.fieldName}Id],
185
- references: [${Q.toTable}.id],
186
- }),`;return""}).join(`
187
- `);return`export const ${J.name}Relations = relations(${J.name}, ({ one, many }) => ({
188
- ${X}
189
- }))`}).join(`
327
+ model Order {
328
+ id String @id @default(uuid())
329
+ orderNumber String @unique
330
+ user User @relation(fields: [userId], references: [id])
331
+ userId String
332
+ status String @default("pending")
333
+ total Int
334
+ createdAt DateTime @default(now())
190
335
 
191
- `);return`${M}
336
+ @@index([userId])
337
+ }
338
+ `;if($==="saas")return`${y}
192
339
 
193
- ${q}${Z}`}function j0($){switch($.type){case"uuid":return"text";case"string":return"text";case"text":return"text";case"number":return"integer";case"boolean":return"boolean";case"date":return"timestamp";case"json":return"json";default:return"text"}}function _G($,I){let G=j0($);if(G+=`('${$.name}'`,$.length)G+=`, { length: ${$.length} }`;if(G+=")",$.isPrimaryKey)G+=".primaryKey()";if($.required&&!$.isPrimaryKey)G+=".notNull()";if($.unique)G+=".unique()";if($.default!==void 0)if($.default==="now")G+=".defaultNow()";else if(typeof $.default==="string")G+=`.default('${$.default}')`;else G+=`.default(${$.default})`;if($.isPrimaryKey&&$.type==="uuid")G+=".$defaultFn(() => crypto.randomUUID())";if($.references){if(G+=`.references(() => ${$.references.table}.${$.references.field}`,$.references.onDelete)G+=`, { onDelete: '${$.references.onDelete}' }`;G+=")"}return G}function OG($,I){let G=`datasource db {
194
- provider = "${I==="postgresql"?"postgresql":I==="mysql"?"mysql":"sqlite"}"
195
- url = env("DATABASE_URL")
340
+ model User {
341
+ id String @id @default(uuid())
342
+ email String @unique
343
+ name String?
344
+ memberships Membership[]
345
+ createdAt DateTime @default(now())
196
346
  }
197
347
 
198
- generator client {
199
- provider = "prisma-client-js"
348
+ model Organization {
349
+ id String @id @default(uuid())
350
+ name String
351
+ slug String @unique
352
+ plan String @default("free")
353
+ memberships Membership[]
354
+ subscriptions Subscription[]
355
+ createdAt DateTime @default(now())
200
356
  }
201
- `,V=$.map((S)=>{let M=S.fields.map((H)=>{return` ${vG(H)}`}).join(`
202
- `),q=S.fields.filter((H)=>H.references).map((H)=>` @@index([${H.name}])`).join(`
203
- `);return`model ${Z$(S.displayName)} {
204
- ${M}
205
- ${q?`
206
- `+q:""}
207
- }`}).join(`
208
-
209
- `);return`${G}
210
- ${V}`}function vG($){let I=$.name;I+=" ";let G=xG($);if(I+=G,!$.required&&!$.isPrimaryKey)I+="?";let V=[];if($.isPrimaryKey)if($.type==="uuid")V.push("@id @default(uuid())");else if($.isAutoIncrement)V.push("@id @default(autoincrement())");else V.push("@id");if($.unique&&!$.isPrimaryKey)V.push("@unique");if($.default!==void 0&&!$.isPrimaryKey)if($.default==="now")V.push("@default(now())");else if(typeof $.default==="string")V.push(`@default("${$.default}")`);else if(typeof $.default==="boolean")V.push(`@default(${$.default})`);else V.push(`@default(${$.default})`);if($.references){if(V.push(`@relation(fields: [${$.name}], references: [${$.references.field}]`),$.references.onDelete)V.push(`, onDelete: ${Z$($.references.onDelete)}`);V.push(")")}if(V.length>0)I+=" "+V.join(" ");return I}function xG($){switch($.type){case"uuid":return"String";case"string":return"String";case"text":return"String";case"number":return"Int";case"boolean":return"Boolean";case"date":return"DateTime";case"json":return"Json";default:return"String"}}function wG($,I){let V=$.map((M)=>{let q=M.fields.map((Z)=>{let J=PG(Z);if(Z.isPrimaryKey&&Z.isAutoIncrement)J=`Generated<${J}>`;if(!Z.required&&!Z.isPrimaryKey)J+=" | null";return` ${Z.name}: ${J}`}).join(`
211
- `),H=Z$(M.displayName);return`export interface ${H}Table {
212
- ${q}
357
+
358
+ model Membership {
359
+ id String @id @default(uuid())
360
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
361
+ userId String
362
+ organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
363
+ organizationId String
364
+ role String @default("member")
365
+ createdAt DateTime @default(now())
366
+
367
+ @@index([userId])
368
+ @@index([organizationId])
213
369
  }
214
370
 
215
- export type ${H} = Selectable<${H}Table>
216
- export type New${H} = Insertable<${H}Table>
217
- export type ${H}Update = Updateable<${H}Table>`}).join(`
371
+ model Subscription {
372
+ id String @id @default(uuid())
373
+ organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
374
+ organizationId String
375
+ plan String
376
+ status String @default("active")
377
+ currentPeriodEnd DateTime
378
+ createdAt DateTime @default(now())
218
379
 
219
- `),S=`export interface Database {
220
- ${$.map((M)=>` ${M.name}: ${Z$(M.displayName)}Table`).join(`
221
- `)}
222
- }`;return`import { Generated, Insertable, Selectable, Updateable } from 'kysely'
380
+ @@index([organizationId])
381
+ }
382
+ `;return y}function Zb($){if($==="empty")return`import { Generated } from 'kysely'
223
383
 
224
- ${V}
384
+ // Define your table interfaces here
385
+ // Example:
386
+ // export interface UsersTable {
387
+ // id: Generated<string>
388
+ // email: string
389
+ // name: string | null
390
+ // }
225
391
 
226
- ${S}`}function PG($){switch($.type){case"uuid":return"string";case"string":return"string";case"text":return"string";case"number":return"number";case"boolean":return"boolean";case"date":return"Date";case"json":return"unknown";default:return"string"}}function Z$($){return $.charAt(0).toUpperCase()+$.slice(1)}function z0($,I,G){switch($){case"drizzle":return yG(I,G);case"prisma":return OG(I,G);case"kysely":return wG(I,G);default:throw Error(`Unsupported ORM: ${$}`)}}async function y0($){let{paths:I,database:G,selectedTables:V}=$,S=z0("kysely",V,G),M=[{path:I.schemaFile,content:S},{path:I.clientFile,content:EG(G)},{path:I.migrateFile,content:cG(G)}];await f(M)}function EG($){if($==="postgresql")return`import { Kysely, PostgresDialect } from 'kysely'
392
+ export interface Database {
393
+ // Add your tables here
394
+ }
395
+ `;if($==="starter")return`import { Generated } from 'kysely'
396
+
397
+ export interface UsersTable {
398
+ id: Generated<string>
399
+ email: string
400
+ name: string | null
401
+ created_at: Generated<Date>
402
+ updated_at: Generated<Date>
403
+ }
404
+
405
+ export interface Database {
406
+ users: UsersTable
407
+ }
408
+ `;if($==="blog")return`import { Generated } from 'kysely'
409
+
410
+ export interface UsersTable {
411
+ id: Generated<string>
412
+ email: string
413
+ name: string | null
414
+ created_at: Generated<Date>
415
+ updated_at: Generated<Date>
416
+ }
417
+
418
+ export interface PostsTable {
419
+ id: Generated<string>
420
+ title: string
421
+ slug: string
422
+ content: string | null
423
+ published: Generated<boolean>
424
+ author_id: string
425
+ created_at: Generated<Date>
426
+ updated_at: Generated<Date>
427
+ }
428
+
429
+ export interface CommentsTable {
430
+ id: Generated<string>
431
+ content: string
432
+ post_id: string
433
+ author_id: string
434
+ created_at: Generated<Date>
435
+ }
436
+
437
+ export interface CategoriesTable {
438
+ id: Generated<string>
439
+ name: string
440
+ slug: string
441
+ created_at: Generated<Date>
442
+ }
443
+
444
+ export interface Database {
445
+ users: UsersTable
446
+ posts: PostsTable
447
+ comments: CommentsTable
448
+ categories: CategoriesTable
449
+ }
450
+ `;return`import { Generated } from 'kysely'
451
+
452
+ export interface Database {}`}async function Xb($){let{paths:b,database:i,template:y}=$,G=[{path:b.schemaFile,content:Qb(y,i)},{path:b.clientFile,content:Ab(i)},{path:b.configFile,content:Hb(i,b.schemaFile,b.migrationsDir)},{path:b.migrateFile,content:Jb(i)}];await k(G)}async function zb($){let{paths:b,database:i,template:y}=$,G=[{path:"prisma/schema.prisma",content:Tb(y,i)},{path:b.clientFile.replace("/db.ts","/prisma.ts"),content:Xi()},{path:"prisma.config.ts",content:zi()}];await k(G)}function Xi(){return`import { PrismaClient } from '@prisma/client'
453
+
454
+ const globalForPrisma = globalThis as unknown as {
455
+ prisma: PrismaClient | undefined
456
+ }
457
+
458
+ export const prisma = globalForPrisma.prisma ?? new PrismaClient()
459
+
460
+ if (process.env.NODE_ENV !== 'production') {
461
+ globalForPrisma.prisma = prisma
462
+ }
463
+ `}function zi(){return`import 'dotenv/config'
464
+ import { defineConfig, env } from "prisma/config";
465
+
466
+ export default defineConfig({
467
+ schema: 'prisma/schema.prisma',
468
+ migrations: {
469
+ path: 'prisma/migrations',
470
+ seed: 'tsx prisma/seed.ts',
471
+ },
472
+ datasource: {
473
+ url: env("DATABASE_URL")
474
+ }
475
+ });
476
+ `}async function Wb($){let{paths:b,database:i,template:y}=$,G=[{path:b.schemaFile,content:Zb(y)},{path:b.clientFile,content:Wi(i)},{path:b.migrateFile,content:Ki(i)}];await k(G)}function Wi($){if($==="postgresql")return`import { Kysely, PostgresDialect } from 'kysely'
227
477
  import { Pool } from 'pg'
228
478
  import type { Database } from './db/schema'
229
479
 
@@ -232,14 +482,10 @@ if (!process.env.DATABASE_URL) {
232
482
  }
233
483
 
234
484
  const dialect = new PostgresDialect({
235
- pool: new Pool({
236
- connectionString: process.env.DATABASE_URL,
237
- }),
485
+ pool: new Pool({ connectionString: process.env.DATABASE_URL }),
238
486
  })
239
487
 
240
- export const db = new Kysely<Database>({
241
- dialect,
242
- })
488
+ export const db = new Kysely<Database>({ dialect })
243
489
  `;if($==="mysql")return`import { Kysely, MysqlDialect } from 'kysely'
244
490
  import { createPool } from 'mysql2'
245
491
  import type { Database } from './db/schema'
@@ -252,9 +498,7 @@ const dialect = new MysqlDialect({
252
498
  pool: createPool(process.env.DATABASE_URL),
253
499
  })
254
500
 
255
- export const db = new Kysely<Database>({
256
- dialect,
257
- })
501
+ export const db = new Kysely<Database>({ dialect })
258
502
  `;return`import { Kysely, SqliteDialect } from 'kysely'
259
503
  import Database from 'better-sqlite3'
260
504
  import type { Database as DatabaseType } from './db/schema'
@@ -267,10 +511,8 @@ const dialect = new SqliteDialect({
267
511
  database: new Database(process.env.DATABASE_URL),
268
512
  })
269
513
 
270
- export const db = new Kysely<DatabaseType>({
271
- dialect,
272
- })
273
- `}function cG($){return`import { promises as fs } from 'fs'
514
+ export const db = new Kysely<DatabaseType>({ dialect })
515
+ `}function Ki($){return`import { promises as fs } from 'fs'
274
516
  import { Migrator, FileMigrationProvider } from 'kysely'
275
517
  import { db } from '../db'
276
518
  import * as path from 'path'
@@ -305,11 +547,11 @@ async function migrateToLatest() {
305
547
  }
306
548
 
307
549
  migrateToLatest()
308
- `}var GI=m(W2(),1);import{Buffer as z3}from"node:buffer";import y3 from"node:path";import N1 from"node:child_process";import N$ from"node:process";function e$($){let I=typeof $==="string"?`
550
+ `}var b2=f(U0(),1);import{Buffer as Ay}from"node:buffer";import Hy from"node:path";import Z1 from"node:child_process";import X$ from"node:process";function s$($){let b=typeof $==="string"?`
309
551
  `:`
310
- `.charCodeAt(),G=typeof $==="string"?"\r":"\r".charCodeAt();if($[$.length-1]===I)$=$.slice(0,-1);if($[$.length-1]===G)$=$.slice(0,-1);return $}import Q$ from"node:process";import p from"node:path";import{fileURLToPath as Y2}from"node:url";function X$($={}){let{env:I=process.env,platform:G=process.platform}=$;if(G!=="win32")return"PATH";return Object.keys(I).reverse().find((V)=>V.toUpperCase()==="PATH")||"Path"}var Z9=({cwd:$=Q$.cwd(),path:I=Q$.env[X$()],preferLocal:G=!0,execPath:V=Q$.execPath,addExecPath:S=!0}={})=>{let M=$ instanceof URL?Y2($):$,q=p.resolve(M),H=[];if(G)U9(H,q);if(S)X9(H,V,q);return[...H,I].join(p.delimiter)},U9=($,I)=>{let G;while(G!==I)$.push(p.join(I,"node_modules/.bin")),G=I,I=p.resolve(I,"..")},X9=($,I,G)=>{let V=I instanceof URL?Y2(I):I;$.push(p.resolve(G,V,".."))},L2=({env:$=Q$.env,...I}={})=>{$={...$};let G=X$({env:$});return I.path=$[G],$[G]=Z9(I),$};var Q9=($,I,G,V)=>{if(G==="length"||G==="prototype")return;if(G==="arguments"||G==="caller")return;let S=Object.getOwnPropertyDescriptor($,G),M=Object.getOwnPropertyDescriptor(I,G);if(!W9(S,M)&&V)return;Object.defineProperty($,G,M)},W9=function($,I){return $===void 0||$.configurable||$.writable===I.writable&&$.enumerable===I.enumerable&&$.configurable===I.configurable&&($.writable||$.value===I.value)},Y9=($,I)=>{let G=Object.getPrototypeOf(I);if(G===Object.getPrototypeOf($))return;Object.setPrototypeOf($,G)},L9=($,I)=>`/* Wrapped ${$}*/
311
- ${I}`,R9=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),b9=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),B9=($,I,G)=>{let V=G===""?"":`with ${G.trim()}() `,S=L9.bind(null,V,I.toString());Object.defineProperty(S,"name",b9),Object.defineProperty($,"toString",{...R9,value:S})};function $1($,I,{ignoreNonConfigurable:G=!1}={}){let{name:V}=$;for(let S of Reflect.ownKeys(I))Q9($,I,S,G);return Y9($,I),B9($,I,V),$}var W$=new WeakMap,R2=($,I={})=>{if(typeof $!=="function")throw TypeError("Expected a function");let G,V=0,S=$.displayName||$.name||"<anonymous>",M=function(...q){if(W$.set(M,++V),V===1)G=$.apply(this,q),$=null;else if(I.throw===!0)throw Error(`Function \`${S}\` can only be called once`);return G};return $1(M,$),W$.set(M,V),M};R2.callCount=($)=>{if(!W$.has($))throw Error(`The given function \`${$.name}\` is not wrapped by the \`onetime\` package`);return W$.get($)};var b2=R2;import v9 from"node:process";import{constants as N9}from"node:os";var B2=()=>{let $=I1-K2+1;return Array.from({length:$},K9)},K9=($,I)=>({name:`SIGRT${I+1}`,number:K2+I,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),K2=34,I1=64;import{constants as A9}from"node:os";var A2=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var G1=()=>{let $=B2();return[...A2,...$].map(T9)},T9=({name:$,number:I,description:G,action:V,forced:S=!1,standard:M})=>{let{signals:{[$]:q}}=A9,H=q!==void 0;return{name:$,number:H?q:I,description:G,supported:H,action:V,forced:S,standard:M}};var j9=()=>{let $=G1();return Object.fromEntries($.map(z9))},z9=({name:$,number:I,description:G,supported:V,action:S,forced:M,standard:q})=>[$,{name:$,number:I,description:G,supported:V,action:S,forced:M,standard:q}],T2=j9(),y9=()=>{let $=G1(),I=I1+1,G=Array.from({length:I},(V,S)=>_9(S,$));return Object.assign({},...G)},_9=($,I)=>{let G=O9($,I);if(G===void 0)return{};let{name:V,description:S,supported:M,action:q,forced:H,standard:Z}=G;return{[$]:{name:V,number:$,description:S,supported:M,action:q,forced:H,standard:Z}}},O9=($,I)=>{let G=I.find(({name:V})=>N9.signals[V]===$);if(G!==void 0)return G;return I.find((V)=>V.number===$)},W5=y9();var x9=({timedOut:$,timeout:I,errorCode:G,signal:V,signalDescription:S,exitCode:M,isCanceled:q})=>{if($)return`timed out after ${I} milliseconds`;if(q)return"was canceled";if(G!==void 0)return`failed with ${G}`;if(V!==void 0)return`was killed with ${V} (${S})`;if(M!==void 0)return`failed with exit code ${M}`;return"failed"},r=({stdout:$,stderr:I,all:G,error:V,signal:S,exitCode:M,command:q,escapedCommand:H,timedOut:Z,isCanceled:J,killed:X,parsed:{options:{timeout:Q,cwd:W=v9.cwd()}}})=>{M=M===null?void 0:M,S=S===null?void 0:S;let A=S===void 0?void 0:T2[S].description,N=V&&V.code,C=`Command ${x9({timedOut:Z,timeout:Q,errorCode:N,signal:S,signalDescription:A,exitCode:M,isCanceled:J})}: ${q}`,s=Object.prototype.toString.call(V)==="[object Error]",e=s?`${C}
312
- ${V.message}`:C,$$=[e,I,$].filter(Boolean).join(`
313
- `);if(s)V.originalMessage=V.message,V.message=$$;else V=Error($$);if(V.shortMessage=e,V.command=q,V.escapedCommand=H,V.exitCode=M,V.signal=S,V.signalDescription=A,V.stdout=$,V.stderr=I,V.cwd=W,G!==void 0)V.all=G;if("bufferedData"in V)delete V.bufferedData;return V.failed=!0,V.timedOut=Boolean(Z),V.isCanceled=J,V.killed=X&&!Z,V};var Y$=["stdin","stdout","stderr"],w9=($)=>Y$.some((I)=>$[I]!==void 0),N2=($)=>{if(!$)return;let{stdio:I}=$;if(I===void 0)return Y$.map((V)=>$[V]);if(w9($))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${Y$.map((V)=>`\`${V}\``).join(", ")}`);if(typeof I==="string")return I;if(!Array.isArray(I))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof I}\``);let G=Math.max(I.length,Y$.length);return Array.from({length:G},(V,S)=>I[S])};import c9 from"node:os";var c=[];c.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")c.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")c.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var L$=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",q1=Symbol.for("signal-exit emitter"),V1=globalThis,P9=Object.defineProperty.bind(Object);class j2{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(V1[q1])return V1[q1];P9(V1,q1,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,I){this.listeners[$].push(I)}removeListener($,I){let G=this.listeners[$],V=G.indexOf(I);if(V===-1)return;if(V===0&&G.length===1)G.length=0;else G.splice(V,1)}emit($,I,G){if(this.emitted[$])return!1;this.emitted[$]=!0;let V=!1;for(let S of this.listeners[$])V=S(I,G)===!0||V;if($==="exit")V=this.emit("afterExit",I,G)||V;return V}}class M1{}var E9=($)=>{return{onExit(I,G){return $.onExit(I,G)},load(){return $.load()},unload(){return $.unload()}}};class z2 extends M1{onExit(){return()=>{}}load(){}unload(){}}class y2 extends M1{#M=S1.platform==="win32"?"SIGINT":"SIGHUP";#I=new j2;#$;#V;#S;#q={};#G=!1;constructor($){super();this.#$=$,this.#q={};for(let I of c)this.#q[I]=()=>{let G=this.#$.listeners(I),{count:V}=this.#I,S=$;if(typeof S.__signal_exit_emitter__==="object"&&typeof S.__signal_exit_emitter__.count==="number")V+=S.__signal_exit_emitter__.count;if(G.length===V){this.unload();let M=this.#I.emit("exit",null,I),q=I==="SIGHUP"?this.#M:I;if(!M)$.kill($.pid,q)}};this.#S=$.reallyExit,this.#V=$.emit}onExit($,I){if(!L$(this.#$))return()=>{};if(this.#G===!1)this.load();let G=I?.alwaysLast?"afterExit":"exit";return this.#I.on(G,$),()=>{if(this.#I.removeListener(G,$),this.#I.listeners.exit.length===0&&this.#I.listeners.afterExit.length===0)this.unload()}}load(){if(this.#G)return;this.#G=!0,this.#I.count+=1;for(let $ of c)try{let I=this.#q[$];if(I)this.#$.on($,I)}catch(I){}this.#$.emit=($,...I)=>{return this.#J($,...I)},this.#$.reallyExit=($)=>{return this.#H($)}}unload(){if(!this.#G)return;this.#G=!1,c.forEach(($)=>{let I=this.#q[$];if(!I)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,I)}catch(G){}}),this.#$.emit=this.#V,this.#$.reallyExit=this.#S,this.#I.count-=1}#H($){if(!L$(this.#$))return 0;return this.#$.exitCode=$||0,this.#I.emit("exit",this.#$.exitCode,null),this.#S.call(this.#$,this.#$.exitCode)}#J($,...I){let G=this.#V;if($==="exit"&&L$(this.#$)){if(typeof I[0]==="number")this.#$.exitCode=I[0];let V=G.call(this.#$,$,...I);return this.#I.emit("exit",this.#$.exitCode,null),V}else return G.call(this.#$,$,...I)}}var S1=globalThis.process,{onExit:_2,load:T5,unload:N5}=E9(L$(S1)?new y2(S1):new z2);var C9=5000,O2=($,I="SIGTERM",G={})=>{let V=$(I);return m9($,I,G,V),V},m9=($,I,G,V)=>{if(!h9(I,G,V))return;let S=n9(G),M=setTimeout(()=>{$("SIGKILL")},S);if(M.unref)M.unref()},h9=($,{forceKillAfterTimeout:I},G)=>k9($)&&I!==!1&&G,k9=($)=>$===c9.constants.signals.SIGTERM||typeof $==="string"&&$.toUpperCase()==="SIGTERM",n9=({forceKillAfterTimeout:$=!0})=>{if($===!0)return C9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},v2=($,I)=>{if($.kill())I.isCanceled=!0},F9=($,I,G)=>{$.kill(I),G(Object.assign(Error("Timed out"),{timedOut:!0,signal:I}))},x2=($,{timeout:I,killSignal:G="SIGTERM"},V)=>{if(I===0||I===void 0)return V;let S,M=new Promise((H,Z)=>{S=setTimeout(()=>{F9($,G,Z)},I)}),q=V.finally(()=>{clearTimeout(S)});return Promise.race([M,q])},w2=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},P2=async($,{cleanup:I,detached:G},V)=>{if(!I||G)return V;let S=_2(()=>{$.kill()});return V.finally(()=>{S()})};import{createWriteStream as u9}from"node:fs";import{ChildProcess as f9}from"node:child_process";function R$($){return $!==null&&typeof $==="object"&&typeof $.pipe==="function"}function H1($){return R$($)&&$.writable!==!1&&typeof $._write==="function"&&typeof $._writableState==="object"}var g9=($)=>$ instanceof f9&&typeof $.then==="function",J1=($,I,G)=>{if(typeof G==="string")return $[I].pipe(u9(G)),$;if(H1(G))return $[I].pipe(G),$;if(!g9(G))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!H1(G.stdin))throw TypeError("The target child process's stdin must be available.");return $[I].pipe(G.stdin),G},E2=($)=>{if($.stdout!==null)$.pipeStdout=J1.bind(void 0,$,"stdout");if($.stderr!==null)$.pipeStderr=J1.bind(void 0,$,"stderr");if($.all!==void 0)$.pipeAll=J1.bind(void 0,$,"all")};import{createReadStream as H3,readFileSync as J3}from"node:fs";import{setTimeout as Z3}from"node:timers/promises";var o=async($,{init:I,convertChunk:G,getSize:V,truncateChunk:S,addChunk:M,getFinalChunk:q,finalize:H},{maxBuffer:Z=Number.POSITIVE_INFINITY}={})=>{if(!D9($))throw Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let J=I();J.length=0;try{for await(let X of $){let Q=d9(X),W=G[Q](X,J);m2({convertedChunk:W,state:J,getSize:V,truncateChunk:S,addChunk:M,maxBuffer:Z})}return i9({state:J,convertChunk:G,getSize:V,truncateChunk:S,addChunk:M,getFinalChunk:q,maxBuffer:Z}),H(J)}catch(X){throw X.bufferedData=H(J),X}},i9=({state:$,getSize:I,truncateChunk:G,addChunk:V,getFinalChunk:S,maxBuffer:M})=>{let q=S($);if(q!==void 0)m2({convertedChunk:q,state:$,getSize:I,truncateChunk:G,addChunk:V,maxBuffer:M})},m2=({convertedChunk:$,state:I,getSize:G,truncateChunk:V,addChunk:S,maxBuffer:M})=>{let q=G($),H=I.length+q;if(H<=M){c2($,I,S,H);return}let Z=V($,M-I.length);if(Z!==void 0)c2(Z,I,S,M);throw new Z1},c2=($,I,G,V)=>{I.contents=G($,I,V),I.length=V},D9=($)=>typeof $==="object"&&$!==null&&typeof $[Symbol.asyncIterator]==="function",d9=($)=>{let I=typeof $;if(I==="string")return"string";if(I!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let G=C2.call($);if(G==="[object ArrayBuffer]")return"arrayBuffer";if(G==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&C2.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:C2}=Object.prototype;class Z1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var U1=($)=>$,X1=()=>{return},Q1=({contents:$})=>$,b$=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},B$=($)=>$.length;async function W1($,I){return o($,$3,I)}var t9=()=>({contents:new ArrayBuffer(0)}),l9=($)=>p9.encode($),p9=new TextEncoder,h2=($)=>new Uint8Array($),k2=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),r9=($,I)=>$.slice(0,I),o9=($,{contents:I,length:G},V)=>{let S=u2()?s9(I,V):a9(I,V);return new Uint8Array(S).set($,G),S},a9=($,I)=>{if(I<=$.byteLength)return $;let G=new ArrayBuffer(F2(I));return new Uint8Array(G).set(new Uint8Array($),0),G},s9=($,I)=>{if(I<=$.maxByteLength)return $.resize(I),$;let G=new ArrayBuffer(I,{maxByteLength:F2(I)});return new Uint8Array(G).set(new Uint8Array($),0),G},F2=($)=>n2**Math.ceil(Math.log($)/Math.log(n2)),n2=2,e9=({contents:$,length:I})=>u2()?$:$.slice(0,I),u2=()=>("resize"in ArrayBuffer.prototype),$3={init:t9,convertChunk:{string:l9,buffer:h2,arrayBuffer:h2,dataView:k2,typedArray:k2,others:b$},getSize:B$,truncateChunk:r9,addChunk:o9,getFinalChunk:X1,finalize:e9};async function K$($,I){if(!("Buffer"in globalThis))throw Error("getStreamAsBuffer() is only supported in Node.js");try{return f2(await W1($,I))}catch(G){if(G.bufferedData!==void 0)G.bufferedData=f2(G.bufferedData);throw G}}var f2=($)=>globalThis.Buffer.from($);async function Y1($,I){return o($,S3,I)}var I3=()=>({contents:"",textDecoder:new TextDecoder}),A$=($,{textDecoder:I})=>I.decode($,{stream:!0}),G3=($,{contents:I})=>I+$,q3=($,I)=>$.slice(0,I),V3=({textDecoder:$})=>{let I=$.decode();return I===""?void 0:I},S3={init:I3,convertChunk:{string:U1,buffer:A$,arrayBuffer:A$,dataView:A$,typedArray:A$,others:b$},getSize:B$,truncateChunk:q3,addChunk:G3,getFinalChunk:V3,finalize:Q1};var D2=m(i2(),1),d2=($)=>{if($!==void 0)throw TypeError("The `input` and `inputFile` options cannot be both set.")},U3=({input:$,inputFile:I})=>{if(typeof I!=="string")return $;return d2($),J3(I)},t2=($)=>{let I=U3($);if(R$(I))throw TypeError("The `input` option cannot be a stream in sync mode");return I},X3=({input:$,inputFile:I})=>{if(typeof I!=="string")return $;return d2($),H3(I)},l2=($,I)=>{let G=X3(I);if(G===void 0)return;if(R$(G))G.pipe($.stdin);else $.stdin.end(G)},p2=($,{all:I})=>{if(!I||!$.stdout&&!$.stderr)return;let G=D2.default();if($.stdout)G.add($.stdout);if($.stderr)G.add($.stderr);return G},L1=async($,I)=>{if(!$||I===void 0)return;await Z3(0),$.destroy();try{return await I}catch(G){return G.bufferedData}},R1=($,{encoding:I,buffer:G,maxBuffer:V})=>{if(!$||!G)return;if(I==="utf8"||I==="utf-8")return Y1($,{maxBuffer:V});if(I===null||I==="buffer")return K$($,{maxBuffer:V});return Q3($,V,I)},Q3=async($,I,G)=>{return(await K$($,{maxBuffer:I})).toString(G)},r2=async({stdout:$,stderr:I,all:G},{encoding:V,buffer:S,maxBuffer:M},q)=>{let H=R1($,{encoding:V,buffer:S,maxBuffer:M}),Z=R1(I,{encoding:V,buffer:S,maxBuffer:M}),J=R1(G,{encoding:V,buffer:S,maxBuffer:M*2});try{return await Promise.all([q,H,Z,J])}catch(X){return Promise.all([{error:X,signal:X.signal,timedOut:X.timedOut},L1($,H),L1(I,Z),L1(G,J)])}};var W3=(async()=>{})().constructor.prototype,Y3=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(W3,$)]),b1=($,I)=>{for(let[G,V]of Y3){let S=typeof I==="function"?(...M)=>Reflect.apply(V.value,I(),M):V.value.bind(I);Reflect.defineProperty($,G,{...V,value:S})}},o2=($)=>new Promise((I,G)=>{if($.on("exit",(V,S)=>{I({exitCode:V,signal:S})}),$.on("error",(V)=>{G(V)}),$.stdin)$.stdin.on("error",(V)=>{G(V)})});import{Buffer as L3}from"node:buffer";import{ChildProcess as R3}from"node:child_process";var e2=($,I=[])=>{if(!Array.isArray(I))return[$];return[$,...I]},b3=/^[\w.-]+$/,B3=($)=>{if(typeof $!=="string"||b3.test($))return $;return`"${$.replaceAll('"',"\\\"")}"`},B1=($,I)=>e2($,I).join(" "),K1=($,I)=>e2($,I).map((G)=>B3(G)).join(" "),K3=/ +/g;var a2=($)=>{let I=typeof $;if(I==="string")return $;if(I==="number")return String($);if(I==="object"&&$!==null&&!($ instanceof R3)&&"stdout"in $){let G=typeof $.stdout;if(G==="string")return $.stdout;if(L3.isBuffer($.stdout))return $.stdout.toString();throw TypeError(`Unexpected "${G}" stdout in template expression`)}throw TypeError(`Unexpected "${I}" in template expression`)},s2=($,I,G)=>G||$.length===0||I.length===0?[...$,...I]:[...$.slice(0,-1),`${$.at(-1)}${I[0]}`,...I.slice(1)],A3=({templates:$,expressions:I,tokens:G,index:V,template:S})=>{let M=S??$.raw[V],q=M.split(K3).filter(Boolean),H=s2(G,q,M.startsWith(" "));if(V===I.length)return H;let Z=I[V],J=Array.isArray(Z)?Z.map((X)=>a2(X)):[a2(Z)];return s2(H,J,M.endsWith(" "))},A1=($,I)=>{let G=[];for(let[V,S]of $.entries())G=A3({templates:$,expressions:I,tokens:G,index:V,template:S});return G};import{debuglog as T3}from"node:util";import N3 from"node:process";var $I=T3("execa").enabled,T$=($,I)=>String($).padStart(I,"0"),j3=()=>{let $=new Date;return`${T$($.getHours(),2)}:${T$($.getMinutes(),2)}:${T$($.getSeconds(),2)}.${T$($.getMilliseconds(),3)}`},T1=($,{verbose:I})=>{if(!I)return;N3.stderr.write(`[${j3()}] ${$}
314
- `)};var _3=1e8,O3=({env:$,extendEnv:I,preferLocal:G,localDir:V,execPath:S})=>{let M=I?{...N$.env,...$}:$;if(G)return L2({env:M,cwd:V,execPath:S});return M},qI=($,I,G={})=>{let V=GI.default._parse($,I,G);if($=V.command,I=V.args,G=V.options,G={maxBuffer:_3,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:G.cwd||N$.cwd(),execPath:N$.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:$I,...G},G.env=O3(G),G.stdio=N2(G),N$.platform==="win32"&&y3.basename($,".exe")==="cmd")I.unshift("/q");return{file:$,args:I,options:G,parsed:V}},a=($,I,G)=>{if(typeof I!=="string"&&!z3.isBuffer(I))return G===void 0?void 0:"";if($.stripFinalNewline)return e$(I);return I};function j$($,I,G){let V=qI($,I,G),S=B1($,I),M=K1($,I);T1(M,V.options),w2(V.options);let q;try{q=N1.spawn(V.file,V.args,V.options)}catch(A){let N=new N1.ChildProcess,x=Promise.reject(r({error:A,stdout:"",stderr:"",all:"",command:S,escapedCommand:M,parsed:V,timedOut:!1,isCanceled:!1,killed:!1}));return b1(N,x),N}let H=o2(q),Z=x2(q,V.options,H),J=P2(q,V.options,Z),X={isCanceled:!1};q.kill=O2.bind(null,q.kill.bind(q)),q.cancel=v2.bind(null,q,X);let W=b2(async()=>{let[{error:A,exitCode:N,signal:x,timedOut:C},s,e,$$]=await r2(q,V.options,J),j1=a(V.options,s),z1=a(V.options,e),y1=a(V.options,$$);if(A||N!==0||x!==null){let _1=r({error:A,exitCode:N,signal:x,stdout:j1,stderr:z1,all:y1,command:S,escapedCommand:M,parsed:V,timedOut:C,isCanceled:X.isCanceled||(V.options.signal?V.options.signal.aborted:!1),killed:q.killed});if(!V.options.reject)return _1;throw _1}return{command:S,escapedCommand:M,exitCode:0,stdout:j1,stderr:z1,all:y1,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return l2(q,V.options),q.all=p2(q,V.options),E2(q),b1(q,W),q}function v3($,I,G){let V=qI($,I,G),S=B1($,I),M=K1($,I);T1(M,V.options);let q=t2(V.options),H;try{H=N1.spawnSync(V.file,V.args,{...V.options,input:q})}catch(X){throw r({error:X,stdout:"",stderr:"",all:"",command:S,escapedCommand:M,parsed:V,timedOut:!1,isCanceled:!1,killed:!1})}let Z=a(V.options,H.stdout,H.error),J=a(V.options,H.stderr,H.error);if(H.error||H.status!==0||H.signal!==null){let X=r({stdout:Z,stderr:J,error:H.error,signal:H.signal,exitCode:H.status,command:S,escapedCommand:M,parsed:V,timedOut:H.error&&H.error.code==="ETIMEDOUT",isCanceled:!1,killed:H.signal!==null});if(!V.options.reject)return X;throw X}return{command:S,escapedCommand:M,exitCode:0,stdout:Z,stderr:J,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var x3=({input:$,inputFile:I,stdio:G})=>$===void 0&&I===void 0&&G===void 0?{stdin:"inherit"}:{},II=($={})=>({preferLocal:!0,...x3($),...$});function VI($){function I(G,...V){if(!Array.isArray(G))return VI({...$,...G});let[S,...M]=A1(G,V);return j$(S,M,II($))}return I.sync=(G,...V)=>{if(!Array.isArray(G))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[S,...M]=A1(G,V);return v3(S,M,II($))},I}var vq=VI();import{readFile as w3,writeFile as P3}from"node:fs/promises";function SI($,I){if(I==="prisma")return"";switch($){case"postgresql":return I==="kysely"?"pg":"postgres";case"mysql":return"mysql2";case"sqlite":return"better-sqlite3"}}async function MI($,I,G,V){let S=[],M=[];switch(I){case"drizzle":S=["drizzle-orm",SI(G,I)],M=["drizzle-kit"];break;case"prisma":S=["@prisma/client"],M=["prisma"];break;case"kysely":S=["kysely",SI(G,I)],M=[];break}let q=$==="npm"?"install":"add",H=$==="npm"?"--save-dev":"-D";if(S.length>0)await j$($,[q,...S],{stdio:"inherit"});if(M.length>0)await j$($,[q,H,...M],{stdio:"inherit"})}async function HI($,I){let V=await w3("package.json","utf-8"),S=JSON.parse(V),M={};switch($){case"drizzle":M={"db:generate":"drizzle-kit generate","db:migrate":"drizzle-kit migrate","db:push":"drizzle-kit push","db:studio":"drizzle-kit studio"};break;case"prisma":M={"db:generate":"prisma generate","db:migrate":"prisma migrate dev","db:push":"prisma db push","db:studio":"prisma studio","db:seed":"prisma db seed"};break;case"kysely":M={"db:migrate":"bun src/lib/db/migrate.ts"};break}S.scripts={...S.scripts,...M},await P3("package.json",JSON.stringify(S,null,2)+`
315
- `)}async function E3(){console.clear(),$0(Y.bold.blue("\uD83D\uDDC4️ ORM Setup CLI v1.0.0"));try{let $=G0();$.start("Analyzing your project...");let I=await Y0();if($.stop("Project analyzed"),T.info(`${Y.green("✓")} ${I.hasTypescript?"TypeScript":"JavaScript"} project`),T.info(`${Y.green("✓")} Package manager: ${I.packageManager}`),I.srcDir)T.info(`${Y.green("✓")} Source directory: ${I.srcDir}/`);if(I.database.url)T.info(`${Y.green("✓")} Database: ${I.database.type} (from .env)`);else T.warn(`${Y.yellow("!")} No DATABASE_URL found in .env`);if(I.hasDrizzle){if(T.warn(`${Y.yellow("⚠")} Drizzle is already set up in this project`),!await n({message:"Continue anyway? (this may overwrite files)",initialValue:!1}))e1("Operation cancelled"),process.exit(0)}let G=await L0(I),V=R0(I.srcDir,G.clientPath);switch($.start("Installing dependencies..."),await MI(I.packageManager,G.orm,G.database,G.includeStudio),$.stop("Dependencies installed"),$.start("Generating files..."),G.orm){case"drizzle":await T0({paths:V,database:G.database,typescript:I.hasTypescript,includeExamples:G.includeSchema});break;case"prisma":await N0({paths:V,database:G.database,includeExamples:G.includeSchema});break;case"kysely":await y0({paths:V,database:G.database,selectedTables:[]});break}if($.stop("Files generated"),$.start("Updating package.json..."),await HI(G.orm,G.database),$.stop("package.json updated"),I0(Y.green.bold(`✅ ${G.orm==="drizzle"?"Drizzle":G.orm==="prisma"?"Prisma":"Kysely"} ORM setup complete!`)),console.log(),T.step("Import your database client:"),G.orm==="drizzle")console.log(Y.cyan(" import { db } from '@/lib/db'"));else if(G.orm==="prisma")console.log(Y.cyan(" import { prisma } from '@/lib/prisma'"));else console.log(Y.cyan(" import { db } from '@/lib/db'"));if(console.log(),T.step("Next steps:"),G.orm==="drizzle"){if(console.log(` ${Y.gray("1.")} Add DATABASE_URL to .env`),console.log(` ${Y.gray("2.")} Run: ${Y.cyan("bun db:generate")} (create migration)`),console.log(` ${Y.gray("3.")} Run: ${Y.cyan("bun db:migrate")} (apply migration)`),G.includeStudio)console.log(` ${Y.gray("4.")} Run: ${Y.cyan("bun db:studio")} (open database GUI)`)}else if(G.orm==="prisma")console.log(` ${Y.gray("1.")} Add DATABASE_URL to .env`),console.log(` ${Y.gray("2.")} Run: ${Y.cyan("bun db:generate")} (generate client)`),console.log(` ${Y.gray("3.")} Run: ${Y.cyan("bun db:migrate")} (create & apply migration)`),console.log(` ${Y.gray("4.")} Run: ${Y.cyan("bun db:studio")} (open Prisma Studio)`);else console.log(` ${Y.gray("1.")} Add DATABASE_URL to .env`),console.log(` ${Y.gray("2.")} Create migrations in migrations/ folder`),console.log(` ${Y.gray("3.")} Run: ${Y.cyan("bun db:migrate")} (apply migrations)`);console.log();let S=G.orm==="drizzle"?"https://orm.drizzle.team/docs":G.orm==="prisma"?"https://www.prisma.io/docs":"https://kysely.dev/docs";T.info(`Documentation: ${Y.cyan(S)}`)}catch($){if($ instanceof Error)T.error(Y.red(`Error: ${$.message}`));process.exit(1)}}E3();
552
+ `.charCodeAt(),i=typeof $==="string"?"\r":"\r".charCodeAt();if($[$.length-1]===b)$=$.slice(0,-1);if($[$.length-1]===i)$=$.slice(0,-1);return $}import U$ from"node:process";import r from"node:path";import{fileURLToPath as m0}from"node:url";function V$($={}){let{env:b=process.env,platform:i=process.platform}=$;if(i!=="win32")return"PATH";return Object.keys(b).reverse().find((y)=>y.toUpperCase()==="PATH")||"Path"}var bI=({cwd:$=U$.cwd(),path:b=U$.env[V$()],preferLocal:i=!0,execPath:y=U$.execPath,addExecPath:G=!0}={})=>{let S=$ instanceof URL?m0($):$,I=r.resolve(S),c=[];if(i)iI(c,I);if(G)II(c,y,I);return[...c,b].join(r.delimiter)},iI=($,b)=>{let i;while(i!==b)$.push(r.join(b,"node_modules/.bin")),i=b,b=r.resolve(b,"..")},II=($,b,i)=>{let y=b instanceof URL?m0(b):b;$.push(r.resolve(i,y,".."))},R0=({env:$=U$.env,...b}={})=>{$={...$};let i=V$({env:$});return b.path=$[i],$[i]=bI(b),$};var yI=($,b,i,y)=>{if(i==="length"||i==="prototype")return;if(i==="arguments"||i==="caller")return;let G=Object.getOwnPropertyDescriptor($,i),S=Object.getOwnPropertyDescriptor(b,i);if(!GI(G,S)&&y)return;Object.defineProperty($,i,S)},GI=function($,b){return $===void 0||$.configurable||$.writable===b.writable&&$.enumerable===b.enumerable&&$.configurable===b.configurable&&($.writable||$.value===b.value)},SI=($,b)=>{let i=Object.getPrototypeOf(b);if(i===Object.getPrototypeOf($))return;Object.setPrototypeOf($,i)},cI=($,b)=>`/* Wrapped ${$}*/
553
+ ${b}`,qI=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),nI=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),MI=($,b,i)=>{let y=i===""?"":`with ${i.trim()}() `,G=cI.bind(null,y,b.toString());Object.defineProperty(G,"name",nI),Object.defineProperty($,"toString",{...qI,value:G})};function e$($,b,{ignoreNonConfigurable:i=!1}={}){let{name:y}=$;for(let G of Reflect.ownKeys(b))yI($,b,G,i);return SI($,b),MI($,b,y),$}var m$=new WeakMap,L0=($,b={})=>{if(typeof $!=="function")throw TypeError("Expected a function");let i,y=0,G=$.displayName||$.name||"<anonymous>",S=function(...I){if(m$.set(S,++y),y===1)i=$.apply(this,I),$=null;else if(b.throw===!0)throw Error(`Function \`${G}\` can only be called once`);return i};return e$(S,$),m$.set(S,y),S};L0.callCount=($)=>{if(!m$.has($))throw Error(`The given function \`${$.name}\` is not wrapped by the \`onetime\` package`);return m$.get($)};var A0=L0;import TI from"node:process";import{constants as RI}from"node:os";var H0=()=>{let $=$1-J0+1;return Array.from({length:$},VI)},VI=($,b)=>({name:`SIGRT${b+1}`,number:J0+b,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),J0=34,$1=64;import{constants as UI}from"node:os";var Q0=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var b1=()=>{let $=H0();return[...Q0,...$].map(mI)},mI=({name:$,number:b,description:i,action:y,forced:G=!1,standard:S})=>{let{signals:{[$]:I}}=UI,c=I!==void 0;return{name:$,number:c?I:b,description:i,supported:c,action:y,forced:G,standard:S}};var LI=()=>{let $=b1();return Object.fromEntries($.map(AI))},AI=({name:$,number:b,description:i,supported:y,action:G,forced:S,standard:I})=>[$,{name:$,number:b,description:i,supported:y,action:G,forced:S,standard:I}],T0=LI(),HI=()=>{let $=b1(),b=$1+1,i=Array.from({length:b},(y,G)=>JI(G,$));return Object.assign({},...i)},JI=($,b)=>{let i=QI($,b);if(i===void 0)return{};let{name:y,description:G,supported:S,action:I,forced:c,standard:M}=i;return{[$]:{name:y,number:$,description:G,supported:S,action:I,forced:c,standard:M}}},QI=($,b)=>{let i=b.find(({name:y})=>RI.signals[y]===$);if(i!==void 0)return i;return b.find((y)=>y.number===$)},cS=HI();var ZI=({timedOut:$,timeout:b,errorCode:i,signal:y,signalDescription:G,exitCode:S,isCanceled:I})=>{if($)return`timed out after ${b} milliseconds`;if(I)return"was canceled";if(i!==void 0)return`failed with ${i}`;if(y!==void 0)return`was killed with ${y} (${G})`;if(S!==void 0)return`failed with exit code ${S}`;return"failed"},o=({stdout:$,stderr:b,all:i,error:y,signal:G,exitCode:S,command:I,escapedCommand:c,timedOut:M,isCanceled:n,killed:V,parsed:{options:{timeout:U,cwd:m=TI.cwd()}}})=>{S=S===null?void 0:S,G=G===null?void 0:G;let T=G===void 0?void 0:T0[G].description,X=y&&y.code,P=`Command ${ZI({timedOut:M,timeout:U,errorCode:X,signal:G,signalDescription:T,exitCode:S,isCanceled:n})}: ${I}`,s=Object.prototype.toString.call(y)==="[object Error]",e=s?`${P}
554
+ ${y.message}`:P,$$=[e,b,$].filter(Boolean).join(`
555
+ `);if(s)y.originalMessage=y.message,y.message=$$;else y=Error($$);if(y.shortMessage=e,y.command=I,y.escapedCommand=c,y.exitCode=S,y.signal=G,y.signalDescription=T,y.stdout=$,y.stderr=b,y.cwd=m,i!==void 0)y.all=i;if("bufferedData"in y)delete y.bufferedData;return y.failed=!0,y.timedOut=Boolean(M),y.isCanceled=n,y.killed=V&&!M,y};var R$=["stdin","stdout","stderr"],XI=($)=>R$.some((b)=>$[b]!==void 0),Z0=($)=>{if(!$)return;let{stdio:b}=$;if(b===void 0)return R$.map((y)=>$[y]);if(XI($))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${R$.map((y)=>`\`${y}\``).join(", ")}`);if(typeof b==="string")return b;if(!Array.isArray(b))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof b}\``);let i=Math.max(b.length,R$.length);return Array.from({length:i},(y,G)=>b[G])};import KI from"node:os";var x=[];x.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")x.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")x.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var L$=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",i1=Symbol.for("signal-exit emitter"),I1=globalThis,zI=Object.defineProperty.bind(Object);class X0{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(I1[i1])return I1[i1];zI(I1,i1,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,b){this.listeners[$].push(b)}removeListener($,b){let i=this.listeners[$],y=i.indexOf(b);if(y===-1)return;if(y===0&&i.length===1)i.length=0;else i.splice(y,1)}emit($,b,i){if(this.emitted[$])return!1;this.emitted[$]=!0;let y=!1;for(let G of this.listeners[$])y=G(b,i)===!0||y;if($==="exit")y=this.emit("afterExit",b,i)||y;return y}}class G1{}var WI=($)=>{return{onExit(b,i){return $.onExit(b,i)},load(){return $.load()},unload(){return $.unload()}}};class z0 extends G1{onExit(){return()=>{}}load(){}unload(){}}class W0 extends G1{#S=y1.platform==="win32"?"SIGINT":"SIGHUP";#b=new X0;#$;#y;#G;#I={};#i=!1;constructor($){super();this.#$=$,this.#I={};for(let b of x)this.#I[b]=()=>{let i=this.#$.listeners(b),{count:y}=this.#b,G=$;if(typeof G.__signal_exit_emitter__==="object"&&typeof G.__signal_exit_emitter__.count==="number")y+=G.__signal_exit_emitter__.count;if(i.length===y){this.unload();let S=this.#b.emit("exit",null,b),I=b==="SIGHUP"?this.#S:b;if(!S)$.kill($.pid,I)}};this.#G=$.reallyExit,this.#y=$.emit}onExit($,b){if(!L$(this.#$))return()=>{};if(this.#i===!1)this.load();let i=b?.alwaysLast?"afterExit":"exit";return this.#b.on(i,$),()=>{if(this.#b.removeListener(i,$),this.#b.listeners.exit.length===0&&this.#b.listeners.afterExit.length===0)this.unload()}}load(){if(this.#i)return;this.#i=!0,this.#b.count+=1;for(let $ of x)try{let b=this.#I[$];if(b)this.#$.on($,b)}catch(b){}this.#$.emit=($,...b)=>{return this.#q($,...b)},this.#$.reallyExit=($)=>{return this.#c($)}}unload(){if(!this.#i)return;this.#i=!1,x.forEach(($)=>{let b=this.#I[$];if(!b)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,b)}catch(i){}}),this.#$.emit=this.#y,this.#$.reallyExit=this.#G,this.#b.count-=1}#c($){if(!L$(this.#$))return 0;return this.#$.exitCode=$||0,this.#b.emit("exit",this.#$.exitCode,null),this.#G.call(this.#$,this.#$.exitCode)}#q($,...b){let i=this.#y;if($==="exit"&&L$(this.#$)){if(typeof b[0]==="number")this.#$.exitCode=b[0];let y=i.call(this.#$,$,...b);return this.#b.emit("exit",this.#$.exitCode,null),y}else return i.call(this.#$,$,...b)}}var y1=globalThis.process,{onExit:K0,load:LS,unload:AS}=WI(L$(y1)?new W0(y1):new z0);var BI=5000,B0=($,b="SIGTERM",i={})=>{let y=$(b);return YI($,b,i,y),y},YI=($,b,i,y)=>{if(!NI(b,i,y))return;let G=vI(i),S=setTimeout(()=>{$("SIGKILL")},G);if(S.unref)S.unref()},NI=($,{forceKillAfterTimeout:b},i)=>jI($)&&b!==!1&&i,jI=($)=>$===KI.constants.signals.SIGTERM||typeof $==="string"&&$.toUpperCase()==="SIGTERM",vI=({forceKillAfterTimeout:$=!0})=>{if($===!0)return BI;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},Y0=($,b)=>{if($.kill())b.isCanceled=!0},wI=($,b,i)=>{$.kill(b),i(Object.assign(Error("Timed out"),{timedOut:!0,signal:b}))},N0=($,{timeout:b,killSignal:i="SIGTERM"},y)=>{if(b===0||b===void 0)return y;let G,S=new Promise((c,M)=>{G=setTimeout(()=>{wI($,i,M)},b)}),I=y.finally(()=>{clearTimeout(G)});return Promise.race([S,I])},j0=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},v0=async($,{cleanup:b,detached:i},y)=>{if(!b||i)return y;let G=K0(()=>{$.kill()});return y.finally(()=>{G()})};import{createWriteStream as _I}from"node:fs";import{ChildProcess as OI}from"node:child_process";function A$($){return $!==null&&typeof $==="object"&&typeof $.pipe==="function"}function S1($){return A$($)&&$.writable!==!1&&typeof $._write==="function"&&typeof $._writableState==="object"}var xI=($)=>$ instanceof OI&&typeof $.then==="function",c1=($,b,i)=>{if(typeof i==="string")return $[b].pipe(_I(i)),$;if(S1(i))return $[b].pipe(i),$;if(!xI(i))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!S1(i.stdin))throw TypeError("The target child process's stdin must be available.");return $[b].pipe(i.stdin),i},w0=($)=>{if($.stdout!==null)$.pipeStdout=c1.bind(void 0,$,"stdout");if($.stderr!==null)$.pipeStderr=c1.bind(void 0,$,"stderr");if($.all!==void 0)$.pipeAll=c1.bind(void 0,$,"all")};import{createReadStream as eI,readFileSync as $y}from"node:fs";import{setTimeout as by}from"node:timers/promises";var D=async($,{init:b,convertChunk:i,getSize:y,truncateChunk:G,addChunk:S,getFinalChunk:I,finalize:c},{maxBuffer:M=Number.POSITIVE_INFINITY}={})=>{if(!fI($))throw Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let n=b();n.length=0;try{for await(let V of $){let U=tI(V),m=i[U](V,n);x0({convertedChunk:m,state:n,getSize:y,truncateChunk:G,addChunk:S,maxBuffer:M})}return PI({state:n,convertChunk:i,getSize:y,truncateChunk:G,addChunk:S,getFinalChunk:I,maxBuffer:M}),c(n)}catch(V){throw V.bufferedData=c(n),V}},PI=({state:$,getSize:b,truncateChunk:i,addChunk:y,getFinalChunk:G,maxBuffer:S})=>{let I=G($);if(I!==void 0)x0({convertedChunk:I,state:$,getSize:b,truncateChunk:i,addChunk:y,maxBuffer:S})},x0=({convertedChunk:$,state:b,getSize:i,truncateChunk:y,addChunk:G,maxBuffer:S})=>{let I=i($),c=b.length+I;if(c<=S){_0($,b,G,c);return}let M=y($,S-b.length);if(M!==void 0)_0(M,b,G,S);throw new q1},_0=($,b,i,y)=>{b.contents=i($,b,y),b.length=y},fI=($)=>typeof $==="object"&&$!==null&&typeof $[Symbol.asyncIterator]==="function",tI=($)=>{let b=typeof $;if(b==="string")return"string";if(b!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let i=O0.call($);if(i==="[object ArrayBuffer]")return"arrayBuffer";if(i==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&O0.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:O0}=Object.prototype;class q1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var n1=($)=>$,M1=()=>{return},V1=({contents:$})=>$,H$=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},J$=($)=>$.length;async function U1($,b){return D($,aI,b)}var hI=()=>({contents:new ArrayBuffer(0)}),EI=($)=>CI.encode($),CI=new TextEncoder,P0=($)=>new Uint8Array($),f0=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),kI=($,b)=>$.slice(0,b),uI=($,{contents:b,length:i},y)=>{let G=E0()?FI(b,y):gI(b,y);return new Uint8Array(G).set($,i),G},gI=($,b)=>{if(b<=$.byteLength)return $;let i=new ArrayBuffer(h0(b));return new Uint8Array(i).set(new Uint8Array($),0),i},FI=($,b)=>{if(b<=$.maxByteLength)return $.resize(b),$;let i=new ArrayBuffer(b,{maxByteLength:h0(b)});return new Uint8Array(i).set(new Uint8Array($),0),i},h0=($)=>t0**Math.ceil(Math.log($)/Math.log(t0)),t0=2,lI=({contents:$,length:b})=>E0()?$:$.slice(0,b),E0=()=>("resize"in ArrayBuffer.prototype),aI={init:hI,convertChunk:{string:EI,buffer:P0,arrayBuffer:P0,dataView:f0,typedArray:f0,others:H$},getSize:J$,truncateChunk:kI,addChunk:uI,getFinalChunk:M1,finalize:lI};async function Q$($,b){if(!("Buffer"in globalThis))throw Error("getStreamAsBuffer() is only supported in Node.js");try{return C0(await U1($,b))}catch(i){if(i.bufferedData!==void 0)i.bufferedData=C0(i.bufferedData);throw i}}var C0=($)=>globalThis.Buffer.from($);async function m1($,b){return D($,pI,b)}var dI=()=>({contents:"",textDecoder:new TextDecoder}),T$=($,{textDecoder:b})=>b.decode($,{stream:!0}),rI=($,{contents:b})=>b+$,oI=($,b)=>$.slice(0,b),DI=({textDecoder:$})=>{let b=$.decode();return b===""?void 0:b},pI={init:dI,convertChunk:{string:n1,buffer:T$,arrayBuffer:T$,dataView:T$,typedArray:T$,others:H$},getSize:J$,truncateChunk:oI,addChunk:rI,getFinalChunk:DI,finalize:V1};var g0=f(u0(),1),F0=($)=>{if($!==void 0)throw TypeError("The `input` and `inputFile` options cannot be both set.")},iy=({input:$,inputFile:b})=>{if(typeof b!=="string")return $;return F0($),$y(b)},l0=($)=>{let b=iy($);if(A$(b))throw TypeError("The `input` option cannot be a stream in sync mode");return b},Iy=({input:$,inputFile:b})=>{if(typeof b!=="string")return $;return F0($),eI(b)},a0=($,b)=>{let i=Iy(b);if(i===void 0)return;if(A$(i))i.pipe($.stdin);else $.stdin.end(i)},d0=($,{all:b})=>{if(!b||!$.stdout&&!$.stderr)return;let i=g0.default();if($.stdout)i.add($.stdout);if($.stderr)i.add($.stderr);return i},R1=async($,b)=>{if(!$||b===void 0)return;await by(0),$.destroy();try{return await b}catch(i){return i.bufferedData}},L1=($,{encoding:b,buffer:i,maxBuffer:y})=>{if(!$||!i)return;if(b==="utf8"||b==="utf-8")return m1($,{maxBuffer:y});if(b===null||b==="buffer")return Q$($,{maxBuffer:y});return yy($,y,b)},yy=async($,b,i)=>{return(await Q$($,{maxBuffer:b})).toString(i)},r0=async({stdout:$,stderr:b,all:i},{encoding:y,buffer:G,maxBuffer:S},I)=>{let c=L1($,{encoding:y,buffer:G,maxBuffer:S}),M=L1(b,{encoding:y,buffer:G,maxBuffer:S}),n=L1(i,{encoding:y,buffer:G,maxBuffer:S*2});try{return await Promise.all([I,c,M,n])}catch(V){return Promise.all([{error:V,signal:V.signal,timedOut:V.timedOut},R1($,c),R1(b,M),R1(i,n)])}};var Gy=(async()=>{})().constructor.prototype,Sy=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(Gy,$)]),A1=($,b)=>{for(let[i,y]of Sy){let G=typeof b==="function"?(...S)=>Reflect.apply(y.value,b(),S):y.value.bind(b);Reflect.defineProperty($,i,{...y,value:G})}},o0=($)=>new Promise((b,i)=>{if($.on("exit",(y,G)=>{b({exitCode:y,signal:G})}),$.on("error",(y)=>{i(y)}),$.stdin)$.stdin.on("error",(y)=>{i(y)})});import{Buffer as cy}from"node:buffer";import{ChildProcess as qy}from"node:child_process";var s0=($,b=[])=>{if(!Array.isArray(b))return[$];return[$,...b]},ny=/^[\w.-]+$/,My=($)=>{if(typeof $!=="string"||ny.test($))return $;return`"${$.replaceAll('"',"\\\"")}"`},H1=($,b)=>s0($,b).join(" "),J1=($,b)=>s0($,b).map((i)=>My(i)).join(" "),Vy=/ +/g;var D0=($)=>{let b=typeof $;if(b==="string")return $;if(b==="number")return String($);if(b==="object"&&$!==null&&!($ instanceof qy)&&"stdout"in $){let i=typeof $.stdout;if(i==="string")return $.stdout;if(cy.isBuffer($.stdout))return $.stdout.toString();throw TypeError(`Unexpected "${i}" stdout in template expression`)}throw TypeError(`Unexpected "${b}" in template expression`)},p0=($,b,i)=>i||$.length===0||b.length===0?[...$,...b]:[...$.slice(0,-1),`${$.at(-1)}${b[0]}`,...b.slice(1)],Uy=({templates:$,expressions:b,tokens:i,index:y,template:G})=>{let S=G??$.raw[y],I=S.split(Vy).filter(Boolean),c=p0(i,I,S.startsWith(" "));if(y===b.length)return c;let M=b[y],n=Array.isArray(M)?M.map((V)=>D0(V)):[D0(M)];return p0(c,n,S.endsWith(" "))},Q1=($,b)=>{let i=[];for(let[y,G]of $.entries())i=Uy({templates:$,expressions:b,tokens:i,index:y,template:G});return i};import{debuglog as my}from"node:util";import Ry from"node:process";var e0=my("execa").enabled,Z$=($,b)=>String($).padStart(b,"0"),Ly=()=>{let $=new Date;return`${Z$($.getHours(),2)}:${Z$($.getMinutes(),2)}:${Z$($.getSeconds(),2)}.${Z$($.getMilliseconds(),3)}`},T1=($,{verbose:b})=>{if(!b)return;Ry.stderr.write(`[${Ly()}] ${$}
556
+ `)};var Jy=1e8,Qy=({env:$,extendEnv:b,preferLocal:i,localDir:y,execPath:G})=>{let S=b?{...X$.env,...$}:$;if(i)return R0({env:S,cwd:y,execPath:G});return S},i2=($,b,i={})=>{let y=b2.default._parse($,b,i);if($=y.command,b=y.args,i=y.options,i={maxBuffer:Jy,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:i.cwd||X$.cwd(),execPath:X$.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:e0,...i},i.env=Qy(i),i.stdio=Z0(i),X$.platform==="win32"&&Hy.basename($,".exe")==="cmd")b.unshift("/q");return{file:$,args:b,options:i,parsed:y}},p=($,b,i)=>{if(typeof b!=="string"&&!Ay.isBuffer(b))return i===void 0?void 0:"";if($.stripFinalNewline)return s$(b);return b};function z$($,b,i){let y=i2($,b,i),G=H1($,b),S=J1($,b);T1(S,y.options),j0(y.options);let I;try{I=Z1.spawn(y.file,y.args,y.options)}catch(T){let X=new Z1.ChildProcess,j=Promise.reject(o({error:T,stdout:"",stderr:"",all:"",command:G,escapedCommand:S,parsed:y,timedOut:!1,isCanceled:!1,killed:!1}));return A1(X,j),X}let c=o0(I),M=N0(I,y.options,c),n=v0(I,y.options,M),V={isCanceled:!1};I.kill=B0.bind(null,I.kill.bind(I)),I.cancel=Y0.bind(null,I,V);let m=A0(async()=>{let[{error:T,exitCode:X,signal:j,timedOut:P},s,e,$$]=await r0(I,y.options,n),X1=p(y.options,s),z1=p(y.options,e),W1=p(y.options,$$);if(T||X!==0||j!==null){let K1=o({error:T,exitCode:X,signal:j,stdout:X1,stderr:z1,all:W1,command:G,escapedCommand:S,parsed:y,timedOut:P,isCanceled:V.isCanceled||(y.options.signal?y.options.signal.aborted:!1),killed:I.killed});if(!y.options.reject)return K1;throw K1}return{command:G,escapedCommand:S,exitCode:0,stdout:X1,stderr:z1,all:W1,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return a0(I,y.options),I.all=d0(I,y.options),w0(I),A1(I,m),I}function Ty($,b,i){let y=i2($,b,i),G=H1($,b),S=J1($,b);T1(S,y.options);let I=l0(y.options),c;try{c=Z1.spawnSync(y.file,y.args,{...y.options,input:I})}catch(V){throw o({error:V,stdout:"",stderr:"",all:"",command:G,escapedCommand:S,parsed:y,timedOut:!1,isCanceled:!1,killed:!1})}let M=p(y.options,c.stdout,c.error),n=p(y.options,c.stderr,c.error);if(c.error||c.status!==0||c.signal!==null){let V=o({stdout:M,stderr:n,error:c.error,signal:c.signal,exitCode:c.status,command:G,escapedCommand:S,parsed:y,timedOut:c.error&&c.error.code==="ETIMEDOUT",isCanceled:!1,killed:c.signal!==null});if(!y.options.reject)return V;throw V}return{command:G,escapedCommand:S,exitCode:0,stdout:M,stderr:n,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Zy=({input:$,inputFile:b,stdio:i})=>$===void 0&&b===void 0&&i===void 0?{stdin:"inherit"}:{},$2=($={})=>({preferLocal:!0,...Zy($),...$});function I2($){function b(i,...y){if(!Array.isArray(i))return I2({...$,...i});let[G,...S]=Q1(i,y);return z$(G,S,$2($))}return b.sync=(i,...y)=>{if(!Array.isArray(i))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[G,...S]=Q1(i,y);return Ty(G,S,$2($))},b}var Xc=I2();import{readFile as Xy,writeFile as zy}from"node:fs/promises";function y2($,b){if(b==="prisma")return"";switch($){case"postgresql":return b==="kysely"?"pg":"postgres";case"mysql":return"mysql2";case"sqlite":return"better-sqlite3"}}async function G2($,b,i,y){let G=[],S=[];switch(b){case"drizzle":G=["drizzle-orm",y2(i,b)],S=["drizzle-kit"];break;case"prisma":G=["@prisma/client"],S=["prisma"];break;case"kysely":G=["kysely",y2(i,b)],S=[];break}let I=$==="npm"?"install":"add",c=$==="npm"?"--save-dev":"-D";if(G.length>0)await z$($,[I,...G],{stdio:"inherit"});if(S.length>0)await z$($,[I,c,...S],{stdio:"inherit"})}async function S2($,b){let y=await Xy("package.json","utf-8"),G=JSON.parse(y),S={};switch($){case"drizzle":S={"db:generate":"drizzle-kit generate","db:migrate":"drizzle-kit migrate","db:push":"drizzle-kit push","db:studio":"drizzle-kit studio"};break;case"prisma":S={"db:generate":"prisma generate","db:migrate":"prisma migrate dev","db:push":"prisma db push","db:studio":"prisma studio","db:seed":"prisma db seed"};break;case"kysely":S={"db:migrate":"bun src/lib/db/migrate.ts"};break}G.scripts={...G.scripts,...S},await zy("package.json",JSON.stringify(G,null,2)+`
557
+ `)}async function Wy(){console.clear(),e1(R.bold.blue("\uD83D\uDDC4️ ORM Setup CLI v1.0.0"));try{let $=bb();$.start("Analyzing your project...");let b=await mb();if($.stop("Project analyzed"),Z.info(`${R.green("✓")} ${b.hasTypescript?"TypeScript":"JavaScript"} project`),Z.info(`${R.green("✓")} Package manager: ${b.packageManager}`),b.srcDir)Z.info(`${R.green("✓")} Source directory: ${b.srcDir}/`);if(b.database.url)Z.info(`${R.green("✓")} Database: ${b.database.type} (from .env)`);else Z.warn(`${R.yellow("!")} No DATABASE_URL found in .env`);if(b.hasDrizzle){if(Z.warn(`${R.yellow("⚠")} Drizzle is already set up in this project`),!await l({message:"Continue anyway? (this may overwrite files)",initialValue:!1}))s1("Operation cancelled"),process.exit(0)}let i=await Rb(b),y=Lb(b.srcDir,i.clientPath);switch($.start("Installing dependencies..."),await G2(b.packageManager,i.orm,i.database,i.includeStudio),$.stop("Dependencies installed"),$.start("Generating files..."),i.orm){case"drizzle":await Xb({paths:y,database:i.database,template:i.template,typescript:b.hasTypescript});break;case"prisma":await zb({paths:y,database:i.database,template:i.template});break;case"kysely":await Wb({paths:y,database:i.database,template:i.template});break}if($.stop("Files generated"),$.start("Updating package.json..."),await S2(i.orm,i.database),$.stop("package.json updated"),$b(R.green.bold(`✅ ${i.orm==="drizzle"?"Drizzle":i.orm==="prisma"?"Prisma":"Kysely"} ORM setup complete!`)),console.log(),Z.step("Import your database client:"),i.orm==="drizzle")console.log(R.cyan(" import { db } from '@/lib/db'"));else if(i.orm==="prisma")console.log(R.cyan(" import { prisma } from '@/lib/prisma'"));else console.log(R.cyan(" import { db } from '@/lib/db'"));if(console.log(),Z.step("Next steps:"),i.orm==="drizzle"){if(console.log(` ${R.gray("1.")} Add DATABASE_URL to .env`),console.log(` ${R.gray("2.")} Run: ${R.cyan("bun db:generate")} (create migration)`),console.log(` ${R.gray("3.")} Run: ${R.cyan("bun db:migrate")} (apply migration)`),i.includeStudio)console.log(` ${R.gray("4.")} Run: ${R.cyan("bun db:studio")} (open database GUI)`)}else if(i.orm==="prisma")console.log(` ${R.gray("1.")} Add DATABASE_URL to .env`),console.log(` ${R.gray("2.")} Run: ${R.cyan("bun db:generate")} (generate client)`),console.log(` ${R.gray("3.")} Run: ${R.cyan("bun db:migrate")} (create & apply migration)`),console.log(` ${R.gray("4.")} Run: ${R.cyan("bun db:studio")} (open Prisma Studio)`);else console.log(` ${R.gray("1.")} Add DATABASE_URL to .env`),console.log(` ${R.gray("2.")} Create migrations in migrations/ folder`),console.log(` ${R.gray("3.")} Run: ${R.cyan("bun db:migrate")} (apply migrations)`);console.log();let G=i.orm==="drizzle"?"https://orm.drizzle.team/docs":i.orm==="prisma"?"https://www.prisma.io/docs":"https://kysely.dev/docs";Z.info(`Documentation: ${R.cyan(G)}`)}catch($){if($ instanceof Error)Z.error(R.red(`Error: ${$.message}`));process.exit(1)}}Wy();