@capgo/cli 4.25.6 → 4.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,33 +20,33 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
20
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 Ye.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()}`,Ye.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new mB(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=hw(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=hw(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
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=>hB(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=yn.basename(e,yn.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=Ye.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 pw(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})}mw.Command=$p});var bw=y(pr=>{var{Argument:yw}=ol(),{Command:Ip}=gw(),{CommanderError:gB,InvalidArgumentError:Dw}=Na(),{Help:yB}=xp(),{Option:vw}=kp();pr.program=new Ip;pr.createCommand=t=>new Ip(t);pr.createOption=(t,e)=>new vw(t,e);pr.createArgument=(t,e)=>new yw(t,e);pr.Command=Ip;pr.Option=vw;pr.Argument=yw;pr.Help=yB;pr.CommanderError=gB;pr.InvalidArgumentError=Dw;pr.InvalidOptionArgumentError=Dw});var Te=y((mce,_w)=>{"use strict";var jp="\x1B",Ue=`${jp}[`,vB="\x07",Np={to(t,e){return e?`${Ue}${e+1};${t+1}H`:`${Ue}${t+1}G`},move(t,e){let r="";return t<0?r+=`${Ue}${-t}D`:t>0&&(r+=`${Ue}${t}C`),e<0?r+=`${Ue}${-e}A`:e>0&&(r+=`${Ue}${e}B`),r},up:(t=1)=>`${Ue}${t}A`,down:(t=1)=>`${Ue}${t}B`,forward:(t=1)=>`${Ue}${t}C`,backward:(t=1)=>`${Ue}${t}D`,nextLine:(t=1)=>`${Ue}E`.repeat(t),prevLine:(t=1)=>`${Ue}F`.repeat(t),left:`${Ue}G`,hide:`${Ue}?25l`,show:`${Ue}?25h`,save:`${jp}7`,restore:`${jp}8`},bB={up:(t=1)=>`${Ue}S`.repeat(t),down:(t=1)=>`${Ue}T`.repeat(t)},wB={screen:`${Ue}2J`,up:(t=1)=>`${Ue}1J`.repeat(t),down:(t=1)=>`${Ue}J`.repeat(t),line:`${Ue}2K`,lineEnd:`${Ue}K`,lineStart:`${Ue}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Np.up():"");return t&&(e+=Np.left),e}};_w.exports={cursor:Np,scroll:bB,erase:wB,beep:vB}});var Sw=y((gce,Lp)=>{var _B=require("tty"),EB=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||_B.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),Ie=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+Ew(i,e,r,o)+e:t+i+e},Ew=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+Ew(o,e,r,s):i+o},Cw=(t=EB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?Ie("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?Ie("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?Ie("\x1B[3m","\x1B[23m"):String,underline:t?Ie("\x1B[4m","\x1B[24m"):String,inverse:t?Ie("\x1B[7m","\x1B[27m"):String,hidden:t?Ie("\x1B[8m","\x1B[28m"):String,strikethrough:t?Ie("\x1B[9m","\x1B[29m"):String,black:t?Ie("\x1B[30m","\x1B[39m"):String,red:t?Ie("\x1B[31m","\x1B[39m"):String,green:t?Ie("\x1B[32m","\x1B[39m"):String,yellow:t?Ie("\x1B[33m","\x1B[39m"):String,blue:t?Ie("\x1B[34m","\x1B[39m"):String,magenta:t?Ie("\x1B[35m","\x1B[39m"):String,cyan:t?Ie("\x1B[36m","\x1B[39m"):String,white:t?Ie("\x1B[37m","\x1B[39m"):String,gray:t?Ie("\x1B[90m","\x1B[39m"):String,bgBlack:t?Ie("\x1B[40m","\x1B[49m"):String,bgRed:t?Ie("\x1B[41m","\x1B[49m"):String,bgGreen:t?Ie("\x1B[42m","\x1B[49m"):String,bgYellow:t?Ie("\x1B[43m","\x1B[49m"):String,bgBlue:t?Ie("\x1B[44m","\x1B[49m"):String,bgMagenta:t?Ie("\x1B[45m","\x1B[49m"):String,bgCyan:t?Ie("\x1B[46m","\x1B[49m"):String,bgWhite:t?Ie("\x1B[47m","\x1B[49m"):String});Lp.exports=Cw();Lp.exports.createColors=Cw});var Mw=y((Dce,zp)=>{var BB=require("tty"),qB=!("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),Ne=(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},qw=(t=qB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?Ne("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?Ne("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?Ne("\x1B[3m","\x1B[23m"):String,underline:t?Ne("\x1B[4m","\x1B[24m"):String,inverse:t?Ne("\x1B[7m","\x1B[27m"):String,hidden:t?Ne("\x1B[8m","\x1B[28m"):String,strikethrough:t?Ne("\x1B[9m","\x1B[29m"):String,black:t?Ne("\x1B[30m","\x1B[39m"):String,red:t?Ne("\x1B[31m","\x1B[39m"):String,green:t?Ne("\x1B[32m","\x1B[39m"):String,yellow:t?Ne("\x1B[33m","\x1B[39m"):String,blue:t?Ne("\x1B[34m","\x1B[39m"):String,magenta:t?Ne("\x1B[35m","\x1B[39m"):String,cyan:t?Ne("\x1B[36m","\x1B[39m"):String,white:t?Ne("\x1B[37m","\x1B[39m"):String,gray:t?Ne("\x1B[90m","\x1B[39m"):String,bgBlack:t?Ne("\x1B[40m","\x1B[49m"):String,bgRed:t?Ne("\x1B[41m","\x1B[49m"):String,bgGreen:t?Ne("\x1B[42m","\x1B[49m"):String,bgYellow:t?Ne("\x1B[43m","\x1B[49m"):String,bgBlue:t?Ne("\x1B[44m","\x1B[49m"):String,bgMagenta:t?Ne("\x1B[45m","\x1B[49m"):String,bgCyan:t?Ne("\x1B[46m","\x1B[49m"):String,bgWhite:t?Ne("\x1B[47m","\x1B[49m"):String});zp.exports=qw();zp.exports.createColors=qw});var hl=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.isNXMonorepo=Ut.isMonorepo=Ut.findPackageRelativePathInMonorepo=Ut.findPackagePath=Ut.findNXMonorepoRoot=Ut.findMonorepoRoot=void 0;var qa=require("node:fs"),Kn=require("node:path");function dl(t){let e=(0,Kn.join)(t,"package.json"),r=(0,Kn.join)(t,"pnpm-workspace.yaml");if((0,qa.existsSync)(r)||(0,qa.existsSync)(e)&&JSON.parse((0,qa.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Kn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return dl(n)}Ut.findMonorepoRoot=dl;function Qp(t){let e=(0,Kn.join)(t,"nx.json");if((0,qa.existsSync)(e))return t;let r=(0,Kn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Qp(r)}Ut.findNXMonorepoRoot=Qp;function em(t,e,r){let n=(0,Kn.join)(e,"node_modules",t);if((0,qa.existsSync)(n))return n;if(e===r)return null;let i=(0,Kn.dirname)(e);return em(t,i,r)}Ut.findPackagePath=em;function KB(t,e){let r=dl(e),n=em(t,e,r);return n?(0,Kn.relative)(e,n):null}Ut.findPackageRelativePathInMonorepo=KB;function YB(t){try{return dl(t),!0}catch{return!1}}Ut.isMonorepo=YB;function JB(t){try{return Qp(t),!0}catch{return!1}}Ut.isNXMonorepo=JB});var Fi={};gn(Fi,{default:()=>XB});var XB,Oi=lt(()=>{XB={}});var zw=y(Nr=>{"use strict";var ZB=Nr&&Nr.__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]}),QB=Nr&&Nr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eq=Nr&&Nr.__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)&&ZB(e,t,r);return QB(e,t),e};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.resolveFetch=void 0;var tq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>eq((Oi(),ke(Fi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};Nr.resolveFetch=tq});var im=y(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.FunctionRegion=or.FunctionsHttpError=or.FunctionsRelayError=or.FunctionsFetchError=or.FunctionsError=void 0;var Mo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};or.FunctionsError=Mo;var tm=class extends Mo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};or.FunctionsFetchError=tm;var rm=class extends Mo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};or.FunctionsRelayError=rm;var nm=class extends Mo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};or.FunctionsHttpError=nm;var rq;(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"})(rq=or.FunctionRegion||(or.FunctionRegion={}))});var Gw=y(Uo=>{"use strict";var nq=Uo&&Uo.__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(Uo,"__esModule",{value:!0});Uo.FunctionsClient=void 0;var iq=zw(),ml=im(),om=class{constructor(e,{headers:r={},customFetch:n,region:i=ml.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,iq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return nq(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(m=>{throw new ml.FunctionsFetchError(m)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new ml.FunctionsRelayError(l);if(!l.ok)throw new ml.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}}})}};Uo.FunctionsClient=om});var sm=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.FunctionRegion=Vt.FunctionsRelayError=Vt.FunctionsHttpError=Vt.FunctionsFetchError=Vt.FunctionsError=Vt.FunctionsClient=void 0;var oq=Gw();Object.defineProperty(Vt,"FunctionsClient",{enumerable:!0,get:function(){return oq.FunctionsClient}});var Ua=im();Object.defineProperty(Vt,"FunctionsError",{enumerable:!0,get:function(){return Ua.FunctionsError}});Object.defineProperty(Vt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ua.FunctionsFetchError}});Object.defineProperty(Vt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ua.FunctionsHttpError}});Object.defineProperty(Vt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ua.FunctionsRelayError}});Object.defineProperty(Vt,"FunctionRegion",{enumerable:!0,get:function(){return Ua.FunctionRegion}})});var cm=y(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var am=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};um.default=am});var fm=y(Va=>{"use strict";var Ww=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var sq=Ww((Oi(),ke(Fi))),aq=Ww(cm()),lm=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=sq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,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 aq.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)}};Va.default=lm});var hm=y(Ha=>{"use strict";var uq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var cq=uq(fm()),dm=class extends cq.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}};Ha.default=dm});var gl=y(za=>{"use strict";var lq=za&&za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(za,"__esModule",{value:!0});var fq=lq(hm()),pm=class extends fq.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}};za.default=pm});var gm=y(Wa=>{"use strict";var dq=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var Ga=dq(gl()),mm=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 Ga.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 Ga.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 Ga.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 Ga.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 Ga.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Wa.default=mm});var Kw=y(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.version=void 0;yl.version="0.0.0-automated"});var Yw=y(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DEFAULT_HEADERS=void 0;var hq=Kw();Dl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${hq.version}`}});var Xw=y(Ka=>{"use strict";var Jw=Ka&&Ka.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ka,"__esModule",{value:!0});var pq=Jw(gm()),mq=Jw(gl()),gq=Yw(),ym=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},gq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new pq.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 mq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Ka.default=ym});var i_=y(bt=>{"use strict";var Vo=bt&&bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bt,"__esModule",{value:!0});bt.PostgrestError=bt.PostgrestBuilder=bt.PostgrestTransformBuilder=bt.PostgrestFilterBuilder=bt.PostgrestQueryBuilder=bt.PostgrestClient=void 0;var Zw=Vo(Xw());bt.PostgrestClient=Zw.default;var Qw=Vo(gm());bt.PostgrestQueryBuilder=Qw.default;var e_=Vo(gl());bt.PostgrestFilterBuilder=e_.default;var t_=Vo(hm());bt.PostgrestTransformBuilder=t_.default;var r_=Vo(fm());bt.PostgrestBuilder=r_.default;var n_=Vo(cm());bt.PostgrestError=n_.default;bt.default={PostgrestClient:Zw.default,PostgrestQueryBuilder:Qw.default,PostgrestFilterBuilder:e_.default,PostgrestTransformBuilder:t_.default,PostgrestBuilder:r_.default,PostgrestError:n_.default}});var vm={};gn(vm,{RealtimeClient:()=>Dm});var Dm,bm=lt(()=>{Dm=class{constructor(){}connect(){}disconnect(){}}});var Ja=y(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.StorageUnknownError=Lr.StorageApiError=Lr.isStorageError=Lr.StorageError=void 0;var Ya=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Lr.StorageError=Ya;function yq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Lr.isStorageError=yq;var wm=class extends Ya{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Lr.StorageApiError=wm;var _m=class extends Ya{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Lr.StorageUnknownError=_m});var vl=y(ft=>{"use strict";var Dq=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]}),vq=ft&&ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o_=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)&&Dq(e,t,r);return vq(e,t),e},bq=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.recursiveToCamel=ft.resolveResponse=ft.resolveFetch=void 0;var wq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>o_((Oi(),ke(Fi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ft.resolveFetch=wq;var _q=()=>bq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>o_((Oi(),ke(Fi))))).Response:Response});ft.resolveResponse=_q;var Eq=t=>{if(Array.isArray(t))return t.map(r=>(0,ft.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,ft.recursiveToCamel)(n)}),e};ft.recursiveToCamel=Eq});var Sm=y(Ht=>{"use strict";var Ai=Ht&&Ht.__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(Ht,"__esModule",{value:!0});Ht.remove=Ht.head=Ht.put=Ht.post=Ht.get=void 0;var Em=Ja(),Cq=vl(),Cm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Sq=(t,e,r)=>Ai(void 0,void 0,void 0,function*(){let n=yield(0,Cq.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Em.StorageApiError(Cm(i),t.status||500))}).catch(i=>{e(new Em.StorageUnknownError(Cm(i),i))}):e(new Em.StorageUnknownError(Cm(t),t))}),xq=(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 Xa(t,e,r,n,i,o){return Ai(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,xq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Sq(u,a,n))})})}function Fq(t,e,r,n){return Ai(this,void 0,void 0,function*(){return Xa(t,"GET",e,r,n)})}Ht.get=Fq;function Oq(t,e,r,n,i){return Ai(this,void 0,void 0,function*(){return Xa(t,"POST",e,n,i,r)})}Ht.post=Oq;function Aq(t,e,r,n,i){return Ai(this,void 0,void 0,function*(){return Xa(t,"PUT",e,n,i,r)})}Ht.put=Aq;function kq(t,e,r,n){return Ai(this,void 0,void 0,function*(){return Xa(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Ht.head=kq;function Tq(t,e,r,n,i){return Ai(this,void 0,void 0,function*(){return Xa(t,"DELETE",e,n,i,r)})}Ht.remove=Tq});var u_=y(Za=>{"use strict";var zt=Za&&Za.__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(Za,"__esModule",{value:!0});var Gt=Ja(),Br=Sm(),s_=vl(),Pq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},xm=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 zt(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),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):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,Gt.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return zt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return zt(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,Gt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return zt(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,Br.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 Gt.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Gt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return zt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return zt(this,void 0,void 0,function*(){try{return{data:yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return zt(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return zt(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return zt(this,void 0,void 0,function*(){try{let i=yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return zt(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,Br.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Gt.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return zt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Br.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,s_.recursiveToCamel)(n),error:null}}catch(n){if((0,Gt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return zt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Br.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Gt.isStorageError)(n)&&n instanceof Gt.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 zt(this,void 0,void 0,function*(){try{return{data:yield(0,Br.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Gt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return zt(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Pq),r),{prefix:e||""});return{data:yield(0,Br.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Gt.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("&")}};Za.default=xm});var c_=y(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.version=void 0;bl.version="2.7.1"});var l_=y(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.DEFAULT_HEADERS=void 0;var Rq=c_();wl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Rq.version}`}});var f_=y(Qa=>{"use strict";var Ho=Qa&&Qa.__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(Qa,"__esModule",{value:!0});var $q=l_(),zo=Ja(),Go=Sm(),Iq=vl(),Fm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},$q.DEFAULT_HEADERS),r),this.fetch=(0,Iq.resolveFetch)(n)}listBuckets(){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,zo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.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,zo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.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,zo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}};Qa.default=Fm});var h_=y(Wo=>{"use strict";var d_=Wo&&Wo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.StorageClient=void 0;var jq=d_(u_()),Nq=d_(f_()),Om=class extends Nq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new jq.default(this.url,this.headers,e,this.fetch)}};Wo.StorageClient=Om});var m_=y(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var y_=y(qr=>{"use strict";var Lq=qr&&qr.__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_=qr&&qr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lq(e,t,r)};Object.defineProperty(qr,"__esModule",{value:!0});qr.StorageClient=void 0;var Bq=h_();Object.defineProperty(qr,"StorageClient",{enumerable:!0,get:function(){return Bq.StorageClient}});g_(m_(),qr);g_(Ja(),qr)});var D_=y(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.version=void 0;_l.version="2.46.0"});var v_=y(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.DEFAULT_REALTIME_OPTIONS=sr.DEFAULT_AUTH_OPTIONS=sr.DEFAULT_DB_OPTIONS=sr.DEFAULT_GLOBAL_OPTIONS=sr.DEFAULT_HEADERS=void 0;var qq=D_(),eu="";typeof Deno<"u"?eu="deno":typeof document<"u"?eu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?eu="react-native":eu="node";sr.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${eu}/${qq.version}`};sr.DEFAULT_GLOBAL_OPTIONS={headers:sr.DEFAULT_HEADERS};sr.DEFAULT_DB_OPTIONS={schema:"public"};sr.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};sr.DEFAULT_REALTIME_OPTIONS={}});var w_=y(dt=>{"use strict";var Mq=dt&&dt.__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]}),Uq=dt&&dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vq=dt&&dt.__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)&&Mq(e,t,r);return Uq(e,t),e},Hq=dt&&dt.__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(dt,"__esModule",{value:!0});dt.fetchWithAuth=dt.resolveHeadersConstructor=dt.resolveFetch=void 0;var b_=Vq((Oi(),ke(Fi))),zq=t=>{let e;return t?e=t:typeof fetch>"u"?e=b_.default:e=fetch,(...r)=>e(...r)};dt.resolveFetch=zq;var Gq=()=>typeof Headers>"u"?b_.Headers:Headers;dt.resolveHeadersConstructor=Gq;var Wq=(t,e,r)=>{let n=(0,dt.resolveFetch)(r),i=(0,dt.resolveHeadersConstructor)();return(o,s)=>Hq(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}))})};dt.fetchWithAuth=Wq});var __=y(gr=>{"use strict";var Kq=gr&&gr.__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(gr,"__esModule",{value:!0});gr.applySettingDefaults=gr.isBrowser=gr.stripTrailingSlash=gr.uuid=void 0;function Yq(){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)})}gr.uuid=Yq;function Jq(t){return t.replace(/\/$/,"")}gr.stripTrailingSlash=Jq;var Xq=()=>typeof window<"u";gr.isBrowser=Xq;function Zq(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:()=>Kq(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}gr.applySettingDefaults=Zq});var Am=y(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.version=void 0;El.version="2.65.1"});var Cl=y(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.API_VERSIONS=ht.API_VERSION_HEADER_NAME=ht.NETWORK_FAILURE=ht.EXPIRY_MARGIN=ht.DEFAULT_HEADERS=ht.AUDIENCE=ht.STORAGE_KEY=ht.GOTRUE_URL=void 0;var Qq=Am();ht.GOTRUE_URL="http://localhost:9999";ht.STORAGE_KEY="supabase.auth.token";ht.AUDIENCE="";ht.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${Qq.version}`};ht.EXPIRY_MARGIN=10;ht.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ht.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ht.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Ko=y(te=>{"use strict";var eM=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]}),tM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rM=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)&&eM(e,t,r);return tM(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 nM=Cl();function iM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=iM;function oM(){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=oM;var sM=()=>typeof document<"u";te.isBrowser=sM;var ki={tested:!1,writable:!1},aM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ki.tested)return ki.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ki.tested=!0,ki.writable=!0}catch{ki.tested=!0,ki.writable=!1}return ki.writable};te.supportsLocalStorage=aM;function uM(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=uM;var cM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>rM((Oi(),ke(Fi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=cM;var lM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=lM;var fM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=fM;var dM=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=dM;var hM=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=hM;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 Sl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=Sl;Sl.promiseConstructor=Promise;function pM(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=pM;async function mM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=mM;function gM(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=gM;function yM(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,yM).join("")}te.generatePKCEVerifier=C_;async function DM(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 vM(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 DM(t);return vM(r)}te.generatePKCEChallenge=S_;async function bM(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=bM;var wM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function _M(t){let e=t.headers.get(nM.API_VERSION_HEADER_NAME);if(!e||!e.match(wM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=_M});var ru=y(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Yo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Yo;function tu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=tu;var km=class extends Yo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=km;function EM(t){return tu(t)&&t.name==="AuthApiError"}he.isAuthApiError=EM;var Tm=class extends Yo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=Tm;var Mr=class extends Yo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=Mr;var Pm=class extends Mr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Pm;function CM(t){return tu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=CM;var Rm=class extends Mr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=Rm;var $m=class extends Mr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=$m;var Im=class extends Mr{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}}};he.AuthImplicitGrantRedirectError=Im;var jm=class extends Mr{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}}};he.AuthPKCEGrantCodeExchangeError=jm;var Nm=class extends Mr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=Nm;function SM(t){return tu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=SM;var Lm=class extends Mr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Lm;function xM(t){return tu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=xM});var Mm=y(it=>{"use strict";var FM=it&&it.__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(it,"__esModule",{value:!0});it._noResolveJsonResponse=it._generateLinkResponse=it._ssoResponse=it._userResponse=it._sessionResponsePassword=it._sessionResponse=it._request=it.handleError=void 0;var xl=Cl(),Bm=Ko(),Yn=ru(),Ti=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),OM=[502,503,504];async function qm(t){var e;if(!(0,Bm.looksLikeFetchResponse)(t))throw new Yn.AuthRetryableFetchError(Ti(t),0);if(OM.includes(t.status))throw new Yn.AuthRetryableFetchError(Ti(t),t.status);let r;try{r=await t.json()}catch(o){throw new Yn.AuthUnknownError(Ti(o),o)}let n,i=(0,Bm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=xl.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 Yn.AuthWeakPasswordError(Ti(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Yn.AuthSessionMissingError}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 Yn.AuthWeakPasswordError(Ti(r),t.status,r.weak_password.reasons);throw new Yn.AuthApiError(Ti(r),t.status||500,n)}it.handleError=qm;var AM=(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 kM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[xl.API_VERSION_HEADER_NAME]||(o[xl.API_VERSION_HEADER_NAME]=xl.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 TM(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}it._request=kM;async function TM(t,e,r,n,i,o){let s=AM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Yn.AuthRetryableFetchError(Ti(u),0)}if(a.ok||await qm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await qm(u)}}function x_(t){var e;let r=null;NM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Bm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}it._sessionResponse=x_;function PM(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}it._sessionResponsePassword=PM;function RM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}it._userResponse=RM;function $M(t){return{data:t,error:null}}it._ssoResponse=$M;function IM(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=FM(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}}it._generateLinkResponse=IM;function jM(t){return t}it._noResolveJsonResponse=jM;function NM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Fl=y(nu=>{"use strict";var LM=nu&&nu.__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(nu,"__esModule",{value:!0});var wt=Mm(),BM=Ko(),Ur=ru(),Um=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,BM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,wt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Ur.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,wt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:wt._userResponse})}catch(n){if((0,Ur.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=LM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,wt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:wt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Ur.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,wt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:wt._userResponse})}catch(r){if((0,Ur.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,wt._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:wt._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(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(m.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,Ur.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,wt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:wt._userResponse})}catch(r){if((0,Ur.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,wt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:wt._userResponse})}catch(n){if((0,Ur.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,wt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:wt._userResponse})}catch(n){if((0,Ur.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,wt._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,Ur.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,wt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Ur.isAuthError)(r))return{data:null,error:r};throw r}}};nu.default=Um});var F_=y(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.memoryLocalStorageAdapter=Jo.localStorageAdapter=void 0;var Vm=Ko();Jo.localStorageAdapter={getItem:t=>(0,Vm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function qM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Jo.memoryLocalStorageAdapter=qM});var O_=y(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.polyfillGlobalThis=void 0;function MM(){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)}}Ol.polyfillGlobalThis=MM});var Hm=y(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.navigatorLock=St.NavigatorLockAcquireTimeoutError=St.LockAcquireTimeoutError=St.internals=void 0;var UM=Ko();St.internals={debug:!!(globalThis&&(0,UM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Al=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};St.LockAcquireTimeoutError=Al;var kl=class extends Al{};St.NavigatorLockAcquireTimeoutError=kl;async function VM(t,e,r){St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),St.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){St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new kl(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(St.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()}})}St.navigatorLock=VM});var Gm=y(su=>{"use strict";var HM=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var zM=HM(Fl()),ou=Cl(),Z=ru(),ae=Mm(),fe=Ko(),zm=F_(),GM=O_(),WM=Am(),A_=Hm();(0,GM.polyfillGlobalThis)();var KM={url:ou.GOTRUE_URL,storageKey:ou.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ou.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},iu=30*1e3,k_=3;async function T_(t,e,r){return await r()}var Tl=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,fe.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({},KM),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 zM.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.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,fe.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,fe.supportsLocalStorage)()?this.storage=zm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.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} (${WM.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,fe.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?.code==="identity_already_exists"?{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,Z.isAuthError)(e)?{error:e}:{error:new Z.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,Z.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,m=null;this.flowType==="pkce"&&([d,m]=await(0,fe.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:m},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 Z.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,Z.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 Z.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 Z.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,Z.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,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{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});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.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})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}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 Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.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,fe.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 Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.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,Z.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,fe.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,Z.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 Z.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,Z.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 Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.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,fe.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 Z.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,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{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 Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.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,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.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 Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.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,Z.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 Z.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,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.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 Z.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 Z.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<=iu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let m=h-f;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,l):l-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,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,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.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,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.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,fe.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,Z.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,Z.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,fe.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,Z.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,Z.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,fe.retryable)(async i=>(i>0&&await(0,fe.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,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<iu})}catch(n){if(this._debug(r,"error",n),(0,Z.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,fe.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,fe.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+ou.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${ou.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.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 Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.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,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(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,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.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(),iu);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)/iu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${iu}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,fe.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,fe.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,Z.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 a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.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,Z.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`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.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(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},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}}))}};su.default=Tl;Tl.nextInstanceID=0});var P_=y(au=>{"use strict";var YM=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var JM=YM(Fl()),XM=JM.default;au.default=XM});var R_=y(uu=>{"use strict";var ZM=uu&&uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uu,"__esModule",{value:!0});var QM=ZM(Gm()),e4=QM.default;uu.default=e4});var I_=y($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0})});var Km=y(Le=>{"use strict";var t4=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]}),j_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t4(e,t,r)},Pl=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.lockInternals=Le.NavigatorLockAcquireTimeoutError=Le.navigatorLock=Le.AuthClient=Le.AuthAdminApi=Le.GoTrueClient=Le.GoTrueAdminApi=void 0;var r4=Pl(Fl());Le.GoTrueAdminApi=r4.default;var n4=Pl(Gm());Le.GoTrueClient=n4.default;var i4=Pl(P_());Le.AuthAdminApi=i4.default;var o4=Pl(R_());Le.AuthClient=o4.default;j_(I_(),Le);j_(ru(),Le);var Wm=Hm();Object.defineProperty(Le,"navigatorLock",{enumerable:!0,get:function(){return Wm.navigatorLock}});Object.defineProperty(Le,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Wm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Le,"lockInternals",{enumerable:!0,get:function(){return Wm.internals}})});var N_=y(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.SupabaseAuthClient=void 0;var s4=Km(),Ym=class extends s4.AuthClient{constructor(e){super(e)}};Rl.SupabaseAuthClient=Ym});var Xm=y(cu=>{"use strict";var a4=cu&&cu.__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(cu,"__esModule",{value:!0});var u4=sm(),c4=i_(),l4=(bm(),ke(vm)),f4=y_(),$l=v_(),d4=w_(),L_=__(),h4=N_(),Jm=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:$l.DEFAULT_DB_OPTIONS,realtime:$l.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},$l.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:$l.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,d4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new c4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new u4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new f4.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 a4(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 h4.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 l4.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)}};cu.default=Jm});var M_=y(Be=>{"use strict";var p4=Be&&Be.__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_=Be&&Be.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p4(e,t,r)},q_=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Be,"__esModule",{value:!0});Be.createClient=Be.SupabaseClient=Be.FunctionRegion=Be.FunctionsError=Be.FunctionsRelayError=Be.FunctionsFetchError=Be.FunctionsHttpError=void 0;var m4=q_(Xm());B_(Km(),Be);var lu=sm();Object.defineProperty(Be,"FunctionsHttpError",{enumerable:!0,get:function(){return lu.FunctionsHttpError}});Object.defineProperty(Be,"FunctionsFetchError",{enumerable:!0,get:function(){return lu.FunctionsFetchError}});Object.defineProperty(Be,"FunctionsRelayError",{enumerable:!0,get:function(){return lu.FunctionsRelayError}});Object.defineProperty(Be,"FunctionsError",{enumerable:!0,get:function(){return lu.FunctionsError}});Object.defineProperty(Be,"FunctionRegion",{enumerable:!0,get:function(){return lu.FunctionRegion}});B_((bm(),ke(vm)),Be);var g4=Xm();Object.defineProperty(Be,"SupabaseClient",{enumerable:!0,get:function(){return q_(g4).default}});var y4=(t,e,r)=>new m4.default(t,e,r);Be.createClient=y4});var Zm=y((xle,U_)=>{U_.exports=require("stream")});var K_=y((Fle,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){D4(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 D4(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 v4(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 b4(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=w4(t,"string");return typeof e=="symbol"?e:String(e)}function w4(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 _4=require("buffer"),Il=_4.Buffer,E4=require("util"),Qm=E4.inspect,C4=Qm&&Qm.custom||"inspect";function S4(t,e,r){Il.prototype.copy.call(t,e,r)}W_.exports=function(){function t(){v4(this,t),this.head=null,this.tail=null,this.length=0}return b4(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 Il.alloc(0);for(var n=Il.allocUnsafe(r>>>0),i=this.head,o=0;i;)S4(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=Il.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:C4,value:function(r,n){return Qm(this,H_(H_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var tg=y((Ole,J_)=>{"use strict";function x4(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(eg,this,t)):process.nextTick(eg,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(jl,r):(r._writableState.errorEmitted=!0,process.nextTick(Y_,r,o)):process.nextTick(Y_,r,o):e?(process.nextTick(jl,r),e(o)):process.nextTick(jl,r)}),this)}function Y_(t,e){eg(t,e),jl(t)}function jl(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function F4(){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 eg(t,e){t.emit("error",e)}function O4(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:x4,undestroy:F4,errorOrDestroy:O4}});var Jn=y((Ale,Q_)=>{"use strict";var Z_={};function yr(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 A4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function k4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function T4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}yr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);yr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&A4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(k4(t," argument"))i=`The ${t} ${n} ${X_(e,"type")}`;else{let o=T4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${X_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);yr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");yr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});yr("ERR_STREAM_PREMATURE_CLOSE","Premature close");yr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});yr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");yr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");yr("ERR_STREAM_WRITE_AFTER_END","write after end");yr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);yr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);yr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Q_.exports.codes=Z_});var rg=y((kle,eE)=>{"use strict";var P4=Jn().codes.ERR_INVALID_OPT_VALUE;function R4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function $4(t,e,r,n){var i=R4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new P4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}eE.exports={getHighWaterMark:$4}});var tE=y((Tle,ng)=>{typeof Object.create=="function"?ng.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ng.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 Xo=y((Ple,og)=>{try{if(ig=require("util"),typeof ig.inherits!="function")throw"";og.exports=ig.inherits}catch{og.exports=tE()}var ig});var nE=y((Rle,rE)=>{rE.exports=require("util").deprecate});var ug=y(($le,cE)=>{"use strict";cE.exports=Xe;function oE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){a5(e,t)}}var Zo;Xe.WritableState=du;var I4={deprecate:nE()},sE=Zm(),Ll=require("buffer").Buffer,j4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function N4(t){return Ll.from(t)}function L4(t){return Ll.isBuffer(t)||t instanceof j4}var ag=tg(),B4=rg(),q4=B4.getHighWaterMark,Xn=Jn().codes,M4=Xn.ERR_INVALID_ARG_TYPE,U4=Xn.ERR_METHOD_NOT_IMPLEMENTED,V4=Xn.ERR_MULTIPLE_CALLBACK,H4=Xn.ERR_STREAM_CANNOT_PIPE,z4=Xn.ERR_STREAM_DESTROYED,G4=Xn.ERR_STREAM_NULL_VALUES,W4=Xn.ERR_STREAM_WRITE_AFTER_END,K4=Xn.ERR_UNKNOWN_ENCODING,Qo=ag.errorOrDestroy;Xo()(Xe,sE);function Y4(){}function du(t,e,r){Zo=Zo||Pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof Zo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=q4(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){r5(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)}du.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(du.prototype,"buffer",{get:I4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Nl;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Nl=Function.prototype[Symbol.hasInstance],Object.defineProperty(Xe,Symbol.hasInstance,{value:function(e){return Nl.call(this,e)?!0:this!==Xe?!1:e&&e._writableState instanceof du}})):Nl=function(e){return e instanceof this};function Xe(t){Zo=Zo||Pi();var e=this instanceof Zo;if(!e&&!Nl.call(Xe,this))return new Xe(t);this._writableState=new du(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)}Xe.prototype.pipe=function(){Qo(this,new H4)};function J4(t,e){var r=new W4;Qo(t,r),process.nextTick(e,r)}function X4(t,e,r,n){var i;return r===null?i=new G4:typeof r!="string"&&!e.objectMode&&(i=new M4("chunk",["string","Buffer"],r)),i?(Qo(t,i),process.nextTick(n,i),!1):!0}Xe.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&L4(t);return o&&!Ll.isBuffer(t)&&(t=N4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Y4),n.ending?J4(this,r):(o||X4(this,n,t,r))&&(n.pendingcb++,i=Q4(this,n,o,t,e,r)),i};Xe.prototype.cork=function(){this._writableState.corked++};Xe.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aE(this,t))};Xe.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 K4(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Xe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Z4(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Ll.from(e,r)),e}Object.defineProperty(Xe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Q4(t,e,r,n,i,o){if(!r){var s=Z4(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 sg(t,e,!1,a,n,i,o);return u}function sg(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new z4("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function e5(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(fu,t,e),t._writableState.errorEmitted=!0,Qo(t,n)):(i(n),t._writableState.errorEmitted=!0,Qo(t,n),fu(t,e))}function t5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function r5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new V4;if(t5(r),e)e5(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||n5(t,e),e.pendingcb--,n(),fu(t,e)}function n5(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,sg(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(sg(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}Xe.prototype._write=function(t,e,r){r(new U4("_write()"))};Xe.prototype._writev=null;Xe.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||s5(this,n,r),this};Object.defineProperty(Xe.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 i5(t,e){t._final(function(r){e.pendingcb--,r&&Qo(t,r),e.prefinished=!0,t.emit("prefinish"),fu(t,e)})}function o5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(i5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function fu(t,e){var r=uE(e);if(r&&(o5(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 s5(t,e,r){e.ending=!0,fu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function a5(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(Xe.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Xe.prototype.destroy=ag.destroy;Xe.prototype._undestroy=ag.undestroy;Xe.prototype._destroy=function(t,e){e(t)}});var Pi=y((Ile,fE)=>{"use strict";var u5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};fE.exports=Vr;var lE=fg(),lg=ug();Xo()(Vr,lE);for(cg=u5(lg.prototype),Bl=0;Bl<cg.length;Bl++)ql=cg[Bl],Vr.prototype[ql]||(Vr.prototype[ql]=lg.prototype[ql]);var cg,ql,Bl;function Vr(t){if(!(this instanceof Vr))return new Vr(t);lE.call(this,t),lg.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",c5)))}Object.defineProperty(Vr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Vr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Vr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function c5(){this._writableState.ended||process.nextTick(l5,this)}function l5(t){t.end()}Object.defineProperty(Vr.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((dg,hE)=>{var Ml=require("buffer"),Hr=Ml.Buffer;function dE(t,e){for(var r in t)e[r]=t[r]}Hr.from&&Hr.alloc&&Hr.allocUnsafe&&Hr.allocUnsafeSlow?hE.exports=Ml:(dE(Ml,dg),dg.Buffer=Ri);function Ri(t,e,r){return Hr(t,e,r)}Ri.prototype=Object.create(Hr.prototype);dE(Hr,Ri);Ri.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Hr(t,e,r)};Ri.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Hr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Ri.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Hr(t)};Ri.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ml.SlowBuffer(t)}});var mg=y(gE=>{"use strict";var pg=pE().Buffer,mE=pg.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 f5(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 d5(t){var e=f5(t);if(typeof e!="string"&&(pg.isEncoding===mE||!mE(t)))throw new Error("Unknown encoding: "+t);return e||t}gE.StringDecoder=hu;function hu(t){this.encoding=d5(t);var e;switch(this.encoding){case"utf16le":this.text=D5,this.end=v5,e=4;break;case"utf8":this.fillLast=m5,e=4;break;case"base64":this.text=b5,this.end=w5,e=3;break;default:this.write=_5,this.end=E5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=pg.allocUnsafe(e)}hu.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||""};hu.prototype.end=y5;hu.prototype.text=g5;hu.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 hg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function h5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=hg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function p5(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 m5(t){var e=this.lastTotal-this.lastNeed,r=p5(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 g5(t,e){var r=h5(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 y5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function D5(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 v5(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 b5(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 w5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function _5(t){return t.toString(this.encoding)}function E5(t){return t&&t.length?this.write(t):""}});var Ul=y((Nle,vE)=>{"use strict";var yE=Jn().codes.ERR_STREAM_PREMATURE_CLOSE;function C5(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 S5(){}function x5(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=C5(r||S5);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(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new yE),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new yE),r.call(t,m)},h=function(){t.req.on("finish",a)};return x5(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((Lle,bE)=>{"use strict";var Vl;function Zn(t,e,r){return e=F5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F5(t){var e=O5(t,"string");return typeof e=="symbol"?e:String(e)}function O5(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 A5=Ul(),Qn=Symbol("lastResolve"),$i=Symbol("lastReject"),pu=Symbol("error"),Hl=Symbol("ended"),Ii=Symbol("lastPromise"),gg=Symbol("handlePromise"),ji=Symbol("stream");function ei(t,e){return{value:t,done:e}}function k5(t){var e=t[Qn];if(e!==null){var r=t[ji].read();r!==null&&(t[Ii]=null,t[Qn]=null,t[$i]=null,e(ei(r,!1)))}}function T5(t){process.nextTick(k5,t)}function P5(t,e){return function(r,n){t.then(function(){if(e[Hl]){r(ei(void 0,!0));return}e[gg](r,n)},n)}}var R5=Object.getPrototypeOf(function(){}),$5=Object.setPrototypeOf((Vl={get stream(){return this[ji]},next:function(){var e=this,r=this[pu];if(r!==null)return Promise.reject(r);if(this[Hl])return Promise.resolve(ei(void 0,!0));if(this[ji].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[pu]?a(e[pu]):s(ei(void 0,!0))})});var n=this[Ii],i;if(n)i=new Promise(P5(n,this));else{var o=this[ji].read();if(o!==null)return Promise.resolve(ei(o,!1));i=new Promise(this[gg])}return this[Ii]=i,i}},Zn(Vl,Symbol.asyncIterator,function(){return this}),Zn(Vl,"return",function(){var e=this;return new Promise(function(r,n){e[ji].destroy(null,function(i){if(i){n(i);return}r(ei(void 0,!0))})})}),Vl),R5),I5=function(e){var r,n=Object.create($5,(r={},Zn(r,ji,{value:e,writable:!0}),Zn(r,Qn,{value:null,writable:!0}),Zn(r,$i,{value:null,writable:!0}),Zn(r,pu,{value:null,writable:!0}),Zn(r,Hl,{value:e._readableState.endEmitted,writable:!0}),Zn(r,gg,{value:function(o,s){var a=n[ji].read();a?(n[Ii]=null,n[Qn]=null,n[$i]=null,o(ei(a,!1))):(n[Qn]=o,n[$i]=s)},writable:!0}),r));return n[Ii]=null,A5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[$i];o!==null&&(n[Ii]=null,n[Qn]=null,n[$i]=null,o(i)),n[pu]=i;return}var s=n[Qn];s!==null&&(n[Ii]=null,n[Qn]=null,n[$i]=null,s(ei(void 0,!0))),n[Hl]=!0}),e.on("readable",T5.bind(null,n)),n};bE.exports=I5});var SE=y((Ble,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 j5(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 N5(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){L5(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 L5(t,e,r){return e=B5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B5(t){var e=q5(t,"string");return typeof e=="symbol"?e:String(e)}function q5(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 M5=Jn().codes.ERR_INVALID_ARG_TYPE;function U5(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 M5("iterable",["Iterable"],e);var i=new t(N5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=j5(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=U5});var fg=y((Mle,IE)=>{"use strict";IE.exports=ye;var es;ye.ReadableState=AE;var qle=require("events").EventEmitter,OE=function(e,r){return e.listeners(r).length},gu=Zm(),zl=require("buffer").Buffer,V5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function H5(t){return zl.from(t)}function z5(t){return zl.isBuffer(t)||t instanceof V5}var yg=require("util"),ue;yg&&yg.debuglog?ue=yg.debuglog("stream"):ue=function(){};var G5=K_(),Cg=tg(),W5=rg(),K5=W5.getHighWaterMark,Gl=Jn().codes,Y5=Gl.ERR_INVALID_ARG_TYPE,J5=Gl.ERR_STREAM_PUSH_AFTER_EOF,X5=Gl.ERR_METHOD_NOT_IMPLEMENTED,Z5=Gl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ts,Dg,vg;Xo()(ye,gu);var mu=Cg.errorOrDestroy,bg=["error","close","destroy","pause","resume"];function Q5(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){es=es||Pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof es),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=K5(this,t,"readableHighWaterMark",r),this.buffer=new G5,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&&(ts||(ts=mg().StringDecoder),this.decoder=new ts(t.encoding),this.encoding=t.encoding)}function ye(t){if(es=es||Pi(),!(this instanceof ye))return new ye(t);var e=this instanceof es;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)),gu.call(this)}Object.defineProperty(ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ye.prototype.destroy=Cg.destroy;ye.prototype._undestroy=Cg.undestroy;ye.prototype._destroy=function(t,e){e(t)};ye.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=zl.from(t,e),e=""),n=!0),kE(this,t,e,!1,n)};ye.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,rU(t,o);else{var s;if(i||(s=eU(o,e)),s)mu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==zl.prototype&&(e=H5(e)),n)o.endEmitted?mu(t,new Z5):wg(t,o,e,!0);else if(o.ended)mu(t,new J5);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?wg(t,o,e,!1):Eg(t,o)):wg(t,o,e,!1)}else n||(o.reading=!1,Eg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function wg(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&&Wl(t)),Eg(t,e)}function eU(t,e){var r;return!z5(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new Y5("chunk",["string","Buffer","Uint8Array"],e)),r}ye.prototype.isPaused=function(){return this._readableState.flowing===!1};ye.prototype.setEncoding=function(t){ts||(ts=mg().StringDecoder);var e=new ts(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 tU(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=tU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ye.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?_g(this):Wl(this),null;if(t=FE(t,e),t===0&&e.ended)return e.length===0&&_g(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&&_g(this)),i!==null&&this.emit("data",i),i};function rU(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?Wl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,TE(t)))}}function Wl(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,Sg(t)}function Eg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(nU,t,e))}function nU(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}ye.prototype._read=function(t){mu(this,new X5("_read()"))};ye.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=iU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),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&&mu(t,g)}Q5(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ue("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function iU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&OE(t,"data")&&(r.flowing=!0,Sg(t))}}ye.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)};ye.prototype.on=function(t,e){var r=gu.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?Wl(this):n.reading||process.nextTick(oU,this)),r};ye.prototype.addListener=ye.prototype.on;ye.prototype.removeListener=function(t,e){var r=gu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(PE,this),r};ye.prototype.removeAllListeners=function(t){var e=gu.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 oU(t){ue("readable nexttick read 0"),t.read(0)}ye.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,sU(this,t)),t.paused=!1,this};function sU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(aU,t,e))}function aU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Sg(t),e.flowing&&!e.reading&&t.read(0)}ye.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 Sg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}ye.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<bg.length;o++)t.on(bg[o],this.emit.bind(this,bg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ye.prototype[Symbol.asyncIterator]=function(){return Dg===void 0&&(Dg=wE()),Dg(this)});Object.defineProperty(ye.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ye.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ye.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ye._fromList=RE;Object.defineProperty(ye.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 _g(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(uU,e,t))}function uU(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"&&(ye.from=function(t,e){return vg===void 0&&(vg=SE()),vg(ye,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 xg=y((Ule,NE)=>{"use strict";NE.exports=vn;var Kl=Jn().codes,cU=Kl.ERR_METHOD_NOT_IMPLEMENTED,lU=Kl.ERR_MULTIPLE_CALLBACK,fU=Kl.ERR_TRANSFORM_ALREADY_TRANSFORMING,dU=Kl.ERR_TRANSFORM_WITH_LENGTH_0,Yl=Pi();Xo()(vn,Yl);function hU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new lU);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 vn(t){if(!(this instanceof vn))return new vn(t);Yl.call(this,t),this._transformState={afterTransform:hU.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",pU)}function pU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jE(t,e,r)}):jE(this,null,null)}vn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Yl.prototype.push.call(this,t,e)};vn.prototype._transform=function(t,e,r){r(new cU("_transform()"))};vn.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)}};vn.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};vn.prototype._destroy=function(t,e){Yl.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 dU;if(t._transformState.transforming)throw new fU;return t.push(null)}});var qE=y((Vle,BE)=>{"use strict";BE.exports=yu;var LE=xg();Xo()(yu,LE);function yu(t){if(!(this instanceof yu))return new yu(t);LE.call(this,t)}yu.prototype._transform=function(t,e,r){r(null,t)}});var zE=y((Hle,HE)=>{"use strict";var Fg;function mU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var VE=Jn().codes,gU=VE.ERR_MISSING_ARGS,yU=VE.ERR_STREAM_DESTROYED;function ME(t){if(t)throw t}function DU(t){return t.setHeader&&typeof t.abort=="function"}function vU(t,e,r,n){n=mU(n);var i=!1;t.on("close",function(){i=!0}),Fg===void 0&&(Fg=Ul()),Fg(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,DU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new yU("pipe"))}}}function UE(t){t()}function bU(t,e){return t.pipe(e)}function wU(t){return!t.length||typeof t[t.length-1]!="function"?ME:t.pop()}function _U(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=wU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new gU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return vU(s,u,c,function(l){i||(i=l),l&&o.forEach(UE),!u&&(o.forEach(UE),n(i))})});return e.reduce(bU)}HE.exports=_U});var GE=y((Dr,vu)=>{var Du=require("stream");process.env.READABLE_STREAM==="disable"&&Du?(vu.exports=Du.Readable,Object.assign(vu.exports,Du),vu.exports.Stream=Du):(Dr=vu.exports=fg(),Dr.Stream=Du||Dr,Dr.Readable=Dr,Dr.Writable=ug(),Dr.Duplex=Pi(),Dr.Transform=xg(),Dr.PassThrough=qE(),Dr.finished=Ul(),Dr.pipeline=zE())});var Ag=y(Og=>{var WE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Og=="object"?t(Og):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],m=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 k(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++]]^m[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=k,t.str=$})});var YE=y((Gle,KE)=>{"use strict";var{Transform:EU}=GE(),CU=Ag(),kg=class extends EU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=CU.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=kg});var XE=y((Wle,JE)=>{"use strict";var{DeflateRaw:SU}=require("zlib"),xU=Ag(),Tg=class extends SU{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=xU.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=Tg});var QE=y((Kle,ZE)=>{"use strict";ZE.exports={CRC32Stream:YE(),DeflateCRC32Stream:XE()}});var bu=y(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.checksum=rs.checksumFile=void 0;var FU=require("fs"),OU=require("crypto"),tC=require("stream"),AU=require("util"),{CRC32Stream:kU}=QE(),eC=(0,AU.promisify)(tC.pipeline),TU=(t,e,r)=>rC(FU.createReadStream(t),e,r);rs.checksumFile=TU;async function rC(t,e,r="hex"){let n=RU(t);if(e==="crc32"){let o=new kU,s=eC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,OU.createHash)(e);return await eC(n,i),i.end(),i.digest(r)}rs.checksum=rC;function PU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var RU=t=>PU(t)?t:new tC.Readable({read(){this.push(t),this.push(null)}})});var Pg=y((Jle,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 Jl=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 $U(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]=$U(iC[t])});var lC=y((Zle,cC)=>{var IU=require("fs"),ct=require("path"),sC=Pg(),jU=Jl(),NU=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 Ze(t){this.sep=ct.sep,this.fs=IU,aC(t)&&aC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}cC.exports=Ze;Ze.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 jU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Ze.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=ct.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};Ze.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=ct.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,m){o.fs.write(m,e,0,e.length,0,function(){o.fs.close(m,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)})})})})})};Ze.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=ct.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(ct.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Ze.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=ct.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(ct.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))})})})};Ze.prototype.getAttributes=function(){};Ze.prototype.setAttributes=function(){};Ze.crc32update=function(t,e){return uC[(t^e)&255]^t>>>8};Ze.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Ze.crc32update(r,t[n++]);return~r>>>0};Ze.methodToString=function(t){switch(t){case sC.STORED:return"STORED ("+t+")";case sC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Ze.canonical=function(t){if(!t)return"";let e=ct.posix.normalize("/"+t.split("\\").join("/"));return ct.join(".",e)};Ze.zipnamefix=function(t){if(!t)return"";let e=ct.posix.normalize("/"+t.split("\\").join("/"));return ct.posix.join(".",e)};Ze.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]};Ze.sanitize=function(t,e){t=ct.resolve(ct.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=ct.normalize(ct.join(t,r.slice(n,i).join(ct.sep)));if(o.indexOf(t)===0)return o}return ct.normalize(ct.join(t,ct.basename(e)))};Ze.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Ze.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Ze.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)};Ze.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};Ze.isWin=NU;Ze.crcTable=uC});var dC=y((Qle,fC)=>{var LU=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=LU.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((efe,hC)=>{hC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var is=y((tfe,ns)=>{ns.exports=lC();ns.exports.Constants=Pg();ns.exports.Errors=Jl();ns.exports.FileAttr=dC();ns.exports.decoder=pC()});var gC=y((rfe,mC)=>{var ti=is(),H=ti.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,m=0;t|=ti.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=ti.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 ti.fromDOS2Date(this.timeval)},set time(D){this.timeval=ti.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 m},set offset(D){m=g(D)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+c+l},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(D){var C=D.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw ti.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 k=m+H.LOCHDR+b.fnameLen,$=k+b.extraLen;return D.slice(k,$)},loadFromBinary:function(D){if(D.length!==H.CENHDR||D.readUInt32LE(0)!==H.CENSIG)throw ti.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),m=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(m,H.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ti.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:m,centralHeaderSize:D(H.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var DC=y((nfe,yC)=>{var os=is(),Ve=os.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 Ve.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Ve.ENDHDR||o.readUInt32LE(0)!==Ve.ENDSIG)&&(o.length<Ve.ZIP64HDR||o.readUInt32LE(0)!==Ve.ZIP64SIG))throw os.Errors.INVALID_END();o.readUInt32LE(0)===Ve.ENDSIG?(t=o.readUInt16LE(Ve.ENDSUB),e=o.readUInt16LE(Ve.ENDTOT),r=o.readUInt32LE(Ve.ENDSIZ),n=o.readUInt32LE(Ve.ENDOFF),i=o.readUInt16LE(Ve.ENDCOM)):(t=os.readBigUInt64LE(o,Ve.ZIP64SUB),e=os.readBigUInt64LE(o,Ve.ZIP64TOT),r=os.readBigUInt64LE(o,Ve.ZIP64SIZE),n=os.readBigUInt64LE(o,Ve.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Ve.ENDHDR+i);return o.writeUInt32LE(Ve.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Ve.ENDSUB),o.writeUInt16LE(e,Ve.ENDTOT),o.writeUInt32LE(r,Ve.ENDSIZ),o.writeUInt32LE(n,Ve.ENDOFF),o.writeUInt16LE(i,Ve.ENDCOM),o.fill(" ",Ve.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 $g=y(Rg=>{Rg.EntryHeader=gC();Rg.MainHeader=DC()});var bC=y((ofe,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((sfe,wC)=>{var BU=+(process.versions?process.versions.node:"").split(".")[0]||0;wC.exports=function(t,e){var r=require("zlib");let n=BU>=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((afe,xC)=>{"use strict";var{randomFillSync:EC}=require("crypto"),qU=Jl(),MU=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)=>MU[(t^e)&255]^t>>>8,wu=()=>typeof EC=="function"?EC(Buffer.alloc(12)):wu.node();wu.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 Xl={genSalt:wu};function Zl(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])}Zl.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};Zl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return SC(t,t^1)>>8&255};function UU(t){let e=new Zl(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 VU(t){let e=new Zl(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 HU(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=UU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw qU.WRONG_PASSWORD();return n(t.slice(12))}function zU(t){Buffer.isBuffer(t)&&t.length>=12?Xl.genSalt=function(){return t.slice(0,12)}:t==="node"?Xl.genSalt=wu.node:Xl.genSalt=wu}function GU(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=VU(r),o=Xl.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:HU,encrypt:GU,_salter:zU}});var OC=y(Ql=>{Ql.Deflater=bC();Ql.Inflater=_C();Ql.ZipCrypto=FC()});var jg=y((cfe,AC)=>{var we=is(),WU=$g(),Qe=we.Constants,Ig=OC();AC.exports=function(t,e){var r=new WU.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:we.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={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Qe.LOCSIG||e.readUInt32LE(k)==Qe.CENSIG)throw we.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Qe.EXTSIG)C.crc=e.readUInt32LE(k+Qe.EXTCRC),C.compressedSize=e.readUInt32LE(k+Qe.EXTSIZ),C.size=e.readUInt32LE(k+Qe.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Qe.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Qe.EXTSIZ-4),C.size=e.readUInt32LE(k+Qe.EXTLEN-4);else throw we.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw we.Errors.DESCRIPTOR_FAULTY();if(we.crc32(D)!==C.crc)return!1}else if(we.crc32(D)!==r.localHeader.crc)return!1;return!0}function m(D,C,k){if(typeof C>"u"&&typeof D=="string"&&(k=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),we.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw we.Errors.INVALID_PASS_PARAM();$=Ig.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case we.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,we.Errors.BAD_CRC()),we.Errors.BAD_CRC();case we.Constants.DEFLATED:var L=new Ig.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,we.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw we.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),we.Errors.UNKNOWN_METHOD()),we.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 k;switch(r.method){case we.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),D&&C&&C(k),k;default:case we.Constants.DEFLATED:var $=new Ig.Deflater(s);if(D)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});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,k,$,F;C+4<D.length;)k=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Qe.ID_ZIP64===k&&x(F)}catch{throw we.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,k,$,F;D.length>=Qe.EF_ZIP64_SCOMP&&(C=g(D,Qe.EF_ZIP64_SUNCOMP),r.size===Qe.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Qe.EF_ZIP64_RHO&&(k=g(D,Qe.EF_ZIP64_SCOMP),r.compressedSize===Qe.EF_ZIP64_OR_32&&(r.compressedSize=k)),D.length>=Qe.EF_ZIP64_DSN&&($=g(D,Qe.EF_ZIP64_RHO),r.offset===Qe.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Qe.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Qe.EF_ZIP64_DSN),r.diskNumStart===Qe.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=we.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=we.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw we.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=we.toBuffer(D,we.decoder.encode),!o&&s.length?(r.size=s.length,r.method=we.Constants.DEFLATED,r.crc=we.crc32(D),r.changed=!0):r.method=we.Constants.STORED},getData:function(D){return r.changed?s:m(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):m(!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=we.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(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,D),D+=C.length,n.copy(k,D),D+=n.length,u.copy(k,D),D+=u.length,k},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((lfe,TC)=>{var kC=jg(),KU=$g(),_t=is();TC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new KU.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?m(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)/_t.Constants.CENHDR)throw _t.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+=_t.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 m(g){var w=t.length-_t.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===_t.Constants.ENDSIG){k=w,$=w,C=w+_t.Constants.ENDHDR,D=w-_t.Constants.END64HDR;continue}if(t.readUInt32LE(w)===_t.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===_t.Constants.ZIP64SIG){k=w,C=w+_t.readBigUInt64LE(t,w+_t.Constants.ZIP64SIZE)+_t.Constants.ZIP64LEAD;break}}if(k==-1)throw _t.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+_t.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=_t.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 k=Buffer.alloc(x);for(let F of g)F.copy(k,D),D+=F.length;for(let F of w)F.copy(k,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,_t.Constants.ENDHDR),$.copy(k,D),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,D){try{s||d(),b();let C=[],k=[],$=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();k.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}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,_t.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var IC=y((ffe,$C)=>{var He=is(),et=require("path"),YU=jg(),JU=PC(),Ni=(...t)=>He.findLast(t,e=>typeof e=="boolean"),RC=(...t)=>He.findLast(t,e=>typeof e=="string"),XU=(...t)=>He.findLast(t,e=>typeof e=="function"),ZU={noSort:!1,readEntries:!1,method:He.Constants.NONE,fs:null};$C.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),ZU);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=He.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new He(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=He.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=He.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw He.Errors.INVALID_FILENAME();let o=new JU(r,n),{canonical:s,sanitize:a,zipnamefix:u}=He;function c(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(et.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(m=o.getEntry(d.entryName)),m)return m}return null}function l(d){let{join:m,normalize:b,sep:g}=et.posix;return m(".",b(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(m){return function(b){return m.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,m)=>{let b=m.slice(-1);return b=b===i.sep?i.sep:"",et.relative(d,m)+b};return{readFile:function(d,m){var b=c(d);return b&&b.getData(m)||null},childCount:function(d){let m=c(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=c(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=c(d);if(b){var g=b.getData();if(g&&g.length)return g.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var g=c(d);g?g.getDataAsync(function(w,x){if(x){m(w,x);return}w&&w.length?m(w.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=c(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=c(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=c(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=c(d);return m&&m.comment||""},updateFile:function(d,m){var b=c(d);b&&b.setData(m)},addLocalFile:function(d,m,b,g){if(i.fs.existsSync(d)){m=m?l(m):"";let w=et.win32.basename(et.win32.normalize(d));m+=b||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(m+=i.sep),this.addFile(m,D,g,x)}else throw He.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=et.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(b,function(C,k){if(C)return m(C,!1);w=w?l(w):"";let $=et.win32.basename(et.win32.normalize(b));if(w+=x||$,k.isFile())i.fs.readFile(b,function(F,L){return F?m(F,!1):(D.addFile(w,L,g,k),setImmediate(m,void 0,!0))});else if(k.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,k),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?l(m):"",d=et.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=et.join(m,h(d,x));b(D)&&w.addLocalFile(x,et.dirname(D))}}else throw He.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,g){g=f(g),b=b?l(b):"",d=et.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")m(void 0,He.Errors.FILE_NOT_FOUND(d));else if(x)m(void 0,x);else{var D=i.findFiles(d),C=-1,k=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&&m(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?m(void 0,I):(w.addFile(b+F,R,"",S),k())}):(w.addFile(b+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else m(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=et.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let D=k=>et.join(g,x(h(localPath,k))),C=k=>et.win32.basename(et.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?m(void 0,He.Errors.FILE_NOT_FOUND(localPath)):k?m(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return m($);F=F.filter(L=>w(D(L))),F.length||m(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:et.dirname(D(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(w,x)=>{w&&g(w),x&&b(this)})})},addFile:function(d,m,b,g){d=u(d);let w=c(d),x=w!=null;x||(w=new YU(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 k=w.isDirectory?16384:32768;return D?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(m),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,m,b,g,w,x){g=Ni(!1,g),w=Ni(!1,w),b=Ni(!0,b),x=RC(w,x);var D=c(d);if(!D)throw He.Errors.NO_ENTRY();var C=s(D.entryName),k=a(m,x&&!D.isDirectory?x:b?C:et.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw He.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(m,b?R:et.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 He.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw He.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var m in o.entries)try{if(m.isDirectory)continue;var b=o.entries[m].getData(d);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(d,m,b,g){if(b=Ni(!1,b),g=RC(b,g),m=Ni(!1,m),!o)throw He.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 He.Errors.CANT_EXTRACT_FILE();let C=b?w.header.fileAttr:void 0;i.writeFileTo(x,D,m,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw He.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,g){if(g=XU(m,b,g),b=Ni(!1,b),m=Ni(!1,m),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,m,b,function(F){F?$(F):k(this)})});if(!o){g(He.Errors.NO_ZIP());return}d=et.resolve(d);let w=k=>a(d,et.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),D=[],C=[];o.entries.forEach(k=>{k.isDirectory?D.push(k):C.push(k)});for(let k of D){let $=w(k),F=b?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=et.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(He.Errors.CANT_EXTRACT_FILE());else{let B=b?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,m){if(arguments.length===1&&typeof d=="function"&&(m=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var b=o.compressToBuffer();if(b){var g=i.writeFileTo(d,b,!0);typeof m=="function"&&m(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:g}=Object.assign({overwrite:!0},m);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=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,b,g,C)},x)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,g){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,g),null):o.compressToBuffer()}}}});var JC=y((Bfe,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((qfe,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((Mfe,QC)=>{"use strict";var i9=require("os"),kr=ZC(),Rt=process.env,us=void 0;kr("no-color")||kr("no-colors")||kr("color=false")?us=!1:(kr("color")||kr("colors")||kr("color=true")||kr("color=always"))&&(us=!0);"FORCE_COLOR"in Rt&&(us=Rt.FORCE_COLOR.length===0||parseInt(Rt.FORCE_COLOR,10)!==0);function o9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function s9(t){if(us===!1)return 0;if(kr("color=16m")||kr("color=full")||kr("color=truecolor"))return 3;if(kr("color=256"))return 2;if(t&&!t.isTTY&&us!==!0)return 0;var e=us?1:0;if(process.platform==="win32"){var r=i9.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 Rt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Rt})||Rt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Rt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Rt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Rt){var n=parseInt((Rt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Rt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Rt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Rt.TERM)||"COLORTERM"in Rt?1:(Rt.TERM==="dumb",e)}function Vg(t){var e=s9(t);return o9(e)}QC.exports={supportsColor:Vg,stdout:Vg(process.stdout),stderr:Vg(process.stderr)}});var rS=y((Ufe,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((Vfe,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 m in d)for(var b=d[m],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((Hfe,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((zfe,aS)=>{aS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var lS=y((Gfe,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((Wfe,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((Yfe,yS)=>{var ce={};yS.exports=ce;ce.themes={};var a9=require("util"),Li=ce.styles=JC(),pS=Object.defineProperties,u9=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 Kfe=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Li[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},c9=/[|\\{}()[\]^$+*?.]/g,l9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(c9,"\\$&")};function mS(t){var e=function r(){return d9.apply(r,arguments)};return e._styles=t,e.__proto__=f9,e}var gS=function(){var t={};return Li.grey=Li.gray,Object.keys(Li).forEach(function(e){Li[e].closeRe=new RegExp(l9(Li[e].close),"g"),t[e]={get:function(){return mS(this._styles.concat(e))}}}),t}(),f9=pS(function(){},gS);function d9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:a9.inspect(s)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
23
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function pw(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})}mw.Command=$p});var bw=y(pr=>{var{Argument:yw}=ol(),{Command:Ip}=gw(),{CommanderError:gB,InvalidArgumentError:Dw}=Na(),{Help:yB}=xp(),{Option:vw}=kp();pr.program=new Ip;pr.createCommand=t=>new Ip(t);pr.createOption=(t,e)=>new vw(t,e);pr.createArgument=(t,e)=>new yw(t,e);pr.Command=Ip;pr.Option=vw;pr.Argument=yw;pr.Help=yB;pr.CommanderError=gB;pr.InvalidArgumentError=Dw;pr.InvalidOptionArgumentError=Dw});var Te=y((mce,_w)=>{"use strict";var jp="\x1B",Ue=`${jp}[`,vB="\x07",Np={to(t,e){return e?`${Ue}${e+1};${t+1}H`:`${Ue}${t+1}G`},move(t,e){let r="";return t<0?r+=`${Ue}${-t}D`:t>0&&(r+=`${Ue}${t}C`),e<0?r+=`${Ue}${-e}A`:e>0&&(r+=`${Ue}${e}B`),r},up:(t=1)=>`${Ue}${t}A`,down:(t=1)=>`${Ue}${t}B`,forward:(t=1)=>`${Ue}${t}C`,backward:(t=1)=>`${Ue}${t}D`,nextLine:(t=1)=>`${Ue}E`.repeat(t),prevLine:(t=1)=>`${Ue}F`.repeat(t),left:`${Ue}G`,hide:`${Ue}?25l`,show:`${Ue}?25h`,save:`${jp}7`,restore:`${jp}8`},bB={up:(t=1)=>`${Ue}S`.repeat(t),down:(t=1)=>`${Ue}T`.repeat(t)},wB={screen:`${Ue}2J`,up:(t=1)=>`${Ue}1J`.repeat(t),down:(t=1)=>`${Ue}J`.repeat(t),line:`${Ue}2K`,lineEnd:`${Ue}K`,lineStart:`${Ue}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Np.up():"");return t&&(e+=Np.left),e}};_w.exports={cursor:Np,scroll:bB,erase:wB,beep:vB}});var Sw=y((gce,Lp)=>{var _B=require("tty"),EB=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||_B.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),Ie=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+Ew(i,e,r,o)+e:t+i+e},Ew=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+Ew(o,e,r,s):i+o},Cw=(t=EB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?Ie("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?Ie("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?Ie("\x1B[3m","\x1B[23m"):String,underline:t?Ie("\x1B[4m","\x1B[24m"):String,inverse:t?Ie("\x1B[7m","\x1B[27m"):String,hidden:t?Ie("\x1B[8m","\x1B[28m"):String,strikethrough:t?Ie("\x1B[9m","\x1B[29m"):String,black:t?Ie("\x1B[30m","\x1B[39m"):String,red:t?Ie("\x1B[31m","\x1B[39m"):String,green:t?Ie("\x1B[32m","\x1B[39m"):String,yellow:t?Ie("\x1B[33m","\x1B[39m"):String,blue:t?Ie("\x1B[34m","\x1B[39m"):String,magenta:t?Ie("\x1B[35m","\x1B[39m"):String,cyan:t?Ie("\x1B[36m","\x1B[39m"):String,white:t?Ie("\x1B[37m","\x1B[39m"):String,gray:t?Ie("\x1B[90m","\x1B[39m"):String,bgBlack:t?Ie("\x1B[40m","\x1B[49m"):String,bgRed:t?Ie("\x1B[41m","\x1B[49m"):String,bgGreen:t?Ie("\x1B[42m","\x1B[49m"):String,bgYellow:t?Ie("\x1B[43m","\x1B[49m"):String,bgBlue:t?Ie("\x1B[44m","\x1B[49m"):String,bgMagenta:t?Ie("\x1B[45m","\x1B[49m"):String,bgCyan:t?Ie("\x1B[46m","\x1B[49m"):String,bgWhite:t?Ie("\x1B[47m","\x1B[49m"):String});Lp.exports=Cw();Lp.exports.createColors=Cw});var Mw=y((Dce,zp)=>{var BB=require("tty"),qB=!("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),Ne=(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},qw=(t=qB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?Ne("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?Ne("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?Ne("\x1B[3m","\x1B[23m"):String,underline:t?Ne("\x1B[4m","\x1B[24m"):String,inverse:t?Ne("\x1B[7m","\x1B[27m"):String,hidden:t?Ne("\x1B[8m","\x1B[28m"):String,strikethrough:t?Ne("\x1B[9m","\x1B[29m"):String,black:t?Ne("\x1B[30m","\x1B[39m"):String,red:t?Ne("\x1B[31m","\x1B[39m"):String,green:t?Ne("\x1B[32m","\x1B[39m"):String,yellow:t?Ne("\x1B[33m","\x1B[39m"):String,blue:t?Ne("\x1B[34m","\x1B[39m"):String,magenta:t?Ne("\x1B[35m","\x1B[39m"):String,cyan:t?Ne("\x1B[36m","\x1B[39m"):String,white:t?Ne("\x1B[37m","\x1B[39m"):String,gray:t?Ne("\x1B[90m","\x1B[39m"):String,bgBlack:t?Ne("\x1B[40m","\x1B[49m"):String,bgRed:t?Ne("\x1B[41m","\x1B[49m"):String,bgGreen:t?Ne("\x1B[42m","\x1B[49m"):String,bgYellow:t?Ne("\x1B[43m","\x1B[49m"):String,bgBlue:t?Ne("\x1B[44m","\x1B[49m"):String,bgMagenta:t?Ne("\x1B[45m","\x1B[49m"):String,bgCyan:t?Ne("\x1B[46m","\x1B[49m"):String,bgWhite:t?Ne("\x1B[47m","\x1B[49m"):String});zp.exports=qw();zp.exports.createColors=qw});var hl=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.isNXMonorepo=Ut.isMonorepo=Ut.findPackageRelativePathInMonorepo=Ut.findPackagePath=Ut.findNXMonorepoRoot=Ut.findMonorepoRoot=void 0;var qa=require("node:fs"),Kn=require("node:path");function dl(t){let e=(0,Kn.join)(t,"package.json"),r=(0,Kn.join)(t,"pnpm-workspace.yaml");if((0,qa.existsSync)(r)||(0,qa.existsSync)(e)&&JSON.parse((0,qa.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Kn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return dl(n)}Ut.findMonorepoRoot=dl;function Qp(t){let e=(0,Kn.join)(t,"nx.json");if((0,qa.existsSync)(e))return t;let r=(0,Kn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Qp(r)}Ut.findNXMonorepoRoot=Qp;function em(t,e,r){let n=(0,Kn.join)(e,"node_modules",t);if((0,qa.existsSync)(n))return n;if(e===r)return null;let i=(0,Kn.dirname)(e);return em(t,i,r)}Ut.findPackagePath=em;function KB(t,e){let r=dl(e),n=em(t,e,r);return n?(0,Kn.relative)(e,n):null}Ut.findPackageRelativePathInMonorepo=KB;function YB(t){try{return dl(t),!0}catch{return!1}}Ut.isMonorepo=YB;function JB(t){try{return Qp(t),!0}catch{return!1}}Ut.isNXMonorepo=JB});var Fi={};gn(Fi,{default:()=>XB});var XB,Oi=lt(()=>{XB={}});var zw=y(Nr=>{"use strict";var ZB=Nr&&Nr.__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]}),QB=Nr&&Nr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eq=Nr&&Nr.__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)&&ZB(e,t,r);return QB(e,t),e};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.resolveFetch=void 0;var tq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>eq((Oi(),ke(Fi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};Nr.resolveFetch=tq});var im=y(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.FunctionRegion=or.FunctionsHttpError=or.FunctionsRelayError=or.FunctionsFetchError=or.FunctionsError=void 0;var Uo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};or.FunctionsError=Uo;var tm=class extends Uo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};or.FunctionsFetchError=tm;var rm=class extends Uo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};or.FunctionsRelayError=rm;var nm=class extends Uo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};or.FunctionsHttpError=nm;var rq;(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"})(rq=or.FunctionRegion||(or.FunctionRegion={}))});var Gw=y(Vo=>{"use strict";var nq=Vo&&Vo.__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(Vo,"__esModule",{value:!0});Vo.FunctionsClient=void 0;var iq=zw(),ml=im(),om=class{constructor(e,{headers:r={},customFetch:n,region:i=ml.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,iq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return nq(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(m=>{throw new ml.FunctionsFetchError(m)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new ml.FunctionsRelayError(l);if(!l.ok)throw new ml.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}}})}};Vo.FunctionsClient=om});var sm=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.FunctionRegion=Vt.FunctionsRelayError=Vt.FunctionsHttpError=Vt.FunctionsFetchError=Vt.FunctionsError=Vt.FunctionsClient=void 0;var oq=Gw();Object.defineProperty(Vt,"FunctionsClient",{enumerable:!0,get:function(){return oq.FunctionsClient}});var Ua=im();Object.defineProperty(Vt,"FunctionsError",{enumerable:!0,get:function(){return Ua.FunctionsError}});Object.defineProperty(Vt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ua.FunctionsFetchError}});Object.defineProperty(Vt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ua.FunctionsHttpError}});Object.defineProperty(Vt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ua.FunctionsRelayError}});Object.defineProperty(Vt,"FunctionRegion",{enumerable:!0,get:function(){return Ua.FunctionRegion}})});var cm=y(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var am=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};um.default=am});var fm=y(Va=>{"use strict";var Ww=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var sq=Ww((Oi(),ke(Fi))),aq=Ww(cm()),lm=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=sq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,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 aq.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)}};Va.default=lm});var hm=y(Ha=>{"use strict";var uq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var cq=uq(fm()),dm=class extends cq.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}};Ha.default=dm});var gl=y(za=>{"use strict";var lq=za&&za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(za,"__esModule",{value:!0});var fq=lq(hm()),pm=class extends fq.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}};za.default=pm});var gm=y(Wa=>{"use strict";var dq=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var Ga=dq(gl()),mm=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 Ga.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 Ga.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 Ga.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 Ga.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 Ga.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Wa.default=mm});var Kw=y(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.version=void 0;yl.version="0.0.0-automated"});var Yw=y(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DEFAULT_HEADERS=void 0;var hq=Kw();Dl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${hq.version}`}});var Xw=y(Ka=>{"use strict";var Jw=Ka&&Ka.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ka,"__esModule",{value:!0});var pq=Jw(gm()),mq=Jw(gl()),gq=Yw(),ym=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},gq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new pq.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 mq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Ka.default=ym});var i_=y(bt=>{"use strict";var Ho=bt&&bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bt,"__esModule",{value:!0});bt.PostgrestError=bt.PostgrestBuilder=bt.PostgrestTransformBuilder=bt.PostgrestFilterBuilder=bt.PostgrestQueryBuilder=bt.PostgrestClient=void 0;var Zw=Ho(Xw());bt.PostgrestClient=Zw.default;var Qw=Ho(gm());bt.PostgrestQueryBuilder=Qw.default;var e_=Ho(gl());bt.PostgrestFilterBuilder=e_.default;var t_=Ho(hm());bt.PostgrestTransformBuilder=t_.default;var r_=Ho(fm());bt.PostgrestBuilder=r_.default;var n_=Ho(cm());bt.PostgrestError=n_.default;bt.default={PostgrestClient:Zw.default,PostgrestQueryBuilder:Qw.default,PostgrestFilterBuilder:e_.default,PostgrestTransformBuilder:t_.default,PostgrestBuilder:r_.default,PostgrestError:n_.default}});var vm={};gn(vm,{RealtimeClient:()=>Dm});var Dm,bm=lt(()=>{Dm=class{constructor(){}connect(){}disconnect(){}}});var Ja=y(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.StorageUnknownError=Lr.StorageApiError=Lr.isStorageError=Lr.StorageError=void 0;var Ya=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Lr.StorageError=Ya;function yq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Lr.isStorageError=yq;var wm=class extends Ya{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Lr.StorageApiError=wm;var _m=class extends Ya{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Lr.StorageUnknownError=_m});var vl=y(ft=>{"use strict";var Dq=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]}),vq=ft&&ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o_=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)&&Dq(e,t,r);return vq(e,t),e},bq=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.recursiveToCamel=ft.resolveResponse=ft.resolveFetch=void 0;var wq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>o_((Oi(),ke(Fi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ft.resolveFetch=wq;var _q=()=>bq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>o_((Oi(),ke(Fi))))).Response:Response});ft.resolveResponse=_q;var Eq=t=>{if(Array.isArray(t))return t.map(r=>(0,ft.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,ft.recursiveToCamel)(n)}),e};ft.recursiveToCamel=Eq});var Sm=y(Ht=>{"use strict";var Ai=Ht&&Ht.__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(Ht,"__esModule",{value:!0});Ht.remove=Ht.head=Ht.put=Ht.post=Ht.get=void 0;var Em=Ja(),Cq=vl(),Cm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Sq=(t,e,r)=>Ai(void 0,void 0,void 0,function*(){let n=yield(0,Cq.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Em.StorageApiError(Cm(i),t.status||500))}).catch(i=>{e(new Em.StorageUnknownError(Cm(i),i))}):e(new Em.StorageUnknownError(Cm(t),t))}),xq=(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 Xa(t,e,r,n,i,o){return Ai(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,xq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Sq(u,a,n))})})}function Fq(t,e,r,n){return Ai(this,void 0,void 0,function*(){return Xa(t,"GET",e,r,n)})}Ht.get=Fq;function Oq(t,e,r,n,i){return Ai(this,void 0,void 0,function*(){return Xa(t,"POST",e,n,i,r)})}Ht.post=Oq;function Aq(t,e,r,n,i){return Ai(this,void 0,void 0,function*(){return Xa(t,"PUT",e,n,i,r)})}Ht.put=Aq;function kq(t,e,r,n){return Ai(this,void 0,void 0,function*(){return Xa(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Ht.head=kq;function Tq(t,e,r,n,i){return Ai(this,void 0,void 0,function*(){return Xa(t,"DELETE",e,n,i,r)})}Ht.remove=Tq});var u_=y(Za=>{"use strict";var zt=Za&&Za.__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(Za,"__esModule",{value:!0});var Gt=Ja(),Br=Sm(),s_=vl(),Pq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},xm=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 zt(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),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):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,Gt.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return zt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return zt(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,Gt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return zt(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,Br.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 Gt.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Gt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return zt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return zt(this,void 0,void 0,function*(){try{return{data:yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return zt(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return zt(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return zt(this,void 0,void 0,function*(){try{let i=yield(0,Br.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,Gt.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return zt(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,Br.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Gt.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return zt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Br.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,s_.recursiveToCamel)(n),error:null}}catch(n){if((0,Gt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return zt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Br.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Gt.isStorageError)(n)&&n instanceof Gt.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 zt(this,void 0,void 0,function*(){try{return{data:yield(0,Br.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Gt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return zt(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Pq),r),{prefix:e||""});return{data:yield(0,Br.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Gt.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("&")}};Za.default=xm});var c_=y(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.version=void 0;bl.version="2.7.1"});var l_=y(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.DEFAULT_HEADERS=void 0;var Rq=c_();wl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Rq.version}`}});var f_=y(Qa=>{"use strict";var zo=Qa&&Qa.__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(Qa,"__esModule",{value:!0});var $q=l_(),Go=Ja(),Wo=Sm(),Iq=vl(),Fm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},$q.DEFAULT_HEADERS),r),this.fetch=(0,Iq.resolveFetch)(n)}listBuckets(){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Go.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.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,Go.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.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,Go.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}};Qa.default=Fm});var h_=y(Ko=>{"use strict";var d_=Ko&&Ko.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.StorageClient=void 0;var jq=d_(u_()),Nq=d_(f_()),Om=class extends Nq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new jq.default(this.url,this.headers,e,this.fetch)}};Ko.StorageClient=Om});var m_=y(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var y_=y(qr=>{"use strict";var Lq=qr&&qr.__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_=qr&&qr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lq(e,t,r)};Object.defineProperty(qr,"__esModule",{value:!0});qr.StorageClient=void 0;var Bq=h_();Object.defineProperty(qr,"StorageClient",{enumerable:!0,get:function(){return Bq.StorageClient}});g_(m_(),qr);g_(Ja(),qr)});var D_=y(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.version=void 0;_l.version="2.46.0"});var v_=y(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.DEFAULT_REALTIME_OPTIONS=sr.DEFAULT_AUTH_OPTIONS=sr.DEFAULT_DB_OPTIONS=sr.DEFAULT_GLOBAL_OPTIONS=sr.DEFAULT_HEADERS=void 0;var qq=D_(),eu="";typeof Deno<"u"?eu="deno":typeof document<"u"?eu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?eu="react-native":eu="node";sr.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${eu}/${qq.version}`};sr.DEFAULT_GLOBAL_OPTIONS={headers:sr.DEFAULT_HEADERS};sr.DEFAULT_DB_OPTIONS={schema:"public"};sr.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};sr.DEFAULT_REALTIME_OPTIONS={}});var w_=y(dt=>{"use strict";var Mq=dt&&dt.__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]}),Uq=dt&&dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vq=dt&&dt.__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)&&Mq(e,t,r);return Uq(e,t),e},Hq=dt&&dt.__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(dt,"__esModule",{value:!0});dt.fetchWithAuth=dt.resolveHeadersConstructor=dt.resolveFetch=void 0;var b_=Vq((Oi(),ke(Fi))),zq=t=>{let e;return t?e=t:typeof fetch>"u"?e=b_.default:e=fetch,(...r)=>e(...r)};dt.resolveFetch=zq;var Gq=()=>typeof Headers>"u"?b_.Headers:Headers;dt.resolveHeadersConstructor=Gq;var Wq=(t,e,r)=>{let n=(0,dt.resolveFetch)(r),i=(0,dt.resolveHeadersConstructor)();return(o,s)=>Hq(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}))})};dt.fetchWithAuth=Wq});var __=y(gr=>{"use strict";var Kq=gr&&gr.__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(gr,"__esModule",{value:!0});gr.applySettingDefaults=gr.isBrowser=gr.stripTrailingSlash=gr.uuid=void 0;function Yq(){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)})}gr.uuid=Yq;function Jq(t){return t.replace(/\/$/,"")}gr.stripTrailingSlash=Jq;var Xq=()=>typeof window<"u";gr.isBrowser=Xq;function Zq(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:()=>Kq(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}gr.applySettingDefaults=Zq});var Am=y(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.version=void 0;El.version="2.65.1"});var Cl=y(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.API_VERSIONS=ht.API_VERSION_HEADER_NAME=ht.NETWORK_FAILURE=ht.EXPIRY_MARGIN=ht.DEFAULT_HEADERS=ht.AUDIENCE=ht.STORAGE_KEY=ht.GOTRUE_URL=void 0;var Qq=Am();ht.GOTRUE_URL="http://localhost:9999";ht.STORAGE_KEY="supabase.auth.token";ht.AUDIENCE="";ht.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${Qq.version}`};ht.EXPIRY_MARGIN=10;ht.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ht.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ht.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Yo=y(te=>{"use strict";var eM=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]}),tM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rM=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)&&eM(e,t,r);return tM(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 nM=Cl();function iM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=iM;function oM(){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=oM;var sM=()=>typeof document<"u";te.isBrowser=sM;var ki={tested:!1,writable:!1},aM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ki.tested)return ki.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ki.tested=!0,ki.writable=!0}catch{ki.tested=!0,ki.writable=!1}return ki.writable};te.supportsLocalStorage=aM;function uM(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=uM;var cM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>rM((Oi(),ke(Fi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=cM;var lM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=lM;var fM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=fM;var dM=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=dM;var hM=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=hM;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 Sl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=Sl;Sl.promiseConstructor=Promise;function pM(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=pM;async function mM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=mM;function gM(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=gM;function yM(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,yM).join("")}te.generatePKCEVerifier=C_;async function DM(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 vM(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 DM(t);return vM(r)}te.generatePKCEChallenge=S_;async function bM(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=bM;var wM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function _M(t){let e=t.headers.get(nM.API_VERSION_HEADER_NAME);if(!e||!e.match(wM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=_M});var ru=y(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Jo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Jo;function tu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=tu;var km=class extends Jo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=km;function EM(t){return tu(t)&&t.name==="AuthApiError"}he.isAuthApiError=EM;var Tm=class extends Jo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=Tm;var Mr=class extends Jo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=Mr;var Pm=class extends Mr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Pm;function CM(t){return tu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=CM;var Rm=class extends Mr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=Rm;var $m=class extends Mr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=$m;var Im=class extends Mr{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}}};he.AuthImplicitGrantRedirectError=Im;var jm=class extends Mr{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}}};he.AuthPKCEGrantCodeExchangeError=jm;var Nm=class extends Mr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=Nm;function SM(t){return tu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=SM;var Lm=class extends Mr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Lm;function xM(t){return tu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=xM});var Mm=y(it=>{"use strict";var FM=it&&it.__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(it,"__esModule",{value:!0});it._noResolveJsonResponse=it._generateLinkResponse=it._ssoResponse=it._userResponse=it._sessionResponsePassword=it._sessionResponse=it._request=it.handleError=void 0;var xl=Cl(),Bm=Yo(),Yn=ru(),Ti=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),OM=[502,503,504];async function qm(t){var e;if(!(0,Bm.looksLikeFetchResponse)(t))throw new Yn.AuthRetryableFetchError(Ti(t),0);if(OM.includes(t.status))throw new Yn.AuthRetryableFetchError(Ti(t),t.status);let r;try{r=await t.json()}catch(o){throw new Yn.AuthUnknownError(Ti(o),o)}let n,i=(0,Bm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=xl.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 Yn.AuthWeakPasswordError(Ti(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Yn.AuthSessionMissingError}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 Yn.AuthWeakPasswordError(Ti(r),t.status,r.weak_password.reasons);throw new Yn.AuthApiError(Ti(r),t.status||500,n)}it.handleError=qm;var AM=(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 kM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[xl.API_VERSION_HEADER_NAME]||(o[xl.API_VERSION_HEADER_NAME]=xl.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 TM(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}it._request=kM;async function TM(t,e,r,n,i,o){let s=AM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Yn.AuthRetryableFetchError(Ti(u),0)}if(a.ok||await qm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await qm(u)}}function x_(t){var e;let r=null;NM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Bm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}it._sessionResponse=x_;function PM(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}it._sessionResponsePassword=PM;function RM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}it._userResponse=RM;function $M(t){return{data:t,error:null}}it._ssoResponse=$M;function IM(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=FM(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}}it._generateLinkResponse=IM;function jM(t){return t}it._noResolveJsonResponse=jM;function NM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Fl=y(nu=>{"use strict";var LM=nu&&nu.__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(nu,"__esModule",{value:!0});var wt=Mm(),BM=Yo(),Ur=ru(),Um=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,BM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,wt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Ur.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,wt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:wt._userResponse})}catch(n){if((0,Ur.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=LM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,wt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:wt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Ur.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,wt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:wt._userResponse})}catch(r){if((0,Ur.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,wt._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:wt._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(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(m.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,Ur.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,wt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:wt._userResponse})}catch(r){if((0,Ur.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,wt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:wt._userResponse})}catch(n){if((0,Ur.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,wt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:wt._userResponse})}catch(n){if((0,Ur.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,wt._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,Ur.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,wt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Ur.isAuthError)(r))return{data:null,error:r};throw r}}};nu.default=Um});var F_=y(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.memoryLocalStorageAdapter=Xo.localStorageAdapter=void 0;var Vm=Yo();Xo.localStorageAdapter={getItem:t=>(0,Vm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function qM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Xo.memoryLocalStorageAdapter=qM});var O_=y(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.polyfillGlobalThis=void 0;function MM(){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)}}Ol.polyfillGlobalThis=MM});var Hm=y(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.navigatorLock=St.NavigatorLockAcquireTimeoutError=St.LockAcquireTimeoutError=St.internals=void 0;var UM=Yo();St.internals={debug:!!(globalThis&&(0,UM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Al=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};St.LockAcquireTimeoutError=Al;var kl=class extends Al{};St.NavigatorLockAcquireTimeoutError=kl;async function VM(t,e,r){St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),St.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){St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw St.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new kl(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(St.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()}})}St.navigatorLock=VM});var Gm=y(su=>{"use strict";var HM=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var zM=HM(Fl()),ou=Cl(),Z=ru(),ae=Mm(),fe=Yo(),zm=F_(),GM=O_(),WM=Am(),A_=Hm();(0,GM.polyfillGlobalThis)();var KM={url:ou.GOTRUE_URL,storageKey:ou.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ou.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},iu=30*1e3,k_=3;async function T_(t,e,r){return await r()}var Tl=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,fe.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({},KM),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 zM.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.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,fe.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,fe.supportsLocalStorage)()?this.storage=zm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.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} (${WM.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,fe.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?.code==="identity_already_exists"?{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,Z.isAuthError)(e)?{error:e}:{error:new Z.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,Z.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,m=null;this.flowType==="pkce"&&([d,m]=await(0,fe.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:m},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 Z.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,Z.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 Z.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 Z.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,Z.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,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{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});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.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})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}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 Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.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,fe.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 Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.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,Z.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,fe.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,Z.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 Z.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,Z.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 Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.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,fe.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 Z.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,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{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 Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.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,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.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 Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.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,Z.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 Z.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,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.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 Z.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 Z.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<=iu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let m=h-f;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,l):l-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,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,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.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,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.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,fe.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,Z.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,Z.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,fe.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,Z.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,Z.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,fe.retryable)(async i=>(i>0&&await(0,fe.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,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<iu})}catch(n){if(this._debug(r,"error",n),(0,Z.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,fe.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,fe.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+ou.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${ou.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.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 Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.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,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(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,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.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(),iu);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)/iu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${iu}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,fe.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,fe.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,Z.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 a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.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,Z.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`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.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(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},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}}))}};su.default=Tl;Tl.nextInstanceID=0});var P_=y(au=>{"use strict";var YM=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var JM=YM(Fl()),XM=JM.default;au.default=XM});var R_=y(uu=>{"use strict";var ZM=uu&&uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uu,"__esModule",{value:!0});var QM=ZM(Gm()),e4=QM.default;uu.default=e4});var I_=y($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0})});var Km=y(Le=>{"use strict";var t4=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]}),j_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t4(e,t,r)},Pl=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.lockInternals=Le.NavigatorLockAcquireTimeoutError=Le.navigatorLock=Le.AuthClient=Le.AuthAdminApi=Le.GoTrueClient=Le.GoTrueAdminApi=void 0;var r4=Pl(Fl());Le.GoTrueAdminApi=r4.default;var n4=Pl(Gm());Le.GoTrueClient=n4.default;var i4=Pl(P_());Le.AuthAdminApi=i4.default;var o4=Pl(R_());Le.AuthClient=o4.default;j_(I_(),Le);j_(ru(),Le);var Wm=Hm();Object.defineProperty(Le,"navigatorLock",{enumerable:!0,get:function(){return Wm.navigatorLock}});Object.defineProperty(Le,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Wm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Le,"lockInternals",{enumerable:!0,get:function(){return Wm.internals}})});var N_=y(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.SupabaseAuthClient=void 0;var s4=Km(),Ym=class extends s4.AuthClient{constructor(e){super(e)}};Rl.SupabaseAuthClient=Ym});var Xm=y(cu=>{"use strict";var a4=cu&&cu.__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(cu,"__esModule",{value:!0});var u4=sm(),c4=i_(),l4=(bm(),ke(vm)),f4=y_(),$l=v_(),d4=w_(),L_=__(),h4=N_(),Jm=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:$l.DEFAULT_DB_OPTIONS,realtime:$l.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},$l.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:$l.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,d4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new c4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new u4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new f4.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 a4(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 h4.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 l4.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)}};cu.default=Jm});var M_=y(Be=>{"use strict";var p4=Be&&Be.__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_=Be&&Be.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p4(e,t,r)},q_=Be&&Be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Be,"__esModule",{value:!0});Be.createClient=Be.SupabaseClient=Be.FunctionRegion=Be.FunctionsError=Be.FunctionsRelayError=Be.FunctionsFetchError=Be.FunctionsHttpError=void 0;var m4=q_(Xm());B_(Km(),Be);var lu=sm();Object.defineProperty(Be,"FunctionsHttpError",{enumerable:!0,get:function(){return lu.FunctionsHttpError}});Object.defineProperty(Be,"FunctionsFetchError",{enumerable:!0,get:function(){return lu.FunctionsFetchError}});Object.defineProperty(Be,"FunctionsRelayError",{enumerable:!0,get:function(){return lu.FunctionsRelayError}});Object.defineProperty(Be,"FunctionsError",{enumerable:!0,get:function(){return lu.FunctionsError}});Object.defineProperty(Be,"FunctionRegion",{enumerable:!0,get:function(){return lu.FunctionRegion}});B_((bm(),ke(vm)),Be);var g4=Xm();Object.defineProperty(Be,"SupabaseClient",{enumerable:!0,get:function(){return q_(g4).default}});var y4=(t,e,r)=>new m4.default(t,e,r);Be.createClient=y4});var Zm=y((xle,U_)=>{U_.exports=require("stream")});var K_=y((Fle,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){D4(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 D4(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 v4(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 b4(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=w4(t,"string");return typeof e=="symbol"?e:String(e)}function w4(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 _4=require("buffer"),Il=_4.Buffer,E4=require("util"),Qm=E4.inspect,C4=Qm&&Qm.custom||"inspect";function S4(t,e,r){Il.prototype.copy.call(t,e,r)}W_.exports=function(){function t(){v4(this,t),this.head=null,this.tail=null,this.length=0}return b4(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 Il.alloc(0);for(var n=Il.allocUnsafe(r>>>0),i=this.head,o=0;i;)S4(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=Il.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:C4,value:function(r,n){return Qm(this,H_(H_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var tg=y((Ole,J_)=>{"use strict";function x4(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(eg,this,t)):process.nextTick(eg,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(jl,r):(r._writableState.errorEmitted=!0,process.nextTick(Y_,r,o)):process.nextTick(Y_,r,o):e?(process.nextTick(jl,r),e(o)):process.nextTick(jl,r)}),this)}function Y_(t,e){eg(t,e),jl(t)}function jl(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function F4(){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 eg(t,e){t.emit("error",e)}function O4(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:x4,undestroy:F4,errorOrDestroy:O4}});var Jn=y((Ale,Q_)=>{"use strict";var Z_={};function yr(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 A4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function k4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function T4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}yr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);yr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&A4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(k4(t," argument"))i=`The ${t} ${n} ${X_(e,"type")}`;else{let o=T4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${X_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);yr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");yr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});yr("ERR_STREAM_PREMATURE_CLOSE","Premature close");yr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});yr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");yr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");yr("ERR_STREAM_WRITE_AFTER_END","write after end");yr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);yr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);yr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Q_.exports.codes=Z_});var rg=y((kle,eE)=>{"use strict";var P4=Jn().codes.ERR_INVALID_OPT_VALUE;function R4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function $4(t,e,r,n){var i=R4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new P4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}eE.exports={getHighWaterMark:$4}});var tE=y((Tle,ng)=>{typeof Object.create=="function"?ng.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ng.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 Zo=y((Ple,og)=>{try{if(ig=require("util"),typeof ig.inherits!="function")throw"";og.exports=ig.inherits}catch{og.exports=tE()}var ig});var nE=y((Rle,rE)=>{rE.exports=require("util").deprecate});var ug=y(($le,cE)=>{"use strict";cE.exports=Xe;function oE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){a5(e,t)}}var Qo;Xe.WritableState=du;var I4={deprecate:nE()},sE=Zm(),Ll=require("buffer").Buffer,j4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function N4(t){return Ll.from(t)}function L4(t){return Ll.isBuffer(t)||t instanceof j4}var ag=tg(),B4=rg(),q4=B4.getHighWaterMark,Xn=Jn().codes,M4=Xn.ERR_INVALID_ARG_TYPE,U4=Xn.ERR_METHOD_NOT_IMPLEMENTED,V4=Xn.ERR_MULTIPLE_CALLBACK,H4=Xn.ERR_STREAM_CANNOT_PIPE,z4=Xn.ERR_STREAM_DESTROYED,G4=Xn.ERR_STREAM_NULL_VALUES,W4=Xn.ERR_STREAM_WRITE_AFTER_END,K4=Xn.ERR_UNKNOWN_ENCODING,es=ag.errorOrDestroy;Zo()(Xe,sE);function Y4(){}function du(t,e,r){Qo=Qo||Pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof Qo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=q4(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){r5(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)}du.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(du.prototype,"buffer",{get:I4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Nl;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Nl=Function.prototype[Symbol.hasInstance],Object.defineProperty(Xe,Symbol.hasInstance,{value:function(e){return Nl.call(this,e)?!0:this!==Xe?!1:e&&e._writableState instanceof du}})):Nl=function(e){return e instanceof this};function Xe(t){Qo=Qo||Pi();var e=this instanceof Qo;if(!e&&!Nl.call(Xe,this))return new Xe(t);this._writableState=new du(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)}Xe.prototype.pipe=function(){es(this,new H4)};function J4(t,e){var r=new W4;es(t,r),process.nextTick(e,r)}function X4(t,e,r,n){var i;return r===null?i=new G4:typeof r!="string"&&!e.objectMode&&(i=new M4("chunk",["string","Buffer"],r)),i?(es(t,i),process.nextTick(n,i),!1):!0}Xe.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&L4(t);return o&&!Ll.isBuffer(t)&&(t=N4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Y4),n.ending?J4(this,r):(o||X4(this,n,t,r))&&(n.pendingcb++,i=Q4(this,n,o,t,e,r)),i};Xe.prototype.cork=function(){this._writableState.corked++};Xe.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aE(this,t))};Xe.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 K4(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Xe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Z4(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Ll.from(e,r)),e}Object.defineProperty(Xe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Q4(t,e,r,n,i,o){if(!r){var s=Z4(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 sg(t,e,!1,a,n,i,o);return u}function sg(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new z4("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function e5(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(fu,t,e),t._writableState.errorEmitted=!0,es(t,n)):(i(n),t._writableState.errorEmitted=!0,es(t,n),fu(t,e))}function t5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function r5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new V4;if(t5(r),e)e5(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||n5(t,e),e.pendingcb--,n(),fu(t,e)}function n5(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,sg(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(sg(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}Xe.prototype._write=function(t,e,r){r(new U4("_write()"))};Xe.prototype._writev=null;Xe.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||s5(this,n,r),this};Object.defineProperty(Xe.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 i5(t,e){t._final(function(r){e.pendingcb--,r&&es(t,r),e.prefinished=!0,t.emit("prefinish"),fu(t,e)})}function o5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(i5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function fu(t,e){var r=uE(e);if(r&&(o5(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 s5(t,e,r){e.ending=!0,fu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function a5(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(Xe.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Xe.prototype.destroy=ag.destroy;Xe.prototype._undestroy=ag.undestroy;Xe.prototype._destroy=function(t,e){e(t)}});var Pi=y((Ile,fE)=>{"use strict";var u5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};fE.exports=Vr;var lE=fg(),lg=ug();Zo()(Vr,lE);for(cg=u5(lg.prototype),Bl=0;Bl<cg.length;Bl++)ql=cg[Bl],Vr.prototype[ql]||(Vr.prototype[ql]=lg.prototype[ql]);var cg,ql,Bl;function Vr(t){if(!(this instanceof Vr))return new Vr(t);lE.call(this,t),lg.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",c5)))}Object.defineProperty(Vr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Vr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Vr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function c5(){this._writableState.ended||process.nextTick(l5,this)}function l5(t){t.end()}Object.defineProperty(Vr.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((dg,hE)=>{var Ml=require("buffer"),Hr=Ml.Buffer;function dE(t,e){for(var r in t)e[r]=t[r]}Hr.from&&Hr.alloc&&Hr.allocUnsafe&&Hr.allocUnsafeSlow?hE.exports=Ml:(dE(Ml,dg),dg.Buffer=Ri);function Ri(t,e,r){return Hr(t,e,r)}Ri.prototype=Object.create(Hr.prototype);dE(Hr,Ri);Ri.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Hr(t,e,r)};Ri.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Hr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Ri.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Hr(t)};Ri.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ml.SlowBuffer(t)}});var mg=y(gE=>{"use strict";var pg=pE().Buffer,mE=pg.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 f5(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 d5(t){var e=f5(t);if(typeof e!="string"&&(pg.isEncoding===mE||!mE(t)))throw new Error("Unknown encoding: "+t);return e||t}gE.StringDecoder=hu;function hu(t){this.encoding=d5(t);var e;switch(this.encoding){case"utf16le":this.text=D5,this.end=v5,e=4;break;case"utf8":this.fillLast=m5,e=4;break;case"base64":this.text=b5,this.end=w5,e=3;break;default:this.write=_5,this.end=E5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=pg.allocUnsafe(e)}hu.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||""};hu.prototype.end=y5;hu.prototype.text=g5;hu.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 hg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function h5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=hg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function p5(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 m5(t){var e=this.lastTotal-this.lastNeed,r=p5(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 g5(t,e){var r=h5(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 y5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function D5(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 v5(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 b5(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 w5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function _5(t){return t.toString(this.encoding)}function E5(t){return t&&t.length?this.write(t):""}});var Ul=y((Nle,vE)=>{"use strict";var yE=Jn().codes.ERR_STREAM_PREMATURE_CLOSE;function C5(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 S5(){}function x5(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=C5(r||S5);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(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new yE),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new yE),r.call(t,m)},h=function(){t.req.on("finish",a)};return x5(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((Lle,bE)=>{"use strict";var Vl;function Zn(t,e,r){return e=F5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F5(t){var e=O5(t,"string");return typeof e=="symbol"?e:String(e)}function O5(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 A5=Ul(),Qn=Symbol("lastResolve"),$i=Symbol("lastReject"),pu=Symbol("error"),Hl=Symbol("ended"),Ii=Symbol("lastPromise"),gg=Symbol("handlePromise"),ji=Symbol("stream");function ei(t,e){return{value:t,done:e}}function k5(t){var e=t[Qn];if(e!==null){var r=t[ji].read();r!==null&&(t[Ii]=null,t[Qn]=null,t[$i]=null,e(ei(r,!1)))}}function T5(t){process.nextTick(k5,t)}function P5(t,e){return function(r,n){t.then(function(){if(e[Hl]){r(ei(void 0,!0));return}e[gg](r,n)},n)}}var R5=Object.getPrototypeOf(function(){}),$5=Object.setPrototypeOf((Vl={get stream(){return this[ji]},next:function(){var e=this,r=this[pu];if(r!==null)return Promise.reject(r);if(this[Hl])return Promise.resolve(ei(void 0,!0));if(this[ji].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[pu]?a(e[pu]):s(ei(void 0,!0))})});var n=this[Ii],i;if(n)i=new Promise(P5(n,this));else{var o=this[ji].read();if(o!==null)return Promise.resolve(ei(o,!1));i=new Promise(this[gg])}return this[Ii]=i,i}},Zn(Vl,Symbol.asyncIterator,function(){return this}),Zn(Vl,"return",function(){var e=this;return new Promise(function(r,n){e[ji].destroy(null,function(i){if(i){n(i);return}r(ei(void 0,!0))})})}),Vl),R5),I5=function(e){var r,n=Object.create($5,(r={},Zn(r,ji,{value:e,writable:!0}),Zn(r,Qn,{value:null,writable:!0}),Zn(r,$i,{value:null,writable:!0}),Zn(r,pu,{value:null,writable:!0}),Zn(r,Hl,{value:e._readableState.endEmitted,writable:!0}),Zn(r,gg,{value:function(o,s){var a=n[ji].read();a?(n[Ii]=null,n[Qn]=null,n[$i]=null,o(ei(a,!1))):(n[Qn]=o,n[$i]=s)},writable:!0}),r));return n[Ii]=null,A5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[$i];o!==null&&(n[Ii]=null,n[Qn]=null,n[$i]=null,o(i)),n[pu]=i;return}var s=n[Qn];s!==null&&(n[Ii]=null,n[Qn]=null,n[$i]=null,s(ei(void 0,!0))),n[Hl]=!0}),e.on("readable",T5.bind(null,n)),n};bE.exports=I5});var SE=y((Ble,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 j5(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 N5(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){L5(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 L5(t,e,r){return e=B5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B5(t){var e=q5(t,"string");return typeof e=="symbol"?e:String(e)}function q5(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 M5=Jn().codes.ERR_INVALID_ARG_TYPE;function U5(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 M5("iterable",["Iterable"],e);var i=new t(N5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=j5(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=U5});var fg=y((Mle,IE)=>{"use strict";IE.exports=ye;var ts;ye.ReadableState=AE;var qle=require("events").EventEmitter,OE=function(e,r){return e.listeners(r).length},gu=Zm(),zl=require("buffer").Buffer,V5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function H5(t){return zl.from(t)}function z5(t){return zl.isBuffer(t)||t instanceof V5}var yg=require("util"),ue;yg&&yg.debuglog?ue=yg.debuglog("stream"):ue=function(){};var G5=K_(),Cg=tg(),W5=rg(),K5=W5.getHighWaterMark,Gl=Jn().codes,Y5=Gl.ERR_INVALID_ARG_TYPE,J5=Gl.ERR_STREAM_PUSH_AFTER_EOF,X5=Gl.ERR_METHOD_NOT_IMPLEMENTED,Z5=Gl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,rs,Dg,vg;Zo()(ye,gu);var mu=Cg.errorOrDestroy,bg=["error","close","destroy","pause","resume"];function Q5(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){ts=ts||Pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof ts),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=K5(this,t,"readableHighWaterMark",r),this.buffer=new G5,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&&(rs||(rs=mg().StringDecoder),this.decoder=new rs(t.encoding),this.encoding=t.encoding)}function ye(t){if(ts=ts||Pi(),!(this instanceof ye))return new ye(t);var e=this instanceof ts;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)),gu.call(this)}Object.defineProperty(ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ye.prototype.destroy=Cg.destroy;ye.prototype._undestroy=Cg.undestroy;ye.prototype._destroy=function(t,e){e(t)};ye.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=zl.from(t,e),e=""),n=!0),kE(this,t,e,!1,n)};ye.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,rU(t,o);else{var s;if(i||(s=eU(o,e)),s)mu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==zl.prototype&&(e=H5(e)),n)o.endEmitted?mu(t,new Z5):wg(t,o,e,!0);else if(o.ended)mu(t,new J5);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?wg(t,o,e,!1):Eg(t,o)):wg(t,o,e,!1)}else n||(o.reading=!1,Eg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function wg(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&&Wl(t)),Eg(t,e)}function eU(t,e){var r;return!z5(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new Y5("chunk",["string","Buffer","Uint8Array"],e)),r}ye.prototype.isPaused=function(){return this._readableState.flowing===!1};ye.prototype.setEncoding=function(t){rs||(rs=mg().StringDecoder);var e=new rs(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 tU(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=tU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ye.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?_g(this):Wl(this),null;if(t=FE(t,e),t===0&&e.ended)return e.length===0&&_g(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&&_g(this)),i!==null&&this.emit("data",i),i};function rU(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?Wl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,TE(t)))}}function Wl(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,Sg(t)}function Eg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(nU,t,e))}function nU(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}ye.prototype._read=function(t){mu(this,new X5("_read()"))};ye.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=iU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),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&&mu(t,g)}Q5(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ue("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function iU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&OE(t,"data")&&(r.flowing=!0,Sg(t))}}ye.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)};ye.prototype.on=function(t,e){var r=gu.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?Wl(this):n.reading||process.nextTick(oU,this)),r};ye.prototype.addListener=ye.prototype.on;ye.prototype.removeListener=function(t,e){var r=gu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(PE,this),r};ye.prototype.removeAllListeners=function(t){var e=gu.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 oU(t){ue("readable nexttick read 0"),t.read(0)}ye.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,sU(this,t)),t.paused=!1,this};function sU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(aU,t,e))}function aU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Sg(t),e.flowing&&!e.reading&&t.read(0)}ye.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 Sg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}ye.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<bg.length;o++)t.on(bg[o],this.emit.bind(this,bg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ye.prototype[Symbol.asyncIterator]=function(){return Dg===void 0&&(Dg=wE()),Dg(this)});Object.defineProperty(ye.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ye.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ye.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ye._fromList=RE;Object.defineProperty(ye.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 _g(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(uU,e,t))}function uU(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"&&(ye.from=function(t,e){return vg===void 0&&(vg=SE()),vg(ye,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 xg=y((Ule,NE)=>{"use strict";NE.exports=vn;var Kl=Jn().codes,cU=Kl.ERR_METHOD_NOT_IMPLEMENTED,lU=Kl.ERR_MULTIPLE_CALLBACK,fU=Kl.ERR_TRANSFORM_ALREADY_TRANSFORMING,dU=Kl.ERR_TRANSFORM_WITH_LENGTH_0,Yl=Pi();Zo()(vn,Yl);function hU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new lU);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 vn(t){if(!(this instanceof vn))return new vn(t);Yl.call(this,t),this._transformState={afterTransform:hU.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",pU)}function pU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jE(t,e,r)}):jE(this,null,null)}vn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Yl.prototype.push.call(this,t,e)};vn.prototype._transform=function(t,e,r){r(new cU("_transform()"))};vn.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)}};vn.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};vn.prototype._destroy=function(t,e){Yl.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 dU;if(t._transformState.transforming)throw new fU;return t.push(null)}});var qE=y((Vle,BE)=>{"use strict";BE.exports=yu;var LE=xg();Zo()(yu,LE);function yu(t){if(!(this instanceof yu))return new yu(t);LE.call(this,t)}yu.prototype._transform=function(t,e,r){r(null,t)}});var zE=y((Hle,HE)=>{"use strict";var Fg;function mU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var VE=Jn().codes,gU=VE.ERR_MISSING_ARGS,yU=VE.ERR_STREAM_DESTROYED;function ME(t){if(t)throw t}function DU(t){return t.setHeader&&typeof t.abort=="function"}function vU(t,e,r,n){n=mU(n);var i=!1;t.on("close",function(){i=!0}),Fg===void 0&&(Fg=Ul()),Fg(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,DU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new yU("pipe"))}}}function UE(t){t()}function bU(t,e){return t.pipe(e)}function wU(t){return!t.length||typeof t[t.length-1]!="function"?ME:t.pop()}function _U(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=wU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new gU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return vU(s,u,c,function(l){i||(i=l),l&&o.forEach(UE),!u&&(o.forEach(UE),n(i))})});return e.reduce(bU)}HE.exports=_U});var GE=y((Dr,vu)=>{var Du=require("stream");process.env.READABLE_STREAM==="disable"&&Du?(vu.exports=Du.Readable,Object.assign(vu.exports,Du),vu.exports.Stream=Du):(Dr=vu.exports=fg(),Dr.Stream=Du||Dr,Dr.Readable=Dr,Dr.Writable=ug(),Dr.Duplex=Pi(),Dr.Transform=xg(),Dr.PassThrough=qE(),Dr.finished=Ul(),Dr.pipeline=zE())});var Ag=y(Og=>{var WE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Og=="object"?t(Og):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],m=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 k(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++]]^m[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=k,t.str=$})});var YE=y((Gle,KE)=>{"use strict";var{Transform:EU}=GE(),CU=Ag(),kg=class extends EU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=CU.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=kg});var XE=y((Wle,JE)=>{"use strict";var{DeflateRaw:SU}=require("zlib"),xU=Ag(),Tg=class extends SU{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=xU.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=Tg});var QE=y((Kle,ZE)=>{"use strict";ZE.exports={CRC32Stream:YE(),DeflateCRC32Stream:XE()}});var bu=y(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.checksum=ns.checksumFile=void 0;var FU=require("fs"),OU=require("crypto"),tC=require("stream"),AU=require("util"),{CRC32Stream:kU}=QE(),eC=(0,AU.promisify)(tC.pipeline),TU=(t,e,r)=>rC(FU.createReadStream(t),e,r);ns.checksumFile=TU;async function rC(t,e,r="hex"){let n=RU(t);if(e==="crc32"){let o=new kU,s=eC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,OU.createHash)(e);return await eC(n,i),i.end(),i.digest(r)}ns.checksum=rC;function PU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var RU=t=>PU(t)?t:new tC.Readable({read(){this.push(t),this.push(null)}})});var Pg=y((Jle,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 Jl=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 $U(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]=$U(iC[t])});var lC=y((Zle,cC)=>{var IU=require("fs"),ct=require("path"),sC=Pg(),jU=Jl(),NU=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 Ze(t){this.sep=ct.sep,this.fs=IU,aC(t)&&aC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}cC.exports=Ze;Ze.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 jU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Ze.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=ct.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};Ze.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=ct.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,m){o.fs.write(m,e,0,e.length,0,function(){o.fs.close(m,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)})})})})})};Ze.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=ct.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(ct.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Ze.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=ct.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(ct.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))})})})};Ze.prototype.getAttributes=function(){};Ze.prototype.setAttributes=function(){};Ze.crc32update=function(t,e){return uC[(t^e)&255]^t>>>8};Ze.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Ze.crc32update(r,t[n++]);return~r>>>0};Ze.methodToString=function(t){switch(t){case sC.STORED:return"STORED ("+t+")";case sC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Ze.canonical=function(t){if(!t)return"";let e=ct.posix.normalize("/"+t.split("\\").join("/"));return ct.join(".",e)};Ze.zipnamefix=function(t){if(!t)return"";let e=ct.posix.normalize("/"+t.split("\\").join("/"));return ct.posix.join(".",e)};Ze.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]};Ze.sanitize=function(t,e){t=ct.resolve(ct.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=ct.normalize(ct.join(t,r.slice(n,i).join(ct.sep)));if(o.indexOf(t)===0)return o}return ct.normalize(ct.join(t,ct.basename(e)))};Ze.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Ze.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Ze.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)};Ze.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};Ze.isWin=NU;Ze.crcTable=uC});var dC=y((Qle,fC)=>{var LU=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=LU.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((efe,hC)=>{hC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var os=y((tfe,is)=>{is.exports=lC();is.exports.Constants=Pg();is.exports.Errors=Jl();is.exports.FileAttr=dC();is.exports.decoder=pC()});var gC=y((rfe,mC)=>{var ti=os(),H=ti.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,m=0;t|=ti.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=ti.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 ti.fromDOS2Date(this.timeval)},set time(D){this.timeval=ti.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 m},set offset(D){m=g(D)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+c+l},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(D){var C=D.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw ti.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 k=m+H.LOCHDR+b.fnameLen,$=k+b.extraLen;return D.slice(k,$)},loadFromBinary:function(D){if(D.length!==H.CENHDR||D.readUInt32LE(0)!==H.CENSIG)throw ti.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),m=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(m,H.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ti.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:m,centralHeaderSize:D(H.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var DC=y((nfe,yC)=>{var ss=os(),Ve=ss.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 Ve.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Ve.ENDHDR||o.readUInt32LE(0)!==Ve.ENDSIG)&&(o.length<Ve.ZIP64HDR||o.readUInt32LE(0)!==Ve.ZIP64SIG))throw ss.Errors.INVALID_END();o.readUInt32LE(0)===Ve.ENDSIG?(t=o.readUInt16LE(Ve.ENDSUB),e=o.readUInt16LE(Ve.ENDTOT),r=o.readUInt32LE(Ve.ENDSIZ),n=o.readUInt32LE(Ve.ENDOFF),i=o.readUInt16LE(Ve.ENDCOM)):(t=ss.readBigUInt64LE(o,Ve.ZIP64SUB),e=ss.readBigUInt64LE(o,Ve.ZIP64TOT),r=ss.readBigUInt64LE(o,Ve.ZIP64SIZE),n=ss.readBigUInt64LE(o,Ve.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Ve.ENDHDR+i);return o.writeUInt32LE(Ve.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Ve.ENDSUB),o.writeUInt16LE(e,Ve.ENDTOT),o.writeUInt32LE(r,Ve.ENDSIZ),o.writeUInt32LE(n,Ve.ENDOFF),o.writeUInt16LE(i,Ve.ENDCOM),o.fill(" ",Ve.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 $g=y(Rg=>{Rg.EntryHeader=gC();Rg.MainHeader=DC()});var bC=y((ofe,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((sfe,wC)=>{var BU=+(process.versions?process.versions.node:"").split(".")[0]||0;wC.exports=function(t,e){var r=require("zlib");let n=BU>=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((afe,xC)=>{"use strict";var{randomFillSync:EC}=require("crypto"),qU=Jl(),MU=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)=>MU[(t^e)&255]^t>>>8,wu=()=>typeof EC=="function"?EC(Buffer.alloc(12)):wu.node();wu.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 Xl={genSalt:wu};function Zl(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])}Zl.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};Zl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return SC(t,t^1)>>8&255};function UU(t){let e=new Zl(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 VU(t){let e=new Zl(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 HU(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=UU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw qU.WRONG_PASSWORD();return n(t.slice(12))}function zU(t){Buffer.isBuffer(t)&&t.length>=12?Xl.genSalt=function(){return t.slice(0,12)}:t==="node"?Xl.genSalt=wu.node:Xl.genSalt=wu}function GU(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=VU(r),o=Xl.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:HU,encrypt:GU,_salter:zU}});var OC=y(Ql=>{Ql.Deflater=bC();Ql.Inflater=_C();Ql.ZipCrypto=FC()});var jg=y((cfe,AC)=>{var we=os(),WU=$g(),Qe=we.Constants,Ig=OC();AC.exports=function(t,e){var r=new WU.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:we.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={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Qe.LOCSIG||e.readUInt32LE(k)==Qe.CENSIG)throw we.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Qe.EXTSIG)C.crc=e.readUInt32LE(k+Qe.EXTCRC),C.compressedSize=e.readUInt32LE(k+Qe.EXTSIZ),C.size=e.readUInt32LE(k+Qe.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Qe.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Qe.EXTSIZ-4),C.size=e.readUInt32LE(k+Qe.EXTLEN-4);else throw we.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw we.Errors.DESCRIPTOR_FAULTY();if(we.crc32(D)!==C.crc)return!1}else if(we.crc32(D)!==r.localHeader.crc)return!1;return!0}function m(D,C,k){if(typeof C>"u"&&typeof D=="string"&&(k=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),we.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw we.Errors.INVALID_PASS_PARAM();$=Ig.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case we.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,we.Errors.BAD_CRC()),we.Errors.BAD_CRC();case we.Constants.DEFLATED:var L=new Ig.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,we.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw we.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),we.Errors.UNKNOWN_METHOD()),we.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 k;switch(r.method){case we.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),D&&C&&C(k),k;default:case we.Constants.DEFLATED:var $=new Ig.Deflater(s);if(D)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});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,k,$,F;C+4<D.length;)k=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Qe.ID_ZIP64===k&&x(F)}catch{throw we.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,k,$,F;D.length>=Qe.EF_ZIP64_SCOMP&&(C=g(D,Qe.EF_ZIP64_SUNCOMP),r.size===Qe.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Qe.EF_ZIP64_RHO&&(k=g(D,Qe.EF_ZIP64_SCOMP),r.compressedSize===Qe.EF_ZIP64_OR_32&&(r.compressedSize=k)),D.length>=Qe.EF_ZIP64_DSN&&($=g(D,Qe.EF_ZIP64_RHO),r.offset===Qe.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Qe.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Qe.EF_ZIP64_DSN),r.diskNumStart===Qe.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=we.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=we.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw we.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=we.toBuffer(D,we.decoder.encode),!o&&s.length?(r.size=s.length,r.method=we.Constants.DEFLATED,r.crc=we.crc32(D),r.changed=!0):r.method=we.Constants.STORED},getData:function(D){return r.changed?s:m(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):m(!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=we.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(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,D),D+=C.length,n.copy(k,D),D+=n.length,u.copy(k,D),D+=u.length,k},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((lfe,TC)=>{var kC=jg(),KU=$g(),_t=os();TC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new KU.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?m(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)/_t.Constants.CENHDR)throw _t.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+=_t.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 m(g){var w=t.length-_t.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===_t.Constants.ENDSIG){k=w,$=w,C=w+_t.Constants.ENDHDR,D=w-_t.Constants.END64HDR;continue}if(t.readUInt32LE(w)===_t.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===_t.Constants.ZIP64SIG){k=w,C=w+_t.readBigUInt64LE(t,w+_t.Constants.ZIP64SIZE)+_t.Constants.ZIP64LEAD;break}}if(k==-1)throw _t.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+_t.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=_t.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 k=Buffer.alloc(x);for(let F of g)F.copy(k,D),D+=F.length;for(let F of w)F.copy(k,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,_t.Constants.ENDHDR),$.copy(k,D),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,D){try{s||d(),b();let C=[],k=[],$=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();k.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}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,_t.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var IC=y((ffe,$C)=>{var He=os(),et=require("path"),YU=jg(),JU=PC(),Ni=(...t)=>He.findLast(t,e=>typeof e=="boolean"),RC=(...t)=>He.findLast(t,e=>typeof e=="string"),XU=(...t)=>He.findLast(t,e=>typeof e=="function"),ZU={noSort:!1,readEntries:!1,method:He.Constants.NONE,fs:null};$C.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),ZU);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=He.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new He(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=He.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=He.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw He.Errors.INVALID_FILENAME();let o=new JU(r,n),{canonical:s,sanitize:a,zipnamefix:u}=He;function c(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(et.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(m=o.getEntry(d.entryName)),m)return m}return null}function l(d){let{join:m,normalize:b,sep:g}=et.posix;return m(".",b(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(m){return function(b){return m.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,m)=>{let b=m.slice(-1);return b=b===i.sep?i.sep:"",et.relative(d,m)+b};return{readFile:function(d,m){var b=c(d);return b&&b.getData(m)||null},childCount:function(d){let m=c(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=c(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=c(d);if(b){var g=b.getData();if(g&&g.length)return g.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var g=c(d);g?g.getDataAsync(function(w,x){if(x){m(w,x);return}w&&w.length?m(w.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=c(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=c(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=c(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=c(d);return m&&m.comment||""},updateFile:function(d,m){var b=c(d);b&&b.setData(m)},addLocalFile:function(d,m,b,g){if(i.fs.existsSync(d)){m=m?l(m):"";let w=et.win32.basename(et.win32.normalize(d));m+=b||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(m+=i.sep),this.addFile(m,D,g,x)}else throw He.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=et.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(b,function(C,k){if(C)return m(C,!1);w=w?l(w):"";let $=et.win32.basename(et.win32.normalize(b));if(w+=x||$,k.isFile())i.fs.readFile(b,function(F,L){return F?m(F,!1):(D.addFile(w,L,g,k),setImmediate(m,void 0,!0))});else if(k.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,k),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?l(m):"",d=et.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=et.join(m,h(d,x));b(D)&&w.addLocalFile(x,et.dirname(D))}}else throw He.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,g){g=f(g),b=b?l(b):"",d=et.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")m(void 0,He.Errors.FILE_NOT_FOUND(d));else if(x)m(void 0,x);else{var D=i.findFiles(d),C=-1,k=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&&m(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?m(void 0,I):(w.addFile(b+F,R,"",S),k())}):(w.addFile(b+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else m(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=et.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let D=k=>et.join(g,x(h(localPath,k))),C=k=>et.win32.basename(et.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?m(void 0,He.Errors.FILE_NOT_FOUND(localPath)):k?m(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return m($);F=F.filter(L=>w(D(L))),F.length||m(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:et.dirname(D(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(w,x)=>{w&&g(w),x&&b(this)})})},addFile:function(d,m,b,g){d=u(d);let w=c(d),x=w!=null;x||(w=new YU(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 k=w.isDirectory?16384:32768;return D?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(m),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,m,b,g,w,x){g=Ni(!1,g),w=Ni(!1,w),b=Ni(!0,b),x=RC(w,x);var D=c(d);if(!D)throw He.Errors.NO_ENTRY();var C=s(D.entryName),k=a(m,x&&!D.isDirectory?x:b?C:et.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw He.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(m,b?R:et.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 He.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw He.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var m in o.entries)try{if(m.isDirectory)continue;var b=o.entries[m].getData(d);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(d,m,b,g){if(b=Ni(!1,b),g=RC(b,g),m=Ni(!1,m),!o)throw He.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 He.Errors.CANT_EXTRACT_FILE();let C=b?w.header.fileAttr:void 0;i.writeFileTo(x,D,m,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw He.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,g){if(g=XU(m,b,g),b=Ni(!1,b),m=Ni(!1,m),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,m,b,function(F){F?$(F):k(this)})});if(!o){g(He.Errors.NO_ZIP());return}d=et.resolve(d);let w=k=>a(d,et.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),D=[],C=[];o.entries.forEach(k=>{k.isDirectory?D.push(k):C.push(k)});for(let k of D){let $=w(k),F=b?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=et.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(He.Errors.CANT_EXTRACT_FILE());else{let B=b?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,m){if(arguments.length===1&&typeof d=="function"&&(m=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var b=o.compressToBuffer();if(b){var g=i.writeFileTo(d,b,!0);typeof m=="function"&&m(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:g}=Object.assign({overwrite:!0},m);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=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,b,g,C)},x)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,g){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,g),null):o.compressToBuffer()}}}});var JC=y((Bfe,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((qfe,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((Mfe,QC)=>{"use strict";var i9=require("os"),kr=ZC(),Rt=process.env,cs=void 0;kr("no-color")||kr("no-colors")||kr("color=false")?cs=!1:(kr("color")||kr("colors")||kr("color=true")||kr("color=always"))&&(cs=!0);"FORCE_COLOR"in Rt&&(cs=Rt.FORCE_COLOR.length===0||parseInt(Rt.FORCE_COLOR,10)!==0);function o9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function s9(t){if(cs===!1)return 0;if(kr("color=16m")||kr("color=full")||kr("color=truecolor"))return 3;if(kr("color=256"))return 2;if(t&&!t.isTTY&&cs!==!0)return 0;var e=cs?1:0;if(process.platform==="win32"){var r=i9.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 Rt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Rt})||Rt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Rt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Rt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Rt){var n=parseInt((Rt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Rt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Rt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Rt.TERM)||"COLORTERM"in Rt?1:(Rt.TERM==="dumb",e)}function Vg(t){var e=s9(t);return o9(e)}QC.exports={supportsColor:Vg,stdout:Vg(process.stdout),stderr:Vg(process.stderr)}});var rS=y((Ufe,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((Vfe,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 m in d)for(var b=d[m],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((Hfe,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((zfe,aS)=>{aS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var lS=y((Gfe,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((Wfe,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((Yfe,yS)=>{var ce={};yS.exports=ce;ce.themes={};var a9=require("util"),Li=ce.styles=JC(),pS=Object.defineProperties,u9=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 Kfe=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Li[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},c9=/[|\\{}()[\]^$+*?.]/g,l9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(c9,"\\$&")};function mS(t){var e=function r(){return d9.apply(r,arguments)};return e._styles=t,e.__proto__=f9,e}var gS=function(){var t={};return Li.grey=Li.gray,Object.keys(Li).forEach(function(e){Li[e].closeRe=new RegExp(l9(Li[e].close),"g"),t[e]={get:function(){return mS(this._styles.concat(e))}}}),t}(),f9=pS(function(){},gS);function d9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:a9.inspect(s)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
24
24
  `)!=-1,n=this._styles,i=n.length;i--;){var o=Li[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(u9,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 h9(){var t={};return Object.keys(gS).forEach(function(e){t[e]={get:function(){return mS([e])}}}),t}var p9=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 p9(ce.maps[t],e)}})(hS);var hS;pS(ce,h9())});var bS=y((Jfe,vS)=>{var m9=DS();vS.exports=m9});var wS=y(Hg=>{"use strict";Hg.indent=function(e){return new Array(e+1).join(" ")};Hg.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((Zfe,g9)=>{g9.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(Cu=>{"use strict";var Gr=bS(),ni=wS(),y9=/[^\w\s\n\r\v\t\.,]/i;Cu.version=_S().version;var zg=function(t,e){return t!==void 0||e.renderUndefined},of=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
25
  `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&of(t[0],!0,r))},D9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?Gr[e.stringColor](t):t;var r=t+"";return t===!0?Gr.green(r):t===!1?Gr.red(r):t==null?Gr.grey(r):typeof t=="number"?t>=0?Gr[e.positiveNumberColor](r):Gr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},Gg=function(t,e){return t.multilineStringColor===null||t.noColor?e:Gr[t.multilineStringColor](e)},v9=function(t,e,r){var n=t.split(`
26
26
  `);return n=n.map(function(i){return ni.indent(e)+Gg(r,i)}),n.join(`
27
- `)},cs=function(t,e,r){if(typeof t=="string"&&t.match(y9)&&e.escape&&(t=JSON.stringify(t)),!zg(t,e))return[];if(of(t,!1,e))return[ni.indent(r)+D9(t,e)];if(typeof t=="string")return[ni.indent(r)+Gg(e,'"""'),v9(t,r+e.defaultIndentation,e),ni.indent(r)+Gg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ni.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(zg(a,e)){var u="- ";e.noColor||(u=Gr[e.dashColor](u)),u=ni.indent(r)+u,of(a,!1,e)?(u+=cs(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,cs(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return cs({message:t.message,stack:t.stack.split(`
28
- `)},e,r);var i=e.noAlign?0:ni.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(zg(t[a],e))if(o=a+": ",e.noColor||(o=Gr[e.keysColor](o)),o=ni.indent(r)+o,of(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=cs(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,cs(t[a],e,r+e.defaultIndentation))}),s};Cu.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,cs(e,r,n).join(`
27
+ `)},ls=function(t,e,r){if(typeof t=="string"&&t.match(y9)&&e.escape&&(t=JSON.stringify(t)),!zg(t,e))return[];if(of(t,!1,e))return[ni.indent(r)+D9(t,e)];if(typeof t=="string")return[ni.indent(r)+Gg(e,'"""'),v9(t,r+e.defaultIndentation,e),ni.indent(r)+Gg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ni.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(zg(a,e)){var u="- ";e.noColor||(u=Gr[e.dashColor](u)),u=ni.indent(r)+u,of(a,!1,e)?(u+=ls(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,ls(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return ls({message:t.message,stack:t.stack.split(`
28
+ `)},e,r);var i=e.noAlign?0:ni.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(zg(t[a],e))if(o=a+": ",e.noColor||(o=Gr[e.keysColor](o)),o=ni.indent(r)+o,of(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=ls(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,ls(t[a],e,r+e.defaultIndentation))}),s};Cu.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,ls(e,r,n).join(`
29
29
  `)};Cu.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 Gr.red("Error:")+" Not valid JSON!"}return i+=Cu.render(o,r,n),i}});var Yg=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;function ls(t){"@babel/helpers - typeof";return ls=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},ls(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,w9(n.key),n)}}function b9(t,e,r){return e&&CS(t.prototype,e),r&&CS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w9(t){var e=_9(t,"string");return ls(e)=="symbol"?e:e+""}function _9(t,e){if(ls(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ls(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function E9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C9(t,e,r){return e=xu(e),S9(t,Kg()?Reflect.construct(e,r||[],xu(t).constructor):e.apply(t,r))}function S9(t,e){if(e&&(ls(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x9(t)}function x9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F9(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&&Su(t,e)}function Wg(t){var e=typeof Map=="function"?new Map:void 0;return Wg=function(n){if(n===null||!A9(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 O9(n,arguments,xu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Su(i,n)},Wg(t)}function O9(t,e,r){if(Kg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Su(i,r.prototype),i}function Kg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kg=function(){return!!t})()}function A9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Su(t,e){return Su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Su(t,e)}function xu(t){return xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xu(t)}var k9=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(E9(this,e),n=C9(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 F9(e,t),b9(e)}(Wg(Error)),ede=sf.default=k9});var Jg=y(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.enableDebugLog=T9;af.log=P9;var SS=!1;function T9(){SS=!0}function P9(t){SS&&console.log(t)}});var FS=y(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.default=void 0;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 R9(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,I9(n.key),n)}}function $9(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function I9(t){var e=j9(t,"string");return Fu(e)=="symbol"?e:e+""}function j9(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 nde=uf.default=function(){function t(){R9(this,t)}return $9(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((Xg,Zg)=>{(function(t,e){typeof Xg=="object"&&typeof Zg<"u"?Zg.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:Xg,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,ve,mn="",bp=T.length%3,rl=0;rl<T.length;){if((oe=T.charCodeAt(rl++))>255||(se=T.charCodeAt(rl++))>255||(ve=T.charCodeAt(rl++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|ve,mn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return bp?mn.slice(0,bp-3)+"===".substring(bp):mn},m=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,ve=T.length;se<ve;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return m(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 m(D(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(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,ve,mn=0;mn<T.length;)N=a[T.charAt(mn++)]<<18|a[T.charAt(mn++)]<<12|(se=a[T.charAt(mn++)])<<6|(ve=a[T.charAt(mn++)]),oe+=se===64?c(N>>16&255):ve===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 k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(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:m,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,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((ode,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(Qg=>{"use strict";var N9=Object.prototype.hasOwnProperty,L9;function TS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function PS(t){try{return encodeURIComponent(t)}catch{return null}}function B9(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 q9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(N9.call(t,i)){if(n=t[i],!n&&(n===null||n===L9||isNaN(n))&&(n=""),i=PS(i),n=PS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Qg.stringify=q9;Qg.parse=B9});var MS=y((ade,qS)=>{"use strict";var IS=kS(),cf=RS(),M9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,jS=/[\n\r\t]/g,U9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,NS=/:\d+$/,V9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,H9=/^[a-zA-Z]:/;function ty(t){return(t||"").toString().replace(M9,"")}var ey=[["#","hash"],["?","query"],function(e,r){return Wr(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 Kr(unescape(t.pathname),{});else if(i==="string"){n=new Kr(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=U9.test(t.href))}return n}function Wr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function BS(t,e){t=ty(t),t=t.replace(jS,""),e=e||{};var r=V9.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)):Wr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Wr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Wr(n),slashesCount:s,rest:a}}function z9(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 Kr(t,e,r){if(t=ty(t),t=t.replace(jS,""),!(this instanceof Kr))return new Kr(t,e,r);var n,i,o,s,a,u,c=ey.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=cf.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||H9.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Wr(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=z9(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Wr(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:"&&Wr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function G9(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||cf.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<ey.length;s++){var a=ey[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:"&&Wr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function W9(t){(!t||typeof t!="function")&&(t=cf.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||Wr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Wr(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}Kr.prototype={set:G9,toString:W9};Kr.extractProtocol=BS;Kr.location=LS;Kr.trimLeft=ty;Kr.qs=cf;qS.exports=Kr});var US=y(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.default=K9;function K9(){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(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;var Y9=OS(),J9=sy(MS()),lf=sy(Yg()),Bi=Jg(),X9=sy(US());function sy(t){return t&&t.__esModule?t:{default: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",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(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(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):v.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,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===m)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=m;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 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 Z9(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 t7(t)||e7(t,e)||QS(t,e)||Q9()}function Q9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return Gr.red("Error:")+" Not valid JSON!"}return i+=Cu.render(o,r,n),i}});var Yg=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;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 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,w9(n.key),n)}}function b9(t,e,r){return e&&CS(t.prototype,e),r&&CS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w9(t){var e=_9(t,"string");return fs(e)=="symbol"?e:e+""}function _9(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)}function E9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C9(t,e,r){return e=xu(e),S9(t,Kg()?Reflect.construct(e,r||[],xu(t).constructor):e.apply(t,r))}function S9(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 x9(t)}function x9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F9(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&&Su(t,e)}function Wg(t){var e=typeof Map=="function"?new Map:void 0;return Wg=function(n){if(n===null||!A9(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 O9(n,arguments,xu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Su(i,n)},Wg(t)}function O9(t,e,r){if(Kg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Su(i,r.prototype),i}function Kg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kg=function(){return!!t})()}function A9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Su(t,e){return Su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Su(t,e)}function xu(t){return xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xu(t)}var k9=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(E9(this,e),n=C9(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 F9(e,t),b9(e)}(Wg(Error)),ede=sf.default=k9});var Jg=y(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.enableDebugLog=T9;af.log=P9;var SS=!1;function T9(){SS=!0}function P9(t){SS&&console.log(t)}});var FS=y(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.default=void 0;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 R9(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,I9(n.key),n)}}function $9(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function I9(t){var e=j9(t,"string");return Fu(e)=="symbol"?e:e+""}function j9(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 nde=uf.default=function(){function t(){R9(this,t)}return $9(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((Xg,Zg)=>{(function(t,e){typeof Xg=="object"&&typeof Zg<"u"?Zg.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:Xg,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,ve,mn="",bp=T.length%3,rl=0;rl<T.length;){if((oe=T.charCodeAt(rl++))>255||(se=T.charCodeAt(rl++))>255||(ve=T.charCodeAt(rl++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|ve,mn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return bp?mn.slice(0,bp-3)+"===".substring(bp):mn},m=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,ve=T.length;se<ve;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return m(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 m(D(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(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,ve,mn=0;mn<T.length;)N=a[T.charAt(mn++)]<<18|a[T.charAt(mn++)]<<12|(se=a[T.charAt(mn++)])<<6|(ve=a[T.charAt(mn++)]),oe+=se===64?c(N>>16&255):ve===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 k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(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:m,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,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((ode,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(Qg=>{"use strict";var N9=Object.prototype.hasOwnProperty,L9;function TS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function PS(t){try{return encodeURIComponent(t)}catch{return null}}function B9(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 q9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(N9.call(t,i)){if(n=t[i],!n&&(n===null||n===L9||isNaN(n))&&(n=""),i=PS(i),n=PS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Qg.stringify=q9;Qg.parse=B9});var MS=y((ade,qS)=>{"use strict";var IS=kS(),cf=RS(),M9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,jS=/[\n\r\t]/g,U9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,NS=/:\d+$/,V9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,H9=/^[a-zA-Z]:/;function ty(t){return(t||"").toString().replace(M9,"")}var ey=[["#","hash"],["?","query"],function(e,r){return Wr(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 Kr(unescape(t.pathname),{});else if(i==="string"){n=new Kr(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=U9.test(t.href))}return n}function Wr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function BS(t,e){t=ty(t),t=t.replace(jS,""),e=e||{};var r=V9.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)):Wr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Wr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Wr(n),slashesCount:s,rest:a}}function z9(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 Kr(t,e,r){if(t=ty(t),t=t.replace(jS,""),!(this instanceof Kr))return new Kr(t,e,r);var n,i,o,s,a,u,c=ey.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=cf.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||H9.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Wr(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=z9(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Wr(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:"&&Wr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function G9(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||cf.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<ey.length;s++){var a=ey[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:"&&Wr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function W9(t){(!t||typeof t!="function")&&(t=cf.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||Wr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Wr(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}Kr.prototype={set:G9,toString:W9};Kr.extractProtocol=BS;Kr.location=LS;Kr.trimLeft=ty;Kr.qs=cf;qS.exports=Kr});var US=y(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.default=K9;function K9(){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(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;var Y9=OS(),J9=sy(MS()),lf=sy(Yg()),Bi=Jg(),X9=sy(US());function sy(t){return t&&t.__esModule?t:{default: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",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(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(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):v.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,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===m)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=m;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 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 Z9(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 t7(t)||e7(t,e)||QS(t,e)||Q9()}function Q9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
31
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e7(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 t7(t){if(Array.isArray(t))return t}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 r7(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 fs(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){n7(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 n7(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 i7(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 o7(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=s7(t,"string");return qi(e)=="symbol"?e:e+""}function s7(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)}var iy="tus-v1",ff="ietf-draft-03",a7={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:iy},t1=function(){function t(e,r){i7(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 o7(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(![iy,ff].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,Bi.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Bi.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:c7(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 m=d.value;return new Promise(function(b,g){var w=fs(fs({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:fs(fs({},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(m,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(!ds(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,Bi.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,Bi.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Bi.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Bi.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=r7(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 lf.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===ff&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!ds(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,Bi.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(!ds(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(ds(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===iy){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(!ds(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===ff&&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 lf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof lf.default||(o=new lf.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=fs(fs({},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(Y9.Base64.encode(String(i)))}).join(",")}function ds(t,e){return t>=e&&t<e+100}function KS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===ff?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,X9.default)();n.setHeader("X-Request-ID",l)}return n}function YS(t,e,r){return oy.apply(this,arguments)}function oy(){return oy=Z9(ny().mark(function t(e,r,n){var i;return ny().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)})),oy.apply(this,arguments)}function u7(){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(!ds(e,400)||e===409||e===423)&&u7()}function XS(t,e){return new J9.default(e,t).toString()}function c7(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=a7;var cde=df.default=t1});var o1=y((fde,i1)=>{"use strict";var Yr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Yr.writable=t=>Yr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Yr.readable=t=>Yr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Yr.duplex=t=>Yr.writable(t)&&Yr.readable(t);Yr.transform=t=>Yr.duplex(t)&&typeof t._transform=="function";i1.exports=Yr});var a1=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;function Ou(t){"@babel/helpers - typeof";return Ou=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},Ou(t)}function l7(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,d7(n.key),n)}}function f7(t,e,r){return e&&s1(t.prototype,e),r&&s1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d7(t){var e=h7(t,"string");return Ou(e)=="symbol"?e:e+""}function h7(t,e){if(Ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var dde=hf.default=function(){function t(e){l7(this,t),this._buffer=e,this.size=e.length}return f7(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(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.default=v7;var l1=require("fs");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 ay(){"use strict";ay=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",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(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(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):v.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,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===m)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=m;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 p7(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,g7(n.key),n)}}function m7(t,e,r){return e&&u1(t.prototype,e),r&&u1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function g7(t){var e=y7(t,"string");return Mi(e)=="symbol"?e:e+""}function y7(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 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 D7(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 v7(t){return uy.apply(this,arguments)}function uy(){return uy=D7(ay().mark(function t(e){var r,n,i,o,s,a,u;return ay().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 b7(e,n,u));case 9:case"end":return l.stop()}},t)})),uy.apply(this,arguments)}var b7=function(){function t(e,r,n){p7(this,t),this._stream=e,this._path=r,this.size=n}return m7(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 fy=y(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.default=void 0;function Ui(t){"@babel/helpers - typeof";return Ui=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},Ui(t)}function Au(){"use strict";Au=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",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(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&&Ui(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):v.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,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===m)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=m;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(Ui(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 w7(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,E7(n.key),n)}}function _7(t,e,r){return e&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E7(t){var e=C7(t,"string");return Ui(e)=="symbol"?e:e+""}function C7(t,e){if(Ui(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ui(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 S7(t,e){return ly.apply(this,arguments)}function ly(){return ly=p1(Au().mark(function t(e,r){return Au().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)})),ly.apply(this,arguments)}var mde=pf.default=function(){function t(e){var r=this;w7(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 _7(t,[{key:"slice",value:function(){var e=p1(Au().mark(function n(i,o){var s,a,u,c,l;return Au().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,S7(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(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.default=void 0;var x7=require("fs"),F7=mf(o1()),O7=mf(a1()),A7=mf(f1()),k7=mf(fy());function mf(t){return t&&t.__esModule?t:{default:t}}function ku(t){"@babel/helpers - typeof";return ku=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},ku(t)}function T7(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,R7(n.key),n)}}function P7(t,e,r){return e&&m1(t.prototype,e),r&&m1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R7(t){var e=$7(t,"string");return ku(e)=="symbol"?e:e+""}function $7(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yde=gf.default=function(){function t(){T7(this,t)}return P7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new O7.default(r)):r instanceof x7.ReadStream&&r.path!=null?(0,A7.default)(r):F7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new k7.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(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.default=N7;var I7=require("crypto"),y1=v1(require("fs")),j7=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 N7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,I7.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=j7.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((bde,C1)=>{var E1="Expected a function",w1=NaN,L7="[object Symbol]",B7=/^\s+|\s+$/g,q7=/^[-+]0x[0-9a-f]+$/i,M7=/^0b[01]+$/i,U7=/^0o[0-7]+$/i,V7=parseInt,H7=typeof global=="object"&&global&&global.Object===Object&&global,z7=typeof self=="object"&&self&&self.Object===Object&&self,G7=H7||z7||Function("return this")(),W7=Object.prototype,K7=W7.toString,Y7=Math.max,J7=Math.min,hy=function(){return G7.Date.now()};function X7(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,yf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?Y7(_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 m($){return c=$,a=setTimeout(w,e),l?d($):s}function b($){var F=$-u,L=$-c,S=e-F;return f?J7(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 $=hy();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(hy())}function k(){var $=hy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return m(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=D,k.flush=C,k}function Z7(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(E1);return yf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),X7(t,e,{leading:n,maxWait:e,trailing:i})}function yf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Q7(t){return!!t&&typeof t=="object"}function eV(t){return typeof t=="symbol"||Q7(t)&&K7.call(t)==L7}function _1(t){if(typeof t=="number")return t;if(eV(t))return w1;if(yf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=yf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(B7,"");var r=M7.test(t);return r||U7.test(t)?V7(t.slice(2),r?2:8):q7.test(t)?w1:+t}C1.exports=Z7});var $1=y(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.default=void 0;var tV=T1(require("http")),rV=T1(require("https")),O1=require("stream"),nV=require("url"),A1=iV(S1());function iV(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 oV(t,e,r){return e=Df(e),sV(t,P1()?Reflect.construct(e,r||[],Df(t).constructor):e.apply(t,r))}function sV(t,e){if(e&&(hs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aV(t)}function aV(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 Df(t){return Df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Df(t)}function uV(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&&py(t,e)}function py(t,e){return py=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},py(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 Tu(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){cV(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 cV(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 hs(t){"@babel/helpers - typeof";return hs=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},hs(t)}function vf(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 bf(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=lV(t,"string");return hs(e)=="symbol"?e:e+""}function lV(t,e){if(hs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var wde=wf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vf(this,t),this._requestOptions=e}return bf(t,[{key:"createRequest",value:function(r,n){return new fV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),fV=function(){function t(e,r,n){vf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return bf(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=Tu(Tu(Tu({},(0,nV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Tu(Tu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?rV:tV;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 dV(c,f))})}),u.on("error",function(c){o(c)}),n instanceof O1.Readable?n.pipe(new hV(r._progressHandler)).pipe(u):n instanceof Uint8Array?pV(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}}])}(),dV=function(){function t(e,r){vf(this,t),this._response=e,this._body=r}return bf(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}}])}(),hV=function(t){function e(r){var n;return vf(this,e),n=oV(this,e),n._onprogress=(0,A1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return uV(e,t),bf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(O1.Transform),pV=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(my=>{"use strict";my.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};my.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(`
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 ds(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){n7(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 n7(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 i7(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 o7(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=s7(t,"string");return qi(e)=="symbol"?e:e+""}function s7(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)}var iy="tus-v1",ff="ietf-draft-03",a7={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:iy},t1=function(){function t(e,r){i7(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 o7(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(![iy,ff].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,Bi.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Bi.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:c7(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 m=d.value;return new Promise(function(b,g){var w=ds(ds({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ds(ds({},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(m,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(!hs(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,Bi.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,Bi.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Bi.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Bi.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=r7(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 lf.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===ff&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!hs(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,Bi.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(!hs(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(hs(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===iy){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(!hs(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===ff&&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 lf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof lf.default||(o=new lf.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=ds(ds({},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(Y9.Base64.encode(String(i)))}).join(",")}function hs(t,e){return t>=e&&t<e+100}function KS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===ff?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,X9.default)();n.setHeader("X-Request-ID",l)}return n}function YS(t,e,r){return oy.apply(this,arguments)}function oy(){return oy=Z9(ny().mark(function t(e,r,n){var i;return ny().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)})),oy.apply(this,arguments)}function u7(){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(!hs(e,400)||e===409||e===423)&&u7()}function XS(t,e){return new J9.default(e,t).toString()}function c7(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=a7;var cde=df.default=t1});var o1=y((fde,i1)=>{"use strict";var Yr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Yr.writable=t=>Yr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Yr.readable=t=>Yr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Yr.duplex=t=>Yr.writable(t)&&Yr.readable(t);Yr.transform=t=>Yr.duplex(t)&&typeof t._transform=="function";i1.exports=Yr});var a1=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;function Ou(t){"@babel/helpers - typeof";return Ou=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},Ou(t)}function l7(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,d7(n.key),n)}}function f7(t,e,r){return e&&s1(t.prototype,e),r&&s1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d7(t){var e=h7(t,"string");return Ou(e)=="symbol"?e:e+""}function h7(t,e){if(Ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var dde=hf.default=function(){function t(e){l7(this,t),this._buffer=e,this.size=e.length}return f7(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(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.default=v7;var l1=require("fs");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 ay(){"use strict";ay=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",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(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(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):v.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,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===m)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=m;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 p7(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,g7(n.key),n)}}function m7(t,e,r){return e&&u1(t.prototype,e),r&&u1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function g7(t){var e=y7(t,"string");return Mi(e)=="symbol"?e:e+""}function y7(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 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 D7(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 v7(t){return uy.apply(this,arguments)}function uy(){return uy=D7(ay().mark(function t(e){var r,n,i,o,s,a,u;return ay().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 b7(e,n,u));case 9:case"end":return l.stop()}},t)})),uy.apply(this,arguments)}var b7=function(){function t(e,r,n){p7(this,t),this._stream=e,this._path=r,this.size=n}return m7(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 fy=y(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.default=void 0;function Ui(t){"@babel/helpers - typeof";return Ui=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},Ui(t)}function Au(){"use strict";Au=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",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(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&&Ui(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):v.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,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===m)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=m;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(Ui(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 w7(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,E7(n.key),n)}}function _7(t,e,r){return e&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E7(t){var e=C7(t,"string");return Ui(e)=="symbol"?e:e+""}function C7(t,e){if(Ui(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ui(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 S7(t,e){return ly.apply(this,arguments)}function ly(){return ly=p1(Au().mark(function t(e,r){return Au().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)})),ly.apply(this,arguments)}var mde=pf.default=function(){function t(e){var r=this;w7(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 _7(t,[{key:"slice",value:function(){var e=p1(Au().mark(function n(i,o){var s,a,u,c,l;return Au().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,S7(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(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.default=void 0;var x7=require("fs"),F7=mf(o1()),O7=mf(a1()),A7=mf(f1()),k7=mf(fy());function mf(t){return t&&t.__esModule?t:{default:t}}function ku(t){"@babel/helpers - typeof";return ku=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},ku(t)}function T7(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,R7(n.key),n)}}function P7(t,e,r){return e&&m1(t.prototype,e),r&&m1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R7(t){var e=$7(t,"string");return ku(e)=="symbol"?e:e+""}function $7(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yde=gf.default=function(){function t(){T7(this,t)}return P7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new O7.default(r)):r instanceof x7.ReadStream&&r.path!=null?(0,A7.default)(r):F7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new k7.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(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.default=N7;var I7=require("crypto"),y1=v1(require("fs")),j7=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 N7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,I7.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=j7.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((bde,C1)=>{var E1="Expected a function",w1=NaN,L7="[object Symbol]",B7=/^\s+|\s+$/g,q7=/^[-+]0x[0-9a-f]+$/i,M7=/^0b[01]+$/i,U7=/^0o[0-7]+$/i,V7=parseInt,H7=typeof global=="object"&&global&&global.Object===Object&&global,z7=typeof self=="object"&&self&&self.Object===Object&&self,G7=H7||z7||Function("return this")(),W7=Object.prototype,K7=W7.toString,Y7=Math.max,J7=Math.min,hy=function(){return G7.Date.now()};function X7(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,yf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?Y7(_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 m($){return c=$,a=setTimeout(w,e),l?d($):s}function b($){var F=$-u,L=$-c,S=e-F;return f?J7(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 $=hy();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(hy())}function k(){var $=hy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return m(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=D,k.flush=C,k}function Z7(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(E1);return yf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),X7(t,e,{leading:n,maxWait:e,trailing:i})}function yf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Q7(t){return!!t&&typeof t=="object"}function eV(t){return typeof t=="symbol"||Q7(t)&&K7.call(t)==L7}function _1(t){if(typeof t=="number")return t;if(eV(t))return w1;if(yf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=yf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(B7,"");var r=M7.test(t);return r||U7.test(t)?V7(t.slice(2),r?2:8):q7.test(t)?w1:+t}C1.exports=Z7});var $1=y(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.default=void 0;var tV=T1(require("http")),rV=T1(require("https")),O1=require("stream"),nV=require("url"),A1=iV(S1());function iV(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 oV(t,e,r){return e=Df(e),sV(t,P1()?Reflect.construct(e,r||[],Df(t).constructor):e.apply(t,r))}function sV(t,e){if(e&&(ps(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aV(t)}function aV(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 Df(t){return Df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Df(t)}function uV(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&&py(t,e)}function py(t,e){return py=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},py(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 Tu(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){cV(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 cV(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 ps(t){"@babel/helpers - typeof";return ps=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},ps(t)}function vf(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 bf(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=lV(t,"string");return ps(e)=="symbol"?e:e+""}function lV(t,e){if(ps(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var wde=wf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vf(this,t),this._requestOptions=e}return bf(t,[{key:"createRequest",value:function(r,n){return new fV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),fV=function(){function t(e,r,n){vf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return bf(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=Tu(Tu(Tu({},(0,nV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Tu(Tu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?rV:tV;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 dV(c,f))})}),u.on("error",function(c){o(c)}),n instanceof O1.Readable?n.pipe(new hV(r._progressHandler)).pipe(u):n instanceof Uint8Array?pV(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}}])}(),dV=function(){function t(e,r){vf(this,t),this._response=e,this._body=r}return bf(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}}])}(),hV=function(t){function e(r){var n;return vf(this,e),n=oV(this,e),n._onprogress=(0,A1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return uV(e,t),bf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(O1.Transform),pV=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(my=>{"use strict";my.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};my.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((Cde,N1)=>{"use strict";N1.exports=Vi;Vi.factory=I1();var Dy=Vi("CustomError");Dy.order=Vi(Dy,{message:"Arguments out of order.",code:"EOARG"});function Vi(t,e,r,n){var i,o;return e=_f(arguments,1,Error,j1,[gy,Ef]),r=_f(arguments,2,{},gy,[Ef]),n=_f(arguments,3,yy,Ef,[]),t=_f(arguments,0,e===Error?"Error":e.prototype.CustomError.name,mV,[j1,gy,Ef]),o=e===Error,o&&n===yy&&(n=Vi.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(m){return m.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Vi.factory).forEach(function(m){l[m]=function(b,g){Vi.factory[m].call(u,b,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==yy&&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 _f(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 Dy.order;return s!==-1?t[s]:r}function Ef(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function mV(t){return typeof t=="string"}function j1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function gy(t){return t&&typeof t=="object"}function yy(){}});var q1=y((Sde,B1)=>{B1.exports=L1()});var z1=y((Hi,ps)=>{var gV=1/0,yV="[object Symbol]",Pu={function:!0,object:!0},DV=Pu[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,vV=Pu[typeof ps]&&ps&&!ps.nodeType?ps:void 0,bV=Cf(DV&&vV&&typeof global=="object"&&global),wV=Cf(Pu[typeof self]&&self),M1=Cf(Pu[typeof window]&&window),vy=Cf(Pu[typeof Hi]&&Hi),_V=bV||M1!==(vy&&vy.window)&&M1||wV||vy||Function("return this")();function Cf(t){return t&&t.Object===Object?t:null}var EV=Object.prototype,CV=EV.toString,U1=_V.Symbol,V1=U1?U1.prototype:void 0,H1=V1?V1.toString:void 0;function SV(t){if(typeof t=="string")return t;if(FV(t))return H1?H1.call(t):"";var e=t+"";return e=="0"&&1/t==-gV?"-0":e}function xV(t){return!!t&&typeof t=="object"}function FV(t){return typeof t=="symbol"||xV(t)&&CV.call(t)==yV}ps.exports=SV});var Z1=y((zi,ms)=>{var OV=z1(),AV="Expected a function",W1="__lodash_hash_undefined__",kV="[object Function]",TV="[object GeneratorFunction]",PV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,RV=/[\\^$.*+?()[\]{}|]/g,$V=/\\(\\)?/g,IV=/^\[object .+?Constructor\]$/,$u={function:!0,object:!0},jV=$u[typeof zi]&&zi&&!zi.nodeType?zi:void 0,NV=$u[typeof ms]&&ms&&!ms.nodeType?ms:void 0,LV=Sf(jV&&NV&&typeof global=="object"&&global),BV=Sf($u[typeof self]&&self),G1=Sf($u[typeof window]&&window),by=Sf($u[typeof zi]&&zi),qV=LV||G1!==(by&&by.window)&&G1||BV||by||Function("return this")();function Sf(t){return t&&t.Object===Object?t:null}function MV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var UV=Array.prototype,K1=Object.prototype,Y1=Function.prototype.toString,wy=K1.hasOwnProperty,VV=K1.toString,HV=RegExp("^"+Y1.call(wy).replace(RV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zV=UV.splice,GV=J1(qV,"Map"),Ru=J1(Object,"create");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 WV(){this.__data__=Ru?Ru(null):{}}function KV(t){return this.has(t)&&delete this.__data__[t]}function YV(t){var e=this.__data__;if(Ru){var r=e[t];return r===W1?void 0:r}return wy.call(e,t)?e[t]:void 0}function JV(t){var e=this.__data__;return Ru?e[t]!==void 0:wy.call(e,t)}function XV(t,e){var r=this.__data__;return r[t]=Ru&&e===void 0?W1:e,this}Gi.prototype.clear=WV;Gi.prototype.delete=KV;Gi.prototype.get=YV;Gi.prototype.has=JV;Gi.prototype.set=XV;function gs(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__=[]}function QV(t){var e=this.__data__,r=xf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():zV.call(e,r,1),!0}function eH(t){var e=this.__data__,r=xf(e,t);return r<0?void 0:e[r][1]}function tH(t){return xf(this.__data__,t)>-1}function rH(t,e){var r=this.__data__,n=xf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}gs.prototype.clear=ZV;gs.prototype.delete=QV;gs.prototype.get=eH;gs.prototype.has=tH;gs.prototype.set=rH;function Wi(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 nH(){this.__data__={hash:new Gi,map:new(GV||gs),string:new Gi}}function iH(t){return Ff(this,t).delete(t)}function oH(t){return Ff(this,t).get(t)}function sH(t){return Ff(this,t).has(t)}function aH(t,e){return Ff(this,t).set(t,e),this}Wi.prototype.clear=nH;Wi.prototype.delete=iH;Wi.prototype.get=oH;Wi.prototype.has=sH;Wi.prototype.set=aH;function xf(t,e){for(var r=t.length;r--;)if(fH(t[r][0],e))return r;return-1}function Ff(t,e){var r=t.__data__;return uH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function J1(t,e){var r=t[e];return hH(r)?r:void 0}function uH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var cH=_y(function(t){var e=[];return pH(t).replace(PV,function(r,n,i,o){e.push(i?o.replace($V,"$1"):n||r)}),e});function lH(t){if(t!=null){try{return Y1.call(t)}catch{}try{return t+""}catch{}}return""}function _y(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(AV);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(_y.Cache||Wi),r}_y.Cache=Wi;function fH(t,e){return t===e||t!==t&&e!==e}function dH(t){var e=X1(t)?VV.call(t):"";return e==kV||e==TV}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function hH(t){if(!X1(t))return!1;var e=dH(t)||MV(t)?HV:IV;return e.test(lH(t))}function pH(t){return t==null?"":OV(t)}ms.exports=cH});var Ox=y((Ki,Ds)=>{var mH=Z1(),gH=200,Ry="__lodash_hash_undefined__",Pf=1,vs=2,yH=1/0,ix=9007199254740991,Of="[object Arguments]",Sy="[object Array]",ox="[object Boolean]",sx="[object Date]",ax="[object Error]",ux="[object Function]",DH="[object GeneratorFunction]",Iu="[object Map]",cx="[object Number]",ys="[object Object]",Q1="[object Promise]",lx="[object RegExp]",ju="[object Set]",$y="[object String]",fx="[object Symbol]",xy="[object WeakMap]",dx="[object ArrayBuffer]",Af="[object DataView]",vH="[object Float32Array]",bH="[object Float64Array]",wH="[object Int8Array]",_H="[object Int16Array]",EH="[object Int32Array]",CH="[object Uint8Array]",SH="[object Uint8ClampedArray]",xH="[object Uint16Array]",FH="[object Uint32Array]",OH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,AH=/^\w*$/,kH=/[\\^$.*+?()[\]{}|]/g,TH=/^\[object .+?Constructor\]$/,PH=/^(?:0|[1-9]\d*)$/,Re={};Re[vH]=Re[bH]=Re[wH]=Re[_H]=Re[EH]=Re[CH]=Re[SH]=Re[xH]=Re[FH]=!0;Re[Of]=Re[Sy]=Re[dx]=Re[ox]=Re[Af]=Re[sx]=Re[ax]=Re[ux]=Re[Iu]=Re[cx]=Re[ys]=Re[lx]=Re[ju]=Re[$y]=Re[xy]=!1;var Lu={function:!0,object:!0},RH=Lu[typeof Ki]&&Ki&&!Ki.nodeType?Ki:void 0,$H=Lu[typeof Ds]&&Ds&&!Ds.nodeType?Ds:void 0,IH=Rf(RH&&$H&&typeof global=="object"&&global),jH=Rf(Lu[typeof self]&&self),ex=Rf(Lu[typeof window]&&window),Ey=Rf(Lu[typeof Ki]&&Ki),Xi=IH||ex!==(Ey&&Ey.window)&&ex||jH||Ey||Function("return this")();function NH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function LH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function BH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function qH(t,e){return NH(e,function(r){return[r,t[r]]})}function Rf(t){return t&&t.Object===Object?t:null}function Fy(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 MH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function UH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var VH=Array.prototype,$f=Object.prototype,px=Function.prototype.toString,Yi=$f.hasOwnProperty,Zi=$f.toString,HH=RegExp("^"+px.call(Yi).replace(kH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=Xi.Symbol,rx=Xi.Uint8Array,zH=$f.propertyIsEnumerable,GH=VH.splice,WH=Object.getPrototypeOf,KH=Object.keys,Oy=bs(Xi,"DataView"),kf=bs(Xi,"Map"),Ay=bs(Xi,"Promise"),ky=bs(Xi,"Set"),Ty=bs(Xi,"WeakMap"),Nu=bs(Object,"create"),YH=eo(Oy),JH=eo(kf),XH=eo(Ay),ZH=eo(ky),QH=eo(Ty),nx=tx?tx.prototype:void 0,Cy=nx?nx.valueOf:void 0;function Ji(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 ez(){this.__data__=Nu?Nu(null):{}}function tz(t){return this.has(t)&&delete this.__data__[t]}function rz(t){var e=this.__data__;if(Nu){var r=e[t];return r===Ry?void 0:r}return Yi.call(e,t)?e[t]:void 0}function nz(t){var e=this.__data__;return Nu?e[t]!==void 0:Yi.call(e,t)}function iz(t,e){var r=this.__data__;return r[t]=Nu&&e===void 0?Ry:e,this}Ji.prototype.clear=ez;Ji.prototype.delete=tz;Ji.prototype.get=rz;Ji.prototype.has=nz;Ji.prototype.set=iz;function _n(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 oz(){this.__data__=[]}function sz(t){var e=this.__data__,r=If(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():GH.call(e,r,1),!0}function az(t){var e=this.__data__,r=If(e,t);return r<0?void 0:e[r][1]}function uz(t){return If(this.__data__,t)>-1}function cz(t,e){var r=this.__data__,n=If(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}_n.prototype.clear=oz;_n.prototype.delete=sz;_n.prototype.get=az;_n.prototype.has=uz;_n.prototype.set=cz;function Qi(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 lz(){this.__data__={hash:new Ji,map:new(kf||_n),string:new Ji}}function fz(t){return jf(this,t).delete(t)}function dz(t){return jf(this,t).get(t)}function hz(t){return jf(this,t).has(t)}function pz(t,e){return jf(this,t).set(t,e),this}Qi.prototype.clear=lz;Qi.prototype.delete=fz;Qi.prototype.get=dz;Qi.prototype.has=hz;Qi.prototype.set=pz;function Tf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Qi;++e<r;)this.add(t[e])}function mz(t){return this.__data__.set(t,Ry),this}function gz(t){return this.__data__.has(t)}Tf.prototype.add=Tf.prototype.push=mz;Tf.prototype.has=gz;function wn(t){this.__data__=new _n(t)}function yz(){this.__data__=new _n}function Dz(t){return this.__data__.delete(t)}function vz(t){return this.__data__.get(t)}function bz(t){return this.__data__.has(t)}function wz(t,e){var r=this.__data__;return r instanceof _n&&r.__data__.length==gH&&(r=this.__data__=new Qi(r.__data__)),r.set(t,e),this}wn.prototype.clear=yz;wn.prototype.delete=Dz;wn.prototype.get=vz;wn.prototype.has=bz;wn.prototype.set=wz;function If(t,e){for(var r=t.length;r--;)if(qz(t[r][0],e))return r;return-1}function mx(t,e){e=Nf(e,t)?[e]:Dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lf(e[r++])];return r&&r==n?t:void 0}function gx(t,e){return Yi.call(t,e)||typeof t=="object"&&e in t&&Iz(t)===null}function _z(t,e){return e in Object(t)}function Iy(t,e,r,n,i){return t===e?!0:t==null||e==null||!qf(t)&&!Bu(e)?t!==t&&e!==e:Ez(t,e,Iy,r,n,i)}function Ez(t,e,r,n,i,o){var s=ii(t),a=ii(e),u=Sy,c=Sy;s||(u=bn(t),u=u==Of?ys:u),a||(c=bn(e),c=c==Of?ys:c);var l=u==ys&&!Fy(t),f=c==ys&&!Fy(e),h=u==c;if(h&&!l)return o||(o=new wn),s||Vz(t)?vx(t,e,r,n,i,o):Tz(t,e,u,r,n,i,o);if(!(i&vs)){var d=l&&Yi.call(t,"__wrapped__"),m=f&&Yi.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,g=m?e.value():e;return o||(o=new wn),r(b,g,n,i,o)}}return h?(o||(o=new wn),Pz(t,e,r,n,i,o)):!1}function Cz(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 wn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Iy(l,c,n,Pf|vs,f):h))return!1}}return!0}function Sz(t){return typeof t=="function"?t:t==null?Wz:typeof t=="object"?ii(t)?Oz(t[0],t[1]):Fz(t):Kz(t)}function xz(t){return KH(Object(t))}function Fz(t){var e=$z(t);return e.length==1&&e[0][2]?_x(e[0][0],e[0][1]):function(r){return r===t||Cz(r,t,e)}}function Oz(t,e){return Nf(t)&&wx(e)?_x(Lf(t),e):function(r){var n=Hz(r,t);return n===void 0&&n===e?zz(r,t):Iy(e,n,void 0,Pf|vs)}}function yx(t){return function(e){return e?.[t]}}function Az(t){return function(e){return mx(e,t)}}function Dx(t){return ii(t)?t:mH(t)}function kz(t){return function(e){var r=bn(e);return r==Iu?hx(e):r==ju?UH(e):qH(e,t(e))}}function vx(t,e,r,n,i,o){var s=i&vs,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&Pf?new Tf:void 0;for(o.set(t,e);++l<a;){var d=t[l],m=e[l];if(n)var b=s?n(m,d,l,e,t,o):n(d,m,l,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!LH(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===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function Tz(t,e,r,n,i,o,s){switch(r){case Af: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 $y:return t==e+"";case Iu:var a=hx;case ju:var u=o&vs;if(a||(a=MH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Pf,s.set(t,e),vx(a(t),a(e),n,i,o,s));case fx:if(Cy)return Cy.call(t)==Cy.call(e)}return!1}function Pz(t,e,r,n,i,o){var s=i&vs,a=Py(t),u=a.length,c=Py(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 m=!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)){m=!1;break}b||(b=h=="constructor")}if(m&&!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)&&(m=!1)}return o.delete(t),m}var Rz=yx("length");function jf(t,e){var r=t.__data__;return Lz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function $z(t){for(var e=Gz(t),r=e.length;r--;)e[r][2]=wx(e[r][1]);return e}function bs(t,e){var r=t[e];return Uz(r)?r:void 0}function Iz(t){return WH(Object(t))}function bn(t){return Zi.call(t)}(Oy&&bn(new Oy(new ArrayBuffer(1)))!=Af||kf&&bn(new kf)!=Iu||Ay&&bn(Ay.resolve())!=Q1||ky&&bn(new ky)!=ju||Ty&&bn(new Ty)!=xy)&&(bn=function(t){var e=Zi.call(t),r=e==ys?t.constructor:void 0,n=r?eo(r):void 0;if(n)switch(n){case YH:return Af;case JH:return Iu;case XH:return Q1;case ZH:return ju;case QH:return xy}return e});function jz(t,e,r){e=Nf(e,t)?[e]:Dx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Lf(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&&Bf(s)&&bx(o,s)&&(ii(t)||xx(t)||Ex(t))}function Nz(t){var e=t?t.length:void 0;return Bf(e)&&(ii(t)||xx(t)||Ex(t))?BH(e,String):null}function bx(t,e){return e=e??ix,!!e&&(typeof t=="number"||PH.test(t))&&t>-1&&t%1==0&&t<e}function Nf(t,e){if(ii(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Fx(t)?!0:AH.test(t)||!OH.test(t)||e!=null&&t in Object(e)}function Lz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Bz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||$f;return t===r}function wx(t){return t===t&&!qf(t)}function _x(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Lf(t){if(typeof t=="string"||Fx(t))return t;var e=t+"";return e=="0"&&1/t==-yH?"-0":e}function eo(t){if(t!=null){try{return px.call(t)}catch{}try{return t+""}catch{}}return""}function qz(t,e){return t===e||t!==t&&e!==e}function Ex(t){return Mz(t)&&Yi.call(t,"callee")&&(!zH.call(t,"callee")||Zi.call(t)==Of)}var ii=Array.isArray;function Cx(t){return t!=null&&Bf(Rz(t))&&!Sx(t)}function Mz(t){return Bu(t)&&Cx(t)}function Sx(t){var e=qf(t)?Zi.call(t):"";return e==ux||e==DH}function Bf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ix}function qf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Bu(t){return!!t&&typeof t=="object"}function Uz(t){if(!qf(t))return!1;var e=Sx(t)||Fy(t)?HH:TH;return e.test(eo(t))}function xx(t){return typeof t=="string"||!ii(t)&&Bu(t)&&Zi.call(t)==$y}function Fx(t){return typeof t=="symbol"||Bu(t)&&Zi.call(t)==fx}function Vz(t){return Bu(t)&&Bf(t.length)&&!!Re[Zi.call(t)]}function Hz(t,e,r){var n=t==null?void 0:mx(t,e);return n===void 0?r:n}function zz(t,e){return t!=null&&jz(t,e,_z)}function Py(t){var e=Bz(t);if(!(e||Cx(t)))return xz(t);var r=Nz(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 Gz=kz(Py);function Wz(t){return t}function Kz(t){return Nf(t)?yx(Lf(t)):Az(t)}Ds.exports=Sz});var Rx=y((to,ws)=>{var Yz=1/0,Jz="[object Function]",Xz="[object GeneratorFunction]",Zz=/[\\^$.*+?()[\]{}|]/g,Qz=/^\[object .+?Constructor\]$/,qu={function:!0,object:!0},eG=qu[typeof to]&&to&&!to.nodeType?to:void 0,tG=qu[typeof ws]&&ws&&!ws.nodeType?ws:void 0,rG=Mf(eG&&tG&&typeof global=="object"&&global),nG=Mf(qu[typeof self]&&self),Ax=Mf(qu[typeof window]&&window),jy=Mf(qu[typeof to]&&to),iG=rG||Ax!==(jy&&jy.window)&&Ax||nG||jy||Function("return this")();function Mf(t){return t&&t.Object===Object?t:null}function oG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function sG(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,aG=kx.hasOwnProperty,uG=kx.toString,cG=RegExp("^"+Tx.call(aG).replace(Zz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ny=fG(iG,"Set"),lG=Ny&&1/sG(new Ny([,-0]))[1]==Yz?function(t){return new Ny(t)}:mG;function fG(t,e){var r=t[e];return pG(r)?r:void 0}function dG(t){if(t!=null){try{return Tx.call(t)}catch{}try{return t+""}catch{}}return""}function hG(t){var e=Px(t)?uG.call(t):"";return e==Jz||e==Xz}function Px(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function pG(t){if(!Px(t))return!1;var e=hG(t)||oG(t)?cG:Qz;return e.test(dG(t))}function mG(){}ws.exports=lG});var Ix=y((ro,_s)=>{var Mu={function:!0,object:!0},gG=Mu[typeof ro]&&ro&&!ro.nodeType?ro:void 0,yG=Mu[typeof _s]&&_s&&!_s.nodeType?_s:void 0,DG=Uf(gG&&yG&&typeof global=="object"&&global),vG=Uf(Mu[typeof self]&&self),$x=Uf(Mu[typeof window]&&window),Ly=Uf(Mu[typeof ro]&&ro),bG=DG||$x!==(Ly&&Ly.window)&&$x||vG||Ly||Function("return this")();function Uf(t){return t&&t.Object===Object?t:null}_s.exports=bG});var Mx=y((xde,qx)=>{var wG=Rx(),_G=Ix(),EG=200,By="__lodash_hash_undefined__",CG="[object Function]",SG="[object GeneratorFunction]",xG=/[\\^$.*+?()[\]{}|]/g,FG=/^\[object .+?Constructor\]$/;function OG(t,e){return!!t.length&&kG(t,e,0)>-1}function AG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function kG(t,e,r){if(e!==e)return PG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function TG(t,e){return t.has(e)}function PG(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 RG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function $G(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var IG=Array.prototype,jx=Object.prototype,Nx=Function.prototype.toString,qy=jx.hasOwnProperty,jG=jx.toString,NG=RegExp("^"+Nx.call(qy).replace(xG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),LG=IG.splice,BG=Lx(_G,"Map"),Uu=Lx(Object,"create");function no(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 qG(){this.__data__=Uu?Uu(null):{}}function MG(t){return this.has(t)&&delete this.__data__[t]}function UG(t){var e=this.__data__;if(Uu){var r=e[t];return r===By?void 0:r}return qy.call(e,t)?e[t]:void 0}function VG(t){var e=this.__data__;return Uu?e[t]!==void 0:qy.call(e,t)}function HG(t,e){var r=this.__data__;return r[t]=Uu&&e===void 0?By:e,this}no.prototype.clear=qG;no.prototype.delete=MG;no.prototype.get=UG;no.prototype.has=VG;no.prototype.set=HG;function Es(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 zG(){this.__data__=[]}function GG(t){var e=this.__data__,r=Hf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():LG.call(e,r,1),!0}function WG(t){var e=this.__data__,r=Hf(e,t);return r<0?void 0:e[r][1]}function KG(t){return Hf(this.__data__,t)>-1}function YG(t,e){var r=this.__data__,n=Hf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Es.prototype.clear=zG;Es.prototype.delete=GG;Es.prototype.get=WG;Es.prototype.has=KG;Es.prototype.set=YG;function Cs(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 JG(){this.__data__={hash:new no,map:new(BG||Es),string:new no}}function XG(t){return zf(this,t).delete(t)}function ZG(t){return zf(this,t).get(t)}function QG(t){return zf(this,t).has(t)}function eW(t,e){return zf(this,t).set(t,e),this}Cs.prototype.clear=JG;Cs.prototype.delete=XG;Cs.prototype.get=ZG;Cs.prototype.has=QG;Cs.prototype.set=eW;function Vf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Cs;++e<r;)this.add(t[e])}function tW(t){return this.__data__.set(t,By),this}function rW(t){return this.__data__.has(t)}Vf.prototype.add=Vf.prototype.push=tW;Vf.prototype.has=rW;function Hf(t,e){for(var r=t.length;r--;)if(sW(t[r][0],e))return r;return-1}function nW(t,e,r){var n=-1,i=OG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=AG;else if(o>=EG){var c=e?null:wG(t);if(c)return $G(c);s=!1,i=TG,u=new Vf}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 zf(t,e){var r=t.__data__;return iW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Lx(t,e){var r=t[e];return uW(r)?r:void 0}function iW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function oW(t){if(t!=null){try{return Nx.call(t)}catch{}try{return t+""}catch{}}return""}function sW(t,e){return t===e||t!==t&&e!==e}function aW(t){var e=Bx(t)?jG.call(t):"";return e==CG||e==SG}function Bx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function uW(t){if(!Bx(t))return!1;var e=aW(t)||RG(t)?NG:FG;return e.test(oW(t))}qx.exports=nW});var Vx=y((Fde,Ux)=>{var cW=Ox(),lW=Mx();function fW(t,e){return t&&t.length?lW(t,cW(e)):[]}Ux.exports=fW});var zx=y((Ode,Hx)=>{"use strict";var dW=q1(),hW=Vx(),pW=dW("MultiError");Hx.exports=My;function My(t){if(!(this instanceof My))return new My(t);if(t=Array.isArray(t)?t:[t],t=hW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new pW({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((Cde,N1)=>{"use strict";N1.exports=Vi;Vi.factory=I1();var Dy=Vi("CustomError");Dy.order=Vi(Dy,{message:"Arguments out of order.",code:"EOARG"});function Vi(t,e,r,n){var i,o;return e=_f(arguments,1,Error,j1,[gy,Ef]),r=_f(arguments,2,{},gy,[Ef]),n=_f(arguments,3,yy,Ef,[]),t=_f(arguments,0,e===Error?"Error":e.prototype.CustomError.name,mV,[j1,gy,Ef]),o=e===Error,o&&n===yy&&(n=Vi.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(m){return m.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Vi.factory).forEach(function(m){l[m]=function(b,g){Vi.factory[m].call(u,b,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==yy&&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 _f(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 Dy.order;return s!==-1?t[s]:r}function Ef(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function mV(t){return typeof t=="string"}function j1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function gy(t){return t&&typeof t=="object"}function yy(){}});var q1=y((Sde,B1)=>{B1.exports=L1()});var z1=y((Hi,ms)=>{var gV=1/0,yV="[object Symbol]",Pu={function:!0,object:!0},DV=Pu[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,vV=Pu[typeof ms]&&ms&&!ms.nodeType?ms:void 0,bV=Cf(DV&&vV&&typeof global=="object"&&global),wV=Cf(Pu[typeof self]&&self),M1=Cf(Pu[typeof window]&&window),vy=Cf(Pu[typeof Hi]&&Hi),_V=bV||M1!==(vy&&vy.window)&&M1||wV||vy||Function("return this")();function Cf(t){return t&&t.Object===Object?t:null}var EV=Object.prototype,CV=EV.toString,U1=_V.Symbol,V1=U1?U1.prototype:void 0,H1=V1?V1.toString:void 0;function SV(t){if(typeof t=="string")return t;if(FV(t))return H1?H1.call(t):"";var e=t+"";return e=="0"&&1/t==-gV?"-0":e}function xV(t){return!!t&&typeof t=="object"}function FV(t){return typeof t=="symbol"||xV(t)&&CV.call(t)==yV}ms.exports=SV});var Z1=y((zi,gs)=>{var OV=z1(),AV="Expected a function",W1="__lodash_hash_undefined__",kV="[object Function]",TV="[object GeneratorFunction]",PV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,RV=/[\\^$.*+?()[\]{}|]/g,$V=/\\(\\)?/g,IV=/^\[object .+?Constructor\]$/,$u={function:!0,object:!0},jV=$u[typeof zi]&&zi&&!zi.nodeType?zi:void 0,NV=$u[typeof gs]&&gs&&!gs.nodeType?gs:void 0,LV=Sf(jV&&NV&&typeof global=="object"&&global),BV=Sf($u[typeof self]&&self),G1=Sf($u[typeof window]&&window),by=Sf($u[typeof zi]&&zi),qV=LV||G1!==(by&&by.window)&&G1||BV||by||Function("return this")();function Sf(t){return t&&t.Object===Object?t:null}function MV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var UV=Array.prototype,K1=Object.prototype,Y1=Function.prototype.toString,wy=K1.hasOwnProperty,VV=K1.toString,HV=RegExp("^"+Y1.call(wy).replace(RV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zV=UV.splice,GV=J1(qV,"Map"),Ru=J1(Object,"create");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 WV(){this.__data__=Ru?Ru(null):{}}function KV(t){return this.has(t)&&delete this.__data__[t]}function YV(t){var e=this.__data__;if(Ru){var r=e[t];return r===W1?void 0:r}return wy.call(e,t)?e[t]:void 0}function JV(t){var e=this.__data__;return Ru?e[t]!==void 0:wy.call(e,t)}function XV(t,e){var r=this.__data__;return r[t]=Ru&&e===void 0?W1:e,this}Gi.prototype.clear=WV;Gi.prototype.delete=KV;Gi.prototype.get=YV;Gi.prototype.has=JV;Gi.prototype.set=XV;function ys(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__=[]}function QV(t){var e=this.__data__,r=xf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():zV.call(e,r,1),!0}function eH(t){var e=this.__data__,r=xf(e,t);return r<0?void 0:e[r][1]}function tH(t){return xf(this.__data__,t)>-1}function rH(t,e){var r=this.__data__,n=xf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ys.prototype.clear=ZV;ys.prototype.delete=QV;ys.prototype.get=eH;ys.prototype.has=tH;ys.prototype.set=rH;function Wi(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 nH(){this.__data__={hash:new Gi,map:new(GV||ys),string:new Gi}}function iH(t){return Ff(this,t).delete(t)}function oH(t){return Ff(this,t).get(t)}function sH(t){return Ff(this,t).has(t)}function aH(t,e){return Ff(this,t).set(t,e),this}Wi.prototype.clear=nH;Wi.prototype.delete=iH;Wi.prototype.get=oH;Wi.prototype.has=sH;Wi.prototype.set=aH;function xf(t,e){for(var r=t.length;r--;)if(fH(t[r][0],e))return r;return-1}function Ff(t,e){var r=t.__data__;return uH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function J1(t,e){var r=t[e];return hH(r)?r:void 0}function uH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var cH=_y(function(t){var e=[];return pH(t).replace(PV,function(r,n,i,o){e.push(i?o.replace($V,"$1"):n||r)}),e});function lH(t){if(t!=null){try{return Y1.call(t)}catch{}try{return t+""}catch{}}return""}function _y(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(AV);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(_y.Cache||Wi),r}_y.Cache=Wi;function fH(t,e){return t===e||t!==t&&e!==e}function dH(t){var e=X1(t)?VV.call(t):"";return e==kV||e==TV}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function hH(t){if(!X1(t))return!1;var e=dH(t)||MV(t)?HV:IV;return e.test(lH(t))}function pH(t){return t==null?"":OV(t)}gs.exports=cH});var Ox=y((Ki,vs)=>{var mH=Z1(),gH=200,Ry="__lodash_hash_undefined__",Pf=1,bs=2,yH=1/0,ix=9007199254740991,Of="[object Arguments]",Sy="[object Array]",ox="[object Boolean]",sx="[object Date]",ax="[object Error]",ux="[object Function]",DH="[object GeneratorFunction]",Iu="[object Map]",cx="[object Number]",Ds="[object Object]",Q1="[object Promise]",lx="[object RegExp]",ju="[object Set]",$y="[object String]",fx="[object Symbol]",xy="[object WeakMap]",dx="[object ArrayBuffer]",Af="[object DataView]",vH="[object Float32Array]",bH="[object Float64Array]",wH="[object Int8Array]",_H="[object Int16Array]",EH="[object Int32Array]",CH="[object Uint8Array]",SH="[object Uint8ClampedArray]",xH="[object Uint16Array]",FH="[object Uint32Array]",OH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,AH=/^\w*$/,kH=/[\\^$.*+?()[\]{}|]/g,TH=/^\[object .+?Constructor\]$/,PH=/^(?:0|[1-9]\d*)$/,Re={};Re[vH]=Re[bH]=Re[wH]=Re[_H]=Re[EH]=Re[CH]=Re[SH]=Re[xH]=Re[FH]=!0;Re[Of]=Re[Sy]=Re[dx]=Re[ox]=Re[Af]=Re[sx]=Re[ax]=Re[ux]=Re[Iu]=Re[cx]=Re[Ds]=Re[lx]=Re[ju]=Re[$y]=Re[xy]=!1;var Lu={function:!0,object:!0},RH=Lu[typeof Ki]&&Ki&&!Ki.nodeType?Ki:void 0,$H=Lu[typeof vs]&&vs&&!vs.nodeType?vs:void 0,IH=Rf(RH&&$H&&typeof global=="object"&&global),jH=Rf(Lu[typeof self]&&self),ex=Rf(Lu[typeof window]&&window),Ey=Rf(Lu[typeof Ki]&&Ki),Xi=IH||ex!==(Ey&&Ey.window)&&ex||jH||Ey||Function("return this")();function NH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function LH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function BH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function qH(t,e){return NH(e,function(r){return[r,t[r]]})}function Rf(t){return t&&t.Object===Object?t:null}function Fy(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 MH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function UH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var VH=Array.prototype,$f=Object.prototype,px=Function.prototype.toString,Yi=$f.hasOwnProperty,Zi=$f.toString,HH=RegExp("^"+px.call(Yi).replace(kH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=Xi.Symbol,rx=Xi.Uint8Array,zH=$f.propertyIsEnumerable,GH=VH.splice,WH=Object.getPrototypeOf,KH=Object.keys,Oy=ws(Xi,"DataView"),kf=ws(Xi,"Map"),Ay=ws(Xi,"Promise"),ky=ws(Xi,"Set"),Ty=ws(Xi,"WeakMap"),Nu=ws(Object,"create"),YH=eo(Oy),JH=eo(kf),XH=eo(Ay),ZH=eo(ky),QH=eo(Ty),nx=tx?tx.prototype:void 0,Cy=nx?nx.valueOf:void 0;function Ji(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 ez(){this.__data__=Nu?Nu(null):{}}function tz(t){return this.has(t)&&delete this.__data__[t]}function rz(t){var e=this.__data__;if(Nu){var r=e[t];return r===Ry?void 0:r}return Yi.call(e,t)?e[t]:void 0}function nz(t){var e=this.__data__;return Nu?e[t]!==void 0:Yi.call(e,t)}function iz(t,e){var r=this.__data__;return r[t]=Nu&&e===void 0?Ry:e,this}Ji.prototype.clear=ez;Ji.prototype.delete=tz;Ji.prototype.get=rz;Ji.prototype.has=nz;Ji.prototype.set=iz;function _n(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 oz(){this.__data__=[]}function sz(t){var e=this.__data__,r=If(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():GH.call(e,r,1),!0}function az(t){var e=this.__data__,r=If(e,t);return r<0?void 0:e[r][1]}function uz(t){return If(this.__data__,t)>-1}function cz(t,e){var r=this.__data__,n=If(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}_n.prototype.clear=oz;_n.prototype.delete=sz;_n.prototype.get=az;_n.prototype.has=uz;_n.prototype.set=cz;function Qi(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 lz(){this.__data__={hash:new Ji,map:new(kf||_n),string:new Ji}}function fz(t){return jf(this,t).delete(t)}function dz(t){return jf(this,t).get(t)}function hz(t){return jf(this,t).has(t)}function pz(t,e){return jf(this,t).set(t,e),this}Qi.prototype.clear=lz;Qi.prototype.delete=fz;Qi.prototype.get=dz;Qi.prototype.has=hz;Qi.prototype.set=pz;function Tf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Qi;++e<r;)this.add(t[e])}function mz(t){return this.__data__.set(t,Ry),this}function gz(t){return this.__data__.has(t)}Tf.prototype.add=Tf.prototype.push=mz;Tf.prototype.has=gz;function wn(t){this.__data__=new _n(t)}function yz(){this.__data__=new _n}function Dz(t){return this.__data__.delete(t)}function vz(t){return this.__data__.get(t)}function bz(t){return this.__data__.has(t)}function wz(t,e){var r=this.__data__;return r instanceof _n&&r.__data__.length==gH&&(r=this.__data__=new Qi(r.__data__)),r.set(t,e),this}wn.prototype.clear=yz;wn.prototype.delete=Dz;wn.prototype.get=vz;wn.prototype.has=bz;wn.prototype.set=wz;function If(t,e){for(var r=t.length;r--;)if(qz(t[r][0],e))return r;return-1}function mx(t,e){e=Nf(e,t)?[e]:Dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lf(e[r++])];return r&&r==n?t:void 0}function gx(t,e){return Yi.call(t,e)||typeof t=="object"&&e in t&&Iz(t)===null}function _z(t,e){return e in Object(t)}function Iy(t,e,r,n,i){return t===e?!0:t==null||e==null||!qf(t)&&!Bu(e)?t!==t&&e!==e:Ez(t,e,Iy,r,n,i)}function Ez(t,e,r,n,i,o){var s=ii(t),a=ii(e),u=Sy,c=Sy;s||(u=bn(t),u=u==Of?Ds:u),a||(c=bn(e),c=c==Of?Ds:c);var l=u==Ds&&!Fy(t),f=c==Ds&&!Fy(e),h=u==c;if(h&&!l)return o||(o=new wn),s||Vz(t)?vx(t,e,r,n,i,o):Tz(t,e,u,r,n,i,o);if(!(i&bs)){var d=l&&Yi.call(t,"__wrapped__"),m=f&&Yi.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,g=m?e.value():e;return o||(o=new wn),r(b,g,n,i,o)}}return h?(o||(o=new wn),Pz(t,e,r,n,i,o)):!1}function Cz(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 wn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Iy(l,c,n,Pf|bs,f):h))return!1}}return!0}function Sz(t){return typeof t=="function"?t:t==null?Wz:typeof t=="object"?ii(t)?Oz(t[0],t[1]):Fz(t):Kz(t)}function xz(t){return KH(Object(t))}function Fz(t){var e=$z(t);return e.length==1&&e[0][2]?_x(e[0][0],e[0][1]):function(r){return r===t||Cz(r,t,e)}}function Oz(t,e){return Nf(t)&&wx(e)?_x(Lf(t),e):function(r){var n=Hz(r,t);return n===void 0&&n===e?zz(r,t):Iy(e,n,void 0,Pf|bs)}}function yx(t){return function(e){return e?.[t]}}function Az(t){return function(e){return mx(e,t)}}function Dx(t){return ii(t)?t:mH(t)}function kz(t){return function(e){var r=bn(e);return r==Iu?hx(e):r==ju?UH(e):qH(e,t(e))}}function vx(t,e,r,n,i,o){var s=i&bs,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&Pf?new Tf:void 0;for(o.set(t,e);++l<a;){var d=t[l],m=e[l];if(n)var b=s?n(m,d,l,e,t,o):n(d,m,l,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!LH(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===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function Tz(t,e,r,n,i,o,s){switch(r){case Af: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 $y:return t==e+"";case Iu:var a=hx;case ju:var u=o&bs;if(a||(a=MH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Pf,s.set(t,e),vx(a(t),a(e),n,i,o,s));case fx:if(Cy)return Cy.call(t)==Cy.call(e)}return!1}function Pz(t,e,r,n,i,o){var s=i&bs,a=Py(t),u=a.length,c=Py(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 m=!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)){m=!1;break}b||(b=h=="constructor")}if(m&&!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)&&(m=!1)}return o.delete(t),m}var Rz=yx("length");function jf(t,e){var r=t.__data__;return Lz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function $z(t){for(var e=Gz(t),r=e.length;r--;)e[r][2]=wx(e[r][1]);return e}function ws(t,e){var r=t[e];return Uz(r)?r:void 0}function Iz(t){return WH(Object(t))}function bn(t){return Zi.call(t)}(Oy&&bn(new Oy(new ArrayBuffer(1)))!=Af||kf&&bn(new kf)!=Iu||Ay&&bn(Ay.resolve())!=Q1||ky&&bn(new ky)!=ju||Ty&&bn(new Ty)!=xy)&&(bn=function(t){var e=Zi.call(t),r=e==Ds?t.constructor:void 0,n=r?eo(r):void 0;if(n)switch(n){case YH:return Af;case JH:return Iu;case XH:return Q1;case ZH:return ju;case QH:return xy}return e});function jz(t,e,r){e=Nf(e,t)?[e]:Dx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Lf(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&&Bf(s)&&bx(o,s)&&(ii(t)||xx(t)||Ex(t))}function Nz(t){var e=t?t.length:void 0;return Bf(e)&&(ii(t)||xx(t)||Ex(t))?BH(e,String):null}function bx(t,e){return e=e??ix,!!e&&(typeof t=="number"||PH.test(t))&&t>-1&&t%1==0&&t<e}function Nf(t,e){if(ii(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Fx(t)?!0:AH.test(t)||!OH.test(t)||e!=null&&t in Object(e)}function Lz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Bz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||$f;return t===r}function wx(t){return t===t&&!qf(t)}function _x(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Lf(t){if(typeof t=="string"||Fx(t))return t;var e=t+"";return e=="0"&&1/t==-yH?"-0":e}function eo(t){if(t!=null){try{return px.call(t)}catch{}try{return t+""}catch{}}return""}function qz(t,e){return t===e||t!==t&&e!==e}function Ex(t){return Mz(t)&&Yi.call(t,"callee")&&(!zH.call(t,"callee")||Zi.call(t)==Of)}var ii=Array.isArray;function Cx(t){return t!=null&&Bf(Rz(t))&&!Sx(t)}function Mz(t){return Bu(t)&&Cx(t)}function Sx(t){var e=qf(t)?Zi.call(t):"";return e==ux||e==DH}function Bf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ix}function qf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Bu(t){return!!t&&typeof t=="object"}function Uz(t){if(!qf(t))return!1;var e=Sx(t)||Fy(t)?HH:TH;return e.test(eo(t))}function xx(t){return typeof t=="string"||!ii(t)&&Bu(t)&&Zi.call(t)==$y}function Fx(t){return typeof t=="symbol"||Bu(t)&&Zi.call(t)==fx}function Vz(t){return Bu(t)&&Bf(t.length)&&!!Re[Zi.call(t)]}function Hz(t,e,r){var n=t==null?void 0:mx(t,e);return n===void 0?r:n}function zz(t,e){return t!=null&&jz(t,e,_z)}function Py(t){var e=Bz(t);if(!(e||Cx(t)))return xz(t);var r=Nz(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 Gz=kz(Py);function Wz(t){return t}function Kz(t){return Nf(t)?yx(Lf(t)):Az(t)}vs.exports=Sz});var Rx=y((to,_s)=>{var Yz=1/0,Jz="[object Function]",Xz="[object GeneratorFunction]",Zz=/[\\^$.*+?()[\]{}|]/g,Qz=/^\[object .+?Constructor\]$/,qu={function:!0,object:!0},eG=qu[typeof to]&&to&&!to.nodeType?to:void 0,tG=qu[typeof _s]&&_s&&!_s.nodeType?_s:void 0,rG=Mf(eG&&tG&&typeof global=="object"&&global),nG=Mf(qu[typeof self]&&self),Ax=Mf(qu[typeof window]&&window),jy=Mf(qu[typeof to]&&to),iG=rG||Ax!==(jy&&jy.window)&&Ax||nG||jy||Function("return this")();function Mf(t){return t&&t.Object===Object?t:null}function oG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function sG(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,aG=kx.hasOwnProperty,uG=kx.toString,cG=RegExp("^"+Tx.call(aG).replace(Zz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ny=fG(iG,"Set"),lG=Ny&&1/sG(new Ny([,-0]))[1]==Yz?function(t){return new Ny(t)}:mG;function fG(t,e){var r=t[e];return pG(r)?r:void 0}function dG(t){if(t!=null){try{return Tx.call(t)}catch{}try{return t+""}catch{}}return""}function hG(t){var e=Px(t)?uG.call(t):"";return e==Jz||e==Xz}function Px(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function pG(t){if(!Px(t))return!1;var e=hG(t)||oG(t)?cG:Qz;return e.test(dG(t))}function mG(){}_s.exports=lG});var Ix=y((ro,Es)=>{var Mu={function:!0,object:!0},gG=Mu[typeof ro]&&ro&&!ro.nodeType?ro:void 0,yG=Mu[typeof Es]&&Es&&!Es.nodeType?Es:void 0,DG=Uf(gG&&yG&&typeof global=="object"&&global),vG=Uf(Mu[typeof self]&&self),$x=Uf(Mu[typeof window]&&window),Ly=Uf(Mu[typeof ro]&&ro),bG=DG||$x!==(Ly&&Ly.window)&&$x||vG||Ly||Function("return this")();function Uf(t){return t&&t.Object===Object?t:null}Es.exports=bG});var Mx=y((xde,qx)=>{var wG=Rx(),_G=Ix(),EG=200,By="__lodash_hash_undefined__",CG="[object Function]",SG="[object GeneratorFunction]",xG=/[\\^$.*+?()[\]{}|]/g,FG=/^\[object .+?Constructor\]$/;function OG(t,e){return!!t.length&&kG(t,e,0)>-1}function AG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function kG(t,e,r){if(e!==e)return PG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function TG(t,e){return t.has(e)}function PG(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 RG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function $G(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var IG=Array.prototype,jx=Object.prototype,Nx=Function.prototype.toString,qy=jx.hasOwnProperty,jG=jx.toString,NG=RegExp("^"+Nx.call(qy).replace(xG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),LG=IG.splice,BG=Lx(_G,"Map"),Uu=Lx(Object,"create");function no(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 qG(){this.__data__=Uu?Uu(null):{}}function MG(t){return this.has(t)&&delete this.__data__[t]}function UG(t){var e=this.__data__;if(Uu){var r=e[t];return r===By?void 0:r}return qy.call(e,t)?e[t]:void 0}function VG(t){var e=this.__data__;return Uu?e[t]!==void 0:qy.call(e,t)}function HG(t,e){var r=this.__data__;return r[t]=Uu&&e===void 0?By:e,this}no.prototype.clear=qG;no.prototype.delete=MG;no.prototype.get=UG;no.prototype.has=VG;no.prototype.set=HG;function Cs(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 zG(){this.__data__=[]}function GG(t){var e=this.__data__,r=Hf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():LG.call(e,r,1),!0}function WG(t){var e=this.__data__,r=Hf(e,t);return r<0?void 0:e[r][1]}function KG(t){return Hf(this.__data__,t)>-1}function YG(t,e){var r=this.__data__,n=Hf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Cs.prototype.clear=zG;Cs.prototype.delete=GG;Cs.prototype.get=WG;Cs.prototype.has=KG;Cs.prototype.set=YG;function Ss(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 JG(){this.__data__={hash:new no,map:new(BG||Cs),string:new no}}function XG(t){return zf(this,t).delete(t)}function ZG(t){return zf(this,t).get(t)}function QG(t){return zf(this,t).has(t)}function eW(t,e){return zf(this,t).set(t,e),this}Ss.prototype.clear=JG;Ss.prototype.delete=XG;Ss.prototype.get=ZG;Ss.prototype.has=QG;Ss.prototype.set=eW;function Vf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Ss;++e<r;)this.add(t[e])}function tW(t){return this.__data__.set(t,By),this}function rW(t){return this.__data__.has(t)}Vf.prototype.add=Vf.prototype.push=tW;Vf.prototype.has=rW;function Hf(t,e){for(var r=t.length;r--;)if(sW(t[r][0],e))return r;return-1}function nW(t,e,r){var n=-1,i=OG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=AG;else if(o>=EG){var c=e?null:wG(t);if(c)return $G(c);s=!1,i=TG,u=new Vf}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 zf(t,e){var r=t.__data__;return iW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Lx(t,e){var r=t[e];return uW(r)?r:void 0}function iW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function oW(t){if(t!=null){try{return Nx.call(t)}catch{}try{return t+""}catch{}}return""}function sW(t,e){return t===e||t!==t&&e!==e}function aW(t){var e=Bx(t)?jG.call(t):"";return e==CG||e==SG}function Bx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function uW(t){if(!Bx(t))return!1;var e=aW(t)||RG(t)?NG:FG;return e.test(oW(t))}qx.exports=nW});var Vx=y((Fde,Ux)=>{var cW=Ox(),lW=Mx();function fW(t,e){return t&&t.length?lW(t,cW(e)):[]}Ux.exports=fW});var zx=y((Ode,Hx)=>{"use strict";var dW=q1(),hW=Vx(),pW=dW("MultiError");Hx.exports=My;function My(t){if(!(this instanceof My))return new My(t);if(t=Array.isArray(t)?t:[t],t=hW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new pW({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
39
  `)}),e}});var Wx=y((Ade,Gx)=>{var oi=require("constants"),mW=process.cwd,Gf=null,gW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Gf||(Gf=mW.call(process)),Gf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Uy=process.chdir,process.chdir=function(t){Gf=null,Uy.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Uy));var Uy;Gx.exports=yW;function yW(t){oi.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(){}),gW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,m){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):m(x)})},g),g<100&&(g+=10);return}m&&m(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,m,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,m,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,m,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,m,b){for(var g=0;;)try{return l.call(t,f,h,d,m,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,oi.O_WRONLY|oi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);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,oi.O_WRONLY|oi.O_SYMLINK,h),m=!0,b;try{b=l.fchmodSync(d,h),m=!1}finally{if(m)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){oi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,m){l.open(f,oi.O_SYMLINK,function(b,g){if(b){m&&m(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){m&&m(w||x)})})})},l.lutimesSync=function(f,h,d){var m=l.openSync(f,oi.O_SYMLINK),b,g=!0;try{b=l.futimesSync(m,h,d),g=!1}finally{if(g)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,h,d,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(m){c(m)&&(m=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,m){return l.call(t,f,h,d,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(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,m):l.call(t,f,m)}}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((kde,Yx)=>{var Kx=require("stream").Stream;Yx.exports=DW;function DW(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((Tde,Xx)=>{"use strict";Xx.exports=bW;var vW=Object.getPrototypeOf||function(t){return t.__proto__};function bW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:vW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var pt=y((Pde,zy)=>{var ze=require("fs"),wW=Wx(),_W=Jx(),EW=Zx(),Wf=require("util"),Et,Yf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Et=Symbol.for("graceful-fs.queue"),Yf=Symbol.for("graceful-fs.previous")):(Et="___graceful-fs.queue",Yf="___graceful-fs.previous");function CW(){}function tF(t,e){Object.defineProperty(t,Et,{get:function(){return e}})}var io=CW;Wf.debuglog?io=Wf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(io=function(){var t=Wf.format.apply(Wf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
- GFS4: `),console.error(t)});ze[Et]||(Qx=global[Et]||[],tF(ze,Qx),ze.close=function(t){function e(r,n){return t.call(ze,r,function(i){i||eF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Yf,{value:t}),e}(ze.close),ze.closeSync=function(t){function e(r){t.apply(ze,arguments),eF()}return Object.defineProperty(e,Yf,{value:t}),e}(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){io(ze[Et]),require("assert").equal(ze[Et].length,0)}));var Qx;global[Et]||tF(global,ze[Et]);zy.exports=Vy(EW(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(zy.exports=Vy(ze),ze.__patched=!0);function Vy(t){wW(t),t.gracefulify=Vy,t.createReadStream=k,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")?Ss([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")?Ss([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")?Ss([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")?Ss([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")?Ss([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=_W(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.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?(m.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 k(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")?Ss([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function Ss(t){io("ENQUEUE",t[0].name,t[1]),ze[Et].push(t),Hy()}var Kf;function eF(){for(var t=Date.now(),e=0;e<ze[Et].length;++e)ze[Et][e].length>2&&(ze[Et][e][3]=t,ze[Et][e][4]=t);Hy()}function Hy(){if(clearTimeout(Kf),Kf=void 0,ze[Et].length!==0){var t=ze[Et].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)io("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){io("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?(io("RETRY",e.name,r),e.apply(null,r.concat([i]))):ze[Et].push(t)}Kf===void 0&&(Kf=setTimeout(Hy,0))}}});var nF=y((Rde,rF)=>{function vr(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=vr;vr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};vr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};vr.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};vr.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)};vr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};vr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};vr.prototype.start=vr.prototype.try;vr.prototype.errors=function(){return this._errors};vr.prototype.attempts=function(){return this._attempts};vr.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(oo=>{var SW=nF();oo.operation=function(t){var e=oo.timeouts(t);return new SW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};oo.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};oo.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};oo.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=oo.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((Ide,oF)=>{oF.exports=iF()});var aF=y((jde,Jf)=>{Jf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Jf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Jf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Ky=y((Nde,Os)=>{var qe=global.process,so=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"};so(qe)?(uF=require("assert"),xs=aF(),cF=/^win/i.test(qe.platform),Vu=require("events"),typeof Vu!="function"&&(Vu=Vu.EventEmitter),qe.__signal_exit_emitter__?mt=qe.__signal_exit_emitter__:(mt=qe.__signal_exit_emitter__=new Vu,mt.count=0,mt.emitted={}),mt.infinite||(mt.setMaxListeners(1/0),mt.infinite=!0),Os.exports=function(t,e){if(!so(global.process))return function(){};uF.equal(typeof t,"function","a callback must be provided for exit handler"),Fs===!1&&Gy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){mt.removeListener(r,t),mt.listeners("exit").length===0&&mt.listeners("afterexit").length===0&&Xf()};return mt.on(r,t),n},Xf=function(){!Fs||!so(global.process)||(Fs=!1,xs.forEach(function(e){try{qe.removeListener(e,Zf[e])}catch{}}),qe.emit=Qf,qe.reallyExit=Wy,mt.count-=1)},Os.exports.unload=Xf,ao=function(e,r,n){mt.emitted[e]||(mt.emitted[e]=!0,mt.emit(e,r,n))},Zf={},xs.forEach(function(t){Zf[t]=function(){if(so(global.process)){var r=qe.listeners(t);r.length===mt.count&&(Xf(),ao("exit",null,t),ao("afterexit",null,t),cF&&t==="SIGHUP"&&(t="SIGINT"),qe.kill(qe.pid,t))}}}),Os.exports.signals=function(){return xs},Fs=!1,Gy=function(){Fs||!so(global.process)||(Fs=!0,mt.count+=1,xs=xs.filter(function(e){try{return qe.on(e,Zf[e]),!0}catch{return!1}}),qe.emit=fF,qe.reallyExit=lF)},Os.exports.load=Gy,Wy=qe.reallyExit,lF=function(e){so(global.process)&&(qe.exitCode=e||0,ao("exit",qe.exitCode,null),ao("afterexit",qe.exitCode,null),Wy.call(qe,qe.exitCode))},Qf=qe.emit,fF=function(e,r){if(e==="exit"&&so(global.process)){r!==void 0&&(qe.exitCode=r);var n=Qf.apply(this,arguments);return ao("exit",qe.exitCode,null),ao("afterexit",qe.exitCode,null),n}else return Qf.apply(this,arguments)}):Os.exports=function(){return function(){}};var uF,xs,cF,Vu,mt,Xf,ao,Zf,Fs,Gy,Wy,lF,Qf,fF});var hF=y((Lde,Yy)=>{"use strict";var dF=Symbol();function xW(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 FW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Yy.exports.probe=xW;Yy.exports.getMtime=FW});var DF=y((Bde,zu)=>{"use strict";var OW=require("path"),Zy=pt(),AW=sF(),kW=Ky(),pF=hF(),En={};function Hu(t,e){return e.lockfilePath||`${t}.lock`}function Qy(t,e,r){if(!e.realpath)return r(null,OW.resolve(t));e.fs.realpath(t,r)}function Xy(t,e,r){let n=Hu(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"?Xy(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);Xy(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(Hu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function ed(t,e){let r=En[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?Jy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Jy(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?Jy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,ed(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Jy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),En[t]===e&&delete En[t],e.options.onCompromised(r)}function TW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Zy,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),Qy(t,e,(n,i)=>{if(n)return r(n);let o=AW.operation(e.retries);o.attempt(()=>{Xy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=En[i]={lockfilePath:Hu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};ed(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:Zy,realpath:!0,...e},Qy(t,e,(n,i)=>{if(n)return r(n);let o=En[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 En[i],gF(i,e,r)})}function PW(t,e,r){e={stale:1e4,realpath:!0,fs:Zy,...e},e.stale=Math.max(e.stale||0,2e3),Qy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Hu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!mF(s,e)))})}function RW(){return En}kW(()=>{for(let t in En){let e=En[t].options;try{e.fs.rmdirSync(Hu(t,e))}catch{}}});zu.exports.lock=TW;zu.exports.unlock=yF;zu.exports.check=PW;zu.exports.getLocks=RW});var bF=y((qde,vF)=>{"use strict";var $W=pt();function IW(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 jW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function NW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function LW(t){if(t={...t},t.fs=IW(t.fs||$W),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:jW,toSync:NW,toSyncOptions:LW}});var _F=y((Mde,si)=>{"use strict";var As=DF(),{toPromise:td,toSync:rd,toSyncOptions:eD}=bF();async function wF(t,e){let r=await td(As.lock)(t,e);return td(r)}function BW(t,e){let r=rd(As.lock)(t,eD(e));return rd(r)}function qW(t,e){return td(As.unlock)(t,e)}function MW(t,e){return rd(As.unlock)(t,eD(e))}function UW(t,e){return td(As.check)(t,e)}function VW(t,e){return rd(As.check)(t,eD(e))}si.exports=wF;si.exports.lock=wF;si.exports.unlock=qW;si.exports.lockSync=BW;si.exports.unlockSync=MW;si.exports.check=UW;si.exports.checkSync=VW});var FF=y(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.canStoreURLs=ks.FileUrlStorage=void 0;var EF=require("fs"),HW=GW(zx()),CF=zW(_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 zW(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 GW(t){return t&&t.__esModule?t:{default:t}}function Gu(t){"@babel/helpers - typeof";return Gu=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},Gu(t)}function WW(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,YW(n.key),n)}}function KW(t,e,r){return e&&SF(t.prototype,e),r&&SF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function YW(t){var e=JW(t,"string");return Gu(e)=="symbol"?e:e+""}function JW(t,e){if(Gu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ude=ks.canStoreURLs=!0,Vde=ks.FileUrlStorage=function(){function t(e){WW(this,t),this.path=e}return KW(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,HW.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 nD=y(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Object.defineProperty(Wt,"DefaultHttpStack",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(Wt,"DetailedError",{enumerable:!0,get:function(){return XW.default}});Object.defineProperty(Wt,"FileUrlStorage",{enumerable:!0,get:function(){return PF.FileUrlStorage}});Object.defineProperty(Wt,"StreamSource",{enumerable:!0,get:function(){return rK.default}});Wt.Upload=void 0;Object.defineProperty(Wt,"canStoreURLs",{enumerable:!0,get:function(){return PF.canStoreURLs}});Wt.defaultOptions=void 0;Object.defineProperty(Wt,"enableDebugLog",{enumerable:!0,get:function(){return ZW.enableDebugLog}});Wt.isSupported=void 0;var XW=uo(Yg()),ZW=Jg(),QW=uo(FS()),tD=uo(n1()),eK=uo(g1()),tK=uo(b1()),TF=uo($1()),rK=uo(fy()),PF=FF();function uo(t){return t&&t.__esModule?t:{default:t}}function Ps(t){"@babel/helpers - typeof";return Ps=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},Ps(t)}function nK(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 iK(t,e,r){return e&&OF(t.prototype,e),r&&OF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function oK(t,e,r){return e=nd(e),sK(t,RF()?Reflect.construct(e,r||[],nd(t).constructor):e.apply(t,r))}function sK(t,e){if(e&&(Ps(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aK(t)}function aK(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 nd(t){return nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nd(t)}function uK(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&&rD(t,e)}function rD(t,e){return rD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rD(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 Ts(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){cK(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 cK(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=lK(t,"string");return Ps(e)=="symbol"?e:e+""}function lK(t,e){if(Ps(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kF=Wt.defaultOptions=Ts(Ts({},tD.default.defaultOptions),{},{httpStack:new TF.default,fileReader:new eK.default,urlStorage:new QW.default,fingerprint:tK.default}),zde=Wt.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 nK(this,e),n=Ts(Ts({},kF),n),oK(this,e,[r,n])}return uK(e,t),iK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Ts(Ts({},kF),i),tD.default.terminate(n,i)}}])}(tD.default),Gde=Wt.isSupported=!0});var Cn={};gn(Cn,{__addDisposableResource:()=>t2,__assign:()=>id,__asyncDelegator:()=>WF,__asyncGenerator:()=>GF,__asyncValues:()=>KF,__await:()=>Rs,__awaiter:()=>qF,__classPrivateFieldGet:()=>ZF,__classPrivateFieldIn:()=>e2,__classPrivateFieldSet:()=>QF,__createBinding:()=>sd,__decorate:()=>NF,__disposeResources:()=>r2,__esDecorate:()=>fK,__exportStar:()=>UF,__extends:()=>IF,__generator:()=>MF,__importDefault:()=>XF,__importStar:()=>JF,__makeTemplateObject:()=>YF,__metadata:()=>BF,__param:()=>LF,__propKey:()=>hK,__read:()=>oD,__rest:()=>jF,__runInitializers:()=>dK,__setFunctionName:()=>pK,__spread:()=>VF,__spreadArray:()=>zF,__spreadArrays:()=>HF,__values:()=>od,default:()=>yK});function IF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");iD(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 fK(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 m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.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],m);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 dK(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 hK(t){return typeof t=="symbol"?t:"".concat(t)}function pK(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)&&sd(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 oD(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(oD(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 Rs(t){return this instanceof Rs?(this.v=t,this):new Rs(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(m){return Promise.resolve(m).then(d,f)}}function a(d,m){n[d]&&(i[d]=function(b){return new Promise(function(g,w){o.push([d,b,g,w])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{c(n[d](m))}catch(b){h(o[0][3],b)}}function c(d){d.value instanceof Rs?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,m){d(m),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:Rs(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 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 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)&&sd(e,t,r);return mK(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 gK(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 iD,id,sd,mK,gK,yK,Sn=lt(()=>{iD=function(t,e){return iD=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])},iD(t,e)};id=function(){return id=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},id.apply(this,arguments)};sd=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]};mK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};gK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};yK={__extends:IF,__assign:id,__rest:jF,__decorate:NF,__param:LF,__metadata:BF,__awaiter:qF,__generator:MF,__createBinding:sd,__exportStar:UF,__values:od,__read:oD,__spread:VF,__spreadArrays:HF,__spreadArray:zF,__await:Rs,__asyncGenerator:GF,__asyncDelegator:WF,__asyncValues:KF,__makeTemplateObject:YF,__importStar:JF,__importDefault:XF,__classPrivateFieldGet:ZF,__classPrivateFieldSet:QF,__classPrivateFieldIn:e2,__addDisposableResource:t2,__disposeResources:r2}});var S2={};gn(S2,{__addDisposableResource:()=>E2,__assign:()=>ad,__asyncDelegator:()=>m2,__asyncGenerator:()=>p2,__asyncValues:()=>g2,__await:()=>$s,__awaiter:()=>u2,__classPrivateFieldGet:()=>b2,__classPrivateFieldIn:()=>_2,__classPrivateFieldSet:()=>w2,__createBinding:()=>cd,__decorate:()=>o2,__disposeResources:()=>C2,__esDecorate:()=>DK,__exportStar:()=>l2,__extends:()=>n2,__generator:()=>c2,__importDefault:()=>v2,__importStar:()=>D2,__makeTemplateObject:()=>y2,__metadata:()=>a2,__param:()=>s2,__propKey:()=>bK,__read:()=>aD,__rest:()=>i2,__runInitializers:()=>vK,__setFunctionName:()=>wK,__spread:()=>f2,__spreadArray:()=>h2,__spreadArrays:()=>d2,__values:()=>ud,default:()=>CK});function n2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sD(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 DK(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 m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.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],m);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 vK(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 bK(t){return typeof t=="symbol"?t:"".concat(t)}function wK(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)&&cd(e,t,r)}function ud(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 f2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(aD(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 $s(t){return this instanceof $s?(this.v=t,this):new $s(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(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof $s?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:$s(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 ud=="function"?ud(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)&&cd(e,t,r);return _K(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 EK(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 sD,ad,cd,_K,EK,CK,x2=lt(()=>{sD=function(t,e){return sD=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])},sD(t,e)};ad=function(){return ad=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},ad.apply(this,arguments)};cd=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]};_K=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};EK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};CK={__extends:n2,__assign:ad,__rest:i2,__decorate:o2,__param:s2,__metadata:a2,__awaiter:u2,__generator:c2,__createBinding:cd,__exportStar:l2,__values:ud,__read:aD,__spread:f2,__spreadArrays:d2,__spreadArray:h2,__await:$s,__asyncGenerator:p2,__asyncDelegator:m2,__asyncValues:g2,__makeTemplateObject:y2,__importStar:D2,__importDefault:v2,__classPrivateFieldGet:b2,__classPrivateFieldSet:w2,__classPrivateFieldIn:_2,__addDisposableResource:E2,__disposeResources:C2}});var Kt=y(uD=>{"use strict";uD.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})};uD.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 Wu=y(ai=>{"use strict";var F2=Kt().fromCallback,$t=pt(),SK=["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 $t[t]=="function");Object.keys($t).forEach(t=>{t!=="promises"&&(ai[t]=$t[t])});SK.forEach(t=>{ai[t]=F2($t[t])});ai.exists=function(t,e){return typeof e=="function"?$t.exists(t,e):new Promise(r=>$t.exists(t,r))};ai.read=function(t,e,r,n,i,o){return typeof o=="function"?$t.read(t,e,r,n,i,o):new Promise((s,a)=>{$t.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};ai.write=function(t,e,...r){return typeof r[r.length-1]=="function"?$t.write(t,e,...r):new Promise((n,i)=>{$t.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof $t.writev=="function"&&(ai.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?$t.writev(t,e,...r):new Promise((n,i)=>{$t.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof $t.realpath.native=="function"&&(ai.realpath.native=F2($t.realpath.native))});var cD=y((Jde,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((Xde,lD)=>{"use strict";var Is=Wu(),xn=require("path"),xK=cD(),A2=xK("10.12.0"),k2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(xn.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};lD.exports.makeDir=async(t,e)=>{if(k2(t),e=T2(e),A2){let n=xn.resolve(t);return Is.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await Is.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(xn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return await r(xn.dirname(n)),r(n)}try{if(!(await Is.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(xn.resolve(t))};lD.exports.makeDirSync=(t,e)=>{if(k2(t),e=T2(e),A2){let n=xn.resolve(t);return Is.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{Is.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(xn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return r(xn.dirname(n)),r(n)}try{if(!Is.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(xn.resolve(t))}});var Tr=y((Zde,$2)=>{"use strict";var FK=Kt().fromPromise,{makeDir:OK,makeDirSync:fD}=R2(),dD=FK(OK);$2.exports={mkdirs:dD,mkdirsSync:fD,mkdirp:dD,mkdirpSync:fD,ensureDir:dD,ensureDirSync:fD}});var hD=y((Qde,I2)=>{"use strict";var js=pt();function AK(t,e,r,n){js.open(t,"r+",(i,o)=>{if(i)return n(i);js.futimes(o,e,r,s=>{js.close(o,a=>{n&&n(s||a)})})})}function kK(t,e,r){let n=js.openSync(t,"r+");return js.futimesSync(n,e,r),js.closeSync(n)}I2.exports={utimesMillis:AK,utimesMillisSync:kK}});var Ku=y((ehe,B2)=>{"use strict";var Ns=Wu(),Yt=require("path"),TK=require("util"),PK=cD(),ld=PK("10.5.0"),j2=t=>ld?Ns.stat(t,{bigint:!0}):Ns.stat(t),pD=t=>ld?Ns.statSync(t,{bigint:!0}):Ns.statSync(t);function RK(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 $K(t,e){let r,n=pD(t);try{r=pD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function IK(t,e,r,n){TK.callbackify(RK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&fd(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&mD(t,e)?n(new Error(dd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function jK(t,e,r){let{srcStat:n,destStat:i}=$K(t,e);if(i&&fd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&mD(t,e))throw new Error(dd(t,e,r));return{srcStat:n,destStat:i}}function N2(t,e,r,n,i){let o=Yt.resolve(Yt.dirname(t)),s=Yt.resolve(Yt.dirname(r));if(s===o||s===Yt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):fd(e,c)?i(new Error(dd(t,r,n))):N2(t,e,s,n,i);ld?Ns.stat(s,{bigint:!0},a):Ns.stat(s,a)}function L2(t,e,r,n){let i=Yt.resolve(Yt.dirname(t)),o=Yt.resolve(Yt.dirname(r));if(o===i||o===Yt.parse(o).root)return;let s;try{s=pD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(fd(e,s))throw new Error(dd(t,r,n));return L2(t,e,o,n)}function fd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(ld||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 mD(t,e){let r=Yt.resolve(t).split(Yt.sep).filter(i=>i),n=Yt.resolve(e).split(Yt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function dd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}B2.exports={checkPaths:IK,checkPathsSync:jK,checkParentPaths:N2,checkParentPathsSync:L2,isSrcSubdir:mD}});var H2=y((the,V2)=>{"use strict";var xt=pt(),Yu=require("path"),NK=Tr().mkdirsSync,LK=hD().utimesMillisSync,Ju=Ku();function BK(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;
40
+ GFS4: `),console.error(t)});ze[Et]||(Qx=global[Et]||[],tF(ze,Qx),ze.close=function(t){function e(r,n){return t.call(ze,r,function(i){i||eF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Yf,{value:t}),e}(ze.close),ze.closeSync=function(t){function e(r){t.apply(ze,arguments),eF()}return Object.defineProperty(e,Yf,{value:t}),e}(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){io(ze[Et]),require("assert").equal(ze[Et].length,0)}));var Qx;global[Et]||tF(global,ze[Et]);zy.exports=Vy(EW(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(zy.exports=Vy(ze),ze.__patched=!0);function Vy(t){wW(t),t.gracefulify=Vy,t.createReadStream=k,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")?xs([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")?xs([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")?xs([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")?xs([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")?xs([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=_W(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.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?(m.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 k(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")?xs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function xs(t){io("ENQUEUE",t[0].name,t[1]),ze[Et].push(t),Hy()}var Kf;function eF(){for(var t=Date.now(),e=0;e<ze[Et].length;++e)ze[Et][e].length>2&&(ze[Et][e][3]=t,ze[Et][e][4]=t);Hy()}function Hy(){if(clearTimeout(Kf),Kf=void 0,ze[Et].length!==0){var t=ze[Et].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)io("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){io("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?(io("RETRY",e.name,r),e.apply(null,r.concat([i]))):ze[Et].push(t)}Kf===void 0&&(Kf=setTimeout(Hy,0))}}});var nF=y((Rde,rF)=>{function vr(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=vr;vr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};vr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};vr.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};vr.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)};vr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};vr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};vr.prototype.start=vr.prototype.try;vr.prototype.errors=function(){return this._errors};vr.prototype.attempts=function(){return this._attempts};vr.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(oo=>{var SW=nF();oo.operation=function(t){var e=oo.timeouts(t);return new SW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};oo.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};oo.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};oo.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=oo.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((Ide,oF)=>{oF.exports=iF()});var aF=y((jde,Jf)=>{Jf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Jf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Jf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Ky=y((Nde,As)=>{var qe=global.process,so=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"};so(qe)?(uF=require("assert"),Fs=aF(),cF=/^win/i.test(qe.platform),Vu=require("events"),typeof Vu!="function"&&(Vu=Vu.EventEmitter),qe.__signal_exit_emitter__?mt=qe.__signal_exit_emitter__:(mt=qe.__signal_exit_emitter__=new Vu,mt.count=0,mt.emitted={}),mt.infinite||(mt.setMaxListeners(1/0),mt.infinite=!0),As.exports=function(t,e){if(!so(global.process))return function(){};uF.equal(typeof t,"function","a callback must be provided for exit handler"),Os===!1&&Gy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){mt.removeListener(r,t),mt.listeners("exit").length===0&&mt.listeners("afterexit").length===0&&Xf()};return mt.on(r,t),n},Xf=function(){!Os||!so(global.process)||(Os=!1,Fs.forEach(function(e){try{qe.removeListener(e,Zf[e])}catch{}}),qe.emit=Qf,qe.reallyExit=Wy,mt.count-=1)},As.exports.unload=Xf,ao=function(e,r,n){mt.emitted[e]||(mt.emitted[e]=!0,mt.emit(e,r,n))},Zf={},Fs.forEach(function(t){Zf[t]=function(){if(so(global.process)){var r=qe.listeners(t);r.length===mt.count&&(Xf(),ao("exit",null,t),ao("afterexit",null,t),cF&&t==="SIGHUP"&&(t="SIGINT"),qe.kill(qe.pid,t))}}}),As.exports.signals=function(){return Fs},Os=!1,Gy=function(){Os||!so(global.process)||(Os=!0,mt.count+=1,Fs=Fs.filter(function(e){try{return qe.on(e,Zf[e]),!0}catch{return!1}}),qe.emit=fF,qe.reallyExit=lF)},As.exports.load=Gy,Wy=qe.reallyExit,lF=function(e){so(global.process)&&(qe.exitCode=e||0,ao("exit",qe.exitCode,null),ao("afterexit",qe.exitCode,null),Wy.call(qe,qe.exitCode))},Qf=qe.emit,fF=function(e,r){if(e==="exit"&&so(global.process)){r!==void 0&&(qe.exitCode=r);var n=Qf.apply(this,arguments);return ao("exit",qe.exitCode,null),ao("afterexit",qe.exitCode,null),n}else return Qf.apply(this,arguments)}):As.exports=function(){return function(){}};var uF,Fs,cF,Vu,mt,Xf,ao,Zf,Os,Gy,Wy,lF,Qf,fF});var hF=y((Lde,Yy)=>{"use strict";var dF=Symbol();function xW(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 FW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Yy.exports.probe=xW;Yy.exports.getMtime=FW});var DF=y((Bde,zu)=>{"use strict";var OW=require("path"),Zy=pt(),AW=sF(),kW=Ky(),pF=hF(),En={};function Hu(t,e){return e.lockfilePath||`${t}.lock`}function Qy(t,e,r){if(!e.realpath)return r(null,OW.resolve(t));e.fs.realpath(t,r)}function Xy(t,e,r){let n=Hu(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"?Xy(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);Xy(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(Hu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function ed(t,e){let r=En[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?Jy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Jy(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?Jy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,ed(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Jy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),En[t]===e&&delete En[t],e.options.onCompromised(r)}function TW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Zy,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),Qy(t,e,(n,i)=>{if(n)return r(n);let o=AW.operation(e.retries);o.attempt(()=>{Xy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=En[i]={lockfilePath:Hu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};ed(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:Zy,realpath:!0,...e},Qy(t,e,(n,i)=>{if(n)return r(n);let o=En[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 En[i],gF(i,e,r)})}function PW(t,e,r){e={stale:1e4,realpath:!0,fs:Zy,...e},e.stale=Math.max(e.stale||0,2e3),Qy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Hu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!mF(s,e)))})}function RW(){return En}kW(()=>{for(let t in En){let e=En[t].options;try{e.fs.rmdirSync(Hu(t,e))}catch{}}});zu.exports.lock=TW;zu.exports.unlock=yF;zu.exports.check=PW;zu.exports.getLocks=RW});var bF=y((qde,vF)=>{"use strict";var $W=pt();function IW(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 jW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function NW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function LW(t){if(t={...t},t.fs=IW(t.fs||$W),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:jW,toSync:NW,toSyncOptions:LW}});var _F=y((Mde,si)=>{"use strict";var ks=DF(),{toPromise:td,toSync:rd,toSyncOptions:eD}=bF();async function wF(t,e){let r=await td(ks.lock)(t,e);return td(r)}function BW(t,e){let r=rd(ks.lock)(t,eD(e));return rd(r)}function qW(t,e){return td(ks.unlock)(t,e)}function MW(t,e){return rd(ks.unlock)(t,eD(e))}function UW(t,e){return td(ks.check)(t,e)}function VW(t,e){return rd(ks.check)(t,eD(e))}si.exports=wF;si.exports.lock=wF;si.exports.unlock=qW;si.exports.lockSync=BW;si.exports.unlockSync=MW;si.exports.check=UW;si.exports.checkSync=VW});var FF=y(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.canStoreURLs=Ts.FileUrlStorage=void 0;var EF=require("fs"),HW=GW(zx()),CF=zW(_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 zW(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 GW(t){return t&&t.__esModule?t:{default:t}}function Gu(t){"@babel/helpers - typeof";return Gu=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},Gu(t)}function WW(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,YW(n.key),n)}}function KW(t,e,r){return e&&SF(t.prototype,e),r&&SF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function YW(t){var e=JW(t,"string");return Gu(e)=="symbol"?e:e+""}function JW(t,e){if(Gu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ude=Ts.canStoreURLs=!0,Vde=Ts.FileUrlStorage=function(){function t(e){WW(this,t),this.path=e}return KW(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,HW.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 nD=y(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Object.defineProperty(Wt,"DefaultHttpStack",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(Wt,"DetailedError",{enumerable:!0,get:function(){return XW.default}});Object.defineProperty(Wt,"FileUrlStorage",{enumerable:!0,get:function(){return PF.FileUrlStorage}});Object.defineProperty(Wt,"StreamSource",{enumerable:!0,get:function(){return rK.default}});Wt.Upload=void 0;Object.defineProperty(Wt,"canStoreURLs",{enumerable:!0,get:function(){return PF.canStoreURLs}});Wt.defaultOptions=void 0;Object.defineProperty(Wt,"enableDebugLog",{enumerable:!0,get:function(){return ZW.enableDebugLog}});Wt.isSupported=void 0;var XW=uo(Yg()),ZW=Jg(),QW=uo(FS()),tD=uo(n1()),eK=uo(g1()),tK=uo(b1()),TF=uo($1()),rK=uo(fy()),PF=FF();function uo(t){return t&&t.__esModule?t:{default:t}}function Rs(t){"@babel/helpers - typeof";return Rs=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},Rs(t)}function nK(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 iK(t,e,r){return e&&OF(t.prototype,e),r&&OF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function oK(t,e,r){return e=nd(e),sK(t,RF()?Reflect.construct(e,r||[],nd(t).constructor):e.apply(t,r))}function sK(t,e){if(e&&(Rs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aK(t)}function aK(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 nd(t){return nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nd(t)}function uK(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&&rD(t,e)}function rD(t,e){return rD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rD(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 Ps(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){cK(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 cK(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=lK(t,"string");return Rs(e)=="symbol"?e:e+""}function lK(t,e){if(Rs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Rs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kF=Wt.defaultOptions=Ps(Ps({},tD.default.defaultOptions),{},{httpStack:new TF.default,fileReader:new eK.default,urlStorage:new QW.default,fingerprint:tK.default}),zde=Wt.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 nK(this,e),n=Ps(Ps({},kF),n),oK(this,e,[r,n])}return uK(e,t),iK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Ps(Ps({},kF),i),tD.default.terminate(n,i)}}])}(tD.default),Gde=Wt.isSupported=!0});var Cn={};gn(Cn,{__addDisposableResource:()=>t2,__assign:()=>id,__asyncDelegator:()=>WF,__asyncGenerator:()=>GF,__asyncValues:()=>KF,__await:()=>$s,__awaiter:()=>qF,__classPrivateFieldGet:()=>ZF,__classPrivateFieldIn:()=>e2,__classPrivateFieldSet:()=>QF,__createBinding:()=>sd,__decorate:()=>NF,__disposeResources:()=>r2,__esDecorate:()=>fK,__exportStar:()=>UF,__extends:()=>IF,__generator:()=>MF,__importDefault:()=>XF,__importStar:()=>JF,__makeTemplateObject:()=>YF,__metadata:()=>BF,__param:()=>LF,__propKey:()=>hK,__read:()=>oD,__rest:()=>jF,__runInitializers:()=>dK,__setFunctionName:()=>pK,__spread:()=>VF,__spreadArray:()=>zF,__spreadArrays:()=>HF,__values:()=>od,default:()=>yK});function IF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");iD(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 fK(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 m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.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],m);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 dK(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 hK(t){return typeof t=="symbol"?t:"".concat(t)}function pK(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)&&sd(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 oD(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(oD(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 $s(t){return this instanceof $s?(this.v=t,this):new $s(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(m){return Promise.resolve(m).then(d,f)}}function a(d,m){n[d]&&(i[d]=function(b){return new Promise(function(g,w){o.push([d,b,g,w])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{c(n[d](m))}catch(b){h(o[0][3],b)}}function c(d){d.value instanceof $s?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,m){d(m),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:$s(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 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 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)&&sd(e,t,r);return mK(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 gK(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 iD,id,sd,mK,gK,yK,Sn=lt(()=>{iD=function(t,e){return iD=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])},iD(t,e)};id=function(){return id=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},id.apply(this,arguments)};sd=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]};mK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};gK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};yK={__extends:IF,__assign:id,__rest:jF,__decorate:NF,__param:LF,__metadata:BF,__awaiter:qF,__generator:MF,__createBinding:sd,__exportStar:UF,__values:od,__read:oD,__spread:VF,__spreadArrays:HF,__spreadArray:zF,__await:$s,__asyncGenerator:GF,__asyncDelegator:WF,__asyncValues:KF,__makeTemplateObject:YF,__importStar:JF,__importDefault:XF,__classPrivateFieldGet:ZF,__classPrivateFieldSet:QF,__classPrivateFieldIn:e2,__addDisposableResource:t2,__disposeResources:r2}});var S2={};gn(S2,{__addDisposableResource:()=>E2,__assign:()=>ad,__asyncDelegator:()=>m2,__asyncGenerator:()=>p2,__asyncValues:()=>g2,__await:()=>Is,__awaiter:()=>u2,__classPrivateFieldGet:()=>b2,__classPrivateFieldIn:()=>_2,__classPrivateFieldSet:()=>w2,__createBinding:()=>cd,__decorate:()=>o2,__disposeResources:()=>C2,__esDecorate:()=>DK,__exportStar:()=>l2,__extends:()=>n2,__generator:()=>c2,__importDefault:()=>v2,__importStar:()=>D2,__makeTemplateObject:()=>y2,__metadata:()=>a2,__param:()=>s2,__propKey:()=>bK,__read:()=>aD,__rest:()=>i2,__runInitializers:()=>vK,__setFunctionName:()=>wK,__spread:()=>f2,__spreadArray:()=>h2,__spreadArrays:()=>d2,__values:()=>ud,default:()=>CK});function n2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sD(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 DK(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 m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.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],m);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 vK(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 bK(t){return typeof t=="symbol"?t:"".concat(t)}function wK(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)&&cd(e,t,r)}function ud(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 f2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(aD(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 Is(t){return this instanceof Is?(this.v=t,this):new Is(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(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof Is?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:Is(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 ud=="function"?ud(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)&&cd(e,t,r);return _K(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 EK(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 sD,ad,cd,_K,EK,CK,x2=lt(()=>{sD=function(t,e){return sD=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])},sD(t,e)};ad=function(){return ad=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},ad.apply(this,arguments)};cd=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]};_K=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};EK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};CK={__extends:n2,__assign:ad,__rest:i2,__decorate:o2,__param:s2,__metadata:a2,__awaiter:u2,__generator:c2,__createBinding:cd,__exportStar:l2,__values:ud,__read:aD,__spread:f2,__spreadArrays:d2,__spreadArray:h2,__await:Is,__asyncGenerator:p2,__asyncDelegator:m2,__asyncValues:g2,__makeTemplateObject:y2,__importStar:D2,__importDefault:v2,__classPrivateFieldGet:b2,__classPrivateFieldSet:w2,__classPrivateFieldIn:_2,__addDisposableResource:E2,__disposeResources:C2}});var Kt=y(uD=>{"use strict";uD.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})};uD.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 Wu=y(ai=>{"use strict";var F2=Kt().fromCallback,$t=pt(),SK=["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 $t[t]=="function");Object.keys($t).forEach(t=>{t!=="promises"&&(ai[t]=$t[t])});SK.forEach(t=>{ai[t]=F2($t[t])});ai.exists=function(t,e){return typeof e=="function"?$t.exists(t,e):new Promise(r=>$t.exists(t,r))};ai.read=function(t,e,r,n,i,o){return typeof o=="function"?$t.read(t,e,r,n,i,o):new Promise((s,a)=>{$t.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};ai.write=function(t,e,...r){return typeof r[r.length-1]=="function"?$t.write(t,e,...r):new Promise((n,i)=>{$t.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof $t.writev=="function"&&(ai.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?$t.writev(t,e,...r):new Promise((n,i)=>{$t.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof $t.realpath.native=="function"&&(ai.realpath.native=F2($t.realpath.native))});var cD=y((Jde,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((Xde,lD)=>{"use strict";var js=Wu(),xn=require("path"),xK=cD(),A2=xK("10.12.0"),k2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(xn.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};lD.exports.makeDir=async(t,e)=>{if(k2(t),e=T2(e),A2){let n=xn.resolve(t);return js.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await js.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(xn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return await r(xn.dirname(n)),r(n)}try{if(!(await js.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(xn.resolve(t))};lD.exports.makeDirSync=(t,e)=>{if(k2(t),e=T2(e),A2){let n=xn.resolve(t);return js.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{js.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(xn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return r(xn.dirname(n)),r(n)}try{if(!js.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(xn.resolve(t))}});var Tr=y((Zde,$2)=>{"use strict";var FK=Kt().fromPromise,{makeDir:OK,makeDirSync:fD}=R2(),dD=FK(OK);$2.exports={mkdirs:dD,mkdirsSync:fD,mkdirp:dD,mkdirpSync:fD,ensureDir:dD,ensureDirSync:fD}});var hD=y((Qde,I2)=>{"use strict";var Ns=pt();function AK(t,e,r,n){Ns.open(t,"r+",(i,o)=>{if(i)return n(i);Ns.futimes(o,e,r,s=>{Ns.close(o,a=>{n&&n(s||a)})})})}function kK(t,e,r){let n=Ns.openSync(t,"r+");return Ns.futimesSync(n,e,r),Ns.closeSync(n)}I2.exports={utimesMillis:AK,utimesMillisSync:kK}});var Ku=y((ehe,B2)=>{"use strict";var Ls=Wu(),Yt=require("path"),TK=require("util"),PK=cD(),ld=PK("10.5.0"),j2=t=>ld?Ls.stat(t,{bigint:!0}):Ls.stat(t),pD=t=>ld?Ls.statSync(t,{bigint:!0}):Ls.statSync(t);function RK(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 $K(t,e){let r,n=pD(t);try{r=pD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function IK(t,e,r,n){TK.callbackify(RK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&fd(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&mD(t,e)?n(new Error(dd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function jK(t,e,r){let{srcStat:n,destStat:i}=$K(t,e);if(i&&fd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&mD(t,e))throw new Error(dd(t,e,r));return{srcStat:n,destStat:i}}function N2(t,e,r,n,i){let o=Yt.resolve(Yt.dirname(t)),s=Yt.resolve(Yt.dirname(r));if(s===o||s===Yt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):fd(e,c)?i(new Error(dd(t,r,n))):N2(t,e,s,n,i);ld?Ls.stat(s,{bigint:!0},a):Ls.stat(s,a)}function L2(t,e,r,n){let i=Yt.resolve(Yt.dirname(t)),o=Yt.resolve(Yt.dirname(r));if(o===i||o===Yt.parse(o).root)return;let s;try{s=pD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(fd(e,s))throw new Error(dd(t,r,n));return L2(t,e,o,n)}function fd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(ld||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 mD(t,e){let r=Yt.resolve(t).split(Yt.sep).filter(i=>i),n=Yt.resolve(e).split(Yt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function dd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}B2.exports={checkPaths:IK,checkPathsSync:jK,checkParentPaths:N2,checkParentPathsSync:L2,isSrcSubdir:mD}});var H2=y((the,V2)=>{"use strict";var xt=pt(),Yu=require("path"),NK=Tr().mkdirsSync,LK=hD().utimesMillisSync,Ju=Ku();function BK(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
42
  see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Ju.checkPathsSync(t,e,"copy");return Ju.checkParentPathsSync(t,n,e,"copy"),qK(i,t,e,r)}function qK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Yu.dirname(r);return xt.existsSync(i)||NK(i),q2(t,e,r,n)}function q2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return MK(t,e,r,n)}function MK(t,e,r,n){let o=(n.dereference?xt.statSync:xt.lstatSync)(e);if(o.isDirectory())return KK(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return UK(o,t,e,r,n);if(o.isSymbolicLink())return XK(t,e,r,n)}function UK(t,e,r,n,i){return e?VK(t,r,n,i):M2(t,r,n,i)}function VK(t,e,r,n){if(n.overwrite)return xt.unlinkSync(r),M2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function M2(t,e,r,n){return xt.copyFileSync(e,r),n.preserveTimestamps&&HK(t.mode,e,r),gD(r,t.mode)}function HK(t,e,r){return zK(t)&&GK(r,t),WK(e,r)}function zK(t){return(t&128)===0}function GK(t,e){return gD(t,e|128)}function gD(t,e){return xt.chmodSync(t,e)}function WK(t,e){let r=xt.statSync(t);return LK(e,r.atime,r.mtime)}function KK(t,e,r,n,i){if(!e)return YK(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 YK(t,e,r,n){return xt.mkdirSync(r),U2(e,r,n),gD(r,t)}function U2(t,e,r){xt.readdirSync(t).forEach(n=>JK(n,t,e,r))}function JK(t,e,r,n){let i=Yu.join(e,t),o=Yu.join(r,t),{destStat:s}=Ju.checkPathsSync(i,o,"copy");return q2(s,i,o,n)}function XK(t,e,r,n){let i=xt.readlinkSync(e);if(n.dereference&&(i=Yu.resolve(process.cwd(),i)),t){let o;try{o=xt.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return xt.symlinkSync(i,r);throw s}if(n.dereference&&(o=Yu.resolve(process.cwd(),o)),Ju.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(xt.statSync(r).isDirectory()&&Ju.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return ZK(i,r)}else return xt.symlinkSync(i,r)}function ZK(t,e){return xt.unlinkSync(e),xt.symlinkSync(t,e)}V2.exports=BK});var yD=y((rhe,z2)=>{"use strict";z2.exports={copySync:H2()}});var ui=y((nhe,W2)=>{"use strict";var QK=Kt().fromPromise,G2=Wu();function eY(t){return G2.access(t).then(()=>!0).catch(()=>!1)}W2.exports={pathExists:QK(eY),pathExistsSync:G2.existsSync}});var rO=y((ihe,tO)=>{"use strict";var Jt=pt(),Xu=require("path"),tY=Tr().mkdirs,rY=ui().pathExists,nY=hD().utimesMillis,Zu=Ku();function iY(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`),Zu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Zu.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=Xu.dirname(r);rY(o,(s,a)=>{if(s)return i(s);if(a)return DD(t,e,r,n,i);tY(o,u=>u?i(u):DD(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 DD(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?Jt.stat:Jt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return fY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return oY(a,t,e,r,n,i);if(a.isSymbolicLink())return pY(t,e,r,n,i)})}function oY(t,e,r,n,i,o){return e?sY(t,r,n,i,o):Z2(t,r,n,i,o)}function sY(t,e,r,n,i){if(n.overwrite)Jt.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){Jt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?aY(t.mode,e,r,i):hd(r,t.mode,i))}function aY(t,e,r,n){return uY(t)?cY(r,t,i=>i?n(i):J2(t,e,r,n)):J2(t,e,r,n)}function uY(t){return(t&128)===0}function cY(t,e,r){return hd(t,e|128,r)}function J2(t,e,r,n){lY(e,r,i=>i?n(i):hd(r,t,n))}function hd(t,e,r){return Jt.chmod(t,e,r)}function lY(t,e,r){Jt.stat(t,(n,i)=>n?r(n):nY(e,i.atime,i.mtime,r))}function fY(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):dY(t.mode,r,n,i,o)}function dY(t,e,r,n,i){Jt.mkdir(r,o=>{if(o)return i(o);Q2(e,r,n,s=>s?i(s):hd(r,t,i))})}function Q2(t,e,r,n){Jt.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?hY(t,o,e,r,n,i):i()}function hY(t,e,r,n,i,o){let s=Xu.join(r,e),a=Xu.join(n,e);Zu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;DD(l,s,a,i,f=>f?o(f):eO(t,r,n,i,o))})}function pY(t,e,r,n,i){Jt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Xu.resolve(process.cwd(),s)),t)Jt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Jt.symlink(s,r,i):i(a):(n.dereference&&(u=Xu.resolve(process.cwd(),u)),Zu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Zu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):mY(s,r,i)));else return Jt.symlink(s,r,i)})}function mY(t,e,r){Jt.unlink(e,n=>n?r(n):Jt.symlink(t,e,r))}tO.exports=iY});var vD=y((ohe,nO)=>{"use strict";var gY=Kt().fromCallback;nO.exports={copy:gY(rO())}});var dO=y((she,fO)=>{"use strict";var iO=pt(),uO=require("path"),xe=require("assert"),Qu=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 bD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe.strictEqual(typeof r,"function","rimraf: callback function required"),xe(e,"rimraf: invalid options argument provided"),xe.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){xe(t),xe(e),xe(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Qu)return sO(t,e,n,r);if(i&&i.isDirectory())return pd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Qu?sO(t,e,o,r):pd(t,e,o,r);if(o.code==="EISDIR")return pd(t,e,o,r)}return r(o)})})}function sO(t,e,r,n){xe(t),xe(e),xe(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()?pd(t,e,r,n):e.unlink(t,n)})})}function aO(t,e,r){let n;xe(t),xe(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()?md(t,e,r):e.unlinkSync(t)}function pd(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?yY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function yY(t,e,r){xe(t),xe(e),xe(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=>{bD(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),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe(e,"rimraf: missing options"),xe.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Qu&&aO(t,e,n)}try{r&&r.isDirectory()?md(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Qu?aO(t,e,n):md(t,e,n);if(n.code!=="EISDIR")throw n;md(t,e,n)}}function md(t,e,r){xe(t),xe(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")DY(t,e);else if(n.code!=="ENOENT")throw n}}function DY(t,e){if(xe(t),xe(e),e.readdirSync(t).forEach(r=>lO(uO.join(t,r),e)),Qu){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=bD;bD.sync=lO});var ec=y((ahe,pO)=>{"use strict";var vY=Kt().fromCallback,hO=dO();pO.exports={remove:vY(hO),removeSync:hO.sync}});var _O=y((uhe,wO)=>{"use strict";var bY=Kt().fromCallback,yO=pt(),DO=require("path"),vO=Tr(),bO=ec(),mO=bY(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((che,SO)=>{"use strict";var wY=Kt().fromCallback,EO=require("path"),ci=pt(),CO=Tr();function _Y(t,e){function r(){ci.writeFile(t,"",n=>{if(n)return e(n);e()})}ci.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=EO.dirname(t);ci.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():ci.readdir(o,u=>{if(u)return e(u)})})})}function EY(t){let e;try{e=ci.statSync(t)}catch{}if(e&&e.isFile())return;let r=EO.dirname(t);try{ci.statSync(r).isDirectory()||ci.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CO.mkdirsSync(r);else throw n}ci.writeFileSync(t,"")}SO.exports={createFile:wY(_Y),createFileSync:EY}});var TO=y((lhe,kO)=>{"use strict";var CY=Kt().fromCallback,OO=require("path"),co=pt(),AO=Tr(),FO=ui().pathExists;function SY(t,e,r){function n(i,o){co.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);co.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 xY(t,e){if(co.existsSync(e))return;try{co.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=OO.dirname(e);return co.existsSync(n)||AO.mkdirsSync(n),co.linkSync(t,e)}kO.exports={createLink:CY(SY),createLinkSync:xY}});var RO=y((fhe,PO)=>{"use strict";var li=require("path"),tc=pt(),FY=ui().pathExists;function OY(t,e,r){if(li.isAbsolute(t))return tc.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=li.dirname(e),i=li.join(n,t);return FY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):tc.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:li.relative(n,t)})))}}function AY(t,e){let r;if(li.isAbsolute(t)){if(r=tc.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=li.dirname(e),i=li.join(n,t);if(r=tc.existsSync(i),r)return{toCwd:i,toDst:t};if(r=tc.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:li.relative(n,t)}}}PO.exports={symlinkPaths:OY,symlinkPathsSync:AY}});var jO=y((dhe,IO)=>{"use strict";var $O=pt();function kY(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 TY(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:kY,symlinkTypeSync:TY}});var VO=y((hhe,UO)=>{"use strict";var PY=Kt().fromCallback,LO=require("path"),Ls=pt(),BO=Tr(),RY=BO.mkdirs,$Y=BO.mkdirsSync,qO=RO(),IY=qO.symlinkPaths,jY=qO.symlinkPathsSync,MO=jO(),NY=MO.symlinkType,LY=MO.symlinkTypeSync,NO=ui().pathExists;function BY(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);IY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,NY(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 Ls.symlink(t,e,c,n);RY(l,d=>{if(d)return n(d);Ls.symlink(t,e,c,n)})})})})})}function qY(t,e,r){if(Ls.existsSync(e))return;let i=jY(t,e);t=i.toDst,r=LY(i.toCwd,r);let o=LO.dirname(e);return Ls.existsSync(o)||$Y(o),Ls.symlinkSync(t,e,r)}UO.exports={createSymlink:PY(BY),createSymlinkSync:qY}});var zO=y((phe,HO)=>{"use strict";var gd=xO(),yd=TO(),Dd=VO();HO.exports={createFile:gd.createFile,createFileSync:gd.createFileSync,ensureFile:gd.createFile,ensureFileSync:gd.createFileSync,createLink:yd.createLink,createLinkSync:yd.createLinkSync,ensureLink:yd.createLink,ensureLinkSync:yd.createLinkSync,createSymlink:Dd.createSymlink,createSymlinkSync:Dd.createSymlinkSync,ensureSymlink:Dd.createSymlink,ensureSymlinkSync:Dd.createSymlinkSync}});var vd=y((mhe,GO)=>{function MY(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 UY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GO.exports={stringify:MY,stripBom:UY}});var JO=y((ghe,YO)=>{var Bs;try{Bs=pt()}catch{Bs=require("fs")}var bd=Kt(),{stringify:WO,stripBom:KO}=vd();async function VY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Bs,n="throws"in e?e.throws:!0,i=await bd.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 HY=bd.fromPromise(VY);function zY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Bs,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 GY(t,e,r={}){let n=r.fs||Bs,i=WO(e,r);await bd.fromCallback(n.writeFile)(t,i,r)}var WY=bd.fromPromise(GY);function KY(t,e,r={}){let n=r.fs||Bs,i=WO(e,r);return n.writeFileSync(t,i,r)}var YY={readFile:HY,readFileSync:zY,writeFile:WY,writeFileSync:KY};YO.exports=YY});var ZO=y((yhe,XO)=>{"use strict";var wd=JO();XO.exports={readJson:wd.readFile,readJsonSync:wd.readFileSync,writeJson:wd.writeFile,writeJsonSync:wd.writeFileSync}});var _d=y((Dhe,tA)=>{"use strict";var JY=Kt().fromCallback,rc=pt(),QO=require("path"),eA=Tr(),XY=ui().pathExists;function ZY(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=QO.dirname(t);XY(i,(o,s)=>{if(o)return n(o);if(s)return rc.writeFile(t,e,r,n);eA.mkdirs(i,a=>{if(a)return n(a);rc.writeFile(t,e,r,n)})})}function QY(t,...e){let r=QO.dirname(t);if(rc.existsSync(r))return rc.writeFileSync(t,...e);eA.mkdirsSync(r),rc.writeFileSync(t,...e)}tA.exports={outputFile:JY(ZY),outputFileSync:QY}});var nA=y((vhe,rA)=>{"use strict";var{stringify:eJ}=vd(),{outputFile:tJ}=_d();async function rJ(t,e,r={}){let n=eJ(e,r);await tJ(t,n,r)}rA.exports=rJ});var oA=y((bhe,iA)=>{"use strict";var{stringify:nJ}=vd(),{outputFileSync:iJ}=_d();function oJ(t,e,r){let n=nJ(e,r);iJ(t,n,r)}iA.exports=oJ});var aA=y((whe,sA)=>{"use strict";var sJ=Kt().fromPromise,It=ZO();It.outputJson=sJ(nA());It.outputJsonSync=oA();It.outputJSON=It.outputJson;It.outputJSONSync=It.outputJsonSync;It.writeJSON=It.writeJson;It.writeJSONSync=It.writeJsonSync;It.readJSON=It.readJson;It.readJSONSync=It.readJsonSync;sA.exports=It});var hA=y((_he,dA)=>{"use strict";var lA=pt(),aJ=require("path"),uJ=yD().copySync,fA=ec().removeSync,cJ=Tr().mkdirpSync,uA=Ku();function lJ(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"),cJ(aJ.dirname(e)),fJ(t,e,n)}function fJ(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 dJ(t,e,r)}}function dJ(t,e,r){return uJ(t,e,{overwrite:r,errorOnExist:!0}),fA(t)}dA.exports=lJ});var mA=y((Ehe,pA)=>{"use strict";pA.exports={moveSync:hA()}});var bA=y((Che,vA)=>{"use strict";var hJ=pt(),pJ=require("path"),mJ=vD().copy,DA=ec().remove,gJ=Tr().mkdirp,yJ=ui().pathExists,gA=Ku();function DJ(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);gJ(pJ.dirname(e),c=>c?n(c):vJ(t,e,i,n))})})}function vJ(t,e,r,n){if(r)return DA(e,i=>i?n(i):yA(t,e,r,n));yJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):yA(t,e,r,n))}function yA(t,e,r,n){hJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):bJ(t,e,r,n):n())}function bJ(t,e,r,n){mJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):DA(t,n))}vA.exports=DJ});var _A=y((She,wA)=>{"use strict";var wJ=Kt().fromCallback;wA.exports={move:wJ(bA())}});var Ed=y((xhe,wD)=>{"use strict";wD.exports={...Wu(),...yD(),...vD(),..._O(),...zO(),...aA(),...Tr(),...mA(),..._A(),..._d(),...ui(),...ec()};var EA=require("fs");Object.getOwnPropertyDescriptor(EA,"promises")&&Object.defineProperty(wD.exports,"promises",{get(){return EA.promises}})});var _D=y(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.readdir=qs.stat=void 0;var CA=Ed();async function _J(t){try{return await CA.stat(t)}catch{}}qs.stat=_J;async function EJ(t){try{return await CA.readdir(t)}catch{return[]}}qs.readdir=EJ});var Ms=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 CJ=(x2(),ke(S2)),br=Ed(),SJ=require("os"),Fn=require("path"),SA=require("stream"),xA=_D();CJ.__exportStar(Ed(),re);var FA=_D();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return FA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return FA.readdir}});async function xJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=CD(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=xJ;async function FJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=Fn.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=Fn.resolve(t),CD(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=FJ;async function OJ(t){try{return await br.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=OJ;async function ED(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=br.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=ED;async function AJ(t){return Promise.all([ED(t),(async()=>{try{return(await br.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=AJ;async function kJ(t,e){let r=await ED(t);await br.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=kJ;function TJ(t,e){return new Promise((r,n)=>{let i=br.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=TJ;async function nc(t,e){try{await br.access(t,e)}catch{return!1}return!0}re.pathAccessible=nc;async function PJ(t){return nc(t,br.constants.F_OK)}re.pathExists=PJ;async function RJ(t){return nc(t,br.constants.R_OK)}re.pathReadable=RJ;async function $J(t){return nc(t,br.constants.W_OK)}re.pathWritable=$J;async function OA(t){return nc(t,br.constants.X_OK)}re.pathExecutable=OA;async function IJ(t){let[e,r]=await Promise.all([xA.stat(t),OA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=IJ;async function jJ(t,e){if(!(!t||!e)){for(let r of AA(t))if((await xA.readdir(r)).includes(e))return r}}re.findBaseDirectory=jJ;function NJ(t){let e=Math.random().toString(16).substring(2,8);return Fn.resolve(SJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=NJ;function AA(t){if(t=Fn.normalize(t),!Fn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=Fn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(Fn.sep).map((r,n,i)=>e.root+Fn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=AA;var Cd=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}br.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?br.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>Fn.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=Cd;function CD(t,e={}){return new Cd(t,e)}re.walk=CD});var SD=y((Ahe,kA)=>{var Us=1e3,Vs=Us*60,Hs=Vs*60,lo=Hs*24,LJ=lo*7,BJ=lo*365.25;kA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return qJ(t);if(r==="number"&&isFinite(t))return e.long?UJ(t):MJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function qJ(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*BJ;case"weeks":case"week":case"w":return r*LJ;case"days":case"day":case"d":return r*lo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Vs;case"seconds":case"second":case"secs":case"sec":case"s":return r*Us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function MJ(t){var e=Math.abs(t);return e>=lo?Math.round(t/lo)+"d":e>=Hs?Math.round(t/Hs)+"h":e>=Vs?Math.round(t/Vs)+"m":e>=Us?Math.round(t/Us)+"s":t+"ms"}function UJ(t){var e=Math.abs(t);return e>=lo?Sd(t,e,lo,"day"):e>=Hs?Sd(t,e,Hs,"hour"):e>=Vs?Sd(t,e,Vs,"minute"):e>=Us?Sd(t,e,Us,"second"):t+" ms"}function Sd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var xD=y((khe,TA)=>{function VJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=SD(),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,m;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,m=r.enabled(l)),m),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=VJ});var PA=y((ar,xd)=>{ar.formatArgs=zJ;ar.save=GJ;ar.load=WJ;ar.useColors=HJ;ar.storage=KJ();ar.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`."))}})();ar.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 HJ(){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 zJ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+xd.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)}ar.log=console.debug||console.log||(()=>{});function GJ(t){try{t?ar.storage.setItem("debug",t):ar.storage.removeItem("debug")}catch{}}function WJ(){let t;try{t=ar.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function KJ(){try{return localStorage}catch{}}xd.exports=xD()(ar);var{formatters:YJ}=xd.exports;YJ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $A=y((The,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 AD=y((Phe,jA)=>{"use strict";var JJ=require("os"),IA=require("tty"),wr=$A(),{env:gt}=process,fi;wr("no-color")||wr("no-colors")||wr("color=false")||wr("color=never")?fi=0:(wr("color")||wr("colors")||wr("color=true")||wr("color=always"))&&(fi=1);"FORCE_COLOR"in gt&&(gt.FORCE_COLOR==="true"?fi=1:gt.FORCE_COLOR==="false"?fi=0:fi=gt.FORCE_COLOR.length===0?1:Math.min(parseInt(gt.FORCE_COLOR,10),3));function FD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function OD(t,e){if(fi===0)return 0;if(wr("color=16m")||wr("color=full")||wr("color=truecolor"))return 3;if(wr("color=256"))return 2;if(t&&!e&&fi===void 0)return 0;let r=fi||0;if(gt.TERM==="dumb")return r;if(process.platform==="win32"){let n=JJ.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in gt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in gt)||gt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in gt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(gt.TEAMCITY_VERSION)?1:0;if(gt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in gt){let n=parseInt((gt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(gt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(gt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(gt.TERM)||"COLORTERM"in gt?1:r}function XJ(t){let e=OD(t,t&&t.isTTY);return FD(e)}jA.exports={supportsColor:XJ,stdout:FD(OD(!0,IA.isatty(1))),stderr:FD(OD(!0,IA.isatty(2)))}});var LA=y((yt,Od)=>{var ZJ=require("tty"),Fd=require("util");yt.init=oX;yt.log=rX;yt.formatArgs=eX;yt.save=nX;yt.load=iX;yt.useColors=QJ;yt.destroy=Fd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");yt.colors=[6,2,3,4,5,1];try{let t=AD();t&&(t.stderr||t).level>=2&&(yt.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{}yt.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 QJ(){return"colors"in yt.inspectOpts?!!yt.inspectOpts.colors:ZJ.isatty(process.stderr.fd)}function eX(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`),Zu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Zu.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=Xu.dirname(r);rY(o,(s,a)=>{if(s)return i(s);if(a)return DD(t,e,r,n,i);tY(o,u=>u?i(u):DD(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 DD(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?Jt.stat:Jt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return fY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return oY(a,t,e,r,n,i);if(a.isSymbolicLink())return pY(t,e,r,n,i)})}function oY(t,e,r,n,i,o){return e?sY(t,r,n,i,o):Z2(t,r,n,i,o)}function sY(t,e,r,n,i){if(n.overwrite)Jt.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){Jt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?aY(t.mode,e,r,i):hd(r,t.mode,i))}function aY(t,e,r,n){return uY(t)?cY(r,t,i=>i?n(i):J2(t,e,r,n)):J2(t,e,r,n)}function uY(t){return(t&128)===0}function cY(t,e,r){return hd(t,e|128,r)}function J2(t,e,r,n){lY(e,r,i=>i?n(i):hd(r,t,n))}function hd(t,e,r){return Jt.chmod(t,e,r)}function lY(t,e,r){Jt.stat(t,(n,i)=>n?r(n):nY(e,i.atime,i.mtime,r))}function fY(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):dY(t.mode,r,n,i,o)}function dY(t,e,r,n,i){Jt.mkdir(r,o=>{if(o)return i(o);Q2(e,r,n,s=>s?i(s):hd(r,t,i))})}function Q2(t,e,r,n){Jt.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?hY(t,o,e,r,n,i):i()}function hY(t,e,r,n,i,o){let s=Xu.join(r,e),a=Xu.join(n,e);Zu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;DD(l,s,a,i,f=>f?o(f):eO(t,r,n,i,o))})}function pY(t,e,r,n,i){Jt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Xu.resolve(process.cwd(),s)),t)Jt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Jt.symlink(s,r,i):i(a):(n.dereference&&(u=Xu.resolve(process.cwd(),u)),Zu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Zu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):mY(s,r,i)));else return Jt.symlink(s,r,i)})}function mY(t,e,r){Jt.unlink(e,n=>n?r(n):Jt.symlink(t,e,r))}tO.exports=iY});var vD=y((ohe,nO)=>{"use strict";var gY=Kt().fromCallback;nO.exports={copy:gY(rO())}});var dO=y((she,fO)=>{"use strict";var iO=pt(),uO=require("path"),xe=require("assert"),Qu=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 bD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe.strictEqual(typeof r,"function","rimraf: callback function required"),xe(e,"rimraf: invalid options argument provided"),xe.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){xe(t),xe(e),xe(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Qu)return sO(t,e,n,r);if(i&&i.isDirectory())return pd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Qu?sO(t,e,o,r):pd(t,e,o,r);if(o.code==="EISDIR")return pd(t,e,o,r)}return r(o)})})}function sO(t,e,r,n){xe(t),xe(e),xe(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()?pd(t,e,r,n):e.unlink(t,n)})})}function aO(t,e,r){let n;xe(t),xe(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()?md(t,e,r):e.unlinkSync(t)}function pd(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?yY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function yY(t,e,r){xe(t),xe(e),xe(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=>{bD(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),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe(e,"rimraf: missing options"),xe.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Qu&&aO(t,e,n)}try{r&&r.isDirectory()?md(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Qu?aO(t,e,n):md(t,e,n);if(n.code!=="EISDIR")throw n;md(t,e,n)}}function md(t,e,r){xe(t),xe(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")DY(t,e);else if(n.code!=="ENOENT")throw n}}function DY(t,e){if(xe(t),xe(e),e.readdirSync(t).forEach(r=>lO(uO.join(t,r),e)),Qu){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=bD;bD.sync=lO});var ec=y((ahe,pO)=>{"use strict";var vY=Kt().fromCallback,hO=dO();pO.exports={remove:vY(hO),removeSync:hO.sync}});var _O=y((uhe,wO)=>{"use strict";var bY=Kt().fromCallback,yO=pt(),DO=require("path"),vO=Tr(),bO=ec(),mO=bY(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((che,SO)=>{"use strict";var wY=Kt().fromCallback,EO=require("path"),ci=pt(),CO=Tr();function _Y(t,e){function r(){ci.writeFile(t,"",n=>{if(n)return e(n);e()})}ci.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=EO.dirname(t);ci.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():ci.readdir(o,u=>{if(u)return e(u)})})})}function EY(t){let e;try{e=ci.statSync(t)}catch{}if(e&&e.isFile())return;let r=EO.dirname(t);try{ci.statSync(r).isDirectory()||ci.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CO.mkdirsSync(r);else throw n}ci.writeFileSync(t,"")}SO.exports={createFile:wY(_Y),createFileSync:EY}});var TO=y((lhe,kO)=>{"use strict";var CY=Kt().fromCallback,OO=require("path"),co=pt(),AO=Tr(),FO=ui().pathExists;function SY(t,e,r){function n(i,o){co.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);co.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 xY(t,e){if(co.existsSync(e))return;try{co.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=OO.dirname(e);return co.existsSync(n)||AO.mkdirsSync(n),co.linkSync(t,e)}kO.exports={createLink:CY(SY),createLinkSync:xY}});var RO=y((fhe,PO)=>{"use strict";var li=require("path"),tc=pt(),FY=ui().pathExists;function OY(t,e,r){if(li.isAbsolute(t))return tc.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=li.dirname(e),i=li.join(n,t);return FY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):tc.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:li.relative(n,t)})))}}function AY(t,e){let r;if(li.isAbsolute(t)){if(r=tc.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=li.dirname(e),i=li.join(n,t);if(r=tc.existsSync(i),r)return{toCwd:i,toDst:t};if(r=tc.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:li.relative(n,t)}}}PO.exports={symlinkPaths:OY,symlinkPathsSync:AY}});var jO=y((dhe,IO)=>{"use strict";var $O=pt();function kY(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 TY(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:kY,symlinkTypeSync:TY}});var VO=y((hhe,UO)=>{"use strict";var PY=Kt().fromCallback,LO=require("path"),Bs=pt(),BO=Tr(),RY=BO.mkdirs,$Y=BO.mkdirsSync,qO=RO(),IY=qO.symlinkPaths,jY=qO.symlinkPathsSync,MO=jO(),NY=MO.symlinkType,LY=MO.symlinkTypeSync,NO=ui().pathExists;function BY(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);IY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,NY(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 Bs.symlink(t,e,c,n);RY(l,d=>{if(d)return n(d);Bs.symlink(t,e,c,n)})})})})})}function qY(t,e,r){if(Bs.existsSync(e))return;let i=jY(t,e);t=i.toDst,r=LY(i.toCwd,r);let o=LO.dirname(e);return Bs.existsSync(o)||$Y(o),Bs.symlinkSync(t,e,r)}UO.exports={createSymlink:PY(BY),createSymlinkSync:qY}});var zO=y((phe,HO)=>{"use strict";var gd=xO(),yd=TO(),Dd=VO();HO.exports={createFile:gd.createFile,createFileSync:gd.createFileSync,ensureFile:gd.createFile,ensureFileSync:gd.createFileSync,createLink:yd.createLink,createLinkSync:yd.createLinkSync,ensureLink:yd.createLink,ensureLinkSync:yd.createLinkSync,createSymlink:Dd.createSymlink,createSymlinkSync:Dd.createSymlinkSync,ensureSymlink:Dd.createSymlink,ensureSymlinkSync:Dd.createSymlinkSync}});var vd=y((mhe,GO)=>{function MY(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 UY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GO.exports={stringify:MY,stripBom:UY}});var JO=y((ghe,YO)=>{var qs;try{qs=pt()}catch{qs=require("fs")}var bd=Kt(),{stringify:WO,stripBom:KO}=vd();async function VY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||qs,n="throws"in e?e.throws:!0,i=await bd.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 HY=bd.fromPromise(VY);function zY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||qs,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 GY(t,e,r={}){let n=r.fs||qs,i=WO(e,r);await bd.fromCallback(n.writeFile)(t,i,r)}var WY=bd.fromPromise(GY);function KY(t,e,r={}){let n=r.fs||qs,i=WO(e,r);return n.writeFileSync(t,i,r)}var YY={readFile:HY,readFileSync:zY,writeFile:WY,writeFileSync:KY};YO.exports=YY});var ZO=y((yhe,XO)=>{"use strict";var wd=JO();XO.exports={readJson:wd.readFile,readJsonSync:wd.readFileSync,writeJson:wd.writeFile,writeJsonSync:wd.writeFileSync}});var _d=y((Dhe,tA)=>{"use strict";var JY=Kt().fromCallback,rc=pt(),QO=require("path"),eA=Tr(),XY=ui().pathExists;function ZY(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=QO.dirname(t);XY(i,(o,s)=>{if(o)return n(o);if(s)return rc.writeFile(t,e,r,n);eA.mkdirs(i,a=>{if(a)return n(a);rc.writeFile(t,e,r,n)})})}function QY(t,...e){let r=QO.dirname(t);if(rc.existsSync(r))return rc.writeFileSync(t,...e);eA.mkdirsSync(r),rc.writeFileSync(t,...e)}tA.exports={outputFile:JY(ZY),outputFileSync:QY}});var nA=y((vhe,rA)=>{"use strict";var{stringify:eJ}=vd(),{outputFile:tJ}=_d();async function rJ(t,e,r={}){let n=eJ(e,r);await tJ(t,n,r)}rA.exports=rJ});var oA=y((bhe,iA)=>{"use strict";var{stringify:nJ}=vd(),{outputFileSync:iJ}=_d();function oJ(t,e,r){let n=nJ(e,r);iJ(t,n,r)}iA.exports=oJ});var aA=y((whe,sA)=>{"use strict";var sJ=Kt().fromPromise,It=ZO();It.outputJson=sJ(nA());It.outputJsonSync=oA();It.outputJSON=It.outputJson;It.outputJSONSync=It.outputJsonSync;It.writeJSON=It.writeJson;It.writeJSONSync=It.writeJsonSync;It.readJSON=It.readJson;It.readJSONSync=It.readJsonSync;sA.exports=It});var hA=y((_he,dA)=>{"use strict";var lA=pt(),aJ=require("path"),uJ=yD().copySync,fA=ec().removeSync,cJ=Tr().mkdirpSync,uA=Ku();function lJ(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"),cJ(aJ.dirname(e)),fJ(t,e,n)}function fJ(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 dJ(t,e,r)}}function dJ(t,e,r){return uJ(t,e,{overwrite:r,errorOnExist:!0}),fA(t)}dA.exports=lJ});var mA=y((Ehe,pA)=>{"use strict";pA.exports={moveSync:hA()}});var bA=y((Che,vA)=>{"use strict";var hJ=pt(),pJ=require("path"),mJ=vD().copy,DA=ec().remove,gJ=Tr().mkdirp,yJ=ui().pathExists,gA=Ku();function DJ(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);gJ(pJ.dirname(e),c=>c?n(c):vJ(t,e,i,n))})})}function vJ(t,e,r,n){if(r)return DA(e,i=>i?n(i):yA(t,e,r,n));yJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):yA(t,e,r,n))}function yA(t,e,r,n){hJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):bJ(t,e,r,n):n())}function bJ(t,e,r,n){mJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):DA(t,n))}vA.exports=DJ});var _A=y((She,wA)=>{"use strict";var wJ=Kt().fromCallback;wA.exports={move:wJ(bA())}});var Ed=y((xhe,wD)=>{"use strict";wD.exports={...Wu(),...yD(),...vD(),..._O(),...zO(),...aA(),...Tr(),...mA(),..._A(),..._d(),...ui(),...ec()};var EA=require("fs");Object.getOwnPropertyDescriptor(EA,"promises")&&Object.defineProperty(wD.exports,"promises",{get(){return EA.promises}})});var _D=y(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.readdir=Ms.stat=void 0;var CA=Ed();async function _J(t){try{return await CA.stat(t)}catch{}}Ms.stat=_J;async function EJ(t){try{return await CA.readdir(t)}catch{return[]}}Ms.readdir=EJ});var Us=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 CJ=(x2(),ke(S2)),br=Ed(),SJ=require("os"),Fn=require("path"),SA=require("stream"),xA=_D();CJ.__exportStar(Ed(),re);var FA=_D();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return FA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return FA.readdir}});async function xJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=CD(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=xJ;async function FJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=Fn.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=Fn.resolve(t),CD(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=FJ;async function OJ(t){try{return await br.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=OJ;async function ED(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=br.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=ED;async function AJ(t){return Promise.all([ED(t),(async()=>{try{return(await br.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=AJ;async function kJ(t,e){let r=await ED(t);await br.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=kJ;function TJ(t,e){return new Promise((r,n)=>{let i=br.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=TJ;async function nc(t,e){try{await br.access(t,e)}catch{return!1}return!0}re.pathAccessible=nc;async function PJ(t){return nc(t,br.constants.F_OK)}re.pathExists=PJ;async function RJ(t){return nc(t,br.constants.R_OK)}re.pathReadable=RJ;async function $J(t){return nc(t,br.constants.W_OK)}re.pathWritable=$J;async function OA(t){return nc(t,br.constants.X_OK)}re.pathExecutable=OA;async function IJ(t){let[e,r]=await Promise.all([xA.stat(t),OA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=IJ;async function jJ(t,e){if(!(!t||!e)){for(let r of AA(t))if((await xA.readdir(r)).includes(e))return r}}re.findBaseDirectory=jJ;function NJ(t){let e=Math.random().toString(16).substring(2,8);return Fn.resolve(SJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=NJ;function AA(t){if(t=Fn.normalize(t),!Fn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=Fn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(Fn.sep).map((r,n,i)=>e.root+Fn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=AA;var Cd=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}br.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?br.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>Fn.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=Cd;function CD(t,e={}){return new Cd(t,e)}re.walk=CD});var SD=y((Ahe,kA)=>{var Vs=1e3,Hs=Vs*60,zs=Hs*60,lo=zs*24,LJ=lo*7,BJ=lo*365.25;kA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return qJ(t);if(r==="number"&&isFinite(t))return e.long?UJ(t):MJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function qJ(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*BJ;case"weeks":case"week":case"w":return r*LJ;case"days":case"day":case"d":return r*lo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*zs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Hs;case"seconds":case"second":case"secs":case"sec":case"s":return r*Vs;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function MJ(t){var e=Math.abs(t);return e>=lo?Math.round(t/lo)+"d":e>=zs?Math.round(t/zs)+"h":e>=Hs?Math.round(t/Hs)+"m":e>=Vs?Math.round(t/Vs)+"s":t+"ms"}function UJ(t){var e=Math.abs(t);return e>=lo?Sd(t,e,lo,"day"):e>=zs?Sd(t,e,zs,"hour"):e>=Hs?Sd(t,e,Hs,"minute"):e>=Vs?Sd(t,e,Vs,"second"):t+" ms"}function Sd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var xD=y((khe,TA)=>{function VJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=SD(),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,m;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,m=r.enabled(l)),m),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=VJ});var PA=y((ar,xd)=>{ar.formatArgs=zJ;ar.save=GJ;ar.load=WJ;ar.useColors=HJ;ar.storage=KJ();ar.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`."))}})();ar.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 HJ(){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 zJ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+xd.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)}ar.log=console.debug||console.log||(()=>{});function GJ(t){try{t?ar.storage.setItem("debug",t):ar.storage.removeItem("debug")}catch{}}function WJ(){let t;try{t=ar.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function KJ(){try{return localStorage}catch{}}xd.exports=xD()(ar);var{formatters:YJ}=xd.exports;YJ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $A=y((The,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 AD=y((Phe,jA)=>{"use strict";var JJ=require("os"),IA=require("tty"),wr=$A(),{env:gt}=process,fi;wr("no-color")||wr("no-colors")||wr("color=false")||wr("color=never")?fi=0:(wr("color")||wr("colors")||wr("color=true")||wr("color=always"))&&(fi=1);"FORCE_COLOR"in gt&&(gt.FORCE_COLOR==="true"?fi=1:gt.FORCE_COLOR==="false"?fi=0:fi=gt.FORCE_COLOR.length===0?1:Math.min(parseInt(gt.FORCE_COLOR,10),3));function FD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function OD(t,e){if(fi===0)return 0;if(wr("color=16m")||wr("color=full")||wr("color=truecolor"))return 3;if(wr("color=256"))return 2;if(t&&!e&&fi===void 0)return 0;let r=fi||0;if(gt.TERM==="dumb")return r;if(process.platform==="win32"){let n=JJ.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in gt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in gt)||gt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in gt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(gt.TEAMCITY_VERSION)?1:0;if(gt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in gt){let n=parseInt((gt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(gt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(gt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(gt.TERM)||"COLORTERM"in gt?1:r}function XJ(t){let e=OD(t,t&&t.isTTY);return FD(e)}jA.exports={supportsColor:XJ,stdout:FD(OD(!0,IA.isatty(1))),stderr:FD(OD(!0,IA.isatty(2)))}});var LA=y((yt,Od)=>{var ZJ=require("tty"),Fd=require("util");yt.init=oX;yt.log=rX;yt.formatArgs=eX;yt.save=nX;yt.load=iX;yt.useColors=QJ;yt.destroy=Fd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");yt.colors=[6,2,3,4,5,1];try{let t=AD();t&&(t.stderr||t).level>=2&&(yt.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{}yt.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 QJ(){return"colors"in yt.inspectOpts?!!yt.inspectOpts.colors:ZJ.isatty(process.stderr.fd)}function eX(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
47
  `+o),t.push(i+"m+"+Od.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=tX()+e+" "+t[0]}function tX(){return yt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function rX(...t){return process.stderr.write(Fd.formatWithOptions(yt.inspectOpts,...t)+`
48
48
  `)}function nX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function iX(){return process.env.DEBUG}function oX(t){t.inspectOpts={};let e=Object.keys(yt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=yt.inspectOpts[e[r]]}Od.exports=xD()(yt);var{formatters:NA}=Od.exports;NA.o=function(t){return this.inspectOpts.colors=this.useColors,Fd.inspect(t,this.inspectOpts).split(`
49
- `).map(e=>e.trim()).join(" ")};NA.O=function(t){return this.inspectOpts.colors=this.useColors,Fd.inspect(t,this.inspectOpts)}});var BA=y((Rhe,kD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?kD.exports=PA():kD.exports=LA()});var GA=y(($he,zA)=>{"use strict";var TD,MA,UA,VA,HA=!0;typeof process<"u"&&({FORCE_COLOR:TD,NODE_DISABLE_COLORS:MA,NO_COLOR:UA,TERM:VA}=process.env||{},HA=process.stdout&&process.stdout.isTTY);var _e={enabled:!MA&&UA==null&&VA!=="dumb"&&(TD!=null&&TD!=="0"||HA),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 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 sX(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.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?qA(this.keys,n+""):n+""):n===void 0?sX([t],[r]):_e.enabled?qA([r],n+""):n+""}}zA.exports=_e});var zs=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ancillary=rt.failure=rt.success=rt.input=rt.weak=rt.strong=void 0;var aX=(Sn(),ke(Cn)),Jr=aX.__importDefault(GA());rt.strong=Jr.default.bold;rt.weak=Jr.default.dim;rt.input=Jr.default.cyan;rt.success=Jr.default.green;rt.failure=Jr.default.red;rt.ancillary=Jr.default.cyan;var uX={strong:rt.strong,weak:rt.weak,input:rt.input,success:rt.success,failure:rt.failure,ancillary:rt.ancillary,log:{DEBUG:Jr.default.magenta,INFO:Jr.default.cyan,WARN:Jr.default.yellow,ERROR:Jr.default.red}};rt.default=uX});var ic={};gn(ic,{__addDisposableResource:()=>hk,__assign:()=>Ad,__asyncDelegator:()=>ok,__asyncGenerator:()=>ik,__asyncValues:()=>sk,__await:()=>Gs,__awaiter:()=>ZA,__classPrivateFieldGet:()=>lk,__classPrivateFieldIn:()=>dk,__classPrivateFieldSet:()=>fk,__createBinding:()=>Td,__decorate:()=>YA,__disposeResources:()=>pk,__esDecorate:()=>cX,__exportStar:()=>ek,__extends:()=>WA,__generator:()=>QA,__importDefault:()=>ck,__importStar:()=>uk,__makeTemplateObject:()=>ak,__metadata:()=>XA,__param:()=>JA,__propKey:()=>fX,__read:()=>RD,__rest:()=>KA,__runInitializers:()=>lX,__setFunctionName:()=>dX,__spread:()=>tk,__spreadArray:()=>nk,__spreadArrays:()=>rk,__values:()=>kd,default:()=>mX});function WA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");PD(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 cX(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 m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.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],m);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 lX(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 fX(t){return typeof t=="symbol"?t:"".concat(t)}function dX(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)&&Td(e,t,r)}function kd(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 RD(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(RD(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 Gs(t){return this instanceof Gs?(this.v=t,this):new Gs(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(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof Gs?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:Gs(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 kd=="function"?kd(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)&&Td(e,t,r);return hX(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 pX(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 PD,Ad,Td,hX,pX,mX,oc=lt(()=>{PD=function(t,e){return PD=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])},PD(t,e)};Ad=function(){return Ad=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},Ad.apply(this,arguments)};Td=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]};hX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};pX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};mX={__extends:WA,__assign:Ad,__rest:KA,__decorate:YA,__param:JA,__metadata:XA,__awaiter:ZA,__generator:QA,__createBinding:Td,__exportStar:ek,__values:kd,__read:RD,__spread:tk,__spreadArrays:rk,__spreadArray:nk,__await:Gs,__asyncGenerator:ik,__asyncDelegator:ok,__asyncValues:sk,__makeTemplateObject:ak,__importStar:uk,__importDefault:ck,__classPrivateFieldGet:lk,__classPrivateFieldSet:fk,__classPrivateFieldIn:dk,__addDisposableResource:hk,__disposeResources:pk}});var $D=y(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.EscapeCode=void 0;var Pr="\x1B[",Dt=class{};Pd.EscapeCode=Dt;Dt.cursorLeft=()=>`${Pr}G`;Dt.cursorUp=(t=1)=>`${Pr}${t}A`;Dt.cursorDown=(t=1)=>`${Pr}${t}B`;Dt.cursorForward=(t=1)=>`${Pr}${t}C`;Dt.cursorBackward=(t=1)=>`${Pr}${t}D`;Dt.cursorHide=()=>`${Pr}?25l`;Dt.cursorShow=()=>`${Pr}?25h`;Dt.eraseLine=()=>`${Pr}2K`;Dt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=Dt.eraseLine(),r<t-1&&(e+=Dt.cursorUp());return`${e}${Dt.cursorLeft()}`};Dt.eraseUp=()=>`${Pr}1J`;Dt.eraseDown=()=>`${Pr}J`;Dt.eraseScreen=()=>`${Pr}2J`});var gk=y(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.Cursor=void 0;var gX=(oc(),ke(ic)),yX=gX.__importDefault(Ky()),mk=$D(),Ws=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(mk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,yX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(mk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Rd.Cursor=Ws;Ws.stream=process.stderr;Ws._isVisible=!0;Ws._listenerAttached=!1});var jD=y((Lhe,ID)=>{"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);ID.exports=yk;ID.exports.default=yk});var bk=y((Bhe,vk)=>{"use strict";var Dk="[\uD800-\uDBFF][\uDC00-\uDFFF]",DX=t=>t&&t.exact?new RegExp(`^${Dk}$`):new RegExp(Dk,"g");vk.exports=DX});var _k=y((qhe,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 ND=y((Mhe,Ck)=>{var sc=_k(),Ek={};for(let t of Object.keys(sc))Ek[sc[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 vX(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(sc)){let o=sc[i],s=vX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return sc[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((Uhe,Sk)=>{var $d=ND();function bX(){let t={},e=Object.keys($d);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function wX(t){let e=bX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys($d[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 _X(t,e){return function(r){return e(t(r))}}function EX(t,e){let r=[e[t].parent,t],n=$d[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=_X($d[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}Sk.exports=function(t){let e=wX(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]=EX(s,e))}return r}});var Ok=y((Vhe,Fk)=>{var LD=ND(),CX=xk(),Ks={},SX=Object.keys(LD);function xX(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 FX(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}SX.forEach(t=>{Ks[t]={},Object.defineProperty(Ks[t],"channels",{value:LD[t].channels}),Object.defineProperty(Ks[t],"labels",{value:LD[t].labels});let e=CX(t);Object.keys(e).forEach(n=>{let i=e[n];Ks[t][n]=FX(i),Ks[t][n].raw=xX(i)})});Fk.exports=Ks});var qD=y((Hhe,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`},Id=t=>t,Pk=(t,e,r)=>[t,e,r],Ys=(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})},BD,Js=(t,e,r,n)=>{BD===void 0&&(BD=Ok());let i=n?10:0,o={};for(let[s,a]of Object.entries(BD)){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 OX(){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",Ys(e.color,"ansi",()=>Js(Ak,"ansi16",Id,!1)),Ys(e.color,"ansi256",()=>Js(kk,"ansi256",Id,!1)),Ys(e.color,"ansi16m",()=>Js(Tk,"rgb",Pk,!1)),Ys(e.bgColor,"ansi",()=>Js(Ak,"ansi16",Id,!0)),Ys(e.bgColor,"ansi256",()=>Js(kk,"ansi256",Id,!0)),Ys(e.bgColor,"ansi16m",()=>Js(Tk,"rgb",Pk,!0)),e}Object.defineProperty(Rk,"exports",{enumerable:!0,get:OX})});var Lk=y((zhe,Nk)=>{"use strict";var AX=jD(),kX=bk(),$k=qD(),jk=["\x1B","\x9B"],jd=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(jd(e?s:o)):t.splice(a,1)}else if(e){n.push(jd(0));break}else n.push(jd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=jd($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++,!kX({exact:!0}).test(f)&&AX(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((Ghe,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 Nd=y((Whe,Mk)=>{"use strict";var TX=qk();Mk.exports=t=>typeof t=="string"?t.replace(TX(),""):t});var Vk=y((Khe,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 UD=y((Yhe,MD)=>{"use strict";var PX=Nd(),RX=jD(),$X=Vk(),Hk=t=>{if(typeof t!="string"||t.length===0||(t=PX(t),t.length===0))return 0;t=t.replace($X()," ");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+=RX(n)?2:1)}return e};MD.exports=Hk;MD.exports.default=Hk});var Jk=y((Jhe,Yk)=>{"use strict";var ac=UD(),IX=Nd(),jX=qD(),Ld=new Set(["\x1B","\x9B"]),NX=39,HD="\x07",Wk="[",LX="]",Kk="m",zD=`${LX}8;;`,zk=t=>`${Ld.values().next().value}${Wk}${t}${Kk}`,Gk=t=>`${Ld.values().next().value}${zD}${t}${HD}`,BX=t=>t.split(" ").map(e=>ac(e)),VD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ac(IX(t[t.length-1]));for(let[a,u]of n.entries()){let c=ac(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Ld.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(zD)),i){o?u===HD&&(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())},qX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ac(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},MX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=BX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ac(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(""),VD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){VD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){VD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(qX));let u=[...a.join(`
49
+ `).map(e=>e.trim()).join(" ")};NA.O=function(t){return this.inspectOpts.colors=this.useColors,Fd.inspect(t,this.inspectOpts)}});var BA=y((Rhe,kD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?kD.exports=PA():kD.exports=LA()});var GA=y(($he,zA)=>{"use strict";var TD,MA,UA,VA,HA=!0;typeof process<"u"&&({FORCE_COLOR:TD,NODE_DISABLE_COLORS:MA,NO_COLOR:UA,TERM:VA}=process.env||{},HA=process.stdout&&process.stdout.isTTY);var _e={enabled:!MA&&UA==null&&VA!=="dumb"&&(TD!=null&&TD!=="0"||HA),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 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 sX(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.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?qA(this.keys,n+""):n+""):n===void 0?sX([t],[r]):_e.enabled?qA([r],n+""):n+""}}zA.exports=_e});var Gs=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ancillary=rt.failure=rt.success=rt.input=rt.weak=rt.strong=void 0;var aX=(Sn(),ke(Cn)),Jr=aX.__importDefault(GA());rt.strong=Jr.default.bold;rt.weak=Jr.default.dim;rt.input=Jr.default.cyan;rt.success=Jr.default.green;rt.failure=Jr.default.red;rt.ancillary=Jr.default.cyan;var uX={strong:rt.strong,weak:rt.weak,input:rt.input,success:rt.success,failure:rt.failure,ancillary:rt.ancillary,log:{DEBUG:Jr.default.magenta,INFO:Jr.default.cyan,WARN:Jr.default.yellow,ERROR:Jr.default.red}};rt.default=uX});var ic={};gn(ic,{__addDisposableResource:()=>hk,__assign:()=>Ad,__asyncDelegator:()=>ok,__asyncGenerator:()=>ik,__asyncValues:()=>sk,__await:()=>Ws,__awaiter:()=>ZA,__classPrivateFieldGet:()=>lk,__classPrivateFieldIn:()=>dk,__classPrivateFieldSet:()=>fk,__createBinding:()=>Td,__decorate:()=>YA,__disposeResources:()=>pk,__esDecorate:()=>cX,__exportStar:()=>ek,__extends:()=>WA,__generator:()=>QA,__importDefault:()=>ck,__importStar:()=>uk,__makeTemplateObject:()=>ak,__metadata:()=>XA,__param:()=>JA,__propKey:()=>fX,__read:()=>RD,__rest:()=>KA,__runInitializers:()=>lX,__setFunctionName:()=>dX,__spread:()=>tk,__spreadArray:()=>nk,__spreadArrays:()=>rk,__values:()=>kd,default:()=>mX});function WA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");PD(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 cX(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 m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.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],m);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 lX(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 fX(t){return typeof t=="symbol"?t:"".concat(t)}function dX(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)&&Td(e,t,r)}function kd(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 RD(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(RD(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 Ws(t){return this instanceof Ws?(this.v=t,this):new Ws(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(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof Ws?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:Ws(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 kd=="function"?kd(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)&&Td(e,t,r);return hX(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 pX(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 PD,Ad,Td,hX,pX,mX,oc=lt(()=>{PD=function(t,e){return PD=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])},PD(t,e)};Ad=function(){return Ad=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},Ad.apply(this,arguments)};Td=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]};hX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};pX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};mX={__extends:WA,__assign:Ad,__rest:KA,__decorate:YA,__param:JA,__metadata:XA,__awaiter:ZA,__generator:QA,__createBinding:Td,__exportStar:ek,__values:kd,__read:RD,__spread:tk,__spreadArrays:rk,__spreadArray:nk,__await:Ws,__asyncGenerator:ik,__asyncDelegator:ok,__asyncValues:sk,__makeTemplateObject:ak,__importStar:uk,__importDefault:ck,__classPrivateFieldGet:lk,__classPrivateFieldSet:fk,__classPrivateFieldIn:dk,__addDisposableResource:hk,__disposeResources:pk}});var $D=y(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.EscapeCode=void 0;var Pr="\x1B[",Dt=class{};Pd.EscapeCode=Dt;Dt.cursorLeft=()=>`${Pr}G`;Dt.cursorUp=(t=1)=>`${Pr}${t}A`;Dt.cursorDown=(t=1)=>`${Pr}${t}B`;Dt.cursorForward=(t=1)=>`${Pr}${t}C`;Dt.cursorBackward=(t=1)=>`${Pr}${t}D`;Dt.cursorHide=()=>`${Pr}?25l`;Dt.cursorShow=()=>`${Pr}?25h`;Dt.eraseLine=()=>`${Pr}2K`;Dt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=Dt.eraseLine(),r<t-1&&(e+=Dt.cursorUp());return`${e}${Dt.cursorLeft()}`};Dt.eraseUp=()=>`${Pr}1J`;Dt.eraseDown=()=>`${Pr}J`;Dt.eraseScreen=()=>`${Pr}2J`});var gk=y(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.Cursor=void 0;var gX=(oc(),ke(ic)),yX=gX.__importDefault(Ky()),mk=$D(),Ks=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(mk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,yX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(mk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Rd.Cursor=Ks;Ks.stream=process.stderr;Ks._isVisible=!0;Ks._listenerAttached=!1});var jD=y((Lhe,ID)=>{"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);ID.exports=yk;ID.exports.default=yk});var bk=y((Bhe,vk)=>{"use strict";var Dk="[\uD800-\uDBFF][\uDC00-\uDFFF]",DX=t=>t&&t.exact?new RegExp(`^${Dk}$`):new RegExp(Dk,"g");vk.exports=DX});var _k=y((qhe,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 ND=y((Mhe,Ck)=>{var sc=_k(),Ek={};for(let t of Object.keys(sc))Ek[sc[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 vX(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(sc)){let o=sc[i],s=vX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return sc[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((Uhe,Sk)=>{var $d=ND();function bX(){let t={},e=Object.keys($d);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function wX(t){let e=bX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys($d[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 _X(t,e){return function(r){return e(t(r))}}function EX(t,e){let r=[e[t].parent,t],n=$d[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=_X($d[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}Sk.exports=function(t){let e=wX(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]=EX(s,e))}return r}});var Ok=y((Vhe,Fk)=>{var LD=ND(),CX=xk(),Ys={},SX=Object.keys(LD);function xX(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 FX(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}SX.forEach(t=>{Ys[t]={},Object.defineProperty(Ys[t],"channels",{value:LD[t].channels}),Object.defineProperty(Ys[t],"labels",{value:LD[t].labels});let e=CX(t);Object.keys(e).forEach(n=>{let i=e[n];Ys[t][n]=FX(i),Ys[t][n].raw=xX(i)})});Fk.exports=Ys});var qD=y((Hhe,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`},Id=t=>t,Pk=(t,e,r)=>[t,e,r],Js=(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})},BD,Xs=(t,e,r,n)=>{BD===void 0&&(BD=Ok());let i=n?10:0,o={};for(let[s,a]of Object.entries(BD)){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 OX(){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",Js(e.color,"ansi",()=>Xs(Ak,"ansi16",Id,!1)),Js(e.color,"ansi256",()=>Xs(kk,"ansi256",Id,!1)),Js(e.color,"ansi16m",()=>Xs(Tk,"rgb",Pk,!1)),Js(e.bgColor,"ansi",()=>Xs(Ak,"ansi16",Id,!0)),Js(e.bgColor,"ansi256",()=>Xs(kk,"ansi256",Id,!0)),Js(e.bgColor,"ansi16m",()=>Xs(Tk,"rgb",Pk,!0)),e}Object.defineProperty(Rk,"exports",{enumerable:!0,get:OX})});var Lk=y((zhe,Nk)=>{"use strict";var AX=jD(),kX=bk(),$k=qD(),jk=["\x1B","\x9B"],jd=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(jd(e?s:o)):t.splice(a,1)}else if(e){n.push(jd(0));break}else n.push(jd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=jd($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++,!kX({exact:!0}).test(f)&&AX(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((Ghe,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 Nd=y((Whe,Mk)=>{"use strict";var TX=qk();Mk.exports=t=>typeof t=="string"?t.replace(TX(),""):t});var Vk=y((Khe,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 UD=y((Yhe,MD)=>{"use strict";var PX=Nd(),RX=jD(),$X=Vk(),Hk=t=>{if(typeof t!="string"||t.length===0||(t=PX(t),t.length===0))return 0;t=t.replace($X()," ");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+=RX(n)?2:1)}return e};MD.exports=Hk;MD.exports.default=Hk});var Jk=y((Jhe,Yk)=>{"use strict";var ac=UD(),IX=Nd(),jX=qD(),Ld=new Set(["\x1B","\x9B"]),NX=39,HD="\x07",Wk="[",LX="]",Kk="m",zD=`${LX}8;;`,zk=t=>`${Ld.values().next().value}${Wk}${t}${Kk}`,Gk=t=>`${Ld.values().next().value}${zD}${t}${HD}`,BX=t=>t.split(" ").map(e=>ac(e)),VD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ac(IX(t[t.length-1]));for(let[a,u]of n.entries()){let c=ac(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Ld.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(zD)),i){o?u===HD&&(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())},qX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ac(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},MX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=BX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ac(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(""),VD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){VD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){VD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(qX));let u=[...a.join(`
50
50
  `)];for(let[c,l]of u.entries()){if(n+=l,Ld.has(l)){let{groups:h}=new RegExp(`(?:\\${Wk}(?<code>\\d+)m|\\${zD}(?<uri>.*)${HD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===NX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=jX.codes.get(Number(i));u[c+1]===`
51
51
  `?(o&&(n+=Gk("")),i&&f&&(n+=zk(f))):l===`
52
52
  `&&(i&&f&&(n+=zk(i)),o&&(n+=Gk(o)))}return n};Yk.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
@@ -60,9 +60,9 @@ ${r3(r)}`)}Ge.wordWrap=YX;function JX(t){t=n3(t);let e=process.cwd(),r=On.dirnam
60
60
  `).join(`
61
61
  `+o),t.push(i+"m+"+Ud.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=uZ()+e+" "+t[0]}function uZ(){return vt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function cZ(...t){return process.stderr.write(Md.formatWithOptions(vt.inspectOpts,...t)+`
62
62
  `)}function lZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function fZ(){return process.env.DEBUG}function dZ(t){t.inspectOpts={};let e=Object.keys(vt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=vt.inspectOpts[e[r]]}Ud.exports=GD()(vt);var{formatters:u3}=Ud.exports;u3.o=function(t){return this.inspectOpts.colors=this.useColors,Md.inspect(t,this.inspectOpts).split(`
63
- `).map(e=>e.trim()).join(" ")};u3.O=function(t){return this.inspectOpts.colors=this.useColors,Md.inspect(t,this.inspectOpts)}});var l3=y((epe,WD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?WD.exports=a3():WD.exports=c3()});var f3=y(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TERMINAL_INFO=_r.CI_ENVIRONMENT_VARIABLES_DETECTED=_r.CI_ENVIRONMENT_VARIABLES=void 0;var hZ=(oc(),ke(ic)),pZ=l3(),mZ=hZ.__importStar(require("os")),gZ=(0,pZ.debug)("ionic:utils-terminal:info");_r.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];_r.CI_ENVIRONMENT_VARIABLES_DETECTED=_r.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function yZ(){let{shell:t}=mZ.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")}_r.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&gZ(`Environment variables for CI detected: ${_r.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);_r.TERMINAL_INFO=Object.freeze({ci:_r.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:yZ(),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 KD=y(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});var Vd=(oc(),ke(ic));Vd.__exportStar($D(),Xs);Vd.__exportStar(gk(),Xs);Vd.__exportStar(o3(),Xs);Vd.__exportStar(f3(),Xs)});var zd=y(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.isFatal=Xr.fatal=Xr.FatalException=Xr.BaseException=void 0;var Hd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Xr.BaseException=Hd;var uc=class extends Hd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Xr.FatalException=uc;function DZ(t){throw new uc(t)}Xr.fatal=DZ;function vZ(t){return t&&t instanceof uc}Xr.isFatal=vZ});var XD={};gn(XD,{LOGGER_LEVELS:()=>FZ,Logger:()=>JD,NO_COLORS:()=>d3,StreamOutputStrategy:()=>Gd,TTYOutputStrategy:()=>YD,TTY_WIDTH:()=>bZ,createDefaultLogger:()=>xZ,indent:()=>wZ,sliceAnsi:()=>_Z,stringWidth:()=>EZ,stripAnsi:()=>CZ,wordWrap:()=>SZ});var bZ,wZ,_Z,EZ,CZ,SZ,xZ,d3,Gd,YD,JD,FZ,ZD=lt(()=>{bZ=80,wZ=t=>t,_Z=t=>t,EZ=t=>t.length,CZ=t=>t,SZ=t=>t,xZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),d3={},Gd=class{constructor(){this.colors=d3,this.stream=process.stdout}},YD=class extends Gd{constructor(e){super(),this.options=e}},JD=class{constructor(){}info(){}warn(){}error(){}debug(){}},FZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var p3=y(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.isInteractive=fo.checkInteractive=void 0;var OZ=(Sn(),ke(Cn)),h3=KD(),AZ=OZ.__importDefault(zs()),kZ=cc(),TZ=(...t)=>(0,fo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(kZ.logger.error(`Non-interactive shell detected.
63
+ `).map(e=>e.trim()).join(" ")};u3.O=function(t){return this.inspectOpts.colors=this.useColors,Md.inspect(t,this.inspectOpts)}});var l3=y((epe,WD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?WD.exports=a3():WD.exports=c3()});var f3=y(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TERMINAL_INFO=_r.CI_ENVIRONMENT_VARIABLES_DETECTED=_r.CI_ENVIRONMENT_VARIABLES=void 0;var hZ=(oc(),ke(ic)),pZ=l3(),mZ=hZ.__importStar(require("os")),gZ=(0,pZ.debug)("ionic:utils-terminal:info");_r.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];_r.CI_ENVIRONMENT_VARIABLES_DETECTED=_r.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function yZ(){let{shell:t}=mZ.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")}_r.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&gZ(`Environment variables for CI detected: ${_r.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);_r.TERMINAL_INFO=Object.freeze({ci:_r.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:yZ(),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 KD=y(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var Vd=(oc(),ke(ic));Vd.__exportStar($D(),Zs);Vd.__exportStar(gk(),Zs);Vd.__exportStar(o3(),Zs);Vd.__exportStar(f3(),Zs)});var zd=y(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.isFatal=Xr.fatal=Xr.FatalException=Xr.BaseException=void 0;var Hd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Xr.BaseException=Hd;var uc=class extends Hd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Xr.FatalException=uc;function DZ(t){throw new uc(t)}Xr.fatal=DZ;function vZ(t){return t&&t instanceof uc}Xr.isFatal=vZ});var XD={};gn(XD,{LOGGER_LEVELS:()=>FZ,Logger:()=>JD,NO_COLORS:()=>d3,StreamOutputStrategy:()=>Gd,TTYOutputStrategy:()=>YD,TTY_WIDTH:()=>bZ,createDefaultLogger:()=>xZ,indent:()=>wZ,sliceAnsi:()=>_Z,stringWidth:()=>EZ,stripAnsi:()=>CZ,wordWrap:()=>SZ});var bZ,wZ,_Z,EZ,CZ,SZ,xZ,d3,Gd,YD,JD,FZ,ZD=lt(()=>{bZ=80,wZ=t=>t,_Z=t=>t,EZ=t=>t.length,CZ=t=>t,SZ=t=>t,xZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),d3={},Gd=class{constructor(){this.colors=d3,this.stream=process.stdout}},YD=class extends Gd{constructor(e){super(),this.options=e}},JD=class{constructor(){}info(){}warn(){}error(){}debug(){}},FZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var p3=y(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.isInteractive=fo.checkInteractive=void 0;var OZ=(Sn(),ke(Cn)),h3=KD(),AZ=OZ.__importDefault(Gs()),kZ=cc(),TZ=(...t)=>(0,fo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(kZ.logger.error(`Non-interactive shell detected.
64
64
  Run the command with ${AZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;fo.checkInteractive=TZ;var PZ=()=>h3.TERMINAL_INFO.tty&&!h3.TERMINAL_INFO.ci;fo.isInteractive=PZ});var We=y((ope,g3)=>{"use strict";var{FORCE_COLOR:RZ,NODE_DISABLE_COLORS:$Z,TERM:IZ}=process.env,Ee={enabled:!$Z&&IZ!=="dumb"&&RZ!=="0",reset:Ae(0,0),bold:Ae(1,22),dim:Ae(2,22),italic:Ae(3,23),underline:Ae(4,24),inverse:Ae(7,27),hidden:Ae(8,28),strikethrough:Ae(9,29),black:Ae(30,39),red:Ae(31,39),green:Ae(32,39),yellow:Ae(33,39),blue:Ae(34,39),magenta:Ae(35,39),cyan:Ae(36,39),white:Ae(37,39),gray:Ae(90,39),grey:Ae(90,39),bgBlack:Ae(40,49),bgRed:Ae(41,49),bgGreen:Ae(42,49),bgYellow:Ae(43,49),bgBlue:Ae(44,49),bgMagenta:Ae(45,49),bgCyan:Ae(46,49),bgWhite:Ae(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 jZ(t,e){let r={has:t,keys:e};return r.reset=Ee.reset.bind(r),r.bold=Ee.bold.bind(r),r.dim=Ee.dim.bind(r),r.italic=Ee.italic.bind(r),r.underline=Ee.underline.bind(r),r.inverse=Ee.inverse.bind(r),r.hidden=Ee.hidden.bind(r),r.strikethrough=Ee.strikethrough.bind(r),r.black=Ee.black.bind(r),r.red=Ee.red.bind(r),r.green=Ee.green.bind(r),r.yellow=Ee.yellow.bind(r),r.blue=Ee.blue.bind(r),r.magenta=Ee.magenta.bind(r),r.cyan=Ee.cyan.bind(r),r.white=Ee.white.bind(r),r.gray=Ee.gray.bind(r),r.grey=Ee.grey.bind(r),r.bgBlack=Ee.bgBlack.bind(r),r.bgRed=Ee.bgRed.bind(r),r.bgGreen=Ee.bgGreen.bind(r),r.bgYellow=Ee.bgYellow.bind(r),r.bgBlue=Ee.bgBlue.bind(r),r.bgMagenta=Ee.bgMagenta.bind(r),r.bgCyan=Ee.bgCyan.bind(r),r.bgWhite=Ee.bgWhite.bind(r),r}function Ae(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:Ee.enabled?m3(this.keys,n+""):n+""):n===void 0?jZ([t],[r]):Ee.enabled?m3([r],n+""):n+""}}g3.exports=Ee});var D3=y((spe,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 Wd=y((ape,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((upe,E3)=>{"use strict";function NZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=LZ(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 LZ(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 BZ=Wd(),_3=Te(),w3=_3.erase,qZ=_3.cursor,MZ=t=>[...BZ(t)].length;E3.exports=function(t,e){if(!e)return w3.line+qZ.to(0);let r=0,n=t.split(/\r?\n/);var i=NZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(MZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return w3.lines(r)}});var QD=y((cpe,S3)=>{"use strict";var lc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},UZ={arrowUp:lc.arrowUp,arrowDown:lc.arrowDown,arrowLeft:lc.arrowLeft,arrowRight:lc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},VZ=process.platform==="win32"?UZ:lc;S3.exports=VZ});var F3=y((lpe,x3)=>{"use strict";var Zs=We(),ho=QD(),e0=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}`}}),HZ=t=>e0[t]||e0.default,fc=Object.freeze({aborted:Zs.red(ho.cross),done:Zs.green(ho.tick),exited:Zs.yellow(ho.cross),default:Zs.cyan("?")}),zZ=(t,e,r)=>e?fc.aborted:r?fc.exited:t?fc.done:fc.default,GZ=t=>Zs.gray(t?ho.ellipsis:ho.pointerSmall),WZ=(t,e)=>Zs.gray(t?e?ho.pointerSmall:"+":ho.line);x3.exports={styles:e0,render:HZ,symbols:fc,symbol:zZ,delimiter:GZ,item:WZ}});var A3=y((fpe,O3)=>{"use strict";var KZ=Wd();O3.exports=function(t,e){let r=String(KZ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var T3=y((dpe,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(`
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 LZ(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 BZ=Wd(),_3=Te(),w3=_3.erase,qZ=_3.cursor,MZ=t=>[...BZ(t)].length;E3.exports=function(t,e){if(!e)return w3.line+qZ.to(0);let r=0,n=t.split(/\r?\n/);var i=NZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(MZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return w3.lines(r)}});var QD=y((cpe,S3)=>{"use strict";var lc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},UZ={arrowUp:lc.arrowUp,arrowDown:lc.arrowDown,arrowLeft:lc.arrowLeft,arrowRight:lc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},VZ=process.platform==="win32"?UZ:lc;S3.exports=VZ});var F3=y((lpe,x3)=>{"use strict";var Qs=We(),ho=QD(),e0=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}`}}),HZ=t=>e0[t]||e0.default,fc=Object.freeze({aborted:Qs.red(ho.cross),done:Qs.green(ho.tick),exited:Qs.yellow(ho.cross),default:Qs.cyan("?")}),zZ=(t,e,r)=>e?fc.aborted:r?fc.exited:t?fc.done:fc.default,GZ=t=>Qs.gray(t?ho.ellipsis:ho.pointerSmall),WZ=(t,e)=>Qs.gray(t?e?ho.pointerSmall:"+":ho.line);x3.exports={styles:e0,render:HZ,symbols:fc,symbol:zZ,delimiter:GZ,item:WZ}});var A3=y((fpe,O3)=>{"use strict";var KZ=Wd();O3.exports=function(t,e){let r=String(KZ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var T3=y((dpe,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
67
  `)}});var R3=y((hpe,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 Rr=y((ppe,$3)=>{"use strict";$3.exports={action:D3(),clear:C3(),style:F3(),strip:Wd(),figures:QD(),lines:A3(),wrap:T3(),entriesToDisplay:R3()}});var An=y((mpe,N3)=>{"use strict";var I3=require("readline"),YZ=Rr(),JZ=YZ.action,XZ=require("events"),j3=Te(),ZZ=j3.beep,QZ=j3.cursor,eQ=We(),t0=class extends XZ{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=JZ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(QZ.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(ZZ)}render(){this.onRender(eQ),this.firstRender&&(this.firstRender=!1)}};N3.exports=t0});var U3=y((gpe,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 Kd=We(),tQ=An(),q3=Te(),rQ=q3.erase,dc=q3.cursor,Yd=Rr(),r0=Yd.style,n0=Yd.clear,nQ=Yd.lines,iQ=Yd.figures,i0=class extends tQ{constructor(e={}){super(e),this.transform=r0.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=n0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Kd.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
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(`
@@ -99,18 +99,18 @@ Instructions:
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?S0.arrowUp:i?S0.arrowDown:" ",a=r?mc.cyan().underline(e.title):e.title;return s=(r?mc.cyan(S0.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
100
  `+KQ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+mc.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=YQ(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[C0.symbol(this.done,this.aborted,this.exited),mc.bold(this.msg),C0.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||mc.gray(this.fallback.title))}this.out.write(WQ.line+BT.to(0)+this.outputText)}};VT.exports=x0});var KT=y((Rpe,WT)=>{"use strict";var Pn=We(),ZQ=Te(),QQ=ZQ.cursor,eee=E0(),O0=Rr(),zT=O0.clear,GT=O0.style,Qs=O0.figures,F0=class extends eee{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||mc.gray(this.fallback.title))}this.out.write(WQ.line+BT.to(0)+this.outputText)}};VT.exports=x0});var KT=y((Rpe,WT)=>{"use strict";var Pn=We(),ZQ=Te(),QQ=ZQ.cursor,eee=E0(),O0=Rr(),zT=O0.clear,GT=O0.style,ea=O0.figures,F0=class extends eee{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
- ${Qs.arrowUp}/${Qs.arrowDown}: Highlight option
105
- ${Qs.arrowLeft}/${Qs.arrowRight}/[space]: Toggle selection
104
+ ${ea.arrowUp}/${ea.arrowDown}: Highlight option
105
+ ${ea.arrowLeft}/${ea.arrowRight}/[space]: Toggle selection
106
106
  [a,b,c]/delete: Filter choices
107
107
  enter/return: Complete answer
108
108
  `:""}renderCurrentInput(){return`
109
109
  Filtered results for: ${this.inputValue?this.inputValue:Pn.gray("Enter something to filter")}
110
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Pn.gray().underline(r.title):Pn.strikethrough().gray(r.title):i=e===n?Pn.cyan().underline(r.title):r.title,(r.selected?Pn.green(Qs.radioOn):Qs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Pn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Pn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(QQ.hide),super.render();let e=[GT.symbol(this.done,this.aborted),Pn.bold(this.msg),GT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Pn.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=F0});var tP=y(($pe,eP)=>{"use strict";var YT=We(),tee=An(),ZT=Rr(),JT=ZT.style,ree=ZT.clear,QT=Te(),nee=QT.erase,XT=QT.cursor,A0=class extends tee{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?Pn.gray().underline(r.title):Pn.strikethrough().gray(r.title):i=e===n?Pn.cyan().underline(r.title):r.title,(r.selected?Pn.green(ea.radioOn):ea.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Pn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Pn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(QQ.hide),super.render();let e=[GT.symbol(this.done,this.aborted),Pn.bold(this.msg),GT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Pn.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=F0});var tP=y(($pe,eP)=>{"use strict";var YT=We(),tee=An(),ZT=Rr(),JT=ZT.style,ree=ZT.clear,QT=Te(),nee=QT.erase,XT=QT.cursor,A0=class extends tee{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
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(ree(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(nee.line+XT.to(0)+this.outputText))}};eP.exports=A0});var nP=y((Ipe,rP)=>{"use strict";rP.exports={TextPrompt:U3(),SelectPrompt:G3(),TogglePrompt:Z3(),DatePrompt:FT(),NumberPrompt:$T(),MultiselectPrompt:E0(),AutocompletePrompt:HT(),AutocompleteMultiselectPrompt:KT(),ConfirmPrompt:tP()}});var oP=y(iP=>{"use strict";var Xt=iP,iee=nP(),th=t=>t;function en(t,e,r={}){return new Promise((n,i)=>{let o=new iee[t](e),s=r.onAbort||th,a=r.onSubmit||th,u=r.onExit||th;o.on("state",e.onState||th),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Xt.text=t=>en("TextPrompt",t);Xt.password=t=>(t.style="password",Xt.text(t));Xt.invisible=t=>(t.style="invisible",Xt.text(t));Xt.number=t=>en("NumberPrompt",t);Xt.date=t=>en("DatePrompt",t);Xt.confirm=t=>en("ConfirmPrompt",t);Xt.list=t=>{let e=t.separator||",";return en("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Xt.toggle=t=>en("TogglePrompt",t);Xt.select=t=>en("SelectPrompt",t);Xt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return en("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 en("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var oee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Xt.autocomplete=t=>(t.suggest=t.suggest||oee,t.choices=[].concat(t.choices||[]),en("AutocompletePrompt",t))});var hP=y((Npe,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){see(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 see(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=uee(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 uee(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 k0=oP(),cee=["suggest","format","onState","validate","onRender","type"],fP=()=>{};function hi(){return T0.apply(this,arguments)}function T0(){return T0=lP(function*(t=[],{onSubmit:e=fP,onCancel:r=fP}={}){let n={},i=hi._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=aee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var m=s;if(u=m.name,c=m.type,typeof c=="function"&&(c=yield c(o,aP({},n),s),s.type=c),!!c){for(let g in s){if(cee.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,k0[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=hi._injected?lee(hi._injected,s.initial):yield k0[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}),T0.apply(this,arguments)}function lee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function fee(t){hi._injected=(hi._injected||[]).concat(t)}function dee(t){hi._override=Object.assign({},t)}dP.exports=Object.assign(hi,{prompt:hi,prompts:k0,inject:fee,override:dee})});var mP=y((Lpe,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 rh=y((Bpe,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((qpe,DP)=>{"use strict";var hee=rh(),{erase:yP,cursor:pee}=Te(),mee=t=>[...hee(t)].length;DP.exports=function(t,e){if(!e)return yP.line+pee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(mee(i)-1,0)/e);return yP.lines(r)}});var P0=y((Mpe,bP)=>{"use strict";var yc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},gee={arrowUp:yc.arrowUp,arrowDown:yc.arrowDown,arrowLeft:yc.arrowLeft,arrowRight:yc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},yee=process.platform==="win32"?gee:yc;bP.exports=yee});var _P=y((Upe,wP)=>{"use strict";var ea=We(),po=P0(),R0=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}`}}),Dee=t=>R0[t]||R0.default,Dc=Object.freeze({aborted:ea.red(po.cross),done:ea.green(po.tick),exited:ea.yellow(po.cross),default:ea.cyan("?")}),vee=(t,e,r)=>e?Dc.aborted:r?Dc.exited:t?Dc.done:Dc.default,bee=t=>ea.gray(t?po.ellipsis:po.pointerSmall),wee=(t,e)=>ea.gray(t?e?po.pointerSmall:"+":po.line);wP.exports={styles:R0,render:Dee,symbols:Dc,symbol:vee,delimiter:bee,item:wee}});var CP=y((Vpe,EP)=>{"use strict";var _ee=rh();EP.exports=function(t,e){let r=String(_ee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var xP=y((Hpe,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(`
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 uee(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 k0=oP(),cee=["suggest","format","onState","validate","onRender","type"],fP=()=>{};function hi(){return T0.apply(this,arguments)}function T0(){return T0=lP(function*(t=[],{onSubmit:e=fP,onCancel:r=fP}={}){let n={},i=hi._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=aee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var m=s;if(u=m.name,c=m.type,typeof c=="function"&&(c=yield c(o,aP({},n),s),s.type=c),!!c){for(let g in s){if(cee.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,k0[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=hi._injected?lee(hi._injected,s.initial):yield k0[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}),T0.apply(this,arguments)}function lee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function fee(t){hi._injected=(hi._injected||[]).concat(t)}function dee(t){hi._override=Object.assign({},t)}dP.exports=Object.assign(hi,{prompt:hi,prompts:k0,inject:fee,override:dee})});var mP=y((Lpe,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 rh=y((Bpe,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((qpe,DP)=>{"use strict";var hee=rh(),{erase:yP,cursor:pee}=Te(),mee=t=>[...hee(t)].length;DP.exports=function(t,e){if(!e)return yP.line+pee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(mee(i)-1,0)/e);return yP.lines(r)}});var P0=y((Mpe,bP)=>{"use strict";var yc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},gee={arrowUp:yc.arrowUp,arrowDown:yc.arrowDown,arrowLeft:yc.arrowLeft,arrowRight:yc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},yee=process.platform==="win32"?gee:yc;bP.exports=yee});var _P=y((Upe,wP)=>{"use strict";var ta=We(),po=P0(),R0=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}`}}),Dee=t=>R0[t]||R0.default,Dc=Object.freeze({aborted:ta.red(po.cross),done:ta.green(po.tick),exited:ta.yellow(po.cross),default:ta.cyan("?")}),vee=(t,e,r)=>e?Dc.aborted:r?Dc.exited:t?Dc.done:Dc.default,bee=t=>ta.gray(t?po.ellipsis:po.pointerSmall),wee=(t,e)=>ta.gray(t?e?po.pointerSmall:"+":po.line);wP.exports={styles:R0,render:Dee,symbols:Dc,symbol:vee,delimiter:bee,item:wee}});var CP=y((Vpe,EP)=>{"use strict";var _ee=rh();EP.exports=function(t,e){let r=String(_ee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var xP=y((Hpe,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
115
  `)}});var OP=y((zpe,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 $r=y((Gpe,AP)=>{"use strict";AP.exports={action:mP(),clear:vP(),style:_P(),strip:rh(),figures:P0(),lines:CP(),wrap:xP(),entriesToDisplay:OP()}});var Rn=y((Wpe,TP)=>{"use strict";var kP=require("readline"),{action:Eee}=$r(),Cee=require("events"),{beep:See,cursor:xee}=Te(),Fee=We(),$0=class extends Cee{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=Eee(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(xee.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(See)}render(){this.onRender(Fee),this.firstRender&&(this.firstRender=!1)}};TP.exports=$0});var RP=y((Kpe,PP)=>{var nh=We(),Oee=Rn(),{erase:Aee,cursor:vc}=Te(),{style:I0,clear:j0,lines:kee,figures:Tee}=$r(),N0=class extends Oee{constructor(e={}){super(e),this.transform=I0.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=j0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=nh.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(`
@@ -147,22 +147,22 @@ Instructions:
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?nv.arrowUp:i?nv.arrowDown:" ",a=r?bc.cyan().underline(e.title):e.title;return s=(r?bc.cyan(nv.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
148
  `+Dte(e.description,{margin:3,width:this.out.columns}))),s+" "+a+bc.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}=vte(this.select,this.choices.length,this.limit);if(this.outputText=[rv.symbol(this.done,this.aborted,this.exited),bc.bold(this.msg),rv.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||bc.gray(this.fallback.title))}this.out.write(yte.line+wR.to(0)+this.outputText)}};CR.exports=iv});var AR=y((fme,OR)=>{"use strict";var In=We(),{cursor:_te}=Te(),Ete=tv(),{clear:xR,style:FR,figures:ta}=$r(),ov=class extends Ete{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||bc.gray(this.fallback.title))}this.out.write(yte.line+wR.to(0)+this.outputText)}};CR.exports=iv});var AR=y((fme,OR)=>{"use strict";var In=We(),{cursor:_te}=Te(),Ete=tv(),{clear:xR,style:FR,figures:ra}=$r(),ov=class extends Ete{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
- ${ta.arrowUp}/${ta.arrowDown}: Highlight option
153
- ${ta.arrowLeft}/${ta.arrowRight}/[space]: Toggle selection
152
+ ${ra.arrowUp}/${ra.arrowDown}: Highlight option
153
+ ${ra.arrowLeft}/${ra.arrowRight}/[space]: Toggle selection
154
154
  [a,b,c]/delete: Filter choices
155
155
  enter/return: Complete answer
156
156
  `:""}renderCurrentInput(){return`
157
157
  Filtered results for: ${this.inputValue?this.inputValue:In.gray("Enter something to filter")}
158
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?In.gray().underline(r.title):In.strikethrough().gray(r.title):i=e===n?In.cyan().underline(r.title):r.title,(r.selected?In.green(ta.radioOn):ta.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[In.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(In.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(_te.hide),super.render();let e=[FR.symbol(this.done,this.aborted),In.bold(this.msg),FR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=In.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=ov});var $R=y((dme,RR)=>{var kR=We(),Cte=Rn(),{style:TR,clear:Ste}=$r(),{erase:xte,cursor:PR}=Te(),sv=class extends Cte{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?In.gray().underline(r.title):In.strikethrough().gray(r.title):i=e===n?In.cyan().underline(r.title):r.title,(r.selected?In.green(ra.radioOn):ra.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[In.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(In.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(_te.hide),super.render();let e=[FR.symbol(this.done,this.aborted),In.bold(this.msg),FR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=In.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=ov});var $R=y((dme,RR)=>{var kR=We(),Cte=Rn(),{style:TR,clear:Ste}=$r(),{erase:xte,cursor:PR}=Te(),sv=class extends Cte{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(Ste(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(xte.line+PR.to(0)+this.outputText))}};RR.exports=sv});var jR=y((hme,IR)=>{"use strict";IR.exports={TextPrompt:RP(),SelectPrompt:NP(),TogglePrompt:MP(),DatePrompt:hR(),NumberPrompt:yR(),MultiselectPrompt:tv(),AutocompletePrompt:SR(),AutocompleteMultiselectPrompt:AR(),ConfirmPrompt:$R()}});var LR=y(NR=>{"use strict";var Zt=NR,Fte=jR(),uh=t=>t;function nn(t,e,r={}){return new Promise((n,i)=>{let o=new Fte[t](e),s=r.onAbort||uh,a=r.onSubmit||uh,u=r.onExit||uh;o.on("state",e.onState||uh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Zt.text=t=>nn("TextPrompt",t);Zt.password=t=>(t.style="password",Zt.text(t));Zt.invisible=t=>(t.style="invisible",Zt.text(t));Zt.number=t=>nn("NumberPrompt",t);Zt.date=t=>nn("DatePrompt",t);Zt.confirm=t=>nn("ConfirmPrompt",t);Zt.list=t=>{let e=t.separator||",";return nn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Zt.toggle=t=>nn("TogglePrompt",t);Zt.select=t=>nn("SelectPrompt",t);Zt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return nn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Zt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return nn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Ote=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Zt.autocomplete=t=>(t.suggest=t.suggest||Ote,t.choices=[].concat(t.choices||[]),nn("AutocompletePrompt",t))});var MR=y((mme,qR)=>{"use strict";var av=LR(),Ate=["suggest","format","onState","validate","onRender","type"],BR=()=>{};async function mi(t=[],{onSubmit:e=BR,onCancel:r=BR}={}){let n={},i=mi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,m=!1)=>{if(!(!m&&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(Ate.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,av[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=mi._injected?kte(mi._injected,s.initial):await av[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 kte(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Tte(t){mi._injected=(mi._injected||[]).concat(t)}function Pte(t){mi._override=Object.assign({},t)}qR.exports=Object.assign(mi,{prompt:mi,prompts:av,inject:Tte,override:Pte})});var ch=y((gme,UR)=>{function Rte(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=Rte("8.6.0")?hP():MR()});var cc=y(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.logSuccess=Qt.logPrompt=Qt.logger=Qt.output=void 0;var uv=(Sn(),ke(Cn)),mo=(ZD(),ke(XD)),go=uv.__importDefault(zs()),$te=p3(),VR={colors:go.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Qt.output=(0,$te.isInteractive)()?new mo.TTYOutputStrategy(VR):new mo.StreamOutputStrategy(VR);Qt.logger=(0,mo.createDefaultLogger)({output:Qt.output,formatterOptions:{titleize:!1,tags:new Map([[mo.LOGGER_LEVELS.DEBUG,go.default.log.DEBUG("[debug]")],[mo.LOGGER_LEVELS.INFO,go.default.log.INFO("[info]")],[mo.LOGGER_LEVELS.WARN,go.default.log.WARN("[warn]")],[mo.LOGGER_LEVELS.ERROR,go.default.log.ERROR("[error]")]])}});async function Ite(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>uv.__importStar((ZD(),ke(XD)))),{prompt:n}=await Promise.resolve().then(()=>uv.__importStar(ch()));return Qt.logger.log({msg:`${go.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Qt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Qt.logPrompt=Ite;function jte(t){Qt.logger.msg(`${go.default.success("[success]")} ${t}`)}Qt.logSuccess=jte});var lh=y(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.resolveNode=ra.requireTS=void 0;var Nte=Ms(),Lte=require("fs"),Bte=require("path"),qte=(t,e)=>{let r=(0,Bte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,Nte.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};ra.requireTS=qte;function Mte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Lte.existsSync)(n)?n:null}}ra.resolveNode=Mte});var HR={};gn(HR,{default:()=>Ute});var Ute,zR=lt(()=>{Ute={}});var GR=y(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.buildXmlElement=on.writeXML=on.parseXML=on.readXML=void 0;var Vte=(Sn(),ke(Cn)),Hte=Ms(),wc=Vte.__importDefault((zR(),ke(HR)));async function zte(t){var e;try{let r=await(0,Hte.readFile)(t,{encoding:"utf-8"});try{return await wc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}on.readXML=zte;function Gte(t,e){let r=e!==void 0?new wc.default.Parser({...e}):new wc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}on.parseXML=Gte;async function Wte(t){return new Promise(e=>{let n=new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}on.writeXML=Wte;function Kte(t,e){return new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}on.buildXmlElement=Kte});var XR=y(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getAllElements=Ce.getFilePath=Ce.getAssets=Ce.getJSModules=Ce.getPluginType=Ce.getPlatformElement=Ce.getPluginPlatform=Ce.printPlugins=Ce.fixName=Ce.getDependencies=Ce.resolvePlugin=Ce.getPlugins=Ce.getIncludedPluginPackages=void 0;var Yte=(Sn(),ke(Cn)),Jte=Ms(),cv=require("path"),na=Yte.__importDefault(zs()),Xte=zd(),Zte=cc(),WR=lh(),Qte=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}}Ce.getIncludedPluginPackages=KR;async function ere(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)}Ce.getPlugins=ere;async function YR(t,e){try{let r=(0,WR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,Xte.fatal)(`Unable to find ${na.default.strong(`node_modules/${e}`)}.
161
- Are you sure ${na.default.strong(e)} is installed?`);let n=(0,cv.dirname)(r),i=await(0,Jte.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:lv(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,cv.join)(n,"plugin.xml"),s=await(0,Qte.readXML)(o);return{id:e,name:lv(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ce.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:{})]}Ce.getDependencies=JR;function lv(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ce.fixName=lv;function tre(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 ${na.default.strong(e)}:
162
- `;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${na.default.strong(e)}, skipped install:
163
- `;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${na.default.strong(e)}:
164
- `;break}n+=t.map(o=>`${o.id}${na.default.weak(`@${o.version}`)}`).join(`
165
- `),Zte.logger.info(n)}Ce.printPlugins=tre;function fv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ce.getPluginPlatform=fv;function rre(t,e,r){let n=fv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ce.getPlatformElement=rre;function nre(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}Ce.getPluginType=nre;function ire(t,e){return dv(t,e,"js-module")}Ce.getJSModules=ire;function ore(t,e){return dv(t,e,"asset")}Ce.getAssets=ore;function sre(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,cv.join)(e.rootPath,r)}Ce.getFilePath=sre;function dv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=fv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ce.getAllElements=dv});var ZR={};gn(ZR,{default:()=>are});var are,QR=lt(()=>{are={}});var fh=y(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.isInstalled=gi.getCommandOutput=gi.runCommand=void 0;var hv=(QR(),ke(ZR));async function e$(t,e,r={}){let n=new hv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof hv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}gi.runCommand=e$;async function ure(t,e,r={}){try{return(await e$(t,e,r)).trim()}catch{return null}}gi.getCommandOutput=ure;async function cre(t){try{await(0,hv.which)(t)}catch{return!1}return!0}gi.isInstalled=cre});var _c=y((_me,t$)=>{var lre="2.0.0",fre=Number.MAX_SAFE_INTEGER||9007199254740991,dre=16,hre=250,pre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:dre,MAX_SAFE_BUILD_LENGTH:hre,MAX_SAFE_INTEGER:fre,RELEASE_TYPES:pre,SEMVER_SPEC_VERSION:lre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ec=y((Eme,r$)=>{var mre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};r$.exports=mre});var ia=y((jn,n$)=>{var{MAX_SAFE_COMPONENT_LENGTH:pv,MAX_SAFE_BUILD_LENGTH:gre,MAX_LENGTH:yre}=_c(),Dre=Ec();jn=n$.exports={};var vre=jn.re=[],bre=jn.safeRe=[],z=jn.src=[],G=jn.t={},wre=0,mv="[a-zA-Z0-9-]",_re=[["\\s",1],["\\d",yre],[mv,gre]],Ere=t=>{for(let[e,r]of _re)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=Ere(e),i=wre++;Dre(t,i,e),G[t]=i,z[i]=e,vre[i]=new RegExp(e,r?"g":void 0),bre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${mv}*`);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",`${mv}+`);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,${pv}})(?:\\.(\\d{1,${pv}}))?(?:\\.(\\d{1,${pv}}))?`);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);jn.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);jn.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);jn.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 dh=y((Cme,i$)=>{var Cre=Object.freeze({loose:!0}),Sre=Object.freeze({}),xre=t=>t?typeof t!="object"?Cre:t:Sre;i$.exports=xre});var gv=y((Sme,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},Fre=(t,e)=>s$(e,t);a$.exports={compareIdentifiers:s$,rcompareIdentifiers:Fre}});var Ft=y((xme,f$)=>{var hh=Ec(),{MAX_LENGTH:u$,MAX_SAFE_INTEGER:ph}=_c(),{safeRe:c$,t:l$}=ia(),Ore=dh(),{compareIdentifiers:oa}=gv(),yv=class t{constructor(e,r){if(r=Ore(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`);hh("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>ph||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ph||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ph||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<ph)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(hh("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)),oa(this.major,e.major)||oa(this.minor,e.minor)||oa(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(hh("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 oa(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(hh("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 oa(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]),oa(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=yv});var yo=y((Fme,h$)=>{var d$=Ft(),Are=(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=Are});var m$=y((Ome,p$)=>{var kre=yo(),Tre=(t,e)=>{let r=kre(t,e);return r?r.version:null};p$.exports=Tre});var y$=y((Ame,g$)=>{var Pre=yo(),Rre=(t,e)=>{let r=Pre(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};g$.exports=Rre});var b$=y((kme,v$)=>{var D$=Ft(),$re=(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=$re});var E$=y((Tme,_$)=>{var w$=yo(),Ire=(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=Ire});var S$=y((Pme,C$)=>{var jre=Ft(),Nre=(t,e)=>new jre(t,e).major;C$.exports=Nre});var F$=y((Rme,x$)=>{var Lre=Ft(),Bre=(t,e)=>new Lre(t,e).minor;x$.exports=Bre});var A$=y(($me,O$)=>{var qre=Ft(),Mre=(t,e)=>new qre(t,e).patch;O$.exports=Mre});var T$=y((Ime,k$)=>{var Ure=yo(),Vre=(t,e)=>{let r=Ure(t,e);return r&&r.prerelease.length?r.prerelease:null};k$.exports=Vre});var Er=y((jme,R$)=>{var P$=Ft(),Hre=(t,e,r)=>new P$(t,r).compare(new P$(e,r));R$.exports=Hre});var I$=y((Nme,$$)=>{var zre=Er(),Gre=(t,e,r)=>zre(e,t,r);$$.exports=Gre});var N$=y((Lme,j$)=>{var Wre=Er(),Kre=(t,e)=>Wre(t,e,!0);j$.exports=Kre});var mh=y((Bme,B$)=>{var L$=Ft(),Yre=(t,e,r)=>{let n=new L$(t,r),i=new L$(e,r);return n.compare(i)||n.compareBuild(i)};B$.exports=Yre});var M$=y((qme,q$)=>{var Jre=mh(),Xre=(t,e)=>t.sort((r,n)=>Jre(r,n,e));q$.exports=Xre});var V$=y((Mme,U$)=>{var Zre=mh(),Qre=(t,e)=>t.sort((r,n)=>Zre(n,r,e));U$.exports=Qre});var Cc=y((Ume,H$)=>{var ene=Er(),tne=(t,e,r)=>ene(t,e,r)>0;H$.exports=tne});var gh=y((Vme,z$)=>{var rne=Er(),nne=(t,e,r)=>rne(t,e,r)<0;z$.exports=nne});var Dv=y((Hme,G$)=>{var ine=Er(),one=(t,e,r)=>ine(t,e,r)===0;G$.exports=one});var vv=y((zme,W$)=>{var sne=Er(),ane=(t,e,r)=>sne(t,e,r)!==0;W$.exports=ane});var yh=y((Gme,K$)=>{var une=Er(),cne=(t,e,r)=>une(t,e,r)>=0;K$.exports=cne});var Dh=y((Wme,Y$)=>{var lne=Er(),fne=(t,e,r)=>lne(t,e,r)<=0;Y$.exports=fne});var bv=y((Kme,J$)=>{var dne=Dv(),hne=vv(),pne=Cc(),mne=yh(),gne=gh(),yne=Dh(),Dne=(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 dne(t,r,n);case"!=":return hne(t,r,n);case">":return pne(t,r,n);case">=":return mne(t,r,n);case"<":return gne(t,r,n);case"<=":return yne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};J$.exports=Dne});var Z$=y((Yme,X$)=>{var vne=Ft(),bne=yo(),{safeRe:vh,t:bh}=ia(),wne=(t,e)=>{if(t instanceof vne)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?vh[bh.COERCEFULL]:vh[bh.COERCE]);else{let u=e.includePrerelease?vh[bh.COERCERTLFULL]:vh[bh.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 bne(`${n}.${i}.${o}${s}${a}`,e)};X$.exports=wne});var eI=y((Jme,Q$)=>{var wv=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=wv});var Cr=y((Xme,iI)=>{var _ne=/\s+/g,_v=class t{constructor(e,r){if(r=Cne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ev)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(_ne," "),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&&Tne(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&&Ane)|(this.options.loose&&kne))+":"+e,i=tI.get(n);if(i)return i;let o=this.options.loose,s=o?er[jt.HYPHENRANGELOOSE]:er[jt.HYPHENRANGE];e=e.replace(s,Mne(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(er[jt.COMPARATORTRIM],xne),$e("comparator trim",e),e=e.replace(er[jt.TILDETRIM],Fne),$e("tilde trim",e),e=e.replace(er[jt.CARETTRIM],One),$e("caret trim",e);let a=e.split(" ").map(f=>Pne(f,this.options)).join(" ").split(/\s+/).map(f=>qne(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(er[jt.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,c=a.map(f=>new Ev(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 Sne(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Une(this.set[r],e,this.options))return!0;return!1}};iI.exports=_v;var Ene=eI(),tI=new Ene,Cne=dh(),Ev=Sc(),$e=Ec(),Sne=Ft(),{safeRe:er,t:jt,comparatorTrimReplace:xne,tildeTrimReplace:Fne,caretTrimReplace:One}=ia(),{FLAG_INCLUDE_PRERELEASE:Ane,FLAG_LOOSE:kne}=_c(),rI=t=>t.value==="<0.0.0-0",Tne=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},Pne=(t,e)=>($e("comp",t,e),t=Ine(t,e),$e("caret",t),t=Rne(t,e),$e("tildes",t),t=Nne(t,e),$e("xrange",t),t=Bne(t,e),$e("stars",t),t),Nt=t=>!t||t.toLowerCase()==="x"||t==="*",Rne=(t,e)=>t.trim().split(/\s+/).map(r=>$ne(r,e)).join(" "),$ne=(t,e)=>{let r=e.loose?er[jt.TILDELOOSE]:er[jt.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return Nt(i)?u="":Nt(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:Nt(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},Ine=(t,e)=>t.trim().split(/\s+/).map(r=>jne(r,e)).join(" "),jne=(t,e)=>{$e("caret",t,e);let r=e.loose?er[jt.CARETLOOSE]:er[jt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let c;return Nt(o)?c="":Nt(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:Nt(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("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`):($e("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`),$e("caret return",c),c})},Nne=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Lne(r,e)).join(" ")),Lne=(t,e)=>{t=t.trim();let r=e.loose?er[jt.XRANGELOOSE]:er[jt.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let c=Nt(o),l=c||Nt(s),f=l||Nt(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`),$e("xRange return",n),n})},Bne=(t,e)=>($e("replaceStars",t,e),t.trim().replace(er[jt.STAR],"")),qne=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(er[e.includePrerelease?jt.GTE0PRE:jt.GTE0],"")),Mne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(Nt(n)?r="":Nt(i)?r=`>=${n}.0.0${t?"-0":""}`:Nt(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Nt(c)?u="":Nt(l)?u=`<${+c+1}.0.0-0`:Nt(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()),Une=(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($e(t[n].semver),t[n].semver!==Ev.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 Sc=y((Zme,lI)=>{var xc=Symbol("SemVer ANY"),xv=class t{static get ANY(){return xc}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(" "),Sv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===xc?this.value="":this.value=this.operator+this.semver.version,Sv("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=xc}toString(){return this.value}test(e){if(Sv("Comparator.test",e,this.options.loose),this.semver===xc||e===xc)return!0;if(typeof e=="string")try{e=new uI(e,this.options)}catch{return!1}return Cv(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("=")||Cv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Cv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};lI.exports=xv;var oI=dh(),{safeRe:sI,t:aI}=ia(),Cv=bv(),Sv=Ec(),uI=Ft(),cI=Cr()});var Fc=y((Qme,fI)=>{var Vne=Cr(),Hne=(t,e,r)=>{try{e=new Vne(e,r)}catch{return!1}return e.test(t)};fI.exports=Hne});var hI=y((ege,dI)=>{var zne=Cr(),Gne=(t,e)=>new zne(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));dI.exports=Gne});var mI=y((tge,pI)=>{var Wne=Ft(),Kne=Cr(),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};pI.exports=Yne});var yI=y((rge,gI)=>{var Jne=Ft(),Xne=Cr(),Zne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Xne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Jne(n,r))}),n};gI.exports=Zne});var bI=y((nge,vI)=>{var Fv=Ft(),Qne=Cr(),DI=Cc(),eie=(t,e)=>{t=new Qne(t,e);let r=new Fv("0.0.0");if(t.test(r)||(r=new Fv("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 Fv(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=eie});var _I=y((ige,wI)=>{var tie=Cr(),rie=(t,e)=>{try{return new tie(t,e).range||"*"}catch{return null}};wI.exports=rie});var wh=y((oge,xI)=>{var nie=Ft(),SI=Sc(),{ANY:iie}=SI,oie=Cr(),sie=Fc(),EI=Cc(),CI=gh(),aie=Dh(),uie=yh(),cie=(t,e,r,n)=>{t=new nie(t,n),e=new oie(e,n);let i,o,s,a,u;switch(r){case">":i=EI,o=aie,s=CI,a=">",u=">=";break;case"<":i=CI,o=uie,s=EI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(sie(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===iie&&(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=cie});var OI=y((sge,FI)=>{var lie=wh(),fie=(t,e,r)=>lie(t,e,">",r);FI.exports=fie});var kI=y((age,AI)=>{var die=wh(),hie=(t,e,r)=>die(t,e,"<",r);AI.exports=hie});var RI=y((uge,PI)=>{var TI=Cr(),pie=(t,e,r)=>(t=new TI(t,r),e=new TI(e,r),t.intersects(e,r));PI.exports=pie});var II=y((cge,$I)=>{var mie=Fc(),gie=Er();$I.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>gie(l,f,r));for(let l of s)mie(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((lge,qI)=>{var jI=Cr(),Av=Sc(),{ANY:Ov}=Av,Oc=Fc(),kv=Er(),yie=(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=vie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Die=[new Av(">=0.0.0-0")],NI=[new Av(">=0.0.0")],vie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ov){if(e.length===1&&e[0].semver===Ov)return!0;r.includePrerelease?t=Die:t=NI}if(e.length===1&&e[0].semver===Ov){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=kv(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&&!Oc(d,String(i),r)||o&&!Oc(d,String(o),r))return null;for(let m of e)if(!Oc(d,String(m),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===">="&&!Oc(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==="<="&&!Oc(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=kv(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=kv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};qI.exports=yie});var Pv=y((fge,HI)=>{var Tv=ia(),UI=_c(),bie=Ft(),VI=gv(),wie=yo(),_ie=m$(),Eie=y$(),Cie=b$(),Sie=E$(),xie=S$(),Fie=F$(),Oie=A$(),Aie=T$(),kie=Er(),Tie=I$(),Pie=N$(),Rie=mh(),$ie=M$(),Iie=V$(),jie=Cc(),Nie=gh(),Lie=Dv(),Bie=vv(),qie=yh(),Mie=Dh(),Uie=bv(),Vie=Z$(),Hie=Sc(),zie=Cr(),Gie=Fc(),Wie=hI(),Kie=mI(),Yie=yI(),Jie=bI(),Xie=_I(),Zie=wh(),Qie=OI(),eoe=kI(),toe=RI(),roe=II(),noe=MI();HI.exports={parse:wie,valid:_ie,clean:Eie,inc:Cie,diff:Sie,major:xie,minor:Fie,patch:Oie,prerelease:Aie,compare:kie,rcompare:Tie,compareLoose:Pie,compareBuild:Rie,sort:$ie,rsort:Iie,gt:jie,lt:Nie,eq:Lie,neq:Bie,gte:qie,lte:Mie,cmp:Uie,coerce:Vie,Comparator:Hie,Range:zie,satisfies:Gie,toComparators:Wie,maxSatisfying:Kie,minSatisfying:Yie,minVersion:Jie,validRange:Xie,outside:Zie,gtr:Qie,ltr:eoe,intersects:toe,simplifyRange:roe,subset:noe,SemVer:bie,re:Tv.re,src:Tv.src,tokens:Tv.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 kc=(Sn(),ke(Cn)),yi=Ms(),zI=KD(),Do=require("path"),Se=kc.__importDefault(zs()),sa=zd(),WI=cc(),ioe=XR(),GI=hl(),Ac=lh(),ooe=fh();async function soe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
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(Ste(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(xte.line+PR.to(0)+this.outputText))}};RR.exports=sv});var jR=y((hme,IR)=>{"use strict";IR.exports={TextPrompt:RP(),SelectPrompt:NP(),TogglePrompt:MP(),DatePrompt:hR(),NumberPrompt:yR(),MultiselectPrompt:tv(),AutocompletePrompt:SR(),AutocompleteMultiselectPrompt:AR(),ConfirmPrompt:$R()}});var LR=y(NR=>{"use strict";var Zt=NR,Fte=jR(),uh=t=>t;function nn(t,e,r={}){return new Promise((n,i)=>{let o=new Fte[t](e),s=r.onAbort||uh,a=r.onSubmit||uh,u=r.onExit||uh;o.on("state",e.onState||uh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Zt.text=t=>nn("TextPrompt",t);Zt.password=t=>(t.style="password",Zt.text(t));Zt.invisible=t=>(t.style="invisible",Zt.text(t));Zt.number=t=>nn("NumberPrompt",t);Zt.date=t=>nn("DatePrompt",t);Zt.confirm=t=>nn("ConfirmPrompt",t);Zt.list=t=>{let e=t.separator||",";return nn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Zt.toggle=t=>nn("TogglePrompt",t);Zt.select=t=>nn("SelectPrompt",t);Zt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return nn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Zt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return nn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Ote=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Zt.autocomplete=t=>(t.suggest=t.suggest||Ote,t.choices=[].concat(t.choices||[]),nn("AutocompletePrompt",t))});var MR=y((mme,qR)=>{"use strict";var av=LR(),Ate=["suggest","format","onState","validate","onRender","type"],BR=()=>{};async function mi(t=[],{onSubmit:e=BR,onCancel:r=BR}={}){let n={},i=mi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,m=!1)=>{if(!(!m&&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(Ate.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,av[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=mi._injected?kte(mi._injected,s.initial):await av[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 kte(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Tte(t){mi._injected=(mi._injected||[]).concat(t)}function Pte(t){mi._override=Object.assign({},t)}qR.exports=Object.assign(mi,{prompt:mi,prompts:av,inject:Tte,override:Pte})});var ch=y((gme,UR)=>{function Rte(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=Rte("8.6.0")?hP():MR()});var cc=y(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.logSuccess=Qt.logPrompt=Qt.logger=Qt.output=void 0;var uv=(Sn(),ke(Cn)),mo=(ZD(),ke(XD)),go=uv.__importDefault(Gs()),$te=p3(),VR={colors:go.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Qt.output=(0,$te.isInteractive)()?new mo.TTYOutputStrategy(VR):new mo.StreamOutputStrategy(VR);Qt.logger=(0,mo.createDefaultLogger)({output:Qt.output,formatterOptions:{titleize:!1,tags:new Map([[mo.LOGGER_LEVELS.DEBUG,go.default.log.DEBUG("[debug]")],[mo.LOGGER_LEVELS.INFO,go.default.log.INFO("[info]")],[mo.LOGGER_LEVELS.WARN,go.default.log.WARN("[warn]")],[mo.LOGGER_LEVELS.ERROR,go.default.log.ERROR("[error]")]])}});async function Ite(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>uv.__importStar((ZD(),ke(XD)))),{prompt:n}=await Promise.resolve().then(()=>uv.__importStar(ch()));return Qt.logger.log({msg:`${go.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Qt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Qt.logPrompt=Ite;function jte(t){Qt.logger.msg(`${go.default.success("[success]")} ${t}`)}Qt.logSuccess=jte});var lh=y(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.resolveNode=na.requireTS=void 0;var Nte=Us(),Lte=require("fs"),Bte=require("path"),qte=(t,e)=>{let r=(0,Bte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,Nte.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};na.requireTS=qte;function Mte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Lte.existsSync)(n)?n:null}}na.resolveNode=Mte});var HR={};gn(HR,{default:()=>Ute});var Ute,zR=lt(()=>{Ute={}});var GR=y(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.buildXmlElement=on.writeXML=on.parseXML=on.readXML=void 0;var Vte=(Sn(),ke(Cn)),Hte=Us(),wc=Vte.__importDefault((zR(),ke(HR)));async function zte(t){var e;try{let r=await(0,Hte.readFile)(t,{encoding:"utf-8"});try{return await wc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}on.readXML=zte;function Gte(t,e){let r=e!==void 0?new wc.default.Parser({...e}):new wc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}on.parseXML=Gte;async function Wte(t){return new Promise(e=>{let n=new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}on.writeXML=Wte;function Kte(t,e){return new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}on.buildXmlElement=Kte});var XR=y(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getAllElements=Ce.getFilePath=Ce.getAssets=Ce.getJSModules=Ce.getPluginType=Ce.getPlatformElement=Ce.getPluginPlatform=Ce.printPlugins=Ce.fixName=Ce.getDependencies=Ce.resolvePlugin=Ce.getPlugins=Ce.getIncludedPluginPackages=void 0;var Yte=(Sn(),ke(Cn)),Jte=Us(),cv=require("path"),ia=Yte.__importDefault(Gs()),Xte=zd(),Zte=cc(),WR=lh(),Qte=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}}Ce.getIncludedPluginPackages=KR;async function ere(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)}Ce.getPlugins=ere;async function YR(t,e){try{let r=(0,WR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,Xte.fatal)(`Unable to find ${ia.default.strong(`node_modules/${e}`)}.
161
+ Are you sure ${ia.default.strong(e)} is installed?`);let n=(0,cv.dirname)(r),i=await(0,Jte.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:lv(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,cv.join)(n,"plugin.xml"),s=await(0,Qte.readXML)(o);return{id:e,name:lv(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ce.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:{})]}Ce.getDependencies=JR;function lv(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ce.fixName=lv;function tre(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 ${ia.default.strong(e)}:
162
+ `;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${ia.default.strong(e)}, skipped install:
163
+ `;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${ia.default.strong(e)}:
164
+ `;break}n+=t.map(o=>`${o.id}${ia.default.weak(`@${o.version}`)}`).join(`
165
+ `),Zte.logger.info(n)}Ce.printPlugins=tre;function fv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ce.getPluginPlatform=fv;function rre(t,e,r){let n=fv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ce.getPlatformElement=rre;function nre(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}Ce.getPluginType=nre;function ire(t,e){return dv(t,e,"js-module")}Ce.getJSModules=ire;function ore(t,e){return dv(t,e,"asset")}Ce.getAssets=ore;function sre(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,cv.join)(e.rootPath,r)}Ce.getFilePath=sre;function dv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=fv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ce.getAllElements=dv});var ZR={};gn(ZR,{default:()=>are});var are,QR=lt(()=>{are={}});var fh=y(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.isInstalled=gi.getCommandOutput=gi.runCommand=void 0;var hv=(QR(),ke(ZR));async function e$(t,e,r={}){let n=new hv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof hv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}gi.runCommand=e$;async function ure(t,e,r={}){try{return(await e$(t,e,r)).trim()}catch{return null}}gi.getCommandOutput=ure;async function cre(t){try{await(0,hv.which)(t)}catch{return!1}return!0}gi.isInstalled=cre});var _c=y((_me,t$)=>{var lre="2.0.0",fre=Number.MAX_SAFE_INTEGER||9007199254740991,dre=16,hre=250,pre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:dre,MAX_SAFE_BUILD_LENGTH:hre,MAX_SAFE_INTEGER:fre,RELEASE_TYPES:pre,SEMVER_SPEC_VERSION:lre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ec=y((Eme,r$)=>{var mre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};r$.exports=mre});var oa=y((jn,n$)=>{var{MAX_SAFE_COMPONENT_LENGTH:pv,MAX_SAFE_BUILD_LENGTH:gre,MAX_LENGTH:yre}=_c(),Dre=Ec();jn=n$.exports={};var vre=jn.re=[],bre=jn.safeRe=[],z=jn.src=[],G=jn.t={},wre=0,mv="[a-zA-Z0-9-]",_re=[["\\s",1],["\\d",yre],[mv,gre]],Ere=t=>{for(let[e,r]of _re)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=Ere(e),i=wre++;Dre(t,i,e),G[t]=i,z[i]=e,vre[i]=new RegExp(e,r?"g":void 0),bre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${mv}*`);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",`${mv}+`);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,${pv}})(?:\\.(\\d{1,${pv}}))?(?:\\.(\\d{1,${pv}}))?`);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);jn.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);jn.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);jn.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 dh=y((Cme,i$)=>{var Cre=Object.freeze({loose:!0}),Sre=Object.freeze({}),xre=t=>t?typeof t!="object"?Cre:t:Sre;i$.exports=xre});var gv=y((Sme,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},Fre=(t,e)=>s$(e,t);a$.exports={compareIdentifiers:s$,rcompareIdentifiers:Fre}});var Ft=y((xme,f$)=>{var hh=Ec(),{MAX_LENGTH:u$,MAX_SAFE_INTEGER:ph}=_c(),{safeRe:c$,t:l$}=oa(),Ore=dh(),{compareIdentifiers:sa}=gv(),yv=class t{constructor(e,r){if(r=Ore(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`);hh("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>ph||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ph||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ph||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<ph)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(hh("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)),sa(this.major,e.major)||sa(this.minor,e.minor)||sa(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(hh("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 sa(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(hh("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 sa(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]),sa(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=yv});var yo=y((Fme,h$)=>{var d$=Ft(),Are=(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=Are});var m$=y((Ome,p$)=>{var kre=yo(),Tre=(t,e)=>{let r=kre(t,e);return r?r.version:null};p$.exports=Tre});var y$=y((Ame,g$)=>{var Pre=yo(),Rre=(t,e)=>{let r=Pre(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};g$.exports=Rre});var b$=y((kme,v$)=>{var D$=Ft(),$re=(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=$re});var E$=y((Tme,_$)=>{var w$=yo(),Ire=(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=Ire});var S$=y((Pme,C$)=>{var jre=Ft(),Nre=(t,e)=>new jre(t,e).major;C$.exports=Nre});var F$=y((Rme,x$)=>{var Lre=Ft(),Bre=(t,e)=>new Lre(t,e).minor;x$.exports=Bre});var A$=y(($me,O$)=>{var qre=Ft(),Mre=(t,e)=>new qre(t,e).patch;O$.exports=Mre});var T$=y((Ime,k$)=>{var Ure=yo(),Vre=(t,e)=>{let r=Ure(t,e);return r&&r.prerelease.length?r.prerelease:null};k$.exports=Vre});var Er=y((jme,R$)=>{var P$=Ft(),Hre=(t,e,r)=>new P$(t,r).compare(new P$(e,r));R$.exports=Hre});var I$=y((Nme,$$)=>{var zre=Er(),Gre=(t,e,r)=>zre(e,t,r);$$.exports=Gre});var N$=y((Lme,j$)=>{var Wre=Er(),Kre=(t,e)=>Wre(t,e,!0);j$.exports=Kre});var mh=y((Bme,B$)=>{var L$=Ft(),Yre=(t,e,r)=>{let n=new L$(t,r),i=new L$(e,r);return n.compare(i)||n.compareBuild(i)};B$.exports=Yre});var M$=y((qme,q$)=>{var Jre=mh(),Xre=(t,e)=>t.sort((r,n)=>Jre(r,n,e));q$.exports=Xre});var V$=y((Mme,U$)=>{var Zre=mh(),Qre=(t,e)=>t.sort((r,n)=>Zre(n,r,e));U$.exports=Qre});var Cc=y((Ume,H$)=>{var ene=Er(),tne=(t,e,r)=>ene(t,e,r)>0;H$.exports=tne});var gh=y((Vme,z$)=>{var rne=Er(),nne=(t,e,r)=>rne(t,e,r)<0;z$.exports=nne});var Dv=y((Hme,G$)=>{var ine=Er(),one=(t,e,r)=>ine(t,e,r)===0;G$.exports=one});var vv=y((zme,W$)=>{var sne=Er(),ane=(t,e,r)=>sne(t,e,r)!==0;W$.exports=ane});var yh=y((Gme,K$)=>{var une=Er(),cne=(t,e,r)=>une(t,e,r)>=0;K$.exports=cne});var Dh=y((Wme,Y$)=>{var lne=Er(),fne=(t,e,r)=>lne(t,e,r)<=0;Y$.exports=fne});var bv=y((Kme,J$)=>{var dne=Dv(),hne=vv(),pne=Cc(),mne=yh(),gne=gh(),yne=Dh(),Dne=(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 dne(t,r,n);case"!=":return hne(t,r,n);case">":return pne(t,r,n);case">=":return mne(t,r,n);case"<":return gne(t,r,n);case"<=":return yne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};J$.exports=Dne});var Z$=y((Yme,X$)=>{var vne=Ft(),bne=yo(),{safeRe:vh,t:bh}=oa(),wne=(t,e)=>{if(t instanceof vne)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?vh[bh.COERCEFULL]:vh[bh.COERCE]);else{let u=e.includePrerelease?vh[bh.COERCERTLFULL]:vh[bh.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 bne(`${n}.${i}.${o}${s}${a}`,e)};X$.exports=wne});var eI=y((Jme,Q$)=>{var wv=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=wv});var Cr=y((Xme,iI)=>{var _ne=/\s+/g,_v=class t{constructor(e,r){if(r=Cne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ev)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(_ne," "),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&&Tne(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&&Ane)|(this.options.loose&&kne))+":"+e,i=tI.get(n);if(i)return i;let o=this.options.loose,s=o?er[jt.HYPHENRANGELOOSE]:er[jt.HYPHENRANGE];e=e.replace(s,Mne(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(er[jt.COMPARATORTRIM],xne),$e("comparator trim",e),e=e.replace(er[jt.TILDETRIM],Fne),$e("tilde trim",e),e=e.replace(er[jt.CARETTRIM],One),$e("caret trim",e);let a=e.split(" ").map(f=>Pne(f,this.options)).join(" ").split(/\s+/).map(f=>qne(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(er[jt.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,c=a.map(f=>new Ev(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 Sne(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Une(this.set[r],e,this.options))return!0;return!1}};iI.exports=_v;var Ene=eI(),tI=new Ene,Cne=dh(),Ev=Sc(),$e=Ec(),Sne=Ft(),{safeRe:er,t:jt,comparatorTrimReplace:xne,tildeTrimReplace:Fne,caretTrimReplace:One}=oa(),{FLAG_INCLUDE_PRERELEASE:Ane,FLAG_LOOSE:kne}=_c(),rI=t=>t.value==="<0.0.0-0",Tne=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},Pne=(t,e)=>($e("comp",t,e),t=Ine(t,e),$e("caret",t),t=Rne(t,e),$e("tildes",t),t=Nne(t,e),$e("xrange",t),t=Bne(t,e),$e("stars",t),t),Nt=t=>!t||t.toLowerCase()==="x"||t==="*",Rne=(t,e)=>t.trim().split(/\s+/).map(r=>$ne(r,e)).join(" "),$ne=(t,e)=>{let r=e.loose?er[jt.TILDELOOSE]:er[jt.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return Nt(i)?u="":Nt(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:Nt(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},Ine=(t,e)=>t.trim().split(/\s+/).map(r=>jne(r,e)).join(" "),jne=(t,e)=>{$e("caret",t,e);let r=e.loose?er[jt.CARETLOOSE]:er[jt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let c;return Nt(o)?c="":Nt(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:Nt(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("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`):($e("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`),$e("caret return",c),c})},Nne=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Lne(r,e)).join(" ")),Lne=(t,e)=>{t=t.trim();let r=e.loose?er[jt.XRANGELOOSE]:er[jt.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let c=Nt(o),l=c||Nt(s),f=l||Nt(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`),$e("xRange return",n),n})},Bne=(t,e)=>($e("replaceStars",t,e),t.trim().replace(er[jt.STAR],"")),qne=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(er[e.includePrerelease?jt.GTE0PRE:jt.GTE0],"")),Mne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(Nt(n)?r="":Nt(i)?r=`>=${n}.0.0${t?"-0":""}`:Nt(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Nt(c)?u="":Nt(l)?u=`<${+c+1}.0.0-0`:Nt(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()),Une=(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($e(t[n].semver),t[n].semver!==Ev.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 Sc=y((Zme,lI)=>{var xc=Symbol("SemVer ANY"),xv=class t{static get ANY(){return xc}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(" "),Sv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===xc?this.value="":this.value=this.operator+this.semver.version,Sv("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=xc}toString(){return this.value}test(e){if(Sv("Comparator.test",e,this.options.loose),this.semver===xc||e===xc)return!0;if(typeof e=="string")try{e=new uI(e,this.options)}catch{return!1}return Cv(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("=")||Cv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Cv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};lI.exports=xv;var oI=dh(),{safeRe:sI,t:aI}=oa(),Cv=bv(),Sv=Ec(),uI=Ft(),cI=Cr()});var Fc=y((Qme,fI)=>{var Vne=Cr(),Hne=(t,e,r)=>{try{e=new Vne(e,r)}catch{return!1}return e.test(t)};fI.exports=Hne});var hI=y((ege,dI)=>{var zne=Cr(),Gne=(t,e)=>new zne(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));dI.exports=Gne});var mI=y((tge,pI)=>{var Wne=Ft(),Kne=Cr(),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};pI.exports=Yne});var yI=y((rge,gI)=>{var Jne=Ft(),Xne=Cr(),Zne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Xne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Jne(n,r))}),n};gI.exports=Zne});var bI=y((nge,vI)=>{var Fv=Ft(),Qne=Cr(),DI=Cc(),eie=(t,e)=>{t=new Qne(t,e);let r=new Fv("0.0.0");if(t.test(r)||(r=new Fv("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 Fv(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=eie});var _I=y((ige,wI)=>{var tie=Cr(),rie=(t,e)=>{try{return new tie(t,e).range||"*"}catch{return null}};wI.exports=rie});var wh=y((oge,xI)=>{var nie=Ft(),SI=Sc(),{ANY:iie}=SI,oie=Cr(),sie=Fc(),EI=Cc(),CI=gh(),aie=Dh(),uie=yh(),cie=(t,e,r,n)=>{t=new nie(t,n),e=new oie(e,n);let i,o,s,a,u;switch(r){case">":i=EI,o=aie,s=CI,a=">",u=">=";break;case"<":i=CI,o=uie,s=EI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(sie(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===iie&&(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=cie});var OI=y((sge,FI)=>{var lie=wh(),fie=(t,e,r)=>lie(t,e,">",r);FI.exports=fie});var kI=y((age,AI)=>{var die=wh(),hie=(t,e,r)=>die(t,e,"<",r);AI.exports=hie});var RI=y((uge,PI)=>{var TI=Cr(),pie=(t,e,r)=>(t=new TI(t,r),e=new TI(e,r),t.intersects(e,r));PI.exports=pie});var II=y((cge,$I)=>{var mie=Fc(),gie=Er();$I.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>gie(l,f,r));for(let l of s)mie(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((lge,qI)=>{var jI=Cr(),Av=Sc(),{ANY:Ov}=Av,Oc=Fc(),kv=Er(),yie=(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=vie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Die=[new Av(">=0.0.0-0")],NI=[new Av(">=0.0.0")],vie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ov){if(e.length===1&&e[0].semver===Ov)return!0;r.includePrerelease?t=Die:t=NI}if(e.length===1&&e[0].semver===Ov){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=kv(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&&!Oc(d,String(i),r)||o&&!Oc(d,String(o),r))return null;for(let m of e)if(!Oc(d,String(m),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===">="&&!Oc(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==="<="&&!Oc(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=kv(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=kv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};qI.exports=yie});var Pv=y((fge,HI)=>{var Tv=oa(),UI=_c(),bie=Ft(),VI=gv(),wie=yo(),_ie=m$(),Eie=y$(),Cie=b$(),Sie=E$(),xie=S$(),Fie=F$(),Oie=A$(),Aie=T$(),kie=Er(),Tie=I$(),Pie=N$(),Rie=mh(),$ie=M$(),Iie=V$(),jie=Cc(),Nie=gh(),Lie=Dv(),Bie=vv(),qie=yh(),Mie=Dh(),Uie=bv(),Vie=Z$(),Hie=Sc(),zie=Cr(),Gie=Fc(),Wie=hI(),Kie=mI(),Yie=yI(),Jie=bI(),Xie=_I(),Zie=wh(),Qie=OI(),eoe=kI(),toe=RI(),roe=II(),noe=MI();HI.exports={parse:wie,valid:_ie,clean:Eie,inc:Cie,diff:Sie,major:xie,minor:Fie,patch:Oie,prerelease:Aie,compare:kie,rcompare:Tie,compareLoose:Pie,compareBuild:Rie,sort:$ie,rsort:Iie,gt:jie,lt:Nie,eq:Lie,neq:Bie,gte:qie,lte:Mie,cmp:Uie,coerce:Vie,Comparator:Hie,Range:zie,satisfies:Gie,toComparators:Wie,maxSatisfying:Kie,minSatisfying:Yie,minVersion:Jie,validRange:Xie,outside:Zie,gtr:Qie,ltr:eoe,intersects:toe,simplifyRange:roe,subset:noe,SemVer:bie,re:Tv.re,src:Tv.src,tokens:Tv.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 kc=(Sn(),ke(Cn)),yi=Us(),zI=KD(),Do=require("path"),Se=kc.__importDefault(Gs()),aa=zd(),WI=cc(),ioe=XR(),GI=hl(),Ac=lh(),ooe=fh();async function soe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
166
  `)}W.check=soe;async function aoe(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,yi.pathExists)(t.app.webDirAbs)?await(0,yi.pathExists)((0,Do.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Se.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}) must contain an ${Se.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: ${Se.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}.
168
168
  Please create it and make sure it has an ${Se.default.strong("index.html")} file. You can change the path of this directory in ${Se.default.strong(t.app.extConfigName)} (${Se.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Se.default.input("npm run build")}). More info: ${Se.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=aoe;async function uoe(){return await(0,yi.pathExists)("package.json")||await(0,yi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
@@ -170,34 +170,34 @@ Make sure you have a package.json or project.json file in the directory where yo
170
170
  More info: ${Se.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=uoe;async function coe(t,e){return await $v(t,e)?null:`Could not find the ${Se.default.input(e)} platform.
171
171
  You must install it in your project first, e.g. w/ ${Se.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=coe;async function loe(t){if(!t.app.appId)return`Missing ${Se.default.input("appId")} for new platform.
172
172
  Please add it in ${t.app.extConfigName} or run ${Se.default.input("npx cap init")}.`;if(!t.app.appName)return`Missing ${Se.default.input("appName")} for new platform.
173
- Please add it in ${t.app.extConfigName} or run ${Se.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=loe;async function foe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=foe;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 doe(t){return new Promise(e=>setTimeout(e,t))}W.wait=doe;async function hoe(t,e,r,n){await Rv(t,e,r,n),(await(0,ioe.getPlugins)(t,e)).forEach(async o=>{await Rv(t,e,o.rootPath,n)})}W.runHooks=hoe;async function Rv(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>kc.__importStar(require("child_process"))),s;(0,GI.isNXMonorepo)(r)?s=await(0,yi.readJSON)((0,Do.join)((0,GI.findNXMonorepoRoot)(r),"package.json")):s=await(0,yi.readJSON)((0,Do.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=Rv;async function poe(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=poe;async function $v(t,e){let r=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,yi.readJSON)(r):null}W.getCapacitorPackage=$v;async function JI(t,e){let r=await $v(t,e);return r||(0,sa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
- Are you sure ${Se.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=JI;async function Eh(t,e){return(await JI(t,e)).version}W.getCapacitorPackageVersion=Eh;async function XI(t){return Eh(t,"core")}W.getCoreVersion=XI;async function moe(t){return Eh(t,"cli")}W.getCLIVersion=moe;function goe(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 _h(t,e){let r=goe(t,e);return r&&await(0,yi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=_h;async function yoe(t,e){if(e){let r=e.toLowerCase().trim();return await jv(r)?await _h(t,r)||(r==="web"&&(0,sa.fatal)(`Could not find the web platform directory.
175
- Make sure ${Se.default.strong(t.app.webDir)} exists.`),(0,sa.fatal)(`${Se.default.strong(r)} platform has not been added yet.
176
- See the docs for adding the ${Se.default.strong(r)} platform: ${Se.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,sa.fatal)(`Invalid platform: ${Se.default.input(r)}`),[r]}return t6(t)}W.selectPlatforms=yoe;async function Iv(){return["web","android","ios"]}W.getKnownPlatforms=Iv;async function jv(t){return(await Iv()).includes(t)}W.isValidPlatform=jv;async function ZI(){return["electron"]}W.getKnownCommunityPlatforms=ZI;async function Doe(t){return(await ZI()).includes(t)}W.isValidCommunityPlatform=Doe;async function QI(){return["windows"]}W.getKnownEnterprisePlatforms=QI;async function voe(t){return(await QI()).includes(t)}W.isValidEnterprisePlatform=voe;async function boe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>kc.__importStar(ch()));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 jv(i)){let o=await Iv();(0,sa.fatal)(`Invalid platform: ${Se.default.input(i)}.
177
- Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=boe;async function woe(t,e){let{prompt:r}=await Promise.resolve().then(()=>kc.__importStar(ch())),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,sa.fatal)(`Invalid target ID: ${Se.default.input(i)}.
173
+ Please add it in ${t.app.extConfigName} or run ${Se.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=loe;async function foe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=foe;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 doe(t){return new Promise(e=>setTimeout(e,t))}W.wait=doe;async function hoe(t,e,r,n){await Rv(t,e,r,n),(await(0,ioe.getPlugins)(t,e)).forEach(async o=>{await Rv(t,e,o.rootPath,n)})}W.runHooks=hoe;async function Rv(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>kc.__importStar(require("child_process"))),s;(0,GI.isNXMonorepo)(r)?s=await(0,yi.readJSON)((0,Do.join)((0,GI.findNXMonorepoRoot)(r),"package.json")):s=await(0,yi.readJSON)((0,Do.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=Rv;async function poe(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=poe;async function $v(t,e){let r=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,yi.readJSON)(r):null}W.getCapacitorPackage=$v;async function JI(t,e){let r=await $v(t,e);return r||(0,aa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
+ Are you sure ${Se.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=JI;async function Eh(t,e){return(await JI(t,e)).version}W.getCapacitorPackageVersion=Eh;async function XI(t){return Eh(t,"core")}W.getCoreVersion=XI;async function moe(t){return Eh(t,"cli")}W.getCLIVersion=moe;function goe(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 _h(t,e){let r=goe(t,e);return r&&await(0,yi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=_h;async function yoe(t,e){if(e){let r=e.toLowerCase().trim();return await jv(r)?await _h(t,r)||(r==="web"&&(0,aa.fatal)(`Could not find the web platform directory.
175
+ Make sure ${Se.default.strong(t.app.webDir)} exists.`),(0,aa.fatal)(`${Se.default.strong(r)} platform has not been added yet.
176
+ See the docs for adding the ${Se.default.strong(r)} platform: ${Se.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,aa.fatal)(`Invalid platform: ${Se.default.input(r)}`),[r]}return t6(t)}W.selectPlatforms=yoe;async function Iv(){return["web","android","ios"]}W.getKnownPlatforms=Iv;async function jv(t){return(await Iv()).includes(t)}W.isValidPlatform=jv;async function ZI(){return["electron"]}W.getKnownCommunityPlatforms=ZI;async function Doe(t){return(await ZI()).includes(t)}W.isValidCommunityPlatform=Doe;async function QI(){return["windows"]}W.getKnownEnterprisePlatforms=QI;async function voe(t){return(await QI()).includes(t)}W.isValidEnterprisePlatform=voe;async function boe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>kc.__importStar(ch()));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 jv(i)){let o=await Iv();(0,aa.fatal)(`Invalid platform: ${Se.default.input(i)}.
177
+ Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=boe;async function woe(t,e){let{prompt:r}=await Promise.resolve().then(()=>kc.__importStar(ch())),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,aa.fatal)(`Invalid target ID: ${Se.default.input(i)}.
178
178
  Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=woe;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 _h(t,t.android.name)&&e.push(t.android.name),await _h(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=t6;async function _oe(t,e){let r=await Promise.resolve().then(()=>kc.__importStar(Pv())),n=await XI(t),i=await Eh(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&WI.logger.warn(`${Se.default.strong("@capacitor/core")}${Se.default.weak(`@${n}`)} version doesn't match ${Se.default.strong(`@capacitor/${e}`)}${Se.default.weak(`@${i}`)} version.
179
- Consider updating to a matching version, e.g. w/ ${Se.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=_oe;function Eoe(t,e){if(e[0]!=="@"){let n=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,Do.dirname)(n);let i=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,Do.dirname)(i);let o=(0,Ac.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,Do.dirname)(o)}let r=(0,Ac.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,Do.dirname)(r):null}W.resolvePlatform=Eoe;async function Coe(){try{let t=await(0,ooe.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=Coe;function Soe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Soe});var n6=y(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.tryFn=void 0;var xoe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Ch.tryFn=xoe});var i6=y(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.formatJSObject=void 0;var Foe=(Sn(),ke(Cn)),Ooe=Foe.__importDefault(require("util"));function Aoe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Ooe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Sh.formatJSObject=Aoe});var o6=y(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.lazy=Di.LazyPromise=Di.allSerial=void 0;function koe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}Di.allSerial=koe;var xh=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)}};Di.LazyPromise=xh;function Toe(t){return new xh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}Di.lazy=Toe});var l6=y(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.checkExternalConfig=ot.writeConfig=ot.loadConfig=ot.CONFIG_FILE_NAME_JSON=ot.CONFIG_FILE_NAME_JS=ot.CONFIG_FILE_NAME_TS=void 0;var Lv=(Sn(),ke(Cn)),tr=Ms(),Poe=Lv.__importDefault(BA()),ie=require("path"),vi=Lv.__importDefault(zs()),Roe=r6(),Fh=zd(),u6=cc(),Nv=n6(),$oe=i6(),s6=hl(),a6=lh(),aa=o6(),Ioe=fh(),c6=(0,Poe.default)("capacitor:config");ot.CONFIG_FILE_NAME_TS="capacitor.config.ts";ot.CONFIG_FILE_NAME_JS="capacitor.config.js";ot.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function joe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await qoe(i),a=await(async()=>{var d,m;if((0,s6.isNXMonorepo)(i)){let b=(0,s6.findNXMonorepoRoot)(i),g=await(0,Nv.tryFn)(tr.readJSON,(0,ie.resolve)(b,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(m=g?.dependencies)!==null&&m!==void 0?m:{};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 Moe(o),h={android:await Uoe(i,s.extConfig,f),ios:await Voe(i,s.extConfig),web:await Hoe(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Nv.tryFn)(tr.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}ot.loadConfig=joe;async function Noe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,tr.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,tr.writeFile)(e,Joe(t));break}}}ot.writeConfig=Noe;async function Loe(t,e,r){var n;try{let i=(0,a6.resolveNode)(t,"typescript");i||(0,Fh.fatal)(`Could not find installation of TypeScript.
179
+ Consider updating to a matching version, e.g. w/ ${Se.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=_oe;function Eoe(t,e){if(e[0]!=="@"){let n=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,Do.dirname)(n);let i=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,Do.dirname)(i);let o=(0,Ac.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,Do.dirname)(o)}let r=(0,Ac.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,Do.dirname)(r):null}W.resolvePlatform=Eoe;async function Coe(){try{let t=await(0,ooe.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=Coe;function Soe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Soe});var n6=y(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.tryFn=void 0;var xoe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Ch.tryFn=xoe});var i6=y(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.formatJSObject=void 0;var Foe=(Sn(),ke(Cn)),Ooe=Foe.__importDefault(require("util"));function Aoe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Ooe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Sh.formatJSObject=Aoe});var o6=y(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.lazy=Di.LazyPromise=Di.allSerial=void 0;function koe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}Di.allSerial=koe;var xh=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)}};Di.LazyPromise=xh;function Toe(t){return new xh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}Di.lazy=Toe});var l6=y(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.checkExternalConfig=ot.writeConfig=ot.loadConfig=ot.CONFIG_FILE_NAME_JSON=ot.CONFIG_FILE_NAME_JS=ot.CONFIG_FILE_NAME_TS=void 0;var Lv=(Sn(),ke(Cn)),tr=Us(),Poe=Lv.__importDefault(BA()),ie=require("path"),vi=Lv.__importDefault(Gs()),Roe=r6(),Fh=zd(),u6=cc(),Nv=n6(),$oe=i6(),s6=hl(),a6=lh(),ua=o6(),Ioe=fh(),c6=(0,Poe.default)("capacitor:config");ot.CONFIG_FILE_NAME_TS="capacitor.config.ts";ot.CONFIG_FILE_NAME_JS="capacitor.config.js";ot.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function joe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await qoe(i),a=await(async()=>{var d,m;if((0,s6.isNXMonorepo)(i)){let b=(0,s6.findNXMonorepoRoot)(i),g=await(0,Nv.tryFn)(tr.readJSON,(0,ie.resolve)(b,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(m=g?.dependencies)!==null&&m!==void 0?m:{};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 Moe(o),h={android:await Uoe(i,s.extConfig,f),ios:await Voe(i,s.extConfig),web:await Hoe(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Nv.tryFn)(tr.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}ot.loadConfig=joe;async function Noe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,tr.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,tr.writeFile)(e,Joe(t));break}}}ot.writeConfig=Noe;async function Loe(t,e,r){var n;try{let i=(0,a6.resolveNode)(t,"typescript");i||(0,Fh.fatal)(`Could not find installation of TypeScript.
180
180
  To use ${vi.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${vi.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,Fh.isFatal)(i)||(0,Fh.fatal)(`Parsing ${vi.default.strong(e)} failed.
181
181
 
182
182
  ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Boe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,Fh.fatal)(`Parsing ${vi.default.strong(e)} failed.
183
183
 
184
- ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function qoe(t){var e;let r=(0,ie.resolve)(t,ot.CONFIG_FILE_NAME_TS);if(await(0,tr.pathExists)(r))return Loe(t,ot.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,ot.CONFIG_FILE_NAME_JS);if(await(0,tr.pathExists)(n))return Boe(t,ot.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,ot.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:ot.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Nv.tryFn)(tr.readJSON,i))!==null&&e!==void 0?e:{}}}async function Moe(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,tr.readJSON)((0,ie.resolve)(t,"package.json")),os:zoe(process.platform)}}async function Uoe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,m,b,g,w,x,D;let C="android",k=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,k),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,Roe.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",_=(0,aa.lazy)(()=>Koe(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=(m=e.android)===null||m===void 0?void 0:m.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:k,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 Voe(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),m=`${l}/App.xcodeproj`,b=(0,ie.resolve)(u,m),g=(0,aa.lazy)(()=>Goe(f)),w=(0,aa.lazy)(()=>Yoe(t,u,f)),x=(0,aa.lazy)(()=>Woe(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:m,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,aa.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,aa.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function Hoe(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function zoe(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function Goe(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function Woe(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,tr.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return u6.logger.warn(`Using the iOS project root for the ${vi.default.strong("public")} directory is deprecated.
184
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function qoe(t){var e;let r=(0,ie.resolve)(t,ot.CONFIG_FILE_NAME_TS);if(await(0,tr.pathExists)(r))return Loe(t,ot.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,ot.CONFIG_FILE_NAME_JS);if(await(0,tr.pathExists)(n))return Boe(t,ot.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,ot.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:ot.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Nv.tryFn)(tr.readJSON,i))!==null&&e!==void 0?e:{}}}async function Moe(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,tr.readJSON)((0,ie.resolve)(t,"package.json")),os:zoe(process.platform)}}async function Uoe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,m,b,g,w,x,D;let C="android",k=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,k),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,Roe.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",_=(0,ua.lazy)(()=>Koe(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=(m=e.android)===null||m===void 0?void 0:m.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:k,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 Voe(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),m=`${l}/App.xcodeproj`,b=(0,ie.resolve)(u,m),g=(0,ua.lazy)(()=>Goe(f)),w=(0,ua.lazy)(()=>Yoe(t,u,f)),x=(0,ua.lazy)(()=>Woe(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:m,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,ua.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,ua.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function Hoe(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function zoe(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function Goe(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function Woe(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,tr.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return u6.logger.warn(`Using the iOS project root for the ${vi.default.strong("public")} directory is deprecated.
185
185
  Please follow the Upgrade Guide to move ${vi.default.strong("public")} inside the iOS target directory: ${vi.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 Koe(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(()=>Lv.__importStar(fh())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,tr.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 Yoe(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,tr.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,tr.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,tr.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,Ioe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,tr.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function Joe(t){return`import type { CapacitorConfig } from '@capacitor/cli';
186
186
 
187
187
  const config: CapacitorConfig = ${(0,$oe.formatJSObject)(t)};
188
188
 
189
189
  export default config;
190
- `}function Xoe(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 ${vi.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}ot.checkExternalConfig=Xoe});function Zoe(){try{return qv.default.statSync("/.dockerenv"),!0}catch{return!1}}function Qoe(){try{return qv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Mv(){return Bv===void 0&&(Bv=Zoe()||Qoe()),Bv}var qv,Bv,d6=lt(()=>{qv=le(require("node:fs"),1)});function ua(){return Uv===void 0&&(Uv=ese()||Mv()),Uv}var h6,Uv,ese,Vv=lt(()=>{h6=le(require("node:fs"),1);d6();ese=()=>{try{return h6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Hv,m6,g6,p6,Pc,y6=lt(()=>{Hv=le(require("node:process"),1),m6=le(require("node:os"),1),g6=le(require("node:fs"),1);Vv();p6=()=>{if(Hv.default.platform!=="linux")return!1;if(m6.default.release().toLowerCase().includes("microsoft"))return!ua();try{return g6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ua():!1}catch{return!1}},Pc=Hv.default.env.__IS_WSL_TEST__?p6:p6()});function vo(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=lt(()=>{});async function zv(){if(b6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await tse("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,tse,_6=lt(()=>{v6=require("node:util"),b6=le(require("node:process"),1),w6=require("node:child_process"),tse=(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 rse("osascript",["-e",t,r]);return n.trim()}var E6,C6,Gv,rse,x6=lt(()=>{E6=le(require("node:process"),1),C6=require("node:util"),Gv=require("node:child_process"),rse=(0,C6.promisify)(Gv.execFile)});async function Wv(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=lt(()=>{x6()});async function Kv(t=nse){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 Oh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=ise[n];if(!i)throw new Oh(`Unknown browser ID: ${n}`);return i}var O6,A6,nse,ise,Oh,k6=lt(()=>{O6=require("node:util"),A6=require("node:child_process"),nse=(0,O6.promisify)(A6.execFile),ise={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"}},Oh=class extends Error{}});async function Yv(){if(Ah.default.platform==="darwin"){let t=await zv();return{name:await Wv(t),id:t}}if(Ah.default.platform==="linux"){let{stdout:t}=await ose("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:sse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Ah.default.platform==="win32")return Kv();throw new Error("Only macOS, Linux, and Windows are supported")}var T6,Ah,P6,ose,sse,R6=lt(()=>{T6=require("node:util"),Ah=le(require("node:process"),1),P6=require("node:child_process");_6();F6();k6();ose=(0,T6.promisify)(P6.execFile),sse=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var M6={};gn(M6,{apps:()=>wo,default:()=>lse,openApp:()=>cse});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 Zv({[ca]:t},{wsl:e}){if(e&&Pc)return N6(e);if(!t)throw new Error(`${ca} is not supported`);return N6(t)}var Rc,L6,Xv,B6,q6,bo,fse,Jv,$6,ca,I6,ase,j6,$c,use,cse,wo,lse,U6=lt(()=>{Rc=le(require("node:process"),1),L6=require("node:buffer"),Xv=le(require("node:path"),1),B6=require("node:url"),q6=le(require("node:child_process"),1),bo=le(require("node:fs/promises"),1);y6();D6();R6();Vv();fse={},Jv=Xv.default.dirname((0,B6.fileURLToPath)(fse.url)),$6=Xv.default.join(Jv,"xdg-open"),{platform:ca,arch:I6}=Rc.default,ase=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await bo.default.access(r,bo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await bo.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},$c=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return j6(t.app,a=>$c({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return j6(e,a=>$c({...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 Yv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),$c({...t,app:{name:wo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(ca==="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(ca==="win32"||Pc&&!ua()&&!e){let a=await ase();n=Pc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Rc.default.env.SYSTEMROOT||Rc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Pc||(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=!Jv||Jv==="/",u=!1;try{await bo.default.access($6,bo.constants.X_OK),u=!0}catch{}n=Rc.default.versions.electron??(ca==="android"||a||!u)?"xdg-open":$6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ca==="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)},use=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return $c({...e,target:t})},cse=(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 $c({...e,app:{name:t,arguments:r}})};wo={};vo(wo,"chrome",()=>Zv({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"]}}));vo(wo,"firefox",()=>Zv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));vo(wo,"edge",()=>Zv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));vo(wo,"browser",()=>"browser");vo(wo,"browserPrivate",()=>"browserPrivate");lse=use});var gj=y(Eo=>{Eo.parse=Eo.decode=Ese;Eo.stringify=Eo.encode=hj;Eo.safe=Da;Eo.unsafe=Ih;var ab=typeof process<"u"&&process.platform==="win32"?`\r
190
+ `}function Xoe(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 ${vi.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}ot.checkExternalConfig=Xoe});function Zoe(){try{return qv.default.statSync("/.dockerenv"),!0}catch{return!1}}function Qoe(){try{return qv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Mv(){return Bv===void 0&&(Bv=Zoe()||Qoe()),Bv}var qv,Bv,d6=lt(()=>{qv=le(require("node:fs"),1)});function ca(){return Uv===void 0&&(Uv=ese()||Mv()),Uv}var h6,Uv,ese,Vv=lt(()=>{h6=le(require("node:fs"),1);d6();ese=()=>{try{return h6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Hv,m6,g6,p6,Pc,y6=lt(()=>{Hv=le(require("node:process"),1),m6=le(require("node:os"),1),g6=le(require("node:fs"),1);Vv();p6=()=>{if(Hv.default.platform!=="linux")return!1;if(m6.default.release().toLowerCase().includes("microsoft"))return!ca();try{return g6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ca():!1}catch{return!1}},Pc=Hv.default.env.__IS_WSL_TEST__?p6:p6()});function vo(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=lt(()=>{});async function zv(){if(b6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await tse("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,tse,_6=lt(()=>{v6=require("node:util"),b6=le(require("node:process"),1),w6=require("node:child_process"),tse=(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 rse("osascript",["-e",t,r]);return n.trim()}var E6,C6,Gv,rse,x6=lt(()=>{E6=le(require("node:process"),1),C6=require("node:util"),Gv=require("node:child_process"),rse=(0,C6.promisify)(Gv.execFile)});async function Wv(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=lt(()=>{x6()});async function Kv(t=nse){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 Oh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=ise[n];if(!i)throw new Oh(`Unknown browser ID: ${n}`);return i}var O6,A6,nse,ise,Oh,k6=lt(()=>{O6=require("node:util"),A6=require("node:child_process"),nse=(0,O6.promisify)(A6.execFile),ise={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"}},Oh=class extends Error{}});async function Yv(){if(Ah.default.platform==="darwin"){let t=await zv();return{name:await Wv(t),id:t}}if(Ah.default.platform==="linux"){let{stdout:t}=await ose("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:sse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Ah.default.platform==="win32")return Kv();throw new Error("Only macOS, Linux, and Windows are supported")}var T6,Ah,P6,ose,sse,R6=lt(()=>{T6=require("node:util"),Ah=le(require("node:process"),1),P6=require("node:child_process");_6();F6();k6();ose=(0,T6.promisify)(P6.execFile),sse=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var M6={};gn(M6,{apps:()=>wo,default:()=>lse,openApp:()=>cse});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 Zv({[la]:t},{wsl:e}){if(e&&Pc)return N6(e);if(!t)throw new Error(`${la} is not supported`);return N6(t)}var Rc,L6,Xv,B6,q6,bo,fse,Jv,$6,la,I6,ase,j6,$c,use,cse,wo,lse,U6=lt(()=>{Rc=le(require("node:process"),1),L6=require("node:buffer"),Xv=le(require("node:path"),1),B6=require("node:url"),q6=le(require("node:child_process"),1),bo=le(require("node:fs/promises"),1);y6();D6();R6();Vv();fse={},Jv=Xv.default.dirname((0,B6.fileURLToPath)(fse.url)),$6=Xv.default.join(Jv,"xdg-open"),{platform:la,arch:I6}=Rc.default,ase=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await bo.default.access(r,bo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await bo.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},$c=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return j6(t.app,a=>$c({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return j6(e,a=>$c({...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 Yv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),$c({...t,app:{name:wo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(la==="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(la==="win32"||Pc&&!ca()&&!e){let a=await ase();n=Pc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Rc.default.env.SYSTEMROOT||Rc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Pc||(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=!Jv||Jv==="/",u=!1;try{await bo.default.access($6,bo.constants.X_OK),u=!0}catch{}n=Rc.default.versions.electron??(la==="android"||a||!u)?"xdg-open":$6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}la==="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)},use=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return $c({...e,target:t})},cse=(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 $c({...e,app:{name:t,arguments:r}})};wo={};vo(wo,"chrome",()=>Zv({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"]}}));vo(wo,"firefox",()=>Zv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));vo(wo,"edge",()=>Zv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));vo(wo,"browser",()=>"browser");vo(wo,"browserPrivate",()=>"browserPrivate");lse=use});var gj=y(Co=>{Co.parse=Co.decode=Ese;Co.stringify=Co.encode=hj;Co.safe=Da;Co.unsafe=Ih;var ab=typeof process<"u"&&process.platform==="win32"?`\r
192
192
  `:`
193
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+=Da(o+"[]")+i+Da(c)+`
194
194
  `}):u&&typeof u=="object"?r.push(o):n+=Da(o)+i+Da(u)+ab}),e.section&&n.length&&(n="["+Da(e.section)+"]"+ab+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+=ab),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 Ese(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=Ih(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Ih(c[2]);if(l!=="__proto__"){var f=c[3]?Ih(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,m,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 Da(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 Ih(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((Kge,Dj)=>{"use strict";var ub=1,yj=2;function Cse(){return""}function Sse(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?Cse:Sse,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=ub,c++;else if(o===ub&&r+n===`\r
195
195
  `){c++,o=!1,a+=u(t,s,c),s=c;continue}else if(o===ub&&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(va=>{"use strict";var bj=require("fs"),xse=gj(),jc=require("path"),Fse=vj(),Ose=va.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Fse(t)):xse.parse(t)},Ase=va.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=jc.join.apply(null,t),n;try{return bj.readFileSync(r,"utf-8")}catch{return}},Yge=va.json=function(){var t=Ase.apply(null,arguments);return t?Ose(t):null},Jge=va.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},Xge=va.find=function(){var t=jc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=jc.join(r,n);try{return bj.statSync(i),i}catch{if(jc.dirname(r)!==r)return e(jc.dirname(r),n)}}return e(process.cwd(),t)}});var Fj=y((Qge,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]=cb({},r):e[n]=r}),e}function _j(t,e){return e==="__proto__"?void 0:t[e]}var cb=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]=cb({},r);return}else{t[s]=cb(n,r);return}})}),t}});var Tj=y((eye,kj)=>{"use strict";function kse(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(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[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=k[k.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,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Oj(k)?Number(k):k;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,m;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],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,m,h),f+=1):/^(true|false)$/.test(m)?(c(d,m==="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(m=h.slice(D+2),m==="-"){c(w[D],m,h);continue}if(/[A-Za-z]/.test(w[D])&&m[0]==="="){c(w[D],m.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){c(w[D],m,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){kse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var Ij=y((tye,$j)=>{var Nc=wj(),ba=require("path").join,Tse=Fj(),Pj="/etc",Rj=process.platform==="win32",Lc=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"?Nc.json(e):e)||{},n=n||Nc.parse;var i=Nc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=Nc.file(u);c&&(o.push(n(c)),s.push(u))}}return Rj||[ba(Pj,t,"config"),ba(Pj,t+"rc")].forEach(a),Lc&&[ba(Lc,".config",t,"config"),ba(Lc,".config",t),ba(Lc,"."+t,"config"),ba(Lc,"."+t+"rc")].forEach(a),a(Nc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Tse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Lj=y((nye,Nj)=>{var wi=require("constants"),Pse=process.cwd,jh=null,Rse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return jh||(jh=Pse.call(process)),jh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(fb=process.chdir,process.chdir=function(t){jh=null,fb.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,fb));var fb;Nj.exports=$se;function $se(t){wi.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(){}),Rse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,m){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):m(x)})},g),g<100&&(g+=10);return}m&&m(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,m,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,m,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,m,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,m,b){for(var g=0;;)try{return l.call(t,f,h,d,m,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,wi.O_WRONLY|wi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);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,wi.O_WRONLY|wi.O_SYMLINK,h),m=!0,b;try{b=l.fchmodSync(d,h),m=!1}finally{if(m)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){wi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,m){l.open(f,wi.O_SYMLINK,function(b,g){if(b){m&&m(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){m&&m(w||x)})})})},l.lutimesSync=function(f,h,d){var m=l.openSync(f,wi.O_SYMLINK),b,g=!0;try{b=l.futimesSync(m,h,d),g=!1}finally{if(g)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,h,d,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(m){c(m)&&(m=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,m){return l.call(t,f,h,d,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(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,m):l.call(t,f,m)}}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((iye,qj)=>{var Bj=require("stream").Stream;qj.exports=Ise;function Ise(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((oye,Uj)=>{"use strict";Uj.exports=Nse;var jse=Object.getPrototypeOf||function(t){return t.__proto__};function Nse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:jse(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((sye,pb)=>{var Ke=require("fs"),Lse=Lj(),Bse=Mj(),qse=Vj(),Nh=require("util"),Ct,Bh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Ct=Symbol.for("graceful-fs.queue"),Bh=Symbol.for("graceful-fs.previous")):(Ct="___graceful-fs.queue",Bh="___graceful-fs.previous");function Mse(){}function Gj(t,e){Object.defineProperty(t,Ct,{get:function(){return e}})}var Co=Mse;Nh.debuglog?Co=Nh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Co=function(){var t=Nh.format.apply(Nh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
- GFS4: `),console.error(t)});Ke[Ct]||(Hj=global[Ct]||[],Gj(Ke,Hj),Ke.close=function(t){function e(r,n){return t.call(Ke,r,function(i){i||zj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Bh,{value:t}),e}(Ke.close),Ke.closeSync=function(t){function e(r){t.apply(Ke,arguments),zj()}return Object.defineProperty(e,Bh,{value:t}),e}(Ke.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Co(Ke[Ct]),require("assert").equal(Ke[Ct].length,0)}));var Hj;global[Ct]||Gj(global,Ke[Ct]);pb.exports=db(qse(Ke));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ke.__patched&&(pb.exports=db(Ke),Ke.__patched=!0);function db(t){Lse(t),t.gracefulify=db,t.createReadStream=k,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")?wa([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")?wa([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")?wa([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")?wa([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")?wa([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=Bse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.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?(m.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 k(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")?wa([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function wa(t){Co("ENQUEUE",t[0].name,t[1]),Ke[Ct].push(t),hb()}var Lh;function zj(){for(var t=Date.now(),e=0;e<Ke[Ct].length;++e)Ke[Ct][e].length>2&&(Ke[Ct][e][3]=t,Ke[Ct][e][4]=t);hb()}function hb(){if(clearTimeout(Lh),Lh=void 0,Ke[Ct].length!==0){var t=Ke[Ct].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Co("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Co("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?(Co("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ke[Ct].push(t)}Lh===void 0&&(Lh=setTimeout(hb,0))}}});var Kj=y(_a=>{"use strict";var Use=_a&&_a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_a,"__esModule",{value:!0});_a.readCAFileSync=void 0;var Vse=Use(Wj());function Hse(t){try{let e=Vse.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}}_a.readCAFileSync=Hse});var Yj=y(So=>{"use strict";var zse=So&&So.__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]}),Gse=So&&So.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zse(e,t,r)};Object.defineProperty(So,"__esModule",{value:!0});Gse(Kj(),So)});var Zj=y((cye,Xj)=>{Xj.exports=Jj;function xo(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&&xo(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&&xo(this.list[this.list.length-1],t),xo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&xo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return xo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&xo(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++)xo(this.list[e],this.list[e+1]||this.root);return t}}});var r8=y(Fo=>{Fo.parse=Fo.decode=Wse;Fo.stringify=Fo.encode=Qj;Fo.safe=Ea;Fo.unsafe=qh;var mb=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=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(va=>{"use strict";var bj=require("fs"),xse=gj(),jc=require("path"),Fse=vj(),Ose=va.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Fse(t)):xse.parse(t)},Ase=va.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=jc.join.apply(null,t),n;try{return bj.readFileSync(r,"utf-8")}catch{return}},Yge=va.json=function(){var t=Ase.apply(null,arguments);return t?Ose(t):null},Jge=va.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},Xge=va.find=function(){var t=jc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=jc.join(r,n);try{return bj.statSync(i),i}catch{if(jc.dirname(r)!==r)return e(jc.dirname(r),n)}}return e(process.cwd(),t)}});var Fj=y((Qge,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]=cb({},r):e[n]=r}),e}function _j(t,e){return e==="__proto__"?void 0:t[e]}var cb=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]=cb({},r);return}else{t[s]=cb(n,r);return}})}),t}});var Tj=y((eye,kj)=>{"use strict";function kse(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(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[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=k[k.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,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Oj(k)?Number(k):k;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,m;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],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,m,h),f+=1):/^(true|false)$/.test(m)?(c(d,m==="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(m=h.slice(D+2),m==="-"){c(w[D],m,h);continue}if(/[A-Za-z]/.test(w[D])&&m[0]==="="){c(w[D],m.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){c(w[D],m,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){kse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var Ij=y((tye,$j)=>{var Nc=wj(),ba=require("path").join,Tse=Fj(),Pj="/etc",Rj=process.platform==="win32",Lc=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"?Nc.json(e):e)||{},n=n||Nc.parse;var i=Nc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=Nc.file(u);c&&(o.push(n(c)),s.push(u))}}return Rj||[ba(Pj,t,"config"),ba(Pj,t+"rc")].forEach(a),Lc&&[ba(Lc,".config",t,"config"),ba(Lc,".config",t),ba(Lc,"."+t,"config"),ba(Lc,"."+t+"rc")].forEach(a),a(Nc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Tse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Lj=y((nye,Nj)=>{var wi=require("constants"),Pse=process.cwd,jh=null,Rse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return jh||(jh=Pse.call(process)),jh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(fb=process.chdir,process.chdir=function(t){jh=null,fb.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,fb));var fb;Nj.exports=$se;function $se(t){wi.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(){}),Rse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,m){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):m(x)})},g),g<100&&(g+=10);return}m&&m(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,m,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,m,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,m,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,m,b){for(var g=0;;)try{return l.call(t,f,h,d,m,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,wi.O_WRONLY|wi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);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,wi.O_WRONLY|wi.O_SYMLINK,h),m=!0,b;try{b=l.fchmodSync(d,h),m=!1}finally{if(m)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){wi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,m){l.open(f,wi.O_SYMLINK,function(b,g){if(b){m&&m(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){m&&m(w||x)})})})},l.lutimesSync=function(f,h,d){var m=l.openSync(f,wi.O_SYMLINK),b,g=!0;try{b=l.futimesSync(m,h,d),g=!1}finally{if(g)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,h,d,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(m){c(m)&&(m=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,m){return l.call(t,f,h,d,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(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,m):l.call(t,f,m)}}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((iye,qj)=>{var Bj=require("stream").Stream;qj.exports=Ise;function Ise(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((oye,Uj)=>{"use strict";Uj.exports=Nse;var jse=Object.getPrototypeOf||function(t){return t.__proto__};function Nse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:jse(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((sye,pb)=>{var Ke=require("fs"),Lse=Lj(),Bse=Mj(),qse=Vj(),Nh=require("util"),Ct,Bh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Ct=Symbol.for("graceful-fs.queue"),Bh=Symbol.for("graceful-fs.previous")):(Ct="___graceful-fs.queue",Bh="___graceful-fs.previous");function Mse(){}function Gj(t,e){Object.defineProperty(t,Ct,{get:function(){return e}})}var So=Mse;Nh.debuglog?So=Nh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(So=function(){var t=Nh.format.apply(Nh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
+ GFS4: `),console.error(t)});Ke[Ct]||(Hj=global[Ct]||[],Gj(Ke,Hj),Ke.close=function(t){function e(r,n){return t.call(Ke,r,function(i){i||zj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Bh,{value:t}),e}(Ke.close),Ke.closeSync=function(t){function e(r){t.apply(Ke,arguments),zj()}return Object.defineProperty(e,Bh,{value:t}),e}(Ke.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){So(Ke[Ct]),require("assert").equal(Ke[Ct].length,0)}));var Hj;global[Ct]||Gj(global,Ke[Ct]);pb.exports=db(qse(Ke));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ke.__patched&&(pb.exports=db(Ke),Ke.__patched=!0);function db(t){Lse(t),t.gracefulify=db,t.createReadStream=k,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")?wa([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")?wa([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")?wa([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")?wa([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")?wa([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=Bse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.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?(m.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 k(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")?wa([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function wa(t){So("ENQUEUE",t[0].name,t[1]),Ke[Ct].push(t),hb()}var Lh;function zj(){for(var t=Date.now(),e=0;e<Ke[Ct].length;++e)Ke[Ct][e].length>2&&(Ke[Ct][e][3]=t,Ke[Ct][e][4]=t);hb()}function hb(){if(clearTimeout(Lh),Lh=void 0,Ke[Ct].length!==0){var t=Ke[Ct].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)So("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){So("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?(So("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ke[Ct].push(t)}Lh===void 0&&(Lh=setTimeout(hb,0))}}});var Kj=y(_a=>{"use strict";var Use=_a&&_a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_a,"__esModule",{value:!0});_a.readCAFileSync=void 0;var Vse=Use(Wj());function Hse(t){try{let e=Vse.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}}_a.readCAFileSync=Hse});var Yj=y(xo=>{"use strict";var zse=xo&&xo.__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]}),Gse=xo&&xo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zse(e,t,r)};Object.defineProperty(xo,"__esModule",{value:!0});Gse(Kj(),xo)});var Zj=y((cye,Xj)=>{Xj.exports=Jj;function Fo(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&&Fo(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&&Fo(this.list[this.list.length-1],t),Fo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&Fo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return Fo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&Fo(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++)Fo(this.list[e],this.list[e+1]||this.root);return t}}});var r8=y(Oo=>{Oo.parse=Oo.decode=Wse;Oo.stringify=Oo.encode=Qj;Oo.safe=Ea;Oo.unsafe=qh;var mb=typeof process<"u"&&process.platform==="win32"?`\r
198
198
  `:`
199
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+=Ea(o+"[]")+i+Ea(c)+`
200
- `}):u&&typeof u=="object"?r.push(o):n+=Ea(o)+i+Ea(u)+mb}),e.section&&n.length&&(n="["+Ea(e.section)+"]"+mb+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+=mb),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 Wse(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=qh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=qh(c[2]);if(l!=="__proto__"){var f=c[3]?qh(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,m,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 Ea(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 qh(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((Ln,o8)=>{var n8=Zj(),Bc=require("path"),Mh=require("fs"),gb=r8(),yb=require("events").EventEmitter,Kse=require("url"),Yse=require("http"),Ln=o8.exports=function(){for(var t=[].slice.call(arguments),e=new At;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Xse(r):r)}return e},fye=Ln.find=function(){var t=Bc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Bc.join(r,n);try{return Mh.statSync(i),i}catch{if(Bc.dirname(r)!==r)return e(Bc.dirname(r),n)}}return e(__dirname,t)},Jse=Ln.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 gb.parse(t);else try{return JSON.parse(t)}catch{return gb.parse(t)}},Xse=Ln.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Bc.join.apply(null,t),r;try{r=Mh.readFileSync(e,"utf-8")}catch{return}return Jse(r,e,"json")},dye=Ln.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};Ln.ConfigChain=At;function At(){yb.apply(this),n8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var i8={constructor:{value:At}};Object.keys(yb.prototype).forEach(function(t){i8[t]=Object.getOwnPropertyDescriptor(yb.prototype,t)});At.prototype=Object.create(n8.prototype,i8);At.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};At.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};At.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]};At.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=gb.stringify(s),this._saving++,Mh.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};At.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(),Mh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};At.prototype.addEnv=function(t,e,r){r=r||"env";var n=Ln.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};At.prototype.addUrl=function(t,e,r){this._await();var n=Kse.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Yse.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};At.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};At.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};At.prototype.parse=Ln.parse;At.prototype._await=function(){this._awaiting++};At.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var u8=y((hye,a8)=>{a8.exports=function(t){let e=t.indexOf(":");if(e===-1)return Db(t);let r=t.substr(0,e),n=t.substr(e+1);return`${Db(r)}:${Db(n)}`};function Db(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(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var Zse=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function Qse(t,e){return t.replace(Zse,eae.bind(null,e))}Uh.envReplace=Qse;function eae(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=rae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var tae=/([^:-]+)(:?)-(.+)/;function rae(t,e){let r=e.match(tae);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(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.envReplace=void 0;var nae=c8();Object.defineProperty(Vh,"envReplace",{enumerable:!0,get:function(){return nae.envReplace}})});var d8=y(Hh=>{"use strict";var iae=require("fs"),Oo=require("path"),{envReplace:f8}=l8(),oae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Oo)!==-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=Oo.resolve(process.env.HOME,e.substr(2))),e=Oo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},sae=t=>{t=Oo.resolve(t);let e=!1;for(;Oo.basename(t)==="node_modules";)t=Oo.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=iae.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=Oo.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)};Hh.envReplace=f8;Hh.findPrefix=sae;Hh.parseField=oae});var m8=y(p8=>{"use strict";var Ao=require("path"),aae=require("stream").Stream,zh=require("url"),uae=()=>{},cae=()=>[],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:Ao,cache:Ao,"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:Ao,"global-style":Boolean,group:[Number,String],"https-proxy":[null,zh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Ao,"init-author-name":String,"init-author-email":String,"init-author-url":["",zh],"init-license":String,"init-version":h8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":cae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:aae,"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:Ao,production:Boolean,progress:Boolean,proxy:[null,!1,zh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,zh],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:Ao,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Ao,umask:uae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var v8=y((Dye,D8)=>{"use strict";var{readCAFileSync:lae}=Yj(),g8=require("fs"),vb=require("path"),{ConfigChain:fae}=s8(),dae=u8(),y8=d8(),bb=class extends fae{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[dae(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:()=>vb.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=vb.resolve(e.prefix);else try{r=y8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=lae(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=vb.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=bb});var S8=y(C8=>{"use strict";var _8=require("os"),Bn=require("path"),E8=_8.tmpdir(),hae=process.getuid?process.getuid():process.pid,pae=()=>!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"},mae={fromString:()=>process.umask()},Ca=_8.homedir();Ca?process.env.HOME=Ca:Ca=Bn.resolve(E8,"npm-"+hae);var gae=process.platform==="win32"?"npm-cache":".npm",yae=process.platform==="win32"&&process.env.APPDATA||Ca,Dae=Bn.resolve(yae,gae),Gh,ko;Object.defineProperty(C8,"defaults",{get:function(){return Gh||(process.env.PREFIX?ko=process.env.PREFIX:process.platform==="win32"?ko=Bn.dirname(process.execPath):(ko=Bn.dirname(Bn.dirname(process.execPath)),process.env.DESTDIR&&(ko=Bn.join(process.env.DESTDIR,ko))),Gh={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:Dae,"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:Bn.resolve(ko,"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":Bn.resolve(Ca,".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:ko,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:pae(),"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:Bn.resolve(Ca,".npmrc"),umask:process.umask?process.umask():mae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Gh)}})});var F8=y((bye,wb)=>{"use strict";var To=require("path"),vae=v8(),x8=S8();wb.exports=(t,e,r)=>{let n=new vae(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(To.resolve(To.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=To.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=To.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=To.resolve(n.get("prefix"),"etc");n.root.globalconfig=To.resolve(c,"npmrc"),n.root.globalignorefile=To.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(wb.exports,"defaults",{get(){return x8.defaults},enumerable:!0})});var I8=y((wye,$8)=>{var _b=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)||bae(r.npmrc)};function R8(t,e){let r=_b.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=_ae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:R8(_b.resolve(t,"."),e);r.pathname=_b.resolve(wae(n),"..")||"/"}}function bae(t){return t.get("_auth")?{token:Wh(t.get("_auth")),type:"Basic"}:void 0}function wae(t){return t[t.length-1]==="/"?t:t+"/"}function _ae(t,e){let r=Eae(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=Cae(n,i);if(o)return o;let s=Sae(e.get(t+k8)||e.get(t+"/"+k8));if(s)return s}function Wh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Eae(t){return t?{token:Wh(t),type:"Bearer"}:void 0}function Cae(t,e){if(!t||!e)return;let r=Buffer.from(Wh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Sae(t){return t?{token:Wh(t),type:"Basic"}:void 0}});var jL=y((xwe,Hn)=>{var at=require("fs"),Zb=require("os"),hr=require("path"),wL=require("crypto"),fn={fs:at.constants,os:Zb.constants},_L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",CL=/XXXXXX/,lue=3,SL=(fn.O_CREAT||fn.fs.O_CREAT)|(fn.O_EXCL||fn.fs.O_EXCL)|(fn.O_RDWR||fn.fs.O_RDWR),fue=Zb.platform()==="win32",due=fn.EBADF||fn.os.errno.EBADF,hue=fn.ENOENT||fn.os.errno.ENOENT,xL=448,FL=384,pue="exit",Ra=[],OL=at.rmdirSync.bind(at),AL=!1;function mue(t,e){return at.rm(t,{recursive:!0},e)}function kL(t){return at.rmSync(t,{recursive:!0})}function Qb(t,e){let r=$a(t,e),n=r[0],i=r[1];try{RL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=PL(n);at.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 ew(t){let e=$a(t),r=e[0];RL(r);let n=r.tries;do{let i=PL(r);try{at.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function gue(t,e){let r=$a(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);at.open(a,SL,n.mode||FL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return at.close(l,function(h){return i(h,a,void 0,Yb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Yb(a,f?-1:l,n,!1))}})})}function yue(t){let e=$a(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=ew(r);var o=at.openSync(i,SL,r.mode||FL);return r.discardDescriptor&&(at.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Yb(i,n?-1:o,r,!0)}}function Due(t,e){let r=$a(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);at.mkdir(a,n.mode||xL,function(c){if(c)return i(c);i(null,a,TL(a,n,!1))})})}function vue(t){let e=$a(t),r=e[0],n=ew(r);return at.mkdirSync(n,r.mode||xL),{name:n,removeCallback:TL(n,r,!0)}}function bue(t,e){let r=function(n){if(n&&!Xb(n))return e(n);e()};0<=t[0]?at.close(t[0],function(){at.unlink(t[1],r)}):at.unlink(t[1],r)}function wue(t){let e=null;try{0<=t[0]&&at.closeSync(t[0])}catch(r){if(!Cue(r)&&!Xb(r))throw r}finally{try{at.unlinkSync(t[1])}catch(r){Xb(r)||(e=r)}}if(e!==null)throw e}function Yb(t,e,r,n){let i=gp(wue,[e,t],n),o=gp(bue,[e,t],n,i);return r.keep||Ra.unshift(i),n?i:o}function TL(t,e,r){let n=e.unsafeCleanup?mue:at.rmdir.bind(at),i=e.unsafeCleanup?kL:OL,o=gp(i,t,r),s=gp(n,t,r,o);return e.keep||Ra.unshift(o),r?o:s}function gp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Ra.indexOf(a);return u>=0&&Ra.splice(u,1),i=!0,r||t===OL||t===kL?t(e):t(e,s||function(){})}}}function _ue(){if(AL)for(;Ra.length;)try{Ra[0]()}catch{}}function EL(t){let e=[],r=null;try{r=wL.randomBytes(t)}catch{r=wL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(_L[r[n]%_L.length]);return e.join("")}function Eue(t){return t===null||nr(t)||!t.trim()}function nr(t){return typeof t>"u"}function $a(t,e){if(typeof t=="function")return[{},t];if(nr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function PL(t){let e=t.tmpdir;if(!nr(t.name))return hr.join(e,t.dir,t.name);if(!nr(t.template))return hr.join(e,t.dir,t.template).replace(CL,EL(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",EL(12),t.postfix?"-"+t.postfix:""].join("");return hr.join(e,t.dir,r)}function RL(t){t.tmpdir=IL(t);let e=t.tmpdir;if(nr(t.name)||Kb(t.name,"name",e),nr(t.dir)||Kb(t.dir,"dir",e),!nr(t.template)&&(Kb(t.template,"template",e),!t.template.match(CL)))throw new Error(`Invalid template, found "${t.template}".`);if(!nr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=nr(t.name)?t.tries||lue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=nr(t.dir)?"":hr.relative(e,Jb(t.dir,e)),t.template=nr(t.template)?void 0:hr.relative(e,Jb(t.template,e)),t.template=Eue(t.template)?void 0:hr.relative(t.dir,t.template),t.name=nr(t.name)?void 0:t.name,t.prefix=nr(t.prefix)?"":t.prefix,t.postfix=nr(t.postfix)?"":t.postfix}function Jb(t,e){return t.startsWith(e)?hr.resolve(t):hr.resolve(hr.join(e,t))}function Kb(t,e,r){if(e==="name"){if(hr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=hr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(hr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Jb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Cue(t){return $L(t,-due,"EBADF")}function Xb(t){return $L(t,-hue,"ENOENT")}function $L(t,e,r){return fue?t.code===r:t.code===r&&t.errno===e}function Sue(){AL=!0}function IL(t){return hr.resolve(t&&t.tmpdir||Zb.tmpdir())}process.addListener(pue,_ue);Object.defineProperty(Hn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return IL()}});Hn.exports.dir=Due;Hn.exports.dirSync=vue;Hn.exports.file=gue;Hn.exports.fileSync=yue;Hn.exports.tmpName=Qb;Hn.exports.tmpNameSync=ew;Hn.exports.setGracefulCleanup=Sue});var ww=le(bw(),1),{program:A,createCommand:nce,createArgument:ice,createOption:oce,CommanderError:sce,InvalidArgumentError:ace,InvalidOptionArgumentError:uce,Command:cce,Argument:lce,Option:fce,Help:dce}=ww.default;var jr={name:"@capgo/cli",version:"4.25.6",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.8.0","@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.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.12.2","@typescript-eslint/parser":"^8.12.2","@vercel/ncc":"^0.38.2","adm-zip":"^0.5.16","ci-info":"^4.0.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.15.0","git-format-staged":"3.1.1",husky:"^9.1.6","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 Sa=require("node:fs"),L8=require("node:process");var Tt=le(Te(),1),No=require("node:process"),Wn=le(require("node:readline"),1),Mp=le(require("node:readline"),1),Rw=require("node:tty"),al=le(Sw(),1);function CB({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 $w(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(CB(),"")}var Up={},SB={get exports(){return Up},set exports(t){Up=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}})(SB);var xB=Up,FB=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 La(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=$w(t),t.length===0))return 0;t=t.replace(FB()," ");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(xB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Bp=10,xw=(t=0)=>e=>`\x1B[${e+t}m`,Fw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ow=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,je={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(je.modifier);var OB=Object.keys(je.color),AB=Object.keys(je.bgColor);[...OB,...AB];function kB(){let t=new Map;for(let[e,r]of Object.entries(je)){for(let[n,i]of Object.entries(r))je[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=je[n],t.set(i[0],i[1]);Object.defineProperty(je,e,{value:r,enumerable:!1})}return Object.defineProperty(je,"codes",{value:t,enumerable:!1}),je.color.close="\x1B[39m",je.bgColor.close="\x1B[49m",je.color.ansi=xw(),je.color.ansi256=Fw(),je.color.ansi16m=Ow(),je.bgColor.ansi=xw(Bp),je.bgColor.ansi256=Fw(Bp),je.bgColor.ansi16m=Ow(Bp),Object.defineProperties(je,{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=>je.rgbToAnsi256(...je.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)=>je.ansi256ToAnsi(je.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>je.ansi256ToAnsi(je.hexToAnsi256(e)),enumerable:!1}}),je}var TB=kB(),fl=new Set(["\x1B","\x9B"]),PB=39,Vp="\x07",Iw="[",RB="]",jw="m",Hp=`${RB}8;;`,Aw=t=>`${fl.values().next().value}${Iw}${t}${jw}`,kw=t=>`${fl.values().next().value}${Hp}${t}${Vp}`,$B=t=>t.split(" ").map(e=>La(e)),qp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=La($w(t[t.length-1]));for(let[a,u]of n.entries()){let c=La(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),fl.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Hp)),i){o?u===Vp&&(i=!1,o=!1):u===jw&&(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())},IB=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(La(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},jB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=$B(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=La(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(""),qp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){qp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){qp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>IB(c)));let u=[...a.join(`
200
+ `}):u&&typeof u=="object"?r.push(o):n+=Ea(o)+i+Ea(u)+mb}),e.section&&n.length&&(n="["+Ea(e.section)+"]"+mb+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+=mb),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 Wse(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=qh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=qh(c[2]);if(l!=="__proto__"){var f=c[3]?qh(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,m,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 Ea(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 qh(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((Ln,o8)=>{var n8=Zj(),Bc=require("path"),Mh=require("fs"),gb=r8(),yb=require("events").EventEmitter,Kse=require("url"),Yse=require("http"),Ln=o8.exports=function(){for(var t=[].slice.call(arguments),e=new At;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Xse(r):r)}return e},fye=Ln.find=function(){var t=Bc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Bc.join(r,n);try{return Mh.statSync(i),i}catch{if(Bc.dirname(r)!==r)return e(Bc.dirname(r),n)}}return e(__dirname,t)},Jse=Ln.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 gb.parse(t);else try{return JSON.parse(t)}catch{return gb.parse(t)}},Xse=Ln.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Bc.join.apply(null,t),r;try{r=Mh.readFileSync(e,"utf-8")}catch{return}return Jse(r,e,"json")},dye=Ln.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};Ln.ConfigChain=At;function At(){yb.apply(this),n8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var i8={constructor:{value:At}};Object.keys(yb.prototype).forEach(function(t){i8[t]=Object.getOwnPropertyDescriptor(yb.prototype,t)});At.prototype=Object.create(n8.prototype,i8);At.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};At.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};At.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]};At.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=gb.stringify(s),this._saving++,Mh.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};At.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(),Mh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};At.prototype.addEnv=function(t,e,r){r=r||"env";var n=Ln.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};At.prototype.addUrl=function(t,e,r){this._await();var n=Kse.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Yse.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};At.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};At.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};At.prototype.parse=Ln.parse;At.prototype._await=function(){this._awaiting++};At.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var u8=y((hye,a8)=>{a8.exports=function(t){let e=t.indexOf(":");if(e===-1)return Db(t);let r=t.substr(0,e),n=t.substr(e+1);return`${Db(r)}:${Db(n)}`};function Db(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(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var Zse=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function Qse(t,e){return t.replace(Zse,eae.bind(null,e))}Uh.envReplace=Qse;function eae(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=rae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var tae=/([^:-]+)(:?)-(.+)/;function rae(t,e){let r=e.match(tae);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(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.envReplace=void 0;var nae=c8();Object.defineProperty(Vh,"envReplace",{enumerable:!0,get:function(){return nae.envReplace}})});var d8=y(Hh=>{"use strict";var iae=require("fs"),Ao=require("path"),{envReplace:f8}=l8(),oae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Ao)!==-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=Ao.resolve(process.env.HOME,e.substr(2))),e=Ao.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},sae=t=>{t=Ao.resolve(t);let e=!1;for(;Ao.basename(t)==="node_modules";)t=Ao.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=iae.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=Ao.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)};Hh.envReplace=f8;Hh.findPrefix=sae;Hh.parseField=oae});var m8=y(p8=>{"use strict";var ko=require("path"),aae=require("stream").Stream,zh=require("url"),uae=()=>{},cae=()=>[],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:ko,cache:ko,"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:ko,"global-style":Boolean,group:[Number,String],"https-proxy":[null,zh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":ko,"init-author-name":String,"init-author-email":String,"init-author-url":["",zh],"init-license":String,"init-version":h8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":cae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:aae,"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:ko,production:Boolean,progress:Boolean,proxy:[null,!1,zh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,zh],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:ko,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:ko,umask:uae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var v8=y((Dye,D8)=>{"use strict";var{readCAFileSync:lae}=Yj(),g8=require("fs"),vb=require("path"),{ConfigChain:fae}=s8(),dae=u8(),y8=d8(),bb=class extends fae{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[dae(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:()=>vb.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=vb.resolve(e.prefix);else try{r=y8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=lae(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=vb.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=bb});var S8=y(C8=>{"use strict";var _8=require("os"),Bn=require("path"),E8=_8.tmpdir(),hae=process.getuid?process.getuid():process.pid,pae=()=>!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"},mae={fromString:()=>process.umask()},Ca=_8.homedir();Ca?process.env.HOME=Ca:Ca=Bn.resolve(E8,"npm-"+hae);var gae=process.platform==="win32"?"npm-cache":".npm",yae=process.platform==="win32"&&process.env.APPDATA||Ca,Dae=Bn.resolve(yae,gae),Gh,To;Object.defineProperty(C8,"defaults",{get:function(){return Gh||(process.env.PREFIX?To=process.env.PREFIX:process.platform==="win32"?To=Bn.dirname(process.execPath):(To=Bn.dirname(Bn.dirname(process.execPath)),process.env.DESTDIR&&(To=Bn.join(process.env.DESTDIR,To))),Gh={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:Dae,"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:Bn.resolve(To,"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":Bn.resolve(Ca,".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:To,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:pae(),"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:Bn.resolve(Ca,".npmrc"),umask:process.umask?process.umask():mae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Gh)}})});var F8=y((bye,wb)=>{"use strict";var Po=require("path"),vae=v8(),x8=S8();wb.exports=(t,e,r)=>{let n=new vae(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(Po.resolve(Po.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=Po.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=Po.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=Po.resolve(n.get("prefix"),"etc");n.root.globalconfig=Po.resolve(c,"npmrc"),n.root.globalignorefile=Po.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(wb.exports,"defaults",{get(){return x8.defaults},enumerable:!0})});var I8=y((wye,$8)=>{var _b=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)||bae(r.npmrc)};function R8(t,e){let r=_b.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=_ae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:R8(_b.resolve(t,"."),e);r.pathname=_b.resolve(wae(n),"..")||"/"}}function bae(t){return t.get("_auth")?{token:Wh(t.get("_auth")),type:"Basic"}:void 0}function wae(t){return t[t.length-1]==="/"?t:t+"/"}function _ae(t,e){let r=Eae(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=Cae(n,i);if(o)return o;let s=Sae(e.get(t+k8)||e.get(t+"/"+k8));if(s)return s}function Wh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Eae(t){return t?{token:Wh(t),type:"Bearer"}:void 0}function Cae(t,e){if(!t||!e)return;let r=Buffer.from(Wh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Sae(t){return t?{token:Wh(t),type:"Basic"}:void 0}});var jL=y((xwe,Hn)=>{var at=require("fs"),Zb=require("os"),hr=require("path"),wL=require("crypto"),fn={fs:at.constants,os:Zb.constants},_L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",CL=/XXXXXX/,lue=3,SL=(fn.O_CREAT||fn.fs.O_CREAT)|(fn.O_EXCL||fn.fs.O_EXCL)|(fn.O_RDWR||fn.fs.O_RDWR),fue=Zb.platform()==="win32",due=fn.EBADF||fn.os.errno.EBADF,hue=fn.ENOENT||fn.os.errno.ENOENT,xL=448,FL=384,pue="exit",Ra=[],OL=at.rmdirSync.bind(at),AL=!1;function mue(t,e){return at.rm(t,{recursive:!0},e)}function kL(t){return at.rmSync(t,{recursive:!0})}function Qb(t,e){let r=$a(t,e),n=r[0],i=r[1];try{RL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=PL(n);at.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 ew(t){let e=$a(t),r=e[0];RL(r);let n=r.tries;do{let i=PL(r);try{at.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function gue(t,e){let r=$a(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);at.open(a,SL,n.mode||FL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return at.close(l,function(h){return i(h,a,void 0,Yb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Yb(a,f?-1:l,n,!1))}})})}function yue(t){let e=$a(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=ew(r);var o=at.openSync(i,SL,r.mode||FL);return r.discardDescriptor&&(at.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Yb(i,n?-1:o,r,!0)}}function Due(t,e){let r=$a(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);at.mkdir(a,n.mode||xL,function(c){if(c)return i(c);i(null,a,TL(a,n,!1))})})}function vue(t){let e=$a(t),r=e[0],n=ew(r);return at.mkdirSync(n,r.mode||xL),{name:n,removeCallback:TL(n,r,!0)}}function bue(t,e){let r=function(n){if(n&&!Xb(n))return e(n);e()};0<=t[0]?at.close(t[0],function(){at.unlink(t[1],r)}):at.unlink(t[1],r)}function wue(t){let e=null;try{0<=t[0]&&at.closeSync(t[0])}catch(r){if(!Cue(r)&&!Xb(r))throw r}finally{try{at.unlinkSync(t[1])}catch(r){Xb(r)||(e=r)}}if(e!==null)throw e}function Yb(t,e,r,n){let i=gp(wue,[e,t],n),o=gp(bue,[e,t],n,i);return r.keep||Ra.unshift(i),n?i:o}function TL(t,e,r){let n=e.unsafeCleanup?mue:at.rmdir.bind(at),i=e.unsafeCleanup?kL:OL,o=gp(i,t,r),s=gp(n,t,r,o);return e.keep||Ra.unshift(o),r?o:s}function gp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Ra.indexOf(a);return u>=0&&Ra.splice(u,1),i=!0,r||t===OL||t===kL?t(e):t(e,s||function(){})}}}function _ue(){if(AL)for(;Ra.length;)try{Ra[0]()}catch{}}function EL(t){let e=[],r=null;try{r=wL.randomBytes(t)}catch{r=wL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(_L[r[n]%_L.length]);return e.join("")}function Eue(t){return t===null||nr(t)||!t.trim()}function nr(t){return typeof t>"u"}function $a(t,e){if(typeof t=="function")return[{},t];if(nr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function PL(t){let e=t.tmpdir;if(!nr(t.name))return hr.join(e,t.dir,t.name);if(!nr(t.template))return hr.join(e,t.dir,t.template).replace(CL,EL(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",EL(12),t.postfix?"-"+t.postfix:""].join("");return hr.join(e,t.dir,r)}function RL(t){t.tmpdir=IL(t);let e=t.tmpdir;if(nr(t.name)||Kb(t.name,"name",e),nr(t.dir)||Kb(t.dir,"dir",e),!nr(t.template)&&(Kb(t.template,"template",e),!t.template.match(CL)))throw new Error(`Invalid template, found "${t.template}".`);if(!nr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=nr(t.name)?t.tries||lue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=nr(t.dir)?"":hr.relative(e,Jb(t.dir,e)),t.template=nr(t.template)?void 0:hr.relative(e,Jb(t.template,e)),t.template=Eue(t.template)?void 0:hr.relative(t.dir,t.template),t.name=nr(t.name)?void 0:t.name,t.prefix=nr(t.prefix)?"":t.prefix,t.postfix=nr(t.postfix)?"":t.postfix}function Jb(t,e){return t.startsWith(e)?hr.resolve(t):hr.resolve(hr.join(e,t))}function Kb(t,e,r){if(e==="name"){if(hr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=hr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(hr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Jb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Cue(t){return $L(t,-due,"EBADF")}function Xb(t){return $L(t,-hue,"ENOENT")}function $L(t,e,r){return fue?t.code===r:t.code===r&&t.errno===e}function Sue(){AL=!0}function IL(t){return hr.resolve(t&&t.tmpdir||Zb.tmpdir())}process.addListener(pue,_ue);Object.defineProperty(Hn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return IL()}});Hn.exports.dir=Due;Hn.exports.dirSync=vue;Hn.exports.file=gue;Hn.exports.fileSync=yue;Hn.exports.tmpName=Qb;Hn.exports.tmpNameSync=ew;Hn.exports.setGracefulCleanup=Sue});var ww=le(bw(),1),{program:A,createCommand:nce,createArgument:ice,createOption:oce,CommanderError:sce,InvalidArgumentError:ace,InvalidOptionArgumentError:uce,Command:cce,Argument:lce,Option:fce,Help:dce}=ww.default;var jr={name:"@capgo/cli",version:"4.26.0",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.8.0","@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.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.12.2","@typescript-eslint/parser":"^8.12.2","@vercel/ncc":"^0.38.2","adm-zip":"^0.5.16","ci-info":"^4.0.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.15.0","git-format-staged":"3.1.1",husky:"^9.1.6","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 Sa=require("node:fs"),L8=require("node:process");var Tt=le(Te(),1),Lo=require("node:process"),Wn=le(require("node:readline"),1),Mp=le(require("node:readline"),1),Rw=require("node:tty"),al=le(Sw(),1);function CB({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 $w(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(CB(),"")}var Up={},SB={get exports(){return Up},set exports(t){Up=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}})(SB);var xB=Up,FB=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 La(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=$w(t),t.length===0))return 0;t=t.replace(FB()," ");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(xB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Bp=10,xw=(t=0)=>e=>`\x1B[${e+t}m`,Fw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ow=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,je={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(je.modifier);var OB=Object.keys(je.color),AB=Object.keys(je.bgColor);[...OB,...AB];function kB(){let t=new Map;for(let[e,r]of Object.entries(je)){for(let[n,i]of Object.entries(r))je[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=je[n],t.set(i[0],i[1]);Object.defineProperty(je,e,{value:r,enumerable:!1})}return Object.defineProperty(je,"codes",{value:t,enumerable:!1}),je.color.close="\x1B[39m",je.bgColor.close="\x1B[49m",je.color.ansi=xw(),je.color.ansi256=Fw(),je.color.ansi16m=Ow(),je.bgColor.ansi=xw(Bp),je.bgColor.ansi256=Fw(Bp),je.bgColor.ansi16m=Ow(Bp),Object.defineProperties(je,{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=>je.rgbToAnsi256(...je.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)=>je.ansi256ToAnsi(je.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>je.ansi256ToAnsi(je.hexToAnsi256(e)),enumerable:!1}}),je}var TB=kB(),fl=new Set(["\x1B","\x9B"]),PB=39,Vp="\x07",Iw="[",RB="]",jw="m",Hp=`${RB}8;;`,Aw=t=>`${fl.values().next().value}${Iw}${t}${jw}`,kw=t=>`${fl.values().next().value}${Hp}${t}${Vp}`,$B=t=>t.split(" ").map(e=>La(e)),qp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=La($w(t[t.length-1]));for(let[a,u]of n.entries()){let c=La(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),fl.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Hp)),i){o?u===Vp&&(i=!1,o=!1):u===jw&&(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())},IB=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(La(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},jB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=$B(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=La(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(""),qp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){qp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){qp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>IB(c)));let u=[...a.join(`
201
201
  `)];for(let[c,l]of u.entries()){if(n+=l,fl.has(l)){let{groups:h}=new RegExp(`(?:\\${Iw}(?<code>\\d+)m|\\${Hp}(?<uri>.*)${Vp})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===PB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=TB.codes.get(Number(i));u[c+1]===`
202
202
  `?(o&&(n+=kw("")),i&&f&&(n+=Aw(f))):l===`
203
203
  `&&(i&&f&&(n+=Aw(i)),o&&(n+=kw(o)))}return n};function Tw(t,e,r){return String(t).normalize().replace(/\r\n/g,`
@@ -205,53 +205,53 @@ GFS4: `),console.error(t)});Ke[Ct]||(Hj=global[Ct]||[],Gj(Ke,Hj),Ke.close=functi
205
205
  `).map(n=>jB(n,e,r)).join(`
206
206
  `)}function NB(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 Nw=Symbol("clack:cancel");function Pt(t){return t===Nw}function sl(t,e){t.isTTY&&t.setRawMode(e)}var Pw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),LB=new Set(["up","down","left","right","space","enter"]),Ba=class{constructor({render:e,input:r=No.stdin,output:n=No.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 Rw.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=Mp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),Mp.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),sl(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(Tt.cursor.show),this.output.off("resize",this.render),sl(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(Tt.cursor.show),this.output.off("resize",this.render),sl(this.input,!1),r(Nw)})})}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&&Pw.has(r.name)&&this.emit("cursor",Pw.get(r.name)),r?.name&&LB.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 Nw=Symbol("clack:cancel");function Pt(t){return t===Nw}function sl(t,e){t.isTTY&&t.setRawMode(e)}var Pw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),LB=new Set(["up","down","left","right","space","enter"]),Ba=class{constructor({render:e,input:r=Lo.stdin,output:n=Lo.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 Rw.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=Mp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),Mp.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),sl(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(Tt.cursor.show),this.output.off("resize",this.render),sl(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(Tt.cursor.show),this.output.off("resize",this.render),sl(this.input,!1),r(Nw)})})}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&&Pw.has(r.name)&&this.emit("cursor",Pw.get(r.name)),r?.name&&LB.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
  `),sl(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Tw(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
210
210
  `).length-1;this.output.write(Tt.cursor.move(-999,e*-1))}render(){let e=Tw(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Tt.cursor.hide);else{let r=NB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Tt.cursor.move(0,n)),this.output.write(Tt.erase.lines(1));let i=e.split(`
211
211
  `);this.output.write(i[n]),this._prevFrame=e,this.output.write(Tt.cursor.move(0,i.length-n-1));return}else if(r&&r?.length>1){let n=r[0];this.output.write(Tt.cursor.move(0,n)),this.output.write(Tt.erase.down());let i=e.split(`
212
212
  `).slice(n);this.output.write(i.join(`
213
- `)),this._prevFrame=e;return}this.output.write(Tt.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ul=class extends Ba{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(Tt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var cl=class extends Ba{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 ll=class extends Ba{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}${al.default.inverse(al.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${al.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}};function Lw({input:t=No.stdin,output:e=No.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Wn.createInterface({input:t,output:e,prompt:"",tabSize:1});Wn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Wn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Wn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(Tt.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(Tt.cursor.show),t.isTTY&&t.setRawMode(!1),i.terminal=!1,i.close()}}var mr=le(require("node:process"),1),V=le(Mw(),1),Lo=le(Te(),1);function MB(){return mr.default.platform!=="win32"?mr.default.env.TERM!=="linux":!!mr.default.env.CI||!!mr.default.env.WT_SESSION||!!mr.default.env.TERMINUS_SUBLIME||mr.default.env.ConEmuTask==="{cmd::Cmder}"||mr.default.env.TERM_PROGRAM==="Terminus-Sublime"||mr.default.env.TERM_PROGRAM==="vscode"||mr.default.env.TERM==="xterm-256color"||mr.default.env.TERM==="alacritty"||mr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Gp=MB(),tt=(t,e)=>Gp?t:e,UB=tt("\u25C6","*"),Uw=tt("\u25A0","x"),Vw=tt("\u25B2","x"),Yp=tt("\u25C7","o"),VB=tt("\u250C","T"),Je=tt("\u2502","|"),Bo=tt("\u2514","\u2014"),Wp=tt("\u25CF",">"),Kp=tt("\u25CB"," "),Cce=tt("\u25FB","[\u2022]"),Sce=tt("\u25FC","[+]"),xce=tt("\u25FB","[ ]"),Fce=tt("\u25AA","\u2022"),Oce=tt("\u2500","-"),Ace=tt("\u256E","+"),kce=tt("\u251C","+"),Tce=tt("\u256F","+"),HB=tt("\u25CF","\u2022"),zB=tt("\u25C6","*"),GB=tt("\u25B2","!"),WB=tt("\u25A0","x"),Jp=t=>{switch(t){case"initial":case"active":return V.default.cyan(UB);case"cancel":return V.default.red(Uw);case"error":return V.default.yellow(Vw);case"submit":return V.default.green(Yp)}},Xp=t=>new ll({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${V.default.gray(Je)}
213
+ `)),this._prevFrame=e;return}this.output.write(Tt.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ul=class extends Ba{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(Tt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var cl=class extends Ba{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 ll=class extends Ba{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}${al.default.inverse(al.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${al.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}};function Lw({input:t=Lo.stdin,output:e=Lo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Wn.createInterface({input:t,output:e,prompt:"",tabSize:1});Wn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Wn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Wn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(Tt.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(Tt.cursor.show),t.isTTY&&t.setRawMode(!1),i.terminal=!1,i.close()}}var mr=le(require("node:process"),1),V=le(Mw(),1),Bo=le(Te(),1);function MB(){return mr.default.platform!=="win32"?mr.default.env.TERM!=="linux":!!mr.default.env.CI||!!mr.default.env.WT_SESSION||!!mr.default.env.TERMINUS_SUBLIME||mr.default.env.ConEmuTask==="{cmd::Cmder}"||mr.default.env.TERM_PROGRAM==="Terminus-Sublime"||mr.default.env.TERM_PROGRAM==="vscode"||mr.default.env.TERM==="xterm-256color"||mr.default.env.TERM==="alacritty"||mr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Gp=MB(),tt=(t,e)=>Gp?t:e,UB=tt("\u25C6","*"),Uw=tt("\u25A0","x"),Vw=tt("\u25B2","x"),Yp=tt("\u25C7","o"),VB=tt("\u250C","T"),Je=tt("\u2502","|"),qo=tt("\u2514","\u2014"),Wp=tt("\u25CF",">"),Kp=tt("\u25CB"," "),Cce=tt("\u25FB","[\u2022]"),Sce=tt("\u25FC","[+]"),xce=tt("\u25FB","[ ]"),Fce=tt("\u25AA","\u2022"),Oce=tt("\u2500","-"),Ace=tt("\u256E","+"),kce=tt("\u251C","+"),Tce=tt("\u256F","+"),HB=tt("\u25CF","\u2022"),zB=tt("\u25C6","*"),GB=tt("\u25B2","!"),WB=tt("\u25A0","x"),Jp=t=>{switch(t){case"initial":case"active":return V.default.cyan(UB);case"cancel":return V.default.red(Uw);case"error":return V.default.yellow(Vw);case"submit":return V.default.green(Yp)}},Xp=t=>new ll({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${V.default.gray(Je)}
214
214
  ${Jp(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(Je)} ${n}
217
- ${V.default.yellow(Bo)} ${V.default.yellow(this.error)}
217
+ ${V.default.yellow(qo)} ${V.default.yellow(this.error)}
218
218
  `;case"submit":return`${e}${V.default.gray(Je)} ${V.default.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${V.default.gray(Je)} ${V.default.strikethrough(V.default.dim(this.value??""))}${this.value?.trim()?`
219
219
  `+V.default.gray(Je):""}`;default:return`${e}${V.default.cyan(Je)} ${n}
220
- ${V.default.cyan(Bo)}
220
+ ${V.default.cyan(qo)}
221
221
  `}}}).prompt();var Pe=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new ul({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${V.default.gray(Je)}
222
222
  ${Jp(this.state)} ${t.message}
223
223
  `,i=this.value?e:r;switch(this.state){case"submit":return`${n}${V.default.gray(Je)} ${V.default.dim(i)}`;case"cancel":return`${n}${V.default.gray(Je)} ${V.default.strikethrough(V.default.dim(i))}
224
224
  ${V.default.gray(Je)}`;default:return`${n}${V.default.cyan(Je)} ${this.value?`${V.default.green(Wp)} ${e}`:`${V.default.dim(Kp)} ${V.default.dim(e)}`} ${V.default.dim("/")} ${this.value?`${V.default.dim(Kp)} ${V.default.dim(r)}`:`${V.default.green(Wp)} ${r}`}
225
- ${V.default.cyan(Bo)}
226
- `}}}).prompt()},qo=t=>{let e=(n,i)=>{let o=n.label??String(n.value);return i==="active"?`${V.default.green(Wp)} ${o} ${n.hint?V.default.dim(`(${n.hint})`):""}`:i==="selected"?`${V.default.dim(o)}`:i==="cancelled"?`${V.default.strikethrough(V.default.dim(o))}`:`${V.default.dim(Kp)} ${V.default.dim(o)}`},r=0;return new cl({options:t.options,initialValue:t.initialValue,render(){let n=`${V.default.gray(Je)}
225
+ ${V.default.cyan(qo)}
226
+ `}}}).prompt()},Mo=t=>{let e=(n,i)=>{let o=n.label??String(n.value);return i==="active"?`${V.default.green(Wp)} ${o} ${n.hint?V.default.dim(`(${n.hint})`):""}`:i==="selected"?`${V.default.dim(o)}`:i==="cancelled"?`${V.default.strikethrough(V.default.dim(o))}`:`${V.default.dim(Kp)} ${V.default.dim(o)}`},r=0;return new cl({options:t.options,initialValue:t.initialValue,render(){let n=`${V.default.gray(Je)}
227
227
  ${Jp(this.state)} ${t.message}
228
228
  `;switch(this.state){case"submit":return`${n}${V.default.gray(Je)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${n}${V.default.gray(Je)} ${e(this.options[this.cursor],"cancelled")}
229
229
  ${V.default.gray(Je)}`;default:{let i=t.maxItems===void 0?1/0:Math.max(t.maxItems,5);this.cursor>=r+i-3?r=Math.max(Math.min(this.cursor-i+3,this.options.length-i),0):this.cursor<r+2&&(r=Math.max(this.cursor-2,0));let o=i<this.options.length&&r>0,s=i<this.options.length&&r+i<this.options.length;return`${n}${V.default.cyan(Je)} ${this.options.slice(r,r+i).map((a,u,c)=>u===0&&o?V.default.dim("..."):u===c.length-1&&s?V.default.dim("..."):e(a,u+r===this.cursor?"active":"inactive")).join(`
230
230
  ${V.default.cyan(Je)} `)}
231
- ${V.default.cyan(Bo)}
232
- `}}}}).prompt()};var Zp=(t="")=>{process.stdout.write(`${V.default.gray(Bo)} ${V.default.red(t)}
231
+ ${V.default.cyan(qo)}
232
+ `}}}}).prompt()};var Zp=(t="")=>{process.stdout.write(`${V.default.gray(qo)} ${V.default.red(t)}
233
233
 
234
234
  `)},Y=(t="")=>{process.stdout.write(`${V.default.gray(VB)} ${t}
235
235
  `)},X=(t="")=>{process.stdout.write(`${V.default.gray(Je)}
236
- ${V.default.gray(Bo)} ${t}
236
+ ${V.default.gray(qo)} ${t}
237
237
 
238
238
  `)},p={message:(t="",{symbol:e=V.default.gray(Je)}={})=>{let r=[`${V.default.gray(Je)}`];if(t){let[n,...i]=t.split(`
239
239
  `);r.push(`${e} ${n}`,...i.map(o=>`${V.default.gray(Je)} ${o}`))}process.stdout.write(`${r.join(`
240
240
  `)}
241
241
  `)},info:t=>{p.message(t,{symbol:V.default.blue(HB)})},success:t=>{p.message(t,{symbol:V.default.green(zB)})},step:t=>{p.message(t,{symbol:V.default.green(Yp)})},warn:t=>{p.message(t,{symbol:V.default.yellow(GB)})},warning:t=>{p.warn(t)},error:t=>{p.message(t,{symbol:V.default.red(WB)})}},be=()=>{let t=Gp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Gp?80:120,r,n,i=!1,o="",s=(l="")=>{i=!0,r=Lw(),o=l.replace(/\.+$/,""),process.stdout.write(`${V.default.gray(Je)}
242
- `);let f=0,h=0;n=setInterval(()=>{let d=V.default.magenta(t[f]),m=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(Lo.cursor.move(-999,0)),process.stdout.write(Lo.erase.down(1)),process.stdout.write(`${d} ${o}${m}`),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(Yp):f===1?V.default.red(Uw):V.default.red(Vw);process.stdout.write(Lo.cursor.move(-999,0)),process.stdout.write(Lo.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 st=require("node:fs"),kh=require("node:os"),nt=le(require("node:path")),cr=require("node:process"),bi=le(hl());var Dn=require("fs"),Ma=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,Dn.existsSync)(r)?"bun":(0,Dn.existsSync)(n)?"pnpm":(0,Dn.existsSync)(i)?"yarn":(0,Dn.existsSync)(o)?"npm":e},pl=(t=Ma(),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,Dn.existsSync)(r)?"bunx":(0,Dn.existsSync)(n)?"pnpm exec":(0,Dn.existsSync)(i)?"yarn dlx":(0,Dn.existsSync)(o)?"npx":e};var fa=le(M_()),Y6=le(bu()),eb=le(IC());var ri=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 ss=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var as=t=>t!==null&&typeof t=="object";var _u=(...t)=>{for(let e of t)if((!as(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Bg({},...t)},Ng=(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 ef(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Bg(t[r]??[],e[r]??[])}var Lg=(t={},e={})=>({beforeRequest:ef(t,e,"beforeRequest"),beforeRetry:ef(t,e,"beforeRetry"),afterResponse:ef(t,e,"afterResponse"),beforeError:ef(t,e,"beforeError")}),Bg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(as(i)){for(let[o,s]of Object.entries(i))as(s)&&o in e&&(s=Bg(e[o],s)),e={...e,[o]:s};as(i.hooks)&&(n=Lg(n,i.hooks),e.hooks=n),as(i.headers)&&(r=Ng(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",tf=["get","post","put","patch","head","delete"],QU=()=>{};QU();var qC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},rf=2147483647,nf=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=>tf.includes(t)?t.toUpperCase():t,e9=["get","put","head","delete","options","trace"],t9=[408,413,429,500,502,503,504],r9=[413,429,503],VC={limit:2,methods:e9,statusCodes:t9,afterStatusCodes:r9,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 qg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new ss(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Mg(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 Eu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>rf)throw new RangeError(`The \`timeout\` option cannot be greater than ${rf}`);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 ri(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:Ng(this._input.headers,r.headers),hooks:Lg({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 ss)throw e;if(e instanceof ri){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),rf);if(this._retryCount<1)throw r;await Mg(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})===nf)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):qg(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 Ug=t=>{let e=(r,n)=>Eu.create(r,_u(t,n));for(let r of tf)e[r]=(n,i)=>Eu.create(n,_u(t,i,{method:r}));return e.create=r=>Ug(_u(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Ug(_u(t,r))),e.stop=nf,e},n9=Ug(),zr=n9;var J6=le(ES()),Th=le(nD());var Tc=le(l6());async function f6(){let t=await(0,Tc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function sn(t,e=!1){let r=await(0,Tc.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,Tc.writeConfig)(n,r.app.extConfigFilePath))}var rr=".capgo_key",lr=".capgo_key_v2",fr=`${rr}.pub`,Nn=`${lr}.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,dse="package.json",da=/^(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,Q=t=>t?`
244
- ${J6.default.render(t)}`:"";function W6(t){return new Promise(e=>{setTimeout(e,t)})}function tb(t){return(0,bi.isMonorepo)(t)?(0,bi.findMonorepoRoot)(t):(0,bi.isNXMonorepo)(t)?(0,bi.findNXMonorepoRoot)(t):t}async function Lt(t=tb((0,cr.cwd)()),e=void 0){e&&((0,st.existsSync)(e)||(p.error(`Package.json at ${e} does not exist`),(0,cr.exit)(1)));let r=(0,st.readFileSync)(e||(0,nt.join)(t,dse));return JSON.parse(r)}async function ee(){try{let t=await f6();return t||(p.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){p.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function ha(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},sn(e)),e}async function Sr(){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&&(p.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 hse=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function rb(){let t=await Sr();return zr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(p.info(`Local config ${Q(t)}`),t))}async function Q6(){let t=await Sr();return zr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await rb();return(!e.supaHost||!e.supaKey)&&(p.error("Cannot connect to server please try again later"),A.error("")),(0,fa.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function pse(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){p.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("");p.error(`Your key should be: ${i} mode.`),A.error("")}}async function mse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function gse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function yse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function Dse(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var Ot=(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))(Ot||{}),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&&(p.error("Cannot get permissions for organization!"),console.error(i),(0,cr.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")&&(p.info("Please accept/deny the organization invitation before trying to access the app"),(0,cr.exit)(1)),p.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,cr.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:p.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,cr.exit)(1)}return{okay:!1,error:s}}async function pa(t,e,r,n,i=!0){let o=await rb();await(n?Dse(t,n,r):yse(t,e))||(p.error(`You need to upgrade your plan to continue to use capgo.
242
+ `);let f=0,h=0;n=setInterval(()=>{let d=V.default.magenta(t[f]),m=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(Bo.cursor.move(-999,0)),process.stdout.write(Bo.erase.down(1)),process.stdout.write(`${d} ${o}${m}`),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(Yp):f===1?V.default.red(Uw):V.default.red(Vw);process.stdout.write(Bo.cursor.move(-999,0)),process.stdout.write(Bo.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 st=require("node:fs"),kh=require("node:os"),nt=le(require("node:path")),cr=require("node:process"),bi=le(hl());var Dn=require("fs"),Ma=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,Dn.existsSync)(r)?"bun":(0,Dn.existsSync)(n)?"pnpm":(0,Dn.existsSync)(i)?"yarn":(0,Dn.existsSync)(o)?"npm":e},pl=(t=Ma(),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,Dn.existsSync)(r)?"bunx":(0,Dn.existsSync)(n)?"pnpm exec":(0,Dn.existsSync)(i)?"yarn dlx":(0,Dn.existsSync)(o)?"npx":e};var da=le(M_()),Y6=le(bu()),eb=le(IC());var ri=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 as=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var us=t=>t!==null&&typeof t=="object";var _u=(...t)=>{for(let e of t)if((!us(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Bg({},...t)},Ng=(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 ef(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Bg(t[r]??[],e[r]??[])}var Lg=(t={},e={})=>({beforeRequest:ef(t,e,"beforeRequest"),beforeRetry:ef(t,e,"beforeRetry"),afterResponse:ef(t,e,"afterResponse"),beforeError:ef(t,e,"beforeError")}),Bg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(us(i)){for(let[o,s]of Object.entries(i))us(s)&&o in e&&(s=Bg(e[o],s)),e={...e,[o]:s};us(i.hooks)&&(n=Lg(n,i.hooks),e.hooks=n),us(i.headers)&&(r=Ng(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",tf=["get","post","put","patch","head","delete"],QU=()=>{};QU();var qC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},rf=2147483647,nf=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=>tf.includes(t)?t.toUpperCase():t,e9=["get","put","head","delete","options","trace"],t9=[408,413,429,500,502,503,504],r9=[413,429,503],VC={limit:2,methods:e9,statusCodes:t9,afterStatusCodes:r9,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 qg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new as(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Mg(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 Eu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>rf)throw new RangeError(`The \`timeout\` option cannot be greater than ${rf}`);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 ri(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:Ng(this._input.headers,r.headers),hooks:Lg({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 as)throw e;if(e instanceof ri){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),rf);if(this._retryCount<1)throw r;await Mg(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})===nf)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):qg(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 Ug=t=>{let e=(r,n)=>Eu.create(r,_u(t,n));for(let r of tf)e[r]=(n,i)=>Eu.create(n,_u(t,i,{method:r}));return e.create=r=>Ug(_u(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Ug(_u(t,r))),e.stop=nf,e},n9=Ug(),zr=n9;var J6=le(ES()),Th=le(nD());var Tc=le(l6());async function f6(){let t=await(0,Tc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function sn(t,e=!1){let r=await(0,Tc.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,Tc.writeConfig)(n,r.app.extConfigFilePath))}var rr=".capgo_key",lr=".capgo_key_v2",fr=`${rr}.pub`,Nn=`${lr}.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,dse="package.json",ha=/^(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,Q=t=>t?`
244
+ ${J6.default.render(t)}`:"";function W6(t){return new Promise(e=>{setTimeout(e,t)})}function tb(t){return(0,bi.isMonorepo)(t)?(0,bi.findMonorepoRoot)(t):(0,bi.isNXMonorepo)(t)?(0,bi.findNXMonorepoRoot)(t):t}async function Lt(t=tb((0,cr.cwd)()),e=void 0){e&&((0,st.existsSync)(e)||(p.error(`Package.json at ${e} does not exist`),(0,cr.exit)(1)));let r=(0,st.readFileSync)(e||(0,nt.join)(t,dse));return JSON.parse(r)}async function ee(){try{let t=await f6();return t||(p.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){p.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function _o(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},sn(e)),e}async function Sr(){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&&(p.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 hse=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function rb(){let t=await Sr();return zr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(p.info(`Local config ${Q(t)}`),t))}async function Q6(){let t=await Sr();return zr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await rb();return(!e.supaHost||!e.supaKey)&&(p.error("Cannot connect to server please try again later"),A.error("")),(0,da.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function pse(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){p.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("");p.error(`Your key should be: ${i} mode.`),A.error("")}}async function mse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function gse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function yse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function Dse(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var Ot=(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))(Ot||{}),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&&(p.error("Cannot get permissions for organization!"),console.error(i),(0,cr.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")&&(p.info("Please accept/deny the organization invitation before trying to access the app"),(0,cr.exit)(1)),p.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,cr.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:p.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,cr.exit)(1)}return{okay:!1,error:s}}async function pa(t,e,r,n,i=!0){let o=await rb();await(n?Dse(t,n,r):yse(t,e))||(p.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),A.error(""));let[a,u]=await Promise.all([gse(t,e),mse(t,e)]);a>0&&i&&!u&&p.warn(`WARNING !!
247
247
  Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
248
- `)}function pe(t=!1){let e=(0,kh.homedir)(),r,n=`${e}/.capgo`;return(0,st.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,st.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,st.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,st.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Bt().runner} @capacitor/cli login`),A.error("")),r}async function*nb(t){let e=await(0,st.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,nt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*nb(n):yield n}}function ma(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 ib(){let t=(0,cr.cwd)(),e=!1,r=(0,nt.resolve)(t,"tsconfig.json");(0,st.existsSync)(r)&&(e=!0);for await(let n of nb(t)){if(n.includes("angular.json"))return p.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return p.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return p.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return p.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return p.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return p.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,nt.dirname)(n),o=await Lt(i);if(o.dependencies){if(o.dependencies.react)return p.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return p.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"?(p.info("Angular project detected"),"build"):t==="nuxtjs"?(p.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(p.info("Nextjs project detected"),p.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"),p.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),A.error("")),"build"):(t==="sveltekit"&&(p.info("Sveltekit project detected"),p.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),p.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),A.error(""))),"build")}async function ij(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,cr.cwd)(),n=r.split("/").length;for await(let i of nb(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function ob(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 fa.FunctionsHttpError){let s=await o.error.context.json();p.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){p.error(`Cannot get upload url ${Q(i)}`)}return""}async function*sj(t){let e=(0,st.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,nt.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,st.readFileSync)(r),i=await(0,Y6.checksum)(n,"sha256"),o=(0,nt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Ph(t){return(0,kh.platform)()==="win32"?bse(t):vse(t)}function vse(t){let e=new eb.default;return e.addLocalFolder(t),e.toBuffer()}async function bse(t){p.info("Zipping file windows mode");let e=new eb.default,r=(n,i)=>{let o=(0,st.readdirSync)(n);for(let s of o){let a=(0,nt.join)(n,s),u=(0,st.statSync)(a);if(u.isFile()){let c=(0,st.readFileSync)(a);e.addFile((0,nt.join)(i,s).split(nt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,nt.join)(i,s))}};return r(t,""),e.toBuffer()}async function uj(t,e,r,n,i,o,s){return new Promise((a,u)=>{Fe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new Th.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 Th.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 Fe(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 fa.FunctionsHttpError){let s=await o.error.context.json();p.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof fa.FunctionsHttpError){let o=await i.context.json();p.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else p.error(`Cannot delete failed version: ${Q(i)}`)}}async function Rh(t,e){if(!e.app_id||!e.name||!e.created_by)return p.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(p.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&p.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return p.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,p.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 Fe(t,e){try{let r=await rb(),n=await zr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&p.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ga(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await qo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;Pt(o)&&(p.error("Canceled organization selection, exiting"),A.error(""));let s=o,a=n.find(u=>u.gid===s);return p.info(`Using the organization "${a.name}" as the app owner`),a}var _o=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await pse(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(p.error("Cannot auth user with apikey"),A.error("")),o}async function xr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ya(t){return new Date(t||"").toLocaleString()}var K6=!1,la="npm",Ic="install",Qv="npx";function Bt(){if(K6)return{pm:la,command:Ic,installCommand:`${la} ${Ic}`,runner:Qv};let t=tb((0,cr.cwd)());return la=Ma(t,"npm"),Ic=pl(la),K6=!0,Qv=Hw(t),{pm:la,command:Ic,installCommand:`${la} ${Ic}`,runner:Qv}}function lj(t){return(0,st.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,nt.join)(t,n.name);return n.isDirectory()?lj(i):i.split(`node_modules${nt.sep}`)[1]||i})}async function sb(t,e){let r=e?e.split(","):[],n;try{n=await Lt("",t)}catch(l){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",l),A.error("")}let i=t?nt.default.resolve(t).replace("package.json",""):tb((0,cr.cwd)()),{dependencies:o}=n;o||(p.error("Missing dependencies section in package.json"),A.error(""));for(let[l,f]of Object.entries(o))typeof f!="string"&&(p.error(`Invalid dependency ${l}: ${f}, expected string, got ${typeof f}`),A.error(""));let s=r.length===0?[(0,nt.join)((0,cr.cwd)(),"node_modules")]:r;if(!s.some(l=>(0,st.existsSync)(l))){let l=Ma(i,"npm"),f=pl(l);p.error(`Missing node_modules folder at ${s.join(", ")}, please run ${l} ${f}`),A.error("")}let u=!1,c=await Promise.all(Object.entries(o).map(async([l,f])=>{let h=!1,d=!1;for(let m of s){let b=(0,nt.join)(m,l);if((0,st.existsSync)(b)){h=!0;try{if(lj(b).some(w=>hse.test(w))){d=!0;break}}catch(g){p.error(`Error reading node_modules files for ${l} package in ${m}`),console.error(g),A.error("")}}}if(!h){u=!0;let m=Ma(i,"npm"),b=pl(m);return p.error(`Missing dependency ${l}, please run ${m} ${b}`),{name:l,version:f}}return{name:l,version:f,native:d}})).catch(()=>[]);return(u||c.find(l=>l.native===void 0))&&A.error(""),c}async function wse(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 _se(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
248
+ `)}function pe(t=!1){let e=(0,kh.homedir)(),r,n=`${e}/.capgo`;return(0,st.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,st.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,st.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,st.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Bt().runner} @capacitor/cli login`),A.error("")),r}async function*nb(t){let e=await(0,st.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,nt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*nb(n):yield n}}function ma(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 ib(){let t=(0,cr.cwd)(),e=!1,r=(0,nt.resolve)(t,"tsconfig.json");(0,st.existsSync)(r)&&(e=!0);for await(let n of nb(t)){if(n.includes("angular.json"))return p.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return p.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return p.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return p.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return p.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return p.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,nt.dirname)(n),o=await Lt(i);if(o.dependencies){if(o.dependencies.react)return p.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return p.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"?(p.info("Angular project detected"),"build"):t==="nuxtjs"?(p.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(p.info("Nextjs project detected"),p.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"),p.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),A.error("")),"build"):(t==="sveltekit"&&(p.info("Sveltekit project detected"),p.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),p.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),A.error(""))),"build")}async function ij(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,cr.cwd)(),n=r.split("/").length;for await(let i of nb(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function ob(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 da.FunctionsHttpError){let s=await o.error.context.json();p.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){p.error(`Cannot get upload url ${Q(i)}`)}return""}async function*sj(t){let e=(0,st.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,nt.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,st.readFileSync)(r),i=await(0,Y6.checksum)(n,"sha256"),o=(0,nt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Ph(t){return(0,kh.platform)()==="win32"?bse(t):vse(t)}function vse(t){let e=new eb.default;return e.addLocalFolder(t),e.toBuffer()}async function bse(t){p.info("Zipping file windows mode");let e=new eb.default,r=(n,i)=>{let o=(0,st.readdirSync)(n);for(let s of o){let a=(0,nt.join)(n,s),u=(0,st.statSync)(a);if(u.isFile()){let c=(0,st.readFileSync)(a);e.addFile((0,nt.join)(i,s).split(nt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,nt.join)(i,s))}};return r(t,""),e.toBuffer()}async function uj(t,e,r,n,i,o,s){return new Promise((a,u)=>{Fe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new Th.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 Th.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 Fe(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 da.FunctionsHttpError){let s=await o.error.context.json();p.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof da.FunctionsHttpError){let o=await i.context.json();p.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else p.error(`Cannot delete failed version: ${Q(i)}`)}}async function Rh(t,e){if(!e.app_id||!e.name||!e.created_by)return p.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(p.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&p.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return p.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,p.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 Fe(t,e){try{let r=await rb(),n=await zr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&p.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ga(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await Mo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;Pt(o)&&(p.error("Canceled organization selection, exiting"),A.error(""));let s=o,a=n.find(u=>u.gid===s);return p.info(`Using the organization "${a.name}" as the app owner`),a}var Eo=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await pse(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(p.error("Cannot auth user with apikey"),A.error("")),o}async function xr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ya(t){return new Date(t||"").toLocaleString()}var K6=!1,fa="npm",Ic="install",Qv="npx";function Bt(){if(K6)return{pm:fa,command:Ic,installCommand:`${fa} ${Ic}`,runner:Qv};let t=tb((0,cr.cwd)());return fa=Ma(t,"npm"),Ic=pl(fa),K6=!0,Qv=Hw(t),{pm:fa,command:Ic,installCommand:`${fa} ${Ic}`,runner:Qv}}function lj(t){return(0,st.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,nt.join)(t,n.name);return n.isDirectory()?lj(i):i.split(`node_modules${nt.sep}`)[1]||i})}async function sb(t,e){let r=e?e.split(","):[],n;try{n=await Lt("",t)}catch(l){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",l),A.error("")}let i=t?nt.default.resolve(t).replace("package.json",""):tb((0,cr.cwd)()),{dependencies:o}=n;o||(p.error("Missing dependencies section in package.json"),A.error(""));for(let[l,f]of Object.entries(o))typeof f!="string"&&(p.error(`Invalid dependency ${l}: ${f}, expected string, got ${typeof f}`),A.error(""));let s=r.length===0?[(0,nt.join)((0,cr.cwd)(),"node_modules")]:r;if(!s.some(l=>(0,st.existsSync)(l))){let l=Ma(i,"npm"),f=pl(l);p.error(`Missing node_modules folder at ${s.join(", ")}, please run ${l} ${f}`),A.error("")}let u=!1,c=await Promise.all(Object.entries(o).map(async([l,f])=>{let h=!1,d=!1;for(let m of s){let b=(0,nt.join)(m,l);if((0,st.existsSync)(b)){h=!0;try{if(lj(b).some(w=>hse.test(w))){d=!0;break}}catch(g){p.error(`Error reading node_modules files for ${l} package in ${m}`),console.error(g),A.error("")}}}if(!h){u=!0;let m=Ma(i,"npm"),b=pl(m);return p.error(`Missing dependency ${l}, please run ${m} ${b}`),{name:l,version:f}}return{name:l,version:f,native:d}})).catch(()=>[]);return(u||c.find(l=>l.native===void 0))&&A.error(""),c}async function wse(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 _se(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
249
249
  native_packages
250
250
  )`).eq("name",r).eq("app_id",e).single();i&&(p.error(`Error fetching native packages: ${i.message}`),A.error(""));let o;try{o=n.version.native_packages}catch{p.error("Error parsing native packages"),A.error("")}return o||(p.error("Error parsing native packages, perhaps the metadata does not exist?"),A.error("")),o.forEach(a=>{typeof a!="object"&&(p.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),A.error(""));let{name:u,version:c}=a;(!u||typeof u!="string")&&(p.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),A.error("")),(!c||typeof c!="string")&&(p.error(`Invalid remote native package version: ${c}, expected string, got ${typeof c}`),A.error(""))}),new Map(o.map(a=>[a.name,a]))}async function fj(t,e,r,n){let i=be();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await wse(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(p.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
253
  PS: You can ignore this check with "--ignore-checksum-check"`),A.error("")),i.stop(`Checksum compatible with ${r} channel`)}function ge(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function $h(t,e,r,n,i){let o=await sb(n,i),s=await _se(t,e,r),a=o.filter(c=>!!c.native).map(c=>{let l=s.get(c.name);return l?{name:c.name,localVersion:c.version,remoteVersion:l.version}:{name:c.name,localVersion:c.version,remoteVersion:void 0}}),u=[...s].filter(([c])=>o.find(l=>l.name===c)===void 0).map(([c,l])=>({name:c,localVersion:void 0,remoteVersion:l.version}));return a.push(...u),{finalCompatibility:a,localDependencies:o}}async function dj(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function Me(t,e,r,n){let i=Bt(),o=await tj(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{p.error("Invalid apikey, such apikey does not exists!"),A.error("");break}case"NO_APP":{p.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),A.error("");break}case"NO_ORG":{p.error("Could not find organization, please contact support to resolve this!"),A.error("");break}}let s=o.data;return n>s&&(p.error(`Insuficcent permissions for app ${r}. Current permission: ${Ot[o.data]}, required for this action: ${Ot[n]}.`),A.error("")),o.data}var Fr="assets/icon.png";var jj=le(Ij(),1);function lb(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=le(I8(),1),N8=le(Pv(),1),Eb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Cb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function Sb(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??lb(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 zr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new Eb(t):f}if(e.allVersions)return c;let l=new Cb(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,m]of Object.entries(c.versions))m.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 qc(t,e){let{version:r}=await Sb(t.toLowerCase(),e);return r}async function De(){let t=await qc("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==jr.version&&p.warning(`\u{1F6A8} You are using @capgo/cli@${jr.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 xae(t,e,r=!0){await xb(t,e,void 0,r)}async function xb(t,e,r,n=!0){n&&Y("Adding"),await De(),e.apikey=e.apikey||pe();let i=await ee();t=ge(t,i?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(p.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await dj(o,t)&&(p.error(`App ${t} already exist`),A.error("")),r||(r=await ga(o,["admin","super_admin"]));let a=r.gid;await pa(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)&&(p.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&p.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Sa.existsSync)(c)?(l=(0,Sa.readFileSync)(c),f=ma(c)||"image/png",p.warn(`Found app icon ${c}`)):(0,Sa.existsSync)(Fr)?(l=(0,Sa.readFileSync)(Fr),f=ma(Fr)||"image/png",p.warn(`Found app icon ${Fr}`)):p.warn(`Cannot find app icon in any of the following locations: ${c}, ${Fr}`);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),p.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:m}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});m&&(p.error(`Could not add app ${Q(m)}`),A.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&&(p.error(`Could not add app ${Q(b)}`),A.error("")),p.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){xae(t,e,!0)}var q8=require("node:process");async function M8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await Me(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){p.warn("Deleting the app is not recomended for users that are not the organization owner"),p.warn("You are invited as a super_admin but your are not the owner"),p.warn("It's strongly recomended that you do not continue!");let h=await qo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(Pt(h)||h==="no")&&(p.error("Canceled deleting the app, exiting"),A.error(""))}else s&&p.warn(`Cannot get the app owner ${Q(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}`),p.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&p.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(p.error("Could not delete app"),A.error(""));let f=await xr(n,t);await Fe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),p.success("App deleted in Capgo"),X("Done \u2705"),(0,q8.exit)()}var Kh=require("node:os"),xa=require("node:process");async function Fae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(qc(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 Oae(){let{dependencies:t}=await Lt(),e={"@capgo/cli":jr.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(t){p.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await Lt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";p.info(` App Name: ${i}`);let o=ge("",e?.config);p.info(` App ID: ${o}`),p.info(` App Version: ${n}`);let s=e?.config?.webDir||"";p.info(` Web Dir: ${s}`),p.info(` OS: ${(0,Kh.platform)()} ${(0,Kh.version)()}`),p.info(` Node: ${xa.version}`),p.info(" Installed Dependencies:");let a=await Oae();Object.keys(a).length===0&&(p.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,xa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];p.info(` ${l}: ${f}`)}let u=be();u.start("Running: Loading latest dependencies");let c=await Fae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];p.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(p.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,xa.exit)(1)),p.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,xa.exit)()}var Fb=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 dr=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(`
254
+ Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function xae(t,e,r=!0){await xb(t,e,void 0,r)}async function xb(t,e,r,n=!0){n&&Y("Adding"),await De(),e.apikey=e.apikey||pe();let i=await ee();t=ge(t,i?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(p.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await dj(o,t)&&(p.error(`App ${t} already exist`),A.error("")),r||(r=await ga(o,["admin","super_admin"]));let a=r.gid;await pa(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)&&(p.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&p.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Sa.existsSync)(c)?(l=(0,Sa.readFileSync)(c),f=ma(c)||"image/png",p.warn(`Found app icon ${c}`)):(0,Sa.existsSync)(Fr)?(l=(0,Sa.readFileSync)(Fr),f=ma(Fr)||"image/png",p.warn(`Found app icon ${Fr}`)):p.warn(`Cannot find app icon in any of the following locations: ${c}, ${Fr}`);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),p.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:m}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});m&&(p.error(`Could not add app ${Q(m)}`),A.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&&(p.error(`Could not add app ${Q(b)}`),A.error("")),p.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){xae(t,e,!0)}var q8=require("node:process");async function M8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await Me(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){p.warn("Deleting the app is not recomended for users that are not the organization owner"),p.warn("You are invited as a super_admin but your are not the owner"),p.warn("It's strongly recomended that you do not continue!");let h=await Mo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(Pt(h)||h==="no")&&(p.error("Canceled deleting the app, exiting"),A.error(""))}else s&&p.warn(`Cannot get the app owner ${Q(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}`),p.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&p.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(p.error("Could not delete app"),A.error(""));let f=await xr(n,t);await Fe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),p.success("App deleted in Capgo"),X("Done \u2705"),(0,q8.exit)()}var Kh=require("node:os"),xa=require("node:process");async function Fae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(qc(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 Oae(){let{dependencies:t}=await Lt(),e={"@capgo/cli":jr.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(t){p.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await Lt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";p.info(` App Name: ${i}`);let o=ge("",e?.config);p.info(` App ID: ${o}`),p.info(` App Version: ${n}`);let s=e?.config?.webDir||"";p.info(` Web Dir: ${s}`),p.info(` OS: ${(0,Kh.platform)()} ${(0,Kh.version)()}`),p.info(` Node: ${xa.version}`),p.info(" Installed Dependencies:");let a=await Oae();Object.keys(a).length===0&&(p.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,xa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];p.info(` ${l}: ${f}`)}let u=be();u.start("Running: Loading latest dependencies");let c=await Fae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];p.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(p.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,xa.exit)(1)),p.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,xa.exit)()}var Fb=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 dr=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
255
  `)}};function Aae(t){t.length||(p.error("No apps found"),(0,Fb.exit)(1));let e=new dr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ya(r.created_at)])}),p.success("Apps"),p.success(e.toString())}async function kae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(p.error("Apps not found"),A.error("")),e}async function H8(t){Y("List apps in Capgo"),await De(),t.apikey=t.apikey||pe();let e=await de(t.apikey);await me(e,t.apikey,["write","all","read","upload"]),p.info("Getting active bundle in Capgo");let r=await kae(e);p.info(`Active app in Capgo: ${r?.length}`),Aae(r),X("Done \u2705"),(0,Fb.exit)()}var z8=require("node:crypto"),Fa=require("node:fs"),G8=require("node:process");async function W8(t,e){Y("Set app"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),o=(await ga(n,["admin","super_admin"])).gid,s=await me(n,e.apikey,["write","all"]);await Me(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(p.error("retention value must be a number"),A.error("")):c&&c<0&&(p.error("retention value cannot be less than 0"),A.error(""));let l,f,h=`icon_${(0,z8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Fa.existsSync)(u)?(l=(0,Fa.readFileSync)(u),f=ma(u)||"image/png",p.warn(`Found app icon ${u}`)):(0,Fa.existsSync)(Fr)?(l=(0,Fa.readFileSync)(Fr),f=ma(Fr)||"image/png",p.warn(`Found app icon ${Fr}`)):p.warn(`Cannot find app icon in any of the following locations: ${u}, ${Fr}`),l&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});b&&(p.error(`Could not set app ${Q(b)}`),A.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:m}=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);m&&(p.error(`Could not set app ${Q(m)}`),A.error("")),X("Done \u2705"),(0,G8.exit)()}var Oa=require("node:process");async function K8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(p.error("Bool and string CANNOT be set at the same time"),(0,Oa.exit)(1)),!e.bool&&!e.string&&(p.error("You MUST provide either bool or string as the value"),(0,Oa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(p.error("Invalid bool"),(0,Oa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(p.error("Invalid path"),(0,Oa.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 sn(r,!0),p.success(`Set "${t}" to "${o}"`)}catch(r){p.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Oa.exit)(1)}X("Done \u2705")}var Nb=require("node:process");function Yh(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 Ab(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 Aa="0|[1-9]\\d*",Tae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Pae=`(?<major>${Aa})\\.(?<minor>${Aa})\\.(?<patch>${Aa})`,Y8=`(?:${Aa}|${Tae})`,Z8=`(?:-(?<prerelease>${Y8}(?:\\.${Y8})*))`,J8="[0-9A-Za-z-]+",Q8=`(?:\\+(?<buildmetadata>${J8}(?:\\.${J8})*))`,eN=`v?${Pae}${Z8}?${Q8}?`,tN=new RegExp(`^${eN}$`),rN="(?:<|>)?=?",Rae="x|X|\\*",Ob=`${Aa}|${Rae}`,nN=`[v=\\s]*(?<major>${Ob})(?:\\.(?<minor>${Ob})(?:\\.(?<patch>${Ob})${Z8}?${Q8}?)?)?`,$ae=new RegExp(`^(?<operator>~>?|\\^|${rN})\\s*${nN}$`),Iae=new RegExp(`^(?<operator>${rN})\\s*(${eN})$|^$`);function kb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Tb=256;var jae=new RegExp(`^${Aa}$`);function Pb(t){return t.split(".").filter(Boolean).map(e=>{if(jae.test(e)){let r=Number(e);if(kb(r))return r}return e})}function Mc(t){return t.split(".").filter(Boolean)}function Uc(t,e){let r=Number(t);if(!kb(r))throw new TypeError(e);return r}function Or(t,e){return t===e?0:Yh(t.major,e.major)||Yh(t.minor,e.minor)||Yh(t.patch,e.patch)||X8(t.prerelease,e.prerelease)||Ab(t.prerelease,e.prerelease)}function Rb(t){return t.toFixed(0)}function ka(t){let e=Rb(t.major),r=Rb(t.minor),n=Rb(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 Nae(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 Vc(t=[],e){let r=Nae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function oN(t,e,r={}){let n=r.build!==void 0?Mc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Vc(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:Vc(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:Vc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var $b={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},sN={operator:void 0,...$b};function Ib(t,e){return Or(t,e)>0}function Ta(t,e){return Or(t,e)<0}function qn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Tb)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Tb}`);t=t.trim();let e=t.match(tN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Uc(e.major,`Cannot parse version ${t}: invalid major version`),n=Uc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Uc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Pb(e.prerelease):[],s=e.buildmetadata?Mc(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&&(p.error(`Cannot check Version ${e}@${r.name}`),A.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await jb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,uN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else p.error("Unlink it first"),A.error("");X(`Version unlinked from ${n.length} channel`)}}function jb(t,e){return t.from("app_versions").select("id").eq("app_id",e).eq("name","unknown").throwOnError().single().then(({data:r,error:n})=>(n&&(p.error(`Cannot call findUnknownVersion as it returned an error.
256
256
  ${Q(n)}`),A.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 dr;e.theme=dr.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"])}),p.success("Channels"),p.success(e.toString())}async function hN(t,e){let{data:r,error:n}=await t.from("channels").select(`
257
257
  id,
@@ -272,16 +272,16 @@ ${Q(n)}`),A.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&&(p.error(`App ${e} not found in database`),A.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&&(p.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();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} ${Q(a)}`),(0,pN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else p.error("Unlink it first"),A.error("")}async function Lae(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&&(p.error(`App Version ${e}@${r} not found in database`),A.error(""))}async function Xh(t,e,r){let n=await Bae(t,e,r);await cN(t,e,n),await mN(t,e,n),await Lae(t,e,r)}function Zh(t){t.length||(p.error("No bundle found"),(0,gN.exit)(1));let e=new dr;e.theme=dr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ya(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Qh(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&&(p.error(`App ${e} not found in database`),A.error("")),r}async function yN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(p.error(`App ${e} not found in database`),A.error("")),r.map(i=>i.version)}async function Bae(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)&&(p.error(`App Version ${e}@${r} doesn't exist`),A.error("")),n}async function qae(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${ya(n.created_at)}`),await Xh(e,r,n.name)}function Mae(t,e,r){let n=[];return t?.forEach(i=>{let o=qn(i.name);Ib(o,e)&&Ta(o,r)&&n.push(i)}),n}async function DN(t,e){Y("Cleanup versions in Capgo"),await De(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=ge(t,o?.config),e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await Me(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Qh(s,t),u=await yN(s,t);if(p.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){p.error("No versions found, aborting cleanup");return}if(r){let f=qn(r),h=oN(f,"major");p.info(`Querying available versions in Capgo between ${ka(f)} and ${ka(h)}`),a=Mae(a,f,h),p.info(`Active versions in Capgo between ${ka(f)} and ${ka(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){p.warn("Nothing to be removed, aborting removal...");return}if(Zh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(Pt(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,Nb.exit)())}p.success("You have confirmed removal, removing versions now"),await qae(c,s,t),X("Done \u2705"),(0,Nb.exit)()}var an=require("node:fs"),EN=require("node:process");var Hc=require("node:buffer"),qt=require("node:crypto"),vN="aes-128-cbc",bN="sha256",ep="base64",wN=qt.constants.RSA_PKCS1_OAEP_PADDING;function _N(t,e,r){let[n,i]=e.split(":"),o=(0,qt.privateDecrypt)({key:r,padding:wN,oaepHash:bN},Hc.Buffer.from(i,ep)),s=Hc.Buffer.from(n,ep),a=(0,qt.createDecipheriv)(vN,o,s);return a.setAutoPadding(!0),Hc.Buffer.concat([a.update(t),a.final()])}function tp(t,e){let r=(0,qt.randomBytes)(16),n=(0,qt.randomBytes)(16),i=(0,qt.createCipheriv)(vN,n,r);i.setAutoPadding(!0);let o=r.toString(ep),s=(0,qt.publicEncrypt)({key:e,padding:wN,oaepHash:bN},n).toString(ep),a=`${o}:${s}`;return{encryptedData:Hc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function rp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,qt.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 De(),(0,an.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(rr)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${rr} or in ${n.path}`),A.error(""));let i=r.key||rr,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,an.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=_N(s,e,r.keyData??o??"");(0,an.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,EN.exit)()}var un=require("node:fs"),ON=require("node:process");var AN=le(bu());var Po=require("node:buffer"),kt=require("node:crypto"),SN="aes-128-cbc",_i="base64",np=kt.constants.RSA_PKCS1_PADDING;function xN(t,e,r){let[n,i]=e.split(":"),o=(0,kt.publicDecrypt)({key:r,padding:np},Po.Buffer.from(i,_i)),s=Po.Buffer.from(n,_i),a=(0,kt.createDecipheriv)(SN,o,s);return a.setAutoPadding(!0),Po.Buffer.concat([a.update(t),a.final()])}function ip(t,e){return(0,kt.privateEncrypt)({key:e,padding:np},Po.Buffer.from(t,_i)).toString(_i)}function FN(t,e){return(0,kt.publicDecrypt)({key:e,padding:np},Po.Buffer.from(t,_i)).toString(_i)}function op(t,e){let r=(0,kt.randomBytes)(16),n=(0,kt.randomBytes)(16),i=(0,kt.createCipheriv)(SN,n,r);i.setAutoPadding(!0);let o=r.toString(_i),s=(0,kt.privateEncrypt)({key:e,padding:np},n).toString(_i),a=`${o}:${s}`;return{encryptedData:Po.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function kN(t,e,r){Y("Decrypt zip file"),await De(),(0,un.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,un.existsSync)(Nn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${Nn} or in ${n.path}`),A.error(""));let i=r.key||Nn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,un.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,un.existsSync)(i)&&(o=(0,un.readFileSync)(i).toString());let s=(0,un.readFileSync)(t),a=xN(s,e,r.keyData??o??"");if((0,un.writeFileSync)(`${t}_decrypted.zip`,a),p.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?(p.error(`Checksum does not match ${u} !== ${c}`),A.error("")):p.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||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await Me(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),p.info(`Deleting bundle ${e}@${t} from Capgo`),p.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Xh(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,TN.exit)()}var Ei=require("node:fs"),RN=require("node:process");async function $N(t,e){Y("Encryption"),await De(),(0,Ei.existsSync)(t)||(p.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||fr,n=e.keyData||"";(0,Ei.existsSync)(r)&&(n=(0,Ei.readFileSync)(r).toString());let i=(0,Ei.readFileSync)(t),o=tp(i,n);p.success(`ivSessionKey: ${o.ivSessionKey}`),(0,Ei.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),p.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,RN.exit)()}var Mn=require("node:fs"),IN=require("node:process");async function jN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await De());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&p.warning("There is still a privateKey in the config"),(0,Mn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||lr,u=r.keyData||"";!(0,Mn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),A.error("")):(0,Mn.existsSync)(a)&&(u=(0,Mn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,Mn.readFileSync)(t),l=op(c,u),f=ip(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(p.success(`Encoded Checksum: ${f}`),p.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,Mn.writeFileSync)(h,l.encryptedData),n||(p.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 De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await Me(n,e.apikey,t,1);let i=await Qh(n,t);p.info(`Active versions in Capgo: ${i?.length}`),Zh(i),X("Done \u2705"),(0,NN.exit)()}var rL=require("node:crypto"),ln=require("node:fs"),nL=require("node:process");function zc(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 sp=32*1024,Lb=2**32-2,ap=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=zc(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 zc(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)zc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Lb)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Lb));zc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Lb)),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(sp);for(;;){let i=this.capacity-this.length<sp,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(sp);for(;;){let i=this.capacity-this.length<sp,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 up=class extends TransformStream{constructor(e){let r=new ap;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 Ci(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 m=o();if(!m)return h;h.attributes[m.name]=m.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 cn=class extends Error{constructor(e){super(e)}};var Ar=class extends cn{},cp=class extends cn{},lp=class extends cn{},Un=class extends cn{},Ro=class extends cn{},Gc=class extends cn{},Wc=class extends cn{},Vn=class extends cn{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=Ci(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 Vn(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Vn(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 $o(t){return!(!Uae(t)||t.length===0)}function Uae(t){return!(typeof t!="string"||t.length>1024)}function fp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Io(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function qb(t){return t.get("x-amz-version-id")??null}function Kc(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 Mb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Ub(t,e){return`${Mb(e)}/${t}/s3/aws4_request`}async function dp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),fp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Vae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],hp=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",m=a++;try{if(m==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:Io(w.headers.get("etag")??void 0),versionId:qb(w.headers)};return}m===1&&(u=(await Hae({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let w of Vae){let x=o[w];x&&(b[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:m.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:m,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 zae({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 Hae(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=Ci(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 zae({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
275
+ `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),A.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&&(p.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();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} ${Q(a)}`),(0,pN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else p.error("Unlink it first"),A.error("")}async function Lae(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&&(p.error(`App Version ${e}@${r} not found in database`),A.error(""))}async function Xh(t,e,r){let n=await Bae(t,e,r);await cN(t,e,n),await mN(t,e,n),await Lae(t,e,r)}function Zh(t){t.length||(p.error("No bundle found"),(0,gN.exit)(1));let e=new dr;e.theme=dr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ya(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Qh(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&&(p.error(`App ${e} not found in database`),A.error("")),r}async function yN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(p.error(`App ${e} not found in database`),A.error("")),r.map(i=>i.version)}async function Bae(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)&&(p.error(`App Version ${e}@${r} doesn't exist`),A.error("")),n}async function qae(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${ya(n.created_at)}`),await Xh(e,r,n.name)}function Mae(t,e,r){let n=[];return t?.forEach(i=>{let o=qn(i.name);Ib(o,e)&&Ta(o,r)&&n.push(i)}),n}async function DN(t,e){Y("Cleanup versions in Capgo"),await De(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=ge(t,o?.config),e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await Me(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Qh(s,t),u=await yN(s,t);if(p.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){p.error("No versions found, aborting cleanup");return}if(r){let f=qn(r),h=oN(f,"major");p.info(`Querying available versions in Capgo between ${ka(f)} and ${ka(h)}`),a=Mae(a,f,h),p.info(`Active versions in Capgo between ${ka(f)} and ${ka(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){p.warn("Nothing to be removed, aborting removal...");return}if(Zh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(Pt(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,Nb.exit)())}p.success("You have confirmed removal, removing versions now"),await qae(c,s,t),X("Done \u2705"),(0,Nb.exit)()}var an=require("node:fs"),EN=require("node:process");var Hc=require("node:buffer"),qt=require("node:crypto"),vN="aes-128-cbc",bN="sha256",ep="base64",wN=qt.constants.RSA_PKCS1_OAEP_PADDING;function _N(t,e,r){let[n,i]=e.split(":"),o=(0,qt.privateDecrypt)({key:r,padding:wN,oaepHash:bN},Hc.Buffer.from(i,ep)),s=Hc.Buffer.from(n,ep),a=(0,qt.createDecipheriv)(vN,o,s);return a.setAutoPadding(!0),Hc.Buffer.concat([a.update(t),a.final()])}function tp(t,e){let r=(0,qt.randomBytes)(16),n=(0,qt.randomBytes)(16),i=(0,qt.createCipheriv)(vN,n,r);i.setAutoPadding(!0);let o=r.toString(ep),s=(0,qt.publicEncrypt)({key:e,padding:wN,oaepHash:bN},n).toString(ep),a=`${o}:${s}`;return{encryptedData:Hc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function rp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,qt.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 De(),(0,an.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(rr)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${rr} or in ${n.path}`),A.error(""));let i=r.key||rr,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,an.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=_N(s,e,r.keyData??o??"");(0,an.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,EN.exit)()}var un=require("node:fs"),ON=require("node:process");var AN=le(bu());var Ro=require("node:buffer"),kt=require("node:crypto"),SN="aes-128-cbc",_i="base64",np=kt.constants.RSA_PKCS1_PADDING;function xN(t,e,r){let[n,i]=e.split(":"),o=(0,kt.publicDecrypt)({key:r,padding:np},Ro.Buffer.from(i,_i)),s=Ro.Buffer.from(n,_i),a=(0,kt.createDecipheriv)(SN,o,s);return a.setAutoPadding(!0),Ro.Buffer.concat([a.update(t),a.final()])}function ip(t,e){return(0,kt.privateEncrypt)({key:e,padding:np},Ro.Buffer.from(t,_i)).toString(_i)}function FN(t,e){return(0,kt.publicDecrypt)({key:e,padding:np},Ro.Buffer.from(t,_i)).toString(_i)}function op(t,e){let r=(0,kt.randomBytes)(16),n=(0,kt.randomBytes)(16),i=(0,kt.createCipheriv)(SN,n,r);i.setAutoPadding(!0);let o=r.toString(_i),s=(0,kt.privateEncrypt)({key:e,padding:np},n).toString(_i),a=`${o}:${s}`;return{encryptedData:Ro.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function kN(t,e,r){Y("Decrypt zip file"),await De(),(0,un.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,un.existsSync)(Nn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${Nn} or in ${n.path}`),A.error(""));let i=r.key||Nn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,un.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,un.existsSync)(i)&&(o=(0,un.readFileSync)(i).toString());let s=(0,un.readFileSync)(t),a=xN(s,e,r.keyData??o??"");if((0,un.writeFileSync)(`${t}_decrypted.zip`,a),p.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?(p.error(`Checksum does not match ${u} !== ${c}`),A.error("")):p.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||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await Me(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),p.info(`Deleting bundle ${e}@${t} from Capgo`),p.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Xh(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,TN.exit)()}var Ei=require("node:fs"),RN=require("node:process");async function $N(t,e){Y("Encryption"),await De(),(0,Ei.existsSync)(t)||(p.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||fr,n=e.keyData||"";(0,Ei.existsSync)(r)&&(n=(0,Ei.readFileSync)(r).toString());let i=(0,Ei.readFileSync)(t),o=tp(i,n);p.success(`ivSessionKey: ${o.ivSessionKey}`),(0,Ei.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),p.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,RN.exit)()}var Mn=require("node:fs"),IN=require("node:process");async function jN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await De());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&p.warning("There is still a privateKey in the config"),(0,Mn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||lr,u=r.keyData||"";!(0,Mn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),A.error("")):(0,Mn.existsSync)(a)&&(u=(0,Mn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,Mn.readFileSync)(t),l=op(c,u),f=ip(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(p.success(`Encoded Checksum: ${f}`),p.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,Mn.writeFileSync)(h,l.encryptedData),n||(p.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 De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await Me(n,e.apikey,t,1);let i=await Qh(n,t);p.info(`Active versions in Capgo: ${i?.length}`),Zh(i),X("Done \u2705"),(0,NN.exit)()}var rL=require("node:crypto"),ln=require("node:fs"),nL=require("node:process");function zc(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 sp=32*1024,Lb=2**32-2,ap=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=zc(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 zc(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)zc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Lb)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Lb));zc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Lb)),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(sp);for(;;){let i=this.capacity-this.length<sp,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(sp);for(;;){let i=this.capacity-this.length<sp,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 up=class extends TransformStream{constructor(e){let r=new ap;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 Ci(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 m=o();if(!m)return h;h.attributes[m.name]=m.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 cn=class extends Error{constructor(e){super(e)}};var Ar=class extends cn{},cp=class extends cn{},lp=class extends cn{},Un=class extends cn{},$o=class extends cn{},Gc=class extends cn{},Wc=class extends cn{},Vn=class extends cn{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=Ci(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 Vn(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Vn(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 Io(t){return!(!Uae(t)||t.length===0)}function Uae(t){return!(typeof t!="string"||t.length>1024)}function fp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function jo(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function qb(t){return t.get("x-amz-version-id")??null}function Kc(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 Mb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Ub(t,e){return`${Mb(e)}/${t}/s3/aws4_request`}async function dp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),fp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Vae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],hp=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",m=a++;try{if(m==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:jo(w.headers.get("etag")??void 0),versionId:qb(w.headers)};return}m===1&&(u=(await Hae({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let w of Vae){let x=o[w];x&&(b[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:m.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:m,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 zae({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 Hae(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=Ci(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 zae({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=Ci(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=qb(s.headers);return{etag:Io(c),versionId:l}}var Vb="AWS4-HMAC-SHA256";async function UN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new Gc("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=fp(await Pa(o,i)).toLowerCase();return`${Vb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function VN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new Gc("secretKey is required for signing");if(t.expirySeconds<1)throw new Wc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Wc("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=Kc(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",Vb),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=fp(await Pa(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 jo={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},Gae="-._~".split("").map(t=>t.charCodeAt(0));function Wae(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=jo.A&&i<=jo.Z||i>=jo.a&&i<=jo.z||i>=jo[0]&&i<=jo[9]||Gae.includes(i)||i==jo["/"]&&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(Wae(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=Ci(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=qb(s.headers);return{etag:jo(c),versionId:l}}var Vb="AWS4-HMAC-SHA256";async function UN(t){if(!t.accessKey)throw new $o("accessKey is required for signing");if(!t.secretKey)throw new Gc("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=fp(await Pa(o,i)).toLowerCase();return`${Vb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function VN(t){if(!t.accessKey)throw new $o("accessKey is required for signing");if(!t.secretKey)throw new Gc("secretKey is required for signing");if(t.expirySeconds<1)throw new Wc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Wc("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=Kc(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",Vb),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=fp(await Pa(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 No={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},Gae="-._~".split("").map(t=>t.charCodeAt(0));function Wae(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=No.A&&i<=No.Z||i>=No.a&&i<=No.z||i>=No[0]&&i<=No[9]||Gae.includes(i)||i==No["/"]&&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(Wae(s,!0)),u.push(a),u.push(o.join(`
281
281
  `)+`
282
282
  `),u.push(n.join(";").toLowerCase()),u.push(i),u.join(`
283
283
  `)}async function GN(t,e,r){let n=await dp(t),i=Ub(r,e),o=[];return o.push(Vb),o.push(Kc(e)),o.push(i),o.push(n),o.join(`
284
- `)}async function WN(t,e,r){let n=Mb(t),i=await Pa("AWS4"+r,n),o=await Pa(i,e),s=await Pa(o,"s3");return await Pa(s,"aws4_request")}function KN(t,e,r){return`${t}/${Ub(e,r)}`}async function Pa(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 Kae=["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"],Yae=5*1024*1024,Jae=5*1024*1024*1024,Hb=5*1024*1024*1024*1024,Yc=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 cp(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!qN(e.port))throw new Ar(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Ar("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Ar("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 lp(`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 dp(r??new Uint8Array);o.set("x-amz-date",Kc(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 Vn(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 Vn(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(!$o(e))throw new Un(`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 Vn&&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(!$o(e))throw new Un(`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 Ro(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!$o(r))throw new Un(`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 Ar("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=Ci(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(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:Io(d.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(d.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(m=>m.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,m)=>{let b=d.type==="Object"?d.key:d.prefix,g=m.type==="Object"?m.key:m.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(m=>m.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(!$o(e))throw new Un(`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 Ar("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Ar(`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 Ar(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<Yae)throw new Ar("Part size should be greater than 5MB");if(a>Jae)throw new Ar("Part size should be less than 6MB");let u=new up(a),c=new hp({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=Hb),e>Hb)throw new TypeError(`size should not be more than ${Hb}`);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(!$o(e))throw new Un(`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 Kae)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:Io(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!$o(r))throw new Un(`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=Ci(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:Io(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 Vn&&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 zb=le(bu());var Si=require("node:fs"),Jc=require("node:path");function Xae(t,e){return(0,Si.readFileSync)(t,"utf8").includes(e)}function Xc(t,e){let r=(0,Si.readdirSync)(t);for(let n of r){let i=(0,Jc.join)(t,n),o=(0,Si.statSync)(i);if(o.isDirectory()){if(Xc(i,e))return!0}else if(o.isFile()&&(0,Jc.extname)(i)===".js"&&Xae(i,e))return!0}return!1}function Zc(t){let e=(0,Si.readdirSync)(t);if(e.length===1){let n=(0,Jc.join)(t,e[0]);if((0,Si.statSync)(n).isDirectory())return Zc(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=le(nD());async function eL(t,e,r,n){let i=be();i.start("Generating the update manifest");let o=await aj(t);return i.stop("Manifest generated successfully"),await Fe(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=be();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Sr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,JN.join)(r,h.file),m=(0,YN.createReadStream)(d).pipe((0,ZN.createBrotliCompress)()),b=await(0,XN.buffer)(m);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){p.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),m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${m} seconds)`),await Fe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Fe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:m},notify:!1}),h}catch(h){let m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${m} seconds)`),p.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function Zae(t,e){let r=await Lt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,rL.randomUUID)().split("-")[0]}`;return da.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function Qae(t){let e=t.apikey||pe();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function eue(t,e,r){let n=ge(t,r),i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,ln.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function tue(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Xc(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Zc(e)||(p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")))}async function rue(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=be();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await $h(t,i,n,r.packageJson,r.nodeModules);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,p.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:D}=c.version;(!D||!da.test(D))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(p.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await sb(r.packageJson,r.nodeModules),a&&(u=o,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(p.error("You need to provide a min-update-version to upload a bundle to this channel"),A.error("")),u&&(da.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let m=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function nue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
284
+ `)}async function WN(t,e,r){let n=Mb(t),i=await Pa("AWS4"+r,n),o=await Pa(i,e),s=await Pa(o,"s3");return await Pa(s,"aws4_request")}function KN(t,e,r){return`${t}/${Ub(e,r)}`}async function Pa(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 Kae=["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"],Yae=5*1024*1024,Jae=5*1024*1024*1024,Hb=5*1024*1024*1024*1024,Yc=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 cp(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!qN(e.port))throw new Ar(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Ar("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Ar("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 lp(`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 dp(r??new Uint8Array);o.set("x-amz-date",Kc(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 Vn(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 Vn(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(!Io(e))throw new Un(`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 Vn&&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(!Io(e))throw new Un(`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 $o(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Io(r))throw new Un(`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 Ar("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=Ci(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(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:jo(d.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(d.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(m=>m.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,m)=>{let b=d.type==="Object"?d.key:d.prefix,g=m.type==="Object"?m.key:m.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(m=>m.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(!Io(e))throw new Un(`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 Ar("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Ar(`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 Ar(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<Yae)throw new Ar("Part size should be greater than 5MB");if(a>Jae)throw new Ar("Part size should be less than 6MB");let u=new up(a),c=new hp({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=Hb),e>Hb)throw new TypeError(`size should not be more than ${Hb}`);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(!Io(e))throw new Un(`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 Kae)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:jo(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Io(r))throw new Un(`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=Ci(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:jo(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 Vn&&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 zb=le(bu());var Si=require("node:fs"),Jc=require("node:path");function Xae(t,e){return(0,Si.readFileSync)(t,"utf8").includes(e)}function Xc(t,e){let r=(0,Si.readdirSync)(t);for(let n of r){let i=(0,Jc.join)(t,n),o=(0,Si.statSync)(i);if(o.isDirectory()){if(Xc(i,e))return!0}else if(o.isFile()&&(0,Jc.extname)(i)===".js"&&Xae(i,e))return!0}return!1}function Zc(t){let e=(0,Si.readdirSync)(t);if(e.length===1){let n=(0,Jc.join)(t,e[0]);if((0,Si.statSync)(n).isDirectory())return Zc(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=le(nD());async function eL(t,e,r,n){let i=be();i.start("Generating the update manifest");let o=await aj(t);return i.stop("Manifest generated successfully"),await Fe(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=be();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Sr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,JN.join)(r,h.file),m=(0,YN.createReadStream)(d).pipe((0,ZN.createBrotliCompress)()),b=await(0,XN.buffer)(m);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){p.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),m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${m} seconds)`),await Fe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Fe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:m},notify:!1}),h}catch(h){let m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${m} seconds)`),p.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function Zae(t,e){let r=await Lt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,rL.randomUUID)().split("-")[0]}`;return ha.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function Qae(t){let e=t.apikey||pe();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function eue(t,e,r){let n=ge(t,r),i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,ln.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function tue(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Xc(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Zc(e)||(p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")))}async function rue(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=be();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await $h(t,i,n,r.packageJson,r.nodeModules);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,p.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:D}=c.version;(!D||!ha.test(D))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(p.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await sb(r.packageJson,r.nodeModules),a&&(u=o,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(p.error("You need to provide a min-update-version to upload a bundle to this channel"),A.error("")),u&&(ha.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let m=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function nue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
285
285
  Trial expires in ${n} days`),p.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function iue(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(p.error(`Version already exists ${Q(i)}`),A.error(""))}async function oue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Ph(t);let f=be();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,ln.existsSync)(lr))&&c!==!1?a=await(0,zb.checksum)(u,"sha256"):a=await(0,zb.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)p.info("Encryption ignored");else if((l||(0,ln.existsSync)(lr)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:lr,m=e.keyDataV2||"";!m&&!(0,ln.existsSync)(d)&&(p.error(`Cannot find private key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),m||(m=(0,ln.readFileSync)(d).toString()),p.info("Encrypting your bundle with V2");let b=op(u,m);a=ip(a,m),s=b.ivSessionKey,e.displayIvSession&&p.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
@@ -292,7 +292,7 @@ It will be also visible in your dashboard
292
292
  The app size is ${h} Mb, this may take a while to download for users
293
293
  `),p.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
294
294
  `),await Fe(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 sue(t,e,r,n,i,o,s){let a=be();a.start("Uploading Bundle");let u=performance.now(),c=!1;if(s.dryRun){a.stop(`Dry run, bundle not uploaded
295
- Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Sr();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?p.info("Uploading bundle with multipart protocol, multipart is deprecated"):p.info("Uploading bundle with TUS protocol"),await uj(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:m}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);m&&(p.error(`Cannot finish TUS upload ${Q(m)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await oj(e,r,n);d||(p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await zr.put(d,{timeout:s.timeout||Z6,retry:5,body:o})}}catch(h){let m=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${m} seconds)`),h instanceof ri){let b=await h.response.json();p.error(`Response Error: ${b.error||b.status||b.message}`)}else p.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await cj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await Fe(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 aue(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||(p.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await Rh(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=_o(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?p.info("Your update is now available in your public channel \u{1F389}"):f?.id&&p.info(`Link device to this bundle to try it: ${d}`),r?p.info(`Bundle url: ${d}`):c||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function uue(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){p.warn("Cannot find default upload channel");let o=_o(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function pp(t,e,r=!0){Y(`Uploading with CLI version ${jr.version}`);let n=Bt();await De();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=Qae(e),h=await ee(),d=await Q6(),{appid:m,path:b}=eue(t,e,h.config),g=await Zae(h.config,e);e.autoSetBundle&&await ha({version:g}),tue(e,b),p.info(`Upload ${m}@${g} started from path "${b}" to Capgo cloud`);let w=await Sr(),x=await de(f),D=await me(x,f,["write","all","upload"]),C=e.channel||await uue(m,x,w.hostWeb)||"dev",k=await xr(x,m);await pa(x,k,f,m,!0),await nue(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await rue(x,n,e,C,m,g);await iue(x,m,g),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:m,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:D,checksum:void 0},S=null;if(e.external)await Fe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":m},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await oue(b,e,w,f,k,m);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await fj(x,m,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await eL(b,f,k,m):[],{error:R}=await ob(x,L);if(R&&(p.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),p.info("Uploading to S3");let q=new Yc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${m}-${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 sue(f,x,m,g,k,S,e);let q=null;try{e.dryRun&&(e.partial=!1),q=e.partial?await tL(f,I,b,m,g,k):null}catch(M){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(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 ob(x,L);K&&(p.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await Me(x,f,m,2);return ej(B,3)?await aue(x,f,!!e.bundleUrl,g,C,D,k,m,w):p.warn("Cannot set channel as a upload organization member"),await Fe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":m},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,nL.exit)()),!0}function iL(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),A.error("")),t.dryRun&&t.external&&(p.error("You cannot use the --dry-run option with an external url"),A.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(p.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function oL(t,e){try{iL(e),await pp(t,e,!0)}catch(r){p.error(Q(r)),A.error("")}}async function sL(t,e){let r=Bt();p.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{iL(e),await pp(t,e,!0)}catch(n){p.error(Q(n)),A.error("")}}var aL=require("node:crypto"),mp=require("node:fs"),uL=require("node:process");var Gb=le(bu());var cue=20;async function cL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await De();let o=await ee();t=ge(t,o?.config);let s=(0,aL.randomUUID)().split("-")[0],a=await Lt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!da.test(r)&&(i?console.error(Q({error:"invalid_semver"})):p.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):p.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),A.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Xc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Zc(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")));let c=await Ph(n);i||p.info(`Zipped ${c.byteLength} bytes`);let l=be();i||l.start("Calculating checksum");let f="";e.keyV2||(0,mp.existsSync)(lr)?f=await(0,Gb.checksum)(c,"sha256"):f=await(0,Gb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>cue&&!i&&(p.warn(`WARNING !!
295
+ Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Sr();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?p.info("Uploading bundle with multipart protocol, multipart is deprecated"):p.info("Uploading bundle with TUS protocol"),await uj(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:m}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);m&&(p.error(`Cannot finish TUS upload ${Q(m)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await oj(e,r,n);d||(p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await zr.put(d,{timeout:s.timeout||Z6,retry:5,body:o})}}catch(h){let m=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${m} seconds)`),h instanceof ri){let b=await h.response.json();p.error(`Response Error: ${b.error||b.status||b.message}`)}else p.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await cj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await Fe(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 aue(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||(p.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await Rh(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=Eo(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?p.info("Your update is now available in your public channel \u{1F389}"):f?.id&&p.info(`Link device to this bundle to try it: ${d}`),r?p.info(`Bundle url: ${d}`):c||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function uue(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){p.warn("Cannot find default upload channel");let o=Eo(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function pp(t,e,r=!0){Y(`Uploading with CLI version ${jr.version}`);let n=Bt();await De();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=Qae(e),h=await ee(),d=await Q6(),{appid:m,path:b}=eue(t,e,h.config),g=await Zae(h.config,e);e.autoSetBundle&&await _o({version:g}),tue(e,b),p.info(`Upload ${m}@${g} started from path "${b}" to Capgo cloud`);let w=await Sr(),x=await de(f),D=await me(x,f,["write","all","upload"]),C=e.channel||await uue(m,x,w.hostWeb)||"dev",k=await xr(x,m);await pa(x,k,f,m,!0),await nue(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await rue(x,n,e,C,m,g);await iue(x,m,g),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:m,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:D,checksum:void 0},S=null;if(e.external)await Fe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":m},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await oue(b,e,w,f,k,m);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await fj(x,m,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await eL(b,f,k,m):[],{error:R}=await ob(x,L);if(R&&(p.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),p.info("Uploading to S3");let q=new Yc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${m}-${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 sue(f,x,m,g,k,S,e);let q=null;try{e.dryRun&&(e.partial=!1),q=e.partial?await tL(f,I,b,m,g,k):null}catch(M){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(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 ob(x,L);K&&(p.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await Me(x,f,m,2);return ej(B,3)?await aue(x,f,!!e.bundleUrl,g,C,D,k,m,w):p.warn("Cannot set channel as a upload organization member"),await Fe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":m},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,nL.exit)()),!0}function iL(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),A.error("")),t.dryRun&&t.external&&(p.error("You cannot use the --dry-run option with an external url"),A.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(p.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function oL(t,e){try{iL(e),await pp(t,e,!0)}catch(r){p.error(Q(r)),A.error("")}}async function sL(t,e){let r=Bt();p.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{iL(e),await pp(t,e,!0)}catch(n){p.error(Q(n)),A.error("")}}var aL=require("node:crypto"),mp=require("node:fs"),uL=require("node:process");var Gb=le(bu());var cue=20;async function cL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await De();let o=await ee();t=ge(t,o?.config);let s=(0,aL.randomUUID)().split("-")[0],a=await Lt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!ha.test(r)&&(i?console.error(Q({error:"invalid_semver"})):p.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):p.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),A.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Xc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Zc(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")));let c=await Ph(n);i||p.info(`Zipped ${c.byteLength} bytes`);let l=be();i||l.start("Calculating checksum");let f="";e.keyV2||(0,mp.existsSync)(lr)?f=await(0,Gb.checksum)(c,"sha256"):f=await(0,Gb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>cue&&!i&&(p.warn(`WARNING !!
296
296
  The app size is ${h} Mb, this may take a while to download for users
297
297
  `),p.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
298
298
  `));let d=be(),m=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${m}`),(0,mp.writeFileSync)(m,c),i||d.stop(`Saved to ${m}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:m,checksum:f},null,2)),(0,uL.exit)()}catch(r){p.error(Q(r)),A.error("")}}var lL=require("node:process");async function Wb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||pe();let i=await ee();e=ge(e,i?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey);await me(o,r.apikey,["write","all"]),await Me(o,r.apikey,e,4),p.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await jb(o,e),a=await xr(o,e);s||(p.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),A.error(""));let u=await lN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(p.error(`Cannot create Channel \u{1F640}
@@ -305,13 +305,13 @@ ${Q(u.error)}`),A.error("")),p.success("Channel created \u2705"),await Fe(r.apik
305
305
  Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableAutoUpdateUnderNative"?(p.error(`The version number you uploaded to your default channel in Capgo, is lower than the present in the device ${t.device_id}.`),p.error(`To fix it, ensure the variable:
306
306
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
307
307
  - Android: versionName
308
- Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(p.error(`Dev build is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(p.error(`Emulator is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(p.error(`We cannot get your bundle from the default channel. ${i}`),p.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?p.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?p.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"?(p.error("Your bundle has been installed but failed to call notifyAppReady()"),p.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?p.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):p.error(`Log from Capgo ${t.action}`)}return!0}async function rw(t,e,r,n,i){let o=!0,s=_o(r),a=await Sr(),u=`${a.hostWeb}/app/p/${s}`;await zn(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=be();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await xue(5e3);let h=await Oue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await Aue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function NL(t,e){Y("Debug Live update in Capgo"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let n=e.device;e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await xr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await Fue("debug",s,o,e.apikey),s?(p.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await rw("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,tw.exit)()}var Mt=require("node:fs");async function kue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||Nn,i=t.keyData||"";if(!(0,Mt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Mt.existsSync)(n)&&(i=(0,Mt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),A.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,p.info("Old private key deleted from config file"),await Pe({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 sn(r)),e&&(p.success(`public key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function Tue(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 sn(r),(0,Mt.existsSync)(rr))try{(0,Mt.unlinkSync)(rr),e&&p.success(`Old private key file deleted: ${rr}`)}catch{e&&p.error(`Failed to delete old private key file: ${rr}`)}if((0,Mt.existsSync)(fr))try{(0,Mt.unlinkSync)(fr),e&&p.success(`Old public key file deleted: ${fr}`)}catch{e&&p.error(`Failed to delete old public key file: ${Nn}`)}return e&&p.success(`Old private key deleted from ${r.path} file`),!0}else return e&&p.info("No old private key found in config file"),!1}async function LL(t){Y("Save keys \u{1F511}"),await De(),await kue(t)}async function nw(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,Mt.existsSync)(Nn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Mt.writeFileSync)(Nn,r),(0,Mt.existsSync)(lr)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Mt.writeFileSync)(lr,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,p.info("Old private key deleted from config file"),await Pe({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,sn(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${lr}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Public key saved in ${i.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),X("Done \u2705")),!0}async function BL(t){await De(),await nw(t)}async function qL(t){await De(),await Tue(t)}var Gn=require("node:fs"),ow=require("node:os"),iw=require("node:process");async function ML(){let t=(0,ow.homedir)();return(0,Gn.existsSync)(`${t}/.capgo`)||(0,Gn.existsSync)(".capgo")}async function sw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await De();try{let{local:n}=e;if(n)(0,Gn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),A.error("")),(0,Gn.writeFileSync)(".capgo",`${t}
308
+ Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(p.error(`Dev build is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(p.error(`Emulator is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(p.error(`We cannot get your bundle from the default channel. ${i}`),p.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?p.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?p.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"?(p.error("Your bundle has been installed but failed to call notifyAppReady()"),p.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?p.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):p.error(`Log from Capgo ${t.action}`)}return!0}async function rw(t,e,r,n,i){let o=!0,s=Eo(r),a=await Sr(),u=`${a.hostWeb}/app/p/${s}`;await zn(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=be();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await xue(5e3);let h=await Oue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await Aue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function NL(t,e){Y("Debug Live update in Capgo"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let n=e.device;e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await xr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await Fue("debug",s,o,e.apikey),s?(p.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await rw("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,tw.exit)()}var Mt=require("node:fs");async function kue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||Nn,i=t.keyData||"";if(!(0,Mt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Mt.existsSync)(n)&&(i=(0,Mt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),A.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,p.info("Old private key deleted from config file"),await Pe({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 sn(r)),e&&(p.success(`public key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function Tue(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 sn(r),(0,Mt.existsSync)(rr))try{(0,Mt.unlinkSync)(rr),e&&p.success(`Old private key file deleted: ${rr}`)}catch{e&&p.error(`Failed to delete old private key file: ${rr}`)}if((0,Mt.existsSync)(fr))try{(0,Mt.unlinkSync)(fr),e&&p.success(`Old public key file deleted: ${fr}`)}catch{e&&p.error(`Failed to delete old public key file: ${Nn}`)}return e&&p.success(`Old private key deleted from ${r.path} file`),!0}else return e&&p.info("No old private key found in config file"),!1}async function LL(t){Y("Save keys \u{1F511}"),await De(),await kue(t)}async function nw(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,Mt.existsSync)(Nn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Mt.writeFileSync)(Nn,r),(0,Mt.existsSync)(lr)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Mt.writeFileSync)(lr,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,p.info("Old private key deleted from config file"),await Pe({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,sn(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${lr}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Public key saved in ${i.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),X("Done \u2705")),!0}async function BL(t){await De(),await nw(t)}async function qL(t){await De(),await Tue(t)}var Gn=require("node:fs"),ow=require("node:os"),iw=require("node:process");async function ML(){let t=(0,ow.homedir)();return(0,Gn.existsSync)(`${t}/.capgo`)||(0,Gn.existsSync)(".capgo")}async function sw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await De();try{let{local:n}=e;if(n)(0,Gn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),A.error("")),(0,Gn.writeFileSync)(".capgo",`${t}
309
309
  `),(0,Gn.appendFileSync)(".gitignore",`.capgo
310
310
  `);else{let s=(0,ow.homedir)();(0,Gn.writeFileSync)(`${s}/.capgo`,`${t}
311
311
  `)}let i=await de(t),o=await me(i,t,["write","all","upload"]);await Fe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),p.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{p.error("Error while saving login"),(0,iw.exit)(1)}return r&&(X("Done \u2705"),(0,iw.exit)()),!0}async function UL(t,e){sw(t,e,!0)}var VL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",yp="CapacitorUpdater.notifyAppReady()",Pue=/import.*from.*/g,Qc="production",HL={stdio:"pipe"},Ia;function zL(){Ia||(Ia=(0,ut.readdirSync)(vp.default.tmpdir).map(t=>({name:t,full:`${vp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??vp.default.fileSync({prefix:"capgocli"}).name)}function xi(t){try{zL(),(0,ut.writeFileSync)(Ia,JSON.stringify({step_done:t}))}catch(e){p.error(`Cannot mark step as done in the CLI, error:
312
312
  ${e}`),p.warn("Onboarding will continue but please report it to the capgo team!")}}async function Rue(t,e){try{zL();let r=(0,ut.readFileSync)(Ia,"utf-8");if(!r||r.length===0)return;let{step_done:n}=JSON.parse(r);p.info(`You have already got to the step ${n}/10 in the previous session`);let i=await Pe({message:"Would you like to continue from where you left off?"});return await dn(i,t,e),i?n:void 0}catch(r){p.error(`Cannot read which steps have been compleated, error:
313
313
  ${r}`),p.warn("Onboarding will continue but please report it to the capgo team!");return}}function $ue(){if(Ia)try{(0,ut.rmSync)(Ia)}catch(t){p.error(`Cannot delete the tmp steps file.
314
- Error: ${t}`)}}async function dn(t,e,r){Pt(t)&&(await zn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,ir.exit)())}async function Ir(t,e,r){return zn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Iue(t,e,r,n){let i=Bt(),o=await Pe({message:`Add ${r} in Capgo?`});if(await dn(o,t.gid,e),o){let s=be();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await xb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else p.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await Ir(t.gid,e,2)}async function jue(t,e,r){let n=Bt(),i=await Pe({message:`Create default channel ${Qc} for ${r} in Capgo?`});if(await dn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Qc} ${r} --default`),await Wb(Qc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else p.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Qc} ${r} --default"`);await Ir(t,e,3)}var Nue="https://capacitorjs.com/docs/updating/6-0",Lue="https://capacitorjs.com/docs/updating/5-0";async function Bue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await dn(i,t,e),i){let o=be();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await Lt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=qn(u?.replace("^","").replace("~","")),u?Ta(u,qn("5.0.0"))?(o.stop("Error"),p.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Lue}`),X("Bye \u{1F44B}"),(0,ir.exit)()):Ta(u,qn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${Nue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),p.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,ir.exit)()),n.pm==="unknown"&&(o.stop("Error"),p.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,ir.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,el.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,HL);let c=await Lt();await ha({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else p.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await Ir(t,e,4)}async function que(t,e,r){let n=await Pe({message:`Automatic Add "${yp}" code and import in ${r}?`});if(await dn(n,t,e),n){let i=be();i.start("Adding @capacitor-updater to your main file");let o=await ib();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,Dp.join)("plugins");(0,ut.existsSync)(s)||(0,ut.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,Dp.join)(s,"capacitorUpdater.client.ts"):a=(0,Dp.join)(s,"capacitorUpdater.client.js");let u=`
314
+ Error: ${t}`)}}async function dn(t,e,r){Pt(t)&&(await zn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,ir.exit)())}async function Ir(t,e,r){return zn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Iue(t,e,r,n){let i=Bt(),o=await Pe({message:`Add ${r} in Capgo?`});if(await dn(o,t.gid,e),o){let s=be();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await xb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else p.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await Ir(t.gid,e,2)}async function jue(t,e,r){let n=Bt(),i=await Pe({message:`Create default channel ${Qc} for ${r} in Capgo?`});if(await dn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Qc} ${r} --default`),await Wb(Qc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else p.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Qc} ${r} --default"`);await Ir(t,e,3)}var Nue="https://capacitorjs.com/docs/updating/6-0",Lue="https://capacitorjs.com/docs/updating/5-0";async function Bue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await dn(i,t,e),i){let o=be();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await Lt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=qn(u?.replace("^","").replace("~","")),u?Ta(u,qn("5.0.0"))?(o.stop("Error"),p.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Lue}`),X("Bye \u{1F44B}"),(0,ir.exit)()):Ta(u,qn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${Nue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),p.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,ir.exit)()),n.pm==="unknown"&&(o.stop("Error"),p.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,ir.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,el.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,HL);let c=await Lt();await _o({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else p.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await Ir(t,e,4)}async function que(t,e,r){let n=await Pe({message:`Automatic Add "${yp}" code and import in ${r}?`});if(await dn(n,t,e),n){let i=be();i.start("Adding @capacitor-updater to your main file");let o=await ib();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,Dp.join)("plugins");(0,ut.existsSync)(s)||(0,ut.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,Dp.join)(s,"capacitorUpdater.client.ts"):a=(0,Dp.join)(s,"capacitorUpdater.client.js");let u=`
315
315
  import { CapacitorUpdater } from '@capgo/capacitor-updater'
316
316
 
317
317
  export default defineNuxtPlugin(() => {
@@ -326,7 +326,7 @@ ${yp};
326
326
  ${VL};
327
327
 
328
328
  ${yp};
329
- `)}async function Mue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await dn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await nw({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),p.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,ir.exit)(1)),zn("onboarding-v2",t,e,"Use encryption v2")}await Ir(t,e,6)}async function Uue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await dn(i,t,e),i){let o=be(),s=await ib(),a=await nj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await Lt()).scripts[a]||(o.stop("Error"),p.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,ir.exit)()),(0,el.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,HL),o.stop("Build & Sync Done \u2705")}else p.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await Ir(t,e,7)}async function Vue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await dn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await pp(r,{channel:Qc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),p.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,ir.exit)())}else p.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await Ir(t,e,8)}async function Hue(t,e){let r=Bt(),n=await Pe({message:"Run in device now ?"});if(await dn(n,t,e),n){let i=await qo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});Pt(i)&&(X("Bye \u{1F44B}"),(0,ir.exit)());let o=i,s=be();s.start(`Running: ${r.runner} cap run ${o}`),await(0,el.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else p.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await Ir(t,e,9)}async function zue(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await dn(i,t,e),i)p.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await rw("onboarding-v2",e,r,e,t);else{let o=_o(r);p.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await Ir(t,e,10)}async function GL(t,e,r){let n=Bt();Y("Capgo onboarding \u{1F6EB}"),await De();let i=await ee(),o=await Sr();e=ge(e,i?.config),r.apikey=t||pe(),e===void 0&&(e=await Xp({message:"Enter your appId:"}),Pt(e)&&(Zp("Operation cancelled."),(0,ir.exit)(1)));let s=be();(!ML()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await sw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ga(a,["admin","super_admin"]),c=u.gid,l=await Rue(c,r.apikey)??0;try{l<1&&await Ir(c,r.apikey,1),l<2&&(await Iue(u,r.apikey,e,r),xi(2)),l<3&&(await jue(c,r.apikey,e),xi(3)),l<4&&(await Bue(c,r.apikey,e),xi(4)),l<5&&(await que(c,r.apikey,e),xi(5)),l<6&&(await Mue(c,r.apikey,e),xi(6)),l<7&&(await Uue(c,r.apikey,e),xi(7)),l<8&&(await Vue(c,r.apikey,e),xi(8)),l<9&&(await Hue(c,r.apikey),xi(9)),await zue(c,r.apikey,e,o.hostWeb),await Ir(c,r.apikey,0),$ue()}catch(f){console.error(f),p.error("Error during onboarding, please try again later"),(0,ir.exit)(1)}p.info("Welcome onboard \u2708\uFE0F!"),p.info("Your Capgo update system is setup"),p.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),p.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,ir.exit)()}var hn=require("node:fs");async function Gue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||rr,i=t.keyData||"";if(!(0,hn.existsSync)(n)&&!i)if(e)p.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,hn.existsSync)(n)&&(i=(0,hn.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 sn(r)),p&&(p.success(`private key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function WL(t){Y("Save keys \u{1F511}"),await De(),await Gue(t)}async function Wue(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,hn.existsSync)(fr)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,hn.writeFileSync)(fr,r),(0,hn.existsSync)(rr)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,hn.writeFileSync)(rr,n);let i=n.replace(/\\n/g,"\\n"),o=await ha({privateKey:i});return e&&(p.success("Your RSA key has been generated"),p.success(`Public key saved in ${fr}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Private key saved in ${o.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),X("Done \u2705")),!0}async function KL(t){await De(),await Wue(t)}async function YL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}async function JL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await Me(i,e.apikey,t,1);let{finalCompatibility:o}=await $h(i,t,n,e.packageJson,e.nodeModules),s=new dr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=dr.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])}),p.success("Compatibility"),p.success(s.toString())}A.name(jr.name).description("Manage packages and bundle versions in Capgo Cloud").version(jr.version,"-v, --version","output the current version");A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(UL).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(U8);A.command("init [apikey] [appId]").description("Init a new app").action(GL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path");var ja=A.command("app").description("Manage app");ja.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");ja.command("delete [appId]").description("Delete an app in Capgo Cloud").action(M8).option("-a, --apikey <apikey>","apikey to link to your account");ja.command("list").alias("l").description("list apps in Capgo Cloud").action(H8).option("-a, --apikey <apikey>","apikey to link to your account");ja.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(NL);ja.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);ja.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 pn=A.command("bundle").description("Manage bundle");pn.command("upload [appId]").alias("u").description("Upload a new bundle in 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("--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 (v1 system)").option("--key-data <keyData>","public signing key (v1 system)").option("--key-v2 <key>","custom path for private signing key (v2 system)").option("--key-data-v2 <keyDataV2>","private signing key (v2 system)").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.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-run","Dry run the upload process").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");pn.command("compatibility [appId]").action(JL).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").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");pn.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");pn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(LN).option("-a, --apikey <apikey>","apikey to link to your account");pn.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");pn.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");pn.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");pn.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");pn.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");pn.command("zip [appId]").description("Zip a bundle").action(cL).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 tl=A.command("channel").description("Manage channel");tl.command("add [channelId] [appId]").alias("a").description("Create channel").action(fL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");tl.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(mL).option("-a, --apikey <apikey>","apikey to link to your account");tl.command("list [appId]").alias("l").description("List channel").action(yL).option("-a, --apikey <apikey>","apikey to link to your account");tl.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(hL).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");tl.command("set [channelId] [appId]").alias("s").description("Set channel").action(bL).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 XL=A.command("key_old").description("Manage old encryption key");XL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(WL).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");XL.command("create").description("Create a new encryption key").action(KL).option("-f, --force","force generate a new one");var aw=A.command("key").description("Manage encryption key");aw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(LL).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");aw.command("create").description("Create a new encryption key").action(BL).option("-f, --force","force generate a new one");aw.command("delete_old").description("Delete the old encryption key").action(qL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(sL).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 Kue=A.command("account").description("Manage account");Kue.command("id").description("Get your account ID").action(YL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
329
+ `)}async function Mue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await dn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await nw({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),p.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,ir.exit)(1)),zn("onboarding-v2",t,e,"Use encryption v2")}await Ir(t,e,6)}async function Uue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await dn(i,t,e),i){let o=be(),s=await ib(),a=await nj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await Lt()).scripts[a]||(o.stop("Error"),p.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,ir.exit)()),(0,el.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,HL),o.stop("Build & Sync Done \u2705")}else p.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await Ir(t,e,7)}async function Vue(t,e,r){let n=Bt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await dn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await pp(r,{channel:Qc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),p.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,ir.exit)())}else p.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await Ir(t,e,8)}async function Hue(t,e){let r=Bt(),n=await Pe({message:"Run in device now ?"});if(await dn(n,t,e),n){let i=await Mo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});Pt(i)&&(X("Bye \u{1F44B}"),(0,ir.exit)());let o=i,s=be();s.start(`Running: ${r.runner} cap run ${o}`),await(0,el.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else p.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await Ir(t,e,9)}async function zue(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await dn(i,t,e),i)p.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await rw("onboarding-v2",e,r,e,t);else{let o=Eo(r);p.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await Ir(t,e,10)}async function GL(t,e,r){let n=Bt();Y("Capgo onboarding \u{1F6EB}"),await De();let i=!r.supaAnon||!r.supaHost?await ee():await _o({statsUrl:`${r.supaHost}/functions/v1/stats`,channelUrl:`${r.supaHost}/functions/v1/channel_self`,updateUrl:`${r.supaHost}/functions/v1/updates`,localApiFiles:`${r.supaHost}/functions/v1`,localS3:!0,localSupa:r.supaHost,localSupaAnon:r.supaAnon}),o=await Sr();e=ge(e,i?.config),r.apikey=t||pe(),e===void 0&&(e=await Xp({message:"Enter your appId:"}),Pt(e)&&(Zp("Operation cancelled."),(0,ir.exit)(1)));let s=be();(!ML()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await sw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ga(a,["admin","super_admin"]),c=u.gid,l=await Rue(c,r.apikey)??0;try{l<1&&await Ir(c,r.apikey,1),l<2&&(await Iue(u,r.apikey,e,r),xi(2)),l<3&&(await jue(c,r.apikey,e),xi(3)),l<4&&(await Bue(c,r.apikey,e),xi(4)),l<5&&(await que(c,r.apikey,e),xi(5)),l<6&&(await Mue(c,r.apikey,e),xi(6)),l<7&&(await Uue(c,r.apikey,e),xi(7)),l<8&&(await Vue(c,r.apikey,e),xi(8)),l<9&&(await Hue(c,r.apikey),xi(9)),await zue(c,r.apikey,e,o.hostWeb),await Ir(c,r.apikey,0),$ue()}catch(f){console.error(f),p.error("Error during onboarding, please try again later"),(0,ir.exit)(1)}p.info("Welcome onboard \u2708\uFE0F!"),p.info("Your Capgo update system is setup"),p.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),p.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,ir.exit)()}var hn=require("node:fs");async function Gue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||rr,i=t.keyData||"";if(!(0,hn.existsSync)(n)&&!i)if(e)p.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,hn.existsSync)(n)&&(i=(0,hn.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 sn(r)),p&&(p.success(`private key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function WL(t){Y("Save keys \u{1F511}"),await De(),await Gue(t)}async function Wue(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,hn.existsSync)(fr)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,hn.writeFileSync)(fr,r),(0,hn.existsSync)(rr)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,hn.writeFileSync)(rr,n);let i=n.replace(/\\n/g,"\\n"),o=await _o({privateKey:i});return e&&(p.success("Your RSA key has been generated"),p.success(`Public key saved in ${fr}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Private key saved in ${o.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),X("Done \u2705")),!0}async function KL(t){await De(),await Wue(t)}async function YL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}async function JL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await Me(i,e.apikey,t,1);let{finalCompatibility:o}=await $h(i,t,n,e.packageJson,e.nodeModules),s=new dr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=dr.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])}),p.success("Compatibility"),p.success(s.toString())}A.name(jr.name).description("Manage packages and bundle versions in Capgo Cloud").version(jr.version,"-v, --version","output the current version");A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(UL).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(U8);A.command("init [apikey] [appId]").description("Init a new app").action(GL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("--supa-host <supaHost>","Supabase host URL").option("--supa-anon <supaAnon>","Supabase anon token");var ja=A.command("app").description("Manage app");ja.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");ja.command("delete [appId]").description("Delete an app in Capgo Cloud").action(M8).option("-a, --apikey <apikey>","apikey to link to your account");ja.command("list").alias("l").description("list apps in Capgo Cloud").action(H8).option("-a, --apikey <apikey>","apikey to link to your account");ja.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(NL);ja.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);ja.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 pn=A.command("bundle").description("Manage bundle");pn.command("upload [appId]").alias("u").description("Upload a new bundle in 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("--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 (v1 system)").option("--key-data <keyData>","public signing key (v1 system)").option("--key-v2 <key>","custom path for private signing key (v2 system)").option("--key-data-v2 <keyDataV2>","private signing key (v2 system)").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.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-run","Dry run the upload process").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");pn.command("compatibility [appId]").action(JL).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").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");pn.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");pn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(LN).option("-a, --apikey <apikey>","apikey to link to your account");pn.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");pn.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");pn.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");pn.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");pn.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");pn.command("zip [appId]").description("Zip a bundle").action(cL).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 tl=A.command("channel").description("Manage channel");tl.command("add [channelId] [appId]").alias("a").description("Create channel").action(fL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");tl.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(mL).option("-a, --apikey <apikey>","apikey to link to your account");tl.command("list [appId]").alias("l").description("List channel").action(yL).option("-a, --apikey <apikey>","apikey to link to your account");tl.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(hL).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");tl.command("set [channelId] [appId]").alias("s").description("Set channel").action(bL).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 XL=A.command("key_old").description("Manage old encryption key");XL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(WL).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");XL.command("create").description("Create a new encryption key").action(KL).option("-f, --force","force generate a new one");var aw=A.command("key").description("Manage encryption key");aw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(LL).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");aw.command("create").description("Create a new encryption key").action(BL).option("-f, --force","force generate a new one");aw.command("delete_old").description("Delete the old encryption key").action(qL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(sL).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 Kue=A.command("account").description("Manage account");Kue.command("id").description("Get your account ID").action(YL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
330
330
  /*! Bundled license information:
331
331
 
332
332
  safe-buffer/index.js: