relic 0.4.0 → 0.4.1
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/cli.js +464 -0
- package/package.json +17 -17
- package/prebuilds/win32-x64/relic_runner.dll +0 -0
- package/commands/init.ts +0 -105
- package/commands/login.ts +0 -85
- package/commands/logout.ts +0 -39
- package/commands/projects.ts +0 -154
- package/commands/run.api-key.test.ts +0 -240
- package/commands/run.test.ts +0 -404
- package/commands/run.ts +0 -532
- package/commands/run.validation.test.ts +0 -135
- package/commands/telemetry.ts +0 -28
- package/commands/whoami.ts +0 -45
- package/ffi/bridge.ts +0 -36
- package/ffi/constants.ts +0 -3
- package/ffi/helper.ts +0 -134
- package/index.ts +0 -116
- package/lib/api.ts +0 -411
- package/lib/config.ts +0 -118
- package/lib/crypto.ts +0 -81
- package/lib/types.ts +0 -1
package/dist/cli.js
ADDED
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
var fn=Object.create;var{getPrototypeOf:Bn,defineProperty:m2,getOwnPropertyNames:An}=Object;var hn=Object.prototype.hasOwnProperty;var Q=(D,u,F)=>{F=D!=null?fn(Bn(D)):{};let E=u||!D||!D.__esModule?m2(F,"default",{value:D,enumerable:!0}):F;for(let C of An(D))if(!hn.call(E,C))m2(E,C,{get:()=>D[C],enumerable:!0});return E};var BD=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var w0=(D,u)=>{for(var F in u)m2(D,F,{get:u[F],enumerable:!0,configurable:!0,set:(E)=>u[F]=()=>E})};var o=(D,u)=>()=>(D&&(u=D(D=0)),u);var TD=import.meta.require;var A3={};w0(A3,{prompt:()=>B3,kCancel:()=>f3});import AD,{stdin as Gn,stdout as Mn}from"process";import jE from"readline";import{WriteStream as qn}from"tty";function Zn(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function Jn(){if(kE)return q2;kE=1;let D="\x1B",u=`${D}[`,F="\x07",E={to(t,n){if(!n)return`${u}${t+1}G`;return`${u}${n+1};${t+1}H`},move(t,n){let i="";if(t<0)i+=`${u}${-t}D`;else if(t>0)i+=`${u}${t}C`;if(n<0)i+=`${u}${-n}A`;else if(n>0)i+=`${u}${n}B`;return i},up:(t=1)=>`${u}${t}A`,down:(t=1)=>`${u}${t}B`,forward:(t=1)=>`${u}${t}C`,backward:(t=1)=>`${u}${t}D`,nextLine:(t=1)=>`${u}E`.repeat(t),prevLine:(t=1)=>`${u}F`.repeat(t),left:`${u}G`,hide:`${u}?25l`,show:`${u}?25h`,save:`${D}7`,restore:`${D}8`},C={up:(t=1)=>`${u}S`.repeat(t),down:(t=1)=>`${u}T`.repeat(t)},c={screen:`${u}2J`,up:(t=1)=>`${u}1J`.repeat(t),down:(t=1)=>`${u}J`.repeat(t),line:`${u}2K`,lineEnd:`${u}K`,lineStart:`${u}1K`,lines(t){let n="";for(let i=0;i<t;i++)n+=this.line+(i<t-1?E.up():"");if(t)n+=E.left;return n}};return q2={cursor:E,scroll:C,erase:c,beep:F},q2}function Kn(){if(yE)return S0.exports;yE=1;let D=process||{},u=D.argv||[],F=D.env||{},E=!(!!F.NO_COLOR||u.includes("--no-color"))&&(!!F.FORCE_COLOR||u.includes("--color")||D.platform==="win32"||(D.stdout||{}).isTTY&&F.TERM!=="dumb"||!!F.CI),C=(n,i,f=n)=>(B)=>{let A=""+B,h=A.indexOf(i,n.length);return~h?n+c(A,i,f,h)+i:n+A+i},c=(n,i,f,B)=>{let A="",h=0;do A+=n.substring(h,B)+f,h=B+i.length,B=n.indexOf(i,h);while(~B);return A+n.substring(h)},t=(n=E)=>{let i=n?C:()=>String;return{isColorSupported:n,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")}};return S0.exports=t(),S0.exports.createColors=t,S0.exports}function Pn({onlyFirst:D=!1}={}){let u=["[\\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(u,D?void 0:"g")}function D3(D){if(typeof D!="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(Vn,"")}function u3(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function Zu(D,u={}){if(typeof D!="string"||D.length===0||(u={ambiguousIsNarrow:!0,...u},D=D3(D),D.length===0))return 0;D=D.replace(vn()," ");let F=u.ambiguousIsNarrow?1:2,E=0;for(let C of D){let c=C.codePointAt(0);if(c<=31||c>=127&&c<=159||c>=768&&c<=879)continue;switch(kn.eastAsianWidth(C)){case"F":case"W":E+=2;break;case"A":E+=F;break;default:E+=1}}return E}function sn(){let D=new Map;for(let[u,F]of Object.entries(m)){for(let[E,C]of Object.entries(F))m[E]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[E]=m[E],D.set(C[0],C[1]);Object.defineProperty(m,u,{value:F,enumerable:!1})}return Object.defineProperty(m,"codes",{value:D,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=vE(),m.color.ansi256=lE(),m.color.ansi16m=dE(),m.bgColor.ansi=vE(Z2),m.bgColor.ansi256=lE(Z2),m.bgColor.ansi16m=dE(Z2),Object.defineProperties(m,{rgbToAnsi256:{value:(u,F,E)=>u===F&&F===E?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5),enumerable:!1},hexToRgb:{value:(u)=>{let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;E.length===3&&(E=[...E].map((c)=>c+c).join(""));let C=Number.parseInt(E,16);return[C>>16&255,C>>8&255,C&255]},enumerable:!1},hexToAnsi256:{value:(u)=>m.rgbToAnsi256(...m.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:(u)=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,C;if(u>=232)F=((u-232)*10+8)/255,E=F,C=F;else{u-=16;let n=u%36;F=Math.floor(u/36)/5,E=Math.floor(n/6)/5,C=n%6/5}let c=Math.max(F,E,C)*2;if(c===0)return 30;let t=30+(Math.round(C)<<2|Math.round(E)<<1|Math.round(F));return c===2&&(t+=60),t},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>m.ansi256ToAnsi(m.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>m.ansi256ToAnsi(m.hexToAnsi256(u)),enumerable:!1}}),m}function eE(D,u,F){return String(D).normalize().replace(/\r\n/g,`
|
|
4
|
+
`).split(`
|
|
5
|
+
`).map((E)=>pn(E,u,F)).join(`
|
|
6
|
+
`)}function C3(D,u){if(typeof D=="string")return N0.aliases.get(D)===u;for(let F of D)if(F!==void 0&&C3(F,u))return!0;return!1}function ui(D,u){if(D===u)return;let F=D.split(`
|
|
7
|
+
`),E=u.split(`
|
|
8
|
+
`),C=[];for(let c=0;c<Math.max(F.length,E.length);c++)F[c]!==E[c]&&C.push(c);return C}function I0(D,u){let F=D;F.isTTY&&F.setRawMode(u)}class Ju{constructor(D,u=!0){uD(this,"input"),uD(this,"output"),uD(this,"_abortSignal"),uD(this,"rl"),uD(this,"opts"),uD(this,"_render"),uD(this,"_track",!1),uD(this,"_prevFrame",""),uD(this,"_subscribers",new Map),uD(this,"_cursor",0),uD(this,"state","initial"),uD(this,"error",""),uD(this,"value");let{input:F=Gn,output:E=Mn,render:C,signal:c,...t}=D;this.opts=t,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=C.bind(this),this._track=u,this._abortSignal=c,this.input=F,this.output=E}unsubscribe(){this._subscribers.clear()}setSubscriber(D,u){let F=this._subscribers.get(D)??[];F.push(u),this._subscribers.set(D,F)}on(D,u){this.setSubscriber(D,{cb:u})}once(D,u){this.setSubscriber(D,{cb:u,once:!0})}emit(D,...u){let F=this._subscribers.get(D)??[],E=[];for(let C of F)C.cb(...u),C.once&&E.push(()=>F.splice(F.indexOf(C),1));for(let C of E)C()}prompt(){return new Promise((D,u)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(oE);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let F=new qn(0);F._write=(E,C,c)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),c()},this.input.pipe(F),this.rl=jE.createInterface({input:this.input,output:F,tabSize:2,prompt:"",escapeCodeTimeout:50}),jE.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),I0(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(hD.cursor.show),this.output.off("resize",this.render),I0(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(hD.cursor.show),this.output.off("resize",this.render),I0(this.input,!1),D(oE)})})}onKeypress(D,u){if(this.state==="error"&&(this.state="active"),u?.name&&(!this._track&&N0.aliases.has(u.name)&&this.emit("cursor",N0.aliases.get(u.name)),N0.actions.has(u.name)&&this.emit("cursor",u.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),D&&this.emit("key",D.toLowerCase()),u?.name==="return"){if(this.opts.validate){let F=this.opts.validate(this.value);F&&(this.error=F instanceof Error?F.message:F,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}C3([D,u?.name,u?.sequence],"cancel")&&(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(`
|
|
9
|
+
`),I0(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let D=eE(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
10
|
+
`).length-1;this.output.write(hD.cursor.move(-999,D*-1))}render(){let D=eE(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(hD.cursor.hide);else{let u=ui(this._prevFrame,D);if(this.restoreCursor(),u&&u?.length===1){let F=u[0];this.output.write(hD.cursor.move(0,F)),this.output.write(hD.erase.lines(1));let E=D.split(`
|
|
11
|
+
`);this.output.write(E[F]),this._prevFrame=D,this.output.write(hD.cursor.move(0,E.length-F-1));return}if(u&&u?.length>1){let F=u[0];this.output.write(hD.cursor.move(0,F)),this.output.write(hD.erase.down());let E=D.split(`
|
|
12
|
+
`).slice(F);this.output.write(E.join(`
|
|
13
|
+
`)),this._prevFrame=D;return}this.output.write(hD.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}function fi(){return AD.platform!=="win32"?AD.env.TERM!=="linux":!!AD.env.CI||!!AD.env.WT_SESSION||!!AD.env.TERMINUS_SUBLIME||AD.env.ConEmuTask==="{cmd::Cmder}"||AD.env.TERM_PROGRAM==="Terminus-Sublime"||AD.env.TERM_PROGRAM==="vscode"||AD.env.TERM==="xterm-256color"||AD.env.TERM==="alacritty"||AD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function B3(D,u={}){let F=(E)=>{if(typeof E!=="symbol"||E.toString()!=="Symbol(clack:cancel)")return E;switch(u.cancel){case"reject":{let C=Error("Prompt cancelled.");if(C.name="ConsolaPromptCancelledError",Error.captureStackTrace)Error.captureStackTrace(C,B3);throw C}case"undefined":return;case"null":return null;case"symbol":return f3;default:case"default":return u.default??u.initial}};if(!u.type||u.type==="text")return await Si({message:D,defaultValue:u.default,placeholder:u.placeholder,initialValue:u.initial}).then(F);if(u.type==="confirm")return await Ii({message:D,initialValue:u.initial}).then(F);if(u.type==="select")return await Ni({message:D,options:u.options.map((E)=>typeof E==="string"?{value:E,label:E}:E),initialValue:u.initial}).then(F);if(u.type==="multiselect")return await Ui({message:D,options:u.options.map((E)=>typeof E==="string"?{value:E,label:E}:E),required:u.required,initialValues:u.initial}).then(F);throw Error(`Unknown prompt type: ${u.type}`)}var q2,kE,hD,S0,yE,Qn,_,Vn,F3,jn,kn,yn=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},vn,Z2=10,vE=(D=0)=>(u)=>`\x1B[${u+D}m`,lE=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,dE=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,m,ln,dn,gn,U0,en=39,V2="\x07",t3="[",on="]",E3="m",j2,sE=(D)=>`${U0.values().next().value}${t3}${D}${E3}`,gE=(D)=>`${U0.values().next().value}${j2}${D}${V2}`,xn=(D)=>D.split(" ").map((u)=>Zu(u)),J2=(D,u,F)=>{let E=[...u],C=!1,c=!1,t=Zu(D3(D[D.length-1]));for(let[n,i]of E.entries()){let f=Zu(i);if(t+f<=F?D[D.length-1]+=i:(D.push(i),t=0),U0.has(i)&&(C=!0,c=E.slice(n+1).join("").startsWith(j2)),C){c?i===V2&&(C=!1,c=!1):i===E3&&(C=!1);continue}t+=f,t===F&&n<E.length-1&&(D.push(""),t=0)}!t&&D[D.length-1].length>0&&D.length>1&&(D[D.length-2]+=D.pop())},an=(D)=>{let u=D.split(" "),F=u.length;for(;F>0&&!(Zu(u[F-1])>0);)F--;return F===u.length?D:u.slice(0,F).join(" ")+u.slice(F).join("")},pn=(D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let E="",C,c,t=xn(D),n=[""];for(let[f,B]of D.split(" ").entries()){F.trim!==!1&&(n[n.length-1]=n[n.length-1].trimStart());let A=Zu(n[n.length-1]);if(f!==0&&(A>=u&&(F.wordWrap===!1||F.trim===!1)&&(n.push(""),A=0),(A>0||F.trim===!1)&&(n[n.length-1]+=" ",A++)),F.hard&&t[f]>u){let h=u-A,w=1+Math.floor((t[f]-h-1)/u);Math.floor((t[f]-1)/u)<w&&n.push(""),J2(n,B,u);continue}if(A+t[f]>u&&A>0&&t[f]>0){if(F.wordWrap===!1&&A<u){J2(n,B,u);continue}n.push("")}if(A+t[f]>u&&F.wordWrap===!1){J2(n,B,u);continue}n[n.length-1]+=B}F.trim!==!1&&(n=n.map((f)=>an(f)));let i=[...n.join(`
|
|
14
|
+
`)];for(let[f,B]of i.entries()){if(E+=B,U0.has(B)){let{groups:h}=new RegExp(`(?:\\${t3}(?<code>\\d+)m|\\${j2}(?<uri>.*)${V2})`).exec(i.slice(f).join(""))||{groups:{}};if(h.code!==void 0){let w=Number.parseFloat(h.code);C=w===en?void 0:w}else h.uri!==void 0&&(c=h.uri.length===0?void 0:h.uri)}let A=gn.codes.get(Number(C));i[f+1]===`
|
|
15
|
+
`?(c&&(E+=gE("")),C&&A&&(E+=sE(A))):B===`
|
|
16
|
+
`&&(C&&A&&(E+=sE(C)),c&&(E+=gE(c)))}return E},Di,N0,oE,Fi,ti=(D,u,F)=>(u in D)?Fi(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,uD=(D,u,F)=>(ti(D,typeof u!="symbol"?u+"":u,F),F),c3,Ei,Ci=(D,u,F)=>(u in D)?Ei(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,xE=(D,u,F)=>(Ci(D,typeof u!="symbol"?u+"":u,F),F),ci,ni,ii=(D,u,F)=>(u in D)?ni(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,aE=(D,u,F)=>(ii(D,typeof u!="symbol"?u+"":u,F),F),n3,i3,Bi,_D=(D,u)=>Bi?D:u,Ai,hi,_i,wi,L,Cu,K2,Q2,Ri,pE,$i,T0=(D)=>{switch(D){case"initial":case"active":return _.cyan(Ai);case"cancel":return _.red(hi);case"error":return _.yellow(_i);case"submit":return _.green(wi)}},P2=(D)=>{let{cursor:u,options:F,style:E}=D,C=D.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),t=Math.min(c,Math.max(C,5)),n=0;u>=n+t-3?n=Math.max(Math.min(u-t+3,F.length-t),0):u<n+2&&(n=Math.max(u-2,0));let i=t<F.length&&n>0,f=t<F.length&&n+t<F.length;return F.slice(n,n+t).map((B,A,h)=>{let w=A===0&&i,R=A===h.length-1&&f;return w||R?_.dim("..."):E(B,A+n===u)})},Si=(D)=>new i3({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,render(){let u=`${_.gray(L)}
|
|
17
|
+
${T0(this.state)} ${D.message}
|
|
18
|
+
`,F=D.placeholder?_.inverse(D.placeholder[0])+_.dim(D.placeholder.slice(1)):_.inverse(_.hidden("_")),E=this.value?this.valueWithCursor:F;switch(this.state){case"error":return`${u.trim()}
|
|
19
|
+
${_.yellow(L)} ${E}
|
|
20
|
+
${_.yellow(Cu)} ${_.yellow(this.error)}
|
|
21
|
+
`;case"submit":return`${u}${_.gray(L)} ${_.dim(this.value||D.placeholder)}`;case"cancel":return`${u}${_.gray(L)} ${_.strikethrough(_.dim(this.value??""))}${this.value?.trim()?`
|
|
22
|
+
${_.gray(L)}`:""}`;default:return`${u}${_.cyan(L)} ${E}
|
|
23
|
+
${_.cyan(Cu)}
|
|
24
|
+
`}}}).prompt(),Ii=(D)=>{let u=D.active??"Yes",F=D.inactive??"No";return new c3({active:u,inactive:F,initialValue:D.initialValue??!0,render(){let E=`${_.gray(L)}
|
|
25
|
+
${T0(this.state)} ${D.message}
|
|
26
|
+
`,C=this.value?u:F;switch(this.state){case"submit":return`${E}${_.gray(L)} ${_.dim(C)}`;case"cancel":return`${E}${_.gray(L)} ${_.strikethrough(_.dim(C))}
|
|
27
|
+
${_.gray(L)}`;default:return`${E}${_.cyan(L)} ${this.value?`${_.green(K2)} ${u}`:`${_.dim(Q2)} ${_.dim(u)}`} ${_.dim("/")} ${this.value?`${_.dim(Q2)} ${_.dim(F)}`:`${_.green(K2)} ${F}`}
|
|
28
|
+
${_.cyan(Cu)}
|
|
29
|
+
`}}}).prompt()},Ni=(D)=>{let u=(F,E)=>{let C=F.label??String(F.value);switch(E){case"selected":return`${_.dim(C)}`;case"active":return`${_.green(K2)} ${C} ${F.hint?_.dim(`(${F.hint})`):""}`;case"cancelled":return`${_.strikethrough(_.dim(C))}`;default:return`${_.dim(Q2)} ${_.dim(C)}`}};return new n3({options:D.options,initialValue:D.initialValue,render(){let F=`${_.gray(L)}
|
|
30
|
+
${T0(this.state)} ${D.message}
|
|
31
|
+
`;switch(this.state){case"submit":return`${F}${_.gray(L)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${F}${_.gray(L)} ${u(this.options[this.cursor],"cancelled")}
|
|
32
|
+
${_.gray(L)}`;default:return`${F}${_.cyan(L)} ${P2({cursor:this.cursor,options:this.options,maxItems:D.maxItems,style:(E,C)=>u(E,C?"active":"inactive")}).join(`
|
|
33
|
+
${_.cyan(L)} `)}
|
|
34
|
+
${_.cyan(Cu)}
|
|
35
|
+
`}}}).prompt()},Ui=(D)=>{let u=(F,E)=>{let C=F.label??String(F.value);return E==="active"?`${_.cyan(Ri)} ${C} ${F.hint?_.dim(`(${F.hint})`):""}`:E==="selected"?`${_.green(pE)} ${_.dim(C)}`:E==="cancelled"?`${_.strikethrough(_.dim(C))}`:E==="active-selected"?`${_.green(pE)} ${C} ${F.hint?_.dim(`(${F.hint})`):""}`:E==="submitted"?`${_.dim(C)}`:`${_.dim($i)} ${_.dim(C)}`};return new ci({options:D.options,initialValues:D.initialValues,required:D.required??!0,cursorAt:D.cursorAt,validate(F){if(this.required&&F.length===0)return`Please select at least one option.
|
|
36
|
+
${_.reset(_.dim(`Press ${_.gray(_.bgWhite(_.inverse(" space ")))} to select, ${_.gray(_.bgWhite(_.inverse(" enter ")))} to submit`))}`},render(){let F=`${_.gray(L)}
|
|
37
|
+
${T0(this.state)} ${D.message}
|
|
38
|
+
`,E=(C,c)=>{let t=this.value.includes(C.value);return c&&t?u(C,"active-selected"):t?u(C,"selected"):u(C,c?"active":"inactive")};switch(this.state){case"submit":return`${F}${_.gray(L)} ${this.options.filter(({value:C})=>this.value.includes(C)).map((C)=>u(C,"submitted")).join(_.dim(", "))||_.dim("none")}`;case"cancel":{let C=this.options.filter(({value:c})=>this.value.includes(c)).map((c)=>u(c,"cancelled")).join(_.dim(", "));return`${F}${_.gray(L)} ${C.trim()?`${C}
|
|
39
|
+
${_.gray(L)}`:""}`}case"error":{let C=this.error.split(`
|
|
40
|
+
`).map((c,t)=>t===0?`${_.yellow(Cu)} ${_.yellow(c)}`:` ${c}`).join(`
|
|
41
|
+
`);return`${F+_.yellow(L)} ${P2({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:E}).join(`
|
|
42
|
+
${_.yellow(L)} `)}
|
|
43
|
+
${C}
|
|
44
|
+
`}default:return`${F}${_.cyan(L)} ${P2({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:E}).join(`
|
|
45
|
+
${_.cyan(L)} `)}
|
|
46
|
+
${_.cyan(Cu)}
|
|
47
|
+
`}}}).prompt()},f3;var h3=o(()=>{hD=Jn(),S0={exports:{}};Qn=Kn(),_=Zn(Qn);Vn=Pn();F3={exports:{}};(function(D){var u={};D.exports=u,u.eastAsianWidth=function(E){var C=E.charCodeAt(0),c=E.length==2?E.charCodeAt(1):0,t=C;return 55296<=C&&C<=56319&&56320<=c&&c<=57343&&(C&=1023,c&=1023,t=C<<10|c,t+=65536),t==12288||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":t==8361||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||t==172||t==175||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":t==161||t==164||167<=t&&t<=168||t==170||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||t==198||t==208||215<=t&&t<=216||222<=t&&t<=225||t==230||232<=t&&t<=234||236<=t&&t<=237||t==240||242<=t&&t<=243||247<=t&&t<=250||t==252||t==254||t==257||t==273||t==275||t==283||294<=t&&t<=295||t==299||305<=t&&t<=307||t==312||319<=t&&t<=322||t==324||328<=t&&t<=331||t==333||338<=t&&t<=339||358<=t&&t<=359||t==363||t==462||t==464||t==466||t==468||t==470||t==472||t==474||t==476||t==593||t==609||t==708||t==711||713<=t&&t<=715||t==717||t==720||728<=t&&t<=731||t==733||t==735||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||t==1025||1040<=t&&t<=1103||t==1105||t==8208||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||t==8240||8242<=t&&t<=8243||t==8245||t==8251||t==8254||t==8308||t==8319||8321<=t&&t<=8324||t==8364||t==8451||t==8453||t==8457||t==8467||t==8470||8481<=t&&t<=8482||t==8486||t==8491||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||t==8585||8592<=t&&t<=8601||8632<=t&&t<=8633||t==8658||t==8660||t==8679||t==8704||8706<=t&&t<=8707||8711<=t&&t<=8712||t==8715||t==8719||t==8721||t==8725||t==8730||8733<=t&&t<=8736||t==8739||t==8741||8743<=t&&t<=8748||t==8750||8756<=t&&t<=8759||8764<=t&&t<=8765||t==8776||t==8780||t==8786||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||t==8853||t==8857||t==8869||t==8895||t==8978||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||t==9675||9678<=t&&t<=9681||9698<=t&&t<=9701||t==9711||9733<=t&&t<=9734||t==9737||9742<=t&&t<=9743||9748<=t&&t<=9749||t==9756||t==9758||t==9792||t==9794||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||t==9839||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||t==9955||9960<=t&&t<=9983||t==10045||t==10071||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||t==65533||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},u.characterLength=function(E){var C=this.eastAsianWidth(E);return C=="F"||C=="W"||C=="A"?2:1};function F(E){return E.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(E){for(var C=F(E),c=0,t=0;t<C.length;t++)c=c+this.characterLength(C[t]);return c},u.slice=function(E,C,c){textLen=u.length(E),C=C||0,c=c||1,C<0&&(C=textLen+C),c<0&&(c=textLen+c);for(var t="",n=0,i=F(E),f=0;f<i.length;f++){var B=i[f],A=u.length(B);if(n>=C-(A==2?1:0))if(n+A<=c)t+=B;else break;n+=A}return t}})(F3);jn=F3.exports,kn=u3(jn),vn=u3(yn);m={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(m.modifier);ln=Object.keys(m.color),dn=Object.keys(m.bgColor);[...ln,...dn];gn=sn(),U0=new Set(["\x1B","\x9B"]),j2=`${on}8;;`;Di=["up","down","left","right","space","enter","cancel"],N0={actions:new Set(Di),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");oE=Symbol("clack:cancel");Fi=Object.defineProperty;c3=class c3 extends Ju{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(u)=>{this.output.write(hD.cursor.move(0,-1)),this.value=u,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};Ei=Object.defineProperty,ci=class extends Ju{constructor(D){super(D,!1),xE(this,"options"),xE(this,"cursor",0),this.options=D.options,this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:u})=>u===D.cursorAt),0),this.on("key",(u)=>{u==="a"&&this.toggleAll()}),this.on("cursor",(u)=>{switch(u){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;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let D=this.value.length===this.options.length;this.value=D?[]:this.options.map((u)=>u.value)}toggleValue(){let D=this.value.includes(this._value);this.value=D?this.value.filter((u)=>u!==this._value):[...this.value,this._value]}},ni=Object.defineProperty;n3=class n3 extends Ju{constructor(D){super(D,!1),aE(this,"options"),aE(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:u})=>u===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(u)=>{switch(u){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}};i3=class i3 extends Ju{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let D=this.value.slice(0,this.cursor),[u,...F]=this.value.slice(this.cursor);return`${D}${_.inverse(u)}${F.join("")}`}get cursor(){return this._cursor}constructor(D){super(D),this.on("finalize",()=>{this.value||(this.value=D.defaultValue)})}};Bi=fi(),Ai=_D("\u276F",">"),hi=_D("\u25A0","x"),_i=_D("\u25B2","x"),wi=_D("\u2714","\u221A"),L=_D(""),Cu=_D(""),K2=_D("\u25CF",">"),Q2=_D("\u25CB"," "),Ri=_D("\u25FB","[\u2022]"),pE=_D("\u25FC","[+]"),$i=_D("\u25FB","[ ]");`${_.gray(L)} `;f3=Symbol.for("cancel")});var du=BD((Mf)=>{class OF extends Error{constructor(D,u,F){super(F);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=u,this.exitCode=D,this.nestedError=void 0}}class s1 extends OF{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Mf.CommanderError=OF;Mf.InvalidArgumentError=s1});var V0=BD((Qf)=>{var{InvalidArgumentError:Jf}=du();class g1{constructor(D,u){switch(this.description=u||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(D,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}default(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new Jf(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,F);return u},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Kf(D){let u=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+u+">":"["+u+"]"}Qf.Argument=g1;Qf.humanReadableArgName=Kf});var bF=BD((kf)=>{var{humanReadableArgName:jf}=V0();class e1{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let u=D.commands.filter((E)=>!E._hidden),F=D._getHelpCommand();if(F&&!F._hidden)u.push(F);if(this.sortSubcommands)u.sort((E,C)=>{return E.name().localeCompare(C.name())});return u}compareOptions(D,u){let F=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return F(D).localeCompare(F(u))}visibleOptions(D){let u=D.options.filter((E)=>!E.hidden),F=D._getHelpOption();if(F&&!F.hidden){let E=F.short&&D._findOption(F.short),C=F.long&&D._findOption(F.long);if(!E&&!C)u.push(F);else if(F.long&&!C)u.push(D.createOption(F.long,F.description));else if(F.short&&!E)u.push(D.createOption(F.short,F.description))}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let u=[];for(let F=D.parent;F;F=F.parent){let E=F.options.filter((C)=>!C.hidden);u.push(...E)}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((u)=>{u.description=u.description||D._argsDescription[u.name()]||""});if(D.registeredArguments.find((u)=>u.description))return D.registeredArguments;return[]}subcommandTerm(D){let u=D.registeredArguments.map((F)=>jf(F)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,u){return u.visibleCommands(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleSubcommandTerm(u.subcommandTerm(E))))},0)}longestOptionTermLength(D,u){return u.visibleOptions(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleOptionTerm(u.optionTerm(E))))},0)}longestGlobalOptionTermLength(D,u){return u.visibleGlobalOptions(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleOptionTerm(u.optionTerm(E))))},0)}longestArgumentTermLength(D,u){return u.visibleArguments(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleArgumentTerm(u.argumentTerm(E))))},0)}commandUsage(D){let u=D._name;if(D._aliases[0])u=u+"|"+D._aliases[0];let F="";for(let E=D.parent;E;E=E.parent)F=E.name()+" "+F;return F+u+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)u.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)u.push(`env: ${D.envVar}`);if(u.length>0)return`${D.description} (${u.join(", ")})`;return D.description}argumentDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0)u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(u.length>0){let F=`(${u.join(", ")})`;if(D.description)return`${D.description} ${F}`;return F}return D.description}formatHelp(D,u){let F=u.padWidth(D,u),E=u.helpWidth??80;function C(B,A){return u.formatItem(B,F,A,u)}let c=[`${u.styleTitle("Usage:")} ${u.styleUsage(u.commandUsage(D))}`,""],t=u.commandDescription(D);if(t.length>0)c=c.concat([u.boxWrap(u.styleCommandDescription(t),E),""]);let n=u.visibleArguments(D).map((B)=>{return C(u.styleArgumentTerm(u.argumentTerm(B)),u.styleArgumentDescription(u.argumentDescription(B)))});if(n.length>0)c=c.concat([u.styleTitle("Arguments:"),...n,""]);let i=u.visibleOptions(D).map((B)=>{return C(u.styleOptionTerm(u.optionTerm(B)),u.styleOptionDescription(u.optionDescription(B)))});if(i.length>0)c=c.concat([u.styleTitle("Options:"),...i,""]);if(u.showGlobalOptions){let B=u.visibleGlobalOptions(D).map((A)=>{return C(u.styleOptionTerm(u.optionTerm(A)),u.styleOptionDescription(u.optionDescription(A)))});if(B.length>0)c=c.concat([u.styleTitle("Global Options:"),...B,""])}let f=u.visibleCommands(D).map((B)=>{return C(u.styleSubcommandTerm(u.subcommandTerm(B)),u.styleSubcommandDescription(u.subcommandDescription(B)))});if(f.length>0)c=c.concat([u.styleTitle("Commands:"),...f,""]);return c.join(`
|
|
48
|
+
`)}displayWidth(D){return o1(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((u)=>{if(u==="[options]")return this.styleOptionText(u);if(u==="[command]")return this.styleSubcommandText(u);if(u[0]==="["||u[0]==="<")return this.styleArgumentText(u);return this.styleCommandText(u)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((u)=>{if(u==="[options]")return this.styleOptionText(u);if(u[0]==="["||u[0]==="<")return this.styleArgumentText(u);return this.styleSubcommandText(u)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,u){return Math.max(u.longestOptionTermLength(D,u),u.longestGlobalOptionTermLength(D,u),u.longestSubcommandTermLength(D,u),u.longestArgumentTermLength(D,u))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,u,F,E){let c=" ".repeat(2);if(!F)return c+D;let t=D.padEnd(u+D.length-E.displayWidth(D)),n=2,f=(this.helpWidth??80)-u-n-2,B;if(f<this.minWidthToWrap||E.preformatted(F))B=F;else B=E.boxWrap(F,f).replace(/\n/g,`
|
|
49
|
+
`+" ".repeat(u+n));return c+t+" ".repeat(n)+B.replace(/\n/g,`
|
|
50
|
+
${c}`)}boxWrap(D,u){if(u<this.minWidthToWrap)return D;let F=D.split(/\r\n|\n/),E=/[\s]*[^\s]+/g,C=[];return F.forEach((c)=>{let t=c.match(E);if(t===null){C.push("");return}let n=[t.shift()],i=this.displayWidth(n[0]);t.forEach((f)=>{let B=this.displayWidth(f);if(i+B<=u){n.push(f),i+=B;return}C.push(n.join(""));let A=f.trimStart();n=[A],i=this.displayWidth(A)}),C.push(n.join(""))}),C.join(`
|
|
51
|
+
`)}}function o1(D){let u=/\x1b\[\d*(;\d*)*m/g;return D.replace(u,"")}kf.Help=e1;kf.stripColor=o1});var LF=BD((sf)=>{var{InvalidArgumentError:lf}=du();class a1{constructor(D,u){this.flags=D,this.description=u||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let F=df(D);if(this.short=F.shortFlag,this.long=F.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let u=D;if(typeof D==="string")u={[D]:!0};return this.implied=Object.assign(this.implied||{},u),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_concatValue(D,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new lf(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,F);return u},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return x1(this.name().replace(/^no-/,""));return x1(this.name())}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class p1{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((u)=>{if(u.negate)this.negativeOptions.set(u.attributeName(),u);else this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,F)=>{if(this.positiveOptions.has(F))this.dualOptions.add(F)})}valueFromOption(D,u){let F=u.attributeName();if(!this.dualOptions.has(F))return!0;let E=this.negativeOptions.get(F).presetArg,C=E!==void 0?E:!1;return u.negate===(C===D)}}function x1(D){return D.split("-").reduce((u,F)=>{return u+F[0].toUpperCase()+F.slice(1)})}function df(D){let u,F,E=/^-[^-]$/,C=/^--[^-]/,c=D.split(/[ |,]+/).concat("guard");if(E.test(c[0]))u=c.shift();if(C.test(c[0]))F=c.shift();if(!u&&E.test(c[0]))u=c.shift();if(!u&&C.test(c[0]))u=F,F=c.shift();if(c[0].startsWith("-")){let t=c[0],n=`option creation failed due to '${t}' in option flags '${D}'`;if(/^-[^-][^-]/.test(t))throw Error(`${n}
|
|
52
|
+
- a short flag is a single dash and a single character
|
|
53
|
+
- either use a single dash and a single character (for a short flag)
|
|
54
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(E.test(t))throw Error(`${n}
|
|
55
|
+
- too many short flags`);if(C.test(t))throw Error(`${n}
|
|
56
|
+
- too many long flags`);throw Error(`${n}
|
|
57
|
+
- unrecognised flag format`)}if(u===void 0&&F===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:u,longFlag:F}}sf.Option=a1;sf.DualOptions=p1});var DC=BD((af)=>{function of(D,u){if(Math.abs(D.length-u.length)>3)return Math.max(D.length,u.length);let F=[];for(let E=0;E<=D.length;E++)F[E]=[E];for(let E=0;E<=u.length;E++)F[0][E]=E;for(let E=1;E<=u.length;E++)for(let C=1;C<=D.length;C++){let c=1;if(D[C-1]===u[E-1])c=0;else c=1;if(F[C][E]=Math.min(F[C-1][E]+1,F[C][E-1]+1,F[C-1][E-1]+c),C>1&&E>1&&D[C-1]===u[E-2]&&D[C-2]===u[E-1])F[C][E]=Math.min(F[C][E],F[C-2][E-2]+1)}return F[D.length][u.length]}function xf(D,u){if(!u||u.length===0)return"";u=Array.from(new Set(u));let F=D.startsWith("--");if(F)D=D.slice(2),u=u.map((t)=>t.slice(2));let E=[],C=3,c=0.4;if(u.forEach((t)=>{if(t.length<=1)return;let n=of(D,t),i=Math.max(D.length,t.length);if((i-n)/i>c){if(n<C)C=n,E=[t];else if(n===C)E.push(t)}}),E.sort((t,n)=>t.localeCompare(n)),F)E=E.map((t)=>`--${t}`);if(E.length>1)return`
|
|
58
|
+
(Did you mean one of ${E.join(", ")}?)`;if(E.length===1)return`
|
|
59
|
+
(Did you mean ${E[0]}?)`;return""}af.suggestSimilar=xf});var EC=BD((cB)=>{var DB=TD("events").EventEmitter,mF=TD("child_process"),GD=TD("path"),j0=TD("fs"),r=TD("process"),{Argument:uB,humanReadableArgName:FB}=V0(),{CommanderError:YF}=du(),{Help:tB,stripColor:EB}=bF(),{Option:uC,DualOptions:CB}=LF(),{suggestSimilar:FC}=DC();class WF extends DB{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=D||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(u)=>r.stdout.write(u),writeErr:(u)=>r.stderr.write(u),outputError:(u,F)=>F(u),getOutHelpWidth:()=>r.stdout.isTTY?r.stdout.columns:void 0,getErrHelpWidth:()=>r.stderr.isTTY?r.stderr.columns:void 0,getOutHasColors:()=>HF()??(r.stdout.isTTY&&r.stdout.hasColors?.()),getErrHasColors:()=>HF()??(r.stderr.isTTY&&r.stderr.hasColors?.()),stripColor:(u)=>EB(u)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let u=this;u;u=u.parent)D.push(u);return D}command(D,u,F){let E=u,C=F;if(typeof E==="object"&&E!==null)C=E,E=null;C=C||{};let[,c,t]=D.match(/([^ ]+) *(.*)/),n=this.createCommand(c);if(E)n.description(E),n._executableHandler=!0;if(C.isDefault)this._defaultCommandName=n._name;if(n._hidden=!!(C.noHelp||C.hidden),n._executableFile=C.executableFile||null,t)n.arguments(t);if(this._registerCommand(n),n.parent=this,n.copyInheritedSettings(this),E)return this;return n}createCommand(D){return new WF(D)}createHelp(){return Object.assign(new tB,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,D),this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,u){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
|
|
60
|
+
- specify the name in Command constructor or using .name()`);if(u=u||{},u.isDefault)this._defaultCommandName=D._name;if(u.noHelp||u.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,u){return new uB(D,u)}argument(D,u,F,E){let C=this.createArgument(D,u);if(typeof F==="function")C.default(E).argParser(F);else C.default(F);return this.addArgument(C),this}arguments(D){return D.trim().split(/ +/).forEach((u)=>{this.argument(u)}),this}addArgument(D){let u=this.registeredArguments.slice(-1)[0];if(u&&u.variadic)throw Error(`only the last argument can be variadic '${u.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,u){if(typeof D==="boolean")return this._addImplicitHelpCommand=D,this;D=D??"help [command]";let[,F,E]=D.match(/([^ ]+) *(.*)/),C=u??"display help for command",c=this.createCommand(F);if(c.helpOption(!1),E)c.arguments(E);if(C)c.description(C);return this._addImplicitHelpCommand=!0,this._helpCommand=c,this}addHelpCommand(D,u){if(typeof D!=="object")return this.helpCommand(D,u),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,u){let F=["preSubcommand","preAction","postAction"];if(!F.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
|
|
61
|
+
Expecting one of '${F.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(u);else this._lifeCycleHooks[D]=[u];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(u)=>{if(u.code!=="commander.executeSubCommandAsync")throw u};return this}_exit(D,u,F){if(this._exitCallback)this._exitCallback(new YF(D,u,F));r.exit(D)}action(D){let u=(F)=>{let E=this.registeredArguments.length,C=F.slice(0,E);if(this._storeOptionsAsProperties)C[E]=this;else C[E]=this.opts();return C.push(this),D.apply(this,C)};return this._actionHandler=u,this}createOption(D,u){return new uC(D,u)}_callParseArg(D,u,F,E){try{return D.parseArg(u,F)}catch(C){if(C.code==="commander.invalidArgument"){let c=`${E} ${C.message}`;this.error(c,{exitCode:C.exitCode,code:C.code})}throw C}}_registerOption(D){let u=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(u){let F=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${F}'
|
|
62
|
+
- already used by option '${u.flags}'`)}this.options.push(D)}_registerCommand(D){let u=(E)=>{return[E.name()].concat(E.aliases())},F=u(D).find((E)=>this._findCommand(E));if(F){let E=u(this._findCommand(F)).join("|"),C=u(D).join("|");throw Error(`cannot add command '${C}' as already have command '${E}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let u=D.name(),F=D.attributeName();if(D.negate){let C=D.long.replace(/^--no-/,"--");if(!this._findOption(C))this.setOptionValueWithSource(F,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(F,D.defaultValue,"default");let E=(C,c,t)=>{if(C==null&&D.presetArg!==void 0)C=D.presetArg;let n=this.getOptionValue(F);if(C!==null&&D.parseArg)C=this._callParseArg(D,C,n,c);else if(C!==null&&D.variadic)C=D._concatValue(C,n);if(C==null)if(D.negate)C=!1;else if(D.isBoolean()||D.optional)C=!0;else C="";this.setOptionValueWithSource(F,C,t)};if(this.on("option:"+u,(C)=>{let c=`error: option '${D.flags}' argument '${C}' is invalid.`;E(C,c,"cli")}),D.envVar)this.on("optionEnv:"+u,(C)=>{let c=`error: option '${D.flags}' value '${C}' from env '${D.envVar}' is invalid.`;E(C,c,"env")});return this}_optionEx(D,u,F,E,C){if(typeof u==="object"&&u instanceof uC)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(u,F);if(c.makeOptionMandatory(!!D.mandatory),typeof E==="function")c.default(C).argParser(E);else if(E instanceof RegExp){let t=E;E=(n,i)=>{let f=t.exec(n);return f?f[0]:i},c.default(C).argParser(E)}else c.default(E);return this.addOption(c)}option(D,u,F,E){return this._optionEx({},D,u,F,E)}requiredOption(D,u,F,E){return this._optionEx({mandatory:!0},D,u,F,E)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,u){return this.setOptionValueWithSource(D,u,void 0)}setOptionValueWithSource(D,u,F){if(this._storeOptionsAsProperties)this[D]=u;else this._optionValues[D]=u;return this._optionValueSources[D]=F,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let u;return this._getCommandAndAncestors().forEach((F)=>{if(F.getOptionValueSource(D)!==void 0)u=F.getOptionValueSource(D)}),u}_prepareUserArgs(D,u){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(u=u||{},D===void 0&&u.from===void 0){if(r.versions?.electron)u.from="electron";let E=r.execArgv??[];if(E.includes("-e")||E.includes("--eval")||E.includes("-p")||E.includes("--print"))u.from="eval"}if(D===void 0)D=r.argv;this.rawArgs=D.slice();let F;switch(u.from){case void 0:case"node":this._scriptPath=D[1],F=D.slice(2);break;case"electron":if(r.defaultApp)this._scriptPath=D[1],F=D.slice(2);else F=D.slice(1);break;case"user":F=D.slice(0);break;case"eval":F=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${u.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",F}parse(D,u){this._prepareForParse();let F=this._prepareUserArgs(D,u);return this._parseCommand([],F),this}async parseAsync(D,u){this._prepareForParse();let F=this._prepareUserArgs(D,u);return await this._parseCommand([],F),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
63
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(D,u,F){if(j0.existsSync(D))return;let E=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",C=`'${D}' does not exist
|
|
64
|
+
- if '${F}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
65
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
66
|
+
- ${E}`;throw Error(C)}_executeSubCommand(D,u){u=u.slice();let F=!1,E=[".js",".ts",".tsx",".mjs",".cjs"];function C(f,B){let A=GD.resolve(f,B);if(j0.existsSync(A))return A;if(E.includes(GD.extname(B)))return;let h=E.find((w)=>j0.existsSync(`${A}${w}`));if(h)return`${A}${h}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=D._executableFile||`${this._name}-${D._name}`,t=this._executableDir||"";if(this._scriptPath){let f;try{f=j0.realpathSync(this._scriptPath)}catch{f=this._scriptPath}t=GD.resolve(GD.dirname(f),t)}if(t){let f=C(t,c);if(!f&&!D._executableFile&&this._scriptPath){let B=GD.basename(this._scriptPath,GD.extname(this._scriptPath));if(B!==this._name)f=C(t,`${B}-${D._name}`)}c=f||c}F=E.includes(GD.extname(c));let n;if(r.platform!=="win32")if(F)u.unshift(c),u=tC(r.execArgv).concat(u),n=mF.spawn(r.argv[0],u,{stdio:"inherit"});else n=mF.spawn(c,u,{stdio:"inherit"});else this._checkForMissingExecutable(c,t,D._name),u.unshift(c),u=tC(r.execArgv).concat(u),n=mF.spawn(r.execPath,u,{stdio:"inherit"});if(!n.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((B)=>{r.on(B,()=>{if(n.killed===!1&&n.exitCode===null)n.kill(B)})});let i=this._exitCallback;n.on("close",(f)=>{if(f=f??1,!i)r.exit(f);else i(new YF(f,"commander.executeSubCommandAsync","(close)"))}),n.on("error",(f)=>{if(f.code==="ENOENT")this._checkForMissingExecutable(c,t,D._name);else if(f.code==="EACCES")throw Error(`'${c}' not executable`);if(!i)r.exit(1);else{let B=new YF(1,"commander.executeSubCommandAsync","(error)");B.nestedError=f,i(B)}}),this.runningCommand=n}_dispatchSubcommand(D,u,F){let E=this._findCommand(D);if(!E)this.help({error:!0});E._prepareForParse();let C;return C=this._chainOrCallSubCommandHook(C,E,"preSubcommand"),C=this._chainOrCall(C,()=>{if(E._executableHandler)this._executeSubCommand(E,u.concat(F));else return E._parseCommand(u,F)}),C}_dispatchHelpCommand(D){if(!D)this.help();let u=this._findCommand(D);if(u&&!u._executableHandler)u.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,u)=>{if(D.required&&this.args[u]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(F,E,C)=>{let c=E;if(E!==null&&F.parseArg){let t=`error: command-argument value '${E}' is invalid for argument '${F.name()}'.`;c=this._callParseArg(F,E,C,t)}return c};this._checkNumberOfArguments();let u=[];this.registeredArguments.forEach((F,E)=>{let C=F.defaultValue;if(F.variadic){if(E<this.args.length){if(C=this.args.slice(E),F.parseArg)C=C.reduce((c,t)=>{return D(F,t,c)},F.defaultValue)}else if(C===void 0)C=[]}else if(E<this.args.length){if(C=this.args[E],F.parseArg)C=D(F,C,F.defaultValue)}u[E]=C}),this.processedArgs=u}_chainOrCall(D,u){if(D&&D.then&&typeof D.then==="function")return D.then(()=>u());return u()}_chainOrCallHooks(D,u){let F=D,E=[];if(this._getCommandAndAncestors().reverse().filter((C)=>C._lifeCycleHooks[u]!==void 0).forEach((C)=>{C._lifeCycleHooks[u].forEach((c)=>{E.push({hookedCommand:C,callback:c})})}),u==="postAction")E.reverse();return E.forEach((C)=>{F=this._chainOrCall(F,()=>{return C.callback(C.hookedCommand,this)})}),F}_chainOrCallSubCommandHook(D,u,F){let E=D;if(this._lifeCycleHooks[F]!==void 0)this._lifeCycleHooks[F].forEach((C)=>{E=this._chainOrCall(E,()=>{return C(this,u)})});return E}_parseCommand(D,u){let F=this.parseOptions(u);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(F.operands),u=F.unknown,this.args=D.concat(u),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),u);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(u),this._dispatchSubcommand(this._defaultCommandName,D,u);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(F.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=()=>{if(F.unknown.length>0)this.unknownOption(F.unknown[0])},C=`command:${this.name()}`;if(this._actionHandler){E(),this._processArguments();let c;if(c=this._chainOrCallHooks(c,"preAction"),c=this._chainOrCall(c,()=>this._actionHandler(this.processedArgs)),this.parent)c=this._chainOrCall(c,()=>{this.parent.emit(C,D,u)});return c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent&&this.parent.listenerCount(C))E(),this._processArguments(),this.parent.emit(C,D,u);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,u);if(this.listenerCount("command:*"))this.emit("command:*",D,u);else if(this.commands.length)this.unknownCommand();else E(),this._processArguments()}else if(this.commands.length)E(),this.help({error:!0});else E(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((u)=>u._name===D||u._aliases.includes(D))}_findOption(D){return this.options.find((u)=>u.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((u)=>{if(u.mandatory&&D.getOptionValue(u.attributeName())===void 0)D.missingMandatoryOptionValue(u)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((F)=>{let E=F.attributeName();if(this.getOptionValue(E)===void 0)return!1;return this.getOptionValueSource(E)!=="default"});D.filter((F)=>F.conflictsWith.length>0).forEach((F)=>{let E=D.find((C)=>F.conflictsWith.includes(C.attributeName()));if(E)this._conflictingOption(F,E)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let u=[],F=[],E=u,C=D.slice();function c(n){return n.length>1&&n[0]==="-"}let t=null;while(C.length){let n=C.shift();if(n==="--"){if(E===F)E.push(n);E.push(...C);break}if(t&&!c(n)){this.emit(`option:${t.name()}`,n);continue}if(t=null,c(n)){let i=this._findOption(n);if(i){if(i.required){let f=C.shift();if(f===void 0)this.optionMissingArgument(i);this.emit(`option:${i.name()}`,f)}else if(i.optional){let f=null;if(C.length>0&&!c(C[0]))f=C.shift();this.emit(`option:${i.name()}`,f)}else this.emit(`option:${i.name()}`);t=i.variadic?i:null;continue}}if(n.length>2&&n[0]==="-"&&n[1]!=="-"){let i=this._findOption(`-${n[1]}`);if(i){if(i.required||i.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${i.name()}`,n.slice(2));else this.emit(`option:${i.name()}`),C.unshift(`-${n.slice(2)}`);continue}}if(/^--[^=]+=/.test(n)){let i=n.indexOf("="),f=this._findOption(n.slice(0,i));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,n.slice(i+1));continue}}if(c(n))E=F;if((this._enablePositionalOptions||this._passThroughOptions)&&u.length===0&&F.length===0){if(this._findCommand(n)){if(u.push(n),C.length>0)F.push(...C);break}else if(this._getHelpCommand()&&n===this._getHelpCommand().name()){if(u.push(n),C.length>0)u.push(...C);break}else if(this._defaultCommandName){if(F.push(n),C.length>0)F.push(...C);break}}if(this._passThroughOptions){if(E.push(n),C.length>0)E.push(...C);break}E.push(n)}return{operands:u,unknown:F}}opts(){if(this._storeOptionsAsProperties){let D={},u=this.options.length;for(let F=0;F<u;F++){let E=this.options[F].attributeName();D[E]=E===this._versionOptionName?this._version:this[E]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,u)=>Object.assign(D,u.opts()),{})}error(D,u){if(this._outputConfiguration.outputError(`${D}
|
|
67
|
+
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
68
|
+
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
69
|
+
`),this.outputHelp({error:!0});let F=u||{},E=F.exitCode||1,C=F.code||"commander.error";this._exit(E,C,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in r.env){let u=D.attributeName();if(this.getOptionValue(u)===void 0||["default","config","env"].includes(this.getOptionValueSource(u)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,r.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new CB(this.options),u=(F)=>{return this.getOptionValue(F)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(F))};this.options.filter((F)=>F.implied!==void 0&&u(F.attributeName())&&D.valueFromOption(this.getOptionValue(F.attributeName()),F)).forEach((F)=>{Object.keys(F.implied).filter((E)=>!u(E)).forEach((E)=>{this.setOptionValueWithSource(E,F.implied[E],"implied")})})}missingArgument(D){let u=`error: missing required argument '${D}'`;this.error(u,{code:"commander.missingArgument"})}optionMissingArgument(D){let u=`error: option '${D.flags}' argument missing`;this.error(u,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let u=`error: required option '${D.flags}' not specified`;this.error(u,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,u){let F=(c)=>{let t=c.attributeName(),n=this.getOptionValue(t),i=this.options.find((B)=>B.negate&&t===B.attributeName()),f=this.options.find((B)=>!B.negate&&t===B.attributeName());if(i&&(i.presetArg===void 0&&n===!1||i.presetArg!==void 0&&n===i.presetArg))return i;return f||c},E=(c)=>{let t=F(c),n=t.attributeName();if(this.getOptionValueSource(n)==="env")return`environment variable '${t.envVar}'`;return`option '${t.flags}'`},C=`error: ${E(D)} cannot be used with ${E(u)}`;this.error(C,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let u="";if(D.startsWith("--")&&this._showSuggestionAfterError){let E=[],C=this;do{let c=C.createHelp().visibleOptions(C).filter((t)=>t.long).map((t)=>t.long);E=E.concat(c),C=C.parent}while(C&&!C._enablePositionalOptions);u=FC(D,E)}let F=`error: unknown option '${D}'${u}`;this.error(F,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let u=this.registeredArguments.length,F=u===1?"":"s",C=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${u} argument${F} but got ${D.length}.`;this.error(C,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],u="";if(this._showSuggestionAfterError){let E=[];this.createHelp().visibleCommands(this).forEach((C)=>{if(E.push(C.name()),C.alias())E.push(C.alias())}),u=FC(D,E)}let F=`error: unknown command '${D}'${u}`;this.error(F,{code:"commander.unknownCommand"})}version(D,u,F){if(D===void 0)return this._version;this._version=D,u=u||"-V, --version",F=F||"output the version number";let E=this.createOption(u,F);return this._versionOptionName=E.attributeName(),this._registerOption(E),this.on("option:"+E.name(),()=>{this._outputConfiguration.writeOut(`${D}
|
|
70
|
+
`),this._exit(0,"commander.version",D)}),this}description(D,u){if(D===void 0&&u===void 0)return this._description;if(this._description=D,u)this._argsDescription=u;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let u=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)u=this.commands[this.commands.length-1];if(D===u._name)throw Error("Command alias can't be the same as its name");let F=this.parent?._findCommand(D);if(F){let E=[F.name()].concat(F.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}return u._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((u)=>this.alias(u)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let u=this.registeredArguments.map((F)=>{return FB(F)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?u:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}nameFromFilename(D){return this._name=GD.basename(D,GD.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let u=this.createHelp(),F=this._getOutputContext(D);u.prepareContext({error:F.error,helpWidth:F.helpWidth,outputHasColors:F.hasColors});let E=u.formatHelp(this,u);if(F.hasColors)return E;return this._outputConfiguration.stripColor(E)}_getOutputContext(D){D=D||{};let u=!!D.error,F,E,C;if(u)F=(t)=>this._outputConfiguration.writeErr(t),E=this._outputConfiguration.getErrHasColors(),C=this._outputConfiguration.getErrHelpWidth();else F=(t)=>this._outputConfiguration.writeOut(t),E=this._outputConfiguration.getOutHasColors(),C=this._outputConfiguration.getOutHelpWidth();return{error:u,write:(t)=>{if(!E)t=this._outputConfiguration.stripColor(t);return F(t)},hasColors:E,helpWidth:C}}outputHelp(D){let u;if(typeof D==="function")u=D,D=void 0;let F=this._getOutputContext(D),E={error:F.error,write:F.write,command:this};this._getCommandAndAncestors().reverse().forEach((c)=>c.emit("beforeAllHelp",E)),this.emit("beforeHelp",E);let C=this.helpInformation({error:F.error});if(u){if(C=u(C),typeof C!=="string"&&!Buffer.isBuffer(C))throw Error("outputHelp callback must return a string or a Buffer")}if(F.write(C),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",E),this._getCommandAndAncestors().forEach((c)=>c.emit("afterAllHelp",E))}helpOption(D,u){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",u=u??"display help for command",this._helpOption=this.createOption(D,u),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this}help(D){this.outputHelp(D);let u=Number(r.exitCode??0);if(u===0&&D&&typeof D!=="function"&&D.error)u=1;this._exit(u,"commander.help","(outputHelp)")}addHelpText(D,u){let F=["beforeAll","before","after","afterAll"];if(!F.includes(D))throw Error(`Unexpected value for position to addHelpText.
|
|
71
|
+
Expecting one of '${F.join("', '")}'`);let E=`${D}Help`;return this.on(E,(C)=>{let c;if(typeof u==="function")c=u({error:C.error,command:C.command});else c=u;if(c)C.write(`${c}
|
|
72
|
+
`)}),this}_outputHelpIfRequested(D){let u=this._getHelpOption();if(u&&D.find((E)=>u.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function tC(D){return D.map((u)=>{if(!u.startsWith("--inspect"))return u;let F,E="127.0.0.1",C="9229",c;if((c=u.match(/^(--inspect(-brk)?)$/))!==null)F=c[1];else if((c=u.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(F=c[1],/^\d+$/.test(c[3]))C=c[3];else E=c[3];else if((c=u.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)F=c[1],E=c[3],C=c[4];if(F&&C!=="0")return`${F}=${E}:${parseInt(C)+1}`;return u})}function HF(){if(r.env.NO_COLOR||r.env.FORCE_COLOR==="0"||r.env.FORCE_COLOR==="false")return!1;if(r.env.FORCE_COLOR||r.env.CLICOLOR_FORCE!==void 0)return!0;return}cB.Command=WF;cB.useColor=HF});var iC=BD((AB)=>{var{Argument:CC}=V0(),{Command:XF}=EC(),{CommanderError:fB,InvalidArgumentError:cC}=du(),{Help:BB}=bF(),{Option:nC}=LF();AB.program=new XF;AB.createCommand=(D)=>new XF(D);AB.createOption=(D,u)=>new nC(D,u);AB.createArgument=(D,u)=>new CC(D,u);AB.Command=XF;AB.Option=nC;AB.Argument=CC;AB.Help=BB;AB.CommanderError=fB;AB.InvalidArgumentError=cC;AB.InvalidOptionArgumentError=cC});var mD=BD((kw,zF)=>{var y0=process||{},hC=y0.argv||[],k0=y0.env||{},OB=!(!!k0.NO_COLOR||hC.includes("--no-color"))&&(!!k0.FORCE_COLOR||hC.includes("--color")||y0.platform==="win32"||(y0.stdout||{}).isTTY&&k0.TERM!=="dumb"||!!k0.CI),bB=(D,u,F=D)=>(E)=>{let C=""+E,c=C.indexOf(u,D.length);return~c?D+LB(C,u,F,c)+u:D+C+u},LB=(D,u,F,E)=>{let C="",c=0;do C+=D.substring(c,E)+F,c=E+u.length,E=D.indexOf(u,c);while(~E);return C+D.substring(c)},_C=(D=OB)=>{let u=D?bB:()=>String;return{isColorSupported:D,reset:u("\x1B[0m","\x1B[0m"),bold:u("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:u("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:u("\x1B[3m","\x1B[23m"),underline:u("\x1B[4m","\x1B[24m"),inverse:u("\x1B[7m","\x1B[27m"),hidden:u("\x1B[8m","\x1B[28m"),strikethrough:u("\x1B[9m","\x1B[29m"),black:u("\x1B[30m","\x1B[39m"),red:u("\x1B[31m","\x1B[39m"),green:u("\x1B[32m","\x1B[39m"),yellow:u("\x1B[33m","\x1B[39m"),blue:u("\x1B[34m","\x1B[39m"),magenta:u("\x1B[35m","\x1B[39m"),cyan:u("\x1B[36m","\x1B[39m"),white:u("\x1B[37m","\x1B[39m"),gray:u("\x1B[90m","\x1B[39m"),bgBlack:u("\x1B[40m","\x1B[49m"),bgRed:u("\x1B[41m","\x1B[49m"),bgGreen:u("\x1B[42m","\x1B[49m"),bgYellow:u("\x1B[43m","\x1B[49m"),bgBlue:u("\x1B[44m","\x1B[49m"),bgMagenta:u("\x1B[45m","\x1B[49m"),bgCyan:u("\x1B[46m","\x1B[49m"),bgWhite:u("\x1B[47m","\x1B[49m"),blackBright:u("\x1B[90m","\x1B[39m"),redBright:u("\x1B[91m","\x1B[39m"),greenBright:u("\x1B[92m","\x1B[39m"),yellowBright:u("\x1B[93m","\x1B[39m"),blueBright:u("\x1B[94m","\x1B[39m"),magentaBright:u("\x1B[95m","\x1B[39m"),cyanBright:u("\x1B[96m","\x1B[39m"),whiteBright:u("\x1B[97m","\x1B[39m"),bgBlackBright:u("\x1B[100m","\x1B[49m"),bgRedBright:u("\x1B[101m","\x1B[49m"),bgGreenBright:u("\x1B[102m","\x1B[49m"),bgYellowBright:u("\x1B[103m","\x1B[49m"),bgBlueBright:u("\x1B[104m","\x1B[49m"),bgMagentaBright:u("\x1B[105m","\x1B[49m"),bgCyanBright:u("\x1B[106m","\x1B[49m"),bgWhiteBright:u("\x1B[107m","\x1B[49m")}};zF.exports=_C();zF.exports.createColors=_C});var MF=BD((yw,wC)=>{var GF={to(D,u){if(!u)return`\x1B[${D+1}G`;return`\x1B[${u+1};${D+1}H`},move(D,u){let F="";if(D<0)F+=`\x1B[${-D}D`;else if(D>0)F+=`\x1B[${D}C`;if(u<0)F+=`\x1B[${-u}A`;else if(u>0)F+=`\x1B[${u}B`;return F},up:(D=1)=>`\x1B[${D}A`,down:(D=1)=>`\x1B[${D}B`,forward:(D=1)=>`\x1B[${D}C`,backward:(D=1)=>`\x1B[${D}D`,nextLine:(D=1)=>"\x1B[E".repeat(D),prevLine:(D=1)=>"\x1B[F".repeat(D),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},mB={up:(D=1)=>"\x1B[S".repeat(D),down:(D=1)=>"\x1B[T".repeat(D)},YB={screen:"\x1B[2J",up:(D=1)=>"\x1B[1J".repeat(D),down:(D=1)=>"\x1B[J".repeat(D),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(D){let u="";for(let F=0;F<D;F++)u+=this.line+(F<D-1?GF.up():"");if(D)u+=GF.left;return u}};wC.exports={cursor:GF,scroll:mB,erase:YB,beep:"\x07"}});import xC from"fs";function k9(){try{return xC.statSync("/.dockerenv"),!0}catch{return!1}}function y9(){try{return xC.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function St(){if($t===void 0)$t=k9()||y9();return $t}var $t;var aC=()=>{};import v9 from"fs";function Tu(){if(It===void 0)It=l9()||St();return It}var It,l9=()=>{try{return v9.statSync("/run/.containerenv"),!0}catch{return!1}};var Nt=o(()=>{aC()});import D8 from"process";import d9 from"os";import s9 from"fs";var pC=()=>{if(D8.platform!=="linux")return!1;if(d9.release().toLowerCase().includes("microsoft")){if(Tu())return!1;return!0}try{return s9.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Tu():!1}catch{return!1}},ZD;var Ut=o(()=>{Nt();ZD=D8.env.__IS_WSL_TEST__?pC:pC()});import u8 from"process";import{Buffer as g9}from"buffer";import{promisify as e9}from"util";import o9 from"child_process";var x9,Tt=()=>`${u8.env.SYSTEMROOT||u8.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,tD=async(D,u={})=>{let{powerShellPath:F,...E}=u,C=tD.encodeCommand(D);return x9(F??Tt(),[...tD.argumentsPrefix,C],{encoding:"utf8",...E})};var rt=o(()=>{x9=e9(o9.execFile);tD.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];tD.encodeCommand=(D)=>g9.from(D,"utf16le").toString("base64");tD.escapeArgument=(D)=>`'${String(D).replaceAll("'","''")}'`});function F8(D){for(let u of D.split(`
|
|
73
|
+
`)){if(/^\s*#/.test(u))continue;let F=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(u);if(!F)continue;return F.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}import{promisify as a9}from"util";import p9 from"child_process";import Ot,{constants as E8}from"fs/promises";var D7,u7,F7=async()=>{return`${await u7()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},E2,t8,C8=async()=>{return t8??=(async()=>{try{let D=await E2();return await Ot.access(D,E8.X_OK),!0}catch{return!1}})(),t8},c8=async()=>{let D=await E2(),u=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:F}=await tD(u,{powerShellPath:D});return F.trim()},n8=async(D)=>{if(/^[a-z]+:\/\//i.test(D))return D;try{let{stdout:u}=await D7("wslpath",["-aw",D],{encoding:"utf8"});return u.trim()}catch{return D}};var i8=o(()=>{Ut();rt();Ut();D7=a9(p9.execFile),u7=(()=>{let u;return async function(){if(u)return u;let F="/etc/wsl.conf",E=!1;try{await Ot.access(F,E8.F_OK),E=!0}catch{}if(!E)return"/mnt/";let C=await Ot.readFile(F,{encoding:"utf8"}),c=F8(C);if(c===void 0)return"/mnt/";return u=c,u=u.endsWith("/")?u:`${u}/`,u}})(),E2=ZD?F7:Tt});function uu(D,u,F){let E=(C)=>Object.defineProperty(D,u,{value:C,enumerable:!0,writable:!0});return Object.defineProperty(D,u,{configurable:!0,enumerable:!0,get(){let C=F();return E(C),C},set(C){E(C)}}),D}import{promisify as t7}from"util";import E7 from"process";import{execFile as C7}from"child_process";async function bt(){if(E7.platform!=="darwin")throw Error("macOS only");let{stdout:D}=await c7("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),F=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(D)?.groups.id??"com.apple.Safari";if(F==="com.apple.safari")return"com.apple.Safari";return F}var c7;var f8=o(()=>{c7=t7(C7)});import n7 from"process";import{promisify as i7}from"util";import{execFile as f7,execFileSync as x$}from"child_process";async function B8(D,{humanReadableOutput:u=!0,signal:F}={}){if(n7.platform!=="darwin")throw Error("macOS only");let E=u?[]:["-ss"],C={};if(F)C.signal=F;let{stdout:c}=await B7("osascript",["-e",D,E],C);return c.trim()}var B7;var A8=o(()=>{B7=i7(f7)});async function Lt(D){return B8(`tell application "Finder" to set app_path to application file id "${D}" as string
|
|
74
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var h8=o(()=>{A8()});import{promisify as A7}from"util";import{execFile as h7}from"child_process";async function Yt(D=_7){let{stdout:u}=await D("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),F=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(u);if(!F)throw new mt(`Cannot find Windows browser in stdout: ${JSON.stringify(u)}`);let{id:E}=F.groups,C=_8[E];if(!C)throw new mt(`Unknown browser ID: ${E}`);return C}var _7,_8,C2,mt;var Ht=o(()=>{_7=A7(h7),_8={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},C2=new Map(Object.entries(_8));mt=class mt extends Error{}});import{promisify as w7}from"util";import Wt from"process";import{execFile as R7}from"child_process";async function Xt(){if(Wt.platform==="darwin"){let D=await bt();return{name:await Lt(D),id:D}}if(Wt.platform==="linux"){let{stdout:D}=await $7("xdg-mime",["query","default","x-scheme-handler/http"]),u=D.trim();return{name:S7(u.replace(/.desktop$/,"").replace("-"," ")),id:u}}if(Wt.platform==="win32")return Yt();throw Error("Only macOS, Linux, and Windows are supported")}var $7,S7=(D)=>D.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(u)=>u.toUpperCase());var w8=o(()=>{f8();h8();Ht();Ht();$7=w7(R7)});import zt from"process";var I7,R8;var $8=o(()=>{I7=Boolean(zt.env.SSH_CONNECTION||zt.env.SSH_CLIENT||zt.env.SSH_TTY),R8=I7});var qt={};w0(qt,{openApp:()=>b7,default:()=>L7,apps:()=>Fu});import Gt from"process";import T8 from"path";import{fileURLToPath as N7}from"url";import U7 from"child_process";import T7,{constants as r7}from"fs/promises";function U8(D){if(typeof D==="string"||Array.isArray(D))return D;let{[I8]:u}=D;if(!u)throw Error(`${I8} is not supported`);return u}function F0({[ru]:D},{wsl:u}={}){if(u&&ZD)return U8(u);if(!D)throw Error(`${ru} is not supported`);return U8(D)}var c2,Mt,S8,ru,I8,N8=async(D,u)=>{if(D.length===0)return;let F=[];for(let E of D)try{return await u(E)}catch(C){F.push(C)}throw AggregateError(F,"Failed to open in all supported apps")},u0=async(D)=>{D={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...D};let u=D[c2]===!0;if(delete D[c2],Array.isArray(D.app))return N8(D.app,(f)=>u0({...D,app:f,[c2]:!0}));let{name:F,arguments:E=[]}=D.app??{};if(E=[...E],Array.isArray(F))return N8(F,(f)=>u0({...D,app:{name:f,arguments:E},[c2]:!0}));if(F==="browser"||F==="browserPrivate"){let f={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},B={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},A;if(ZD){let h=await c8();A=C2.get(h)??{}}else A=await Xt();if(A.id in f){let h=f[A.id.toLowerCase()];if(F==="browserPrivate"){if(h==="safari")throw Error("Safari doesn't support opening in private mode via command line");E.push(B[h])}return u0({...D,app:{name:Fu[h],arguments:E}})}throw Error(`${A.name} is not supported as a default browser`)}let C,c=[],t={},n=!1;if(ZD&&!Tu()&&!R8&&!F)n=await C8();if(ru==="darwin"){if(C="open",D.wait)c.push("--wait-apps");if(D.background)c.push("--background");if(D.newInstance)c.push("--new");if(F)c.push("-a",F)}else if(ru==="win32"||n){if(C=await E2(),c.push(...tD.argumentsPrefix),!ZD)t.windowsVerbatimArguments=!0;if(ZD&&D.target)D.target=await n8(D.target);let f=["$ProgressPreference = 'SilentlyContinue';","Start"];if(D.wait)f.push("-Wait");if(F){if(f.push(tD.escapeArgument(F)),D.target)E.push(D.target)}else if(D.target)f.push(tD.escapeArgument(D.target));if(E.length>0)E=E.map((B)=>tD.escapeArgument(B)),f.push("-ArgumentList",E.join(","));if(D.target=tD.encodeCommand(f.join(" ")),!D.wait)t.stdio="ignore"}else{if(F)C=F;else{let f=!Mt||Mt==="/",B=!1;try{await T7.access(S8,r7.X_OK),B=!0}catch{}C=Gt.versions.electron??(ru==="android"||f||!B)?"xdg-open":S8}if(E.length>0)c.push(...E);if(!D.wait)t.stdio="ignore",t.detached=!0}if(ru==="darwin"&&E.length>0)c.push("--args",...E);if(D.target)c.push(D.target);let i=U7.spawn(C,c,t);if(D.wait)return new Promise((f,B)=>{i.once("error",B),i.once("close",(A)=>{if(!D.allowNonzeroExitCode&&A!==0){B(Error(`Exited with code ${A}`));return}f(i)})});if(u)return new Promise((f,B)=>{i.once("error",B),i.once("spawn",()=>{i.once("close",(A)=>{if(i.off("error",B),A!==0){B(Error(`Exited with code ${A}`));return}i.unref(),f(i)})})});return i.unref(),new Promise((f,B)=>{i.once("error",B),i.once("spawn",()=>{i.off("error",B),f(i)})})},O7=(D,u)=>{if(typeof D!=="string")throw TypeError("Expected a `target`");return u0({...u,target:D})},b7=(D,u)=>{if(typeof D!=="string"&&!Array.isArray(D))throw TypeError("Expected a valid `name`");let{arguments:F=[]}=u??{};if(F!==void 0&&F!==null&&!Array.isArray(F))throw TypeError("Expected `appArguments` as Array type");return u0({...u,app:{name:D,arguments:F}})},Fu,L7;var Zt=o(()=>{i8();rt();w8();Nt();$8();c2=Symbol("fallbackAttempt"),Mt=import.meta.url?T8.dirname(N7(import.meta.url)):"",S8=T8.join(Mt,"xdg-open"),{platform:ru,arch:I8}=Gt;Fu={browser:"browser",browserPrivate:"browserPrivate"};uu(Fu,"chrome",()=>F0({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));uu(Fu,"brave",()=>F0({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));uu(Fu,"firefox",()=>F0({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));uu(Fu,"edge",()=>F0({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));uu(Fu,"safari",()=>F0({darwin:"Safari"}));L7=O7});var P8={};w0(P8,{wrapAESKeyWithRSA:()=>Z8,wrapAESKeyWithAES:()=>P7,unwrapProjectKey:()=>lt,unwrapAESKeyWithRSA:()=>J8,unwrapAESKeyWithAES:()=>V7,importPublicKey:()=>G8,importPrivateKey:()=>M8,generateSalt:()=>W8,generateRSAKeyPair:()=>Y8,generateIV:()=>i2,generateAESKey:()=>H8,exportPublicKey:()=>X8,exportPrivateKey:()=>z8,encryptWithRSA:()=>K7,encryptWithAES:()=>K8,encryptSecret:()=>y7,encryptPrivateKeyWithPassword:()=>q8,deriveKeyFromPassword:()=>yt,decryptWithRSA:()=>Q7,decryptWithAES:()=>Q8,decryptSecret:()=>dt,decryptPrivateKeyWithPassword:()=>vt,createUserKeys:()=>j7,createProjectKey:()=>k7,CryptoError:()=>T});import L8 from"argon2";function M(D,u){if(typeof D!=="string"||D.length===0)throw new T("INVALID_INPUT",`${u} must be a non-empty string`)}function J7(D,u){if(!/^[A-Za-z0-9+/]*={0,2}$/.test(D))throw new T("INVALID_BASE64",`${u} contains invalid base64 characters`)}function jt(D,u,F){let E=D instanceof ArrayBuffer?D.byteLength:D.length;if(E<u)throw new T("INVALID_CIPHERTEXT",`${F} is too short: expected at least ${u} bytes, got ${E}`)}async function Y8(){try{let D=await crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt","wrapKey","unwrapKey"]);return{publicKey:D.publicKey,privateKey:D.privateKey}}catch(D){throw new T("KEY_GENERATION_FAILED","Failed to generate RSA key pair",D)}}async function H8(){try{return await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"])}catch(D){throw new T("KEY_GENERATION_FAILED","Failed to generate AES key",D)}}function W8(){let D=new Uint8Array(16);return crypto.getRandomValues(D),dD(D)}function i2(){let D=new Uint8Array(12);return crypto.getRandomValues(D),D}function kt(D){let u=new ArrayBuffer(D.length);return new Uint8Array(u).set(D),u}async function yt(D,u){M(D,"password"),M(u,"salt");try{let F=sD(u),E=await L8.hash(D,{type:L8.argon2id,salt:Buffer.from(F),memoryCost:65536,timeCost:3,parallelism:4,hashLength:32,raw:!0}),C=new Uint8Array(E).buffer;return await crypto.subtle.importKey("raw",C,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}catch(F){if(F instanceof T)throw F;throw new T("KEY_DERIVATION_FAILED","Failed to derive key from password",F)}}async function X8(D){try{let u=await crypto.subtle.exportKey("spki",D);return dD(u)}catch(u){throw new T("KEY_EXPORT_FAILED","Failed to export public key",u)}}async function z8(D){try{let u=await crypto.subtle.exportKey("pkcs8",D);return dD(u)}catch(u){throw new T("KEY_EXPORT_FAILED","Failed to export private key",u)}}async function G8(D){M(D,"publicKeyStr");try{let u=sD(D);return await crypto.subtle.importKey("spki",u,{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt","wrapKey"])}catch(u){if(u instanceof T)throw u;throw new T("KEY_IMPORT_FAILED","Failed to import public key",u)}}async function M8(D){M(D,"privateKeyStr");try{let u=sD(D);return await crypto.subtle.importKey("pkcs8",u,{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt","unwrapKey"])}catch(u){if(u instanceof T)throw u;throw new T("KEY_IMPORT_FAILED","Failed to import private key",u)}}async function q8(D,u,F){M(u,"password"),M(F,"salt");try{let E=await yt(u,F),C=await z8(D),c=i2(),t=await crypto.subtle.encrypt({name:"AES-GCM",iv:kt(c)},E,Pt.encode(C)),n=new Uint8Array(c.length+t.byteLength);return n.set(c),n.set(new Uint8Array(t),c.length),dD(n)}catch(E){if(E instanceof T)throw E;throw new T("ENCRYPTION_FAILED","Failed to encrypt private key",E)}}async function vt(D,u,F){M(D,"encryptedPrivateKey"),M(u,"password"),M(F,"salt");try{let E=await yt(u,F),C=sD(D);jt(C,JD+1,"encrypted private key");let c=new Uint8Array(C),t=c.slice(0,JD),n=c.slice(JD),i=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},E,n),f=Vt.decode(i);return await M8(f)}catch(E){if(E instanceof T)throw E;throw new T("DECRYPTION_FAILED","Failed to decrypt private key - incorrect password or corrupted data",E)}}async function K7(D,u){M(u,"data");let F=Pt.encode(u);if(F.length>m8)throw new T("RSA_MESSAGE_TOO_LARGE",`Data too large for RSA encryption: ${F.length} bytes exceeds maximum of ${m8} bytes`);try{let E=await crypto.subtle.encrypt({name:"RSA-OAEP"},D,F);return dD(E)}catch(E){throw new T("ENCRYPTION_FAILED","RSA encryption failed",E)}}async function Q7(D,u){M(u,"encryptedData");try{let F=sD(u),E=await crypto.subtle.decrypt({name:"RSA-OAEP"},D,F);return Vt.decode(E)}catch(F){if(F instanceof T)throw F;throw new T("DECRYPTION_FAILED","RSA decryption failed",F)}}async function Z8(D,u){try{let F=await crypto.subtle.wrapKey("raw",D,u,{name:"RSA-OAEP"});return dD(F)}catch(F){throw new T("KEY_WRAP_FAILED","Failed to wrap AES key with RSA",F)}}async function J8(D,u){M(D,"wrappedKey");try{let F=sD(D);return await crypto.subtle.unwrapKey("raw",F,u,{name:"RSA-OAEP"},{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])}catch(F){if(F instanceof T)throw F;throw new T("KEY_UNWRAP_FAILED","Failed to unwrap AES key with RSA",F)}}async function P7(D,u){try{let F=i2(),E=await crypto.subtle.wrapKey("raw",D,u,{name:"AES-GCM",iv:kt(F)}),C=new Uint8Array(F.length+E.byteLength);return C.set(F),C.set(new Uint8Array(E),F.length),dD(C)}catch(F){if(F instanceof T)throw F;throw new T("KEY_WRAP_FAILED","Failed to wrap AES key with AES",F)}}async function V7(D,u){M(D,"wrappedKey");try{let F=sD(D);jt(F,JD+1,"wrapped key");let E=new Uint8Array(F),C=E.slice(0,JD),c=E.slice(JD);return await crypto.subtle.unwrapKey("raw",c,u,{name:"AES-GCM",iv:C},{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])}catch(F){if(F instanceof T)throw F;throw new T("KEY_UNWRAP_FAILED","Failed to unwrap AES key with AES",F)}}async function K8(D,u){M(u,"data");try{let F=i2(),E=await crypto.subtle.encrypt({name:"AES-GCM",iv:kt(F)},D,Pt.encode(u)),C=new Uint8Array(F.length+E.byteLength);return C.set(F),C.set(new Uint8Array(E),F.length),dD(C)}catch(F){if(F instanceof T)throw F;throw new T("ENCRYPTION_FAILED","AES encryption failed",F)}}async function Q8(D,u){M(u,"encryptedData");try{let F=sD(u);jt(F,JD+1,"encrypted data");let E=new Uint8Array(F),C=E.slice(0,JD),c=E.slice(JD),t=await crypto.subtle.decrypt({name:"AES-GCM",iv:C},D,c);return Vt.decode(t)}catch(F){if(F instanceof T)throw F;throw new T("DECRYPTION_FAILED","AES decryption failed",F)}}async function j7(D){M(D,"password");let u=await Y8(),F=W8(),E=await X8(u.publicKey),C=await q8(u.privateKey,D,F);return{publicKey:E,encryptedPrivateKey:C,salt:F}}async function k7(D){M(D,"userPublicKey");let u=await H8(),F=await G8(D),E=await Z8(u,F);return{projectKey:u,encryptedProjectKey:E}}async function lt(D,u,F,E){M(D,"encryptedProjectKey"),M(u,"userEncryptedPrivateKey"),M(F,"userPassword"),M(E,"userSalt");let C=await vt(u,F,E);return await J8(D,C)}async function y7(D,u){return await K8(D,u)}async function dt(D,u){return await Q8(D,u)}function dD(D){let u=D instanceof ArrayBuffer?new Uint8Array(D):D;return Buffer.from(u).toString("base64")}function sD(D){J7(D,"base64 input");let u=new Uint8Array(Buffer.from(D,"base64"));return u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)}var Pt,Vt,JD=12,m8=190,T;var f2=o(()=>{Pt=new TextEncoder,Vt=new TextDecoder;T=class T extends Error{code;cause;constructor(D,u,F){super(u);this.code=D;this.name="CryptoError",this.cause=F}}});var Yc=BD((XN,V4)=>{V4.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\u2764\uFE0F "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var $E=BD((zN,Wc)=>{var O2=Object.assign({},Yc()),Hc=Object.keys(O2);Object.defineProperty(O2,"random",{get(){let D=Math.floor(Math.random()*Hc.length),u=Hc[D];return O2[u]}});Wc.exports=O2});var bA={};var V={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},X2={silent:{level:-1},fatal:{level:V.fatal},error:{level:V.error},warn:{level:V.warn},log:{level:V.log},info:{level:V.info},success:{level:V.success},fail:{level:V.fail},ready:{level:V.info},start:{level:V.info},box:{level:V.info},debug:{level:V.debug},trace:{level:V.trace},verbose:{level:V.verbose}};function Y2(D){if(D===null||typeof D!=="object")return!1;let u=Object.getPrototypeOf(D);if(u!==null&&u!==Object.prototype&&Object.getPrototypeOf(u)!==null)return!1;if(Symbol.iterator in D)return!1;if(Symbol.toStringTag in D)return Object.prototype.toString.call(D)==="[object Module]";return!0}function z2(D,u,F=".",E){if(!Y2(u))return z2(D,{},F,E);let C=Object.assign({},u);for(let c in D){if(c==="__proto__"||c==="constructor")continue;let t=D[c];if(t===null||t===void 0)continue;if(E&&E(C,c,t,F))continue;if(Array.isArray(t)&&Array.isArray(C[c]))C[c]=[...t,...C[c]];else if(Y2(t)&&Y2(C[c]))C[c]=z2(t,C[c],(F?`${F}.`:"")+c.toString(),E);else C[c]=t}return C}function _n(D){return(...u)=>u.reduce((F,E)=>z2(F,E,"",D),{})}var wn=_n();function Rn(D){return Object.prototype.toString.call(D)==="[object Object]"}function $n(D){if(!Rn(D))return!1;if(!D.message&&!D.args)return!1;if(D.stack)return!1;return!0}var H2=!1,GE=[];class P{options;_lastLog;_mockFn;constructor(D={}){let u=D.types||X2;this.options=wn({...D,defaults:{...D.defaults},level:W2(D.level,u),reporters:[...D.reporters||[]]},{types:X2,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let F in u){let E={type:F,...this.options.defaults,...u[F]};this[F]=this._wrapLogFn(E),this[F].raw=this._wrapLogFn(E,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(D){this.options.level=W2(D,this.options.types,this.options.level)}prompt(D,u){if(!this.options.prompt)throw Error("prompt is not supported!");return this.options.prompt(D,u)}create(D){let u=new P({...this.options,...D});if(this._mockFn)u.mockTypes(this._mockFn);return u}withDefaults(D){return this.create({...this.options,defaults:{...this.options.defaults,...D}})}withTag(D){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+D:D})}addReporter(D){return this.options.reporters.push(D),this}removeReporter(D){if(D){let u=this.options.reporters.indexOf(D);if(u!==-1)return this.options.reporters.splice(u,1)}else this.options.reporters.splice(0);return this}setReporters(D){return this.options.reporters=Array.isArray(D)?D:[D],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let D in this.options.types){if(!console["__"+D])console["__"+D]=console[D];console[D]=this[D].raw}}restoreConsole(){for(let D in this.options.types)if(console["__"+D])console[D]=console["__"+D],delete console["__"+D]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(D,u){if(!D)return;if(!D.__write)D.__write=D.write;D.write=(F)=>{this[u].raw(String(F).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(D){if(!D)return;if(D.__write)D.write=D.__write,delete D.__write}pauseLogs(){H2=!0}resumeLogs(){H2=!1;let D=GE.splice(0);for(let u of D)u[0]._logFn(u[1],u[2])}mockTypes(D){let u=D||this.options.mockFn;if(this._mockFn=u,typeof u!=="function")return;for(let F in this.options.types)this[F]=u(F,this.options.types[F])||this[F],this[F].raw=this[F]}_wrapLogFn(D,u){return(...F)=>{if(H2){GE.push([this,D,F,u]);return}return this._logFn(D,F,u)}}_logFn(D,u,F){if((D.level||0)>this.level)return!1;let E={date:new Date,args:[],...D,level:W2(D.level,this.options.types)};if(!F&&u.length===1&&$n(u[0]))Object.assign(E,u[0]);else E.args=[...u];if(E.message)E.args.unshift(E.message),delete E.message;if(E.additional){if(!Array.isArray(E.additional))E.additional=E.additional.split(`
|
|
75
|
+
`);E.args.push(`
|
|
76
|
+
`+E.additional.join(`
|
|
77
|
+
`)),delete E.additional}E.type=typeof E.type==="string"?E.type.toLowerCase():"log",E.tag=typeof E.tag==="string"?E.tag:"";let C=(t=!1)=>{let n=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&n>0){let i=[...this._lastLog.object.args];if(n>1)i.push(`(repeated ${n} times)`);this._log({...this._lastLog.object,args:i}),this._lastLog.count=1}if(t)this._lastLog.object=E,this._log(E)};clearTimeout(this._lastLog.timeout);let c=this._lastLog.time&&E.date?E.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=E.date,c<this.options.throttle)try{let t=JSON.stringify([E.type,E.tag,E.args]),n=this._lastLog.serialized===t;if(this._lastLog.serialized=t,n){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(C,this.options.throttle);return}}}catch{}C(!0)}_log(D){for(let u of this.options.reporters)u.log(D,{options:this.options})}}function W2(D,u={},F=3){if(D===void 0)return F;if(typeof D==="number")return D;if(u[D]&&u[D].level!==void 0)return u[D].level;return F}P.prototype.add=P.prototype.addReporter;P.prototype.remove=P.prototype.removeReporter;P.prototype.clear=P.prototype.removeReporter;P.prototype.withScope=P.prototype.withTag;P.prototype.mock=P.prototype.mockTypes;P.prototype.pause=P.prototype.pauseLogs;P.prototype.resume=P.prototype.resumeLogs;function ME(D={}){return new P(D)}import{formatWithOptions as qE}from"util";import{sep as Sn}from"path";function M2(D,u){let F=process.cwd()+Sn;return D.split(`
|
|
78
|
+
`).splice(u.split(`
|
|
79
|
+
`).length).map((C)=>C.trim().replace("file://","").replace(F,""))}function In(D,u){return(u.__write||u.write).call(u,D)}var G2=(D)=>D?`[${D}]`:"";class R0{formatStack(D,u,F){let E=" ".repeat((F?.errorLevel||0)+1);return E+M2(D,u).join(`
|
|
80
|
+
${E}`)}formatError(D,u){let F=D.message??qE(u,D),E=D.stack?this.formatStack(D.stack,F,u):"",C=u?.errorLevel||0,c=C>0?`${" ".repeat(C)}[cause]: `:"",t=D.cause?`
|
|
81
|
+
|
|
82
|
+
`+this.formatError(D.cause,{...u,errorLevel:C+1}):"";return c+F+`
|
|
83
|
+
`+E+t}formatArgs(D,u){let F=D.map((E)=>{if(E&&typeof E.stack==="string")return this.formatError(E,u);return E});return qE(u,...F)}formatDate(D,u){return u.date?D.toLocaleTimeString():""}filterAndJoin(D){return D.filter(Boolean).join(" ")}formatLogObj(D,u){let F=this.formatArgs(D.args,u);if(D.type==="box")return`
|
|
84
|
+
`+[G2(D.tag),D.title&&D.title,...F.split(`
|
|
85
|
+
`)].filter(Boolean).map((E)=>" > "+E).join(`
|
|
86
|
+
`)+`
|
|
87
|
+
`;return this.filterAndJoin([G2(D.type),G2(D.tag),F])}log(D,u){let F=this.formatLogObj(D,{columns:u.options.stdout.columns||0,...u.options.formatOptions});return In(F+`
|
|
88
|
+
`,D.level<2?u.options.stderr||process.stderr:u.options.stdout||process.stdout)}}import _3 from"process";import*as $0 from"tty";var{env:jD={},argv:KE=[],platform:Nn=""}=typeof process>"u"?{}:process,Un="NO_COLOR"in jD||KE.includes("--no-color"),Tn="FORCE_COLOR"in jD||KE.includes("--color"),rn=Nn==="win32",QE=jD.TERM==="dumb",On=$0&&$0.isatty&&$0.isatty(1)&&jD.TERM&&!QE,bn="CI"in jD&&(("GITHUB_ACTIONS"in jD)||("GITLAB_CI"in jD)||("CIRCLECI"in jD)),Ln=!Un&&(Tn||rn&&!QE||On||bn);function PE(D,u,F,E,C=u.slice(0,Math.max(0,D))+E,c=u.slice(Math.max(0,D+F.length)),t=c.indexOf(F)){return C+(t<0?c:PE(t,c,F,E))}function mn(D,u,F,E,C){return D<0?F+u+E:F+PE(D,u,E,C)+E}function Yn(D,u,F=D,E=D.length+1){return(C)=>C||!(C===""||C===void 0)?mn((""+C).indexOf(u,E),C,D,u,F):""}function $(D,u,F){return Yn(`\x1B[${D}m`,`\x1B[${u}m`,F)}var ZE={reset:$(0,0),bold:$(1,22,"\x1B[22m\x1B[1m"),dim:$(2,22,"\x1B[22m\x1B[2m"),italic:$(3,23),underline:$(4,24),inverse:$(7,27),hidden:$(8,28),strikethrough:$(9,29),black:$(30,39),red:$(31,39),green:$(32,39),yellow:$(33,39),blue:$(34,39),magenta:$(35,39),cyan:$(36,39),white:$(37,39),gray:$(90,39),bgBlack:$(40,49),bgRed:$(41,49),bgGreen:$(42,49),bgYellow:$(43,49),bgBlue:$(44,49),bgMagenta:$(45,49),bgCyan:$(46,49),bgWhite:$(47,49),blackBright:$(90,39),redBright:$(91,39),greenBright:$(92,39),yellowBright:$(93,39),blueBright:$(94,39),magentaBright:$(95,39),cyanBright:$(96,39),whiteBright:$(97,39),bgBlackBright:$(100,49),bgRedBright:$(101,49),bgGreenBright:$(102,49),bgYellowBright:$(103,49),bgBlueBright:$(104,49),bgMagentaBright:$(105,49),bgCyanBright:$(106,49),bgWhiteBright:$(107,49)};function Hn(D=Ln){return D?ZE:Object.fromEntries(Object.keys(ZE).map((u)=>[u,String]))}var y=Hn();function Wn(D,u="reset"){return y[D]||y[u]}var Xn=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function VD(D){return D.replace(new RegExp(Xn,"g"),"")}var JE={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},zn={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function VE(D,u={}){let F={...u,style:{...zn,...u.style}},E=D.split(`
|
|
89
|
+
`),C=[],c=Wn(F.style.borderColor),t={...typeof F.style.borderStyle==="string"?JE[F.style.borderStyle]||JE.solid:F.style.borderStyle};if(c)for(let w in t)t[w]=c(t[w]);let n=F.style.padding%2===0?F.style.padding:F.style.padding+1,i=E.length+n,f=Math.max(...E.map((w)=>VD(w).length),F.title?VD(F.title).length:0)+n,B=f+n,A=F.style.marginLeft>0?" ".repeat(F.style.marginLeft):"";if(F.style.marginTop>0)C.push("".repeat(F.style.marginTop));if(F.title){let w=c?c(F.title):F.title,R=t.h.repeat(Math.floor((f-VD(F.title).length)/2)),X=t.h.repeat(f-VD(F.title).length-VD(R).length+n);C.push(`${A}${t.tl}${R}${w}${X}${t.tr}`)}else C.push(`${A}${t.tl}${t.h.repeat(B)}${t.tr}`);let h=F.style.valign==="center"?Math.floor((i-E.length)/2):F.style.valign==="top"?i-E.length-n:i-E.length;for(let w=0;w<i;w++)if(w<h||w>=h+E.length)C.push(`${A}${t.v}${" ".repeat(B)}${t.v}`);else{let R=E[w-h],X=" ".repeat(n),K=" ".repeat(f-VD(R).length);C.push(`${A}${t.v}${X}${R}${K}${t.v}`)}if(C.push(`${A}${t.bl}${t.h.repeat(B)}${t.br}`),F.style.marginBottom>0)C.push("".repeat(F.style.marginBottom));return C.join(`
|
|
90
|
+
`)}var O0=Object.create(null),Ku=(D)=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(D?O0:globalThis),kD=new Proxy(O0,{get(D,u){return Ku()[u]??O0[u]},has(D,u){let F=Ku();return u in F||u in O0},set(D,u,F){let E=Ku(!0);return E[u]=F,!0},deleteProperty(D,u){if(!u)return!1;let F=Ku(!0);return delete F[u],!0},ownKeys(){let D=Ku(!0);return Object.keys(D)}}),Ti=typeof process<"u"&&process.env&&"development"||"",ri=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Oi(){if(globalThis.process?.env)for(let D of ri){let u=D[1]||D[0];if(globalThis.process?.env[u])return{name:D[0].toLowerCase(),...D[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var S3=Oi();S3.name;function oD(D){return D?D!=="false":!1}var bi=globalThis.process?.platform||"",k2=oD(kD.CI)||S3.ci!==!1,I3=oD(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),Li=oD(kD.DEBUG),y2=Ti==="test"||oD(kD.TEST);oD(kD.MINIMAL);var mi=/^win/i.test(bi);!oD(kD.NO_COLOR)&&(oD(kD.FORCE_COLOR)||(I3||mi)&&kD.TERM);var Yi=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Yi?.split(".")[0]);var Hi=globalThis.process||Object.create(null),w3={versions:{}};new Proxy(Hi,{get(D,u){if(u==="env")return kD;if(u in D)return D[u];if(u in w3)return w3[u]}});var Wi=globalThis.process?.release?.name==="node",Xi=!!globalThis.Bun||!!globalThis.process?.versions?.bun,zi=!!globalThis.Deno,Gi=!!globalThis.fastly,Mi=!!globalThis.Netlify,qi=!!globalThis.EdgeRuntime,Zi=globalThis.navigator?.userAgent==="Cloudflare-Workers",Ji=[[Mi,"netlify"],[qi,"edge-light"],[Zi,"workerd"],[Gi,"fastly"],[zi,"deno"],[Xi,"bun"],[Wi,"node"]];function Ki(){let D=Ji.find((u)=>u[0]);if(D)return{name:D[1]}}var Qi=Ki();Qi?.name;function Pi({onlyFirst:D=!1}={}){let F=["[\\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(F,D?void 0:"g")}var Vi=Pi();function ji(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(Vi,"")}function ki(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function yi(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function vi(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101631&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129673||D>=129679&&D<=129734||D>=129742&&D<=129756||D>=129759&&D<=129769||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function li(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function di(D,{ambiguousAsWide:u=!1}={}){if(li(D),yi(D)||vi(D)||u&&ki(D))return 2;return 1}var si=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},gi=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:(D)=>D.split("")},ei=/^\p{Default_Ignorable_Code_Point}$/u;function oi(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:E=!1}=u;if(!E)D=ji(D);if(D.length===0)return 0;let C=0,c={ambiguousAsWide:!F};for(let{segment:t}of gi.segment(D)){let n=t.codePointAt(0);if(n<=31||n>=127&&n<=159)continue;if(n>=8203&&n<=8207||n===65279)continue;if(n>=768&&n<=879||n>=6832&&n<=6911||n>=7616&&n<=7679||n>=8400&&n<=8447||n>=65056&&n<=65071)continue;if(n>=55296&&n<=57343)continue;if(n>=65024&&n<=65039)continue;if(ei.test(t))continue;if(si().test(t)){C+=2;continue}C+=di(n,c)}return C}function xi(){let{env:D}=_3,{TERM:u,TERM_PROGRAM:F}=D;if(_3.platform!=="win32")return u!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||F==="Terminus-Sublime"||F==="vscode"||u==="xterm-256color"||u==="alacritty"||u==="rxvt-unicode"||u==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ai={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},pi={0:"red",1:"yellow"},D6=xi(),rD=(D,u)=>D6?D:u,R3={error:rD("\u2716","\xD7"),fatal:rD("\u2716","\xD7"),ready:rD("\u2714","\u221A"),warn:rD("\u26A0","\u203C"),info:rD("\u2139","i"),success:rD("\u2714","\u221A"),debug:rD("\u2699","D"),trace:rD("\u2192","\u2192"),fail:rD("\u2716","\xD7"),start:rD("\u25D0","o"),log:""};function $3(D){if(typeof Intl!=="object"||!Intl.Segmenter)return VD(D).length;return oi(D)}class N3 extends R0{formatStack(D,u,F){let E=" ".repeat((F?.errorLevel||0)+1);return`
|
|
91
|
+
${E}`+M2(D,u).map((C)=>" "+C.replace(/^at +/,(c)=>y.gray(c)).replace(/\((.+)\)/,(c,t)=>`(${y.cyan(t)})`)).join(`
|
|
92
|
+
${E}`)}formatType(D,u,F){let E=ai[D.type]||pi[D.level]||"gray";if(u)return F6(E)(y.black(` ${D.type.toUpperCase()} `));let C=typeof R3[D.type]==="string"?R3[D.type]:D.icon||D.type;return C?u6(E)(C):""}formatLogObj(D,u){let[F,...E]=this.formatArgs(D.args,u).split(`
|
|
93
|
+
`);if(D.type==="box")return VE(r0(F+(E.length>0?`
|
|
94
|
+
`+E.join(`
|
|
95
|
+
`):"")),{title:D.title?r0(D.title):void 0,style:D.style});let C=this.formatDate(D.date,u),c=C&&y.gray(C),t=D.badge??D.level<2,n=this.formatType(D,t,u),i=D.tag?y.gray(D.tag):"",f,B=this.filterAndJoin([n,r0(F)]),A=this.filterAndJoin(u.columns?[i,c]:[i]),h=(u.columns||0)-$3(B)-$3(A)-2;if(f=h>0&&(u.columns||0)>=80?B+" ".repeat(h)+A:(A?`${y.gray(`[${A}]`)} `:"")+B,f+=r0(E.length>0?`
|
|
96
|
+
`+E.join(`
|
|
97
|
+
`):""),D.type==="trace"){let w=Error("Trace: "+D.message);f+=this.formatStack(w.stack||"",w.message)}return t?`
|
|
98
|
+
`+f+`
|
|
99
|
+
`:f}}function r0(D){return D.replace(/`([^`]+)`/gm,(u,F)=>y.cyan(F)).replace(/\s+_([^_]+)_\s+/gm,(u,F)=>` ${y.underline(F)} `)}function u6(D="white"){return y[D]||y.white}function F6(D="bgWhite"){return y[`bg${D[0].toUpperCase()}${D.slice(1)}`]||y.bgWhite}function b0(D={}){let u=t6();if(process.env.CONSOLA_LEVEL)u=Number.parseInt(process.env.CONSOLA_LEVEL)??u;return ME({level:u,defaults:{level:u},stdout:process.stdout,stderr:process.stderr,prompt:(...E)=>Promise.resolve().then(() => (h3(),A3)).then((C)=>C.prompt(...E)),reporters:D.reporters||[D.fancy??!(k2||y2)?new N3:new R0],...D})}function t6(){if(Li)return V.debug;if(y2)return V.warn;return V.info}var jA=b0();import{existsSync as v2,mkdirSync as T3,readFileSync as E6,writeFileSync as C6}from"fs";import{dirname as r3,resolve as cu}from"path";var U3=process.env.HOME||process.env.USERPROFILE||"~",O3=process.platform==="win32"?cu(U3,"AppData","Roaming","relic"):cu(U3,".config","relic"),b3=cu(O3,"logs"),L0=cu(O3,"telemetry.json"),c6=cu(b3,"debug.log"),n6=cu(b3,"relic.log");function m0(){return process.env.DEV==="true"}function L3(){return process.env.CI==="true"||!!process.env.CI}function i6(){let D=process.env.RELIC_LOG?.toLowerCase();if(D&&["debug","info","warn","error","off"].includes(D))return D;return m0()?"info":"warn"}function l2(){try{if(!v2(L0))return null;let D=JSON.parse(E6(L0,"utf-8"));return typeof D.enabled==="boolean"?D.enabled:null}catch{return null}}function f6(){if(process.env.RELIC_TELEMETRY==="false")return!1;if(L3())return!1;if(m0())return!1;let D=l2();if(D!==null)return D;return!0}function d2(){return{level:i6(),logFile:process.env.RELIC_LOG_FILE||(m0()?c6:n6),isDev:m0(),isCI:L3(),telemetryEnabled:f6(),telemetryProxyUrl:process.env.RELIC_TELEMETRY_URL||"https://telemetry.relic.so",posthogApiKey:process.env.RELIC_POSTHOG_KEY||""}}function s2(D){let u=r3(D);if(!v2(u))T3(u,{recursive:!0})}function nu(D){try{let u=r3(L0);if(!v2(u))T3(u,{recursive:!0});C6(L0,JSON.stringify({enabled:D},null,2))}catch{}}function g2(){return l2()}function e2(){return l2()===null}import{appendFileSync as B6,writeFileSync as A6}from"fs";var h6={0:"FATAL",1:"ERROR",2:"WARN",3:"INFO",4:"DEBUG",5:"TRACE"};function _6(D){let u=new Date().toISOString(),F=h6[D.level]||"LOG",E=D.tag?`[${D.tag}]`:"",C=D.args.map((c)=>{if(c instanceof Error)return`${c.name}: ${c.message}${c.stack?`
|
|
100
|
+
${c.stack}`:""}`;if(typeof c==="string")return c;try{return JSON.stringify(c,null,2)}catch{return String(c)}});return`[${u}] [${F}] ${E} ${C.join(" ")}`.trim()}function o2(D){let u=!1;return{log(F){try{if(!u)s2(D),u=!0;let E=_6(F);B6(D,`${E}
|
|
101
|
+
`)}catch{}}}}function m3(D){try{s2(D),A6(D,"")}catch{}}import{dirname as w6,posix as R6,sep as $6}from"path";function H3(){let D=S6();return async(u)=>{for(let F of u)F.module=D(F.filename);return u}}function S6(D=process.argv[1]?w6(process.argv[1]):process.cwd(),u=$6==="\\"){let F=u?Y3(D):D;return(E)=>{if(!E)return;let C=u?Y3(E):E,{dir:c,base:t,ext:n}=R6.parse(C);if(n===".js"||n===".mjs"||n===".cjs")t=t.slice(0,-1*n.length);let i=decodeURIComponent(t);if(!c)c=".";let f=c.lastIndexOf("/node_modules");if(f>-1)return`${c.slice(f+14).replace(/\//g,".")}:${i}`;if(c.startsWith(F)){let B=c.slice(F.length+1).replace(/\//g,".");return B?`${B}:${i}`:i}return i}}function Y3(D){return D.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var x2=(D)=>{if("flags"in D){let u=W3(D.flags),F=X3(D.flags);return{...D,featureFlags:u,featureFlagPayloads:F}}{let u=D.featureFlags??{},F=Object.fromEntries(Object.entries(D.featureFlagPayloads||{}).map(([C,c])=>[C,a2(c)])),E=Object.fromEntries(Object.entries(u).map(([C,c])=>[C,I6(C,c,F[C])]));return{...D,featureFlags:u,featureFlagPayloads:F,flags:E}}};function I6(D,u,F){return{key:D,enabled:typeof u=="string"?!0:u,variant:typeof u=="string"?u:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:F?JSON.stringify(F):void 0,description:void 0}}}var W3=(D)=>Object.fromEntries(Object.entries(D??{}).map(([u,F])=>[u,Qu(F)]).filter(([,u])=>u!==void 0)),X3=(D)=>{let u=D??{};return Object.fromEntries(Object.keys(u).filter((F)=>{let E=u[F];return E.enabled&&E.metadata&&E.metadata.payload!==void 0}).map((F)=>{let E=u[F].metadata?.payload;return[F,E?a2(E):void 0]}))};var Qu=(D)=>D===void 0?void 0:D.variant??D.enabled,a2=(D)=>{if(typeof D!="string")return D;try{return JSON.parse(D)}catch{return D}};/*! For license information please see uuidv7.mjs.LICENSE.txt */class xD{constructor(D){this.bytes=D}static ofInner(D){if(D.length===16)return new xD(D);throw TypeError("not 128-bit length")}static fromFieldsV7(D,u,F,E){if(!Number.isInteger(D)||!Number.isInteger(u)||!Number.isInteger(F)||!Number.isInteger(E)||D<0||u<0||F<0||E<0||D>281474976710655||u>4095||F>1073741823||E>4294967295)throw RangeError("invalid field value");let C=new Uint8Array(16);return C[0]=D/1099511627776,C[1]=D/4294967296,C[2]=D/16777216,C[3]=D/65536,C[4]=D/256,C[5]=D,C[6]=112|u>>>8,C[7]=u,C[8]=128|F>>>24,C[9]=F>>>16,C[10]=F>>>8,C[11]=F,C[12]=E>>>24,C[13]=E>>>16,C[14]=E>>>8,C[15]=E,new xD(C)}static parse(D){let u;switch(D.length){case 32:u=/^[0-9a-f]{32}$/i.exec(D)?.[0];break;case 36:u=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(D)?.slice(1,6).join("");break;case 38:u=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(D)?.slice(1,6).join("");break;case 45:u=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(D)?.slice(1,6).join("");break;default:break}if(u){let F=new Uint8Array(16);for(let E=0;E<16;E+=4){let C=parseInt(u.substring(2*E,2*E+8),16);F[E+0]=C>>>24,F[E+1]=C>>>16,F[E+2]=C>>>8,F[E+3]=C}return new xD(F)}throw SyntaxError("could not parse UUID string")}toString(){let D="";for(let u=0;u<this.bytes.length;u++)if(D+="0123456789abcdef".charAt(this.bytes[u]>>>4),D+="0123456789abcdef".charAt(15&this.bytes[u]),u===3||u===5||u===7||u===9)D+="-";return D}toHex(){let D="";for(let u=0;u<this.bytes.length;u++)D+="0123456789abcdef".charAt(this.bytes[u]>>>4),D+="0123456789abcdef".charAt(15&this.bytes[u]);return D}toJSON(){return this.toString()}getVariant(){let D=this.bytes[8]>>>4;if(D<0)throw Error("unreachable");if(D<=7)return this.bytes.every((u)=>u===0)?"NIL":"VAR_0";if(D<=11)return"VAR_10";if(D<=13)return"VAR_110";if(D<=15)return this.bytes.every((u)=>u===255)?"MAX":"VAR_RESERVED";else throw Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new xD(this.bytes.slice(0))}equals(D){return this.compareTo(D)===0}compareTo(D){for(let u=0;u<16;u++){let F=this.bytes[u]-D.bytes[u];if(F!==0)return Math.sign(F)}return 0}}class G3{constructor(D){this.timestamp=0,this.counter=0,this.random=D??N6()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(D,u){let F=this.generateOrAbortCore(D,u);if(F===void 0)this.timestamp=0,F=this.generateOrAbortCore(D,u);return F}generateOrAbortCore(D,u){if(!Number.isInteger(D)||D<1||D>281474976710655)throw RangeError("`unixTsMs` must be a 48-bit positive integer");if(u<0||u>281474976710655)throw RangeError("`rollbackAllowance` out of reasonable range");if(D>this.timestamp)this.timestamp=D,this.resetCounter();else{if(!(D+u>=this.timestamp))return;if(this.counter++,this.counter>4398046511103)this.timestamp++,this.resetCounter()}return xD.fromFieldsV7(this.timestamp,Math.trunc(this.counter/1073741824),this.counter&1073741823,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}generateV4(){let D=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return D[6]=64|D[6]>>>4,D[8]=128|D[8]>>>2,xD.ofInner(D)}}var N6=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}),z3,OD=()=>U6().toString(),U6=()=>(z3||(z3=new G3)).generate();var v=function(D){return D.AnonymousId="anonymous_id",D.DistinctId="distinct_id",D.Props="props",D.EnablePersonProcessing="enable_person_processing",D.PersonMode="person_mode",D.FeatureFlagDetails="feature_flag_details",D.FeatureFlags="feature_flags",D.FeatureFlagPayloads="feature_flag_payloads",D.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",D.BootstrapFeatureFlags="bootstrap_feature_flags",D.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",D.OverrideFeatureFlags="override_feature_flags",D.Queue="queue",D.OptedOut="opted_out",D.SessionId="session_id",D.SessionStartTimestamp="session_start_timestamp",D.SessionLastTimestamp="session_timestamp",D.PersonProperties="person_properties",D.GroupProperties="group_properties",D.InstalledAppBuild="installed_app_build",D.InstalledAppVersion="installed_app_version",D.SessionReplay="session_replay",D.SurveyLastSeenDate="survey_last_seen_date",D.SurveysSeen="surveys_seen",D.Surveys="surveys",D.RemoteConfig="remote_config",D.FlagsEndpointWasHit="flags_endpoint_was_hit",D}({});var T6=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],M3=function(D,u=[]){if(!D)return!1;let F=D.toLowerCase();return T6.concat(u).some((E)=>{let C=E.toLowerCase();return F.indexOf(C)!==-1})};var O6=Array.isArray,q3=Object.prototype,fh=q3.hasOwnProperty,p2=q3.toString,DF=O6||function(D){return p2.call(D)==="[object Array]"};var uF=(D)=>D===Object(D)&&!DF(D);var iu=(D)=>D===void 0,Pu=(D)=>p2.call(D)=="[object String]",Z3=(D)=>Pu(D)&&D.trim().length===0;var J3=(D)=>p2.call(D)=="[object Number]"&&D===D;var FF=(D)=>D instanceof Error;function Vu(D){return D===null||typeof D!="object"}function aD(D,u){return Object.prototype.toString.call(D)===`[object ${u}]`}function K3(D){return aD(D,"ErrorEvent")}function Y0(D){return!iu(Event)&&b6(D,Event)}function Q3(D){return aD(D,"Object")}function b6(D,u){try{return D instanceof u}catch{return!1}}function ju(D,u,F,E,C){if(u>F)E.warn("min cannot be greater than max."),u=F;if(J3(D))if(D>F)return E.warn(" cannot be greater than max: "+F+". Using max value instead."),F;else{if(!(D<u))return D;return E.warn(" cannot be less than min: "+u+". Using min value instead."),u}return E.warn(" must be a number. using max or fallback. max: "+F+", fallback: "+C),ju(C||F,u,F,E)}var L6=86400000;class tF{constructor(D){this._buckets={},this._onBucketRateLimited=D._onBucketRateLimited,this._bucketSize=ju(D.bucketSize,0,100,D._logger),this._refillRate=ju(D.refillRate,0,this._bucketSize,D._logger),this._refillInterval=ju(D.refillInterval,0,L6,D._logger)}_applyRefill(D,u){let F=u-D.lastAccess,E=Math.floor(F/this._refillInterval);if(E>0){let C=E*this._refillRate;D.tokens=Math.min(D.tokens+C,this._bucketSize),D.lastAccess=D.lastAccess+E*this._refillInterval}}consumeRateLimit(D){let u=Date.now(),F=String(D),E=this._buckets[F];if(E)this._applyRefill(E,u);else E={tokens:this._bucketSize,lastAccess:u},this._buckets[F]=E;if(E.tokens===0)return!0;if(E.tokens--,E.tokens===0)this._onBucketRateLimited?.(D);return E.tokens===0}stop(){this._buckets={}}}class EF{add(D){let u=OD();return this.promiseByIds[u]=D,D.catch(()=>{}).finally(()=>{delete this.promiseByIds[u]}),D}async join(){let D=Object.values(this.promiseByIds),u=D.length;while(u>0)await Promise.all(D),D=Object.values(this.promiseByIds),u=D.length}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={}}}function m6(D=console){return{log:D.log.bind(D),warn:D.warn.bind(D),error:D.error.bind(D),debug:D.debug.bind(D)}}var P3=(D,u,F)=>{function E(c,...t){u(()=>{let n=F[c];n(D,...t)})}return{info:(...c)=>{E("log",...c)},warn:(...c)=>{E("warn",...c)},error:(...c)=>{E("error",...c)},critical:(...c)=>{F.error(D,...c)},createLogger:(c)=>P3(`${D} ${c}`,u,F)}},Y6=(D)=>D();function V3(D,u=Y6){return P3(D,u,m6())}var Bu="Mobile",W0="iOS",fu="Android",j3="Tablet",Th=fu+" "+j3;var H6="Apple",rh=H6+" Watch",k3="Safari",X0="BlackBerry",y3="Samsung",W6=y3+"Browser",X6=y3+" Internet",z0="Chrome",z6=z0+" OS",G6=z0+" "+W0,v3="Internet Explorer",M6=v3+" "+Bu,cF="Opera",Oh=cF+" Mini",l3="Edge",q6="Microsoft "+l3,nF="Firefox",Z6=nF+" "+W0,iF="Nintendo",fF="PlayStation",H0="Xbox",J6=fu+" "+Bu,K6=Bu+" "+k3,ku="Windows",Q6=ku+" Phone";var d3="Generic",bh=d3+" "+Bu.toLowerCase(),Lh=d3+" "+j3.toLowerCase(),P6="Konqueror",l="(\\d+(\\.\\d+)?)",CF=new RegExp("Version/"+l),mh=new RegExp(H0,"i"),Yh=new RegExp(fF+" \\w+","i"),Hh=new RegExp(iF+" \\w+","i"),V6=new RegExp(X0+"|PlayBook|BB10","i"),j6={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000","5.1":"XP","5.2":"XP","6.0":"Vista","6.1":"7","6.2":"8","6.3":"8.1","6.4":"10","10.0":"10"};var Wh={[M6]:[new RegExp("rv:"+l)],[q6]:[new RegExp(l3+"?\\/"+l)],[z0]:[new RegExp("("+z0+"|CrMo)\\/"+l)],[G6]:[new RegExp("CriOS\\/"+l)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+l)],[k3]:[CF],[K6]:[CF],[cF]:[new RegExp("("+cF+"|OPR)\\/"+l)],[nF]:[new RegExp(nF+"\\/"+l)],[Z6]:[new RegExp("FxiOS\\/"+l)],[P6]:[new RegExp("Konqueror[:/]?"+l,"i")],[X0]:[new RegExp(X0+" "+l),CF],[J6]:[new RegExp("android\\s"+l,"i")],[X6]:[new RegExp(W6+"\\/"+l)],[v3]:[new RegExp("(rv:|MSIE )"+l)],Mozilla:[new RegExp("rv:"+l)]};var Xh=[[new RegExp(H0+"; "+H0+" (.*?)[);]","i"),(D)=>[H0,D&&D[1]||""]],[new RegExp(iF,"i"),[iF,""]],[new RegExp(fF,"i"),[fF,""]],[V6,[X0,""]],[new RegExp(ku,"i"),(D,u)=>{if(/Phone/.test(u)||/WPDesktop/.test(u))return[Q6,""];if(new RegExp(Bu).test(u)&&!/IEMobile\b/.test(u))return[ku+" "+Bu,""];let F=/Windows NT ([0-9.]+)/i.exec(u);if(F&&F[1]){let E=F[1],C=j6[E]||"";if(/arm/i.test(u))C="RT";return[ku,C]}return[ku,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,(D)=>{if(D&&D[3]){let u=[D[3],D[4],D[5]||"0"];return[W0,u.join(".")]}return[W0,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,(D)=>{let u="";if(D&&D.length>=3)u=iu(D[2])?D[3]:D[2];return["watchOS",u]}],[new RegExp("("+fu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fu+")","i"),(D)=>{if(D&&D[2]){let u=[D[2],D[3],D[4]||"0"];return[fu,u.join(".")]}return[fu,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,(D)=>{let u=["Mac OS X",""];if(D&&D[1]){let F=[D[1],D[2],D[3]||"0"];u[1]=F.join(".")}return u}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[z6,""]],[/Linux|debian/i,["Linux",""]]];var s3="utf8";function g3(D,u){if(!D||typeof D!="string"||k6(D))throw Error(u)}function k6(D){if(D.trim().length===0)return!0;return!1}function e3(D){return D?.replace(/\/+$/,"")}async function o3(D,u){let F=null;for(let E=0;E<u.retryCount+1;E++){if(E>0)await new Promise((C)=>setTimeout(C,u.retryDelay));try{return await D()}catch(C){if(F=C,!u.retryCheck(C))throw C}}throw F}function G0(){return new Date().toISOString()}function pD(D,u){let F=setTimeout(D,u);return F?.unref&&F?.unref(),F}var x3=(D)=>D instanceof Error;function BF(D){return Promise.all(D.map((u)=>(u??Promise.resolve()).then((F)=>({status:"fulfilled",value:F}),(F)=>({status:"rejected",reason:F}))))}class AF{constructor(){this.events={},this.events={}}on(D,u){if(!this.events[D])this.events[D]=[];return this.events[D].push(u),()=>{this.events[D]=this.events[D].filter((F)=>F!==u)}}emit(D,u){for(let F of this.events[D]||[])F(u);for(let F of this.events["*"]||[])F(D,u)}}function a3(){return"CompressionStream"in globalThis}async function hF(D,u=!0){try{let E=new Blob([D],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return await new Response(E).blob()}catch(F){if(u)console.error("Failed to gzip compress data",F);return null}}class Au extends Error{constructor(D,u){super("HTTP error while fetching PostHog: status="+D.status+", reqByteLength="+u),this.response=D,this.reqByteLength=u,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}}class yu extends Error{constructor(D){super("Network error while fetching PostHog",D instanceof Error?{cause:D}:{}),this.error=D,this.name="PostHogFetchNetworkError"}}async function p3(D){if(D instanceof Au){let u="";try{u=await D.text}catch{}console.error(`Error while flushing PostHog: message=${D.message}, response body=${u}`,D)}else console.error("Error while flushing PostHog",D);return Promise.resolve()}function _F(D){return typeof D=="object"&&(D instanceof Au||D instanceof yu)}function D1(D){return typeof D=="object"&&D instanceof Au&&D.status===413}class M0{constructor(D,u={}){if(this.flushPromise=null,this.shutdownPromise=null,this.promiseQueue=new EF,this._events=new AF,this._isInitialized=!1,g3(D,"You must pass your PostHog project's api key."),this.apiKey=D,this.host=e3(u.host||"https://us.i.posthog.com"),this.flushAt=u.flushAt?Math.max(u.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,u.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,u.maxQueueSize??1000),this.flushInterval=u.flushInterval??1e4,this.preloadFeatureFlags=u.preloadFeatureFlags??!0,this.defaultOptIn=u.defaultOptIn??!0,this.disableSurveys=u.disableSurveys??!1,this._retryOptions={retryCount:u.fetchRetryCount??3,retryDelay:u.fetchRetryDelay??3000,retryCheck:_F},this.requestTimeout=u.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=u.featureFlagsRequestTimeoutMs??3000,this.remoteConfigRequestTimeoutMs=u.remoteConfigRequestTimeoutMs??3000,this.disableGeoip=u.disableGeoip??!0,this.disabled=u.disabled??!1,this.historicalMigration=u?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this._logger=V3("[PostHog]",this.logMsgIfDebug.bind(this)),this.evaluationContexts=u?.evaluationContexts??u?.evaluationEnvironments,u?.evaluationEnvironments&&!u?.evaluationContexts)this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version.");this.disableCompression=!a3()||(u?.disableCompression??!1)}logMsgIfDebug(D){if(this.isDebug)D()}wrap(D){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized)return D();this._initPromise.then(()=>D())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(v.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(v.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(v.OptedOut,!0)})}on(D,u){return this._events.on(D,u)}debug(D=!0){if(this.removeDebugCallback?.(),D){let u=this.on("*",(F,E)=>this._logger.info(F,E));this.removeDebugCallback=()=>{u(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(D){return{distinct_id:D.distinct_id,event:D.event,properties:{...D.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(D){return this.promiseQueue.add(D)}identifyStateless(D,u,F){this.wrap(()=>{let E={...this.buildPayload({distinct_id:D,event:"$identify",properties:u})};this.enqueue("identify",E,F)})}async identifyStatelessImmediate(D,u,F){let E={...this.buildPayload({distinct_id:D,event:"$identify",properties:u})};await this.sendImmediate("identify",E,F)}captureStateless(D,u,F,E){this.wrap(()=>{let C=this.buildPayload({distinct_id:D,event:u,properties:F});this.enqueue("capture",C,E)})}async captureStatelessImmediate(D,u,F,E){let C=this.buildPayload({distinct_id:D,event:u,properties:F});await this.sendImmediate("capture",C,E)}aliasStateless(D,u,F,E){this.wrap(()=>{let C=this.buildPayload({event:"$create_alias",distinct_id:u,properties:{...F||{},distinct_id:u,alias:D}});this.enqueue("alias",C,E)})}async aliasStatelessImmediate(D,u,F,E){let C=this.buildPayload({event:"$create_alias",distinct_id:u,properties:{...F||{},distinct_id:u,alias:D}});await this.sendImmediate("alias",C,E)}groupIdentifyStateless(D,u,F,E,C,c){this.wrap(()=>{let t=this.buildPayload({distinct_id:C||`$${D}_${u}`,event:"$groupidentify",properties:{$group_type:D,$group_key:u,$group_set:F||{},...c||{}}});this.enqueue("capture",t,E)})}async getRemoteConfig(){await this._initPromise;let D=this.host;if(D==="https://us.i.posthog.com")D="https://us-assets.i.posthog.com";else if(D==="https://eu.i.posthog.com")D="https://eu-assets.i.posthog.com";let u=`${D}/array/${this.apiKey}/config`,F={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(u,F,{retryCount:0},this.remoteConfigRequestTimeoutMs).then((E)=>E.json()).catch((E)=>{this._logger.error("Remote config could not be loaded",E),this._events.emit("error",E)})}async getFlags(D,u={},F={},E={},C={},c=!0){await this._initPromise;let t=c?"&config=true":"",n=`${this.host}/flags/?v=2${t}`,i={token:this.apiKey,distinct_id:D,groups:u,person_properties:F,group_properties:E,...C};if(this.evaluationContexts&&this.evaluationContexts.length>0)i.evaluation_contexts=this.evaluationContexts;let f={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(i)};return this._logger.info("Flags URL",n),this.fetchWithRetry(n,f,{retryCount:0},this.featureFlagsRequestTimeoutMs).then((B)=>B.json()).then((B)=>({success:!0,response:x2(B)})).catch((B)=>{return this._events.emit("error",B),{success:!1,error:this.categorizeRequestError(B)}})}categorizeRequestError(D){if(D instanceof Au)return{type:"api_error",statusCode:D.status};if(D instanceof yu){let u=D.error;if(u instanceof Error&&(u.name==="AbortError"||u.name==="TimeoutError"))return{type:"timeout"};return{type:"connection_error"}}return{type:"unknown_error"}}async getFeatureFlagStateless(D,u,F={},E={},C={},c){await this._initPromise;let t=await this.getFeatureFlagDetailStateless(D,u,F,E,C,c);if(t===void 0)return{response:void 0,requestId:void 0};let n=Qu(t.response);if(n===void 0)n=!1;return{response:n,requestId:t.requestId}}async getFeatureFlagDetailStateless(D,u,F={},E={},C={},c){await this._initPromise;let t=await this.getFeatureFlagDetailsStateless(u,F,E,C,c,[D]);if(t===void 0)return;return{response:t.flags[D],requestId:t.requestId,evaluatedAt:t.evaluatedAt}}async getFeatureFlagPayloadStateless(D,u,F={},E={},C={},c){await this._initPromise;let t=await this.getFeatureFlagPayloadsStateless(u,F,E,C,c,[D]);if(!t)return;let n=t[D];if(n===void 0)return null;return n}async getFeatureFlagPayloadsStateless(D,u={},F={},E={},C,c){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(D,u,F,E,C,c)).payloads}async getFeatureFlagsStateless(D,u={},F={},E={},C,c){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(D,u,F,E,C,c)}async getFeatureFlagsAndPayloadsStateless(D,u={},F={},E={},C,c){await this._initPromise;let t=await this.getFeatureFlagDetailsStateless(D,u,F,E,C,c);if(!t)return{flags:void 0,payloads:void 0,requestId:void 0};return{flags:t.featureFlags,payloads:t.featureFlagPayloads,requestId:t.requestId}}async getFeatureFlagDetailsStateless(D,u={},F={},E={},C,c){await this._initPromise;let t={};if(C??this.disableGeoip)t.geoip_disable=!0;if(c)t.flag_keys_to_evaluate=c;let n=await this.getFlags(D,u,F,E,t);if(!n.success)return;let i=n.response;if(i.errorsWhileComputingFlags)console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices");if(i.quotaLimited?.includes("feature_flags"))return console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:i?.requestId,quotaLimited:i.quotaLimited};return i}async getSurveysStateless(){if(await this._initPromise,this.disableSurveys===!0)return this._logger.info("Loading surveys is disabled."),[];let D=`${this.host}/api/surveys/?token=${this.apiKey}`,u={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},E=(await this.fetchWithRetry(D,u).then((C)=>{if(C.status!==200||!C.json){let c=`Surveys API could not be loaded: ${C.status}`,t=Error(c);this._logger.error(t),this._events.emit("error",Error(c));return}return C.json()}).catch((C)=>{this._logger.error("Surveys API could not be loaded",C),this._events.emit("error",C)}))?.surveys;if(E)this._logger.info("Surveys fetched from API: ",JSON.stringify(E));return E??[]}get props(){if(!this._props)this._props=this.getPersistedProperty(v.Props);return this._props||{}}set props(D){this._props=D}async register(D){this.wrap(()=>{this.props={...this.props,...D},this.setPersistedProperty(v.Props,this.props)})}async unregister(D){this.wrap(()=>{delete this.props[D],this.setPersistedProperty(v.Props,this.props)})}processBeforeEnqueue(D){return D}async flushStorage(){}enqueue(D,u,F){this.wrap(()=>{if(this.optedOut)return void this._events.emit(D,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let E=this.prepareMessage(D,u,F);if(E=this.processBeforeEnqueue(E),E===null)return;let C=this.getPersistedProperty(v.Queue)||[];if(C.length>=this.maxQueueSize)C.shift(),this._logger.info("Queue is full, the oldest event is dropped.");if(C.push({message:E}),this.setPersistedProperty(v.Queue,C),this._events.emit(D,E),C.length>=this.flushAt)this.flushBackground();if(this.flushInterval&&!this._flushTimer)this._flushTimer=pD(()=>this.flushBackground(),this.flushInterval)})}async sendImmediate(D,u,F){if(this.disabled)return void this._logger.warn("The client is disabled");if(!this._isInitialized)await this._initPromise;if(this.optedOut)return void this._events.emit(D,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let E=this.prepareMessage(D,u,F);if(E=this.processBeforeEnqueue(E),E===null)return;let C={api_key:this.apiKey,batch:[E],sent_at:G0()};if(this.historicalMigration)C.historical_migration=!0;let c=JSON.stringify(C),t=`${this.host}/batch/`,n=this.disableCompression?null:await hF(c,this.isDebug),i={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...n!==null&&{"Content-Encoding":"gzip"}},body:n||c};try{await this.fetchWithRetry(t,i)}catch(f){this._events.emit("error",f)}}prepareMessage(D,u,F){let E={...u,type:D,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:F?.timestamp?F?.timestamp:G0(),uuid:F?.uuid?F.uuid:OD()};if(F?.disableGeoip??this.disableGeoip){if(!E.properties)E.properties={};E.properties.$geoip_disable=!0}if(E.distinctId)E.distinct_id=E.distinctId,delete E.distinctId;return E}clearFlushTimer(){if(this._flushTimer)clearTimeout(this._flushTimer),this._flushTimer=void 0}flushBackground(){this.flush().catch(async(D)=>{await p3(D)})}async flush(){let D=BF([this.flushPromise]).then(()=>this._flush());return this.flushPromise=D,this.addPendingPromise(D),BF([D]).then(()=>{if(this.flushPromise===D)this.flushPromise=null}),D}getCustomHeaders(){let D=this.getCustomUserAgent(),u={};if(D&&D!=="")u["User-Agent"]=D;return u}async _flush(){this.clearFlushTimer(),await this._initPromise;let D=this.getPersistedProperty(v.Queue)||[];if(!D.length)return;let u=[],F=D.length;while(D.length>0&&u.length<F){let E=D.slice(0,this.maxBatchSize),C=E.map((h)=>h.message),c=async()=>{let w=(this.getPersistedProperty(v.Queue)||[]).slice(E.length);this.setPersistedProperty(v.Queue,w),D=w,await this.flushStorage()},t={api_key:this.apiKey,batch:C,sent_at:G0()};if(this.historicalMigration)t.historical_migration=!0;let n=JSON.stringify(t),i=`${this.host}/batch/`,f=this.disableCompression?null:await hF(n,this.isDebug),B={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...f!==null&&{"Content-Encoding":"gzip"}},body:f||n},A={retryCheck:(h)=>{if(D1(h))return!1;return _F(h)}};try{await this.fetchWithRetry(i,B,A)}catch(h){if(D1(h)&&C.length>1){this.maxBatchSize=Math.max(1,Math.floor(C.length/2)),this._logger.warn(`Received 413 when sending batch of size ${C.length}, reducing batch size to ${this.maxBatchSize}`);continue}if(!(h instanceof yu))await c();throw this._events.emit("error",h),h}await c(),u.push(...C)}this._events.emit("flush",u)}async fetchWithRetry(D,u,F,E){AbortSignal.timeout??=function(t){let n=new AbortController;return setTimeout(()=>n.abort(),t),n.signal};let C=u.body?u.body:"",c=-1;try{c=C instanceof Blob?C.size:Buffer.byteLength(C,s3)}catch{if(C instanceof Blob)c=C.size;else c=new TextEncoder().encode(C).length}return await o3(async()=>{let t=null;try{t=await this.fetch(D,{signal:AbortSignal.timeout(E??this.requestTimeout),...u})}catch(i){throw new yu(i)}if(u.mode!=="no-cors"&&(t.status<200||t.status>=400))throw new Au(t,c);return t},{...this._retryOptions,...F})}async _shutdown(D=30000){await this._initPromise;let u=!1;this.clearFlushTimer();let F=async()=>{try{await this.promiseQueue.join();while(!0){if((this.getPersistedProperty(v.Queue)||[]).length===0)break;if(await this.flush(),u)break}}catch(E){if(!_F(E))throw E;await p3(E)}};return Promise.race([new Promise((E,C)=>{pD(()=>{this._logger.error("Timed out while shutting down PostHog"),u=!0,C("Timeout while shutting down PostHog. Some events may not have been sent.")},D)}),F()])}async shutdown(D=30000){if(this.shutdownPromise)this._logger.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup");else this.shutdownPromise=this._shutdown(D).finally(()=>{this.shutdownPromise=null});return this.shutdownPromise}}var x={};w0(x,{winjsStackLineParser:()=>E1,reverseAndStripFrames:()=>A1,opera11StackLineParser:()=>c1,opera10StackLineParser:()=>C1,nodeStackLineParser:()=>i1,geckoStackLineParser:()=>RF,createStackParser:()=>h1,createDefaultStackParser:()=>tf,chromeStackLineParser:()=>wF,StringCoercer:()=>$1,ReduceableCache:()=>r1,PromiseRejectionEventCoercer:()=>T1,PrimitiveCoercer:()=>U1,ObjectCoercer:()=>I1,EventCoercer:()=>N1,ErrorPropertiesBuilder:()=>t1,ErrorEventCoercer:()=>R1,ErrorCoercer:()=>w1,DOMExceptionCoercer:()=>_1});var q0,u1,Z0;function F1(D){let u=globalThis._posthogChunkIds;if(!u)return;let F=Object.keys(u);if(Z0&&F.length===u1)return Z0;return u1=F.length,Z0=F.reduce((E,C)=>{if(!q0)q0={};let c=q0[C];if(c)E[c[0]]=c[1];else{let t=D(C);for(let n=t.length-1;n>=0;n--){let f=t[n]?.filename,B=u[C];if(f&&B){E[f]=B,q0[C]=[f,B];break}}}return E},{}),Z0}var v6=4;class t1{constructor(D,u,F=[]){this.coercers=D,this.stackParser=u,this.modifiers=F}buildFromUnknown(D,u={}){let E=u&&u.mechanism||{handled:!0,type:"generic"},c=this.buildCoercingContext(E,u,0).apply(D),t=this.buildParsingContext(u),n=this.parseStacktrace(c,t);return{$exception_list:this.convertToExceptionList(n,E),$exception_level:"error"}}async modifyFrames(D){for(let u of D)if(u.stacktrace&&u.stacktrace.frames&&DF(u.stacktrace.frames))u.stacktrace.frames=await this.applyModifiers(u.stacktrace.frames);return D}coerceFallback(D){return{type:"Error",value:"Unknown error",stack:D.syntheticException?.stack,synthetic:!0}}parseStacktrace(D,u){let F;if(D.cause!=null)F=this.parseStacktrace(D.cause,u);let E;if(D.stack!=""&&D.stack!=null)E=this.applyChunkIds(this.stackParser(D.stack,D.synthetic?u.skipFirstLines:0),u.chunkIdMap);return{...D,cause:F,stack:E}}applyChunkIds(D,u){return D.map((F)=>{if(F.filename&&u)F.chunk_id=u[F.filename];return F})}applyCoercers(D,u){for(let F of this.coercers)if(F.match(D))return F.coerce(D,u);return this.coerceFallback(u)}async applyModifiers(D){let u=D;for(let F of this.modifiers)u=await F(u);return u}convertToExceptionList(D,u){let F={type:D.type,value:D.value,mechanism:{type:u.type??"generic",handled:u.handled??!0,synthetic:D.synthetic??!1}};if(D.stack)F.stacktrace={type:"raw",frames:D.stack};let E=[F];if(D.cause!=null)E.push(...this.convertToExceptionList(D.cause,{...u,handled:!0}));return E}buildParsingContext(D){return{chunkIdMap:F1(this.stackParser),skipFirstLines:D.skipFirstLines??1}}buildCoercingContext(D,u,F=0){let E=(c,t)=>{if(!(t<=v6))return;{let n=this.buildCoercingContext(D,u,t);return this.applyCoercers(c,n)}};return{...u,syntheticException:F==0?u.syntheticException:void 0,mechanism:D,apply:(c)=>E(c,F),next:(c)=>E(c,F+1)}}}var j="?";function bD(D,u,F,E,C){let c={platform:D,filename:u,function:F==="<anonymous>"?j:F,in_app:!0};if(!iu(E))c.lineno=E;if(!iu(C))c.colno=C;return c}var J0=(D,u)=>{let F=D.indexOf("safari-extension")!==-1,E=D.indexOf("safari-web-extension")!==-1;return F||E?[D.indexOf("@")!==-1?D.split("@")[0]:j,F?`safari-extension:${u}`:`safari-web-extension:${u}`]:[D,u]};var l6=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,d6=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s6=/\((\S*)(?::(\d+))(?::(\d+))\)/,wF=(D,u)=>{let F=l6.exec(D);if(F){let[,C,c,t]=F;return bD(u,C,j,+c,+t)}let E=d6.exec(D);if(E){if(E[2]&&E[2].indexOf("eval")===0){let n=s6.exec(E[2]);if(n)E[2]=n[1],E[3]=n[2],E[4]=n[3]}let[c,t]=J0(E[1]||j,E[2]);return bD(u,t,c,E[3]?+E[3]:void 0,E[4]?+E[4]:void 0)}};var g6=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,e6=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,RF=(D,u)=>{let F=g6.exec(D);if(F){if(F[3]&&F[3].indexOf(" > eval")>-1){let t=e6.exec(F[3]);if(t)F[1]=F[1]||"eval",F[3]=t[1],F[4]=t[2],F[5]=""}let C=F[3],c=F[1]||j;return[c,C]=J0(c,C),bD(u,C,c,F[4]?+F[4]:void 0,F[5]?+F[5]:void 0)}};var o6=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,E1=(D,u)=>{let F=o6.exec(D);return F?bD(u,F[2],F[1]||j,+F[3],F[4]?+F[4]:void 0):void 0};var x6=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,C1=(D,u)=>{let F=x6.exec(D);return F?bD(u,F[2],F[3]||j,+F[1]):void 0},a6=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,c1=(D,u)=>{let F=a6.exec(D);return F?bD(u,F[5],F[3]||F[4]||j,+F[1],+F[2]):void 0};var p6=/^\s*[-]{4,}$/,Df=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,i1=(D,u)=>{let F=D.match(Df);if(F){let E,C,c,t,n;if(F[1]){c=F[1];let B=c.lastIndexOf(".");if(c[B-1]===".")B--;if(B>0){E=c.slice(0,B),C=c.slice(B+1);let A=E.indexOf(".Module");if(A>0)c=c.slice(A+1),E=E.slice(0,A)}t=void 0}if(C)t=E,n=C;if(C==="<anonymous>")n=void 0,c=void 0;if(c===void 0)n=n||j,c=t?`${t}.${n}`:n;let i=F[2]?.startsWith("file://")?F[2].slice(7):F[2],f=F[5]==="native";if(i?.match(/\/[A-Z]:/))i=i.slice(1);if(!i&&F[5]&&!f)i=F[5];return{filename:i?decodeURI(i):void 0,module:void 0,function:c,lineno:n1(F[3]),colno:n1(F[4]),in_app:uf(i||"",f),platform:u}}if(D.match(p6))return{filename:D,platform:u}};function uf(D,u=!1){return!(u||D&&!D.startsWith("/")&&!D.match(/^[A-Z]:/)&&!D.startsWith(".")&&!D.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&D!==void 0&&!D.includes("node_modules/")}function n1(D){return parseInt(D||"",10)||void 0}var f1=/\(error: (.*)\)/,B1=50;function A1(D){if(!D.length)return[];let u=Array.from(D);return u.reverse(),u.slice(0,B1).map((F)=>({...F,filename:F.filename||Ff(u).filename,function:F.function||j}))}function Ff(D){return D[D.length-1]||{}}function tf(){return h1("web:javascript",wF,RF)}function h1(D,...u){return(F,E=0)=>{let C=[],c=F.split(`
|
|
102
|
+
`);for(let t=E;t<c.length;t++){let n=c[t];if(n.length>1024)continue;let i=f1.test(n)?n.replace(f1,"$1"):n;if(!i.match(/\S*Error: /)){for(let f of u){let B=f(i,D);if(B){C.push(B);break}}if(C.length>=B1)break}}return A1(C)}}class _1{match(D){return this.isDOMException(D)||this.isDOMError(D)}coerce(D,u){let F=Pu(D.stack);return{type:this.getType(D),value:this.getValue(D),stack:F?D.stack:void 0,cause:D.cause?u.next(D.cause):void 0,synthetic:!1}}getType(D){return this.isDOMError(D)?"DOMError":"DOMException"}getValue(D){let u=D.name||(this.isDOMError(D)?"DOMError":"DOMException");return D.message?`${u}: ${D.message}`:u}isDOMException(D){return aD(D,"DOMException")}isDOMError(D){return aD(D,"DOMError")}}class w1{match(D){return FF(D)}coerce(D,u){return{type:this.getType(D),value:this.getMessage(D,u),stack:this.getStack(D),cause:D.cause?u.next(D.cause):void 0,synthetic:!1}}getType(D){return D.name||D.constructor.name}getMessage(D,u){let F=D.message;if(F.error&&typeof F.error.message=="string")return String(F.error.message);return String(F)}getStack(D){return D.stacktrace||D.stack||void 0}}class R1{constructor(){}match(D){return K3(D)&&D.error!=null}coerce(D,u){let F=u.apply(D.error);if(!F)return{type:"ErrorEvent",value:D.message,stack:u.syntheticException?.stack,synthetic:!0};return F}}var Ef=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class $1{match(D){return typeof D=="string"}coerce(D,u){let[F,E]=this.getInfos(D);return{type:F??"Error",value:E??D,stack:u.syntheticException?.stack,synthetic:!0}}getInfos(D){let u="Error",F=D,E=D.match(Ef);if(E)u=E[1],F=E[2];return[u,F]}}var S1=["fatal","error","warning","log","info","debug"];function K0(D,u=40){let F=Object.keys(D);if(F.sort(),!F.length)return"[object has no keys]";for(let E=F.length;E>0;E--){let C=F.slice(0,E).join(", ");if(!(C.length>u)){if(E===F.length)return C;return C.length<=u?C:`${C.slice(0,u)}...`}}return""}class I1{match(D){return typeof D=="object"&&D!==null}coerce(D,u){let F=this.getErrorPropertyFromObject(D);if(F)return u.apply(F);return{type:this.getType(D),value:this.getValue(D),stack:u.syntheticException?.stack,level:this.isSeverityLevel(D.level)?D.level:"error",synthetic:!0}}getType(D){return Y0(D)?D.constructor.name:"Error"}getValue(D){if("name"in D&&typeof D.name=="string"){let E=`'${D.name}' captured as exception`;if("message"in D&&typeof D.message=="string")E+=` with message: '${D.message}'`;return E}if("message"in D&&typeof D.message=="string")return D.message;let u=this.getObjectClassName(D),F=K0(D);return`${u&&u!=="Object"?`'${u}'`:"Object"} captured as exception with keys: ${F}`}isSeverityLevel(D){return Pu(D)&&!Z3(D)&&S1.indexOf(D)>=0}getErrorPropertyFromObject(D){for(let u in D)if(Object.prototype.hasOwnProperty.call(D,u)){let F=D[u];if(x3(F))return F}}getObjectClassName(D){try{let u=Object.getPrototypeOf(D);return u?u.constructor.name:void 0}catch(u){return}}}class N1{match(D){return Y0(D)}coerce(D,u){let F=D.constructor.name;return{type:F,value:`${F} captured as exception with keys: ${K0(D)}`,stack:u.syntheticException?.stack,synthetic:!0}}}class U1{match(D){return Vu(D)}coerce(D,u){return{type:"Error",value:`Primitive value captured as exception: ${String(D)}`,stack:u.syntheticException?.stack,synthetic:!0}}}class T1{match(D){return aD(D,"PromiseRejectionEvent")}coerce(D,u){let F=this.getUnhandledRejectionReason(D);if(Vu(F))return{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(F)}`,stack:u.syntheticException?.stack,synthetic:!0};return u.apply(F)}getUnhandledRejectionReason(D){if(Vu(D))return D;try{if("reason"in D)return D.reason;if("detail"in D&&"reason"in D.detail)return D.detail.reason}catch{}return D}}class r1{constructor(D){this._maxSize=D,this._cache=new Map}get(D){let u=this._cache.get(D);if(u===void 0)return;return this._cache.delete(D),this._cache.set(D,u),u}set(D,u){this._cache.set(D,u)}reduce(){while(this._cache.size>=this._maxSize){let D=this._cache.keys().next().value;if(D)this._cache.delete(D)}}}import{createReadStream as Cf}from"fs";import{createInterface as cf}from"readline";var Q0=new x.ReduceableCache(25),L1=new x.ReduceableCache(20),$F=7,nf=1000,ff=1e4;async function m1(D){let u={};for(let C=D.length-1;C>=0;C--){let c=D[C],t=c?.filename;if(!c||typeof t!="string"||typeof c.lineno!="number"||_f(t)||wf(c))continue;if(!u[t])u[t]=[];u[t].push(c.lineno)}let F=Object.keys(u);if(F.length==0)return D;let E=[];for(let C of F){if(L1.get(C))continue;let c=u[C];if(!c)continue;c.sort((i,f)=>i-f);let t=$f(c);if(t.every((i)=>Rf(C,i)))continue;let n=Sf(Q0,C,{});E.push(Bf(C,t,n))}if(await Promise.all(E).catch(()=>{}),D&&D.length>0)Af(D,Q0);return Q0.reduce(),D}function Bf(D,u,F){return new Promise((E)=>{let C=Cf(D),c=cf({input:C});function t(){C.destroy(),E()}let n=0,i=0,f=u[i];if(f===void 0)return void t();let B=f[0],A=f[1];function h(){L1.set(D,1),c.close(),c.removeAllListeners(),t()}C.on("error",h),c.on("error",h),c.on("close",t),c.on("line",(w)=>{if(n++,n<B)return;if(F[n]=If(w,0),n>=A){if(i===u.length-1){c.close(),c.removeAllListeners();return}i++;let R=u[i];if(R===void 0){c.close(),c.removeAllListeners();return}B=R[0],A=R[1]}})})}function Af(D,u){for(let F of D)if(F.filename&&F.context_line===void 0&&typeof F.lineno=="number"){let E=u.get(F.filename);if(E===void 0)continue;hf(F.lineno,F,E)}}function hf(D,u,F){if(u.lineno===void 0||F===void 0)return;u.pre_context=[];for(let C=Y1(D);C<D;C++){let c=F[C];if(c===void 0)return void O1(u);u.pre_context.push(c)}if(F[D]===void 0)return void O1(u);u.context_line=F[D];let E=H1(D);u.post_context=[];for(let C=D+1;C<=E;C++){let c=F[C];if(c===void 0)break;u.post_context.push(c)}}function O1(D){delete D.pre_context,delete D.context_line,delete D.post_context}function _f(D){return D.startsWith("node:")||D.endsWith(".min.js")||D.endsWith(".min.cjs")||D.endsWith(".min.mjs")||D.startsWith("data:")}function wf(D){if(D.lineno!==void 0&&D.lineno>ff)return!0;if(D.colno!==void 0&&D.colno>nf)return!0;return!1}function Rf(D,u){let F=Q0.get(D);if(F===void 0)return!1;for(let E=u[0];E<=u[1];E++)if(F[E]===void 0)return!1;return!0}function $f(D){if(!D.length)return[];let u=0,F=D[0];if(typeof F!="number")return[];let E=b1(F),C=[];while(!0){if(u===D.length-1){C.push(E);break}let c=D[u+1];if(typeof c!="number")break;if(c<=E[1])E[1]=c+$F;else C.push(E),E=b1(c);u++}return C}function b1(D){return[Y1(D),H1(D)]}function Y1(D){return Math.max(1,D-$F)}function H1(D){return D+$F}function Sf(D,u,F){let E=D.get(u);if(E===void 0)return D.set(u,F),F;return E}function If(D,u){let F=D,E=F.length;if(E<=150)return F;if(u>E)u=E;let C=Math.max(u-60,0);if(C<5)C=0;let c=Math.min(C+140,E);if(c>E-5)c=E;if(c===E)C=Math.max(c-140,0);if(F=F.slice(C,c),C>0)F=`...${F}`;if(c<E)F+="...";return F}function Nf(D,u){let F=!1;return Object.assign((E)=>{let c=global.process.listeners("uncaughtException").filter((t)=>t.name!=="domainUncaughtExceptionClear"&&t._posthogErrorHandler!==!0).length===0;if(D(E,{mechanism:{type:"onuncaughtexception",handled:!1}}),!F&&c)F=!0,u(E)},{_posthogErrorHandler:!0})}function W1(D,u){globalThis.process?.on("uncaughtException",Nf(D,u))}function X1(D){globalThis.process?.on("unhandledRejection",(u)=>D(u,{mechanism:{type:"onunhandledrejection",handled:!1}}))}var Uf=2000;class ED{constructor(D,u,F){this.client=D,this._exceptionAutocaptureEnabled=u.enableExceptionAutocapture||!1,this._logger=F,this._rateLimiter=new tF({refillRate:1,bucketSize:10,refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(D){return uF(D)&&"__posthog_previously_captured_error"in D&&D.__posthog_previously_captured_error===!0}static async buildEventMessage(D,u,F,E){let C={...E};if(!F)C.$process_person_profile=!1;let c=this.errorPropertiesBuilder.buildFromUnknown(D,u);return c.$exception_list=await this.errorPropertiesBuilder.modifyFrames(c.$exception_list),{event:"$exception",distinctId:F||OD(),properties:{...c,...C},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){if(this.isEnabled())W1(this.onException.bind(this),this.onFatalError.bind(this)),X1(this.onException.bind(this))}onException(D,u){this.client.addPendingPromise((async()=>{if(!ED.isPreviouslyCapturedError(D)){let F=await ED.buildEventMessage(D,u),C=F.properties?.$exception_list[0]?.type??"Exception";if(this._rateLimiter.consumeRateLimit(C))return void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:C});return this.client.capture(F)}})())}async onFatalError(D){console.error(D),await this.client.shutdown(Uf),process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}}var z1="5.24.17";var vu={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};async function G1(D){let u=globalThis.crypto?.subtle;if(!u)throw Error("SubtleCrypto API not available");let F=await u.digest("SHA-1",new TextEncoder().encode(D));return Array.from(new Uint8Array(F)).map((C)=>C.toString(16).padStart(2,"0")).join("")}var Tf=60000,rf=1152921504606847000,Of=["is_not"];class hu extends Error{constructor(D){super();Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=D,Object.setPrototypeOf(this,hu.prototype)}}class O extends Error{constructor(D){super(D);this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,O.prototype)}}class LD extends Error{constructor(D){super(D);this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,LD.prototype)}}class SF{constructor({pollingInterval:D,personalApiKey:u,projectApiKey:F,timeout:E,host:C,customHeaders:c,...t}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollingInterval=D,this.personalApiKey=u,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=E,this.projectApiKey=F,this.host=C,this.poller=void 0,this.fetch=t.fetch||fetch,this.onError=t.onError,this.customHeaders=c,this.onLoad=t.onLoad,this.cacheProvider=t.cacheProvider,this.strictLocalEvaluation=t.strictLocalEvaluation??!1,this.loadFeatureFlags()}debug(D=!0){this.debugMode=D}logMsgIfDebug(D){if(this.debugMode)D()}async getFeatureFlag(D,u,F={},E={},C={}){await this.loadFeatureFlags();let c,t;if(!this.loadedSuccessfullyOnce)return c;if(t=this.featureFlagsByKey[D],t!==void 0)try{c=(await this.computeFlagAndPayloadLocally(t,u,F,E,C)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${D} -> ${c}`))}catch(n){if(n instanceof LD||n instanceof O)this.logMsgIfDebug(()=>console.debug(`${n.name} when computing flag locally: ${D}: ${n.message}`));else if(n instanceof Error)this.onError?.(Error(`Error computing flag locally: ${D}: ${n}`))}return c}async getAllFlagsAndPayloads(D,u={},F={},E={},C){await this.loadFeatureFlags();let c={},t={},n=this.featureFlags.length==0,i=C?C.map((B)=>this.featureFlagsByKey[B]).filter(Boolean):this.featureFlags,f={};return await Promise.all(i.map(async(B)=>{try{let{value:A,payload:h}=await this.computeFlagAndPayloadLocally(B,D,u,F,E,void 0,f);if(c[B.key]=A,h)t[B.key]=h}catch(A){if(A instanceof LD||A instanceof O)this.logMsgIfDebug(()=>console.debug(`${A.name} when computing flag locally: ${B.key}: ${A.message}`));else if(A instanceof Error)this.onError?.(Error(`Error computing flag locally: ${B.key}: ${A}`));n=!0}})),{response:c,payloads:t,fallbackToFlags:n}}async computeFlagAndPayloadLocally(D,u,F={},E={},C={},c,t,n=!1){if(!n)await this.loadFeatureFlags();if(!this.loadedSuccessfullyOnce)return{value:!1,payload:null};let i;i=c!==void 0?c:await this.computeFlagValueLocally(D,u,F,E,C,t);let f=this.getFeatureFlagPayload(D.key,i);return{value:i,payload:f}}async computeFlagValueLocally(D,u,F={},E={},C={},c={}){if(D.ensure_experience_continuity)throw new O("Flag has experience continuity enabled");if(!D.active)return!1;let n=(D.filters||{}).aggregation_group_type_index;if(n!=null){let i=this.groupTypeMapping[String(n)];if(!i)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${n} for feature flag ${D.key}`)),new O("Flag has unknown group type index");if(!(i in F))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${D.key} without group names passed in`)),!1;let f=C[i];return await this.matchFeatureFlagProperties(D,F[i],f,c,u,F,E,C)}{let i=this.getBucketingValueForFlag(D,u,E);if(i===void 0)throw new O(`Can't compute feature flag: ${D.key} without $device_id`);return await this.matchFeatureFlagProperties(D,i,E,c,u,F,E,C)}}getBucketingValueForFlag(D,u,F){if(D.filters?.aggregation_group_type_index!=null)return u;if(D.bucketing_identifier==="device_id"){let E=F?.$device_id;if(E==null||E==="")return;return E}return u}getFeatureFlagPayload(D,u){let F=null;if(u!==!1&&u!=null){if(typeof u=="boolean")F=this.featureFlagsByKey?.[D]?.filters?.payloads?.[u.toString()]||null;else if(typeof u=="string")F=this.featureFlagsByKey?.[D]?.filters?.payloads?.[u]||null;if(F!=null){if(typeof F=="object")return F;if(typeof F=="string")try{return JSON.parse(F)}catch{}return F}}return null}async evaluateFlagDependency(D,u,F,E,C,c,t){let n=D.key;if(!this.featureFlagsByKey)throw new O("Feature flags not available for dependency evaluation");if(!("dependency_chain"in D))throw new O(`Flag dependency property for '${n}' is missing required 'dependency_chain' field`);let i=D.dependency_chain;if(!Array.isArray(i))throw new O(`Flag dependency property for '${n}' has an invalid 'dependency_chain' (expected array, got ${typeof i})`);if(i.length===0)throw new O(`Circular dependency detected for flag '${n}' (empty dependency chain)`);for(let B of i){if(!(B in t)){let h=this.featureFlagsByKey[B];if(h)if(h.active)try{let w=await this.computeFlagValueLocally(h,u,F,E,C,t);t[B]=w}catch(w){throw new O(`Error evaluating flag dependency '${B}' for flag '${n}': ${w}`)}else t[B]=!1;else throw new O(`Missing flag dependency '${B}' for flag '${n}'`)}if(t[B]==null)throw new O(`Dependency '${B}' could not be evaluated`)}let f=t[n];return this.flagEvaluatesToExpectedValue(D.value,f)}flagEvaluatesToExpectedValue(D,u){if(typeof D=="boolean")return D===u||typeof u=="string"&&u!==""&&D===!0;if(typeof D=="string")return u===D;return!1}async matchFeatureFlagProperties(D,u,F,E={},C=u,c={},t={},n={}){let i=D.filters||{},f=i.groups||[],B=!1,A;for(let h of f)try{if(await this.isConditionMatch(D,u,h,F,E,C,c,t,n)){let w=h.variant,R=i.multivariate?.variants||[];A=w&&R.some((X)=>X.key===w)?w:await this.getMatchingVariant(D,u)||!0;break}}catch(w){if(w instanceof LD)throw w;if(w instanceof O)B=!0;else throw w}if(A!==void 0)return A;if(B)throw new O("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(D,u,F,E,C={},c=u,t={},n={},i={}){let f=F.rollout_percentage,B=(A)=>{this.logMsgIfDebug(()=>console.warn(A))};if((F.properties||[]).length>0){for(let A of F.properties){let h=A.type,w=!1;if(w=h==="cohort"?K1(A,E,this.cohorts,this.debugMode):h==="flag"?await this.evaluateFlagDependency(A,c,t,n,i,E,C):J1(A,E,B),!w)return!1}if(f==null)return!0}if(f!=null&&await M1(D.key,u)>f/100)return!1;return!0}async getMatchingVariant(D,u){let F=await M1(D.key,u,"variant"),E=this.variantLookupTable(D).find((C)=>F>=C.valueMin&&F<C.valueMax);if(E)return E.key}variantLookupTable(D){let u=[],F=0,E=0;return((D.filters||{}).multivariate?.variants||[]).forEach((t)=>{E=F+t.rollout_percentage/100,u.push({valueMin:F,valueMax:E,key:t.key}),F=E}),u}updateFlagState(D){this.featureFlags=D.flags,this.featureFlagsByKey=D.flags.reduce((u,F)=>(u[F.key]=F,u),{}),this.groupTypeMapping=D.groupTypeMapping,this.cohorts=D.cohorts,this.loadedSuccessfullyOnce=!0}warnAboutExperienceContinuityFlags(D){if(this.strictLocalEvaluation)return;let u=D.filter((F)=>F.ensure_experience_continuity);if(u.length>0)console.warn(`[PostHog] You are using local evaluation but ${u.length} flag(s) have experience continuity enabled: ${u.map((F)=>F.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`)}async loadFromCache(D){if(!this.cacheProvider)return!1;try{let u=await this.cacheProvider.getFlagDefinitions();if(u)return this.updateFlagState(u),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${D} (${u.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(u.flags),!0;return!1}catch(u){return this.onError?.(Error(`Failed to load from cache: ${u}`)),!1}}async loadFeatureFlags(D=!1){if(this.loadedSuccessfullyOnce&&!D)return;if(!D&&this.nextFetchAllowedAt&&Date.now()<this.nextFetchAllowedAt)return void this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period"));if(!this.loadingPromise)this.loadingPromise=this._loadFeatureFlags().catch((u)=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${u}`))).finally(()=>{this.loadingPromise=void 0});return this.loadingPromise}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getPollingInterval(){if(!this.shouldBeginExponentialBackoff)return this.pollingInterval;return Math.min(Tf,this.pollingInterval*2**this.backOffCount)}beginBackoff(){this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,this.nextFetchAllowedAt=Date.now()+this.getPollingInterval()}clearBackoff(){this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.nextFetchAllowedAt=void 0}async _loadFeatureFlags(){if(this.poller)clearTimeout(this.poller),this.poller=void 0;this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval());try{let D=!0;if(this.cacheProvider)try{D=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(F){this.onError?.(Error(`Error in shouldFetchFlagDefinitions: ${F}`))}if(!D){if(await this.loadFromCache("Loaded flags from cache (skipped fetch)"))return;if(this.loadedSuccessfullyOnce)return}let u=await this._requestFeatureFlagDefinitions();if(!u)return;switch(u.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=u.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.clearBackoff();return;case 401:throw this.beginBackoff(),new hu(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.beginBackoff(),new hu(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new hu(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let F=await u.json()??{};if(!("flags"in F))return void this.onError?.(Error(`Invalid response when getting feature flags: ${JSON.stringify(F)}`));this.flagsEtag=u.headers?.get("ETag")??void 0;let E={flags:F.flags??[],groupTypeMapping:F.group_type_mapping||{},cohorts:F.cohorts||{}};if(this.updateFlagState(E),this.clearBackoff(),this.cacheProvider&&D)try{await this.cacheProvider.onFlagDefinitionsReceived(E)}catch(C){this.onError?.(Error(`Failed to store in cache: ${C}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(E.flags);break}default:return}}catch(D){if(D instanceof hu)this.onError?.(D)}}getPersonalApiKeyRequestOptions(D="GET",u){let F={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};if(u)F["If-None-Match"]=u;return{method:D,headers:F}}_requestFeatureFlagDefinitions(){let D=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,u=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),F=null;if(this.timeout&&typeof this.timeout=="number"){let E=new AbortController;F=pD(()=>{E.abort()},this.timeout),u.signal=E.signal}try{let E=this.fetch;return E(D,u)}finally{clearTimeout(F)}}async stopPoller(D=30000){if(clearTimeout(this.poller),this.cacheProvider)try{let u=this.cacheProvider.shutdown();if(u instanceof Promise)await Promise.race([u,new Promise((F,E)=>setTimeout(()=>E(Error(`Cache shutdown timeout after ${D}ms`)),D))])}catch(u){this.onError?.(Error(`Error during cache shutdown: ${u}`))}}}async function M1(D,u,F=""){let E=await G1(`${D}.${u}${F}`);return parseInt(E.slice(0,15),16)/rf}function J1(D,u,F){let{key:E,value:C}=D,c=D.operator||"exact";if(E in u){if(c==="is_not_set")throw new O("Operator is_not_set is not supported")}else throw new O(`Property ${E} not found in propertyValues`);let t=u[E];if(t==null&&!Of.includes(c)){if(F)F(`Property ${E} cannot have a value of null/undefined with the ${c} operator`);return!1}function n(f,B){if(Array.isArray(f))return f.map((A)=>String(A).toLowerCase()).includes(String(B).toLowerCase());return String(f).toLowerCase()===String(B).toLowerCase()}function i(f,B,A){if(A==="gt")return f>B;if(A==="gte")return f>=B;if(A==="lt")return f<B;if(A==="lte")return f<=B;throw Error(`Invalid operator: ${A}`)}switch(c){case"exact":return n(C,t);case"is_not":return!n(C,t);case"is_set":return E in u;case"icontains":return String(t).toLowerCase().includes(String(C).toLowerCase());case"not_icontains":return!String(t).toLowerCase().includes(String(C).toLowerCase());case"regex":return q1(String(C))&&String(t).match(String(C))!==null;case"not_regex":return q1(String(C))&&String(t).match(String(C))===null;case"gt":case"gte":case"lt":case"lte":{let f=typeof C=="number"?C:null;if(typeof C=="string")try{f=parseFloat(C)}catch(B){}if(f==null||t==null)return i(String(t),String(C),c);if(typeof t=="string")return i(t,String(C),c);return i(t,f,c)}case"is_date_after":case"is_date_before":{if(typeof C=="boolean")throw new O("Date operations cannot be performed on boolean values");let f=Lf(String(C));if(f==null)f=Z1(C);if(f==null)throw new O(`Invalid date: ${C}`);let B=Z1(t);if(["is_date_before"].includes(c))return B<f;return B>f}default:throw new O(`Unknown operator: ${c}`)}}function bf(D,u){if(!(D in u))throw new LD(`cohort ${D} not found in local cohorts - likely a static cohort that requires server evaluation`)}function K1(D,u,F,E=!1){let C=String(D.value);bf(C,F);let c=F[C];return Q1(c,u,F,E)}function Q1(D,u,F,E=!1){if(!D)return!0;let{type:C,values:c}=D;if(!c||c.length===0)return!0;let t=!1;if("values"in c[0]){for(let n of c)try{let i=Q1(n,u,F,E);if(C==="AND"){if(!i)return!1}else if(i)return!0}catch(i){if(i instanceof LD)throw i;if(i instanceof O){if(E)console.debug(`Failed to compute property ${n} locally: ${i}`);t=!0}else throw i}if(t)throw new O("Can't match cohort without a given cohort property value");return C==="AND"}for(let n of c)try{let i;if(n.type==="cohort")i=K1(n,u,F,E);else if(n.type==="flag"){if(E)console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${n.key||"unknown"}'`);continue}else i=J1(n,u);let f=n.negation||!1;if(C==="AND"){if(!i&&!f)return!1;if(i&&f)return!1}else{if(i&&!f)return!0;if(!i&&f)return!0}}catch(i){if(i instanceof LD)throw i;if(i instanceof O){if(E)console.debug(`Failed to compute property ${n} locally: ${i}`);t=!0}else throw i}if(t)throw new O("can't match cohort without a given cohort property value");return C==="AND"}function q1(D){try{return new RegExp(D),!0}catch(u){return!1}}function Z1(D){if(D instanceof Date)return D;if(typeof D=="string"||typeof D=="number"){let u=new Date(D);if(!isNaN(u.valueOf()))return u;throw new O(`${D} is in an invalid date format`)}throw new O(`The date provided ${D} must be a string, number, or date object`)}function Lf(D){let u=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,F=D.match(u),E=new Date(new Date().toISOString());if(!F)return null;{if(!F.groups)return null;let C=parseInt(F.groups.number);if(C>=1e4)return null;let c=F.groups.interval;if(c=="h")E.setUTCHours(E.getUTCHours()-C);else if(c=="d")E.setUTCDate(E.getUTCDate()-C);else if(c=="w")E.setUTCDate(E.getUTCDate()-7*C);else if(c=="m")E.setUTCMonth(E.getUTCMonth()-C);else{if(c!="y")return null;E.setUTCFullYear(E.getUTCFullYear()-C)}return E}}class IF{getProperty(D){return this._memoryStorage[D]}setProperty(D,u){this._memoryStorage[D]=u!==null?u:void 0}constructor(){this._memoryStorage={}}}var mf=100,P1=30000,Yf=50000;class NF extends M0{constructor(D,u={}){if(super(D,u),this._memoryStorage=new IF,this.options=u,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof u.featureFlagsPollingInterval=="number"?Math.max(u.featureFlagsPollingInterval,mf):P1,u.personalApiKey){if(u.personalApiKey.includes("phc_"))throw Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');if(u.enableLocalEvaluation!==!1)this.featureFlagsPoller=new SF({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:u.personalApiKey,projectApiKey:D,timeout:u.requestTimeout??1e4,host:this.host,fetch:u.fetch,onError:(E)=>{this._events.emit("error",E)},onLoad:(E)=>{this._events.emit("localEvaluationFlagsLoaded",E)},customHeaders:this.getCustomHeaders(),cacheProvider:u.flagDefinitionCacheProvider,strictLocalEvaluation:u.strictLocalEvaluation})}this.errorTracking=new ED(this,u,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=u.maxCacheSize||Yf}getPersistedProperty(D){return this._memoryStorage.getProperty(D)}setPersistedProperty(D,u){return this._memoryStorage.setProperty(D,u)}fetch(D,u){return this.options.fetch?this.options.fetch(D,u):fetch(D,u)}getLibraryVersion(){return z1}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}enable(){return super.optIn()}disable(){return super.optOut()}debug(D=!0){super.debug(D),this.featureFlagsPoller?.debug(D)}capture(D){if(typeof D=="string")this._logger.warn("Called capture() with a string as the first argument when an object was expected.");if(D.event==="$exception"&&!D._originatedFromCaptureException)this._logger.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically.");this.addPendingPromise(this.prepareEventMessage(D).then(({distinctId:u,event:F,properties:E,options:C})=>super.captureStateless(u,F,E,{timestamp:C.timestamp,disableGeoip:C.disableGeoip,uuid:C.uuid})).catch((u)=>{if(u)console.error(u)}))}async captureImmediate(D){if(typeof D=="string")this._logger.warn("Called captureImmediate() with a string as the first argument when an object was expected.");if(D.event==="$exception"&&!D._originatedFromCaptureException)this._logger.warn("Capturing a `$exception` event via `posthog.captureImmediate('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureExceptionImmediate(error)` instead, which attaches this metadata by default.");return this.addPendingPromise(this.prepareEventMessage(D).then(({distinctId:u,event:F,properties:E,options:C})=>super.captureStatelessImmediate(u,F,E,{timestamp:C.timestamp,disableGeoip:C.disableGeoip,uuid:C.uuid})).catch((u)=>{if(u)console.error(u)}))}identify({distinctId:D,properties:u={},disableGeoip:F}){let{$set:E,$set_once:C,$anon_distinct_id:c,...t}=u,f={$set:E||t,$set_once:C||{},$anon_distinct_id:c??void 0};super.identifyStateless(D,f,{disableGeoip:F})}async identifyImmediate({distinctId:D,properties:u={},disableGeoip:F}){let{$set:E,$set_once:C,$anon_distinct_id:c,...t}=u,f={$set:E||t,$set_once:C||{},$anon_distinct_id:c??void 0};super.identifyStatelessImmediate(D,f,{disableGeoip:F})}alias(D){super.aliasStateless(D.alias,D.distinctId,void 0,{disableGeoip:D.disableGeoip})}async aliasImmediate(D){await super.aliasStatelessImmediate(D.alias,D.distinctId,void 0,{disableGeoip:D.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(D=P1){if(this.isLocalEvaluationReady())return!0;if(this.featureFlagsPoller===void 0)return!1;return new Promise((u)=>{let F=setTimeout(()=>{E(),u(!1)},D),E=this._events.on("localEvaluationFlagsLoaded",(C)=>{clearTimeout(F),E(),u(C>0)})})}async _getFeatureFlagResult(D,u,F={},E){let C=F.sendFeatureFlagEvents??!0;if(this._flagOverrides!==void 0&&D in this._flagOverrides){let N=this._flagOverrides[D];if(N===void 0)return;let U=this._payloadOverrides?.[D];return{key:D,enabled:N!==!1,variant:typeof N=="string"?N:void 0,payload:U}}let{groups:c,disableGeoip:t}=F,{onlyEvaluateLocally:n,personProperties:i,groupProperties:f}=F,B=this.addLocalPersonAndGroupProperties(u,c,i,f);if(i=B.allPersonProperties,f=B.allGroupProperties,n==null)n=this.options.strictLocalEvaluation??!1;let A,h=!1,w,R,X,K,fD,PD;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let N=this.featureFlagsPoller?.featureFlagsByKey[D];if(N)try{let U=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(N,u,c,i,f,E);if(U){h=!0;let b=U.value;K=N.id,PD="Evaluated locally",A={key:D,enabled:b!==!1,variant:typeof b=="string"?b:void 0,payload:U.payload??void 0}}}catch(U){if(U instanceof LD||U instanceof O)this._logger?.info(`${U.name} when computing flag locally: ${D}: ${U.message}`);else throw U}}if(!h&&!n){let N=await super.getFeatureFlagDetailsStateless(u,c,i,f,t,[D]);if(N===void 0)X=vu.UNKNOWN_ERROR;else{w=N.requestId,R=N.evaluatedAt;let U=[];if(N.errorsWhileComputingFlags)U.push(vu.ERRORS_WHILE_COMPUTING);if(N.quotaLimited?.includes("feature_flags"))U.push(vu.QUOTA_LIMITED);let b=N.flags[D];if(b===void 0)U.push(vu.FLAG_MISSING);else{K=b.metadata?.id,fD=b.metadata?.version,PD=b.reason?.description??b.reason?.code;let UD;if(b.metadata?.payload!==void 0)try{UD=JSON.parse(b.metadata.payload)}catch{UD=b.metadata.payload}A={key:D,enabled:b.enabled,variant:b.variant,payload:UD}}if(U.length>0)X=U.join(",")}}if(C){let N=A===void 0?void 0:A.enabled===!1?!1:A.variant??!0,U=`${D}_${N}`;if(!(u in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[u].includes(U)){if(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize)this.distinctIdHasSentFlagCalls={};if(Array.isArray(this.distinctIdHasSentFlagCalls[u]))this.distinctIdHasSentFlagCalls[u].push(U);else this.distinctIdHasSentFlagCalls[u]=[U];let b={$feature_flag:D,$feature_flag_response:N,$feature_flag_id:K,$feature_flag_version:fD,$feature_flag_reason:PD,locally_evaluated:h,[`$feature/${D}`]:N,$feature_flag_request_id:w,$feature_flag_evaluated_at:R};if(X)b.$feature_flag_error=X;this.capture({distinctId:u,event:"$feature_flag_called",properties:b,groups:c,disableGeoip:t})}}if(A!==void 0&&this._payloadOverrides!==void 0&&D in this._payloadOverrides)A={...A,payload:this._payloadOverrides[D]};return A}async getFeatureFlag(D,u,F){let E=await this._getFeatureFlagResult(D,u,{...F,sendFeatureFlagEvents:F?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});if(E===void 0)return;if(E.enabled===!1)return!1;return E.variant??!0}async getFeatureFlagPayload(D,u,F,E){if(this._payloadOverrides!==void 0&&D in this._payloadOverrides)return this._payloadOverrides[D];let C=await this._getFeatureFlagResult(D,u,{...E,sendFeatureFlagEvents:!1},F);if(C===void 0)return;return C.payload??null}async getFeatureFlagResult(D,u,F){return this._getFeatureFlagResult(D,u,{...F,sendFeatureFlagEvents:F?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0})}async getRemoteConfigPayload(D){if(!this.options.personalApiKey)throw Error("Personal API key is required for remote config payload decryption");let u=await this._requestRemoteConfigPayload(D);if(!u)return;let F=await u.json();if(typeof F=="string")try{return JSON.parse(F)}catch(E){}return F}async isFeatureEnabled(D,u,F){let E=await this.getFeatureFlag(D,u,F);if(E===void 0)return;return!!E||!1}async getAllFlags(D,u){return(await this.getAllFlagsAndPayloads(D,u)).featureFlags||{}}async getAllFlagsAndPayloads(D,u){let{groups:F,disableGeoip:E,flagKeys:C}=u||{},{onlyEvaluateLocally:c,personProperties:t,groupProperties:n}=u||{},i=this.addLocalPersonAndGroupProperties(D,F,t,n);if(t=i.allPersonProperties,n=i.allGroupProperties,c==null)c=this.options.strictLocalEvaluation??!1;let f=await this.featureFlagsPoller?.getAllFlagsAndPayloads(D,F,t,n,C),B={},A={},h=!0;if(f)B=f.response,A=f.payloads,h=f.fallbackToFlags;if(h&&!c){let w=await super.getFeatureFlagsAndPayloadsStateless(D,F,t,n,E,C);B={...B,...w.flags||{}},A={...A,...w.payloads||{}}}if(this._flagOverrides!==void 0)B={...B,...this._flagOverrides};if(this._payloadOverrides!==void 0)A={...A,...this._payloadOverrides};return{featureFlags:B,featureFlagPayloads:A}}groupIdentify({groupType:D,groupKey:u,properties:F,distinctId:E,disableGeoip:C}){super.groupIdentifyStateless(D,u,F,{disableGeoip:C},E)}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}overrideFeatureFlags(D){let u=(F)=>Object.fromEntries(F.map((E)=>[E,!0]));if(D===!1){this._flagOverrides=void 0,this._payloadOverrides=void 0;return}if(Array.isArray(D)){this._flagOverrides=u(D);return}if(this._isFeatureFlagOverrideOptions(D)){if("flags"in D){if(D.flags===!1)this._flagOverrides=void 0;else if(Array.isArray(D.flags))this._flagOverrides=u(D.flags);else if(D.flags!==void 0)this._flagOverrides={...D.flags}}if("payloads"in D){if(D.payloads===!1)this._payloadOverrides=void 0;else if(D.payloads!==void 0)this._payloadOverrides={...D.payloads}}return}this._flagOverrides={...D}}_isFeatureFlagOverrideOptions(D){if(typeof D!="object"||D===null||Array.isArray(D))return!1;let u=D;if("flags"in u){let F=u.flags;if(F===!1||Array.isArray(F)||typeof F=="object"&&F!==null)return!0}if("payloads"in u){let F=u.payloads;if(F===!1||typeof F=="object"&&F!==null)return!0}return!1}withContext(D,u,F){if(!this.context)return u();return this.context.run(D,u,F)}getContext(){return this.context?.get()}async _shutdown(D){return this.featureFlagsPoller?.stopPoller(D),this.errorTracking.shutdown(),super._shutdown(D)}async _requestRemoteConfigPayload(D){if(!this.options.personalApiKey)return;let u=`${this.host}/api/projects/@current/feature_flags/${D}/remote_config?token=${encodeURIComponent(this.apiKey)}`,F={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},E=null;if(this.options.requestTimeout&&typeof this.options.requestTimeout=="number"){let C=new AbortController;E=pD(()=>{C.abort()},this.options.requestTimeout),F.signal=C.signal}try{return await this.fetch(u,F)}catch(C){this._events.emit("error",C);return}finally{if(E)clearTimeout(E)}}extractPropertiesFromEvent(D,u){if(!D)return{personProperties:{},groupProperties:{}};let F={},E={};for(let[C,c]of Object.entries(D))if(Q3(c)&&u&&C in u){let t={};for(let[n,i]of Object.entries(c))t[String(n)]=String(i);E[String(C)]=t}else F[String(C)]=String(c);return{personProperties:F,groupProperties:E}}async getFeatureFlagsForEvent(D,u,F,E){let C=E?.personProperties||{},c=E?.groupProperties||{},t=E?.flagKeys;if(E?.onlyEvaluateLocally??this.options.strictLocalEvaluation??!1)if(!((this.featureFlagsPoller?.featureFlags?.length||0)>0))return{};else{let i={};for(let[f,B]of Object.entries(u||{}))i[f]=String(B);return await this.getAllFlags(D,{groups:i,personProperties:C,groupProperties:c,disableGeoip:F,onlyEvaluateLocally:!0,flagKeys:t})}if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let i={};for(let[f,B]of Object.entries(u||{}))i[f]=String(B);return await this.getAllFlags(D,{groups:i,personProperties:C,groupProperties:c,disableGeoip:F,onlyEvaluateLocally:!0,flagKeys:t})}return(await super.getFeatureFlagsStateless(D,u,C,c,F)).flags}addLocalPersonAndGroupProperties(D,u,F,E){let C={distinct_id:D,...F||{}},c={};if(u)for(let t of Object.keys(u))c[t]={$group_key:u[t],...E?.[t]||{}};return{allPersonProperties:C,allGroupProperties:c}}captureException(D,u,F,E){if(!ED.isPreviouslyCapturedError(D)){let C=Error("PostHog syntheticException");this.addPendingPromise(ED.buildEventMessage(D,{syntheticException:C},u,F).then((c)=>this.capture({...c,uuid:E})))}}async captureExceptionImmediate(D,u,F){if(!ED.isPreviouslyCapturedError(D)){let E=Error("PostHog syntheticException");this.addPendingPromise(ED.buildEventMessage(D,{syntheticException:E},u,F).then((C)=>this.captureImmediate(C)))}}async prepareEventMessage(D){let{distinctId:u,event:F,properties:E,groups:C,sendFeatureFlags:c,timestamp:t,disableGeoip:n,uuid:i}=D,f=this.context?.get(),B=u||f?.distinctId,A={...f?.properties||{},...E||{}};if(!B)B=OD(),A.$process_person_profile=!1;if(f?.sessionId&&!A.$session_id)A.$session_id=f.sessionId;let h=this._runBeforeSend({distinctId:B,event:F,properties:A,groups:C,sendFeatureFlags:c,timestamp:t,disableGeoip:n,uuid:i});if(!h)return Promise.reject(null);let w=await Promise.resolve().then(async()=>{if(c){let R=typeof c=="object"?c:void 0;return await this.getFeatureFlagsForEvent(h.distinctId,C,n,R)}return h.event,{}}).then((R)=>{let X={};if(R)for(let[fD,PD]of Object.entries(R))X[`$feature/${fD}`]=PD;let K=Object.keys(R||{}).filter((fD)=>R?.[fD]!==!1).sort();if(K.length>0)X.$active_feature_flags=K;return X}).catch(()=>({})).then((R)=>{return{...R,...h.properties||{},$groups:h.groups||C}});if(h.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof w.$raw_user_agent=="string"){if(M3(w.$raw_user_agent,this.options.custom_blocked_useragents||[]))h.event="$bot_pageview",w.$browser_type="bot"}return{distinctId:h.distinctId,event:h.event,properties:w,options:{timestamp:h.timestamp,disableGeoip:h.disableGeoip,uuid:h.uuid}}}_runBeforeSend(D){let u=this.options.before_send;if(!u)return D;let F=Array.isArray(u)?u:[u],E=D;for(let C of F){if(E=C(E),!E)return this._logger.info(`Event '${D.event}' was rejected in beforeSend function`),null;if(!E.properties||Object.keys(E.properties).length===0){let c=`Event '${E.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(c)}}return E}}import{AsyncLocalStorage as Hf}from"async_hooks";class UF{constructor(){this.storage=new Hf}get(){return this.storage.getStore()}run(D,u,F){if(F?.fresh===!0)return this.storage.run(D,u);{let C=this.get()||{},c={distinctId:D.distinctId??C.distinctId,sessionId:D.sessionId??C.sessionId,properties:{...C.properties||{},...D.properties||{}}};return this.storage.run(c,u)}}}function Wf(D,{organization:u,projectId:F,prefix:E,severityAllowList:C=["error"],sendExceptionsToPostHog:c=!0}={}){return(t)=>{if(!(C==="*"||C.includes(t.level)))return t;if(!t.tags)t.tags={};let i=t.tags[V1.POSTHOG_ID_TAG];if(i===void 0)return t;let f=D.options.host??"https://us.i.posthog.com",B=new URL(`/project/${D.apiKey}/person/${i}`,f).toString();t.tags["PostHog Person URL"]=B;let A=t.exception?.values||[],h=A.map((R)=>({...R,stacktrace:R.stacktrace?{...R.stacktrace,type:"raw",frames:(R.stacktrace.frames||[]).map((X)=>({...X,platform:"node:javascript"}))}:void 0})),w={$exception_message:A[0]?.value||t.message,$exception_type:A[0]?.type,$exception_level:t.level,$exception_list:h,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:A[0]?.value||t.message,$sentry_exception_type:A[0]?.type,$sentry_tags:t.tags};if(u&&F)w.$sentry_url=(E||"https://sentry.io/organizations/")+u+"/issues/?project="+F+"&query="+t.event_id;if(c)D.capture({event:"$exception",distinctId:i,properties:w});return t}}class V1{static#F=this.POSTHOG_ID_TAG="posthog_distinct_id";constructor(D,u,F,E,C){this.name="posthog-node",this.name="posthog-node",this.setupOnce=function(c,t){let n=t()?.getClient()?.getDsn()?.projectId;c(Wf(D,{organization:u,projectId:n,prefix:F,severityAllowList:E,sendExceptionsToPostHog:C??!0}))}}}ED.errorPropertiesBuilder=new x.ErrorPropertiesBuilder([new x.EventCoercer,new x.ErrorCoercer,new x.ObjectCoercer,new x.StringCoercer,new x.PrimitiveCoercer],x.createStackParser("node:javascript",x.nodeStackLineParser),[H3(),m1]);class TF extends NF{getLibraryId(){return"posthog-node"}initializeContext(){return new UF}}var P0=null,Xf=`relic-${Date.now()}-${Math.random().toString(36).slice(2)}`;function j1(D){if(!D.telemetryEnabled||!D.posthogApiKey)return null;if(!P0)P0=new TF(D.posthogApiKey,{host:D.telemetryProxyUrl,flushAt:20,flushInterval:5000});return P0}function k1(D,u,F={}){let E=j1(D);if(!E)return;E.capture({distinctId:Xf,event:u,properties:{...F,platform:process.platform,arch:process.arch,node_version:process.version}})}async function y1(D){let u=j1(D);if(u)await u.shutdown(),P0=null}var zf={debug:4,info:3,warn:2,error:1,off:-1},yD=null,v1=!1,rF=null;function l1(){if(!yD)yD=d2();return yD}function Gf(){if(!rF)rF=zD("event");return rF}async function d1(){if(v1)return;if(yD=d2(),yD.isDev)m3(yD.logFile);process.on("beforeExit",async()=>{if(yD)await y1(yD)}),v1=!0}function zD(D){let u=l1(),F=zf[u.level]??3;if(u.isDev&&!u.isCI){let E=b0({level:F,defaults:{tag:D}});return E.addReporter(o2(u.logFile)),E}return b0({level:F,reporters:[o2(u.logFile)],defaults:{tag:D}})}function Z(D,u={}){let F=l1();k1(F,D,u),Gf().info(`[${D}]`,u)}function lu(D,u,F={}){let E=u instanceof Error?u.message:String(u),C=u instanceof Error?u.stack:void 0;Z("error_occurred",{source:D,message:E,stack:C,...F})}var fC=Q(iC(),1),{program:Gw,createCommand:Mw,createArgument:qw,createOption:Zw,CommanderError:BC,InvalidArgumentError:Jw,InvalidOptionArgumentError:Kw,Command:AC,Argument:Qw,Option:Pw,Help:Vw}=fC.default;var z=Q(mD(),1);var d=Q(MF(),1);import{stdin as OC,stdout as bC}from"process";import*as vD from"readline";import RC from"readline";import{Writable as HB}from"stream";function WB({onlyFirst:D=!1}={}){let u=["[\\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(u,D?void 0:"g")}var XB=WB();function LC(D){if(typeof D!="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(XB,"")}function mC(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var YC={exports:{}};(function(D){var u={};D.exports=u,u.eastAsianWidth=function(E){var C=E.charCodeAt(0),c=E.length==2?E.charCodeAt(1):0,t=C;return 55296<=C&&C<=56319&&56320<=c&&c<=57343&&(C&=1023,c&=1023,t=C<<10|c,t+=65536),t==12288||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":t==8361||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||t==172||t==175||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":t==161||t==164||167<=t&&t<=168||t==170||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||t==198||t==208||215<=t&&t<=216||222<=t&&t<=225||t==230||232<=t&&t<=234||236<=t&&t<=237||t==240||242<=t&&t<=243||247<=t&&t<=250||t==252||t==254||t==257||t==273||t==275||t==283||294<=t&&t<=295||t==299||305<=t&&t<=307||t==312||319<=t&&t<=322||t==324||328<=t&&t<=331||t==333||338<=t&&t<=339||358<=t&&t<=359||t==363||t==462||t==464||t==466||t==468||t==470||t==472||t==474||t==476||t==593||t==609||t==708||t==711||713<=t&&t<=715||t==717||t==720||728<=t&&t<=731||t==733||t==735||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||t==1025||1040<=t&&t<=1103||t==1105||t==8208||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||t==8240||8242<=t&&t<=8243||t==8245||t==8251||t==8254||t==8308||t==8319||8321<=t&&t<=8324||t==8364||t==8451||t==8453||t==8457||t==8467||t==8470||8481<=t&&t<=8482||t==8486||t==8491||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||t==8585||8592<=t&&t<=8601||8632<=t&&t<=8633||t==8658||t==8660||t==8679||t==8704||8706<=t&&t<=8707||8711<=t&&t<=8712||t==8715||t==8719||t==8721||t==8725||t==8730||8733<=t&&t<=8736||t==8739||t==8741||8743<=t&&t<=8748||t==8750||8756<=t&&t<=8759||8764<=t&&t<=8765||t==8776||t==8780||t==8786||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||t==8853||t==8857||t==8869||t==8895||t==8978||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||t==9675||9678<=t&&t<=9681||9698<=t&&t<=9701||t==9711||9733<=t&&t<=9734||t==9737||9742<=t&&t<=9743||9748<=t&&t<=9749||t==9756||t==9758||t==9792||t==9794||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||t==9839||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||t==9955||9960<=t&&t<=9983||t==10045||t==10071||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||t==65533||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},u.characterLength=function(E){var C=this.eastAsianWidth(E);return C=="F"||C=="W"||C=="A"?2:1};function F(E){return E.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(E){for(var C=F(E),c=0,t=0;t<C.length;t++)c=c+this.characterLength(C[t]);return c},u.slice=function(E,C,c){textLen=u.length(E),C=C||0,c=c||1,C<0&&(C=textLen+C),c<0&&(c=textLen+c);for(var t="",n=0,i=F(E),f=0;f<i.length;f++){var B=i[f],A=u.length(B);if(n>=C-(A==2?1:0))if(n+A<=c)t+=B;else break;n+=A}return t}})(YC);var zB=YC.exports,GB=mC(zB),MB=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},qB=mC(MB);function su(D,u={}){if(typeof D!="string"||D.length===0||(u={ambiguousIsNarrow:!0,...u},D=LC(D),D.length===0))return 0;D=D.replace(qB()," ");let F=u.ambiguousIsNarrow?1:2,E=0;for(let C of D){let c=C.codePointAt(0);if(c<=31||c>=127&&c<=159||c>=768&&c<=879)continue;switch(GB.eastAsianWidth(C)){case"F":case"W":E+=2;break;case"A":E+=F;break;default:E+=1}}return E}var qF=10,$C=(D=0)=>(u)=>`\x1B[${u+D}m`,SC=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,IC=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,Y={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(Y.modifier);var ZB=Object.keys(Y.color),JB=Object.keys(Y.bgColor);[...ZB,...JB];function KB(){let D=new Map;for(let[u,F]of Object.entries(Y)){for(let[E,C]of Object.entries(F))Y[E]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[E]=Y[E],D.set(C[0],C[1]);Object.defineProperty(Y,u,{value:F,enumerable:!1})}return Object.defineProperty(Y,"codes",{value:D,enumerable:!1}),Y.color.close="\x1B[39m",Y.bgColor.close="\x1B[49m",Y.color.ansi=$C(),Y.color.ansi256=SC(),Y.color.ansi16m=IC(),Y.bgColor.ansi=$C(qF),Y.bgColor.ansi256=SC(qF),Y.bgColor.ansi16m=IC(qF),Object.defineProperties(Y,{rgbToAnsi256:{value:(u,F,E)=>u===F&&F===E?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5),enumerable:!1},hexToRgb:{value:(u)=>{let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;E.length===3&&(E=[...E].map((c)=>c+c).join(""));let C=Number.parseInt(E,16);return[C>>16&255,C>>8&255,C&255]},enumerable:!1},hexToAnsi256:{value:(u)=>Y.rgbToAnsi256(...Y.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:(u)=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,C;if(u>=232)F=((u-232)*10+8)/255,E=F,C=F;else{u-=16;let n=u%36;F=Math.floor(u/36)/5,E=Math.floor(n/6)/5,C=n%6/5}let c=Math.max(F,E,C)*2;if(c===0)return 30;let t=30+(Math.round(C)<<2|Math.round(E)<<1|Math.round(F));return c===2&&(t+=60),t},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>Y.ansi256ToAnsi(Y.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>Y.ansi256ToAnsi(Y.hexToAnsi256(u)),enumerable:!1}}),Y}var QB=KB(),d0=new Set(["\x1B","\x9B"]),PB=39,KF="\x07",HC="[",VB="]",WC="m",QF=`${VB}8;;`,NC=(D)=>`${d0.values().next().value}${HC}${D}${WC}`,UC=(D)=>`${d0.values().next().value}${QF}${D}${KF}`,jB=(D)=>D.split(" ").map((u)=>su(u)),ZF=(D,u,F)=>{let E=[...u],C=!1,c=!1,t=su(LC(D[D.length-1]));for(let[n,i]of E.entries()){let f=su(i);if(t+f<=F?D[D.length-1]+=i:(D.push(i),t=0),d0.has(i)&&(C=!0,c=E.slice(n+1).join("").startsWith(QF)),C){c?i===KF&&(C=!1,c=!1):i===WC&&(C=!1);continue}t+=f,t===F&&n<E.length-1&&(D.push(""),t=0)}!t&&D[D.length-1].length>0&&D.length>1&&(D[D.length-2]+=D.pop())},kB=(D)=>{let u=D.split(" "),F=u.length;for(;F>0&&!(su(u[F-1])>0);)F--;return F===u.length?D:u.slice(0,F).join(" ")+u.slice(F).join("")},yB=(D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let E="",C,c,t=jB(D),n=[""];for(let[f,B]of D.split(" ").entries()){F.trim!==!1&&(n[n.length-1]=n[n.length-1].trimStart());let A=su(n[n.length-1]);if(f!==0&&(A>=u&&(F.wordWrap===!1||F.trim===!1)&&(n.push(""),A=0),(A>0||F.trim===!1)&&(n[n.length-1]+=" ",A++)),F.hard&&t[f]>u){let h=u-A,w=1+Math.floor((t[f]-h-1)/u);Math.floor((t[f]-1)/u)<w&&n.push(""),ZF(n,B,u);continue}if(A+t[f]>u&&A>0&&t[f]>0){if(F.wordWrap===!1&&A<u){ZF(n,B,u);continue}n.push("")}if(A+t[f]>u&&F.wordWrap===!1){ZF(n,B,u);continue}n[n.length-1]+=B}F.trim!==!1&&(n=n.map((f)=>kB(f)));let i=[...n.join(`
|
|
103
|
+
`)];for(let[f,B]of i.entries()){if(E+=B,d0.has(B)){let{groups:h}=new RegExp(`(?:\\${HC}(?<code>\\d+)m|\\${QF}(?<uri>.*)${KF})`).exec(i.slice(f).join(""))||{groups:{}};if(h.code!==void 0){let w=Number.parseFloat(h.code);C=w===PB?void 0:w}else h.uri!==void 0&&(c=h.uri.length===0?void 0:h.uri)}let A=QB.codes.get(Number(C));i[f+1]===`
|
|
104
|
+
`?(c&&(E+=UC("")),C&&A&&(E+=NC(A))):B===`
|
|
105
|
+
`&&(C&&A&&(E+=NC(C)),c&&(E+=UC(c)))}return E};function TC(D,u,F){return String(D).normalize().replace(/\r\n/g,`
|
|
106
|
+
`).split(`
|
|
107
|
+
`).map((E)=>yB(E,u,F)).join(`
|
|
108
|
+
`)}var vB=["up","down","left","right","space","enter","cancel"],l0={actions:new Set(vB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function PF(D,u){if(typeof D=="string")return l0.aliases.get(D)===u;for(let F of D)if(F!==void 0&&PF(F,u))return!0;return!1}function lB(D,u){if(D===u)return;let F=D.split(`
|
|
109
|
+
`),E=u.split(`
|
|
110
|
+
`),C=[];for(let c=0;c<Math.max(F.length,E.length);c++)F[c]!==E[c]&&C.push(c);return C}var dB=globalThis.process.platform.startsWith("win"),JF=Symbol("clack:cancel");function s0(D){return D===JF}function v0(D,u){let F=D;F.isTTY&&F.setRawMode(u)}function XC({input:D=OC,output:u=bC,overwrite:F=!0,hideCursor:E=!0}={}){let C=vD.createInterface({input:D,output:u,prompt:"",tabSize:1});vD.emitKeypressEvents(D,C),D.isTTY&&D.setRawMode(!0);let c=(t,{name:n,sequence:i})=>{let f=String(t);if(PF([f,n,i],"cancel")){E&&u.write(d.cursor.show),process.exit(0);return}if(!F)return;vD.moveCursor(u,n==="return"?0:-1,n==="return"?-1:0,()=>{vD.clearLine(u,1,()=>{D.once("keypress",c)})})};return E&&u.write(d.cursor.hide),D.once("keypress",c),()=>{D.off("keypress",c),E&&u.write(d.cursor.show),D.isTTY&&!dB&&D.setRawMode(!1),C.terminal=!1,C.close()}}var sB=Object.defineProperty,gB=(D,u,F)=>(u in D)?sB(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,FD=(D,u,F)=>(gB(D,typeof u!="symbol"?u+"":u,F),F);class zC{constructor(D,u=!0){FD(this,"input"),FD(this,"output"),FD(this,"_abortSignal"),FD(this,"rl"),FD(this,"opts"),FD(this,"_render"),FD(this,"_track",!1),FD(this,"_prevFrame",""),FD(this,"_subscribers",new Map),FD(this,"_cursor",0),FD(this,"state","initial"),FD(this,"error",""),FD(this,"value");let{input:F=OC,output:E=bC,render:C,signal:c,...t}=D;this.opts=t,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=C.bind(this),this._track=u,this._abortSignal=c,this.input=F,this.output=E}unsubscribe(){this._subscribers.clear()}setSubscriber(D,u){let F=this._subscribers.get(D)??[];F.push(u),this._subscribers.set(D,F)}on(D,u){this.setSubscriber(D,{cb:u})}once(D,u){this.setSubscriber(D,{cb:u,once:!0})}emit(D,...u){let F=this._subscribers.get(D)??[],E=[];for(let C of F)C.cb(...u),C.once&&E.push(()=>F.splice(F.indexOf(C),1));for(let C of E)C()}prompt(){return new Promise((D,u)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(JF);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let F=new HB;F._write=(E,C,c)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),c()},this.input.pipe(F),this.rl=RC.createInterface({input:this.input,output:F,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),RC.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),v0(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(d.cursor.show),this.output.off("resize",this.render),v0(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(d.cursor.show),this.output.off("resize",this.render),v0(this.input,!1),D(JF)})})}onKeypress(D,u){if(this.state==="error"&&(this.state="active"),u?.name&&(!this._track&&l0.aliases.has(u.name)&&this.emit("cursor",l0.aliases.get(u.name)),l0.actions.has(u.name)&&this.emit("cursor",u.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),D&&this.emit("key",D.toLowerCase()),u?.name==="return"){if(this.opts.validate){let F=this.opts.validate(this.value);F&&(this.error=F instanceof Error?F.message:F,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}PF([D,u?.name,u?.sequence],"cancel")&&(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(`
|
|
111
|
+
`),v0(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let D=TC(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
112
|
+
`).length-1;this.output.write(d.cursor.move(-999,D*-1))}render(){let D=TC(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(d.cursor.hide);else{let u=lB(this._prevFrame,D);if(this.restoreCursor(),u&&u?.length===1){let F=u[0];this.output.write(d.cursor.move(0,F)),this.output.write(d.erase.lines(1));let E=D.split(`
|
|
113
|
+
`);this.output.write(E[F]),this._prevFrame=D,this.output.write(d.cursor.move(0,E.length-F-1));return}if(u&&u?.length>1){let F=u[0];this.output.write(d.cursor.move(0,F)),this.output.write(d.erase.down());let E=D.split(`
|
|
114
|
+
`).slice(F);this.output.write(E.join(`
|
|
115
|
+
`)),this._prevFrame=D;return}this.output.write(d.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}var eB;eB=new WeakMap;var oB=Object.defineProperty,xB=(D,u,F)=>(u in D)?oB(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,rC=(D,u,F)=>(xB(D,typeof u!="symbol"?u+"":u,F),F);class VF extends zC{constructor(D){super(D,!1),rC(this,"options"),rC(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:u})=>u===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(u)=>{switch(u){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 I=Q(mD(),1),g0=Q(MF(),1);import wD from"process";function aB(){return wD.platform!=="win32"?wD.env.TERM!=="linux":!!wD.env.CI||!!wD.env.WT_SESSION||!!wD.env.TERMINUS_SUBLIME||wD.env.ConEmuTask==="{cmd::Cmder}"||wD.env.TERM_PROGRAM==="Terminus-Sublime"||wD.env.TERM_PROGRAM==="vscode"||wD.env.TERM==="xterm-256color"||wD.env.TERM==="alacritty"||wD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var jF=aB(),G=(D,u)=>jF?D:u,pB=G("\u25C6","*"),GC=G("\u25A0","x"),MC=G("\u25B2","x"),kF=G("\u25C7","o"),D9=G("\u250C","T"),CD=G("\u2502","|"),yF=G("\u2514","\u2014"),u9=G("\u25CF",">"),F9=G("\u25CB"," "),tR=G("\u25FB","[\u2022]"),ER=G("\u25FC","[+]"),CR=G("\u25FB","[ ]"),cR=G("\u25AA","\u2022"),nR=G("\u2500","-"),iR=G("\u256E","+"),fR=G("\u251C","+"),BR=G("\u256F","+"),t9=G("\u25CF","\u2022"),E9=G("\u25C6","*"),C9=G("\u25B2","!"),c9=G("\u25A0","x"),n9=(D)=>{switch(D){case"initial":case"active":return I.default.cyan(pB);case"cancel":return I.default.red(GC);case"error":return I.default.yellow(MC);case"submit":return I.default.green(kF)}},i9=(D)=>{let{cursor:u,options:F,style:E}=D,C=D.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),t=Math.min(c,Math.max(C,5)),n=0;u>=n+t-3?n=Math.max(Math.min(u-t+3,F.length-t),0):u<n+2&&(n=Math.max(u-2,0));let i=t<F.length&&n>0,f=t<F.length&&n+t<F.length;return F.slice(n,n+t).map((B,A,h)=>{let w=A===0&&i,R=A===h.length-1&&f;return w||R?I.default.dim("..."):E(B,A+n===u)})};var qC=(D)=>{let u=(F,E)=>{let C=F.label??String(F.value);switch(E){case"selected":return`${I.default.dim(C)}`;case"active":return`${I.default.green(u9)} ${C} ${F.hint?I.default.dim(`(${F.hint})`):""}`;case"cancelled":return`${I.default.strikethrough(I.default.dim(C))}`;default:return`${I.default.dim(F9)} ${I.default.dim(C)}`}};return new VF({options:D.options,initialValue:D.initialValue,render(){let F=`${I.default.gray(CD)}
|
|
116
|
+
${n9(this.state)} ${D.message}
|
|
117
|
+
`;switch(this.state){case"submit":return`${F}${I.default.gray(CD)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${F}${I.default.gray(CD)} ${u(this.options[this.cursor],"cancelled")}
|
|
118
|
+
${I.default.gray(CD)}`;default:return`${F}${I.default.cyan(CD)} ${i9({cursor:this.cursor,options:this.options,maxItems:D.maxItems,style:(E,C)=>u(E,C?"active":"inactive")}).join(`
|
|
119
|
+
${I.default.cyan(CD)} `)}
|
|
120
|
+
${I.default.cyan(yF)}
|
|
121
|
+
`}}}).prompt()};var ZC=(D="")=>{process.stdout.write(`${I.default.gray(yF)} ${I.default.red(D)}
|
|
122
|
+
|
|
123
|
+
`)},JC=(D="")=>{process.stdout.write(`${I.default.gray(D9)} ${D}
|
|
124
|
+
`)},gu=(D="")=>{process.stdout.write(`${I.default.gray(CD)}
|
|
125
|
+
${I.default.gray(yF)} ${D}
|
|
126
|
+
|
|
127
|
+
`)},a={message:(D="",{symbol:u=I.default.gray(CD)}={})=>{let F=[`${I.default.gray(CD)}`];if(D){let[E,...C]=D.split(`
|
|
128
|
+
`);F.push(`${u} ${E}`,...C.map((c)=>`${I.default.gray(CD)} ${c}`))}process.stdout.write(`${F.join(`
|
|
129
|
+
`)}
|
|
130
|
+
`)},info:(D)=>{a.message(D,{symbol:I.default.blue(t9)})},success:(D)=>{a.message(D,{symbol:I.default.green(E9)})},step:(D)=>{a.message(D,{symbol:I.default.green(kF)})},warn:(D)=>{a.message(D,{symbol:I.default.yellow(C9)})},warning:(D)=>{a.warn(D)},error:(D)=>{a.message(D,{symbol:I.default.red(c9)})}},AR=`${I.default.gray(CD)} `;var KC=({indicator:D="dots"}={})=>{let u=jF?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],F=jF?80:120,E=process.env.CI==="true",C,c,t=!1,n="",i,f=performance.now(),B=(N)=>{let U=N>1?"Something went wrong":"Canceled";t&&qu(U,N)},A=()=>B(2),h=()=>B(1),w=()=>{process.on("uncaughtExceptionMonitor",A),process.on("unhandledRejection",A),process.on("SIGINT",h),process.on("SIGTERM",h),process.on("exit",B)},R=()=>{process.removeListener("uncaughtExceptionMonitor",A),process.removeListener("unhandledRejection",A),process.removeListener("SIGINT",h),process.removeListener("SIGTERM",h),process.removeListener("exit",B)},X=()=>{if(i===void 0)return;E&&process.stdout.write(`
|
|
131
|
+
`);let N=i.split(`
|
|
132
|
+
`);process.stdout.write(g0.cursor.move(-999,N.length-1)),process.stdout.write(g0.erase.down(N.length))},K=(N)=>N.replace(/\.+$/,""),fD=(N)=>{let U=(performance.now()-N)/1000,b=Math.floor(U/60),UD=Math.floor(U%60);return b>0?`[${b}m ${UD}s]`:`[${UD}s]`},PD=(N="")=>{t=!0,C=XC(),n=K(N),f=performance.now(),process.stdout.write(`${I.default.gray(CD)}
|
|
133
|
+
`);let U=0,b=0;w(),c=setInterval(()=>{if(E&&n===i)return;X(),i=n;let UD=I.default.magenta(u[U]);if(E)process.stdout.write(`${UD} ${n}...`);else if(D==="timer")process.stdout.write(`${UD} ${n} ${fD(f)}`);else{let nn=".".repeat(Math.floor(b)).slice(0,3);process.stdout.write(`${UD} ${n}${nn}`)}U=U+1<u.length?U+1:0,b=b<u.length?b+0.125:0},F)},qu=(N="",U=0)=>{t=!1,clearInterval(c),X();let b=U===0?I.default.green(kF):U===1?I.default.red(GC):I.default.red(MC);n=K(N??n),D==="timer"?process.stdout.write(`${b} ${n} ${fD(f)}
|
|
134
|
+
`):process.stdout.write(`${b} ${n}
|
|
135
|
+
`),R(),C()};return{start:PD,stop:qu,message:(N="")=>{n=K(N??n)}}};var YD=[],cD=[],B9=Uint8Array,vF="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(lD=0,lF=vF.length;lD<lF;++lD)YD[lD]=vF[lD],cD[vF.charCodeAt(lD)]=lD;var lD,lF;cD[45]=62;cD[95]=63;function A9(D){var u=D.length;if(u%4>0)throw Error("Invalid string. Length must be a multiple of 4");var F=D.indexOf("=");if(F===-1)F=u;var E=F===u?0:4-F%4;return[F,E]}function h9(D,u,F){return(u+F)*3/4-F}function eu(D){var u,F=A9(D),E=F[0],C=F[1],c=new B9(h9(D,E,C)),t=0,n=C>0?E-4:E,i;for(i=0;i<n;i+=4)u=cD[D.charCodeAt(i)]<<18|cD[D.charCodeAt(i+1)]<<12|cD[D.charCodeAt(i+2)]<<6|cD[D.charCodeAt(i+3)],c[t++]=u>>16&255,c[t++]=u>>8&255,c[t++]=u&255;if(C===2)u=cD[D.charCodeAt(i)]<<2|cD[D.charCodeAt(i+1)]>>4,c[t++]=u&255;if(C===1)u=cD[D.charCodeAt(i)]<<10|cD[D.charCodeAt(i+1)]<<4|cD[D.charCodeAt(i+2)]>>2,c[t++]=u>>8&255,c[t++]=u&255;return c}function _9(D){return YD[D>>18&63]+YD[D>>12&63]+YD[D>>6&63]+YD[D&63]}function w9(D,u,F){var E,C=[];for(var c=u;c<F;c+=3)E=(D[c]<<16&16711680)+(D[c+1]<<8&65280)+(D[c+2]&255),C.push(_9(E));return C.join("")}function ou(D){var u,F=D.length,E=F%3,C=[],c=16383;for(var t=0,n=F-E;t<n;t+=c)C.push(w9(D,t,t+c>n?n:t+c));if(E===1)u=D[F-1],C.push(YD[u>>2]+YD[u<<4&63]+"==");else if(E===2)u=(D[F-2]<<8)+D[F-1],C.push(YD[u>>10]+YD[u>>4&63]+YD[u<<2&63]+"=");return C.join("")}function _u(D){if(D===void 0)return{};if(!dF(D))throw Error(`The arguments to a Convex function must be an object. Received: ${D}`);return D}function QC(D){if(typeof D>"u")throw Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof D!=="string")throw Error(`Invalid deployment address: found ${D}".`);if(!(D.startsWith("http:")||D.startsWith("https:")))throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${D}".`);try{new URL(D)}catch{throw Error(`Invalid deployment address: "${D}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(D.endsWith(".convex.site"))throw Error(`Invalid deployment address: "${D}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function dF(D){let u=typeof D==="object",F=Object.getPrototypeOf(D),E=F===null||F===Object.prototype||F?.constructor?.name==="Object";return u&&E}var jC=!0,wu=BigInt("-9223372036854775808"),oF=BigInt("9223372036854775807"),gF=BigInt("0"),$9=BigInt("8"),S9=BigInt("256");function kC(D){return Number.isNaN(D)||!Number.isFinite(D)||Object.is(D,-0)}function I9(D){if(D<gF)D-=wu+wu;let u=D.toString(16);if(u.length%2===1)u="0"+u;let F=new Uint8Array(new ArrayBuffer(8)),E=0;for(let C of u.match(/.{2}/g).reverse())F.set([parseInt(C,16)],E++),D>>=$9;return ou(F)}function N9(D){let u=eu(D);if(u.byteLength!==8)throw Error(`Received ${u.byteLength} bytes, expected 8 for $integer`);let F=gF,E=gF;for(let C of u)F+=BigInt(C)*S9**E,E++;if(F>oF)F+=wu+wu;return F}function U9(D){if(D<wu||oF<D)throw Error(`BigInt ${D} does not fit into a 64-bit signed integer.`);let u=new ArrayBuffer(8);return new DataView(u).setBigInt64(0,D,!0),ou(new Uint8Array(u))}function T9(D){let u=eu(D);if(u.byteLength!==8)throw Error(`Received ${u.byteLength} bytes, expected 8 for $integer`);return new DataView(u.buffer).getBigInt64(0,!0)}var r9=DataView.prototype.setBigInt64?U9:I9,O9=DataView.prototype.getBigInt64?T9:N9,PC=1024;function eF(D){if(D.length>PC)throw Error(`Field name ${D} exceeds maximum field name length ${PC}.`);if(D.startsWith("$"))throw Error(`Field name ${D} starts with a '$', which is reserved.`);for(let u=0;u<D.length;u+=1){let F=D.charCodeAt(u);if(F<32||F>=127)throw Error(`Field name ${D} has invalid character '${D[u]}': Field names can only contain non-control ASCII characters`)}}function MD(D){if(D===null)return D;if(typeof D==="boolean")return D;if(typeof D==="number")return D;if(typeof D==="string")return D;if(Array.isArray(D))return D.map((E)=>MD(E));if(typeof D!=="object")throw Error(`Unexpected type of ${D}`);let u=Object.entries(D);if(u.length===1){let E=u[0][0];if(E==="$bytes"){if(typeof D.$bytes!=="string")throw Error(`Malformed $bytes field on ${D}`);return eu(D.$bytes).buffer}if(E==="$integer"){if(typeof D.$integer!=="string")throw Error(`Malformed $integer field on ${D}`);return O9(D.$integer)}if(E==="$float"){if(typeof D.$float!=="string")throw Error(`Malformed $float field on ${D}`);let C=eu(D.$float);if(C.byteLength!==8)throw Error(`Received ${C.byteLength} bytes, expected 8 for $float`);let t=new DataView(C.buffer).getFloat64(0,jC);if(!kC(t))throw Error(`Float ${t} should be encoded as a number`);return t}if(E==="$set")throw Error("Received a Set which is no longer supported as a Convex type.");if(E==="$map")throw Error("Received a Map which is no longer supported as a Convex type.")}let F={};for(let[E,C]of Object.entries(D))eF(E),F[E]=MD(C);return F}var VC=16384;function Du(D){let u=JSON.stringify(D,(F,E)=>{if(E===void 0)return"undefined";if(typeof E==="bigint")return`${E.toString()}n`;return E});if(u.length>VC){let E=VC-14,C=u.codePointAt(E-1);if(C!==void 0&&C>65535)E-=1;return u.substring(0,E)+"[...truncated]"}return u}function e0(D,u,F,E){if(D===void 0){let t=F&&` (present at path ${F} in original object ${Du(u)})`;throw Error(`undefined is not a valid Convex value${t}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(D===null)return D;if(typeof D==="bigint"){if(D<wu||oF<D)throw Error(`BigInt ${D} does not fit into a 64-bit signed integer.`);return{$integer:r9(D)}}if(typeof D==="number")if(kC(D)){let t=new ArrayBuffer(8);return new DataView(t).setFloat64(0,D,jC),{$float:ou(new Uint8Array(t))}}else return D;if(typeof D==="boolean")return D;if(typeof D==="string")return D;if(D instanceof ArrayBuffer)return{$bytes:ou(new Uint8Array(D))};if(Array.isArray(D))return D.map((t,n)=>e0(t,u,F+`[${n}]`,!1));if(D instanceof Set)throw Error(sF(F,"Set",[...D],u));if(D instanceof Map)throw Error(sF(F,"Map",[...D],u));if(!dF(D)){let t=D?.constructor?.name,n=t?`${t} `:"";throw Error(sF(F,n,D,u))}let C={},c=Object.entries(D);c.sort(([t,n],[i,f])=>t===i?0:t<i?-1:1);for(let[t,n]of c)if(n!==void 0)eF(t),C[t]=e0(n,u,F+`.${t}`,!1);else if(E)eF(t),C[t]=b9(n,u,F+`.${t}`);return C}function sF(D,u,F,E){if(D)return`${u}${Du(F)} is not a supported Convex type (present at path ${D} in original object ${Du(E)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`;else return`${u}${Du(F)} is not a supported Convex type.`}function b9(D,u,F){if(D===void 0)return{$undefined:null};else{if(u===void 0)throw Error(`Programming error. Current value is ${Du(D)} but original value is undefined`);return e0(D,u,F,!1)}}function Ru(D){return e0(D,D,"",!1)}var L9=Object.defineProperty,m9=(D,u,F)=>(u in D)?L9(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,xF=(D,u,F)=>m9(D,typeof u!=="symbol"?u+"":u,F),yC,vC,Y9=Symbol.for("ConvexError");class $u extends(vC=Error,yC=Y9,vC){constructor(D){super(typeof D==="string"?D:Du(D));xF(this,"name","ConvexError"),xF(this,"data"),xF(this,yC,!0),this.data=D}}var Su="1.29.0";var Iu=Symbol.for("functionName");var aF=Symbol.for("toReferencePath");function H9(D){return D[aF]??null}function W9(D){return D.startsWith("function://")}function pF(D){let u;if(typeof D==="string")if(W9(D))u={functionHandle:D};else u={name:D};else if(D[Iu])u={name:D[Iu]};else{let F=H9(D);if(!F)throw Error(`${D} is not a functionReference`);u={reference:F}}return u}function Nu(D){let u=pF(D);if(u.name===void 0){if(u.functionHandle!==void 0)throw Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${u.functionHandle}`);else if(u.reference!==void 0)throw Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${u.reference}`);throw Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(u)}`)}if(typeof D==="string")return D;let F=D[Iu];if(!F)throw Error(`${D} is not a functionReference`);return F}function lC(D=[]){return new Proxy({},{get(F,E){if(typeof E==="string"){let C=[...D,E];return lC(C)}else if(E===Iu){if(D.length<2){let t=["api",...D].join(".");throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``)}let C=D.slice(0,-1).join("/"),c=D[D.length-1];if(c==="default")return C;else return C+":"+c}else if(E===Symbol.toStringTag)return"FunctionReference";else return}})}var Dt=lC();function dC(D,u){return new Proxy({},{get(E,C){if(typeof C==="string"){let c=[...u,C];return dC(D,c)}else if(C===aF){if(u.length<1){let c=[D,...u].join(".");throw Error(`API path is expected to be of the form \`${D}.childComponent.functionName\`. Found: \`${c}\``)}return"_reference/childComponent/"+u.join("/")}else return}})}var ut=()=>dC("components",[]);var s=Dt;var X9=ut();var Ft;((F)=>{F.SecretsRead="secrets.read";F.UserKeysRead="user.keys.read"})(Ft||={});var lR=Object.values(Ft);var z9=Object.defineProperty,G9=(D,u,F)=>(u in D)?z9(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,sC=(D,u,F)=>G9(D,typeof u!=="symbol"?u+"":u,F),M9="color:rgb(0, 145, 255)";function q9(D){switch(D){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class tt{constructor(D){sC(this,"_onLogLineFuncs"),sC(this,"_verbose"),this._onLogLineFuncs={},this._verbose=D.verbose}addLogLineListener(D){let u=Math.random().toString(36).substring(2,15);for(let F=0;F<10;F++){if(this._onLogLineFuncs[u]===void 0)break;u=Math.random().toString(36).substring(2,15)}return this._onLogLineFuncs[u]=D,()=>{delete this._onLogLineFuncs[u]}}logVerbose(...D){if(this._verbose)for(let u of Object.values(this._onLogLineFuncs))u("debug",`${new Date().toISOString()}`,...D)}log(...D){for(let u of Object.values(this._onLogLineFuncs))u("info",...D)}warn(...D){for(let u of Object.values(this._onLogLineFuncs))u("warn",...D)}error(...D){for(let u of Object.values(this._onLogLineFuncs))u("error",...D)}}function gC(D){let u=new tt(D);return u.addLogLineListener((F,...E)=>{switch(F){case"debug":console.debug(...E);break;case"info":console.log(...E);break;case"warn":console.warn(...E);break;case"error":console.error(...E);break;default:console.log(...E)}}),u}function eC(D){return new tt(D)}function xu(D,u,F,E,C){let c=q9(F);if(typeof C==="object")C=`ConvexError ${JSON.stringify(C.errorData,null,2)}`;if(u==="info"){let t=C.match(/^\[.*?\] /);if(t===null){D.error(`[CONVEX ${c}(${E})] Could not parse console.log`);return}let n=C.slice(1,t[0].length-2),i=C.slice(t[0].length);D.log(`%c[CONVEX ${c}(${E})] [${n}]`,M9,i)}else D.error(`[CONVEX ${c}(${E})] ${C}`)}var Z9=Object.defineProperty,J9=(D,u,F)=>(u in D)?Z9(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,qD=(D,u,F)=>J9(D,typeof u!=="symbol"?u+"":u,F);var o0=560,au=void 0;class Uu{constructor(D,u){if(qD(this,"address"),qD(this,"auth"),qD(this,"adminAuth"),qD(this,"encodedTsPromise"),qD(this,"debug"),qD(this,"fetchOptions"),qD(this,"logger"),qD(this,"mutationQueue",[]),qD(this,"isProcessingQueue",!1),typeof u==="boolean")throw Error("skipConvexDeploymentUrlCheck as the second argument is no longer supported. Please pass an options object, `{ skipConvexDeploymentUrlCheck: true }`.");if((u??{}).skipConvexDeploymentUrlCheck!==!0)QC(D);if(this.logger=u?.logger===!1?eC({verbose:!1}):u?.logger!==!0&&u?.logger?u.logger:gC({verbose:!1}),this.address=D,this.debug=!0,this.auth=void 0,this.adminAuth=void 0,u?.auth)this.setAuth(u.auth)}backendUrl(){return`${this.address}/api`}get url(){return this.address}setAuth(D){this.clearAuth(),this.auth=D}setAdminAuth(D,u){if(this.clearAuth(),u!==void 0){let F=new TextEncoder().encode(JSON.stringify(u)),E=btoa(String.fromCodePoint(...F));this.adminAuth=`${D}:${E}`}else this.adminAuth=D}clearAuth(){this.auth=void 0,this.adminAuth=void 0}setDebug(D){this.debug=D}setFetchOptions(D){this.fetchOptions=D}async consistentQuery(D,...u){let F=_u(u[0]),E=this.getTimestamp();return await this.queryInner(D,F,{timestampPromise:E})}async getTimestamp(){if(this.encodedTsPromise)return this.encodedTsPromise;return this.encodedTsPromise=this.getTimestampInner()}async getTimestampInner(){let D=au||fetch,u={"Content-Type":"application/json","Convex-Client":`npm-${Su}`},F=await D(`${this.address}/api/query_ts`,{...this.fetchOptions,method:"POST",headers:u});if(!F.ok)throw Error(await F.text());let{ts:E}=await F.json();return E}async query(D,...u){let F=_u(u[0]);return await this.queryInner(D,F,{})}async queryInner(D,u,F){let E=Nu(D),C=[Ru(u)],c={"Content-Type":"application/json","Convex-Client":`npm-${Su}`};if(this.adminAuth)c.Authorization=`Convex ${this.adminAuth}`;else if(this.auth)c.Authorization=`Bearer ${this.auth}`;let t=au||fetch,n=F.timestampPromise?await F.timestampPromise:void 0,i=JSON.stringify({path:E,format:"convex_encoded_json",args:C,...n?{ts:n}:{}}),f=n?`${this.address}/api/query_at_ts`:`${this.address}/api/query`,B=await t(f,{...this.fetchOptions,body:i,method:"POST",headers:c});if(!B.ok&&B.status!==o0)throw Error(await B.text());let A=await B.json();if(this.debug)for(let h of A.logLines??[])xu(this.logger,"info","query",E,h);switch(A.status){case"success":return MD(A.value);case"error":if(A.errorData!==void 0)throw x0(A.errorData,new $u(A.errorMessage));throw Error(A.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(A)}`)}}async mutationInner(D,u){let F=Nu(D),E=JSON.stringify({path:F,format:"convex_encoded_json",args:[Ru(u)]}),C={"Content-Type":"application/json","Convex-Client":`npm-${Su}`};if(this.adminAuth)C.Authorization=`Convex ${this.adminAuth}`;else if(this.auth)C.Authorization=`Bearer ${this.auth}`;let t=await(au||fetch)(`${this.address}/api/mutation`,{...this.fetchOptions,body:E,method:"POST",headers:C});if(!t.ok&&t.status!==o0)throw Error(await t.text());let n=await t.json();if(this.debug)for(let i of n.logLines??[])xu(this.logger,"info","mutation",F,i);switch(n.status){case"success":return MD(n.value);case"error":if(n.errorData!==void 0)throw x0(n.errorData,new $u(n.errorMessage));throw Error(n.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(n)}`)}}async processMutationQueue(){if(this.isProcessingQueue)return;this.isProcessingQueue=!0;while(this.mutationQueue.length>0){let{mutation:D,args:u,resolve:F,reject:E}=this.mutationQueue.shift();try{let C=await this.mutationInner(D,u);F(C)}catch(C){E(C)}}this.isProcessingQueue=!1}enqueueMutation(D,u){return new Promise((F,E)=>{this.mutationQueue.push({mutation:D,args:u,resolve:F,reject:E}),this.processMutationQueue()})}async mutation(D,...u){let[F,E]=u,C=_u(F);if(!E?.skipQueue)return await this.enqueueMutation(D,C);else return await this.mutationInner(D,C)}async action(D,...u){let F=_u(u[0]),E=Nu(D),C=JSON.stringify({path:E,format:"convex_encoded_json",args:[Ru(F)]}),c={"Content-Type":"application/json","Convex-Client":`npm-${Su}`};if(this.adminAuth)c.Authorization=`Convex ${this.adminAuth}`;else if(this.auth)c.Authorization=`Bearer ${this.auth}`;let n=await(au||fetch)(`${this.address}/api/action`,{...this.fetchOptions,body:C,method:"POST",headers:c});if(!n.ok&&n.status!==o0)throw Error(await n.text());let i=await n.json();if(this.debug)for(let f of i.logLines??[])xu(this.logger,"info","action",E,f);switch(i.status){case"success":return MD(i.value);case"error":if(i.errorData!==void 0)throw x0(i.errorData,new $u(i.errorMessage));throw Error(i.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(i)}`)}}async function(D,u,...F){let E=_u(F[0]),C=typeof D==="string"?D:Nu(D),c=JSON.stringify({componentPath:u,path:C,format:"convex_encoded_json",args:Ru(E)}),t={"Content-Type":"application/json","Convex-Client":`npm-${Su}`};if(this.adminAuth)t.Authorization=`Convex ${this.adminAuth}`;else if(this.auth)t.Authorization=`Bearer ${this.auth}`;let i=await(au||fetch)(`${this.address}/api/function`,{...this.fetchOptions,body:c,method:"POST",headers:t});if(!i.ok&&i.status!==o0)throw Error(await i.text());let f=await i.json();if(this.debug)for(let B of f.logLines??[])xu(this.logger,"info","any",C,B);switch(f.status){case"success":return MD(f.value);case"error":if(f.errorData!==void 0)throw x0(f.errorData,new $u(f.errorMessage));throw Error(f.errorMessage);default:throw Error(`Invalid response: ${JSON.stringify(f)}`)}}}function x0(D,u){return u.data=MD(D),u}var Et=process.env.DEV==="true",pu=process.env.CONVEX_URL??(Et?"http://localhost:3210":"https://strong-viper-562.convex.cloud"),a0=process.env.CONVEX_SITE_URL??(Et?"http://localhost:3211":"https://strong-viper-562.convex.site"),Ct=process.env.SITE_URL??(Et?"http://localhost:3000":"https://relic.so");function K9(){return new Uu(pu)}class ct{client;constructor(){this.client=K9()}async requestDeviceCode(D={}){return this.client.mutation(s.deviceAuth.requestDeviceCode,{...D})}async pollDeviceToken(D){return this.client.mutation(s.deviceAuth.pollDeviceToken,{...D})}}var p0=new ct;import{chmod as Q9,mkdir as P9,unlink as V9,watch as R$}from"fs/promises";import{resolve as nt}from"path";var oC=process.env.HOME||process.env.USERPROFILE||"~",it=process.platform==="win32"?nt(oC,"AppData","Roaming","relic"):nt(oC,".config","relic"),D2=nt(it,"session.json");async function j9(){try{if(await P9(it,{recursive:!0,mode:448}),process.platform!=="win32")await Q9(it,448)}catch(D){}}async function u2(D){await j9();let u=JSON.stringify(D,null,2);await Bun.write(D2,u)}async function ft(){try{let D=Bun.file(D2);if(!await D.exists())return null;return await D.json()}catch{return null}}async function F2(){try{if(await Bun.file(D2).exists())await V9(D2)}catch(D){}}async function Bt(D,u){let F=await ft();if(F)F.jwtToken=D,F.jwtExpiresAt=u,await u2(F)}async function g(){let D=await ft();if(!D)return{isValid:!1,isExpired:!1,session:null};let u=Date.now();if(D.expiresAt<u)return await F2(),{isValid:!1,isExpired:!0,session:null};return{isValid:!0,isExpired:!1,session:D}}async function At(){let{session:D}=await g();return D?.sessionToken??null}async function ht(){let{session:D}=await g();if(!D?.jwtToken||!D?.jwtExpiresAt)return null;let u=Date.now(),F=60000;if(D.jwtExpiresAt-F<u)return null;return D.jwtToken}function t2(D){return typeof D==="object"&&D!==null&&"data"in D}function _t(D){if(t2(D)&&D.data?.code==="AUTHORIZATION_PENDING")return!0;if(D instanceof Error&&D.message.includes("AUTHORIZATION_PENDING"))return!0;return!1}function wt(D){if(t2(D)&&D.data?.code==="DEVICE_AUTH_DENIED")return!0;if(D instanceof Error&&D.message.includes("DEVICE_AUTH_DENIED"))return!0;return!1}function Rt(D){if(t2(D)&&D.data?.code==="DEVICE_CODE_EXPIRED")return!0;if(D instanceof Error&&D.message.includes("DEVICE_CODE_EXPIRED"))return!0;return!1}async function m7(D){await(await Promise.resolve().then(() => (Zt(),qt))).default(D)}class Jt{pollingInterval=5000;isPolling=!1;abortController=null;openUrl;constructor(D={}){this.openUrl=D.openUrl??m7}async requestDeviceCode(){return p0.requestDeviceCode()}async pollForToken(D,u){this.isPolling=!0,this.abortController=new AbortController;try{while(this.isPolling){if(this.abortController.signal.aborted)throw Error("Polling aborted");try{let F=await p0.pollDeviceToken({device_code:D}),E=Date.now()+F.expires_in*1000;return await u2({sessionToken:F.session_token,tokenType:F.token_type,expiresAt:E}),u?.onStatusChange?.("approved"),u?.onSuccess?.(F),this.isPolling=!1,{success:!0,token:F}}catch(F){if(_t(F)){u?.onStatusChange?.("pending"),await this.sleep(this.pollingInterval);continue}if(wt(F)){u?.onStatusChange?.("denied"),this.isPolling=!1;let C=Error("Authorization denied by user");return u?.onError?.(C),{success:!1,error:C}}if(Rt(F)){u?.onStatusChange?.("expired"),this.isPolling=!1;let C=Error("Device code expired");return u?.onError?.(C),{success:!1,error:C}}this.isPolling=!1,u?.onStatusChange?.("error");let E=F instanceof Error?F:Error("Unknown error");return u?.onError?.(E),{success:!1,error:E}}}return{success:!1,error:Error("Polling stopped")}}finally{this.isPolling=!1,this.abortController=null}}async startAuth(D){try{let u=await this.requestDeviceCode();return this.pollingInterval=(u.interval||5)*1000,D?.onCodeReceived?.(u),D?.onStatusChange?.("pending"),setTimeout(()=>{this.openUrl(u.verification_uri_complete)},500),await this.pollForToken(u.device_code,D)}catch(u){let F=u instanceof Error?u:Error("Failed to start auth");return D?.onError?.(F),D?.onStatusChange?.("error"),{success:!1,error:F}}}stopPolling(){this.isPolling=!1,this.abortController?.abort()}sleep(D){return new Promise((u)=>setTimeout(u,D))}}var Kt=new Jt;class Ou extends Error{name="AuthenticationError";constructor(D){super(D);Object.setPrototypeOf(this,Ou.prototype)}}class t0 extends Ou{name="InvalidJwtError";constructor(D="No valid JWT token"){super(D);Object.setPrototypeOf(this,t0.prototype)}}var Y7=900,H7=5000,W7=30000,X7=3,z7=60000,J={lastFailureTime:null,consecutiveFailures:0,backoffMs:1000,circuitOpen:!1,circuitOpenTime:null},G7={debug:()=>{return},info:()=>{return},warn:()=>{return},error:()=>{return}},n2=G7;async function r8(D){let u=`${Ct}/api/auth/convex/token`,F=await fetch(u,{method:"GET",headers:{Authorization:`Bearer ${D}`}});if(!F.ok){let C=await F.text();throw Error(`Failed to fetch JWT token: ${F.status} ${C}`)}return(await F.json()).token}function O8(){J={lastFailureTime:null,consecutiveFailures:0,backoffMs:1000,circuitOpen:!1,circuitOpenTime:null}}function M7(){O8()}function q7(){let D=Date.now();if(J.lastFailureTime=D,J.consecutiveFailures+=1,J.backoffMs=Math.min(J.backoffMs*2,W7),J.consecutiveFailures>=X7)J.circuitOpen=!0,J.circuitOpenTime=D,n2.warn(`JWT refresh circuit breaker opened after ${J.consecutiveFailures} consecutive failures`)}function Z7(){let D=Date.now();if(J.circuitOpen&&J.circuitOpenTime){if(D-J.circuitOpenTime>=z7)return n2.info("JWT refresh circuit breaker reset - attempting refresh"),J.circuitOpen=!1,J.circuitOpenTime=null,J.consecutiveFailures=0,J.backoffMs=1000,!0;return!1}if(J.lastFailureTime){if(D-J.lastFailureTime<Math.max(H7,J.backoffMs))return!1}return!0}async function b8(){let D=await ht();if(D){if(J.consecutiveFailures>0)O8();return D}let u=await At();if(!u)return null;if(!Z7())return n2.debug("JWT refresh skipped due to cooldown/backoff/circuit breaker"),null;try{let F=await r8(u),E=Date.now()+Y7*1000;return await Bt(F,E),M7(),F}catch(F){return n2.error("Failed to refresh JWT token:",F),q7(),null}}async function Qt(){let D=await b8();if(!D)throw new t0("Not authenticated - no valid JWT token");return D}f2();import{resolve as st}from"path";var V8=process.env.HOME||process.env.USERPROFILE||"~",j8=process.platform==="win32"?st(V8,"AppData","Roaming","relic"):st(V8,".config","relic"),gt=st(j8,"password"),k8="com.relic.tui",y8="master-password",v7="RELIC_PASSWORD";async function tu(){let D=process.env[v7];if(D&&D.length>0)return D;let{secrets:u}=awaitPromise.resolve(globalThis.Bun);try{let F=await u.get({service:k8,name:y8});if(F!==null&&F.length>0)return F}catch(F){}try{let F=Bun.file(gt);if(await F.exists()){let E=await F.text();return E.length>0?E:null}}catch(F){}return null}async function l7(){let{secrets:D}=awaitPromise.resolve(globalThis.Bun),{unlink:u}=await import("fs/promises");try{await D.delete({service:k8,name:y8})}catch(F){}try{if(await Bun.file(gt).exists())await u(gt)}catch(F){}}async function et(){let D=await tu();return D!==null&&D.length>0}async function ot(){await l7()}function B2(){return j8}import{Database as d7}from"bun:sqlite";import{resolve as s7}from"path";var g7=s7(B2(),"relic.db"),bu=null;async function e7(){let{mkdir:D,chmod:u}=await import("fs/promises"),F=B2();try{if(await D(F,{recursive:!0,mode:448}),process.platform!=="win32")await u(F,448)}catch(E){}}function v8(D){D.run(`
|
|
136
|
+
CREATE TABLE IF NOT EXISTS user_keys (
|
|
137
|
+
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
138
|
+
encrypted_private_key TEXT NOT NULL,
|
|
139
|
+
salt TEXT NOT NULL,
|
|
140
|
+
public_key TEXT,
|
|
141
|
+
keys_updated_at INTEGER NOT NULL
|
|
142
|
+
)
|
|
143
|
+
`)}async function Lu(){if(bu)return bu;return await e7(),bu=new d7(g7,{create:!0}),bu.run("PRAGMA journal_mode = WAL;"),v8(bu),bu}function A2(D){try{let u=D.prepare("SELECT encrypted_private_key, salt, public_key, keys_updated_at FROM user_keys WHERE id = 1").get();if(!u)return null;return{encryptedPrivateKey:u.encrypted_private_key,salt:u.salt,publicKey:u.public_key??void 0,keysUpdatedAt:u.keys_updated_at}}catch(u){return null}}function mu(D,u){try{D.prepare("INSERT OR REPLACE INTO user_keys (id, encrypted_private_key, salt, public_key, keys_updated_at) VALUES (1, ?, ?, ?, ?)").run(u.encryptedPrivateKey,u.salt,u.publicKey??null,u.keysUpdatedAt)}catch(F){}}function Yu(D){try{D.prepare("DELETE FROM user_keys").run()}catch(u){}}var e=Q(mD(),1);function o7(){return new Uu(pu)}function HD(D){return D}class l8{client;authPromise=null;constructor(){this.client=o7()}async ensureAuth(){if(this.authPromise){await this.authPromise;return}this.authPromise=(async()=>{try{let D=await Qt();this.client.setAuth(D)}catch(D){throw lu("cli",D,{action:"cli_auth"}),this.client.clearAuth(),D}finally{this.authPromise=null}})(),await this.authPromise}async withAuth(D){return await this.ensureAuth(),D()}async getCurrentUser(){let D=await this.withAuth(()=>this.client.query(s.user.getCurrentUser,{}));return{id:String(D.id),name:D.name,email:D.email,image:D.image??void 0,hasPro:D.hasPro??!1}}async listProjects(){return(await this.withAuth(()=>this.client.query(s.project.listUserProjects,{}))).projects.map((u)=>({...u,id:String(u.id)}))}async listSharedProjects(){return(await this.withAuth(()=>this.client.query(s.projectShare.listActiveSharedProjectsForCurrentUser,{}))).shares.map((u)=>({id:String(u.projectId),name:u.projectName,slug:u.projectSlug,status:u.status,isRestricted:u.isRestricted,isArchived:u.isArchived,ownerId:u.ownerId,createdAt:0,updatedAt:0}))}async getProjectEnvironments(D){return(await this.withAuth(()=>this.client.query(s.environment.getProjectEnvironments,{projectId:HD(D)}))).map((F)=>({id:String(F.id),name:F.name,projectId:String(F.projectId),color:F.color}))}async getEnvironmentData(D){let u=await this.withAuth(()=>this.client.query(s.environment.getEnvironmentData,{environmentId:HD(D)}));return{secrets:u.secrets.filter((F)=>!F.isDeleted).map((F)=>({id:String(F.id),key:F.key,encryptedValue:F.encryptedValue,environmentId:String(F.environmentId),folderId:F.folderId?String(F.folderId):void 0,valueType:F.valueType,scope:F.scope})),folders:u.folders.map((F)=>({id:String(F.id),name:F.name,environmentId:String(F.environmentId)}))}}async getFullUser(){let D=await this.withAuth(()=>this.client.query(s.user.getCurrentUser,{}));return{id:String(D.id),name:D.name,email:D.email,image:D.image??void 0,hasPro:D.hasPro??!1,publicKey:D.publicKey??void 0,encryptedPrivateKey:D.encryptedPrivateKey??void 0,salt:D.salt??void 0,keysUpdatedAt:D.keysUpdatedAt??void 0}}async getProject(D){let u=await this.withAuth(()=>this.client.query(s.project.getProject,{projectId:HD(D)}));return{id:String(u.id),name:u.name,slug:u.slug,encryptedProjectKey:u.encryptedProjectKey,keyVersion:u.keyVersion,isArchived:u.isArchived}}async getProjectShare(D){let u=await this.withAuth(()=>this.client.query(s.projectShare.getProjectShareByProjectForCurrentUser,{projectId:HD(D)}));if(!u)return null;return{encryptedProjectKey:u.encryptedProjectKey}}async getSecretsForFolder(D,u){let F=await this.getEnvironmentData(D);if(u)return F.secrets.filter((E)=>E.folderId===u);return F.secrets.filter((E)=>!E.folderId)}async getSecretsCacheValidation(D,u,F){return await this.withAuth(()=>this.client.query(s.environment.getSecretsCacheValidation,{projectId:HD(D),environmentId:u?HD(u):void 0,folderId:F?HD(F):void 0}))}async exportSecrets(D){let u=await this.withAuth(()=>this.client.mutation(s.secret.exportSecrets,{projectId:HD(D.projectId),environmentName:D.environmentName,environmentId:D.environmentId?HD(D.environmentId):void 0,folderName:D.folderName,folderId:D.folderId?HD(D.folderId):void 0,scope:D.scope}));return{secrets:u.secrets,count:u.count,encryptedProjectKey:u.encryptedProjectKey,environmentId:String(u.environmentId),folderId:u.folderId?String(u.folderId):null}}}var xt=null;function gD(){if(!xt)xt=new l8;return xt}class E0 extends Error{upgradeUrl;constructor(D,u){super(D);this.name="ProPlanRequiredError",this.upgradeUrl=u}}async function d8(D,u){let F=`${a0}/api/secrets/export`,E=await fetch(F,{method:"POST",headers:{Authorization:`Bearer ${D}`,"Content-Type":"application/json"},body:JSON.stringify(u)});if(!E.ok){let c=await E.json().catch(()=>null);if(E.status===402||c?.code==="PRO_PLAN_REQUIRED")throw new E0(c?.error||"API keys require a Pro plan.",c?.upgradeUrl||"https://relic.so/dashboard?action=upgrade");throw Error(c?.error??`HTTP ${E.status}`)}return await E.json()}async function at(D){let u=`${a0}/api/user/keys`,F=await fetch(u,{method:"GET",headers:{Authorization:`Bearer ${D}`}});if(!F.ok){let C=await F.json().catch(()=>null);if(F.status===402||C?.code==="PRO_PLAN_REQUIRED")throw new E0(C?.error||"API keys require a Pro plan.",C?.upgradeUrl||"https://relic.so/dashboard?action=upgrade");throw Error(C?.error??`HTTP ${F.status}`)}return await F.json()}import{mkdir as A4}from"fs/promises";import{dirname as h4,join as n0,resolve as EE}from"path";/*!
|
|
144
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
145
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
|
+
*
|
|
147
|
+
* Redistribution and use in source and binary forms, with or without
|
|
148
|
+
* modification, are permitted provided that the following conditions are met:
|
|
149
|
+
*
|
|
150
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
151
|
+
* list of conditions and the following disclaimer.
|
|
152
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
153
|
+
* this list of conditions and the following disclaimer in the
|
|
154
|
+
* documentation and/or other materials provided with the distribution.
|
|
155
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
156
|
+
* may be used to endorse or promote products derived from this software without
|
|
157
|
+
* specific prior written permission.
|
|
158
|
+
*
|
|
159
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
160
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
161
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
162
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
163
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
164
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
165
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
166
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
167
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
168
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
169
|
+
*/function x7(D,u){let F=D.slice(0,u).split(/\r\n|\n|\r/g);return[F.length,F.pop().length+1]}function a7(D,u,F){let E=D.split(/\r\n|\n|\r/g),C="",c=(Math.log10(u+1)|0)+1;for(let t=u-1;t<=u+1;t++){let n=E[t-1];if(!n)continue;if(C+=t.toString().padEnd(c," "),C+=": ",C+=n,C+=`
|
|
170
|
+
`,t===u)C+=" ".repeat(c+F+2),C+=`^
|
|
171
|
+
`}return C}class S extends Error{line;column;codeblock;constructor(D,u){let[F,E]=x7(u.toml,u.ptr),C=a7(u.toml,F,E);super(`Invalid TOML document: ${D}
|
|
172
|
+
|
|
173
|
+
${C}`,u);this.line=F,this.column=E,this.codeblock=C}}/*!
|
|
174
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
175
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
176
|
+
*
|
|
177
|
+
* Redistribution and use in source and binary forms, with or without
|
|
178
|
+
* modification, are permitted provided that the following conditions are met:
|
|
179
|
+
*
|
|
180
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
181
|
+
* list of conditions and the following disclaimer.
|
|
182
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
183
|
+
* this list of conditions and the following disclaimer in the
|
|
184
|
+
* documentation and/or other materials provided with the distribution.
|
|
185
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
186
|
+
* may be used to endorse or promote products derived from this software without
|
|
187
|
+
* specific prior written permission.
|
|
188
|
+
*
|
|
189
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
190
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
191
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
192
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
193
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
194
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
195
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
196
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
197
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
198
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
199
|
+
*/function p7(D,u){let F=0;while(D[u-++F]==="\\");return--F&&F%2}function h2(D,u=0,F=D.length){let E=D.indexOf(`
|
|
200
|
+
`,u);if(D[E-1]==="\r")E--;return E<=F?E:-1}function Hu(D,u){for(let F=u;F<D.length;F++){let E=D[F];if(E===`
|
|
201
|
+
`)return F;if(E==="\r"&&D[F+1]===`
|
|
202
|
+
`)return F+1;if(E<" "&&E!=="\t"||E==="\x7F")throw new S("control characters are not allowed in comments",{toml:D,ptr:u})}return D.length}function p(D,u,F,E){let C;while((C=D[u])===" "||C==="\t"||!F&&(C===`
|
|
203
|
+
`||C==="\r"&&D[u+1]===`
|
|
204
|
+
`))u++;return E||C!=="#"?u:p(D,Hu(D,u),F)}function s8(D,u,F,E,C=!1){if(!E)return u=h2(D,u),u<0?D.length:u;for(let c=u;c<D.length;c++){let t=D[c];if(t==="#")c=h2(D,c);else if(t===F)return c+1;else if(t===E||C&&(t===`
|
|
205
|
+
`||t==="\r"&&D[c+1]===`
|
|
206
|
+
`))return c}throw new S("cannot find end of structure",{toml:D,ptr:u})}function _2(D,u){let F=D[u],E=F===D[u+1]&&D[u+1]===D[u+2]?D.slice(u,u+3):F;u+=E.length-1;do u=D.indexOf(E,++u);while(u>-1&&F!=="'"&&p7(D,u));if(u>-1){if(u+=E.length,E.length>1){if(D[u]===F)u++;if(D[u]===F)u++}}return u}/*!
|
|
207
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
208
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
209
|
+
*
|
|
210
|
+
* Redistribution and use in source and binary forms, with or without
|
|
211
|
+
* modification, are permitted provided that the following conditions are met:
|
|
212
|
+
*
|
|
213
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
214
|
+
* list of conditions and the following disclaimer.
|
|
215
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
216
|
+
* this list of conditions and the following disclaimer in the
|
|
217
|
+
* documentation and/or other materials provided with the distribution.
|
|
218
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
219
|
+
* may be used to endorse or promote products derived from this software without
|
|
220
|
+
* specific prior written permission.
|
|
221
|
+
*
|
|
222
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
223
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
224
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
225
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
226
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
227
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
228
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
229
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
230
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
231
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
232
|
+
*/var D4=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class eD extends Date{#F=!1;#u=!1;#D=null;constructor(D){let u=!0,F=!0,E="Z";if(typeof D==="string"){let C=D.match(D4);if(C){if(!C[1])u=!1,D=`0000-01-01T${D}`;if(F=!!C[2],F&&D[10]===" "&&(D=D.replace(" ","T")),C[2]&&+C[2]>23)D="";else if(E=C[3]||null,D=D.toUpperCase(),!E&&F)D+="Z"}else D=""}super(D);if(!isNaN(this.getTime()))this.#F=u,this.#u=F,this.#D=E}isDateTime(){return this.#F&&this.#u}isLocal(){return!this.#F||!this.#u||!this.#D}isDate(){return this.#F&&!this.#u}isTime(){return this.#u&&!this.#F}isValid(){return this.#F||this.#u}toISOString(){let D=super.toISOString();if(this.isDate())return D.slice(0,10);if(this.isTime())return D.slice(11,23);if(this.#D===null)return D.slice(0,-1);if(this.#D==="Z")return D;let u=+this.#D.slice(1,3)*60+ +this.#D.slice(4,6);return u=this.#D[0]==="-"?u:-u,new Date(this.getTime()-u*60000).toISOString().slice(0,-1)+this.#D}static wrapAsOffsetDateTime(D,u="Z"){let F=new eD(D);return F.#D=u,F}static wrapAsLocalDateTime(D){let u=new eD(D);return u.#D=null,u}static wrapAsLocalDate(D){let u=new eD(D);return u.#u=!1,u.#D=null,u}static wrapAsLocalTime(D){let u=new eD(D);return u.#F=!1,u.#D=null,u}}/*!
|
|
233
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
234
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
235
|
+
*
|
|
236
|
+
* Redistribution and use in source and binary forms, with or without
|
|
237
|
+
* modification, are permitted provided that the following conditions are met:
|
|
238
|
+
*
|
|
239
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
240
|
+
* list of conditions and the following disclaimer.
|
|
241
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
242
|
+
* this list of conditions and the following disclaimer in the
|
|
243
|
+
* documentation and/or other materials provided with the distribution.
|
|
244
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
245
|
+
* may be used to endorse or promote products derived from this software without
|
|
246
|
+
* specific prior written permission.
|
|
247
|
+
*
|
|
248
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
249
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
250
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
251
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
252
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
253
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
254
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
255
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
256
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
257
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
258
|
+
*/var u4=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,F4=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,t4=/^[+-]?0[0-9_]/,E4=/^[0-9a-f]{2,8}$/i,g8={b:"\b",t:"\t",n:`
|
|
259
|
+
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function w2(D,u=0,F=D.length){let E=D[u]==="'",C=D[u++]===D[u]&&D[u]===D[u+1];if(C){if(F-=2,D[u+=2]==="\r")u++;if(D[u]===`
|
|
260
|
+
`)u++}let c=0,t,n="",i=u;while(u<F-1){let f=D[u++];if(f===`
|
|
261
|
+
`||f==="\r"&&D[u]===`
|
|
262
|
+
`){if(!C)throw new S("newlines are not allowed in strings",{toml:D,ptr:u-1})}else if(f<" "&&f!=="\t"||f==="\x7F")throw new S("control characters are not allowed in strings",{toml:D,ptr:u-1});if(t){if(t=!1,f==="x"||f==="u"||f==="U"){let B=D.slice(u,u+=f==="x"?2:f==="u"?4:8);if(!E4.test(B))throw new S("invalid unicode escape",{toml:D,ptr:c});try{n+=String.fromCodePoint(parseInt(B,16))}catch{throw new S("invalid unicode escape",{toml:D,ptr:c})}}else if(C&&(f===`
|
|
263
|
+
`||f===" "||f==="\t"||f==="\r")){if(u=p(D,u-1,!0),D[u]!==`
|
|
264
|
+
`&&D[u]!=="\r")throw new S("invalid escape: only line-ending whitespace may be escaped",{toml:D,ptr:c});u=p(D,u)}else if(f in g8)n+=g8[f];else throw new S("unrecognized escape sequence",{toml:D,ptr:c});i=u}else if(!E&&f==="\\")c=u-1,t=!0,n+=D.slice(i,c)}return n+D.slice(i,F-1)}function e8(D,u,F,E){if(D==="true")return!0;if(D==="false")return!1;if(D==="-inf")return-1/0;if(D==="inf"||D==="+inf")return 1/0;if(D==="nan"||D==="+nan"||D==="-nan")return NaN;if(D==="-0")return E?0n:0;let C=u4.test(D);if(C||F4.test(D)){if(t4.test(D))throw new S("leading zeroes are not allowed",{toml:u,ptr:F});D=D.replace(/_/g,"");let t=+D;if(isNaN(t))throw new S("invalid number",{toml:u,ptr:F});if(C){if((C=!Number.isSafeInteger(t))&&!E)throw new S("integer value cannot be represented losslessly",{toml:u,ptr:F});if(C||E===!0)t=BigInt(D)}return t}let c=new eD(D);if(!c.isValid())throw new S("invalid value",{toml:u,ptr:F});return c}/*!
|
|
265
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
266
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
267
|
+
*
|
|
268
|
+
* Redistribution and use in source and binary forms, with or without
|
|
269
|
+
* modification, are permitted provided that the following conditions are met:
|
|
270
|
+
*
|
|
271
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
272
|
+
* list of conditions and the following disclaimer.
|
|
273
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
274
|
+
* this list of conditions and the following disclaimer in the
|
|
275
|
+
* documentation and/or other materials provided with the distribution.
|
|
276
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
277
|
+
* may be used to endorse or promote products derived from this software without
|
|
278
|
+
* specific prior written permission.
|
|
279
|
+
*
|
|
280
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
281
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
282
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
283
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
284
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
285
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
286
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
287
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
288
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
289
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
290
|
+
*/function C4(D,u,F){let E=D.slice(u,F),C=E.indexOf("#");if(C>-1)Hu(D,C),E=E.slice(0,C);return[E.trimEnd(),C]}function C0(D,u,F,E,C){if(E===0)throw new S("document contains excessively nested structures. aborting.",{toml:D,ptr:u});let c=D[u];if(c==="["||c==="{"){let[i,f]=c==="["?x8(D,u,E,C):o8(D,u,E,C);if(F){if(f=p(D,f),D[f]===",")f++;else if(D[f]!==F)throw new S("expected comma or end of structure",{toml:D,ptr:f})}return[i,f]}let t;if(c==='"'||c==="'"){t=_2(D,u);let i=w2(D,u,t);if(F){if(t=p(D,t),D[t]&&D[t]!==","&&D[t]!==F&&D[t]!==`
|
|
291
|
+
`&&D[t]!=="\r")throw new S("unexpected character encountered",{toml:D,ptr:t});t+=+(D[t]===",")}return[i,t]}t=s8(D,u,",",F);let n=C4(D,u,t-+(D[t-1]===","));if(!n[0])throw new S("incomplete key-value declaration: no value specified",{toml:D,ptr:u});if(F&&n[1]>-1)t=p(D,u+n[1]),t+=+(D[t]===",");return[e8(n[0],D,u,C),t]}/*!
|
|
292
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
293
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
294
|
+
*
|
|
295
|
+
* Redistribution and use in source and binary forms, with or without
|
|
296
|
+
* modification, are permitted provided that the following conditions are met:
|
|
297
|
+
*
|
|
298
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
299
|
+
* list of conditions and the following disclaimer.
|
|
300
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
301
|
+
* this list of conditions and the following disclaimer in the
|
|
302
|
+
* documentation and/or other materials provided with the distribution.
|
|
303
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
304
|
+
* may be used to endorse or promote products derived from this software without
|
|
305
|
+
* specific prior written permission.
|
|
306
|
+
*
|
|
307
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
308
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
309
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
310
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
311
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
312
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
313
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
314
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
315
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
316
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
317
|
+
*/var c4=/^[a-zA-Z0-9-_]+[ \t]*$/;function R2(D,u,F="="){let E=u-1,C=[],c=D.indexOf(F,u);if(c<0)throw new S("incomplete key-value: cannot find end of key",{toml:D,ptr:u});do{let t=D[u=++E];if(t!==" "&&t!=="\t")if(t==='"'||t==="'"){if(t===D[u+1]&&t===D[u+2])throw new S("multiline strings are not allowed in keys",{toml:D,ptr:u});let n=_2(D,u);if(n<0)throw new S("unfinished string encountered",{toml:D,ptr:u});E=D.indexOf(".",n);let i=D.slice(n,E<0||E>c?c:E),f=h2(i);if(f>-1)throw new S("newlines are not allowed in keys",{toml:D,ptr:u+E+f});if(i.trimStart())throw new S("found extra tokens after the string part",{toml:D,ptr:n});if(c<n){if(c=D.indexOf(F,n),c<0)throw new S("incomplete key-value: cannot find end of key",{toml:D,ptr:u})}C.push(w2(D,u,n))}else{E=D.indexOf(".",u);let n=D.slice(u,E<0||E>c?c:E);if(!c4.test(n))throw new S("only letter, numbers, dashes and underscores are allowed in keys",{toml:D,ptr:u});C.push(n.trimEnd())}}while(E+1&&E<c);return[C,p(D,c+1,!0,!0)]}function o8(D,u,F,E){let C={},c=new Set,t;u++;while((t=D[u++])!=="}"&&t)if(t===",")throw new S("expected value, found comma",{toml:D,ptr:u-1});else if(t==="#")u=Hu(D,u);else if(t!==" "&&t!=="\t"&&t!==`
|
|
318
|
+
`&&t!=="\r"){let n,i=C,f=!1,[B,A]=R2(D,u-1);for(let R=0;R<B.length;R++){if(R)i=f?i[n]:i[n]={};if(n=B[R],(f=Object.hasOwn(i,n))&&(typeof i[n]!=="object"||c.has(i[n])))throw new S("trying to redefine an already defined value",{toml:D,ptr:u});if(!f&&n==="__proto__")Object.defineProperty(i,n,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new S("trying to redefine an already defined value",{toml:D,ptr:u});let[h,w]=C0(D,A,"}",F-1,E);c.add(h),i[n]=h,u=w}if(!t)throw new S("unfinished table encountered",{toml:D,ptr:u});return[C,u]}function x8(D,u,F,E){let C=[],c;u++;while((c=D[u++])!=="]"&&c)if(c===",")throw new S("expected value, found comma",{toml:D,ptr:u-1});else if(c==="#")u=Hu(D,u);else if(c!==" "&&c!=="\t"&&c!==`
|
|
319
|
+
`&&c!=="\r"){let t=C0(D,u-1,"]",F-1,E);C.push(t[0]),u=t[1]}if(!c)throw new S("unfinished array encountered",{toml:D,ptr:u});return[C,u]}/*!
|
|
320
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
321
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
322
|
+
*
|
|
323
|
+
* Redistribution and use in source and binary forms, with or without
|
|
324
|
+
* modification, are permitted provided that the following conditions are met:
|
|
325
|
+
*
|
|
326
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
327
|
+
* list of conditions and the following disclaimer.
|
|
328
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
329
|
+
* this list of conditions and the following disclaimer in the
|
|
330
|
+
* documentation and/or other materials provided with the distribution.
|
|
331
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
332
|
+
* may be used to endorse or promote products derived from this software without
|
|
333
|
+
* specific prior written permission.
|
|
334
|
+
*
|
|
335
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
336
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
337
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
338
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
339
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
340
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
341
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
342
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
343
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
344
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
345
|
+
*/function a8(D,u,F,E){let C=u,c=F,t,n=!1,i;for(let f=0;f<D.length;f++){if(f){if(C=n?C[t]:C[t]={},c=(i=c[t]).c,E===0&&(i.t===1||i.t===2))return null;if(i.t===2){let B=C.length-1;C=C[B],c=c[B].c}}if(t=D[f],(n=Object.hasOwn(C,t))&&c[t]?.t===0&&c[t]?.d)return null;if(!n){if(t==="__proto__")Object.defineProperty(C,t,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(c,t,{enumerable:!0,configurable:!0,writable:!0});c[t]={t:f<D.length-1&&E===2?3:E,d:!1,i:0,c:{}}}}if(i=c[t],i.t!==E&&!(E===1&&i.t===3))return null;if(E===2){if(!i.d)i.d=!0,C[t]=[];C[t].push(C={}),i.c[i.i++]=i={t:1,d:!1,i:0,c:{}}}if(i.d)return null;if(i.d=!0,E===1)C=n?C[t]:C[t]={};else if(E===0&&n)return null;return[t,C,i.c]}function pt(D,{maxDepth:u=1000,integersAsBigInt:F}={}){let E={},C={},c=E,t=C;for(let n=p(D,0);n<D.length;){if(D[n]==="["){let i=D[++n]==="[",f=R2(D,n+=+i,"]");if(i){if(D[f[1]-1]!=="]")throw new S("expected end of table declaration",{toml:D,ptr:f[1]-1});f[1]++}let B=a8(f[0],E,C,i?2:1);if(!B)throw new S("trying to redefine an already defined table or value",{toml:D,ptr:n});t=B[2],c=B[1],n=f[1]}else{let i=R2(D,n),f=a8(i[0],c,t,0);if(!f)throw new S("trying to redefine an already defined table or value",{toml:D,ptr:n});let B=C0(D,i[1],void 0,u,F);f[1][f[0]]=B[0],n=B[1]}if(n=p(D,n,!0),D[n]&&D[n]!==`
|
|
346
|
+
`&&D[n]!=="\r")throw new S("each key-value declaration must be followed by an end-of-line",{toml:D,ptr:n});n=p(D,n)}return E}/*!
|
|
347
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
348
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
349
|
+
*
|
|
350
|
+
* Redistribution and use in source and binary forms, with or without
|
|
351
|
+
* modification, are permitted provided that the following conditions are met:
|
|
352
|
+
*
|
|
353
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
354
|
+
* list of conditions and the following disclaimer.
|
|
355
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
356
|
+
* this list of conditions and the following disclaimer in the
|
|
357
|
+
* documentation and/or other materials provided with the distribution.
|
|
358
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
359
|
+
* may be used to endorse or promote products derived from this software without
|
|
360
|
+
* specific prior written permission.
|
|
361
|
+
*
|
|
362
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
363
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
364
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
365
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
366
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
367
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
368
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
369
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
370
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
371
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
372
|
+
*/var p8=/^[a-z0-9-_]+$/i;function c0(D){let u=typeof D;if(u==="object"){if(Array.isArray(D))return"array";if(D instanceof Date)return"date"}return u}function n4(D){for(let u=0;u<D.length;u++)if(c0(D[u])!=="object")return!1;return D.length!=0}function DE(D){return JSON.stringify(D).replace(/\x7f/g,"\\u007f")}function uE(D,u,F,E){if(F===0)throw Error("Could not stringify the object: maximum object depth exceeded");if(u==="number"){if(isNaN(D))return"nan";if(D===1/0)return"inf";if(D===-1/0)return"-inf";if(E&&Number.isInteger(D))return D.toFixed(1);return D.toString()}if(u==="bigint"||u==="boolean")return D.toString();if(u==="string")return DE(D);if(u==="date"){if(isNaN(D.getTime()))throw TypeError("cannot serialize invalid date");return D.toISOString()}if(u==="object")return i4(D,F,E);if(u==="array")return f4(D,F,E)}function i4(D,u,F){let E=Object.keys(D);if(E.length===0)return"{}";let C="{ ";for(let c=0;c<E.length;c++){let t=E[c];if(c)C+=", ";C+=p8.test(t)?t:DE(t),C+=" = ",C+=uE(D[t],c0(D[t]),u-1,F)}return C+" }"}function f4(D,u,F){if(D.length===0)return"[]";let E="[ ";for(let C=0;C<D.length;C++){if(C)E+=", ";if(D[C]===null||D[C]===void 0)throw TypeError("arrays cannot contain null or undefined values");E+=uE(D[C],c0(D[C]),u-1,F)}return E+" ]"}function B4(D,u,F,E){if(F===0)throw Error("Could not stringify the object: maximum object depth exceeded");let C="";for(let c=0;c<D.length;c++)C+=`${C&&`
|
|
373
|
+
`}[[${u}]]
|
|
374
|
+
`,C+=FE(0,D[c],u,F,E);return C}function FE(D,u,F,E,C){if(E===0)throw Error("Could not stringify the object: maximum object depth exceeded");let c="",t="",n=Object.keys(u);for(let i=0;i<n.length;i++){let f=n[i];if(u[f]!==null&&u[f]!==void 0){let B=c0(u[f]);if(B==="symbol"||B==="function")throw TypeError(`cannot serialize values of type '${B}'`);let A=p8.test(f)?f:DE(f);if(B==="array"&&n4(u[f]))t+=(t&&`
|
|
375
|
+
`)+B4(u[f],F?`${F}.${A}`:A,E-1,C);else if(B==="object"){let h=F?`${F}.${A}`:A;t+=(t&&`
|
|
376
|
+
`)+FE(h,u[f],h,E-1,C)}else c+=A,c+=" = ",c+=uE(u[f],B,E,C),c+=`
|
|
377
|
+
`}}if(D&&(c||!t))c=c?`[${D}]
|
|
378
|
+
${c}`:`[${D}]`;return c&&t?`${c}
|
|
379
|
+
${t}`:c||t}function tE(D,{maxDepth:u=1000,numbersAsFloat:F=!1}={}){if(c0(D)!=="object")throw TypeError("stringify can only be called with an object");let E=FE(0,D,"",u,F);if(E[E.length-1]!==`
|
|
380
|
+
`)return E+`
|
|
381
|
+
`;return E}/*!
|
|
382
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
383
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
384
|
+
*
|
|
385
|
+
* Redistribution and use in source and binary forms, with or without
|
|
386
|
+
* modification, are permitted provided that the following conditions are met:
|
|
387
|
+
*
|
|
388
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
389
|
+
* list of conditions and the following disclaimer.
|
|
390
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
391
|
+
* this list of conditions and the following disclaimer in the
|
|
392
|
+
* documentation and/or other materials provided with the distribution.
|
|
393
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
394
|
+
* may be used to endorse or promote products derived from this software without
|
|
395
|
+
* specific prior written permission.
|
|
396
|
+
*
|
|
397
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
398
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
399
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
400
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
401
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
402
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
403
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
404
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
405
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
406
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
407
|
+
*/var $2="relic.toml",Dc=".relic",_4="cache.db";async function uc(D,u){let F=u??process.cwd(),E=n0(F,$2),C=tE(D);return await Bun.write(E,C),E}async function i0(D){let u=EE(D??process.cwd()),F=EE("/"),E=process.env.HOME?EE(process.env.HOME):null;while(u!==F){let C=n0(u,$2),c=Bun.file(C);if(await c.exists())try{let n=await c.text();return{config:pt(n),configPath:C,rootDir:u}}catch{return null}if(E&&u===E)return null;let t=h4(u);if(t===u)break;u=t}return null}async function Fc(D){let u=D??process.cwd(),F=n0(u,$2);return Bun.file(F).exists()}function tc(D){return{project_id:D}}function Ec(){return $2}function Cc(D){return n0(D,Dc,_4)}async function cc(D){let u=D??process.cwd(),F=n0(u,Dc);return await A4(F,{recursive:!0}),F}var w4=zD("cli");async function CE(){if(JC(e.default.bgCyan(e.default.black(" relic init "))),await Fc()){a.warn(e.default.yellow("Already initialized")),gu(e.default.dim("Delete relic.toml to re-initialize"));return}let D=KC();D.start("Checking authentication...");let u=await g();if(!u.isValid||u.isExpired)D.stop("Not logged in"),a.error(e.default.yellow("Not logged in")),gu(e.default.dim("Run `relic login` to authenticate")),process.exit(1);D.message("Loading projects...");try{let F=gD(),[E,C]=await Promise.all([F.listProjects(),F.listSharedProjects()]),c=[...E.filter((f)=>!f.isArchived).map((f)=>({...f,isShared:!1})),...C.filter((f)=>!f.isArchived).map((f)=>({...f,isShared:!0}))];if(D.stop("Projects loaded"),c.length===0)a.warn(e.default.yellow("No projects found. Run `relic` to create a new project")),process.exit(1);let t=await qC({message:"Select a project",options:c.map((f)=>({value:f.id,label:f.isShared?`${f.name} ${e.default.dim("(shared)")}`:f.name}))});if(s0(t))ZC("Operation cancelled"),process.exit(0);let n=c.find((f)=>f.id===t);if(!n)a.error(e.default.red("Failed to find selected project")),process.exit(1);D.start("Saving configuration...");let i=tc(n.id);await uc(i),await cc(),D.stop("Configuration saved"),Z("cli_project_initialized",{success:!0}),a.success(e.default.green(`Initialized Relic for ${n.name}`)),gu(e.default.dim(`Config saved to ${Ec()}`))}catch(F){if(D.stop("Failed"),F instanceof Ou)a.error(e.default.yellow("Not logged in")),gu(e.default.dim("Run `relic login` to authenticate")),process.exit(1);w4.error("Init failed",F),Z("cli_project_initialized",{success:!1});let E=F instanceof Error?F.message:"Failed to initialize";a.error(e.default.red(`Error: ${E}`)),process.exit(1)}}import b2 from"process";var nc=(D=0)=>(u)=>`\x1B[${u+D}m`,ic=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,fc=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,H={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]}},FN=Object.keys(H.modifier),R4=Object.keys(H.color),$4=Object.keys(H.bgColor),tN=[...R4,...$4];function S4(){let D=new Map;for(let[u,F]of Object.entries(H)){for(let[E,C]of Object.entries(F))H[E]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[E]=H[E],D.set(C[0],C[1]);Object.defineProperty(H,u,{value:F,enumerable:!1})}return Object.defineProperty(H,"codes",{value:D,enumerable:!1}),H.color.close="\x1B[39m",H.bgColor.close="\x1B[49m",H.color.ansi=nc(),H.color.ansi256=ic(),H.color.ansi16m=fc(),H.bgColor.ansi=nc(10),H.bgColor.ansi256=ic(10),H.bgColor.ansi16m=fc(10),Object.defineProperties(H,{rgbToAnsi256:{value(u,F,E){if(u===F&&F===E){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;if(E.length===3)E=[...E].map((c)=>c+c).join("");let C=Number.parseInt(E,16);return[C>>16&255,C>>8&255,C&255]},enumerable:!1},hexToAnsi256:{value:(u)=>H.rgbToAnsi256(...H.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,C;if(u>=232)F=((u-232)*10+8)/255,E=F,C=F;else{u-=16;let n=u%36;F=Math.floor(u/36)/5,E=Math.floor(n/6)/5,C=n%6/5}let c=Math.max(F,E,C)*2;if(c===0)return 30;let t=30+(Math.round(C)<<2|Math.round(E)<<1|Math.round(F));if(c===2)t+=60;return t},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>H.ansi256ToAnsi(H.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>H.ansi256ToAnsi(H.hexToAnsi256(u)),enumerable:!1}}),H}var I4=S4(),RD=I4;import cE from"process";import N4 from"os";import Bc from"tty";function nD(D,u=globalThis.Deno?globalThis.Deno.args:cE.argv){let F=D.startsWith("-")?"":D.length===1?"-":"--",E=u.indexOf(F+D),C=u.indexOf("--");return E!==-1&&(C===-1||E<C)}var{env:W}=cE,S2;if(nD("no-color")||nD("no-colors")||nD("color=false")||nD("color=never"))S2=0;else if(nD("color")||nD("colors")||nD("color=true")||nD("color=always"))S2=1;function U4(){if("FORCE_COLOR"in W){if(W.FORCE_COLOR==="true")return 1;if(W.FORCE_COLOR==="false")return 0;return W.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(W.FORCE_COLOR,10),3)}}function T4(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function r4(D,{streamIsTTY:u,sniffFlags:F=!0}={}){let E=U4();if(E!==void 0)S2=E;let C=F?S2:E;if(C===0)return 0;if(F){if(nD("color=16m")||nD("color=full")||nD("color=truecolor"))return 3;if(nD("color=256"))return 2}if("TF_BUILD"in W&&"AGENT_NAME"in W)return 1;if(D&&!u&&C===void 0)return 0;let c=C||0;if(W.TERM==="dumb")return c;if(cE.platform==="win32"){let t=N4.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586)return Number(t[2])>=14931?3:2;return 1}if("CI"in W){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((t)=>(t in W)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((t)=>(t in W))||W.CI_NAME==="codeship")return 1;return c}if("TEAMCITY_VERSION"in W)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(W.TEAMCITY_VERSION)?1:0;if(W.COLORTERM==="truecolor")return 3;if(W.TERM==="xterm-kitty")return 3;if(W.TERM==="xterm-ghostty")return 3;if(W.TERM==="wezterm")return 3;if("TERM_PROGRAM"in W){let t=Number.parseInt((W.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(W.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(W.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(W.TERM))return 1;if("COLORTERM"in W)return 1;return c}function Ac(D,u={}){let F=r4(D,{streamIsTTY:D&&D.isTTY,...u});return T4(F)}var O4={stdout:Ac({isTTY:Bc.isatty(1)}),stderr:Ac({isTTY:Bc.isatty(2)})},hc=O4;function _c(D,u,F){let E=D.indexOf(u);if(E===-1)return D;let C=u.length,c=0,t="";do t+=D.slice(c,E)+u+F,c=E+C,E=D.indexOf(u,c);while(E!==-1);return t+=D.slice(c),t}function wc(D,u,F,E){let C=0,c="";do{let t=D[E-1]==="\r";c+=D.slice(C,t?E-1:E)+u+(t?`\r
|
|
408
|
+
`:`
|
|
409
|
+
`)+F,C=E+1,E=D.indexOf(`
|
|
410
|
+
`,C)}while(E!==-1);return c+=D.slice(C),c}var{stdout:Rc,stderr:$c}=hc,nE=Symbol("GENERATOR"),Wu=Symbol("STYLER"),f0=Symbol("IS_EMPTY"),Sc=["ansi","ansi","ansi256","ansi16m"],Xu=Object.create(null),b4=(D,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let F=Rc?Rc.level:0;D.level=u.level===void 0?F:u.level};var L4=(D)=>{let u=(...F)=>F.join(" ");return b4(u,D),Object.setPrototypeOf(u,B0.prototype),u};function B0(D){return L4(D)}Object.setPrototypeOf(B0.prototype,Function.prototype);for(let[D,u]of Object.entries(RD))Xu[D]={get(){let F=I2(this,fE(u.open,u.close,this[Wu]),this[f0]);return Object.defineProperty(this,D,{value:F}),F}};Xu.visible={get(){let D=I2(this,this[Wu],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var iE=(D,u,F,...E)=>{if(D==="rgb"){if(u==="ansi16m")return RD[F].ansi16m(...E);if(u==="ansi256")return RD[F].ansi256(RD.rgbToAnsi256(...E));return RD[F].ansi(RD.rgbToAnsi(...E))}if(D==="hex")return iE("rgb",u,F,...RD.hexToRgb(...E));return RD[F][D](...E)},m4=["rgb","hex","ansi256"];for(let D of m4){Xu[D]={get(){let{level:F}=this;return function(...E){let C=fE(iE(D,Sc[F],"color",...E),RD.color.close,this[Wu]);return I2(this,C,this[f0])}}};let u="bg"+D[0].toUpperCase()+D.slice(1);Xu[u]={get(){let{level:F}=this;return function(...E){let C=fE(iE(D,Sc[F],"bgColor",...E),RD.bgColor.close,this[Wu]);return I2(this,C,this[f0])}}}}var Y4=Object.defineProperties(()=>{},{...Xu,level:{enumerable:!0,get(){return this[nE].level},set(D){this[nE].level=D}}}),fE=(D,u,F)=>{let E,C;if(F===void 0)E=D,C=u;else E=F.openAll+D,C=u+F.closeAll;return{open:D,close:u,openAll:E,closeAll:C,parent:F}},I2=(D,u,F)=>{let E=(...C)=>H4(E,C.length===1?""+C[0]:C.join(" "));return Object.setPrototypeOf(E,Y4),E[nE]=D,E[Wu]=u,E[f0]=F,E},H4=(D,u)=>{if(D.level<=0||!u)return D[f0]?"":u;let F=D[Wu];if(F===void 0)return u;let{openAll:E,closeAll:C}=F;if(u.includes("\x1B"))while(F!==void 0)u=_c(u,F.close,F.open),F=F.parent;let c=u.indexOf(`
|
|
411
|
+
`);if(c!==-1)u=wc(u,C,E,c);return E+u+C};Object.defineProperties(B0.prototype,Xu);var W4=B0(),_N=B0({level:$c?$c.level:0});var $D=W4;import mc from"process";import T2 from"process";var X4=(D,u,F,E)=>{if(F==="length"||F==="prototype")return;if(F==="arguments"||F==="caller")return;let C=Object.getOwnPropertyDescriptor(D,F),c=Object.getOwnPropertyDescriptor(u,F);if(!z4(C,c)&&E)return;Object.defineProperty(D,F,c)},z4=function(D,u){return D===void 0||D.configurable||D.writable===u.writable&&D.enumerable===u.enumerable&&D.configurable===u.configurable&&(D.writable||D.value===u.value)},G4=(D,u)=>{let F=Object.getPrototypeOf(u);if(F===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,F)},M4=(D,u)=>`/* Wrapped ${D}*/
|
|
412
|
+
${u}`,q4=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Z4=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),J4=(D,u,F)=>{let E=F===""?"":`with ${F.trim()}() `,C=M4.bind(null,E,u.toString());Object.defineProperty(C,"name",Z4);let{writable:c,enumerable:t,configurable:n}=q4;Object.defineProperty(D,"toString",{value:C,writable:c,enumerable:t,configurable:n})};function BE(D,u,{ignoreNonConfigurable:F=!1}={}){let{name:E}=D;for(let C of Reflect.ownKeys(u))X4(D,u,C,F);return G4(D,u),J4(D,u,E),D}var N2=new WeakMap,Ic=(D,u={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let F,E=0,C=D.displayName||D.name||"<anonymous>",c=function(...t){if(N2.set(c,++E),E===1)F=D.apply(this,t),D=void 0;else if(u.throw===!0)throw Error(`Function \`${C}\` can only be called once`);return F};return BE(c,D),N2.set(c,E),c};Ic.callCount=(D)=>{if(!N2.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return N2.get(D)};var Nc=Ic;var Eu=[];Eu.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")Eu.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")Eu.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var U2=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",AE=Symbol.for("signal-exit emitter"),hE=globalThis,K4=Object.defineProperty.bind(Object);class Uc{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(hE[AE])return hE[AE];K4(hE,AE,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,u){this.listeners[D].push(u)}removeListener(D,u){let F=this.listeners[D],E=F.indexOf(u);if(E===-1)return;if(E===0&&F.length===1)F.length=0;else F.splice(E,1)}emit(D,u,F){if(this.emitted[D])return!1;this.emitted[D]=!0;let E=!1;for(let C of this.listeners[D])E=C(u,F)===!0||E;if(D==="exit")E=this.emit("afterExit",u,F)||E;return E}}class wE{}var Q4=(D)=>{return{onExit(u,F){return D.onExit(u,F)},load(){return D.load()},unload(){return D.unload()}}};class Tc extends wE{onExit(){return()=>{}}load(){}unload(){}}class rc extends wE{#F=_E.platform==="win32"?"SIGINT":"SIGHUP";#u=new Uc;#D;#C;#h;#t={};#c=!1;constructor(D){super();this.#D=D,this.#t={};for(let u of Eu)this.#t[u]=()=>{let F=this.#D.listeners(u),{count:E}=this.#u,C=D;if(typeof C.__signal_exit_emitter__==="object"&&typeof C.__signal_exit_emitter__.count==="number")E+=C.__signal_exit_emitter__.count;if(F.length===E){this.unload();let c=this.#u.emit("exit",null,u),t=u==="SIGHUP"?this.#F:u;if(!c)D.kill(D.pid,t)}};this.#h=D.reallyExit,this.#C=D.emit}onExit(D,u){if(!U2(this.#D))return()=>{};if(this.#c===!1)this.load();let F=u?.alwaysLast?"afterExit":"exit";return this.#u.on(F,D),()=>{if(this.#u.removeListener(F,D),this.#u.listeners.exit.length===0&&this.#u.listeners.afterExit.length===0)this.unload()}}load(){if(this.#c)return;this.#c=!0,this.#u.count+=1;for(let D of Eu)try{let u=this.#t[D];if(u)this.#D.on(D,u)}catch(u){}this.#D.emit=(D,...u)=>{return this.#_(D,...u)},this.#D.reallyExit=(D)=>{return this.#E(D)}}unload(){if(!this.#c)return;this.#c=!1,Eu.forEach((D)=>{let u=this.#t[D];if(!u)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,u)}catch(F){}}),this.#D.emit=this.#C,this.#D.reallyExit=this.#h,this.#u.count-=1}#E(D){if(!U2(this.#D))return 0;return this.#D.exitCode=D||0,this.#u.emit("exit",this.#D.exitCode,null),this.#h.call(this.#D,this.#D.exitCode)}#_(D,...u){let F=this.#C;if(D==="exit"&&U2(this.#D)){if(typeof u[0]==="number")this.#D.exitCode=u[0];let E=F.call(this.#D,D,...u);return this.#u.emit("exit",this.#D.exitCode,null),E}else return F.call(this.#D,D,...u)}}var _E=globalThis.process,{onExit:Oc,load:UN,unload:TN}=Q4(U2(_E)?new rc(_E):new Tc);var bc=T2.stderr.isTTY?T2.stderr:T2.stdout.isTTY?T2.stdout:void 0,P4=bc?Nc(()=>{Oc(()=>{bc.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Lc=P4;var r2=!1,zu={};zu.show=(D=mc.stderr)=>{if(!D.isTTY)return;r2=!1,D.write("\x1B[?25h")};zu.hide=(D=mc.stderr)=>{if(!D.isTTY)return;Lc(),r2=!0,D.write("\x1B[?25l")};zu.toggle=(D,u)=>{if(D!==void 0)r2=D;if(r2)zu.show(u);else zu.hide(u)};var RE=zu;var _0=Q($E(),1);import SD from"process";function SE(){if(SD.platform!=="win32")return SD.env.TERM!=="linux";return Boolean(SD.env.CI)||Boolean(SD.env.WT_SESSION)||Boolean(SD.env.TERMINUS_SUBLIME)||SD.env.ConEmuTask==="{cmd::Cmder}"||SD.env.TERM_PROGRAM==="Terminus-Sublime"||SD.env.TERM_PROGRAM==="vscode"||SD.env.TERM==="xterm-256color"||SD.env.TERM==="alacritty"||SD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var j4={info:$D.blue("\u2139"),success:$D.green("\u2714"),warning:$D.yellow("\u26A0"),error:$D.red("\u2716")},k4={info:$D.blue("i"),success:$D.green("\u221A"),warning:$D.yellow("\u203C"),error:$D.red("\xD7")},y4=SE()?j4:k4,A0=y4;function IE({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var v4=IE();function h0(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(v4,"")}function Xc(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function zc(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function Gc(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function l4(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function Mc(D,{ambiguousAsWide:u=!1}={}){if(l4(D),zc(D)||Gc(D)||u&&Xc(D))return 2;return 1}var qc=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g};var d4=new Intl.Segmenter,s4=/^\p{Default_Ignorable_Code_Point}$/u;function NE(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:E=!1}=u;if(!E)D=h0(D);if(D.length===0)return 0;let C=0,c={ambiguousAsWide:!F};for(let{segment:t}of d4.segment(D)){let n=t.codePointAt(0);if(n<=31||n>=127&&n<=159)continue;if(n>=8203&&n<=8207||n===65279)continue;if(n>=768&&n<=879||n>=6832&&n<=6911||n>=7616&&n<=7679||n>=8400&&n<=8447||n>=65056&&n<=65071)continue;if(n>=55296&&n<=57343)continue;if(n>=65024&&n<=65039)continue;if(s4.test(t))continue;if(qc().test(t)){C+=2;continue}C+=Mc(n,c)}return C}function UE({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import Zc from"process";function TE(){let{env:D}=Zc,{TERM:u,TERM_PROGRAM:F}=D;if(Zc.platform!=="win32")return u!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||F==="Terminus-Sublime"||F==="vscode"||u==="xterm-256color"||u==="alacritty"||u==="rxvt-unicode"||u==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import WD from"process";var g4=3;class Jc{#F=0;start(){if(this.#F++,this.#F===1)this.#u()}stop(){if(this.#F<=0)throw Error("`stop` called more times than `start`");if(this.#F--,this.#F===0)this.#D()}#u(){if(WD.platform==="win32"||!WD.stdin.isTTY)return;WD.stdin.setRawMode(!0),WD.stdin.on("data",this.#C),WD.stdin.resume()}#D(){if(!WD.stdin.isTTY)return;WD.stdin.off("data",this.#C),WD.stdin.pause(),WD.stdin.setRawMode(!1)}#C(D){if(D[0]===g4)WD.emit("SIGINT")}}var e4=new Jc,rE=e4;var o4=Q($E(),1);class Kc{#F=0;#u=!1;#D=0;#C=-1;#h=0;#t;#c;#E;#_;#R;#f;#B;#A;#$;#n;#i;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#t={color:"cyan",stream:b2.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#R=this.#t.interval,this.#E=this.#t.stream,this.#f=typeof this.#t.isEnabled==="boolean"?this.#t.isEnabled:UE({stream:this.#E}),this.#B=typeof this.#t.isSilent==="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,b2.env.NODE_ENV==="test")this._stream=this.#E,this._isEnabled=this.#f,Object.defineProperty(this,"_linesToClear",{get(){return this.#F},set(u){this.#F=u}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#C}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#A}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#A=D,this.#w()}get interval(){return this.#R??this.#c.interval??100}get spinner(){return this.#c}set spinner(D){if(this.#C=-1,this.#R=void 0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#c=D}else if(!TE())this.#c=_0.default.line;else if(D===void 0)this.#c=_0.default.dots;else if(D!=="default"&&_0.default[D])this.#c=_0.default[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#$}set text(D=""){this.#$=D,this.#w()}get prefixText(){return this.#n}set prefixText(D=""){this.#n=D,this.#w()}get suffixText(){return this.#i}set suffixText(D=""){this.#i=D,this.#w()}get isSpinning(){return this.#_!==void 0}#S(D=this.#n,u=" "){if(typeof D==="string"&&D!=="")return D+u;if(typeof D==="function")return D()+u;return""}#I(D=this.#i,u=" "){if(typeof D==="string"&&D!=="")return u+D;if(typeof D==="function")return u+D();return""}#w(){let D=this.#E.columns??80,u=this.#S(this.#n,"-"),F=this.#I(this.#i,"-"),E=" ".repeat(this.#A)+u+"--"+this.#$+"--"+F;this.#D=0;for(let C of h0(E).split(`
|
|
413
|
+
`))this.#D+=Math.max(1,Math.ceil(NE(C,{countAnsiEscapeCodes:!0})/D))}get isEnabled(){return this.#f&&!this.#B}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#f=D}get isSilent(){return this.#B}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#B=D}frame(){let D=Date.now();if(this.#C===-1||D-this.#h>=this.interval)this.#C=++this.#C%this.#c.frames.length,this.#h=D;let{frames:u}=this.#c,F=u[this.#C];if(this.color)F=$D[this.color](F);let E=typeof this.#n==="string"&&this.#n!==""?this.#n+" ":"",C=typeof this.text==="string"?" "+this.text:"",c=typeof this.#i==="string"&&this.#i!==""?" "+this.#i:"";return E+F+C+c}clear(){if(!this.#f||!this.#E.isTTY)return this;this.#E.cursorTo(0);for(let D=0;D<this.#F;D++){if(D>0)this.#E.moveCursor(0,-1);this.#E.clearLine(1)}if(this.#A||this.lastIndent!==this.#A)this.#E.cursorTo(this.#A);return this.lastIndent=this.#A,this.#F=0,this}render(){if(this.#B)return this;return this.clear(),this.#E.write(this.frame()),this.#F=this.#D,this}start(D){if(D)this.text=D;if(this.#B)return this;if(!this.#f){if(this.text)this.#E.write(`- ${this.text}
|
|
414
|
+
`);return this}if(this.isSpinning)return this;if(this.#t.hideCursor)RE.hide(this.#E);if(this.#t.discardStdin&&b2.stdin.isTTY)this.#u=!0,rE.start();return this.render(),this.#_=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#f)return this;if(clearInterval(this.#_),this.#_=void 0,this.#C=0,this.clear(),this.#t.hideCursor)RE.show(this.#E);if(this.#t.discardStdin&&b2.stdin.isTTY&&this.#u)rE.stop(),this.#u=!1;return this}succeed(D){return this.stopAndPersist({symbol:A0.success,text:D})}fail(D){return this.stopAndPersist({symbol:A0.error,text:D})}warn(D){return this.stopAndPersist({symbol:A0.warning,text:D})}info(D){return this.stopAndPersist({symbol:A0.info,text:D})}stopAndPersist(D={}){if(this.#B)return this;let u=D.prefixText??this.#n,F=this.#S(u," "),E=D.symbol??" ",C=D.text??this.text,t=typeof C==="string"?(E?" ":"")+C:"",n=D.suffixText??this.#i,i=this.#I(n," "),f=F+E+t+i+`
|
|
415
|
+
`;return this.stop(),this.#E.write(f),this}}function DD(D){return new Kc(D)}var ID=Q(mD(),1),x4=zD("cli");function a4(D){if(D.includes("-"))return D;if(D.length===8)return`${D.slice(0,4)}-${D.slice(4)}`;return D}async function OE(){let D=DD("Connecting to server...").start();try{let u=await g();if(u.isValid&&!u.isExpired){D.succeed(ID.default.green("Already logged in"));return}Z("cli_login_started");let F=null,E=null,C="starting",c=await Kt.startAuth({onCodeReceived:(t)=>{if(F=t.user_code,E=t.verification_uri_complete,D.stop(),console.log(),console.log("Your verification code:"),console.log(),console.log(` ${ID.default.bold(ID.default.green(a4(F)))}`),console.log(),E)console.log(ID.default.dim(`Opening browser to: ${E}`));console.log(),D.start("Waiting for authorization...")},onStatusChange:(t)=>{C=t},onSuccess:()=>{C="approved"},onError:(t)=>{D.fail(ID.default.red(`Error: ${t.message}`)),process.exit(1)}});if(c.success)Z("cli_login_completed",{success:!0}),D.succeed(ID.default.green("Login successful!"));else if(c.error){if(Z("cli_login_completed",{success:!1,reason:C}),C==="denied")D.fail(ID.default.red("Authorization denied"));else if(C==="expired")D.fail(ID.default.red("Code expired. Please try again."));else D.fail(ID.default.red(`Error: ${c.error.message}`));process.exit(1)}}catch(u){x4.error("Login failed",u),Z("cli_login_completed",{success:!1}),D.fail(ID.default.red(u instanceof Error?u.message:String(u))),process.exit(1)}}var L2=Q(mD(),1),p4=zD("cli");async function bE(){let D=DD("Checking session...").start();try{if(!(await g()).isValid){D.warn(L2.default.yellow("Not logged in"));return}D.text="Logging out...";let F=await Lu();Yu(F),await F2(),await ot(),Z("cli_logout",{success:!0}),D.succeed(L2.default.green("Logged out"))}catch(u){p4.error("Logout failed",u),Z("cli_logout",{success:!1});let F=u instanceof Error?u.message:"Failed to logout";D.fail(L2.default.red(`Error: ${F}`)),process.exit(1)}}var q=Q(mD(),1);var XD={BRANCH:"\u251C\u2500\u2500 ",LAST_BRANCH:"\u2514\u2500\u2500 ",VERTICAL:"\u2502 ",EMPTY:" "};function DA(D){if(D.length===0){console.log(q.default.dim("No projects found")),console.log(q.default.dim("Create one at app.relic.so"));return}console.log(q.default.bold("Your Projects")),console.log();for(let u=0;u<D.length;u++){let F=D[u],E=u===D.length-1,C=E?XD.LAST_BRANCH:XD.BRANCH,c=E?XD.EMPTY:XD.VERTICAL,t=[];if(F.isShared)t.push("shared");if(F.isArchived)t.push("archived");let n=t.length>0?q.default.dim(` (${t.join(", ")})`):"",i=F.isArchived?q.default.dim(F.name):q.default.bold(F.name);console.log(`${q.default.dim(C)}${i}${n}`);for(let f=0;f<F.environments.length;f++){let B=F.environments[f],A=f===F.environments.length-1,h=A?XD.LAST_BRANCH:XD.BRANCH,w=A?XD.EMPTY:XD.VERTICAL,R=B.color||"white",X=R in q.default?q.default[R]:(K)=>K;console.log(`${q.default.dim(c)}${q.default.dim(h)}${X(B.name)}`);for(let K=0;K<B.folders.length;K++){let fD=B.folders[K],qu=K===B.folders.length-1?XD.LAST_BRANCH:XD.BRANCH;console.log(`${q.default.dim(c)}${q.default.dim(w)}${q.default.dim(qu)}${q.default.dim(`${fD.name}/`)}`)}}}}async function LE(){let D=DD("Connecting...").start();try{let u=await g();if(!u.isValid||u.isExpired){D.stop(),console.log(q.default.yellow("Not logged in")),console.log(q.default.dim("Run `relic login` to authenticate"));return}let F=gD();D.text="Fetching projects...";let[E,C]=await Promise.all([F.listProjects(),F.listSharedProjects()]),c=[...E.map((i)=>({...i,isShared:!1,environments:[]})),...C.map((i)=>({...i,isShared:!0,environments:[]}))];D.text="Fetching environments...";let t=await Promise.all(c.map(async(i)=>{try{let f=await F.getProjectEnvironments(i.id);return{...i,environments:f.map((B)=>({...B,folders:[]}))}}catch{return{...i,environments:[]}}}));D.text="Fetching folders...";let n=await Promise.all(t.map(async(i)=>{let f=await Promise.all(i.environments.map(async(B)=>{try{let A=await F.getEnvironmentData(B.id);return{...B,folders:A.folders}}catch{return{...B,folders:[]}}}));return{...i,environments:f}}));Z("cli_command_executed",{command:"projects",count:n.length}),D.stop(),DA(n)}catch(u){let F=u instanceof Error?u.message:"Failed to fetch projects";if(F.includes("Not authenticated")||F.includes("JWT")||F.includes("token")){D.stop(),console.log(q.default.yellow("Not logged in")),console.log(q.default.dim("Run `relic login` to authenticate"));return}D.fail(q.default.red(`Error: ${F}`)),process.exit(1)}}import{ptr as ac}from"bun:ffi";import{Database as uA}from"bun:sqlite";var Gu=null;function FA(D){D.run(`
|
|
416
|
+
CREATE TABLE IF NOT EXISTS projects (
|
|
417
|
+
id TEXT PRIMARY KEY,
|
|
418
|
+
encrypted_project_key TEXT NOT NULL
|
|
419
|
+
)
|
|
420
|
+
`),D.run(`
|
|
421
|
+
CREATE TABLE IF NOT EXISTS environments (
|
|
422
|
+
id TEXT PRIMARY KEY,
|
|
423
|
+
project_id TEXT NOT NULL,
|
|
424
|
+
name TEXT NOT NULL
|
|
425
|
+
)
|
|
426
|
+
`),D.run(`
|
|
427
|
+
CREATE TABLE IF NOT EXISTS folders (
|
|
428
|
+
id TEXT PRIMARY KEY,
|
|
429
|
+
project_id TEXT NOT NULL,
|
|
430
|
+
environment_id TEXT NOT NULL,
|
|
431
|
+
name TEXT NOT NULL
|
|
432
|
+
)
|
|
433
|
+
`),D.run(`
|
|
434
|
+
CREATE TABLE IF NOT EXISTS secrets (
|
|
435
|
+
id TEXT PRIMARY KEY,
|
|
436
|
+
project_id TEXT NOT NULL,
|
|
437
|
+
environment_id TEXT NOT NULL,
|
|
438
|
+
folder_id TEXT,
|
|
439
|
+
key TEXT NOT NULL,
|
|
440
|
+
encrypted_value TEXT NOT NULL,
|
|
441
|
+
scope TEXT NOT NULL,
|
|
442
|
+
value_type TEXT NOT NULL
|
|
443
|
+
)
|
|
444
|
+
`),D.run(`
|
|
445
|
+
CREATE TABLE IF NOT EXISTS secrets_cache_meta (
|
|
446
|
+
project_id TEXT NOT NULL,
|
|
447
|
+
environment_id TEXT NOT NULL,
|
|
448
|
+
folder_id TEXT NOT NULL DEFAULT '__root__',
|
|
449
|
+
last_cached_at INTEGER NOT NULL,
|
|
450
|
+
PRIMARY KEY (project_id, environment_id, folder_id)
|
|
451
|
+
)
|
|
452
|
+
`)}async function Qc(){if(Gu)return Gu;let D=await i0();if(!D)throw Error("No relic.toml found. Run 'relic init' first.");let u=Cc(D.rootDir);return Gu=new uA(u,{create:!0}),Gu.run("PRAGMA journal_mode = WAL;"),FA(Gu),Gu}function Pc(D,u,F){D.prepare("INSERT OR REPLACE INTO projects (id, encrypted_project_key) VALUES (?, ?)").run(u,F)}function Vc(D,u,F){let E=D.prepare("INSERT OR REPLACE INTO environments (id, project_id, name) VALUES (?, ?, ?)");for(let C of F)E.run(C.id,u,C.name)}function jc(D,u,F){let E=D.prepare("INSERT OR REPLACE INTO folders (id, project_id, environment_id, name) VALUES (?, ?, ?, ?)");for(let C of F)E.run(C.id,u,C.environmentId,C.name)}function kc(D,u,F,E,C,c){let t=E??null;if(t)D.prepare("DELETE FROM secrets WHERE project_id = ? AND environment_id = ? AND folder_id = ?").run(u,F,t);else D.prepare("DELETE FROM secrets WHERE project_id = ? AND environment_id = ? AND folder_id IS NULL").run(u,F);let n=D.prepare("INSERT INTO secrets (id, project_id, environment_id, folder_id, key, encrypted_value, scope, value_type) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");for(let f of C)n.run(f.id,u,F,t,f.key,f.encryptedValue,f.scope,f.valueType);let i=E??"__root__";D.prepare("INSERT OR REPLACE INTO secrets_cache_meta (project_id, environment_id, folder_id, last_cached_at) VALUES (?, ?, ?, ?)").run(u,F,i,c)}function yc(D,u,F){return D.prepare("SELECT id FROM environments WHERE project_id = ? AND LOWER(name) = LOWER(?)").get(u,F)?.id??null}function vc(D,u,F,E){return D.prepare("SELECT id FROM folders WHERE project_id = ? AND environment_id = ? AND LOWER(name) = LOWER(?)").get(u,F,E)?.id??null}function lc(D,u,F,E,C){let c=E??null,t=C?" AND scope = ?":"",n=c?D.prepare(`SELECT id, key, encrypted_value AS encryptedValue, scope, value_type AS valueType FROM secrets WHERE project_id = ? AND environment_id = ? AND folder_id = ?${t}`):D.prepare(`SELECT id, key, encrypted_value AS encryptedValue, scope, value_type AS valueType FROM secrets WHERE project_id = ? AND environment_id = ? AND folder_id IS NULL${t}`),i=c?[u,F,c]:[u,F];if(C)i.push(C);let f=n.all(...i);if(f.length===0)return null;return f}function dc(D,u,F,E){let C=E??"__root__";return D.prepare("SELECT last_cached_at FROM secrets_cache_meta WHERE project_id = ? AND environment_id = ? AND folder_id = ?").get(u,F,C)?.last_cached_at??null}function sc(D,u){return D.prepare("SELECT encrypted_project_key FROM projects WHERE id = ?").get(u)?.encrypted_project_key??null}var k=Q(mD(),1);import{dlopen as tA,FFIType as mE,suffix as EA}from"bun:ffi";var gc="https://github.com/heycupola/relic/issues",ec="https://github.com/heycupola/relic/releases";var oc={"darwin-arm64":"darwin-arm64","darwin-x64":"darwin-x64","linux-x64":"linux-x64","win32-x64":"win32-x64"};async function CA(){if(process.env.DEV==="true")return"development";let D=`${import.meta.dir}/../prebuilds`;if(await Bun.file(D).exists())return"production";let u=`${import.meta.dir}/../../../turbo.json`;if(await Bun.file(u).exists())return"development";return"production"}function cA(){return`${import.meta.dir}/../../../packages/runner`}function nA(){return process.platform==="win32"?"relic_runner.dll":`librelic_runner.${EA}`}function iA(D){return Error(`Rust library not found for ${D}.
|
|
453
|
+
|
|
454
|
+
This appears to be a packaging issue. Please try reinstalling:
|
|
455
|
+
- If installed via package manager: uninstall and reinstall relic
|
|
456
|
+
- If using binaries: re-download from ${ec}
|
|
457
|
+
|
|
458
|
+
If the problem persists, report at: ${gc}`)}function fA(D){return Error(`Rust library not found for ${D}.
|
|
459
|
+
|
|
460
|
+
Build the runner first:
|
|
461
|
+
cd packages/runner && cargo build --release`)}async function BA(D,u){let F=[`${import.meta.dir}/${u}`,`${import.meta.dir}/../lib/${u}`,`${import.meta.dir}/../prebuilds/${D}/${u}`];for(let E of F)if(await Bun.file(E).exists())return E;return null}async function AA(D,u){let F=cA(),E=[`${F}/target/release/${u}`,`${F}/target/debug/${u}`,`${F}/prebuilt/${D}/${u}`];for(let C of E)if(await Bun.file(C).exists())return C;return null}async function hA(){let D=`${process.platform}-${process.arch}`,u=oc[D];if(!u)throw Error(`Unsupported platform: ${D}. Supported platforms: ${Object.keys(oc).join(", ")}`);let F=nA();if(await CA()==="production"){let c=await BA(u,F);if(c)return c;throw iA(D)}let C=await AA(u,F);if(C)return C;throw fA(D)}async function xc(){return tA(await hA(),{run_with_secrets:{args:[mE.cstring,mE.cstring],returns:mE.i32}})}class iD{lib;static instance=null;static instancePromise=null;constructor(D){this.lib=D}static async getInstance(){if(iD.instance)return iD.instance;if(iD.instancePromise)return iD.instancePromise;return iD.instancePromise=(async()=>{let D=await xc();return iD.instance=new iD(D),iD.instance})(),iD.instancePromise}runWithSecrets(D,u){return this.lib.symbols.run_with_secrets(D,u)}}f2();class Mu extends Error{code;originalError;constructor(D,u,F){super(D);this.code=u;this.originalError=F;this.name="ProjectKeyError"}}async function YE(D,u,F){let E=await tu();if(!E)throw new Mu("No password available. Run 'relic login' and set up your password first.","NO_PASSWORD");try{return await lt(D,u,E,F)}catch(C){let c=C instanceof Error?C.message:String(C);if(lu("cli",C,{action:"decrypt_project_key"}),c.includes("DECRYPTION_FAILED")||c.includes("incorrect password"))throw new Mu("Failed to decrypt project key. Your stored password may be incorrect.","DECRYPTION_FAILED",C instanceof Error?C:Error(String(C)));throw new Mu(`Failed to unwrap project key: ${c}`,"UNKNOWN",C instanceof Error?C:Error(String(C)))}}async function _A(D,u){return await dt(D,u)}async function HE(D,u){let F=[];for(let E of u)try{let C=await _A(D,E.encryptedValue);F.push({key:E.key,value:C})}catch(C){throw lu("cli",C,{action:"decrypt_secret"}),Error(`Failed to decrypt secret "${E.key}": ${C}`)}return F}var wA=zD("cli");function pc(){return!!process.env.RELIC_API_KEY}async function RA(D,u){let F=A2(D);if(F)return{encryptedPrivateKey:F.encryptedPrivateKey,salt:F.salt,fromCache:!0};let E=await at(u);return mu(D,{encryptedPrivateKey:E.encryptedPrivateKey,salt:E.salt,publicKey:E.publicKey,keysUpdatedAt:Date.now()}),{encryptedPrivateKey:E.encryptedPrivateKey,salt:E.salt,fromCache:!1}}async function $A(D,u){let F=process.env.RELIC_API_KEY;if(!F)throw Error("RELIC_API_KEY is required for API key mode.");let E=await tu();if(!E)throw Error("RELIC_PASSWORD is required for API key mode.");let C=await Lu(),c=await RA(C,F),t=await d8(F,{projectId:D,environmentName:u.environment,folderName:u.folder,scope:u.scope});if(t.count===0)throw Error("No secrets found");let{unwrapProjectKey:n}=await Promise.resolve().then(() => (f2(),P8)),i;try{i=await n(t.encryptedProjectKey,c.encryptedPrivateKey,E,c.salt)}catch(A){if(!c.fromCache)throw A;Yu(C);let h=await at(F);mu(C,{encryptedPrivateKey:h.encryptedPrivateKey,salt:h.salt,publicKey:h.publicKey,keysUpdatedAt:Date.now()}),i=await n(t.encryptedProjectKey,h.encryptedPrivateKey,E,h.salt)}let f=await HE(i,t.secrets.map((A)=>({key:A.key,encryptedValue:A.encryptedValue}))),B={};for(let A of f)B[A.key]=A.value;return{secrets:B,count:t.count}}async function SA(D,u){let F=A2(D);if(F)return{encryptedPrivateKey:F.encryptedPrivateKey,salt:F.salt,fromCache:!0};let E=await u.getFullUser();if(!E.encryptedPrivateKey||!E.salt)throw Error("No encryption keys found. Run 'relic tui' to set up your keys first.");return mu(D,{encryptedPrivateKey:E.encryptedPrivateKey,salt:E.salt,keysUpdatedAt:E.keysUpdatedAt??Date.now()}),{encryptedPrivateKey:E.encryptedPrivateKey,salt:E.salt,fromCache:!1}}async function IA(D,u,F,E){let C=yc(D,u,F.environment);if(C){let n=F.folder?vc(D,u,C,F.folder):null,i=F.folder?!!n:!0,f=i?dc(D,u,C,n??void 0):null,B=null;if(f!==null){let h=await E.getSecretsCacheValidation(u,C,n??void 0);if(h)B=h.updatedAt}if(i&&f&&B&&f>=B){let h=lc(D,u,C,n??void 0,F.scope),w=sc(D,u);if(h&&w)return{secrets:h,encryptedProjectKey:w}}}let c=await E.exportSecrets({projectId:u,environmentName:F.environment,folderName:F.folder});if(c.count===0)throw Error("No secrets found");if(Pc(D,u,c.encryptedProjectKey),Vc(D,u,[{id:c.environmentId,name:F.environment}]),c.folderId&&F.folder)jc(D,u,[{id:c.folderId,environmentId:c.environmentId,name:F.folder}]);return kc(D,u,c.environmentId,c.folderId??void 0,c.secrets,Date.now()),{secrets:F.scope?c.secrets.filter((n)=>n.scope===F.scope):c.secrets,encryptedProjectKey:c.encryptedProjectKey}}async function NA(D,u,F,E,C,c){try{return await YE(D,u,F)}catch(t){let n=t instanceof Mu&&t.code==="DECRYPTION_FAILED";if(E&&n){Yu(C);let i=await c.getFullUser();if(!i.encryptedPrivateKey||!i.salt)throw Error("No encryption keys found. Run 'relic tui' to set up your keys first.");return mu(C,{encryptedPrivateKey:i.encryptedPrivateKey,salt:i.salt,keysUpdatedAt:i.keysUpdatedAt??Date.now()}),await YE(D,i.encryptedPrivateKey,i.salt)}throw t}}async function UA(D,u,F,E,C){let c=await SA(E,C),{secrets:t,encryptedProjectKey:n}=await IA(F,D,u,C),i=await NA(n,c.encryptedPrivateKey,c.salt,c.fromCache,E,C),f=await HE(i,t.map((A)=>({key:A.key,encryptedValue:A.encryptedValue}))),B={};for(let A of f)B[A.key]=A.value;return{secrets:B,count:t.length}}function un(D){if(D.project)return D.project;if(process.env.RELIC_PROJECT_ID)return process.env.RELIC_PROJECT_ID;return null}async function TA(D,u,F){let E=DD("Authenticating with API key...").start(),C=un(u);if(!C){let c=await i0();if(c)return Dn(D,u,c.config.project_id,E,F);E.fail(k.default.red("Project ID is required. Use --project <id> or set RELIC_PROJECT_ID.")),process.exit(1)}return Dn(D,u,C,E,F)}async function Dn(D,u,F,E,C){E.text="Fetching secrets via API key...";let{secrets:c,count:t}=await $A(F,u);E.succeed(k.default.green(`Injected ${t} secret${t!==1?"s":""}`)),await Fn(D,c,t,C)}async function rA(D,u,F){let E=DD("Checking authentication...").start(),C=await g();if(!C.isValid||C.isExpired)E.fail(k.default.red("Not logged in. Run 'relic login' first.")),process.exit(1);if(E.text="Verifying password...",!await et())E.fail(k.default.red("No password set. Run 'relic tui' to set up your password first.")),process.exit(1);if(!await tu())E.fail(k.default.red("Could not retrieve password. Please re-authenticate.")),process.exit(1);E.text="Loading configuration...";let t=await i0();if(!t)E.fail(k.default.red("No relic.toml found. Run 'relic init' first.")),process.exit(1);let n=un(u)??t.config.project_id;E.text="Preparing secrets...";let i=await Qc(),f=await Lu(),B=gD(),{secrets:A,count:h}=await UA(n,u,i,f,B);E.succeed(k.default.green(`Injected ${h} secret${h!==1?"s":""}`)),await Fn(D,A,h,F)}async function Fn(D,u,F,E){let C=await iD.getInstance(),c=JSON.stringify(D),t=JSON.stringify(u),n=Buffer.from(`${c}\x00`,"utf-8"),i=Buffer.from(`${t}\x00`,"utf-8"),f=ac(n),B=ac(i),A=-1;try{A=C.runWithSecrets(f,B)}finally{n.fill(0),i.fill(0)}Z("cli_run_completed",{secret_count:F,exit_code:A,duration_ms:Date.now()-E}),process.exit(A)}async function WE(D,u){if(!u.environment)console.error(k.default.red("Error: --env is required")),process.exit(1);if(D.length===0)console.error(k.default.red("Error: No command specified")),process.exit(1);if(u.scope&&!["client","server","shared"].includes(u.scope.toLowerCase()))console.error(k.default.red("Error: --scope must be: client, server, or shared")),process.exit(1);if(u.scope)u.scope=u.scope.toLowerCase();let F=Date.now();Z("cli_run_started",{has_folder:!!u.folder,has_scope:!!u.scope,mode:pc()?"api_key":"session"});try{if(pc())await TA(D,u,F);else await rA(D,u,F)}catch(E){if(wA.error("Run failed",E),Z("cli_run_completed",{success:!1,duration_ms:Date.now()-F}),E instanceof E0){if(DD().fail(k.default.red(E.message)),console.log(),console.log(k.default.dim(" Upgrade at: ")+k.default.underline(E.upgradeUrl)),console.log(),process.stdin.isTTY){let n=(await import("readline")).createInterface({input:process.stdin,output:process.stdout});console.log(k.default.dim(" Press Enter to open the upgrade page, or Ctrl+C to exit.")),await new Promise((f)=>n.once("line",()=>{n.close(),f()})),await(await Promise.resolve().then(() => (Zt(),qt))).default(E.upgradeUrl)}process.exit(1)}DD().fail(k.default.red(E instanceof Error?E.message:String(E))),process.exit(1)}}var KD=Q(mD(),1);async function tn(){let D=g2();if(D===null)console.log(`Telemetry: ${KD.default.green("enabled")} ${KD.default.dim("(default)")}`);else if(D)console.log(`Telemetry: ${KD.default.green("enabled")}`);else console.log(`Telemetry: ${KD.default.yellow("disabled")}`);console.log(),console.log(KD.default.dim("Relic collects anonymous usage data to improve the product.")),console.log(KD.default.dim("No secrets, project names, or personal data are ever collected."))}async function En(){nu(!0),console.log(KD.default.green("Telemetry enabled"))}async function Cn(){nu(!1),console.log(KD.default.yellow("Telemetry disabled"))}var ND=Q(mD(),1);async function XE(){let D=DD("Fetching user info...").start();try{let u=await g();if(!u.isValid||u.isExpired){D.stop(),console.log(ND.default.yellow("Not logged in")),console.log(ND.default.dim("Run `relic login` to authenticate"));return}let E=await gD().getCurrentUser();Z("cli_command_executed",{command:"whoami"}),D.stop(),console.log(ND.default.bold("Logged in as:")),console.log(),console.log(`${ND.default.dim("Name:")} ${E.name}`),console.log(`${ND.default.dim("Email:")} ${E.email}`),console.log(`${ND.default.dim("Plan:")} ${E.hasPro?ND.default.green("Pro"):"Free"}`)}catch(u){let F=u instanceof Error?u.message:"Failed to fetch user";if(F.includes("Not authenticated")||F.includes("JWT")||F.includes("token")){D.stop(),console.log(ND.default.yellow("Not logged in")),console.log(ND.default.dim("Run `relic login` to authenticate"));return}D.fail(ND.default.red(`Error: ${F}`)),process.exit(1)}}var cn={name:"relic",version:"0.4.1",description:"The Relic CLI for managing and sharing secrets. Encrypted on your device, never exposed to anyone else. Not even us.",keywords:["cli","tui"],repository:{type:"git",url:"https://github.com/heycupola/relic.git",directory:"apps/cli"},author:"Can Vardar",license:"MIT",module:"index.ts",type:"module",bin:{relic:"dist/cli.js"},scripts:{build:"bun run scripts/build.ts","build:runner":"cd ../../packages/runner && cargo build --release",prepublishOnly:"bun run build","dev:cli":"DEV=true bun run build:runner && bun run index.ts","log:watch":"bun run ../../packages/logger/scripts/watch.ts",lint:"biome check --write .",format:"biome format --write .","check-types":"tsc --noEmit",test:"bun test"},files:["dist/**","prebuilds/**","README.md"],dependencies:{argon2:"^0.41.1"},devDependencies:{"@clack/prompts":"^0.11.0","@repo/auth":"*","@repo/backend":"*","@repo/crypto":"*","@repo/logger":"*","@repo/tui":"*","@repo/typescript-config":"*","@types/bun":"latest","bun-types":"^1.3.1",commander:"^13.1.0",convex:"catalog:",open:"^11.0.0",ora:"^8.2.0",picocolors:"^1.1.1","smol-toml":"^1.6.0"},peerDependencies:{typescript:"^5"},engines:{node:">=18"}};await d1();if(e2())console.log(z.default.dim("Relic collects anonymous usage data to improve the product. Run `relic telemetry disable` to opt out.")),nu(!0);function LA(){console.error(z.default.dim(` Available commands:
|
|
462
|
+
`));for(let D of QD.commands)console.error(` ${z.default.cyan(D.name().padEnd(14))} ${z.default.dim(D.description())}`)}function mA(){console.error(`
|
|
463
|
+
${z.default.dim(`Run ${z.default.white("relic --help")} for more information.`)}
|
|
464
|
+
`)}var QD=new AC().name("relic").description("Zero-knowledge secret layer for your projects").version(cn.version).exitOverride().configureOutput({outputError:()=>{}}).action(async()=>{process.env._RELIC_FROM_CLI="true",await Promise.resolve().then(() => bA)});QD.command("login").description("Authenticate with Relic").action(OE);QD.command("logout").description("Clear authentication").action(bE);QD.command("whoami").description("Show current user").action(XE);QD.command("projects").description("List all projects").action(LE);QD.command("init").description("Initialize Relic for the current project").action(CE);var zE=QD.command("telemetry").description("Manage anonymous usage data collection");zE.command("status").description("Show telemetry status").action(tn);zE.command("enable").description("Enable telemetry").action(En);zE.command("disable").description("Disable telemetry").action(Cn);QD.command("run").description("Run a command with secrets injected as environment variables").requiredOption("-e, --environment <name>","Environment name (required)").option("-f, --folder <name>","Folder name (optional)").option("-s, --scope <scope>","Scope filter: client, server, or shared (optional)").option("-p, --project <id>","Project ID (optional, defaults to relic.toml or RELIC_PROJECT_ID)").argument("<command...>","Command to run").action((D,u)=>{WE(D,u)});try{QD.parse()}catch(D){if(D instanceof BC){if(D.code==="commander.helpDisplayed"||D.code==="commander.version")process.exit(0);let u=D.message.replace(/^error:\s*/i,"");if(console.error(),D.code==="commander.unknownCommand"||D.code==="commander.excessArguments"){let F=D.message.match(/'(.+?)'/)?.[1]??process.argv.find((E)=>!E.startsWith("-")&&E!==process.argv[0]&&E!==process.argv[1]);console.error(` ${z.default.red(z.default.bold("Unknown command:"))} ${z.default.white(F??"unknown")}`),console.error(),LA()}else if(D.code==="commander.missingArgument")console.error(` ${z.default.red(z.default.bold("Missing argument:"))} ${z.default.dim(u)}`);else if(D.code==="commander.missingMandatoryOptionValue")console.error(` ${z.default.red(z.default.bold("Missing required option:"))} ${z.default.dim(u)}`);else if(D.code==="commander.optionMissingArgument")console.error(` ${z.default.red(z.default.bold("Option missing argument:"))} ${z.default.dim(u)}`);else console.error(` ${z.default.red(z.default.bold("Error:"))} ${z.default.dim(u)}`);mA(),process.exit(1)}throw D}
|