@capgo/cli 4.21.36 → 4.22.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/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var XL=Object.create;var el=Object.defineProperty;var ZL=Object.getOwnPropertyDescriptor;var QL=Object.getOwnPropertyNames;var eB=Object.getPrototypeOf,tB=Object.prototype.hasOwnProperty;var ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mn=(t,e)=>{for(var r in e)el(t,r,{get:e[r],enumerable:!0})},ow=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of QL(e))!tB.call(t,i)&&i!==r&&el(t,i,{get:()=>e[i],enumerable:!(n=ZL(e,i))||n.enumerable});return t};var fe=(t,e,r)=>(r=t!=null?XL(eB(t)):{},ow(e||!t||!t.__esModule?el(r,"default",{value:t,enumerable:!0}):r,t)),Ae=t=>ow(el({},"__esModule",{value:!0}),t);var $a=y(wp=>{var tl=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},bp=class extends tl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};wp.CommanderError=tl;wp.InvalidArgumentError=bp});var rl=y(Ep=>{var{InvalidArgumentError:rB}=$a(),_p=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new rB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function nB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Ep.Argument=_p;Ep.humanReadableArgName=nB});var Sp=y(sw=>{var{humanReadableArgName:iB}=rl(),Cp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>iB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(p,b){if(b){let g=`${p.padEnd(n+s)}${b}`;return r.wrap(g,i-o,n+s)}return p}function u(p){return p.join(`
2
+ "use strict";var JL=Object.create;var el=Object.defineProperty;var XL=Object.getOwnPropertyDescriptor;var ZL=Object.getOwnPropertyNames;var QL=Object.getPrototypeOf,eB=Object.prototype.hasOwnProperty;var ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mn=(t,e)=>{for(var r in e)el(t,r,{get:e[r],enumerable:!0})},ow=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ZL(e))!eB.call(t,i)&&i!==r&&el(t,i,{get:()=>e[i],enumerable:!(n=XL(e,i))||n.enumerable});return t};var le=(t,e,r)=>(r=t!=null?JL(QL(t)):{},ow(e||!t||!t.__esModule?el(r,"default",{value:t,enumerable:!0}):r,t)),Ae=t=>ow(el({},"__esModule",{value:!0}),t);var $a=y(wp=>{var tl=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},bp=class extends tl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};wp.CommanderError=tl;wp.InvalidArgumentError=bp});var rl=y(Ep=>{var{InvalidArgumentError:tB}=$a(),_p=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new tB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function rB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Ep.Argument=_p;Ep.humanReadableArgName=rB});var Sp=y(sw=>{var{humanReadableArgName:nB}=rl(),Cp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>nB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(p,b){if(b){let g=`${p.padEnd(n+s)}${b}`;return r.wrap(g,i-o,n+s)}return p}function u(p){return p.join(`
3
3
  `).replace(/^/gm," ".repeat(o))}let c=[`Usage: ${r.commandUsage(e)}`,""],l=r.commandDescription(e);l.length>0&&(c=c.concat([r.wrap(l,i,0),""]));let f=r.visibleArguments(e).map(p=>a(r.argumentTerm(p),r.argumentDescription(p)));f.length>0&&(c=c.concat(["Arguments:",u(f),""]));let h=r.visibleOptions(e).map(p=>a(r.optionTerm(p),r.optionDescription(p)));if(h.length>0&&(c=c.concat(["Options:",u(h),""])),this.showGlobalOptions){let p=r.visibleGlobalOptions(e).map(b=>a(r.optionTerm(b),r.optionDescription(b)));p.length>0&&(c=c.concat(["Global Options:",u(p),""]))}let d=r.visibleCommands(e).map(p=>a(r.subcommandTerm(p),r.subcommandDescription(p)));return d.length>0&&(c=c.concat(["Commands:",u(d),""])),c.join(`
4
4
  `)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,n,i=40){let o=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${o}]+`);if(e.match(s))return e;let a=r-n;if(a<i)return e;let u=e.slice(0,n),c=e.slice(n).replace(`\r
5
5
  `,`
6
6
  `),l=" ".repeat(n),h="\\s\u200B",d=new RegExp(`
7
7
  |.{1,${a-1}}([${h}]|$)|[^${h}]+?([${h}]|$)`,"g"),p=c.match(d)||[];return u+p.map((b,g)=>b===`
8
8
  `?"":(g>0?l:"")+b.trimEnd()).join(`
9
- `)}};sw.Help=Cp});var Ap=y(Op=>{var{InvalidArgumentError:oB}=$a(),xp=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=aB(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new oB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return sB(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Fp=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function sB(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function aB(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Op.Option=xp;Op.DualOptions=Fp});var uw=y(aw=>{function uB(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function cB(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=uB(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
9
+ `)}};sw.Help=Cp});var Ap=y(Op=>{var{InvalidArgumentError:iB}=$a(),xp=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=sB(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new iB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return oB(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Fp=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function oB(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function sB(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Op.Option=xp;Op.DualOptions=Fp});var uw=y(aw=>{function aB(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function uB(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=aB(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
10
10
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
11
- (Did you mean ${n[0]}?)`:""}aw.suggestSimilar=cB});var hw=y(dw=>{var lB=require("node:events").EventEmitter,kp=require("node:child_process"),gn=require("node:path"),Tp=require("node:fs"),Ke=require("node:process"),{Argument:fB,humanReadableArgName:dB}=rl(),{CommanderError:Pp}=$a(),{Help:hB}=Sp(),{Option:cw,DualOptions:pB}=Ap(),{suggestSimilar:lw}=uw(),Rp=class t extends lB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>Ke.stdout.write(r),writeErr:r=>Ke.stderr.write(r),getOutHelpWidth:()=>Ke.stdout.isTTY?Ke.stdout.columns:void 0,getErrHelpWidth:()=>Ke.stderr.isTTY?Ke.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new hB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new fB(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),o=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),o&&s.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
11
+ (Did you mean ${n[0]}?)`:""}aw.suggestSimilar=uB});var hw=y(dw=>{var cB=require("node:events").EventEmitter,kp=require("node:child_process"),gn=require("node:path"),Tp=require("node:fs"),Ke=require("node:process"),{Argument:lB,humanReadableArgName:fB}=rl(),{CommanderError:Pp}=$a(),{Help:dB}=Sp(),{Option:cw,DualOptions:hB}=Ap(),{suggestSimilar:lw}=uw(),Rp=class t extends cB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>Ke.stdout.write(r),writeErr:r=>Ke.stderr.write(r),getOutHelpWidth:()=>Ke.stdout.isTTY?Ke.stdout.columns:void 0,getErrHelpWidth:()=>Ke.stderr.isTTY?Ke.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new dB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new lB(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),o=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),o&&s.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
13
13
  Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Pp(e,r,n)),Ke.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new cw(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
14
14
  - already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._concatValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof cw)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ke.versions?.electron&&(r.from="electron");let i=Ke.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ke.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Ke.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,f){let h=gn.resolve(l,f);if(Tp.existsSync(h))return h;if(i.includes(gn.extname(f)))return;let d=i.find(p=>Tp.existsSync(`${h}${p}`));if(d)return`${h}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Tp.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=gn.resolve(gn.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!e._executableFile&&this._scriptPath){let f=gn.basename(this._scriptPath,gn.extname(this._scriptPath));f!==this._name&&(l=o(a,`${f}-${e._name}`))}s=l||s}n=i.includes(gn.extname(s));let u;Ke.platform!=="win32"?n?(r.unshift(s),r=fw(Ke.execArgv).concat(r),u=kp.spawn(Ke.argv[0],r,{stdio:"inherit"})):u=kp.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=fw(Ke.execArgv).concat(r),u=kp.spawn(Ke.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{Ke.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new Pp(l,"commander.executeSubCommandAsync","(close)")):Ke.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",h=`'${s}' does not exist
15
15
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -17,73 +17,73 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
17
17
  - ${f}`;throw new Error(h)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!c)Ke.exit(1);else{let f=new Pp(1,"commander.executeSubCommandAsync","(error)");f.nestedError=l,c(f)}}),this.runningCommand=u}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0});let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((s,a)=>e(n,a,s),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=e(n,o,n.defaultValue))),r[i]=o}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r,o=e.slice();function s(u){return u.length>1&&u[0]==="-"}let a=null;for(;o.length;){let u=o.shift();if(u==="--"){i===n&&i.push(u),i.push(...o);break}if(a&&!s(u)){this.emit(`option:${a.name()}`,u);continue}if(a=null,s(u)){let c=this._findOption(u);if(c){if(c.required){let l=o.shift();l===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,l)}else if(c.optional){let l=null;o.length>0&&!s(o[0])&&(l=o.shift()),this.emit(`option:${c.name()}`,l)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let c=this._findOption(`-${u[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,u.slice(2)):(this.emit(`option:${c.name()}`),o.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let c=u.indexOf("="),l=this._findOption(u.slice(0,c));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,u.slice(c+1));continue}}if(s(u)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),o.length>0&&n.push(...o);break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u),o.length>0&&r.push(...o);break}else if(this._defaultCommandName){n.push(u),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){i.push(u),o.length>0&&i.push(...o);break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
18
18
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
19
19
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
20
- `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ke.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ke.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new pB(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=lw(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=lw(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
- `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>dB(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=gn.basename(e,gn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Ke.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
20
+ `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ke.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ke.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new hB(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=lw(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=lw(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
+ `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>fB(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=gn.basename(e,gn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Ke.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
22
22
  Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
23
- `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function fw(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}dw.Command=Rp});var yw=y(dr=>{var{Argument:pw}=rl(),{Command:$p}=hw(),{CommanderError:mB,InvalidArgumentError:mw}=$a(),{Help:gB}=Sp(),{Option:gw}=Ap();dr.program=new $p;dr.createCommand=t=>new $p(t);dr.createOption=(t,e)=>new gw(t,e);dr.createArgument=(t,e)=>new pw(t,e);dr.Command=$p;dr.Option=gw;dr.Argument=pw;dr.Help=gB;dr.CommanderError=mB;dr.InvalidArgumentError=mw;dr.InvalidOptionArgumentError=mw});var ke=y((dce,vw)=>{"use strict";var Ip="\x1B",Me=`${Ip}[`,DB="\x07",jp={to(t,e){return e?`${Me}${e+1};${t+1}H`:`${Me}${t+1}G`},move(t,e){let r="";return t<0?r+=`${Me}${-t}D`:t>0&&(r+=`${Me}${t}C`),e<0?r+=`${Me}${-e}A`:e>0&&(r+=`${Me}${e}B`),r},up:(t=1)=>`${Me}${t}A`,down:(t=1)=>`${Me}${t}B`,forward:(t=1)=>`${Me}${t}C`,backward:(t=1)=>`${Me}${t}D`,nextLine:(t=1)=>`${Me}E`.repeat(t),prevLine:(t=1)=>`${Me}F`.repeat(t),left:`${Me}G`,hide:`${Me}?25l`,show:`${Me}?25h`,save:`${Ip}7`,restore:`${Ip}8`},vB={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},bB={screen:`${Me}2J`,up:(t=1)=>`${Me}1J`.repeat(t),down:(t=1)=>`${Me}J`.repeat(t),line:`${Me}2K`,lineEnd:`${Me}K`,lineStart:`${Me}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?jp.up():"");return t&&(e+=jp.left),e}};vw.exports={cursor:jp,scroll:vB,erase:bB,beep:DB}});var _w=y((hce,Np)=>{var wB=require("tty"),_B=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||wB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),$e=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+bw(i,e,r,o)+e:t+i+e},bw=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+bw(o,e,r,s):i+o},ww=(t=_B)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?$e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?$e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?$e("\x1B[3m","\x1B[23m"):String,underline:t?$e("\x1B[4m","\x1B[24m"):String,inverse:t?$e("\x1B[7m","\x1B[27m"):String,hidden:t?$e("\x1B[8m","\x1B[28m"):String,strikethrough:t?$e("\x1B[9m","\x1B[29m"):String,black:t?$e("\x1B[30m","\x1B[39m"):String,red:t?$e("\x1B[31m","\x1B[39m"):String,green:t?$e("\x1B[32m","\x1B[39m"):String,yellow:t?$e("\x1B[33m","\x1B[39m"):String,blue:t?$e("\x1B[34m","\x1B[39m"):String,magenta:t?$e("\x1B[35m","\x1B[39m"):String,cyan:t?$e("\x1B[36m","\x1B[39m"):String,white:t?$e("\x1B[37m","\x1B[39m"):String,gray:t?$e("\x1B[90m","\x1B[39m"):String,bgBlack:t?$e("\x1B[40m","\x1B[49m"):String,bgRed:t?$e("\x1B[41m","\x1B[49m"):String,bgGreen:t?$e("\x1B[42m","\x1B[49m"):String,bgYellow:t?$e("\x1B[43m","\x1B[49m"):String,bgBlue:t?$e("\x1B[44m","\x1B[49m"):String,bgMagenta:t?$e("\x1B[45m","\x1B[49m"):String,bgCyan:t?$e("\x1B[46m","\x1B[49m"):String,bgWhite:t?$e("\x1B[47m","\x1B[49m"):String});Np.exports=ww();Np.exports.createColors=ww});var Lw=y((mce,Hp)=>{var LB=require("tty"),BB=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||LB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),je=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+jw(i,e,r,o)+e:t+i+e},jw=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+jw(o,e,r,s):i+o},Nw=(t=BB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?je("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?je("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?je("\x1B[3m","\x1B[23m"):String,underline:t?je("\x1B[4m","\x1B[24m"):String,inverse:t?je("\x1B[7m","\x1B[27m"):String,hidden:t?je("\x1B[8m","\x1B[28m"):String,strikethrough:t?je("\x1B[9m","\x1B[29m"):String,black:t?je("\x1B[30m","\x1B[39m"):String,red:t?je("\x1B[31m","\x1B[39m"):String,green:t?je("\x1B[32m","\x1B[39m"):String,yellow:t?je("\x1B[33m","\x1B[39m"):String,blue:t?je("\x1B[34m","\x1B[39m"):String,magenta:t?je("\x1B[35m","\x1B[39m"):String,cyan:t?je("\x1B[36m","\x1B[39m"):String,white:t?je("\x1B[37m","\x1B[39m"):String,gray:t?je("\x1B[90m","\x1B[39m"):String,bgBlack:t?je("\x1B[40m","\x1B[49m"):String,bgRed:t?je("\x1B[41m","\x1B[49m"):String,bgGreen:t?je("\x1B[42m","\x1B[49m"):String,bgYellow:t?je("\x1B[43m","\x1B[49m"):String,bgBlue:t?je("\x1B[44m","\x1B[49m"):String,bgMagenta:t?je("\x1B[45m","\x1B[49m"):String,bgCyan:t?je("\x1B[46m","\x1B[49m"):String,bgWhite:t?je("\x1B[47m","\x1B[49m"):String});Hp.exports=Nw();Hp.exports.createColors=Nw});var ll=y(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.isNXMonorepo=Mt.isMonorepo=Mt.findPackageRelativePathInMonorepo=Mt.findPackagePath=Mt.findNXMonorepoRoot=Mt.findMonorepoRoot=void 0;var Na=require("node:fs"),Wn=require("node:path");function cl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,Na.existsSync)(r)||(0,Na.existsSync)(e)&&JSON.parse((0,Na.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return cl(n)}Mt.findMonorepoRoot=cl;function Jp(t){let e=(0,Wn.join)(t,"nx.json");if((0,Na.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Jp(r)}Mt.findNXMonorepoRoot=Jp;function Xp(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,Na.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return Xp(t,i,r)}Mt.findPackagePath=Xp;function WB(t,e){let r=cl(e),n=Xp(t,e,r);return n?(0,Wn.relative)(e,n):null}Mt.findPackageRelativePathInMonorepo=WB;function KB(t){try{return cl(t),!0}catch{return!1}}Mt.isMonorepo=KB;function YB(t){try{return Jp(t),!0}catch{return!1}}Mt.isNXMonorepo=YB});var Si={};mn(Si,{default:()=>JB});var JB,xi=ct(()=>{JB={}});var zw=y(jr=>{"use strict";var XB=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZB=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QB=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&XB(e,t,r);return ZB(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var eq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>QB((xi(),Ae(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=eq});var tm=y(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var qo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=qo;var Zp=class extends qo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=Zp;var Qp=class extends qo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=Qp;var em=class extends qo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=em;var tq;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(tq=nr.FunctionRegion||(nr.FunctionRegion={}))});var Gw=y(Mo=>{"use strict";var rq=Mo&&Mo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.FunctionsClient=void 0;var nq=zw(),dl=tm(),rm=class{constructor(e,{headers:r={},customFetch:n,region:i=dl.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,nq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return rq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(p=>{throw new dl.FunctionsFetchError(p)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new dl.FunctionsRelayError(l);if(!l.ok)throw new dl.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Mo.FunctionsClient=rm});var nm=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.FunctionRegion=Ut.FunctionsRelayError=Ut.FunctionsHttpError=Ut.FunctionsFetchError=Ut.FunctionsError=Ut.FunctionsClient=void 0;var iq=Gw();Object.defineProperty(Ut,"FunctionsClient",{enumerable:!0,get:function(){return iq.FunctionsClient}});var Ba=tm();Object.defineProperty(Ut,"FunctionsError",{enumerable:!0,get:function(){return Ba.FunctionsError}});Object.defineProperty(Ut,"FunctionsFetchError",{enumerable:!0,get:function(){return Ba.FunctionsFetchError}});Object.defineProperty(Ut,"FunctionsHttpError",{enumerable:!0,get:function(){return Ba.FunctionsHttpError}});Object.defineProperty(Ut,"FunctionsRelayError",{enumerable:!0,get:function(){return Ba.FunctionsRelayError}});Object.defineProperty(Ut,"FunctionRegion",{enumerable:!0,get:function(){return Ba.FunctionRegion}})});var Ww=y(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var im=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};om.default=im});var am=y(qa=>{"use strict";var Kw=qa&&qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qa,"__esModule",{value:!0});var oq=Kw((xi(),Ae(Si))),sq=Kw(Ww()),sm=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=oq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let b=await o.text();try{c=JSON.parse(b),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):c={message:b}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new sq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};qa.default=sm});var cm=y(Ma=>{"use strict";var aq=Ma&&Ma.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ma,"__esModule",{value:!0});var uq=aq(am()),um=class extends uq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Ma.default=um});var hl=y(Ua=>{"use strict";var cq=Ua&&Ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ua,"__esModule",{value:!0});var lq=cq(cm()),lm=class extends lq.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let o="";i==="plain"?o="pl":i==="phrase"?o="ph":i==="websearch"&&(o="w");let s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${s}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};Ua.default=lm});var dm=y(Ha=>{"use strict";var fq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var Va=fq(hl()),fm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=r,this.schema=n,this.fetch=i}select(e,{head:r=!1,count:n}={}){let i=r?"HEAD":"GET",o=!1,s=(e??"*").split("").map(a=>/\s/.test(a)&&!o?"":(a==='"'&&(o=!o),a)).join("");return this.url.searchParams.set("select",s),n&&(this.headers.Prefer=`count=${n}`),new Va.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:r,defaultToNull:n=!0}={}){let i="POST",o=[];if(this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),n||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let s=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(s.length>0){let a=[...new Set(s)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new Va.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new Va.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:r}={}){let n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),this.headers.Prefer=i.join(","),new Va.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let r="DELETE",n=[];return e&&n.push(`count=${e}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new Va.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ha.default=fm});var Yw=y(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.version=void 0;pl.version="0.0.0-automated"});var Jw=y(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.DEFAULT_HEADERS=void 0;var dq=Yw();ml.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${dq.version}`}});var Zw=y(za=>{"use strict";var Xw=za&&za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(za,"__esModule",{value:!0});var hq=Xw(dm()),pq=Xw(hl()),mq=Jw(),hm=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},mq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new hq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new pq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};za.default=hm});var i_=y(kt=>{"use strict";var Ga=kt&&kt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kt,"__esModule",{value:!0});kt.PostgrestBuilder=kt.PostgrestTransformBuilder=kt.PostgrestFilterBuilder=kt.PostgrestQueryBuilder=kt.PostgrestClient=void 0;var Qw=Ga(Zw());kt.PostgrestClient=Qw.default;var e_=Ga(dm());kt.PostgrestQueryBuilder=e_.default;var t_=Ga(hl());kt.PostgrestFilterBuilder=t_.default;var r_=Ga(cm());kt.PostgrestTransformBuilder=r_.default;var n_=Ga(am());kt.PostgrestBuilder=n_.default;kt.default={PostgrestClient:Qw.default,PostgrestQueryBuilder:e_.default,PostgrestFilterBuilder:t_.default,PostgrestTransformBuilder:r_.default,PostgrestBuilder:n_.default}});var mm={};mn(mm,{RealtimeClient:()=>pm});var pm,gm=ct(()=>{pm=class{constructor(){}connect(){}disconnect(){}}});var Ka=y(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Wa=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Wa;function gq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=gq;var ym=class extends Wa{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=ym;var Dm=class extends Wa{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=Dm});var gl=y(lt=>{"use strict";var yq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Dq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o_=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&yq(e,t,r);return Dq(e,t),e},vq=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.recursiveToCamel=lt.resolveResponse=lt.resolveFetch=void 0;var bq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>o_((xi(),Ae(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};lt.resolveFetch=bq;var wq=()=>vq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>o_((xi(),Ae(Si))))).Response:Response});lt.resolveResponse=wq;var _q=t=>{if(Array.isArray(t))return t.map(r=>(0,lt.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,lt.recursiveToCamel)(n)}),e};lt.recursiveToCamel=_q});var wm=y(Vt=>{"use strict";var Fi=Vt&&Vt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.remove=Vt.head=Vt.put=Vt.post=Vt.get=void 0;var vm=Ka(),Eq=gl(),bm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Cq=(t,e,r)=>Fi(void 0,void 0,void 0,function*(){let n=yield(0,Eq.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new vm.StorageApiError(bm(i),t.status||500))}).catch(i=>{e(new vm.StorageUnknownError(bm(i),i))}):e(new vm.StorageUnknownError(bm(t),t))}),Sq=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),r))};function Ya(t,e,r,n,i,o){return Fi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,Sq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Cq(u,a,n))})})}function xq(t,e,r,n){return Fi(this,void 0,void 0,function*(){return Ya(t,"GET",e,r,n)})}Vt.get=xq;function Fq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Ya(t,"POST",e,n,i,r)})}Vt.post=Fq;function Oq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Ya(t,"PUT",e,n,i,r)})}Vt.put=Oq;function Aq(t,e,r,n){return Fi(this,void 0,void 0,function*(){return Ya(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Vt.head=Aq;function kq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Ya(t,"DELETE",e,n,i,r)})}Vt.remove=kq});var u_=y(Ja=>{"use strict";var Ht=Ja&&Ja.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ja,"__esModule",{value:!0});var zt=Ka(),Lr=wm(),s_=gl(),Tq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},_m=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,s_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ht(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},a_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),o.append("",n),u&&o.append("metadata",this.encodeMetadata(u))):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,zt.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ht(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:a_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,zt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Ht(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new zt.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Ht(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,zt.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,s_.recursiveToCamel)(n),error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,zt.isStorageError)(n)&&n instanceof zt.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,zt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Tq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Ja.default=_m});var c_=y(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.version=void 0;yl.version="2.7.0"});var l_=y(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DEFAULT_HEADERS=void 0;var Pq=c_();Dl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Pq.version}`}});var f_=y(Xa=>{"use strict";var Uo=Xa&&Xa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Xa,"__esModule",{value:!0});var Rq=l_(),Vo=Ka(),Ho=wm(),$q=gl(),Em=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Rq.DEFAULT_HEADERS),r),this.fetch=(0,$q.resolveFetch)(n)}listBuckets(){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Vo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.post)(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Vo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.put)(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Vo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}};Xa.default=Em});var h_=y(zo=>{"use strict";var d_=zo&&zo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zo,"__esModule",{value:!0});zo.StorageClient=void 0;var Iq=d_(u_()),jq=d_(f_()),Cm=class extends jq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new Iq.default(this.url,this.headers,e,this.fetch)}};zo.StorageClient=Cm});var m_=y(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var y_=y(Br=>{"use strict";var Nq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Lq=h_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Lq.StorageClient}});g_(m_(),Br);g_(Ka(),Br)});var D_=y(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.version=void 0;vl.version="2.45.2"});var v_=y(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Bq=D_(),Za="";typeof Deno<"u"?Za="deno":typeof document<"u"?Za="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Za="react-native":Za="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Za}/${Bq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var w_=y(ft=>{"use strict";var qq=ft&&ft.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Mq=ft&&ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Uq=ft&&ft.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&qq(e,t,r);return Mq(e,t),e},Vq=ft&&ft.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ft,"__esModule",{value:!0});ft.fetchWithAuth=ft.resolveHeadersConstructor=ft.resolveFetch=void 0;var b_=Uq((xi(),Ae(Si))),Hq=t=>{let e;return t?e=t:typeof fetch>"u"?e=b_.default:e=fetch,(...r)=>e(...r)};ft.resolveFetch=Hq;var zq=()=>typeof Headers>"u"?b_.Headers:Headers;ft.resolveHeadersConstructor=zq;var Gq=(t,e,r)=>{let n=(0,ft.resolveFetch)(r),i=(0,ft.resolveHeadersConstructor)();return(o,s)=>Vq(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};ft.fetchWithAuth=Gq});var __=y(pr=>{"use strict";var Wq=pr&&pr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(pr,"__esModule",{value:!0});pr.applySettingDefaults=pr.isBrowser=pr.stripTrailingSlash=pr.uuid=void 0;function Kq(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}pr.uuid=Kq;function Yq(t){return t.replace(/\/$/,"")}pr.stripTrailingSlash=Yq;var Jq=()=>typeof window<"u";pr.isBrowser=Jq;function Xq(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>Wq(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}pr.applySettingDefaults=Xq});var Sm=y(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.version=void 0;bl.version="2.64.4"});var wl=y(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.API_VERSIONS=dt.API_VERSION_HEADER_NAME=dt.NETWORK_FAILURE=dt.EXPIRY_MARGIN=dt.DEFAULT_HEADERS=dt.AUDIENCE=dt.STORAGE_KEY=dt.GOTRUE_URL=void 0;var Zq=Sm();dt.GOTRUE_URL="http://localhost:9999";dt.STORAGE_KEY="supabase.auth.token";dt.AUDIENCE="";dt.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${Zq.version}`};dt.EXPIRY_MARGIN=10;dt.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};dt.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";dt.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Go=y(te=>{"use strict";var Qq=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),e4=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),t4=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Qq(e,t,r);return e4(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var r4=wl();function n4(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=n4;function i4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=i4;var o4=()=>typeof document<"u";te.isBrowser=o4;var Oi={tested:!1,writable:!1},s4=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Oi.tested)return Oi.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Oi.tested=!0,Oi.writable=!0}catch{Oi.tested=!0,Oi.writable=!1}return Oi.writable};te.supportsLocalStorage=s4;function a4(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=a4;var u4=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>t4((xi(),Ae(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=u4;var c4=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=c4;var l4=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=l4;var f4=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=f4;var d4=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=d4;function E_(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=E_;var _l=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=_l;_l.promiseConstructor=Promise;function h4(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(E_(n))}te.decodeJWTPayload=h4;async function p4(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=p4;function m4(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=m4;function g4(t){return("0"+t.toString(16)).substr(-2)}function C_(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,g4).join("")}te.generatePKCEVerifier=C_;async function y4(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}function D4(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function S_(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await y4(t);return D4(r)}te.generatePKCEChallenge=S_;async function v4(t,e,r=!1){let n=C_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await S_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=v4;var b4=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function w4(t){let e=t.headers.get(r4.API_VERSION_HEADER_NAME);if(!e||!e.match(b4))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=w4});var Qa=y(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isAuthWeakPasswordError=ye.AuthWeakPasswordError=ye.isAuthRetryableFetchError=ye.AuthRetryableFetchError=ye.AuthPKCEGrantCodeExchangeError=ye.AuthImplicitGrantRedirectError=ye.AuthInvalidCredentialsError=ye.AuthInvalidTokenResponseError=ye.AuthSessionMissingError=ye.CustomAuthError=ye.AuthUnknownError=ye.isAuthApiError=ye.AuthApiError=ye.isAuthError=ye.AuthError=void 0;var Wo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};ye.AuthError=Wo;function El(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}ye.isAuthError=El;var xm=class extends Wo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};ye.AuthApiError=xm;function _4(t){return El(t)&&t.name==="AuthApiError"}ye.isAuthApiError=_4;var Fm=class extends Wo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};ye.AuthUnknownError=Fm;var qr=class extends Wo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};ye.CustomAuthError=qr;var Om=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};ye.AuthSessionMissingError=Om;var Am=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};ye.AuthInvalidTokenResponseError=Am;var km=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};ye.AuthInvalidCredentialsError=km;var Tm=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ye.AuthImplicitGrantRedirectError=Tm;var Pm=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ye.AuthPKCEGrantCodeExchangeError=Pm;var Rm=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};ye.AuthRetryableFetchError=Rm;function E4(t){return El(t)&&t.name==="AuthRetryableFetchError"}ye.isAuthRetryableFetchError=E4;var $m=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};ye.AuthWeakPasswordError=$m;function C4(t){return El(t)&&t.name==="AuthWeakPasswordError"}ye.isAuthWeakPasswordError=C4});var Nm=y(rt=>{"use strict";var S4=rt&&rt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(rt,"__esModule",{value:!0});rt._noResolveJsonResponse=rt._generateLinkResponse=rt._ssoResponse=rt._userResponse=rt._sessionResponsePassword=rt._sessionResponse=rt._request=rt.handleError=void 0;var Cl=wl(),Im=Go(),Ai=Qa(),ki=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),x4=[502,503,504];async function jm(t){var e;if(!(0,Im.looksLikeFetchResponse)(t))throw new Ai.AuthRetryableFetchError(ki(t),0);if(x4.includes(t.status))throw new Ai.AuthRetryableFetchError(ki(t),t.status);let r;try{r=await t.json()}catch(o){throw new Ai.AuthUnknownError(ki(o),o)}let n,i=(0,Im.parseResponseAPIVersion)(t);if(i&&i.getTime()>=Cl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Ai.AuthWeakPasswordError(ki(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[])}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Ai.AuthWeakPasswordError(ki(r),t.status,r.weak_password.reasons);throw new Ai.AuthApiError(ki(r),t.status||500,n)}rt.handleError=jm;var F4=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function O4(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[Cl.API_VERSION_HEADER_NAME]||(o[Cl.API_VERSION_HEADER_NAME]=Cl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await A4(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}rt._request=O4;async function A4(t,e,r,n,i,o){let s=F4(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Ai.AuthRetryableFetchError(ki(u),0)}if(a.ok||await jm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await jm(u)}}function x_(t){var e;let r=null;I4(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Im.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}rt._sessionResponse=x_;function k4(t){let e=x_(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}rt._sessionResponsePassword=k4;function T4(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}rt._userResponse=T4;function P4(t){return{data:t,error:null}}rt._ssoResponse=P4;function R4(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=S4(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},u=Object.assign({},s);return{data:{properties:a,user:u},error:null}}rt._generateLinkResponse=R4;function $4(t){return t}rt._noResolveJsonResponse=$4;function I4(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Sl=y(eu=>{"use strict";var j4=eu&&eu.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(eu,"__esModule",{value:!0});var vt=Nm(),N4=Go(),Mr=Qa(),Lm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,N4.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=j4(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(p=>{let b=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);c[`${g}Page`]=b}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};eu.default=Lm});var F_=y(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.memoryLocalStorageAdapter=Ko.localStorageAdapter=void 0;var Bm=Go();Ko.localStorageAdapter={getItem:t=>(0,Bm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Bm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Bm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function L4(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Ko.memoryLocalStorageAdapter=L4});var O_=y(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.polyfillGlobalThis=void 0;function B4(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}xl.polyfillGlobalThis=B4});var qm=y(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.navigatorLock=Et.NavigatorLockAcquireTimeoutError=Et.LockAcquireTimeoutError=Et.internals=void 0;var q4=Go();Et.internals={debug:!!(globalThis&&(0,q4.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Fl=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Et.LockAcquireTimeoutError=Fl;var Ol=class extends Fl{};Et.NavigatorLockAcquireTimeoutError=Ol;async function M4(t,e,r){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Ol(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Et.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}Et.navigatorLock=M4});var Um=y(nu=>{"use strict";var U4=nu&&nu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nu,"__esModule",{value:!0});var V4=U4(Sl()),ru=wl(),Q=Qa(),ae=Nm(),de=Go(),Mm=F_(),H4=O_(),z4=Sm(),A_=qm();(0,H4.polyfillGlobalThis)();var G4={url:ru.GOTRUE_URL,storageKey:ru.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ru.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},tu=30*1e3,k_=3;async function T_(t,e,r){return await r()}var Al=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,de.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},G4),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new V4.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,de.resolveFetch)(i.fetch),this.lock=i.lock||T_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,de.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=A_.navigatorLock:this.lock=T_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,de.supportsLocalStorage)()?this.storage=Mm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,Mm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,Mm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,de.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${z4.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,de.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.message==="Identity is already linked"||n?.message==="Identity is already linked to another user"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Q.isAuthError)(e)?{error:e}:{error:new Q.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Q.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,p=null;this.flowType==="pkce"&&([d,p]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:p},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Q.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Q.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,de.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/"),{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});return await(0,de.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s?{data:{user:null,session:null,redirectType:null},error:s}:!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Q.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Q.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Q.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Q.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Q.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Q.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Q.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,de.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Q.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Q.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Q.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,de.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Q.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,de.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Q.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Q.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,de.isBrowser)())throw new Q.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Q.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Q.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,de.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Q.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:D}=await this._exchangeCodeForSession(r.code);if(D)throw D;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Q.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Q.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=tu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let p=h-f;l-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,h,l):l-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",p,h,l);let{data:b,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Q.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,de.parseParametersFromURL)(window.location.href);return!!((0,de.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,de.parseParametersFromURL)(window.location.href),r=await(0,de.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Q.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,de.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){let r=(0,de.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Q.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,de.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Q.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,de.retryable)(async i=>(i>0&&await(0,de.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Q.isAuthRetryableFetchError)(o)&&Date.now()+s-n<tu})}catch(n){if(this._debug(r,"error",n),(0,Q.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,de.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,de.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+ru.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${ru.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Q.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Q.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new de.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Q.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Q.isAuthError)(o)){let s={session:null,error:o};return(0,Q.isAuthRetryableFetchError)(o)||(await this._removeSession(),await this._notifyAllSubscribers("SIGNED_OUT",null)),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,de.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,de.removeItemAsync)(this.storage,this.storageKey)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,de.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),tu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/tu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${tu}ms, refresh threshold is ${k_} ticks`),i<=k_&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof A_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,de.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let{data:a,error:u}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return u?{data:null,error:u}:(!((i=a?.totp)===null||i===void 0)&&i.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),{data:a,error:null})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(o=>o.factor_type==="totp"&&o.status==="verified");return{data:{all:n,totp:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};nu.default=Al;Al.nextInstanceID=0});var P_=y(iu=>{"use strict";var W4=iu&&iu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iu,"__esModule",{value:!0});var K4=W4(Sl()),Y4=K4.default;iu.default=Y4});var R_=y(ou=>{"use strict";var J4=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var X4=J4(Um()),Z4=X4.default;ou.default=Z4});var I_=y($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0})});var Hm=y(Ne=>{"use strict";var Q4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q4(e,t,r)},kl=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.lockInternals=Ne.NavigatorLockAcquireTimeoutError=Ne.navigatorLock=Ne.AuthClient=Ne.AuthAdminApi=Ne.GoTrueClient=Ne.GoTrueAdminApi=void 0;var eM=kl(Sl());Ne.GoTrueAdminApi=eM.default;var tM=kl(Um());Ne.GoTrueClient=tM.default;var rM=kl(P_());Ne.AuthAdminApi=rM.default;var nM=kl(R_());Ne.AuthClient=nM.default;j_(I_(),Ne);j_(Qa(),Ne);var Vm=qm();Object.defineProperty(Ne,"navigatorLock",{enumerable:!0,get:function(){return Vm.navigatorLock}});Object.defineProperty(Ne,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Vm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ne,"lockInternals",{enumerable:!0,get:function(){return Vm.internals}})});var N_=y(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.SupabaseAuthClient=void 0;var iM=Hm(),zm=class extends iM.AuthClient{constructor(e){super(e)}};Tl.SupabaseAuthClient=zm});var Wm=y(su=>{"use strict";var oM=su&&su.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(su,"__esModule",{value:!0});var sM=nm(),aM=i_(),uM=(gm(),Ae(mm)),cM=y_(),Pl=v_(),lM=w_(),L_=__(),fM=N_(),Gm=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,L_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:Pl.DEFAULT_DB_OPTIONS,realtime:Pl.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Pl.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Pl.DEFAULT_GLOBAL_OPTIONS},l=(0,L_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,lM.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new aM.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new sM.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new cM.StorageClient(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return oM(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new fM.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new uM.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};su.default=Gm});var M_=y(Le=>{"use strict";var dM=Le&&Le.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),B_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dM(e,t,r)},q_=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.createClient=Le.SupabaseClient=Le.FunctionRegion=Le.FunctionsError=Le.FunctionsRelayError=Le.FunctionsFetchError=Le.FunctionsHttpError=void 0;var hM=q_(Wm());B_(Hm(),Le);var au=nm();Object.defineProperty(Le,"FunctionsHttpError",{enumerable:!0,get:function(){return au.FunctionsHttpError}});Object.defineProperty(Le,"FunctionsFetchError",{enumerable:!0,get:function(){return au.FunctionsFetchError}});Object.defineProperty(Le,"FunctionsRelayError",{enumerable:!0,get:function(){return au.FunctionsRelayError}});Object.defineProperty(Le,"FunctionsError",{enumerable:!0,get:function(){return au.FunctionsError}});Object.defineProperty(Le,"FunctionRegion",{enumerable:!0,get:function(){return au.FunctionRegion}});B_((gm(),Ae(mm)),Le);var pM=Wm();Object.defineProperty(Le,"SupabaseClient",{enumerable:!0,get:function(){return q_(pM).default}});var mM=(t,e,r)=>new hM.default(t,e,r);Le.createClient=mM});var Km=y((_le,U_)=>{U_.exports=require("stream")});var K_=y((Ele,W_)=>{"use strict";function V_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function H_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?V_(Object(r),!0).forEach(function(n){gM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gM(t,e,r){return e=G_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G_(n.key),n)}}function DM(t,e,r){return e&&z_(t.prototype,e),r&&z_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function G_(t){var e=vM(t,"string");return typeof e=="symbol"?e:String(e)}function vM(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bM=require("buffer"),Rl=bM.Buffer,wM=require("util"),Ym=wM.inspect,_M=Ym&&Ym.custom||"inspect";function EM(t,e,r){Rl.prototype.copy.call(t,e,r)}W_.exports=function(){function t(){yM(this,t),this.head=null,this.tail=null,this.length=0}return DM(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Rl.alloc(0);for(var n=Rl.allocUnsafe(r>>>0),i=this.head,o=0;i;)EM(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=Rl.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:_M,value:function(r,n){return Ym(this,H_(H_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var Xm=y((Cle,J_)=>{"use strict";function CM(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Jm,this,t)):process.nextTick(Jm,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick($l,r):(r._writableState.errorEmitted=!0,process.nextTick(Y_,r,o)):process.nextTick(Y_,r,o):e?(process.nextTick($l,r),e(o)):process.nextTick($l,r)}),this)}function Y_(t,e){Jm(t,e),$l(t)}function $l(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function SM(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Jm(t,e){t.emit("error",e)}function xM(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}J_.exports={destroy:CM,undestroy:SM,errorOrDestroy:xM}});var Kn=y((Sle,Q_)=>{"use strict";var Z_={};function mr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Z_[t]=i}function X_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function FM(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function OM(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function AM(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}mr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);mr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&FM(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(OM(t," argument"))i=`The ${t} ${n} ${X_(e,"type")}`;else{let o=AM(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${X_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);mr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");mr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});mr("ERR_STREAM_PREMATURE_CLOSE","Premature close");mr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});mr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");mr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");mr("ERR_STREAM_WRITE_AFTER_END","write after end");mr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);mr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);mr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Q_.exports.codes=Z_});var Zm=y((xle,eE)=>{"use strict";var kM=Kn().codes.ERR_INVALID_OPT_VALUE;function TM(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function PM(t,e,r,n){var i=TM(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new kM(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}eE.exports={getHighWaterMark:PM}});var tE=y((Fle,Qm)=>{typeof Object.create=="function"?Qm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Qm.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Yo=y((Ole,tg)=>{try{if(eg=require("util"),typeof eg.inherits!="function")throw"";tg.exports=eg.inherits}catch{tg.exports=tE()}var eg});var nE=y((Ale,rE)=>{rE.exports=require("util").deprecate});var ig=y((kle,cE)=>{"use strict";cE.exports=Je;function oE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){o5(e,t)}}var Jo;Je.WritableState=cu;var RM={deprecate:nE()},sE=Km(),jl=require("buffer").Buffer,$M=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function IM(t){return jl.from(t)}function jM(t){return jl.isBuffer(t)||t instanceof $M}var ng=Xm(),NM=Zm(),LM=NM.getHighWaterMark,Yn=Kn().codes,BM=Yn.ERR_INVALID_ARG_TYPE,qM=Yn.ERR_METHOD_NOT_IMPLEMENTED,MM=Yn.ERR_MULTIPLE_CALLBACK,UM=Yn.ERR_STREAM_CANNOT_PIPE,VM=Yn.ERR_STREAM_DESTROYED,HM=Yn.ERR_STREAM_NULL_VALUES,zM=Yn.ERR_STREAM_WRITE_AFTER_END,GM=Yn.ERR_UNKNOWN_ENCODING,Xo=ng.errorOrDestroy;Yo()(Je,sE);function WM(){}function cu(t,e,r){Jo=Jo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Jo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=LM(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){e5(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oE(this)}cu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(cu.prototype,"buffer",{get:RM.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Il;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Il=Function.prototype[Symbol.hasInstance],Object.defineProperty(Je,Symbol.hasInstance,{value:function(e){return Il.call(this,e)?!0:this!==Je?!1:e&&e._writableState instanceof cu}})):Il=function(e){return e instanceof this};function Je(t){Jo=Jo||Ti();var e=this instanceof Jo;if(!e&&!Il.call(Je,this))return new Je(t);this._writableState=new cu(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),sE.call(this)}Je.prototype.pipe=function(){Xo(this,new UM)};function KM(t,e){var r=new zM;Xo(t,r),process.nextTick(e,r)}function YM(t,e,r,n){var i;return r===null?i=new HM:typeof r!="string"&&!e.objectMode&&(i=new BM("chunk",["string","Buffer"],r)),i?(Xo(t,i),process.nextTick(n,i),!1):!0}Je.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&jM(t);return o&&!jl.isBuffer(t)&&(t=IM(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=WM),n.ending?KM(this,r):(o||YM(this,n,t,r))&&(n.pendingcb++,i=XM(this,n,o,t,e,r)),i};Je.prototype.cork=function(){this._writableState.corked++};Je.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aE(this,t))};Je.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new GM(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Je.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function JM(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=jl.from(e,r)),e}Object.defineProperty(Je.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function XM(t,e,r,n,i,o){if(!r){var s=JM(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else rg(t,e,!1,a,n,i,o);return u}function rg(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new VM("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function ZM(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(uu,t,e),t._writableState.errorEmitted=!0,Xo(t,n)):(i(n),t._writableState.errorEmitted=!0,Xo(t,n),uu(t,e))}function QM(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function e5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new MM;if(QM(r),e)ZM(t,r,n,e,i);else{var o=uE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&aE(t,r),n?process.nextTick(iE,t,r,o,i):iE(t,r,o,i)}}function iE(t,e,r,n){r||t5(t,e),e.pendingcb--,n(),uu(t,e)}function t5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function aE(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,rg(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new oE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(rg(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Je.prototype._write=function(t,e,r){r(new qM("_write()"))};Je.prototype._writev=null;Je.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||i5(this,n,r),this};Object.defineProperty(Je.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function uE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function r5(t,e){t._final(function(r){e.pendingcb--,r&&Xo(t,r),e.prefinished=!0,t.emit("prefinish"),uu(t,e)})}function n5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(r5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function uu(t,e){var r=uE(e);if(r&&(n5(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function i5(t,e,r){e.ending=!0,uu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function o5(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Je.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Je.prototype.destroy=ng.destroy;Je.prototype._undestroy=ng.undestroy;Je.prototype._destroy=function(t,e){e(t)}});var Ti=y((Tle,fE)=>{"use strict";var s5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};fE.exports=Ur;var lE=ag(),sg=ig();Yo()(Ur,lE);for(og=s5(sg.prototype),Nl=0;Nl<og.length;Nl++)Ll=og[Nl],Ur.prototype[Ll]||(Ur.prototype[Ll]=sg.prototype[Ll]);var og,Ll,Nl;function Ur(t){if(!(this instanceof Ur))return new Ur(t);lE.call(this,t),sg.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a5(){this._writableState.ended||process.nextTick(u5,this)}function u5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var pE=y((ug,hE)=>{var Bl=require("buffer"),Vr=Bl.Buffer;function dE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?hE.exports=Bl:(dE(Bl,ug),ug.Buffer=Pi);function Pi(t,e,r){return Vr(t,e,r)}Pi.prototype=Object.create(Vr.prototype);dE(Vr,Pi);Pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Bl.SlowBuffer(t)}});var fg=y(gE=>{"use strict";var lg=pE().Buffer,mE=lg.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function c5(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function l5(t){var e=c5(t);if(typeof e!="string"&&(lg.isEncoding===mE||!mE(t)))throw new Error("Unknown encoding: "+t);return e||t}gE.StringDecoder=lu;function lu(t){this.encoding=l5(t);var e;switch(this.encoding){case"utf16le":this.text=g5,this.end=y5,e=4;break;case"utf8":this.fillLast=h5,e=4;break;case"base64":this.text=D5,this.end=v5,e=3;break;default:this.write=b5,this.end=w5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lg.allocUnsafe(e)}lu.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};lu.prototype.end=m5;lu.prototype.text=p5;lu.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function cg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function f5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=cg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=cg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=cg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function d5(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function h5(t){var e=this.lastTotal-this.lastNeed,r=d5(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function p5(t,e){var r=f5(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function m5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function g5(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function y5(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function D5(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function v5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function b5(t){return t.toString(this.encoding)}function w5(t){return t&&t.length?this.write(t):""}});var ql=y((Rle,vE)=>{"use strict";var yE=Kn().codes.ERR_STREAM_PREMATURE_CLOSE;function _5(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function E5(){}function C5(t){return t.setHeader&&typeof t.abort=="function"}function DE(t,e,r){if(typeof e=="function")return DE(t,null,e);e||(e={}),r=_5(r||E5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(p){r.call(t,p)},f=function(){var p;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(p=new yE),r.call(t,p);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(p=new yE),r.call(t,p)},h=function(){t.req.on("finish",a)};return C5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}vE.exports=DE});var wE=y(($le,bE)=>{"use strict";var Ml;function Jn(t,e,r){return e=S5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S5(t){var e=x5(t,"string");return typeof e=="symbol"?e:String(e)}function x5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var F5=ql(),Xn=Symbol("lastResolve"),Ri=Symbol("lastReject"),fu=Symbol("error"),Ul=Symbol("ended"),$i=Symbol("lastPromise"),dg=Symbol("handlePromise"),Ii=Symbol("stream");function Zn(t,e){return{value:t,done:e}}function O5(t){var e=t[Xn];if(e!==null){var r=t[Ii].read();r!==null&&(t[$i]=null,t[Xn]=null,t[Ri]=null,e(Zn(r,!1)))}}function A5(t){process.nextTick(O5,t)}function k5(t,e){return function(r,n){t.then(function(){if(e[Ul]){r(Zn(void 0,!0));return}e[dg](r,n)},n)}}var T5=Object.getPrototypeOf(function(){}),P5=Object.setPrototypeOf((Ml={get stream(){return this[Ii]},next:function(){var e=this,r=this[fu];if(r!==null)return Promise.reject(r);if(this[Ul])return Promise.resolve(Zn(void 0,!0));if(this[Ii].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[fu]?a(e[fu]):s(Zn(void 0,!0))})});var n=this[$i],i;if(n)i=new Promise(k5(n,this));else{var o=this[Ii].read();if(o!==null)return Promise.resolve(Zn(o,!1));i=new Promise(this[dg])}return this[$i]=i,i}},Jn(Ml,Symbol.asyncIterator,function(){return this}),Jn(Ml,"return",function(){var e=this;return new Promise(function(r,n){e[Ii].destroy(null,function(i){if(i){n(i);return}r(Zn(void 0,!0))})})}),Ml),T5),R5=function(e){var r,n=Object.create(P5,(r={},Jn(r,Ii,{value:e,writable:!0}),Jn(r,Xn,{value:null,writable:!0}),Jn(r,Ri,{value:null,writable:!0}),Jn(r,fu,{value:null,writable:!0}),Jn(r,Ul,{value:e._readableState.endEmitted,writable:!0}),Jn(r,dg,{value:function(o,s){var a=n[Ii].read();a?(n[$i]=null,n[Xn]=null,n[Ri]=null,o(Zn(a,!1))):(n[Xn]=o,n[Ri]=s)},writable:!0}),r));return n[$i]=null,F5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ri];o!==null&&(n[$i]=null,n[Xn]=null,n[Ri]=null,o(i)),n[fu]=i;return}var s=n[Xn];s!==null&&(n[$i]=null,n[Xn]=null,n[Ri]=null,s(Zn(void 0,!0))),n[Ul]=!0}),e.on("readable",A5.bind(null,n)),n};bE.exports=R5});var SE=y((Ile,CE)=>{"use strict";function _E(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function $5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){_E(o,n,i,s,a,"next",u)}function a(u){_E(o,n,i,s,a,"throw",u)}s(void 0)})}}function EE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function I5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?EE(Object(r),!0).forEach(function(n){j5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):EE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function j5(t,e,r){return e=N5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N5(t){var e=L5(t,"string");return typeof e=="symbol"?e:String(e)}function L5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var B5=Kn().codes.ERR_INVALID_ARG_TYPE;function q5(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new B5("iterable",["Iterable"],e);var i=new t(I5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=$5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}CE.exports=q5});var ag=y((Nle,IE)=>{"use strict";IE.exports=me;var Zo;me.ReadableState=AE;var jle=require("events").EventEmitter,OE=function(e,r){return e.listeners(r).length},hu=Km(),Vl=require("buffer").Buffer,M5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function U5(t){return Vl.from(t)}function V5(t){return Vl.isBuffer(t)||t instanceof M5}var hg=require("util"),ue;hg&&hg.debuglog?ue=hg.debuglog("stream"):ue=function(){};var H5=K_(),bg=Xm(),z5=Zm(),G5=z5.getHighWaterMark,Hl=Kn().codes,W5=Hl.ERR_INVALID_ARG_TYPE,K5=Hl.ERR_STREAM_PUSH_AFTER_EOF,Y5=Hl.ERR_METHOD_NOT_IMPLEMENTED,J5=Hl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Qo,pg,mg;Yo()(me,hu);var du=bg.errorOrDestroy,gg=["error","close","destroy","pause","resume"];function X5(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function AE(t,e,r){Zo=Zo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Zo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=G5(this,t,"readableHighWaterMark",r),this.buffer=new H5,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Qo||(Qo=fg().StringDecoder),this.decoder=new Qo(t.encoding),this.encoding=t.encoding)}function me(t){if(Zo=Zo||Ti(),!(this instanceof me))return new me(t);var e=this instanceof Zo;this._readableState=new AE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),hu.call(this)}Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});me.prototype.destroy=bg.destroy;me.prototype._undestroy=bg.undestroy;me.prototype._destroy=function(t,e){e(t)};me.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Vl.from(t,e),e=""),n=!0),kE(this,t,e,!1,n)};me.prototype.unshift=function(t){return kE(this,t,null,!0,!1)};function kE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,eU(t,o);else{var s;if(i||(s=Z5(o,e)),s)du(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Vl.prototype&&(e=U5(e)),n)o.endEmitted?du(t,new J5):yg(t,o,e,!0);else if(o.ended)du(t,new K5);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?yg(t,o,e,!1):vg(t,o)):yg(t,o,e,!1)}else n||(o.reading=!1,vg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function yg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&zl(t)),vg(t,e)}function Z5(t,e){var r;return!V5(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new W5("chunk",["string","Buffer","Uint8Array"],e)),r}me.prototype.isPaused=function(){return this._readableState.flowing===!1};me.prototype.setEncoding=function(t){Qo||(Qo=fg().StringDecoder);var e=new Qo(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var xE=1073741824;function Q5(t){return t>=xE?t=xE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function FE(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Q5(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}me.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Dg(this):zl(this),null;if(t=FE(t,e),t===0&&e.ended)return e.length===0&&Dg(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=FE(r,e)));var i;return t>0?i=RE(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Dg(this)),i!==null&&this.emit("data",i),i};function eU(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?zl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,TE(t)))}}function zl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(TE,t))}function TE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,wg(t)}function vg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(tU,t,e))}function tU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}me.prototype._read=function(t){du(this,new Y5("_read()"))};me.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ue("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=rU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&$E(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),b(),t.removeListener("error",h),OE(t,"error")===0&&du(t,g)}X5(t,"error",h);function d(){t.removeListener("finish",p),b()}t.once("close",d);function p(){ue("onfinish"),t.removeListener("close",d),b()}t.once("finish",p);function b(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function rU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&OE(t,"data")&&(r.flowing=!0,wg(t))}}me.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=$E(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};me.prototype.on=function(t,e){var r=hu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?zl(this):n.reading||process.nextTick(nU,this)),r};me.prototype.addListener=me.prototype.on;me.prototype.removeListener=function(t,e){var r=hu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(PE,this),r};me.prototype.removeAllListeners=function(t){var e=hu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(PE,this),e};function PE(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function nU(t){ue("readable nexttick read 0"),t.read(0)}me.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,iU(this,t)),t.paused=!1,this};function iU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(oU,t,e))}function oU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),wg(t),e.flowing&&!e.reading&&t.read(0)}me.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function wg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}me.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<gg.length;o++)t.on(gg[o],this.emit.bind(this,gg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(me.prototype[Symbol.asyncIterator]=function(){return pg===void 0&&(pg=wE()),pg(this)});Object.defineProperty(me.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(me.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(me.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});me._fromList=RE;Object.defineProperty(me.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function RE(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Dg(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(sU,e,t))}function sU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(me.from=function(t,e){return mg===void 0&&(mg=SE()),mg(me,t,e)});function $E(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var _g=y((Lle,NE)=>{"use strict";NE.exports=Dn;var Gl=Kn().codes,aU=Gl.ERR_METHOD_NOT_IMPLEMENTED,uU=Gl.ERR_MULTIPLE_CALLBACK,cU=Gl.ERR_TRANSFORM_ALREADY_TRANSFORMING,lU=Gl.ERR_TRANSFORM_WITH_LENGTH_0,Wl=Ti();Yo()(Dn,Wl);function fU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new uU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Wl.call(this,t),this._transformState={afterTransform:fU.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",dU)}function dU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jE(t,e,r)}):jE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Wl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new aU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Wl.prototype._destroy.call(this,t,function(r){e(r)})};function jE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new lU;if(t._transformState.transforming)throw new cU;return t.push(null)}});var qE=y((Ble,BE)=>{"use strict";BE.exports=pu;var LE=_g();Yo()(pu,LE);function pu(t){if(!(this instanceof pu))return new pu(t);LE.call(this,t)}pu.prototype._transform=function(t,e,r){r(null,t)}});var zE=y((qle,HE)=>{"use strict";var Eg;function hU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var VE=Kn().codes,pU=VE.ERR_MISSING_ARGS,mU=VE.ERR_STREAM_DESTROYED;function ME(t){if(t)throw t}function gU(t){return t.setHeader&&typeof t.abort=="function"}function yU(t,e,r,n){n=hU(n);var i=!1;t.on("close",function(){i=!0}),Eg===void 0&&(Eg=ql()),Eg(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,gU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new mU("pipe"))}}}function UE(t){t()}function DU(t,e){return t.pipe(e)}function vU(t){return!t.length||typeof t[t.length-1]!="function"?ME:t.pop()}function bU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=vU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new pU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return yU(s,u,c,function(l){i||(i=l),l&&o.forEach(UE),!u&&(o.forEach(UE),n(i))})});return e.reduce(DU)}HE.exports=bU});var GE=y((gr,gu)=>{var mu=require("stream");process.env.READABLE_STREAM==="disable"&&mu?(gu.exports=mu.Readable,Object.assign(gu.exports,mu),gu.exports.Stream=mu):(gr=gu.exports=ag(),gr.Stream=mu||gr,gr.Readable=gr,gr.Writable=ig(),gr.Duplex=Ti(),gr.Transform=_g(),gr.PassThrough=qE(),gr.finished=ql(),gr.pipeline=zE())});var Sg=y(Cg=>{var WE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Cg=="object"?t(Cg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(WE={}):t(WE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],p=i[9],b=i[10],g=i[11],w=i[12],x=i[13],D=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function A(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=D[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^b[F[R++]]^p[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=A,t.str=$})});var YE=y((Ule,KE)=>{"use strict";var{Transform:wU}=GE(),_U=Sg(),xg=class extends wU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=_U.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};KE.exports=xg});var XE=y((Vle,JE)=>{"use strict";var{DeflateRaw:EU}=require("zlib"),CU=Sg(),Fg=class extends EU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,r){return e&&(this.compressedSize+=e.length),super.push(e,r)}_transform(e,r,n){e&&(this.checksum=CU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};JE.exports=Fg});var QE=y((Hle,ZE)=>{"use strict";ZE.exports={CRC32Stream:YE(),DeflateCRC32Stream:XE()}});var yu=y(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.checksum=es.checksumFile=void 0;var SU=require("fs"),xU=require("crypto"),tC=require("stream"),FU=require("util"),{CRC32Stream:OU}=QE(),eC=(0,FU.promisify)(tC.pipeline),AU=(t,e,r)=>rC(SU.createReadStream(t),e,r);es.checksumFile=AU;async function rC(t,e,r="hex"){let n=TU(t);if(e==="crc32"){let o=new OU,s=eC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,xU.createHash)(e);return await eC(n,i),i.end(),i.digest(r)}es.checksum=rC;function kU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var TU=t=>kU(t)?t:new tC.Readable({read(){this.push(t),this.push(null)}})});var Og=y((Gle,nC)=>{nC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Kl=y(oC=>{var iC={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function PU(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(iC))oC[t]=PU(iC[t])});var lC=y((Kle,cC)=>{var RU=require("fs"),ut=require("path"),sC=Og(),$U=Kl(),IU=typeof process=="object"&&process.platform==="win32",aC=t=>typeof t=="object"&&t!==null,uC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Xe(t){this.sep=ut.sep,this.fs=RU,aC(t)&&aC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}cC.exports=Xe;Xe.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw $U.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Xe.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=ut.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Xe.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=ut.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,p){o.fs.write(p,e,0,e.length,0,function(){o.fs.close(p,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Xe.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=ut.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(ut.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Xe.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=ut.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(ut.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Xe.prototype.getAttributes=function(){};Xe.prototype.setAttributes=function(){};Xe.crc32update=function(t,e){return uC[(t^e)&255]^t>>>8};Xe.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Xe.crc32update(r,t[n++]);return~r>>>0};Xe.methodToString=function(t){switch(t){case sC.STORED:return"STORED ("+t+")";case sC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Xe.canonical=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.join(".",e)};Xe.zipnamefix=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.posix.join(".",e)};Xe.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Xe.sanitize=function(t,e){t=ut.resolve(ut.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=ut.normalize(ut.join(t,r.slice(n,i).join(ut.sep)));if(o.indexOf(t)===0)return o}return ut.normalize(ut.join(t,ut.basename(e)))};Xe.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Xe.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Xe.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Xe.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Xe.isWin=IU;Xe.crcTable=uC});var dC=y((Yle,fC)=>{var jU=require("path");fC.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=jU.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var pC=y((Jle,hC)=>{hC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var rs=y((Xle,ts)=>{ts.exports=lC();ts.exports.Constants=Og();ts.exports.Errors=Kl();ts.exports.FileAttr=dC();ts.exports.decoder=pC()});var gC=y((Zle,mC)=>{var Qn=rs(),H=Qn.Constants;mC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;t|=Qn.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},g=D=>Math.max(0,D)>>>0,w=D=>Math.max(0,D)&65535,x=D=>Math.max(0,D)&255;return i=Qn.fromDate2DOS(new Date),{get made(){return t},set made(D){t=D},get version(){return e},set version(D){e=D},get flags(){return r},set flags(D){r=D},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(D){D?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(D){D?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(D){switch(D){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=D},get time(){return Qn.fromDOS2Date(this.timeval)},set time(D){this.timeval=Qn.fromDate2DOS(D)},get timeval(){return i},set timeval(D){i=g(D)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(D){o=g(D)},get compressedSize(){return s},set compressedSize(D){s=g(D)},get size(){return a},set size(D){a=g(D)},get fileNameLength(){return u},set fileNameLength(D){u=D},get extraLength(){return c},set extraLength(D){c=D},get extraLocalLength(){return b.extraLen},set extraLocalLength(D){b.extraLen=D},get commentLength(){return l},set commentLength(D){l=D},get diskNumStart(){return f},set diskNumStart(D){f=g(D)},get inAttr(){return h},set inAttr(D){h=g(D)},get attr(){return d},set attr(D){d=g(D)},get fileAttr(){return(d||0)>>16&4095},get offset(){return p},set offset(D){p=g(D)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+c+l},get realDataOffset(){return p+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(D){var C=D.slice(p,p+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw Qn.Errors.INVALID_LOC();b.version=C.readUInt16LE(H.LOCVER),b.flags=C.readUInt16LE(H.LOCFLG),b.method=C.readUInt16LE(H.LOCHOW),b.time=C.readUInt32LE(H.LOCTIM),b.crc=C.readUInt32LE(H.LOCCRC),b.compressedSize=C.readUInt32LE(H.LOCSIZ),b.size=C.readUInt32LE(H.LOCLEN),b.fnameLen=C.readUInt16LE(H.LOCNAM),b.extraLen=C.readUInt16LE(H.LOCEXT);let A=p+H.LOCHDR+b.fnameLen,$=A+b.extraLen;return D.slice(A,$)},loadFromBinary:function(D){if(D.length!==H.CENHDR||D.readUInt32LE(0)!==H.CENSIG)throw Qn.Errors.INVALID_CEN();t=D.readUInt16LE(H.CENVEM),e=D.readUInt16LE(H.CENVER),r=D.readUInt16LE(H.CENFLG),n=D.readUInt16LE(H.CENHOW),i=D.readUInt32LE(H.CENTIM),o=D.readUInt32LE(H.CENCRC),s=D.readUInt32LE(H.CENSIZ),a=D.readUInt32LE(H.CENLEN),u=D.readUInt16LE(H.CENNAM),c=D.readUInt16LE(H.CENEXT),l=D.readUInt16LE(H.CENCOM),f=D.readUInt16LE(H.CENDSK),h=D.readUInt16LE(H.CENATT),d=D.readUInt32LE(H.CENATX),p=D.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var D=Buffer.alloc(H.LOCHDR);return D.writeUInt32LE(H.LOCSIG,0),D.writeUInt16LE(e,H.LOCVER),D.writeUInt16LE(r,H.LOCFLG),D.writeUInt16LE(n,H.LOCHOW),D.writeUInt32LE(i,H.LOCTIM),D.writeUInt32LE(o,H.LOCCRC),D.writeUInt32LE(s,H.LOCSIZ),D.writeUInt32LE(a,H.LOCLEN),D.writeUInt16LE(u,H.LOCNAM),D.writeUInt16LE(b.extraLen,H.LOCEXT),D},centralHeaderToBinary:function(){var D=Buffer.alloc(H.CENHDR+u+c+l);return D.writeUInt32LE(H.CENSIG,0),D.writeUInt16LE(t,H.CENVEM),D.writeUInt16LE(e,H.CENVER),D.writeUInt16LE(r,H.CENFLG),D.writeUInt16LE(n,H.CENHOW),D.writeUInt32LE(i,H.CENTIM),D.writeUInt32LE(o,H.CENCRC),D.writeUInt32LE(s,H.CENSIZ),D.writeUInt32LE(a,H.CENLEN),D.writeUInt16LE(u,H.CENNAM),D.writeUInt16LE(c,H.CENEXT),D.writeUInt16LE(l,H.CENCOM),D.writeUInt16LE(f,H.CENDSK),D.writeUInt16LE(h,H.CENATT),D.writeUInt32LE(d,H.CENATX),D.writeUInt32LE(p,H.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:Qn.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:D(s),size:D(a),fileNameLength:D(u),extraLength:D(c),commentLength:D(l),diskNumStart:f,inAttr:h,attr:d,offset:p,centralHeaderSize:D(H.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var DC=y((Qle,yC)=>{var ns=rs(),Ue=ns.Constants;yC.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return Ue.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Ue.ENDHDR||o.readUInt32LE(0)!==Ue.ENDSIG)&&(o.length<Ue.ZIP64HDR||o.readUInt32LE(0)!==Ue.ZIP64SIG))throw ns.Errors.INVALID_END();o.readUInt32LE(0)===Ue.ENDSIG?(t=o.readUInt16LE(Ue.ENDSUB),e=o.readUInt16LE(Ue.ENDTOT),r=o.readUInt32LE(Ue.ENDSIZ),n=o.readUInt32LE(Ue.ENDOFF),i=o.readUInt16LE(Ue.ENDCOM)):(t=ns.readBigUInt64LE(o,Ue.ZIP64SUB),e=ns.readBigUInt64LE(o,Ue.ZIP64TOT),r=ns.readBigUInt64LE(o,Ue.ZIP64SIZE),n=ns.readBigUInt64LE(o,Ue.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Ue.ENDHDR+i);return o.writeUInt32LE(Ue.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Ue.ENDSUB),o.writeUInt16LE(e,Ue.ENDTOT),o.writeUInt32LE(r,Ue.ENDSIZ),o.writeUInt32LE(n,Ue.ENDOFF),o.writeUInt16LE(i,Ue.ENDCOM),o.fill(" ",Ue.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var kg=y(Ag=>{Ag.EntryHeader=gC();Ag.MainHeader=DC()});var bC=y((tfe,vC)=>{vC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var _C=y((rfe,wC)=>{var NU=+(process.versions?process.versions.node:"").split(".")[0]||0;wC.exports=function(t,e){var r=require("zlib");let n=NU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var FC=y((nfe,xC)=>{"use strict";var{randomFillSync:EC}=require("crypto"),LU=Kl(),BU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),SC=(t,e)=>Math.imul(t,e)>>>0,CC=(t,e)=>BU[(t^e)&255]^t>>>8,Du=()=>typeof EC=="function"?EC(Buffer.alloc(12)):Du.node();Du.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Yl={genSalt:Du};function Jl(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Jl.prototype.updateKeys=function(t){let e=this.keys;return e[0]=CC(e[0],t),e[1]+=e[0]&255,e[1]=SC(e[1],134775813)+1,e[2]=CC(e[2],e[1]>>>24),t};Jl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return SC(t,t^1)>>8&255};function qU(t){let e=new Jl(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function MU(t){let e=new Jl(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function UU(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=qU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw LU.WRONG_PASSWORD();return n(t.slice(12))}function VU(t){Buffer.isBuffer(t)&&t.length>=12?Yl.genSalt=function(){return t.slice(0,12)}:t==="node"?Yl.genSalt=Du.node:Yl.genSalt=Du}function HU(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=MU(r),o=Yl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}xC.exports={decrypt:UU,encrypt:HU,_salter:VU}});var OC=y(Xl=>{Xl.Deflater=bC();Xl.Inflater=_C();Xl.ZipCrypto=FC()});var Pg=y((ofe,AC)=>{var be=rs(),zU=kg(),Ze=be.Constants,Tg=OC();AC.exports=function(t,e){var r=new zU.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:be.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(D){if(r.flags_desc){let C={},A=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(A)==Ze.LOCSIG||e.readUInt32LE(A)==Ze.CENSIG)throw be.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(A)==Ze.EXTSIG)C.crc=e.readUInt32LE(A+Ze.EXTCRC),C.compressedSize=e.readUInt32LE(A+Ze.EXTSIZ),C.size=e.readUInt32LE(A+Ze.EXTLEN);else if(e.readUInt16LE(A+12)===19280)C.crc=e.readUInt32LE(A+Ze.EXTCRC-4),C.compressedSize=e.readUInt32LE(A+Ze.EXTSIZ-4),C.size=e.readUInt32LE(A+Ze.EXTLEN-4);else throw be.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw be.Errors.DESCRIPTOR_FAULTY();if(be.crc32(D)!==C.crc)return!1}else if(be.crc32(D)!==r.localHeader.crc)return!1;return!0}function p(D,C,A){if(typeof C>"u"&&typeof D=="string"&&(A=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),be.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof A!="string"&&!Buffer.isBuffer(A))throw be.Errors.INVALID_PASS_PARAM();$=Tg.ZipCrypto.decrypt($,r,A)}var F=Buffer.alloc(r.size);switch(r.method){case be.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,be.Errors.BAD_CRC()),be.Errors.BAD_CRC();case be.Constants.DEFLATED:var L=new Tg.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,be.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw be.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),be.Errors.UNKNOWN_METHOD()),be.Errors.UNKNOWN_METHOD()}}function b(D,C){if((!s||!s.length)&&Buffer.isBuffer(e))return D&&C&&C(h()),h();if(s.length&&!o){var A;switch(r.method){case be.Constants.STORED:return r.compressedSize=r.size,A=Buffer.alloc(s.length),s.copy(A),D&&C&&C(A),A;default:case be.Constants.DEFLATED:var $=new Tg.Deflater(s);if(D)$.deflateAsync(function(L){A=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(A),C&&C(A)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(D&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(D,C){return(D.readUInt32LE(C+4)<<4)+D.readUInt32LE(C)}function w(D){try{for(var C=0,A,$,F;C+4<D.length;)A=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Ze.ID_ZIP64===A&&x(F)}catch{throw be.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,A,$,F;D.length>=Ze.EF_ZIP64_SCOMP&&(C=g(D,Ze.EF_ZIP64_SUNCOMP),r.size===Ze.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Ze.EF_ZIP64_RHO&&(A=g(D,Ze.EF_ZIP64_SCOMP),r.compressedSize===Ze.EF_ZIP64_OR_32&&(r.compressedSize=A)),D.length>=Ze.EF_ZIP64_DSN&&($=g(D,Ze.EF_ZIP64_RHO),r.offset===Ze.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Ze.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Ze.EF_ZIP64_DSN),r.diskNumStart===Ze.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=be.toBuffer(D,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(D){a=D,r.extraLength=D.length,w(D)},get comment(){return f.decode(i)},set comment(D){if(i=be.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw be.Errors.COMMENT_TOO_LONG()},get name(){var D=f.decode(n);return o?D.substr(D.length-1).split("/").pop():D.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(D){b(!0,D)},setData:function(D){s=be.toBuffer(D,be.decoder.encode),!o&&s.length?(r.size=s.length,r.method=be.Constants.DEFLATED,r.crc=be.crc32(D),r.changed=!0):r.method=be.Constants.STORED},getData:function(D){return r.changed?s:p(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):p(!0,D,C)},set attr(D){r.attr=D},get attr(){return r.attr},set header(D){r.loadFromBinary(D)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var D=r.centralHeaderToBinary(),C=be.Constants.CENHDR;return n.copy(D,C),C+=n.length,a.copy(D,C),C+=r.extraLength,i.copy(D,C),D},packLocalHeader:function(){let D=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),A=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(A,D),D+=C.length,n.copy(A,D),D+=n.length,u.copy(A,D),D+=u.length,A},toJSON:function(){let D=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:D(e),data:D(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var PC=y((sfe,TC)=>{var kC=Pg(),GU=kg(),bt=rs();TC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new GU.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?p(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let D=0;D<x.length;D++){let C=x.slice(0,D+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new kC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,D=new kC(c,t);D.header=t.slice(x,x+=bt.Constants.CENHDR),D.entryName=t.slice(x,x+=D.header.fileNameLength),D.header.extraLength&&(D.extra=t.slice(x,x+=D.header.extraLength)),D.header.commentLength&&(D.comment=t.slice(x,x+D.header.commentLength)),g+=D.header.centralHeaderSize,r[w]=D,n[D.entryName]=D}u.clear(),h()}function p(g){var w=t.length-bt.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,A=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===bt.Constants.ENDSIG){A=w,$=w,C=w+bt.Constants.ENDHDR,D=w-bt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===bt.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===bt.Constants.ZIP64SIG){A=w,C=w+bt.readBigUInt64LE(t,w+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(A==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(A,C)),o.commentLength&&(i=t.slice($+bt.Constants.ENDHDR)),g&&d()}function b(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=bt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],D=g.entryName;for(let C of r)C.entryName.startsWith(D)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),b();let g=[],w=[],x=0,D=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=D;let S=F.packLocalHeader(),I=S.length+L.length;D+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=D,o.totalEntries=C,D=0;let A=Buffer.alloc(x);for(let F of g)F.copy(A,D),D+=F.length;for(let F of w)F.copy(A,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,bt.Constants.ENDHDR),$.copy(A,D),t=A,s=!1,A},toAsyncBuffer:function(g,w,x,D){try{s||d(),b();let C=[],A=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){D&&D(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();A.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),A.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var IC=y((afe,$C)=>{var Ve=rs(),Qe=require("path"),WU=Pg(),KU=PC(),ji=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),RC=(...t)=>Ve.findLast(t,e=>typeof e=="string"),YU=(...t)=>Ve.findLast(t,e=>typeof e=="function"),JU={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};$C.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),JU);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=Ve.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ve(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ve.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ve.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ve.Errors.INVALID_FILENAME();let o=new KU(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function c(d){if(d&&o){var p;if(typeof d=="string"&&(p=o.getEntry(Qe.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(p=o.getEntry(d.entryName)),p)return p}return null}function l(d){let{join:p,normalize:b,sep:g}=Qe.posix;return p(".",b(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(p){return function(b){return p.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,p)=>{let b=p.slice(-1);return b=b===i.sep?i.sep:"",Qe.relative(d,p)+b};return{readFile:function(d,p){var b=c(d);return b&&b.getData(p)||null},childCount:function(d){let p=c(d);if(p)return o.getChildCount(p)},readFileAsync:function(d,p){var b=c(d);b?b.getDataAsync(p):p(null,"getEntry failed for:"+d)},readAsText:function(d,p){var b=c(d);if(b){var g=b.getData();if(g&&g.length)return g.toString(p||"utf8")}return""},readAsTextAsync:function(d,p,b){var g=c(d);g?g.getDataAsync(function(w,x){if(x){p(w,x);return}w&&w.length?p(w.toString(b||"utf8")):p("")}):p("")},deleteFile:function(d,p=!0){var b=c(d);b&&o.deleteFile(b.entryName,p)},deleteEntry:function(d){var p=c(d);p&&o.deleteEntry(p.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,p){var b=c(d);b&&(b.comment=p)},getZipEntryComment:function(d){var p=c(d);return p&&p.comment||""},updateFile:function(d,p){var b=c(d);b&&b.setData(p)},addLocalFile:function(d,p,b,g){if(i.fs.existsSync(d)){p=p?l(p):"";let w=Qe.win32.basename(Qe.win32.normalize(d));p+=b||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(p+=i.sep),this.addFile(p,D,g,x)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,p){d=typeof d=="object"?d:{localPath:d};let b=Qe.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(b,function(C,A){if(C)return p(C,!1);w=w?l(w):"";let $=Qe.win32.basename(Qe.win32.normalize(b));if(w+=x||$,A.isFile())i.fs.readFile(b,function(F,L){return F?p(F,!1):(D.addFile(w,L,g,A),setImmediate(p,void 0,!0))});else if(A.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,A),setImmediate(p,void 0,!0)})},addLocalFolder:function(d,p,b){if(b=f(b),p=p?l(p):"",d=Qe.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=Qe.join(p,h(d,x));b(D)&&w.addLocalFile(x,Qe.dirname(D))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,p,b,g){g=f(g),b=b?l(b):"",d=Qe.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")p(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(x)p(void 0,x);else{var D=i.findFiles(d),C=-1,A=function(){if(C+=1,C<D.length){var $=D[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&p(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?p(void 0,I):(w.addFile(b+F,R,"",S),A())}):(w.addFile(b+F+"/",Buffer.alloc(0),"",S),A())}):process.nextTick(()=>{A()})}else p(!0,void 0)};A()}})},addLocalFolderAsync2:function(d,p){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Qe.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(A){return function($){return A.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=A=>A.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=A=>A);let D=A=>Qe.join(g,x(h(localPath,A))),C=A=>Qe.win32.basename(Qe.win32.normalize(x(A)));i.fs.open(localPath,"r",function(A){A&&A.code==="ENOENT"?p(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):A?p(void 0,A):i.findFilesAsync(localPath,function($,F){if($)return p($);F=F.filter(L=>w(D(L))),F.length||p(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Qe.dirname(D(S)),zipName:C(S)},L)}},p))})})},addLocalFolderPromise:function(d,p){return new Promise((b,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},p),(w,x)=>{w&&g(w),x&&b(this)})})},addFile:function(d,p,b,g){d=u(d);let w=c(d),x=w!=null;x||(w=new WU(n),w.entryName=d),w.comment=b||"";let D=typeof g=="object"&&g instanceof i.fs.Stats;D&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let A=w.isDirectory?16384:32768;return D?A|=4095&g.mode:typeof g=="number"?A|=4095&g:A|=w.isDirectory?493:420,C=(C|A<<16)>>>0,w.attr=C,w.setData(p),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,p,b,g,w,x){g=ji(!1,g),w=ji(!1,w),b=ji(!0,b),x=RC(w,x);var D=c(d);if(!D)throw Ve.Errors.NO_ENTRY();var C=s(D.entryName),A=a(p,x&&!D.isDirectory?x:b?C:Qe.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(p,b?R:Qe.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=D.getData(o.password);if(!F)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(A)&&!g)throw Ve.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(A,F,g,L),!0},test:function(d){if(!o)return!1;for(var p in o.entries)try{if(p.isDirectory)continue;var b=o.entries[p].getData(d);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(d,p,b,g){if(b=ji(!1,b),g=RC(b,g),p=ji(!1,p),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var D=w.getData(g);if(!D)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?w.header.fileAttr:void 0;i.writeFileTo(x,D,p,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,p,b,g){if(g=YU(p,b,g),b=ji(!1,b),p=ji(!1,p),!g)return new Promise((A,$)=>{this.extractAllToAsync(d,p,b,function(F){F?$(F):A(this)})});if(!o){g(Ve.Errors.NO_ZIP());return}d=Qe.resolve(d);let w=A=>a(d,Qe.normalize(s(A.entryName))),x=(A,$)=>new Error(A+': "'+$+'"'),D=[],C=[];o.entries.forEach(A=>{A.isDirectory?D.push(A):C.push(A)});for(let A of D){let $=w(A),F=b?A.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,A.header.time,A.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(A,$){return function(F){if(F)A(F);else{let L=Qe.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)A(R);else if(!I)A(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,p,B,function(q){q||A(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?A(x("Unable to set times",S)):A()})})}})}}},g)()},writeZip:function(d,p){if(arguments.length===1&&typeof d=="function"&&(p=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var b=o.compressToBuffer();if(b){var g=i.writeFileTo(d,b,!0);typeof p=="function"&&p(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,p){let{overwrite:b,perm:g}=Object.assign({overwrite:!0},p);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(D=>{let C=A=>A?w(A):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,b,g,C)},x)})},toBufferPromise:function(){return new Promise((d,p)=>{o.toAsyncBuffer(d,p)})},toBuffer:function(d,p,b,g){return typeof d=="function"?(o.toAsyncBuffer(d,p,b,g),null):o.compressToBuffer()}}}});var JC=y((Ife,YC)=>{var KC={};YC.exports=KC;var WC={reset:[0,0],bold:[1,22],dim:[2,22],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],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,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],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(WC).forEach(function(t){var e=WC[t],r=KC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var ZC=y((jfe,XC)=>{"use strict";XC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var eS=y((Nfe,QC)=>{"use strict";var r9=require("os"),Ar=ZC(),Tt=process.env,ss=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?ss=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(ss=!0);"FORCE_COLOR"in Tt&&(ss=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function n9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function i9(t){if(ss===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&ss!==!0)return 0;var e=ss?1:0;if(process.platform==="win32"){var r=r9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function Bg(t){var e=i9(t);return n9(e)}QC.exports={supportsColor:Bg,stdout:Bg(process.stdout),stderr:Bg(process.stderr)}});var rS=y((Lfe,tS)=>{tS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var iS=y((Bfe,nS)=>{nS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var p in d)for(var b=d[p],g=0;g<=f[b];g++)c[b]&&(l=l+n[b][o(n[b].length)])}return l}return a(e,r)}});var sS=y((qfe,oS)=>{oS.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var uS=y((Mfe,aS)=>{aS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var lS=y((Ufe,cS)=>{cS.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var dS=y((Vfe,fS)=>{fS.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var DS=y((zfe,yS)=>{var ce={};yS.exports=ce;ce.themes={};var o9=require("util"),Ni=ce.styles=JC(),pS=Object.defineProperties,s9=new RegExp(/[\r\n]+/g);ce.supportsColor=eS().supportsColor;typeof ce.enabled>"u"&&(ce.enabled=ce.supportsColor()!==!1);ce.enable=function(){ce.enabled=!0};ce.disable=function(){ce.enabled=!1};ce.stripColors=ce.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var Hfe=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Ni[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},a9=/[|\\{}()[\]^$+*?.]/g,u9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(a9,"\\$&")};function mS(t){var e=function r(){return l9.apply(r,arguments)};return e._styles=t,e.__proto__=c9,e}var gS=function(){var t={};return Ni.grey=Ni.gray,Object.keys(Ni).forEach(function(e){Ni[e].closeRe=new RegExp(u9(Ni[e].close),"g"),t[e]={get:function(){return mS(this._styles.concat(e))}}}),t}(),c9=pS(function(){},gS);function l9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:o9.inspect(s)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
24
- `)!=-1,n=this._styles,i=n.length;i--;){var o=Ni[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(s9,function(s){return o.close+s+o.open}))}return e}ce.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){ce[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=ce[t[r][o]](i);return i}return ce[t[r]](n)}})(e)};function f9(){var t={};return Object.keys(gS).forEach(function(e){t[e]={get:function(){return mS([e])}}}),t}var d9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};ce.trap=rS();ce.zalgo=iS();ce.maps={};ce.maps.america=sS()(ce);ce.maps.zebra=uS()(ce);ce.maps.rainbow=lS()(ce);ce.maps.random=dS()(ce);for(hS in ce.maps)(function(t){ce[t]=function(e){return d9(ce.maps[t],e)}})(hS);var hS;pS(ce,f9())});var bS=y((Gfe,vS)=>{var h9=DS();vS.exports=h9});var wS=y(qg=>{"use strict";qg.indent=function(e){return new Array(e+1).join(" ")};qg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var _S=y((Kfe,p9)=>{p9.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var ES=y(wu=>{"use strict";var zr=bS(),ti=wS(),m9=/[^\w\s\n\r\v\t\.,]/i;wu.version=_S().version;var Mg=function(t,e){return t!==void 0||e.renderUndefined},rf=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
25
- `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&rf(t[0],!0,r))},g9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?zr[e.stringColor](t):t;var r=t+"";return t===!0?zr.green(r):t===!1?zr.red(r):t==null?zr.grey(r):typeof t=="number"?t>=0?zr[e.positiveNumberColor](r):zr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},Ug=function(t,e){return t.multilineStringColor===null||t.noColor?e:zr[t.multilineStringColor](e)},y9=function(t,e,r){var n=t.split(`
23
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function fw(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}dw.Command=Rp});var yw=y(hr=>{var{Argument:pw}=rl(),{Command:$p}=hw(),{CommanderError:pB,InvalidArgumentError:mw}=$a(),{Help:mB}=Sp(),{Option:gw}=Ap();hr.program=new $p;hr.createCommand=t=>new $p(t);hr.createOption=(t,e)=>new gw(t,e);hr.createArgument=(t,e)=>new pw(t,e);hr.Command=$p;hr.Option=gw;hr.Argument=pw;hr.Help=mB;hr.CommanderError=pB;hr.InvalidArgumentError=mw;hr.InvalidOptionArgumentError=mw});var ke=y((dce,vw)=>{"use strict";var Ip="\x1B",Me=`${Ip}[`,yB="\x07",jp={to(t,e){return e?`${Me}${e+1};${t+1}H`:`${Me}${t+1}G`},move(t,e){let r="";return t<0?r+=`${Me}${-t}D`:t>0&&(r+=`${Me}${t}C`),e<0?r+=`${Me}${-e}A`:e>0&&(r+=`${Me}${e}B`),r},up:(t=1)=>`${Me}${t}A`,down:(t=1)=>`${Me}${t}B`,forward:(t=1)=>`${Me}${t}C`,backward:(t=1)=>`${Me}${t}D`,nextLine:(t=1)=>`${Me}E`.repeat(t),prevLine:(t=1)=>`${Me}F`.repeat(t),left:`${Me}G`,hide:`${Me}?25l`,show:`${Me}?25h`,save:`${Ip}7`,restore:`${Ip}8`},DB={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},vB={screen:`${Me}2J`,up:(t=1)=>`${Me}1J`.repeat(t),down:(t=1)=>`${Me}J`.repeat(t),line:`${Me}2K`,lineEnd:`${Me}K`,lineStart:`${Me}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?jp.up():"");return t&&(e+=jp.left),e}};vw.exports={cursor:jp,scroll:DB,erase:vB,beep:yB}});var _w=y((hce,Np)=>{var bB=require("tty"),wB=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||bB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),$e=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+bw(i,e,r,o)+e:t+i+e},bw=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+bw(o,e,r,s):i+o},ww=(t=wB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?$e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?$e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?$e("\x1B[3m","\x1B[23m"):String,underline:t?$e("\x1B[4m","\x1B[24m"):String,inverse:t?$e("\x1B[7m","\x1B[27m"):String,hidden:t?$e("\x1B[8m","\x1B[28m"):String,strikethrough:t?$e("\x1B[9m","\x1B[29m"):String,black:t?$e("\x1B[30m","\x1B[39m"):String,red:t?$e("\x1B[31m","\x1B[39m"):String,green:t?$e("\x1B[32m","\x1B[39m"):String,yellow:t?$e("\x1B[33m","\x1B[39m"):String,blue:t?$e("\x1B[34m","\x1B[39m"):String,magenta:t?$e("\x1B[35m","\x1B[39m"):String,cyan:t?$e("\x1B[36m","\x1B[39m"):String,white:t?$e("\x1B[37m","\x1B[39m"):String,gray:t?$e("\x1B[90m","\x1B[39m"):String,bgBlack:t?$e("\x1B[40m","\x1B[49m"):String,bgRed:t?$e("\x1B[41m","\x1B[49m"):String,bgGreen:t?$e("\x1B[42m","\x1B[49m"):String,bgYellow:t?$e("\x1B[43m","\x1B[49m"):String,bgBlue:t?$e("\x1B[44m","\x1B[49m"):String,bgMagenta:t?$e("\x1B[45m","\x1B[49m"):String,bgCyan:t?$e("\x1B[46m","\x1B[49m"):String,bgWhite:t?$e("\x1B[47m","\x1B[49m"):String});Np.exports=ww();Np.exports.createColors=ww});var Lw=y((mce,Hp)=>{var NB=require("tty"),LB=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||NB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),je=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+jw(i,e,r,o)+e:t+i+e},jw=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+jw(o,e,r,s):i+o},Nw=(t=LB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?je("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?je("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?je("\x1B[3m","\x1B[23m"):String,underline:t?je("\x1B[4m","\x1B[24m"):String,inverse:t?je("\x1B[7m","\x1B[27m"):String,hidden:t?je("\x1B[8m","\x1B[28m"):String,strikethrough:t?je("\x1B[9m","\x1B[29m"):String,black:t?je("\x1B[30m","\x1B[39m"):String,red:t?je("\x1B[31m","\x1B[39m"):String,green:t?je("\x1B[32m","\x1B[39m"):String,yellow:t?je("\x1B[33m","\x1B[39m"):String,blue:t?je("\x1B[34m","\x1B[39m"):String,magenta:t?je("\x1B[35m","\x1B[39m"):String,cyan:t?je("\x1B[36m","\x1B[39m"):String,white:t?je("\x1B[37m","\x1B[39m"):String,gray:t?je("\x1B[90m","\x1B[39m"):String,bgBlack:t?je("\x1B[40m","\x1B[49m"):String,bgRed:t?je("\x1B[41m","\x1B[49m"):String,bgGreen:t?je("\x1B[42m","\x1B[49m"):String,bgYellow:t?je("\x1B[43m","\x1B[49m"):String,bgBlue:t?je("\x1B[44m","\x1B[49m"):String,bgMagenta:t?je("\x1B[45m","\x1B[49m"):String,bgCyan:t?je("\x1B[46m","\x1B[49m"):String,bgWhite:t?je("\x1B[47m","\x1B[49m"):String});Hp.exports=Nw();Hp.exports.createColors=Nw});var ll=y(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.isNXMonorepo=Mt.isMonorepo=Mt.findPackageRelativePathInMonorepo=Mt.findPackagePath=Mt.findNXMonorepoRoot=Mt.findMonorepoRoot=void 0;var Na=require("node:fs"),Wn=require("node:path");function cl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,Na.existsSync)(r)||(0,Na.existsSync)(e)&&JSON.parse((0,Na.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return cl(n)}Mt.findMonorepoRoot=cl;function Jp(t){let e=(0,Wn.join)(t,"nx.json");if((0,Na.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Jp(r)}Mt.findNXMonorepoRoot=Jp;function Xp(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,Na.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return Xp(t,i,r)}Mt.findPackagePath=Xp;function GB(t,e){let r=cl(e),n=Xp(t,e,r);return n?(0,Wn.relative)(e,n):null}Mt.findPackageRelativePathInMonorepo=GB;function WB(t){try{return cl(t),!0}catch{return!1}}Mt.isMonorepo=WB;function KB(t){try{return Jp(t),!0}catch{return!1}}Mt.isNXMonorepo=KB});var Si={};mn(Si,{default:()=>YB});var YB,xi=ct(()=>{YB={}});var zw=y(jr=>{"use strict";var JB=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),XB=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZB=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&JB(e,t,r);return XB(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var QB=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>ZB((xi(),Ae(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=QB});var tm=y(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var qo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=qo;var Zp=class extends qo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=Zp;var Qp=class extends qo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=Qp;var em=class extends qo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=em;var eq;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(eq=nr.FunctionRegion||(nr.FunctionRegion={}))});var Gw=y(Mo=>{"use strict";var tq=Mo&&Mo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.FunctionsClient=void 0;var rq=zw(),dl=tm(),rm=class{constructor(e,{headers:r={},customFetch:n,region:i=dl.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,rq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return tq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(p=>{throw new dl.FunctionsFetchError(p)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new dl.FunctionsRelayError(l);if(!l.ok)throw new dl.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Mo.FunctionsClient=rm});var nm=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.FunctionRegion=Ut.FunctionsRelayError=Ut.FunctionsHttpError=Ut.FunctionsFetchError=Ut.FunctionsError=Ut.FunctionsClient=void 0;var nq=Gw();Object.defineProperty(Ut,"FunctionsClient",{enumerable:!0,get:function(){return nq.FunctionsClient}});var Ba=tm();Object.defineProperty(Ut,"FunctionsError",{enumerable:!0,get:function(){return Ba.FunctionsError}});Object.defineProperty(Ut,"FunctionsFetchError",{enumerable:!0,get:function(){return Ba.FunctionsFetchError}});Object.defineProperty(Ut,"FunctionsHttpError",{enumerable:!0,get:function(){return Ba.FunctionsHttpError}});Object.defineProperty(Ut,"FunctionsRelayError",{enumerable:!0,get:function(){return Ba.FunctionsRelayError}});Object.defineProperty(Ut,"FunctionRegion",{enumerable:!0,get:function(){return Ba.FunctionRegion}})});var Ww=y(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var im=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};om.default=im});var am=y(qa=>{"use strict";var Kw=qa&&qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qa,"__esModule",{value:!0});var iq=Kw((xi(),Ae(Si))),oq=Kw(Ww()),sm=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=iq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let b=await o.text();try{c=JSON.parse(b),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):c={message:b}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new oq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};qa.default=sm});var cm=y(Ma=>{"use strict";var sq=Ma&&Ma.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ma,"__esModule",{value:!0});var aq=sq(am()),um=class extends aq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Ma.default=um});var hl=y(Ua=>{"use strict";var uq=Ua&&Ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ua,"__esModule",{value:!0});var cq=uq(cm()),lm=class extends cq.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let o="";i==="plain"?o="pl":i==="phrase"?o="ph":i==="websearch"&&(o="w");let s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${s}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};Ua.default=lm});var dm=y(Ha=>{"use strict";var lq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var Va=lq(hl()),fm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=r,this.schema=n,this.fetch=i}select(e,{head:r=!1,count:n}={}){let i=r?"HEAD":"GET",o=!1,s=(e??"*").split("").map(a=>/\s/.test(a)&&!o?"":(a==='"'&&(o=!o),a)).join("");return this.url.searchParams.set("select",s),n&&(this.headers.Prefer=`count=${n}`),new Va.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:r,defaultToNull:n=!0}={}){let i="POST",o=[];if(this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),n||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let s=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(s.length>0){let a=[...new Set(s)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new Va.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new Va.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:r}={}){let n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),this.headers.Prefer=i.join(","),new Va.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let r="DELETE",n=[];return e&&n.push(`count=${e}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new Va.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ha.default=fm});var Yw=y(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.version=void 0;pl.version="0.0.0-automated"});var Jw=y(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.DEFAULT_HEADERS=void 0;var fq=Yw();ml.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${fq.version}`}});var Zw=y(za=>{"use strict";var Xw=za&&za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(za,"__esModule",{value:!0});var dq=Xw(dm()),hq=Xw(hl()),pq=Jw(),hm=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},pq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new dq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new hq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};za.default=hm});var i_=y(kt=>{"use strict";var Ga=kt&&kt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kt,"__esModule",{value:!0});kt.PostgrestBuilder=kt.PostgrestTransformBuilder=kt.PostgrestFilterBuilder=kt.PostgrestQueryBuilder=kt.PostgrestClient=void 0;var Qw=Ga(Zw());kt.PostgrestClient=Qw.default;var e_=Ga(dm());kt.PostgrestQueryBuilder=e_.default;var t_=Ga(hl());kt.PostgrestFilterBuilder=t_.default;var r_=Ga(cm());kt.PostgrestTransformBuilder=r_.default;var n_=Ga(am());kt.PostgrestBuilder=n_.default;kt.default={PostgrestClient:Qw.default,PostgrestQueryBuilder:e_.default,PostgrestFilterBuilder:t_.default,PostgrestTransformBuilder:r_.default,PostgrestBuilder:n_.default}});var mm={};mn(mm,{RealtimeClient:()=>pm});var pm,gm=ct(()=>{pm=class{constructor(){}connect(){}disconnect(){}}});var Ka=y(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Wa=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Wa;function mq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=mq;var ym=class extends Wa{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=ym;var Dm=class extends Wa{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=Dm});var gl=y(lt=>{"use strict";var gq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),yq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o_=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&gq(e,t,r);return yq(e,t),e},Dq=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.recursiveToCamel=lt.resolveResponse=lt.resolveFetch=void 0;var vq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>o_((xi(),Ae(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};lt.resolveFetch=vq;var bq=()=>Dq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>o_((xi(),Ae(Si))))).Response:Response});lt.resolveResponse=bq;var wq=t=>{if(Array.isArray(t))return t.map(r=>(0,lt.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,lt.recursiveToCamel)(n)}),e};lt.recursiveToCamel=wq});var wm=y(Vt=>{"use strict";var Fi=Vt&&Vt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.remove=Vt.head=Vt.put=Vt.post=Vt.get=void 0;var vm=Ka(),_q=gl(),bm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Eq=(t,e,r)=>Fi(void 0,void 0,void 0,function*(){let n=yield(0,_q.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new vm.StorageApiError(bm(i),t.status||500))}).catch(i=>{e(new vm.StorageUnknownError(bm(i),i))}):e(new vm.StorageUnknownError(bm(t),t))}),Cq=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),r))};function Ya(t,e,r,n,i,o){return Fi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,Cq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Eq(u,a,n))})})}function Sq(t,e,r,n){return Fi(this,void 0,void 0,function*(){return Ya(t,"GET",e,r,n)})}Vt.get=Sq;function xq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Ya(t,"POST",e,n,i,r)})}Vt.post=xq;function Fq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Ya(t,"PUT",e,n,i,r)})}Vt.put=Fq;function Oq(t,e,r,n){return Fi(this,void 0,void 0,function*(){return Ya(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Vt.head=Oq;function Aq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Ya(t,"DELETE",e,n,i,r)})}Vt.remove=Aq});var u_=y(Ja=>{"use strict";var Ht=Ja&&Ja.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ja,"__esModule",{value:!0});var zt=Ka(),Lr=wm(),s_=gl(),kq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},_m=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,s_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ht(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},a_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),o.append("",n),u&&o.append("metadata",this.encodeMetadata(u))):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,zt.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ht(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:a_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,zt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Ht(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new zt.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Ht(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,zt.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,s_.recursiveToCamel)(n),error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,zt.isStorageError)(n)&&n instanceof zt.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,zt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},kq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Ja.default=_m});var c_=y(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.version=void 0;yl.version="2.7.0"});var l_=y(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DEFAULT_HEADERS=void 0;var Tq=c_();Dl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Tq.version}`}});var f_=y(Xa=>{"use strict";var Uo=Xa&&Xa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Xa,"__esModule",{value:!0});var Pq=l_(),Vo=Ka(),Ho=wm(),Rq=gl(),Em=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Pq.DEFAULT_HEADERS),r),this.fetch=(0,Rq.resolveFetch)(n)}listBuckets(){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Vo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.post)(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Vo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.put)(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Vo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Uo(this,void 0,void 0,function*(){try{return{data:yield(0,Ho.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}};Xa.default=Em});var h_=y(zo=>{"use strict";var d_=zo&&zo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zo,"__esModule",{value:!0});zo.StorageClient=void 0;var $q=d_(u_()),Iq=d_(f_()),Cm=class extends Iq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new $q.default(this.url,this.headers,e,this.fetch)}};zo.StorageClient=Cm});var m_=y(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var y_=y(Br=>{"use strict";var jq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Nq=h_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Nq.StorageClient}});g_(m_(),Br);g_(Ka(),Br)});var D_=y(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.version=void 0;vl.version="2.45.2"});var v_=y(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Lq=D_(),Za="";typeof Deno<"u"?Za="deno":typeof document<"u"?Za="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Za="react-native":Za="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Za}/${Lq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var w_=y(ft=>{"use strict";var Bq=ft&&ft.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qq=ft&&ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Mq=ft&&ft.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Bq(e,t,r);return qq(e,t),e},Uq=ft&&ft.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ft,"__esModule",{value:!0});ft.fetchWithAuth=ft.resolveHeadersConstructor=ft.resolveFetch=void 0;var b_=Mq((xi(),Ae(Si))),Vq=t=>{let e;return t?e=t:typeof fetch>"u"?e=b_.default:e=fetch,(...r)=>e(...r)};ft.resolveFetch=Vq;var Hq=()=>typeof Headers>"u"?b_.Headers:Headers;ft.resolveHeadersConstructor=Hq;var zq=(t,e,r)=>{let n=(0,ft.resolveFetch)(r),i=(0,ft.resolveHeadersConstructor)();return(o,s)=>Uq(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};ft.fetchWithAuth=zq});var __=y(mr=>{"use strict";var Gq=mr&&mr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(mr,"__esModule",{value:!0});mr.applySettingDefaults=mr.isBrowser=mr.stripTrailingSlash=mr.uuid=void 0;function Wq(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}mr.uuid=Wq;function Kq(t){return t.replace(/\/$/,"")}mr.stripTrailingSlash=Kq;var Yq=()=>typeof window<"u";mr.isBrowser=Yq;function Jq(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>Gq(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}mr.applySettingDefaults=Jq});var Sm=y(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.version=void 0;bl.version="2.64.4"});var wl=y(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.API_VERSIONS=dt.API_VERSION_HEADER_NAME=dt.NETWORK_FAILURE=dt.EXPIRY_MARGIN=dt.DEFAULT_HEADERS=dt.AUDIENCE=dt.STORAGE_KEY=dt.GOTRUE_URL=void 0;var Xq=Sm();dt.GOTRUE_URL="http://localhost:9999";dt.STORAGE_KEY="supabase.auth.token";dt.AUDIENCE="";dt.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${Xq.version}`};dt.EXPIRY_MARGIN=10;dt.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};dt.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";dt.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Go=y(te=>{"use strict";var Zq=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Qq=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e4=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Zq(e,t,r);return Qq(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var t4=wl();function r4(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=r4;function n4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=n4;var i4=()=>typeof document<"u";te.isBrowser=i4;var Oi={tested:!1,writable:!1},o4=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Oi.tested)return Oi.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Oi.tested=!0,Oi.writable=!0}catch{Oi.tested=!0,Oi.writable=!1}return Oi.writable};te.supportsLocalStorage=o4;function s4(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=s4;var a4=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>e4((xi(),Ae(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=a4;var u4=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=u4;var c4=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=c4;var l4=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=l4;var f4=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=f4;function E_(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=E_;var _l=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=_l;_l.promiseConstructor=Promise;function d4(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(E_(n))}te.decodeJWTPayload=d4;async function h4(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=h4;function p4(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=p4;function m4(t){return("0"+t.toString(16)).substr(-2)}function C_(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,m4).join("")}te.generatePKCEVerifier=C_;async function g4(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}function y4(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function S_(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await g4(t);return y4(r)}te.generatePKCEChallenge=S_;async function D4(t,e,r=!1){let n=C_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await S_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=D4;var v4=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function b4(t){let e=t.headers.get(t4.API_VERSION_HEADER_NAME);if(!e||!e.match(v4))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=b4});var Qa=y(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isAuthWeakPasswordError=ye.AuthWeakPasswordError=ye.isAuthRetryableFetchError=ye.AuthRetryableFetchError=ye.AuthPKCEGrantCodeExchangeError=ye.AuthImplicitGrantRedirectError=ye.AuthInvalidCredentialsError=ye.AuthInvalidTokenResponseError=ye.AuthSessionMissingError=ye.CustomAuthError=ye.AuthUnknownError=ye.isAuthApiError=ye.AuthApiError=ye.isAuthError=ye.AuthError=void 0;var Wo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};ye.AuthError=Wo;function El(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}ye.isAuthError=El;var xm=class extends Wo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};ye.AuthApiError=xm;function w4(t){return El(t)&&t.name==="AuthApiError"}ye.isAuthApiError=w4;var Fm=class extends Wo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};ye.AuthUnknownError=Fm;var qr=class extends Wo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};ye.CustomAuthError=qr;var Om=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};ye.AuthSessionMissingError=Om;var Am=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};ye.AuthInvalidTokenResponseError=Am;var km=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};ye.AuthInvalidCredentialsError=km;var Tm=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ye.AuthImplicitGrantRedirectError=Tm;var Pm=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ye.AuthPKCEGrantCodeExchangeError=Pm;var Rm=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};ye.AuthRetryableFetchError=Rm;function _4(t){return El(t)&&t.name==="AuthRetryableFetchError"}ye.isAuthRetryableFetchError=_4;var $m=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};ye.AuthWeakPasswordError=$m;function E4(t){return El(t)&&t.name==="AuthWeakPasswordError"}ye.isAuthWeakPasswordError=E4});var Nm=y(nt=>{"use strict";var C4=nt&&nt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(nt,"__esModule",{value:!0});nt._noResolveJsonResponse=nt._generateLinkResponse=nt._ssoResponse=nt._userResponse=nt._sessionResponsePassword=nt._sessionResponse=nt._request=nt.handleError=void 0;var Cl=wl(),Im=Go(),Ai=Qa(),ki=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),S4=[502,503,504];async function jm(t){var e;if(!(0,Im.looksLikeFetchResponse)(t))throw new Ai.AuthRetryableFetchError(ki(t),0);if(S4.includes(t.status))throw new Ai.AuthRetryableFetchError(ki(t),t.status);let r;try{r=await t.json()}catch(o){throw new Ai.AuthUnknownError(ki(o),o)}let n,i=(0,Im.parseResponseAPIVersion)(t);if(i&&i.getTime()>=Cl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Ai.AuthWeakPasswordError(ki(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[])}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Ai.AuthWeakPasswordError(ki(r),t.status,r.weak_password.reasons);throw new Ai.AuthApiError(ki(r),t.status||500,n)}nt.handleError=jm;var x4=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function F4(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[Cl.API_VERSION_HEADER_NAME]||(o[Cl.API_VERSION_HEADER_NAME]=Cl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await O4(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}nt._request=F4;async function O4(t,e,r,n,i,o){let s=x4(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Ai.AuthRetryableFetchError(ki(u),0)}if(a.ok||await jm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await jm(u)}}function x_(t){var e;let r=null;$4(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Im.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}nt._sessionResponse=x_;function A4(t){let e=x_(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}nt._sessionResponsePassword=A4;function k4(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}nt._userResponse=k4;function T4(t){return{data:t,error:null}}nt._ssoResponse=T4;function P4(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=C4(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},u=Object.assign({},s);return{data:{properties:a,user:u},error:null}}nt._generateLinkResponse=P4;function R4(t){return t}nt._noResolveJsonResponse=R4;function $4(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Sl=y(eu=>{"use strict";var I4=eu&&eu.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(eu,"__esModule",{value:!0});var vt=Nm(),j4=Go(),Mr=Qa(),Lm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,j4.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=I4(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(p=>{let b=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);c[`${g}Page`]=b}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};eu.default=Lm});var F_=y(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.memoryLocalStorageAdapter=Ko.localStorageAdapter=void 0;var Bm=Go();Ko.localStorageAdapter={getItem:t=>(0,Bm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Bm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Bm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function N4(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Ko.memoryLocalStorageAdapter=N4});var O_=y(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.polyfillGlobalThis=void 0;function L4(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}xl.polyfillGlobalThis=L4});var qm=y(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.navigatorLock=Et.NavigatorLockAcquireTimeoutError=Et.LockAcquireTimeoutError=Et.internals=void 0;var B4=Go();Et.internals={debug:!!(globalThis&&(0,B4.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Fl=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Et.LockAcquireTimeoutError=Fl;var Ol=class extends Fl{};Et.NavigatorLockAcquireTimeoutError=Ol;async function q4(t,e,r){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Ol(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Et.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}Et.navigatorLock=q4});var Um=y(nu=>{"use strict";var M4=nu&&nu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nu,"__esModule",{value:!0});var U4=M4(Sl()),ru=wl(),Q=Qa(),ae=Nm(),de=Go(),Mm=F_(),V4=O_(),H4=Sm(),A_=qm();(0,V4.polyfillGlobalThis)();var z4={url:ru.GOTRUE_URL,storageKey:ru.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ru.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},tu=30*1e3,k_=3;async function T_(t,e,r){return await r()}var Al=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,de.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},z4),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new U4.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,de.resolveFetch)(i.fetch),this.lock=i.lock||T_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,de.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=A_.navigatorLock:this.lock=T_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,de.supportsLocalStorage)()?this.storage=Mm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,Mm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,Mm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,de.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${H4.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,de.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.message==="Identity is already linked"||n?.message==="Identity is already linked to another user"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Q.isAuthError)(e)?{error:e}:{error:new Q.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Q.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,p=null;this.flowType==="pkce"&&([d,p]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:p},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Q.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Q.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,de.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/"),{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});return await(0,de.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s?{data:{user:null,session:null,redirectType:null},error:s}:!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Q.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Q.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Q.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Q.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Q.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Q.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Q.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Q.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,de.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Q.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Q.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Q.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,de.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Q.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,de.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Q.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Q.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Q.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,de.isBrowser)())throw new Q.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Q.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Q.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,de.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Q.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:D}=await this._exchangeCodeForSession(r.code);if(D)throw D;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Q.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Q.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=tu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let p=h-f;l-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,h,l):l-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",p,h,l);let{data:b,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Q.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,de.parseParametersFromURL)(window.location.href);return!!((0,de.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,de.parseParametersFromURL)(window.location.href),r=await(0,de.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Q.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,de.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){let r=(0,de.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Q.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,de.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Q.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,de.retryable)(async i=>(i>0&&await(0,de.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Q.isAuthRetryableFetchError)(o)&&Date.now()+s-n<tu})}catch(n){if(this._debug(r,"error",n),(0,Q.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,de.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,de.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+ru.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${ru.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Q.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Q.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new de.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Q.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Q.isAuthError)(o)){let s={session:null,error:o};return(0,Q.isAuthRetryableFetchError)(o)||(await this._removeSession(),await this._notifyAllSubscribers("SIGNED_OUT",null)),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,de.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,de.removeItemAsync)(this.storage,this.storageKey)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,de.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),tu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/tu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${tu}ms, refresh threshold is ${k_} ticks`),i<=k_&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof A_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,de.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,de.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let{data:a,error:u}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return u?{data:null,error:u}:(!((i=a?.totp)===null||i===void 0)&&i.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),{data:a,error:null})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Q.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(o=>o.factor_type==="totp"&&o.status==="verified");return{data:{all:n,totp:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};nu.default=Al;Al.nextInstanceID=0});var P_=y(iu=>{"use strict";var G4=iu&&iu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iu,"__esModule",{value:!0});var W4=G4(Sl()),K4=W4.default;iu.default=K4});var R_=y(ou=>{"use strict";var Y4=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var J4=Y4(Um()),X4=J4.default;ou.default=X4});var I_=y($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0})});var Hm=y(Ne=>{"use strict";var Z4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Z4(e,t,r)},kl=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.lockInternals=Ne.NavigatorLockAcquireTimeoutError=Ne.navigatorLock=Ne.AuthClient=Ne.AuthAdminApi=Ne.GoTrueClient=Ne.GoTrueAdminApi=void 0;var Q4=kl(Sl());Ne.GoTrueAdminApi=Q4.default;var eM=kl(Um());Ne.GoTrueClient=eM.default;var tM=kl(P_());Ne.AuthAdminApi=tM.default;var rM=kl(R_());Ne.AuthClient=rM.default;j_(I_(),Ne);j_(Qa(),Ne);var Vm=qm();Object.defineProperty(Ne,"navigatorLock",{enumerable:!0,get:function(){return Vm.navigatorLock}});Object.defineProperty(Ne,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Vm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ne,"lockInternals",{enumerable:!0,get:function(){return Vm.internals}})});var N_=y(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.SupabaseAuthClient=void 0;var nM=Hm(),zm=class extends nM.AuthClient{constructor(e){super(e)}};Tl.SupabaseAuthClient=zm});var Wm=y(su=>{"use strict";var iM=su&&su.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(su,"__esModule",{value:!0});var oM=nm(),sM=i_(),aM=(gm(),Ae(mm)),uM=y_(),Pl=v_(),cM=w_(),L_=__(),lM=N_(),Gm=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,L_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:Pl.DEFAULT_DB_OPTIONS,realtime:Pl.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Pl.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Pl.DEFAULT_GLOBAL_OPTIONS},l=(0,L_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,cM.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new sM.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new oM.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new uM.StorageClient(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return iM(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new lM.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new aM.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};su.default=Gm});var M_=y(Le=>{"use strict";var fM=Le&&Le.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),B_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fM(e,t,r)},q_=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.createClient=Le.SupabaseClient=Le.FunctionRegion=Le.FunctionsError=Le.FunctionsRelayError=Le.FunctionsFetchError=Le.FunctionsHttpError=void 0;var dM=q_(Wm());B_(Hm(),Le);var au=nm();Object.defineProperty(Le,"FunctionsHttpError",{enumerable:!0,get:function(){return au.FunctionsHttpError}});Object.defineProperty(Le,"FunctionsFetchError",{enumerable:!0,get:function(){return au.FunctionsFetchError}});Object.defineProperty(Le,"FunctionsRelayError",{enumerable:!0,get:function(){return au.FunctionsRelayError}});Object.defineProperty(Le,"FunctionsError",{enumerable:!0,get:function(){return au.FunctionsError}});Object.defineProperty(Le,"FunctionRegion",{enumerable:!0,get:function(){return au.FunctionRegion}});B_((gm(),Ae(mm)),Le);var hM=Wm();Object.defineProperty(Le,"SupabaseClient",{enumerable:!0,get:function(){return q_(hM).default}});var pM=(t,e,r)=>new dM.default(t,e,r);Le.createClient=pM});var Km=y((_le,U_)=>{U_.exports=require("stream")});var K_=y((Ele,W_)=>{"use strict";function V_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function H_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?V_(Object(r),!0).forEach(function(n){mM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mM(t,e,r){return e=G_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G_(n.key),n)}}function yM(t,e,r){return e&&z_(t.prototype,e),r&&z_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function G_(t){var e=DM(t,"string");return typeof e=="symbol"?e:String(e)}function DM(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var vM=require("buffer"),Rl=vM.Buffer,bM=require("util"),Ym=bM.inspect,wM=Ym&&Ym.custom||"inspect";function _M(t,e,r){Rl.prototype.copy.call(t,e,r)}W_.exports=function(){function t(){gM(this,t),this.head=null,this.tail=null,this.length=0}return yM(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Rl.alloc(0);for(var n=Rl.allocUnsafe(r>>>0),i=this.head,o=0;i;)_M(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=Rl.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:wM,value:function(r,n){return Ym(this,H_(H_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var Xm=y((Cle,J_)=>{"use strict";function EM(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Jm,this,t)):process.nextTick(Jm,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick($l,r):(r._writableState.errorEmitted=!0,process.nextTick(Y_,r,o)):process.nextTick(Y_,r,o):e?(process.nextTick($l,r),e(o)):process.nextTick($l,r)}),this)}function Y_(t,e){Jm(t,e),$l(t)}function $l(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function CM(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Jm(t,e){t.emit("error",e)}function SM(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}J_.exports={destroy:EM,undestroy:CM,errorOrDestroy:SM}});var Kn=y((Sle,Q_)=>{"use strict";var Z_={};function gr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Z_[t]=i}function X_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function xM(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function FM(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function OM(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}gr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&xM(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(FM(t," argument"))i=`The ${t} ${n} ${X_(e,"type")}`;else{let o=OM(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${X_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);gr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gr("ERR_STREAM_PREMATURE_CLOSE","Premature close");gr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gr("ERR_STREAM_WRITE_AFTER_END","write after end");gr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Q_.exports.codes=Z_});var Zm=y((xle,eE)=>{"use strict";var AM=Kn().codes.ERR_INVALID_OPT_VALUE;function kM(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function TM(t,e,r,n){var i=kM(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new AM(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}eE.exports={getHighWaterMark:TM}});var tE=y((Fle,Qm)=>{typeof Object.create=="function"?Qm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Qm.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Yo=y((Ole,tg)=>{try{if(eg=require("util"),typeof eg.inherits!="function")throw"";tg.exports=eg.inherits}catch{tg.exports=tE()}var eg});var nE=y((Ale,rE)=>{rE.exports=require("util").deprecate});var ig=y((kle,cE)=>{"use strict";cE.exports=Je;function oE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){i5(e,t)}}var Jo;Je.WritableState=cu;var PM={deprecate:nE()},sE=Km(),jl=require("buffer").Buffer,RM=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function $M(t){return jl.from(t)}function IM(t){return jl.isBuffer(t)||t instanceof RM}var ng=Xm(),jM=Zm(),NM=jM.getHighWaterMark,Yn=Kn().codes,LM=Yn.ERR_INVALID_ARG_TYPE,BM=Yn.ERR_METHOD_NOT_IMPLEMENTED,qM=Yn.ERR_MULTIPLE_CALLBACK,MM=Yn.ERR_STREAM_CANNOT_PIPE,UM=Yn.ERR_STREAM_DESTROYED,VM=Yn.ERR_STREAM_NULL_VALUES,HM=Yn.ERR_STREAM_WRITE_AFTER_END,zM=Yn.ERR_UNKNOWN_ENCODING,Xo=ng.errorOrDestroy;Yo()(Je,sE);function GM(){}function cu(t,e,r){Jo=Jo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Jo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=NM(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){QM(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oE(this)}cu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(cu.prototype,"buffer",{get:PM.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Il;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Il=Function.prototype[Symbol.hasInstance],Object.defineProperty(Je,Symbol.hasInstance,{value:function(e){return Il.call(this,e)?!0:this!==Je?!1:e&&e._writableState instanceof cu}})):Il=function(e){return e instanceof this};function Je(t){Jo=Jo||Ti();var e=this instanceof Jo;if(!e&&!Il.call(Je,this))return new Je(t);this._writableState=new cu(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),sE.call(this)}Je.prototype.pipe=function(){Xo(this,new MM)};function WM(t,e){var r=new HM;Xo(t,r),process.nextTick(e,r)}function KM(t,e,r,n){var i;return r===null?i=new VM:typeof r!="string"&&!e.objectMode&&(i=new LM("chunk",["string","Buffer"],r)),i?(Xo(t,i),process.nextTick(n,i),!1):!0}Je.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&IM(t);return o&&!jl.isBuffer(t)&&(t=$M(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=GM),n.ending?WM(this,r):(o||KM(this,n,t,r))&&(n.pendingcb++,i=JM(this,n,o,t,e,r)),i};Je.prototype.cork=function(){this._writableState.corked++};Je.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aE(this,t))};Je.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new zM(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Je.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function YM(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=jl.from(e,r)),e}Object.defineProperty(Je.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function JM(t,e,r,n,i,o){if(!r){var s=YM(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else rg(t,e,!1,a,n,i,o);return u}function rg(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new UM("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function XM(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(uu,t,e),t._writableState.errorEmitted=!0,Xo(t,n)):(i(n),t._writableState.errorEmitted=!0,Xo(t,n),uu(t,e))}function ZM(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function QM(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new qM;if(ZM(r),e)XM(t,r,n,e,i);else{var o=uE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&aE(t,r),n?process.nextTick(iE,t,r,o,i):iE(t,r,o,i)}}function iE(t,e,r,n){r||e5(t,e),e.pendingcb--,n(),uu(t,e)}function e5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function aE(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,rg(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new oE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(rg(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Je.prototype._write=function(t,e,r){r(new BM("_write()"))};Je.prototype._writev=null;Je.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n5(this,n,r),this};Object.defineProperty(Je.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function uE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function t5(t,e){t._final(function(r){e.pendingcb--,r&&Xo(t,r),e.prefinished=!0,t.emit("prefinish"),uu(t,e)})}function r5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(t5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function uu(t,e){var r=uE(e);if(r&&(r5(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function n5(t,e,r){e.ending=!0,uu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function i5(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Je.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Je.prototype.destroy=ng.destroy;Je.prototype._undestroy=ng.undestroy;Je.prototype._destroy=function(t,e){e(t)}});var Ti=y((Tle,fE)=>{"use strict";var o5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};fE.exports=Ur;var lE=ag(),sg=ig();Yo()(Ur,lE);for(og=o5(sg.prototype),Nl=0;Nl<og.length;Nl++)Ll=og[Nl],Ur.prototype[Ll]||(Ur.prototype[Ll]=sg.prototype[Ll]);var og,Ll,Nl;function Ur(t){if(!(this instanceof Ur))return new Ur(t);lE.call(this,t),sg.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function s5(){this._writableState.ended||process.nextTick(a5,this)}function a5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var pE=y((ug,hE)=>{var Bl=require("buffer"),Vr=Bl.Buffer;function dE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?hE.exports=Bl:(dE(Bl,ug),ug.Buffer=Pi);function Pi(t,e,r){return Vr(t,e,r)}Pi.prototype=Object.create(Vr.prototype);dE(Vr,Pi);Pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Bl.SlowBuffer(t)}});var fg=y(gE=>{"use strict";var lg=pE().Buffer,mE=lg.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function u5(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function c5(t){var e=u5(t);if(typeof e!="string"&&(lg.isEncoding===mE||!mE(t)))throw new Error("Unknown encoding: "+t);return e||t}gE.StringDecoder=lu;function lu(t){this.encoding=c5(t);var e;switch(this.encoding){case"utf16le":this.text=m5,this.end=g5,e=4;break;case"utf8":this.fillLast=d5,e=4;break;case"base64":this.text=y5,this.end=D5,e=3;break;default:this.write=v5,this.end=b5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lg.allocUnsafe(e)}lu.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};lu.prototype.end=p5;lu.prototype.text=h5;lu.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function cg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function l5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=cg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=cg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=cg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function f5(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function d5(t){var e=this.lastTotal-this.lastNeed,r=f5(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function h5(t,e){var r=l5(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function p5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function m5(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function g5(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function y5(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function D5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function v5(t){return t.toString(this.encoding)}function b5(t){return t&&t.length?this.write(t):""}});var ql=y((Rle,vE)=>{"use strict";var yE=Kn().codes.ERR_STREAM_PREMATURE_CLOSE;function w5(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function _5(){}function E5(t){return t.setHeader&&typeof t.abort=="function"}function DE(t,e,r){if(typeof e=="function")return DE(t,null,e);e||(e={}),r=w5(r||_5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(p){r.call(t,p)},f=function(){var p;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(p=new yE),r.call(t,p);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(p=new yE),r.call(t,p)},h=function(){t.req.on("finish",a)};return E5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}vE.exports=DE});var wE=y(($le,bE)=>{"use strict";var Ml;function Jn(t,e,r){return e=C5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C5(t){var e=S5(t,"string");return typeof e=="symbol"?e:String(e)}function S5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var x5=ql(),Xn=Symbol("lastResolve"),Ri=Symbol("lastReject"),fu=Symbol("error"),Ul=Symbol("ended"),$i=Symbol("lastPromise"),dg=Symbol("handlePromise"),Ii=Symbol("stream");function Zn(t,e){return{value:t,done:e}}function F5(t){var e=t[Xn];if(e!==null){var r=t[Ii].read();r!==null&&(t[$i]=null,t[Xn]=null,t[Ri]=null,e(Zn(r,!1)))}}function O5(t){process.nextTick(F5,t)}function A5(t,e){return function(r,n){t.then(function(){if(e[Ul]){r(Zn(void 0,!0));return}e[dg](r,n)},n)}}var k5=Object.getPrototypeOf(function(){}),T5=Object.setPrototypeOf((Ml={get stream(){return this[Ii]},next:function(){var e=this,r=this[fu];if(r!==null)return Promise.reject(r);if(this[Ul])return Promise.resolve(Zn(void 0,!0));if(this[Ii].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[fu]?a(e[fu]):s(Zn(void 0,!0))})});var n=this[$i],i;if(n)i=new Promise(A5(n,this));else{var o=this[Ii].read();if(o!==null)return Promise.resolve(Zn(o,!1));i=new Promise(this[dg])}return this[$i]=i,i}},Jn(Ml,Symbol.asyncIterator,function(){return this}),Jn(Ml,"return",function(){var e=this;return new Promise(function(r,n){e[Ii].destroy(null,function(i){if(i){n(i);return}r(Zn(void 0,!0))})})}),Ml),k5),P5=function(e){var r,n=Object.create(T5,(r={},Jn(r,Ii,{value:e,writable:!0}),Jn(r,Xn,{value:null,writable:!0}),Jn(r,Ri,{value:null,writable:!0}),Jn(r,fu,{value:null,writable:!0}),Jn(r,Ul,{value:e._readableState.endEmitted,writable:!0}),Jn(r,dg,{value:function(o,s){var a=n[Ii].read();a?(n[$i]=null,n[Xn]=null,n[Ri]=null,o(Zn(a,!1))):(n[Xn]=o,n[Ri]=s)},writable:!0}),r));return n[$i]=null,x5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ri];o!==null&&(n[$i]=null,n[Xn]=null,n[Ri]=null,o(i)),n[fu]=i;return}var s=n[Xn];s!==null&&(n[$i]=null,n[Xn]=null,n[Ri]=null,s(Zn(void 0,!0))),n[Ul]=!0}),e.on("readable",O5.bind(null,n)),n};bE.exports=P5});var SE=y((Ile,CE)=>{"use strict";function _E(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function R5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){_E(o,n,i,s,a,"next",u)}function a(u){_E(o,n,i,s,a,"throw",u)}s(void 0)})}}function EE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function $5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?EE(Object(r),!0).forEach(function(n){I5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):EE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function I5(t,e,r){return e=j5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j5(t){var e=N5(t,"string");return typeof e=="symbol"?e:String(e)}function N5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var L5=Kn().codes.ERR_INVALID_ARG_TYPE;function B5(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new L5("iterable",["Iterable"],e);var i=new t($5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=R5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}CE.exports=B5});var ag=y((Nle,IE)=>{"use strict";IE.exports=me;var Zo;me.ReadableState=AE;var jle=require("events").EventEmitter,OE=function(e,r){return e.listeners(r).length},hu=Km(),Vl=require("buffer").Buffer,q5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function M5(t){return Vl.from(t)}function U5(t){return Vl.isBuffer(t)||t instanceof q5}var hg=require("util"),ue;hg&&hg.debuglog?ue=hg.debuglog("stream"):ue=function(){};var V5=K_(),bg=Xm(),H5=Zm(),z5=H5.getHighWaterMark,Hl=Kn().codes,G5=Hl.ERR_INVALID_ARG_TYPE,W5=Hl.ERR_STREAM_PUSH_AFTER_EOF,K5=Hl.ERR_METHOD_NOT_IMPLEMENTED,Y5=Hl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Qo,pg,mg;Yo()(me,hu);var du=bg.errorOrDestroy,gg=["error","close","destroy","pause","resume"];function J5(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function AE(t,e,r){Zo=Zo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Zo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=z5(this,t,"readableHighWaterMark",r),this.buffer=new V5,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Qo||(Qo=fg().StringDecoder),this.decoder=new Qo(t.encoding),this.encoding=t.encoding)}function me(t){if(Zo=Zo||Ti(),!(this instanceof me))return new me(t);var e=this instanceof Zo;this._readableState=new AE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),hu.call(this)}Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});me.prototype.destroy=bg.destroy;me.prototype._undestroy=bg.undestroy;me.prototype._destroy=function(t,e){e(t)};me.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Vl.from(t,e),e=""),n=!0),kE(this,t,e,!1,n)};me.prototype.unshift=function(t){return kE(this,t,null,!0,!1)};function kE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,Q5(t,o);else{var s;if(i||(s=X5(o,e)),s)du(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Vl.prototype&&(e=M5(e)),n)o.endEmitted?du(t,new Y5):yg(t,o,e,!0);else if(o.ended)du(t,new W5);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?yg(t,o,e,!1):vg(t,o)):yg(t,o,e,!1)}else n||(o.reading=!1,vg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function yg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&zl(t)),vg(t,e)}function X5(t,e){var r;return!U5(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new G5("chunk",["string","Buffer","Uint8Array"],e)),r}me.prototype.isPaused=function(){return this._readableState.flowing===!1};me.prototype.setEncoding=function(t){Qo||(Qo=fg().StringDecoder);var e=new Qo(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var xE=1073741824;function Z5(t){return t>=xE?t=xE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function FE(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Z5(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}me.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Dg(this):zl(this),null;if(t=FE(t,e),t===0&&e.ended)return e.length===0&&Dg(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=FE(r,e)));var i;return t>0?i=RE(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Dg(this)),i!==null&&this.emit("data",i),i};function Q5(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?zl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,TE(t)))}}function zl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(TE,t))}function TE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,wg(t)}function vg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(eU,t,e))}function eU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}me.prototype._read=function(t){du(this,new K5("_read()"))};me.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ue("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=tU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&$E(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),b(),t.removeListener("error",h),OE(t,"error")===0&&du(t,g)}J5(t,"error",h);function d(){t.removeListener("finish",p),b()}t.once("close",d);function p(){ue("onfinish"),t.removeListener("close",d),b()}t.once("finish",p);function b(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function tU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&OE(t,"data")&&(r.flowing=!0,wg(t))}}me.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=$E(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};me.prototype.on=function(t,e){var r=hu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?zl(this):n.reading||process.nextTick(rU,this)),r};me.prototype.addListener=me.prototype.on;me.prototype.removeListener=function(t,e){var r=hu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(PE,this),r};me.prototype.removeAllListeners=function(t){var e=hu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(PE,this),e};function PE(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function rU(t){ue("readable nexttick read 0"),t.read(0)}me.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,nU(this,t)),t.paused=!1,this};function nU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(iU,t,e))}function iU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),wg(t),e.flowing&&!e.reading&&t.read(0)}me.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function wg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}me.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<gg.length;o++)t.on(gg[o],this.emit.bind(this,gg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(me.prototype[Symbol.asyncIterator]=function(){return pg===void 0&&(pg=wE()),pg(this)});Object.defineProperty(me.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(me.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(me.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});me._fromList=RE;Object.defineProperty(me.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function RE(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Dg(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(oU,e,t))}function oU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(me.from=function(t,e){return mg===void 0&&(mg=SE()),mg(me,t,e)});function $E(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var _g=y((Lle,NE)=>{"use strict";NE.exports=Dn;var Gl=Kn().codes,sU=Gl.ERR_METHOD_NOT_IMPLEMENTED,aU=Gl.ERR_MULTIPLE_CALLBACK,uU=Gl.ERR_TRANSFORM_ALREADY_TRANSFORMING,cU=Gl.ERR_TRANSFORM_WITH_LENGTH_0,Wl=Ti();Yo()(Dn,Wl);function lU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new aU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Wl.call(this,t),this._transformState={afterTransform:lU.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",fU)}function fU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jE(t,e,r)}):jE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Wl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new sU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Wl.prototype._destroy.call(this,t,function(r){e(r)})};function jE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new cU;if(t._transformState.transforming)throw new uU;return t.push(null)}});var qE=y((Ble,BE)=>{"use strict";BE.exports=pu;var LE=_g();Yo()(pu,LE);function pu(t){if(!(this instanceof pu))return new pu(t);LE.call(this,t)}pu.prototype._transform=function(t,e,r){r(null,t)}});var zE=y((qle,HE)=>{"use strict";var Eg;function dU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var VE=Kn().codes,hU=VE.ERR_MISSING_ARGS,pU=VE.ERR_STREAM_DESTROYED;function ME(t){if(t)throw t}function mU(t){return t.setHeader&&typeof t.abort=="function"}function gU(t,e,r,n){n=dU(n);var i=!1;t.on("close",function(){i=!0}),Eg===void 0&&(Eg=ql()),Eg(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,mU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new pU("pipe"))}}}function UE(t){t()}function yU(t,e){return t.pipe(e)}function DU(t){return!t.length||typeof t[t.length-1]!="function"?ME:t.pop()}function vU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=DU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new hU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return gU(s,u,c,function(l){i||(i=l),l&&o.forEach(UE),!u&&(o.forEach(UE),n(i))})});return e.reduce(yU)}HE.exports=vU});var GE=y((yr,gu)=>{var mu=require("stream");process.env.READABLE_STREAM==="disable"&&mu?(gu.exports=mu.Readable,Object.assign(gu.exports,mu),gu.exports.Stream=mu):(yr=gu.exports=ag(),yr.Stream=mu||yr,yr.Readable=yr,yr.Writable=ig(),yr.Duplex=Ti(),yr.Transform=_g(),yr.PassThrough=qE(),yr.finished=ql(),yr.pipeline=zE())});var Sg=y(Cg=>{var WE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Cg=="object"?t(Cg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(WE={}):t(WE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],p=i[9],b=i[10],g=i[11],w=i[12],x=i[13],D=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function A(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=D[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^b[F[R++]]^p[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=A,t.str=$})});var YE=y((Ule,KE)=>{"use strict";var{Transform:bU}=GE(),wU=Sg(),xg=class extends bU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=wU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};KE.exports=xg});var XE=y((Vle,JE)=>{"use strict";var{DeflateRaw:_U}=require("zlib"),EU=Sg(),Fg=class extends _U{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,r){return e&&(this.compressedSize+=e.length),super.push(e,r)}_transform(e,r,n){e&&(this.checksum=EU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};JE.exports=Fg});var QE=y((Hle,ZE)=>{"use strict";ZE.exports={CRC32Stream:YE(),DeflateCRC32Stream:XE()}});var yu=y(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.checksum=es.checksumFile=void 0;var CU=require("fs"),SU=require("crypto"),tC=require("stream"),xU=require("util"),{CRC32Stream:FU}=QE(),eC=(0,xU.promisify)(tC.pipeline),OU=(t,e,r)=>rC(CU.createReadStream(t),e,r);es.checksumFile=OU;async function rC(t,e,r="hex"){let n=kU(t);if(e==="crc32"){let o=new FU,s=eC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,SU.createHash)(e);return await eC(n,i),i.end(),i.digest(r)}es.checksum=rC;function AU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var kU=t=>AU(t)?t:new tC.Readable({read(){this.push(t),this.push(null)}})});var Og=y((Gle,nC)=>{nC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Kl=y(oC=>{var iC={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function TU(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(iC))oC[t]=TU(iC[t])});var lC=y((Kle,cC)=>{var PU=require("fs"),ut=require("path"),sC=Og(),RU=Kl(),$U=typeof process=="object"&&process.platform==="win32",aC=t=>typeof t=="object"&&t!==null,uC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Xe(t){this.sep=ut.sep,this.fs=PU,aC(t)&&aC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}cC.exports=Xe;Xe.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw RU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Xe.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=ut.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Xe.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=ut.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,p){o.fs.write(p,e,0,e.length,0,function(){o.fs.close(p,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Xe.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=ut.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(ut.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Xe.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=ut.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(ut.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Xe.prototype.getAttributes=function(){};Xe.prototype.setAttributes=function(){};Xe.crc32update=function(t,e){return uC[(t^e)&255]^t>>>8};Xe.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Xe.crc32update(r,t[n++]);return~r>>>0};Xe.methodToString=function(t){switch(t){case sC.STORED:return"STORED ("+t+")";case sC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Xe.canonical=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.join(".",e)};Xe.zipnamefix=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.posix.join(".",e)};Xe.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Xe.sanitize=function(t,e){t=ut.resolve(ut.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=ut.normalize(ut.join(t,r.slice(n,i).join(ut.sep)));if(o.indexOf(t)===0)return o}return ut.normalize(ut.join(t,ut.basename(e)))};Xe.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Xe.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Xe.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Xe.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Xe.isWin=$U;Xe.crcTable=uC});var dC=y((Yle,fC)=>{var IU=require("path");fC.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=IU.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var pC=y((Jle,hC)=>{hC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var rs=y((Xle,ts)=>{ts.exports=lC();ts.exports.Constants=Og();ts.exports.Errors=Kl();ts.exports.FileAttr=dC();ts.exports.decoder=pC()});var gC=y((Zle,mC)=>{var Qn=rs(),H=Qn.Constants;mC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;t|=Qn.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},g=D=>Math.max(0,D)>>>0,w=D=>Math.max(0,D)&65535,x=D=>Math.max(0,D)&255;return i=Qn.fromDate2DOS(new Date),{get made(){return t},set made(D){t=D},get version(){return e},set version(D){e=D},get flags(){return r},set flags(D){r=D},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(D){D?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(D){D?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(D){switch(D){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=D},get time(){return Qn.fromDOS2Date(this.timeval)},set time(D){this.timeval=Qn.fromDate2DOS(D)},get timeval(){return i},set timeval(D){i=g(D)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(D){o=g(D)},get compressedSize(){return s},set compressedSize(D){s=g(D)},get size(){return a},set size(D){a=g(D)},get fileNameLength(){return u},set fileNameLength(D){u=D},get extraLength(){return c},set extraLength(D){c=D},get extraLocalLength(){return b.extraLen},set extraLocalLength(D){b.extraLen=D},get commentLength(){return l},set commentLength(D){l=D},get diskNumStart(){return f},set diskNumStart(D){f=g(D)},get inAttr(){return h},set inAttr(D){h=g(D)},get attr(){return d},set attr(D){d=g(D)},get fileAttr(){return(d||0)>>16&4095},get offset(){return p},set offset(D){p=g(D)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+c+l},get realDataOffset(){return p+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(D){var C=D.slice(p,p+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw Qn.Errors.INVALID_LOC();b.version=C.readUInt16LE(H.LOCVER),b.flags=C.readUInt16LE(H.LOCFLG),b.method=C.readUInt16LE(H.LOCHOW),b.time=C.readUInt32LE(H.LOCTIM),b.crc=C.readUInt32LE(H.LOCCRC),b.compressedSize=C.readUInt32LE(H.LOCSIZ),b.size=C.readUInt32LE(H.LOCLEN),b.fnameLen=C.readUInt16LE(H.LOCNAM),b.extraLen=C.readUInt16LE(H.LOCEXT);let A=p+H.LOCHDR+b.fnameLen,$=A+b.extraLen;return D.slice(A,$)},loadFromBinary:function(D){if(D.length!==H.CENHDR||D.readUInt32LE(0)!==H.CENSIG)throw Qn.Errors.INVALID_CEN();t=D.readUInt16LE(H.CENVEM),e=D.readUInt16LE(H.CENVER),r=D.readUInt16LE(H.CENFLG),n=D.readUInt16LE(H.CENHOW),i=D.readUInt32LE(H.CENTIM),o=D.readUInt32LE(H.CENCRC),s=D.readUInt32LE(H.CENSIZ),a=D.readUInt32LE(H.CENLEN),u=D.readUInt16LE(H.CENNAM),c=D.readUInt16LE(H.CENEXT),l=D.readUInt16LE(H.CENCOM),f=D.readUInt16LE(H.CENDSK),h=D.readUInt16LE(H.CENATT),d=D.readUInt32LE(H.CENATX),p=D.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var D=Buffer.alloc(H.LOCHDR);return D.writeUInt32LE(H.LOCSIG,0),D.writeUInt16LE(e,H.LOCVER),D.writeUInt16LE(r,H.LOCFLG),D.writeUInt16LE(n,H.LOCHOW),D.writeUInt32LE(i,H.LOCTIM),D.writeUInt32LE(o,H.LOCCRC),D.writeUInt32LE(s,H.LOCSIZ),D.writeUInt32LE(a,H.LOCLEN),D.writeUInt16LE(u,H.LOCNAM),D.writeUInt16LE(b.extraLen,H.LOCEXT),D},centralHeaderToBinary:function(){var D=Buffer.alloc(H.CENHDR+u+c+l);return D.writeUInt32LE(H.CENSIG,0),D.writeUInt16LE(t,H.CENVEM),D.writeUInt16LE(e,H.CENVER),D.writeUInt16LE(r,H.CENFLG),D.writeUInt16LE(n,H.CENHOW),D.writeUInt32LE(i,H.CENTIM),D.writeUInt32LE(o,H.CENCRC),D.writeUInt32LE(s,H.CENSIZ),D.writeUInt32LE(a,H.CENLEN),D.writeUInt16LE(u,H.CENNAM),D.writeUInt16LE(c,H.CENEXT),D.writeUInt16LE(l,H.CENCOM),D.writeUInt16LE(f,H.CENDSK),D.writeUInt16LE(h,H.CENATT),D.writeUInt32LE(d,H.CENATX),D.writeUInt32LE(p,H.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:Qn.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:D(s),size:D(a),fileNameLength:D(u),extraLength:D(c),commentLength:D(l),diskNumStart:f,inAttr:h,attr:d,offset:p,centralHeaderSize:D(H.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var DC=y((Qle,yC)=>{var ns=rs(),Ue=ns.Constants;yC.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return Ue.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Ue.ENDHDR||o.readUInt32LE(0)!==Ue.ENDSIG)&&(o.length<Ue.ZIP64HDR||o.readUInt32LE(0)!==Ue.ZIP64SIG))throw ns.Errors.INVALID_END();o.readUInt32LE(0)===Ue.ENDSIG?(t=o.readUInt16LE(Ue.ENDSUB),e=o.readUInt16LE(Ue.ENDTOT),r=o.readUInt32LE(Ue.ENDSIZ),n=o.readUInt32LE(Ue.ENDOFF),i=o.readUInt16LE(Ue.ENDCOM)):(t=ns.readBigUInt64LE(o,Ue.ZIP64SUB),e=ns.readBigUInt64LE(o,Ue.ZIP64TOT),r=ns.readBigUInt64LE(o,Ue.ZIP64SIZE),n=ns.readBigUInt64LE(o,Ue.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Ue.ENDHDR+i);return o.writeUInt32LE(Ue.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Ue.ENDSUB),o.writeUInt16LE(e,Ue.ENDTOT),o.writeUInt32LE(r,Ue.ENDSIZ),o.writeUInt32LE(n,Ue.ENDOFF),o.writeUInt16LE(i,Ue.ENDCOM),o.fill(" ",Ue.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var kg=y(Ag=>{Ag.EntryHeader=gC();Ag.MainHeader=DC()});var bC=y((tfe,vC)=>{vC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var _C=y((rfe,wC)=>{var jU=+(process.versions?process.versions.node:"").split(".")[0]||0;wC.exports=function(t,e){var r=require("zlib");let n=jU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var FC=y((nfe,xC)=>{"use strict";var{randomFillSync:EC}=require("crypto"),NU=Kl(),LU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),SC=(t,e)=>Math.imul(t,e)>>>0,CC=(t,e)=>LU[(t^e)&255]^t>>>8,Du=()=>typeof EC=="function"?EC(Buffer.alloc(12)):Du.node();Du.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Yl={genSalt:Du};function Jl(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Jl.prototype.updateKeys=function(t){let e=this.keys;return e[0]=CC(e[0],t),e[1]+=e[0]&255,e[1]=SC(e[1],134775813)+1,e[2]=CC(e[2],e[1]>>>24),t};Jl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return SC(t,t^1)>>8&255};function BU(t){let e=new Jl(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function qU(t){let e=new Jl(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function MU(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=BU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw NU.WRONG_PASSWORD();return n(t.slice(12))}function UU(t){Buffer.isBuffer(t)&&t.length>=12?Yl.genSalt=function(){return t.slice(0,12)}:t==="node"?Yl.genSalt=Du.node:Yl.genSalt=Du}function VU(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=qU(r),o=Yl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}xC.exports={decrypt:MU,encrypt:VU,_salter:UU}});var OC=y(Xl=>{Xl.Deflater=bC();Xl.Inflater=_C();Xl.ZipCrypto=FC()});var Pg=y((ofe,AC)=>{var be=rs(),HU=kg(),Ze=be.Constants,Tg=OC();AC.exports=function(t,e){var r=new HU.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:be.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(D){if(r.flags_desc){let C={},A=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(A)==Ze.LOCSIG||e.readUInt32LE(A)==Ze.CENSIG)throw be.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(A)==Ze.EXTSIG)C.crc=e.readUInt32LE(A+Ze.EXTCRC),C.compressedSize=e.readUInt32LE(A+Ze.EXTSIZ),C.size=e.readUInt32LE(A+Ze.EXTLEN);else if(e.readUInt16LE(A+12)===19280)C.crc=e.readUInt32LE(A+Ze.EXTCRC-4),C.compressedSize=e.readUInt32LE(A+Ze.EXTSIZ-4),C.size=e.readUInt32LE(A+Ze.EXTLEN-4);else throw be.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw be.Errors.DESCRIPTOR_FAULTY();if(be.crc32(D)!==C.crc)return!1}else if(be.crc32(D)!==r.localHeader.crc)return!1;return!0}function p(D,C,A){if(typeof C>"u"&&typeof D=="string"&&(A=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),be.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof A!="string"&&!Buffer.isBuffer(A))throw be.Errors.INVALID_PASS_PARAM();$=Tg.ZipCrypto.decrypt($,r,A)}var F=Buffer.alloc(r.size);switch(r.method){case be.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,be.Errors.BAD_CRC()),be.Errors.BAD_CRC();case be.Constants.DEFLATED:var L=new Tg.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,be.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw be.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),be.Errors.UNKNOWN_METHOD()),be.Errors.UNKNOWN_METHOD()}}function b(D,C){if((!s||!s.length)&&Buffer.isBuffer(e))return D&&C&&C(h()),h();if(s.length&&!o){var A;switch(r.method){case be.Constants.STORED:return r.compressedSize=r.size,A=Buffer.alloc(s.length),s.copy(A),D&&C&&C(A),A;default:case be.Constants.DEFLATED:var $=new Tg.Deflater(s);if(D)$.deflateAsync(function(L){A=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(A),C&&C(A)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(D&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(D,C){return(D.readUInt32LE(C+4)<<4)+D.readUInt32LE(C)}function w(D){try{for(var C=0,A,$,F;C+4<D.length;)A=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Ze.ID_ZIP64===A&&x(F)}catch{throw be.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,A,$,F;D.length>=Ze.EF_ZIP64_SCOMP&&(C=g(D,Ze.EF_ZIP64_SUNCOMP),r.size===Ze.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Ze.EF_ZIP64_RHO&&(A=g(D,Ze.EF_ZIP64_SCOMP),r.compressedSize===Ze.EF_ZIP64_OR_32&&(r.compressedSize=A)),D.length>=Ze.EF_ZIP64_DSN&&($=g(D,Ze.EF_ZIP64_RHO),r.offset===Ze.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Ze.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Ze.EF_ZIP64_DSN),r.diskNumStart===Ze.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=be.toBuffer(D,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(D){a=D,r.extraLength=D.length,w(D)},get comment(){return f.decode(i)},set comment(D){if(i=be.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw be.Errors.COMMENT_TOO_LONG()},get name(){var D=f.decode(n);return o?D.substr(D.length-1).split("/").pop():D.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(D){b(!0,D)},setData:function(D){s=be.toBuffer(D,be.decoder.encode),!o&&s.length?(r.size=s.length,r.method=be.Constants.DEFLATED,r.crc=be.crc32(D),r.changed=!0):r.method=be.Constants.STORED},getData:function(D){return r.changed?s:p(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):p(!0,D,C)},set attr(D){r.attr=D},get attr(){return r.attr},set header(D){r.loadFromBinary(D)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var D=r.centralHeaderToBinary(),C=be.Constants.CENHDR;return n.copy(D,C),C+=n.length,a.copy(D,C),C+=r.extraLength,i.copy(D,C),D},packLocalHeader:function(){let D=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),A=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(A,D),D+=C.length,n.copy(A,D),D+=n.length,u.copy(A,D),D+=u.length,A},toJSON:function(){let D=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:D(e),data:D(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var PC=y((sfe,TC)=>{var kC=Pg(),zU=kg(),bt=rs();TC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new zU.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?p(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let D=0;D<x.length;D++){let C=x.slice(0,D+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new kC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,D=new kC(c,t);D.header=t.slice(x,x+=bt.Constants.CENHDR),D.entryName=t.slice(x,x+=D.header.fileNameLength),D.header.extraLength&&(D.extra=t.slice(x,x+=D.header.extraLength)),D.header.commentLength&&(D.comment=t.slice(x,x+D.header.commentLength)),g+=D.header.centralHeaderSize,r[w]=D,n[D.entryName]=D}u.clear(),h()}function p(g){var w=t.length-bt.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,A=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===bt.Constants.ENDSIG){A=w,$=w,C=w+bt.Constants.ENDHDR,D=w-bt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===bt.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===bt.Constants.ZIP64SIG){A=w,C=w+bt.readBigUInt64LE(t,w+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(A==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(A,C)),o.commentLength&&(i=t.slice($+bt.Constants.ENDHDR)),g&&d()}function b(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=bt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],D=g.entryName;for(let C of r)C.entryName.startsWith(D)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),b();let g=[],w=[],x=0,D=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=D;let S=F.packLocalHeader(),I=S.length+L.length;D+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=D,o.totalEntries=C,D=0;let A=Buffer.alloc(x);for(let F of g)F.copy(A,D),D+=F.length;for(let F of w)F.copy(A,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,bt.Constants.ENDHDR),$.copy(A,D),t=A,s=!1,A},toAsyncBuffer:function(g,w,x,D){try{s||d(),b();let C=[],A=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){D&&D(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();A.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),A.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var IC=y((afe,$C)=>{var Ve=rs(),Qe=require("path"),GU=Pg(),WU=PC(),ji=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),RC=(...t)=>Ve.findLast(t,e=>typeof e=="string"),KU=(...t)=>Ve.findLast(t,e=>typeof e=="function"),YU={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};$C.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),YU);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=Ve.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ve(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ve.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ve.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ve.Errors.INVALID_FILENAME();let o=new WU(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function c(d){if(d&&o){var p;if(typeof d=="string"&&(p=o.getEntry(Qe.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(p=o.getEntry(d.entryName)),p)return p}return null}function l(d){let{join:p,normalize:b,sep:g}=Qe.posix;return p(".",b(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(p){return function(b){return p.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,p)=>{let b=p.slice(-1);return b=b===i.sep?i.sep:"",Qe.relative(d,p)+b};return{readFile:function(d,p){var b=c(d);return b&&b.getData(p)||null},childCount:function(d){let p=c(d);if(p)return o.getChildCount(p)},readFileAsync:function(d,p){var b=c(d);b?b.getDataAsync(p):p(null,"getEntry failed for:"+d)},readAsText:function(d,p){var b=c(d);if(b){var g=b.getData();if(g&&g.length)return g.toString(p||"utf8")}return""},readAsTextAsync:function(d,p,b){var g=c(d);g?g.getDataAsync(function(w,x){if(x){p(w,x);return}w&&w.length?p(w.toString(b||"utf8")):p("")}):p("")},deleteFile:function(d,p=!0){var b=c(d);b&&o.deleteFile(b.entryName,p)},deleteEntry:function(d){var p=c(d);p&&o.deleteEntry(p.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,p){var b=c(d);b&&(b.comment=p)},getZipEntryComment:function(d){var p=c(d);return p&&p.comment||""},updateFile:function(d,p){var b=c(d);b&&b.setData(p)},addLocalFile:function(d,p,b,g){if(i.fs.existsSync(d)){p=p?l(p):"";let w=Qe.win32.basename(Qe.win32.normalize(d));p+=b||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(p+=i.sep),this.addFile(p,D,g,x)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,p){d=typeof d=="object"?d:{localPath:d};let b=Qe.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(b,function(C,A){if(C)return p(C,!1);w=w?l(w):"";let $=Qe.win32.basename(Qe.win32.normalize(b));if(w+=x||$,A.isFile())i.fs.readFile(b,function(F,L){return F?p(F,!1):(D.addFile(w,L,g,A),setImmediate(p,void 0,!0))});else if(A.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,A),setImmediate(p,void 0,!0)})},addLocalFolder:function(d,p,b){if(b=f(b),p=p?l(p):"",d=Qe.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=Qe.join(p,h(d,x));b(D)&&w.addLocalFile(x,Qe.dirname(D))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,p,b,g){g=f(g),b=b?l(b):"",d=Qe.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")p(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(x)p(void 0,x);else{var D=i.findFiles(d),C=-1,A=function(){if(C+=1,C<D.length){var $=D[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&p(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?p(void 0,I):(w.addFile(b+F,R,"",S),A())}):(w.addFile(b+F+"/",Buffer.alloc(0),"",S),A())}):process.nextTick(()=>{A()})}else p(!0,void 0)};A()}})},addLocalFolderAsync2:function(d,p){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Qe.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(A){return function($){return A.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=A=>A.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=A=>A);let D=A=>Qe.join(g,x(h(localPath,A))),C=A=>Qe.win32.basename(Qe.win32.normalize(x(A)));i.fs.open(localPath,"r",function(A){A&&A.code==="ENOENT"?p(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):A?p(void 0,A):i.findFilesAsync(localPath,function($,F){if($)return p($);F=F.filter(L=>w(D(L))),F.length||p(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Qe.dirname(D(S)),zipName:C(S)},L)}},p))})})},addLocalFolderPromise:function(d,p){return new Promise((b,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},p),(w,x)=>{w&&g(w),x&&b(this)})})},addFile:function(d,p,b,g){d=u(d);let w=c(d),x=w!=null;x||(w=new GU(n),w.entryName=d),w.comment=b||"";let D=typeof g=="object"&&g instanceof i.fs.Stats;D&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let A=w.isDirectory?16384:32768;return D?A|=4095&g.mode:typeof g=="number"?A|=4095&g:A|=w.isDirectory?493:420,C=(C|A<<16)>>>0,w.attr=C,w.setData(p),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,p,b,g,w,x){g=ji(!1,g),w=ji(!1,w),b=ji(!0,b),x=RC(w,x);var D=c(d);if(!D)throw Ve.Errors.NO_ENTRY();var C=s(D.entryName),A=a(p,x&&!D.isDirectory?x:b?C:Qe.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(p,b?R:Qe.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=D.getData(o.password);if(!F)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(A)&&!g)throw Ve.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(A,F,g,L),!0},test:function(d){if(!o)return!1;for(var p in o.entries)try{if(p.isDirectory)continue;var b=o.entries[p].getData(d);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(d,p,b,g){if(b=ji(!1,b),g=RC(b,g),p=ji(!1,p),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var D=w.getData(g);if(!D)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?w.header.fileAttr:void 0;i.writeFileTo(x,D,p,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,p,b,g){if(g=KU(p,b,g),b=ji(!1,b),p=ji(!1,p),!g)return new Promise((A,$)=>{this.extractAllToAsync(d,p,b,function(F){F?$(F):A(this)})});if(!o){g(Ve.Errors.NO_ZIP());return}d=Qe.resolve(d);let w=A=>a(d,Qe.normalize(s(A.entryName))),x=(A,$)=>new Error(A+': "'+$+'"'),D=[],C=[];o.entries.forEach(A=>{A.isDirectory?D.push(A):C.push(A)});for(let A of D){let $=w(A),F=b?A.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,A.header.time,A.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(A,$){return function(F){if(F)A(F);else{let L=Qe.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)A(R);else if(!I)A(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,p,B,function(q){q||A(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?A(x("Unable to set times",S)):A()})})}})}}},g)()},writeZip:function(d,p){if(arguments.length===1&&typeof d=="function"&&(p=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var b=o.compressToBuffer();if(b){var g=i.writeFileTo(d,b,!0);typeof p=="function"&&p(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,p){let{overwrite:b,perm:g}=Object.assign({overwrite:!0},p);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(D=>{let C=A=>A?w(A):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,b,g,C)},x)})},toBufferPromise:function(){return new Promise((d,p)=>{o.toAsyncBuffer(d,p)})},toBuffer:function(d,p,b,g){return typeof d=="function"?(o.toAsyncBuffer(d,p,b,g),null):o.compressToBuffer()}}}});var JC=y((Ife,YC)=>{var KC={};YC.exports=KC;var WC={reset:[0,0],bold:[1,22],dim:[2,22],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],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,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],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(WC).forEach(function(t){var e=WC[t],r=KC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var ZC=y((jfe,XC)=>{"use strict";XC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var eS=y((Nfe,QC)=>{"use strict";var t9=require("os"),Ar=ZC(),Tt=process.env,ss=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?ss=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(ss=!0);"FORCE_COLOR"in Tt&&(ss=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function r9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function n9(t){if(ss===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&ss!==!0)return 0;var e=ss?1:0;if(process.platform==="win32"){var r=t9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function Bg(t){var e=n9(t);return r9(e)}QC.exports={supportsColor:Bg,stdout:Bg(process.stdout),stderr:Bg(process.stderr)}});var rS=y((Lfe,tS)=>{tS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var iS=y((Bfe,nS)=>{nS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var p in d)for(var b=d[p],g=0;g<=f[b];g++)c[b]&&(l=l+n[b][o(n[b].length)])}return l}return a(e,r)}});var sS=y((qfe,oS)=>{oS.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var uS=y((Mfe,aS)=>{aS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var lS=y((Ufe,cS)=>{cS.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var dS=y((Vfe,fS)=>{fS.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var DS=y((zfe,yS)=>{var ce={};yS.exports=ce;ce.themes={};var i9=require("util"),Ni=ce.styles=JC(),pS=Object.defineProperties,o9=new RegExp(/[\r\n]+/g);ce.supportsColor=eS().supportsColor;typeof ce.enabled>"u"&&(ce.enabled=ce.supportsColor()!==!1);ce.enable=function(){ce.enabled=!0};ce.disable=function(){ce.enabled=!1};ce.stripColors=ce.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var Hfe=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Ni[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},s9=/[|\\{}()[\]^$+*?.]/g,a9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(s9,"\\$&")};function mS(t){var e=function r(){return c9.apply(r,arguments)};return e._styles=t,e.__proto__=u9,e}var gS=function(){var t={};return Ni.grey=Ni.gray,Object.keys(Ni).forEach(function(e){Ni[e].closeRe=new RegExp(a9(Ni[e].close),"g"),t[e]={get:function(){return mS(this._styles.concat(e))}}}),t}(),u9=pS(function(){},gS);function c9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:i9.inspect(s)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
24
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=Ni[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(o9,function(s){return o.close+s+o.open}))}return e}ce.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){ce[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=ce[t[r][o]](i);return i}return ce[t[r]](n)}})(e)};function l9(){var t={};return Object.keys(gS).forEach(function(e){t[e]={get:function(){return mS([e])}}}),t}var f9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};ce.trap=rS();ce.zalgo=iS();ce.maps={};ce.maps.america=sS()(ce);ce.maps.zebra=uS()(ce);ce.maps.rainbow=lS()(ce);ce.maps.random=dS()(ce);for(hS in ce.maps)(function(t){ce[t]=function(e){return f9(ce.maps[t],e)}})(hS);var hS;pS(ce,l9())});var bS=y((Gfe,vS)=>{var d9=DS();vS.exports=d9});var wS=y(qg=>{"use strict";qg.indent=function(e){return new Array(e+1).join(" ")};qg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var _S=y((Kfe,h9)=>{h9.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var ES=y(wu=>{"use strict";var zr=bS(),ti=wS(),p9=/[^\w\s\n\r\v\t\.,]/i;wu.version=_S().version;var Mg=function(t,e){return t!==void 0||e.renderUndefined},rf=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
25
+ `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&rf(t[0],!0,r))},m9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?zr[e.stringColor](t):t;var r=t+"";return t===!0?zr.green(r):t===!1?zr.red(r):t==null?zr.grey(r):typeof t=="number"?t>=0?zr[e.positiveNumberColor](r):zr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},Ug=function(t,e){return t.multilineStringColor===null||t.noColor?e:zr[t.multilineStringColor](e)},g9=function(t,e,r){var n=t.split(`
26
26
  `);return n=n.map(function(i){return ti.indent(e)+Ug(r,i)}),n.join(`
27
- `)},as=function(t,e,r){if(typeof t=="string"&&t.match(m9)&&e.escape&&(t=JSON.stringify(t)),!Mg(t,e))return[];if(rf(t,!1,e))return[ti.indent(r)+g9(t,e)];if(typeof t=="string")return[ti.indent(r)+Ug(e,'"""'),y9(t,r+e.defaultIndentation,e),ti.indent(r)+Ug(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ti.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(Mg(a,e)){var u="- ";e.noColor||(u=zr[e.dashColor](u)),u=ti.indent(r)+u,rf(a,!1,e)?(u+=as(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,as(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return as({message:t.message,stack:t.stack.split(`
27
+ `)},as=function(t,e,r){if(typeof t=="string"&&t.match(p9)&&e.escape&&(t=JSON.stringify(t)),!Mg(t,e))return[];if(rf(t,!1,e))return[ti.indent(r)+m9(t,e)];if(typeof t=="string")return[ti.indent(r)+Ug(e,'"""'),g9(t,r+e.defaultIndentation,e),ti.indent(r)+Ug(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ti.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(Mg(a,e)){var u="- ";e.noColor||(u=zr[e.dashColor](u)),u=ti.indent(r)+u,rf(a,!1,e)?(u+=as(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,as(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return as({message:t.message,stack:t.stack.split(`
28
28
  `)},e,r);var i=e.noAlign?0:ti.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(Mg(t[a],e))if(o=a+": ",e.noColor||(o=zr[e.keysColor](o)),o=ti.indent(r)+o,rf(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=as(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,as(t[a],e,r+e.defaultIndentation))}),s};wu.render=function(e,r,n){return n=n||0,r=r||{},r.emptyArrayMsg=r.emptyArrayMsg||"(empty array)",r.keysColor=r.keysColor||"green",r.dashColor=r.dashColor||"green",r.numberColor=r.numberColor||"blue",r.positiveNumberColor=r.positiveNumberColor||r.numberColor,r.negativeNumberColor=r.negativeNumberColor||r.numberColor,r.defaultIndentation=r.defaultIndentation||2,r.noColor=!!r.noColor,r.noAlign=!!r.noAlign,r.escape=!!r.escape,r.renderUndefined=!!r.renderUndefined,r.stringColor=r.stringColor||null,r.multilineStringColor=r.multilineStringColor||null,as(e,r,n).join(`
29
29
  `)};wu.renderString=function(e,r,n){var i="",o;if(typeof e!="string"||e==="")return"";if(e[0]!=="{"&&e[0]!=="["){var s;e.indexOf("{")===-1?s=e.indexOf("["):e.indexOf("[")===-1||e.indexOf("{")<e.indexOf("[")?s=e.indexOf("{"):s=e.indexOf("["),i+=e.substr(0,s)+`
30
- `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=wu.render(o,r,n),i}});var zg=y(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;function us(t){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},us(t)}function CS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v9(n.key),n)}}function D9(t,e,r){return e&&CS(t.prototype,e),r&&CS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function v9(t){var e=b9(t,"string");return us(e)=="symbol"?e:e+""}function b9(t,e){if(us(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(us(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function w9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _9(t,e,r){return e=Eu(e),E9(t,Hg()?Reflect.construct(e,r||[],Eu(t).constructor):e.apply(t,r))}function E9(t,e){if(e&&(us(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C9(t)}function C9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_u(t,e)}function Vg(t){var e=typeof Map=="function"?new Map:void 0;return Vg=function(n){if(n===null||!F9(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return x9(n,arguments,Eu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_u(i,n)},Vg(t)}function x9(t,e,r){if(Hg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&_u(i,r.prototype),i}function Hg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hg=function(){return!!t})()}function F9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},_u(t,e)}function Eu(t){return Eu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eu(t)}var O9=function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(w9(this,e),n=_9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return S9(e,t),D9(e)}(Vg(Error)),Jfe=nf.default=O9});var Gg=y(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.enableDebugLog=A9;of.log=k9;var SS=!1;function A9(){SS=!0}function k9(t){SS&&console.log(t)}});var FS=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;function Cu(t){"@babel/helpers - typeof";return Cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cu(t)}function T9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R9(n.key),n)}}function P9(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R9(t){var e=$9(t,"string");return Cu(e)=="symbol"?e:e+""}function $9(t,e){if(Cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qfe=sf.default=function(){function t(){T9(this,t)}return P9(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var OS=y((Wg,Kg)=>{(function(t,e){typeof Wg=="object"&&typeof Kg<"u"?Kg.exports=e():typeof define=="function"&&define.amd?define(e):function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Wg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,De,pn="",vp=T.length%3,Qc=0;Qc<T.length;){if((oe=T.charCodeAt(Qc++))>255||(se=T.charCodeAt(Qc++))>255||(De=T.charCodeAt(Qc++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|De,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return vp?pn.slice(0,vp-3)+"===".substring(vp):pn},p=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,b=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,De=T.length;se<De;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return p(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(b(T)):b(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return b(i.encode(T))}:function(T){return p(D(T))},A=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return A(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,De,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(De=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):De===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},v=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return A(this,N)}),T("toBase64URI",function(){return A(this,!0)}),T("toBase64URL",function(){return A(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:p,btoaPolyfill:d,fromBase64:E,toBase64:A,encode:A,encodeURI:$,encodeURL:$,utob:D,btou:S,decode:E,isValid:v,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var kS=y((tde,AS)=>{"use strict";AS.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var RS=y(Yg=>{"use strict";var I9=Object.prototype.hasOwnProperty,j9;function TS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function PS(t){try{return encodeURIComponent(t)}catch{return null}}function N9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=TS(n[1]),o=TS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function L9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(I9.call(t,i)){if(n=t[i],!n&&(n===null||n===j9||isNaN(n))&&(n=""),i=PS(i),n=PS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Yg.stringify=L9;Yg.parse=N9});var MS=y((nde,qS)=>{"use strict";var IS=kS(),af=RS(),B9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,jS=/[\n\r\t]/g,q9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,NS=/:\d+$/,M9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,U9=/^[a-zA-Z]:/;function Xg(t){return(t||"").toString().replace(B9,"")}var Jg=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],$S={hash:1,query:1};function LS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in $S)delete n[o]}else if(i==="object"){for(o in t)o in $S||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=q9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function BS(t,e){t=Xg(t),t=t.replace(jS,""),e=e||{};var r=M9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function V9(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=Xg(t),t=t.replace(jS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=Jg.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=af.parse),e=LS(e),i=BS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||U9.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=V9(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),IS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function H9(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||af.parse)(e)),n[t]=e;break;case"port":n[t]=e,IS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,NS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<Jg.length;s++){var a=Jg[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function z9(t){(!t||typeof t!="function")&&(t=af.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||NS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Wr.prototype={set:H9,toString:z9};Wr.extractProtocol=BS;Wr.location=LS;Wr.trimLeft=Xg;Wr.qs=af;qS.exports=Wr});var US=y(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.default=G9;function G9(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var n1=y(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.default=void 0;var W9=OS(),K9=ry(MS()),uf=ry(zg()),Li=Gg(),Y9=ry(US());function ry(t){return t&&t.__esModule?t:{default:t}}function Qg(){"use strict";Qg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var A=Object.getPrototypeOf,$=A&&A(A(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function VS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function J9(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){VS(o,n,i,s,a,"next",u)}function a(u){VS(o,n,i,s,a,"throw",u)}s(void 0)})}}function ZS(t,e){return Q9(t)||Z9(t,e)||QS(t,e)||X9()}function X9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z9(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function Q9(t){if(Array.isArray(t))return t}function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function e7(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=QS(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function QS(t,e){if(t){if(typeof t=="string")return HS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HS(t,e)}}function HS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function cs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zS(Object(r),!0).forEach(function(n){t7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function t7(t,e,r){return e=e1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,e1(n.key),n)}}function n7(t,e,r){return e&&GS(t.prototype,e),r&&GS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e1(t){var e=i7(t,"string");return Bi(e)=="symbol"?e:e+""}function i7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ey="tus-v1",cf="ietf-draft-03",o7={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:r1,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:ey},t1=function(){function t(e,r){r7(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return n7(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![ey,cf].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Li.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Li.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:a7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var p=d.value;return new Promise(function(b,g){var w=cs(cs({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:cs(cs({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(p,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=WS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!ls(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=XS(n.options.endpoint,f),(0,Li.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Li.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Li.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Li.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=e7(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new uf.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),JS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=WS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===cf&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!ls(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=XS(r.options.endpoint,a),(0,Li.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!ls(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(ls(s,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,o,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(o.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,o,"tus: invalid or missing offset value");return}var u=Number.parseInt(o.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===ey){r._emitHttpError(n,o,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(o);return}r._offset=a,r._performUpload()})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to resume upload",o)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(o){if(!ls(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===cf&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=KS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return YS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=KS("DELETE",r,n);return YS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new uf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof uf.default||(o=new uf.default("tus: failed to terminate upload",o,i,null)),!JS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=cs(cs({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function WS(t){return Object.entries(t).map(function(e){var r=ZS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(W9.Base64.encode(String(i)))}).join(",")}function ls(t,e){return t>=e&&t<e+100}function KS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===cf?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=ZS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,Y9.default)();n.setHeader("X-Request-ID",l)}return n}function YS(t,e,r){return ty.apply(this,arguments)}function ty(){return ty=J9(Qg().mark(function t(e,r,n){var i;return Qg().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(typeof n.onBeforeRequest!="function"){s.next=3;break}return s.next=3,n.onBeforeRequest(e);case 3:return s.next=5,e.send(r);case 5:if(i=s.sent,typeof n.onAfterResponse!="function"){s.next=9;break}return s.next=9,n.onAfterResponse(e,i);case 9:return s.abrupt("return",i);case 10:case"end":return s.stop()}},t)})),ty.apply(this,arguments)}function s7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function JS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):r1(t)}function r1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ls(e,400)||e===409||e===423)&&s7()}function XS(t,e){return new K9.default(e,t).toString()}function a7(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}t1.defaultOptions=o7;var ode=lf.default=t1});var o1=y((ade,i1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";i1.exports=Kr});var a1=y(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.default=void 0;function Su(t){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Su(t)}function u7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l7(n.key),n)}}function c7(t,e,r){return e&&s1(t.prototype,e),r&&s1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function l7(t){var e=f7(t,"string");return Su(e)=="symbol"?e:e+""}function f7(t,e){if(Su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ude=ff.default=function(){function t(e){u7(this,t),this._buffer=e,this.size=e.length}return c7(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var f1=y(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.default=y7;var l1=require("fs");function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function ny(){"use strict";ny=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var A=Object.getPrototypeOf,$=A&&A(A(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function d7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p7(n.key),n)}}function h7(t,e,r){return e&&u1(t.prototype,e),r&&u1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function p7(t){var e=m7(t,"string");return qi(e)=="symbol"?e:e+""}function m7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function c1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function g7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){c1(o,n,i,s,a,"next",u)}function a(u){c1(o,n,i,s,a,"throw",u)}s(void 0)})}}function y7(t){return iy.apply(this,arguments)}function iy(){return iy=g7(ny().mark(function t(e){var r,n,i,o,s,a,u;return ny().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,l1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new D7(e,n,u));case 9:case"end":return l.stop()}},t)})),iy.apply(this,arguments)}var D7=function(){function t(e,r,n){d7(this,t),this._stream=e,this._path=r,this.size=n}return h7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,l1.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var ay=y(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;function Mi(t){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(t)}function xu(){"use strict";xu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var A=Object.getPrototypeOf,$=A&&A(A(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Mi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Mi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function v7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,w7(n.key),n)}}function b7(t,e,r){return e&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w7(t){var e=_7(t,"string");return Mi(e)=="symbol"?e:e+""}function _7(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function p1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){h1(o,n,i,s,a,"next",u)}function a(u){h1(o,n,i,s,a,"throw",u)}s(void 0)})}}function E7(t,e){return sy.apply(this,arguments)}function sy(){return sy=p1(xu().mark(function t(e,r){return xu().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),sy.apply(this,arguments)}var fde=df.default=function(){function t(e){var r=this;v7(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return b7(t,[{key:"slice",value:function(){var e=p1(xu().mark(function n(i,o){var s,a,u,c,l;return xu().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,E7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var g1=y(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.default=void 0;var C7=require("fs"),S7=hf(o1()),x7=hf(a1()),F7=hf(f1()),O7=hf(ay());function hf(t){return t&&t.__esModule?t:{default:t}}function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function A7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T7(n.key),n)}}function k7(t,e,r){return e&&m1(t.prototype,e),r&&m1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function T7(t){var e=P7(t,"string");return Fu(e)=="symbol"?e:e+""}function P7(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var hde=pf.default=function(){function t(){A7(this,t)}return k7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new x7.default(r)):r instanceof C7.ReadStream&&r.path!=null?(0,F7.default)(r):S7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new O7.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var b1=y(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.default=I7;var R7=require("crypto"),y1=v1(require("fs")),$7=v1(require("path"));function D1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(D1=function(n){return n?r:e})(t)}function v1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=D1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function I7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,R7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof y1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=$7.resolve(t.path);y1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var S1=y((gde,C1)=>{var E1="Expected a function",w1=NaN,j7="[object Symbol]",N7=/^\s+|\s+$/g,L7=/^[-+]0x[0-9a-f]+$/i,B7=/^0b[01]+$/i,q7=/^0o[0-7]+$/i,M7=parseInt,U7=typeof global=="object"&&global&&global.Object===Object&&global,V7=typeof self=="object"&&self&&self.Object===Object&&self,H7=U7||V7||Function("return this")(),z7=Object.prototype,G7=z7.toString,W7=Math.max,K7=Math.min,cy=function(){return H7.Date.now()};function Y7(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(E1);e=_1(e)||0,mf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?W7(_1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function p($){return c=$,a=setTimeout(w,e),l?d($):s}function b($){var F=$-u,L=$-c,S=e-F;return f?K7(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=cy();if(g($))return x($);a=setTimeout(w,b($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function D(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(cy())}function A(){var $=cy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return p(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return A.cancel=D,A.flush=C,A}function J7(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(E1);return mf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Y7(t,e,{leading:n,maxWait:e,trailing:i})}function mf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function X7(t){return!!t&&typeof t=="object"}function Z7(t){return typeof t=="symbol"||X7(t)&&G7.call(t)==j7}function _1(t){if(typeof t=="number")return t;if(Z7(t))return w1;if(mf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=mf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(N7,"");var r=B7.test(t);return r||q7.test(t)?M7(t.slice(2),r?2:8):L7.test(t)?w1:+t}C1.exports=J7});var $1=y(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.default=void 0;var Q7=T1(require("http")),eV=T1(require("https")),O1=require("stream"),tV=require("url"),A1=rV(S1());function rV(t){return t&&t.__esModule?t:{default:t}}function k1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(k1=function(n){return n?r:e})(t)}function T1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=k1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function nV(t,e,r){return e=gf(e),iV(t,P1()?Reflect.construct(e,r||[],gf(t).constructor):e.apply(t,r))}function iV(t,e){if(e&&(fs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oV(t)}function oV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P1=function(){return!!t})()}function gf(t){return gf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gf(t)}function sV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ly(t,e)}function ly(t,e){return ly=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ly(t,e)}function x1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ou(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x1(Object(r),!0).forEach(function(n){aV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aV(t,e,r){return e=R1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fs(t){"@babel/helpers - typeof";return fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fs(t)}function yf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R1(n.key),n)}}function Df(t,e,r){return e&&F1(t.prototype,e),r&&F1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R1(t){var e=uV(t,"string");return fs(e)=="symbol"?e:e+""}function uV(t,e){if(fs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yde=vf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yf(this,t),this._requestOptions=e}return Df(t,[{key:"createRequest",value:function(r,n){return new cV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),cV=function(){function t(e,r,n){yf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return Df(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=Ou(Ou(Ou({},(0,tV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Ou(Ou({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?eV:Q7;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new lV(c,f))})}),u.on("error",function(c){o(c)}),n instanceof O1.Readable?n.pipe(new fV(r._progressHandler)).pipe(u):n instanceof Uint8Array?dV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),lV=function(){function t(e,r){yf(this,t),this._response=e,this._body=r}return Df(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),fV=function(t){function e(r){var n;return yf(this,e),n=nV(this,e),n._onprogress=(0,A1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return sV(e,t),Df(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(O1.Transform),dV=function(e,r,n){n=(0,A1.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var I1=y(fy=>{"use strict";fy.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};fy.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
30
+ `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=wu.render(o,r,n),i}});var zg=y(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;function us(t){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},us(t)}function CS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,D9(n.key),n)}}function y9(t,e,r){return e&&CS(t.prototype,e),r&&CS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function D9(t){var e=v9(t,"string");return us(e)=="symbol"?e:e+""}function v9(t,e){if(us(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(us(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function b9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w9(t,e,r){return e=Eu(e),_9(t,Hg()?Reflect.construct(e,r||[],Eu(t).constructor):e.apply(t,r))}function _9(t,e){if(e&&(us(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E9(t)}function E9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function C9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_u(t,e)}function Vg(t){var e=typeof Map=="function"?new Map:void 0;return Vg=function(n){if(n===null||!x9(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return S9(n,arguments,Eu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_u(i,n)},Vg(t)}function S9(t,e,r){if(Hg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&_u(i,r.prototype),i}function Hg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hg=function(){return!!t})()}function x9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},_u(t,e)}function Eu(t){return Eu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eu(t)}var F9=function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(b9(this,e),n=w9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return C9(e,t),y9(e)}(Vg(Error)),Jfe=nf.default=F9});var Gg=y(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.enableDebugLog=O9;of.log=A9;var SS=!1;function O9(){SS=!0}function A9(t){SS&&console.log(t)}});var FS=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;function Cu(t){"@babel/helpers - typeof";return Cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cu(t)}function k9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,P9(n.key),n)}}function T9(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function P9(t){var e=R9(t,"string");return Cu(e)=="symbol"?e:e+""}function R9(t,e){if(Cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qfe=sf.default=function(){function t(){k9(this,t)}return T9(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var OS=y((Wg,Kg)=>{(function(t,e){typeof Wg=="object"&&typeof Kg<"u"?Kg.exports=e():typeof define=="function"&&define.amd?define(e):function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Wg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,De,pn="",vp=T.length%3,Qc=0;Qc<T.length;){if((oe=T.charCodeAt(Qc++))>255||(se=T.charCodeAt(Qc++))>255||(De=T.charCodeAt(Qc++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|De,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return vp?pn.slice(0,vp-3)+"===".substring(vp):pn},p=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,b=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,De=T.length;se<De;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return p(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(b(T)):b(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return b(i.encode(T))}:function(T){return p(D(T))},A=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return A(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,De,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(De=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):De===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},v=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return A(this,N)}),T("toBase64URI",function(){return A(this,!0)}),T("toBase64URL",function(){return A(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:p,btoaPolyfill:d,fromBase64:E,toBase64:A,encode:A,encodeURI:$,encodeURL:$,utob:D,btou:S,decode:E,isValid:v,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var kS=y((tde,AS)=>{"use strict";AS.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var RS=y(Yg=>{"use strict";var $9=Object.prototype.hasOwnProperty,I9;function TS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function PS(t){try{return encodeURIComponent(t)}catch{return null}}function j9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=TS(n[1]),o=TS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function N9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if($9.call(t,i)){if(n=t[i],!n&&(n===null||n===I9||isNaN(n))&&(n=""),i=PS(i),n=PS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Yg.stringify=N9;Yg.parse=j9});var MS=y((nde,qS)=>{"use strict";var IS=kS(),af=RS(),L9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,jS=/[\n\r\t]/g,B9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,NS=/:\d+$/,q9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,M9=/^[a-zA-Z]:/;function Xg(t){return(t||"").toString().replace(L9,"")}var Jg=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],$S={hash:1,query:1};function LS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in $S)delete n[o]}else if(i==="object"){for(o in t)o in $S||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=B9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function BS(t,e){t=Xg(t),t=t.replace(jS,""),e=e||{};var r=q9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function U9(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=Xg(t),t=t.replace(jS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=Jg.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=af.parse),e=LS(e),i=BS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||M9.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=U9(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),IS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function V9(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||af.parse)(e)),n[t]=e;break;case"port":n[t]=e,IS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,NS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<Jg.length;s++){var a=Jg[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function H9(t){(!t||typeof t!="function")&&(t=af.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||NS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Wr.prototype={set:V9,toString:H9};Wr.extractProtocol=BS;Wr.location=LS;Wr.trimLeft=Xg;Wr.qs=af;qS.exports=Wr});var US=y(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.default=z9;function z9(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var n1=y(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.default=void 0;var G9=OS(),W9=ry(MS()),uf=ry(zg()),Li=Gg(),K9=ry(US());function ry(t){return t&&t.__esModule?t:{default:t}}function Qg(){"use strict";Qg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var A=Object.getPrototypeOf,$=A&&A(A(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function VS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Y9(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){VS(o,n,i,s,a,"next",u)}function a(u){VS(o,n,i,s,a,"throw",u)}s(void 0)})}}function ZS(t,e){return Z9(t)||X9(t,e)||QS(t,e)||J9()}function J9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X9(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function Z9(t){if(Array.isArray(t))return t}function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function Q9(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=QS(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function QS(t,e){if(t){if(typeof t=="string")return HS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HS(t,e)}}function HS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function cs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zS(Object(r),!0).forEach(function(n){e7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function e7(t,e,r){return e=e1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function t7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,e1(n.key),n)}}function r7(t,e,r){return e&&GS(t.prototype,e),r&&GS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e1(t){var e=n7(t,"string");return Bi(e)=="symbol"?e:e+""}function n7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ey="tus-v1",cf="ietf-draft-03",i7={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:r1,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:ey},t1=function(){function t(e,r){t7(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return r7(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![ey,cf].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Li.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Li.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:s7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var p=d.value;return new Promise(function(b,g){var w=cs(cs({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:cs(cs({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(p,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=WS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!ls(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=XS(n.options.endpoint,f),(0,Li.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Li.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Li.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Li.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=Q9(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new uf.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),JS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=WS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===cf&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!ls(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=XS(r.options.endpoint,a),(0,Li.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!ls(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(ls(s,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,o,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(o.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,o,"tus: invalid or missing offset value");return}var u=Number.parseInt(o.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===ey){r._emitHttpError(n,o,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(o);return}r._offset=a,r._performUpload()})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to resume upload",o)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(o){if(!ls(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===cf&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=KS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return YS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=KS("DELETE",r,n);return YS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new uf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof uf.default||(o=new uf.default("tus: failed to terminate upload",o,i,null)),!JS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=cs(cs({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function WS(t){return Object.entries(t).map(function(e){var r=ZS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(G9.Base64.encode(String(i)))}).join(",")}function ls(t,e){return t>=e&&t<e+100}function KS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===cf?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=ZS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,K9.default)();n.setHeader("X-Request-ID",l)}return n}function YS(t,e,r){return ty.apply(this,arguments)}function ty(){return ty=Y9(Qg().mark(function t(e,r,n){var i;return Qg().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(typeof n.onBeforeRequest!="function"){s.next=3;break}return s.next=3,n.onBeforeRequest(e);case 3:return s.next=5,e.send(r);case 5:if(i=s.sent,typeof n.onAfterResponse!="function"){s.next=9;break}return s.next=9,n.onAfterResponse(e,i);case 9:return s.abrupt("return",i);case 10:case"end":return s.stop()}},t)})),ty.apply(this,arguments)}function o7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function JS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):r1(t)}function r1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ls(e,400)||e===409||e===423)&&o7()}function XS(t,e){return new W9.default(e,t).toString()}function s7(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}t1.defaultOptions=i7;var ode=lf.default=t1});var o1=y((ade,i1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";i1.exports=Kr});var a1=y(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.default=void 0;function Su(t){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Su(t)}function a7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c7(n.key),n)}}function u7(t,e,r){return e&&s1(t.prototype,e),r&&s1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c7(t){var e=l7(t,"string");return Su(e)=="symbol"?e:e+""}function l7(t,e){if(Su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ude=ff.default=function(){function t(e){a7(this,t),this._buffer=e,this.size=e.length}return u7(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var f1=y(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.default=g7;var l1=require("fs");function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function ny(){"use strict";ny=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var A=Object.getPrototypeOf,$=A&&A(A(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function f7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h7(n.key),n)}}function d7(t,e,r){return e&&u1(t.prototype,e),r&&u1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h7(t){var e=p7(t,"string");return qi(e)=="symbol"?e:e+""}function p7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function c1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function m7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){c1(o,n,i,s,a,"next",u)}function a(u){c1(o,n,i,s,a,"throw",u)}s(void 0)})}}function g7(t){return iy.apply(this,arguments)}function iy(){return iy=m7(ny().mark(function t(e){var r,n,i,o,s,a,u;return ny().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,l1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new y7(e,n,u));case 9:case"end":return l.stop()}},t)})),iy.apply(this,arguments)}var y7=function(){function t(e,r,n){f7(this,t),this._stream=e,this._path=r,this.size=n}return d7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,l1.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var ay=y(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;function Mi(t){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(t)}function xu(){"use strict";xu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var A=Object.getPrototypeOf,$=A&&A(A(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Mi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Mi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function D7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b7(n.key),n)}}function v7(t,e,r){return e&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function b7(t){var e=w7(t,"string");return Mi(e)=="symbol"?e:e+""}function w7(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function p1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){h1(o,n,i,s,a,"next",u)}function a(u){h1(o,n,i,s,a,"throw",u)}s(void 0)})}}function _7(t,e){return sy.apply(this,arguments)}function sy(){return sy=p1(xu().mark(function t(e,r){return xu().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),sy.apply(this,arguments)}var fde=df.default=function(){function t(e){var r=this;D7(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return v7(t,[{key:"slice",value:function(){var e=p1(xu().mark(function n(i,o){var s,a,u,c,l;return xu().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,_7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var g1=y(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.default=void 0;var E7=require("fs"),C7=hf(o1()),S7=hf(a1()),x7=hf(f1()),F7=hf(ay());function hf(t){return t&&t.__esModule?t:{default:t}}function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function O7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k7(n.key),n)}}function A7(t,e,r){return e&&m1(t.prototype,e),r&&m1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function k7(t){var e=T7(t,"string");return Fu(e)=="symbol"?e:e+""}function T7(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var hde=pf.default=function(){function t(){O7(this,t)}return A7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new S7.default(r)):r instanceof E7.ReadStream&&r.path!=null?(0,x7.default)(r):C7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new F7.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var b1=y(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.default=$7;var P7=require("crypto"),y1=v1(require("fs")),R7=v1(require("path"));function D1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(D1=function(n){return n?r:e})(t)}function v1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=D1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function $7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,P7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof y1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=R7.resolve(t.path);y1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var S1=y((gde,C1)=>{var E1="Expected a function",w1=NaN,I7="[object Symbol]",j7=/^\s+|\s+$/g,N7=/^[-+]0x[0-9a-f]+$/i,L7=/^0b[01]+$/i,B7=/^0o[0-7]+$/i,q7=parseInt,M7=typeof global=="object"&&global&&global.Object===Object&&global,U7=typeof self=="object"&&self&&self.Object===Object&&self,V7=M7||U7||Function("return this")(),H7=Object.prototype,z7=H7.toString,G7=Math.max,W7=Math.min,cy=function(){return V7.Date.now()};function K7(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(E1);e=_1(e)||0,mf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?G7(_1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function p($){return c=$,a=setTimeout(w,e),l?d($):s}function b($){var F=$-u,L=$-c,S=e-F;return f?W7(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=cy();if(g($))return x($);a=setTimeout(w,b($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function D(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(cy())}function A(){var $=cy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return p(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return A.cancel=D,A.flush=C,A}function Y7(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(E1);return mf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),K7(t,e,{leading:n,maxWait:e,trailing:i})}function mf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function J7(t){return!!t&&typeof t=="object"}function X7(t){return typeof t=="symbol"||J7(t)&&z7.call(t)==I7}function _1(t){if(typeof t=="number")return t;if(X7(t))return w1;if(mf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=mf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(j7,"");var r=L7.test(t);return r||B7.test(t)?q7(t.slice(2),r?2:8):N7.test(t)?w1:+t}C1.exports=Y7});var $1=y(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.default=void 0;var Z7=T1(require("http")),Q7=T1(require("https")),O1=require("stream"),eV=require("url"),A1=tV(S1());function tV(t){return t&&t.__esModule?t:{default:t}}function k1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(k1=function(n){return n?r:e})(t)}function T1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=k1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function rV(t,e,r){return e=gf(e),nV(t,P1()?Reflect.construct(e,r||[],gf(t).constructor):e.apply(t,r))}function nV(t,e){if(e&&(fs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iV(t)}function iV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P1=function(){return!!t})()}function gf(t){return gf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gf(t)}function oV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ly(t,e)}function ly(t,e){return ly=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ly(t,e)}function x1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ou(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x1(Object(r),!0).forEach(function(n){sV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sV(t,e,r){return e=R1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fs(t){"@babel/helpers - typeof";return fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fs(t)}function yf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R1(n.key),n)}}function Df(t,e,r){return e&&F1(t.prototype,e),r&&F1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R1(t){var e=aV(t,"string");return fs(e)=="symbol"?e:e+""}function aV(t,e){if(fs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yde=vf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yf(this,t),this._requestOptions=e}return Df(t,[{key:"createRequest",value:function(r,n){return new uV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),uV=function(){function t(e,r,n){yf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return Df(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=Ou(Ou(Ou({},(0,eV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Ou(Ou({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?Q7:Z7;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new cV(c,f))})}),u.on("error",function(c){o(c)}),n instanceof O1.Readable?n.pipe(new lV(r._progressHandler)).pipe(u):n instanceof Uint8Array?fV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),cV=function(){function t(e,r){yf(this,t),this._response=e,this._body=r}return Df(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),lV=function(t){function e(r){var n;return yf(this,e),n=rV(this,e),n._onprogress=(0,A1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return oV(e,t),Df(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(O1.Transform),fV=function(e,r,n){n=(0,A1.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var I1=y(fy=>{"use strict";fy.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};fy.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
33
33
  `)}(!e||typeof e!="object")&&(e={}),e.hasOwnProperty("stackLength")&&typeof e.stackLength=="number"&&!isNaN(e.stackLength)&&e.stackLength>=0&&(o.stackLength=e.stackLength),e.hasOwnProperty("rootOnly")||(o.rootOnly=e.rootOnly),(!o.rootOnly||this.CustomError.parent===Error)&&(Object.keys(t).forEach(function(l){switch(l){case"code":i=t.code||void 0;break;case"message":s=t.message||"";break;default:n[l]=t[l]}}),Error.stackTraceLimit=o.stackLength+2,u=new Error().stack.split(`
34
34
  `),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=a,this.stack=u.join(`
35
- `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var L1=y((bde,N1)=>{"use strict";N1.exports=Ui;Ui.factory=I1();var py=Ui("CustomError");py.order=Ui(py,{message:"Arguments out of order.",code:"EOARG"});function Ui(t,e,r,n){var i,o;return e=bf(arguments,1,Error,j1,[dy,wf]),r=bf(arguments,2,{},dy,[wf]),n=bf(arguments,3,hy,wf,[]),t=bf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,hV,[j1,dy,wf]),o=e===Error,o&&n===hy&&(n=Ui.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(p){return p.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Ui.factory).forEach(function(p){l[p]=function(b,g){Ui.factory[p].call(u,b,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==hy&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function bf(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new py.order;return s!==-1?t[s]:r}function wf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function hV(t){return typeof t=="string"}function j1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function dy(t){return t&&typeof t=="object"}function hy(){}});var q1=y((wde,B1)=>{B1.exports=L1()});var z1=y((Vi,ds)=>{var pV=1/0,mV="[object Symbol]",Au={function:!0,object:!0},gV=Au[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,yV=Au[typeof ds]&&ds&&!ds.nodeType?ds:void 0,DV=_f(gV&&yV&&typeof global=="object"&&global),vV=_f(Au[typeof self]&&self),M1=_f(Au[typeof window]&&window),my=_f(Au[typeof Vi]&&Vi),bV=DV||M1!==(my&&my.window)&&M1||vV||my||Function("return this")();function _f(t){return t&&t.Object===Object?t:null}var wV=Object.prototype,_V=wV.toString,U1=bV.Symbol,V1=U1?U1.prototype:void 0,H1=V1?V1.toString:void 0;function EV(t){if(typeof t=="string")return t;if(SV(t))return H1?H1.call(t):"";var e=t+"";return e=="0"&&1/t==-pV?"-0":e}function CV(t){return!!t&&typeof t=="object"}function SV(t){return typeof t=="symbol"||CV(t)&&_V.call(t)==mV}ds.exports=EV});var Z1=y((Hi,hs)=>{var xV=z1(),FV="Expected a function",W1="__lodash_hash_undefined__",OV="[object Function]",AV="[object GeneratorFunction]",kV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,TV=/[\\^$.*+?()[\]{}|]/g,PV=/\\(\\)?/g,RV=/^\[object .+?Constructor\]$/,Tu={function:!0,object:!0},$V=Tu[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,IV=Tu[typeof hs]&&hs&&!hs.nodeType?hs:void 0,jV=Ef($V&&IV&&typeof global=="object"&&global),NV=Ef(Tu[typeof self]&&self),G1=Ef(Tu[typeof window]&&window),gy=Ef(Tu[typeof Hi]&&Hi),LV=jV||G1!==(gy&&gy.window)&&G1||NV||gy||Function("return this")();function Ef(t){return t&&t.Object===Object?t:null}function BV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var qV=Array.prototype,K1=Object.prototype,Y1=Function.prototype.toString,yy=K1.hasOwnProperty,MV=K1.toString,UV=RegExp("^"+Y1.call(yy).replace(TV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),VV=qV.splice,HV=J1(LV,"Map"),ku=J1(Object,"create");function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function zV(){this.__data__=ku?ku(null):{}}function GV(t){return this.has(t)&&delete this.__data__[t]}function WV(t){var e=this.__data__;if(ku){var r=e[t];return r===W1?void 0:r}return yy.call(e,t)?e[t]:void 0}function KV(t){var e=this.__data__;return ku?e[t]!==void 0:yy.call(e,t)}function YV(t,e){var r=this.__data__;return r[t]=ku&&e===void 0?W1:e,this}zi.prototype.clear=zV;zi.prototype.delete=GV;zi.prototype.get=WV;zi.prototype.has=KV;zi.prototype.set=YV;function ps(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function JV(){this.__data__=[]}function XV(t){var e=this.__data__,r=Cf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():VV.call(e,r,1),!0}function ZV(t){var e=this.__data__,r=Cf(e,t);return r<0?void 0:e[r][1]}function QV(t){return Cf(this.__data__,t)>-1}function eH(t,e){var r=this.__data__,n=Cf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ps.prototype.clear=JV;ps.prototype.delete=XV;ps.prototype.get=ZV;ps.prototype.has=QV;ps.prototype.set=eH;function Gi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function tH(){this.__data__={hash:new zi,map:new(HV||ps),string:new zi}}function rH(t){return Sf(this,t).delete(t)}function nH(t){return Sf(this,t).get(t)}function iH(t){return Sf(this,t).has(t)}function oH(t,e){return Sf(this,t).set(t,e),this}Gi.prototype.clear=tH;Gi.prototype.delete=rH;Gi.prototype.get=nH;Gi.prototype.has=iH;Gi.prototype.set=oH;function Cf(t,e){for(var r=t.length;r--;)if(cH(t[r][0],e))return r;return-1}function Sf(t,e){var r=t.__data__;return sH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function J1(t,e){var r=t[e];return fH(r)?r:void 0}function sH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var aH=Dy(function(t){var e=[];return dH(t).replace(kV,function(r,n,i,o){e.push(i?o.replace(PV,"$1"):n||r)}),e});function uH(t){if(t!=null){try{return Y1.call(t)}catch{}try{return t+""}catch{}}return""}function Dy(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(FV);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Dy.Cache||Gi),r}Dy.Cache=Gi;function cH(t,e){return t===e||t!==t&&e!==e}function lH(t){var e=X1(t)?MV.call(t):"";return e==OV||e==AV}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function fH(t){if(!X1(t))return!1;var e=lH(t)||BV(t)?UV:RV;return e.test(uH(t))}function dH(t){return t==null?"":xV(t)}hs.exports=aH});var Ox=y((Wi,gs)=>{var hH=Z1(),pH=200,Ay="__lodash_hash_undefined__",kf=1,ys=2,mH=1/0,ix=9007199254740991,xf="[object Arguments]",wy="[object Array]",ox="[object Boolean]",sx="[object Date]",ax="[object Error]",ux="[object Function]",gH="[object GeneratorFunction]",Pu="[object Map]",cx="[object Number]",ms="[object Object]",Q1="[object Promise]",lx="[object RegExp]",Ru="[object Set]",ky="[object String]",fx="[object Symbol]",_y="[object WeakMap]",dx="[object ArrayBuffer]",Ff="[object DataView]",yH="[object Float32Array]",DH="[object Float64Array]",vH="[object Int8Array]",bH="[object Int16Array]",wH="[object Int32Array]",_H="[object Uint8Array]",EH="[object Uint8ClampedArray]",CH="[object Uint16Array]",SH="[object Uint32Array]",xH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,FH=/^\w*$/,OH=/[\\^$.*+?()[\]{}|]/g,AH=/^\[object .+?Constructor\]$/,kH=/^(?:0|[1-9]\d*)$/,Pe={};Pe[yH]=Pe[DH]=Pe[vH]=Pe[bH]=Pe[wH]=Pe[_H]=Pe[EH]=Pe[CH]=Pe[SH]=!0;Pe[xf]=Pe[wy]=Pe[dx]=Pe[ox]=Pe[Ff]=Pe[sx]=Pe[ax]=Pe[ux]=Pe[Pu]=Pe[cx]=Pe[ms]=Pe[lx]=Pe[Ru]=Pe[ky]=Pe[_y]=!1;var Iu={function:!0,object:!0},TH=Iu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,PH=Iu[typeof gs]&&gs&&!gs.nodeType?gs:void 0,RH=Tf(TH&&PH&&typeof global=="object"&&global),$H=Tf(Iu[typeof self]&&self),ex=Tf(Iu[typeof window]&&window),vy=Tf(Iu[typeof Wi]&&Wi),Ji=RH||ex!==(vy&&vy.window)&&ex||$H||vy||Function("return this")();function IH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function jH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function NH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function LH(t,e){return IH(e,function(r){return[r,t[r]]})}function Tf(t){return t&&t.Object===Object?t:null}function Ey(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function hx(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function BH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function qH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var MH=Array.prototype,Pf=Object.prototype,px=Function.prototype.toString,Ki=Pf.hasOwnProperty,Xi=Pf.toString,UH=RegExp("^"+px.call(Ki).replace(OH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=Ji.Symbol,rx=Ji.Uint8Array,VH=Pf.propertyIsEnumerable,HH=MH.splice,zH=Object.getPrototypeOf,GH=Object.keys,Cy=Ds(Ji,"DataView"),Of=Ds(Ji,"Map"),Sy=Ds(Ji,"Promise"),xy=Ds(Ji,"Set"),Fy=Ds(Ji,"WeakMap"),$u=Ds(Object,"create"),WH=Qi(Cy),KH=Qi(Of),YH=Qi(Sy),JH=Qi(xy),XH=Qi(Fy),nx=tx?tx.prototype:void 0,by=nx?nx.valueOf:void 0;function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ZH(){this.__data__=$u?$u(null):{}}function QH(t){return this.has(t)&&delete this.__data__[t]}function ez(t){var e=this.__data__;if($u){var r=e[t];return r===Ay?void 0:r}return Ki.call(e,t)?e[t]:void 0}function tz(t){var e=this.__data__;return $u?e[t]!==void 0:Ki.call(e,t)}function rz(t,e){var r=this.__data__;return r[t]=$u&&e===void 0?Ay:e,this}Yi.prototype.clear=ZH;Yi.prototype.delete=QH;Yi.prototype.get=ez;Yi.prototype.has=tz;Yi.prototype.set=rz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nz(){this.__data__=[]}function iz(t){var e=this.__data__,r=Rf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():HH.call(e,r,1),!0}function oz(t){var e=this.__data__,r=Rf(e,t);return r<0?void 0:e[r][1]}function sz(t){return Rf(this.__data__,t)>-1}function az(t,e){var r=this.__data__,n=Rf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=nz;wn.prototype.delete=iz;wn.prototype.get=oz;wn.prototype.has=sz;wn.prototype.set=az;function Zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function uz(){this.__data__={hash:new Yi,map:new(Of||wn),string:new Yi}}function cz(t){return $f(this,t).delete(t)}function lz(t){return $f(this,t).get(t)}function fz(t){return $f(this,t).has(t)}function dz(t,e){return $f(this,t).set(t,e),this}Zi.prototype.clear=uz;Zi.prototype.delete=cz;Zi.prototype.get=lz;Zi.prototype.has=fz;Zi.prototype.set=dz;function Af(t){var e=-1,r=t?t.length:0;for(this.__data__=new Zi;++e<r;)this.add(t[e])}function hz(t){return this.__data__.set(t,Ay),this}function pz(t){return this.__data__.has(t)}Af.prototype.add=Af.prototype.push=hz;Af.prototype.has=pz;function bn(t){this.__data__=new wn(t)}function mz(){this.__data__=new wn}function gz(t){return this.__data__.delete(t)}function yz(t){return this.__data__.get(t)}function Dz(t){return this.__data__.has(t)}function vz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==pH&&(r=this.__data__=new Zi(r.__data__)),r.set(t,e),this}bn.prototype.clear=mz;bn.prototype.delete=gz;bn.prototype.get=yz;bn.prototype.has=Dz;bn.prototype.set=vz;function Rf(t,e){for(var r=t.length;r--;)if(Lz(t[r][0],e))return r;return-1}function mx(t,e){e=If(e,t)?[e]:Dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[jf(e[r++])];return r&&r==n?t:void 0}function gx(t,e){return Ki.call(t,e)||typeof t=="object"&&e in t&&Rz(t)===null}function bz(t,e){return e in Object(t)}function Ty(t,e,r,n,i){return t===e?!0:t==null||e==null||!Lf(t)&&!ju(e)?t!==t&&e!==e:wz(t,e,Ty,r,n,i)}function wz(t,e,r,n,i,o){var s=ri(t),a=ri(e),u=wy,c=wy;s||(u=vn(t),u=u==xf?ms:u),a||(c=vn(e),c=c==xf?ms:c);var l=u==ms&&!Ey(t),f=c==ms&&!Ey(e),h=u==c;if(h&&!l)return o||(o=new bn),s||Mz(t)?vx(t,e,r,n,i,o):Az(t,e,u,r,n,i,o);if(!(i&ys)){var d=l&&Ki.call(t,"__wrapped__"),p=f&&Ki.call(e,"__wrapped__");if(d||p){var b=d?t.value():t,g=p?e.value():e;return o||(o=new bn),r(b,g,n,i,o)}}return h?(o||(o=new bn),kz(t,e,r,n,i,o)):!1}function _z(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Ty(l,c,n,kf|ys,f):h))return!1}}return!0}function Ez(t){return typeof t=="function"?t:t==null?zz:typeof t=="object"?ri(t)?xz(t[0],t[1]):Sz(t):Gz(t)}function Cz(t){return GH(Object(t))}function Sz(t){var e=Pz(t);return e.length==1&&e[0][2]?_x(e[0][0],e[0][1]):function(r){return r===t||_z(r,t,e)}}function xz(t,e){return If(t)&&wx(e)?_x(jf(t),e):function(r){var n=Uz(r,t);return n===void 0&&n===e?Vz(r,t):Ty(e,n,void 0,kf|ys)}}function yx(t){return function(e){return e?.[t]}}function Fz(t){return function(e){return mx(e,t)}}function Dx(t){return ri(t)?t:hH(t)}function Oz(t){return function(e){var r=vn(e);return r==Pu?hx(e):r==Ru?qH(e):LH(e,t(e))}}function vx(t,e,r,n,i,o){var s=i&ys,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&kf?new Af:void 0;for(o.set(t,e);++l<a;){var d=t[l],p=e[l];if(n)var b=s?n(p,d,l,e,t,o):n(d,p,l,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!jH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===p||r(d,p,n,i,o))){f=!1;break}}return o.delete(t),f}function Az(t,e,r,n,i,o,s){switch(r){case Ff:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dx:return!(t.byteLength!=e.byteLength||!n(new rx(t),new rx(e)));case ox:case sx:return+t==+e;case ax:return t.name==e.name&&t.message==e.message;case cx:return t!=+t?e!=+e:t==+e;case lx:case ky:return t==e+"";case Pu:var a=hx;case Ru:var u=o&ys;if(a||(a=BH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=kf,s.set(t,e),vx(a(t),a(e),n,i,o,s));case fx:if(by)return by.call(t)==by.call(e)}return!1}function kz(t,e,r,n,i,o){var s=i&ys,a=Oy(t),u=a.length,c=Oy(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:gx(e,h)))return!1}var d=o.get(t);if(d)return d==e;var p=!0;o.set(t,e);for(var b=s;++f<u;){h=a[f];var g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){p=!1;break}b||(b=h=="constructor")}if(p&&!b){var D=t.constructor,C=e.constructor;D!=C&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(t),p}var Tz=yx("length");function $f(t,e){var r=t.__data__;return jz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Pz(t){for(var e=Hz(t),r=e.length;r--;)e[r][2]=wx(e[r][1]);return e}function Ds(t,e){var r=t[e];return qz(r)?r:void 0}function Rz(t){return zH(Object(t))}function vn(t){return Xi.call(t)}(Cy&&vn(new Cy(new ArrayBuffer(1)))!=Ff||Of&&vn(new Of)!=Pu||Sy&&vn(Sy.resolve())!=Q1||xy&&vn(new xy)!=Ru||Fy&&vn(new Fy)!=_y)&&(vn=function(t){var e=Xi.call(t),r=e==ms?t.constructor:void 0,n=r?Qi(r):void 0;if(n)switch(n){case WH:return Ff;case KH:return Pu;case YH:return Q1;case JH:return Ru;case XH:return _y}return e});function $z(t,e,r){e=If(e,t)?[e]:Dx(e);for(var n,i=-1,s=e.length;++i<s;){var o=jf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&Nf(s)&&bx(o,s)&&(ri(t)||xx(t)||Ex(t))}function Iz(t){var e=t?t.length:void 0;return Nf(e)&&(ri(t)||xx(t)||Ex(t))?NH(e,String):null}function bx(t,e){return e=e??ix,!!e&&(typeof t=="number"||kH.test(t))&&t>-1&&t%1==0&&t<e}function If(t,e){if(ri(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Fx(t)?!0:FH.test(t)||!xH.test(t)||e!=null&&t in Object(e)}function jz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Nz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Pf;return t===r}function wx(t){return t===t&&!Lf(t)}function _x(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function jf(t){if(typeof t=="string"||Fx(t))return t;var e=t+"";return e=="0"&&1/t==-mH?"-0":e}function Qi(t){if(t!=null){try{return px.call(t)}catch{}try{return t+""}catch{}}return""}function Lz(t,e){return t===e||t!==t&&e!==e}function Ex(t){return Bz(t)&&Ki.call(t,"callee")&&(!VH.call(t,"callee")||Xi.call(t)==xf)}var ri=Array.isArray;function Cx(t){return t!=null&&Nf(Tz(t))&&!Sx(t)}function Bz(t){return ju(t)&&Cx(t)}function Sx(t){var e=Lf(t)?Xi.call(t):"";return e==ux||e==gH}function Nf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ix}function Lf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function ju(t){return!!t&&typeof t=="object"}function qz(t){if(!Lf(t))return!1;var e=Sx(t)||Ey(t)?UH:AH;return e.test(Qi(t))}function xx(t){return typeof t=="string"||!ri(t)&&ju(t)&&Xi.call(t)==ky}function Fx(t){return typeof t=="symbol"||ju(t)&&Xi.call(t)==fx}function Mz(t){return ju(t)&&Nf(t.length)&&!!Pe[Xi.call(t)]}function Uz(t,e,r){var n=t==null?void 0:mx(t,e);return n===void 0?r:n}function Vz(t,e){return t!=null&&$z(t,e,bz)}function Oy(t){var e=Nz(t);if(!(e||Cx(t)))return Cz(t);var r=Iz(t),n=!!r,i=r||[],o=i.length;for(var s in t)gx(t,s)&&!(n&&(s=="length"||bx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var Hz=Oz(Oy);function zz(t){return t}function Gz(t){return If(t)?yx(jf(t)):Fz(t)}gs.exports=Ez});var Rx=y((eo,vs)=>{var Wz=1/0,Kz="[object Function]",Yz="[object GeneratorFunction]",Jz=/[\\^$.*+?()[\]{}|]/g,Xz=/^\[object .+?Constructor\]$/,Nu={function:!0,object:!0},Zz=Nu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,Qz=Nu[typeof vs]&&vs&&!vs.nodeType?vs:void 0,eG=Bf(Zz&&Qz&&typeof global=="object"&&global),tG=Bf(Nu[typeof self]&&self),Ax=Bf(Nu[typeof window]&&window),Py=Bf(Nu[typeof eo]&&eo),rG=eG||Ax!==(Py&&Py.window)&&Ax||tG||Py||Function("return this")();function Bf(t){return t&&t.Object===Object?t:null}function nG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function iG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var kx=Object.prototype,Tx=Function.prototype.toString,oG=kx.hasOwnProperty,sG=kx.toString,aG=RegExp("^"+Tx.call(oG).replace(Jz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ry=cG(rG,"Set"),uG=Ry&&1/iG(new Ry([,-0]))[1]==Wz?function(t){return new Ry(t)}:hG;function cG(t,e){var r=t[e];return dG(r)?r:void 0}function lG(t){if(t!=null){try{return Tx.call(t)}catch{}try{return t+""}catch{}}return""}function fG(t){var e=Px(t)?sG.call(t):"";return e==Kz||e==Yz}function Px(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function dG(t){if(!Px(t))return!1;var e=fG(t)||nG(t)?aG:Xz;return e.test(lG(t))}function hG(){}vs.exports=uG});var Ix=y((to,bs)=>{var Lu={function:!0,object:!0},pG=Lu[typeof to]&&to&&!to.nodeType?to:void 0,mG=Lu[typeof bs]&&bs&&!bs.nodeType?bs:void 0,gG=qf(pG&&mG&&typeof global=="object"&&global),yG=qf(Lu[typeof self]&&self),$x=qf(Lu[typeof window]&&window),$y=qf(Lu[typeof to]&&to),DG=gG||$x!==($y&&$y.window)&&$x||yG||$y||Function("return this")();function qf(t){return t&&t.Object===Object?t:null}bs.exports=DG});var Mx=y((_de,qx)=>{var vG=Rx(),bG=Ix(),wG=200,Iy="__lodash_hash_undefined__",_G="[object Function]",EG="[object GeneratorFunction]",CG=/[\\^$.*+?()[\]{}|]/g,SG=/^\[object .+?Constructor\]$/;function xG(t,e){return!!t.length&&OG(t,e,0)>-1}function FG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function OG(t,e,r){if(e!==e)return kG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function AG(t,e){return t.has(e)}function kG(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var o=t[i];if(o!==o)return i}return-1}function TG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function PG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var RG=Array.prototype,jx=Object.prototype,Nx=Function.prototype.toString,jy=jx.hasOwnProperty,$G=jx.toString,IG=RegExp("^"+Nx.call(jy).replace(CG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jG=RG.splice,NG=Lx(bG,"Map"),Bu=Lx(Object,"create");function ro(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function LG(){this.__data__=Bu?Bu(null):{}}function BG(t){return this.has(t)&&delete this.__data__[t]}function qG(t){var e=this.__data__;if(Bu){var r=e[t];return r===Iy?void 0:r}return jy.call(e,t)?e[t]:void 0}function MG(t){var e=this.__data__;return Bu?e[t]!==void 0:jy.call(e,t)}function UG(t,e){var r=this.__data__;return r[t]=Bu&&e===void 0?Iy:e,this}ro.prototype.clear=LG;ro.prototype.delete=BG;ro.prototype.get=qG;ro.prototype.has=MG;ro.prototype.set=UG;function ws(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function VG(){this.__data__=[]}function HG(t){var e=this.__data__,r=Uf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():jG.call(e,r,1),!0}function zG(t){var e=this.__data__,r=Uf(e,t);return r<0?void 0:e[r][1]}function GG(t){return Uf(this.__data__,t)>-1}function WG(t,e){var r=this.__data__,n=Uf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ws.prototype.clear=VG;ws.prototype.delete=HG;ws.prototype.get=zG;ws.prototype.has=GG;ws.prototype.set=WG;function _s(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function KG(){this.__data__={hash:new ro,map:new(NG||ws),string:new ro}}function YG(t){return Vf(this,t).delete(t)}function JG(t){return Vf(this,t).get(t)}function XG(t){return Vf(this,t).has(t)}function ZG(t,e){return Vf(this,t).set(t,e),this}_s.prototype.clear=KG;_s.prototype.delete=YG;_s.prototype.get=JG;_s.prototype.has=XG;_s.prototype.set=ZG;function Mf(t){var e=-1,r=t?t.length:0;for(this.__data__=new _s;++e<r;)this.add(t[e])}function QG(t){return this.__data__.set(t,Iy),this}function eW(t){return this.__data__.has(t)}Mf.prototype.add=Mf.prototype.push=QG;Mf.prototype.has=eW;function Uf(t,e){for(var r=t.length;r--;)if(iW(t[r][0],e))return r;return-1}function tW(t,e,r){var n=-1,i=xG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=FG;else if(o>=wG){var c=e?null:vG(t);if(c)return PG(c);s=!1,i=AG,u=new Mf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function Vf(t,e){var r=t.__data__;return rW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Lx(t,e){var r=t[e];return sW(r)?r:void 0}function rW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function nW(t){if(t!=null){try{return Nx.call(t)}catch{}try{return t+""}catch{}}return""}function iW(t,e){return t===e||t!==t&&e!==e}function oW(t){var e=Bx(t)?$G.call(t):"";return e==_G||e==EG}function Bx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function sW(t){if(!Bx(t))return!1;var e=oW(t)||TG(t)?IG:SG;return e.test(nW(t))}qx.exports=tW});var Vx=y((Ede,Ux)=>{var aW=Ox(),uW=Mx();function cW(t,e){return t&&t.length?uW(t,aW(e)):[]}Ux.exports=cW});var zx=y((Cde,Hx)=>{"use strict";var lW=q1(),fW=Vx(),dW=lW("MultiError");Hx.exports=Ny;function Ny(t){if(!(this instanceof Ny))return new Ny(t);if(t=Array.isArray(t)?t:[t],t=fW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new dW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
35
+ `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var L1=y((bde,N1)=>{"use strict";N1.exports=Ui;Ui.factory=I1();var py=Ui("CustomError");py.order=Ui(py,{message:"Arguments out of order.",code:"EOARG"});function Ui(t,e,r,n){var i,o;return e=bf(arguments,1,Error,j1,[dy,wf]),r=bf(arguments,2,{},dy,[wf]),n=bf(arguments,3,hy,wf,[]),t=bf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,dV,[j1,dy,wf]),o=e===Error,o&&n===hy&&(n=Ui.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(p){return p.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Ui.factory).forEach(function(p){l[p]=function(b,g){Ui.factory[p].call(u,b,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==hy&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function bf(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new py.order;return s!==-1?t[s]:r}function wf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function dV(t){return typeof t=="string"}function j1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function dy(t){return t&&typeof t=="object"}function hy(){}});var q1=y((wde,B1)=>{B1.exports=L1()});var z1=y((Vi,ds)=>{var hV=1/0,pV="[object Symbol]",Au={function:!0,object:!0},mV=Au[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,gV=Au[typeof ds]&&ds&&!ds.nodeType?ds:void 0,yV=_f(mV&&gV&&typeof global=="object"&&global),DV=_f(Au[typeof self]&&self),M1=_f(Au[typeof window]&&window),my=_f(Au[typeof Vi]&&Vi),vV=yV||M1!==(my&&my.window)&&M1||DV||my||Function("return this")();function _f(t){return t&&t.Object===Object?t:null}var bV=Object.prototype,wV=bV.toString,U1=vV.Symbol,V1=U1?U1.prototype:void 0,H1=V1?V1.toString:void 0;function _V(t){if(typeof t=="string")return t;if(CV(t))return H1?H1.call(t):"";var e=t+"";return e=="0"&&1/t==-hV?"-0":e}function EV(t){return!!t&&typeof t=="object"}function CV(t){return typeof t=="symbol"||EV(t)&&wV.call(t)==pV}ds.exports=_V});var Z1=y((Hi,hs)=>{var SV=z1(),xV="Expected a function",W1="__lodash_hash_undefined__",FV="[object Function]",OV="[object GeneratorFunction]",AV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,kV=/[\\^$.*+?()[\]{}|]/g,TV=/\\(\\)?/g,PV=/^\[object .+?Constructor\]$/,Tu={function:!0,object:!0},RV=Tu[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,$V=Tu[typeof hs]&&hs&&!hs.nodeType?hs:void 0,IV=Ef(RV&&$V&&typeof global=="object"&&global),jV=Ef(Tu[typeof self]&&self),G1=Ef(Tu[typeof window]&&window),gy=Ef(Tu[typeof Hi]&&Hi),NV=IV||G1!==(gy&&gy.window)&&G1||jV||gy||Function("return this")();function Ef(t){return t&&t.Object===Object?t:null}function LV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var BV=Array.prototype,K1=Object.prototype,Y1=Function.prototype.toString,yy=K1.hasOwnProperty,qV=K1.toString,MV=RegExp("^"+Y1.call(yy).replace(kV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),UV=BV.splice,VV=J1(NV,"Map"),ku=J1(Object,"create");function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function HV(){this.__data__=ku?ku(null):{}}function zV(t){return this.has(t)&&delete this.__data__[t]}function GV(t){var e=this.__data__;if(ku){var r=e[t];return r===W1?void 0:r}return yy.call(e,t)?e[t]:void 0}function WV(t){var e=this.__data__;return ku?e[t]!==void 0:yy.call(e,t)}function KV(t,e){var r=this.__data__;return r[t]=ku&&e===void 0?W1:e,this}zi.prototype.clear=HV;zi.prototype.delete=zV;zi.prototype.get=GV;zi.prototype.has=WV;zi.prototype.set=KV;function ps(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function YV(){this.__data__=[]}function JV(t){var e=this.__data__,r=Cf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():UV.call(e,r,1),!0}function XV(t){var e=this.__data__,r=Cf(e,t);return r<0?void 0:e[r][1]}function ZV(t){return Cf(this.__data__,t)>-1}function QV(t,e){var r=this.__data__,n=Cf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ps.prototype.clear=YV;ps.prototype.delete=JV;ps.prototype.get=XV;ps.prototype.has=ZV;ps.prototype.set=QV;function Gi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function eH(){this.__data__={hash:new zi,map:new(VV||ps),string:new zi}}function tH(t){return Sf(this,t).delete(t)}function rH(t){return Sf(this,t).get(t)}function nH(t){return Sf(this,t).has(t)}function iH(t,e){return Sf(this,t).set(t,e),this}Gi.prototype.clear=eH;Gi.prototype.delete=tH;Gi.prototype.get=rH;Gi.prototype.has=nH;Gi.prototype.set=iH;function Cf(t,e){for(var r=t.length;r--;)if(uH(t[r][0],e))return r;return-1}function Sf(t,e){var r=t.__data__;return oH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function J1(t,e){var r=t[e];return lH(r)?r:void 0}function oH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var sH=Dy(function(t){var e=[];return fH(t).replace(AV,function(r,n,i,o){e.push(i?o.replace(TV,"$1"):n||r)}),e});function aH(t){if(t!=null){try{return Y1.call(t)}catch{}try{return t+""}catch{}}return""}function Dy(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(xV);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Dy.Cache||Gi),r}Dy.Cache=Gi;function uH(t,e){return t===e||t!==t&&e!==e}function cH(t){var e=X1(t)?qV.call(t):"";return e==FV||e==OV}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function lH(t){if(!X1(t))return!1;var e=cH(t)||LV(t)?MV:PV;return e.test(aH(t))}function fH(t){return t==null?"":SV(t)}hs.exports=sH});var Ox=y((Wi,gs)=>{var dH=Z1(),hH=200,Ay="__lodash_hash_undefined__",kf=1,ys=2,pH=1/0,ix=9007199254740991,xf="[object Arguments]",wy="[object Array]",ox="[object Boolean]",sx="[object Date]",ax="[object Error]",ux="[object Function]",mH="[object GeneratorFunction]",Pu="[object Map]",cx="[object Number]",ms="[object Object]",Q1="[object Promise]",lx="[object RegExp]",Ru="[object Set]",ky="[object String]",fx="[object Symbol]",_y="[object WeakMap]",dx="[object ArrayBuffer]",Ff="[object DataView]",gH="[object Float32Array]",yH="[object Float64Array]",DH="[object Int8Array]",vH="[object Int16Array]",bH="[object Int32Array]",wH="[object Uint8Array]",_H="[object Uint8ClampedArray]",EH="[object Uint16Array]",CH="[object Uint32Array]",SH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xH=/^\w*$/,FH=/[\\^$.*+?()[\]{}|]/g,OH=/^\[object .+?Constructor\]$/,AH=/^(?:0|[1-9]\d*)$/,Pe={};Pe[gH]=Pe[yH]=Pe[DH]=Pe[vH]=Pe[bH]=Pe[wH]=Pe[_H]=Pe[EH]=Pe[CH]=!0;Pe[xf]=Pe[wy]=Pe[dx]=Pe[ox]=Pe[Ff]=Pe[sx]=Pe[ax]=Pe[ux]=Pe[Pu]=Pe[cx]=Pe[ms]=Pe[lx]=Pe[Ru]=Pe[ky]=Pe[_y]=!1;var Iu={function:!0,object:!0},kH=Iu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,TH=Iu[typeof gs]&&gs&&!gs.nodeType?gs:void 0,PH=Tf(kH&&TH&&typeof global=="object"&&global),RH=Tf(Iu[typeof self]&&self),ex=Tf(Iu[typeof window]&&window),vy=Tf(Iu[typeof Wi]&&Wi),Ji=PH||ex!==(vy&&vy.window)&&ex||RH||vy||Function("return this")();function $H(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function IH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function jH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function NH(t,e){return $H(e,function(r){return[r,t[r]]})}function Tf(t){return t&&t.Object===Object?t:null}function Ey(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function hx(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function LH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function BH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var qH=Array.prototype,Pf=Object.prototype,px=Function.prototype.toString,Ki=Pf.hasOwnProperty,Xi=Pf.toString,MH=RegExp("^"+px.call(Ki).replace(FH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=Ji.Symbol,rx=Ji.Uint8Array,UH=Pf.propertyIsEnumerable,VH=qH.splice,HH=Object.getPrototypeOf,zH=Object.keys,Cy=Ds(Ji,"DataView"),Of=Ds(Ji,"Map"),Sy=Ds(Ji,"Promise"),xy=Ds(Ji,"Set"),Fy=Ds(Ji,"WeakMap"),$u=Ds(Object,"create"),GH=Qi(Cy),WH=Qi(Of),KH=Qi(Sy),YH=Qi(xy),JH=Qi(Fy),nx=tx?tx.prototype:void 0,by=nx?nx.valueOf:void 0;function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function XH(){this.__data__=$u?$u(null):{}}function ZH(t){return this.has(t)&&delete this.__data__[t]}function QH(t){var e=this.__data__;if($u){var r=e[t];return r===Ay?void 0:r}return Ki.call(e,t)?e[t]:void 0}function ez(t){var e=this.__data__;return $u?e[t]!==void 0:Ki.call(e,t)}function tz(t,e){var r=this.__data__;return r[t]=$u&&e===void 0?Ay:e,this}Yi.prototype.clear=XH;Yi.prototype.delete=ZH;Yi.prototype.get=QH;Yi.prototype.has=ez;Yi.prototype.set=tz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function rz(){this.__data__=[]}function nz(t){var e=this.__data__,r=Rf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():VH.call(e,r,1),!0}function iz(t){var e=this.__data__,r=Rf(e,t);return r<0?void 0:e[r][1]}function oz(t){return Rf(this.__data__,t)>-1}function sz(t,e){var r=this.__data__,n=Rf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=rz;wn.prototype.delete=nz;wn.prototype.get=iz;wn.prototype.has=oz;wn.prototype.set=sz;function Zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function az(){this.__data__={hash:new Yi,map:new(Of||wn),string:new Yi}}function uz(t){return $f(this,t).delete(t)}function cz(t){return $f(this,t).get(t)}function lz(t){return $f(this,t).has(t)}function fz(t,e){return $f(this,t).set(t,e),this}Zi.prototype.clear=az;Zi.prototype.delete=uz;Zi.prototype.get=cz;Zi.prototype.has=lz;Zi.prototype.set=fz;function Af(t){var e=-1,r=t?t.length:0;for(this.__data__=new Zi;++e<r;)this.add(t[e])}function dz(t){return this.__data__.set(t,Ay),this}function hz(t){return this.__data__.has(t)}Af.prototype.add=Af.prototype.push=dz;Af.prototype.has=hz;function bn(t){this.__data__=new wn(t)}function pz(){this.__data__=new wn}function mz(t){return this.__data__.delete(t)}function gz(t){return this.__data__.get(t)}function yz(t){return this.__data__.has(t)}function Dz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==hH&&(r=this.__data__=new Zi(r.__data__)),r.set(t,e),this}bn.prototype.clear=pz;bn.prototype.delete=mz;bn.prototype.get=gz;bn.prototype.has=yz;bn.prototype.set=Dz;function Rf(t,e){for(var r=t.length;r--;)if(Nz(t[r][0],e))return r;return-1}function mx(t,e){e=If(e,t)?[e]:Dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[jf(e[r++])];return r&&r==n?t:void 0}function gx(t,e){return Ki.call(t,e)||typeof t=="object"&&e in t&&Pz(t)===null}function vz(t,e){return e in Object(t)}function Ty(t,e,r,n,i){return t===e?!0:t==null||e==null||!Lf(t)&&!ju(e)?t!==t&&e!==e:bz(t,e,Ty,r,n,i)}function bz(t,e,r,n,i,o){var s=ri(t),a=ri(e),u=wy,c=wy;s||(u=vn(t),u=u==xf?ms:u),a||(c=vn(e),c=c==xf?ms:c);var l=u==ms&&!Ey(t),f=c==ms&&!Ey(e),h=u==c;if(h&&!l)return o||(o=new bn),s||qz(t)?vx(t,e,r,n,i,o):Oz(t,e,u,r,n,i,o);if(!(i&ys)){var d=l&&Ki.call(t,"__wrapped__"),p=f&&Ki.call(e,"__wrapped__");if(d||p){var b=d?t.value():t,g=p?e.value():e;return o||(o=new bn),r(b,g,n,i,o)}}return h?(o||(o=new bn),Az(t,e,r,n,i,o)):!1}function wz(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Ty(l,c,n,kf|ys,f):h))return!1}}return!0}function _z(t){return typeof t=="function"?t:t==null?Hz:typeof t=="object"?ri(t)?Sz(t[0],t[1]):Cz(t):zz(t)}function Ez(t){return zH(Object(t))}function Cz(t){var e=Tz(t);return e.length==1&&e[0][2]?_x(e[0][0],e[0][1]):function(r){return r===t||wz(r,t,e)}}function Sz(t,e){return If(t)&&wx(e)?_x(jf(t),e):function(r){var n=Mz(r,t);return n===void 0&&n===e?Uz(r,t):Ty(e,n,void 0,kf|ys)}}function yx(t){return function(e){return e?.[t]}}function xz(t){return function(e){return mx(e,t)}}function Dx(t){return ri(t)?t:dH(t)}function Fz(t){return function(e){var r=vn(e);return r==Pu?hx(e):r==Ru?BH(e):NH(e,t(e))}}function vx(t,e,r,n,i,o){var s=i&ys,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&kf?new Af:void 0;for(o.set(t,e);++l<a;){var d=t[l],p=e[l];if(n)var b=s?n(p,d,l,e,t,o):n(d,p,l,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!IH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===p||r(d,p,n,i,o))){f=!1;break}}return o.delete(t),f}function Oz(t,e,r,n,i,o,s){switch(r){case Ff:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dx:return!(t.byteLength!=e.byteLength||!n(new rx(t),new rx(e)));case ox:case sx:return+t==+e;case ax:return t.name==e.name&&t.message==e.message;case cx:return t!=+t?e!=+e:t==+e;case lx:case ky:return t==e+"";case Pu:var a=hx;case Ru:var u=o&ys;if(a||(a=LH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=kf,s.set(t,e),vx(a(t),a(e),n,i,o,s));case fx:if(by)return by.call(t)==by.call(e)}return!1}function Az(t,e,r,n,i,o){var s=i&ys,a=Oy(t),u=a.length,c=Oy(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:gx(e,h)))return!1}var d=o.get(t);if(d)return d==e;var p=!0;o.set(t,e);for(var b=s;++f<u;){h=a[f];var g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){p=!1;break}b||(b=h=="constructor")}if(p&&!b){var D=t.constructor,C=e.constructor;D!=C&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(t),p}var kz=yx("length");function $f(t,e){var r=t.__data__;return Iz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Tz(t){for(var e=Vz(t),r=e.length;r--;)e[r][2]=wx(e[r][1]);return e}function Ds(t,e){var r=t[e];return Bz(r)?r:void 0}function Pz(t){return HH(Object(t))}function vn(t){return Xi.call(t)}(Cy&&vn(new Cy(new ArrayBuffer(1)))!=Ff||Of&&vn(new Of)!=Pu||Sy&&vn(Sy.resolve())!=Q1||xy&&vn(new xy)!=Ru||Fy&&vn(new Fy)!=_y)&&(vn=function(t){var e=Xi.call(t),r=e==ms?t.constructor:void 0,n=r?Qi(r):void 0;if(n)switch(n){case GH:return Ff;case WH:return Pu;case KH:return Q1;case YH:return Ru;case JH:return _y}return e});function Rz(t,e,r){e=If(e,t)?[e]:Dx(e);for(var n,i=-1,s=e.length;++i<s;){var o=jf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&Nf(s)&&bx(o,s)&&(ri(t)||xx(t)||Ex(t))}function $z(t){var e=t?t.length:void 0;return Nf(e)&&(ri(t)||xx(t)||Ex(t))?jH(e,String):null}function bx(t,e){return e=e??ix,!!e&&(typeof t=="number"||AH.test(t))&&t>-1&&t%1==0&&t<e}function If(t,e){if(ri(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Fx(t)?!0:xH.test(t)||!SH.test(t)||e!=null&&t in Object(e)}function Iz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function jz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Pf;return t===r}function wx(t){return t===t&&!Lf(t)}function _x(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function jf(t){if(typeof t=="string"||Fx(t))return t;var e=t+"";return e=="0"&&1/t==-pH?"-0":e}function Qi(t){if(t!=null){try{return px.call(t)}catch{}try{return t+""}catch{}}return""}function Nz(t,e){return t===e||t!==t&&e!==e}function Ex(t){return Lz(t)&&Ki.call(t,"callee")&&(!UH.call(t,"callee")||Xi.call(t)==xf)}var ri=Array.isArray;function Cx(t){return t!=null&&Nf(kz(t))&&!Sx(t)}function Lz(t){return ju(t)&&Cx(t)}function Sx(t){var e=Lf(t)?Xi.call(t):"";return e==ux||e==mH}function Nf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ix}function Lf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function ju(t){return!!t&&typeof t=="object"}function Bz(t){if(!Lf(t))return!1;var e=Sx(t)||Ey(t)?MH:OH;return e.test(Qi(t))}function xx(t){return typeof t=="string"||!ri(t)&&ju(t)&&Xi.call(t)==ky}function Fx(t){return typeof t=="symbol"||ju(t)&&Xi.call(t)==fx}function qz(t){return ju(t)&&Nf(t.length)&&!!Pe[Xi.call(t)]}function Mz(t,e,r){var n=t==null?void 0:mx(t,e);return n===void 0?r:n}function Uz(t,e){return t!=null&&Rz(t,e,vz)}function Oy(t){var e=jz(t);if(!(e||Cx(t)))return Ez(t);var r=$z(t),n=!!r,i=r||[],o=i.length;for(var s in t)gx(t,s)&&!(n&&(s=="length"||bx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var Vz=Fz(Oy);function Hz(t){return t}function zz(t){return If(t)?yx(jf(t)):xz(t)}gs.exports=_z});var Rx=y((eo,vs)=>{var Gz=1/0,Wz="[object Function]",Kz="[object GeneratorFunction]",Yz=/[\\^$.*+?()[\]{}|]/g,Jz=/^\[object .+?Constructor\]$/,Nu={function:!0,object:!0},Xz=Nu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,Zz=Nu[typeof vs]&&vs&&!vs.nodeType?vs:void 0,Qz=Bf(Xz&&Zz&&typeof global=="object"&&global),eG=Bf(Nu[typeof self]&&self),Ax=Bf(Nu[typeof window]&&window),Py=Bf(Nu[typeof eo]&&eo),tG=Qz||Ax!==(Py&&Py.window)&&Ax||eG||Py||Function("return this")();function Bf(t){return t&&t.Object===Object?t:null}function rG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function nG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var kx=Object.prototype,Tx=Function.prototype.toString,iG=kx.hasOwnProperty,oG=kx.toString,sG=RegExp("^"+Tx.call(iG).replace(Yz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ry=uG(tG,"Set"),aG=Ry&&1/nG(new Ry([,-0]))[1]==Gz?function(t){return new Ry(t)}:dG;function uG(t,e){var r=t[e];return fG(r)?r:void 0}function cG(t){if(t!=null){try{return Tx.call(t)}catch{}try{return t+""}catch{}}return""}function lG(t){var e=Px(t)?oG.call(t):"";return e==Wz||e==Kz}function Px(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function fG(t){if(!Px(t))return!1;var e=lG(t)||rG(t)?sG:Jz;return e.test(cG(t))}function dG(){}vs.exports=aG});var Ix=y((to,bs)=>{var Lu={function:!0,object:!0},hG=Lu[typeof to]&&to&&!to.nodeType?to:void 0,pG=Lu[typeof bs]&&bs&&!bs.nodeType?bs:void 0,mG=qf(hG&&pG&&typeof global=="object"&&global),gG=qf(Lu[typeof self]&&self),$x=qf(Lu[typeof window]&&window),$y=qf(Lu[typeof to]&&to),yG=mG||$x!==($y&&$y.window)&&$x||gG||$y||Function("return this")();function qf(t){return t&&t.Object===Object?t:null}bs.exports=yG});var Mx=y((_de,qx)=>{var DG=Rx(),vG=Ix(),bG=200,Iy="__lodash_hash_undefined__",wG="[object Function]",_G="[object GeneratorFunction]",EG=/[\\^$.*+?()[\]{}|]/g,CG=/^\[object .+?Constructor\]$/;function SG(t,e){return!!t.length&&FG(t,e,0)>-1}function xG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function FG(t,e,r){if(e!==e)return AG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function OG(t,e){return t.has(e)}function AG(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var o=t[i];if(o!==o)return i}return-1}function kG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function TG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var PG=Array.prototype,jx=Object.prototype,Nx=Function.prototype.toString,jy=jx.hasOwnProperty,RG=jx.toString,$G=RegExp("^"+Nx.call(jy).replace(EG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),IG=PG.splice,jG=Lx(vG,"Map"),Bu=Lx(Object,"create");function ro(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function NG(){this.__data__=Bu?Bu(null):{}}function LG(t){return this.has(t)&&delete this.__data__[t]}function BG(t){var e=this.__data__;if(Bu){var r=e[t];return r===Iy?void 0:r}return jy.call(e,t)?e[t]:void 0}function qG(t){var e=this.__data__;return Bu?e[t]!==void 0:jy.call(e,t)}function MG(t,e){var r=this.__data__;return r[t]=Bu&&e===void 0?Iy:e,this}ro.prototype.clear=NG;ro.prototype.delete=LG;ro.prototype.get=BG;ro.prototype.has=qG;ro.prototype.set=MG;function ws(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function UG(){this.__data__=[]}function VG(t){var e=this.__data__,r=Uf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():IG.call(e,r,1),!0}function HG(t){var e=this.__data__,r=Uf(e,t);return r<0?void 0:e[r][1]}function zG(t){return Uf(this.__data__,t)>-1}function GG(t,e){var r=this.__data__,n=Uf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ws.prototype.clear=UG;ws.prototype.delete=VG;ws.prototype.get=HG;ws.prototype.has=zG;ws.prototype.set=GG;function _s(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function WG(){this.__data__={hash:new ro,map:new(jG||ws),string:new ro}}function KG(t){return Vf(this,t).delete(t)}function YG(t){return Vf(this,t).get(t)}function JG(t){return Vf(this,t).has(t)}function XG(t,e){return Vf(this,t).set(t,e),this}_s.prototype.clear=WG;_s.prototype.delete=KG;_s.prototype.get=YG;_s.prototype.has=JG;_s.prototype.set=XG;function Mf(t){var e=-1,r=t?t.length:0;for(this.__data__=new _s;++e<r;)this.add(t[e])}function ZG(t){return this.__data__.set(t,Iy),this}function QG(t){return this.__data__.has(t)}Mf.prototype.add=Mf.prototype.push=ZG;Mf.prototype.has=QG;function Uf(t,e){for(var r=t.length;r--;)if(nW(t[r][0],e))return r;return-1}function eW(t,e,r){var n=-1,i=SG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=xG;else if(o>=bG){var c=e?null:DG(t);if(c)return TG(c);s=!1,i=OG,u=new Mf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function Vf(t,e){var r=t.__data__;return tW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Lx(t,e){var r=t[e];return oW(r)?r:void 0}function tW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function rW(t){if(t!=null){try{return Nx.call(t)}catch{}try{return t+""}catch{}}return""}function nW(t,e){return t===e||t!==t&&e!==e}function iW(t){var e=Bx(t)?RG.call(t):"";return e==wG||e==_G}function Bx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function oW(t){if(!Bx(t))return!1;var e=iW(t)||kG(t)?$G:CG;return e.test(rW(t))}qx.exports=eW});var Vx=y((Ede,Ux)=>{var sW=Ox(),aW=Mx();function uW(t,e){return t&&t.length?aW(t,sW(e)):[]}Ux.exports=uW});var zx=y((Cde,Hx)=>{"use strict";var cW=q1(),lW=Vx(),fW=cW("MultiError");Hx.exports=Ny;function Ny(t){if(!(this instanceof Ny))return new Ny(t);if(t=Array.isArray(t)?t:[t],t=lW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new fW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
36
36
 
37
37
  `)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
38
38
 
39
- `)}),e}});var Wx=y((Sde,Gx)=>{var ni=require("constants"),hW=process.cwd,Hf=null,pW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Hf||(Hf=hW.call(process)),Hf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ly=process.chdir,process.chdir=function(t){Hf=null,Ly.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ly));var Ly;Gx.exports=mW;function mW(t){ni.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),pW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,A,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,b){for(var g=0;;)try{return l.call(t,f,h,d,p,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ni.O_WRONLY|ni.O_SYMLINK,h,function(p,b){if(p){d&&d(p);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ni.O_WRONLY|ni.O_SYMLINK,h),p=!0,b;try{b=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){ni.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,ni.O_SYMLINK,function(b,g){if(b){p&&p(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,ni.O_SYMLINK),b,g=!0;try{b=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return b}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(b){c(b)&&(b=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Jx=y((xde,Yx)=>{var Kx=require("stream").Stream;Yx.exports=gW;function gW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Kx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Kx.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Zx=y((Fde,Xx)=>{"use strict";Xx.exports=DW;var yW=Object.getPrototypeOf||function(t){return t.__proto__};function DW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:yW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var ht=y((Ode,My)=>{var He=require("fs"),vW=Wx(),bW=Jx(),wW=Zx(),zf=require("util"),wt,Wf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Wf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Wf="___graceful-fs.previous");function _W(){}function tF(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var no=_W;zf.debuglog?no=zf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(no=function(){var t=zf.format.apply(zf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
- GFS4: `),console.error(t)});He[wt]||(Qx=global[wt]||[],tF(He,Qx),He.close=function(t){function e(r,n){return t.call(He,r,function(i){i||eF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Wf,{value:t}),e}(He.close),He.closeSync=function(t){function e(r){t.apply(He,arguments),eF()}return Object.defineProperty(e,Wf,{value:t}),e}(He.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){no(He[wt]),require("assert").equal(He[wt].length,0)}));var Qx;global[wt]||tF(global,He[wt]);My.exports=By(wW(He));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!He.__patched&&(My.exports=By(He),He.__patched=!0);function By(t){vW(t),t.gracefulify=By,t.createReadStream=A,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?Es([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Es([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=bW(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function A(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function Es(t){no("ENQUEUE",t[0].name,t[1]),He[wt].push(t),qy()}var Gf;function eF(){for(var t=Date.now(),e=0;e<He[wt].length;++e)He[wt][e].length>2&&(He[wt][e][3]=t,He[wt][e][4]=t);qy()}function qy(){if(clearTimeout(Gf),Gf=void 0,He[wt].length!==0){var t=He[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)no("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){no("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(no("RETRY",e.name,r),e.apply(null,r.concat([i]))):He[wt].push(t)}Gf===void 0&&(Gf=setTimeout(qy,0))}}});var nF=y((Ade,rF)=>{function yr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rF.exports=yr;yr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};yr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};yr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};yr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};yr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};yr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};yr.prototype.start=yr.prototype.try;yr.prototype.errors=function(){return this._errors};yr.prototype.attempts=function(){return this._attempts};yr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var iF=y(io=>{var EW=nF();io.operation=function(t){var e=io.timeouts(t);return new EW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};io.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};io.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};io.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=io.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var sF=y((Tde,oF)=>{oF.exports=iF()});var aF=y((Pde,Kf)=>{Kf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Kf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Kf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Hy=y((Rde,xs)=>{var Be=global.process,oo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};oo(Be)?(uF=require("assert"),Cs=aF(),cF=/^win/i.test(Be.platform),qu=require("events"),typeof qu!="function"&&(qu=qu.EventEmitter),Be.__signal_exit_emitter__?pt=Be.__signal_exit_emitter__:(pt=Be.__signal_exit_emitter__=new qu,pt.count=0,pt.emitted={}),pt.infinite||(pt.setMaxListeners(1/0),pt.infinite=!0),xs.exports=function(t,e){if(!oo(global.process))return function(){};uF.equal(typeof t,"function","a callback must be provided for exit handler"),Ss===!1&&Uy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){pt.removeListener(r,t),pt.listeners("exit").length===0&&pt.listeners("afterexit").length===0&&Yf()};return pt.on(r,t),n},Yf=function(){!Ss||!oo(global.process)||(Ss=!1,Cs.forEach(function(e){try{Be.removeListener(e,Jf[e])}catch{}}),Be.emit=Xf,Be.reallyExit=Vy,pt.count-=1)},xs.exports.unload=Yf,so=function(e,r,n){pt.emitted[e]||(pt.emitted[e]=!0,pt.emit(e,r,n))},Jf={},Cs.forEach(function(t){Jf[t]=function(){if(oo(global.process)){var r=Be.listeners(t);r.length===pt.count&&(Yf(),so("exit",null,t),so("afterexit",null,t),cF&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),xs.exports.signals=function(){return Cs},Ss=!1,Uy=function(){Ss||!oo(global.process)||(Ss=!0,pt.count+=1,Cs=Cs.filter(function(e){try{return Be.on(e,Jf[e]),!0}catch{return!1}}),Be.emit=fF,Be.reallyExit=lF)},xs.exports.load=Uy,Vy=Be.reallyExit,lF=function(e){oo(global.process)&&(Be.exitCode=e||0,so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),Vy.call(Be,Be.exitCode))},Xf=Be.emit,fF=function(e,r){if(e==="exit"&&oo(global.process)){r!==void 0&&(Be.exitCode=r);var n=Xf.apply(this,arguments);return so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),n}else return Xf.apply(this,arguments)}):xs.exports=function(){return function(){}};var uF,Cs,cF,qu,pt,Yf,so,Jf,Ss,Uy,Vy,lF,Xf,fF});var hF=y(($de,zy)=>{"use strict";var dF=Symbol();function CW(t,e,r){let n=e[dF];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,dF,{value:u}),r(null,a.mtime,u)})})}function SW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}zy.exports.probe=CW;zy.exports.getMtime=SW});var DF=y((Ide,Uu)=>{"use strict";var xW=require("path"),Ky=ht(),FW=sF(),OW=Hy(),pF=hF(),_n={};function Mu(t,e){return e.lockfilePath||`${t}.lock`}function Yy(t,e,r){if(!e.realpath)return r(null,xW.resolve(t));e.fs.realpath(t,r)}function Wy(t,e,r){let n=Mu(t,e);e.fs.mkdir(n,i=>{if(!i)return pF.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Wy(t,{...e,stale:0},r):r(o);if(!mF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));gF(t,e,a=>{if(a)return r(a);Wy(t,{...e,stale:0},r)})})})}function mF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function gF(t,e,r){e.fs.rmdir(Mu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Zf(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Gy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Zf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Gy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=pF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Gy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Zf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Zf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Gy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function AW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Ky,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),Yy(t,e,(n,i)=>{if(n)return r(n);let o=FW.operation(e.retries);o.attempt(()=>{Wy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Mu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Zf(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));yF(i,{...e,realpath:!1},l)})})})})}function yF(t,e,r){e={fs:Ky,realpath:!0,...e},Yy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],gF(i,e,r)})}function kW(t,e,r){e={stale:1e4,realpath:!0,fs:Ky,...e},e.stale=Math.max(e.stale||0,2e3),Yy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Mu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!mF(s,e)))})}function TW(){return _n}OW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Mu(t,e))}catch{}}});Uu.exports.lock=AW;Uu.exports.unlock=yF;Uu.exports.check=kW;Uu.exports.getLocks=TW});var bF=y((jde,vF)=>{"use strict";var PW=ht();function RW(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let o=i.pop(),s;try{s=t[`${n}Sync`](...i)}catch(a){return o(a)}o(null,s)}}),r}function $W(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function IW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function jW(t){if(t={...t},t.fs=RW(t.fs||PW),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}vF.exports={toPromise:$W,toSync:IW,toSyncOptions:jW}});var _F=y((Nde,ii)=>{"use strict";var Fs=DF(),{toPromise:Qf,toSync:ed,toSyncOptions:Jy}=bF();async function wF(t,e){let r=await Qf(Fs.lock)(t,e);return Qf(r)}function NW(t,e){let r=ed(Fs.lock)(t,Jy(e));return ed(r)}function LW(t,e){return Qf(Fs.unlock)(t,e)}function BW(t,e){return ed(Fs.unlock)(t,Jy(e))}function qW(t,e){return Qf(Fs.check)(t,e)}function MW(t,e){return ed(Fs.check)(t,Jy(e))}ii.exports=wF;ii.exports.lock=wF;ii.exports.unlock=LW;ii.exports.lockSync=NW;ii.exports.unlockSync=BW;ii.exports.check=qW;ii.exports.checkSync=MW});var FF=y(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.canStoreURLs=Os.FileUrlStorage=void 0;var EF=require("fs"),UW=HW(zx()),CF=VW(_F());function xF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(xF=function(n){return n?r:e})(t)}function VW(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=xF(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function HW(t){return t&&t.__esModule?t:{default:t}}function Vu(t){"@babel/helpers - typeof";return Vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vu(t)}function zW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function SF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,WW(n.key),n)}}function GW(t,e,r){return e&&SF(t.prototype,e),r&&SF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function WW(t){var e=KW(t,"string");return Vu(e)=="symbol"?e:e+""}function KW(t,e){if(Vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Lde=Os.canStoreURLs=!0,Bde=Os.FileUrlStorage=function(){function t(e){zW(this,t),this.path=e}return GW(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;CF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;CF.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,UW.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,EF.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,EF.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var Qy=y(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Object.defineProperty(Gt,"DefaultHttpStack",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(Gt,"DetailedError",{enumerable:!0,get:function(){return YW.default}});Object.defineProperty(Gt,"FileUrlStorage",{enumerable:!0,get:function(){return PF.FileUrlStorage}});Object.defineProperty(Gt,"StreamSource",{enumerable:!0,get:function(){return eK.default}});Gt.Upload=void 0;Object.defineProperty(Gt,"canStoreURLs",{enumerable:!0,get:function(){return PF.canStoreURLs}});Gt.defaultOptions=void 0;Object.defineProperty(Gt,"enableDebugLog",{enumerable:!0,get:function(){return JW.enableDebugLog}});Gt.isSupported=void 0;var YW=ao(zg()),JW=Gg(),XW=ao(FS()),Xy=ao(n1()),ZW=ao(g1()),QW=ao(b1()),TF=ao($1()),eK=ao(ay()),PF=FF();function ao(t){return t&&t.__esModule?t:{default:t}}function ks(t){"@babel/helpers - typeof";return ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ks(t)}function tK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$F(n.key),n)}}function rK(t,e,r){return e&&OF(t.prototype,e),r&&OF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nK(t,e,r){return e=td(e),iK(t,RF()?Reflect.construct(e,r||[],td(t).constructor):e.apply(t,r))}function iK(t,e){if(e&&(ks(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oK(t)}function oK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function RF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RF=function(){return!!t})()}function td(t){return td=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},td(t)}function sK(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zy(t,e)}function Zy(t,e){return Zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zy(t,e)}function AF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function As(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AF(Object(r),!0).forEach(function(n){aK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aK(t,e,r){return e=$F(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $F(t){var e=uK(t,"string");return ks(e)=="symbol"?e:e+""}function uK(t,e){if(ks(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kF=Gt.defaultOptions=As(As({},Xy.default.defaultOptions),{},{httpStack:new TF.default,fileReader:new ZW.default,urlStorage:new XW.default,fingerprint:QW.default}),Mde=Gt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return tK(this,e),n=As(As({},kF),n),nK(this,e,[r,n])}return sK(e,t),rK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=As(As({},kF),i),Xy.default.terminate(n,i)}}])}(Xy.default),Ude=Gt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>t2,__assign:()=>rd,__asyncDelegator:()=>WF,__asyncGenerator:()=>GF,__asyncValues:()=>KF,__await:()=>Ts,__awaiter:()=>qF,__classPrivateFieldGet:()=>ZF,__classPrivateFieldIn:()=>e2,__classPrivateFieldSet:()=>QF,__createBinding:()=>id,__decorate:()=>NF,__disposeResources:()=>r2,__esDecorate:()=>cK,__exportStar:()=>UF,__extends:()=>IF,__generator:()=>MF,__importDefault:()=>XF,__importStar:()=>JF,__makeTemplateObject:()=>YF,__metadata:()=>BF,__param:()=>LF,__propKey:()=>fK,__read:()=>tD,__rest:()=>jF,__runInitializers:()=>lK,__setFunctionName:()=>dK,__spread:()=>VF,__spreadArray:()=>zF,__spreadArrays:()=>HF,__values:()=>nd,default:()=>mK});function IF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");eD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function jF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function NF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function LF(t,e){return function(r,n){e(r,n,t)}}function cK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var b in n)p[b]=b==="access"?{}:n[b];for(var b in n.access)p.access[b]=n.access[b];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function lK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function fK(t){return typeof t=="symbol"?t:"".concat(t)}function dK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function BF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function qF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function MF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function UF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&id(e,t,r)}function nd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function tD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function VF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(tD(arguments[e]));return t}function HF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function zF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Ts(t){return this instanceof Ts?(this.v=t,this):new Ts(t)}function GF(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){n[d]&&(i[d]=function(b){return new Promise(function(g,w){o.push([d,b,g,w])>1||u(d,b)})},p&&(i[d]=p(i[d])))}function u(d,p){try{c(n[d](p))}catch(b){h(o[0][3],b)}}function c(d){d.value instanceof Ts?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,p){d(p),o.shift(),o.length&&u(o[0][0],o[0][1])}}function WF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ts(t[i](s)),done:!1}:o?o(s):s}:o}}function KF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof nd=="function"?nd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function YF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function JF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&id(e,t,r);return hK(e,t),e}function XF(t){return t&&t.__esModule?t:{default:t}}function ZF(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function QF(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function e2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function t2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function r2(t){function e(o){t.error=t.hasError?new pK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var eD,rd,id,hK,pK,mK,Cn=ct(()=>{eD=function(t,e){return eD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},eD(t,e)};rd=function(){return rd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},rd.apply(this,arguments)};id=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};hK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};pK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};mK={__extends:IF,__assign:rd,__rest:jF,__decorate:NF,__param:LF,__metadata:BF,__awaiter:qF,__generator:MF,__createBinding:id,__exportStar:UF,__values:nd,__read:tD,__spread:VF,__spreadArrays:HF,__spreadArray:zF,__await:Ts,__asyncGenerator:GF,__asyncDelegator:WF,__asyncValues:KF,__makeTemplateObject:YF,__importStar:JF,__importDefault:XF,__classPrivateFieldGet:ZF,__classPrivateFieldSet:QF,__classPrivateFieldIn:e2,__addDisposableResource:t2,__disposeResources:r2}});var S2={};mn(S2,{__addDisposableResource:()=>E2,__assign:()=>od,__asyncDelegator:()=>m2,__asyncGenerator:()=>p2,__asyncValues:()=>g2,__await:()=>Ps,__awaiter:()=>u2,__classPrivateFieldGet:()=>b2,__classPrivateFieldIn:()=>_2,__classPrivateFieldSet:()=>w2,__createBinding:()=>ad,__decorate:()=>o2,__disposeResources:()=>C2,__esDecorate:()=>gK,__exportStar:()=>l2,__extends:()=>n2,__generator:()=>c2,__importDefault:()=>v2,__importStar:()=>D2,__makeTemplateObject:()=>y2,__metadata:()=>a2,__param:()=>s2,__propKey:()=>DK,__read:()=>nD,__rest:()=>i2,__runInitializers:()=>yK,__setFunctionName:()=>vK,__spread:()=>f2,__spreadArray:()=>h2,__spreadArrays:()=>d2,__values:()=>sd,default:()=>_K});function n2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function i2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function o2(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function s2(t,e){return function(r,n){e(r,n,t)}}function gK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var b in n)p[b]=b==="access"?{}:n[b];for(var b in n.access)p.access[b]=n.access[b];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function yK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function DK(t){return typeof t=="symbol"?t:"".concat(t)}function vK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function a2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function u2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function c2(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function l2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ad(e,t,r)}function sd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function nD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function f2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(nD(arguments[e]));return t}function d2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function h2(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Ps(t){return this instanceof Ps?(this.v=t,this):new Ps(t)}function p2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,b){o.push([h,d,p,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Ps?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function m2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ps(t[i](s)),done:!1}:o?o(s):s}:o}}function g2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof sd=="function"?sd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function y2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function D2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ad(e,t,r);return bK(e,t),e}function v2(t){return t&&t.__esModule?t:{default:t}}function b2(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function w2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function _2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function E2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function C2(t){function e(n){t.error=t.hasError?new wK(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var rD,od,ad,bK,wK,_K,x2=ct(()=>{rD=function(t,e){return rD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},rD(t,e)};od=function(){return od=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},od.apply(this,arguments)};ad=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};bK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};wK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};_K={__extends:n2,__assign:od,__rest:i2,__decorate:o2,__param:s2,__metadata:a2,__awaiter:u2,__generator:c2,__createBinding:ad,__exportStar:l2,__values:sd,__read:nD,__spread:f2,__spreadArrays:d2,__spreadArray:h2,__await:Ps,__asyncGenerator:p2,__asyncDelegator:m2,__asyncValues:g2,__makeTemplateObject:y2,__importStar:D2,__importDefault:v2,__classPrivateFieldGet:b2,__classPrivateFieldSet:w2,__classPrivateFieldIn:_2,__addDisposableResource:E2,__disposeResources:C2}});var Wt=y(iD=>{"use strict";iD.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,o)=>i!=null?n(i):r(o)),t.apply(this,e)})},"name",{value:t.name})};iD.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Hu=y(oi=>{"use strict";var F2=Wt().fromCallback,Pt=ht(),EK=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(oi[t]=Pt[t])});EK.forEach(t=>{oi[t]=F2(Pt[t])});oi.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};oi.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};oi.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(oi.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(oi.realpath.native=F2(Pt.realpath.native))});var oD=y((Gde,O2)=>{O2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var R2=y((Wde,sD)=>{"use strict";var Rs=Hu(),Sn=require("path"),CK=oD(),A2=CK("10.12.0"),k2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},T2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},P2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};sD.exports.makeDir=async(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Rs.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await Rs.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await Rs.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};sD.exports.makeDirSync=(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Rs.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{Rs.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!Rs.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=y((Kde,$2)=>{"use strict";var SK=Wt().fromPromise,{makeDir:xK,makeDirSync:aD}=R2(),uD=SK(xK);$2.exports={mkdirs:uD,mkdirsSync:aD,mkdirp:uD,mkdirpSync:aD,ensureDir:uD,ensureDirSync:aD}});var cD=y((Yde,I2)=>{"use strict";var $s=ht();function FK(t,e,r,n){$s.open(t,"r+",(i,o)=>{if(i)return n(i);$s.futimes(o,e,r,s=>{$s.close(o,a=>{n&&n(s||a)})})})}function OK(t,e,r){let n=$s.openSync(t,"r+");return $s.futimesSync(n,e,r),$s.closeSync(n)}I2.exports={utimesMillis:FK,utimesMillisSync:OK}});var zu=y((Jde,B2)=>{"use strict";var Is=Hu(),Kt=require("path"),AK=require("util"),kK=oD(),ud=kK("10.5.0"),j2=t=>ud?Is.stat(t,{bigint:!0}):Is.stat(t),lD=t=>ud?Is.statSync(t,{bigint:!0}):Is.statSync(t);function TK(t,e){return Promise.all([j2(t),j2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function PK(t,e){let r,n=lD(t);try{r=lD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function RK(t,e,r,n){AK.callbackify(TK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&cd(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&fD(t,e)?n(new Error(ld(t,e,r))):n(null,{srcStat:s,destStat:a})})}function $K(t,e,r){let{srcStat:n,destStat:i}=PK(t,e);if(i&&cd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&fD(t,e))throw new Error(ld(t,e,r));return{srcStat:n,destStat:i}}function N2(t,e,r,n,i){let o=Kt.resolve(Kt.dirname(t)),s=Kt.resolve(Kt.dirname(r));if(s===o||s===Kt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):cd(e,c)?i(new Error(ld(t,r,n))):N2(t,e,s,n,i);ud?Is.stat(s,{bigint:!0},a):Is.stat(s,a)}function L2(t,e,r,n){let i=Kt.resolve(Kt.dirname(t)),o=Kt.resolve(Kt.dirname(r));if(o===i||o===Kt.parse(o).root)return;let s;try{s=lD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(cd(e,s))throw new Error(ld(t,r,n));return L2(t,e,o,n)}function cd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(ud||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function fD(t,e){let r=Kt.resolve(t).split(Kt.sep).filter(i=>i),n=Kt.resolve(e).split(Kt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function ld(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}B2.exports={checkPaths:RK,checkPathsSync:$K,checkParentPaths:N2,checkParentPathsSync:L2,isSrcSubdir:fD}});var H2=y((Xde,V2)=>{"use strict";var Ct=ht(),Gu=require("path"),IK=kr().mkdirsSync,jK=cD().utimesMillisSync,Wu=zu();function NK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
39
+ `)}),e}});var Wx=y((Sde,Gx)=>{var ni=require("constants"),dW=process.cwd,Hf=null,hW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Hf||(Hf=dW.call(process)),Hf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ly=process.chdir,process.chdir=function(t){Hf=null,Ly.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ly));var Ly;Gx.exports=pW;function pW(t){ni.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),hW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,A,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,b){for(var g=0;;)try{return l.call(t,f,h,d,p,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ni.O_WRONLY|ni.O_SYMLINK,h,function(p,b){if(p){d&&d(p);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ni.O_WRONLY|ni.O_SYMLINK,h),p=!0,b;try{b=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){ni.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,ni.O_SYMLINK,function(b,g){if(b){p&&p(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,ni.O_SYMLINK),b,g=!0;try{b=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return b}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(b){c(b)&&(b=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Jx=y((xde,Yx)=>{var Kx=require("stream").Stream;Yx.exports=mW;function mW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Kx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Kx.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Zx=y((Fde,Xx)=>{"use strict";Xx.exports=yW;var gW=Object.getPrototypeOf||function(t){return t.__proto__};function yW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:gW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var ht=y((Ode,My)=>{var He=require("fs"),DW=Wx(),vW=Jx(),bW=Zx(),zf=require("util"),wt,Wf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Wf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Wf="___graceful-fs.previous");function wW(){}function tF(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var no=wW;zf.debuglog?no=zf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(no=function(){var t=zf.format.apply(zf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
+ GFS4: `),console.error(t)});He[wt]||(Qx=global[wt]||[],tF(He,Qx),He.close=function(t){function e(r,n){return t.call(He,r,function(i){i||eF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Wf,{value:t}),e}(He.close),He.closeSync=function(t){function e(r){t.apply(He,arguments),eF()}return Object.defineProperty(e,Wf,{value:t}),e}(He.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){no(He[wt]),require("assert").equal(He[wt].length,0)}));var Qx;global[wt]||tF(global,He[wt]);My.exports=By(bW(He));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!He.__patched&&(My.exports=By(He),He.__patched=!0);function By(t){DW(t),t.gracefulify=By,t.createReadStream=A,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?Es([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Es([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=vW(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function A(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Es([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function Es(t){no("ENQUEUE",t[0].name,t[1]),He[wt].push(t),qy()}var Gf;function eF(){for(var t=Date.now(),e=0;e<He[wt].length;++e)He[wt][e].length>2&&(He[wt][e][3]=t,He[wt][e][4]=t);qy()}function qy(){if(clearTimeout(Gf),Gf=void 0,He[wt].length!==0){var t=He[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)no("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){no("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(no("RETRY",e.name,r),e.apply(null,r.concat([i]))):He[wt].push(t)}Gf===void 0&&(Gf=setTimeout(qy,0))}}});var nF=y((Ade,rF)=>{function Dr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rF.exports=Dr;Dr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Dr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Dr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Dr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Dr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Dr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Dr.prototype.start=Dr.prototype.try;Dr.prototype.errors=function(){return this._errors};Dr.prototype.attempts=function(){return this._attempts};Dr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var iF=y(io=>{var _W=nF();io.operation=function(t){var e=io.timeouts(t);return new _W(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};io.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};io.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};io.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=io.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var sF=y((Tde,oF)=>{oF.exports=iF()});var aF=y((Pde,Kf)=>{Kf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Kf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Kf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Hy=y((Rde,xs)=>{var Be=global.process,oo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};oo(Be)?(uF=require("assert"),Cs=aF(),cF=/^win/i.test(Be.platform),qu=require("events"),typeof qu!="function"&&(qu=qu.EventEmitter),Be.__signal_exit_emitter__?pt=Be.__signal_exit_emitter__:(pt=Be.__signal_exit_emitter__=new qu,pt.count=0,pt.emitted={}),pt.infinite||(pt.setMaxListeners(1/0),pt.infinite=!0),xs.exports=function(t,e){if(!oo(global.process))return function(){};uF.equal(typeof t,"function","a callback must be provided for exit handler"),Ss===!1&&Uy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){pt.removeListener(r,t),pt.listeners("exit").length===0&&pt.listeners("afterexit").length===0&&Yf()};return pt.on(r,t),n},Yf=function(){!Ss||!oo(global.process)||(Ss=!1,Cs.forEach(function(e){try{Be.removeListener(e,Jf[e])}catch{}}),Be.emit=Xf,Be.reallyExit=Vy,pt.count-=1)},xs.exports.unload=Yf,so=function(e,r,n){pt.emitted[e]||(pt.emitted[e]=!0,pt.emit(e,r,n))},Jf={},Cs.forEach(function(t){Jf[t]=function(){if(oo(global.process)){var r=Be.listeners(t);r.length===pt.count&&(Yf(),so("exit",null,t),so("afterexit",null,t),cF&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),xs.exports.signals=function(){return Cs},Ss=!1,Uy=function(){Ss||!oo(global.process)||(Ss=!0,pt.count+=1,Cs=Cs.filter(function(e){try{return Be.on(e,Jf[e]),!0}catch{return!1}}),Be.emit=fF,Be.reallyExit=lF)},xs.exports.load=Uy,Vy=Be.reallyExit,lF=function(e){oo(global.process)&&(Be.exitCode=e||0,so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),Vy.call(Be,Be.exitCode))},Xf=Be.emit,fF=function(e,r){if(e==="exit"&&oo(global.process)){r!==void 0&&(Be.exitCode=r);var n=Xf.apply(this,arguments);return so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),n}else return Xf.apply(this,arguments)}):xs.exports=function(){return function(){}};var uF,Cs,cF,qu,pt,Yf,so,Jf,Ss,Uy,Vy,lF,Xf,fF});var hF=y(($de,zy)=>{"use strict";var dF=Symbol();function EW(t,e,r){let n=e[dF];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,dF,{value:u}),r(null,a.mtime,u)})})}function CW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}zy.exports.probe=EW;zy.exports.getMtime=CW});var DF=y((Ide,Uu)=>{"use strict";var SW=require("path"),Ky=ht(),xW=sF(),FW=Hy(),pF=hF(),_n={};function Mu(t,e){return e.lockfilePath||`${t}.lock`}function Yy(t,e,r){if(!e.realpath)return r(null,SW.resolve(t));e.fs.realpath(t,r)}function Wy(t,e,r){let n=Mu(t,e);e.fs.mkdir(n,i=>{if(!i)return pF.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Wy(t,{...e,stale:0},r):r(o);if(!mF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));gF(t,e,a=>{if(a)return r(a);Wy(t,{...e,stale:0},r)})})})}function mF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function gF(t,e,r){e.fs.rmdir(Mu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Zf(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Gy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Zf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Gy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=pF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Gy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Zf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Zf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Gy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function OW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Ky,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),Yy(t,e,(n,i)=>{if(n)return r(n);let o=xW.operation(e.retries);o.attempt(()=>{Wy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Mu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Zf(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));yF(i,{...e,realpath:!1},l)})})})})}function yF(t,e,r){e={fs:Ky,realpath:!0,...e},Yy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],gF(i,e,r)})}function AW(t,e,r){e={stale:1e4,realpath:!0,fs:Ky,...e},e.stale=Math.max(e.stale||0,2e3),Yy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Mu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!mF(s,e)))})}function kW(){return _n}FW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Mu(t,e))}catch{}}});Uu.exports.lock=OW;Uu.exports.unlock=yF;Uu.exports.check=AW;Uu.exports.getLocks=kW});var bF=y((jde,vF)=>{"use strict";var TW=ht();function PW(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let o=i.pop(),s;try{s=t[`${n}Sync`](...i)}catch(a){return o(a)}o(null,s)}}),r}function RW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function $W(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function IW(t){if(t={...t},t.fs=PW(t.fs||TW),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}vF.exports={toPromise:RW,toSync:$W,toSyncOptions:IW}});var _F=y((Nde,ii)=>{"use strict";var Fs=DF(),{toPromise:Qf,toSync:ed,toSyncOptions:Jy}=bF();async function wF(t,e){let r=await Qf(Fs.lock)(t,e);return Qf(r)}function jW(t,e){let r=ed(Fs.lock)(t,Jy(e));return ed(r)}function NW(t,e){return Qf(Fs.unlock)(t,e)}function LW(t,e){return ed(Fs.unlock)(t,Jy(e))}function BW(t,e){return Qf(Fs.check)(t,e)}function qW(t,e){return ed(Fs.check)(t,Jy(e))}ii.exports=wF;ii.exports.lock=wF;ii.exports.unlock=NW;ii.exports.lockSync=jW;ii.exports.unlockSync=LW;ii.exports.check=BW;ii.exports.checkSync=qW});var FF=y(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.canStoreURLs=Os.FileUrlStorage=void 0;var EF=require("fs"),MW=VW(zx()),CF=UW(_F());function xF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(xF=function(n){return n?r:e})(t)}function UW(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=xF(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function VW(t){return t&&t.__esModule?t:{default:t}}function Vu(t){"@babel/helpers - typeof";return Vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vu(t)}function HW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function SF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,GW(n.key),n)}}function zW(t,e,r){return e&&SF(t.prototype,e),r&&SF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function GW(t){var e=WW(t,"string");return Vu(e)=="symbol"?e:e+""}function WW(t,e){if(Vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Lde=Os.canStoreURLs=!0,Bde=Os.FileUrlStorage=function(){function t(e){HW(this,t),this.path=e}return zW(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;CF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;CF.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,MW.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,EF.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,EF.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var Qy=y(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Object.defineProperty(Gt,"DefaultHttpStack",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(Gt,"DetailedError",{enumerable:!0,get:function(){return KW.default}});Object.defineProperty(Gt,"FileUrlStorage",{enumerable:!0,get:function(){return PF.FileUrlStorage}});Object.defineProperty(Gt,"StreamSource",{enumerable:!0,get:function(){return QW.default}});Gt.Upload=void 0;Object.defineProperty(Gt,"canStoreURLs",{enumerable:!0,get:function(){return PF.canStoreURLs}});Gt.defaultOptions=void 0;Object.defineProperty(Gt,"enableDebugLog",{enumerable:!0,get:function(){return YW.enableDebugLog}});Gt.isSupported=void 0;var KW=ao(zg()),YW=Gg(),JW=ao(FS()),Xy=ao(n1()),XW=ao(g1()),ZW=ao(b1()),TF=ao($1()),QW=ao(ay()),PF=FF();function ao(t){return t&&t.__esModule?t:{default:t}}function ks(t){"@babel/helpers - typeof";return ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ks(t)}function eK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$F(n.key),n)}}function tK(t,e,r){return e&&OF(t.prototype,e),r&&OF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rK(t,e,r){return e=td(e),nK(t,RF()?Reflect.construct(e,r||[],td(t).constructor):e.apply(t,r))}function nK(t,e){if(e&&(ks(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iK(t)}function iK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function RF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RF=function(){return!!t})()}function td(t){return td=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},td(t)}function oK(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zy(t,e)}function Zy(t,e){return Zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zy(t,e)}function AF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function As(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AF(Object(r),!0).forEach(function(n){sK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sK(t,e,r){return e=$F(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $F(t){var e=aK(t,"string");return ks(e)=="symbol"?e:e+""}function aK(t,e){if(ks(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kF=Gt.defaultOptions=As(As({},Xy.default.defaultOptions),{},{httpStack:new TF.default,fileReader:new XW.default,urlStorage:new JW.default,fingerprint:ZW.default}),Mde=Gt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return eK(this,e),n=As(As({},kF),n),rK(this,e,[r,n])}return oK(e,t),tK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=As(As({},kF),i),Xy.default.terminate(n,i)}}])}(Xy.default),Ude=Gt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>t2,__assign:()=>rd,__asyncDelegator:()=>WF,__asyncGenerator:()=>GF,__asyncValues:()=>KF,__await:()=>Ts,__awaiter:()=>qF,__classPrivateFieldGet:()=>ZF,__classPrivateFieldIn:()=>e2,__classPrivateFieldSet:()=>QF,__createBinding:()=>id,__decorate:()=>NF,__disposeResources:()=>r2,__esDecorate:()=>uK,__exportStar:()=>UF,__extends:()=>IF,__generator:()=>MF,__importDefault:()=>XF,__importStar:()=>JF,__makeTemplateObject:()=>YF,__metadata:()=>BF,__param:()=>LF,__propKey:()=>lK,__read:()=>tD,__rest:()=>jF,__runInitializers:()=>cK,__setFunctionName:()=>fK,__spread:()=>VF,__spreadArray:()=>zF,__spreadArrays:()=>HF,__values:()=>nd,default:()=>pK});function IF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");eD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function jF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function NF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function LF(t,e){return function(r,n){e(r,n,t)}}function uK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var b in n)p[b]=b==="access"?{}:n[b];for(var b in n.access)p.access[b]=n.access[b];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function cK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function lK(t){return typeof t=="symbol"?t:"".concat(t)}function fK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function BF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function qF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function MF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function UF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&id(e,t,r)}function nd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function tD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function VF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(tD(arguments[e]));return t}function HF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function zF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Ts(t){return this instanceof Ts?(this.v=t,this):new Ts(t)}function GF(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){n[d]&&(i[d]=function(b){return new Promise(function(g,w){o.push([d,b,g,w])>1||u(d,b)})},p&&(i[d]=p(i[d])))}function u(d,p){try{c(n[d](p))}catch(b){h(o[0][3],b)}}function c(d){d.value instanceof Ts?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,p){d(p),o.shift(),o.length&&u(o[0][0],o[0][1])}}function WF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ts(t[i](s)),done:!1}:o?o(s):s}:o}}function KF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof nd=="function"?nd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function YF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function JF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&id(e,t,r);return dK(e,t),e}function XF(t){return t&&t.__esModule?t:{default:t}}function ZF(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function QF(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function e2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function t2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function r2(t){function e(o){t.error=t.hasError?new hK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var eD,rd,id,dK,hK,pK,Cn=ct(()=>{eD=function(t,e){return eD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},eD(t,e)};rd=function(){return rd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},rd.apply(this,arguments)};id=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};dK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};hK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};pK={__extends:IF,__assign:rd,__rest:jF,__decorate:NF,__param:LF,__metadata:BF,__awaiter:qF,__generator:MF,__createBinding:id,__exportStar:UF,__values:nd,__read:tD,__spread:VF,__spreadArrays:HF,__spreadArray:zF,__await:Ts,__asyncGenerator:GF,__asyncDelegator:WF,__asyncValues:KF,__makeTemplateObject:YF,__importStar:JF,__importDefault:XF,__classPrivateFieldGet:ZF,__classPrivateFieldSet:QF,__classPrivateFieldIn:e2,__addDisposableResource:t2,__disposeResources:r2}});var S2={};mn(S2,{__addDisposableResource:()=>E2,__assign:()=>od,__asyncDelegator:()=>m2,__asyncGenerator:()=>p2,__asyncValues:()=>g2,__await:()=>Ps,__awaiter:()=>u2,__classPrivateFieldGet:()=>b2,__classPrivateFieldIn:()=>_2,__classPrivateFieldSet:()=>w2,__createBinding:()=>ad,__decorate:()=>o2,__disposeResources:()=>C2,__esDecorate:()=>mK,__exportStar:()=>l2,__extends:()=>n2,__generator:()=>c2,__importDefault:()=>v2,__importStar:()=>D2,__makeTemplateObject:()=>y2,__metadata:()=>a2,__param:()=>s2,__propKey:()=>yK,__read:()=>nD,__rest:()=>i2,__runInitializers:()=>gK,__setFunctionName:()=>DK,__spread:()=>f2,__spreadArray:()=>h2,__spreadArrays:()=>d2,__values:()=>sd,default:()=>wK});function n2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function i2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function o2(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function s2(t,e){return function(r,n){e(r,n,t)}}function mK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var b in n)p[b]=b==="access"?{}:n[b];for(var b in n.access)p.access[b]=n.access[b];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function gK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function yK(t){return typeof t=="symbol"?t:"".concat(t)}function DK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function a2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function u2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function c2(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function l2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ad(e,t,r)}function sd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function nD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function f2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(nD(arguments[e]));return t}function d2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function h2(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Ps(t){return this instanceof Ps?(this.v=t,this):new Ps(t)}function p2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,b){o.push([h,d,p,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Ps?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function m2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ps(t[i](s)),done:!1}:o?o(s):s}:o}}function g2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof sd=="function"?sd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function y2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function D2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ad(e,t,r);return vK(e,t),e}function v2(t){return t&&t.__esModule?t:{default:t}}function b2(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function w2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function _2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function E2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function C2(t){function e(n){t.error=t.hasError?new bK(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var rD,od,ad,vK,bK,wK,x2=ct(()=>{rD=function(t,e){return rD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},rD(t,e)};od=function(){return od=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},od.apply(this,arguments)};ad=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};vK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};bK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};wK={__extends:n2,__assign:od,__rest:i2,__decorate:o2,__param:s2,__metadata:a2,__awaiter:u2,__generator:c2,__createBinding:ad,__exportStar:l2,__values:sd,__read:nD,__spread:f2,__spreadArrays:d2,__spreadArray:h2,__await:Ps,__asyncGenerator:p2,__asyncDelegator:m2,__asyncValues:g2,__makeTemplateObject:y2,__importStar:D2,__importDefault:v2,__classPrivateFieldGet:b2,__classPrivateFieldSet:w2,__classPrivateFieldIn:_2,__addDisposableResource:E2,__disposeResources:C2}});var Wt=y(iD=>{"use strict";iD.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,o)=>i!=null?n(i):r(o)),t.apply(this,e)})},"name",{value:t.name})};iD.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Hu=y(oi=>{"use strict";var F2=Wt().fromCallback,Pt=ht(),_K=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(oi[t]=Pt[t])});_K.forEach(t=>{oi[t]=F2(Pt[t])});oi.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};oi.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};oi.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(oi.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(oi.realpath.native=F2(Pt.realpath.native))});var oD=y((Gde,O2)=>{O2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var R2=y((Wde,sD)=>{"use strict";var Rs=Hu(),Sn=require("path"),EK=oD(),A2=EK("10.12.0"),k2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},T2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},P2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};sD.exports.makeDir=async(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Rs.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await Rs.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await Rs.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};sD.exports.makeDirSync=(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Rs.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{Rs.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!Rs.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=y((Kde,$2)=>{"use strict";var CK=Wt().fromPromise,{makeDir:SK,makeDirSync:aD}=R2(),uD=CK(SK);$2.exports={mkdirs:uD,mkdirsSync:aD,mkdirp:uD,mkdirpSync:aD,ensureDir:uD,ensureDirSync:aD}});var cD=y((Yde,I2)=>{"use strict";var $s=ht();function xK(t,e,r,n){$s.open(t,"r+",(i,o)=>{if(i)return n(i);$s.futimes(o,e,r,s=>{$s.close(o,a=>{n&&n(s||a)})})})}function FK(t,e,r){let n=$s.openSync(t,"r+");return $s.futimesSync(n,e,r),$s.closeSync(n)}I2.exports={utimesMillis:xK,utimesMillisSync:FK}});var zu=y((Jde,B2)=>{"use strict";var Is=Hu(),Kt=require("path"),OK=require("util"),AK=oD(),ud=AK("10.5.0"),j2=t=>ud?Is.stat(t,{bigint:!0}):Is.stat(t),lD=t=>ud?Is.statSync(t,{bigint:!0}):Is.statSync(t);function kK(t,e){return Promise.all([j2(t),j2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function TK(t,e){let r,n=lD(t);try{r=lD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function PK(t,e,r,n){OK.callbackify(kK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&cd(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&fD(t,e)?n(new Error(ld(t,e,r))):n(null,{srcStat:s,destStat:a})})}function RK(t,e,r){let{srcStat:n,destStat:i}=TK(t,e);if(i&&cd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&fD(t,e))throw new Error(ld(t,e,r));return{srcStat:n,destStat:i}}function N2(t,e,r,n,i){let o=Kt.resolve(Kt.dirname(t)),s=Kt.resolve(Kt.dirname(r));if(s===o||s===Kt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):cd(e,c)?i(new Error(ld(t,r,n))):N2(t,e,s,n,i);ud?Is.stat(s,{bigint:!0},a):Is.stat(s,a)}function L2(t,e,r,n){let i=Kt.resolve(Kt.dirname(t)),o=Kt.resolve(Kt.dirname(r));if(o===i||o===Kt.parse(o).root)return;let s;try{s=lD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(cd(e,s))throw new Error(ld(t,r,n));return L2(t,e,o,n)}function cd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(ud||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function fD(t,e){let r=Kt.resolve(t).split(Kt.sep).filter(i=>i),n=Kt.resolve(e).split(Kt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function ld(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}B2.exports={checkPaths:PK,checkPathsSync:RK,checkParentPaths:N2,checkParentPathsSync:L2,isSrcSubdir:fD}});var H2=y((Xde,V2)=>{"use strict";var Ct=ht(),Gu=require("path"),$K=kr().mkdirsSync,IK=cD().utimesMillisSync,Wu=zu();function jK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
41
41
 
42
- see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Wu.checkPathsSync(t,e,"copy");return Wu.checkParentPathsSync(t,n,e,"copy"),LK(i,t,e,r)}function LK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Gu.dirname(r);return Ct.existsSync(i)||IK(i),q2(t,e,r,n)}function q2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return BK(t,e,r,n)}function BK(t,e,r,n){let o=(n.dereference?Ct.statSync:Ct.lstatSync)(e);if(o.isDirectory())return GK(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return qK(o,t,e,r,n);if(o.isSymbolicLink())return YK(t,e,r,n)}function qK(t,e,r,n,i){return e?MK(t,r,n,i):M2(t,r,n,i)}function MK(t,e,r,n){if(n.overwrite)return Ct.unlinkSync(r),M2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function M2(t,e,r,n){return Ct.copyFileSync(e,r),n.preserveTimestamps&&UK(t.mode,e,r),dD(r,t.mode)}function UK(t,e,r){return VK(t)&&HK(r,t),zK(e,r)}function VK(t){return(t&128)===0}function HK(t,e){return dD(t,e|128)}function dD(t,e){return Ct.chmodSync(t,e)}function zK(t,e){let r=Ct.statSync(t);return jK(e,r.atime,r.mtime)}function GK(t,e,r,n,i){if(!e)return WK(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return U2(r,n,i)}function WK(t,e,r,n){return Ct.mkdirSync(r),U2(e,r,n),dD(r,t)}function U2(t,e,r){Ct.readdirSync(t).forEach(n=>KK(n,t,e,r))}function KK(t,e,r,n){let i=Gu.join(e,t),o=Gu.join(r,t),{destStat:s}=Wu.checkPathsSync(i,o,"copy");return q2(s,i,o,n)}function YK(t,e,r,n){let i=Ct.readlinkSync(e);if(n.dereference&&(i=Gu.resolve(process.cwd(),i)),t){let o;try{o=Ct.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Ct.symlinkSync(i,r);throw s}if(n.dereference&&(o=Gu.resolve(process.cwd(),o)),Wu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Ct.statSync(r).isDirectory()&&Wu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return JK(i,r)}else return Ct.symlinkSync(i,r)}function JK(t,e){return Ct.unlinkSync(e),Ct.symlinkSync(t,e)}V2.exports=NK});var hD=y((Zde,z2)=>{"use strict";z2.exports={copySync:H2()}});var si=y((Qde,W2)=>{"use strict";var XK=Wt().fromPromise,G2=Hu();function ZK(t){return G2.access(t).then(()=>!0).catch(()=>!1)}W2.exports={pathExists:XK(ZK),pathExistsSync:G2.existsSync}});var rO=y((ehe,tO)=>{"use strict";var Yt=ht(),Ku=require("path"),QK=kr().mkdirs,eY=si().pathExists,tY=cD().utimesMillis,Yu=zu();function rY(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
42
+ see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Wu.checkPathsSync(t,e,"copy");return Wu.checkParentPathsSync(t,n,e,"copy"),NK(i,t,e,r)}function NK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Gu.dirname(r);return Ct.existsSync(i)||$K(i),q2(t,e,r,n)}function q2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return LK(t,e,r,n)}function LK(t,e,r,n){let o=(n.dereference?Ct.statSync:Ct.lstatSync)(e);if(o.isDirectory())return zK(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return BK(o,t,e,r,n);if(o.isSymbolicLink())return KK(t,e,r,n)}function BK(t,e,r,n,i){return e?qK(t,r,n,i):M2(t,r,n,i)}function qK(t,e,r,n){if(n.overwrite)return Ct.unlinkSync(r),M2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function M2(t,e,r,n){return Ct.copyFileSync(e,r),n.preserveTimestamps&&MK(t.mode,e,r),dD(r,t.mode)}function MK(t,e,r){return UK(t)&&VK(r,t),HK(e,r)}function UK(t){return(t&128)===0}function VK(t,e){return dD(t,e|128)}function dD(t,e){return Ct.chmodSync(t,e)}function HK(t,e){let r=Ct.statSync(t);return IK(e,r.atime,r.mtime)}function zK(t,e,r,n,i){if(!e)return GK(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return U2(r,n,i)}function GK(t,e,r,n){return Ct.mkdirSync(r),U2(e,r,n),dD(r,t)}function U2(t,e,r){Ct.readdirSync(t).forEach(n=>WK(n,t,e,r))}function WK(t,e,r,n){let i=Gu.join(e,t),o=Gu.join(r,t),{destStat:s}=Wu.checkPathsSync(i,o,"copy");return q2(s,i,o,n)}function KK(t,e,r,n){let i=Ct.readlinkSync(e);if(n.dereference&&(i=Gu.resolve(process.cwd(),i)),t){let o;try{o=Ct.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Ct.symlinkSync(i,r);throw s}if(n.dereference&&(o=Gu.resolve(process.cwd(),o)),Wu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Ct.statSync(r).isDirectory()&&Wu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return YK(i,r)}else return Ct.symlinkSync(i,r)}function YK(t,e){return Ct.unlinkSync(e),Ct.symlinkSync(t,e)}V2.exports=jK});var hD=y((Zde,z2)=>{"use strict";z2.exports={copySync:H2()}});var si=y((Qde,W2)=>{"use strict";var JK=Wt().fromPromise,G2=Hu();function XK(t){return G2.access(t).then(()=>!0).catch(()=>!1)}W2.exports={pathExists:JK(XK),pathExistsSync:G2.existsSync}});var rO=y((ehe,tO)=>{"use strict";var Yt=ht(),Ku=require("path"),ZK=kr().mkdirs,QK=si().pathExists,eY=cD().utimesMillis,Yu=zu();function tY(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
43
43
 
44
- see https://github.com/jprichardson/node-fs-extra/issues/269`),Yu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Yu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?X2(K2,a,t,e,r,n):K2(a,t,e,r,n))})}function K2(t,e,r,n,i){let o=Ku.dirname(r);eY(o,(s,a)=>{if(s)return i(s);if(a)return pD(t,e,r,n,i);QK(o,u=>u?i(u):pD(t,e,r,n,i))})}function X2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function pD(t,e,r,n,i){return n.filter?X2(Y2,t,e,r,n,i):Y2(t,e,r,n,i)}function Y2(t,e,r,n,i){(n.dereference?Yt.stat:Yt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return cY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return nY(a,t,e,r,n,i);if(a.isSymbolicLink())return dY(t,e,r,n,i)})}function nY(t,e,r,n,i,o){return e?iY(t,r,n,i,o):Z2(t,r,n,i,o)}function iY(t,e,r,n,i){if(n.overwrite)Yt.unlink(r,o=>o?i(o):Z2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function Z2(t,e,r,n,i){Yt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?oY(t.mode,e,r,i):fd(r,t.mode,i))}function oY(t,e,r,n){return sY(t)?aY(r,t,i=>i?n(i):J2(t,e,r,n)):J2(t,e,r,n)}function sY(t){return(t&128)===0}function aY(t,e,r){return fd(t,e|128,r)}function J2(t,e,r,n){uY(e,r,i=>i?n(i):fd(r,t,n))}function fd(t,e,r){return Yt.chmod(t,e,r)}function uY(t,e,r){Yt.stat(t,(n,i)=>n?r(n):tY(e,i.atime,i.mtime,r))}function cY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):Q2(r,n,i,o):lY(t.mode,r,n,i,o)}function lY(t,e,r,n,i){Yt.mkdir(r,o=>{if(o)return i(o);Q2(e,r,n,s=>s?i(s):fd(r,t,i))})}function Q2(t,e,r,n){Yt.readdir(t,(i,o)=>i?n(i):eO(o,t,e,r,n))}function eO(t,e,r,n,i){let o=t.pop();return o?fY(t,o,e,r,n,i):i()}function fY(t,e,r,n,i,o){let s=Ku.join(r,e),a=Ku.join(n,e);Yu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;pD(l,s,a,i,f=>f?o(f):eO(t,r,n,i,o))})}function dY(t,e,r,n,i){Yt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Ku.resolve(process.cwd(),s)),t)Yt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Yt.symlink(s,r,i):i(a):(n.dereference&&(u=Ku.resolve(process.cwd(),u)),Yu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Yu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):hY(s,r,i)));else return Yt.symlink(s,r,i)})}function hY(t,e,r){Yt.unlink(e,n=>n?r(n):Yt.symlink(t,e,r))}tO.exports=rY});var mD=y((the,nO)=>{"use strict";var pY=Wt().fromCallback;nO.exports={copy:pY(rO())}});var dO=y((rhe,fO)=>{"use strict";var iO=ht(),uO=require("path"),Se=require("assert"),Ju=process.platform==="win32";function cO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||iO[r],r=r+"Sync",t[r]=t[r]||iO[r]}),t.maxBusyTries=t.maxBusyTries||3}function gD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se.strictEqual(typeof r,"function","rimraf: callback function required"),Se(e,"rimraf: invalid options argument provided"),Se.strictEqual(typeof e,"object","rimraf: options should be object"),cO(e),oO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>oO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function oO(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Ju)return sO(t,e,n,r);if(i&&i.isDirectory())return dd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Ju?sO(t,e,o,r):dd(t,e,o,r);if(o.code==="EISDIR")return dd(t,e,o,r)}return r(o)})})}function sO(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?dd(t,e,r,n):e.unlink(t,n)})})}function aO(t,e,r){let n;Se(t),Se(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?hd(t,e,r):e.unlinkSync(t)}function dd(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?mY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function mY(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{gD(uO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function lO(t,e){let r;e=e||{},cO(e),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se(e,"rimraf: missing options"),Se.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Ju&&aO(t,e,n)}try{r&&r.isDirectory()?hd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Ju?aO(t,e,n):hd(t,e,n);if(n.code!=="EISDIR")throw n;hd(t,e,n)}}function hd(t,e,r){Se(t),Se(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")gY(t,e);else if(n.code!=="ENOENT")throw n}}function gY(t,e){if(Se(t),Se(e),e.readdirSync(t).forEach(r=>lO(uO.join(t,r),e)),Ju){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}fO.exports=gD;gD.sync=lO});var Xu=y((nhe,pO)=>{"use strict";var yY=Wt().fromCallback,hO=dO();pO.exports={remove:yY(hO),removeSync:hO.sync}});var _O=y((ihe,wO)=>{"use strict";var DY=Wt().fromCallback,yO=ht(),DO=require("path"),vO=kr(),bO=Xu(),mO=DY(function(e,r){r=r||function(){},yO.readdir(e,(n,i)=>{if(n)return vO.mkdirs(e,r);i=i.map(s=>DO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();bO.remove(s,a=>{if(a)return r(a);o()})}})});function gO(t){let e;try{e=yO.readdirSync(t)}catch{return vO.mkdirsSync(t)}e.forEach(r=>{r=DO.join(t,r),bO.removeSync(r)})}wO.exports={emptyDirSync:gO,emptydirSync:gO,emptyDir:mO,emptydir:mO}});var xO=y((ohe,SO)=>{"use strict";var vY=Wt().fromCallback,EO=require("path"),ai=ht(),CO=kr();function bY(t,e){function r(){ai.writeFile(t,"",n=>{if(n)return e(n);e()})}ai.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=EO.dirname(t);ai.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?CO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ai.readdir(o,u=>{if(u)return e(u)})})})}function wY(t){let e;try{e=ai.statSync(t)}catch{}if(e&&e.isFile())return;let r=EO.dirname(t);try{ai.statSync(r).isDirectory()||ai.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CO.mkdirsSync(r);else throw n}ai.writeFileSync(t,"")}SO.exports={createFile:vY(bY),createFileSync:wY}});var TO=y((she,kO)=>{"use strict";var _Y=Wt().fromCallback,OO=require("path"),uo=ht(),AO=kr(),FO=si().pathExists;function EY(t,e,r){function n(i,o){uo.link(i,o,s=>{if(s)return r(s);r(null)})}FO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);uo.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=OO.dirname(e);FO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);AO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function CY(t,e){if(uo.existsSync(e))return;try{uo.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=OO.dirname(e);return uo.existsSync(n)||AO.mkdirsSync(n),uo.linkSync(t,e)}kO.exports={createLink:_Y(EY),createLinkSync:CY}});var RO=y((ahe,PO)=>{"use strict";var ui=require("path"),Zu=ht(),SY=si().pathExists;function xY(t,e,r){if(ui.isAbsolute(t))return Zu.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ui.dirname(e),i=ui.join(n,t);return SY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):Zu.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ui.relative(n,t)})))}}function FY(t,e){let r;if(ui.isAbsolute(t)){if(r=Zu.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ui.dirname(e),i=ui.join(n,t);if(r=Zu.existsSync(i),r)return{toCwd:i,toDst:t};if(r=Zu.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ui.relative(n,t)}}}PO.exports={symlinkPaths:xY,symlinkPathsSync:FY}});var jO=y((uhe,IO)=>{"use strict";var $O=ht();function OY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);$O.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function AY(t,e){let r;if(e)return e;try{r=$O.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}IO.exports={symlinkType:OY,symlinkTypeSync:AY}});var VO=y((che,UO)=>{"use strict";var kY=Wt().fromCallback,LO=require("path"),js=ht(),BO=kr(),TY=BO.mkdirs,PY=BO.mkdirsSync,qO=RO(),RY=qO.symlinkPaths,$Y=qO.symlinkPathsSync,MO=jO(),IY=MO.symlinkType,jY=MO.symlinkTypeSync,NO=si().pathExists;function NY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,NO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);RY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,IY(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=LO.dirname(e);NO(l,(f,h)=>{if(f)return n(f);if(h)return js.symlink(t,e,c,n);TY(l,d=>{if(d)return n(d);js.symlink(t,e,c,n)})})})})})}function LY(t,e,r){if(js.existsSync(e))return;let i=$Y(t,e);t=i.toDst,r=jY(i.toCwd,r);let o=LO.dirname(e);return js.existsSync(o)||PY(o),js.symlinkSync(t,e,r)}UO.exports={createSymlink:kY(NY),createSymlinkSync:LY}});var zO=y((lhe,HO)=>{"use strict";var pd=xO(),md=TO(),gd=VO();HO.exports={createFile:pd.createFile,createFileSync:pd.createFileSync,ensureFile:pd.createFile,ensureFileSync:pd.createFileSync,createLink:md.createLink,createLinkSync:md.createLinkSync,ensureLink:md.createLink,ensureLinkSync:md.createLinkSync,createSymlink:gd.createSymlink,createSymlinkSync:gd.createSymlinkSync,ensureSymlink:gd.createSymlink,ensureSymlinkSync:gd.createSymlinkSync}});var yd=y((fhe,GO)=>{function BY(t,{EOL:e=`
45
- `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function qY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GO.exports={stringify:BY,stripBom:qY}});var JO=y((dhe,YO)=>{var Ns;try{Ns=ht()}catch{Ns=require("fs")}var Dd=Wt(),{stringify:WO,stripBom:KO}=yd();async function MY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ns,n="throws"in e?e.throws:!0,i=await Dd.fromCallback(r.readFile)(t,e);i=KO(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var UY=Dd.fromPromise(MY);function VY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ns,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=KO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function HY(t,e,r={}){let n=r.fs||Ns,i=WO(e,r);await Dd.fromCallback(n.writeFile)(t,i,r)}var zY=Dd.fromPromise(HY);function GY(t,e,r={}){let n=r.fs||Ns,i=WO(e,r);return n.writeFileSync(t,i,r)}var WY={readFile:UY,readFileSync:VY,writeFile:zY,writeFileSync:GY};YO.exports=WY});var ZO=y((hhe,XO)=>{"use strict";var vd=JO();XO.exports={readJson:vd.readFile,readJsonSync:vd.readFileSync,writeJson:vd.writeFile,writeJsonSync:vd.writeFileSync}});var bd=y((phe,tA)=>{"use strict";var KY=Wt().fromCallback,Qu=ht(),QO=require("path"),eA=kr(),YY=si().pathExists;function JY(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=QO.dirname(t);YY(i,(o,s)=>{if(o)return n(o);if(s)return Qu.writeFile(t,e,r,n);eA.mkdirs(i,a=>{if(a)return n(a);Qu.writeFile(t,e,r,n)})})}function XY(t,...e){let r=QO.dirname(t);if(Qu.existsSync(r))return Qu.writeFileSync(t,...e);eA.mkdirsSync(r),Qu.writeFileSync(t,...e)}tA.exports={outputFile:KY(JY),outputFileSync:XY}});var nA=y((mhe,rA)=>{"use strict";var{stringify:ZY}=yd(),{outputFile:QY}=bd();async function eJ(t,e,r={}){let n=ZY(e,r);await QY(t,n,r)}rA.exports=eJ});var oA=y((ghe,iA)=>{"use strict";var{stringify:tJ}=yd(),{outputFileSync:rJ}=bd();function nJ(t,e,r){let n=tJ(e,r);rJ(t,n,r)}iA.exports=nJ});var aA=y((yhe,sA)=>{"use strict";var iJ=Wt().fromPromise,Rt=ZO();Rt.outputJson=iJ(nA());Rt.outputJsonSync=oA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;sA.exports=Rt});var hA=y((Dhe,dA)=>{"use strict";var lA=ht(),oJ=require("path"),sJ=hD().copySync,fA=Xu().removeSync,aJ=kr().mkdirpSync,uA=zu();function uJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=uA.checkPathsSync(t,e,"move");return uA.checkParentPathsSync(t,i,e,"move"),aJ(oJ.dirname(e)),cJ(t,e,n)}function cJ(t,e,r){if(r)return fA(e),cA(t,e,r);if(lA.existsSync(e))throw new Error("dest already exists.");return cA(t,e,r)}function cA(t,e,r){try{lA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return lJ(t,e,r)}}function lJ(t,e,r){return sJ(t,e,{overwrite:r,errorOnExist:!0}),fA(t)}dA.exports=uJ});var mA=y((vhe,pA)=>{"use strict";pA.exports={moveSync:hA()}});var bA=y((bhe,vA)=>{"use strict";var fJ=ht(),dJ=require("path"),hJ=mD().copy,DA=Xu().remove,pJ=kr().mkdirp,mJ=si().pathExists,gA=zu();function gJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;gA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;gA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);pJ(dJ.dirname(e),c=>c?n(c):yJ(t,e,i,n))})})}function yJ(t,e,r,n){if(r)return DA(e,i=>i?n(i):yA(t,e,r,n));mJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):yA(t,e,r,n))}function yA(t,e,r,n){fJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):DJ(t,e,r,n):n())}function DJ(t,e,r,n){hJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):DA(t,n))}vA.exports=gJ});var _A=y((whe,wA)=>{"use strict";var vJ=Wt().fromCallback;wA.exports={move:vJ(bA())}});var wd=y((_he,yD)=>{"use strict";yD.exports={...Hu(),...hD(),...mD(),..._O(),...zO(),...aA(),...kr(),...mA(),..._A(),...bd(),...si(),...Xu()};var EA=require("fs");Object.getOwnPropertyDescriptor(EA,"promises")&&Object.defineProperty(yD.exports,"promises",{get(){return EA.promises}})});var DD=y(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.readdir=Ls.stat=void 0;var CA=wd();async function bJ(t){try{return await CA.stat(t)}catch{}}Ls.stat=bJ;async function wJ(t){try{return await CA.readdir(t)}catch{return[]}}Ls.readdir=wJ});var Bs=y(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var _J=(x2(),Ae(S2)),Dr=wd(),EJ=require("os"),xn=require("path"),SA=require("stream"),xA=DD();_J.__exportStar(wd(),re);var FA=DD();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return FA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return FA.readdir}});async function CJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=bD(t,n);e&&(a=a.pipe(new SA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=CJ;async function SJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),bD(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=SJ;async function xJ(t){try{return await Dr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=xJ;async function vD(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=Dr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=vD;async function FJ(t){return Promise.all([vD(t),(async()=>{try{return(await Dr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=FJ;async function OJ(t,e){let r=await vD(t);await Dr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=OJ;function AJ(t,e){return new Promise((r,n)=>{let i=Dr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=AJ;async function ec(t,e){try{await Dr.access(t,e)}catch{return!1}return!0}re.pathAccessible=ec;async function kJ(t){return ec(t,Dr.constants.F_OK)}re.pathExists=kJ;async function TJ(t){return ec(t,Dr.constants.R_OK)}re.pathReadable=TJ;async function PJ(t){return ec(t,Dr.constants.W_OK)}re.pathWritable=PJ;async function OA(t){return ec(t,Dr.constants.X_OK)}re.pathExecutable=OA;async function RJ(t){let[e,r]=await Promise.all([xA.stat(t),OA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=RJ;async function $J(t,e){if(!(!t||!e)){for(let r of AA(t))if((await xA.readdir(r)).includes(e))return r}}re.findBaseDirectory=$J;function IJ(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve(EJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=IJ;function AA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=AA;var _d=class extends SA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}Dr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?Dr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=_d;function bD(t,e={}){return new _d(t,e)}re.walk=bD});var wD=y((She,kA)=>{var qs=1e3,Ms=qs*60,Us=Ms*60,co=Us*24,jJ=co*7,NJ=co*365.25;kA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return LJ(t);if(r==="number"&&isFinite(t))return e.long?qJ(t):BJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function LJ(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*NJ;case"weeks":case"week":case"w":return r*jJ;case"days":case"day":case"d":return r*co;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Us;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ms;case"seconds":case"second":case"secs":case"sec":case"s":return r*qs;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function BJ(t){var e=Math.abs(t);return e>=co?Math.round(t/co)+"d":e>=Us?Math.round(t/Us)+"h":e>=Ms?Math.round(t/Ms)+"m":e>=qs?Math.round(t/qs)+"s":t+"ms"}function qJ(t){var e=Math.abs(t);return e>=co?Ed(t,e,co,"day"):e>=Us?Ed(t,e,Us,"hour"):e>=Ms?Ed(t,e,Ms,"minute"):e>=qs?Ed(t,e,qs,"second"):t+" ms"}function Ed(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var _D=y((xhe,TA)=>{function MJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=wD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}TA.exports=MJ});var PA=y((or,Cd)=>{or.formatArgs=VJ;or.save=HJ;or.load=zJ;or.useColors=UJ;or.storage=GJ();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function UJ(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function VJ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Cd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function HJ(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function zJ(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function GJ(){try{return localStorage}catch{}}Cd.exports=_D()(or);var{formatters:WJ}=Cd.exports;WJ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $A=y((Fhe,RA)=>{"use strict";RA.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var SD=y((Ohe,jA)=>{"use strict";var KJ=require("os"),IA=require("tty"),vr=$A(),{env:mt}=process,ci;vr("no-color")||vr("no-colors")||vr("color=false")||vr("color=never")?ci=0:(vr("color")||vr("colors")||vr("color=true")||vr("color=always"))&&(ci=1);"FORCE_COLOR"in mt&&(mt.FORCE_COLOR==="true"?ci=1:mt.FORCE_COLOR==="false"?ci=0:ci=mt.FORCE_COLOR.length===0?1:Math.min(parseInt(mt.FORCE_COLOR,10),3));function ED(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function CD(t,e){if(ci===0)return 0;if(vr("color=16m")||vr("color=full")||vr("color=truecolor"))return 3;if(vr("color=256"))return 2;if(t&&!e&&ci===void 0)return 0;let r=ci||0;if(mt.TERM==="dumb")return r;if(process.platform==="win32"){let n=KJ.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in mt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in mt)||mt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in mt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mt.TEAMCITY_VERSION)?1:0;if(mt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in mt){let n=parseInt((mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(mt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mt.TERM)||"COLORTERM"in mt?1:r}function YJ(t){let e=CD(t,t&&t.isTTY);return ED(e)}jA.exports={supportsColor:YJ,stdout:ED(CD(!0,IA.isatty(1))),stderr:ED(CD(!0,IA.isatty(2)))}});var LA=y((gt,xd)=>{var JJ=require("tty"),Sd=require("util");gt.init=nX;gt.log=eX;gt.formatArgs=ZJ;gt.save=tX;gt.load=rX;gt.useColors=XJ;gt.destroy=Sd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gt.colors=[6,2,3,4,5,1];try{let t=SD();t&&(t.stderr||t).level>=2&&(gt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}gt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function XJ(){return"colors"in gt.inspectOpts?!!gt.inspectOpts.colors:JJ.isatty(process.stderr.fd)}function ZJ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
44
+ see https://github.com/jprichardson/node-fs-extra/issues/269`),Yu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Yu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?X2(K2,a,t,e,r,n):K2(a,t,e,r,n))})}function K2(t,e,r,n,i){let o=Ku.dirname(r);QK(o,(s,a)=>{if(s)return i(s);if(a)return pD(t,e,r,n,i);ZK(o,u=>u?i(u):pD(t,e,r,n,i))})}function X2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function pD(t,e,r,n,i){return n.filter?X2(Y2,t,e,r,n,i):Y2(t,e,r,n,i)}function Y2(t,e,r,n,i){(n.dereference?Yt.stat:Yt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return uY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return rY(a,t,e,r,n,i);if(a.isSymbolicLink())return fY(t,e,r,n,i)})}function rY(t,e,r,n,i,o){return e?nY(t,r,n,i,o):Z2(t,r,n,i,o)}function nY(t,e,r,n,i){if(n.overwrite)Yt.unlink(r,o=>o?i(o):Z2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function Z2(t,e,r,n,i){Yt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?iY(t.mode,e,r,i):fd(r,t.mode,i))}function iY(t,e,r,n){return oY(t)?sY(r,t,i=>i?n(i):J2(t,e,r,n)):J2(t,e,r,n)}function oY(t){return(t&128)===0}function sY(t,e,r){return fd(t,e|128,r)}function J2(t,e,r,n){aY(e,r,i=>i?n(i):fd(r,t,n))}function fd(t,e,r){return Yt.chmod(t,e,r)}function aY(t,e,r){Yt.stat(t,(n,i)=>n?r(n):eY(e,i.atime,i.mtime,r))}function uY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):Q2(r,n,i,o):cY(t.mode,r,n,i,o)}function cY(t,e,r,n,i){Yt.mkdir(r,o=>{if(o)return i(o);Q2(e,r,n,s=>s?i(s):fd(r,t,i))})}function Q2(t,e,r,n){Yt.readdir(t,(i,o)=>i?n(i):eO(o,t,e,r,n))}function eO(t,e,r,n,i){let o=t.pop();return o?lY(t,o,e,r,n,i):i()}function lY(t,e,r,n,i,o){let s=Ku.join(r,e),a=Ku.join(n,e);Yu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;pD(l,s,a,i,f=>f?o(f):eO(t,r,n,i,o))})}function fY(t,e,r,n,i){Yt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Ku.resolve(process.cwd(),s)),t)Yt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Yt.symlink(s,r,i):i(a):(n.dereference&&(u=Ku.resolve(process.cwd(),u)),Yu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Yu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):dY(s,r,i)));else return Yt.symlink(s,r,i)})}function dY(t,e,r){Yt.unlink(e,n=>n?r(n):Yt.symlink(t,e,r))}tO.exports=tY});var mD=y((the,nO)=>{"use strict";var hY=Wt().fromCallback;nO.exports={copy:hY(rO())}});var dO=y((rhe,fO)=>{"use strict";var iO=ht(),uO=require("path"),Se=require("assert"),Ju=process.platform==="win32";function cO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||iO[r],r=r+"Sync",t[r]=t[r]||iO[r]}),t.maxBusyTries=t.maxBusyTries||3}function gD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se.strictEqual(typeof r,"function","rimraf: callback function required"),Se(e,"rimraf: invalid options argument provided"),Se.strictEqual(typeof e,"object","rimraf: options should be object"),cO(e),oO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>oO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function oO(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Ju)return sO(t,e,n,r);if(i&&i.isDirectory())return dd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Ju?sO(t,e,o,r):dd(t,e,o,r);if(o.code==="EISDIR")return dd(t,e,o,r)}return r(o)})})}function sO(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?dd(t,e,r,n):e.unlink(t,n)})})}function aO(t,e,r){let n;Se(t),Se(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?hd(t,e,r):e.unlinkSync(t)}function dd(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?pY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function pY(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{gD(uO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function lO(t,e){let r;e=e||{},cO(e),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se(e,"rimraf: missing options"),Se.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Ju&&aO(t,e,n)}try{r&&r.isDirectory()?hd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Ju?aO(t,e,n):hd(t,e,n);if(n.code!=="EISDIR")throw n;hd(t,e,n)}}function hd(t,e,r){Se(t),Se(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")mY(t,e);else if(n.code!=="ENOENT")throw n}}function mY(t,e){if(Se(t),Se(e),e.readdirSync(t).forEach(r=>lO(uO.join(t,r),e)),Ju){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}fO.exports=gD;gD.sync=lO});var Xu=y((nhe,pO)=>{"use strict";var gY=Wt().fromCallback,hO=dO();pO.exports={remove:gY(hO),removeSync:hO.sync}});var _O=y((ihe,wO)=>{"use strict";var yY=Wt().fromCallback,yO=ht(),DO=require("path"),vO=kr(),bO=Xu(),mO=yY(function(e,r){r=r||function(){},yO.readdir(e,(n,i)=>{if(n)return vO.mkdirs(e,r);i=i.map(s=>DO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();bO.remove(s,a=>{if(a)return r(a);o()})}})});function gO(t){let e;try{e=yO.readdirSync(t)}catch{return vO.mkdirsSync(t)}e.forEach(r=>{r=DO.join(t,r),bO.removeSync(r)})}wO.exports={emptyDirSync:gO,emptydirSync:gO,emptyDir:mO,emptydir:mO}});var xO=y((ohe,SO)=>{"use strict";var DY=Wt().fromCallback,EO=require("path"),ai=ht(),CO=kr();function vY(t,e){function r(){ai.writeFile(t,"",n=>{if(n)return e(n);e()})}ai.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=EO.dirname(t);ai.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?CO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ai.readdir(o,u=>{if(u)return e(u)})})})}function bY(t){let e;try{e=ai.statSync(t)}catch{}if(e&&e.isFile())return;let r=EO.dirname(t);try{ai.statSync(r).isDirectory()||ai.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CO.mkdirsSync(r);else throw n}ai.writeFileSync(t,"")}SO.exports={createFile:DY(vY),createFileSync:bY}});var TO=y((she,kO)=>{"use strict";var wY=Wt().fromCallback,OO=require("path"),uo=ht(),AO=kr(),FO=si().pathExists;function _Y(t,e,r){function n(i,o){uo.link(i,o,s=>{if(s)return r(s);r(null)})}FO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);uo.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=OO.dirname(e);FO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);AO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function EY(t,e){if(uo.existsSync(e))return;try{uo.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=OO.dirname(e);return uo.existsSync(n)||AO.mkdirsSync(n),uo.linkSync(t,e)}kO.exports={createLink:wY(_Y),createLinkSync:EY}});var RO=y((ahe,PO)=>{"use strict";var ui=require("path"),Zu=ht(),CY=si().pathExists;function SY(t,e,r){if(ui.isAbsolute(t))return Zu.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ui.dirname(e),i=ui.join(n,t);return CY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):Zu.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ui.relative(n,t)})))}}function xY(t,e){let r;if(ui.isAbsolute(t)){if(r=Zu.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ui.dirname(e),i=ui.join(n,t);if(r=Zu.existsSync(i),r)return{toCwd:i,toDst:t};if(r=Zu.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ui.relative(n,t)}}}PO.exports={symlinkPaths:SY,symlinkPathsSync:xY}});var jO=y((uhe,IO)=>{"use strict";var $O=ht();function FY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);$O.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function OY(t,e){let r;if(e)return e;try{r=$O.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}IO.exports={symlinkType:FY,symlinkTypeSync:OY}});var VO=y((che,UO)=>{"use strict";var AY=Wt().fromCallback,LO=require("path"),js=ht(),BO=kr(),kY=BO.mkdirs,TY=BO.mkdirsSync,qO=RO(),PY=qO.symlinkPaths,RY=qO.symlinkPathsSync,MO=jO(),$Y=MO.symlinkType,IY=MO.symlinkTypeSync,NO=si().pathExists;function jY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,NO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);PY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,$Y(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=LO.dirname(e);NO(l,(f,h)=>{if(f)return n(f);if(h)return js.symlink(t,e,c,n);kY(l,d=>{if(d)return n(d);js.symlink(t,e,c,n)})})})})})}function NY(t,e,r){if(js.existsSync(e))return;let i=RY(t,e);t=i.toDst,r=IY(i.toCwd,r);let o=LO.dirname(e);return js.existsSync(o)||TY(o),js.symlinkSync(t,e,r)}UO.exports={createSymlink:AY(jY),createSymlinkSync:NY}});var zO=y((lhe,HO)=>{"use strict";var pd=xO(),md=TO(),gd=VO();HO.exports={createFile:pd.createFile,createFileSync:pd.createFileSync,ensureFile:pd.createFile,ensureFileSync:pd.createFileSync,createLink:md.createLink,createLinkSync:md.createLinkSync,ensureLink:md.createLink,ensureLinkSync:md.createLinkSync,createSymlink:gd.createSymlink,createSymlinkSync:gd.createSymlinkSync,ensureSymlink:gd.createSymlink,ensureSymlinkSync:gd.createSymlinkSync}});var yd=y((fhe,GO)=>{function LY(t,{EOL:e=`
45
+ `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function BY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GO.exports={stringify:LY,stripBom:BY}});var JO=y((dhe,YO)=>{var Ns;try{Ns=ht()}catch{Ns=require("fs")}var Dd=Wt(),{stringify:WO,stripBom:KO}=yd();async function qY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ns,n="throws"in e?e.throws:!0,i=await Dd.fromCallback(r.readFile)(t,e);i=KO(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var MY=Dd.fromPromise(qY);function UY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ns,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=KO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function VY(t,e,r={}){let n=r.fs||Ns,i=WO(e,r);await Dd.fromCallback(n.writeFile)(t,i,r)}var HY=Dd.fromPromise(VY);function zY(t,e,r={}){let n=r.fs||Ns,i=WO(e,r);return n.writeFileSync(t,i,r)}var GY={readFile:MY,readFileSync:UY,writeFile:HY,writeFileSync:zY};YO.exports=GY});var ZO=y((hhe,XO)=>{"use strict";var vd=JO();XO.exports={readJson:vd.readFile,readJsonSync:vd.readFileSync,writeJson:vd.writeFile,writeJsonSync:vd.writeFileSync}});var bd=y((phe,tA)=>{"use strict";var WY=Wt().fromCallback,Qu=ht(),QO=require("path"),eA=kr(),KY=si().pathExists;function YY(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=QO.dirname(t);KY(i,(o,s)=>{if(o)return n(o);if(s)return Qu.writeFile(t,e,r,n);eA.mkdirs(i,a=>{if(a)return n(a);Qu.writeFile(t,e,r,n)})})}function JY(t,...e){let r=QO.dirname(t);if(Qu.existsSync(r))return Qu.writeFileSync(t,...e);eA.mkdirsSync(r),Qu.writeFileSync(t,...e)}tA.exports={outputFile:WY(YY),outputFileSync:JY}});var nA=y((mhe,rA)=>{"use strict";var{stringify:XY}=yd(),{outputFile:ZY}=bd();async function QY(t,e,r={}){let n=XY(e,r);await ZY(t,n,r)}rA.exports=QY});var oA=y((ghe,iA)=>{"use strict";var{stringify:eJ}=yd(),{outputFileSync:tJ}=bd();function rJ(t,e,r){let n=eJ(e,r);tJ(t,n,r)}iA.exports=rJ});var aA=y((yhe,sA)=>{"use strict";var nJ=Wt().fromPromise,Rt=ZO();Rt.outputJson=nJ(nA());Rt.outputJsonSync=oA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;sA.exports=Rt});var hA=y((Dhe,dA)=>{"use strict";var lA=ht(),iJ=require("path"),oJ=hD().copySync,fA=Xu().removeSync,sJ=kr().mkdirpSync,uA=zu();function aJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=uA.checkPathsSync(t,e,"move");return uA.checkParentPathsSync(t,i,e,"move"),sJ(iJ.dirname(e)),uJ(t,e,n)}function uJ(t,e,r){if(r)return fA(e),cA(t,e,r);if(lA.existsSync(e))throw new Error("dest already exists.");return cA(t,e,r)}function cA(t,e,r){try{lA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return cJ(t,e,r)}}function cJ(t,e,r){return oJ(t,e,{overwrite:r,errorOnExist:!0}),fA(t)}dA.exports=aJ});var mA=y((vhe,pA)=>{"use strict";pA.exports={moveSync:hA()}});var bA=y((bhe,vA)=>{"use strict";var lJ=ht(),fJ=require("path"),dJ=mD().copy,DA=Xu().remove,hJ=kr().mkdirp,pJ=si().pathExists,gA=zu();function mJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;gA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;gA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);hJ(fJ.dirname(e),c=>c?n(c):gJ(t,e,i,n))})})}function gJ(t,e,r,n){if(r)return DA(e,i=>i?n(i):yA(t,e,r,n));pJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):yA(t,e,r,n))}function yA(t,e,r,n){lJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):yJ(t,e,r,n):n())}function yJ(t,e,r,n){dJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):DA(t,n))}vA.exports=mJ});var _A=y((whe,wA)=>{"use strict";var DJ=Wt().fromCallback;wA.exports={move:DJ(bA())}});var wd=y((_he,yD)=>{"use strict";yD.exports={...Hu(),...hD(),...mD(),..._O(),...zO(),...aA(),...kr(),...mA(),..._A(),...bd(),...si(),...Xu()};var EA=require("fs");Object.getOwnPropertyDescriptor(EA,"promises")&&Object.defineProperty(yD.exports,"promises",{get(){return EA.promises}})});var DD=y(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.readdir=Ls.stat=void 0;var CA=wd();async function vJ(t){try{return await CA.stat(t)}catch{}}Ls.stat=vJ;async function bJ(t){try{return await CA.readdir(t)}catch{return[]}}Ls.readdir=bJ});var Bs=y(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var wJ=(x2(),Ae(S2)),vr=wd(),_J=require("os"),xn=require("path"),SA=require("stream"),xA=DD();wJ.__exportStar(wd(),re);var FA=DD();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return FA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return FA.readdir}});async function EJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=bD(t,n);e&&(a=a.pipe(new SA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=EJ;async function CJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),bD(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=CJ;async function SJ(t){try{return await vr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=SJ;async function vD(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=vr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=vD;async function xJ(t){return Promise.all([vD(t),(async()=>{try{return(await vr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=xJ;async function FJ(t,e){let r=await vD(t);await vr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=FJ;function OJ(t,e){return new Promise((r,n)=>{let i=vr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=OJ;async function ec(t,e){try{await vr.access(t,e)}catch{return!1}return!0}re.pathAccessible=ec;async function AJ(t){return ec(t,vr.constants.F_OK)}re.pathExists=AJ;async function kJ(t){return ec(t,vr.constants.R_OK)}re.pathReadable=kJ;async function TJ(t){return ec(t,vr.constants.W_OK)}re.pathWritable=TJ;async function OA(t){return ec(t,vr.constants.X_OK)}re.pathExecutable=OA;async function PJ(t){let[e,r]=await Promise.all([xA.stat(t),OA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=PJ;async function RJ(t,e){if(!(!t||!e)){for(let r of AA(t))if((await xA.readdir(r)).includes(e))return r}}re.findBaseDirectory=RJ;function $J(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve(_J.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=$J;function AA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=AA;var _d=class extends SA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}vr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?vr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=_d;function bD(t,e={}){return new _d(t,e)}re.walk=bD});var wD=y((She,kA)=>{var qs=1e3,Ms=qs*60,Us=Ms*60,co=Us*24,IJ=co*7,jJ=co*365.25;kA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return NJ(t);if(r==="number"&&isFinite(t))return e.long?BJ(t):LJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function NJ(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*jJ;case"weeks":case"week":case"w":return r*IJ;case"days":case"day":case"d":return r*co;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Us;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ms;case"seconds":case"second":case"secs":case"sec":case"s":return r*qs;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function LJ(t){var e=Math.abs(t);return e>=co?Math.round(t/co)+"d":e>=Us?Math.round(t/Us)+"h":e>=Ms?Math.round(t/Ms)+"m":e>=qs?Math.round(t/qs)+"s":t+"ms"}function BJ(t){var e=Math.abs(t);return e>=co?Ed(t,e,co,"day"):e>=Us?Ed(t,e,Us,"hour"):e>=Ms?Ed(t,e,Ms,"minute"):e>=qs?Ed(t,e,qs,"second"):t+" ms"}function Ed(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var _D=y((xhe,TA)=>{function qJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=wD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}TA.exports=qJ});var PA=y((or,Cd)=>{or.formatArgs=UJ;or.save=VJ;or.load=HJ;or.useColors=MJ;or.storage=zJ();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function MJ(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function UJ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Cd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function VJ(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function HJ(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function zJ(){try{return localStorage}catch{}}Cd.exports=_D()(or);var{formatters:GJ}=Cd.exports;GJ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $A=y((Fhe,RA)=>{"use strict";RA.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var SD=y((Ohe,jA)=>{"use strict";var WJ=require("os"),IA=require("tty"),br=$A(),{env:mt}=process,ci;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?ci=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(ci=1);"FORCE_COLOR"in mt&&(mt.FORCE_COLOR==="true"?ci=1:mt.FORCE_COLOR==="false"?ci=0:ci=mt.FORCE_COLOR.length===0?1:Math.min(parseInt(mt.FORCE_COLOR,10),3));function ED(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function CD(t,e){if(ci===0)return 0;if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2;if(t&&!e&&ci===void 0)return 0;let r=ci||0;if(mt.TERM==="dumb")return r;if(process.platform==="win32"){let n=WJ.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in mt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in mt)||mt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in mt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mt.TEAMCITY_VERSION)?1:0;if(mt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in mt){let n=parseInt((mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(mt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mt.TERM)||"COLORTERM"in mt?1:r}function KJ(t){let e=CD(t,t&&t.isTTY);return ED(e)}jA.exports={supportsColor:KJ,stdout:ED(CD(!0,IA.isatty(1))),stderr:ED(CD(!0,IA.isatty(2)))}});var LA=y((gt,xd)=>{var YJ=require("tty"),Sd=require("util");gt.init=rX;gt.log=QJ;gt.formatArgs=XJ;gt.save=eX;gt.load=tX;gt.useColors=JJ;gt.destroy=Sd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gt.colors=[6,2,3,4,5,1];try{let t=SD();t&&(t.stderr||t).level>=2&&(gt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}gt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function JJ(){return"colors"in gt.inspectOpts?!!gt.inspectOpts.colors:YJ.isatty(process.stderr.fd)}function XJ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
46
46
  `).join(`
47
- `+o),t.push(i+"m+"+xd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=QJ()+e+" "+t[0]}function QJ(){return gt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function eX(...t){return process.stderr.write(Sd.formatWithOptions(gt.inspectOpts,...t)+`
48
- `)}function tX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function rX(){return process.env.DEBUG}function nX(t){t.inspectOpts={};let e=Object.keys(gt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=gt.inspectOpts[e[r]]}xd.exports=_D()(gt);var{formatters:NA}=xd.exports;NA.o=function(t){return this.inspectOpts.colors=this.useColors,Sd.inspect(t,this.inspectOpts).split(`
49
- `).map(e=>e.trim()).join(" ")};NA.O=function(t){return this.inspectOpts.colors=this.useColors,Sd.inspect(t,this.inspectOpts)}});var BA=y((Ahe,xD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xD.exports=PA():xD.exports=LA()});var GA=y((khe,zA)=>{"use strict";var FD,MA,UA,VA,HA=!0;typeof process<"u"&&({FORCE_COLOR:FD,NODE_DISABLE_COLORS:MA,NO_COLOR:UA,TERM:VA}=process.env||{},HA=process.stdout&&process.stdout.isTTY);var we={enabled:!MA&&UA==null&&VA!=="dumb"&&(FD!=null&&FD!=="0"||HA),reset:Fe(0,0),bold:Fe(1,22),dim:Fe(2,22),italic:Fe(3,23),underline:Fe(4,24),inverse:Fe(7,27),hidden:Fe(8,28),strikethrough:Fe(9,29),black:Fe(30,39),red:Fe(31,39),green:Fe(32,39),yellow:Fe(33,39),blue:Fe(34,39),magenta:Fe(35,39),cyan:Fe(36,39),white:Fe(37,39),gray:Fe(90,39),grey:Fe(90,39),bgBlack:Fe(40,49),bgRed:Fe(41,49),bgGreen:Fe(42,49),bgYellow:Fe(43,49),bgBlue:Fe(44,49),bgMagenta:Fe(45,49),bgCyan:Fe(46,49),bgWhite:Fe(47,49)};function qA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function iX(t,e){let r={has:t,keys:e};return r.reset=we.reset.bind(r),r.bold=we.bold.bind(r),r.dim=we.dim.bind(r),r.italic=we.italic.bind(r),r.underline=we.underline.bind(r),r.inverse=we.inverse.bind(r),r.hidden=we.hidden.bind(r),r.strikethrough=we.strikethrough.bind(r),r.black=we.black.bind(r),r.red=we.red.bind(r),r.green=we.green.bind(r),r.yellow=we.yellow.bind(r),r.blue=we.blue.bind(r),r.magenta=we.magenta.bind(r),r.cyan=we.cyan.bind(r),r.white=we.white.bind(r),r.gray=we.gray.bind(r),r.grey=we.grey.bind(r),r.bgBlack=we.bgBlack.bind(r),r.bgRed=we.bgRed.bind(r),r.bgGreen=we.bgGreen.bind(r),r.bgYellow=we.bgYellow.bind(r),r.bgBlue=we.bgBlue.bind(r),r.bgMagenta=we.bgMagenta.bind(r),r.bgCyan=we.bgCyan.bind(r),r.bgWhite=we.bgWhite.bind(r),r}function Fe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:we.enabled?qA(this.keys,n+""):n+""):n===void 0?iX([t],[r]):we.enabled?qA([r],n+""):n+""}}zA.exports=we});var Vs=y(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.ancillary=tt.failure=tt.success=tt.input=tt.weak=tt.strong=void 0;var oX=(Cn(),Ae(En)),Yr=oX.__importDefault(GA());tt.strong=Yr.default.bold;tt.weak=Yr.default.dim;tt.input=Yr.default.cyan;tt.success=Yr.default.green;tt.failure=Yr.default.red;tt.ancillary=Yr.default.cyan;var sX={strong:tt.strong,weak:tt.weak,input:tt.input,success:tt.success,failure:tt.failure,ancillary:tt.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};tt.default=sX});var tc={};mn(tc,{__addDisposableResource:()=>h3,__assign:()=>Fd,__asyncDelegator:()=>o3,__asyncGenerator:()=>i3,__asyncValues:()=>s3,__await:()=>Hs,__awaiter:()=>ZA,__classPrivateFieldGet:()=>l3,__classPrivateFieldIn:()=>d3,__classPrivateFieldSet:()=>f3,__createBinding:()=>Ad,__decorate:()=>YA,__disposeResources:()=>p3,__esDecorate:()=>aX,__exportStar:()=>e3,__extends:()=>WA,__generator:()=>QA,__importDefault:()=>c3,__importStar:()=>u3,__makeTemplateObject:()=>a3,__metadata:()=>XA,__param:()=>JA,__propKey:()=>cX,__read:()=>AD,__rest:()=>KA,__runInitializers:()=>uX,__setFunctionName:()=>lX,__spread:()=>t3,__spreadArray:()=>n3,__spreadArrays:()=>r3,__values:()=>Od,default:()=>hX});function WA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");OD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function KA(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function YA(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function JA(t,e){return function(r,n){e(r,n,t)}}function aX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var b in n)p[b]=b==="access"?{}:n[b];for(var b in n.access)p.access[b]=n.access[b];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function uX(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function cX(t){return typeof t=="symbol"?t:"".concat(t)}function lX(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function XA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ZA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function QA(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function e3(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ad(e,t,r)}function Od(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function AD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function t3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(AD(arguments[e]));return t}function r3(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function n3(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Hs(t){return this instanceof Hs?(this.v=t,this):new Hs(t)}function i3(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,b){o.push([h,d,p,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Hs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function o3(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Hs(t[i](s)),done:!1}:o?o(s):s}:o}}function s3(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Od=="function"?Od(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function a3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function u3(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Ad(e,t,r);return fX(e,t),e}function c3(t){return t&&t.__esModule?t:{default:t}}function l3(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function f3(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function d3(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function h3(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function p3(t){function e(n){t.error=t.hasError?new dX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var OD,Fd,Ad,fX,dX,hX,rc=ct(()=>{OD=function(t,e){return OD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},OD(t,e)};Fd=function(){return Fd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Fd.apply(this,arguments)};Ad=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};fX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};dX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};hX={__extends:WA,__assign:Fd,__rest:KA,__decorate:YA,__param:JA,__metadata:XA,__awaiter:ZA,__generator:QA,__createBinding:Ad,__exportStar:e3,__values:Od,__read:AD,__spread:t3,__spreadArrays:r3,__spreadArray:n3,__await:Hs,__asyncGenerator:i3,__asyncDelegator:o3,__asyncValues:s3,__makeTemplateObject:a3,__importStar:u3,__importDefault:c3,__classPrivateFieldGet:l3,__classPrivateFieldSet:f3,__classPrivateFieldIn:d3,__addDisposableResource:h3,__disposeResources:p3}});var kD=y(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.EscapeCode=void 0;var Tr="\x1B[",yt=class{};kd.EscapeCode=yt;yt.cursorLeft=()=>`${Tr}G`;yt.cursorUp=(t=1)=>`${Tr}${t}A`;yt.cursorDown=(t=1)=>`${Tr}${t}B`;yt.cursorForward=(t=1)=>`${Tr}${t}C`;yt.cursorBackward=(t=1)=>`${Tr}${t}D`;yt.cursorHide=()=>`${Tr}?25l`;yt.cursorShow=()=>`${Tr}?25h`;yt.eraseLine=()=>`${Tr}2K`;yt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=yt.eraseLine(),r<t-1&&(e+=yt.cursorUp());return`${e}${yt.cursorLeft()}`};yt.eraseUp=()=>`${Tr}1J`;yt.eraseDown=()=>`${Tr}J`;yt.eraseScreen=()=>`${Tr}2J`});var g3=y(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.Cursor=void 0;var pX=(rc(),Ae(tc)),mX=pX.__importDefault(Hy()),m3=kD(),zs=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(m3.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,mX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(m3.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Td.Cursor=zs;zs.stream=process.stderr;zs._isVisible=!0;zs._listenerAttached=!1});var PD=y(($he,TD)=>{"use strict";var y3=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);TD.exports=y3;TD.exports.default=y3});var b3=y((Ihe,v3)=>{"use strict";var D3="[\uD800-\uDBFF][\uDC00-\uDFFF]",gX=t=>t&&t.exact?new RegExp(`^${D3}$`):new RegExp(D3,"g");v3.exports=gX});var _3=y((jhe,w3)=>{"use strict";w3.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var RD=y((Nhe,C3)=>{var nc=_3(),E3={};for(let t of Object.keys(nc))E3[nc[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};C3.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function yX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=E3[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(nc)){let o=nc[i],s=yX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return nc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var x3=y((Lhe,S3)=>{var Pd=RD();function DX(){let t={},e=Object.keys(Pd);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function vX(t){let e=DX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Pd[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function bX(t,e){return function(r){return e(t(r))}}function wX(t,e){let r=[e[t].parent,t],n=Pd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=bX(Pd[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}S3.exports=function(t){let e=vX(t),r={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=wX(s,e))}return r}});var O3=y((Bhe,F3)=>{var $D=RD(),_X=x3(),Gs={},EX=Object.keys($D);function CX(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function SX(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}EX.forEach(t=>{Gs[t]={},Object.defineProperty(Gs[t],"channels",{value:$D[t].channels}),Object.defineProperty(Gs[t],"labels",{value:$D[t].labels});let e=_X(t);Object.keys(e).forEach(n=>{let i=e[n];Gs[t][n]=SX(i),Gs[t][n].raw=CX(i)})});F3.exports=Gs});var jD=y((qhe,R3)=>{"use strict";var A3=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,k3=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},T3=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Rd=t=>t,P3=(t,e,r)=>[t,e,r],Ws=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},ID,Ks=(t,e,r,n)=>{ID===void 0&&(ID=O3());let i=n?10:0,o={};for(let[s,a]of Object.entries(ID)){let u=s==="ansi16"?"ansi":s;s===e?o[u]=t(r,i):typeof a=="object"&&(o[u]=t(a[e],i))}return o};function xX(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,o]of Object.entries(n))e[i]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[i]=e[i],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Ws(e.color,"ansi",()=>Ks(A3,"ansi16",Rd,!1)),Ws(e.color,"ansi256",()=>Ks(k3,"ansi256",Rd,!1)),Ws(e.color,"ansi16m",()=>Ks(T3,"rgb",P3,!1)),Ws(e.bgColor,"ansi",()=>Ks(A3,"ansi16",Rd,!0)),Ws(e.bgColor,"ansi256",()=>Ks(k3,"ansi256",Rd,!0)),Ws(e.bgColor,"ansi16m",()=>Ks(T3,"rgb",P3,!0)),e}Object.defineProperty(R3,"exports",{enumerable:!0,get:xX})});var L3=y((Mhe,N3)=>{"use strict";var FX=PD(),OX=b3(),$3=jD(),j3=["\x1B","\x9B"],$d=t=>`${j3[0]}[${t}m`,I3=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=$3.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push($d(e?s:o)):t.splice(a,1)}else if(e){n.push($d(0));break}else n.push($d(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=$d($3.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};N3.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(j3.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!OX({exact:!0}).test(f)&&FX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=I3(i);else if(u>=o){c+=I3(i,!0,a);break}}return c}});var q3=y((Uhe,B3)=>{"use strict";B3.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Id=y((Vhe,M3)=>{"use strict";var AX=q3();M3.exports=t=>typeof t=="string"?t.replace(AX(),""):t});var V3=y((Hhe,U3)=>{"use strict";U3.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var LD=y((zhe,ND)=>{"use strict";var kX=Id(),TX=PD(),PX=V3(),H3=t=>{if(typeof t!="string"||t.length===0||(t=kX(t),t.length===0))return 0;t=t.replace(PX()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=TX(n)?2:1)}return e};ND.exports=H3;ND.exports.default=H3});var J3=y((Ghe,Y3)=>{"use strict";var ic=LD(),RX=Id(),$X=jD(),jd=new Set(["\x1B","\x9B"]),IX=39,qD="\x07",W3="[",jX="]",K3="m",MD=`${jX}8;;`,z3=t=>`${jd.values().next().value}${W3}${t}${K3}`,G3=t=>`${jd.values().next().value}${MD}${t}${qD}`,NX=t=>t.split(" ").map(e=>ic(e)),BD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ic(RX(t[t.length-1]));for(let[a,u]of n.entries()){let c=ic(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),jd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(MD)),i){o?u===qD&&(i=!1,o=!1):u===K3&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},LX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ic(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},BX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=NX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ic(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),BD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){BD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){BD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(LX));let u=[...a.join(`
50
- `)];for(let[c,l]of u.entries()){if(n+=l,jd.has(l)){let{groups:h}=new RegExp(`(?:\\${W3}(?<code>\\d+)m|\\${MD}(?<uri>.*)${qD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===IX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=$X.codes.get(Number(i));u[c+1]===`
51
- `?(o&&(n+=G3("")),i&&f&&(n+=z3(f))):l===`
52
- `&&(i&&f&&(n+=z3(i)),o&&(n+=G3(o)))}return n};Y3.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
47
+ `+o),t.push(i+"m+"+xd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=ZJ()+e+" "+t[0]}function ZJ(){return gt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function QJ(...t){return process.stderr.write(Sd.formatWithOptions(gt.inspectOpts,...t)+`
48
+ `)}function eX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function tX(){return process.env.DEBUG}function rX(t){t.inspectOpts={};let e=Object.keys(gt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=gt.inspectOpts[e[r]]}xd.exports=_D()(gt);var{formatters:NA}=xd.exports;NA.o=function(t){return this.inspectOpts.colors=this.useColors,Sd.inspect(t,this.inspectOpts).split(`
49
+ `).map(e=>e.trim()).join(" ")};NA.O=function(t){return this.inspectOpts.colors=this.useColors,Sd.inspect(t,this.inspectOpts)}});var BA=y((Ahe,xD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xD.exports=PA():xD.exports=LA()});var GA=y((khe,zA)=>{"use strict";var FD,MA,UA,VA,HA=!0;typeof process<"u"&&({FORCE_COLOR:FD,NODE_DISABLE_COLORS:MA,NO_COLOR:UA,TERM:VA}=process.env||{},HA=process.stdout&&process.stdout.isTTY);var we={enabled:!MA&&UA==null&&VA!=="dumb"&&(FD!=null&&FD!=="0"||HA),reset:Fe(0,0),bold:Fe(1,22),dim:Fe(2,22),italic:Fe(3,23),underline:Fe(4,24),inverse:Fe(7,27),hidden:Fe(8,28),strikethrough:Fe(9,29),black:Fe(30,39),red:Fe(31,39),green:Fe(32,39),yellow:Fe(33,39),blue:Fe(34,39),magenta:Fe(35,39),cyan:Fe(36,39),white:Fe(37,39),gray:Fe(90,39),grey:Fe(90,39),bgBlack:Fe(40,49),bgRed:Fe(41,49),bgGreen:Fe(42,49),bgYellow:Fe(43,49),bgBlue:Fe(44,49),bgMagenta:Fe(45,49),bgCyan:Fe(46,49),bgWhite:Fe(47,49)};function qA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function nX(t,e){let r={has:t,keys:e};return r.reset=we.reset.bind(r),r.bold=we.bold.bind(r),r.dim=we.dim.bind(r),r.italic=we.italic.bind(r),r.underline=we.underline.bind(r),r.inverse=we.inverse.bind(r),r.hidden=we.hidden.bind(r),r.strikethrough=we.strikethrough.bind(r),r.black=we.black.bind(r),r.red=we.red.bind(r),r.green=we.green.bind(r),r.yellow=we.yellow.bind(r),r.blue=we.blue.bind(r),r.magenta=we.magenta.bind(r),r.cyan=we.cyan.bind(r),r.white=we.white.bind(r),r.gray=we.gray.bind(r),r.grey=we.grey.bind(r),r.bgBlack=we.bgBlack.bind(r),r.bgRed=we.bgRed.bind(r),r.bgGreen=we.bgGreen.bind(r),r.bgYellow=we.bgYellow.bind(r),r.bgBlue=we.bgBlue.bind(r),r.bgMagenta=we.bgMagenta.bind(r),r.bgCyan=we.bgCyan.bind(r),r.bgWhite=we.bgWhite.bind(r),r}function Fe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:we.enabled?qA(this.keys,n+""):n+""):n===void 0?nX([t],[r]):we.enabled?qA([r],n+""):n+""}}zA.exports=we});var Vs=y(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.ancillary=tt.failure=tt.success=tt.input=tt.weak=tt.strong=void 0;var iX=(Cn(),Ae(En)),Yr=iX.__importDefault(GA());tt.strong=Yr.default.bold;tt.weak=Yr.default.dim;tt.input=Yr.default.cyan;tt.success=Yr.default.green;tt.failure=Yr.default.red;tt.ancillary=Yr.default.cyan;var oX={strong:tt.strong,weak:tt.weak,input:tt.input,success:tt.success,failure:tt.failure,ancillary:tt.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};tt.default=oX});var tc={};mn(tc,{__addDisposableResource:()=>hk,__assign:()=>Fd,__asyncDelegator:()=>ok,__asyncGenerator:()=>ik,__asyncValues:()=>sk,__await:()=>Hs,__awaiter:()=>ZA,__classPrivateFieldGet:()=>lk,__classPrivateFieldIn:()=>dk,__classPrivateFieldSet:()=>fk,__createBinding:()=>Ad,__decorate:()=>YA,__disposeResources:()=>pk,__esDecorate:()=>sX,__exportStar:()=>ek,__extends:()=>WA,__generator:()=>QA,__importDefault:()=>ck,__importStar:()=>uk,__makeTemplateObject:()=>ak,__metadata:()=>XA,__param:()=>JA,__propKey:()=>uX,__read:()=>AD,__rest:()=>KA,__runInitializers:()=>aX,__setFunctionName:()=>cX,__spread:()=>tk,__spreadArray:()=>nk,__spreadArrays:()=>rk,__values:()=>Od,default:()=>dX});function WA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");OD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function KA(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function YA(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function JA(t,e){return function(r,n){e(r,n,t)}}function sX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var b in n)p[b]=b==="access"?{}:n[b];for(var b in n.access)p.access[b]=n.access[b];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function aX(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function uX(t){return typeof t=="symbol"?t:"".concat(t)}function cX(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function XA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ZA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function QA(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ek(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ad(e,t,r)}function Od(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function AD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function tk(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(AD(arguments[e]));return t}function rk(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function nk(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Hs(t){return this instanceof Hs?(this.v=t,this):new Hs(t)}function ik(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,b){o.push([h,d,p,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Hs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function ok(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Hs(t[i](s)),done:!1}:o?o(s):s}:o}}function sk(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Od=="function"?Od(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function ak(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function uk(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Ad(e,t,r);return lX(e,t),e}function ck(t){return t&&t.__esModule?t:{default:t}}function lk(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function fk(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function dk(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function hk(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function pk(t){function e(n){t.error=t.hasError?new fX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var OD,Fd,Ad,lX,fX,dX,rc=ct(()=>{OD=function(t,e){return OD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},OD(t,e)};Fd=function(){return Fd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Fd.apply(this,arguments)};Ad=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};lX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};fX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};dX={__extends:WA,__assign:Fd,__rest:KA,__decorate:YA,__param:JA,__metadata:XA,__awaiter:ZA,__generator:QA,__createBinding:Ad,__exportStar:ek,__values:Od,__read:AD,__spread:tk,__spreadArrays:rk,__spreadArray:nk,__await:Hs,__asyncGenerator:ik,__asyncDelegator:ok,__asyncValues:sk,__makeTemplateObject:ak,__importStar:uk,__importDefault:ck,__classPrivateFieldGet:lk,__classPrivateFieldSet:fk,__classPrivateFieldIn:dk,__addDisposableResource:hk,__disposeResources:pk}});var kD=y(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.EscapeCode=void 0;var Tr="\x1B[",yt=class{};kd.EscapeCode=yt;yt.cursorLeft=()=>`${Tr}G`;yt.cursorUp=(t=1)=>`${Tr}${t}A`;yt.cursorDown=(t=1)=>`${Tr}${t}B`;yt.cursorForward=(t=1)=>`${Tr}${t}C`;yt.cursorBackward=(t=1)=>`${Tr}${t}D`;yt.cursorHide=()=>`${Tr}?25l`;yt.cursorShow=()=>`${Tr}?25h`;yt.eraseLine=()=>`${Tr}2K`;yt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=yt.eraseLine(),r<t-1&&(e+=yt.cursorUp());return`${e}${yt.cursorLeft()}`};yt.eraseUp=()=>`${Tr}1J`;yt.eraseDown=()=>`${Tr}J`;yt.eraseScreen=()=>`${Tr}2J`});var gk=y(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.Cursor=void 0;var hX=(rc(),Ae(tc)),pX=hX.__importDefault(Hy()),mk=kD(),zs=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(mk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,pX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(mk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Td.Cursor=zs;zs.stream=process.stderr;zs._isVisible=!0;zs._listenerAttached=!1});var PD=y(($he,TD)=>{"use strict";var yk=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);TD.exports=yk;TD.exports.default=yk});var bk=y((Ihe,vk)=>{"use strict";var Dk="[\uD800-\uDBFF][\uDC00-\uDFFF]",mX=t=>t&&t.exact?new RegExp(`^${Dk}$`):new RegExp(Dk,"g");vk.exports=mX});var _k=y((jhe,wk)=>{"use strict";wk.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var RD=y((Nhe,Ck)=>{var nc=_k(),Ek={};for(let t of Object.keys(nc))Ek[nc[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ck.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function gX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=Ek[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(nc)){let o=nc[i],s=gX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return nc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var xk=y((Lhe,Sk)=>{var Pd=RD();function yX(){let t={},e=Object.keys(Pd);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function DX(t){let e=yX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Pd[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function vX(t,e){return function(r){return e(t(r))}}function bX(t,e){let r=[e[t].parent,t],n=Pd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=vX(Pd[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}Sk.exports=function(t){let e=DX(t),r={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=bX(s,e))}return r}});var Ok=y((Bhe,Fk)=>{var $D=RD(),wX=xk(),Gs={},_X=Object.keys($D);function EX(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function CX(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}_X.forEach(t=>{Gs[t]={},Object.defineProperty(Gs[t],"channels",{value:$D[t].channels}),Object.defineProperty(Gs[t],"labels",{value:$D[t].labels});let e=wX(t);Object.keys(e).forEach(n=>{let i=e[n];Gs[t][n]=CX(i),Gs[t][n].raw=EX(i)})});Fk.exports=Gs});var jD=y((qhe,Rk)=>{"use strict";var Ak=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,kk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},Tk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Rd=t=>t,Pk=(t,e,r)=>[t,e,r],Ws=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},ID,Ks=(t,e,r,n)=>{ID===void 0&&(ID=Ok());let i=n?10:0,o={};for(let[s,a]of Object.entries(ID)){let u=s==="ansi16"?"ansi":s;s===e?o[u]=t(r,i):typeof a=="object"&&(o[u]=t(a[e],i))}return o};function SX(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,o]of Object.entries(n))e[i]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[i]=e[i],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Ws(e.color,"ansi",()=>Ks(Ak,"ansi16",Rd,!1)),Ws(e.color,"ansi256",()=>Ks(kk,"ansi256",Rd,!1)),Ws(e.color,"ansi16m",()=>Ks(Tk,"rgb",Pk,!1)),Ws(e.bgColor,"ansi",()=>Ks(Ak,"ansi16",Rd,!0)),Ws(e.bgColor,"ansi256",()=>Ks(kk,"ansi256",Rd,!0)),Ws(e.bgColor,"ansi16m",()=>Ks(Tk,"rgb",Pk,!0)),e}Object.defineProperty(Rk,"exports",{enumerable:!0,get:SX})});var Lk=y((Mhe,Nk)=>{"use strict";var xX=PD(),FX=bk(),$k=jD(),jk=["\x1B","\x9B"],$d=t=>`${jk[0]}[${t}m`,Ik=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=$k.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push($d(e?s:o)):t.splice(a,1)}else if(e){n.push($d(0));break}else n.push($d(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=$d($k.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};Nk.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(jk.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!FX({exact:!0}).test(f)&&xX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=Ik(i);else if(u>=o){c+=Ik(i,!0,a);break}}return c}});var qk=y((Uhe,Bk)=>{"use strict";Bk.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Id=y((Vhe,Mk)=>{"use strict";var OX=qk();Mk.exports=t=>typeof t=="string"?t.replace(OX(),""):t});var Vk=y((Hhe,Uk)=>{"use strict";Uk.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var LD=y((zhe,ND)=>{"use strict";var AX=Id(),kX=PD(),TX=Vk(),Hk=t=>{if(typeof t!="string"||t.length===0||(t=AX(t),t.length===0))return 0;t=t.replace(TX()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=kX(n)?2:1)}return e};ND.exports=Hk;ND.exports.default=Hk});var Jk=y((Ghe,Yk)=>{"use strict";var ic=LD(),PX=Id(),RX=jD(),jd=new Set(["\x1B","\x9B"]),$X=39,qD="\x07",Wk="[",IX="]",Kk="m",MD=`${IX}8;;`,zk=t=>`${jd.values().next().value}${Wk}${t}${Kk}`,Gk=t=>`${jd.values().next().value}${MD}${t}${qD}`,jX=t=>t.split(" ").map(e=>ic(e)),BD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ic(PX(t[t.length-1]));for(let[a,u]of n.entries()){let c=ic(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),jd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(MD)),i){o?u===qD&&(i=!1,o=!1):u===Kk&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},NX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ic(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},LX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=jX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ic(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),BD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){BD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){BD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(NX));let u=[...a.join(`
50
+ `)];for(let[c,l]of u.entries()){if(n+=l,jd.has(l)){let{groups:h}=new RegExp(`(?:\\${Wk}(?<code>\\d+)m|\\${MD}(?<uri>.*)${qD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===$X?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=RX.codes.get(Number(i));u[c+1]===`
51
+ `?(o&&(n+=Gk("")),i&&f&&(n+=zk(f))):l===`
52
+ `&&(i&&f&&(n+=zk(i)),o&&(n+=Gk(o)))}return n};Yk.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
53
53
  `).split(`
54
- `).map(n=>BX(n,e,r)).join(`
55
- `)});var Q3=y((Whe,Z3)=>{"use strict";var qX=require("os"),X3=qX.homedir();Z3.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return X3?t.replace(/^~(?=$|\/|\\)/,X3):t}});var ok=y(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.columnar=ze.generateFillSpaceStringList=ze.expandPath=ze.prettyPath=ze.wordWrap=ze.indent=ze.TTY_WIDTH=ze.stripAnsi=ze.stringWidth=ze.sliceAnsi=void 0;var ek=(rc(),Ae(tc)),MX=ek.__importStar(require("os")),Fn=ek.__importStar(require("path")),tk=L3();ze.sliceAnsi=tk;var Nd=LD();ze.stringWidth=Nd;var UX=Id();ze.stripAnsi=UX;var VX=J3(),HX=Q3(),zX=80,GX=120;ze.TTY_WIDTH=process.stdout.columns?Math.max(zX,Math.min(process.stdout.columns,GX)):1/0;function rk(t=4){return" ".repeat(t)}ze.indent=rk;function WX(t,{width:e=ze.TTY_WIDTH,indentation:r=0,append:n=""}){return VX(t,e-r-n.length,{trim:!0}).split(`
54
+ `).map(n=>LX(n,e,r)).join(`
55
+ `)});var Qk=y((Whe,Zk)=>{"use strict";var BX=require("os"),Xk=BX.homedir();Zk.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Xk?t.replace(/^~(?=$|\/|\\)/,Xk):t}});var o3=y(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.columnar=ze.generateFillSpaceStringList=ze.expandPath=ze.prettyPath=ze.wordWrap=ze.indent=ze.TTY_WIDTH=ze.stripAnsi=ze.stringWidth=ze.sliceAnsi=void 0;var e3=(rc(),Ae(tc)),qX=e3.__importStar(require("os")),Fn=e3.__importStar(require("path")),t3=Lk();ze.sliceAnsi=t3;var Nd=LD();ze.stringWidth=Nd;var MX=Id();ze.stripAnsi=MX;var UX=Jk(),VX=Qk(),HX=80,zX=120;ze.TTY_WIDTH=process.stdout.columns?Math.max(HX,Math.min(process.stdout.columns,zX)):1/0;function r3(t=4){return" ".repeat(t)}ze.indent=r3;function GX(t,{width:e=ze.TTY_WIDTH,indentation:r=0,append:n=""}){return UX(t,e-r-n.length,{trim:!0}).split(`
56
56
  `).join(`${n}
57
- ${rk(r)}`)}ze.wordWrap=WX;function KX(t){t=nk(t);let e=process.cwd(),r=Fn.dirname(t),n=MX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}ze.prettyPath=KX;function nk(t){return Fn.resolve(HX(t))}ze.expandPath=nk;function ik(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>Nd(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>tk(o,0,i-Nd(s)))}ze.generateFillSpaceStringList=ik;function YX(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let p=d.split(`
58
- `);return f=Math.max(f,p.length),p});for(let d in l)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((l,f)=>{if(f<o-1){let h=ik(l);return l.map((d,p)=>`${d}${h[p]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,f)=>l.map((h,d)=>{let p=l[d]+f[d];return u=Math.max(u,Nd(p)),p}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
59
- `)}ze.columnar=YX});var UD=y((Yhe,sk)=>{function JX(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=wD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}sk.exports=JX});var ak=y((sr,Ld)=>{sr.formatArgs=ZX;sr.save=QX;sr.load=eZ;sr.useColors=XX;sr.storage=tZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function XX(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ZX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Ld.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function QX(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function eZ(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function tZ(){try{return localStorage}catch{}}Ld.exports=UD()(sr);var{formatters:rZ}=Ld.exports;rZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ck=y((Dt,qd)=>{var nZ=require("tty"),Bd=require("util");Dt.init=lZ;Dt.log=aZ;Dt.formatArgs=oZ;Dt.save=uZ;Dt.load=cZ;Dt.useColors=iZ;Dt.destroy=Bd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Dt.colors=[6,2,3,4,5,1];try{let t=SD();t&&(t.stderr||t).level>=2&&(Dt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Dt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function iZ(){return"colors"in Dt.inspectOpts?!!Dt.inspectOpts.colors:nZ.isatty(process.stderr.fd)}function oZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
57
+ ${r3(r)}`)}ze.wordWrap=GX;function WX(t){t=n3(t);let e=process.cwd(),r=Fn.dirname(t),n=qX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}ze.prettyPath=WX;function n3(t){return Fn.resolve(VX(t))}ze.expandPath=n3;function i3(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>Nd(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>t3(o,0,i-Nd(s)))}ze.generateFillSpaceStringList=i3;function KX(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let p=d.split(`
58
+ `);return f=Math.max(f,p.length),p});for(let d in l)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((l,f)=>{if(f<o-1){let h=i3(l);return l.map((d,p)=>`${d}${h[p]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,f)=>l.map((h,d)=>{let p=l[d]+f[d];return u=Math.max(u,Nd(p)),p}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
59
+ `)}ze.columnar=KX});var UD=y((Yhe,s3)=>{function YX(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=wD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}s3.exports=YX});var a3=y((sr,Ld)=>{sr.formatArgs=XX;sr.save=ZX;sr.load=QX;sr.useColors=JX;sr.storage=eZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function JX(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function XX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Ld.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function ZX(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function QX(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function eZ(){try{return localStorage}catch{}}Ld.exports=UD()(sr);var{formatters:tZ}=Ld.exports;tZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var c3=y((Dt,qd)=>{var rZ=require("tty"),Bd=require("util");Dt.init=cZ;Dt.log=sZ;Dt.formatArgs=iZ;Dt.save=aZ;Dt.load=uZ;Dt.useColors=nZ;Dt.destroy=Bd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Dt.colors=[6,2,3,4,5,1];try{let t=SD();t&&(t.stderr||t).level>=2&&(Dt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Dt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function nZ(){return"colors"in Dt.inspectOpts?!!Dt.inspectOpts.colors:rZ.isatty(process.stderr.fd)}function iZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
60
60
  `).join(`
61
- `+o),t.push(i+"m+"+qd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=sZ()+e+" "+t[0]}function sZ(){return Dt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function aZ(...t){return process.stderr.write(Bd.formatWithOptions(Dt.inspectOpts,...t)+`
62
- `)}function uZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function cZ(){return process.env.DEBUG}function lZ(t){t.inspectOpts={};let e=Object.keys(Dt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Dt.inspectOpts[e[r]]}qd.exports=UD()(Dt);var{formatters:uk}=qd.exports;uk.o=function(t){return this.inspectOpts.colors=this.useColors,Bd.inspect(t,this.inspectOpts).split(`
63
- `).map(e=>e.trim()).join(" ")};uk.O=function(t){return this.inspectOpts.colors=this.useColors,Bd.inspect(t,this.inspectOpts)}});var lk=y((Jhe,VD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?VD.exports=ak():VD.exports=ck()});var fk=y(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.TERMINAL_INFO=br.CI_ENVIRONMENT_VARIABLES_DETECTED=br.CI_ENVIRONMENT_VARIABLES=void 0;var fZ=(rc(),Ae(tc)),dZ=lk(),hZ=fZ.__importStar(require("os")),pZ=(0,dZ.debug)("ionic:utils-terminal:info");br.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];br.CI_ENVIRONMENT_VARIABLES_DETECTED=br.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function mZ(){let{shell:t}=hZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}br.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&pZ(`Environment variables for CI detected: ${br.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);br.TERMINAL_INFO=Object.freeze({ci:br.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:mZ(),tty:!!(process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY),windows:process.platform==="win32"||!!(process.env.OSTYPE&&/^(msys|cygwin)$/.test(process.env.OSTYPE)||process.env.MSYSTEM&&/^MINGW(32|64)$/.test(process.env.MSYSTEM))})});var HD=y(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});var Md=(rc(),Ae(tc));Md.__exportStar(kD(),Ys);Md.__exportStar(g3(),Ys);Md.__exportStar(ok(),Ys);Md.__exportStar(fk(),Ys)});var Vd=y(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var Ud=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=Ud;var oc=class extends Ud{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=oc;function gZ(t){throw new oc(t)}Jr.fatal=gZ;function yZ(t){return t&&t instanceof oc}Jr.isFatal=yZ});var WD={};mn(WD,{LOGGER_LEVELS:()=>SZ,Logger:()=>GD,NO_COLORS:()=>dk,StreamOutputStrategy:()=>Hd,TTYOutputStrategy:()=>zD,TTY_WIDTH:()=>DZ,createDefaultLogger:()=>CZ,indent:()=>vZ,sliceAnsi:()=>bZ,stringWidth:()=>wZ,stripAnsi:()=>_Z,wordWrap:()=>EZ});var DZ,vZ,bZ,wZ,_Z,EZ,CZ,dk,Hd,zD,GD,SZ,KD=ct(()=>{DZ=80,vZ=t=>t,bZ=t=>t,wZ=t=>t.length,_Z=t=>t,EZ=t=>t,CZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),dk={},Hd=class{constructor(){this.colors=dk,this.stream=process.stdout}},zD=class extends Hd{constructor(e){super(),this.options=e}},GD=class{constructor(){}info(){}warn(){}error(){}debug(){}},SZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var pk=y(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.isInteractive=lo.checkInteractive=void 0;var xZ=(Cn(),Ae(En)),hk=HD(),FZ=xZ.__importDefault(Vs()),OZ=sc(),AZ=(...t)=>(0,lo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(OZ.logger.error(`Non-interactive shell detected.
64
- Run the command with ${FZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;lo.checkInteractive=AZ;var kZ=()=>hk.TERMINAL_INFO.tty&&!hk.TERMINAL_INFO.ci;lo.isInteractive=kZ});var Ge=y((tpe,gk)=>{"use strict";var{FORCE_COLOR:TZ,NODE_DISABLE_COLORS:PZ,TERM:RZ}=process.env,_e={enabled:!PZ&&RZ!=="dumb"&&TZ!=="0",reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function mk(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function $Z(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?mk(this.keys,n+""):n+""):n===void 0?$Z([t],[r]):_e.enabled?mk([r],n+""):n+""}}gk.exports=_e});var Dk=y((rpe,yk)=>{"use strict";yk.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var zd=y((npe,vk)=>{"use strict";vk.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var Ck=y((ipe,Ek)=>{"use strict";function IZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=jZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function jZ(t,e){if(t){if(typeof t=="string")return bk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bk(t,e)}}function bk(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var NZ=zd(),_k=ke(),wk=_k.erase,LZ=_k.cursor,BZ=t=>[...NZ(t)].length;Ek.exports=function(t,e){if(!e)return wk.line+LZ.to(0);let r=0,n=t.split(/\r?\n/);var i=IZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(BZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return wk.lines(r)}});var YD=y((ope,Sk)=>{"use strict";var ac={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},qZ={arrowUp:ac.arrowUp,arrowDown:ac.arrowDown,arrowLeft:ac.arrowLeft,arrowRight:ac.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},MZ=process.platform==="win32"?qZ:ac;Sk.exports=MZ});var Fk=y((spe,xk)=>{"use strict";var Js=Ge(),fo=YD(),JD=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),UZ=t=>JD[t]||JD.default,uc=Object.freeze({aborted:Js.red(fo.cross),done:Js.green(fo.tick),exited:Js.yellow(fo.cross),default:Js.cyan("?")}),VZ=(t,e,r)=>e?uc.aborted:r?uc.exited:t?uc.done:uc.default,HZ=t=>Js.gray(t?fo.ellipsis:fo.pointerSmall),zZ=(t,e)=>Js.gray(t?e?fo.pointerSmall:"+":fo.line);xk.exports={styles:JD,render:UZ,symbols:uc,symbol:VZ,delimiter:HZ,item:zZ}});var Ak=y((ape,Ok)=>{"use strict";var GZ=zd();Ok.exports=function(t,e){let r=String(GZ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var Tk=y((upe,kk)=>{"use strict";kk.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
61
+ `+o),t.push(i+"m+"+qd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=oZ()+e+" "+t[0]}function oZ(){return Dt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function sZ(...t){return process.stderr.write(Bd.formatWithOptions(Dt.inspectOpts,...t)+`
62
+ `)}function aZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function uZ(){return process.env.DEBUG}function cZ(t){t.inspectOpts={};let e=Object.keys(Dt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Dt.inspectOpts[e[r]]}qd.exports=UD()(Dt);var{formatters:u3}=qd.exports;u3.o=function(t){return this.inspectOpts.colors=this.useColors,Bd.inspect(t,this.inspectOpts).split(`
63
+ `).map(e=>e.trim()).join(" ")};u3.O=function(t){return this.inspectOpts.colors=this.useColors,Bd.inspect(t,this.inspectOpts)}});var l3=y((Jhe,VD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?VD.exports=a3():VD.exports=c3()});var f3=y(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.TERMINAL_INFO=wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES=void 0;var lZ=(rc(),Ae(tc)),fZ=l3(),dZ=lZ.__importStar(require("os")),hZ=(0,fZ.debug)("ionic:utils-terminal:info");wr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function pZ(){let{shell:t}=dZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&hZ(`Environment variables for CI detected: ${wr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);wr.TERMINAL_INFO=Object.freeze({ci:wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:pZ(),tty:!!(process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY),windows:process.platform==="win32"||!!(process.env.OSTYPE&&/^(msys|cygwin)$/.test(process.env.OSTYPE)||process.env.MSYSTEM&&/^MINGW(32|64)$/.test(process.env.MSYSTEM))})});var HD=y(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});var Md=(rc(),Ae(tc));Md.__exportStar(kD(),Ys);Md.__exportStar(gk(),Ys);Md.__exportStar(o3(),Ys);Md.__exportStar(f3(),Ys)});var Vd=y(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var Ud=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=Ud;var oc=class extends Ud{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=oc;function mZ(t){throw new oc(t)}Jr.fatal=mZ;function gZ(t){return t&&t instanceof oc}Jr.isFatal=gZ});var WD={};mn(WD,{LOGGER_LEVELS:()=>CZ,Logger:()=>GD,NO_COLORS:()=>d3,StreamOutputStrategy:()=>Hd,TTYOutputStrategy:()=>zD,TTY_WIDTH:()=>yZ,createDefaultLogger:()=>EZ,indent:()=>DZ,sliceAnsi:()=>vZ,stringWidth:()=>bZ,stripAnsi:()=>wZ,wordWrap:()=>_Z});var yZ,DZ,vZ,bZ,wZ,_Z,EZ,d3,Hd,zD,GD,CZ,KD=ct(()=>{yZ=80,DZ=t=>t,vZ=t=>t,bZ=t=>t.length,wZ=t=>t,_Z=t=>t,EZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),d3={},Hd=class{constructor(){this.colors=d3,this.stream=process.stdout}},zD=class extends Hd{constructor(e){super(),this.options=e}},GD=class{constructor(){}info(){}warn(){}error(){}debug(){}},CZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var p3=y(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.isInteractive=lo.checkInteractive=void 0;var SZ=(Cn(),Ae(En)),h3=HD(),xZ=SZ.__importDefault(Vs()),FZ=sc(),OZ=(...t)=>(0,lo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(FZ.logger.error(`Non-interactive shell detected.
64
+ Run the command with ${xZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;lo.checkInteractive=OZ;var AZ=()=>h3.TERMINAL_INFO.tty&&!h3.TERMINAL_INFO.ci;lo.isInteractive=AZ});var Ge=y((tpe,g3)=>{"use strict";var{FORCE_COLOR:kZ,NODE_DISABLE_COLORS:TZ,TERM:PZ}=process.env,_e={enabled:!TZ&&PZ!=="dumb"&&kZ!=="0",reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function m3(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function RZ(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?m3(this.keys,n+""):n+""):n===void 0?RZ([t],[r]):_e.enabled?m3([r],n+""):n+""}}g3.exports=_e});var D3=y((rpe,y3)=>{"use strict";y3.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var zd=y((npe,v3)=>{"use strict";v3.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var C3=y((ipe,E3)=>{"use strict";function $Z(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=IZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function IZ(t,e){if(t){if(typeof t=="string")return b3(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b3(t,e)}}function b3(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var jZ=zd(),_3=ke(),w3=_3.erase,NZ=_3.cursor,LZ=t=>[...jZ(t)].length;E3.exports=function(t,e){if(!e)return w3.line+NZ.to(0);let r=0,n=t.split(/\r?\n/);var i=$Z(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(LZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return w3.lines(r)}});var YD=y((ope,S3)=>{"use strict";var ac={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},BZ={arrowUp:ac.arrowUp,arrowDown:ac.arrowDown,arrowLeft:ac.arrowLeft,arrowRight:ac.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},qZ=process.platform==="win32"?BZ:ac;S3.exports=qZ});var F3=y((spe,x3)=>{"use strict";var Js=Ge(),fo=YD(),JD=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),MZ=t=>JD[t]||JD.default,uc=Object.freeze({aborted:Js.red(fo.cross),done:Js.green(fo.tick),exited:Js.yellow(fo.cross),default:Js.cyan("?")}),UZ=(t,e,r)=>e?uc.aborted:r?uc.exited:t?uc.done:uc.default,VZ=t=>Js.gray(t?fo.ellipsis:fo.pointerSmall),HZ=(t,e)=>Js.gray(t?e?fo.pointerSmall:"+":fo.line);x3.exports={styles:JD,render:MZ,symbols:uc,symbol:UZ,delimiter:VZ,item:HZ}});var A3=y((ape,O3)=>{"use strict";var zZ=zd();O3.exports=function(t,e){let r=String(zZ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var T3=y((upe,k3)=>{"use strict";k3.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
66
66
  `)).join(`
67
- `)}});var Rk=y((cpe,Pk)=>{"use strict";Pk.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=y((lpe,$k)=>{"use strict";$k.exports={action:Dk(),clear:Ck(),style:Fk(),strip:zd(),figures:YD(),lines:Ak(),wrap:Tk(),entriesToDisplay:Rk()}});var On=y((fpe,Nk)=>{"use strict";var Ik=require("readline"),WZ=Pr(),KZ=WZ.action,YZ=require("events"),jk=ke(),JZ=jk.beep,XZ=jk.cursor,ZZ=Ge(),XD=class extends YZ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=Ik.createInterface({input:this.in,escapeCodeTimeout:50});Ik.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=KZ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(XZ.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(JZ)}render(){this.onRender(ZZ),this.firstRender&&(this.firstRender=!1)}};Nk.exports=XD});var Uk=y((dpe,Mk)=>{"use strict";function Lk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Bk(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Lk(o,n,i,s,a,"next",u)}function a(u){Lk(o,n,i,s,a,"throw",u)}s(void 0)})}}var Gd=Ge(),QZ=On(),qk=ke(),eQ=qk.erase,cc=qk.cursor,Wd=Pr(),ZD=Wd.style,QD=Wd.clear,tQ=Wd.lines,rQ=Wd.figures,e0=class extends QZ{constructor(e={}){super(e),this.transform=ZD.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=QD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Gd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
68
- `),this.close()}validate(){var e=this;return Bk(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return Bk(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
69
- `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(cc.down(tQ(this.outputError,this.out.columns)-1)+QD(this.outputError,this.out.columns)),this.out.write(QD(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ZD.symbol(this.done,this.aborted),Gd.bold(this.msg),ZD.delimiter(this.done),this.red?Gd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
67
+ `)}});var R3=y((cpe,P3)=>{"use strict";P3.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=y((lpe,$3)=>{"use strict";$3.exports={action:D3(),clear:C3(),style:F3(),strip:zd(),figures:YD(),lines:A3(),wrap:T3(),entriesToDisplay:R3()}});var On=y((fpe,N3)=>{"use strict";var I3=require("readline"),GZ=Pr(),WZ=GZ.action,KZ=require("events"),j3=ke(),YZ=j3.beep,JZ=j3.cursor,XZ=Ge(),XD=class extends KZ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=I3.createInterface({input:this.in,escapeCodeTimeout:50});I3.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=WZ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(JZ.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(YZ)}render(){this.onRender(XZ),this.firstRender&&(this.firstRender=!1)}};N3.exports=XD});var U3=y((dpe,M3)=>{"use strict";function L3(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function B3(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){L3(o,n,i,s,a,"next",u)}function a(u){L3(o,n,i,s,a,"throw",u)}s(void 0)})}}var Gd=Ge(),ZZ=On(),q3=ke(),QZ=q3.erase,cc=q3.cursor,Wd=Pr(),ZD=Wd.style,QD=Wd.clear,eQ=Wd.lines,tQ=Wd.figures,e0=class extends ZZ{constructor(e={}){super(e),this.transform=ZD.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=QD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Gd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
68
+ `),this.close()}validate(){var e=this;return B3(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return B3(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
69
+ `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(cc.down(eQ(this.outputError,this.out.columns)-1)+QD(this.outputError,this.out.columns)),this.out.write(QD(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ZD.symbol(this.done,this.aborted),Gd.bold(this.msg),ZD.delimiter(this.done),this.red?Gd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
70
  `).reduce((e,r,n)=>e+`
71
- ${n?" ":rQ.pointerSmall} ${Gd.red().italic(r)}`,"")),this.out.write(eQ.line+cc.to(0)+this.outputText+cc.save+this.outputError+cc.restore+cc.move(this.cursorOffset,0)))}};Mk.exports=e0});var Gk=y((hpe,zk)=>{"use strict";var An=Ge(),nQ=On(),lc=Pr(),Vk=lc.style,Hk=lc.clear,Kd=lc.figures,iQ=lc.wrap,oQ=lc.entriesToDisplay,sQ=ke(),aQ=sQ.cursor,t0=class extends nQ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Hk("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
71
+ ${n?" ":tQ.pointerSmall} ${Gd.red().italic(r)}`,"")),this.out.write(QZ.line+cc.to(0)+this.outputText+cc.save+this.outputError+cc.restore+cc.move(this.cursorOffset,0)))}};M3.exports=e0});var G3=y((hpe,z3)=>{"use strict";var An=Ge(),rQ=On(),lc=Pr(),V3=lc.style,H3=lc.clear,Kd=lc.figures,nQ=lc.wrap,iQ=lc.entriesToDisplay,oQ=ke(),sQ=oQ.cursor,t0=class extends rQ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=H3("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
72
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(aQ.hide):this.out.write(Hk(this.outputText,this.out.columns)),super.render();let e=oQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[Vk.symbol(this.done,this.aborted),An.bold(this.msg),Vk.delimiter(!1),this.done?this.selection.title:this.selection.disabled?An.yellow(this.warn):An.gray(this.hint)].join(" "),!this.done){this.outputText+=`
73
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(sQ.hide):this.out.write(H3(this.outputText,this.out.columns)),super.render();let e=iQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[V3.symbol(this.done,this.aborted),An.bold(this.msg),V3.delimiter(!1),this.done?this.selection.title:this.selection.disabled?An.yellow(this.warn):An.gray(this.hint)].join(" "),!this.done){this.outputText+=`
74
74
  `;for(let i=r;i<n;i++){let o,s,a="",u=this.choices[i];i===r&&r>0?s=Kd.arrowUp:i===n-1&&n<this.choices.length?s=Kd.arrowDown:s=" ",u.disabled?(o=this.cursor===i?An.gray().underline(u.title):An.strikethrough().gray(u.title),s=(this.cursor===i?An.bold().gray(Kd.pointer)+" ":" ")+s):(o=this.cursor===i?An.cyan().underline(u.title):u.title,s=(this.cursor===i?An.cyan(Kd.pointer)+" ":" ")+s,u.description&&this.cursor===i&&(a=` - ${u.description}`,(s.length+o.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
75
- `+iQ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${An.gray(a)}
76
- `}}this.out.write(this.outputText)}};zk.exports=t0});var Zk=y((ppe,Xk)=>{"use strict";var Yd=Ge(),uQ=On(),Yk=Pr(),Wk=Yk.style,cQ=Yk.clear,Jk=ke(),Kk=Jk.cursor,lQ=Jk.erase,r0=class extends uQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
75
+ `+nQ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${An.gray(a)}
76
+ `}}this.out.write(this.outputText)}};z3.exports=t0});var Z3=y((ppe,X3)=>{"use strict";var Yd=Ge(),aQ=On(),Y3=Pr(),W3=Y3.style,uQ=Y3.clear,J3=ke(),K3=J3.cursor,cQ=J3.erase,r0=class extends aQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
77
77
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
78
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Kk.hide):this.out.write(cQ(this.outputText,this.out.columns)),super.render(),this.outputText=[Wk.symbol(this.done,this.aborted),Yd.bold(this.msg),Wk.delimiter(this.done),this.value?this.inactive:Yd.cyan().underline(this.inactive),Yd.gray("/"),this.value?Yd.cyan().underline(this.active):this.active].join(" "),this.out.write(lQ.line+Kk.to(0)+this.outputText))}};Xk.exports=r0});var Xr=y((mpe,Qk)=>{"use strict";var n0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};Qk.exports=n0});var tT=y((gpe,eT)=>{"use strict";var fQ=Xr(),i0=class extends fQ{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};eT.exports=i0});var nT=y((ype,rT)=>{"use strict";var dQ=Xr(),hQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),o0=class extends dQ{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+hQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};rT.exports=o0});var oT=y((Dpe,iT)=>{"use strict";var pQ=Xr(),s0=class extends pQ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};iT.exports=s0});var aT=y((vpe,sT)=>{"use strict";var mQ=Xr(),a0=class extends mQ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};sT.exports=a0});var cT=y((bpe,uT)=>{"use strict";var gQ=Xr(),u0=class extends gQ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};uT.exports=u0});var fT=y((wpe,lT)=>{"use strict";var yQ=Xr(),c0=class extends yQ{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};lT.exports=c0});var hT=y((_pe,dT)=>{"use strict";var DQ=Xr(),l0=class extends DQ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};dT.exports=l0});var mT=y((Epe,pT)=>{"use strict";var vQ=Xr(),f0=class extends vQ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};pT.exports=f0});var yT=y((Cpe,gT)=>{"use strict";gT.exports={DatePart:Xr(),Meridiem:tT(),Day:nT(),Hours:oT(),Milliseconds:aT(),Minutes:cT(),Month:fT(),Seconds:hT(),Year:mT()}});var FT=y((Spe,xT)=>{"use strict";function DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){DT(o,n,i,s,a,"next",u)}function a(u){DT(o,n,i,s,a,"throw",u)}s(void 0)})}}var d0=Ge(),bQ=On(),p0=Pr(),bT=p0.style,wT=p0.clear,wQ=p0.figures,ST=ke(),_Q=ST.erase,_T=ST.cursor,kn=yT(),ET=kn.DatePart,EQ=kn.Meridiem,CQ=kn.Day,SQ=kn.Hours,xQ=kn.Milliseconds,FQ=kn.Minutes,OQ=kn.Month,AQ=kn.Seconds,kQ=kn.Year,TQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,CT={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new CQ(t),3:t=>new OQ(t),4:t=>new kQ(t),5:t=>new EQ(t),6:t=>new SQ(t),7:t=>new FQ(t),8:t=>new AQ(t),9:t=>new xQ(t)},PQ={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},h0=class extends bQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(PQ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=wT("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=TQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in CT?CT[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof ET)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
78
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(K3.hide):this.out.write(uQ(this.outputText,this.out.columns)),super.render(),this.outputText=[W3.symbol(this.done,this.aborted),Yd.bold(this.msg),W3.delimiter(this.done),this.value?this.inactive:Yd.cyan().underline(this.inactive),Yd.gray("/"),this.value?Yd.cyan().underline(this.active):this.active].join(" "),this.out.write(cQ.line+K3.to(0)+this.outputText))}};X3.exports=r0});var Xr=y((mpe,Q3)=>{"use strict";var n0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};Q3.exports=n0});var tT=y((gpe,eT)=>{"use strict";var lQ=Xr(),i0=class extends lQ{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};eT.exports=i0});var nT=y((ype,rT)=>{"use strict";var fQ=Xr(),dQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),o0=class extends fQ{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+dQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};rT.exports=o0});var oT=y((Dpe,iT)=>{"use strict";var hQ=Xr(),s0=class extends hQ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};iT.exports=s0});var aT=y((vpe,sT)=>{"use strict";var pQ=Xr(),a0=class extends pQ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};sT.exports=a0});var cT=y((bpe,uT)=>{"use strict";var mQ=Xr(),u0=class extends mQ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};uT.exports=u0});var fT=y((wpe,lT)=>{"use strict";var gQ=Xr(),c0=class extends gQ{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};lT.exports=c0});var hT=y((_pe,dT)=>{"use strict";var yQ=Xr(),l0=class extends yQ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};dT.exports=l0});var mT=y((Epe,pT)=>{"use strict";var DQ=Xr(),f0=class extends DQ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};pT.exports=f0});var yT=y((Cpe,gT)=>{"use strict";gT.exports={DatePart:Xr(),Meridiem:tT(),Day:nT(),Hours:oT(),Milliseconds:aT(),Minutes:cT(),Month:fT(),Seconds:hT(),Year:mT()}});var FT=y((Spe,xT)=>{"use strict";function DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){DT(o,n,i,s,a,"next",u)}function a(u){DT(o,n,i,s,a,"throw",u)}s(void 0)})}}var d0=Ge(),vQ=On(),p0=Pr(),bT=p0.style,wT=p0.clear,bQ=p0.figures,ST=ke(),wQ=ST.erase,_T=ST.cursor,kn=yT(),ET=kn.DatePart,_Q=kn.Meridiem,EQ=kn.Day,CQ=kn.Hours,SQ=kn.Milliseconds,xQ=kn.Minutes,FQ=kn.Month,OQ=kn.Seconds,AQ=kn.Year,kQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,CT={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new EQ(t),3:t=>new FQ(t),4:t=>new AQ(t),5:t=>new _Q(t),6:t=>new CQ(t),7:t=>new xQ(t),8:t=>new OQ(t),9:t=>new SQ(t)},TQ={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},h0=class extends vQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(TQ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=wT("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=kQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in CT?CT[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof ET)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
79
79
  `),this.close()}validate(){var e=this;return vT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return vT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
80
80
  `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof ET)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(_T.hide):this.out.write(wT(this.outputText,this.out.columns)),super.render(),this.outputText=[bT.symbol(this.done,this.aborted),d0.bold(this.msg),bT.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?d0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
81
81
  `).reduce((e,r,n)=>e+`
82
- ${n?" ":wQ.pointerSmall} ${d0.red().italic(r)}`,"")),this.out.write(_Q.line+_T.to(0)+this.outputText))}};xT.exports=h0});var $T=y((xpe,RT)=>{"use strict";function OT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function AT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){OT(o,n,i,s,a,"next",u)}function a(u){OT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Jd=Ge(),RQ=On(),PT=ke(),Xd=PT.cursor,$Q=PT.erase,Zd=Pr(),m0=Zd.style,IQ=Zd.figures,kT=Zd.clear,jQ=Zd.lines,NQ=/[0-9]/,g0=t=>t!==void 0,TT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},y0=class extends RQ{constructor(e={}){super(e),this.transform=m0.render(e.style),this.msg=e.message,this.initial=g0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=g0(e.min)?e.min:-1/0,this.max=g0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Jd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${TT(e,this.round)}`),this._value=TT(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||NQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
82
+ ${n?" ":bQ.pointerSmall} ${d0.red().italic(r)}`,"")),this.out.write(wQ.line+_T.to(0)+this.outputText))}};xT.exports=h0});var $T=y((xpe,RT)=>{"use strict";function OT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function AT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){OT(o,n,i,s,a,"next",u)}function a(u){OT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Jd=Ge(),PQ=On(),PT=ke(),Xd=PT.cursor,RQ=PT.erase,Zd=Pr(),m0=Zd.style,$Q=Zd.figures,kT=Zd.clear,IQ=Zd.lines,jQ=/[0-9]/,g0=t=>t!==void 0,TT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},y0=class extends PQ{constructor(e={}){super(e),this.transform=m0.render(e.style),this.msg=e.message,this.initial=g0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=g0(e.min)?e.min:-1/0,this.max=g0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Jd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${TT(e,this.round)}`),this._value=TT(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||jQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}validate(){var e=this;return AT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return AT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
84
- `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Xd.down(jQ(this.outputError,this.out.columns)-1)+kT(this.outputError,this.out.columns)),this.out.write(kT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[m0.symbol(this.done,this.aborted),Jd.bold(this.msg),m0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Jd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
84
+ `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Xd.down(IQ(this.outputError,this.out.columns)-1)+kT(this.outputError,this.out.columns)),this.out.write(kT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[m0.symbol(this.done,this.aborted),Jd.bold(this.msg),m0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Jd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
85
85
  `).reduce((e,r,n)=>e+`
86
- ${n?" ":IQ.pointerSmall} ${Jd.red().italic(r)}`,"")),this.out.write($Q.line+Xd.to(0)+this.outputText+Xd.save+this.outputError+Xd.restore))}};RT.exports=y0});var v0=y((Fpe,NT)=>{"use strict";var Zr=Ge(),LQ=ke(),BQ=LQ.cursor,qQ=On(),fc=Pr(),IT=fc.clear,li=fc.figures,jT=fc.style,MQ=fc.wrap,UQ=fc.entriesToDisplay,D0=class extends qQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=IT("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
86
+ ${n?" ":$Q.pointerSmall} ${Jd.red().italic(r)}`,"")),this.out.write(RQ.line+Xd.to(0)+this.outputText+Xd.save+this.outputError+Xd.restore))}};RT.exports=y0});var v0=y((Fpe,NT)=>{"use strict";var Zr=Ge(),NQ=ke(),LQ=NQ.cursor,BQ=On(),fc=Pr(),IT=fc.clear,li=fc.figures,jT=fc.style,qQ=fc.wrap,MQ=fc.entriesToDisplay,D0=class extends BQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=IT("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
87
87
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
88
88
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
89
89
  Instructions:
@@ -91,15 +91,15 @@ Instructions:
91
91
  ${li.arrowLeft}/${li.arrowRight}/[space]: Toggle selection
92
92
  `+(this.maxChoices===void 0?` a: Toggle all
93
93
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?Zr.green(li.radioOn):li.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?Zr.gray().underline(r.title):Zr.strikethrough().gray(r.title):(s=e===n?Zr.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
94
- `+MQ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Zr.gray(a||"")}paginateOptions(e){if(e.length===0)return Zr.red("No matches for this query.");let r=UQ(this.cursor,e.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex,o,s=[];for(let a=n;a<i;a++)a===n&&n>0?o=li.arrowUp:a===i-1&&i<e.length?o=li.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return`
94
+ `+qQ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Zr.gray(a||"")}paginateOptions(e){if(e.length===0)return Zr.red("No matches for this query.");let r=MQ(this.cursor,e.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex,o,s=[];for(let a=n;a<i;a++)a===n&&n>0?o=li.arrowUp:a===i-1&&i<e.length?o=li.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return`
95
95
  `+s.join(`
96
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(BQ.hide),super.render();let e=[jT.symbol(this.done,this.aborted),Zr.bold(this.msg),jT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Zr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=IT(e,this.out.columns)}};NT.exports=D0});var HT=y((Ope,VT)=>{"use strict";function LT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function VQ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){LT(o,n,i,s,a,"next",u)}function a(u){LT(o,n,i,s,a,"throw",u)}s(void 0)})}}var dc=Ge(),HQ=On(),UT=ke(),zQ=UT.erase,BT=UT.cursor,hc=Pr(),b0=hc.style,qT=hc.clear,w0=hc.figures,GQ=hc.wrap,WQ=hc.entriesToDisplay,MT=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),KQ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),YQ=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},_0=class extends HQ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:YQ(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=b0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qT("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=MT(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return VQ(function*(){let n=r.completing=r.suggest(r.input,r.choices),i=yield n;if(r.completing!==n)return;r.suggestions=i.map((s,a,u)=>({title:KQ(u,a),value:MT(u,a),description:s.description})),r.completing=!1;let o=Math.max(i.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
96
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(LQ.hide),super.render();let e=[jT.symbol(this.done,this.aborted),Zr.bold(this.msg),jT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Zr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=IT(e,this.out.columns)}};NT.exports=D0});var HT=y((Ope,VT)=>{"use strict";function LT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function UQ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){LT(o,n,i,s,a,"next",u)}function a(u){LT(o,n,i,s,a,"throw",u)}s(void 0)})}}var dc=Ge(),VQ=On(),UT=ke(),HQ=UT.erase,BT=UT.cursor,hc=Pr(),b0=hc.style,qT=hc.clear,w0=hc.figures,zQ=hc.wrap,GQ=hc.entriesToDisplay,MT=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),WQ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),KQ=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},_0=class extends VQ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:KQ(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=b0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qT("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=MT(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return UQ(function*(){let n=r.completing=r.suggest(r.input,r.choices),i=yield n;if(r.completing!==n)return;r.suggestions=i.map((s,a,u)=>({title:WQ(u,a),value:MT(u,a),description:s.description})),r.completing=!1;let o=Math.max(i.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
97
97
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
98
98
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
99
99
  `),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?w0.arrowUp:i?w0.arrowDown:" ",a=r?dc.cyan().underline(e.title):e.title;return s=(r?dc.cyan(w0.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
100
- `+GQ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+dc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(BT.hide):this.out.write(qT(this.outputText,this.out.columns)),super.render();let e=WQ(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[b0.symbol(this.done,this.aborted,this.exited),dc.bold(this.msg),b0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===n-1&&n<this.choices.length)).join(`
100
+ `+zQ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+dc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(BT.hide):this.out.write(qT(this.outputText,this.out.columns)),super.render();let e=GQ(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[b0.symbol(this.done,this.aborted,this.exited),dc.bold(this.msg),b0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===n-1&&n<this.choices.length)).join(`
101
101
  `);this.outputText+=`
102
- `+(i||dc.gray(this.fallback.title))}this.out.write(zQ.line+BT.to(0)+this.outputText)}};VT.exports=_0});var KT=y((Ape,WT)=>{"use strict";var Tn=Ge(),JQ=ke(),XQ=JQ.cursor,ZQ=v0(),C0=Pr(),zT=C0.clear,GT=C0.style,Xs=C0.figures,E0=class extends ZQ{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=zT("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
102
+ `+(i||dc.gray(this.fallback.title))}this.out.write(HQ.line+BT.to(0)+this.outputText)}};VT.exports=_0});var KT=y((Ape,WT)=>{"use strict";var Tn=Ge(),YQ=ke(),JQ=YQ.cursor,XQ=v0(),C0=Pr(),zT=C0.clear,GT=C0.style,Xs=C0.figures,E0=class extends XQ{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=zT("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
103
103
  Instructions:
104
104
  ${Xs.arrowUp}/${Xs.arrowDown}: Highlight option
105
105
  ${Xs.arrowLeft}/${Xs.arrowRight}/[space]: Toggle selection
@@ -107,31 +107,31 @@ Instructions:
107
107
  enter/return: Complete answer
108
108
  `:""}renderCurrentInput(){return`
109
109
  Filtered results for: ${this.inputValue?this.inputValue:Tn.gray("Enter something to filter")}
110
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):i=e===n?Tn.cyan().underline(r.title):r.title,(r.selected?Tn.green(Xs.radioOn):Xs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(XQ.hide),super.render();let e=[GT.symbol(this.done,this.aborted),Tn.bold(this.msg),GT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=zT(e,this.out.columns)}};WT.exports=E0});var tP=y((kpe,eP)=>{"use strict";var YT=Ge(),QQ=On(),ZT=Pr(),JT=ZT.style,eee=ZT.clear,QT=ke(),tee=QT.erase,XT=QT.cursor,S0=class extends QQ{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
110
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):i=e===n?Tn.cyan().underline(r.title):r.title,(r.selected?Tn.green(Xs.radioOn):Xs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(JQ.hide),super.render();let e=[GT.symbol(this.done,this.aborted),Tn.bold(this.msg),GT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=zT(e,this.out.columns)}};WT.exports=E0});var tP=y((kpe,eP)=>{"use strict";var YT=Ge(),ZQ=On(),ZT=Pr(),JT=ZT.style,QQ=ZT.clear,QT=ke(),eee=QT.erase,XT=QT.cursor,S0=class extends ZQ{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
111
111
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
112
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(XT.hide):this.out.write(eee(this.outputText,this.out.columns)),super.render(),this.outputText=[JT.symbol(this.done,this.aborted),YT.bold(this.msg),JT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:YT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(tee.line+XT.to(0)+this.outputText))}};eP.exports=S0});var nP=y((Tpe,rP)=>{"use strict";rP.exports={TextPrompt:Uk(),SelectPrompt:Gk(),TogglePrompt:Zk(),DatePrompt:FT(),NumberPrompt:$T(),MultiselectPrompt:v0(),AutocompletePrompt:HT(),AutocompleteMultiselectPrompt:KT(),ConfirmPrompt:tP()}});var oP=y(iP=>{"use strict";var Jt=iP,ree=nP(),Qd=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new ree[t](e),s=r.onAbort||Qd,a=r.onSubmit||Qd,u=r.onExit||Qd;o.on("state",e.onState||Qd),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>Qr("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>Qr("NumberPrompt",t);Jt.date=t=>Qr("DatePrompt",t);Jt.confirm=t=>Qr("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>Qr("TogglePrompt",t);Jt.select=t=>Qr("SelectPrompt",t);Jt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Jt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var nee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||nee,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var hP=y((Rpe,dP)=>{"use strict";function sP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function aP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sP(Object(r),!0).forEach(function(n){iee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function iee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=see(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function see(t,e){if(t){if(typeof t=="string")return uP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uP(t,e)}}function uP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function lP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){cP(o,n,i,s,a,"next",u)}function a(u){cP(o,n,i,s,a,"throw",u)}s(void 0)})}}var x0=oP(),aee=["suggest","format","onState","validate","onRender","type"],fP=()=>{};function fi(){return F0.apply(this,arguments)}function F0(){return F0=lP(function*(t=[],{onSubmit:e=fP,onCancel:r=fP}={}){let n={},i=fi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=lP(function*(w,x,D=!1){if(!(!D&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,D){return g.apply(this,arguments)}}();var h=oee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var p=s;if(u=p.name,c=p.type,typeof c=="function"&&(c=yield c(o,aP({},n),s),s.type=c),!!c){for(let g in s){if(aee.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,aP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(u=b.name,c=b.type,x0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=fi._injected?uee(fi._injected,s.initial):yield x0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),F0.apply(this,arguments)}function uee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function cee(t){fi._injected=(fi._injected||[]).concat(t)}function lee(t){fi._override=Object.assign({},t)}dP.exports=Object.assign(fi,{prompt:fi,prompts:x0,inject:cee,override:lee})});var mP=y(($pe,pP)=>{"use strict";pP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var eh=y((Ipe,gP)=>{"use strict";gP.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var vP=y((jpe,DP)=>{"use strict";var fee=eh(),{erase:yP,cursor:dee}=ke(),hee=t=>[...fee(t)].length;DP.exports=function(t,e){if(!e)return yP.line+dee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(hee(i)-1,0)/e);return yP.lines(r)}});var O0=y((Npe,bP)=>{"use strict";var pc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},pee={arrowUp:pc.arrowUp,arrowDown:pc.arrowDown,arrowLeft:pc.arrowLeft,arrowRight:pc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},mee=process.platform==="win32"?pee:pc;bP.exports=mee});var _P=y((Lpe,wP)=>{"use strict";var Zs=Ge(),ho=O0(),A0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),gee=t=>A0[t]||A0.default,mc=Object.freeze({aborted:Zs.red(ho.cross),done:Zs.green(ho.tick),exited:Zs.yellow(ho.cross),default:Zs.cyan("?")}),yee=(t,e,r)=>e?mc.aborted:r?mc.exited:t?mc.done:mc.default,Dee=t=>Zs.gray(t?ho.ellipsis:ho.pointerSmall),vee=(t,e)=>Zs.gray(t?e?ho.pointerSmall:"+":ho.line);wP.exports={styles:A0,render:gee,symbols:mc,symbol:yee,delimiter:Dee,item:vee}});var CP=y((Bpe,EP)=>{"use strict";var bee=eh();EP.exports=function(t,e){let r=String(bee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var xP=y((qpe,SP)=>{"use strict";SP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
112
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(XT.hide):this.out.write(QQ(this.outputText,this.out.columns)),super.render(),this.outputText=[JT.symbol(this.done,this.aborted),YT.bold(this.msg),JT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:YT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(eee.line+XT.to(0)+this.outputText))}};eP.exports=S0});var nP=y((Tpe,rP)=>{"use strict";rP.exports={TextPrompt:U3(),SelectPrompt:G3(),TogglePrompt:Z3(),DatePrompt:FT(),NumberPrompt:$T(),MultiselectPrompt:v0(),AutocompletePrompt:HT(),AutocompleteMultiselectPrompt:KT(),ConfirmPrompt:tP()}});var oP=y(iP=>{"use strict";var Jt=iP,tee=nP(),Qd=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new tee[t](e),s=r.onAbort||Qd,a=r.onSubmit||Qd,u=r.onExit||Qd;o.on("state",e.onState||Qd),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>Qr("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>Qr("NumberPrompt",t);Jt.date=t=>Qr("DatePrompt",t);Jt.confirm=t=>Qr("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>Qr("TogglePrompt",t);Jt.select=t=>Qr("SelectPrompt",t);Jt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Jt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var ree=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||ree,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var hP=y((Rpe,dP)=>{"use strict";function sP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function aP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sP(Object(r),!0).forEach(function(n){nee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=oee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function oee(t,e){if(t){if(typeof t=="string")return uP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uP(t,e)}}function uP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function lP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){cP(o,n,i,s,a,"next",u)}function a(u){cP(o,n,i,s,a,"throw",u)}s(void 0)})}}var x0=oP(),see=["suggest","format","onState","validate","onRender","type"],fP=()=>{};function fi(){return F0.apply(this,arguments)}function F0(){return F0=lP(function*(t=[],{onSubmit:e=fP,onCancel:r=fP}={}){let n={},i=fi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=lP(function*(w,x,D=!1){if(!(!D&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,D){return g.apply(this,arguments)}}();var h=iee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var p=s;if(u=p.name,c=p.type,typeof c=="function"&&(c=yield c(o,aP({},n),s),s.type=c),!!c){for(let g in s){if(see.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,aP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(u=b.name,c=b.type,x0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=fi._injected?aee(fi._injected,s.initial):yield x0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),F0.apply(this,arguments)}function aee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function uee(t){fi._injected=(fi._injected||[]).concat(t)}function cee(t){fi._override=Object.assign({},t)}dP.exports=Object.assign(fi,{prompt:fi,prompts:x0,inject:uee,override:cee})});var mP=y(($pe,pP)=>{"use strict";pP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var eh=y((Ipe,gP)=>{"use strict";gP.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var vP=y((jpe,DP)=>{"use strict";var lee=eh(),{erase:yP,cursor:fee}=ke(),dee=t=>[...lee(t)].length;DP.exports=function(t,e){if(!e)return yP.line+fee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(dee(i)-1,0)/e);return yP.lines(r)}});var O0=y((Npe,bP)=>{"use strict";var pc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},hee={arrowUp:pc.arrowUp,arrowDown:pc.arrowDown,arrowLeft:pc.arrowLeft,arrowRight:pc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},pee=process.platform==="win32"?hee:pc;bP.exports=pee});var _P=y((Lpe,wP)=>{"use strict";var Zs=Ge(),ho=O0(),A0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),mee=t=>A0[t]||A0.default,mc=Object.freeze({aborted:Zs.red(ho.cross),done:Zs.green(ho.tick),exited:Zs.yellow(ho.cross),default:Zs.cyan("?")}),gee=(t,e,r)=>e?mc.aborted:r?mc.exited:t?mc.done:mc.default,yee=t=>Zs.gray(t?ho.ellipsis:ho.pointerSmall),Dee=(t,e)=>Zs.gray(t?e?ho.pointerSmall:"+":ho.line);wP.exports={styles:A0,render:mee,symbols:mc,symbol:gee,delimiter:yee,item:Dee}});var CP=y((Bpe,EP)=>{"use strict";var vee=eh();EP.exports=function(t,e){let r=String(vee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var xP=y((qpe,SP)=>{"use strict";SP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
114
114
  `)).join(`
115
- `)}});var OP=y((Mpe,FP)=>{"use strict";FP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=y((Upe,AP)=>{"use strict";AP.exports={action:mP(),clear:vP(),style:_P(),strip:eh(),figures:O0(),lines:CP(),wrap:xP(),entriesToDisplay:OP()}});var Pn=y((Vpe,TP)=>{"use strict";var kP=require("readline"),{action:wee}=Rr(),_ee=require("events"),{beep:Eee,cursor:Cee}=ke(),See=Ge(),k0=class extends _ee{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=kP.createInterface({input:this.in,escapeCodeTimeout:50});kP.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=wee(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(Cee.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Eee)}render(){this.onRender(See),this.firstRender&&(this.firstRender=!1)}};TP.exports=k0});var RP=y((Hpe,PP)=>{var th=Ge(),xee=Pn(),{erase:Fee,cursor:gc}=ke(),{style:T0,clear:P0,lines:Oee,figures:Aee}=Rr(),R0=class extends xee{constructor(e={}){super(e),this.transform=T0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=P0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=th.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
115
+ `)}});var OP=y((Mpe,FP)=>{"use strict";FP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=y((Upe,AP)=>{"use strict";AP.exports={action:mP(),clear:vP(),style:_P(),strip:eh(),figures:O0(),lines:CP(),wrap:xP(),entriesToDisplay:OP()}});var Pn=y((Vpe,TP)=>{"use strict";var kP=require("readline"),{action:bee}=Rr(),wee=require("events"),{beep:_ee,cursor:Eee}=ke(),Cee=Ge(),k0=class extends wee{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=kP.createInterface({input:this.in,escapeCodeTimeout:50});kP.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=bee(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(Eee.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(_ee)}render(){this.onRender(Cee),this.firstRender&&(this.firstRender=!1)}};TP.exports=k0});var RP=y((Hpe,PP)=>{var th=Ge(),See=Pn(),{erase:xee,cursor:gc}=ke(),{style:T0,clear:P0,lines:Fee,figures:Oee}=Rr(),R0=class extends See{constructor(e={}){super(e),this.transform=T0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=P0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=th.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
116
116
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
117
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(gc.down(Oee(this.outputError,this.out.columns)-1)+P0(this.outputError,this.out.columns)),this.out.write(P0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[T0.symbol(this.done,this.aborted),th.bold(this.msg),T0.delimiter(this.done),this.red?th.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
117
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(gc.down(Fee(this.outputError,this.out.columns)-1)+P0(this.outputError,this.out.columns)),this.out.write(P0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[T0.symbol(this.done,this.aborted),th.bold(this.msg),T0.delimiter(this.done),this.red?th.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
118
118
  `).reduce((e,r,n)=>e+`
119
- ${n?" ":Aee.pointerSmall} ${th.red().italic(r)}`,"")),this.out.write(Fee.line+gc.to(0)+this.outputText+gc.save+this.outputError+gc.restore+gc.move(this.cursorOffset,0)))}};PP.exports=R0});var NP=y((zpe,jP)=>{"use strict";var Rn=Ge(),kee=Pn(),{style:$P,clear:IP,figures:rh,wrap:Tee,entriesToDisplay:Pee}=Rr(),{cursor:Ree}=ke(),$0=class extends kee{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=IP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
119
+ ${n?" ":Oee.pointerSmall} ${th.red().italic(r)}`,"")),this.out.write(xee.line+gc.to(0)+this.outputText+gc.save+this.outputError+gc.restore+gc.move(this.cursorOffset,0)))}};PP.exports=R0});var NP=y((zpe,jP)=>{"use strict";var Rn=Ge(),Aee=Pn(),{style:$P,clear:IP,figures:rh,wrap:kee,entriesToDisplay:Tee}=Rr(),{cursor:Pee}=ke(),$0=class extends Aee{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=IP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
120
120
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
121
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Ree.hide):this.out.write(IP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Pee(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[$P.symbol(this.done,this.aborted),Rn.bold(this.msg),$P.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rn.yellow(this.warn):Rn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
121
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Pee.hide):this.out.write(IP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Tee(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[$P.symbol(this.done,this.aborted),Rn.bold(this.msg),$P.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rn.yellow(this.warn):Rn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
122
122
  `;for(let n=e;n<r;n++){let i,o,s="",a=this.choices[n];n===e&&e>0?o=rh.arrowUp:n===r-1&&r<this.choices.length?o=rh.arrowDown:o=" ",a.disabled?(i=this.cursor===n?Rn.gray().underline(a.title):Rn.strikethrough().gray(a.title),o=(this.cursor===n?Rn.bold().gray(rh.pointer)+" ":" ")+o):(i=this.cursor===n?Rn.cyan().underline(a.title):a.title,o=(this.cursor===n?Rn.cyan(rh.pointer)+" ":" ")+o,a.description&&this.cursor===n&&(s=` - ${a.description}`,(o.length+i.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
123
- `+Tee(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Rn.gray(s)}
124
- `}}this.out.write(this.outputText)}};jP.exports=$0});var MP=y((Gpe,qP)=>{var nh=Ge(),$ee=Pn(),{style:LP,clear:Iee}=Rr(),{cursor:BP,erase:jee}=ke(),I0=class extends $ee{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
123
+ `+kee(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Rn.gray(s)}
124
+ `}}this.out.write(this.outputText)}};jP.exports=$0});var MP=y((Gpe,qP)=>{var nh=Ge(),Ree=Pn(),{style:LP,clear:$ee}=Rr(),{cursor:BP,erase:Iee}=ke(),I0=class extends Ree{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
125
125
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
126
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(BP.hide):this.out.write(Iee(this.outputText,this.out.columns)),super.render(),this.outputText=[LP.symbol(this.done,this.aborted),nh.bold(this.msg),LP.delimiter(this.done),this.value?this.inactive:nh.cyan().underline(this.inactive),nh.gray("/"),this.value?nh.cyan().underline(this.active):this.active].join(" "),this.out.write(jee.line+BP.to(0)+this.outputText))}};qP.exports=I0});var en=y((Wpe,UP)=>{"use strict";var j0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};UP.exports=j0});var HP=y((Kpe,VP)=>{"use strict";var Nee=en(),N0=class extends Nee{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};VP.exports=N0});var GP=y((Ype,zP)=>{"use strict";var Lee=en(),Bee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),L0=class extends Lee{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Bee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};zP.exports=L0});var KP=y((Jpe,WP)=>{"use strict";var qee=en(),B0=class extends qee{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};WP.exports=B0});var JP=y((Xpe,YP)=>{"use strict";var Mee=en(),q0=class extends Mee{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};YP.exports=q0});var ZP=y((Zpe,XP)=>{"use strict";var Uee=en(),M0=class extends Uee{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};XP.exports=M0});var eR=y((Qpe,QP)=>{"use strict";var Vee=en(),U0=class extends Vee{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};QP.exports=U0});var rR=y((eme,tR)=>{"use strict";var Hee=en(),V0=class extends Hee{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};tR.exports=V0});var iR=y((tme,nR)=>{"use strict";var zee=en(),H0=class extends zee{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};nR.exports=H0});var sR=y((rme,oR)=>{"use strict";oR.exports={DatePart:en(),Meridiem:HP(),Day:GP(),Hours:KP(),Milliseconds:JP(),Minutes:ZP(),Month:eR(),Seconds:rR(),Year:iR()}});var hR=y((nme,dR)=>{"use strict";var z0=Ge(),Gee=Pn(),{style:aR,clear:uR,figures:Wee}=Rr(),{erase:Kee,cursor:cR}=ke(),{DatePart:lR,Meridiem:Yee,Day:Jee,Hours:Xee,Milliseconds:Zee,Minutes:Qee,Month:ete,Seconds:tte,Year:rte}=sR(),nte=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,fR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new Jee(t),3:t=>new ete(t),4:t=>new rte(t),5:t=>new Yee(t),6:t=>new Xee(t),7:t=>new Qee(t),8:t=>new tte(t),9:t=>new Zee(t)},ite={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},G0=class extends Gee{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ite,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=uR("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=nte.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in fR?fR[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof lR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
126
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(BP.hide):this.out.write($ee(this.outputText,this.out.columns)),super.render(),this.outputText=[LP.symbol(this.done,this.aborted),nh.bold(this.msg),LP.delimiter(this.done),this.value?this.inactive:nh.cyan().underline(this.inactive),nh.gray("/"),this.value?nh.cyan().underline(this.active):this.active].join(" "),this.out.write(Iee.line+BP.to(0)+this.outputText))}};qP.exports=I0});var en=y((Wpe,UP)=>{"use strict";var j0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};UP.exports=j0});var HP=y((Kpe,VP)=>{"use strict";var jee=en(),N0=class extends jee{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};VP.exports=N0});var GP=y((Ype,zP)=>{"use strict";var Nee=en(),Lee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),L0=class extends Nee{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Lee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};zP.exports=L0});var KP=y((Jpe,WP)=>{"use strict";var Bee=en(),B0=class extends Bee{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};WP.exports=B0});var JP=y((Xpe,YP)=>{"use strict";var qee=en(),q0=class extends qee{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};YP.exports=q0});var ZP=y((Zpe,XP)=>{"use strict";var Mee=en(),M0=class extends Mee{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};XP.exports=M0});var eR=y((Qpe,QP)=>{"use strict";var Uee=en(),U0=class extends Uee{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};QP.exports=U0});var rR=y((eme,tR)=>{"use strict";var Vee=en(),V0=class extends Vee{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};tR.exports=V0});var iR=y((tme,nR)=>{"use strict";var Hee=en(),H0=class extends Hee{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};nR.exports=H0});var sR=y((rme,oR)=>{"use strict";oR.exports={DatePart:en(),Meridiem:HP(),Day:GP(),Hours:KP(),Milliseconds:JP(),Minutes:ZP(),Month:eR(),Seconds:rR(),Year:iR()}});var hR=y((nme,dR)=>{"use strict";var z0=Ge(),zee=Pn(),{style:aR,clear:uR,figures:Gee}=Rr(),{erase:Wee,cursor:cR}=ke(),{DatePart:lR,Meridiem:Kee,Day:Yee,Hours:Jee,Milliseconds:Xee,Minutes:Zee,Month:Qee,Seconds:ete,Year:tte}=sR(),rte=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,fR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new Yee(t),3:t=>new Qee(t),4:t=>new tte(t),5:t=>new Kee(t),6:t=>new Jee(t),7:t=>new Zee(t),8:t=>new ete(t),9:t=>new Xee(t)},nte={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},G0=class extends zee{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(nte,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=uR("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=rte.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in fR?fR[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof lR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
127
127
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
128
128
  `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof lR)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(cR.hide):this.out.write(uR(this.outputText,this.out.columns)),super.render(),this.outputText=[aR.symbol(this.done,this.aborted),z0.bold(this.msg),aR.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?z0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
129
129
  `).reduce((e,r,n)=>e+`
130
- ${n?" ":Wee.pointerSmall} ${z0.red().italic(r)}`,"")),this.out.write(Kee.line+cR.to(0)+this.outputText))}};dR.exports=G0});var yR=y((ime,gR)=>{var ih=Ge(),ote=Pn(),{cursor:oh,erase:ste}=ke(),{style:W0,figures:ate,clear:pR,lines:ute}=Rr(),cte=/[0-9]/,K0=t=>t!==void 0,mR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Y0=class extends ote{constructor(e={}){super(e),this.transform=W0.render(e.style),this.msg=e.message,this.initial=K0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=K0(e.min)?e.min:-1/0,this.max=K0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=ih.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${mR(e,this.round)}`),this._value=mR(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||cte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
130
+ ${n?" ":Gee.pointerSmall} ${z0.red().italic(r)}`,"")),this.out.write(Wee.line+cR.to(0)+this.outputText))}};dR.exports=G0});var yR=y((ime,gR)=>{var ih=Ge(),ite=Pn(),{cursor:oh,erase:ote}=ke(),{style:W0,figures:ste,clear:pR,lines:ate}=Rr(),ute=/[0-9]/,K0=t=>t!==void 0,mR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Y0=class extends ite{constructor(e={}){super(e),this.transform=W0.render(e.style),this.msg=e.message,this.initial=K0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=K0(e.min)?e.min:-1/0,this.max=K0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=ih.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${mR(e,this.round)}`),this._value=mR(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||ute.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
131
131
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
132
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(oh.down(ute(this.outputError,this.out.columns)-1)+pR(this.outputError,this.out.columns)),this.out.write(pR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[W0.symbol(this.done,this.aborted),ih.bold(this.msg),W0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?ih[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
132
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(oh.down(ate(this.outputError,this.out.columns)-1)+pR(this.outputError,this.out.columns)),this.out.write(pR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[W0.symbol(this.done,this.aborted),ih.bold(this.msg),W0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?ih[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
133
133
  `).reduce((e,r,n)=>e+`
134
- ${n?" ":ate.pointerSmall} ${ih.red().italic(r)}`,"")),this.out.write(ste.line+oh.to(0)+this.outputText+oh.save+this.outputError+oh.restore))}};gR.exports=Y0});var X0=y((ome,bR)=>{"use strict";var tn=Ge(),{cursor:lte}=ke(),fte=Pn(),{clear:DR,figures:di,style:vR,wrap:dte,entriesToDisplay:hte}=Rr(),J0=class extends fte{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=DR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
134
+ ${n?" ":ste.pointerSmall} ${ih.red().italic(r)}`,"")),this.out.write(ote.line+oh.to(0)+this.outputText+oh.save+this.outputError+oh.restore))}};gR.exports=Y0});var X0=y((ome,bR)=>{"use strict";var tn=Ge(),{cursor:cte}=ke(),lte=Pn(),{clear:DR,figures:di,style:vR,wrap:fte,entriesToDisplay:dte}=Rr(),J0=class extends lte{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=DR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
135
135
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
136
136
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
137
137
  Instructions:
@@ -139,15 +139,15 @@ Instructions:
139
139
  ${di.arrowLeft}/${di.arrowRight}/[space]: Toggle selection
140
140
  `+(this.maxChoices===void 0?` a: Toggle all
141
141
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?tn.green(di.radioOn):di.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?tn.gray().underline(r.title):tn.strikethrough().gray(r.title):(s=e===n?tn.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
142
- `+dte(r.description,{margin:o.length,width:this.out.columns})))),o+s+tn.gray(a||"")}paginateOptions(e){if(e.length===0)return tn.red("No matches for this query.");let{startIndex:r,endIndex:n}=hte(this.cursor,e.length,this.optionsPerPage),i,o=[];for(let s=r;s<n;s++)s===r&&r>0?i=di.arrowUp:s===n-1&&n<e.length?i=di.arrowDown:i=" ",o.push(this.renderOption(this.cursor,e[s],s,i));return`
142
+ `+fte(r.description,{margin:o.length,width:this.out.columns})))),o+s+tn.gray(a||"")}paginateOptions(e){if(e.length===0)return tn.red("No matches for this query.");let{startIndex:r,endIndex:n}=dte(this.cursor,e.length,this.optionsPerPage),i,o=[];for(let s=r;s<n;s++)s===r&&r>0?i=di.arrowUp:s===n-1&&n<e.length?i=di.arrowDown:i=" ",o.push(this.renderOption(this.cursor,e[s],s,i));return`
143
143
  `+o.join(`
144
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(lte.hide),super.render();let e=[vR.symbol(this.done,this.aborted),tn.bold(this.msg),vR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=DR(e,this.out.columns)}};bR.exports=J0});var SR=y((sme,CR)=>{"use strict";var yc=Ge(),pte=Pn(),{erase:mte,cursor:wR}=ke(),{style:Z0,clear:_R,figures:Q0,wrap:gte,entriesToDisplay:yte}=Rr(),ER=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),Dte=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),vte=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},ev=class extends pte{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:vte(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Z0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=_R("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ER(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,s,a)=>({title:Dte(a,s),value:ER(a,s),description:o.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
144
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(cte.hide),super.render();let e=[vR.symbol(this.done,this.aborted),tn.bold(this.msg),vR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=DR(e,this.out.columns)}};bR.exports=J0});var SR=y((sme,CR)=>{"use strict";var yc=Ge(),hte=Pn(),{erase:pte,cursor:wR}=ke(),{style:Z0,clear:_R,figures:Q0,wrap:mte,entriesToDisplay:gte}=Rr(),ER=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),yte=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),Dte=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},ev=class extends hte{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Dte(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Z0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=_R("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ER(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,s,a)=>({title:yte(a,s),value:ER(a,s),description:o.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
145
145
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
146
146
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
147
147
  `),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?Q0.arrowUp:i?Q0.arrowDown:" ",a=r?yc.cyan().underline(e.title):e.title;return s=(r?yc.cyan(Q0.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
148
- `+gte(e.description,{margin:3,width:this.out.columns}))),s+" "+a+yc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(wR.hide):this.out.write(_R(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=yte(this.select,this.choices.length,this.limit);if(this.outputText=[Z0.symbol(this.done,this.aborted,this.exited),yc.bold(this.msg),Z0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(e,r).map((i,o)=>this.renderOption(i,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
148
+ `+mte(e.description,{margin:3,width:this.out.columns}))),s+" "+a+yc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(wR.hide):this.out.write(_R(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=gte(this.select,this.choices.length,this.limit);if(this.outputText=[Z0.symbol(this.done,this.aborted,this.exited),yc.bold(this.msg),Z0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(e,r).map((i,o)=>this.renderOption(i,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
149
149
  `);this.outputText+=`
150
- `+(n||yc.gray(this.fallback.title))}this.out.write(mte.line+wR.to(0)+this.outputText)}};CR.exports=ev});var AR=y((ame,OR)=>{"use strict";var $n=Ge(),{cursor:bte}=ke(),wte=X0(),{clear:xR,style:FR,figures:Qs}=Rr(),tv=class extends wte{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=xR("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
150
+ `+(n||yc.gray(this.fallback.title))}this.out.write(pte.line+wR.to(0)+this.outputText)}};CR.exports=ev});var AR=y((ame,OR)=>{"use strict";var $n=Ge(),{cursor:vte}=ke(),bte=X0(),{clear:xR,style:FR,figures:Qs}=Rr(),tv=class extends bte{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=xR("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
151
151
  Instructions:
152
152
  ${Qs.arrowUp}/${Qs.arrowDown}: Highlight option
153
153
  ${Qs.arrowLeft}/${Qs.arrowRight}/[space]: Toggle selection
@@ -155,62 +155,62 @@ Instructions:
155
155
  enter/return: Complete answer
156
156
  `:""}renderCurrentInput(){return`
157
157
  Filtered results for: ${this.inputValue?this.inputValue:$n.gray("Enter something to filter")}
158
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?$n.gray().underline(r.title):$n.strikethrough().gray(r.title):i=e===n?$n.cyan().underline(r.title):r.title,(r.selected?$n.green(Qs.radioOn):Qs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[$n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($n.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(bte.hide),super.render();let e=[FR.symbol(this.done,this.aborted),$n.bold(this.msg),FR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=xR(e,this.out.columns)}};OR.exports=tv});var $R=y((ume,RR)=>{var kR=Ge(),_te=Pn(),{style:TR,clear:Ete}=Rr(),{erase:Cte,cursor:PR}=ke(),rv=class extends _te{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
158
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?$n.gray().underline(r.title):$n.strikethrough().gray(r.title):i=e===n?$n.cyan().underline(r.title):r.title,(r.selected?$n.green(Qs.radioOn):Qs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[$n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($n.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(vte.hide),super.render();let e=[FR.symbol(this.done,this.aborted),$n.bold(this.msg),FR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=xR(e,this.out.columns)}};OR.exports=tv});var $R=y((ume,RR)=>{var kR=Ge(),wte=Pn(),{style:TR,clear:_te}=Rr(),{erase:Ete,cursor:PR}=ke(),rv=class extends wte{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
159
159
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
160
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(PR.hide):this.out.write(Ete(this.outputText,this.out.columns)),super.render(),this.outputText=[TR.symbol(this.done,this.aborted),kR.bold(this.msg),TR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Cte.line+PR.to(0)+this.outputText))}};RR.exports=rv});var jR=y((cme,IR)=>{"use strict";IR.exports={TextPrompt:RP(),SelectPrompt:NP(),TogglePrompt:MP(),DatePrompt:hR(),NumberPrompt:yR(),MultiselectPrompt:X0(),AutocompletePrompt:SR(),AutocompleteMultiselectPrompt:AR(),ConfirmPrompt:$R()}});var LR=y(NR=>{"use strict";var Xt=NR,Ste=jR(),sh=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new Ste[t](e),s=r.onAbort||sh,a=r.onSubmit||sh,u=r.onExit||sh;o.on("state",e.onState||sh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Xt.text=t=>rn("TextPrompt",t);Xt.password=t=>(t.style="password",Xt.text(t));Xt.invisible=t=>(t.style="invisible",Xt.text(t));Xt.number=t=>rn("NumberPrompt",t);Xt.date=t=>rn("DatePrompt",t);Xt.confirm=t=>rn("ConfirmPrompt",t);Xt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Xt.toggle=t=>rn("TogglePrompt",t);Xt.select=t=>rn("SelectPrompt",t);Xt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Xt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var xte=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Xt.autocomplete=t=>(t.suggest=t.suggest||xte,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var MR=y((fme,qR)=>{"use strict";var nv=LR(),Fte=["suggest","format","onState","validate","onRender","type"],BR=()=>{};async function hi(t=[],{onSubmit:e=BR,onCancel:r=BR}={}){let n={},i=hi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,p=!1)=>{if(!(!p&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(Fte.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,nv[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=hi._injected?Ote(hi._injected,s.initial):await nv[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function Ote(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Ate(t){hi._injected=(hi._injected||[]).concat(t)}function kte(t){hi._override=Object.assign({},t)}qR.exports=Object.assign(hi,{prompt:hi,prompts:nv,inject:Ate,override:kte})});var ah=y((dme,UR)=>{function Tte(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}UR.exports=Tte("8.6.0")?hP():MR()});var sc=y(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.logSuccess=Zt.logPrompt=Zt.logger=Zt.output=void 0;var iv=(Cn(),Ae(En)),po=(KD(),Ae(WD)),mo=iv.__importDefault(Vs()),Pte=pk(),VR={colors:mo.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Zt.output=(0,Pte.isInteractive)()?new po.TTYOutputStrategy(VR):new po.StreamOutputStrategy(VR);Zt.logger=(0,po.createDefaultLogger)({output:Zt.output,formatterOptions:{titleize:!1,tags:new Map([[po.LOGGER_LEVELS.DEBUG,mo.default.log.DEBUG("[debug]")],[po.LOGGER_LEVELS.INFO,mo.default.log.INFO("[info]")],[po.LOGGER_LEVELS.WARN,mo.default.log.WARN("[warn]")],[po.LOGGER_LEVELS.ERROR,mo.default.log.ERROR("[error]")]])}});async function Rte(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>iv.__importStar((KD(),Ae(WD)))),{prompt:n}=await Promise.resolve().then(()=>iv.__importStar(ah()));return Zt.logger.log({msg:`${mo.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Zt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Zt.logPrompt=Rte;function $te(t){Zt.logger.msg(`${mo.default.success("[success]")} ${t}`)}Zt.logSuccess=$te});var uh=y(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.resolveNode=ea.requireTS=void 0;var Ite=Bs(),jte=require("fs"),Nte=require("path"),Lte=(t,e)=>{let r=(0,Nte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,Ite.readFileSync)(o,"utf8");o.endsWith(".ts")?a=t.transpileModule(a,{fileName:o,compilerOptions:{module:t.ModuleKind.CommonJS,moduleResolution:t.ModuleResolutionKind.NodeJs,esModuleInterop:!0,strict:!0,target:t.ScriptTarget.ES2017},reportDiagnostics:!0}).outputText:a=a.replace(/export\s+\w+\s+(\w+)/gm,"exports.$1"),(s=i._compile)===null||s===void 0||s.call(i,a,o)};let n=require(r);return delete require.extensions[".ts"],n};ea.requireTS=Lte;function Bte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,jte.existsSync)(n)?n:null}}ea.resolveNode=Bte});var HR={};mn(HR,{default:()=>qte});var qte,zR=ct(()=>{qte={}});var GR=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var Mte=(Cn(),Ae(En)),Ute=Bs(),Dc=Mte.__importDefault((zR(),Ae(HR)));async function Vte(t){var e;try{let r=await(0,Ute.readFile)(t,{encoding:"utf-8"});try{return await Dc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=Vte;function Hte(t,e){let r=e!==void 0?new Dc.default.Parser({...e}):new Dc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=Hte;async function zte(t){return new Promise(e=>{let n=new Dc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=zte;function Gte(t,e){return new Dc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=Gte});var XR=y(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.getAllElements=Ee.getFilePath=Ee.getAssets=Ee.getJSModules=Ee.getPluginType=Ee.getPlatformElement=Ee.getPluginPlatform=Ee.printPlugins=Ee.fixName=Ee.getDependencies=Ee.resolvePlugin=Ee.getPlugins=Ee.getIncludedPluginPackages=void 0;var Wte=(Cn(),Ae(En)),Kte=Bs(),ov=require("path"),ta=Wte.__importDefault(Vs()),Yte=Vd(),Jte=sc(),WR=uh(),Xte=GR();function KR(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ee.getIncludedPluginPackages=KR;async function Zte(t,e){var r;let n=(r=KR(t,e))!==null&&r!==void 0?r:JR(t);return(await Promise.all(n.map(async o=>YR(t,o)))).filter(o=>!!o)}Ee.getPlugins=Zte;async function YR(t,e){try{let r=(0,WR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,Yte.fatal)(`Unable to find ${ta.default.strong(`node_modules/${e}`)}.
161
- Are you sure ${ta.default.strong(e)} is installed?`);let n=(0,ov.dirname)(r),i=await(0,Kte.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:sv(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,ov.join)(n,"plugin.xml"),s=await(0,Xte.readXML)(o);return{id:e,name:sv(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ee.resolvePlugin=YR;function JR(t){var e,r;return[...Object.keys((e=t.app.package.dependencies)!==null&&e!==void 0?e:{}),...Object.keys((r=t.app.package.devDependencies)!==null&&r!==void 0?r:{})]}Ee.getDependencies=JR;function sv(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ee.fixName=sv;function Qte(t,e,r="capacitor"){if(t.length===0)return;let n,i=t.length===1?"":"s";switch(r){case"cordova":n=`Found ${t.length} Cordova plugin${i} for ${ta.default.strong(e)}:
160
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(PR.hide):this.out.write(_te(this.outputText,this.out.columns)),super.render(),this.outputText=[TR.symbol(this.done,this.aborted),kR.bold(this.msg),TR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ete.line+PR.to(0)+this.outputText))}};RR.exports=rv});var jR=y((cme,IR)=>{"use strict";IR.exports={TextPrompt:RP(),SelectPrompt:NP(),TogglePrompt:MP(),DatePrompt:hR(),NumberPrompt:yR(),MultiselectPrompt:X0(),AutocompletePrompt:SR(),AutocompleteMultiselectPrompt:AR(),ConfirmPrompt:$R()}});var LR=y(NR=>{"use strict";var Xt=NR,Cte=jR(),sh=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new Cte[t](e),s=r.onAbort||sh,a=r.onSubmit||sh,u=r.onExit||sh;o.on("state",e.onState||sh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Xt.text=t=>rn("TextPrompt",t);Xt.password=t=>(t.style="password",Xt.text(t));Xt.invisible=t=>(t.style="invisible",Xt.text(t));Xt.number=t=>rn("NumberPrompt",t);Xt.date=t=>rn("DatePrompt",t);Xt.confirm=t=>rn("ConfirmPrompt",t);Xt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Xt.toggle=t=>rn("TogglePrompt",t);Xt.select=t=>rn("SelectPrompt",t);Xt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Xt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Ste=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Xt.autocomplete=t=>(t.suggest=t.suggest||Ste,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var MR=y((fme,qR)=>{"use strict";var nv=LR(),xte=["suggest","format","onState","validate","onRender","type"],BR=()=>{};async function hi(t=[],{onSubmit:e=BR,onCancel:r=BR}={}){let n={},i=hi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,p=!1)=>{if(!(!p&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(xte.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,nv[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=hi._injected?Fte(hi._injected,s.initial):await nv[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function Fte(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Ote(t){hi._injected=(hi._injected||[]).concat(t)}function Ate(t){hi._override=Object.assign({},t)}qR.exports=Object.assign(hi,{prompt:hi,prompts:nv,inject:Ote,override:Ate})});var ah=y((dme,UR)=>{function kte(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}UR.exports=kte("8.6.0")?hP():MR()});var sc=y(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.logSuccess=Zt.logPrompt=Zt.logger=Zt.output=void 0;var iv=(Cn(),Ae(En)),po=(KD(),Ae(WD)),mo=iv.__importDefault(Vs()),Tte=p3(),VR={colors:mo.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Zt.output=(0,Tte.isInteractive)()?new po.TTYOutputStrategy(VR):new po.StreamOutputStrategy(VR);Zt.logger=(0,po.createDefaultLogger)({output:Zt.output,formatterOptions:{titleize:!1,tags:new Map([[po.LOGGER_LEVELS.DEBUG,mo.default.log.DEBUG("[debug]")],[po.LOGGER_LEVELS.INFO,mo.default.log.INFO("[info]")],[po.LOGGER_LEVELS.WARN,mo.default.log.WARN("[warn]")],[po.LOGGER_LEVELS.ERROR,mo.default.log.ERROR("[error]")]])}});async function Pte(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>iv.__importStar((KD(),Ae(WD)))),{prompt:n}=await Promise.resolve().then(()=>iv.__importStar(ah()));return Zt.logger.log({msg:`${mo.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Zt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Zt.logPrompt=Pte;function Rte(t){Zt.logger.msg(`${mo.default.success("[success]")} ${t}`)}Zt.logSuccess=Rte});var uh=y(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.resolveNode=ea.requireTS=void 0;var $te=Bs(),Ite=require("fs"),jte=require("path"),Nte=(t,e)=>{let r=(0,jte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,$te.readFileSync)(o,"utf8");o.endsWith(".ts")?a=t.transpileModule(a,{fileName:o,compilerOptions:{module:t.ModuleKind.CommonJS,moduleResolution:t.ModuleResolutionKind.NodeJs,esModuleInterop:!0,strict:!0,target:t.ScriptTarget.ES2017},reportDiagnostics:!0}).outputText:a=a.replace(/export\s+\w+\s+(\w+)/gm,"exports.$1"),(s=i._compile)===null||s===void 0||s.call(i,a,o)};let n=require(r);return delete require.extensions[".ts"],n};ea.requireTS=Nte;function Lte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Ite.existsSync)(n)?n:null}}ea.resolveNode=Lte});var HR={};mn(HR,{default:()=>Bte});var Bte,zR=ct(()=>{Bte={}});var GR=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var qte=(Cn(),Ae(En)),Mte=Bs(),Dc=qte.__importDefault((zR(),Ae(HR)));async function Ute(t){var e;try{let r=await(0,Mte.readFile)(t,{encoding:"utf-8"});try{return await Dc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=Ute;function Vte(t,e){let r=e!==void 0?new Dc.default.Parser({...e}):new Dc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=Vte;async function Hte(t){return new Promise(e=>{let n=new Dc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=Hte;function zte(t,e){return new Dc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=zte});var XR=y(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.getAllElements=Ee.getFilePath=Ee.getAssets=Ee.getJSModules=Ee.getPluginType=Ee.getPlatformElement=Ee.getPluginPlatform=Ee.printPlugins=Ee.fixName=Ee.getDependencies=Ee.resolvePlugin=Ee.getPlugins=Ee.getIncludedPluginPackages=void 0;var Gte=(Cn(),Ae(En)),Wte=Bs(),ov=require("path"),ta=Gte.__importDefault(Vs()),Kte=Vd(),Yte=sc(),WR=uh(),Jte=GR();function KR(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ee.getIncludedPluginPackages=KR;async function Xte(t,e){var r;let n=(r=KR(t,e))!==null&&r!==void 0?r:JR(t);return(await Promise.all(n.map(async o=>YR(t,o)))).filter(o=>!!o)}Ee.getPlugins=Xte;async function YR(t,e){try{let r=(0,WR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,Kte.fatal)(`Unable to find ${ta.default.strong(`node_modules/${e}`)}.
161
+ Are you sure ${ta.default.strong(e)} is installed?`);let n=(0,ov.dirname)(r),i=await(0,Wte.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:sv(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,ov.join)(n,"plugin.xml"),s=await(0,Jte.readXML)(o);return{id:e,name:sv(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ee.resolvePlugin=YR;function JR(t){var e,r;return[...Object.keys((e=t.app.package.dependencies)!==null&&e!==void 0?e:{}),...Object.keys((r=t.app.package.devDependencies)!==null&&r!==void 0?r:{})]}Ee.getDependencies=JR;function sv(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ee.fixName=sv;function Zte(t,e,r="capacitor"){if(t.length===0)return;let n,i=t.length===1?"":"s";switch(r){case"cordova":n=`Found ${t.length} Cordova plugin${i} for ${ta.default.strong(e)}:
162
162
  `;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${ta.default.strong(e)}, skipped install:
163
163
  `;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${ta.default.strong(e)}:
164
164
  `;break}n+=t.map(o=>`${o.id}${ta.default.weak(`@${o.version}`)}`).join(`
165
- `),Jte.logger.info(n)}Ee.printPlugins=Qte;function av(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=av;function ere(t,e,r){let n=av(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=ere;function tre(t,e){var r,n,i,o;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(o=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&o!==void 0?o:0}return 0}Ee.getPluginType=tre;function rre(t,e){return uv(t,e,"js-module")}Ee.getJSModules=rre;function nre(t,e){return uv(t,e,"asset")}Ee.getAssets=nre;function ire(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,WR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,ov.join)(e.rootPath,r)}Ee.getFilePath=ire;function uv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=av(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=uv});var ZR={};mn(ZR,{default:()=>ore});var ore,QR=ct(()=>{ore={}});var ch=y(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.isInstalled=pi.getCommandOutput=pi.runCommand=void 0;var cv=(QR(),Ae(ZR));async function e$(t,e,r={}){let n=new cv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof cv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}pi.runCommand=e$;async function sre(t,e,r={}){try{return(await e$(t,e,r)).trim()}catch{return null}}pi.getCommandOutput=sre;async function are(t){try{await(0,cv.which)(t)}catch{return!1}return!0}pi.isInstalled=are});var vc=y((Dme,t$)=>{var ure="2.0.0",cre=Number.MAX_SAFE_INTEGER||9007199254740991,lre=16,fre=250,dre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:lre,MAX_SAFE_BUILD_LENGTH:fre,MAX_SAFE_INTEGER:cre,RELEASE_TYPES:dre,SEMVER_SPEC_VERSION:ure,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var bc=y((vme,r$)=>{var hre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};r$.exports=hre});var ra=y((In,n$)=>{var{MAX_SAFE_COMPONENT_LENGTH:lv,MAX_SAFE_BUILD_LENGTH:pre,MAX_LENGTH:mre}=vc(),gre=bc();In=n$.exports={};var yre=In.re=[],Dre=In.safeRe=[],z=In.src=[],G=In.t={},vre=0,fv="[a-zA-Z0-9-]",bre=[["\\s",1],["\\d",mre],[fv,pre]],wre=t=>{for(let[e,r]of bre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=wre(e),i=vre++;gre(t,i,e),G[t]=i,z[i]=e,yre[i]=new RegExp(e,r?"g":void 0),Dre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${fv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${fv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${lv}})(?:\\.(\\d{1,${lv}}))?(?:\\.(\\d{1,${lv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var lh=y((bme,i$)=>{var _re=Object.freeze({loose:!0}),Ere=Object.freeze({}),Cre=t=>t?typeof t!="object"?_re:t:Ere;i$.exports=Cre});var dv=y((wme,a$)=>{var o$=/^[0-9]+$/,s$=(t,e)=>{let r=o$.test(t),n=o$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Sre=(t,e)=>s$(e,t);a$.exports={compareIdentifiers:s$,rcompareIdentifiers:Sre}});var St=y((_me,f$)=>{var fh=bc(),{MAX_LENGTH:u$,MAX_SAFE_INTEGER:dh}=vc(),{safeRe:c$,t:l$}=ra(),xre=lh(),{compareIdentifiers:na}=dv(),hv=class t{constructor(e,r){if(r=xre(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>u$)throw new TypeError(`version is longer than ${u$} characters`);fh("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?c$[l$.LOOSE]:c$[l$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>dh||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dh||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dh||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<dh)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(fh("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),na(this.major,e.major)||na(this.minor,e.minor)||na(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(fh("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return na(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(fh("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return na(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),na(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};f$.exports=hv});var go=y((Eme,h$)=>{var d$=St(),Fre=(t,e,r=!1)=>{if(t instanceof d$)return t;try{return new d$(t,e)}catch(n){if(!r)return null;throw n}};h$.exports=Fre});var m$=y((Cme,p$)=>{var Ore=go(),Are=(t,e)=>{let r=Ore(t,e);return r?r.version:null};p$.exports=Are});var y$=y((Sme,g$)=>{var kre=go(),Tre=(t,e)=>{let r=kre(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};g$.exports=Tre});var b$=y((xme,v$)=>{var D$=St(),Pre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new D$(t instanceof D$?t.version:t,r).inc(e,n,i).version}catch{return null}};v$.exports=Pre});var E$=y((Fme,_$)=>{var w$=go(),Rre=(t,e)=>{let r=w$(t,null,!0),n=w$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};_$.exports=Rre});var S$=y((Ome,C$)=>{var $re=St(),Ire=(t,e)=>new $re(t,e).major;C$.exports=Ire});var F$=y((Ame,x$)=>{var jre=St(),Nre=(t,e)=>new jre(t,e).minor;x$.exports=Nre});var A$=y((kme,O$)=>{var Lre=St(),Bre=(t,e)=>new Lre(t,e).patch;O$.exports=Bre});var T$=y((Tme,k$)=>{var qre=go(),Mre=(t,e)=>{let r=qre(t,e);return r&&r.prerelease.length?r.prerelease:null};k$.exports=Mre});var wr=y((Pme,R$)=>{var P$=St(),Ure=(t,e,r)=>new P$(t,r).compare(new P$(e,r));R$.exports=Ure});var I$=y((Rme,$$)=>{var Vre=wr(),Hre=(t,e,r)=>Vre(e,t,r);$$.exports=Hre});var N$=y(($me,j$)=>{var zre=wr(),Gre=(t,e)=>zre(t,e,!0);j$.exports=Gre});var hh=y((Ime,B$)=>{var L$=St(),Wre=(t,e,r)=>{let n=new L$(t,r),i=new L$(e,r);return n.compare(i)||n.compareBuild(i)};B$.exports=Wre});var M$=y((jme,q$)=>{var Kre=hh(),Yre=(t,e)=>t.sort((r,n)=>Kre(r,n,e));q$.exports=Yre});var V$=y((Nme,U$)=>{var Jre=hh(),Xre=(t,e)=>t.sort((r,n)=>Jre(n,r,e));U$.exports=Xre});var wc=y((Lme,H$)=>{var Zre=wr(),Qre=(t,e,r)=>Zre(t,e,r)>0;H$.exports=Qre});var ph=y((Bme,z$)=>{var ene=wr(),tne=(t,e,r)=>ene(t,e,r)<0;z$.exports=tne});var pv=y((qme,G$)=>{var rne=wr(),nne=(t,e,r)=>rne(t,e,r)===0;G$.exports=nne});var mv=y((Mme,W$)=>{var ine=wr(),one=(t,e,r)=>ine(t,e,r)!==0;W$.exports=one});var mh=y((Ume,K$)=>{var sne=wr(),ane=(t,e,r)=>sne(t,e,r)>=0;K$.exports=ane});var gh=y((Vme,Y$)=>{var une=wr(),cne=(t,e,r)=>une(t,e,r)<=0;Y$.exports=cne});var gv=y((Hme,J$)=>{var lne=pv(),fne=mv(),dne=wc(),hne=mh(),pne=ph(),mne=gh(),gne=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return lne(t,r,n);case"!=":return fne(t,r,n);case">":return dne(t,r,n);case">=":return hne(t,r,n);case"<":return pne(t,r,n);case"<=":return mne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};J$.exports=gne});var Z$=y((zme,X$)=>{var yne=St(),Dne=go(),{safeRe:yh,t:Dh}=ra(),vne=(t,e)=>{if(t instanceof yne)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?yh[Dh.COERCEFULL]:yh[Dh.COERCE]);else{let u=e.includePrerelease?yh[Dh.COERCERTLFULL]:yh[Dh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Dne(`${n}.${i}.${o}${s}${a}`,e)};X$.exports=vne});var eI=y((Gme,Q$)=>{var yv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Q$.exports=yv});var _r=y((Wme,iI)=>{var bne=/\s+/g,Dv=class t{constructor(e,r){if(r=_ne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof vv)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(bne," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!rI(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Ane(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Fne)|(this.options.loose&&One))+":"+e,i=tI.get(n);if(i)return i;let o=this.options.loose,s=o?Qt[$t.HYPHENRANGELOOSE]:Qt[$t.HYPHENRANGE];e=e.replace(s,Bne(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(Qt[$t.COMPARATORTRIM],Cne),Re("comparator trim",e),e=e.replace(Qt[$t.TILDETRIM],Sne),Re("tilde trim",e),e=e.replace(Qt[$t.CARETTRIM],xne),Re("caret trim",e);let a=e.split(" ").map(f=>kne(f,this.options)).join(" ").split(/\s+/).map(f=>Lne(f,this.options));o&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(Qt[$t.COMPARATORLOOSE])))),Re("range list",a);let u=new Map,c=a.map(f=>new vv(f,this.options));for(let f of c){if(rI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return tI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>nI(n,r)&&e.set.some(i=>nI(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Ene(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(qne(this.set[r],e,this.options))return!0;return!1}};iI.exports=Dv;var wne=eI(),tI=new wne,_ne=lh(),vv=_c(),Re=bc(),Ene=St(),{safeRe:Qt,t:$t,comparatorTrimReplace:Cne,tildeTrimReplace:Sne,caretTrimReplace:xne}=ra(),{FLAG_INCLUDE_PRERELEASE:Fne,FLAG_LOOSE:One}=vc(),rI=t=>t.value==="<0.0.0-0",Ane=t=>t.value==="",nI=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},kne=(t,e)=>(Re("comp",t,e),t=Rne(t,e),Re("caret",t),t=Tne(t,e),Re("tildes",t),t=Ine(t,e),Re("xrange",t),t=Nne(t,e),Re("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",Tne=(t,e)=>t.trim().split(/\s+/).map(r=>Pne(r,e)).join(" "),Pne=(t,e)=>{let r=e.loose?Qt[$t.TILDELOOSE]:Qt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{Re("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Re("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Re("tilde return",u),u})},Rne=(t,e)=>t.trim().split(/\s+/).map(r=>$ne(r,e)).join(" "),$ne=(t,e)=>{Re("caret",t,e);let r=e.loose?Qt[$t.CARETLOOSE]:Qt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{Re("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Re("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Re("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Re("caret return",c),c})},Ine=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>jne(r,e)).join(" ")),jne=(t,e)=>{t=t.trim();let r=e.loose?Qt[$t.XRANGELOOSE]:Qt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{Re("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Re("xRange return",n),n})},Nne=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(Qt[$t.STAR],"")),Lne=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(Qt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),Bne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),qne=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Re(t[n].semver),t[n].semver!==vv.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var _c=y((Kme,lI)=>{var Ec=Symbol("SemVer ANY"),_v=class t{static get ANY(){return Ec}constructor(e,r){if(r=oI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),wv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Ec?this.value="":this.value=this.operator+this.semver.version,wv("comp",this)}parse(e){let r=this.options.loose?sI[aI.COMPARATORLOOSE]:sI[aI.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new uI(n[2],this.options.loose):this.semver=Ec}toString(){return this.value}test(e){if(wv("Comparator.test",e,this.options.loose),this.semver===Ec||e===Ec)return!0;if(typeof e=="string")try{e=new uI(e,this.options)}catch{return!1}return bv(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new cI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new cI(this.value,r).test(e.semver):(r=oI(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||bv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||bv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};lI.exports=_v;var oI=lh(),{safeRe:sI,t:aI}=ra(),bv=gv(),wv=bc(),uI=St(),cI=_r()});var Cc=y((Yme,fI)=>{var Mne=_r(),Une=(t,e,r)=>{try{e=new Mne(e,r)}catch{return!1}return e.test(t)};fI.exports=Une});var hI=y((Jme,dI)=>{var Vne=_r(),Hne=(t,e)=>new Vne(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));dI.exports=Hne});var mI=y((Xme,pI)=>{var zne=St(),Gne=_r(),Wne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Gne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new zne(n,r))}),n};pI.exports=Wne});var yI=y((Zme,gI)=>{var Kne=St(),Yne=_r(),Jne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Yne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Kne(n,r))}),n};gI.exports=Jne});var bI=y((Qme,vI)=>{var Ev=St(),Xne=_r(),DI=wc(),Zne=(t,e)=>{t=new Xne(t,e);let r=new Ev("0.0.0");if(t.test(r)||(r=new Ev("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new Ev(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||DI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||DI(r,o))&&(r=o)}return r&&t.test(r)?r:null};vI.exports=Zne});var _I=y((ege,wI)=>{var Qne=_r(),eie=(t,e)=>{try{return new Qne(t,e).range||"*"}catch{return null}};wI.exports=eie});var vh=y((tge,xI)=>{var tie=St(),SI=_c(),{ANY:rie}=SI,nie=_r(),iie=Cc(),EI=wc(),CI=ph(),oie=gh(),sie=mh(),aie=(t,e,r,n)=>{t=new tie(t,n),e=new nie(e,n);let i,o,s,a,u;switch(r){case">":i=EI,o=oie,s=CI,a=">",u=">=";break;case"<":i=CI,o=sie,s=EI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(iie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===rie&&(d=new SI(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};xI.exports=aie});var OI=y((rge,FI)=>{var uie=vh(),cie=(t,e,r)=>uie(t,e,">",r);FI.exports=cie});var kI=y((nge,AI)=>{var lie=vh(),fie=(t,e,r)=>lie(t,e,"<",r);AI.exports=fie});var RI=y((ige,PI)=>{var TI=_r(),die=(t,e,r)=>(t=new TI(t,r),e=new TI(e,r),t.intersects(e,r));PI.exports=die});var II=y((oge,$I)=>{var hie=Cc(),pie=wr();$I.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>pie(l,f,r));for(let l of s)hie(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var MI=y((sge,qI)=>{var jI=_r(),Sv=_c(),{ANY:Cv}=Sv,Sc=Cc(),xv=wr(),mie=(t,e,r={})=>{if(t===e)return!0;t=new jI(t,r),e=new jI(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=yie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},gie=[new Sv(">=0.0.0-0")],NI=[new Sv(">=0.0.0")],yie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Cv){if(e.length===1&&e[0].semver===Cv)return!0;r.includePrerelease?t=gie:t=NI}if(e.length===1&&e[0].semver===Cv){if(r.includePrerelease)return!0;e=NI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=LI(i,d,r):d.operator==="<"||d.operator==="<="?o=BI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=xv(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(i&&!Sc(d,String(i),r)||o&&!Sc(d,String(o),r))return null;for(let p of e)if(!Sc(d,String(p),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=LI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Sc(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=BI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Sc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},LI=(t,e,r)=>{if(!t)return e;let n=xv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},BI=(t,e,r)=>{if(!t)return e;let n=xv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};qI.exports=mie});var Ov=y((age,HI)=>{var Fv=ra(),UI=vc(),Die=St(),VI=dv(),vie=go(),bie=m$(),wie=y$(),_ie=b$(),Eie=E$(),Cie=S$(),Sie=F$(),xie=A$(),Fie=T$(),Oie=wr(),Aie=I$(),kie=N$(),Tie=hh(),Pie=M$(),Rie=V$(),$ie=wc(),Iie=ph(),jie=pv(),Nie=mv(),Lie=mh(),Bie=gh(),qie=gv(),Mie=Z$(),Uie=_c(),Vie=_r(),Hie=Cc(),zie=hI(),Gie=mI(),Wie=yI(),Kie=bI(),Yie=_I(),Jie=vh(),Xie=OI(),Zie=kI(),Qie=RI(),eoe=II(),toe=MI();HI.exports={parse:vie,valid:bie,clean:wie,inc:_ie,diff:Eie,major:Cie,minor:Sie,patch:xie,prerelease:Fie,compare:Oie,rcompare:Aie,compareLoose:kie,compareBuild:Tie,sort:Pie,rsort:Rie,gt:$ie,lt:Iie,eq:jie,neq:Nie,gte:Lie,lte:Bie,cmp:qie,coerce:Mie,Comparator:Uie,Range:Vie,satisfies:Hie,toComparators:zie,maxSatisfying:Gie,minSatisfying:Wie,minVersion:Kie,validRange:Yie,outside:Jie,gtr:Xie,ltr:Zie,intersects:Qie,simplifyRange:eoe,subset:toe,SemVer:Die,re:Fv.re,src:Fv.src,tokens:Fv.t,SEMVER_SPEC_VERSION:UI.SEMVER_SPEC_VERSION,RELEASE_TYPES:UI.RELEASE_TYPES,compareIdentifiers:VI.compareIdentifiers,rcompareIdentifiers:VI.rcompareIdentifiers}});var r6=y(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var Fc=(Cn(),Ae(En)),mi=Bs(),zI=HD(),yo=require("path"),Ce=Fc.__importDefault(Vs()),ia=Vd(),WI=sc(),roe=XR(),GI=ll(),xc=uh(),noe=ch();async function ioe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
- `)}W.check=ioe;async function ooe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,mi.pathExists)(t.app.webDirAbs)?await(0,mi.pathExists)((0,yo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Ce.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}) must contain an ${Ce.default.strong("index.html")} file.
165
+ `),Yte.logger.info(n)}Ee.printPlugins=Zte;function av(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=av;function Qte(t,e,r){let n=av(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=Qte;function ere(t,e){var r,n,i,o;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(o=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&o!==void 0?o:0}return 0}Ee.getPluginType=ere;function tre(t,e){return uv(t,e,"js-module")}Ee.getJSModules=tre;function rre(t,e){return uv(t,e,"asset")}Ee.getAssets=rre;function nre(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,WR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,ov.join)(e.rootPath,r)}Ee.getFilePath=nre;function uv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=av(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=uv});var ZR={};mn(ZR,{default:()=>ire});var ire,QR=ct(()=>{ire={}});var ch=y(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.isInstalled=pi.getCommandOutput=pi.runCommand=void 0;var cv=(QR(),Ae(ZR));async function e$(t,e,r={}){let n=new cv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof cv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}pi.runCommand=e$;async function ore(t,e,r={}){try{return(await e$(t,e,r)).trim()}catch{return null}}pi.getCommandOutput=ore;async function sre(t){try{await(0,cv.which)(t)}catch{return!1}return!0}pi.isInstalled=sre});var vc=y((Dme,t$)=>{var are="2.0.0",ure=Number.MAX_SAFE_INTEGER||9007199254740991,cre=16,lre=250,fre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:cre,MAX_SAFE_BUILD_LENGTH:lre,MAX_SAFE_INTEGER:ure,RELEASE_TYPES:fre,SEMVER_SPEC_VERSION:are,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var bc=y((vme,r$)=>{var dre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};r$.exports=dre});var ra=y((In,n$)=>{var{MAX_SAFE_COMPONENT_LENGTH:lv,MAX_SAFE_BUILD_LENGTH:hre,MAX_LENGTH:pre}=vc(),mre=bc();In=n$.exports={};var gre=In.re=[],yre=In.safeRe=[],z=In.src=[],G=In.t={},Dre=0,fv="[a-zA-Z0-9-]",vre=[["\\s",1],["\\d",pre],[fv,hre]],bre=t=>{for(let[e,r]of vre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=bre(e),i=Dre++;mre(t,i,e),G[t]=i,z[i]=e,gre[i]=new RegExp(e,r?"g":void 0),yre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${fv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${fv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${lv}})(?:\\.(\\d{1,${lv}}))?(?:\\.(\\d{1,${lv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var lh=y((bme,i$)=>{var wre=Object.freeze({loose:!0}),_re=Object.freeze({}),Ere=t=>t?typeof t!="object"?wre:t:_re;i$.exports=Ere});var dv=y((wme,a$)=>{var o$=/^[0-9]+$/,s$=(t,e)=>{let r=o$.test(t),n=o$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Cre=(t,e)=>s$(e,t);a$.exports={compareIdentifiers:s$,rcompareIdentifiers:Cre}});var St=y((_me,f$)=>{var fh=bc(),{MAX_LENGTH:u$,MAX_SAFE_INTEGER:dh}=vc(),{safeRe:c$,t:l$}=ra(),Sre=lh(),{compareIdentifiers:na}=dv(),hv=class t{constructor(e,r){if(r=Sre(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>u$)throw new TypeError(`version is longer than ${u$} characters`);fh("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?c$[l$.LOOSE]:c$[l$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>dh||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dh||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dh||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<dh)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(fh("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),na(this.major,e.major)||na(this.minor,e.minor)||na(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(fh("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return na(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(fh("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return na(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),na(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};f$.exports=hv});var go=y((Eme,h$)=>{var d$=St(),xre=(t,e,r=!1)=>{if(t instanceof d$)return t;try{return new d$(t,e)}catch(n){if(!r)return null;throw n}};h$.exports=xre});var m$=y((Cme,p$)=>{var Fre=go(),Ore=(t,e)=>{let r=Fre(t,e);return r?r.version:null};p$.exports=Ore});var y$=y((Sme,g$)=>{var Are=go(),kre=(t,e)=>{let r=Are(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};g$.exports=kre});var b$=y((xme,v$)=>{var D$=St(),Tre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new D$(t instanceof D$?t.version:t,r).inc(e,n,i).version}catch{return null}};v$.exports=Tre});var E$=y((Fme,_$)=>{var w$=go(),Pre=(t,e)=>{let r=w$(t,null,!0),n=w$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};_$.exports=Pre});var S$=y((Ome,C$)=>{var Rre=St(),$re=(t,e)=>new Rre(t,e).major;C$.exports=$re});var F$=y((Ame,x$)=>{var Ire=St(),jre=(t,e)=>new Ire(t,e).minor;x$.exports=jre});var A$=y((kme,O$)=>{var Nre=St(),Lre=(t,e)=>new Nre(t,e).patch;O$.exports=Lre});var T$=y((Tme,k$)=>{var Bre=go(),qre=(t,e)=>{let r=Bre(t,e);return r&&r.prerelease.length?r.prerelease:null};k$.exports=qre});var _r=y((Pme,R$)=>{var P$=St(),Mre=(t,e,r)=>new P$(t,r).compare(new P$(e,r));R$.exports=Mre});var I$=y((Rme,$$)=>{var Ure=_r(),Vre=(t,e,r)=>Ure(e,t,r);$$.exports=Vre});var N$=y(($me,j$)=>{var Hre=_r(),zre=(t,e)=>Hre(t,e,!0);j$.exports=zre});var hh=y((Ime,B$)=>{var L$=St(),Gre=(t,e,r)=>{let n=new L$(t,r),i=new L$(e,r);return n.compare(i)||n.compareBuild(i)};B$.exports=Gre});var M$=y((jme,q$)=>{var Wre=hh(),Kre=(t,e)=>t.sort((r,n)=>Wre(r,n,e));q$.exports=Kre});var V$=y((Nme,U$)=>{var Yre=hh(),Jre=(t,e)=>t.sort((r,n)=>Yre(n,r,e));U$.exports=Jre});var wc=y((Lme,H$)=>{var Xre=_r(),Zre=(t,e,r)=>Xre(t,e,r)>0;H$.exports=Zre});var ph=y((Bme,z$)=>{var Qre=_r(),ene=(t,e,r)=>Qre(t,e,r)<0;z$.exports=ene});var pv=y((qme,G$)=>{var tne=_r(),rne=(t,e,r)=>tne(t,e,r)===0;G$.exports=rne});var mv=y((Mme,W$)=>{var nne=_r(),ine=(t,e,r)=>nne(t,e,r)!==0;W$.exports=ine});var mh=y((Ume,K$)=>{var one=_r(),sne=(t,e,r)=>one(t,e,r)>=0;K$.exports=sne});var gh=y((Vme,Y$)=>{var ane=_r(),une=(t,e,r)=>ane(t,e,r)<=0;Y$.exports=une});var gv=y((Hme,J$)=>{var cne=pv(),lne=mv(),fne=wc(),dne=mh(),hne=ph(),pne=gh(),mne=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return cne(t,r,n);case"!=":return lne(t,r,n);case">":return fne(t,r,n);case">=":return dne(t,r,n);case"<":return hne(t,r,n);case"<=":return pne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};J$.exports=mne});var Z$=y((zme,X$)=>{var gne=St(),yne=go(),{safeRe:yh,t:Dh}=ra(),Dne=(t,e)=>{if(t instanceof gne)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?yh[Dh.COERCEFULL]:yh[Dh.COERCE]);else{let u=e.includePrerelease?yh[Dh.COERCERTLFULL]:yh[Dh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return yne(`${n}.${i}.${o}${s}${a}`,e)};X$.exports=Dne});var eI=y((Gme,Q$)=>{var yv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Q$.exports=yv});var Er=y((Wme,iI)=>{var vne=/\s+/g,Dv=class t{constructor(e,r){if(r=wne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof vv)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(vne," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!rI(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&One(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&xne)|(this.options.loose&&Fne))+":"+e,i=tI.get(n);if(i)return i;let o=this.options.loose,s=o?Qt[$t.HYPHENRANGELOOSE]:Qt[$t.HYPHENRANGE];e=e.replace(s,Lne(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(Qt[$t.COMPARATORTRIM],Ene),Re("comparator trim",e),e=e.replace(Qt[$t.TILDETRIM],Cne),Re("tilde trim",e),e=e.replace(Qt[$t.CARETTRIM],Sne),Re("caret trim",e);let a=e.split(" ").map(f=>Ane(f,this.options)).join(" ").split(/\s+/).map(f=>Nne(f,this.options));o&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(Qt[$t.COMPARATORLOOSE])))),Re("range list",a);let u=new Map,c=a.map(f=>new vv(f,this.options));for(let f of c){if(rI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return tI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>nI(n,r)&&e.set.some(i=>nI(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new _ne(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Bne(this.set[r],e,this.options))return!0;return!1}};iI.exports=Dv;var bne=eI(),tI=new bne,wne=lh(),vv=_c(),Re=bc(),_ne=St(),{safeRe:Qt,t:$t,comparatorTrimReplace:Ene,tildeTrimReplace:Cne,caretTrimReplace:Sne}=ra(),{FLAG_INCLUDE_PRERELEASE:xne,FLAG_LOOSE:Fne}=vc(),rI=t=>t.value==="<0.0.0-0",One=t=>t.value==="",nI=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},Ane=(t,e)=>(Re("comp",t,e),t=Pne(t,e),Re("caret",t),t=kne(t,e),Re("tildes",t),t=$ne(t,e),Re("xrange",t),t=jne(t,e),Re("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",kne=(t,e)=>t.trim().split(/\s+/).map(r=>Tne(r,e)).join(" "),Tne=(t,e)=>{let r=e.loose?Qt[$t.TILDELOOSE]:Qt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{Re("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Re("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Re("tilde return",u),u})},Pne=(t,e)=>t.trim().split(/\s+/).map(r=>Rne(r,e)).join(" "),Rne=(t,e)=>{Re("caret",t,e);let r=e.loose?Qt[$t.CARETLOOSE]:Qt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{Re("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Re("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Re("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Re("caret return",c),c})},$ne=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>Ine(r,e)).join(" ")),Ine=(t,e)=>{t=t.trim();let r=e.loose?Qt[$t.XRANGELOOSE]:Qt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{Re("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Re("xRange return",n),n})},jne=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(Qt[$t.STAR],"")),Nne=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(Qt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),Lne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Bne=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Re(t[n].semver),t[n].semver!==vv.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var _c=y((Kme,lI)=>{var Ec=Symbol("SemVer ANY"),_v=class t{static get ANY(){return Ec}constructor(e,r){if(r=oI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),wv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Ec?this.value="":this.value=this.operator+this.semver.version,wv("comp",this)}parse(e){let r=this.options.loose?sI[aI.COMPARATORLOOSE]:sI[aI.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new uI(n[2],this.options.loose):this.semver=Ec}toString(){return this.value}test(e){if(wv("Comparator.test",e,this.options.loose),this.semver===Ec||e===Ec)return!0;if(typeof e=="string")try{e=new uI(e,this.options)}catch{return!1}return bv(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new cI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new cI(this.value,r).test(e.semver):(r=oI(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||bv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||bv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};lI.exports=_v;var oI=lh(),{safeRe:sI,t:aI}=ra(),bv=gv(),wv=bc(),uI=St(),cI=Er()});var Cc=y((Yme,fI)=>{var qne=Er(),Mne=(t,e,r)=>{try{e=new qne(e,r)}catch{return!1}return e.test(t)};fI.exports=Mne});var hI=y((Jme,dI)=>{var Une=Er(),Vne=(t,e)=>new Une(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));dI.exports=Vne});var mI=y((Xme,pI)=>{var Hne=St(),zne=Er(),Gne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new zne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Hne(n,r))}),n};pI.exports=Gne});var yI=y((Zme,gI)=>{var Wne=St(),Kne=Er(),Yne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Kne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Wne(n,r))}),n};gI.exports=Yne});var bI=y((Qme,vI)=>{var Ev=St(),Jne=Er(),DI=wc(),Xne=(t,e)=>{t=new Jne(t,e);let r=new Ev("0.0.0");if(t.test(r)||(r=new Ev("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new Ev(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||DI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||DI(r,o))&&(r=o)}return r&&t.test(r)?r:null};vI.exports=Xne});var _I=y((ege,wI)=>{var Zne=Er(),Qne=(t,e)=>{try{return new Zne(t,e).range||"*"}catch{return null}};wI.exports=Qne});var vh=y((tge,xI)=>{var eie=St(),SI=_c(),{ANY:tie}=SI,rie=Er(),nie=Cc(),EI=wc(),CI=ph(),iie=gh(),oie=mh(),sie=(t,e,r,n)=>{t=new eie(t,n),e=new rie(e,n);let i,o,s,a,u;switch(r){case">":i=EI,o=iie,s=CI,a=">",u=">=";break;case"<":i=CI,o=oie,s=EI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(nie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===tie&&(d=new SI(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};xI.exports=sie});var OI=y((rge,FI)=>{var aie=vh(),uie=(t,e,r)=>aie(t,e,">",r);FI.exports=uie});var kI=y((nge,AI)=>{var cie=vh(),lie=(t,e,r)=>cie(t,e,"<",r);AI.exports=lie});var RI=y((ige,PI)=>{var TI=Er(),fie=(t,e,r)=>(t=new TI(t,r),e=new TI(e,r),t.intersects(e,r));PI.exports=fie});var II=y((oge,$I)=>{var die=Cc(),hie=_r();$I.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>hie(l,f,r));for(let l of s)die(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var MI=y((sge,qI)=>{var jI=Er(),Sv=_c(),{ANY:Cv}=Sv,Sc=Cc(),xv=_r(),pie=(t,e,r={})=>{if(t===e)return!0;t=new jI(t,r),e=new jI(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=gie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},mie=[new Sv(">=0.0.0-0")],NI=[new Sv(">=0.0.0")],gie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Cv){if(e.length===1&&e[0].semver===Cv)return!0;r.includePrerelease?t=mie:t=NI}if(e.length===1&&e[0].semver===Cv){if(r.includePrerelease)return!0;e=NI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=LI(i,d,r):d.operator==="<"||d.operator==="<="?o=BI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=xv(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(i&&!Sc(d,String(i),r)||o&&!Sc(d,String(o),r))return null;for(let p of e)if(!Sc(d,String(p),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=LI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Sc(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=BI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Sc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},LI=(t,e,r)=>{if(!t)return e;let n=xv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},BI=(t,e,r)=>{if(!t)return e;let n=xv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};qI.exports=pie});var Ov=y((age,HI)=>{var Fv=ra(),UI=vc(),yie=St(),VI=dv(),Die=go(),vie=m$(),bie=y$(),wie=b$(),_ie=E$(),Eie=S$(),Cie=F$(),Sie=A$(),xie=T$(),Fie=_r(),Oie=I$(),Aie=N$(),kie=hh(),Tie=M$(),Pie=V$(),Rie=wc(),$ie=ph(),Iie=pv(),jie=mv(),Nie=mh(),Lie=gh(),Bie=gv(),qie=Z$(),Mie=_c(),Uie=Er(),Vie=Cc(),Hie=hI(),zie=mI(),Gie=yI(),Wie=bI(),Kie=_I(),Yie=vh(),Jie=OI(),Xie=kI(),Zie=RI(),Qie=II(),eoe=MI();HI.exports={parse:Die,valid:vie,clean:bie,inc:wie,diff:_ie,major:Eie,minor:Cie,patch:Sie,prerelease:xie,compare:Fie,rcompare:Oie,compareLoose:Aie,compareBuild:kie,sort:Tie,rsort:Pie,gt:Rie,lt:$ie,eq:Iie,neq:jie,gte:Nie,lte:Lie,cmp:Bie,coerce:qie,Comparator:Mie,Range:Uie,satisfies:Vie,toComparators:Hie,maxSatisfying:zie,minSatisfying:Gie,minVersion:Wie,validRange:Kie,outside:Yie,gtr:Jie,ltr:Xie,intersects:Zie,simplifyRange:Qie,subset:eoe,SemVer:yie,re:Fv.re,src:Fv.src,tokens:Fv.t,SEMVER_SPEC_VERSION:UI.SEMVER_SPEC_VERSION,RELEASE_TYPES:UI.RELEASE_TYPES,compareIdentifiers:VI.compareIdentifiers,rcompareIdentifiers:VI.rcompareIdentifiers}});var r6=y(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var Fc=(Cn(),Ae(En)),mi=Bs(),zI=HD(),yo=require("path"),Ce=Fc.__importDefault(Vs()),ia=Vd(),WI=sc(),toe=XR(),GI=ll(),xc=uh(),roe=ch();async function noe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
+ `)}W.check=noe;async function ioe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,mi.pathExists)(t.app.webDirAbs)?await(0,mi.pathExists)((0,yo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Ce.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}) must contain an ${Ce.default.strong("index.html")} file.
167
167
  It will be the entry point for the web portion of the Capacitor app.`:`Could not find the web assets directory: ${Ce.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}.
168
- Please create it and make sure it has an ${Ce.default.strong("index.html")} file. You can change the path of this directory in ${Ce.default.strong(t.app.extConfigName)} (${Ce.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Ce.default.input("npm run build")}). More info: ${Ce.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=ooe;async function soe(){return await(0,mi.pathExists)("package.json")||await(0,mi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
168
+ Please create it and make sure it has an ${Ce.default.strong("index.html")} file. You can change the path of this directory in ${Ce.default.strong(t.app.extConfigName)} (${Ce.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Ce.default.input("npm run build")}). More info: ${Ce.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=ioe;async function ooe(){return await(0,mi.pathExists)("package.json")||await(0,mi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
169
169
  Make sure you have a package.json or project.json file in the directory where you run the Capacitor CLI.
170
- More info: ${Ce.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=soe;async function aoe(t,e){return await kv(t,e)?null:`Could not find the ${Ce.default.input(e)} platform.
171
- You must install it in your project first, e.g. w/ ${Ce.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=aoe;async function uoe(t){if(!t.app.appId)return`Missing ${Ce.default.input("appId")} for new platform.
170
+ More info: ${Ce.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=ooe;async function soe(t,e){return await kv(t,e)?null:`Could not find the ${Ce.default.input(e)} platform.
171
+ You must install it in your project first, e.g. w/ ${Ce.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=soe;async function aoe(t){if(!t.app.appId)return`Missing ${Ce.default.input("appId")} for new platform.
172
172
  Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;if(!t.app.appName)return`Missing ${Ce.default.input("appName")} for new platform.
173
- Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;let e=await KI(t,t.app.appId);if(e)return e;let r=await YI(t,t.app.appName);return r||null}W.checkAppConfig=uoe;async function coe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=coe;async function KI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=KI;async function YI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=YI;async function loe(t){return new Promise(e=>setTimeout(e,t))}W.wait=loe;async function foe(t,e,r,n){await Av(t,e,r,n),(await(0,roe.getPlugins)(t,e)).forEach(async o=>{await Av(t,e,o.rootPath,n)})}W.runHooks=foe;async function Av(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>Fc.__importStar(require("child_process"))),s;(0,GI.isNXMonorepo)(r)?s=await(0,mi.readJSON)((0,yo.join)((0,GI.findNXMonorepoRoot)(r),"package.json")):s=await(0,mi.readJSON)((0,yo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=Av;async function doe(t,e){let r=WI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=doe;async function kv(t,e){let r=(0,xc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,mi.readJSON)(r):null}W.getCapacitorPackage=kv;async function JI(t,e){let r=await kv(t,e);return r||(0,ia.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
- Are you sure ${Ce.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=JI;async function wh(t,e){return(await JI(t,e)).version}W.getCapacitorPackageVersion=wh;async function XI(t){return wh(t,"core")}W.getCoreVersion=XI;async function hoe(t){return wh(t,"cli")}W.getCLIVersion=hoe;function poe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function bh(t,e){let r=poe(t,e);return r&&await(0,mi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=bh;async function moe(t,e){if(e){let r=e.toLowerCase().trim();return await Pv(r)?await bh(t,r)||(r==="web"&&(0,ia.fatal)(`Could not find the web platform directory.
173
+ Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;let e=await KI(t,t.app.appId);if(e)return e;let r=await YI(t,t.app.appName);return r||null}W.checkAppConfig=aoe;async function uoe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=uoe;async function KI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=KI;async function YI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=YI;async function coe(t){return new Promise(e=>setTimeout(e,t))}W.wait=coe;async function loe(t,e,r,n){await Av(t,e,r,n),(await(0,toe.getPlugins)(t,e)).forEach(async o=>{await Av(t,e,o.rootPath,n)})}W.runHooks=loe;async function Av(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>Fc.__importStar(require("child_process"))),s;(0,GI.isNXMonorepo)(r)?s=await(0,mi.readJSON)((0,yo.join)((0,GI.findNXMonorepoRoot)(r),"package.json")):s=await(0,mi.readJSON)((0,yo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=Av;async function foe(t,e){let r=WI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=foe;async function kv(t,e){let r=(0,xc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,mi.readJSON)(r):null}W.getCapacitorPackage=kv;async function JI(t,e){let r=await kv(t,e);return r||(0,ia.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
+ Are you sure ${Ce.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=JI;async function wh(t,e){return(await JI(t,e)).version}W.getCapacitorPackageVersion=wh;async function XI(t){return wh(t,"core")}W.getCoreVersion=XI;async function doe(t){return wh(t,"cli")}W.getCLIVersion=doe;function hoe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function bh(t,e){let r=hoe(t,e);return r&&await(0,mi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=bh;async function poe(t,e){if(e){let r=e.toLowerCase().trim();return await Pv(r)?await bh(t,r)||(r==="web"&&(0,ia.fatal)(`Could not find the web platform directory.
175
175
  Make sure ${Ce.default.strong(t.app.webDir)} exists.`),(0,ia.fatal)(`${Ce.default.strong(r)} platform has not been added yet.
176
- See the docs for adding the ${Ce.default.strong(r)} platform: ${Ce.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,ia.fatal)(`Invalid platform: ${Ce.default.input(r)}`),[r]}return t6(t)}W.selectPlatforms=moe;async function Tv(){return["web","android","ios"]}W.getKnownPlatforms=Tv;async function Pv(t){return(await Tv()).includes(t)}W.isValidPlatform=Pv;async function ZI(){return["electron"]}W.getKnownCommunityPlatforms=ZI;async function goe(t){return(await ZI()).includes(t)}W.isValidCommunityPlatform=goe;async function QI(){return["windows"]}W.getKnownEnterprisePlatforms=QI;async function yoe(t){return(await QI()).includes(t)}W.isValidEnterprisePlatform=yoe;async function Doe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>Fc.__importStar(ah()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await Pv(i)){let o=await Tv();(0,ia.fatal)(`Invalid platform: ${Ce.default.input(i)}.
177
- Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=Doe;async function voe(t,e){let{prompt:r}=await Promise.resolve().then(()=>Fc.__importStar(ah())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${e6(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,ia.fatal)(`Invalid target ID: ${Ce.default.input(i)}.
178
- Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=voe;function e6(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=e6;async function t6(t){let e=[];return await bh(t,t.android.name)&&e.push(t.android.name),await bh(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=t6;async function boe(t,e){let r=await Promise.resolve().then(()=>Fc.__importStar(Ov())),n=await XI(t),i=await wh(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&WI.logger.warn(`${Ce.default.strong("@capacitor/core")}${Ce.default.weak(`@${n}`)} version doesn't match ${Ce.default.strong(`@capacitor/${e}`)}${Ce.default.weak(`@${i}`)} version.
179
- Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=boe;function woe(t,e){if(e[0]!=="@"){let n=(0,xc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,yo.dirname)(n);let i=(0,xc.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,yo.dirname)(i);let o=(0,xc.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,yo.dirname)(o)}let r=(0,xc.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,yo.dirname)(r):null}W.resolvePlatform=woe;async function _oe(){try{let t=await(0,noe.runCommand)("java",["--version"]),r=RegExp(/([0-9]+)\.?([0-9]*)\.?([0-9]*)/).exec(t);if(r===null)return-1;let n=parseInt(r[1]),i=parseInt(r[2]);return typeof n=="number"&&n!=1?n:typeof i=="number"&&n==1&&i<9?i:-1}catch{return-1}}W.checkJDKMajorVersion=_oe;function Eoe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Eoe});var n6=y(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.tryFn=void 0;var Coe=async(t,...e)=>{try{return await t(...e)}catch{}return null};_h.tryFn=Coe});var i6=y(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.formatJSObject=void 0;var Soe=(Cn(),Ae(En)),xoe=Soe.__importDefault(require("util"));function Foe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return xoe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Eh.formatJSObject=Foe});var o6=y(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.lazy=gi.LazyPromise=gi.allSerial=void 0;function Ooe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}gi.allSerial=Ooe;var Ch=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};gi.LazyPromise=Ch;function Aoe(t){return new Ch(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}gi.lazy=Aoe});var l6=y(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.checkExternalConfig=nt.writeConfig=nt.loadConfig=nt.CONFIG_FILE_NAME_JSON=nt.CONFIG_FILE_NAME_JS=nt.CONFIG_FILE_NAME_TS=void 0;var $v=(Cn(),Ae(En)),er=Bs(),koe=$v.__importDefault(BA()),ie=require("path"),yi=$v.__importDefault(Vs()),Toe=r6(),Sh=Vd(),u6=sc(),Rv=n6(),Poe=i6(),s6=ll(),a6=uh(),oa=o6(),Roe=ch(),c6=(0,koe.default)("capacitor:config");nt.CONFIG_FILE_NAME_TS="capacitor.config.ts";nt.CONFIG_FILE_NAME_JS="capacitor.config.js";nt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function $oe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Loe(i),a=await(async()=>{var d,p;if((0,s6.isNXMonorepo)(i)){let b=(0,s6.findNXMonorepoRoot)(i),g=await(0,Rv.tryFn)(er.readJSON,(0,ie.resolve)(b,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(p=g?.dependencies)!==null&&p!==void 0?p:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Boe(o),h={android:await qoe(i,s.extConfig,f),ios:await Moe(i,s.extConfig),web:await Uoe(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Rv.tryFn)(er.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return c6("config: %O",h),h}nt.loadConfig=$oe;async function Ioe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,er.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,er.writeFile)(e,Koe(t));break}}}nt.writeConfig=Ioe;async function joe(t,e,r){var n;try{let i=(0,a6.resolveNode)(t,"typescript");i||(0,Sh.fatal)(`Could not find installation of TypeScript.
176
+ See the docs for adding the ${Ce.default.strong(r)} platform: ${Ce.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,ia.fatal)(`Invalid platform: ${Ce.default.input(r)}`),[r]}return t6(t)}W.selectPlatforms=poe;async function Tv(){return["web","android","ios"]}W.getKnownPlatforms=Tv;async function Pv(t){return(await Tv()).includes(t)}W.isValidPlatform=Pv;async function ZI(){return["electron"]}W.getKnownCommunityPlatforms=ZI;async function moe(t){return(await ZI()).includes(t)}W.isValidCommunityPlatform=moe;async function QI(){return["windows"]}W.getKnownEnterprisePlatforms=QI;async function goe(t){return(await QI()).includes(t)}W.isValidEnterprisePlatform=goe;async function yoe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>Fc.__importStar(ah()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await Pv(i)){let o=await Tv();(0,ia.fatal)(`Invalid platform: ${Ce.default.input(i)}.
177
+ Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=yoe;async function Doe(t,e){let{prompt:r}=await Promise.resolve().then(()=>Fc.__importStar(ah())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${e6(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,ia.fatal)(`Invalid target ID: ${Ce.default.input(i)}.
178
+ Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=Doe;function e6(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=e6;async function t6(t){let e=[];return await bh(t,t.android.name)&&e.push(t.android.name),await bh(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=t6;async function voe(t,e){let r=await Promise.resolve().then(()=>Fc.__importStar(Ov())),n=await XI(t),i=await wh(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&WI.logger.warn(`${Ce.default.strong("@capacitor/core")}${Ce.default.weak(`@${n}`)} version doesn't match ${Ce.default.strong(`@capacitor/${e}`)}${Ce.default.weak(`@${i}`)} version.
179
+ Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=voe;function boe(t,e){if(e[0]!=="@"){let n=(0,xc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,yo.dirname)(n);let i=(0,xc.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,yo.dirname)(i);let o=(0,xc.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,yo.dirname)(o)}let r=(0,xc.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,yo.dirname)(r):null}W.resolvePlatform=boe;async function woe(){try{let t=await(0,roe.runCommand)("java",["--version"]),r=RegExp(/([0-9]+)\.?([0-9]*)\.?([0-9]*)/).exec(t);if(r===null)return-1;let n=parseInt(r[1]),i=parseInt(r[2]);return typeof n=="number"&&n!=1?n:typeof i=="number"&&n==1&&i<9?i:-1}catch{return-1}}W.checkJDKMajorVersion=woe;function _oe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=_oe});var n6=y(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.tryFn=void 0;var Eoe=async(t,...e)=>{try{return await t(...e)}catch{}return null};_h.tryFn=Eoe});var i6=y(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.formatJSObject=void 0;var Coe=(Cn(),Ae(En)),Soe=Coe.__importDefault(require("util"));function xoe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Soe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Eh.formatJSObject=xoe});var o6=y(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.lazy=gi.LazyPromise=gi.allSerial=void 0;function Foe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}gi.allSerial=Foe;var Ch=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};gi.LazyPromise=Ch;function Ooe(t){return new Ch(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}gi.lazy=Ooe});var l6=y(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.checkExternalConfig=it.writeConfig=it.loadConfig=it.CONFIG_FILE_NAME_JSON=it.CONFIG_FILE_NAME_JS=it.CONFIG_FILE_NAME_TS=void 0;var $v=(Cn(),Ae(En)),er=Bs(),Aoe=$v.__importDefault(BA()),ie=require("path"),yi=$v.__importDefault(Vs()),koe=r6(),Sh=Vd(),u6=sc(),Rv=n6(),Toe=i6(),s6=ll(),a6=uh(),oa=o6(),Poe=ch(),c6=(0,Aoe.default)("capacitor:config");it.CONFIG_FILE_NAME_TS="capacitor.config.ts";it.CONFIG_FILE_NAME_JS="capacitor.config.js";it.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Roe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Noe(i),a=await(async()=>{var d,p;if((0,s6.isNXMonorepo)(i)){let b=(0,s6.findNXMonorepoRoot)(i),g=await(0,Rv.tryFn)(er.readJSON,(0,ie.resolve)(b,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(p=g?.dependencies)!==null&&p!==void 0?p:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Loe(o),h={android:await Boe(i,s.extConfig,f),ios:await qoe(i,s.extConfig),web:await Moe(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Rv.tryFn)(er.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return c6("config: %O",h),h}it.loadConfig=Roe;async function $oe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,er.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,er.writeFile)(e,Woe(t));break}}}it.writeConfig=$oe;async function Ioe(t,e,r){var n;try{let i=(0,a6.resolveNode)(t,"typescript");i||(0,Sh.fatal)(`Could not find installation of TypeScript.
180
180
  To use ${yi.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${yi.default.input("npm install -D typescript")}`);let o=require(i),s=(0,a6.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,Sh.isFatal)(i)||(0,Sh.fatal)(`Parsing ${yi.default.strong(e)} failed.
181
181
 
182
- ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Noe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,Sh.fatal)(`Parsing ${yi.default.strong(e)} failed.
182
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function joe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,Sh.fatal)(`Parsing ${yi.default.strong(e)} failed.
183
183
 
184
- ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Loe(t){var e;let r=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_TS);if(await(0,er.pathExists)(r))return joe(t,nt.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JS);if(await(0,er.pathExists)(n))return Noe(t,nt.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:nt.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Rv.tryFn)(er.readJSON,i))!==null&&e!==void 0?e:{}}}async function Boe(t){let e="assets",r=(0,ie.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ie.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ie.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,s)}},package:await(0,er.readJSON)((0,ie.resolve)(t,"package.json")),os:Voe(process.platform)}}async function qoe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,p,b,g,w,x,D;let C="android",A=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,A),F="app",L=`${F}/src`,S=`${L}/main`,I=`${S}/assets`,R=`${I}/public`,B=`${S}/res`,q=`${F}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let M=(0,Toe.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",_=(0,oa.lazy)(()=>Goe(r.os)),O={keystorePath:(c=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.keystorePath,keystorePassword:(f=(l=e.android)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(b=(p=e.android)===null||p===void 0?void 0:p.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(w=(g=e.android)===null||g===void 0?void 0:g.buildOptions)===null||w===void 0?void 0:w.signingType,releaseType:(D=(x=e.android)===null||x===void 0?void 0:x.buildOptions)===null||D===void 0?void 0:D.releaseType};return{name:C,minVersion:"22",studioPath:_,platformDir:A,platformDirAbs:$,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ie.resolve)($,v),appDir:F,appDirAbs:(0,ie.resolve)($,F),srcDir:L,srcDirAbs:(0,ie.resolve)($,L),srcMainDir:S,srcMainDirAbs:(0,ie.resolve)($,S),assetsDir:I,assetsDirAbs:(0,ie.resolve)($,I),webDir:R,webDirAbs:(0,ie.resolve)($,R),resDir:B,resDirAbs:(0,ie.resolve)($,B),apkName:M,buildOutputDir:E,buildOutputDirAbs:(0,ie.resolve)($,E),flavor:K,buildOptions:O}}async function Moe(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ie.resolve)(t,a),c=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",l="App",f=(0,ie.resolve)(u,l),h=`${l}/App`,d=(0,ie.resolve)(u,h),p=`${l}/App.xcodeproj`,b=(0,ie.resolve)(u,p),g=(0,oa.lazy)(()=>Hoe(f)),w=(0,oa.lazy)(()=>Woe(t,u,f)),x=(0,oa.lazy)(()=>zoe(f,d,b)),D="capacitor-cordova-ios-plugins";return{name:s,minVersion:"13.0",platformDir:a,platformDirAbs:u,scheme:c,cordovaPluginsDir:D,cordovaPluginsDirAbs:(0,ie.resolve)(u,D),nativeProjectDir:l,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:p,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,oa.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,oa.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function Uoe(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function Voe(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function Hoe(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function zoe(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ie.resolve)(r,"project.pbxproj");try{let s=(await(0,er.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return u6.logger.warn(`Using the iOS project root for the ${yi.default.strong("public")} directory is deprecated.
185
- Please follow the Upgrade Guide to move ${yi.default.strong("public")} inside the iOS target directory: ${yi.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function Goe(t){if(process.env.CAPACITOR_ANDROID_STUDIO_PATH)return process.env.CAPACITOR_ANDROID_STUDIO_PATH;switch(t){case"mac":return"/Applications/Android Studio.app";case"windows":{let{runCommand:e}=await Promise.resolve().then(()=>$v.__importStar(ch())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,er.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){c6("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function Woe(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,er.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,Roe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,er.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function Koe(t){return`import type { CapacitorConfig } from '@capacitor/cli';
184
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Noe(t){var e;let r=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_TS);if(await(0,er.pathExists)(r))return Ioe(t,it.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_JS);if(await(0,er.pathExists)(n))return joe(t,it.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:it.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Rv.tryFn)(er.readJSON,i))!==null&&e!==void 0?e:{}}}async function Loe(t){let e="assets",r=(0,ie.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ie.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ie.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,s)}},package:await(0,er.readJSON)((0,ie.resolve)(t,"package.json")),os:Uoe(process.platform)}}async function Boe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,p,b,g,w,x,D;let C="android",A=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,A),F="app",L=`${F}/src`,S=`${L}/main`,I=`${S}/assets`,R=`${I}/public`,B=`${S}/res`,q=`${F}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let M=(0,koe.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",_=(0,oa.lazy)(()=>zoe(r.os)),O={keystorePath:(c=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.keystorePath,keystorePassword:(f=(l=e.android)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(b=(p=e.android)===null||p===void 0?void 0:p.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(w=(g=e.android)===null||g===void 0?void 0:g.buildOptions)===null||w===void 0?void 0:w.signingType,releaseType:(D=(x=e.android)===null||x===void 0?void 0:x.buildOptions)===null||D===void 0?void 0:D.releaseType};return{name:C,minVersion:"22",studioPath:_,platformDir:A,platformDirAbs:$,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ie.resolve)($,v),appDir:F,appDirAbs:(0,ie.resolve)($,F),srcDir:L,srcDirAbs:(0,ie.resolve)($,L),srcMainDir:S,srcMainDirAbs:(0,ie.resolve)($,S),assetsDir:I,assetsDirAbs:(0,ie.resolve)($,I),webDir:R,webDirAbs:(0,ie.resolve)($,R),resDir:B,resDirAbs:(0,ie.resolve)($,B),apkName:M,buildOutputDir:E,buildOutputDirAbs:(0,ie.resolve)($,E),flavor:K,buildOptions:O}}async function qoe(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ie.resolve)(t,a),c=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",l="App",f=(0,ie.resolve)(u,l),h=`${l}/App`,d=(0,ie.resolve)(u,h),p=`${l}/App.xcodeproj`,b=(0,ie.resolve)(u,p),g=(0,oa.lazy)(()=>Voe(f)),w=(0,oa.lazy)(()=>Goe(t,u,f)),x=(0,oa.lazy)(()=>Hoe(f,d,b)),D="capacitor-cordova-ios-plugins";return{name:s,minVersion:"13.0",platformDir:a,platformDirAbs:u,scheme:c,cordovaPluginsDir:D,cordovaPluginsDirAbs:(0,ie.resolve)(u,D),nativeProjectDir:l,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:p,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,oa.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,oa.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function Moe(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function Uoe(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function Voe(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function Hoe(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ie.resolve)(r,"project.pbxproj");try{let s=(await(0,er.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return u6.logger.warn(`Using the iOS project root for the ${yi.default.strong("public")} directory is deprecated.
185
+ Please follow the Upgrade Guide to move ${yi.default.strong("public")} inside the iOS target directory: ${yi.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function zoe(t){if(process.env.CAPACITOR_ANDROID_STUDIO_PATH)return process.env.CAPACITOR_ANDROID_STUDIO_PATH;switch(t){case"mac":return"/Applications/Android Studio.app";case"windows":{let{runCommand:e}=await Promise.resolve().then(()=>$v.__importStar(ch())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,er.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){c6("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function Goe(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,er.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,Poe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,er.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function Woe(t){return`import type { CapacitorConfig } from '@capacitor/cli';
186
186
 
187
- const config: CapacitorConfig = ${(0,Poe.formatJSObject)(t)};
187
+ const config: CapacitorConfig = ${(0,Toe.formatJSObject)(t)};
188
188
 
189
189
  export default config;
190
- `}function Yoe(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),u6.logger.warn(`The ${yi.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}nt.checkExternalConfig=Yoe});function Joe(){try{return jv.default.statSync("/.dockerenv"),!0}catch{return!1}}function Xoe(){try{return jv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Nv(){return Iv===void 0&&(Iv=Joe()||Xoe()),Iv}var jv,Iv,d6=ct(()=>{jv=fe(require("node:fs"),1)});function sa(){return Lv===void 0&&(Lv=Zoe()||Nv()),Lv}var h6,Lv,Zoe,Bv=ct(()=>{h6=fe(require("node:fs"),1);d6();Zoe=()=>{try{return h6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var qv,m6,g6,p6,Ac,y6=ct(()=>{qv=fe(require("node:process"),1),m6=fe(require("node:os"),1),g6=fe(require("node:fs"),1);Bv();p6=()=>{if(qv.default.platform!=="linux")return!1;if(m6.default.release().toLowerCase().includes("microsoft"))return!sa();try{return g6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!sa():!1}catch{return!1}},Ac=qv.default.env.__IS_WSL_TEST__?p6:p6()});function Do(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var D6=ct(()=>{});async function Mv(){if(b6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await Qoe("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var v6,b6,w6,Qoe,_6=ct(()=>{v6=require("node:util"),b6=fe(require("node:process"),1),w6=require("node:child_process"),Qoe=(0,v6.promisify)(w6.execFile)});async function S6(t,{humanReadableOutput:e=!0}={}){if(E6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await ese("osascript",["-e",t,r]);return n.trim()}var E6,C6,Uv,ese,x6=ct(()=>{E6=fe(require("node:process"),1),C6=require("node:util"),Uv=require("node:child_process"),ese=(0,C6.promisify)(Uv.execFile)});async function Vv(t){return S6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var F6=ct(()=>{x6()});async function Hv(t=tse){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new xh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=rse[n];if(!i)throw new xh(`Unknown browser ID: ${n}`);return i}var O6,A6,tse,rse,xh,k6=ct(()=>{O6=require("node:util"),A6=require("node:child_process"),tse=(0,O6.promisify)(A6.execFile),rse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},xh=class extends Error{}});async function zv(){if(Fh.default.platform==="darwin"){let t=await Mv();return{name:await Vv(t),id:t}}if(Fh.default.platform==="linux"){let{stdout:t}=await nse("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:ise(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Fh.default.platform==="win32")return Hv();throw new Error("Only macOS, Linux, and Windows are supported")}var T6,Fh,P6,nse,ise,R6=ct(()=>{T6=require("node:util"),Fh=fe(require("node:process"),1),P6=require("node:child_process");_6();F6();k6();nse=(0,T6.promisify)(P6.execFile),ise=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var M6={};mn(M6,{apps:()=>bo,default:()=>use,openApp:()=>ase});function N6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[I6]:e}=t;if(!e)throw new Error(`${I6} is not supported`);return e}function Kv({[aa]:t},{wsl:e}){if(e&&Ac)return N6(e);if(!t)throw new Error(`${aa} is not supported`);return N6(t)}var kc,L6,Wv,B6,q6,vo,cse,Gv,$6,aa,I6,ose,j6,Tc,sse,ase,bo,use,U6=ct(()=>{kc=fe(require("node:process"),1),L6=require("node:buffer"),Wv=fe(require("node:path"),1),B6=require("node:url"),q6=fe(require("node:child_process"),1),vo=fe(require("node:fs/promises"),1);y6();D6();R6();Bv();cse={},Gv=Wv.default.dirname((0,B6.fileURLToPath)(cse.url)),$6=Wv.default.join(Gv,"xdg-open"),{platform:aa,arch:I6}=kc.default,ose=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await vo.default.access(r,vo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await vo.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),j6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},Tc=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return j6(t.app,a=>Tc({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return j6(e,a=>Tc({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await zv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),Tc({...t,app:{name:bo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(aa==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(aa==="win32"||Ac&&!sa()&&!e){let a=await ose();n=Ac?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${kc.default.env.SYSTEMROOT||kc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Ac||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=L6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Gv||Gv==="/",u=!1;try{await vo.default.access($6,vo.constants.X_OK),u=!0}catch{}n=kc.default.versions.electron??(aa==="android"||a||!u)?"xdg-open":$6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}aa==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=q6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},sse=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Tc({...e,target:t})},ase=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return Tc({...e,app:{name:t,arguments:r}})};bo={};Do(bo,"chrome",()=>Kv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Do(bo,"firefox",()=>Kv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Do(bo,"edge",()=>Kv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Do(bo,"browser",()=>"browser");Do(bo,"browserPrivate",()=>"browserPrivate");use=sse});var gj=y(_o=>{_o.parse=_o.decode=bse;_o.stringify=_o.encode=hj;_o.safe=ma;_o.unsafe=$h;var ib=typeof process<"u"&&process.platform==="win32"?`\r
190
+ `}function Koe(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),u6.logger.warn(`The ${yi.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}it.checkExternalConfig=Koe});function Yoe(){try{return jv.default.statSync("/.dockerenv"),!0}catch{return!1}}function Joe(){try{return jv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Nv(){return Iv===void 0&&(Iv=Yoe()||Joe()),Iv}var jv,Iv,d6=ct(()=>{jv=le(require("node:fs"),1)});function sa(){return Lv===void 0&&(Lv=Xoe()||Nv()),Lv}var h6,Lv,Xoe,Bv=ct(()=>{h6=le(require("node:fs"),1);d6();Xoe=()=>{try{return h6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var qv,m6,g6,p6,Ac,y6=ct(()=>{qv=le(require("node:process"),1),m6=le(require("node:os"),1),g6=le(require("node:fs"),1);Bv();p6=()=>{if(qv.default.platform!=="linux")return!1;if(m6.default.release().toLowerCase().includes("microsoft"))return!sa();try{return g6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!sa():!1}catch{return!1}},Ac=qv.default.env.__IS_WSL_TEST__?p6:p6()});function Do(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var D6=ct(()=>{});async function Mv(){if(b6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await Zoe("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var v6,b6,w6,Zoe,_6=ct(()=>{v6=require("node:util"),b6=le(require("node:process"),1),w6=require("node:child_process"),Zoe=(0,v6.promisify)(w6.execFile)});async function S6(t,{humanReadableOutput:e=!0}={}){if(E6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await Qoe("osascript",["-e",t,r]);return n.trim()}var E6,C6,Uv,Qoe,x6=ct(()=>{E6=le(require("node:process"),1),C6=require("node:util"),Uv=require("node:child_process"),Qoe=(0,C6.promisify)(Uv.execFile)});async function Vv(t){return S6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var F6=ct(()=>{x6()});async function Hv(t=ese){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new xh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=tse[n];if(!i)throw new xh(`Unknown browser ID: ${n}`);return i}var O6,A6,ese,tse,xh,k6=ct(()=>{O6=require("node:util"),A6=require("node:child_process"),ese=(0,O6.promisify)(A6.execFile),tse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},xh=class extends Error{}});async function zv(){if(Fh.default.platform==="darwin"){let t=await Mv();return{name:await Vv(t),id:t}}if(Fh.default.platform==="linux"){let{stdout:t}=await rse("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:nse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Fh.default.platform==="win32")return Hv();throw new Error("Only macOS, Linux, and Windows are supported")}var T6,Fh,P6,rse,nse,R6=ct(()=>{T6=require("node:util"),Fh=le(require("node:process"),1),P6=require("node:child_process");_6();F6();k6();rse=(0,T6.promisify)(P6.execFile),nse=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var M6={};mn(M6,{apps:()=>bo,default:()=>ase,openApp:()=>sse});function N6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[I6]:e}=t;if(!e)throw new Error(`${I6} is not supported`);return e}function Kv({[aa]:t},{wsl:e}){if(e&&Ac)return N6(e);if(!t)throw new Error(`${aa} is not supported`);return N6(t)}var kc,L6,Wv,B6,q6,vo,use,Gv,$6,aa,I6,ise,j6,Tc,ose,sse,bo,ase,U6=ct(()=>{kc=le(require("node:process"),1),L6=require("node:buffer"),Wv=le(require("node:path"),1),B6=require("node:url"),q6=le(require("node:child_process"),1),vo=le(require("node:fs/promises"),1);y6();D6();R6();Bv();use={},Gv=Wv.default.dirname((0,B6.fileURLToPath)(use.url)),$6=Wv.default.join(Gv,"xdg-open"),{platform:aa,arch:I6}=kc.default,ise=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await vo.default.access(r,vo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await vo.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),j6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},Tc=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return j6(t.app,a=>Tc({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return j6(e,a=>Tc({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await zv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),Tc({...t,app:{name:bo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(aa==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(aa==="win32"||Ac&&!sa()&&!e){let a=await ise();n=Ac?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${kc.default.env.SYSTEMROOT||kc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Ac||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=L6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Gv||Gv==="/",u=!1;try{await vo.default.access($6,vo.constants.X_OK),u=!0}catch{}n=kc.default.versions.electron??(aa==="android"||a||!u)?"xdg-open":$6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}aa==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=q6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},ose=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Tc({...e,target:t})},sse=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return Tc({...e,app:{name:t,arguments:r}})};bo={};Do(bo,"chrome",()=>Kv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Do(bo,"firefox",()=>Kv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Do(bo,"edge",()=>Kv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Do(bo,"browser",()=>"browser");Do(bo,"browserPrivate",()=>"browserPrivate");ase=ose});var mj=y(_o=>{_o.parse=_o.decode=bse;_o.stringify=_o.encode=dj;_o.safe=ma;_o.unsafe=$h;var ib=typeof process<"u"&&process.platform==="win32"?`\r
192
192
  `:`
193
- `;function hj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=ma(o+"[]")+i+ma(c)+`
194
- `}):u&&typeof u=="object"?r.push(o):n+=ma(o)+i+ma(u)+ib}),e.section&&n.length&&(n="["+ma(e.section)+"]"+ib+n),r.forEach(function(o,s,a){var u=pj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=hj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ib),n+=l}),n}function pj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function bse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=$h(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=$h(c[2]);if(l!=="__proto__"){var f=c[3]?$h(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=pj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function mj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ma(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&mj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function $h(t,e){if(t=(t||"").trim(),mj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var vj=y((Hge,Dj)=>{"use strict";var ob=1,yj=2;function wse(){return""}function _se(t,e,r){return t.slice(e,r).replace(/\S/g," ")}Dj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?wse:_se,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=ob,c++;else if(o===ob&&r+n===`\r
193
+ `;function dj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=ma(o+"[]")+i+ma(c)+`
194
+ `}):u&&typeof u=="object"?r.push(o):n+=ma(o)+i+ma(u)+ib}),e.section&&n.length&&(n="["+ma(e.section)+"]"+ib+n),r.forEach(function(o,s,a){var u=hj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=dj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ib),n+=l}),n}function hj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function bse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=$h(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=$h(c[2]);if(l!=="__proto__"){var f=c[3]?$h(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=hj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function pj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ma(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&pj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function $h(t,e){if(t=(t||"").trim(),pj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var Dj=y((Hge,yj)=>{"use strict";var ob=1,gj=2;function wse(){return""}function _se(t,e,r){return t.slice(e,r).replace(/\S/g," ")}yj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?wse:_se,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=ob,c++;else if(o===ob&&r+n===`\r
195
195
  `){c++,o=!1,a+=u(t,s,c),s=c;continue}else if(o===ob&&r===`
196
- `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=yj,c++;continue}else if(o===yj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var wj=y(ga=>{"use strict";var bj=require("fs"),Ese=gj(),Rc=require("path"),Cse=vj(),Sse=ga.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Cse(t)):Ese.parse(t)},xse=ga.file=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null});for(var e in t)if(typeof t[e]!="string")return;var r=Rc.join.apply(null,t),n;try{return bj.readFileSync(r,"utf-8")}catch{return}},zge=ga.json=function(){var t=xse.apply(null,arguments);return t?Sse(t):null},Gge=ga.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},Wge=ga.find=function(){var t=Rc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Rc.join(r,n);try{return bj.statSync(i),i}catch{if(Rc.dirname(r)!==r)return e(Rc.dirname(r),n)}}return e(process.cwd(),t)}});var Fj=y((Yge,xj)=>{"use strict";function Ej(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Cj(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Sj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Sj(r):Ej(r)?e[n]=Cj(r):e[n]=sb({},r):e[n]=r}),e}function _j(t,e){return e==="__proto__"?void 0:t[e]}var sb=xj.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=_j(t,s),r=_j(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Sj(r);return}else if(Ej(r)){t[s]=Cj(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=sb({},r);return}else{t[s]=sb(n,r);return}})}),t}});var Tj=y((Jge,kj)=>{"use strict";function Fse(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function Oj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Aj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}kj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(A){return r.bools[A]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(A){n[A]=[C].concat(n[C].filter(function($){return A!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(A){r.strings[A]=!0})});var o=e.default||{},s={_:[]};function a(C,A){return r.allBools&&/^--[^=]+$/.test(A)||r.strings[C]||r.bools[C]||n[C]}function u(C,A,$){for(var F=C,L=0;L<A.length-1;L++){var S=A[L];if(Aj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=A[A.length-1];Aj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,A,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Oj(A)?Number(A):A;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,p;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var g=b[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],p=t[f+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,p,h),f+=1):/^(true|false)$/.test(p)?(c(d,p==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,D=0;D<w.length;D++){if(p=h.slice(D+2),p==="-"){c(w[D],p,h);continue}if(/[A-Za-z]/.test(w[D])&&p[0]==="="){c(w[D],p.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){c(w[D],p,h),x=!0;break}if(w[D+1]&&w[D+1].match(/\W/)){c(w[D],h.slice(D+2),h),x=!0;break}else c(w[D],r.strings[w[D]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Oj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){Fse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(A){u(s,A.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var Ij=y((Xge,$j)=>{var $c=wj(),ya=require("path").join,Ose=Fj(),Pj="/etc",Rj=process.platform==="win32",Ic=Rj?process.env.USERPROFILE:process.env.HOME;$j.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Tj()(process.argv.slice(2))),e=(typeof e=="string"?$c.json(e):e)||{},n=n||$c.parse;var i=$c.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=$c.file(u);c&&(o.push(n(c)),s.push(u))}}return Rj||[ya(Pj,t,"config"),ya(Pj,t+"rc")].forEach(a),Ic&&[ya(Ic,".config",t,"config"),ya(Ic,".config",t),ya(Ic,"."+t,"config"),ya(Ic,"."+t+"rc")].forEach(a),a($c.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Ose.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Lj=y((Qge,Nj)=>{var vi=require("constants"),Ase=process.cwd,Ih=null,kse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ih||(Ih=Ase.call(process)),Ih};try{process.cwd()}catch{}typeof process.chdir=="function"&&(ub=process.chdir,process.chdir=function(t){Ih=null,ub.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ub));var ub;Nj.exports=Tse;function Tse(t){vi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),kse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,A,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,b){for(var g=0;;)try{return l.call(t,f,h,d,p,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,vi.O_WRONLY|vi.O_SYMLINK,h,function(p,b){if(p){d&&d(p);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,vi.O_WRONLY|vi.O_SYMLINK,h),p=!0,b;try{b=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){vi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,vi.O_SYMLINK,function(b,g){if(b){p&&p(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,vi.O_SYMLINK),b,g=!0;try{b=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return b}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(b){c(b)&&(b=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Mj=y((eye,qj)=>{var Bj=require("stream").Stream;qj.exports=Pse;function Pse(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Bj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Bj.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Vj=y((tye,Uj)=>{"use strict";Uj.exports=$se;var Rse=Object.getPrototypeOf||function(t){return t.__proto__};function $se(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Rse(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Wj=y((rye,fb)=>{var We=require("fs"),Ise=Lj(),jse=Mj(),Nse=Vj(),jh=require("util"),_t,Lh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Lh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Lh="___graceful-fs.previous");function Lse(){}function Gj(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var Eo=Lse;jh.debuglog?Eo=jh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Eo=function(){var t=jh.format.apply(jh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
- GFS4: `),console.error(t)});We[_t]||(Hj=global[_t]||[],Gj(We,Hj),We.close=function(t){function e(r,n){return t.call(We,r,function(i){i||zj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Lh,{value:t}),e}(We.close),We.closeSync=function(t){function e(r){t.apply(We,arguments),zj()}return Object.defineProperty(e,Lh,{value:t}),e}(We.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Eo(We[_t]),require("assert").equal(We[_t].length,0)}));var Hj;global[_t]||Gj(global,We[_t]);fb.exports=cb(Nse(We));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!We.__patched&&(fb.exports=cb(We),We.__patched=!0);function cb(t){Ise(t),t.gracefulify=cb,t.createReadStream=A,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?Da([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Da([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=jse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function A(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function Da(t){Eo("ENQUEUE",t[0].name,t[1]),We[_t].push(t),lb()}var Nh;function zj(){for(var t=Date.now(),e=0;e<We[_t].length;++e)We[_t][e].length>2&&(We[_t][e][3]=t,We[_t][e][4]=t);lb()}function lb(){if(clearTimeout(Nh),Nh=void 0,We[_t].length!==0){var t=We[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Eo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Eo("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Eo("RETRY",e.name,r),e.apply(null,r.concat([i]))):We[_t].push(t)}Nh===void 0&&(Nh=setTimeout(lb,0))}}});var Kj=y(va=>{"use strict";var Bse=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.readCAFileSync=void 0;var qse=Bse(Wj());function Mse(t){try{let e=qse.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(i=>!!i.trim()).map(i=>`${i.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}va.readCAFileSync=Mse});var Yj=y(Co=>{"use strict";var Use=Co&&Co.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Vse=Co&&Co.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Use(e,t,r)};Object.defineProperty(Co,"__esModule",{value:!0});Vse(Kj(),Co)});var Zj=y((oye,Xj)=>{Xj.exports=Jj;function So(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Jj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&So(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Jj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&So(this.list[this.list.length-1],t),So(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&So(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return So(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&So(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)So(this.list[e],this.list[e+1]||this.root);return t}}});var r8=y(xo=>{xo.parse=xo.decode=Hse;xo.stringify=xo.encode=Qj;xo.safe=ba;xo.unsafe=Bh;var db=typeof process<"u"&&process.platform==="win32"?`\r
196
+ `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=gj,c++;continue}else if(o===gj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var bj=y(ga=>{"use strict";var vj=require("fs"),Ese=mj(),Rc=require("path"),Cse=Dj(),Sse=ga.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Cse(t)):Ese.parse(t)},xse=ga.file=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null});for(var e in t)if(typeof t[e]!="string")return;var r=Rc.join.apply(null,t),n;try{return vj.readFileSync(r,"utf-8")}catch{return}},zge=ga.json=function(){var t=xse.apply(null,arguments);return t?Sse(t):null},Gge=ga.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},Wge=ga.find=function(){var t=Rc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Rc.join(r,n);try{return vj.statSync(i),i}catch{if(Rc.dirname(r)!==r)return e(Rc.dirname(r),n)}}return e(process.cwd(),t)}});var xj=y((Yge,Sj)=>{"use strict";function _j(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Ej(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Cj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Cj(r):_j(r)?e[n]=Ej(r):e[n]=sb({},r):e[n]=r}),e}function wj(t,e){return e==="__proto__"?void 0:t[e]}var sb=Sj.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=wj(t,s),r=wj(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Cj(r);return}else if(_j(r)){t[s]=Ej(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=sb({},r);return}else{t[s]=sb(n,r);return}})}),t}});var kj=y((Jge,Aj)=>{"use strict";function Fse(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function Fj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Oj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Aj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(A){return r.bools[A]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(A){n[A]=[C].concat(n[C].filter(function($){return A!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(A){r.strings[A]=!0})});var o=e.default||{},s={_:[]};function a(C,A){return r.allBools&&/^--[^=]+$/.test(A)||r.strings[C]||r.bools[C]||n[C]}function u(C,A,$){for(var F=C,L=0;L<A.length-1;L++){var S=A[L];if(Oj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=A[A.length-1];Oj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,A,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Fj(A)?Number(A):A;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,p;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var g=b[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],p=t[f+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,p,h),f+=1):/^(true|false)$/.test(p)?(c(d,p==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,D=0;D<w.length;D++){if(p=h.slice(D+2),p==="-"){c(w[D],p,h);continue}if(/[A-Za-z]/.test(w[D])&&p[0]==="="){c(w[D],p.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){c(w[D],p,h),x=!0;break}if(w[D+1]&&w[D+1].match(/\W/)){c(w[D],h.slice(D+2),h),x=!0;break}else c(w[D],r.strings[w[D]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Fj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){Fse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(A){u(s,A.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var $j=y((Xge,Rj)=>{var $c=bj(),ya=require("path").join,Ose=xj(),Tj="/etc",Pj=process.platform==="win32",Ic=Pj?process.env.USERPROFILE:process.env.HOME;Rj.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=kj()(process.argv.slice(2))),e=(typeof e=="string"?$c.json(e):e)||{},n=n||$c.parse;var i=$c.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=$c.file(u);c&&(o.push(n(c)),s.push(u))}}return Pj||[ya(Tj,t,"config"),ya(Tj,t+"rc")].forEach(a),Ic&&[ya(Ic,".config",t,"config"),ya(Ic,".config",t),ya(Ic,"."+t,"config"),ya(Ic,"."+t+"rc")].forEach(a),a($c.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Ose.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Nj=y((Qge,jj)=>{var vi=require("constants"),Ase=process.cwd,Ih=null,kse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ih||(Ih=Ase.call(process)),Ih};try{process.cwd()}catch{}typeof process.chdir=="function"&&(ub=process.chdir,process.chdir=function(t){Ih=null,ub.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ub));var ub;jj.exports=Tse;function Tse(t){vi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),kse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,A,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,b){for(var g=0;;)try{return l.call(t,f,h,d,p,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,vi.O_WRONLY|vi.O_SYMLINK,h,function(p,b){if(p){d&&d(p);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,vi.O_WRONLY|vi.O_SYMLINK,h),p=!0,b;try{b=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){vi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,vi.O_SYMLINK,function(b,g){if(b){p&&p(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,vi.O_SYMLINK),b,g=!0;try{b=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return b}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(b){c(b)&&(b=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var qj=y((eye,Bj)=>{var Lj=require("stream").Stream;Bj.exports=Pse;function Pse(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Lj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Lj.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Uj=y((tye,Mj)=>{"use strict";Mj.exports=$se;var Rse=Object.getPrototypeOf||function(t){return t.__proto__};function $se(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Rse(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Gj=y((rye,fb)=>{var We=require("fs"),Ise=Nj(),jse=qj(),Nse=Uj(),jh=require("util"),_t,Lh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Lh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Lh="___graceful-fs.previous");function Lse(){}function zj(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var Eo=Lse;jh.debuglog?Eo=jh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Eo=function(){var t=jh.format.apply(jh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
+ GFS4: `),console.error(t)});We[_t]||(Vj=global[_t]||[],zj(We,Vj),We.close=function(t){function e(r,n){return t.call(We,r,function(i){i||Hj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Lh,{value:t}),e}(We.close),We.closeSync=function(t){function e(r){t.apply(We,arguments),Hj()}return Object.defineProperty(e,Lh,{value:t}),e}(We.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Eo(We[_t]),require("assert").equal(We[_t].length,0)}));var Vj;global[_t]||zj(global,We[_t]);fb.exports=cb(Nse(We));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!We.__patched&&(fb.exports=cb(We),We.__patched=!0);function cb(t){Ise(t),t.gracefulify=cb,t.createReadStream=A,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?Da([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Da([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=jse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function A(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Da([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function Da(t){Eo("ENQUEUE",t[0].name,t[1]),We[_t].push(t),lb()}var Nh;function Hj(){for(var t=Date.now(),e=0;e<We[_t].length;++e)We[_t][e].length>2&&(We[_t][e][3]=t,We[_t][e][4]=t);lb()}function lb(){if(clearTimeout(Nh),Nh=void 0,We[_t].length!==0){var t=We[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Eo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Eo("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Eo("RETRY",e.name,r),e.apply(null,r.concat([i]))):We[_t].push(t)}Nh===void 0&&(Nh=setTimeout(lb,0))}}});var Wj=y(va=>{"use strict";var Bse=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.readCAFileSync=void 0;var qse=Bse(Gj());function Mse(t){try{let e=qse.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(i=>!!i.trim()).map(i=>`${i.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}va.readCAFileSync=Mse});var Kj=y(Co=>{"use strict";var Use=Co&&Co.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Vse=Co&&Co.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Use(e,t,r)};Object.defineProperty(Co,"__esModule",{value:!0});Vse(Wj(),Co)});var Xj=y((oye,Jj)=>{Jj.exports=Yj;function So(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Yj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&So(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Yj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&So(this.list[this.list.length-1],t),So(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&So(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return So(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&So(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)So(this.list[e],this.list[e+1]||this.root);return t}}});var t8=y(xo=>{xo.parse=xo.decode=Hse;xo.stringify=xo.encode=Zj;xo.safe=ba;xo.unsafe=Bh;var db=typeof process<"u"&&process.platform==="win32"?`\r
198
198
  `:`
199
- `;function Qj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=ba(o+"[]")+i+ba(c)+`
200
- `}):u&&typeof u=="object"?r.push(o):n+=ba(o)+i+ba(u)+db}),e.section&&n.length&&(n="["+ba(e.section)+"]"+db+n),r.forEach(function(o,s,a){var u=e8(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Qj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=db),n+=l}),n}function e8(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Hse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Bh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Bh(c[2]);if(l!=="__proto__"){var f=c[3]?Bh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=e8(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function t8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ba(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&t8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Bh(t,e){if(t=(t||"").trim(),t8(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var s8=y((Nn,o8)=>{var n8=Zj(),jc=require("path"),qh=require("fs"),hb=r8(),pb=require("events").EventEmitter,zse=require("url"),Gse=require("http"),Nn=o8.exports=function(){for(var t=[].slice.call(arguments),e=new Ft;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Kse(r):r)}return e},aye=Nn.find=function(){var t=jc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=jc.join(r,n);try{return qh.statSync(i),i}catch{if(jc.dirname(r)!==r)return e(jc.dirname(r),n)}}return e(__dirname,t)},Wse=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return hb.parse(t);else try{return JSON.parse(t)}catch{return hb.parse(t)}},Kse=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=jc.join.apply(null,t),r;try{r=qh.readFileSync(e,"utf-8")}catch{return}return Wse(r,e,"json")},uye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ft;function Ft(){pb.apply(this),n8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var i8={constructor:{value:Ft}};Object.keys(pb.prototype).forEach(function(t){i8[t]=Object.getOwnPropertyDescriptor(pb.prototype,t)});Ft.prototype=Object.create(n8.prototype,i8);Ft.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};Ft.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};Ft.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};Ft.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=hb.stringify(s),this._saving++,qh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ft.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),qh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ft.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ft.prototype.addUrl=function(t,e,r){this._await();var n=zse.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Gse.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};Ft.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ft.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};Ft.prototype.parse=Nn.parse;Ft.prototype._await=function(){this._awaiting++};Ft.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var u8=y((cye,a8)=>{a8.exports=function(t){let e=t.indexOf(":");if(e===-1)return mb(t);let r=t.substr(0,e),n=t.substr(e+1);return`${mb(r)}:${mb(n)}`};function mb(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var c8=y(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.envReplace=void 0;var Yse=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function Jse(t,e){return t.replace(Yse,Xse.bind(null,e))}Mh.envReplace=Jse;function Xse(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=Qse(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var Zse=/([^:-]+)(:?)-(.+)/;function Qse(t,e){let r=e.match(Zse);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var l8=y(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var eae=c8();Object.defineProperty(Uh,"envReplace",{enumerable:!0,get:function(){return eae.envReplace}})});var d8=y(Vh=>{"use strict";var tae=require("fs"),Fo=require("path"),{envReplace:f8}=l8(),rae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Fo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=f8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Fo.resolve(process.env.HOME,e.substr(2))),e=Fo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},nae=t=>{t=Fo.resolve(t);let e=!1;for(;Fo.basename(t)==="node_modules";)t=Fo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=tae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Fo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Vh.envReplace=f8;Vh.findPrefix=nae;Vh.parseField=rae});var m8=y(p8=>{"use strict";var Oo=require("path"),iae=require("stream").Stream,Hh=require("url"),oae=()=>{},sae=()=>[],h8=()=>{};p8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Oo,cache:Oo,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Oo,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Hh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Oo,"init-author-name":String,"init-author-email":String,"init-author-url":["",Hh],"init-license":String,"init-version":h8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":sae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:iae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,h8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Oo,production:Boolean,progress:Boolean,proxy:[null,!1,Hh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Hh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Oo,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Oo,umask:oae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var v8=y((pye,D8)=>{"use strict";var{readCAFileSync:aae}=Yj(),g8=require("fs"),gb=require("path"),{ConfigChain:uae}=s8(),cae=u8(),y8=d8(),yb=class extends uae{constructor(e,r){super(e),this.root=e,this._parseField=y8.parseField.bind(null,r||m8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=g8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[cae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>gb.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=gb.resolve(e.prefix);else try{r=y8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=aae(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=gb.resolve(this.get("prefix"));try{let n=g8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};D8.exports=yb});var S8=y(C8=>{"use strict";var _8=require("os"),Ln=require("path"),E8=_8.tmpdir(),lae=process.getuid?process.getuid():process.pid,fae=()=>!0,b8=process.platform==="win32",w8={editor:()=>process.env.EDITOR||process.env.VISUAL||(b8?"notepad.exe":"vi"),shell:()=>b8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},dae={fromString:()=>process.umask()},wa=_8.homedir();wa?process.env.HOME=wa:wa=Ln.resolve(E8,"npm-"+lae);var hae=process.platform==="win32"?"npm-cache":".npm",pae=process.platform==="win32"&&process.env.APPDATA||wa,mae=Ln.resolve(pae,hae),zh,Ao;Object.defineProperty(C8,"defaults",{get:function(){return zh||(process.env.PREFIX?Ao=process.env.PREFIX:process.platform==="win32"?Ao=Ln.dirname(process.execPath):(Ao=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(Ao=Ln.join(process.env.DESTDIR,Ao))),zh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:mae,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:w8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(Ao,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(wa,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Ao,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:w8.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:E8,unicode:fae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(wa,".npmrc"),umask:process.umask?process.umask():dae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},zh)}})});var F8=y((gye,Db)=>{"use strict";var ko=require("path"),gae=v8(),x8=S8();Db.exports=(t,e,r)=>{let n=new gae(Object.assign({},x8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(ko.resolve(ko.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=ko.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=ko.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=ko.resolve(n.get("prefix"),"etc");n.root.globalconfig=ko.resolve(c,"npmrc"),n.root.globalignorefile=ko.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(Db.exports,"defaults",{get(){return x8.defaults},enumerable:!0})});var I8=y((yye,$8)=>{var vb=require("url"),O8=F8(),A8=":_authToken",k8=":_auth",T8=":username",P8=":_password";$8.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:O8()).config,e=e||r.npmrc.get("registry")||O8.defaults.registry,R8(e,r)||yae(r.npmrc)};function R8(t,e){let r=vb.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=vae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:R8(vb.resolve(t,"."),e);r.pathname=vb.resolve(Dae(n),"..")||"/"}}function yae(t){return t.get("_auth")?{token:Gh(t.get("_auth")),type:"Basic"}:void 0}function Dae(t){return t[t.length-1]==="/"?t:t+"/"}function vae(t,e){let r=bae(e.get(t+A8)||e.get(t+"/"+A8));if(r)return r;let n=e.get(t+T8)||e.get(t+"/"+T8),i=e.get(t+P8)||e.get(t+"/"+P8),o=wae(n,i);if(o)return o;let s=_ae(e.get(t+k8)||e.get(t+"/"+k8));if(s)return s}function Gh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function bae(t){return t?{token:Gh(t),type:"Bearer"}:void 0}function wae(t,e){if(!t||!e)return;let r=Buffer.from(Gh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function _ae(t){return t?{token:Gh(t),type:"Basic"}:void 0}});var IL=y((_we,Vn)=>{var st=require("fs"),Yb=require("os"),lr=require("path"),bL=require("crypto"),ln={fs:st.constants,os:Yb.constants},wL="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",EL=/XXXXXX/,aue=3,CL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),uue=Yb.platform()==="win32",cue=ln.EBADF||ln.os.errno.EBADF,lue=ln.ENOENT||ln.os.errno.ENOENT,SL=448,xL=384,fue="exit",ka=[],FL=st.rmdirSync.bind(st),OL=!1;function due(t,e){return st.rm(t,{recursive:!0},e)}function AL(t){return st.rmSync(t,{recursive:!0})}function Jb(t,e){let r=Ta(t,e),n=r[0],i=r[1];try{PL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=TL(n);st.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function Xb(t){let e=Ta(t),r=e[0];PL(r);let n=r.tries;do{let i=TL(r);try{st.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function hue(t,e){let r=Ta(t,e),n=r[0],i=r[1];Jb(n,function(s,a){if(s)return i(s);st.open(a,CL,n.mode||xL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return st.close(l,function(h){return i(h,a,void 0,Gb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Gb(a,f?-1:l,n,!1))}})})}function pue(t){let e=Ta(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Xb(r);var o=st.openSync(i,CL,r.mode||xL);return r.discardDescriptor&&(st.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Gb(i,n?-1:o,r,!0)}}function mue(t,e){let r=Ta(t,e),n=r[0],i=r[1];Jb(n,function(s,a){if(s)return i(s);st.mkdir(a,n.mode||SL,function(c){if(c)return i(c);i(null,a,kL(a,n,!1))})})}function gue(t){let e=Ta(t),r=e[0],n=Xb(r);return st.mkdirSync(n,r.mode||SL),{name:n,removeCallback:kL(n,r,!0)}}function yue(t,e){let r=function(n){if(n&&!Kb(n))return e(n);e()};0<=t[0]?st.close(t[0],function(){st.unlink(t[1],r)}):st.unlink(t[1],r)}function Due(t){let e=null;try{0<=t[0]&&st.closeSync(t[0])}catch(r){if(!wue(r)&&!Kb(r))throw r}finally{try{st.unlinkSync(t[1])}catch(r){Kb(r)||(e=r)}}if(e!==null)throw e}function Gb(t,e,r,n){let i=mp(Due,[e,t],n),o=mp(yue,[e,t],n,i);return r.keep||ka.unshift(i),n?i:o}function kL(t,e,r){let n=e.unsafeCleanup?due:st.rmdir.bind(st),i=e.unsafeCleanup?AL:FL,o=mp(i,t,r),s=mp(n,t,r,o);return e.keep||ka.unshift(o),r?o:s}function mp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=ka.indexOf(a);return u>=0&&ka.splice(u,1),i=!0,r||t===FL||t===AL?t(e):t(e,s||function(){})}}}function vue(){if(OL)for(;ka.length;)try{ka[0]()}catch{}}function _L(t){let e=[],r=null;try{r=bL.randomBytes(t)}catch{r=bL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(wL[r[n]%wL.length]);return e.join("")}function bue(t){return t===null||rr(t)||!t.trim()}function rr(t){return typeof t>"u"}function Ta(t,e){if(typeof t=="function")return[{},t];if(rr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function TL(t){let e=t.tmpdir;if(!rr(t.name))return lr.join(e,t.dir,t.name);if(!rr(t.template))return lr.join(e,t.dir,t.template).replace(EL,_L(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_L(12),t.postfix?"-"+t.postfix:""].join("");return lr.join(e,t.dir,r)}function PL(t){t.tmpdir=$L(t);let e=t.tmpdir;if(rr(t.name)||zb(t.name,"name",e),rr(t.dir)||zb(t.dir,"dir",e),!rr(t.template)&&(zb(t.template,"template",e),!t.template.match(EL)))throw new Error(`Invalid template, found "${t.template}".`);if(!rr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=rr(t.name)?t.tries||aue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=rr(t.dir)?"":lr.relative(e,Wb(t.dir,e)),t.template=rr(t.template)?void 0:lr.relative(e,Wb(t.template,e)),t.template=bue(t.template)?void 0:lr.relative(t.dir,t.template),t.name=rr(t.name)?void 0:t.name,t.prefix=rr(t.prefix)?"":t.prefix,t.postfix=rr(t.postfix)?"":t.postfix}function Wb(t,e){return t.startsWith(e)?lr.resolve(t):lr.resolve(lr.join(e,t))}function zb(t,e,r){if(e==="name"){if(lr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=lr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(lr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Wb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function wue(t){return RL(t,-cue,"EBADF")}function Kb(t){return RL(t,-lue,"ENOENT")}function RL(t,e,r){return uue?t.code===r:t.code===r&&t.errno===e}function _ue(){OL=!0}function $L(t){return lr.resolve(t&&t.tmpdir||Yb.tmpdir())}process.addListener(fue,vue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return $L()}});Vn.exports.dir=mue;Vn.exports.dirSync=gue;Vn.exports.file=hue;Vn.exports.fileSync=pue;Vn.exports.tmpName=Jb;Vn.exports.tmpNameSync=Xb;Vn.exports.setGracefulCleanup=_ue});var Dw=fe(yw(),1),{program:k,createCommand:ece,createArgument:tce,createOption:rce,CommanderError:nce,InvalidArgumentError:ice,InvalidOptionArgumentError:oce,Command:sce,Argument:ace,Option:uce,Help:cce}=Dw.default;var Ir={name:"@capgo/cli",version:"4.21.36",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^3.7.3","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.1.2","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.7.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.45.2","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.5","@types/node":"^22.5.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.3.0","@typescript-eslint/parser":"^8.3.0","@vercel/ncc":"^0.38.1","adm-zip":"^0.5.16","ci-info":"^4.0.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.13.0","git-format-staged":"3.1.1",husky:"^9.1.5","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.6.3"}};var _a=require("node:fs"),L8=require("node:process");var At=fe(ke(),1),jo=require("node:process"),Gn=fe(require("node:readline"),1),qp=fe(require("node:readline"),1),kw=require("node:tty"),il=fe(_w(),1);function EB({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function Tw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(EB(),"")}var Mp={},CB={get exports(){return Mp},set exports(t){Mp=t}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(CB);var SB=Mp,xB=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};function Ia(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Tw(t),t.length===0))return 0;t=t.replace(xB()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let o=i.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(SB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Lp=10,Ew=(t=0)=>e=>`\x1B[${e+t}m`,Cw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Sw=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={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(Ie.modifier);var FB=Object.keys(Ie.color),OB=Object.keys(Ie.bgColor);[...FB,...OB];function AB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=Ew(),Ie.color.ansi256=Cw(),Ie.color.ansi16m=Sw(),Ie.bgColor.ansi=Ew(Lp),Ie.bgColor.ansi256=Cw(Lp),Ie.bgColor.ansi16m=Sw(Lp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var kB=AB(),ul=new Set(["\x1B","\x9B"]),TB=39,Up="\x07",Pw="[",PB="]",Rw="m",Vp=`${PB}8;;`,xw=t=>`${ul.values().next().value}${Pw}${t}${Rw}`,Fw=t=>`${ul.values().next().value}${Vp}${t}${Up}`,RB=t=>t.split(" ").map(e=>Ia(e)),Bp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Ia(Tw(t[t.length-1]));for(let[a,u]of n.entries()){let c=Ia(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),ul.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Vp)),i){o?u===Up&&(i=!1,o=!1):u===Rw&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},$B=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Ia(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},IB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=RB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Ia(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Bp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Bp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Bp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>$B(c)));let u=[...a.join(`
201
- `)];for(let[c,l]of u.entries()){if(n+=l,ul.has(l)){let{groups:h}=new RegExp(`(?:\\${Pw}(?<code>\\d+)m|\\${Vp}(?<uri>.*)${Up})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===TB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=kB.codes.get(Number(i));u[c+1]===`
199
+ `;function Zj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=ba(o+"[]")+i+ba(c)+`
200
+ `}):u&&typeof u=="object"?r.push(o):n+=ba(o)+i+ba(u)+db}),e.section&&n.length&&(n="["+ba(e.section)+"]"+db+n),r.forEach(function(o,s,a){var u=Qj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Zj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=db),n+=l}),n}function Qj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Hse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Bh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Bh(c[2]);if(l!=="__proto__"){var f=c[3]?Bh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=Qj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function e8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ba(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&e8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Bh(t,e){if(t=(t||"").trim(),e8(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var o8=y((Nn,i8)=>{var r8=Xj(),jc=require("path"),qh=require("fs"),hb=t8(),pb=require("events").EventEmitter,zse=require("url"),Gse=require("http"),Nn=i8.exports=function(){for(var t=[].slice.call(arguments),e=new Ft;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Kse(r):r)}return e},aye=Nn.find=function(){var t=jc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=jc.join(r,n);try{return qh.statSync(i),i}catch{if(jc.dirname(r)!==r)return e(jc.dirname(r),n)}}return e(__dirname,t)},Wse=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return hb.parse(t);else try{return JSON.parse(t)}catch{return hb.parse(t)}},Kse=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=jc.join.apply(null,t),r;try{r=qh.readFileSync(e,"utf-8")}catch{return}return Wse(r,e,"json")},uye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ft;function Ft(){pb.apply(this),r8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var n8={constructor:{value:Ft}};Object.keys(pb.prototype).forEach(function(t){n8[t]=Object.getOwnPropertyDescriptor(pb.prototype,t)});Ft.prototype=Object.create(r8.prototype,n8);Ft.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};Ft.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};Ft.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};Ft.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=hb.stringify(s),this._saving++,qh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ft.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),qh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ft.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ft.prototype.addUrl=function(t,e,r){this._await();var n=zse.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Gse.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};Ft.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ft.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};Ft.prototype.parse=Nn.parse;Ft.prototype._await=function(){this._awaiting++};Ft.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var a8=y((cye,s8)=>{s8.exports=function(t){let e=t.indexOf(":");if(e===-1)return mb(t);let r=t.substr(0,e),n=t.substr(e+1);return`${mb(r)}:${mb(n)}`};function mb(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var u8=y(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.envReplace=void 0;var Yse=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function Jse(t,e){return t.replace(Yse,Xse.bind(null,e))}Mh.envReplace=Jse;function Xse(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=Qse(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var Zse=/([^:-]+)(:?)-(.+)/;function Qse(t,e){let r=e.match(Zse);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var c8=y(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var eae=u8();Object.defineProperty(Uh,"envReplace",{enumerable:!0,get:function(){return eae.envReplace}})});var f8=y(Vh=>{"use strict";var tae=require("fs"),Fo=require("path"),{envReplace:l8}=c8(),rae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Fo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=l8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Fo.resolve(process.env.HOME,e.substr(2))),e=Fo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},nae=t=>{t=Fo.resolve(t);let e=!1;for(;Fo.basename(t)==="node_modules";)t=Fo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=tae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Fo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Vh.envReplace=l8;Vh.findPrefix=nae;Vh.parseField=rae});var p8=y(h8=>{"use strict";var Oo=require("path"),iae=require("stream").Stream,Hh=require("url"),oae=()=>{},sae=()=>[],d8=()=>{};h8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Oo,cache:Oo,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Oo,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Hh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Oo,"init-author-name":String,"init-author-email":String,"init-author-url":["",Hh],"init-license":String,"init-version":d8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":sae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:iae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,d8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Oo,production:Boolean,progress:Boolean,proxy:[null,!1,Hh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Hh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Oo,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Oo,umask:oae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var D8=y((pye,y8)=>{"use strict";var{readCAFileSync:aae}=Kj(),m8=require("fs"),gb=require("path"),{ConfigChain:uae}=o8(),cae=a8(),g8=f8(),yb=class extends uae{constructor(e,r){super(e),this.root=e,this._parseField=g8.parseField.bind(null,r||p8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=m8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[cae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>gb.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=gb.resolve(e.prefix);else try{r=g8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=aae(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=gb.resolve(this.get("prefix"));try{let n=m8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};y8.exports=yb});var C8=y(E8=>{"use strict";var w8=require("os"),Ln=require("path"),_8=w8.tmpdir(),lae=process.getuid?process.getuid():process.pid,fae=()=>!0,v8=process.platform==="win32",b8={editor:()=>process.env.EDITOR||process.env.VISUAL||(v8?"notepad.exe":"vi"),shell:()=>v8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},dae={fromString:()=>process.umask()},wa=w8.homedir();wa?process.env.HOME=wa:wa=Ln.resolve(_8,"npm-"+lae);var hae=process.platform==="win32"?"npm-cache":".npm",pae=process.platform==="win32"&&process.env.APPDATA||wa,mae=Ln.resolve(pae,hae),zh,Ao;Object.defineProperty(E8,"defaults",{get:function(){return zh||(process.env.PREFIX?Ao=process.env.PREFIX:process.platform==="win32"?Ao=Ln.dirname(process.execPath):(Ao=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(Ao=Ln.join(process.env.DESTDIR,Ao))),zh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:mae,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:b8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(Ao,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(wa,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Ao,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:b8.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:_8,unicode:fae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(wa,".npmrc"),umask:process.umask?process.umask():dae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},zh)}})});var x8=y((gye,Db)=>{"use strict";var ko=require("path"),gae=D8(),S8=C8();Db.exports=(t,e,r)=>{let n=new gae(Object.assign({},S8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(ko.resolve(ko.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=ko.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=ko.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=ko.resolve(n.get("prefix"),"etc");n.root.globalconfig=ko.resolve(c,"npmrc"),n.root.globalignorefile=ko.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(Db.exports,"defaults",{get(){return S8.defaults},enumerable:!0})});var $8=y((yye,R8)=>{var vb=require("url"),F8=x8(),O8=":_authToken",A8=":_auth",k8=":username",T8=":_password";R8.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:F8()).config,e=e||r.npmrc.get("registry")||F8.defaults.registry,P8(e,r)||yae(r.npmrc)};function P8(t,e){let r=vb.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=vae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:P8(vb.resolve(t,"."),e);r.pathname=vb.resolve(Dae(n),"..")||"/"}}function yae(t){return t.get("_auth")?{token:Gh(t.get("_auth")),type:"Basic"}:void 0}function Dae(t){return t[t.length-1]==="/"?t:t+"/"}function vae(t,e){let r=bae(e.get(t+O8)||e.get(t+"/"+O8));if(r)return r;let n=e.get(t+k8)||e.get(t+"/"+k8),i=e.get(t+T8)||e.get(t+"/"+T8),o=wae(n,i);if(o)return o;let s=_ae(e.get(t+A8)||e.get(t+"/"+A8));if(s)return s}function Gh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function bae(t){return t?{token:Gh(t),type:"Bearer"}:void 0}function wae(t,e){if(!t||!e)return;let r=Buffer.from(Gh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function _ae(t){return t?{token:Gh(t),type:"Basic"}:void 0}});var $L=y((_we,Vn)=>{var st=require("fs"),Yb=require("os"),fr=require("path"),vL=require("crypto"),ln={fs:st.constants,os:Yb.constants},bL="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",_L=/XXXXXX/,aue=3,EL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),uue=Yb.platform()==="win32",cue=ln.EBADF||ln.os.errno.EBADF,lue=ln.ENOENT||ln.os.errno.ENOENT,CL=448,SL=384,fue="exit",ka=[],xL=st.rmdirSync.bind(st),FL=!1;function due(t,e){return st.rm(t,{recursive:!0},e)}function OL(t){return st.rmSync(t,{recursive:!0})}function Jb(t,e){let r=Ta(t,e),n=r[0],i=r[1];try{TL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=kL(n);st.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function Xb(t){let e=Ta(t),r=e[0];TL(r);let n=r.tries;do{let i=kL(r);try{st.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function hue(t,e){let r=Ta(t,e),n=r[0],i=r[1];Jb(n,function(s,a){if(s)return i(s);st.open(a,EL,n.mode||SL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return st.close(l,function(h){return i(h,a,void 0,Gb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Gb(a,f?-1:l,n,!1))}})})}function pue(t){let e=Ta(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Xb(r);var o=st.openSync(i,EL,r.mode||SL);return r.discardDescriptor&&(st.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Gb(i,n?-1:o,r,!0)}}function mue(t,e){let r=Ta(t,e),n=r[0],i=r[1];Jb(n,function(s,a){if(s)return i(s);st.mkdir(a,n.mode||CL,function(c){if(c)return i(c);i(null,a,AL(a,n,!1))})})}function gue(t){let e=Ta(t),r=e[0],n=Xb(r);return st.mkdirSync(n,r.mode||CL),{name:n,removeCallback:AL(n,r,!0)}}function yue(t,e){let r=function(n){if(n&&!Kb(n))return e(n);e()};0<=t[0]?st.close(t[0],function(){st.unlink(t[1],r)}):st.unlink(t[1],r)}function Due(t){let e=null;try{0<=t[0]&&st.closeSync(t[0])}catch(r){if(!wue(r)&&!Kb(r))throw r}finally{try{st.unlinkSync(t[1])}catch(r){Kb(r)||(e=r)}}if(e!==null)throw e}function Gb(t,e,r,n){let i=mp(Due,[e,t],n),o=mp(yue,[e,t],n,i);return r.keep||ka.unshift(i),n?i:o}function AL(t,e,r){let n=e.unsafeCleanup?due:st.rmdir.bind(st),i=e.unsafeCleanup?OL:xL,o=mp(i,t,r),s=mp(n,t,r,o);return e.keep||ka.unshift(o),r?o:s}function mp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=ka.indexOf(a);return u>=0&&ka.splice(u,1),i=!0,r||t===xL||t===OL?t(e):t(e,s||function(){})}}}function vue(){if(FL)for(;ka.length;)try{ka[0]()}catch{}}function wL(t){let e=[],r=null;try{r=vL.randomBytes(t)}catch{r=vL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(bL[r[n]%bL.length]);return e.join("")}function bue(t){return t===null||rr(t)||!t.trim()}function rr(t){return typeof t>"u"}function Ta(t,e){if(typeof t=="function")return[{},t];if(rr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function kL(t){let e=t.tmpdir;if(!rr(t.name))return fr.join(e,t.dir,t.name);if(!rr(t.template))return fr.join(e,t.dir,t.template).replace(_L,wL(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",wL(12),t.postfix?"-"+t.postfix:""].join("");return fr.join(e,t.dir,r)}function TL(t){t.tmpdir=RL(t);let e=t.tmpdir;if(rr(t.name)||zb(t.name,"name",e),rr(t.dir)||zb(t.dir,"dir",e),!rr(t.template)&&(zb(t.template,"template",e),!t.template.match(_L)))throw new Error(`Invalid template, found "${t.template}".`);if(!rr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=rr(t.name)?t.tries||aue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=rr(t.dir)?"":fr.relative(e,Wb(t.dir,e)),t.template=rr(t.template)?void 0:fr.relative(e,Wb(t.template,e)),t.template=bue(t.template)?void 0:fr.relative(t.dir,t.template),t.name=rr(t.name)?void 0:t.name,t.prefix=rr(t.prefix)?"":t.prefix,t.postfix=rr(t.postfix)?"":t.postfix}function Wb(t,e){return t.startsWith(e)?fr.resolve(t):fr.resolve(fr.join(e,t))}function zb(t,e,r){if(e==="name"){if(fr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=fr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(fr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Wb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function wue(t){return PL(t,-cue,"EBADF")}function Kb(t){return PL(t,-lue,"ENOENT")}function PL(t,e,r){return uue?t.code===r:t.code===r&&t.errno===e}function _ue(){FL=!0}function RL(t){return fr.resolve(t&&t.tmpdir||Yb.tmpdir())}process.addListener(fue,vue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return RL()}});Vn.exports.dir=mue;Vn.exports.dirSync=gue;Vn.exports.file=hue;Vn.exports.fileSync=pue;Vn.exports.tmpName=Jb;Vn.exports.tmpNameSync=Xb;Vn.exports.setGracefulCleanup=_ue});var Dw=le(yw(),1),{program:k,createCommand:ece,createArgument:tce,createOption:rce,CommanderError:nce,InvalidArgumentError:ice,InvalidOptionArgumentError:oce,Command:sce,Argument:ace,Option:uce,Help:cce}=Dw.default;var Ir={name:"@capgo/cli",version:"4.22.1",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^3.7.3","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.1.2","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.7.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.45.2","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.5","@types/node":"^22.5.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.3.0","@typescript-eslint/parser":"^8.3.0","@vercel/ncc":"^0.38.1","adm-zip":"^0.5.16","ci-info":"^4.0.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.13.0","git-format-staged":"3.1.1",husky:"^9.1.5","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.6.3"}};var _a=require("node:fs"),N8=require("node:process");var At=le(ke(),1),jo=require("node:process"),Gn=le(require("node:readline"),1),qp=le(require("node:readline"),1),kw=require("node:tty"),il=le(_w(),1);function _B({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function Tw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(_B(),"")}var Mp={},EB={get exports(){return Mp},set exports(t){Mp=t}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(EB);var CB=Mp,SB=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};function Ia(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Tw(t),t.length===0))return 0;t=t.replace(SB()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let o=i.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(CB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Lp=10,Ew=(t=0)=>e=>`\x1B[${e+t}m`,Cw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Sw=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={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(Ie.modifier);var xB=Object.keys(Ie.color),FB=Object.keys(Ie.bgColor);[...xB,...FB];function OB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=Ew(),Ie.color.ansi256=Cw(),Ie.color.ansi16m=Sw(),Ie.bgColor.ansi=Ew(Lp),Ie.bgColor.ansi256=Cw(Lp),Ie.bgColor.ansi16m=Sw(Lp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var AB=OB(),ul=new Set(["\x1B","\x9B"]),kB=39,Up="\x07",Pw="[",TB="]",Rw="m",Vp=`${TB}8;;`,xw=t=>`${ul.values().next().value}${Pw}${t}${Rw}`,Fw=t=>`${ul.values().next().value}${Vp}${t}${Up}`,PB=t=>t.split(" ").map(e=>Ia(e)),Bp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Ia(Tw(t[t.length-1]));for(let[a,u]of n.entries()){let c=Ia(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),ul.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Vp)),i){o?u===Up&&(i=!1,o=!1):u===Rw&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},RB=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Ia(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},$B=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=PB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Ia(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Bp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Bp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Bp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>RB(c)));let u=[...a.join(`
201
+ `)];for(let[c,l]of u.entries()){if(n+=l,ul.has(l)){let{groups:h}=new RegExp(`(?:\\${Pw}(?<code>\\d+)m|\\${Vp}(?<uri>.*)${Up})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===kB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=AB.codes.get(Number(i));u[c+1]===`
202
202
  `?(o&&(n+=Fw("")),i&&f&&(n+=xw(f))):l===`
203
203
  `&&(i&&f&&(n+=xw(i)),o&&(n+=Fw(o)))}return n};function Ow(t,e,r){return String(t).normalize().replace(/\r\n/g,`
204
204
  `).split(`
205
- `).map(n=>IB(n,e,r)).join(`
206
- `)}function jB(t,e){if(t===e)return;let r=t.split(`
205
+ `).map(n=>$B(n,e,r)).join(`
206
+ `)}function IB(t,e){if(t===e)return;let r=t.split(`
207
207
  `),n=e.split(`
208
- `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var $w=Symbol("clack:cancel");function qt(t){return t===$w}function nl(t,e){t.isTTY&&t.setRawMode(e)}var Aw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),NB=new Set(["up","down","left","right","space","enter"]),ja=class{constructor({render:e,input:r=jo.stdin,output:n=jo.stdout,...i},o=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new kw.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=qp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),qp.default.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),nl(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),nl(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),nl(this.input,!1),r($w)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Aw.has(r.name)&&this.emit("cursor",Aw.get(r.name)),r?.name&&NB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(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(`
208
+ `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var $w=Symbol("clack:cancel");function qt(t){return t===$w}function nl(t,e){t.isTTY&&t.setRawMode(e)}var Aw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),jB=new Set(["up","down","left","right","space","enter"]),ja=class{constructor({render:e,input:r=jo.stdin,output:n=jo.stdout,...i},o=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new kw.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=qp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),qp.default.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),nl(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),nl(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),nl(this.input,!1),r($w)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Aw.has(r.name)&&this.emit("cursor",Aw.get(r.name)),r?.name&&jB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(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(`
209
209
  `),nl(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Ow(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
210
- `).length-1;this.output.write(At.cursor.move(-999,e*-1))}render(){let e=Ow(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(At.cursor.hide);else{let r=jB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.lines(1));let i=e.split(`
210
+ `).length-1;this.output.write(At.cursor.move(-999,e*-1))}render(){let e=Ow(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(At.cursor.hide);else{let r=IB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.lines(1));let i=e.split(`
211
211
  `);this.output.write(i[n]),this._prevFrame=e,this.output.write(At.cursor.move(0,i.length-n-1));return}else if(r&&r?.length>1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.down());let i=e.split(`
212
212
  `).slice(n);this.output.write(i.join(`
213
- `)),this._prevFrame=e;return}this.output.write(At.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ol=class extends ja{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(At.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var sl=class extends ja{constructor(e){super(e,!1),this.cursor=0,this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){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 al=class extends ja{constructor(e){super(e),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${il.default.inverse(il.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${il.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}};function Iw({input:t=jo.stdin,output:e=jo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(At.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(At.cursor.show),t.isTTY&&t.setRawMode(!1),i.terminal=!1,i.close()}}var hr=fe(require("node:process"),1),V=fe(Lw(),1),No=fe(ke(),1);function qB(){return hr.default.platform!=="win32"?hr.default.env.TERM!=="linux":!!hr.default.env.CI||!!hr.default.env.WT_SESSION||!!hr.default.env.TERMINUS_SUBLIME||hr.default.env.ConEmuTask==="{cmd::Cmder}"||hr.default.env.TERM_PROGRAM==="Terminus-Sublime"||hr.default.env.TERM_PROGRAM==="vscode"||hr.default.env.TERM==="xterm-256color"||hr.default.env.TERM==="alacritty"||hr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var zp=qB(),et=(t,e)=>zp?t:e,MB=et("\u25C6","*"),Bw=et("\u25A0","x"),qw=et("\u25B2","x"),Kp=et("\u25C7","o"),UB=et("\u250C","T"),Ye=et("\u2502","|"),Lo=et("\u2514","\u2014"),Gp=et("\u25CF",">"),Wp=et("\u25CB"," "),wce=et("\u25FB","[\u2022]"),_ce=et("\u25FC","[+]"),Ece=et("\u25FB","[ ]"),Cce=et("\u25AA","\u2022"),Sce=et("\u2500","-"),xce=et("\u256E","+"),Fce=et("\u251C","+"),Oce=et("\u256F","+"),VB=et("\u25CF","\u2022"),HB=et("\u25C6","*"),zB=et("\u25B2","!"),GB=et("\u25A0","x"),Yp=t=>{switch(t){case"initial":case"active":return V.default.cyan(MB);case"cancel":return V.default.red(Bw);case"error":return V.default.yellow(qw);case"submit":return V.default.green(Kp)}},Mw=t=>new al({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${V.default.gray(Ye)}
213
+ `)),this._prevFrame=e;return}this.output.write(At.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ol=class extends ja{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(At.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var sl=class extends ja{constructor(e){super(e,!1),this.cursor=0,this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){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 al=class extends ja{constructor(e){super(e),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${il.default.inverse(il.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${il.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}};function Iw({input:t=jo.stdin,output:e=jo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(At.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(At.cursor.show),t.isTTY&&t.setRawMode(!1),i.terminal=!1,i.close()}}var pr=le(require("node:process"),1),V=le(Lw(),1),No=le(ke(),1);function BB(){return pr.default.platform!=="win32"?pr.default.env.TERM!=="linux":!!pr.default.env.CI||!!pr.default.env.WT_SESSION||!!pr.default.env.TERMINUS_SUBLIME||pr.default.env.ConEmuTask==="{cmd::Cmder}"||pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||pr.default.env.TERM_PROGRAM==="vscode"||pr.default.env.TERM==="xterm-256color"||pr.default.env.TERM==="alacritty"||pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var zp=BB(),et=(t,e)=>zp?t:e,qB=et("\u25C6","*"),Bw=et("\u25A0","x"),qw=et("\u25B2","x"),Kp=et("\u25C7","o"),MB=et("\u250C","T"),Ye=et("\u2502","|"),Lo=et("\u2514","\u2014"),Gp=et("\u25CF",">"),Wp=et("\u25CB"," "),wce=et("\u25FB","[\u2022]"),_ce=et("\u25FC","[+]"),Ece=et("\u25FB","[ ]"),Cce=et("\u25AA","\u2022"),Sce=et("\u2500","-"),xce=et("\u256E","+"),Fce=et("\u251C","+"),Oce=et("\u256F","+"),UB=et("\u25CF","\u2022"),VB=et("\u25C6","*"),HB=et("\u25B2","!"),zB=et("\u25A0","x"),Yp=t=>{switch(t){case"initial":case"active":return V.default.cyan(qB);case"cancel":return V.default.red(Bw);case"error":return V.default.yellow(qw);case"submit":return V.default.green(Kp)}},Mw=t=>new al({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${V.default.gray(Ye)}
214
214
  ${Yp(this.state)} ${t.message}
215
215
  `,r=t.placeholder?V.default.inverse(t.placeholder[0])+V.default.dim(t.placeholder.slice(1)):V.default.inverse(V.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
216
216
  ${V.default.yellow(Ye)} ${n}
@@ -231,29 +231,29 @@ ${V.default.cyan(Ye)} `)}
231
231
  ${V.default.cyan(Lo)}
232
232
  `}}}}).prompt()};var Uw=(t="")=>{process.stdout.write(`${V.default.gray(Lo)} ${V.default.red(t)}
233
233
 
234
- `)},Y=(t="")=>{process.stdout.write(`${V.default.gray(UB)} ${t}
234
+ `)},Y=(t="")=>{process.stdout.write(`${V.default.gray(MB)} ${t}
235
235
  `)},X=(t="")=>{process.stdout.write(`${V.default.gray(Ye)}
236
236
  ${V.default.gray(Lo)} ${t}
237
237
 
238
238
  `)},m={message:(t="",{symbol:e=V.default.gray(Ye)}={})=>{let r=[`${V.default.gray(Ye)}`];if(t){let[n,...i]=t.split(`
239
239
  `);r.push(`${e} ${n}`,...i.map(o=>`${V.default.gray(Ye)} ${o}`))}process.stdout.write(`${r.join(`
240
240
  `)}
241
- `)},info:t=>{m.message(t,{symbol:V.default.blue(VB)})},success:t=>{m.message(t,{symbol:V.default.green(HB)})},step:t=>{m.message(t,{symbol:V.default.green(Kp)})},warn:t=>{m.message(t,{symbol:V.default.yellow(zB)})},warning:t=>{m.warn(t)},error:t=>{m.message(t,{symbol:V.default.red(GB)})}},ve=()=>{let t=zp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=zp?80:120,r,n,i=!1,o="",s=(l="")=>{i=!0,r=Iw(),o=l.replace(/\.+$/,""),process.stdout.write(`${V.default.gray(Ye)}
241
+ `)},info:t=>{m.message(t,{symbol:V.default.blue(UB)})},success:t=>{m.message(t,{symbol:V.default.green(VB)})},step:t=>{m.message(t,{symbol:V.default.green(Kp)})},warn:t=>{m.message(t,{symbol:V.default.yellow(HB)})},warning:t=>{m.warn(t)},error:t=>{m.message(t,{symbol:V.default.red(zB)})}},ve=()=>{let t=zp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=zp?80:120,r,n,i=!1,o="",s=(l="")=>{i=!0,r=Iw(),o=l.replace(/\.+$/,""),process.stdout.write(`${V.default.gray(Ye)}
242
242
  `);let f=0,h=0;n=setInterval(()=>{let d=V.default.magenta(t[f]),p=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(No.cursor.move(-999,0)),process.stdout.write(No.erase.down(1)),process.stdout.write(`${d} ${o}${p}`),f=f+1<t.length?f+1:0,h=h<t.length?h+.125:0},e)},a=(l="",f=0)=>{o=l??o,i=!1,clearInterval(n);let h=f===0?V.default.green(Kp):f===1?V.default.red(Bw):V.default.red(qw);process.stdout.write(No.cursor.move(-999,0)),process.stdout.write(No.erase.down(1)),process.stdout.write(`${h} ${o}
243
- `),r()},u=(l="")=>{o=l??o},c=l=>{let f=l>1?"Something went wrong":"Canceled";i&&a(f,l)};return process.on("uncaughtExceptionMonitor",()=>c(2)),process.on("unhandledRejection",()=>c(2)),process.on("SIGINT",()=>c(1)),process.on("SIGTERM",()=>c(1)),process.on("exit",c),{start:s,stop:a,message:u}};var it=require("node:fs"),Oh=require("node:os"),ot=require("node:path"),Er=require("node:process"),Di=fe(ll());var yn=require("fs"),La=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},fl=(t=La(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},Hw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var ca=fe(M_()),Y6=fe(yu()),Jv=fe(IC());var ei=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var is=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var os=t=>t!==null&&typeof t=="object";var vu=(...t)=>{for(let e of t)if((!os(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Ig({},...t)},Rg=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function Zl(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Ig(t[r]??[],e[r]??[])}var $g=(t={},e={})=>({beforeRequest:Zl(t,e,"beforeRequest"),beforeRetry:Zl(t,e,"beforeRetry"),afterResponse:Zl(t,e,"afterResponse"),beforeError:Zl(t,e,"beforeError")}),Ig=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(os(i)){for(let[o,s]of Object.entries(i))os(s)&&o in e&&(s=Ig(e[o],s)),e={...e,[o]:s};os(i.hooks)&&(n=$g(n,i.hooks),e.hooks=n),os(i.headers)&&(r=Rg(r,i.headers),e.headers=r)}return e};var jC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),NC=typeof globalThis.AbortController=="function",LC=typeof globalThis.ReadableStream=="function",BC=typeof globalThis.FormData=="function",Ql=["get","post","put","patch","head","delete"],XU=()=>{};XU();var qC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},ef=2147483647,tf=Symbol("stop"),MC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},UC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var HC=t=>Ql.includes(t)?t.toUpperCase():t,ZU=["get","put","head","delete","options","trace"],QU=[408,413,429,500,502,503,504],e9=[413,429,503],VC={limit:2,methods:ZU,statusCodes:QU,afterStatusCodes:e9,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},zC=(t={})=>{if(typeof t=="number")return{...VC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...VC,...t}};async function jg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new is(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Ng(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var GC=(t,e)=>{let r={};for(let n in e)!(n in UC)&&!(n in MC)&&!(n in t)&&(r[n]=e[n]);return r};var bu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>ef)throw new RangeError(`The \`timeout\` option cannot be greater than ${ef}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ei(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!LC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(qC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:Rg(this._input.headers,r.headers),hooks:$g({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:HC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:zC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(NC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(jC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(BC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof is)throw e;if(e instanceof ei){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),ef);if(this._retryCount<1)throw r;await Ng(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===tf)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=GC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):jg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Lg=t=>{let e=(r,n)=>bu.create(r,vu(t,n));for(let r of Ql)e[r]=(n,i)=>bu.create(n,vu(t,i,{method:r}));return e.create=r=>Lg(vu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Lg(vu(t,r))),e.stop=tf,e},t9=Lg(),Hr=t9;var J6=fe(ES()),Ah=fe(Qy());var Oc=fe(l6());async function f6(){let t=await(0,Oc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,Oc.loadConfig)(),{extConfig:n}=r.app;n&&(n.plugins||(n.plugins={extConfig:{},CapacitorUpdater:{}}),n.plugins.CapacitorUpdater||(n.plugins.CapacitorUpdater={}),e?n=t.config:n.plugins.CapacitorUpdater=t.config.plugins?.CapacitorUpdater,(0,Oc.writeConfig)(n,r.app.extConfigFilePath))}var tr=".capgo_key",ar=".capgo_key_v2",ur=`${tr}.pub`,jn=`${ar}.pub`;var V6="https://capgo.app",H6="https://files.capgo.app",z6="https://api.capgo.app",G6="https://web.capgo.app",X6=20,Z6=12e4,Q6="package.json",la=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Z=t=>t?`
244
- ${J6.default.render(t)}`:"";function W6(t){return new Promise(e=>{setTimeout(e,t)})}function Xv(t){return(0,Di.isMonorepo)(t)?(0,Di.findMonorepoRoot)(t):(0,Di.isNXMonorepo)(t)?(0,Di.findNXMonorepoRoot)(t):t}async function jt(t=Xv((0,Er.cwd)())){let e=(0,it.readFileSync)((0,ot.join)(t,Q6));return JSON.parse(e)}async function ee(){try{let t=await f6();return t||(m.error("No capacitor config file found, run `cap init` first"),k.error("")),t}catch(t){m.error(`No capacitor config file found, run \`cap init\` first ${Z(t)}`),k.error("")}}async function kh(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||V6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||G6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||H6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||z6};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(m.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:V6,hostWeb:G6,hostFilesApi:H6,hostApi:z6}}}var lse=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function Zv(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(m.info(`Local config ${Z(t)}`),t))}async function ej(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function le(t){let e=await Zv();return(!e.supaHost||!e.supaKey)&&(m.error("Cannot connect to server please try again later"),k.error("")),(0,ca.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function fse(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){m.error("Invalid API key or insufficient permissions.");let i=r.map((o,s)=>r.length===1?`"${o}"`:s===r.length-1?`or "${o}"`:`"${o}", `).join("");m.error(`Your key should be: ${i} mode.`),k.error("")}}async function dse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function hse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function pse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function mse(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var xt=(s=>(s[s.none=0]="none",s[s.read=1]="read",s[s.upload=2]="upload",s[s.write=3]="write",s[s.admin=4]="admin",s[s.super_admin=5]="super_admin",s))(xt||{}),tj=(t,e)=>t>=e;async function rj(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(m.error("Cannot get permissions for organization!"),console.error(i),(0,Er.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(m.info("Please accept/deny the organization invitation before trying to access the app"),(0,Er.exit)(1)),m.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,Er.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:m.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,Er.exit)(1)}return{okay:!1,error:s}}async function fa(t,e,r,n,i=!0){let o=await Zv();await(n?mse(t,n,r):pse(t,e))||(m.error(`You need to upgrade your plan to continue to use capgo.
243
+ `),r()},u=(l="")=>{o=l??o},c=l=>{let f=l>1?"Something went wrong":"Canceled";i&&a(f,l)};return process.on("uncaughtExceptionMonitor",()=>c(2)),process.on("unhandledRejection",()=>c(2)),process.on("SIGINT",()=>c(1)),process.on("SIGTERM",()=>c(1)),process.on("exit",c),{start:s,stop:a,message:u}};var ot=require("node:fs"),Oh=require("node:os"),rt=le(require("node:path")),ar=require("node:process"),Di=le(ll());var yn=require("fs"),La=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},fl=(t=La(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},Hw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var ca=le(M_()),Y6=le(yu()),Jv=le(IC());var ei=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var is=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var os=t=>t!==null&&typeof t=="object";var vu=(...t)=>{for(let e of t)if((!os(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Ig({},...t)},Rg=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function Zl(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Ig(t[r]??[],e[r]??[])}var $g=(t={},e={})=>({beforeRequest:Zl(t,e,"beforeRequest"),beforeRetry:Zl(t,e,"beforeRetry"),afterResponse:Zl(t,e,"afterResponse"),beforeError:Zl(t,e,"beforeError")}),Ig=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(os(i)){for(let[o,s]of Object.entries(i))os(s)&&o in e&&(s=Ig(e[o],s)),e={...e,[o]:s};os(i.hooks)&&(n=$g(n,i.hooks),e.hooks=n),os(i.headers)&&(r=Rg(r,i.headers),e.headers=r)}return e};var jC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),NC=typeof globalThis.AbortController=="function",LC=typeof globalThis.ReadableStream=="function",BC=typeof globalThis.FormData=="function",Ql=["get","post","put","patch","head","delete"],JU=()=>{};JU();var qC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},ef=2147483647,tf=Symbol("stop"),MC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},UC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var HC=t=>Ql.includes(t)?t.toUpperCase():t,XU=["get","put","head","delete","options","trace"],ZU=[408,413,429,500,502,503,504],QU=[413,429,503],VC={limit:2,methods:XU,statusCodes:ZU,afterStatusCodes:QU,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},zC=(t={})=>{if(typeof t=="number")return{...VC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...VC,...t}};async function jg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new is(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Ng(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var GC=(t,e)=>{let r={};for(let n in e)!(n in UC)&&!(n in MC)&&!(n in t)&&(r[n]=e[n]);return r};var bu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>ef)throw new RangeError(`The \`timeout\` option cannot be greater than ${ef}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ei(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!LC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(qC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:Rg(this._input.headers,r.headers),hooks:$g({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:HC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:zC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(NC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(jC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(BC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof is)throw e;if(e instanceof ei){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),ef);if(this._retryCount<1)throw r;await Ng(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===tf)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=GC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):jg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Lg=t=>{let e=(r,n)=>bu.create(r,vu(t,n));for(let r of Ql)e[r]=(n,i)=>bu.create(n,vu(t,i,{method:r}));return e.create=r=>Lg(vu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Lg(vu(t,r))),e.stop=tf,e},e9=Lg(),Hr=e9;var J6=le(ES()),Ah=le(Qy());var Oc=le(l6());async function f6(){let t=await(0,Oc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,Oc.loadConfig)(),{extConfig:n}=r.app;n&&(n.plugins||(n.plugins={extConfig:{},CapacitorUpdater:{}}),n.plugins.CapacitorUpdater||(n.plugins.CapacitorUpdater={}),e?n=t.config:n.plugins.CapacitorUpdater=t.config.plugins?.CapacitorUpdater,(0,Oc.writeConfig)(n,r.app.extConfigFilePath))}var tr=".capgo_key",ur=".capgo_key_v2",cr=`${tr}.pub`,jn=`${ur}.pub`;var V6="https://capgo.app",H6="https://files.capgo.app",z6="https://api.capgo.app",G6="https://web.capgo.app",X6=20,Z6=12e4,cse="package.json",la=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Z=t=>t?`
244
+ ${J6.default.render(t)}`:"";function W6(t){return new Promise(e=>{setTimeout(e,t)})}function Xv(t){return(0,Di.isMonorepo)(t)?(0,Di.findMonorepoRoot)(t):(0,Di.isNXMonorepo)(t)?(0,Di.findNXMonorepoRoot)(t):t}async function jt(t=Xv((0,ar.cwd)()),e=void 0){e&&((0,ot.existsSync)(e)||(m.error(`Package.json at ${e} does not exist`),(0,ar.exit)(1)));let r=(0,ot.readFileSync)(e||(0,rt.join)(t,cse));return JSON.parse(r)}async function ee(){try{let t=await f6();return t||(m.error("No capacitor config file found, run `cap init` first"),k.error("")),t}catch(t){m.error(`No capacitor config file found, run \`cap init\` first ${Z(t)}`),k.error("")}}async function kh(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||V6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||G6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||H6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||z6};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(m.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:V6,hostWeb:G6,hostFilesApi:H6,hostApi:z6}}}var lse=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function Zv(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(m.info(`Local config ${Z(t)}`),t))}async function Q6(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function fe(t){let e=await Zv();return(!e.supaHost||!e.supaKey)&&(m.error("Cannot connect to server please try again later"),k.error("")),(0,ca.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function fse(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){m.error("Invalid API key or insufficient permissions.");let i=r.map((o,s)=>r.length===1?`"${o}"`:s===r.length-1?`or "${o}"`:`"${o}", `).join("");m.error(`Your key should be: ${i} mode.`),k.error("")}}async function dse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function hse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function pse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function mse(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var xt=(s=>(s[s.none=0]="none",s[s.read=1]="read",s[s.upload=2]="upload",s[s.write=3]="write",s[s.admin=4]="admin",s[s.super_admin=5]="super_admin",s))(xt||{}),ej=(t,e)=>t>=e;async function tj(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(m.error("Cannot get permissions for organization!"),console.error(i),(0,ar.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(m.info("Please accept/deny the organization invitation before trying to access the app"),(0,ar.exit)(1)),m.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:m.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!1,error:s}}async function fa(t,e,r,n,i=!0){let o=await Zv();await(n?mse(t,n,r):pse(t,e))||(m.error(`You need to upgrade your plan to continue to use capgo.
245
245
  Upgrade here: ${o.hostWeb}/dashboard/settings/plans
246
246
  `),W6(100),Promise.resolve().then(()=>(U6(),M6)).then(c=>{c.default(`${o.hostWeb}/dashboard/settings/plans`)}),W6(500),k.error(""));let[a,u]=await Promise.all([hse(t,e),dse(t,e)]);a>0&&i&&!u&&m.warn(`WARNING !!
247
247
  Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
248
- `)}function he(t=!1){let e=(0,Oh.homedir)(),r,n=`${e}/.capgo`;return(0,it.existsSync)(n)&&(t||m.info(`Use global API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,it.existsSync)(n)&&(t||m.info(`Use local API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),r||(m.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),k.error("")),r}async function*Qv(t){let e=await(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,ot.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*Qv(n):yield n}}function da(t){let e=/\.(jpg|jpeg|png|gif|bmp|webp)$/i,r=t.match(e);if(r)switch(r[1].toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp"}return null}async function eb(){let t=(0,Er.cwd)(),e=!1,r=(0,ot.resolve)(t,"tsconfig.json");(0,it.existsSync)(r)&&(e=!0);for await(let n of Qv(t)){if(n.includes("angular.json"))return m.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return m.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return m.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return m.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return m.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return m.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,ot.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return m.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return m.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function nj(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function ij(t){return t==="angular"?(m.info("Angular project detected"),"build"):t==="nuxtjs"?(m.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(m.info("Nextjs project detected"),m.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),m.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Te({message:"Do you want to continue?"})||(m.error("Aborted"),k.error("")),"build"):(t==="sveltekit"&&(m.info("Sveltekit project detected"),m.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),m.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Te({message:"Do you want to continue?"})||(m.error("Aborted"),k.error(""))),"build")}async function oj(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,Er.cwd)(),n=r.split("/").length;for await(let i of Qv(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,m.info(`Found main file here ${i}`);break}return e}async function tb(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function sj(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof ca.FunctionsHttpError){let s=await o.error.context.json();m.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){m.error(`Cannot get upload url ${Z(i)}`)}return""}async function*aj(t){let e=(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,ot.join)(t,r.name);r.isDirectory()?yield*aj(n):yield n}}async function uj(t){let e=[];for await(let r of aj(t)){let n=(0,it.readFileSync)(r),i=await(0,Y6.checksum)(n,"sha256"),o=(0,ot.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Th(t){return(0,Oh.platform)()==="win32"?yse(t):gse(t)}function gse(t){let e=new Jv.default;return e.addLocalFolder(t),e.toBuffer()}async function yse(t){m.info("Zipping file windows mode");let e=new Jv.default,r=(n,i)=>{let o=(0,it.readdirSync)(n);for(let s of o){let a=(0,ot.join)(n,s),u=(0,it.statSync)(a);if(u.isFile()){let c=(0,it.readFileSync)(a);e.addFile((0,ot.join)(i,s).split(ot.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,ot.join)(i,s))}};return r(t,""),e.toBuffer()}async function rb(t,e,r,n,i,o,s){return new Promise((a,u)=>{xe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new Ah.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof Ah.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await xe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function cj(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof ca.FunctionsHttpError){let s=await o.error.context.json();m.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof ca.FunctionsHttpError){let o=await i.context.json();m.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else m.error(`Cannot delete failed version: ${Z(i)}`)}}async function Ph(t,e){if(!e.app_id||!e.name||!e.created_by)return m.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(m.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&m.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return m.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,m.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function xe(t,e){try{let r=await Zv(),n=await Hr.post(`${r.host}/private/events`,{json:e,headers:{Authorization:`Bearer ${t}`},timeout:1e4,retry:3}).json();n.error&&m.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ha(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(m.error("Cannot get the list of organizations - exiting"),m.error(`Error ${JSON.stringify(r)}`),k.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(m.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),k.error(""));let o=i.length>1?await Bo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;qt(o)&&(m.error("Canceled organization selection, exiting"),k.error(""));let s=o,a=n.find(u=>u.gid===s);return m.info(`Using the organization "${a.name}" as the app owner`),a}var wo=t=>t.replace(/\./g,"--");async function pe(t,e,r=["all"]){await fse(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(m.error("Cannot auth user with apikey"),k.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(m.error(`Cannot get organization id for app id ${e}`),Z(n),k.error("")),r.owner_org}function pa(t){return new Date(t||"").toLocaleString()}var K6=!1,ua="npm",Pc="install",Yv="npx";function Nt(){if(K6)return{pm:ua,command:Pc,installCommand:`${ua} ${Pc}`,runner:Yv};let t=Xv((0,Er.cwd)());return ua=La(t,"npm"),Pc=fl(ua),K6=!0,Yv=Hw(t),{pm:ua,command:Pc,installCommand:`${ua} ${Pc}`,runner:Yv}}function lj(t){return(0,it.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,ot.join)(t,n.name);return n.isDirectory()?lj(i):i.split(`node_modules${ot.sep}`)[1]||i})}async function nb(){let t=Xv((0,Er.cwd)()),e=(0,ot.join)(t,Q6);(0,it.existsSync)(e)||(m.error("Missing package.json, you need to be in a capacitor project"),k.error(""));let r;try{r=await jt()}catch(a){m.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",a),k.error("")}let{dependencies:n}=r;n||(m.error("Missing dependencies section in package.json"),k.error(""));for(let[a,u]of Object.entries(n))typeof u!="string"&&(m.error(`Invalid dependency ${a}: ${u}, expected string, got ${typeof u}`),k.error(""));let i=(0,ot.join)((0,Er.cwd)(),"node_modules");if(!(0,it.existsSync)(i)){let a=La(t,"npm"),u=fl(a);m.error(`Missing node_modules folder, please run ${a} ${u}`),k.error("")}let o=!1,s=await Promise.all(Object.entries(n).map(async([a,u])=>{let c=(0,ot.join)(i,a);if(!(0,it.existsSync)(c)){o=!0;let h=La(t,"npm"),d=fl(h);return m.error(`Missing dependency ${a}, please run ${h} ${d}`),{name:a,version:u}}let f=!1;try{f=lj(c).some(d=>lse.test(d))}catch(h){m.error(`Error reading node_modules files for ${a} package`),console.error(h),k.error("")}return{name:a,version:u,native:f}})).catch(()=>[]);return(o||s.find(a=>a.native===void 0))&&k.error(""),s}async function Dse(t,e,r){let{data:n,error:i}=await t.from("channels").select("version(checksum)").eq("name",r).eq("app_id",e).single(),o=n;return i||o===null||!o.version||!o.version.checksum?null:o.version.checksum}async function vse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
248
+ `)}function he(t=!1){let e=(0,Oh.homedir)(),r,n=`${e}/.capgo`;return(0,ot.existsSync)(n)&&(t||m.info(`Use global API key ${n}`),r=(0,ot.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,ot.existsSync)(n)&&(t||m.info(`Use local API key ${n}`),r=(0,ot.readFileSync)(n,"utf8").trim()),r||(m.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),k.error("")),r}async function*Qv(t){let e=await(0,ot.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,rt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*Qv(n):yield n}}function da(t){let e=/\.(jpg|jpeg|png|gif|bmp|webp)$/i,r=t.match(e);if(r)switch(r[1].toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp"}return null}async function eb(){let t=(0,ar.cwd)(),e=!1,r=(0,rt.resolve)(t,"tsconfig.json");(0,ot.existsSync)(r)&&(e=!0);for await(let n of Qv(t)){if(n.includes("angular.json"))return m.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return m.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return m.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return m.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return m.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return m.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,rt.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return m.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return m.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function rj(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function nj(t){return t==="angular"?(m.info("Angular project detected"),"build"):t==="nuxtjs"?(m.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(m.info("Nextjs project detected"),m.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),m.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Te({message:"Do you want to continue?"})||(m.error("Aborted"),k.error("")),"build"):(t==="sveltekit"&&(m.info("Sveltekit project detected"),m.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),m.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Te({message:"Do you want to continue?"})||(m.error("Aborted"),k.error(""))),"build")}async function ij(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,ar.cwd)(),n=r.split("/").length;for await(let i of Qv(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,m.info(`Found main file here ${i}`);break}return e}async function tb(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function oj(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof ca.FunctionsHttpError){let s=await o.error.context.json();m.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){m.error(`Cannot get upload url ${Z(i)}`)}return""}async function*sj(t){let e=(0,ot.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,rt.join)(t,r.name);r.isDirectory()?yield*sj(n):yield n}}async function aj(t){let e=[];for await(let r of sj(t)){let n=(0,ot.readFileSync)(r),i=await(0,Y6.checksum)(n,"sha256"),o=(0,rt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Th(t){return(0,Oh.platform)()==="win32"?yse(t):gse(t)}function gse(t){let e=new Jv.default;return e.addLocalFolder(t),e.toBuffer()}async function yse(t){m.info("Zipping file windows mode");let e=new Jv.default,r=(n,i)=>{let o=(0,ot.readdirSync)(n);for(let s of o){let a=(0,rt.join)(n,s),u=(0,ot.statSync)(a);if(u.isFile()){let c=(0,ot.readFileSync)(a);e.addFile((0,rt.join)(i,s).split(rt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,rt.join)(i,s))}};return r(t,""),e.toBuffer()}async function rb(t,e,r,n,i,o,s){return new Promise((a,u)=>{xe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new Ah.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof Ah.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await xe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function uj(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof ca.FunctionsHttpError){let s=await o.error.context.json();m.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof ca.FunctionsHttpError){let o=await i.context.json();m.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else m.error(`Cannot delete failed version: ${Z(i)}`)}}async function Ph(t,e){if(!e.app_id||!e.name||!e.created_by)return m.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(m.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&m.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return m.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,m.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function xe(t,e){try{let r=await Zv(),n=await Hr.post(`${r.host}/private/events`,{json:e,headers:{Authorization:`Bearer ${t}`},timeout:1e4,retry:3}).json();n.error&&m.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ha(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(m.error("Cannot get the list of organizations - exiting"),m.error(`Error ${JSON.stringify(r)}`),k.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(m.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),k.error(""));let o=i.length>1?await Bo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;qt(o)&&(m.error("Canceled organization selection, exiting"),k.error(""));let s=o,a=n.find(u=>u.gid===s);return m.info(`Using the organization "${a.name}" as the app owner`),a}var wo=t=>t.replace(/\./g,"--");async function pe(t,e,r=["all"]){await fse(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(m.error("Cannot auth user with apikey"),k.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(m.error(`Cannot get organization id for app id ${e}`),Z(n),k.error("")),r.owner_org}function pa(t){return new Date(t||"").toLocaleString()}var K6=!1,ua="npm",Pc="install",Yv="npx";function Nt(){if(K6)return{pm:ua,command:Pc,installCommand:`${ua} ${Pc}`,runner:Yv};let t=Xv((0,ar.cwd)());return ua=La(t,"npm"),Pc=fl(ua),K6=!0,Yv=Hw(t),{pm:ua,command:Pc,installCommand:`${ua} ${Pc}`,runner:Yv}}function cj(t){return(0,ot.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,rt.join)(t,n.name);return n.isDirectory()?cj(i):i.split(`node_modules${rt.sep}`)[1]||i})}async function nb(t){let e;try{e=await jt("",t)}catch(a){m.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",a),k.error("")}let r=t?rt.default.resolve(t).replace("package.json",""):Xv((0,ar.cwd)()),{dependencies:n}=e;n||(m.error("Missing dependencies section in package.json"),k.error(""));for(let[a,u]of Object.entries(n))typeof u!="string"&&(m.error(`Invalid dependency ${a}: ${u}, expected string, got ${typeof u}`),k.error(""));let i=(0,rt.join)((0,ar.cwd)(),"node_modules");if(!(0,ot.existsSync)(i)){let a=La(r,"npm"),u=fl(a);m.error(`Missing node_modules folder, please run ${a} ${u}`),k.error("")}let o=!1,s=await Promise.all(Object.entries(n).map(async([a,u])=>{let c=(0,rt.join)(i,a);if(!(0,ot.existsSync)(c)){o=!0;let h=La(r,"npm"),d=fl(h);return m.error(`Missing dependency ${a}, please run ${h} ${d}`),{name:a,version:u}}let f=!1;try{f=cj(c).some(d=>lse.test(d))}catch(h){m.error(`Error reading node_modules files for ${a} package`),console.error(h),k.error("")}return{name:a,version:u,native:f}})).catch(()=>[]);return(o||s.find(a=>a.native===void 0))&&k.error(""),s}async function Dse(t,e,r){let{data:n,error:i}=await t.from("channels").select("version(checksum)").eq("name",r).eq("app_id",e).single(),o=n;return i||o===null||!o.version||!o.version.checksum?null:o.version.checksum}async function vse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
249
249
  native_packages
250
- )`).eq("name",r).eq("app_id",e).single();i&&(m.error(`Error fetching native packages: ${i.message}`),k.error(""));let o;try{o=n.version.native_packages}catch{m.error("Error parsing native packages"),k.error("")}return o||(m.error("Error parsing native packages, perhaps the metadata does not exist?"),k.error("")),o.forEach(a=>{typeof a!="object"&&(m.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),k.error(""));let{name:u,version:c}=a;(!u||typeof u!="string")&&(m.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),k.error("")),(!c||typeof c!="string")&&(m.error(`Invalid remote native package version: ${c}, expected string, got ${typeof c}`),k.error(""))}),new Map(o.map(a=>[a.name,a]))}async function fj(t,e,r,n){let i=ve();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await Dse(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(m.error(`Cannot upload the same bundle content.
250
+ )`).eq("name",r).eq("app_id",e).single();i&&(m.error(`Error fetching native packages: ${i.message}`),k.error(""));let o;try{o=n.version.native_packages}catch{m.error("Error parsing native packages"),k.error("")}return o||(m.error("Error parsing native packages, perhaps the metadata does not exist?"),k.error("")),o.forEach(a=>{typeof a!="object"&&(m.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),k.error(""));let{name:u,version:c}=a;(!u||typeof u!="string")&&(m.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),k.error("")),(!c||typeof c!="string")&&(m.error(`Invalid remote native package version: ${c}, expected string, got ${typeof c}`),k.error(""))}),new Map(o.map(a=>[a.name,a]))}async function lj(t,e,r,n){let i=ve();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await Dse(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(m.error(`Cannot upload the same bundle content.
251
251
  Current bundle checksum matches remote bundle for channel ${r}
252
252
  Did you builded your app before uploading?
253
- PS: You can ignore this check with "--ignore-checksum-check"`),k.error("")),i.stop(`Checksum compatible with ${r} channel`)}async function Rh(t,e,r){let n=await nb(),i=await vse(t,e,r),o=n.filter(a=>!!a.native).map(a=>{let u=i.get(a.name);return u?{name:a.name,localVersion:a.version,remoteVersion:u.version}:{name:a.name,localVersion:a.version,remoteVersion:void 0}}),s=[...i].filter(([a])=>n.find(u=>u.name===a)===void 0).map(([a,u])=>({name:a,localVersion:void 0,remoteVersion:u.version}));return o.push(...s),{finalCompatibility:o,localDependencies:n}}async function dj(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function qe(t,e,r,n){let i=Nt(),o=await rj(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{m.error("Invalid apikey, such apikey does not exists!"),k.error("");break}case"NO_APP":{m.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),k.error("");break}case"NO_ORG":{m.error("Could not find organization, please contact support to resolve this!"),k.error("");break}}let s=o.data;return n>s&&(m.error(`Insuficcent permissions for app ${r}. Current permission: ${xt[o.data]}, required for this action: ${xt[n]}.`),k.error("")),o.data}var xr="assets/icon.png";var jj=fe(Ij(),1);function ab(t){let e=(0,jj.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var j8=fe(I8(),1),N8=fe(Ov(),1),bb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},wb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function _b(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??ab(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,j8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new bb(t):f}if(e.allVersions)return c;let l=new wb(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,p]of Object.entries(c.versions))p.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=N8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function Nc(t,e){let{version:r}=await _b(t.toLowerCase(),e);return r}async function ge(){let t=await Nc("@capgo/cli"),e=t?.split(".")[0];t!==Ir.version&&m.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
- Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function Eae(t,e,r=!0){await Eb(t,e,void 0,r)}async function Eb(t,e,r,n=!0){n&&Y("Adding"),await ge(),e.apikey=e.apikey||he();let i=await ee();t=t||i?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),t.includes("--")&&(m.error('The app id includes illegal symbols. You cannot use "--" in the app id'),k.error(""));let o=await le(e.apikey);await pe(o,e.apikey,["write","all"]),await dj(o,t)&&(m.error(`App ${t} already exist`),k.error("")),r||(r=await ha(o,["admin","super_admin"]));let a=r.gid;await fa(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(m.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),k.error("")),n&&m.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,_a.existsSync)(c)?(l=(0,_a.readFileSync)(c),f=da(c)||"image/png",m.warn(`Found app icon ${c}`)):(0,_a.existsSync)(xr)?(l=(0,_a.readFileSync)(xr),f=da(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),m.error(`Could not add app ${Z(g)}`),k.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:p}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});p&&(m.error(`Could not add app ${Z(p)}`),k.error(""));let{error:b}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return b&&(m.error(`Could not add app ${Z(b)}`),k.error("")),m.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,L8.exit)()),!0}async function B8(t,e){Eae(t,e,!0)}var q8=require("node:process");async function M8(t,e){Y("Deleting"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await le(e.apikey),i=await pe(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,5);let{data:o,error:s}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",t).single(),a=o;if(!s&&(a?.owner_org.created_by??"")!==i){m.warn("Deleting the app is not recomended for users that are not the organization owner"),m.warn("You are invited as a super_admin but your are not the owner"),m.warn("It's strongly recomended that you do not continue!");let h=await Bo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(qt(h)||h==="no")&&(m.error("Canceled deleting the app, exiting"),k.error(""))}else s&&m.warn(`Cannot get the app owner ${Z(s)}`);let{error:u}=await n.storage.from("images").remove([`org/${a?.owner_org.id}/${t}/icon`]);u&&(console.error(u,`images/org/${a?.owner_org.id}/${t}`),m.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&m.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(m.error("Could not delete app"),k.error(""));let f=await Sr(n,t);await xe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),m.success("App deleted in Capgo"),X("Done \u2705"),(0,q8.exit)()}var Wh=require("node:os"),Ea=require("node:process");async function Cae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Nc(n));return await Promise.all(r).then(n=>{let i=Object.keys(t);for(let o=0;o<n.length;o+=1){let s=n[o];s&&(e[i[o]]=s)}}),e}async function Sae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function U8(){m.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let t=await ee(),e=await jt(),r=t?.config?.plugins?.CapacitorUpdater?.version||e?.version,n=t?.config?.appName||"";m.info(` App Name: ${n}`);let i=t?.config?.appId||"";m.info(` App ID: ${i}`),m.info(` App Version: ${r}`);let o=t?.config?.webDir||"";m.info(` Web Dir: ${o}`),m.info(` OS: ${(0,Wh.platform)()} ${(0,Wh.version)()}`),m.info(` Node: ${Ea.version}`),m.info(" Installed Dependencies:");let s=await Sae();Object.keys(s).length===0&&(m.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Ea.exit)(1));for(let c in s)if(Object.prototype.hasOwnProperty.call(s,c)){let l=s[c];m.info(` ${c}: ${l}`)}let a=ve();a.start("Running: Loading latest dependencies");let u=await Cae(s);a.stop("Latest Dependencies:");for(let c in u)if(Object.prototype.hasOwnProperty.call(u,c)){let l=u[c];m.info(` ${c}: ${l}`)}JSON.stringify(s)!==JSON.stringify(u)&&(m.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Ea.exit)(1)),m.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Ea.exit)()}var Cb=require("node:process");function V8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var cr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?V8("bold",i):i,s=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(s)+o;case"string":return o+a.repeat(s);case"boolean":case"object":return a.repeat(Math.ceil(s/2))+V8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
- `)}};function xae(t){t.length||(m.error("No apps found"),(0,Cb.exit)(1));let e=new cr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,pa(r.created_at)])}),m.success("Apps"),m.success(e.toString())}async function Fae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(m.error("Apps not found"),k.error("")),e}async function H8(t){Y("List apps in Capgo"),await ge(),t.apikey=t.apikey||he();let e=await le(t.apikey);await pe(e,t.apikey,["write","all","read","upload"]),m.info("Getting active bundle in Capgo");let r=await Fae(e);m.info(`Active app in Capgo: ${r?.length}`),xae(r),X("Done \u2705"),(0,Cb.exit)()}var z8=require("node:crypto"),Ca=require("node:fs"),G8=require("node:process");async function W8(t,e){Y("Set app"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await le(e.apikey),o=(await ha(n,["admin","super_admin"])).gid,s=await pe(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(m.error("retention value must be a number"),k.error("")):c&&c<0&&(m.error("retention value cannot be less than 0"),k.error(""));let l,f,h=`icon_${(0,z8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Ca.existsSync)(u)?(l=(0,Ca.readFileSync)(u),f=da(u)||"image/png",m.warn(`Found app icon ${u}`)):(0,Ca.existsSync)(xr)?(l=(0,Ca.readFileSync)(xr),f=da(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});b&&(m.error(`Could not set app ${Z(b)}`),k.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:p}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);p&&(m.error(`Could not set app ${Z(p)}`),k.error("")),X("Done \u2705"),(0,G8.exit)()}var Sa=require("node:process");async function K8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(m.error("Bool and string CANNOT be set at the same time"),(0,Sa.exit)(1)),!e.bool&&!e.string&&(m.error("You MUST provide either bool or string as the value"),(0,Sa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(m.error("Invalid bool"),(0,Sa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(m.error("Invalid path"),(0,Sa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),m.success(`Set "${t}" to "${o}"`)}catch(r){m.error(`Cannot set config in capacitor settings ${Z(r)}`),(0,Sa.exit)(1)}X("Done \u2705")}var $b=require("node:process");function Kh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function X8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function xb(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],o=e[n];if(i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof o=="number")return 1;if(typeof i=="number"&&typeof o=="string"||i<o)return-1;if(i>o)return 1}return 0}var xa="0|[1-9]\\d*",Oae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Aae=`(?<major>${xa})\\.(?<minor>${xa})\\.(?<patch>${xa})`,Y8=`(?:${xa}|${Oae})`,Z8=`(?:-(?<prerelease>${Y8}(?:\\.${Y8})*))`,J8="[0-9A-Za-z-]+",Q8=`(?:\\+(?<buildmetadata>${J8}(?:\\.${J8})*))`,eN=`v?${Aae}${Z8}?${Q8}?`,tN=new RegExp(`^${eN}$`),rN="(?:<|>)?=?",kae="x|X|\\*",Sb=`${xa}|${kae}`,nN=`[v=\\s]*(?<major>${Sb})(?:\\.(?<minor>${Sb})(?:\\.(?<patch>${Sb})${Z8}?${Q8}?)?)?`,Tae=new RegExp(`^(?<operator>~>?|\\^|${rN})\\s*${nN}$`),Pae=new RegExp(`^(?<operator>${rN})\\s*(${eN})$|^$`);function Fb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Ob=256;var Rae=new RegExp(`^${xa}$`);function Ab(t){return t.split(".").filter(Boolean).map(e=>{if(Rae.test(e)){let r=Number(e);if(Fb(r))return r}return e})}function Lc(t){return t.split(".").filter(Boolean)}function Bc(t,e){let r=Number(t);if(!Fb(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Kh(t.major,e.major)||Kh(t.minor,e.minor)||Kh(t.patch,e.patch)||X8(t.prerelease,e.prerelease)||xb(t.prerelease,e.prerelease)}function kb(t){return t.toFixed(0)}function Fa(t){let e=kb(t.major),r=kb(t.minor),n=kb(t.patch),i=t.prerelease?.join(".")??"",o=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),o].filter(u=>u).join("+")}function $ae(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function qc(t=[],e){let r=$ae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function oN(t,e,r={}){let n=r.build!==void 0?Lc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:qc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:qc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:qc(t.prerelease,r.prerelease),build:n};case"prerelease":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:qc(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let o=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:o,patch:0,prerelease:[],build:n}}case"patch":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:qc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var Tb={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},sN={operator:void 0,...Tb};function Pb(t,e){return Fr(t,e)>0}function Oa(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Ob)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Ob}`);t=t.trim();let e=t.match(tN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Bc(e.major,`Cannot parse version ${t}: invalid major version`),n=Bc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Bc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Ab(e.prerelease):[],s=e.buildmetadata?Lc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var gN=require("node:process");var uN=require("node:process");async function cN(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Version ${e}@${r.name}`),k.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await Rb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Z(a)}`),(0,uN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else m.error("Unlink it first"),k.error("");X(`Version unlinked from ${n.length} channel`)}}function Rb(t,e){return t.from("app_versions").select("id").eq("app_id",e).eq("name","unknown").throwOnError().single().then(({data:r,error:n})=>(n&&(m.error(`Cannot call findUnknownVersion as it returned an error.
256
- ${Z(n)}`),k.error("")),r))}function lN(t,e){return t.from("channels").insert(e).select().single()}function fN(t,e,r,n){return t.from("channels").delete().eq("name",e).eq("app_id",r).single()}function dN(t){let e=new cr;e.theme=cr.roundTheme,e.headers=["Name","Version","Public","iOS","Android","Auto Update","Native Auto Update","Device Self Set","Progressive Deploy","Secondary Version","Secondary Version Percentage","AB Testing","AB Testing Version","AB Testing Percentage","Emulator","Dev"],e.rows=[["a",0,!0],["bb",10,!1]],t.reverse().forEach(r=>{e.rows.push([r.name,r.version?.name,r.public?"\u2705":"\u274C",r.ios?"\u2705":"\u274C",r.android?"\u2705":"\u274C",r.disable_auto_update,r.disable_auto_update_under_native?"\u274C":"\u2705",r.allow_device_self_set?"\u2705":"\u274C",r.enable_progressive_deploy?"\u2705":"\u274C",r.enable_progressive_deploy&&r.second_version?r.second_version.name:void 0,r.enable_progressive_deploy&&r.second_version?r.secondary_version_percentage:void 0,r.enable_ab_testing?"\u2705":"\u274C",r.enable_ab_testing&&r.second_version?r.second_version.name:void 0,r.enable_ab_testing&&r.second_version?`${(1-r.secondary_version_percentage)*100}% / ${r.secondary_version_percentage*100}%`:void 0,r.allow_emulator?"\u2705":"\u274C",r.allow_dev?"\u2705":"\u274C"])}),m.success("Channels"),m.success(e.toString())}async function hN(t,e){let{data:r,error:n}=await t.from("channels").select(`
253
+ PS: You can ignore this check with "--ignore-checksum-check"`),k.error("")),i.stop(`Checksum compatible with ${r} channel`)}async function Rh(t,e,r,n){let i=await nb(n),o=await vse(t,e,r),s=i.filter(u=>!!u.native).map(u=>{let c=o.get(u.name);return c?{name:u.name,localVersion:u.version,remoteVersion:c.version}:{name:u.name,localVersion:u.version,remoteVersion:void 0}}),a=[...o].filter(([u])=>i.find(c=>c.name===u)===void 0).map(([u,c])=>({name:u,localVersion:void 0,remoteVersion:c.version}));return s.push(...a),{finalCompatibility:s,localDependencies:i}}async function fj(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function qe(t,e,r,n){let i=Nt(),o=await tj(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{m.error("Invalid apikey, such apikey does not exists!"),k.error("");break}case"NO_APP":{m.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),k.error("");break}case"NO_ORG":{m.error("Could not find organization, please contact support to resolve this!"),k.error("");break}}let s=o.data;return n>s&&(m.error(`Insuficcent permissions for app ${r}. Current permission: ${xt[o.data]}, required for this action: ${xt[n]}.`),k.error("")),o.data}var xr="assets/icon.png";var Ij=le($j(),1);function ab(t){let e=(0,Ij.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var I8=le($8(),1),j8=le(Ov(),1),bb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},wb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function _b(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??ab(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,I8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new bb(t):f}if(e.allVersions)return c;let l=new wb(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,p]of Object.entries(c.versions))p.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=j8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function Nc(t,e){let{version:r}=await _b(t.toLowerCase(),e);return r}async function ge(){let t=await Nc("@capgo/cli"),e=t?.split(".")[0];t!==Ir.version&&m.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
+ Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function Eae(t,e,r=!0){await Eb(t,e,void 0,r)}async function Eb(t,e,r,n=!0){n&&Y("Adding"),await ge(),e.apikey=e.apikey||he();let i=await ee();t=t||i?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),t.includes("--")&&(m.error('The app id includes illegal symbols. You cannot use "--" in the app id'),k.error(""));let o=await fe(e.apikey);await pe(o,e.apikey,["write","all"]),await fj(o,t)&&(m.error(`App ${t} already exist`),k.error("")),r||(r=await ha(o,["admin","super_admin"]));let a=r.gid;await fa(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(m.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),k.error("")),n&&m.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,_a.existsSync)(c)?(l=(0,_a.readFileSync)(c),f=da(c)||"image/png",m.warn(`Found app icon ${c}`)):(0,_a.existsSync)(xr)?(l=(0,_a.readFileSync)(xr),f=da(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),m.error(`Could not add app ${Z(g)}`),k.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:p}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});p&&(m.error(`Could not add app ${Z(p)}`),k.error(""));let{error:b}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return b&&(m.error(`Could not add app ${Z(b)}`),k.error("")),m.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,N8.exit)()),!0}async function L8(t,e){Eae(t,e,!0)}var B8=require("node:process");async function q8(t,e){Y("Deleting"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await pe(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,5);let{data:o,error:s}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",t).single(),a=o;if(!s&&(a?.owner_org.created_by??"")!==i){m.warn("Deleting the app is not recomended for users that are not the organization owner"),m.warn("You are invited as a super_admin but your are not the owner"),m.warn("It's strongly recomended that you do not continue!");let h=await Bo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(qt(h)||h==="no")&&(m.error("Canceled deleting the app, exiting"),k.error(""))}else s&&m.warn(`Cannot get the app owner ${Z(s)}`);let{error:u}=await n.storage.from("images").remove([`org/${a?.owner_org.id}/${t}/icon`]);u&&(console.error(u,`images/org/${a?.owner_org.id}/${t}`),m.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&m.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(m.error("Could not delete app"),k.error(""));let f=await Sr(n,t);await xe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),m.success("App deleted in Capgo"),X("Done \u2705"),(0,B8.exit)()}var Wh=require("node:os"),Ea=require("node:process");async function Cae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Nc(n));return await Promise.all(r).then(n=>{let i=Object.keys(t);for(let o=0;o<n.length;o+=1){let s=n[o];s&&(e[i[o]]=s)}}),e}async function Sae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function M8(t){m.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await jt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";m.info(` App Name: ${i}`);let o=e?.config?.appId||"";m.info(` App ID: ${o}`),m.info(` App Version: ${n}`);let s=e?.config?.webDir||"";m.info(` Web Dir: ${s}`),m.info(` OS: ${(0,Wh.platform)()} ${(0,Wh.version)()}`),m.info(` Node: ${Ea.version}`),m.info(" Installed Dependencies:");let a=await Sae();Object.keys(a).length===0&&(m.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Ea.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];m.info(` ${l}: ${f}`)}let u=ve();u.start("Running: Loading latest dependencies");let c=await Cae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];m.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(m.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Ea.exit)(1)),m.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Ea.exit)()}var Cb=require("node:process");function U8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var lr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?U8("bold",i):i,s=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(s)+o;case"string":return o+a.repeat(s);case"boolean":case"object":return a.repeat(Math.ceil(s/2))+U8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
+ `)}};function xae(t){t.length||(m.error("No apps found"),(0,Cb.exit)(1));let e=new lr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,pa(r.created_at)])}),m.success("Apps"),m.success(e.toString())}async function Fae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(m.error("Apps not found"),k.error("")),e}async function V8(t){Y("List apps in Capgo"),await ge(),t.apikey=t.apikey||he();let e=await fe(t.apikey);await pe(e,t.apikey,["write","all","read","upload"]),m.info("Getting active bundle in Capgo");let r=await Fae(e);m.info(`Active app in Capgo: ${r?.length}`),xae(r),X("Done \u2705"),(0,Cb.exit)()}var H8=require("node:crypto"),Ca=require("node:fs"),z8=require("node:process");async function G8(t,e){Y("Set app"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),o=(await ha(n,["admin","super_admin"])).gid,s=await pe(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(m.error("retention value must be a number"),k.error("")):c&&c<0&&(m.error("retention value cannot be less than 0"),k.error(""));let l,f,h=`icon_${(0,H8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Ca.existsSync)(u)?(l=(0,Ca.readFileSync)(u),f=da(u)||"image/png",m.warn(`Found app icon ${u}`)):(0,Ca.existsSync)(xr)?(l=(0,Ca.readFileSync)(xr),f=da(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});b&&(m.error(`Could not set app ${Z(b)}`),k.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:p}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);p&&(m.error(`Could not set app ${Z(p)}`),k.error("")),X("Done \u2705"),(0,z8.exit)()}var Sa=require("node:process");async function W8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(m.error("Bool and string CANNOT be set at the same time"),(0,Sa.exit)(1)),!e.bool&&!e.string&&(m.error("You MUST provide either bool or string as the value"),(0,Sa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(m.error("Invalid bool"),(0,Sa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(m.error("Invalid path"),(0,Sa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),m.success(`Set "${t}" to "${o}"`)}catch(r){m.error(`Cannot set config in capacitor settings ${Z(r)}`),(0,Sa.exit)(1)}X("Done \u2705")}var $b=require("node:process");function Kh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function J8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function xb(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],o=e[n];if(i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof o=="number")return 1;if(typeof i=="number"&&typeof o=="string"||i<o)return-1;if(i>o)return 1}return 0}var xa="0|[1-9]\\d*",Oae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Aae=`(?<major>${xa})\\.(?<minor>${xa})\\.(?<patch>${xa})`,K8=`(?:${xa}|${Oae})`,X8=`(?:-(?<prerelease>${K8}(?:\\.${K8})*))`,Y8="[0-9A-Za-z-]+",Z8=`(?:\\+(?<buildmetadata>${Y8}(?:\\.${Y8})*))`,Q8=`v?${Aae}${X8}?${Z8}?`,eN=new RegExp(`^${Q8}$`),tN="(?:<|>)?=?",kae="x|X|\\*",Sb=`${xa}|${kae}`,rN=`[v=\\s]*(?<major>${Sb})(?:\\.(?<minor>${Sb})(?:\\.(?<patch>${Sb})${X8}?${Z8}?)?)?`,Tae=new RegExp(`^(?<operator>~>?|\\^|${tN})\\s*${rN}$`),Pae=new RegExp(`^(?<operator>${tN})\\s*(${Q8})$|^$`);function Fb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Ob=256;var Rae=new RegExp(`^${xa}$`);function Ab(t){return t.split(".").filter(Boolean).map(e=>{if(Rae.test(e)){let r=Number(e);if(Fb(r))return r}return e})}function Lc(t){return t.split(".").filter(Boolean)}function Bc(t,e){let r=Number(t);if(!Fb(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Kh(t.major,e.major)||Kh(t.minor,e.minor)||Kh(t.patch,e.patch)||J8(t.prerelease,e.prerelease)||xb(t.prerelease,e.prerelease)}function kb(t){return t.toFixed(0)}function Fa(t){let e=kb(t.major),r=kb(t.minor),n=kb(t.patch),i=t.prerelease?.join(".")??"",o=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),o].filter(u=>u).join("+")}function $ae(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function qc(t=[],e){let r=$ae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function iN(t,e,r={}){let n=r.build!==void 0?Lc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:qc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:qc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:qc(t.prerelease,r.prerelease),build:n};case"prerelease":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:qc(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let o=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:o,patch:0,prerelease:[],build:n}}case"patch":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:qc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var Tb={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},oN={operator:void 0,...Tb};function Pb(t,e){return Fr(t,e)>0}function Oa(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Ob)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Ob}`);t=t.trim();let e=t.match(eN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Bc(e.major,`Cannot parse version ${t}: invalid major version`),n=Bc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Bc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Ab(e.prerelease):[],s=e.buildmetadata?Lc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var mN=require("node:process");var aN=require("node:process");async function uN(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Version ${e}@${r.name}`),k.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await Rb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Z(a)}`),(0,aN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else m.error("Unlink it first"),k.error("");X(`Version unlinked from ${n.length} channel`)}}function Rb(t,e){return t.from("app_versions").select("id").eq("app_id",e).eq("name","unknown").throwOnError().single().then(({data:r,error:n})=>(n&&(m.error(`Cannot call findUnknownVersion as it returned an error.
256
+ ${Z(n)}`),k.error("")),r))}function cN(t,e){return t.from("channels").insert(e).select().single()}function lN(t,e,r,n){return t.from("channels").delete().eq("name",e).eq("app_id",r).single()}function fN(t){let e=new lr;e.theme=lr.roundTheme,e.headers=["Name","Version","Public","iOS","Android","Auto Update","Native Auto Update","Device Self Set","Progressive Deploy","Secondary Version","Secondary Version Percentage","AB Testing","AB Testing Version","AB Testing Percentage","Emulator","Dev"],e.rows=[["a",0,!0],["bb",10,!1]],t.reverse().forEach(r=>{e.rows.push([r.name,r.version?.name,r.public?"\u2705":"\u274C",r.ios?"\u2705":"\u274C",r.android?"\u2705":"\u274C",r.disable_auto_update,r.disable_auto_update_under_native?"\u274C":"\u2705",r.allow_device_self_set?"\u2705":"\u274C",r.enable_progressive_deploy?"\u2705":"\u274C",r.enable_progressive_deploy&&r.second_version?r.second_version.name:void 0,r.enable_progressive_deploy&&r.second_version?r.secondary_version_percentage:void 0,r.enable_ab_testing?"\u2705":"\u274C",r.enable_ab_testing&&r.second_version?r.second_version.name:void 0,r.enable_ab_testing&&r.second_version?`${(1-r.secondary_version_percentage)*100}% / ${r.secondary_version_percentage*100}%`:void 0,r.allow_emulator?"\u2705":"\u274C",r.allow_dev?"\u2705":"\u274C"])}),m.success("Channels"),m.success(e.toString())}async function dN(t,e){let{data:r,error:n}=await t.from("channels").select(`
257
257
  id,
258
258
  name,
259
259
  public,
@@ -272,30 +272,30 @@ ${Z(n)}`),k.error("")),r))}function lN(t,e){return t.from("channels").insert(e).
272
272
  created_by,
273
273
  app_id,
274
274
  version (id, name)
275
- `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),k.error("")),r}var pN=require("node:process");async function mN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Device override ${e}@${r.name}`),k.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Z(a)}`),(0,pN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else m.error("Unlink it first"),k.error("")}async function Iae(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(m.error(`App Version ${e}@${r} not found in database`),k.error(""))}async function Jh(t,e,r){let n=await jae(t,e,r);await cN(t,e,n),await mN(t,e,n),await Iae(t,e,r)}function Xh(t){t.length||(m.error("No bundle found"),(0,gN.exit)(1));let e=new cr;e.theme=cr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,pa(r.created_at),r.keep!=null?r.keep:""])}),m.success("Bundles"),m.success(e.toString())}async function Zh(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),k.error("")),r}async function yN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(m.error(`App ${e} not found in database`),k.error("")),r.map(i=>i.version)}async function jae(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(m.error(`App Version ${e}@${r} doesn't exist`),k.error("")),n}async function Nae(t,e,r){for await(let n of t)m.warn(`Removing ${n.name} created on ${pa(n.created_at)}`),await Jh(e,r,n.name)}function Lae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);Pb(o,e)&&Oa(o,r)&&n.push(i)}),n}async function DN(t,e){Y("Cleanup versions in Capgo"),await ge(),e.apikey=e.apikey||he();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=t||o?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let s=await le(e.apikey);await pe(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),m.info("Querying all available versions in Capgo");let a=await Zh(s,t),u=await yN(s,t);if(m.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){m.error("No versions found, aborting cleanup");return}if(r){let f=Bn(r),h=oN(f,"major");m.info(`Querying available versions in Capgo between ${Fa(f)} and ${Fa(h)}`),a=Lae(a,f,h),m.info(`Active versions in Capgo between ${Fa(f)} and ${Fa(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){m.warn("Nothing to be removed, aborting removal...");return}if(Xh(a),!i){let f=await Te({message:"Do you want to continue removing the versions specified?"});(qt(f)||!f)&&(m.warn("Not confirmed, aborting removal..."),(0,$b.exit)())}m.success("You have confirmed removal, removing versions now"),await Nae(c,s,t),X("Done \u2705"),(0,$b.exit)()}var sn=require("node:fs"),EN=require("node:process");var Mc=require("node:buffer"),Lt=require("node:crypto"),vN="aes-128-cbc",bN="sha256",Qh="base64",wN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function _N(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:wN,oaepHash:bN},Mc.Buffer.from(i,Qh)),s=Mc.Buffer.from(n,Qh),a=(0,Lt.createDecipheriv)(vN,o,s);return a.setAutoPadding(!0),Mc.Buffer.concat([a.update(t),a.final()])}function ep(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(vN,n,r);i.setAutoPadding(!0);let o=r.toString(Qh),s=(0,Lt.publicEncrypt)({key:e,padding:wN,oaepHash:bN},n).toString(Qh),a=`${o}:${s}`;return{encryptedData:Mc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function tp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function CN(t,e,r){Y("Decrypt zip file"),await ge(),(0,sn.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),k.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(tr)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${tr} or in ${n.path}`),k.error(""));let i=r.key||tr,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=_N(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,EN.exit)()}var an=require("node:fs"),ON=require("node:process");var AN=fe(yu());var To=require("node:buffer"),Ot=require("node:crypto"),SN="aes-128-cbc",bi="base64",rp=Ot.constants.RSA_PKCS1_PADDING;function xN(t,e,r){let[n,i]=e.split(":"),o=(0,Ot.publicDecrypt)({key:r,padding:rp},To.Buffer.from(i,bi)),s=To.Buffer.from(n,bi),a=(0,Ot.createDecipheriv)(SN,o,s);return a.setAutoPadding(!0),To.Buffer.concat([a.update(t),a.final()])}function np(t,e){return(0,Ot.privateEncrypt)({key:e,padding:rp},To.Buffer.from(t,bi)).toString(bi)}function FN(t,e){return(0,Ot.publicDecrypt)({key:e,padding:rp},To.Buffer.from(t,bi)).toString(bi)}function ip(t,e){let r=(0,Ot.randomBytes)(16),n=(0,Ot.randomBytes)(16),i=(0,Ot.createCipheriv)(SN,n,r);i.setAutoPadding(!0);let o=r.toString(bi),s=(0,Ot.privateEncrypt)({key:e,padding:rp},n).toString(bi),a=`${o}:${s}`;return{encryptedData:To.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function kN(t,e,r){Y("Decrypt zip file"),await ge(),(0,an.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),k.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${jn} or in ${n.path}`),k.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=xN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),m.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,AN.checksum)(a,"sha256"),c=FN(r.checksum,r.keyData??o??"");u!==c?(m.error(`Checksum does not match ${u} !== ${c}`),k.error("")):m.info("Checksum matches")}X("\u2705 done"),(0,ON.exit)()}var TN=require("node:process");async function PN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||he();let n=await ee();e=e||n?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await le(r.apikey);await pe(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(m.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),m.info(`Deleting bundle ${e}@${t} from Capgo`),m.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Jh(i,e,t),m.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,TN.exit)()}var wi=require("node:fs"),RN=require("node:process");async function $N(t,e){Y("Encryption"),await ge(),(0,wi.existsSync)(t)||(m.error(`Error: Zip not found at the path ${t}`),k.error(""));let r=e.key||ur,n=e.keyData||"";(0,wi.existsSync)(r)&&(n=(0,wi.readFileSync)(r).toString());let i=(0,wi.readFileSync)(t),o=ep(i,n);m.success(`ivSessionKey: ${o.ivSessionKey}`),(0,wi.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),m.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,RN.exit)()}var qn=require("node:fs"),IN=require("node:process");async function jN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await ge());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&m.warning("There is still a privateKey in the config"),(0,qn.existsSync)(t)||(n?console.error(Z({error:"zip_not_found"})):m.error(`Error: Zip not found at the path ${t}`),k.error("")),s||(n?console.error(Z({error:"missing_public_key"})):m.warning("Warning: Missing Public Key in config"),k.error(""));let a=r.key||ar,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Z({error:"missing_key"})):(m.warning(`Cannot find a private key at ${a} or as a keyData option`),m.error("Error: Missing key")),k.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Z({error:"invalid_private_key"})):m.error("the private key provided is not a valid RSA Private key"),k.error(""));let c=(0,qn.readFileSync)(t),l=ip(c,u),f=np(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(m.success(`Encoded Checksum: ${f}`),m.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(m.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,IN.exit)()}var NN=require("node:process");async function LN(t,e){Y("List bundles"),await ge(),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let n=await le(e.apikey);await pe(n,e.apikey,["write","all","read","upload"]),m.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Zh(n,t);m.info(`Active versions in Capgo: ${i?.length}`),Xh(i),X("Done \u2705"),(0,NN.exit)()}var rL=require("node:crypto"),cn=require("node:fs"),nL=require("node:process");function Uc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var op=32*1024,Ib=2**32-2,sp=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=Uc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return Uc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)Uc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Ib)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Ib));Uc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Ib)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var ap=class extends TransformStream{constructor(e){let r=new sp;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function _i(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let p=o();if(!p)return h;h.attributes[p.name]=p.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},up=class extends un{},cp=class extends un{},Mn=class extends un{},Po=class extends un{},Vc=class extends un{},Hc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function BN(t){try{let r=_i(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function qN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function MN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function Ro(t){return!(!Bae(t)||t.length===0)}function Bae(t){return!(typeof t!="string"||t.length>1024)}function lp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function $o(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function Nb(t){return t.get("x-amz-version-id")??null}function zc(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,5)+e.substr(14,2)+e.substr(17,2)+"Z"}function Lb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Bb(t,e){return`${Lb(e)}/${t}/s3/aws4_request`}async function fp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),lp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var qae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],dp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",p=a++;try{if(p==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:$o(w.headers.get("etag")??void 0),versionId:Nb(w.headers)};return}p===1&&(u=(await Mae({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let w of qae){let x=o[w];x&&(b[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:p.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:p,etag:x})}),l.push(g)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await Uae({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function Mae(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=_i(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function Uae({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
275
+ `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),k.error("")),r}var hN=require("node:process");async function pN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Device override ${e}@${r.name}`),k.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Z(a)}`),(0,hN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else m.error("Unlink it first"),k.error("")}async function Iae(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(m.error(`App Version ${e}@${r} not found in database`),k.error(""))}async function Jh(t,e,r){let n=await jae(t,e,r);await uN(t,e,n),await pN(t,e,n),await Iae(t,e,r)}function Xh(t){t.length||(m.error("No bundle found"),(0,mN.exit)(1));let e=new lr;e.theme=lr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,pa(r.created_at),r.keep!=null?r.keep:""])}),m.success("Bundles"),m.success(e.toString())}async function Zh(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),k.error("")),r}async function gN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(m.error(`App ${e} not found in database`),k.error("")),r.map(i=>i.version)}async function jae(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(m.error(`App Version ${e}@${r} doesn't exist`),k.error("")),n}async function Nae(t,e,r){for await(let n of t)m.warn(`Removing ${n.name} created on ${pa(n.created_at)}`),await Jh(e,r,n.name)}function Lae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);Pb(o,e)&&Oa(o,r)&&n.push(i)}),n}async function yN(t,e){Y("Cleanup versions in Capgo"),await ge(),e.apikey=e.apikey||he();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=t||o?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let s=await fe(e.apikey);await pe(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),m.info("Querying all available versions in Capgo");let a=await Zh(s,t),u=await gN(s,t);if(m.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){m.error("No versions found, aborting cleanup");return}if(r){let f=Bn(r),h=iN(f,"major");m.info(`Querying available versions in Capgo between ${Fa(f)} and ${Fa(h)}`),a=Lae(a,f,h),m.info(`Active versions in Capgo between ${Fa(f)} and ${Fa(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){m.warn("Nothing to be removed, aborting removal...");return}if(Xh(a),!i){let f=await Te({message:"Do you want to continue removing the versions specified?"});(qt(f)||!f)&&(m.warn("Not confirmed, aborting removal..."),(0,$b.exit)())}m.success("You have confirmed removal, removing versions now"),await Nae(c,s,t),X("Done \u2705"),(0,$b.exit)()}var sn=require("node:fs"),_N=require("node:process");var Mc=require("node:buffer"),Lt=require("node:crypto"),DN="aes-128-cbc",vN="sha256",Qh="base64",bN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function wN(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:bN,oaepHash:vN},Mc.Buffer.from(i,Qh)),s=Mc.Buffer.from(n,Qh),a=(0,Lt.createDecipheriv)(DN,o,s);return a.setAutoPadding(!0),Mc.Buffer.concat([a.update(t),a.final()])}function ep(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(DN,n,r);i.setAutoPadding(!0);let o=r.toString(Qh),s=(0,Lt.publicEncrypt)({key:e,padding:bN,oaepHash:vN},n).toString(Qh),a=`${o}:${s}`;return{encryptedData:Mc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function tp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function EN(t,e,r){Y("Decrypt zip file"),await ge(),(0,sn.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),k.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(tr)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${tr} or in ${n.path}`),k.error(""));let i=r.key||tr,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=wN(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,_N.exit)()}var an=require("node:fs"),FN=require("node:process");var ON=le(yu());var To=require("node:buffer"),Ot=require("node:crypto"),CN="aes-128-cbc",bi="base64",rp=Ot.constants.RSA_PKCS1_PADDING;function SN(t,e,r){let[n,i]=e.split(":"),o=(0,Ot.publicDecrypt)({key:r,padding:rp},To.Buffer.from(i,bi)),s=To.Buffer.from(n,bi),a=(0,Ot.createDecipheriv)(CN,o,s);return a.setAutoPadding(!0),To.Buffer.concat([a.update(t),a.final()])}function np(t,e){return(0,Ot.privateEncrypt)({key:e,padding:rp},To.Buffer.from(t,bi)).toString(bi)}function xN(t,e){return(0,Ot.publicDecrypt)({key:e,padding:rp},To.Buffer.from(t,bi)).toString(bi)}function ip(t,e){let r=(0,Ot.randomBytes)(16),n=(0,Ot.randomBytes)(16),i=(0,Ot.createCipheriv)(CN,n,r);i.setAutoPadding(!0);let o=r.toString(bi),s=(0,Ot.privateEncrypt)({key:e,padding:rp},n).toString(bi),a=`${o}:${s}`;return{encryptedData:To.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function AN(t,e,r){Y("Decrypt zip file"),await ge(),(0,an.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),k.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${jn} or in ${n.path}`),k.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=SN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),m.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,ON.checksum)(a,"sha256"),c=xN(r.checksum,r.keyData??o??"");u!==c?(m.error(`Checksum does not match ${u} !== ${c}`),k.error("")):m.info("Checksum matches")}X("\u2705 done"),(0,FN.exit)()}var kN=require("node:process");async function TN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||he();let n=await ee();e=e||n?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey);await pe(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(m.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),m.info(`Deleting bundle ${e}@${t} from Capgo`),m.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Jh(i,e,t),m.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,kN.exit)()}var wi=require("node:fs"),PN=require("node:process");async function RN(t,e){Y("Encryption"),await ge(),(0,wi.existsSync)(t)||(m.error(`Error: Zip not found at the path ${t}`),k.error(""));let r=e.key||cr,n=e.keyData||"";(0,wi.existsSync)(r)&&(n=(0,wi.readFileSync)(r).toString());let i=(0,wi.readFileSync)(t),o=ep(i,n);m.success(`ivSessionKey: ${o.ivSessionKey}`),(0,wi.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),m.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,PN.exit)()}var qn=require("node:fs"),$N=require("node:process");async function IN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await ge());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&m.warning("There is still a privateKey in the config"),(0,qn.existsSync)(t)||(n?console.error(Z({error:"zip_not_found"})):m.error(`Error: Zip not found at the path ${t}`),k.error("")),s||(n?console.error(Z({error:"missing_public_key"})):m.warning("Warning: Missing Public Key in config"),k.error(""));let a=r.key||ur,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Z({error:"missing_key"})):(m.warning(`Cannot find a private key at ${a} or as a keyData option`),m.error("Error: Missing key")),k.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Z({error:"invalid_private_key"})):m.error("the private key provided is not a valid RSA Private key"),k.error(""));let c=(0,qn.readFileSync)(t),l=ip(c,u),f=np(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(m.success(`Encoded Checksum: ${f}`),m.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(m.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,$N.exit)()}var jN=require("node:process");async function NN(t,e){Y("List bundles"),await ge(),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey);await pe(n,e.apikey,["write","all","read","upload"]),m.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Zh(n,t);m.info(`Active versions in Capgo: ${i?.length}`),Xh(i),X("Done \u2705"),(0,jN.exit)()}var tL=require("node:crypto"),cn=require("node:fs"),rL=require("node:process");function Uc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var op=32*1024,Ib=2**32-2,sp=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=Uc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return Uc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)Uc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Ib)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Ib));Uc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Ib)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var ap=class extends TransformStream{constructor(e){let r=new sp;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function _i(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let p=o();if(!p)return h;h.attributes[p.name]=p.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},up=class extends un{},cp=class extends un{},Mn=class extends un{},Po=class extends un{},Vc=class extends un{},Hc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function LN(t){try{let r=_i(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function BN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function qN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function Ro(t){return!(!Bae(t)||t.length===0)}function Bae(t){return!(typeof t!="string"||t.length>1024)}function lp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function $o(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function Nb(t){return t.get("x-amz-version-id")??null}function zc(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,5)+e.substr(14,2)+e.substr(17,2)+"Z"}function Lb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Bb(t,e){return`${Lb(e)}/${t}/s3/aws4_request`}async function fp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),lp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var qae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],dp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",p=a++;try{if(p==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:$o(w.headers.get("etag")??void 0),versionId:Nb(w.headers)};return}p===1&&(u=(await Mae({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let w of qae){let x=o[w];x&&(b[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:p.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:p,etag:x})}),l.push(g)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await Uae({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function Mae(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=_i(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function Uae({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
276
276
  <CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
277
277
  ${i.map(f=>` <Part><PartNumber>${f.part}</PartNumber><ETag>${f.etag}</ETag></Part>`).join(`
278
278
  `)}
279
279
  </CompleteMultipartUpload>
280
- `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=_i(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=Nb(s.headers);return{etag:$o(c),versionId:l}}var qb="AWS4-HMAC-SHA256";async function UN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new Vc("secretKey is required for signing");let e=t.headers.get("x-amz-content-sha256");if(e===null)throw new Error("Internal S3 client error - expected x-amz-content-sha256 header, but it's missing.");let r=HN(t.headers),n=zN(t.method,t.path,t.headers,r,e),i=await GN(n,t.date,t.region),o=await WN(t.date,t.region,t.secretKey),s=KN(t.accessKey,t.region,t.date),a=lp(await Aa(o,i)).toLowerCase();return`${qb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function VN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new Vc("secretKey is required for signing");if(t.expirySeconds<1)throw new Hc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Hc("expirySeconds cannot be greater than 7 days");if(!t.headers.has("Host"))throw new Error("Internal error: host header missing");let e=t.path.split("?")[0],r=t.path.split("?")[1],n=zc(t.date),i=HN(t.headers),o=KN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",qb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=zN(t.method,u,t.headers,i,s),l=await GN(c,t.date,t.region),f=await WN(t.date,t.region,t.secretKey),h=lp(await Aa(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function HN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var Io={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},Vae="-._~".split("").map(t=>t.charCodeAt(0));function Hae(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=Io.A&&i<=Io.Z||i>=Io.a&&i<=Io.z||i>=Io[0]&&i<=Io[9]||Vae.includes(i)||i==Io["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function zN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(Hae(s,!0)),u.push(a),u.push(o.join(`
280
+ `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=_i(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=Nb(s.headers);return{etag:$o(c),versionId:l}}var qb="AWS4-HMAC-SHA256";async function MN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new Vc("secretKey is required for signing");let e=t.headers.get("x-amz-content-sha256");if(e===null)throw new Error("Internal S3 client error - expected x-amz-content-sha256 header, but it's missing.");let r=VN(t.headers),n=HN(t.method,t.path,t.headers,r,e),i=await zN(n,t.date,t.region),o=await GN(t.date,t.region,t.secretKey),s=WN(t.accessKey,t.region,t.date),a=lp(await Aa(o,i)).toLowerCase();return`${qb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function UN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new Vc("secretKey is required for signing");if(t.expirySeconds<1)throw new Hc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Hc("expirySeconds cannot be greater than 7 days");if(!t.headers.has("Host"))throw new Error("Internal error: host header missing");let e=t.path.split("?")[0],r=t.path.split("?")[1],n=zc(t.date),i=VN(t.headers),o=WN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",qb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=HN(t.method,u,t.headers,i,s),l=await zN(c,t.date,t.region),f=await GN(t.date,t.region,t.secretKey),h=lp(await Aa(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function VN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var Io={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},Vae="-._~".split("").map(t=>t.charCodeAt(0));function Hae(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=Io.A&&i<=Io.Z||i>=Io.a&&i<=Io.z||i>=Io[0]&&i<=Io[9]||Vae.includes(i)||i==Io["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function HN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(Hae(s,!0)),u.push(a),u.push(o.join(`
281
281
  `)+`
282
282
  `),u.push(n.join(";").toLowerCase()),u.push(i),u.join(`
283
- `)}async function GN(t,e,r){let n=await fp(t),i=Bb(r,e),o=[];return o.push(qb),o.push(zc(e)),o.push(i),o.push(n),o.join(`
284
- `)}async function WN(t,e,r){let n=Lb(t),i=await Aa("AWS4"+r,n),o=await Aa(i,e),s=await Aa(o,"s3");return await Aa(s,"aws4_request")}function KN(t,e,r){return`${t}/${Bb(e,r)}`}async function Aa(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}var zae=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],Gae=5*1024*1024,Wae=5*1024*1024*1024,Mb=5*1024*1024*1024*1024,Gc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new up(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!qN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!MN(r))throw new cp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await fp(r??new Uint8Array);o.set("x-amz-date",zc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await UN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await BN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Po(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return VN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=_i(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(p=>p.name==="Contents"))f.push({type:"Object",key:d.children.find(p=>p.name==="Key")?.content??"",etag:$o(d.children.find(p=>p.name==="ETag")?.content??""),size:parseInt(d.children.find(p=>p.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(p=>p.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,p)=>{let b=d.type==="Object"?d.key:d.prefix,g=p.type==="Object"?p.key:p.prefix;return b>g?1:b<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(p=>p.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<Gae)throw new Or("Part size should be greater than 5MB");if(a>Wae)throw new Or("Part size should be less than 6MB");let u=new ap(a),c=new dp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Mb),e>Mb)throw new TypeError(`size should not be more than ${Mb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of zae)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:$o(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=_i(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:$o(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var Ub=fe(yu());var Ei=require("node:fs"),Wc=require("node:path");function Kae(t,e){return(0,Ei.readFileSync)(t,"utf8").includes(e)}function Kc(t,e){let r=(0,Ei.readdirSync)(t);for(let n of r){let i=(0,Wc.join)(t,n),o=(0,Ei.statSync)(i);if(o.isDirectory()){if(Kc(i,e))return!0}else if(o.isFile()&&(0,Wc.extname)(i)===".js"&&Kae(i,e))return!0}return!1}function Yc(t){let e=(0,Ei.readdirSync)(t);if(e.length===1){let n=(0,Wc.join)(t,e[0]);if((0,Ei.statSync)(n).isDirectory())return Yc(n)}return e.indexOf("index.html")>-1}var YN=require("node:fs"),JN=require("node:path"),XN=require("node:stream/consumers"),ZN=require("node:zlib");var QN=fe(Qy());async function eL(t,e,r,n){let i=ve();i.start("Generating the update manifest");let o=await uj(t);return i.stop("Manifest generated successfully"),await xe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}async function tL(t,e,r,n,i,o){let s=ve();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,JN.join)(r,h.file),p=(0,YN.createReadStream)(d).pipe((0,ZN.createBrotliCompress)()),b=await(0,XN.buffer)(p);return new Promise((g,w)=>{new QN.Upload(b,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${h.file}`},headers:{Authorization:t},onError(D){m.info(`Failed to upload ${h.file}: ${D}`),w(D)},onProgress(){let D=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${D}%`)},onSuccess(){c++,g({file_name:h.file,s3_path:`orgs/${o}/apps/${n}/${i}/${h.file}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${p} seconds)`),await xe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await xe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:p},notify:!1}),h}catch(h){let p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${p} seconds)`),m.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function Yae(t,e){let r=await jt(),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,rL.randomUUID)().split("-")[0]}`;return la.test(n)||(m.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n}function Jae(t){let e=t.apikey||he();return e||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e}function Xae(t,e,r){let n=t||r?.plugins?.CapacitorUpdater?.appId||r?.appId,i=e.path||r?.webDir;return(!n||!i)&&(m.error("Missing argument, you need to provide a appid and a path (--path), or be in a capacitor project"),k.error("")),(0,cn.existsSync)(i)||(m.error(`Path ${i} does not exist, build your app first, or provide a valid path`),k.error("")),{appid:n,path:i}}function Zae(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Kc(e,"notifyAppReady")||(m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Yc(e)||(m.error("index.html is missing in the root folder or in the only folder in the root folder"),k.error("")))}async function Qae(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=ve();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await Rh(t,i,n);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),m.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,m.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:D}=c.version;(!D||!la.test(D))&&(m.error("Invalid remote min update version, skipping auto setting compatibility"),k.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{m.error(`Cannot auto set compatibility, invalid data ${c}`),k.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(m.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await nb(),a&&(u=o,m.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(m.error("You need to provide a min-update-version to upload a bundle to this channel"),k.error("")),u&&(la.test(u)||(m.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),k.error("")));let p=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:p.size>0||!r.ignoreMetadataCheck?Array.from(p,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function eue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(m.warn(`WARNING !!
285
- Trial expires in ${n} days`),m.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function tue(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(m.error(`Version already exists ${Z(i)}`),k.error(""))}async function rue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Th(t);let f=ve();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ar))&&c!==!1?a=await(0,Ub.checksum)(u,"sha256"):a=await(0,Ub.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)m.info("Encryption ignored");else if((l||(0,cn.existsSync)(ar)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ar,p=e.keyDataV2||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find private key ${d}`),k.error("")),await xe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle with V2");let b=ip(u,p);a=np(a,p),s=b.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
283
+ `)}async function zN(t,e,r){let n=await fp(t),i=Bb(r,e),o=[];return o.push(qb),o.push(zc(e)),o.push(i),o.push(n),o.join(`
284
+ `)}async function GN(t,e,r){let n=Lb(t),i=await Aa("AWS4"+r,n),o=await Aa(i,e),s=await Aa(o,"s3");return await Aa(s,"aws4_request")}function WN(t,e,r){return`${t}/${Bb(e,r)}`}async function Aa(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}var zae=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],Gae=5*1024*1024,Wae=5*1024*1024*1024,Mb=5*1024*1024*1024*1024,Gc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new up(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!BN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!qN(r))throw new cp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await fp(r??new Uint8Array);o.set("x-amz-date",zc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await MN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await LN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Po(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return UN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=_i(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(p=>p.name==="Contents"))f.push({type:"Object",key:d.children.find(p=>p.name==="Key")?.content??"",etag:$o(d.children.find(p=>p.name==="ETag")?.content??""),size:parseInt(d.children.find(p=>p.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(p=>p.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,p)=>{let b=d.type==="Object"?d.key:d.prefix,g=p.type==="Object"?p.key:p.prefix;return b>g?1:b<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(p=>p.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<Gae)throw new Or("Part size should be greater than 5MB");if(a>Wae)throw new Or("Part size should be less than 6MB");let u=new ap(a),c=new dp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Mb),e>Mb)throw new TypeError(`size should not be more than ${Mb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of zae)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:$o(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=_i(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:$o(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var Ub=le(yu());var Ei=require("node:fs"),Wc=require("node:path");function Kae(t,e){return(0,Ei.readFileSync)(t,"utf8").includes(e)}function Kc(t,e){let r=(0,Ei.readdirSync)(t);for(let n of r){let i=(0,Wc.join)(t,n),o=(0,Ei.statSync)(i);if(o.isDirectory()){if(Kc(i,e))return!0}else if(o.isFile()&&(0,Wc.extname)(i)===".js"&&Kae(i,e))return!0}return!1}function Yc(t){let e=(0,Ei.readdirSync)(t);if(e.length===1){let n=(0,Wc.join)(t,e[0]);if((0,Ei.statSync)(n).isDirectory())return Yc(n)}return e.indexOf("index.html")>-1}var KN=require("node:fs"),YN=require("node:path"),JN=require("node:stream/consumers"),XN=require("node:zlib");var ZN=le(Qy());async function QN(t,e,r,n){let i=ve();i.start("Generating the update manifest");let o=await aj(t);return i.stop("Manifest generated successfully"),await xe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}async function eL(t,e,r,n,i,o){let s=ve();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,YN.join)(r,h.file),p=(0,KN.createReadStream)(d).pipe((0,XN.createBrotliCompress)()),b=await(0,JN.buffer)(p);return new Promise((g,w)=>{new ZN.Upload(b,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${h.file}`},headers:{Authorization:t},onError(D){m.info(`Failed to upload ${h.file}: ${D}`),w(D)},onProgress(){let D=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${D}%`)},onSuccess(){c++,g({file_name:h.file,s3_path:`orgs/${o}/apps/${n}/${i}/${h.file}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${p} seconds)`),await xe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await xe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:p},notify:!1}),h}catch(h){let p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${p} seconds)`),m.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function Yae(t,e){let r=await jt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,tL.randomUUID)().split("-")[0]}`;return la.test(n)||(m.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n}function Jae(t){let e=t.apikey||he();return e||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e}function Xae(t,e,r){let n=t||r?.plugins?.CapacitorUpdater?.appId||r?.appId,i=e.path||r?.webDir;return(!n||!i)&&(m.error("Missing argument, you need to provide a appid and a path (--path), or be in a capacitor project"),k.error("")),(0,cn.existsSync)(i)||(m.error(`Path ${i} does not exist, build your app first, or provide a valid path`),k.error("")),{appid:n,path:i}}function Zae(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Kc(e,"notifyAppReady")||(m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Yc(e)||(m.error("index.html is missing in the root folder or in the only folder in the root folder"),k.error("")))}async function Qae(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=ve();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await Rh(t,i,n,r.packageJson);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),m.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,m.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:D}=c.version;(!D||!la.test(D))&&(m.error("Invalid remote min update version, skipping auto setting compatibility"),k.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{m.error(`Cannot auto set compatibility, invalid data ${c}`),k.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(m.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await nb(r.packageJson),a&&(u=o,m.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(m.error("You need to provide a min-update-version to upload a bundle to this channel"),k.error("")),u&&(la.test(u)||(m.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),k.error("")));let p=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:p.size>0||!r.ignoreMetadataCheck?Array.from(p,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function eue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(m.warn(`WARNING !!
285
+ Trial expires in ${n} days`),m.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function tue(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(m.error(`Version already exists ${Z(i)}`),k.error(""))}async function rue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Th(t);let f=ve();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ur))&&c!==!1?a=await(0,Ub.checksum)(u,"sha256"):a=await(0,Ub.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)m.info("Encryption ignored");else if((l||(0,cn.existsSync)(ur)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ur,p=e.keyDataV2||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find private key ${d}`),k.error("")),await xe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle with V2");let b=ip(u,p);a=np(a,p),s=b.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
286
286
  keep it safe, you will need it to decrypt your bundle.
287
287
  It will be also visible in your dashboard
288
- `),u=b.encryptedData}else if(c||e.keyData||(0,cn.existsSync)(ur)){let d=typeof c=="string"?c:ur,p=e.keyData||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find public key ${d}`),k.error("")),await xe(n,{channel:"app",event:"App encryption",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle");let b=ep(u,p);s=b.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
288
+ `),u=b.encryptedData}else if(c||e.keyData||(0,cn.existsSync)(cr)){let d=typeof c=="string"?c:cr,p=e.keyData||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find public key ${d}`),k.error("")),await xe(n,{channel:"app",event:"App encryption",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle");let b=ep(u,p);s=b.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
289
289
  keep it safe, you will need it to decrypt your bundle.
290
290
  It will be also visible in your dashboard
291
291
  `),u=b.encryptedData}let h=Math.floor((u?.byteLength??0)/1024/1024);return h>X6&&(m.warn(`WARNING !!
292
292
  The app size is ${h} Mb, this may take a while to download for users
293
293
  `),m.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
294
- `),await xe(n,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:i,tags:{"app-id":o},notify:!1})),{zipped:u,sessionKey:s,checksum:a}}async function nue(t,e,r,n,i,o,s){let a=ve();a.start("Uploading Bundle");let u=performance.now(),c=!1;try{let h=await Cr();if(s.tus!==void 0&&s.tus){m.info("Uploading bundle with TUS protocol"),await rb(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Z(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}if(s.multipart!==void 0&&s.multipart){m.info("Uploading bundle with TUS protocol, multipart is deprecated"),await rb(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Z(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await sj(e,r,n);d||(m.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||Z6,retry:5,body:o})}}catch(h){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${p} seconds)`),h instanceof ei){let b=await h.response.json();m.error(`Response Error: ${b.error||b.status||b.message}`)}else m.error(`Cannot upload bundle ( try again with --tus option) ${Z(h)}`);await cj(e,r,n),k.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await xe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function iue(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(m.warn("Cannot get version id, cannot set channel"),k.error(""));let{error:l,data:f}=await Ph(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(m.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Z(l)}`),k.error(""));let h=wo(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?m.info("Your update is now available in your public channel \u{1F389}"):f?.id&&m.info(`Link device to this bundle to try it: ${d}`),r?m.info(`Bundle url: ${d}`):c||(m.warn("Cannot set bundle with upload key, use key with more rights for that"),k.error(""))}async function oue(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){m.warn("Cannot find default upload channel");let o=wo(t);return m.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function hp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await ge();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=Jae(e),h=await ee(),d=await ej(),{appid:p,path:b}=Xae(t,e,h.config),g=await Yae(h.config,e);Zae(e,b),m.info(`Upload ${p}@${g} started from path "${b}" to Capgo cloud`);let w=await Cr(),x=await le(f),D=await pe(x,f,["write","all","upload"]),C=e.channel||await oue(p,x,w.hostWeb)||"dev",A=await Sr(x,p);await fa(x,A,f,p,!0),await eue(x,A,w);let{nativePackages:$,minUpdateVersion:F}=await Qae(x,n,e,C,p,g);await tue(x,p,g),e.external&&!e.external.startsWith("https://")&&(m.error(`External link should should start with "https://" current is "${e.external}"`),k.error(""));let L={name:g,app_id:p,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:A,user_id:D,checksum:void 0},S=null;if(e.external)await xe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:A,tags:{"app-id":p},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await rue(b,e,w,f,A,p);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await fj(x,p,C,M)}d.TUSUpload?e.tus=e.tus||d.TUSUploadForced:e.tus=!1,d.partialUpload?e.partial=e.partial||d.partialUploadForced:e.partial=!1;let I=e.partial?await eL(b,f,A,p):[],{error:R}=await tb(x,L);if(R&&(m.error(`Cannot add bundle ${Z(R)}`),k.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(m.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),k.error("")),m.info("Uploading to S3");let q=new Gc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${p}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await nue(f,x,p,g,A,S,e);let q=null;try{q=e.partial?await tL(f,I,b,p,g,A):null}catch(M){m.info(`Failed to upload partial files to capgo cloud. Error: ${Z(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await tb(x,L);K&&(m.error(`Cannot update bundle ${Z(K)}`),k.error(""))}let B=await qe(x,f,p,2);return tj(B,3)?await iue(x,f,!!e.bundleUrl,g,C,D,A,p,w):m.warn("Cannot set channel as a upload organization member"),await xe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:A,tags:{"app-id":p},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,nL.exit)()),!0}async function iL(t,e){try{await hp(t,e,!0)}catch(r){m.error(Z(r)),k.error("")}}async function oL(t,e){let r=Nt();m.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{await hp(t,e,!0)}catch(n){m.error(Z(n)),k.error("")}}var sL=require("node:crypto"),pp=require("node:fs"),aL=require("node:process");var Vb=fe(yu());var sue=20;async function uL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await ge();let o=await ee();t=t||o?.config?.appId;let s=(0,sL.randomUUID)().split("-")[0],a=await jt();r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!la.test(r)&&(i?console.error(Z({error:"invalid_semver"})):m.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Z({error:"missing_argument"})):m.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),k.error("")),i||m.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Kc(n,"notifyAppReady")||(i?console.error(Z({error:"notifyAppReady_not_in_source_code"})):m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Yc(n)||(i?console.error(Z({error:"index_html_not_found"})):m.error("index.html is missing in the root folder or in the only folder in the root folder"),k.error("")));let c=await Th(n);i||m.info(`Zipped ${c.byteLength} bytes`);let l=ve();i||l.start("Calculating checksum");let f="";e.keyV2||(0,pp.existsSync)(ar)?f=await(0,Vb.checksum)(c,"sha256"):f=await(0,Vb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>sue&&!i&&(m.warn(`WARNING !!
294
+ `),await xe(n,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:i,tags:{"app-id":o},notify:!1})),{zipped:u,sessionKey:s,checksum:a}}async function nue(t,e,r,n,i,o,s){let a=ve();a.start("Uploading Bundle");let u=performance.now(),c=!1;try{let h=await Cr();if(s.tus!==void 0&&s.tus){m.info("Uploading bundle with TUS protocol"),await rb(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Z(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}if(s.multipart!==void 0&&s.multipart){m.info("Uploading bundle with TUS protocol, multipart is deprecated"),await rb(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Z(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await oj(e,r,n);d||(m.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||Z6,retry:5,body:o})}}catch(h){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${p} seconds)`),h instanceof ei){let b=await h.response.json();m.error(`Response Error: ${b.error||b.status||b.message}`)}else m.error(`Cannot upload bundle ( try again with --tus option) ${Z(h)}`);await uj(e,r,n),k.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await xe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function iue(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(m.warn("Cannot get version id, cannot set channel"),k.error(""));let{error:l,data:f}=await Ph(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(m.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Z(l)}`),k.error(""));let h=wo(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?m.info("Your update is now available in your public channel \u{1F389}"):f?.id&&m.info(`Link device to this bundle to try it: ${d}`),r?m.info(`Bundle url: ${d}`):c||(m.warn("Cannot set bundle with upload key, use key with more rights for that"),k.error(""))}async function oue(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){m.warn("Cannot find default upload channel");let o=wo(t);return m.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function hp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await ge();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=Jae(e),h=await ee(),d=await Q6(),{appid:p,path:b}=Xae(t,e,h.config),g=await Yae(h.config,e);Zae(e,b),m.info(`Upload ${p}@${g} started from path "${b}" to Capgo cloud`);let w=await Cr(),x=await fe(f),D=await pe(x,f,["write","all","upload"]),C=e.channel||await oue(p,x,w.hostWeb)||"dev",A=await Sr(x,p);await fa(x,A,f,p,!0),await eue(x,A,w);let{nativePackages:$,minUpdateVersion:F}=await Qae(x,n,e,C,p,g);await tue(x,p,g),e.external&&!e.external.startsWith("https://")&&(m.error(`External link should should start with "https://" current is "${e.external}"`),k.error(""));let L={name:g,app_id:p,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:A,user_id:D,checksum:void 0},S=null;if(e.external)await xe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:A,tags:{"app-id":p},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await rue(b,e,w,f,A,p);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await lj(x,p,C,M)}d.TUSUpload?e.tus=e.tus||d.TUSUploadForced:e.tus=!1,d.partialUpload?e.partial=e.partial||d.partialUploadForced:e.partial=!1;let I=e.partial?await QN(b,f,A,p):[],{error:R}=await tb(x,L);if(R&&(m.error(`Cannot add bundle ${Z(R)}`),k.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(m.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),k.error("")),m.info("Uploading to S3");let q=new Gc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${p}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await nue(f,x,p,g,A,S,e);let q=null;try{q=e.partial?await eL(f,I,b,p,g,A):null}catch(M){m.info(`Failed to upload partial files to capgo cloud. Error: ${Z(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await tb(x,L);K&&(m.error(`Cannot update bundle ${Z(K)}`),k.error(""))}let B=await qe(x,f,p,2);return ej(B,3)?await iue(x,f,!!e.bundleUrl,g,C,D,A,p,w):m.warn("Cannot set channel as a upload organization member"),await xe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:A,tags:{"app-id":p},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,rL.exit)()),!0}async function nL(t,e){try{await hp(t,e,!0)}catch(r){m.error(Z(r)),k.error("")}}async function iL(t,e){let r=Nt();m.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{await hp(t,e,!0)}catch(n){m.error(Z(n)),k.error("")}}var oL=require("node:crypto"),pp=require("node:fs"),sL=require("node:process");var Vb=le(yu());var sue=20;async function aL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await ge();let o=await ee();t=t||o?.config?.appId;let s=(0,oL.randomUUID)().split("-")[0],a=await jt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!la.test(r)&&(i?console.error(Z({error:"invalid_semver"})):m.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Z({error:"missing_argument"})):m.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),k.error("")),i||m.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Kc(n,"notifyAppReady")||(i?console.error(Z({error:"notifyAppReady_not_in_source_code"})):m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Yc(n)||(i?console.error(Z({error:"index_html_not_found"})):m.error("index.html is missing in the root folder or in the only folder in the root folder"),k.error("")));let c=await Th(n);i||m.info(`Zipped ${c.byteLength} bytes`);let l=ve();i||l.start("Calculating checksum");let f="";e.keyV2||(0,pp.existsSync)(ur)?f=await(0,Vb.checksum)(c,"sha256"):f=await(0,Vb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>sue&&!i&&(m.warn(`WARNING !!
295
295
  The app size is ${h} Mb, this may take a while to download for users
296
296
  `),m.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
297
- `));let d=ve(),p=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${p}`),(0,pp.writeFileSync)(p,c),i||d.stop(`Saved to ${p}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:p,checksum:f},null,2)),(0,aL.exit)()}catch(r){m.error(Z(r)),k.error("")}}var cL=require("node:process");async function Hb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||he();let i=await ee();e=e||i?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await le(r.apikey);await pe(o,r.apikey,["write","all"]),await qe(o,r.apikey,e,4),m.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await Rb(o,e),a=await Sr(o,e);s||(m.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),k.error(""));let u=await lN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(m.error(`Cannot create Channel \u{1F640}
298
- ${Z(u.error)}`),k.error("")),m.success("Channel created \u2705"),await xe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return m.error("Cannot create Channel \u{1F640}"),!1}return n&&(X("Done \u2705"),(0,cL.exit)()),!0}async function lL(t,e,r){Hb(t,e,r,!0)}var fL=require("node:process");async function dL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||he(n);let i=await ee();e=e||i?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await le(r.apikey),s=await pe(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(m.error("Please provide a channel to get the bundle from."),k.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error(""));let{version:c}=a[0];c||(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error("")),n?m.info(c.name):m.info(`Current bundle for channel ${t} is ${c.name}`),(0,fL.exit)()}var hL=require("node:process");async function pL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||he();let n=await ee();e=e||n?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await le(r.apikey),o=await pe(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4),m.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await fN(i,t,e,o);s.error&&(m.error(`Cannot delete Channel \u{1F640} ${Z(s.error)}`),k.error(""));let a=await Sr(i,e);m.success("Channel deleted"),await xe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{m.error("Cannot delete Channel \u{1F640}")}X("Done \u2705"),(0,hL.exit)()}var mL=require("node:process");async function gL(t,e){Y("List channels"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||m.error("Missing API key, you need to provide a API key to upload your bundle"),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await le(e.apikey),i=await pe(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),m.info("Querying available channels in Capgo");let o=await hN(n,t);m.info(`Active channels in Capgo: ${o?.length}`),dN(o),await xe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,mL.exit)()}var DL=require("node:process");var yL=["major","minor","metadata","patch","none"];async function vL(t,e,r){Y("Set channel"),r.apikey=r.apikey||he();let n=await ee();e=e||n?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await le(r.apikey),o=await pe(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:p,disableAutoUpdate:b,dev:g,emulator:w}=r;t||(m.error("Missing argument, you need to provide a channel"),k.error("")),l&&a&&(m.error("Cannot set latest and bundle at the same time"),k.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&p==null&&g==null&&w==null&&b==null&&(m.error("Missing argument, you need to provide a option to set"),k.error(""));try{await fa(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},D=await jt(),C=l?n?.config?.plugins?.CapacitorUpdater?.version||D?.version:a;if(C!=null){let{data:A,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!A)&&(m.error(`Cannot find version ${C}`),k.error("")),m.info(`Set ${e} channel: ${t} to @${C}`),x.version=A.id}if(u!=null&&((u==="public"||u==="private")&&m.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),m.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),x.public=u==="public"||u==="default"),c!=null&&(m.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(m.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(m.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),p!=null&&(m.info(`Set ${e} channel: ${t} to ${p?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!p),b!=null){let A=b.toLocaleLowerCase();yL.includes(A)||(m.error(`Channel strategy ${A} is not known. The possible values are: ${yL.join(", ")}.`),k.error("")),A==="metadata"&&(A="version_number"),x.disable_auto_update=A,m.info(`Set ${e} channel: ${t} to ${A} disable update strategy to this channel`)}try{let{error:A}=await Ph(i,x);A&&(m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error(""))}catch{m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error("")}await xe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){m.error(`Unknow error ${Z(x)}`),k.error("")}X("Done \u2705"),(0,DL.exit)()}var Xc=require("node:child_process"),at=require("node:fs"),yp=require("node:path"),fr=require("node:process");var Dp=fe(IL());var Zb=require("node:process");function Eue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await xe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function Cue(t,e,r,n){qt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,Zb.exit)())}async function Sue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){m.error(`Cannot get stats ${Z(n)}`)}return[]}async function xue(t,e,r,n,i,o){if(m.info(`Log from Device: ${t.device_id}`),t.action==="get")m.info("Update Sent your your device, wait until event download complete"),await Hn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(m.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Hn(e,r,n,"downloaded")):s==="fail"?(m.error("Your bundle has failed to download on your device."),m.error("Please check if you have network connection and try again")):m.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return m.info("Your bundle has been set on your device \u2764\uFE0F"),await Hn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?m.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?m.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?m.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(m.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
297
+ `));let d=ve(),p=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${p}`),(0,pp.writeFileSync)(p,c),i||d.stop(`Saved to ${p}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:p,checksum:f},null,2)),(0,sL.exit)()}catch(r){m.error(Z(r)),k.error("")}}var uL=require("node:process");async function Hb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||he();let i=await ee();e=e||i?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey);await pe(o,r.apikey,["write","all"]),await qe(o,r.apikey,e,4),m.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await Rb(o,e),a=await Sr(o,e);s||(m.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),k.error(""));let u=await cN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(m.error(`Cannot create Channel \u{1F640}
298
+ ${Z(u.error)}`),k.error("")),m.success("Channel created \u2705"),await xe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return m.error("Cannot create Channel \u{1F640}"),!1}return n&&(X("Done \u2705"),(0,uL.exit)()),!0}async function cL(t,e,r){Hb(t,e,r,!0)}var lL=require("node:process");async function fL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||he(n);let i=await ee();e=e||i?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey),s=await pe(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(m.error("Please provide a channel to get the bundle from."),k.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error(""));let{version:c}=a[0];c||(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error("")),n?m.info(c.name):m.info(`Current bundle for channel ${t} is ${c.name}`),(0,lL.exit)()}var dL=require("node:process");async function hL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||he();let n=await ee();e=e||n?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await pe(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4),m.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await lN(i,t,e,o);s.error&&(m.error(`Cannot delete Channel \u{1F640} ${Z(s.error)}`),k.error(""));let a=await Sr(i,e);m.success("Channel deleted"),await xe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{m.error("Cannot delete Channel \u{1F640}")}X("Done \u2705"),(0,dL.exit)()}var pL=require("node:process");async function mL(t,e){Y("List channels"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId,e.apikey||m.error("Missing API key, you need to provide a API key to upload your bundle"),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await pe(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),m.info("Querying available channels in Capgo");let o=await dN(n,t);m.info(`Active channels in Capgo: ${o?.length}`),fN(o),await xe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,pL.exit)()}var yL=require("node:process");var gL=["major","minor","metadata","patch","none"];async function DL(t,e,r){Y("Set channel"),r.apikey=r.apikey||he();let n=await ee();e=e||n?.config?.appId,r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await pe(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:p,disableAutoUpdate:b,dev:g,emulator:w}=r;t||(m.error("Missing argument, you need to provide a channel"),k.error("")),l&&a&&(m.error("Cannot set latest and bundle at the same time"),k.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&p==null&&g==null&&w==null&&b==null&&(m.error("Missing argument, you need to provide a option to set"),k.error(""));try{await fa(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},D=await jt("",r.packageJson),C=l?n?.config?.plugins?.CapacitorUpdater?.version||D?.version:a;if(C!=null){let{data:A,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!A)&&(m.error(`Cannot find version ${C}`),k.error("")),m.info(`Set ${e} channel: ${t} to @${C}`),x.version=A.id}if(u!=null&&((u==="public"||u==="private")&&m.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),m.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),x.public=u==="public"||u==="default"),c!=null&&(m.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(m.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(m.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),p!=null&&(m.info(`Set ${e} channel: ${t} to ${p?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!p),b!=null){let A=b.toLocaleLowerCase();gL.includes(A)||(m.error(`Channel strategy ${A} is not known. The possible values are: ${gL.join(", ")}.`),k.error("")),A==="metadata"&&(A="version_number"),x.disable_auto_update=A,m.info(`Set ${e} channel: ${t} to ${A} disable update strategy to this channel`)}try{let{error:A}=await Ph(i,x);A&&(m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error(""))}catch{m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error("")}await xe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){m.error(`Unknow error ${Z(x)}`),k.error("")}X("Done \u2705"),(0,yL.exit)()}var Xc=require("node:child_process"),at=require("node:fs"),yp=require("node:path"),dr=require("node:process");var Dp=le($L());var Zb=require("node:process");function Eue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await xe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function Cue(t,e,r,n){qt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,Zb.exit)())}async function Sue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){m.error(`Cannot get stats ${Z(n)}`)}return[]}async function xue(t,e,r,n,i,o){if(m.info(`Log from Device: ${t.device_id}`),t.action==="get")m.info("Update Sent your your device, wait until event download complete"),await Hn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(m.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Hn(e,r,n,"downloaded")):s==="fail"?(m.error("Your bundle has failed to download on your device."),m.error("Please check if you have network connection and try again")):m.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return m.info("Your bundle has been set on your device \u2764\uFE0F"),await Hn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?m.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?m.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?m.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(m.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
299
299
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
300
300
  - Android: versionName
301
301
  Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disablePlatformIos"?m.error(`iOS is disabled in the default channel and your device ${t.device_id} is an iOS device ${i}`):t.action==="disablePlatformAndroid"?m.error(`Android is disabled in the default channel and your device ${t.device_id} is an Android device ${i}`):t.action==="disableAutoUpdateToMajor"?(m.error(`The version number you uploaded to your default channel in Capgo, is a major version higher (ex: 1.0.0 in device to 2.0.0 in Capgo) than the present in the device ${t.device_id}.`),m.error("Capgo is set by default to protect you from this, and avoid sending breaking changes incompatible with the native code present in the device."),m.error(`To fix it, ensure the variable:
@@ -304,28 +304,28 @@ ${Z(u.error)}`),k.error("")),m.success("Channel created \u2705"),await xe(r.apik
304
304
  Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableAutoUpdateUnderNative"?(m.error(`The version number you uploaded to your default channel in Capgo, is lower than the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
305
305
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
306
306
  - Android: versionName
307
- Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(m.error(`Dev build is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(m.error(`Emulator is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(m.error(`We cannot get your bundle from the default channel. ${i}`),m.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?m.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?m.error("Your device has been reset to the builtin bundle, did notifyAppReady() is present in the code builded and uploaded to Capgo ?"):t.action==="update_fail"?(m.error("Your bundle has been installed but failed to call notifyAppReady()"),m.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?m.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):m.error(`Log from Capgo ${t.action}`)}return!0}async function Qb(t,e,r,n,i){let o=!0,s=wo(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=ve();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Eue(5e3);let h=await Sue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await xue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function jL(t,e){Y("Debug Live update in Capgo"),await ge(),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId;let n=e.device;e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await le(e.apikey),o=await Sr(i,t),s=await Te({message:"Automatic check if update working in device ?"});await Cue("debug",s,o,e.apikey),s?(m.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await Qb("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,Zb.exit)()}var Bt=require("node:fs");async function Fue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(m)m.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(m)m.error("the public key provided is not a valid RSA Public key"),k.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(m.success(`public key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function Oue(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(tr))try{(0,Bt.unlinkSync)(tr),e&&m.success(`Old private key file deleted: ${tr}`)}catch{e&&m.error(`Failed to delete old private key file: ${tr}`)}if((0,Bt.existsSync)(ur))try{(0,Bt.unlinkSync)(ur),e&&m.success(`Old public key file deleted: ${ur}`)}catch{e&&m.error(`Failed to delete old public key file: ${jn}`)}return e&&m.success(`Old private key deleted from ${r.path} file`),!0}else return e&&m.info("No old private key found in config file"),!1}async function NL(t){Y("Save keys \u{1F511}"),await ge(),await Fue(t)}async function ew(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,Bt.existsSync)(jn)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ar)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,Bt.writeFileSync)(ar,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),m&&(m.success("Your RSA key has been generated"),m.success(`Private key saved in ${ar}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Public key saved in ${i.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function LL(t){await ge(),await ew(t)}async function BL(t){await ge(),await Oue(t)}var zn=require("node:fs"),rw=require("node:os"),tw=require("node:process");async function qL(){let t=(0,rw.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function nw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),!1;await ge();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(m.error("To use local you should be in a git repository"),k.error("")),(0,zn.writeFileSync)(".capgo",`${t}
307
+ Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(m.error(`Dev build is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(m.error(`Emulator is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(m.error(`We cannot get your bundle from the default channel. ${i}`),m.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?m.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?m.error("Your device has been reset to the builtin bundle, did notifyAppReady() is present in the code builded and uploaded to Capgo ?"):t.action==="update_fail"?(m.error("Your bundle has been installed but failed to call notifyAppReady()"),m.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?m.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):m.error(`Log from Capgo ${t.action}`)}return!0}async function Qb(t,e,r,n,i){let o=!0,s=wo(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=ve();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Eue(5e3);let h=await Sue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await xue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function IL(t,e){Y("Debug Live update in Capgo"),await ge(),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId;let n=e.device;e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey),o=await Sr(i,t),s=await Te({message:"Automatic check if update working in device ?"});await Cue("debug",s,o,e.apikey),s?(m.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await Qb("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,Zb.exit)()}var Bt=require("node:fs");async function Fue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(m)m.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(m)m.error("the public key provided is not a valid RSA Public key"),k.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(m.success(`public key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function Oue(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(tr))try{(0,Bt.unlinkSync)(tr),e&&m.success(`Old private key file deleted: ${tr}`)}catch{e&&m.error(`Failed to delete old private key file: ${tr}`)}if((0,Bt.existsSync)(cr))try{(0,Bt.unlinkSync)(cr),e&&m.success(`Old public key file deleted: ${cr}`)}catch{e&&m.error(`Failed to delete old public key file: ${jn}`)}return e&&m.success(`Old private key deleted from ${r.path} file`),!0}else return e&&m.info("No old private key found in config file"),!1}async function jL(t){Y("Save keys \u{1F511}"),await ge(),await Fue(t)}async function ew(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,Bt.existsSync)(jn)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ur)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,Bt.writeFileSync)(ur,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),m&&(m.success("Your RSA key has been generated"),m.success(`Private key saved in ${ur}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Public key saved in ${i.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function NL(t){await ge(),await ew(t)}async function LL(t){await ge(),await Oue(t)}var zn=require("node:fs"),rw=require("node:os"),tw=require("node:process");async function BL(){let t=(0,rw.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function nw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),!1;await ge();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(m.error("To use local you should be in a git repository"),k.error("")),(0,zn.writeFileSync)(".capgo",`${t}
308
308
  `),(0,zn.appendFileSync)(".gitignore",`.capgo
309
309
  `);else{let s=(0,rw.homedir)();(0,zn.writeFileSync)(`${s}/.capgo`,`${t}
310
- `)}let i=await le(t),o=await pe(i,t,["write","all","upload"]);await xe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),m.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{m.error("Error while saving login"),(0,tw.exit)(1)}return r&&(X("Done \u2705"),(0,tw.exit)()),!0}async function ML(t,e){nw(t,e,!0)}var UL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",gp="CapacitorUpdater.notifyAppReady()",Aue=/import.*from.*/g,Jc="production",VL={stdio:"pipe"},Pa;function HL(){Pa||(Pa=(0,at.readdirSync)(Dp.default.tmpdir).map(t=>({name:t,full:`${Dp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??Dp.default.fileSync({prefix:"capgocli"}).name)}function Ci(t){try{HL(),(0,at.writeFileSync)(Pa,JSON.stringify({step_done:t}))}catch(e){m.error(`Cannot mark step as done in the CLI, error:
311
- ${e}`),m.warn("Onboarding will continue but please report it to the capgo team!")}}async function kue(t,e){try{HL();let r=(0,at.readFileSync)(Pa,"utf-8");if(!r||r.length===0)return;let{step_done:n}=JSON.parse(r);m.info(`You have already got to the step ${n}/10 in the previous session`);let i=await Te({message:"Would you like to continue from where you left off?"});return await fn(i,t,e),i?n:void 0}catch(r){m.error(`Cannot read which steps have been compleated, error:
310
+ `)}let i=await fe(t),o=await pe(i,t,["write","all","upload"]);await xe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),m.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{m.error("Error while saving login"),(0,tw.exit)(1)}return r&&(X("Done \u2705"),(0,tw.exit)()),!0}async function qL(t,e){nw(t,e,!0)}var ML="import { CapacitorUpdater } from '@capgo/capacitor-updater'",gp="CapacitorUpdater.notifyAppReady()",Aue=/import.*from.*/g,Jc="production",UL={stdio:"pipe"},Pa;function VL(){Pa||(Pa=(0,at.readdirSync)(Dp.default.tmpdir).map(t=>({name:t,full:`${Dp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??Dp.default.fileSync({prefix:"capgocli"}).name)}function Ci(t){try{VL(),(0,at.writeFileSync)(Pa,JSON.stringify({step_done:t}))}catch(e){m.error(`Cannot mark step as done in the CLI, error:
311
+ ${e}`),m.warn("Onboarding will continue but please report it to the capgo team!")}}async function kue(t,e){try{VL();let r=(0,at.readFileSync)(Pa,"utf-8");if(!r||r.length===0)return;let{step_done:n}=JSON.parse(r);m.info(`You have already got to the step ${n}/10 in the previous session`);let i=await Te({message:"Would you like to continue from where you left off?"});return await fn(i,t,e),i?n:void 0}catch(r){m.error(`Cannot read which steps have been compleated, error:
312
312
  ${r}`),m.warn("Onboarding will continue but please report it to the capgo team!");return}}function Tue(){if(Pa)try{(0,at.rmSync)(Pa)}catch(t){m.error(`Cannot delete the tmp steps file.
313
- Error: ${t}`)}}async function fn(t,e,r){qt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,fr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Pue(t,e,r,n){let i=Nt(),o=await Te({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=ve();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await Eb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else m.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await $r(t.gid,e,2)}async function Rue(t,e,r){let n=Nt(),i=await Te({message:`Create default channel ${Jc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Jc} ${r} --default`),await Hb(Jc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else m.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Jc} ${r} --default"`);await $r(t,e,3)}var $ue="https://capacitorjs.com/docs/updating/6-0",Iue="https://capacitorjs.com/docs/updating/5-0";async function jue(t,e,r){let n=Nt(),i=await Te({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=ve();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?Oa(u,Bn("5.0.0"))?(o.stop("Error"),m.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Iue}`),X("Bye \u{1F44B}"),(0,fr.exit)()):Oa(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${$ue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),m.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,fr.exit)()),n.pm==="unknown"&&(o.stop("Error"),m.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,fr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,Xc.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,VL);let c=await jt();await kh({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else m.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await $r(t,e,4)}async function Nue(t,e,r){let n=await Te({message:`Automatic Add "${gp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=ve();i.start("Adding @capacitor-updater to your main file");let o=await eb();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,yp.join)("plugins");(0,at.existsSync)(s)||(0,at.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,yp.join)(s,"capacitorUpdater.client.ts"):a=(0,yp.join)(s,"capacitorUpdater.client.js");let u=`
313
+ Error: ${t}`)}}async function fn(t,e,r){qt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,dr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Pue(t,e,r,n){let i=Nt(),o=await Te({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=ve();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await Eb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else m.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await $r(t.gid,e,2)}async function Rue(t,e,r){let n=Nt(),i=await Te({message:`Create default channel ${Jc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Jc} ${r} --default`),await Hb(Jc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else m.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Jc} ${r} --default"`);await $r(t,e,3)}var $ue="https://capacitorjs.com/docs/updating/6-0",Iue="https://capacitorjs.com/docs/updating/5-0";async function jue(t,e,r){let n=Nt(),i=await Te({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=ve();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?Oa(u,Bn("5.0.0"))?(o.stop("Error"),m.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Iue}`),X("Bye \u{1F44B}"),(0,dr.exit)()):Oa(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${$ue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),m.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,dr.exit)()),n.pm==="unknown"&&(o.stop("Error"),m.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,dr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,Xc.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,UL);let c=await jt();await kh({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else m.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await $r(t,e,4)}async function Nue(t,e,r){let n=await Te({message:`Automatic Add "${gp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=ve();i.start("Adding @capacitor-updater to your main file");let o=await eb();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,yp.join)("plugins");(0,at.existsSync)(s)||(0,at.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,yp.join)(s,"capacitorUpdater.client.ts"):a=(0,yp.join)(s,"capacitorUpdater.client.js");let u=`
314
314
  import { CapacitorUpdater } from '@capgo/capacitor-updater'
315
315
 
316
316
  export default defineNuxtPlugin(() => {
317
317
  CapacitorUpdater.notifyAppReady()
318
318
  })
319
- `;(0,at.existsSync)(a)?(0,at.readFileSync)(a,"utf8").includes("CapacitorUpdater.notifyAppReady()")?(i.stop("Code already added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Plugins directory and capacitorUpdater.client.ts file already exist with required code")):((0,at.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Updated capacitorUpdater.client.ts file with required code")):((0,at.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Created plugins directory and capacitorUpdater.client.ts file"))}else{let s;if(o==="unknown")s=await oj();else{let f=o.endsWith("-ts");s=await nj(o,f)}if(!s||!(0,at.existsSync)(s)){i.stop("Cannot find main file to install Updater plugin");let f=await Mw({message:"Provide the correct relative path to your main file:",validate:h=>{if(!(0,at.existsSync)(h))return"File does not exist. Please provide a valid path."}});qt(f)&&(Uw("Operation cancelled."),(0,fr.exit)(1)),s=f}let u=(0,at.readFileSync)(s,"utf8").toString(),l=u.match(Aue)?.pop();if(l||(i.stop("Error"),m.warn("Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/cloud-mode/auto-update/"),X("Bye \u{1F44B}"),(0,fr.exit)()),u.includes(gp))i.stop(`Code already added to ${s} \u2705`);else{let f=u.replace(l,`${l}
320
- ${UL};
319
+ `;(0,at.existsSync)(a)?(0,at.readFileSync)(a,"utf8").includes("CapacitorUpdater.notifyAppReady()")?(i.stop("Code already added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Plugins directory and capacitorUpdater.client.ts file already exist with required code")):((0,at.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Updated capacitorUpdater.client.ts file with required code")):((0,at.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Created plugins directory and capacitorUpdater.client.ts file"))}else{let s;if(o==="unknown")s=await ij();else{let f=o.endsWith("-ts");s=await rj(o,f)}if(!s||!(0,at.existsSync)(s)){i.stop("Cannot find main file to install Updater plugin");let f=await Mw({message:"Provide the correct relative path to your main file:",validate:h=>{if(!(0,at.existsSync)(h))return"File does not exist. Please provide a valid path."}});qt(f)&&(Uw("Operation cancelled."),(0,dr.exit)(1)),s=f}let u=(0,at.readFileSync)(s,"utf8").toString(),l=u.match(Aue)?.pop();if(l||(i.stop("Error"),m.warn("Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/cloud-mode/auto-update/"),X("Bye \u{1F44B}"),(0,dr.exit)()),u.includes(gp))i.stop(`Code already added to ${s} \u2705`);else{let f=u.replace(l,`${l}
320
+ ${ML};
321
321
 
322
322
  ${gp};
323
323
  `);(0,at.writeFileSync)(s,f,"utf8"),i.stop(`Code added to ${s} \u2705`)}}await $r(t,e,5)}else m.info(`Add to your main file the following code:
324
324
 
325
- ${UL};
325
+ ${ML};
326
326
 
327
327
  ${gp};
328
- `)}async function Lue(t,e,r){let n=Nt(),i=await Te({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await ew({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),m.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,fr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Bue(t,e,r){let n=Nt(),i=await Te({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=ve(),s=await eb(),a=await ij(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),m.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,fr.exit)()),(0,Xc.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,VL),o.stop("Build & Sync Done \u2705")}else m.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function que(t,e,r){let n=Nt(),i=await Te({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await hp(r,{channel:Jc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),m.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,fr.exit)())}else m.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function Mue(t,e){let r=Nt(),n=await Te({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await Bo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});qt(i)&&(X("Bye \u{1F44B}"),(0,fr.exit)());let o=i,s=ve();s.start(`Running: ${r.runner} cap run ${o}`),await(0,Xc.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else m.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await $r(t,e,9)}async function Uue(t,e,r,n){let i=await Te({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)m.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await Qb("onboarding-v2",e,r,e,t);else{let o=wo(r);m.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function zL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await ge();let i=await ee(),o=await Cr();e=e||i?.config?.appId,r.apikey=t||he();let s=ve();(!qL()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await nw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await le(r.apikey);await pe(a,r.apikey,["upload","all","read","write"]);let u=await ha(a,["admin","super_admin"]),c=u.gid,l=await kue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await Pue(u,r.apikey,e,r),Ci(2)),l<3&&(await Rue(c,r.apikey,e),Ci(3)),l<4&&(await jue(c,r.apikey,e),Ci(4)),l<5&&(await Nue(c,r.apikey,e),Ci(5)),l<6&&(await Lue(c,r.apikey,e),Ci(6)),l<7&&(await Bue(c,r.apikey,e),Ci(7)),l<8&&(await que(c,r.apikey,e),Ci(8)),l<9&&(await Mue(c,r.apikey),Ci(9)),await Uue(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),Tue()}catch(f){console.error(f),m.error("Error during onboarding, please try again later"),(0,fr.exit)(1)}m.info("Welcome onboard \u2708\uFE0F!"),m.info("Your Capgo update system is setup"),m.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),m.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,fr.exit)()}var dn=require("node:fs");async function Vue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||tr,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)m.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),m&&(m.success(`private key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function GL(t){Y("Save keys \u{1F511}"),await ge(),await Vue(t)}async function Hue(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,dn.existsSync)(ur)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,dn.writeFileSync)(ur,r),(0,dn.existsSync)(tr)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,dn.writeFileSync)(tr,n);let i=n.replace(/\\n/g,"\\n"),o=await kh({privateKey:i});return e&&(m.success("Your RSA key has been generated"),m.success(`Public key saved in ${ur}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Private key saved in ${o.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function WL(t){await ge(),await Hue(t)}async function KL(t){Y("Getting user id"),t.apikey=t.apikey||he();let e=await le(t.apikey),r=await pe(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}async function YL(t,e){Y("Check compatibility"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId;let{channel:n}=e;n||(m.error("Missing argument, you need to provide a channel"),k.error("")),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await le(e.apikey);await pe(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await Rh(i,t,n),s=new cr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=cr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=h===f?a:u;s.rows.push([l,f,h,d])}),m.success("Compatibility"),m.success(s.toString())}k.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version);k.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(ML).option("--local","Only save in local folder");k.command("doctor").description("Get info about your Capgo app install").action(U8);k.command("init [apikey] [appId]").description("Init a new app").action(zL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path");var Ra=k.command("app").description("Manage app");Ra.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(B8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Ra.command("delete [appId]").description("Delete an app in Capgo Cloud").action(M8).option("-a, --apikey <apikey>","apikey to link to your account");Ra.command("list").alias("l").description("list apps in Capgo Cloud").action(H8).option("-a, --apikey <apikey>","apikey to link to your account");Ra.command("debug [appId]").description("Listen for live updates event in Capgo Cloud to debug your app").option("-a, --apikey <apikey>","apikey to link to your account").option("-d, --device <device>","the specific device to debug").action(jL);Ra.command("setting [path]").description("Modifies capacitor config programmatically").option("--bool <bool>","A value for the setting to modify as a boolean").option("--string <string>","A value for the setting to modify as a string").action(K8);Ra.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(W8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=k.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(iL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--key-v2 <key>","custom path for private signing key").option("--key-data-v2 <keyDataV2>","private signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.");hn.command("compatibility [appId]").action(YL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(PN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(LN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(DN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(CN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action($N).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(jN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(kN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(uL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2");var Zc=k.command("channel").description("Manage channel");Zc.command("add [channelId] [appId]").alias("a").description("Create channel").action(lL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");Zc.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(pL).option("-a, --apikey <apikey>","apikey to link to your account");Zc.command("list [appId]").alias("l").description("List channel").action(gL).option("-a, --apikey <apikey>","apikey to link to your account");Zc.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(dL).option("-c, --channel <channel>","channel to get the current bundle from").option("-a, --apikey <apikey>","apikey to link to your account").option("--quiet","only print the bundle version");Zc.command("set [channelId] [appId]").alias("s").description("Set channel").action(vL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices");var JL=k.command("key_old").description("Manage old encryption key");JL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(GL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");JL.command("create").description("Create a new encryption key").action(WL).option("-f, --force","force generate a new one");var iw=k.command("key").description("Manage encryption key");iw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(NL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");iw.command("create").description("Create a new encryption key").action(LL).option("-f, --force","force generate a new one");iw.command("delete_old").description("Delete the old encryption key").action(BL);k.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(oL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel");var zue=k.command("account").description("Manage account");zue.command("id").description("Get your account ID").action(KL).option("-a, --apikey <apikey>","apikey to link to your account");k.parseAsync();
328
+ `)}async function Lue(t,e,r){let n=Nt(),i=await Te({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await ew({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),m.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,dr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Bue(t,e,r){let n=Nt(),i=await Te({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=ve(),s=await eb(),a=await nj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),m.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,dr.exit)()),(0,Xc.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,UL),o.stop("Build & Sync Done \u2705")}else m.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function que(t,e,r){let n=Nt(),i=await Te({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await hp(r,{channel:Jc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),m.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,dr.exit)())}else m.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function Mue(t,e){let r=Nt(),n=await Te({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await Bo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});qt(i)&&(X("Bye \u{1F44B}"),(0,dr.exit)());let o=i,s=ve();s.start(`Running: ${r.runner} cap run ${o}`),await(0,Xc.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else m.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await $r(t,e,9)}async function Uue(t,e,r,n){let i=await Te({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)m.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await Qb("onboarding-v2",e,r,e,t);else{let o=wo(r);m.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function HL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await ge();let i=await ee(),o=await Cr();e=e||i?.config?.appId,r.apikey=t||he();let s=ve();(!BL()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await nw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await fe(r.apikey);await pe(a,r.apikey,["upload","all","read","write"]);let u=await ha(a,["admin","super_admin"]),c=u.gid,l=await kue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await Pue(u,r.apikey,e,r),Ci(2)),l<3&&(await Rue(c,r.apikey,e),Ci(3)),l<4&&(await jue(c,r.apikey,e),Ci(4)),l<5&&(await Nue(c,r.apikey,e),Ci(5)),l<6&&(await Lue(c,r.apikey,e),Ci(6)),l<7&&(await Bue(c,r.apikey,e),Ci(7)),l<8&&(await que(c,r.apikey,e),Ci(8)),l<9&&(await Mue(c,r.apikey),Ci(9)),await Uue(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),Tue()}catch(f){console.error(f),m.error("Error during onboarding, please try again later"),(0,dr.exit)(1)}m.info("Welcome onboard \u2708\uFE0F!"),m.info("Your Capgo update system is setup"),m.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),m.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,dr.exit)()}var dn=require("node:fs");async function Vue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||tr,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)m.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),m&&(m.success(`private key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function zL(t){Y("Save keys \u{1F511}"),await ge(),await Vue(t)}async function Hue(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,dn.existsSync)(cr)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,dn.writeFileSync)(cr,r),(0,dn.existsSync)(tr)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,dn.writeFileSync)(tr,n);let i=n.replace(/\\n/g,"\\n"),o=await kh({privateKey:i});return e&&(m.success("Your RSA key has been generated"),m.success(`Public key saved in ${cr}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Private key saved in ${o.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function GL(t){await ge(),await Hue(t)}async function WL(t){Y("Getting user id"),t.apikey=t.apikey||he();let e=await fe(t.apikey),r=await pe(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}async function KL(t,e){Y("Check compatibility"),e.apikey=e.apikey||he();let r=await ee();t=t||r?.config?.appId;let{channel:n}=e;n||(m.error("Missing argument, you need to provide a channel"),k.error("")),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey);await pe(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await Rh(i,t,n,e.packageJson),s=new lr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=lr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=h===f?a:u;s.rows.push([l,f,h,d])}),m.success("Compatibility"),m.success(s.toString())}k.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version);k.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(qL).option("--local","Only save in local folder");k.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(M8);k.command("init [apikey] [appId]").description("Init a new app").action(HL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path");var Ra=k.command("app").description("Manage app");Ra.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(L8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Ra.command("delete [appId]").description("Delete an app in Capgo Cloud").action(q8).option("-a, --apikey <apikey>","apikey to link to your account");Ra.command("list").alias("l").description("list apps in Capgo Cloud").action(V8).option("-a, --apikey <apikey>","apikey to link to your account");Ra.command("debug [appId]").description("Listen for live updates event in Capgo Cloud to debug your app").option("-a, --apikey <apikey>","apikey to link to your account").option("-d, --device <device>","the specific device to debug").action(IL);Ra.command("setting [path]").description("Modifies capacitor config programmatically").option("--bool <bool>","A value for the setting to modify as a boolean").option("--string <string>","A value for the setting to modify as a string").action(W8);Ra.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(G8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=k.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(nL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--key-v2 <key>","custom path for private signing key").option("--key-data-v2 <keyDataV2>","private signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.");hn.command("compatibility [appId]").action(KL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(TN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(NN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(yN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(EN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action(RN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(IN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(AN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(aL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var Zc=k.command("channel").description("Manage channel");Zc.command("add [channelId] [appId]").alias("a").description("Create channel").action(cL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");Zc.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(hL).option("-a, --apikey <apikey>","apikey to link to your account");Zc.command("list [appId]").alias("l").description("List channel").action(mL).option("-a, --apikey <apikey>","apikey to link to your account");Zc.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(fL).option("-c, --channel <channel>","channel to get the current bundle from").option("-a, --apikey <apikey>","apikey to link to your account").option("--quiet","only print the bundle version");Zc.command("set [channelId] [appId]").alias("s").description("Set channel").action(DL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var YL=k.command("key_old").description("Manage old encryption key");YL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(zL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");YL.command("create").description("Create a new encryption key").action(GL).option("-f, --force","force generate a new one");var iw=k.command("key").description("Manage encryption key");iw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(jL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");iw.command("create").description("Create a new encryption key").action(NL).option("-f, --force","force generate a new one");iw.command("delete_old").description("Delete the old encryption key").action(LL);k.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(iL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var zue=k.command("account").description("Manage account");zue.command("id").description("Get your account ID").action(WL).option("-a, --apikey <apikey>","apikey to link to your account");k.parseAsync();
329
329
  /*! Bundled license information:
330
330
 
331
331
  safe-buffer/index.js: