@capgo/cli 4.16.2 → 4.16.4

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -280,7 +280,7 @@ GFS4: `),console.error(e)});bt[Rr]||(Fce=global[Rr]||[],kce(bt,Fce),bt.close=fun
280
280
  `;function qce(e,t){var r=[],i="";typeof t=="string"?t={section:t,whitespace:!1}:(t=t||{},t.whitespace=t.whitespace===!0);var n=t.whitespace?" = ":"=";return Object.keys(e).forEach(function(s,a,o){var u=e[s];u&&Array.isArray(u)?u.forEach(function(l){i+=yf(s+"[]")+n+yf(l)+`
281
281
  `}):u&&typeof u=="object"?r.push(s):i+=yf(s)+n+yf(u)+HT}),t.section&&i.length&&(i="["+yf(t.section)+"]"+HT+i),r.forEach(function(s,a,o){var u=$ce(s).join("\\."),l=(t.section?t.section+".":"")+u,c=qce(e[s],{section:l,whitespace:t.whitespace});i.length&&c.length&&(i+=HT),i+=c}),i}function $ce(e){return e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(t){return t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function wze(e){var t={},r=t,i=null,n=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,s=e.split(/[\r\n]+/g);return s.forEach(function(a,o,u){if(!(!a||a.match(/^\s*[;#]/))){var l=a.match(n);if(l){if(l[1]!==void 0){if(i=b9(l[1]),i==="__proto__"){r={};return}r=t[i]=t[i]||{};return}var c=b9(l[2]);if(c!=="__proto__"){var p=l[3]?b9(l[4]):!0;switch(p){case"true":case"false":case"null":p=JSON.parse(p)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(p):r[c]=p}}}}),Object.keys(t).filter(function(a,o,u){if(!t[a]||typeof t[a]!="object"||Array.isArray(t[a]))return!1;var l=$ce(a),c=t,p=l.pop(),d=p.replace(/\\\./g,".");return l.forEach(function(f,h,m){f!=="__proto__"&&((!c[f]||typeof c[f]!="object")&&(c[f]={}),c=c[f])}),c===t&&d===p?!1:(c[d]=t[a],!0)}).forEach(function(a,o,u){delete t[a]}),t}function Mce(e){return e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'"}function yf(e){return typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Mce(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#")}function b9(e,t){if(e=(e||"").trim(),Mce(e)){e.charAt(0)==="'"&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch{}}else{for(var r=!1,i="",n=0,s=e.length;n<s;n++){var a=e.charAt(n);if(r)"\\;#".indexOf(a)!==-1?i+=a:i+="\\"+a,r=!1;else{if(";#".indexOf(a)!==-1)break;a==="\\"?r=!0:i+=a}}return r&&(i+="\\"),i.trim()}return e}});var Gce=g((wo,zce)=>{var Vce=jce(),Om=require("path"),D9=require("fs"),zT=Uce(),GT=require("events").EventEmitter,_ze=require("url"),bze=require("http"),wo=zce.exports=function(){for(var e=[].slice.call(arguments),t=new Kr;e.length;){var r=e.shift();r&&t.push(typeof r=="string"?Eze(r):r)}return t},Jct=wo.find=function(){var e=Om.join.apply(null,[].slice.call(arguments));function t(r,i){var n=Om.join(r,i);try{return D9.statSync(n),n}catch{if(Om.dirname(r)!==r)return t(Om.dirname(r),i)}}return t(__dirname,e)},Dze=wo.parse=function(e,t,r){if(e=""+e,r)if(r==="json")if(this.emit)try{return JSON.parse(e)}catch(i){this.emit("error",i)}else return JSON.parse(e);else return zT.parse(e);else try{return JSON.parse(e)}catch{return zT.parse(e)}},Eze=wo.json=function(){var e=[].slice.call(arguments).filter(function(i){return i!=null}),t=Om.join.apply(null,e),r;try{r=D9.readFileSync(t,"utf-8")}catch{return}return Dze(r,t,"json")},Zct=wo.env=function(e,t){t=t||process.env;var r={},i=e.length;for(var n in t)n.indexOf(e)===0&&(r[n.substring(i)]=t[n]);return r};wo.ConfigChain=Kr;function Kr(){GT.apply(this),Vce.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var Hce={constructor:{value:Kr}};Object.keys(GT.prototype).forEach(function(e){Hce[e]=Object.getOwnPropertyDescriptor(GT.prototype,e)});Kr.prototype=Object.create(Vce.prototype,Hce);Kr.prototype.del=function(e,t){if(t){var r=this.sources[t];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+t));delete r[e]}else for(var i=0,n=this.list.length;i<n;i++)delete this.list[i][e];return this};Kr.prototype.set=function(e,t,r){var i;if(r){if(i=this.sources[r],i=i&&i.data,!i)return this.emit("error",new Error("not found "+r))}else if(i=this.list[0],!i)return this.emit("error",new Error("cannot set, no confs!"));return i[e]=t,this};Kr.prototype.get=function(e,t){return t?(t=this.sources[t],t&&(t=t.data),t&&Object.hasOwnProperty.call(t,e)?t[e]:void 0):this.list[0][e]};Kr.prototype.save=function(e,s,r){typeof s=="function"&&(r=s,s=null);var i=this.sources[e];if(!i||!(i.path||i.source)||!i.data)return this.emit("error",new Error("bad save target: "+e));if(i.source){var n=i.prefix||"";return Object.keys(i.data).forEach(function(o){i.source[n+o]=i.data[o]}),this}var s=s||i.type,a=i.data;return i.type==="json"?a=JSON.stringify(a):a=zT.stringify(a),this._saving++,D9.writeFile(i.path,a,"utf8",function(o){if(this._saving--,o)return r?r(o):this.emit("error",o);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Kr.prototype.addFile=function(e,t,r){r=r||e;var i={__source__:r};return this.sources[r]={path:e,type:t},this.push(i),this._await(),D9.readFile(e,"utf8",function(n,s){n&&this.emit("error",n),this.addString(s,e,t,i)}.bind(this)),this};Kr.prototype.addEnv=function(e,t,r){r=r||"env";var i=wo.env(e,t);return this.sources[r]={data:i,source:t,prefix:e},this.add(i,r)};Kr.prototype.addUrl=function(e,t,r){this._await();var i=_ze.format(e);r=r||i;var n={__source__:r};return this.sources[r]={href:i,type:t},this.push(n),bze.request(e,function(s){var a=[],o=s.headers["content-type"];t||(t=o.indexOf("json")!==-1?"json":o.indexOf("ini")!==-1?"ini":i.match(/\.json$/)?"json":i.match(/\.ini$/)?"ini":null,n.type=t),s.on("data",a.push.bind(a)).on("end",function(){this.addString(Buffer.concat(a),i,t,n)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};Kr.prototype.addString=function(e,t,r,i){return e=this.parse(e,t,r),this.add(e,i),this};Kr.prototype.add=function(e,t){if(t&&typeof t=="object"){var r=this.list.indexOf(t);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,e),t=t.__source__,this.sources[t]=this.sources[t]||{},this.sources[t].data=e,this._resolve()}else typeof t=="string"&&(this.sources[t]=this.sources[t]||{},this.sources[t].data=e),this._await(),this.push(e),process.nextTick(this._resolve.bind(this));return this};Kr.prototype.parse=wo.parse;Kr.prototype._await=function(){this._awaiting++};Kr.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var Kce=g((Qct,Wce)=>{Wce.exports=function(e){let t=e.indexOf(":");if(t===-1)return WT(e);let r=e.substr(0,t),i=e.substr(t+1);return`${WT(r)}:${WT(i)}`};function WT(e){if(e=e.toLowerCase(),e==="_authtoken")return"_authToken";let t=e[0];for(let r=1;r<e.length;r++)t+=e[r]==="_"?"-":e[r];return t}});var Yce=g(E9=>{"use strict";Object.defineProperty(E9,"__esModule",{value:!0});E9.envReplace=void 0;var xze=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function Cze(e,t){return e.replace(xze,Sze.bind(null,t))}E9.envReplace=Cze;function Sze(e,t,r,i){if(r.length%2)return t.slice((r.length+1)/2);let n=Tze(e,i);if(n===void 0)throw new Error(`Failed to replace env in config: ${t}`);return`${r.slice(r.length/2)}${n}`}var Aze=/([^:-]+)(:?)-(.+)/;function Tze(e,t){let r=t.match(Aze);if(!r)return e[t];let[,i,n,s]=r;return Object.prototype.hasOwnProperty.call(e,i)?!e[i]&&n?s:e[i]:s}});var Xce=g(x9=>{"use strict";Object.defineProperty(x9,"__esModule",{value:!0});x9.envReplace=void 0;var Oze=Yce();Object.defineProperty(x9,"envReplace",{enumerable:!0,get:function(){return Oze.envReplace}})});var Zce=g(C9=>{"use strict";var Fze=require("fs"),yc=require("path"),{envReplace:Jce}=Xce(),Nze=(e,t,r)=>{if(typeof t!="string")return t;let i=[].concat(e[r]),n=i.indexOf(yc)!==-1,s=i.indexOf(Boolean)!==-1,a=i.indexOf(String)!==-1,o=i.indexOf(Number)!==-1;if(t=`${t}`.trim(),/^".*"$/.test(t))try{t=JSON.parse(t)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${t}`)}if(s&&!a&&t==="")return!0;switch(t){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return t=Jce(t,process.env),n&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(t)&&process.env.HOME&&(t=yc.resolve(process.env.HOME,t.substr(2))),t=yc.resolve(t)),o&&!isNaN(t)&&(t=Number(t)),t},kze=e=>{e=yc.resolve(e);let t=!1;for(;yc.basename(e)==="node_modules";)e=yc.dirname(e),t=!0;if(t)return e;let r=(i,n)=>{let s=/^[a-zA-Z]:(\\|\/)?$/;if(i==="/"||process.platform==="win32"&&s.test(i))return n;try{let a=Fze.readdirSync(i);if(a.includes("node_modules")||a.includes("package.json")||a.includes("package.json5")||a.includes("package.yaml")||a.includes("pnpm-workspace.yaml"))return i;let o=yc.dirname(i);return o===i?n:r(o,n)}catch(a){if(i===n){if(a.code==="ENOENT")return n;throw a}return n}};return r(e,e)};C9.envReplace=Jce;C9.findPrefix=kze;C9.parseField=Nze});var tpe=g(epe=>{"use strict";var vc=require("path"),Rze=require("stream").Stream,S9=require("url"),Pze=()=>{},Ize=()=>[],Qce=()=>{};epe.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:vc,cache:vc,"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:vc,"global-style":Boolean,group:[Number,String],"https-proxy":[null,S9],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":vc,"init-author-name":String,"init-author-email":String,"init-author-url":["",S9],"init-license":String,"init-version":Qce,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":Ize(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:Rze,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,Qce],"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:vc,production:Boolean,progress:Boolean,proxy:[null,!1,S9],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,S9],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:vc,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:vc,umask:Pze,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var spe=g((npt,npe)=>{"use strict";var{readCAFileSync:Lze}=Ice(),rpe=require("fs"),KT=require("path"),{ConfigChain:Bze}=Gce(),jze=Kce(),ipe=Zce(),YT=class extends Bze{constructor(t,r){super(t),this.root=t,this._parseField=ipe.parseField.bind(null,r||tpe())}add(t,r){try{for(let i of Object.keys(t))t[i]=this._parseField(t[i],i)}catch(i){throw i}return super.add(t,r)}addFile(t,r){r=r||t;let i={__source__:r};this.sources[r]={path:t,type:"ini"},this.push(i),this._await();try{let n=rpe.readFileSync(t,"utf8");this.addString(n,t,"ini",i)}catch(n){if(n.code==="ENOENT")this.add({},i);else return`Issue while reading "${t}". ${n.message}`}}addEnv(t){t=t||process.env;let r={};return Object.keys(t).filter(i=>/^npm_config_/i.test(i)).forEach(i=>{t[i]&&(r[jze(i.substr(11))]=t[i])}),super.addEnv("",r,"env")}loadPrefix(){let t=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:i=>{let n=this.get("global");this[n?"globalPrefix":"localPrefix"]=i},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:i=>{this.set("prefix",i)},get:()=>KT.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:i=>{r=i},get:()=>r}),Object.prototype.hasOwnProperty.call(t,"prefix"))r=KT.resolve(t.prefix);else try{r=ipe.findPrefix(process.cwd())}catch(i){throw i}return r}loadCAFile(t){if(!t)return;let r=Lze(t);r&&this.set("ca",r)}loadUser(){let t=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){t.user=Number(process.env.SUDO_UID);return}let r=KT.resolve(this.get("prefix"));try{let i=rpe.statSync(r);t.user=i.uid}catch(i){if(i.code==="ENOENT")return;throw i}}};npe.exports=YT});var ppe=g(cpe=>{"use strict";var upe=require("os"),_o=require("path"),lpe=upe.tmpdir(),qze=process.getuid?process.getuid():process.pid,$ze=()=>!0,ape=process.platform==="win32",ope={editor:()=>process.env.EDITOR||process.env.VISUAL||(ape?"notepad.exe":"vi"),shell:()=>ape?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},Mze={fromString:()=>process.umask()},vf=upe.homedir();vf?process.env.HOME=vf:vf=_o.resolve(lpe,"npm-"+qze);var Uze=process.platform==="win32"?"npm-cache":".npm",Vze=process.platform==="win32"&&process.env.APPDATA||vf,Hze=_o.resolve(Vze,Uze),A9,wc;Object.defineProperty(cpe,"defaults",{get:function(){return A9||(process.env.PREFIX?wc=process.env.PREFIX:process.platform==="win32"?wc=_o.dirname(process.execPath):(wc=_o.dirname(_o.dirname(process.execPath)),process.env.DESTDIR&&(wc=_o.join(process.env.DESTDIR,wc))),A9={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:Hze,"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:ope.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:_o.resolve(wc,"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":_o.resolve(vf,".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:wc,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:ope.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:lpe,unicode:$ze(),"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:_o.resolve(vf,".npmrc"),umask:process.umask?process.umask():Mze.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},A9)}})});var fpe=g((apt,XT)=>{"use strict";var _c=require("path"),zze=spe(),dpe=ppe();XT.exports=(e,t,r)=>{let i=new zze(Object.assign({},dpe.defaults,r),t);i.add(Object.assign({},e),"cli");let n=[],s=!1;if(require.resolve.paths){let l=require.resolve.paths("npm"),c;try{c=require.resolve("npm",{paths:l.slice(-1)})}catch{s=!0}c&&n.push(i.addFile(_c.resolve(_c.dirname(c),"..","npmrc"),"builtin"))}i.addEnv(),i.loadPrefix();let a=_c.resolve(i.localPrefix,".npmrc"),o=i.get("userconfig");if(!i.get("global")&&a!==o?n.push(i.addFile(a,"project")):i.add({},"project"),i.get("workspace-prefix")&&i.get("workspace-prefix")!==a){let l=_c.resolve(i.get("workspace-prefix"),".npmrc");n.push(i.addFile(l,"workspace"))}if(n.push(i.addFile(i.get("userconfig"),"user")),i.get("prefix")){let l=_c.resolve(i.get("prefix"),"etc");i.root.globalconfig=_c.resolve(l,"npmrc"),i.root.globalignorefile=_c.resolve(l,"npmignore")}n.push(i.addFile(i.get("globalconfig"),"global")),i.loadUser();let u=i.get("cafile");return u&&i.loadCAFile(u),{config:i,warnings:n.filter(Boolean),failedToLoadBuiltInConfig:s}};Object.defineProperty(XT.exports,"defaults",{get(){return dpe.defaults},enumerable:!0})});var bpe=g((opt,_pe)=>{var JT=require("url"),hpe=fpe(),mpe=":_authToken",gpe=":_auth",ype=":username",vpe=":_password";_pe.exports=function(){let t,r;arguments.length>=2?(t=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?t=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let i=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:n=>i[n]}}:hpe()).config,t=t||r.npmrc.get("registry")||hpe.defaults.registry,wpe(t,r)||Gze(r.npmrc)};function wpe(e,t){let r=JT.parse(e,!1,!0),i;for(;i!=="/"&&r.pathname!==i;){i=r.pathname||"/";let n="//"+r.host+i.replace(/\/$/,""),s=Kze(n,t.npmrc);if(s)return s;if(!t.recursive)return/\/$/.test(e)?void 0:wpe(JT.resolve(e,"."),t);r.pathname=JT.resolve(Wze(i),"..")||"/"}}function Gze(e){return e.get("_auth")?{token:T9(e.get("_auth")),type:"Basic"}:void 0}function Wze(e){return e[e.length-1]==="/"?e:e+"/"}function Kze(e,t){let r=Yze(t.get(e+mpe)||t.get(e+"/"+mpe));if(r)return r;let i=t.get(e+ype)||t.get(e+"/"+ype),n=t.get(e+vpe)||t.get(e+"/"+vpe),s=Xze(i,n);if(s)return s;let a=Jze(t.get(e+gpe)||t.get(e+"/"+gpe));if(a)return a}function T9(e){return e.replace(/^\$\{?([^}]*)\}?$/,function(t,r){return process.env[r]})}function Yze(e){return e?{token:T9(e),type:"Bearer"}:void 0}function Xze(e,t){if(!e||!t)return;let r=Buffer.from(T9(t),"base64").toString("utf8");return{token:Buffer.from(e+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:e}}function Jze(e){return e?{token:T9(e),type:"Basic"}:void 0}});var Fm=g((upt,Dpe)=>{var Zze="2.0.0",Qze=Number.MAX_SAFE_INTEGER||9007199254740991,eGe=16,tGe=250,rGe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Dpe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:eGe,MAX_SAFE_BUILD_LENGTH:tGe,MAX_SAFE_INTEGER:Qze,RELEASE_TYPES:rGe,SEMVER_SPEC_VERSION:Zze,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Nm=g((lpt,Epe)=>{var iGe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Epe.exports=iGe});var wf=g((bo,xpe)=>{var{MAX_SAFE_COMPONENT_LENGTH:ZT,MAX_SAFE_BUILD_LENGTH:nGe,MAX_LENGTH:sGe}=Fm(),aGe=Nm();bo=xpe.exports={};var oGe=bo.re=[],uGe=bo.safeRe=[],Y=bo.src=[],X=bo.t={},lGe=0,QT="[a-zA-Z0-9-]",cGe=[["\\s",1],["\\d",sGe],[QT,nGe]],pGe=e=>{for(let[t,r]of cGe)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},fe=(e,t,r)=>{let i=pGe(t),n=lGe++;aGe(e,n,t),X[e]=n,Y[n]=t,oGe[n]=new RegExp(t,r?"g":void 0),uGe[n]=new RegExp(i,r?"g":void 0)};fe("NUMERICIDENTIFIER","0|[1-9]\\d*");fe("NUMERICIDENTIFIERLOOSE","\\d+");fe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${QT}*`);fe("MAINVERSION",`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`);fe("MAINVERSIONLOOSE",`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`);fe("PRERELEASEIDENTIFIER",`(?:${Y[X.NUMERICIDENTIFIER]}|${Y[X.NONNUMERICIDENTIFIER]})`);fe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[X.NUMERICIDENTIFIERLOOSE]}|${Y[X.NONNUMERICIDENTIFIER]})`);fe("PRERELEASE",`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`);fe("PRERELEASELOOSE",`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`);fe("BUILDIDENTIFIER",`${QT}+`);fe("BUILD",`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`);fe("FULLPLAIN",`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`);fe("FULL",`^${Y[X.FULLPLAIN]}$`);fe("LOOSEPLAIN",`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`);fe("LOOSE",`^${Y[X.LOOSEPLAIN]}$`);fe("GTLT","((?:<|>)?=?)");fe("XRANGEIDENTIFIERLOOSE",`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);fe("XRANGEIDENTIFIER",`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`);fe("XRANGEPLAIN",`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`);fe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`);fe("XRANGE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`);fe("XRANGELOOSE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`);fe("COERCE",`(^|[^\\d])(\\d{1,${ZT}})(?:\\.(\\d{1,${ZT}}))?(?:\\.(\\d{1,${ZT}}))?(?:$|[^\\d])`);fe("COERCERTL",Y[X.COERCE],!0);fe("LONETILDE","(?:~>?)");fe("TILDETRIM",`(\\s*)${Y[X.LONETILDE]}\\s+`,!0);bo.tildeTrimReplace="$1~";fe("TILDE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`);fe("TILDELOOSE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`);fe("LONECARET","(?:\\^)");fe("CARETTRIM",`(\\s*)${Y[X.LONECARET]}\\s+`,!0);bo.caretTrimReplace="$1^";fe("CARET",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`);fe("CARETLOOSE",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`);fe("COMPARATORLOOSE",`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`);fe("COMPARATOR",`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`);fe("COMPARATORTRIM",`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0);bo.comparatorTrimReplace="$1$2$3";fe("HYPHENRANGE",`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`);fe("HYPHENRANGELOOSE",`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`);fe("STAR","(<|>)?=?\\s*\\*");fe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");fe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var O9=g((cpt,Cpe)=>{var dGe=Object.freeze({loose:!0}),fGe=Object.freeze({}),hGe=e=>e?typeof e!="object"?dGe:e:fGe;Cpe.exports=hGe});var eO=g((ppt,Tpe)=>{var Spe=/^[0-9]+$/,Ape=(e,t)=>{let r=Spe.test(e),i=Spe.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},mGe=(e,t)=>Ape(t,e);Tpe.exports={compareIdentifiers:Ape,rcompareIdentifiers:mGe}});var Yr=g((dpt,kpe)=>{var F9=Nm(),{MAX_LENGTH:Ope,MAX_SAFE_INTEGER:N9}=Fm(),{safeRe:Fpe,t:Npe}=wf(),gGe=O9(),{compareIdentifiers:_f}=eO(),tO=class e{constructor(t,r){if(r=gGe(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ope)throw new TypeError(`version is longer than ${Ope} characters`);F9("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?Fpe[Npe.LOOSE]:Fpe[Npe.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>N9||this.major<0)throw new TypeError("Invalid major version");if(this.minor>N9||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>N9||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<N9)return s}return n}):this.prerelease=[],this.build=i[5]?i[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(t){if(F9("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),_f(this.major,t.major)||_f(this.minor,t.minor)||_f(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let i=this.prerelease[r],n=t.prerelease[r];if(F9("prerelease compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return _f(i,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let i=this.build[r],n=t.build[r];if(F9("prerelease compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return _f(i,n)}while(++r)}inc(t,r,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 n=Number(i)?1:0;if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[n];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let s=[r,n];i===!1&&(s=[r]),_f(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};kpe.exports=tO});var bc=g((fpt,Ppe)=>{var Rpe=Yr(),yGe=(e,t,r=!1)=>{if(e instanceof Rpe)return e;try{return new Rpe(e,t)}catch(i){if(!r)return null;throw i}};Ppe.exports=yGe});var Lpe=g((hpt,Ipe)=>{var vGe=bc(),wGe=(e,t)=>{let r=vGe(e,t);return r?r.version:null};Ipe.exports=wGe});var jpe=g((mpt,Bpe)=>{var _Ge=bc(),bGe=(e,t)=>{let r=_Ge(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Bpe.exports=bGe});var Mpe=g((gpt,$pe)=>{var qpe=Yr(),DGe=(e,t,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new qpe(e instanceof qpe?e.version:e,r).inc(t,i,n).version}catch{return null}};$pe.exports=DGe});var Hpe=g((ypt,Vpe)=>{var Upe=bc(),EGe=(e,t)=>{let r=Upe(e,null,!0),i=Upe(t,null,!0),n=r.compare(i);if(n===0)return null;let s=n>0,a=s?r:i,o=s?i:r,u=!!a.prerelease.length;if(!!o.prerelease.length&&!u)return!o.patch&&!o.minor?"major":a.patch?"patch":a.minor?"minor":"major";let c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"};Vpe.exports=EGe});var Gpe=g((vpt,zpe)=>{var xGe=Yr(),CGe=(e,t)=>new xGe(e,t).major;zpe.exports=CGe});var Kpe=g((wpt,Wpe)=>{var SGe=Yr(),AGe=(e,t)=>new SGe(e,t).minor;Wpe.exports=AGe});var Xpe=g((_pt,Ype)=>{var TGe=Yr(),OGe=(e,t)=>new TGe(e,t).patch;Ype.exports=OGe});var Zpe=g((bpt,Jpe)=>{var FGe=bc(),NGe=(e,t)=>{let r=FGe(e,t);return r&&r.prerelease.length?r.prerelease:null};Jpe.exports=NGe});var Bn=g((Dpt,ede)=>{var Qpe=Yr(),kGe=(e,t,r)=>new Qpe(e,r).compare(new Qpe(t,r));ede.exports=kGe});var rde=g((Ept,tde)=>{var RGe=Bn(),PGe=(e,t,r)=>RGe(t,e,r);tde.exports=PGe});var nde=g((xpt,ide)=>{var IGe=Bn(),LGe=(e,t)=>IGe(e,t,!0);ide.exports=LGe});var k9=g((Cpt,ade)=>{var sde=Yr(),BGe=(e,t,r)=>{let i=new sde(e,r),n=new sde(t,r);return i.compare(n)||i.compareBuild(n)};ade.exports=BGe});var ude=g((Spt,ode)=>{var jGe=k9(),qGe=(e,t)=>e.sort((r,i)=>jGe(r,i,t));ode.exports=qGe});var cde=g((Apt,lde)=>{var $Ge=k9(),MGe=(e,t)=>e.sort((r,i)=>$Ge(i,r,t));lde.exports=MGe});var km=g((Tpt,pde)=>{var UGe=Bn(),VGe=(e,t,r)=>UGe(e,t,r)>0;pde.exports=VGe});var R9=g((Opt,dde)=>{var HGe=Bn(),zGe=(e,t,r)=>HGe(e,t,r)<0;dde.exports=zGe});var rO=g((Fpt,fde)=>{var GGe=Bn(),WGe=(e,t,r)=>GGe(e,t,r)===0;fde.exports=WGe});var iO=g((Npt,hde)=>{var KGe=Bn(),YGe=(e,t,r)=>KGe(e,t,r)!==0;hde.exports=YGe});var P9=g((kpt,mde)=>{var XGe=Bn(),JGe=(e,t,r)=>XGe(e,t,r)>=0;mde.exports=JGe});var I9=g((Rpt,gde)=>{var ZGe=Bn(),QGe=(e,t,r)=>ZGe(e,t,r)<=0;gde.exports=QGe});var nO=g((Ppt,yde)=>{var eWe=rO(),tWe=iO(),rWe=km(),iWe=P9(),nWe=R9(),sWe=I9(),aWe=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return eWe(e,r,i);case"!=":return tWe(e,r,i);case">":return rWe(e,r,i);case">=":return iWe(e,r,i);case"<":return nWe(e,r,i);case"<=":return sWe(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}};yde.exports=aWe});var wde=g((Ipt,vde)=>{var oWe=Yr(),uWe=bc(),{safeRe:L9,t:B9}=wf(),lWe=(e,t)=>{if(e instanceof oWe)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(L9[B9.COERCE]);else{let i;for(;(i=L9[B9.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||i.index+i[0].length!==r.index+r[0].length)&&(r=i),L9[B9.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;L9[B9.COERCERTL].lastIndex=-1}return r===null?null:uWe(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};vde.exports=lWe});var bde=g((Lpt,_de)=>{"use strict";_de.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var Ede=g((Bpt,Dde)=>{"use strict";Dde.exports=Ne;Ne.Node=Dc;Ne.create=Ne;function Ne(e){var t=this;if(t instanceof Ne||(t=new Ne),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(n){t.push(n)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}Ne.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};Ne.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};Ne.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};Ne.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)pWe(this,arguments[e]);return this.length};Ne.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)dWe(this,arguments[e]);return this.length};Ne.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};Ne.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};Ne.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,i=0;r!==null;i++)e.call(t,r.value,i,this),r=r.next};Ne.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,i=this.length-1;r!==null;i--)e.call(t,r.value,i,this),r=r.prev};Ne.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};Ne.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};Ne.prototype.map=function(e,t){t=t||this;for(var r=new Ne,i=this.head;i!==null;)r.push(e.call(t,i.value,this)),i=i.next;return r};Ne.prototype.mapReverse=function(e,t){t=t||this;for(var r=new Ne,i=this.tail;i!==null;)r.push(e.call(t,i.value,this)),i=i.prev;return r};Ne.prototype.reduce=function(e,t){var r,i=this.head;if(arguments.length>1)r=t;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)r=e(r,i.value,n),i=i.next;return r};Ne.prototype.reduceReverse=function(e,t){var r,i=this.tail;if(arguments.length>1)r=t;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)r=e(r,i.value,n),i=i.prev;return r};Ne.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};Ne.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};Ne.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Ne;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,n=this.head;n!==null&&i<e;i++)n=n.next;for(;n!==null&&i<t;i++,n=n.next)r.push(n.value);return r};Ne.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Ne;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,n=this.tail;n!==null&&i>t;i--)n=n.prev;for(;n!==null&&i>e;i--,n=n.prev)r.push(n.value);return r};Ne.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,n=this.head;n!==null&&i<e;i++)n=n.next;for(var s=[],i=0;n&&i<t;i++)s.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var i=0;i<r.length;i++)n=cWe(this,n,r[i]);return s};Ne.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=t,this.tail=e,this};function cWe(e,t,r){var i=t===e.head?new Dc(r,null,t,e):new Dc(r,t,t.next,e);return i.next===null&&(e.tail=i),i.prev===null&&(e.head=i),e.length++,i}function pWe(e,t){e.tail=new Dc(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function dWe(e,t){e.head=new Dc(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Dc(e,t,r,i){if(!(this instanceof Dc))return new Dc(e,t,r,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{bde()(Ne)}catch{}});var Tde=g((jpt,Ade)=>{"use strict";var fWe=Ede(),Ec=Symbol("max"),Eo=Symbol("length"),bf=Symbol("lengthCalculator"),Pm=Symbol("allowStale"),xc=Symbol("maxAge"),Do=Symbol("dispose"),xde=Symbol("noDisposeOnSet"),wr=Symbol("lruList"),ps=Symbol("cache"),Sde=Symbol("updateAgeOnGet"),sO=()=>1,oO=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");let r=this[Ec]=t.max||1/0,i=t.length||sO;if(this[bf]=typeof i!="function"?sO:i,this[Pm]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[xc]=t.maxAge||0,this[Do]=t.dispose,this[xde]=t.noDisposeOnSet||!1,this[Sde]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Ec]=t||1/0,Rm(this)}get max(){return this[Ec]}set allowStale(t){this[Pm]=!!t}get allowStale(){return this[Pm]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[xc]=t,Rm(this)}get maxAge(){return this[xc]}set lengthCalculator(t){typeof t!="function"&&(t=sO),t!==this[bf]&&(this[bf]=t,this[Eo]=0,this[wr].forEach(r=>{r.length=this[bf](r.value,r.key),this[Eo]+=r.length})),Rm(this)}get lengthCalculator(){return this[bf]}get length(){return this[Eo]}get itemCount(){return this[wr].length}rforEach(t,r){r=r||this;for(let i=this[wr].tail;i!==null;){let n=i.prev;Cde(this,t,i,r),i=n}}forEach(t,r){r=r||this;for(let i=this[wr].head;i!==null;){let n=i.next;Cde(this,t,i,r),i=n}}keys(){return this[wr].toArray().map(t=>t.key)}values(){return this[wr].toArray().map(t=>t.value)}reset(){this[Do]&&this[wr]&&this[wr].length&&this[wr].forEach(t=>this[Do](t.key,t.value)),this[ps]=new Map,this[wr]=new fWe,this[Eo]=0}dump(){return this[wr].map(t=>j9(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[wr]}set(t,r,i){if(i=i||this[xc],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[bf](r,t);if(this[ps].has(t)){if(s>this[Ec])return Df(this,this[ps].get(t)),!1;let u=this[ps].get(t).value;return this[Do]&&(this[xde]||this[Do](t,u.value)),u.now=n,u.maxAge=i,u.value=r,this[Eo]+=s-u.length,u.length=s,this.get(t),Rm(this),!0}let a=new uO(t,r,s,n,i);return a.length>this[Ec]?(this[Do]&&this[Do](t,r),!1):(this[Eo]+=a.length,this[wr].unshift(a),this[ps].set(t,this[wr].head),Rm(this),!0)}has(t){if(!this[ps].has(t))return!1;let r=this[ps].get(t).value;return!j9(this,r)}get(t){return aO(this,t,!0)}peek(t){return aO(this,t,!1)}pop(){let t=this[wr].tail;return t?(Df(this,t),t.value):null}del(t){Df(this,this[ps].get(t))}load(t){this.reset();let r=Date.now();for(let i=t.length-1;i>=0;i--){let n=t[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let a=s-r;a>0&&this.set(n.k,n.v,a)}}}prune(){this[ps].forEach((t,r)=>aO(this,r,!1))}},aO=(e,t,r)=>{let i=e[ps].get(t);if(i){let n=i.value;if(j9(e,n)){if(Df(e,i),!e[Pm])return}else r&&(e[Sde]&&(i.value.now=Date.now()),e[wr].unshiftNode(i));return n.value}},j9=(e,t)=>{if(!t||!t.maxAge&&!e[xc])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[xc]&&r>e[xc]},Rm=e=>{if(e[Eo]>e[Ec])for(let t=e[wr].tail;e[Eo]>e[Ec]&&t!==null;){let r=t.prev;Df(e,t),t=r}},Df=(e,t)=>{if(t){let r=t.value;e[Do]&&e[Do](r.key,r.value),e[Eo]-=r.length,e[ps].delete(r.key),e[wr].removeNode(t)}},uO=class{constructor(t,r,i,n,s){this.key=t,this.value=r,this.length=i,this.now=n,this.maxAge=s||0}},Cde=(e,t,r,i)=>{let n=r.value;j9(e,n)&&(Df(e,r),e[Pm]||(n=void 0)),n&&t.call(i,n.value,n.key,e)};Ade.exports=oO});var jn=g((qpt,kde)=>{var lO=class e{constructor(t,r){if(r=mWe(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof cO)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!Fde(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&DWe(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let i=((this.options.includePrerelease&&_We)|(this.options.loose&&bWe))+":"+t,n=Ode.get(i);if(n)return n;let s=this.options.loose,a=s?Ii[pi.HYPHENRANGELOOSE]:Ii[pi.HYPHENRANGE];t=t.replace(a,kWe(this.options.includePrerelease)),st("hyphen replace",t),t=t.replace(Ii[pi.COMPARATORTRIM],yWe),st("comparator trim",t),t=t.replace(Ii[pi.TILDETRIM],vWe),st("tilde trim",t),t=t.replace(Ii[pi.CARETTRIM],wWe),st("caret trim",t);let o=t.split(" ").map(p=>EWe(p,this.options)).join(" ").split(/\s+/).map(p=>NWe(p,this.options));s&&(o=o.filter(p=>(st("loose invalid filter",p,this.options),!!p.match(Ii[pi.COMPARATORLOOSE])))),st("range list",o);let u=new Map,l=o.map(p=>new cO(p,this.options));for(let p of l){if(Fde(p))return[p];u.set(p.value,p)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return Ode.set(i,c),c}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>Nde(i,r)&&t.set.some(n=>Nde(n,r)&&i.every(s=>n.every(a=>s.intersects(a,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new gWe(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(RWe(this.set[r],t,this.options))return!0;return!1}};kde.exports=lO;var hWe=Tde(),Ode=new hWe({max:1e3}),mWe=O9(),cO=Im(),st=Nm(),gWe=Yr(),{safeRe:Ii,t:pi,comparatorTrimReplace:yWe,tildeTrimReplace:vWe,caretTrimReplace:wWe}=wf(),{FLAG_INCLUDE_PRERELEASE:_We,FLAG_LOOSE:bWe}=Fm(),Fde=e=>e.value==="<0.0.0-0",DWe=e=>e.value==="",Nde=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},EWe=(e,t)=>(st("comp",e,t),e=SWe(e,t),st("caret",e),e=xWe(e,t),st("tildes",e),e=TWe(e,t),st("xrange",e),e=FWe(e,t),st("stars",e),e),di=e=>!e||e.toLowerCase()==="x"||e==="*",xWe=(e,t)=>e.trim().split(/\s+/).map(r=>CWe(r,t)).join(" "),CWe=(e,t)=>{let r=t.loose?Ii[pi.TILDELOOSE]:Ii[pi.TILDE];return e.replace(r,(i,n,s,a,o)=>{st("tilde",e,i,n,s,a,o);let u;return di(n)?u="":di(s)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:di(a)?u=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(st("replaceTilde pr",o),u=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):u=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,st("tilde return",u),u})},SWe=(e,t)=>e.trim().split(/\s+/).map(r=>AWe(r,t)).join(" "),AWe=(e,t)=>{st("caret",e,t);let r=t.loose?Ii[pi.CARETLOOSE]:Ii[pi.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,u)=>{st("caret",e,n,s,a,o,u);let l;return di(s)?l="":di(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:di(o)?s==="0"?l=`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:l=`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(st("replaceCaret pr",u),s==="0"?a==="0"?l=`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:l=`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:l=`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(st("no pr"),s==="0"?a==="0"?l=`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:l=`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:l=`>=${s}.${a}.${o} <${+s+1}.0.0-0`),st("caret return",l),l})},TWe=(e,t)=>(st("replaceXRanges",e,t),e.split(/\s+/).map(r=>OWe(r,t)).join(" ")),OWe=(e,t)=>{e=e.trim();let r=t.loose?Ii[pi.XRANGELOOSE]:Ii[pi.XRANGE];return e.replace(r,(i,n,s,a,o,u)=>{st("xRange",e,i,n,s,a,o,u);let l=di(s),c=l||di(a),p=c||di(o),d=p;return n==="="&&d&&(n=""),u=t.includePrerelease?"-0":"",l?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&d?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(u="-0"),i=`${n+s}.${a}.${o}${u}`):c?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:p&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),st("xRange return",i),i})},FWe=(e,t)=>(st("replaceStars",e,t),e.trim().replace(Ii[pi.STAR],"")),NWe=(e,t)=>(st("replaceGTE0",e,t),e.trim().replace(Ii[t.includePrerelease?pi.GTE0PRE:pi.GTE0],"")),kWe=e=>(t,r,i,n,s,a,o,u,l,c,p,d,f)=>(di(i)?r="":di(n)?r=`>=${i}.0.0${e?"-0":""}`:di(s)?r=`>=${i}.${n}.0${e?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,di(l)?u="":di(c)?u=`<${+l+1}.0.0-0`:di(p)?u=`<${l}.${+c+1}.0-0`:d?u=`<=${l}.${c}.${p}-${d}`:e?u=`<${l}.${c}.${+p+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),RWe=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(st(e[i].semver),e[i].semver!==cO.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}});var Im=g(($pt,jde)=>{var Lm=Symbol("SemVer ANY"),fO=class e{static get ANY(){return Lm}constructor(t,r){if(r=Rde(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),dO("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Lm?this.value="":this.value=this.operator+this.semver.version,dO("comp",this)}parse(t){let r=this.options.loose?Pde[Ide.COMPARATORLOOSE]:Pde[Ide.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new Lde(i[2],this.options.loose):this.semver=Lm}toString(){return this.value}test(t){if(dO("Comparator.test",t,this.options.loose),this.semver===Lm||t===Lm)return!0;if(typeof t=="string")try{t=new Lde(t,this.options)}catch{return!1}return pO(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Bde(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new Bde(this.value,r).test(t.semver):(r=Rde(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||pO(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||pO(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};jde.exports=fO;var Rde=O9(),{safeRe:Pde,t:Ide}=wf(),pO=nO(),dO=Nm(),Lde=Yr(),Bde=jn()});var Bm=g((Mpt,qde)=>{var PWe=jn(),IWe=(e,t,r)=>{try{t=new PWe(t,r)}catch{return!1}return t.test(e)};qde.exports=IWe});var Mde=g((Upt,$de)=>{var LWe=jn(),BWe=(e,t)=>new LWe(e,t).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));$de.exports=BWe});var Vde=g((Vpt,Ude)=>{var jWe=Yr(),qWe=jn(),$We=(e,t,r)=>{let i=null,n=null,s=null;try{s=new qWe(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!i||n.compare(a)===-1)&&(i=a,n=new jWe(i,r))}),i};Ude.exports=$We});var zde=g((Hpt,Hde)=>{var MWe=Yr(),UWe=jn(),VWe=(e,t,r)=>{let i=null,n=null,s=null;try{s=new UWe(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!i||n.compare(a)===1)&&(i=a,n=new MWe(i,r))}),i};Hde.exports=VWe});var Kde=g((zpt,Wde)=>{var hO=Yr(),HWe=jn(),Gde=km(),zWe=(e,t)=>{e=new HWe(e,t);let r=new hO("0.0.0");if(e.test(r)||(r=new hO("0.0.0-0"),e.test(r)))return r;r=null;for(let i=0;i<e.set.length;++i){let n=e.set[i],s=null;n.forEach(a=>{let o=new hO(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||Gde(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Gde(r,s))&&(r=s)}return r&&e.test(r)?r:null};Wde.exports=zWe});var Xde=g((Gpt,Yde)=>{var GWe=jn(),WWe=(e,t)=>{try{return new GWe(e,t).range||"*"}catch{return null}};Yde.exports=WWe});var q9=g((Wpt,efe)=>{var KWe=Yr(),Qde=Im(),{ANY:YWe}=Qde,XWe=jn(),JWe=Bm(),Jde=km(),Zde=R9(),ZWe=I9(),QWe=P9(),eKe=(e,t,r,i)=>{e=new KWe(e,i),t=new XWe(t,i);let n,s,a,o,u;switch(r){case">":n=Jde,s=ZWe,a=Zde,o=">",u=">=";break;case"<":n=Zde,s=QWe,a=Jde,o="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(JWe(e,t,i))return!1;for(let l=0;l<t.set.length;++l){let c=t.set[l],p=null,d=null;if(c.forEach(f=>{f.semver===YWe&&(f=new Qde(">=0.0.0")),p=p||f,d=d||f,n(f.semver,p.semver,i)?p=f:a(f.semver,d.semver,i)&&(d=f)}),p.operator===o||p.operator===u||(!d.operator||d.operator===o)&&s(e,d.semver))return!1;if(d.operator===u&&a(e,d.semver))return!1}return!0};efe.exports=eKe});var rfe=g((Kpt,tfe)=>{var tKe=q9(),rKe=(e,t,r)=>tKe(e,t,">",r);tfe.exports=rKe});var nfe=g((Ypt,ife)=>{var iKe=q9(),nKe=(e,t,r)=>iKe(e,t,"<",r);ife.exports=nKe});var ofe=g((Xpt,afe)=>{var sfe=jn(),sKe=(e,t,r)=>(e=new sfe(e,r),t=new sfe(t,r),e.intersects(t,r));afe.exports=sKe});var lfe=g((Jpt,ufe)=>{var aKe=Bm(),oKe=Bn();ufe.exports=(e,t,r)=>{let i=[],n=null,s=null,a=e.sort((c,p)=>oKe(c,p,r));for(let c of a)aKe(c,t,r)?(s=c,n||(n=c)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,null]);let o=[];for(let[c,p]of i)c===p?o.push(c):!p&&c===a[0]?o.push("*"):p?c===a[0]?o.push(`<=${p}`):o.push(`${c} - ${p}`):o.push(`>=${c}`);let u=o.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return u.length<l.length?u:t}});var mfe=g((Zpt,hfe)=>{var cfe=jn(),gO=Im(),{ANY:mO}=gO,jm=Bm(),yO=Bn(),uKe=(e,t,r={})=>{if(e===t)return!0;e=new cfe(e,r),t=new cfe(t,r);let i=!1;e:for(let n of e.set){for(let s of t.set){let a=cKe(n,s,r);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},lKe=[new gO(">=0.0.0-0")],pfe=[new gO(">=0.0.0")],cKe=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===mO){if(t.length===1&&t[0].semver===mO)return!0;r.includePrerelease?e=lKe:e=pfe}if(t.length===1&&t[0].semver===mO){if(r.includePrerelease)return!0;t=pfe}let i=new Set,n,s;for(let f of e)f.operator===">"||f.operator===">="?n=dfe(n,f,r):f.operator==="<"||f.operator==="<="?s=ffe(s,f,r):i.add(f.semver);if(i.size>1)return null;let a;if(n&&s){if(a=yO(n.semver,s.semver,r),a>0)return null;if(a===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let f of i){if(n&&!jm(f,String(n),r)||s&&!jm(f,String(s),r))return null;for(let h of t)if(!jm(f,String(h),r))return!1;return!0}let o,u,l,c,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let f of t){if(c=c||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",n){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator===">"||f.operator===">="){if(o=dfe(n,f,r),o===f&&o!==n)return!1}else if(n.operator===">="&&!jm(n.semver,String(f),r))return!1}if(s){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator==="<"||f.operator==="<="){if(u=ffe(s,f,r),u===f&&u!==s)return!1}else if(s.operator==="<="&&!jm(s.semver,String(f),r))return!1}if(!f.operator&&(s||n)&&a!==0)return!1}return!(n&&l&&!s&&a!==0||s&&c&&!n&&a!==0||d||p)},dfe=(e,t,r)=>{if(!e)return t;let i=yO(e.semver,t.semver,r);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},ffe=(e,t,r)=>{if(!e)return t;let i=yO(e.semver,t.semver,r);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};hfe.exports=uKe});var wfe=g((Qpt,vfe)=>{var vO=wf(),gfe=Fm(),pKe=Yr(),yfe=eO(),dKe=bc(),fKe=Lpe(),hKe=jpe(),mKe=Mpe(),gKe=Hpe(),yKe=Gpe(),vKe=Kpe(),wKe=Xpe(),_Ke=Zpe(),bKe=Bn(),DKe=rde(),EKe=nde(),xKe=k9(),CKe=ude(),SKe=cde(),AKe=km(),TKe=R9(),OKe=rO(),FKe=iO(),NKe=P9(),kKe=I9(),RKe=nO(),PKe=wde(),IKe=Im(),LKe=jn(),BKe=Bm(),jKe=Mde(),qKe=Vde(),$Ke=zde(),MKe=Kde(),UKe=Xde(),VKe=q9(),HKe=rfe(),zKe=nfe(),GKe=ofe(),WKe=lfe(),KKe=mfe();vfe.exports={parse:dKe,valid:fKe,clean:hKe,inc:mKe,diff:gKe,major:yKe,minor:vKe,patch:wKe,prerelease:_Ke,compare:bKe,rcompare:DKe,compareLoose:EKe,compareBuild:xKe,sort:CKe,rsort:SKe,gt:AKe,lt:TKe,eq:OKe,neq:FKe,gte:NKe,lte:kKe,cmp:RKe,coerce:PKe,Comparator:IKe,Range:LKe,satisfies:BKe,toComparators:jKe,maxSatisfying:qKe,minSatisfying:$Ke,minVersion:MKe,validRange:UKe,outside:VKe,gtr:HKe,ltr:zKe,intersects:GKe,simplifyRange:WKe,subset:KKe,SemVer:pKe,re:vO.re,src:vO.src,tokens:vO.t,SEMVER_SPEC_VERSION:gfe.SEMVER_SPEC_VERSION,RELEASE_TYPES:gfe.RELEASE_TYPES,compareIdentifiers:yfe.compareIdentifiers,rcompareIdentifiers:yfe.rcompareIdentifiers}});var wO=g((edt,Efe)=>{var YKe=require("url"),{getIt:XKe}=kle(),{debug:JKe,retry:_fe,promise:ZKe,httpErrors:QKe,jsonResponse:eYe}=Jle(),tYe=Dce(),rYe=bpe(),iYe=wfe(),nYe=e=>/(application\/json|\+json)/.test(e||"");function sYe(e,t,r){let i=e.response||{statusCode:500,headers:{}};return _fe.shouldRetry(e,t,r)||i&&i.statusCode>=500||i.statusCode<300&&!nYe(i.headers["content-type"])}function aYe(e,t){if(t.registryUrl)return t.registryUrl;let r=e.split("/")[0];return tYe(r)}var bfe=XKe([eYe({force:!0}),QKe(),JKe({namespace:"get-latest-version"}),ZKe(),_fe({shouldRetry:sYe})]);async function Dfe(e,t){let r=typeof t=="string"?{range:t,auth:!0}:Object.assign({range:"latest",auth:!0},t),i=aYe(e,r),n=YKe.resolve(i,encodeURIComponent(e).replace(/^%40/,"@")),s=r.auth&&rYe(i,{recursive:!0}),a=r.request||bfe,o={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};s&&(o.authorization=`${s.type} ${s.token}`);let u;try{u=await a({url:n,headers:o})}catch(h){throw h.response&&h.response.statusCode===404?new Error(`Package \`${e}\` doesn't exist`):h}let l=u.body,c=r.range,p=l["dist-tags"].latest;if(l["dist-tags"][c])return r.includeLatest?{latest:p,inRange:l["dist-tags"][c]}:l["dist-tags"][c];if(l.versions[c])return r.includeLatest?{latest:p,inRange:c}:c;let d=Object.keys(l.versions),f=iYe.maxSatisfying(d,c);return f?r.includeLatest?{latest:p,inRange:f}:f:r.includeLatest?{latest:p,inRange:void 0}:void 0}Dfe.request=bfe;Efe.exports=Dfe});var Vfe=g((pdt,xo)=>{var Yt=require("fs"),CO=require("os"),rn=require("path"),Tfe=require("crypto"),da={fs:Yt.constants,os:CO.constants},Ofe="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Nfe=/XXXXXX/,lYe=3,kfe=(da.O_CREAT||da.fs.O_CREAT)|(da.O_EXCL||da.fs.O_EXCL)|(da.O_RDWR||da.fs.O_RDWR),cYe=CO.platform()==="win32",pYe=da.EBADF||da.os.errno.EBADF,dYe=da.ENOENT||da.os.errno.ENOENT,Rfe=448,Pfe=384,fYe="exit",Ef=[],Ife=Yt.rmdirSync.bind(Yt),Lfe=!1;function hYe(e,t){return Yt.rm(e,{recursive:!0},t)}function Bfe(e){return Yt.rmSync(e,{recursive:!0})}function SO(e,t){let r=xf(e,t),i=r[0],n=r[1];try{$fe(i)}catch(a){return n(a)}let s=i.tries;(function a(){try{let o=qfe(i);Yt.stat(o,function(u){if(!u)return s-- >0?a():n(new Error("Could not get a unique tmp filename, max tries reached "+o));n(null,o)})}catch(o){n(o)}})()}function AO(e){let t=xf(e),r=t[0];$fe(r);let i=r.tries;do{let n=qfe(r);try{Yt.statSync(n)}catch{return n}}while(i-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function mYe(e,t){let r=xf(e,t),i=r[0],n=r[1];SO(i,function(a,o){if(a)return n(a);Yt.open(o,kfe,i.mode||Pfe,function(l,c){if(l)return n(l);if(i.discardDescriptor)return Yt.close(c,function(d){return n(d,o,void 0,DO(o,-1,i,!1))});{let p=i.discardDescriptor||i.detachDescriptor;n(null,o,c,DO(o,p?-1:c,i,!1))}})})}function gYe(e){let t=xf(e),r=t[0],i=r.discardDescriptor||r.detachDescriptor,n=AO(r);var s=Yt.openSync(n,kfe,r.mode||Pfe);return r.discardDescriptor&&(Yt.closeSync(s),s=void 0),{name:n,fd:s,removeCallback:DO(n,i?-1:s,r,!0)}}function yYe(e,t){let r=xf(e,t),i=r[0],n=r[1];SO(i,function(a,o){if(a)return n(a);Yt.mkdir(o,i.mode||Rfe,function(l){if(l)return n(l);n(null,o,jfe(o,i,!1))})})}function vYe(e){let t=xf(e),r=t[0],i=AO(r);return Yt.mkdirSync(i,r.mode||Rfe),{name:i,removeCallback:jfe(i,r,!0)}}function wYe(e,t){let r=function(i){if(i&&!xO(i))return t(i);t()};0<=e[0]?Yt.close(e[0],function(){Yt.unlink(e[1],r)}):Yt.unlink(e[1],r)}function _Ye(e){let t=null;try{0<=e[0]&&Yt.closeSync(e[0])}catch(r){if(!EYe(r)&&!xO(r))throw r}finally{try{Yt.unlinkSync(e[1])}catch(r){xO(r)||(t=r)}}if(t!==null)throw t}function DO(e,t,r,i){let n=M9(_Ye,[t,e],i),s=M9(wYe,[t,e],i,n);return r.keep||Ef.unshift(n),i?n:s}function jfe(e,t,r){let i=t.unsafeCleanup?hYe:Yt.rmdir.bind(Yt),n=t.unsafeCleanup?Bfe:Ife,s=M9(n,e,r),a=M9(i,e,r,s);return t.keep||Ef.unshift(s),r?s:a}function M9(e,t,r,i){let n=!1;return function s(a){if(!n){let o=i||s,u=Ef.indexOf(o);return u>=0&&Ef.splice(u,1),n=!0,r||e===Ife||e===Bfe?e(t):e(t,a||function(){})}}}function bYe(){if(Lfe)for(;Ef.length;)try{Ef[0]()}catch{}}function Ffe(e){let t=[],r=null;try{r=Tfe.randomBytes(e)}catch{r=Tfe.pseudoRandomBytes(e)}for(var i=0;i<e;i++)t.push(Ofe[r[i]%Ofe.length]);return t.join("")}function DYe(e){return e===null||Li(e)||!e.trim()}function Li(e){return typeof e>"u"}function xf(e,t){if(typeof e=="function")return[{},e];if(Li(e))return[{},t];let r={};for(let i of Object.getOwnPropertyNames(e))r[i]=e[i];return[r,t]}function qfe(e){let t=e.tmpdir;if(!Li(e.name))return rn.join(t,e.dir,e.name);if(!Li(e.template))return rn.join(t,e.dir,e.template).replace(Nfe,Ffe(6));let r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",Ffe(12),e.postfix?"-"+e.postfix:""].join("");return rn.join(t,e.dir,r)}function $fe(e){e.tmpdir=Ufe(e);let t=e.tmpdir;if(Li(e.name)||bO(e.name,"name",t),Li(e.dir)||bO(e.dir,"dir",t),!Li(e.template)&&(bO(e.template,"template",t),!e.template.match(Nfe)))throw new Error(`Invalid template, found "${e.template}".`);if(!Li(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);e.tries=Li(e.name)?e.tries||lYe:1,e.keep=!!e.keep,e.detachDescriptor=!!e.detachDescriptor,e.discardDescriptor=!!e.discardDescriptor,e.unsafeCleanup=!!e.unsafeCleanup,e.dir=Li(e.dir)?"":rn.relative(t,EO(e.dir,t)),e.template=Li(e.template)?void 0:rn.relative(t,EO(e.template,t)),e.template=DYe(e.template)?void 0:rn.relative(e.dir,e.template),e.name=Li(e.name)?void 0:e.name,e.prefix=Li(e.prefix)?"":e.prefix,e.postfix=Li(e.postfix)?"":e.postfix}function EO(e,t){return e.startsWith(t)?rn.resolve(e):rn.resolve(rn.join(t,e))}function bO(e,t,r){if(t==="name"){if(rn.isAbsolute(e))throw new Error(`${t} option must not contain an absolute path, found "${e}".`);let i=rn.basename(e);if(i===".."||i==="."||i!==e)throw new Error(`${t} option must not contain a path, found "${e}".`)}else{if(rn.isAbsolute(e)&&!e.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${e}".`);let i=EO(e,r);if(!i.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${i}".`)}}function EYe(e){return Mfe(e,-pYe,"EBADF")}function xO(e){return Mfe(e,-dYe,"ENOENT")}function Mfe(e,t,r){return cYe?e.code===r:e.code===r&&e.errno===t}function xYe(){Lfe=!0}function Ufe(e){return rn.resolve(e&&e.tmpdir||CO.tmpdir())}process.addListener(fYe,bYe);Object.defineProperty(xo.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return Ufe()}});xo.exports.dir=yYe;xo.exports.dirSync=vYe;xo.exports.file=mYe;xo.exports.fileSync=gYe;xo.exports.tmpName=SO;xo.exports.tmpNameSync=AO;xo.exports.setGracefulCleanup=xYe});var kO=g(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.DEFAULT_COLOR_MAP=void 0;Cf.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var NO=class{constructor(t=Cf.DEFAULT_COLOR_MAP){this.text="",this.colorMap=t}addCharsWithColor(t,r){let i=this.colorMap[t];this.text+=i!==void 0?`${i}${r}${this.colorMap.reset}`:r}renderConsole(){return this.text}};Cf.default=NO});var Vm=g(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_HEADER_ALIGNMENT=Xt.DEFAULT_ROW_ALIGNMENT=Xt.DEFAULT_HEADER_FONT_COLOR=Xt.DEFAULT_ROW_FONT_COLOR=Xt.COLORS=Xt.ALIGNMENTS=Xt.DEFAULT_TABLE_STYLE=Xt.DEFAULT_ROW_SEPARATOR=Xt.DEFAULT_COLUMN_LEN=void 0;Xt.DEFAULT_COLUMN_LEN=20;Xt.DEFAULT_ROW_SEPARATOR=!1;Xt.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};Xt.ALIGNMENTS=["right","left","center"];Xt.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];Xt.DEFAULT_ROW_FONT_COLOR="white";Xt.DEFAULT_HEADER_FONT_COLOR="white_bold";Xt.DEFAULT_ROW_ALIGNMENT="right";Xt.DEFAULT_HEADER_ALIGNMENT="center"});var RO=g(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.rawColumnToInternalColumn=So.objIfExists=void 0;var NYe=Vm(),kYe=(e,t)=>t?{[e]:t}:{};So.objIfExists=kYe;var RYe=e=>{var t;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(t=e.title)!==null&&t!==void 0?t:e.name},(0,So.objIfExists)("color",e.color)),(0,So.objIfExists)("maxLen",e.maxLen)),(0,So.objIfExists)("minLen",e.minLen)),{alignment:e.alignment||NYe.DEFAULT_ROW_ALIGNMENT})};So.rawColumnToInternalColumn=RYe});var Qfe=g(PO=>{"use strict";Object.defineProperty(PO,"__esModule",{value:!0});var PYe=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];PO.default=PYe});var e1e=g(IO=>{"use strict";Object.defineProperty(IO,"__esModule",{value:!0});var IYe=(e,t,r)=>{let i=0,n,s=r;if(e<t[0].first||e>t[s].last)return 0;for(;s>=i;)if(n=Math.floor((i+s)/2),e>t[n].last)i=n+1;else if(e<t[n].first)s=n-1;else return 1;return 0};IO.default=IYe});var LO=g(Hm=>{"use strict";var r1e=Hm&&Hm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hm,"__esModule",{value:!0});var t1e=r1e(Qfe()),LYe=r1e(e1e()),BYe=e=>e===0?0:e<32||e>=127&&e<160?-1:LYe.default(e,t1e.default,t1e.default.length-1)?0:1+ +(e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141));Hm.default=BYe});var i1e=g(zm=>{"use strict";var jYe=zm&&zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zm,"__esModule",{value:!0});var qYe=jYe(LO()),$Ye=e=>{let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),n=qYe.default(i);if(n<0)return-1;t+=n}return t};zm.default=$Ye});var s1e=g(Vu=>{"use strict";var n1e=Vu&&Vu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vu,"__esModule",{value:!0});Vu.wcswidth=Vu.wcwidth=void 0;var MYe=n1e(i1e());Vu.wcswidth=MYe.default;var UYe=n1e(LO());Vu.wcwidth=UYe.default});var BO=g(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.findWidthInConsole=Cc.stripAnsi=void 0;var VYe=s1e(),HYe=/\x1b\[\d{1,3}(;\d{1,3})*m/g,zYe=e=>e.replace(HYe,"");Cc.stripAnsi=zYe;var GYe=(e,t)=>{let r=0;return e=(0,Cc.stripAnsi)(e),t&&Object.entries(t).forEach(([i,n])=>{let s=new RegExp(i,"g");r+=(e.match(s)||[]).length*n,e=e.replace(i,"")}),r+=(0,VYe.wcswidth)(e),r};Cc.findWidthInConsole=GYe});var qO=g(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.biggestWordInSentence=fa.textWithPadding=fa.splitTextIntoTextsOfMinLen=void 0;var jO=BO(),WYe=(e,t,r)=>{let i=[];return e.split(/[\n\r]/).forEach(s=>{let a=s.split(" "),o=[],u=0;a.forEach(l=>{let c=(0,jO.findWidthInConsole)(l,r);u+c<=t?(u+=c+1,o.push(l)):(o.length>0&&i.push(o.join(" ")),o=[l],u=c+1)}),i.push(o.join(" "))}),i};fa.splitTextIntoTextsOfMinLen=WYe;var KYe=(e,t,r,i)=>{let n=(0,jO.findWidthInConsole)(e,i),s=Math.floor((r-n)/2),a=r-s-n;if(r<n){let o=(0,fa.splitTextIntoTextsOfMinLen)(e,r);return o.length===1?e:o.map(u=>(0,fa.textWithPadding)(u,t,r,i)).join(`
282
282
  `)}switch(t){case"left":return e.concat(" ".repeat(r-n));case"center":return" ".repeat(s).concat(e).concat(" ".repeat(a));case"right":default:return" ".repeat(r-n).concat(e)}};fa.textWithPadding=KYe;var YYe=(e,t)=>e.split(" ").reduce((r,i)=>Math.max(r,(0,jO.findWidthInConsole)(i,t)),0);fa.biggestWordInSentence=YYe});var Gm=g(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.getWidthLimitedColumnsArray=Je.createHeaderAsRow=Je.renderTableHorizontalBorders=Je.findLenOfColumn=Je.createRow=Je.createColumFromComputedColumn=Je.createColumFromOnlyName=Je.createTableHorizontalBorders=Je.convertRawRowOptionsToStandard=Je.cellText=void 0;var $O=RO(),a1e=BO(),MO=qO(),z9=Vm(),Sf=(e,t)=>Math.max(e,t),XYe=e=>e==null?"":`${e}`;Je.cellText=XYe;var JYe=e=>{if(e)return{color:e.color,separator:e.separator||z9.DEFAULT_ROW_SEPARATOR}};Je.convertRawRowOptionsToStandard=JYe;var ZYe=({left:e,mid:t,right:r,other:i},n)=>{let s=e;return n.forEach(a=>{s+=i.repeat(a+2),s+=t}),s=s.slice(0,-t.length),s+=r,s};Je.createTableHorizontalBorders=ZYe;var QYe=e=>({name:e,title:e});Je.createColumFromOnlyName=QYe;var eXe=e=>{var t;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(t=e.title)!==null&&t!==void 0?t:e.name},(0,$O.objIfExists)("color",e.color)),(0,$O.objIfExists)("maxLen",e.maxLen)),(0,$O.objIfExists)("minLen",e.minLen)),{alignment:e.alignment||z9.DEFAULT_ROW_ALIGNMENT})};Je.createColumFromComputedColumn=eXe;var tXe=(e,t,r)=>({color:e,separator:r,text:t});Je.createRow=tXe;var rXe=(e,t,r)=>{let i=e.name,n=e.title,s=Sf(0,e?.minLen||0);return e.maxLen?(s=Sf(s,Sf(e.maxLen,(0,MO.biggestWordInSentence)(n,r))),s=t.reduce((a,o)=>Sf(a,(0,MO.biggestWordInSentence)((0,Je.cellText)(o.text[i]),r)),s),s):(s=Sf(s,(0,a1e.findWidthInConsole)(n,r)),t.forEach(a=>{s=Sf(s,(0,a1e.findWidthInConsole)((0,Je.cellText)(a.text[i]),r))}),s)};Je.findLenOfColumn=rXe;var iXe=(e,t)=>(0,Je.createTableHorizontalBorders)(e,t);Je.renderTableHorizontalBorders=iXe;var nXe=(e,t)=>{let r=z9.DEFAULT_HEADER_FONT_COLOR,i=e(r,{},!1);return t.forEach(n=>{i.text[n.name]=n.title}),i};Je.createHeaderAsRow=nXe;var sXe=(e,t,r)=>{let i={};return e.forEach(n=>{i[n.name]=(0,MO.splitTextIntoTextsOfMinLen)((0,Je.cellText)(t.text[n.name]),n.length||z9.DEFAULT_COLUMN_LEN,r)}),i};Je.getWidthLimitedColumnsArray=sXe});var o1e=g(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.preProcessRows=Af.preProcessColumns=void 0;var aXe=Gm(),oXe=e=>{e.computedColumns.length&&e.computedColumns.forEach(t=>{e.addColumn(t),e.rows.forEach(r=>{r.text[t.name]=t.function(r.text)})})},uXe=e=>{e.enabledColumns.length&&(e.columns=e.columns.filter(t=>e.enabledColumns.includes(t.name)))},lXe=e=>{e.disabledColumns.length&&(e.columns=e.columns.filter(t=>!e.disabledColumns.includes(t.name)))},cXe=e=>{e.columns.forEach(t=>{t.length=(0,aXe.findLenOfColumn)(t,e.rows,e.charLength)})},pXe=e=>{oXe(e),lXe(e),uXe(e),cXe(e)};Af.preProcessColumns=pXe;var dXe=e=>{let t=e.rows.filter(r=>e.filterFunction(r.text)).sort((r,i)=>e.sortFunction(r.text,i.text));e.rows=t};Af.preProcessRows=dXe});var UO=g($n=>{"use strict";var l1e=$n&&$n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($n,"__esModule",{value:!0});$n.printSimpleTable=$n.renderSimpleTable=$n.renderTable=void 0;var c1e=l1e(kO()),p1e=qO(),ds=Vm(),Hu=Gm(),fXe=l1e(VO()),u1e=o1e(),hXe=(e,t,r,i,n,s,a,o)=>{let u=new c1e.default(a);return u.addCharsWithColor("",e.vertical),t.forEach(l=>{let p=r<i[l.name].length?(0,Hu.cellText)(i[l.name][r]):"";u.addCharsWithColor(ds.DEFAULT_ROW_FONT_COLOR," "),u.addCharsWithColor(n&&ds.DEFAULT_HEADER_FONT_COLOR||l.color||s.color,(0,p1e.textWithPadding)(p,l.alignment||ds.DEFAULT_ROW_ALIGNMENT,l.length||ds.DEFAULT_COLUMN_LEN,o)),u.addCharsWithColor("",` ${e.vertical}`)}),u.renderConsole()},d1e=(e,t,r,i,n,s)=>{let a=(0,Hu.getWidthLimitedColumnsArray)(t,r,s),o=Object.values(a).reduce((l,c)=>Math.max(l,c.length),0),u=[];for(let l=0;l<o;l+=1){let c=hXe(e,t,l,a,n,r,i,s);u.push(c)}return u},mXe=(e,t)=>{let r=[];return r=r.concat(d1e(e.tableStyle,e.columns,t,e.colorMap,void 0,e.charLength)),r},gXe=e=>{let t=[];if(e.title===void 0)return t;let r=()=>{let s=(a,o)=>a+o+2+1;return e.columns.map(a=>a.length||ds.DEFAULT_COLUMN_LEN).reduce(s,1)},i=(0,p1e.textWithPadding)(e.title,ds.DEFAULT_HEADER_ALIGNMENT,r()),n=new c1e.default(e.colorMap);return n.addCharsWithColor(ds.DEFAULT_HEADER_FONT_COLOR,i),t.push(n.renderConsole()),t},yXe=e=>{let t=[];t.push((0,Hu.renderTableHorizontalBorders)(e.tableStyle.headerTop,e.columns.map(i=>i.length||ds.DEFAULT_COLUMN_LEN)));let r=(0,Hu.createHeaderAsRow)(Hu.createRow,e.columns);return t=t.concat(d1e(e.tableStyle,e.columns,r,e.colorMap,!0)),t.push((0,Hu.renderTableHorizontalBorders)(e.tableStyle.headerBottom,e.columns.map(i=>i.length||ds.DEFAULT_COLUMN_LEN))),t},vXe=e=>{let t=[];return t.push((0,Hu.renderTableHorizontalBorders)(e.tableStyle.tableBottom,e.columns.map(r=>r.length||ds.DEFAULT_COLUMN_LEN))),t},wXe=(e,t)=>{let r=[],i=e.rows.length-1;return e.rows.indexOf(t)!==i&&t.separator&&r.push((0,Hu.renderTableHorizontalBorders)(e.tableStyle.rowSeparator,e.columns.map(s=>s.length||ds.DEFAULT_COLUMN_LEN))),r},_Xe=e=>{(0,u1e.preProcessColumns)(e),(0,u1e.preProcessRows)(e);let t=[];return gXe(e).forEach(r=>t.push(r)),yXe(e).forEach(r=>t.push(r)),e.rows.forEach(r=>{mXe(e,r).forEach(i=>t.push(i)),wXe(e,r).forEach(i=>t.push(i))}),vXe(e).forEach(r=>t.push(r)),t.join(`
283
- `)};$n.renderTable=_Xe;var bXe=e=>{let t=new fXe.default;return t.addRows(e),(0,$n.renderTable)(t)};$n.renderSimpleTable=bXe;var DXe=e=>{console.log((0,$n.renderSimpleTable)(e))};$n.printSimpleTable=DXe});var VO=g(zO=>{"use strict";Object.defineProperty(zO,"__esModule",{value:!0});var EXe=kO(),G9=Vm(),W9=Gm(),xXe=RO(),CXe=UO(),SXe=()=>0,AXe=()=>!0,HO=class{initSimple(t){this.columns=t.map(r=>({name:r,title:r,alignment:G9.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var r;this.title=t?.title||this.title,this.tableStyle=t?.style||this.tableStyle,this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((r=t?.columns)===null||r===void 0?void 0:r.map(xXe.rawColumnToInternalColumn))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,t?.shouldDisableColors?this.colorMap={}:t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=G9.DEFAULT_TABLE_STYLE,this.filterFunction=AXe,this.sortFunction=SXe,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=G9.DEFAULT_ROW_SEPARATOR,this.colorMap=EXe.DEFAULT_COLOR_MAP,this.charLength={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let r=this.columns.map(i=>i.name);Object.keys(t).forEach(i=>{r.includes(i)||this.columns.push((0,W9.createColumFromOnlyName)(i))})}addColumn(t){typeof t=="string"?this.columns.push((0,W9.createColumFromOnlyName)(t)):this.columns.push((0,W9.createColumFromComputedColumn)(t))}addColumns(t){t.forEach(r=>{this.addColumn(r)})}addRow(t,r){this.createColumnFromRow(t),this.rows.push((0,W9.createRow)(r?.color||G9.DEFAULT_ROW_FONT_COLOR,t,r?.separator!==void 0?r?.separator:this.rowSeparator))}addRows(t,r){t.forEach(i=>{this.addRow(i,r)})}renderTable(){return(0,CXe.renderTable)(this)}};zO.default=HO});var h1e=g(Wm=>{"use strict";var TXe=Wm&&Wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wm,"__esModule",{value:!0});var OXe=TXe(VO()),f1e=Gm(),GO=class{constructor(t){this.table=new OXe.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,r){return this.table.addRow(t,(0,f1e.convertRawRowOptionsToStandard)(r)),this}addRows(t,r){return this.table.addRows(t,(0,f1e.convertRawRowOptionsToStandard)(r)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Wm.default=GO});var Km=g(ha=>{"use strict";var FXe=ha&&ha.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ha,"__esModule",{value:!0});ha.renderTable=ha.printTable=ha.Table=void 0;var NXe=FXe(h1e());ha.Table=NXe.default;var m1e=UO();Object.defineProperty(ha,"printTable",{enumerable:!0,get:function(){return m1e.printSimpleTable}});Object.defineProperty(ha,"renderTable",{enumerable:!0,get:function(){return m1e.renderSimpleTable}})});var Che=g((xht,xhe)=>{xhe.exports=R8()});var TF=he(AF(),1),{program:B,createCommand:RJe,createArgument:PJe,createOption:IJe,CommanderError:LJe,InvalidArgumentError:BJe,InvalidOptionArgumentError:jJe,Command:qJe,Argument:$Je,Option:MJe,Help:UJe}=TF.default;var ko={name:"@capgo/cli",version:"4.16.2",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:">=18.0.0"},scripts:{build:"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"},dependencies:{"@types/node-dir":"^0.0.37"},devDependencies:{"@antfu/eslint-config":"^2.27.3","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.1.2","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.7.0","@manypkg/find-root":"^2.2.3","@supabase/supabase-js":"^2.45.2","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"0.5.5","@types/mime":"^4.0.0","@types/node":"^22.5.0","@types/npmcli__ci-detect":"^2.0.3","@types/prettyjson":"^0.0.33","@types/prompt-sync":"^4.2.3","@types/semver":"^7.5.8","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.3.0","@typescript-eslint/parser":"^8.3.0","@vercel/ncc":"^0.38.1","adm-zip":"0.5.14","ci-info":"^4.0.0",commander:"12.1.0","console-table-printer":"^2.12.1",esbuild:"^0.23.1",eslint:"9.10.0","get-latest-version":"^5.1.0","git-format-staged":"3.1.1",husky:"^9.1.5","is-wsl":"^3.1.0",jszip:"^3.10.1",ky:"^1.7.1",logsnag:"1.0.0",mime:"^4.0.4","node-dir":"^0.1.17",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.6.3",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0",typescript:"5.6.2"}};var rf=require("node:process");var Xr=he(Ze(),1),Nc=require("node:process"),Ro=he(require("node:readline"),1),Ly=he(require("node:readline"),1),$F=require("node:tty"),l2=he(kF(),1);function d0e({onlyFirst:e=!1}={}){let t=["[\\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(t,e?void 0:"g")}function MF(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(d0e(),"")}var By={},f0e={get exports(){return By},set exports(e){By=e}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(i){var n=i.charCodeAt(0),s=i.length==2?i.charCodeAt(1):0,a=n;return 55296<=n&&n<=56319&&56320<=s&&s<=57343&&(n&=1023,s&=1023,a=n<<10|s,a+=65536),a==12288||65281<=a&&a<=65376||65504<=a&&a<=65510?"F":a==8361||65377<=a&&a<=65470||65474<=a&&a<=65479||65482<=a&&a<=65487||65490<=a&&a<=65495||65498<=a&&a<=65500||65512<=a&&a<=65518?"H":4352<=a&&a<=4447||4515<=a&&a<=4519||4602<=a&&a<=4607||9001<=a&&a<=9002||11904<=a&&a<=11929||11931<=a&&a<=12019||12032<=a&&a<=12245||12272<=a&&a<=12283||12289<=a&&a<=12350||12353<=a&&a<=12438||12441<=a&&a<=12543||12549<=a&&a<=12589||12593<=a&&a<=12686||12688<=a&&a<=12730||12736<=a&&a<=12771||12784<=a&&a<=12830||12832<=a&&a<=12871||12880<=a&&a<=13054||13056<=a&&a<=19903||19968<=a&&a<=42124||42128<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||55216<=a&&a<=55238||55243<=a&&a<=55291||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65106||65108<=a&&a<=65126||65128<=a&&a<=65131||110592<=a&&a<=110593||127488<=a&&a<=127490||127504<=a&&a<=127546||127552<=a&&a<=127560||127568<=a&&a<=127569||131072<=a&&a<=194367||177984<=a&&a<=196605||196608<=a&&a<=262141?"W":32<=a&&a<=126||162<=a&&a<=163||165<=a&&a<=166||a==172||a==175||10214<=a&&a<=10221||10629<=a&&a<=10630?"Na":a==161||a==164||167<=a&&a<=168||a==170||173<=a&&a<=174||176<=a&&a<=180||182<=a&&a<=186||188<=a&&a<=191||a==198||a==208||215<=a&&a<=216||222<=a&&a<=225||a==230||232<=a&&a<=234||236<=a&&a<=237||a==240||242<=a&&a<=243||247<=a&&a<=250||a==252||a==254||a==257||a==273||a==275||a==283||294<=a&&a<=295||a==299||305<=a&&a<=307||a==312||319<=a&&a<=322||a==324||328<=a&&a<=331||a==333||338<=a&&a<=339||358<=a&&a<=359||a==363||a==462||a==464||a==466||a==468||a==470||a==472||a==474||a==476||a==593||a==609||a==708||a==711||713<=a&&a<=715||a==717||a==720||728<=a&&a<=731||a==733||a==735||768<=a&&a<=879||913<=a&&a<=929||931<=a&&a<=937||945<=a&&a<=961||963<=a&&a<=969||a==1025||1040<=a&&a<=1103||a==1105||a==8208||8211<=a&&a<=8214||8216<=a&&a<=8217||8220<=a&&a<=8221||8224<=a&&a<=8226||8228<=a&&a<=8231||a==8240||8242<=a&&a<=8243||a==8245||a==8251||a==8254||a==8308||a==8319||8321<=a&&a<=8324||a==8364||a==8451||a==8453||a==8457||a==8467||a==8470||8481<=a&&a<=8482||a==8486||a==8491||8531<=a&&a<=8532||8539<=a&&a<=8542||8544<=a&&a<=8555||8560<=a&&a<=8569||a==8585||8592<=a&&a<=8601||8632<=a&&a<=8633||a==8658||a==8660||a==8679||a==8704||8706<=a&&a<=8707||8711<=a&&a<=8712||a==8715||a==8719||a==8721||a==8725||a==8730||8733<=a&&a<=8736||a==8739||a==8741||8743<=a&&a<=8748||a==8750||8756<=a&&a<=8759||8764<=a&&a<=8765||a==8776||a==8780||a==8786||8800<=a&&a<=8801||8804<=a&&a<=8807||8810<=a&&a<=8811||8814<=a&&a<=8815||8834<=a&&a<=8835||8838<=a&&a<=8839||a==8853||a==8857||a==8869||a==8895||a==8978||9312<=a&&a<=9449||9451<=a&&a<=9547||9552<=a&&a<=9587||9600<=a&&a<=9615||9618<=a&&a<=9621||9632<=a&&a<=9633||9635<=a&&a<=9641||9650<=a&&a<=9651||9654<=a&&a<=9655||9660<=a&&a<=9661||9664<=a&&a<=9665||9670<=a&&a<=9672||a==9675||9678<=a&&a<=9681||9698<=a&&a<=9701||a==9711||9733<=a&&a<=9734||a==9737||9742<=a&&a<=9743||9748<=a&&a<=9749||a==9756||a==9758||a==9792||a==9794||9824<=a&&a<=9825||9827<=a&&a<=9829||9831<=a&&a<=9834||9836<=a&&a<=9837||a==9839||9886<=a&&a<=9887||9918<=a&&a<=9919||9924<=a&&a<=9933||9935<=a&&a<=9953||a==9955||9960<=a&&a<=9983||a==10045||a==10071||10102<=a&&a<=10111||11093<=a&&a<=11097||12872<=a&&a<=12879||57344<=a&&a<=63743||65024<=a&&a<=65039||a==65533||127232<=a&&a<=127242||127248<=a&&a<=127277||127280<=a&&a<=127337||127344<=a&&a<=127386||917760<=a&&a<=917999||983040<=a&&a<=1048573||1048576<=a&&a<=1114109?"A":"N"},t.characterLength=function(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function r(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(i){for(var n=r(i),s=0,a=0;a<n.length;a++)s=s+this.characterLength(n[a]);return s},t.slice=function(i,n,s){textLen=t.length(i),n=n||0,s=s||1,n<0&&(n=textLen+n),s<0&&(s=textLen+s);for(var a="",o=0,u=r(i),l=0;l<u.length;l++){var c=u[l],p=t.length(c);if(o>=n-(p==2?1:0))if(o+p<=s)a+=c;else break;o+=p}return a}})(f0e);var h0e=By,m0e=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 Bf(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=MF(e),e.length===0))return 0;e=e.replace(m0e()," ");let r=t.ambiguousIsNarrow?1:2,i=0;for(let n of e){let s=n.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(h0e.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=r;break;default:i+=1}}return i}var Py=10,RF=(e=0)=>t=>`\x1B[${t+e}m`,PF=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,IF=(e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,ot={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(ot.modifier);var g0e=Object.keys(ot.color),y0e=Object.keys(ot.bgColor);[...g0e,...y0e];function v0e(){let e=new Map;for(let[t,r]of Object.entries(ot)){for(let[i,n]of Object.entries(r))ot[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[i]=ot[i],e.set(n[0],n[1]);Object.defineProperty(ot,t,{value:r,enumerable:!1})}return Object.defineProperty(ot,"codes",{value:e,enumerable:!1}),ot.color.close="\x1B[39m",ot.bgColor.close="\x1B[49m",ot.color.ansi=RF(),ot.color.ansi256=PF(),ot.color.ansi16m=IF(),ot.bgColor.ansi=RF(Py),ot.bgColor.ansi256=PF(Py),ot.bgColor.ansi16m=IF(Py),Object.defineProperties(ot,{rgbToAnsi256:{value:(t,r,i)=>t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(s=>s+s).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>ot.rgbToAnsi256(...ot.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,n;if(t>=232)r=((t-232)*10+8)/255,i=r,n=r;else{t-=16;let o=t%36;r=Math.floor(t/36)/5,i=Math.floor(o/6)/5,n=o%6/5}let s=Math.max(r,i,n)*2;if(s===0)return 30;let a=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(r));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,r,i)=>ot.ansi256ToAnsi(ot.rgbToAnsi256(t,r,i)),enumerable:!1},hexToAnsi:{value:t=>ot.ansi256ToAnsi(ot.hexToAnsi256(t)),enumerable:!1}}),ot}var w0e=v0e(),f2=new Set(["\x1B","\x9B"]),_0e=39,jy="\x07",UF="[",b0e="]",VF="m",qy=`${b0e}8;;`,LF=e=>`${f2.values().next().value}${UF}${e}${VF}`,BF=e=>`${f2.values().next().value}${qy}${e}${jy}`,D0e=e=>e.split(" ").map(t=>Bf(t)),Iy=(e,t,r)=>{let i=[...t],n=!1,s=!1,a=Bf(MF(e[e.length-1]));for(let[o,u]of i.entries()){let l=Bf(u);if(a+l<=r?e[e.length-1]+=u:(e.push(u),a=0),f2.has(u)&&(n=!0,s=i.slice(o+1).join("").startsWith(qy)),n){s?u===jy&&(n=!1,s=!1):u===VF&&(n=!1);continue}a+=l,a===r&&o<i.length-1&&(e.push(""),a=0)}!a&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},E0e=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Bf(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},x0e=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,a=D0e(e),o=[""];for(let[l,c]of e.split(" ").entries()){r.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let p=Bf(o[o.length-1]);if(l!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(o.push(""),p=0),(p>0||r.trim===!1)&&(o[o.length-1]+=" ",p++)),r.hard&&a[l]>t){let d=t-p,f=1+Math.floor((a[l]-d-1)/t);Math.floor((a[l]-1)/t)<f&&o.push(""),Iy(o,c,t);continue}if(p+a[l]>t&&p>0&&a[l]>0){if(r.wordWrap===!1&&p<t){Iy(o,c,t);continue}o.push("")}if(p+a[l]>t&&r.wordWrap===!1){Iy(o,c,t);continue}o[o.length-1]+=c}r.trim!==!1&&(o=o.map(l=>E0e(l)));let u=[...o.join(`
283
+ `)};$n.renderTable=_Xe;var bXe=e=>{let t=new fXe.default;return t.addRows(e),(0,$n.renderTable)(t)};$n.renderSimpleTable=bXe;var DXe=e=>{console.log((0,$n.renderSimpleTable)(e))};$n.printSimpleTable=DXe});var VO=g(zO=>{"use strict";Object.defineProperty(zO,"__esModule",{value:!0});var EXe=kO(),G9=Vm(),W9=Gm(),xXe=RO(),CXe=UO(),SXe=()=>0,AXe=()=>!0,HO=class{initSimple(t){this.columns=t.map(r=>({name:r,title:r,alignment:G9.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var r;this.title=t?.title||this.title,this.tableStyle=t?.style||this.tableStyle,this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((r=t?.columns)===null||r===void 0?void 0:r.map(xXe.rawColumnToInternalColumn))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,t?.shouldDisableColors?this.colorMap={}:t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=G9.DEFAULT_TABLE_STYLE,this.filterFunction=AXe,this.sortFunction=SXe,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=G9.DEFAULT_ROW_SEPARATOR,this.colorMap=EXe.DEFAULT_COLOR_MAP,this.charLength={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let r=this.columns.map(i=>i.name);Object.keys(t).forEach(i=>{r.includes(i)||this.columns.push((0,W9.createColumFromOnlyName)(i))})}addColumn(t){typeof t=="string"?this.columns.push((0,W9.createColumFromOnlyName)(t)):this.columns.push((0,W9.createColumFromComputedColumn)(t))}addColumns(t){t.forEach(r=>{this.addColumn(r)})}addRow(t,r){this.createColumnFromRow(t),this.rows.push((0,W9.createRow)(r?.color||G9.DEFAULT_ROW_FONT_COLOR,t,r?.separator!==void 0?r?.separator:this.rowSeparator))}addRows(t,r){t.forEach(i=>{this.addRow(i,r)})}renderTable(){return(0,CXe.renderTable)(this)}};zO.default=HO});var h1e=g(Wm=>{"use strict";var TXe=Wm&&Wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wm,"__esModule",{value:!0});var OXe=TXe(VO()),f1e=Gm(),GO=class{constructor(t){this.table=new OXe.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,r){return this.table.addRow(t,(0,f1e.convertRawRowOptionsToStandard)(r)),this}addRows(t,r){return this.table.addRows(t,(0,f1e.convertRawRowOptionsToStandard)(r)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Wm.default=GO});var Km=g(ha=>{"use strict";var FXe=ha&&ha.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ha,"__esModule",{value:!0});ha.renderTable=ha.printTable=ha.Table=void 0;var NXe=FXe(h1e());ha.Table=NXe.default;var m1e=UO();Object.defineProperty(ha,"printTable",{enumerable:!0,get:function(){return m1e.printSimpleTable}});Object.defineProperty(ha,"renderTable",{enumerable:!0,get:function(){return m1e.renderSimpleTable}})});var Che=g((xht,xhe)=>{xhe.exports=R8()});var TF=he(AF(),1),{program:B,createCommand:RJe,createArgument:PJe,createOption:IJe,CommanderError:LJe,InvalidArgumentError:BJe,InvalidOptionArgumentError:jJe,Command:qJe,Argument:$Je,Option:MJe,Help:UJe}=TF.default;var ko={name:"@capgo/cli",version:"4.16.4",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:">=18.0.0"},scripts:{build:"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"},dependencies:{"@types/node-dir":"^0.0.37"},devDependencies:{"@antfu/eslint-config":"^2.27.3","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.1.2","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.7.0","@manypkg/find-root":"^2.2.3","@supabase/supabase-js":"^2.45.2","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"0.5.5","@types/mime":"^4.0.0","@types/node":"^22.5.0","@types/npmcli__ci-detect":"^2.0.3","@types/prettyjson":"^0.0.33","@types/prompt-sync":"^4.2.3","@types/semver":"^7.5.8","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.3.0","@typescript-eslint/parser":"^8.3.0","@vercel/ncc":"^0.38.1","adm-zip":"0.5.14","ci-info":"^4.0.0",commander:"12.1.0","console-table-printer":"^2.12.1",esbuild:"^0.23.1",eslint:"9.10.0","get-latest-version":"^5.1.0","git-format-staged":"3.1.1",husky:"^9.1.5","is-wsl":"^3.1.0",jszip:"^3.10.1",ky:"^1.7.1",logsnag:"1.0.0",mime:"^4.0.4","node-dir":"^0.1.17",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.6.3",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0",typescript:"5.6.2"}};var rf=require("node:process");var Xr=he(Ze(),1),Nc=require("node:process"),Ro=he(require("node:readline"),1),Ly=he(require("node:readline"),1),$F=require("node:tty"),l2=he(kF(),1);function d0e({onlyFirst:e=!1}={}){let t=["[\\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(t,e?void 0:"g")}function MF(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(d0e(),"")}var By={},f0e={get exports(){return By},set exports(e){By=e}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(i){var n=i.charCodeAt(0),s=i.length==2?i.charCodeAt(1):0,a=n;return 55296<=n&&n<=56319&&56320<=s&&s<=57343&&(n&=1023,s&=1023,a=n<<10|s,a+=65536),a==12288||65281<=a&&a<=65376||65504<=a&&a<=65510?"F":a==8361||65377<=a&&a<=65470||65474<=a&&a<=65479||65482<=a&&a<=65487||65490<=a&&a<=65495||65498<=a&&a<=65500||65512<=a&&a<=65518?"H":4352<=a&&a<=4447||4515<=a&&a<=4519||4602<=a&&a<=4607||9001<=a&&a<=9002||11904<=a&&a<=11929||11931<=a&&a<=12019||12032<=a&&a<=12245||12272<=a&&a<=12283||12289<=a&&a<=12350||12353<=a&&a<=12438||12441<=a&&a<=12543||12549<=a&&a<=12589||12593<=a&&a<=12686||12688<=a&&a<=12730||12736<=a&&a<=12771||12784<=a&&a<=12830||12832<=a&&a<=12871||12880<=a&&a<=13054||13056<=a&&a<=19903||19968<=a&&a<=42124||42128<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||55216<=a&&a<=55238||55243<=a&&a<=55291||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65106||65108<=a&&a<=65126||65128<=a&&a<=65131||110592<=a&&a<=110593||127488<=a&&a<=127490||127504<=a&&a<=127546||127552<=a&&a<=127560||127568<=a&&a<=127569||131072<=a&&a<=194367||177984<=a&&a<=196605||196608<=a&&a<=262141?"W":32<=a&&a<=126||162<=a&&a<=163||165<=a&&a<=166||a==172||a==175||10214<=a&&a<=10221||10629<=a&&a<=10630?"Na":a==161||a==164||167<=a&&a<=168||a==170||173<=a&&a<=174||176<=a&&a<=180||182<=a&&a<=186||188<=a&&a<=191||a==198||a==208||215<=a&&a<=216||222<=a&&a<=225||a==230||232<=a&&a<=234||236<=a&&a<=237||a==240||242<=a&&a<=243||247<=a&&a<=250||a==252||a==254||a==257||a==273||a==275||a==283||294<=a&&a<=295||a==299||305<=a&&a<=307||a==312||319<=a&&a<=322||a==324||328<=a&&a<=331||a==333||338<=a&&a<=339||358<=a&&a<=359||a==363||a==462||a==464||a==466||a==468||a==470||a==472||a==474||a==476||a==593||a==609||a==708||a==711||713<=a&&a<=715||a==717||a==720||728<=a&&a<=731||a==733||a==735||768<=a&&a<=879||913<=a&&a<=929||931<=a&&a<=937||945<=a&&a<=961||963<=a&&a<=969||a==1025||1040<=a&&a<=1103||a==1105||a==8208||8211<=a&&a<=8214||8216<=a&&a<=8217||8220<=a&&a<=8221||8224<=a&&a<=8226||8228<=a&&a<=8231||a==8240||8242<=a&&a<=8243||a==8245||a==8251||a==8254||a==8308||a==8319||8321<=a&&a<=8324||a==8364||a==8451||a==8453||a==8457||a==8467||a==8470||8481<=a&&a<=8482||a==8486||a==8491||8531<=a&&a<=8532||8539<=a&&a<=8542||8544<=a&&a<=8555||8560<=a&&a<=8569||a==8585||8592<=a&&a<=8601||8632<=a&&a<=8633||a==8658||a==8660||a==8679||a==8704||8706<=a&&a<=8707||8711<=a&&a<=8712||a==8715||a==8719||a==8721||a==8725||a==8730||8733<=a&&a<=8736||a==8739||a==8741||8743<=a&&a<=8748||a==8750||8756<=a&&a<=8759||8764<=a&&a<=8765||a==8776||a==8780||a==8786||8800<=a&&a<=8801||8804<=a&&a<=8807||8810<=a&&a<=8811||8814<=a&&a<=8815||8834<=a&&a<=8835||8838<=a&&a<=8839||a==8853||a==8857||a==8869||a==8895||a==8978||9312<=a&&a<=9449||9451<=a&&a<=9547||9552<=a&&a<=9587||9600<=a&&a<=9615||9618<=a&&a<=9621||9632<=a&&a<=9633||9635<=a&&a<=9641||9650<=a&&a<=9651||9654<=a&&a<=9655||9660<=a&&a<=9661||9664<=a&&a<=9665||9670<=a&&a<=9672||a==9675||9678<=a&&a<=9681||9698<=a&&a<=9701||a==9711||9733<=a&&a<=9734||a==9737||9742<=a&&a<=9743||9748<=a&&a<=9749||a==9756||a==9758||a==9792||a==9794||9824<=a&&a<=9825||9827<=a&&a<=9829||9831<=a&&a<=9834||9836<=a&&a<=9837||a==9839||9886<=a&&a<=9887||9918<=a&&a<=9919||9924<=a&&a<=9933||9935<=a&&a<=9953||a==9955||9960<=a&&a<=9983||a==10045||a==10071||10102<=a&&a<=10111||11093<=a&&a<=11097||12872<=a&&a<=12879||57344<=a&&a<=63743||65024<=a&&a<=65039||a==65533||127232<=a&&a<=127242||127248<=a&&a<=127277||127280<=a&&a<=127337||127344<=a&&a<=127386||917760<=a&&a<=917999||983040<=a&&a<=1048573||1048576<=a&&a<=1114109?"A":"N"},t.characterLength=function(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function r(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(i){for(var n=r(i),s=0,a=0;a<n.length;a++)s=s+this.characterLength(n[a]);return s},t.slice=function(i,n,s){textLen=t.length(i),n=n||0,s=s||1,n<0&&(n=textLen+n),s<0&&(s=textLen+s);for(var a="",o=0,u=r(i),l=0;l<u.length;l++){var c=u[l],p=t.length(c);if(o>=n-(p==2?1:0))if(o+p<=s)a+=c;else break;o+=p}return a}})(f0e);var h0e=By,m0e=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 Bf(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=MF(e),e.length===0))return 0;e=e.replace(m0e()," ");let r=t.ambiguousIsNarrow?1:2,i=0;for(let n of e){let s=n.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(h0e.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=r;break;default:i+=1}}return i}var Py=10,RF=(e=0)=>t=>`\x1B[${t+e}m`,PF=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,IF=(e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,ot={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(ot.modifier);var g0e=Object.keys(ot.color),y0e=Object.keys(ot.bgColor);[...g0e,...y0e];function v0e(){let e=new Map;for(let[t,r]of Object.entries(ot)){for(let[i,n]of Object.entries(r))ot[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[i]=ot[i],e.set(n[0],n[1]);Object.defineProperty(ot,t,{value:r,enumerable:!1})}return Object.defineProperty(ot,"codes",{value:e,enumerable:!1}),ot.color.close="\x1B[39m",ot.bgColor.close="\x1B[49m",ot.color.ansi=RF(),ot.color.ansi256=PF(),ot.color.ansi16m=IF(),ot.bgColor.ansi=RF(Py),ot.bgColor.ansi256=PF(Py),ot.bgColor.ansi16m=IF(Py),Object.defineProperties(ot,{rgbToAnsi256:{value:(t,r,i)=>t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(s=>s+s).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>ot.rgbToAnsi256(...ot.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,n;if(t>=232)r=((t-232)*10+8)/255,i=r,n=r;else{t-=16;let o=t%36;r=Math.floor(t/36)/5,i=Math.floor(o/6)/5,n=o%6/5}let s=Math.max(r,i,n)*2;if(s===0)return 30;let a=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(r));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,r,i)=>ot.ansi256ToAnsi(ot.rgbToAnsi256(t,r,i)),enumerable:!1},hexToAnsi:{value:t=>ot.ansi256ToAnsi(ot.hexToAnsi256(t)),enumerable:!1}}),ot}var w0e=v0e(),f2=new Set(["\x1B","\x9B"]),_0e=39,jy="\x07",UF="[",b0e="]",VF="m",qy=`${b0e}8;;`,LF=e=>`${f2.values().next().value}${UF}${e}${VF}`,BF=e=>`${f2.values().next().value}${qy}${e}${jy}`,D0e=e=>e.split(" ").map(t=>Bf(t)),Iy=(e,t,r)=>{let i=[...t],n=!1,s=!1,a=Bf(MF(e[e.length-1]));for(let[o,u]of i.entries()){let l=Bf(u);if(a+l<=r?e[e.length-1]+=u:(e.push(u),a=0),f2.has(u)&&(n=!0,s=i.slice(o+1).join("").startsWith(qy)),n){s?u===jy&&(n=!1,s=!1):u===VF&&(n=!1);continue}a+=l,a===r&&o<i.length-1&&(e.push(""),a=0)}!a&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},E0e=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Bf(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},x0e=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,a=D0e(e),o=[""];for(let[l,c]of e.split(" ").entries()){r.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let p=Bf(o[o.length-1]);if(l!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(o.push(""),p=0),(p>0||r.trim===!1)&&(o[o.length-1]+=" ",p++)),r.hard&&a[l]>t){let d=t-p,f=1+Math.floor((a[l]-d-1)/t);Math.floor((a[l]-1)/t)<f&&o.push(""),Iy(o,c,t);continue}if(p+a[l]>t&&p>0&&a[l]>0){if(r.wordWrap===!1&&p<t){Iy(o,c,t);continue}o.push("")}if(p+a[l]>t&&r.wordWrap===!1){Iy(o,c,t);continue}o[o.length-1]+=c}r.trim!==!1&&(o=o.map(l=>E0e(l)));let u=[...o.join(`
284
284
  `)];for(let[l,c]of u.entries()){if(i+=c,f2.has(c)){let{groups:d}=new RegExp(`(?:\\${UF}(?<code>\\d+)m|\\${qy}(?<uri>.*)${jy})`).exec(u.slice(l).join(""))||{groups:{}};if(d.code!==void 0){let f=Number.parseFloat(d.code);n=f===_0e?void 0:f}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let p=w0e.codes.get(Number(n));u[l+1]===`
285
285
  `?(s&&(i+=BF("")),n&&p&&(i+=LF(p))):c===`
286
286
  `&&(n&&p&&(i+=LF(n)),s&&(i+=BF(s)))}return i};function jF(e,t,r){return String(e).normalize().replace(/\r\n/g,`
@@ -328,7 +328,7 @@ ${noe.default.render(e)}`:"";function eoe(e){return new Promise(t=>{setTimeout(t
328
328
  Upgrade here: ${s.hostWeb}/dashboard/settings/plans
329
329
  `),eoe(100),Promise.resolve().then(()=>(Jae(),Xae)).then(l=>{l.default(`${s.hostWeb}/dashboard/settings/plans`)}),eoe(500),B.error(""));let[o,u]=await Promise.all([Gqe(e,t),zqe(e,t)]);o>0&&n&&!u&&S.warn(`WARNING !!
330
330
  Trial expires in ${o} days, upgrade here: ${s.hostWeb}/dashboard/settings/plans
331
- `)}function xe(e=!1){let t=(0,U8.homedir)(),r,i=`${t}/.capgo`;return(0,vr.existsSync)(i)&&(e||S.info(`Use global apy key ${i}`),r=(0,vr.readFileSync)(i,"utf8").trim()),i=".capgo",!r&&(0,vr.existsSync)(i)&&(e||S.info(`Use local apy key ${i}`),r=(0,vr.readFileSync)(i,"utf8").trim()),r||(S.error(`Cannot find API key in local folder or global, please login first with ${ci().runner} @capacitor/cli login`),B.error("")),r}async function*FA(e){let t=await(0,vr.readdirSync)(e,{withFileTypes:!0});for(let r of t){let i=(0,ui.resolve)(e,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*FA(i):yield i}}async function NA(){let e=(0,Wr.cwd)(),t=!1,r=(0,ui.resolve)(e,"tsconfig.json");(0,vr.existsSync)(r)&&(t=!0);for await(let i of FA(e)){if(i.includes("angular.json"))return S.info("Found angular project"),t?"angular-ts":"angular-js";if(i.includes("nuxt.config.js"))return S.info("Found nuxtjs project"),t?"nuxtjs-ts":"nuxtjs-js";if(i.includes("next.config.js")||i.includes("next.config.mjs"))return S.info("Found nextjs project"),t?"nextjs-ts":"nextjs-js";if(i.includes("svelte.config.js"))return S.info("Found sveltekit project"),t?"sveltekit-ts":"sveltekit-js";if(i.includes("rolluconfig.js"))return S.info("Found svelte project"),t?"svelte-ts":"svelte-js";if(i.includes("vue.config.js"))return S.info("Found vue project"),t?"vue-ts":"vue-js";if(i.includes("package.json")){let n=await li();if(n.dependencies){if(n.dependencies.react)return S.info("Found react project test"),t?"react-ts":"react-js";if(n.dependencies.vue)return S.info("Found vue project"),t?"vue-ts":"vue-js"}}}return"unknown"}function foe(e,t){return e==="angular-js"||e==="angular-ts"?t?"src/main.ts":"src/main.js":e==="nextjs-js"||e==="nextjs-ts"?t?"src/app/layout.tsx":"src/app/layout.js":e==="svelte-js"||e==="svelte-ts"||e==="vue-js"||e==="vue-ts"?t?"src/main.ts":"src/main.js":e==="react-js"||e==="react-ts"?t?"src/index.tsx":"src/index.js":null}async function hoe(e){return e==="angular"?(S.info("Angular project detected"),"build"):e==="nuxtjs"?(S.info("Nuxtjs project detected"),"generate"):e==="nextjs"?(S.info("Nextjs project detected"),S.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"),S.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Qe({message:"Do you want to continue?"})||(S.error("Aborted"),B.error("")),"build"):(e==="sveltekit"&&(S.info("Sveltekit project detected"),S.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),S.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Qe({message:"Do you want to continue?"})||(S.error("Aborted"),B.error(""))),"build")}async function moe(){let e=/(main|index)\.(ts|tsx|js|jsx)$/,t="",r=(0,Wr.cwd)(),i=r.split("/").length;for await(let n of FA(r))if(n.split("/").length-i<=2&&e.test(n)){t=n,S.info(`Found main file here ${n}`);break}return t}async function kA(e,t){return e.from("app_versions").upsert(t,{onConflict:"name,app_id"}).eq("app_id",t.app_id).eq("name",t.name)}async function goe(e,t,r){let i={app_id:t,name:r,version:0};try{return(await e.functions.invoke("private/upload_link",{body:JSON.stringify(i)})).data.url}catch(n){S.error(`Cannot get upload url ${oe(n)}`)}return""}async function Yqe(e,t,r){let i={app_id:t,name:r,version:1};try{return(await e.functions.invoke("private/upload_link",{body:JSON.stringify(i)})).data}catch(n){return S.error(`Cannot get upload url ${oe(n)}`),null}}async function H8(e){return(0,U8.platform)()==="win32"?Jqe(e):Xqe(e)}function Xqe(e){let t=new aoe.default;return t.addLocalFolder(e),t.toBuffer()}async function Jqe(e){S.info("Zipping file windows mode");let t=new ooe.default,r=async(n,s)=>{let a=(0,vr.readdirSync)(n);for(let o of a){let u=(0,ui.join)(n,o),l=(0,vr.statSync)(u);if(l.isFile()){let c=await(0,vr.readFileSync)(u);t.file((0,ui.join)(s,o).split(ui.sep).join("/"),c)}else l.isDirectory()&&await r(u,(0,ui.join)(s,o))}};return await r(e,""),await t.generateAsync({type:"nodebuffer",platform:"UNIX",compression:"DEFLATE",compressionOptions:{level:6}})}async function Zqe(e,t,r,i){let n={action:"mpu-complete",uploadId:t,key:e};await Xo.post(r,{json:{parts:i},searchParams:new URLSearchParams({body:btoa(JSON.stringify(n))})})}var toe=10*1024*1024;async function yoe(e,t,r,i,n){try{let s=qt();await s.track({channel:"app",event:"App Multipart Prepare",icon:"\u23EB",user_id:n,tags:{"app-id":t},notify:!1}).catch();let a=await Yqe(e,t,r);if(!a)return!1;let o=i.length,u=Math.ceil(o/toe),l=Array.from({length:u},(p,d)=>Qqe(i,toe,a.url,a.key,a.uploadId,d)),c=await Promise.all(l);return await Zqe(a.key,a.uploadId,a.url,c),await s.track({channel:"app",event:"App Multipart done",icon:"\u23EB",user_id:n,tags:{"app-id":t},notify:!1}).catch(),!0}catch(s){return S.error(`Could not upload via multipart ${oe(s)}`),!1}}async function voe(e,t,r){let i={app_id:t,name:r};try{return(await e.functions.invoke("private/delete_failed_version",{body:JSON.stringify(i),method:"DELETE"})).data.status}catch(n){return S.error(`Cannot delete failed version ${oe(n)}`),Promise.reject(new Error("Cannot delete failed version"))}}async function Qqe(e,t,r,i,n,s){let a=e.subarray(t*s,t*(s+1)),o={action:"mpu-uploadpart",uploadId:n,partNumber:s+1,key:i};return await(await Xo.put(r,{body:a,searchParams:new URLSearchParams({body:btoa(JSON.stringify(o))})})).json()}async function z8(e,t){if(!t.app_id||!t.name||!t.created_by)return S.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:i}=await e.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",t.app_id).eq("name",t.name).single();if(r&&!i){if(r.enable_progressive_deploy){if(S.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&S.warn("Latest progressive deploy has not finished"),t.second_version=t.version,!r.second_version)return S.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));t.version=r.second_version,t.secondary_version_percentage=.1,S.info("Started new progressive upload!")}return e.from("channels").update(t).eq("app_id",t.app_id).eq("name",t.name).select().single()}return e.from("channels").insert(t).select().single()}function qt(){return new soe.LogSnag({token:Wr.env.CAPGO_LOGSNAG??"c124f5e9d0ce5bdd14bbb48f815d5583",project:Wr.env.CAPGO_LOGSNAG_PROJECT??"capgo"})}async function Qd(e,t){let{error:r,data:i}=await e.rpc("get_orgs_v5");r&&(S.error("Cannot get the list of organizations - exiting"),S.error(`Error ${JSON.stringify(r)}`),B.error(""));let n=i.filter(u=>!!t.find(l=>l===u.role));n.length===0&&(S.error(`Could not get organization with roles: ${t.join(" or ")} because the user does not have any org`),B.error(""));let s=n.length>1?await Pc({message:"Please pick the organization that you want to insert to",options:n.map(u=>({value:u.gid,label:u.name}))}):n[0].gid;gi(s)&&(S.error("Canceled organization selection, exiting"),B.error(""));let a=s,o=i.find(u=>u.gid===a);return S.info(`Using the organization "${o.name}" as the app owner`),o}var ef=e=>e.replace(/\./g,"--");async function be(e,t,r=["all"]){await Hqe(e,t,r);let{data:i,error:n}=await e.rpc("get_user_id",{apikey:t}).single(),s=(i||"").toString();return(!s||n)&&(S.error("Cannot auth user with apikey"),B.error("")),s}async function Pn(e,t){let{data:r,error:i}=await e.from("apps").select("owner_org").eq("app_id",t).single();return(!r||i)&&(S.error(`Cannot get organization id for app id ${t}`),oe(i),B.error("")),r.owner_org}function tf(e){return new Date(e||"").toLocaleString()}var roe=!1,Xd="npm",am="install",AA="npx";function ci(){if(roe)return{pm:Xd,command:am,installCommand:`${Xd} ${am}`,runner:AA};let e=(0,TA.findRootSync)((0,Wr.cwd)());return Xd=_h(e.rootDir,"npm"),am=v4(Xd),roe=!0,AA=C$(e.rootDir),{pm:Xd,command:am,installCommand:`${Xd} ${am}`,runner:AA}}function woe(e){return(0,vr.readdirSync)(e,{withFileTypes:!0}).flatMap(i=>{let n=(0,ui.join)(e,i.name);return i.isDirectory()?woe(n):n.split(`node_modules${ui.sep}`)[1]||n})}async function RA(){let e=(0,TA.findRootSync)((0,Wr.cwd)()),t=(0,ui.join)((0,Wr.cwd)(),"package.json");(0,vr.existsSync)(t)||(S.error("Missing package.json, you need to be in a capacitor project"),B.error(""));let r;try{r=await li()}catch(o){S.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",o),B.error("")}let{dependencies:i}=r;i||(S.error("Missing dependencies section in package.json"),B.error(""));for(let[o,u]of Object.entries(i))typeof u!="string"&&(S.error(`Invalid dependency ${o}: ${u}, expected string, got ${typeof u}`),B.error(""));let n=(0,ui.join)((0,Wr.cwd)(),"node_modules");if(!(0,vr.existsSync)(n)){let o=_h(e.rootDir,"npm"),u=v4(o);S.error(`Missing node_modules folder, please run ${o} ${u}`),B.error("")}let s=!1,a=await Promise.all(Object.entries(i).map(async([o,u])=>{let l=(0,ui.join)(n,o);if(!(0,vr.existsSync)(l)){s=!0;let d=_h(e.rootDir,"npm"),f=v4(d);return S.error(`Missing dependency ${o}, please run ${d} ${f}`),{name:o,version:u}}let p=!1;try{p=woe(l).some(f=>Vqe.test(f))}catch(d){S.error(`Error reading node_modules files for ${o} package`),console.error(d),B.error("")}return{name:o,version:u,native:p}})).catch(()=>[]);return(s||a.find(o=>o.native===void 0))&&B.error(""),a}async function e$e(e,t,r){let{data:i,error:n}=await e.from("channels").select("version(checksum)").eq("name",r).eq("app_id",t).single(),s=i;return n||s===null||!s.version||!s.version.checksum?null:s.version.checksum}async function t$e(e,t,r){let{data:i,error:n}=await e.from("channels").select(`version (
331
+ `)}function xe(e=!1){let t=(0,U8.homedir)(),r,i=`${t}/.capgo`;return(0,vr.existsSync)(i)&&(e||S.info(`Use global API key ${i}`),r=(0,vr.readFileSync)(i,"utf8").trim()),i=".capgo",!r&&(0,vr.existsSync)(i)&&(e||S.info(`Use local API key ${i}`),r=(0,vr.readFileSync)(i,"utf8").trim()),r||(S.error(`Cannot find API key in local folder or global, please login first with ${ci().runner} @capacitor/cli login`),B.error("")),r}async function*FA(e){let t=await(0,vr.readdirSync)(e,{withFileTypes:!0});for(let r of t){let i=(0,ui.resolve)(e,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*FA(i):yield i}}async function NA(){let e=(0,Wr.cwd)(),t=!1,r=(0,ui.resolve)(e,"tsconfig.json");(0,vr.existsSync)(r)&&(t=!0);for await(let i of FA(e)){if(i.includes("angular.json"))return S.info("Found angular project"),t?"angular-ts":"angular-js";if(i.includes("nuxt.config.js"))return S.info("Found nuxtjs project"),t?"nuxtjs-ts":"nuxtjs-js";if(i.includes("next.config.js")||i.includes("next.config.mjs"))return S.info("Found nextjs project"),t?"nextjs-ts":"nextjs-js";if(i.includes("svelte.config.js"))return S.info("Found sveltekit project"),t?"sveltekit-ts":"sveltekit-js";if(i.includes("rolluconfig.js"))return S.info("Found svelte project"),t?"svelte-ts":"svelte-js";if(i.includes("vue.config.js"))return S.info("Found vue project"),t?"vue-ts":"vue-js";if(i.includes("package.json")){let n=await li();if(n.dependencies){if(n.dependencies.react)return S.info("Found react project test"),t?"react-ts":"react-js";if(n.dependencies.vue)return S.info("Found vue project"),t?"vue-ts":"vue-js"}}}return"unknown"}function foe(e,t){return e==="angular-js"||e==="angular-ts"?t?"src/main.ts":"src/main.js":e==="nextjs-js"||e==="nextjs-ts"?t?"src/app/layout.tsx":"src/app/layout.js":e==="svelte-js"||e==="svelte-ts"||e==="vue-js"||e==="vue-ts"?t?"src/main.ts":"src/main.js":e==="react-js"||e==="react-ts"?t?"src/index.tsx":"src/index.js":null}async function hoe(e){return e==="angular"?(S.info("Angular project detected"),"build"):e==="nuxtjs"?(S.info("Nuxtjs project detected"),"generate"):e==="nextjs"?(S.info("Nextjs project detected"),S.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"),S.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Qe({message:"Do you want to continue?"})||(S.error("Aborted"),B.error("")),"build"):(e==="sveltekit"&&(S.info("Sveltekit project detected"),S.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),S.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Qe({message:"Do you want to continue?"})||(S.error("Aborted"),B.error(""))),"build")}async function moe(){let e=/(main|index)\.(ts|tsx|js|jsx)$/,t="",r=(0,Wr.cwd)(),i=r.split("/").length;for await(let n of FA(r))if(n.split("/").length-i<=2&&e.test(n)){t=n,S.info(`Found main file here ${n}`);break}return t}async function kA(e,t){return e.from("app_versions").upsert(t,{onConflict:"name,app_id"}).eq("app_id",t.app_id).eq("name",t.name)}async function goe(e,t,r){let i={app_id:t,name:r,version:0};try{return(await e.functions.invoke("private/upload_link",{body:JSON.stringify(i)})).data.url}catch(n){S.error(`Cannot get upload url ${oe(n)}`)}return""}async function Yqe(e,t,r){let i={app_id:t,name:r,version:1};try{return(await e.functions.invoke("private/upload_link",{body:JSON.stringify(i)})).data}catch(n){return S.error(`Cannot get upload url ${oe(n)}`),null}}async function H8(e){return(0,U8.platform)()==="win32"?Jqe(e):Xqe(e)}function Xqe(e){let t=new aoe.default;return t.addLocalFolder(e),t.toBuffer()}async function Jqe(e){S.info("Zipping file windows mode");let t=new ooe.default,r=async(n,s)=>{let a=(0,vr.readdirSync)(n);for(let o of a){let u=(0,ui.join)(n,o),l=(0,vr.statSync)(u);if(l.isFile()){let c=await(0,vr.readFileSync)(u);t.file((0,ui.join)(s,o).split(ui.sep).join("/"),c)}else l.isDirectory()&&await r(u,(0,ui.join)(s,o))}};return await r(e,""),await t.generateAsync({type:"nodebuffer",platform:"UNIX",compression:"DEFLATE",compressionOptions:{level:6}})}async function Zqe(e,t,r,i){let n={action:"mpu-complete",uploadId:t,key:e};await Xo.post(r,{json:{parts:i},searchParams:new URLSearchParams({body:btoa(JSON.stringify(n))})})}var toe=10*1024*1024;async function yoe(e,t,r,i,n){try{let s=qt();await s.track({channel:"app",event:"App Multipart Prepare",icon:"\u23EB",user_id:n,tags:{"app-id":t},notify:!1}).catch();let a=await Yqe(e,t,r);if(!a)return!1;let o=i.length,u=Math.ceil(o/toe),l=Array.from({length:u},(p,d)=>Qqe(i,toe,a.url,a.key,a.uploadId,d)),c=await Promise.all(l);return await Zqe(a.key,a.uploadId,a.url,c),await s.track({channel:"app",event:"App Multipart done",icon:"\u23EB",user_id:n,tags:{"app-id":t},notify:!1}).catch(),!0}catch(s){return S.error(`Could not upload via multipart ${oe(s)}`),!1}}async function voe(e,t,r){let i={app_id:t,name:r};try{return(await e.functions.invoke("private/delete_failed_version",{body:JSON.stringify(i),method:"DELETE"})).data.status}catch(n){return S.error(`Cannot delete failed version ${oe(n)}`),Promise.reject(new Error("Cannot delete failed version"))}}async function Qqe(e,t,r,i,n,s){let a=e.subarray(t*s,t*(s+1)),o={action:"mpu-uploadpart",uploadId:n,partNumber:s+1,key:i};return await(await Xo.put(r,{body:a,searchParams:new URLSearchParams({body:btoa(JSON.stringify(o))})})).json()}async function z8(e,t){if(!t.app_id||!t.name||!t.created_by)return S.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:i}=await e.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",t.app_id).eq("name",t.name).single();if(r&&!i){if(r.enable_progressive_deploy){if(S.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&S.warn("Latest progressive deploy has not finished"),t.second_version=t.version,!r.second_version)return S.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));t.version=r.second_version,t.secondary_version_percentage=.1,S.info("Started new progressive upload!")}return e.from("channels").update(t).eq("app_id",t.app_id).eq("name",t.name).select().single()}return e.from("channels").insert(t).select().single()}function qt(){return new soe.LogSnag({token:Wr.env.CAPGO_LOGSNAG??"c124f5e9d0ce5bdd14bbb48f815d5583",project:Wr.env.CAPGO_LOGSNAG_PROJECT??"capgo"})}async function Qd(e,t){let{error:r,data:i}=await e.rpc("get_orgs_v5");r&&(S.error("Cannot get the list of organizations - exiting"),S.error(`Error ${JSON.stringify(r)}`),B.error(""));let n=i.filter(u=>!!t.find(l=>l===u.role));n.length===0&&(S.error(`Could not get organization with roles: ${t.join(" or ")} because the user does not have any org`),B.error(""));let s=n.length>1?await Pc({message:"Please pick the organization that you want to insert to",options:n.map(u=>({value:u.gid,label:u.name}))}):n[0].gid;gi(s)&&(S.error("Canceled organization selection, exiting"),B.error(""));let a=s,o=i.find(u=>u.gid===a);return S.info(`Using the organization "${o.name}" as the app owner`),o}var ef=e=>e.replace(/\./g,"--");async function be(e,t,r=["all"]){await Hqe(e,t,r);let{data:i,error:n}=await e.rpc("get_user_id",{apikey:t}).single(),s=(i||"").toString();return(!s||n)&&(S.error("Cannot auth user with apikey"),B.error("")),s}async function Pn(e,t){let{data:r,error:i}=await e.from("apps").select("owner_org").eq("app_id",t).single();return(!r||i)&&(S.error(`Cannot get organization id for app id ${t}`),oe(i),B.error("")),r.owner_org}function tf(e){return new Date(e||"").toLocaleString()}var roe=!1,Xd="npm",am="install",AA="npx";function ci(){if(roe)return{pm:Xd,command:am,installCommand:`${Xd} ${am}`,runner:AA};let e=(0,TA.findRootSync)((0,Wr.cwd)());return Xd=_h(e.rootDir,"npm"),am=v4(Xd),roe=!0,AA=C$(e.rootDir),{pm:Xd,command:am,installCommand:`${Xd} ${am}`,runner:AA}}function woe(e){return(0,vr.readdirSync)(e,{withFileTypes:!0}).flatMap(i=>{let n=(0,ui.join)(e,i.name);return i.isDirectory()?woe(n):n.split(`node_modules${ui.sep}`)[1]||n})}async function RA(){let e=(0,TA.findRootSync)((0,Wr.cwd)()),t=(0,ui.join)((0,Wr.cwd)(),"package.json");(0,vr.existsSync)(t)||(S.error("Missing package.json, you need to be in a capacitor project"),B.error(""));let r;try{r=await li()}catch(o){S.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",o),B.error("")}let{dependencies:i}=r;i||(S.error("Missing dependencies section in package.json"),B.error(""));for(let[o,u]of Object.entries(i))typeof u!="string"&&(S.error(`Invalid dependency ${o}: ${u}, expected string, got ${typeof u}`),B.error(""));let n=(0,ui.join)((0,Wr.cwd)(),"node_modules");if(!(0,vr.existsSync)(n)){let o=_h(e.rootDir,"npm"),u=v4(o);S.error(`Missing node_modules folder, please run ${o} ${u}`),B.error("")}let s=!1,a=await Promise.all(Object.entries(i).map(async([o,u])=>{let l=(0,ui.join)(n,o);if(!(0,vr.existsSync)(l)){s=!0;let d=_h(e.rootDir,"npm"),f=v4(d);return S.error(`Missing dependency ${o}, please run ${d} ${f}`),{name:o,version:u}}let p=!1;try{p=woe(l).some(f=>Vqe.test(f))}catch(d){S.error(`Error reading node_modules files for ${o} package`),console.error(d),B.error("")}return{name:o,version:u,native:p}})).catch(()=>[]);return(s||a.find(o=>o.native===void 0))&&B.error(""),a}async function e$e(e,t,r){let{data:i,error:n}=await e.from("channels").select("version(checksum)").eq("name",r).eq("app_id",t).single(),s=i;return n||s===null||!s.version||!s.version.checksum?null:s.version.checksum}async function t$e(e,t,r){let{data:i,error:n}=await e.from("channels").select(`version (
332
332
  native_packages
333
333
  )`).eq("name",r).eq("app_id",t).single();n&&(S.error(`Error fetching native packages: ${n.message}`),B.error(""));let s;try{s=i.version.native_packages}catch{S.error("Error parsing native packages"),B.error("")}return s||(S.error("Error parsing native packages, perhaps the metadata does not exist?"),B.error("")),s.forEach(o=>{typeof o!="object"&&(S.error(`Invalid remote native package data: ${o}, expected object, got ${typeof o}`),B.error(""));let{name:u,version:l}=o;(!u||typeof u!="string")&&(S.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),B.error("")),(!l||typeof l!="string")&&(S.error(`Invalid remote native package version: ${l}, expected string, got ${typeof l}`),B.error(""))}),new Map(s.map(o=>[o.name,o]))}async function _oe(e,t,r,i){let n=Ue();n.start(`Checking bundle checksum compatibility with channel ${r}`);let s=await e$e(e,t,r);s&&s===i&&(S.error(`Cannot upload the same bundle content.
334
334
  Current bundle checksum matches remote bundle for channel ${r}
@@ -407,7 +407,7 @@ ${ay};
407
407
  ${K1e};
408
408
 
409
409
  ${ay};
410
- `)}async function lJe(e,t,r,i){let n=ci(),s=await Qe({message:`Automatic configure end-to-end encryption in ${i} updates?`});if(await ya(s,e,t),s){let a=Ue();a.start(`Running: ${n.runner} @capgo/cli@latest key create`),await TO({force:!0},!1)?a.stop("key created \u{1F511}"):(a.stop("Error"),S.warn("Cannot create key \u274C"),ee("Bye \u{1F44B}"),(0,sn.exit)(1)),Co("onboarding-v2",e,t,"Use encryption v2")}await fs(e,t,6)}async function cJe(e,t,r,i){let n=ci(),s=await Qe({message:`Automatic build ${i} with "${n.pm} run build" ?`});if(await ya(s,e,t),s){let a=Ue(),o=await NA(),u=await hoe(o);a.start(`Running: ${n.pm} run ${u} && ${n.runner} cap sync`),(await li()).scripts[u]||(a.stop("Error"),S.warn(`Cannot find ${u} script in package.json, please add it and run \`capgo init\` again`),ee("Bye \u{1F44B}"),(0,sn.exit)()),(0,r2.execSync)(`${n.pm} run ${u} && ${n.runner} cap sync`,Y1e),a.stop("Build & Sync Done \u2705")}else S.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await fs(e,t,7)}async function pJe(e,t,r,i){let n=ci(),s=await Qe({message:`Automatic upload ${i} bundle to Capgo?`});if(await ya(s,e,t),s){let a=Ue();a.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await sy(i,{channel:t2,apikey:r},!1)?a.stop("Upload Done \u2705"):(a.stop("Error"),S.warn("Upload failed \u274C"),ee("Bye \u{1F44B}"),(0,sn.exit)())}else S.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await fs(e,t,8)}async function dJe(e,t){let r=ci(),i=await Qe({message:"Run in device now ?"});if(await ya(i,e,t),i){let n=await Pc({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});gi(n)&&(ee("Bye \u{1F44B}"),(0,sn.exit)());let s=n,a=Ue();a.start(`Running: ${r.runner} cap run ${s}`),await(0,r2.spawnSync)(r.runner,["cap","run",s],{stdio:"inherit"}),a.stop("Started Done \u2705")}else S.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await fs(e,t,9)}async function fJe(e,t,r,i){let n=await Qe({message:"Automatic check if update working in device ?"});if(await ya(n,e,t),n)S.info(`Wait logs sent to Capgo from ${i} device, Please open your app \u{1F4AA}`),await FO("onboarding-v2",r,i,t,e);else{let s=ef(i);S.info(`Check logs in https://web.capgo.app/app/p/${s}/logs to see if update works.`)}await fs(e,t,10)}async function J1e(e,t,r){let i=ci();Z("Capgo onboarding \u{1F6EB}"),await Pe();let n=qt(),s=await se();t=t||s?.config?.appId,r.apikey=e||xe();let a=Ue();(!$1e()||e)&&(a.start(`Running: ${i.runner} @capgo/cli@latest login ***`),await aF(r.apikey,r,!1),a.stop("Login Done \u2705"));let o=await _e(r.apikey);await be(o,r.apikey,["upload","all","read","write"]);let u=await Qd(o,["admin","super_admin"]),l=u.gid,c=await tJe(l,n)??0;try{c<1&&await fs(l,n,1),c<2&&(await iJe(u,n,t,r),Gu(2)),c<3&&(await nJe(l,n,r.apikey,t),Gu(3)),c<4&&(await oJe(l,n,r.apikey,t),Gu(4)),c<5&&(await uJe(l,n,r.apikey,t),Gu(5)),c<6&&(await lJe(l,n,r.apikey,t),Gu(6)),c<7&&(await cJe(l,n,r.apikey,t),Gu(7)),c<8&&(await pJe(l,n,r.apikey,t),Gu(8)),c<9&&(await dJe(l,n),Gu(9)),await fJe(l,n,r.apikey,t),await fs(l,n,0),rJe()}catch(p){console.error(p),S.error("Error during onboarding, please try again later"),(0,sn.exit)(1)}S.info("Welcome onboard \u2708\uFE0F!"),S.info("Your Capgo update system is setup"),S.info(`Next time use \`${i.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),S.info(`If you have any issue try to use the debug command \`${i.runner} @capgo/cli@latest app debug\``),ee("Bye \u{1F44B}"),(0,sn.exit)()}var ihe=require("node:process");var ehe=require("node:process");var the=he(Km());var Z1e=require("node:process");async function Q1e(e,t,r){let{data:i,error:n}=await e.from("devices_override").select().eq("app_id",t).eq("version",r.id);if(n&&(S.error(`Cannot check Device override ${t}@${r.name}`),B.error("")),i&&i.length>0)if(Z(`\u274C Version ${t}@${r.name} is used in ${i.length} device override`),await Qe({message:"unlink it?"}))for(let s of i){let a=Ue();a.start(`Unlinking device ${s.device_id}`);let{error:o}=await e.from("devices_override").delete().eq("device_id",s.device_id);o&&(a.stop(`Cannot unlink device ${s.device_id} ${oe(o)}`),(0,Z1e.exit)(1)),a.stop(`\u2705 Device ${s.device_id} unlinked`)}else S.error("Unlink it first"),B.error("")}async function hJe(e,t,r){let{error:i}=await e.from("app_versions").update({deleted:!0}).eq("app_id",t).eq("deleted",!1).eq("name",r);i&&(S.error(`App Version ${t}@${r} not found in database`),B.error(""))}async function cy(e,t,r){let i=await mJe(e,t,r);await v1e(e,t,i),await Q1e(e,t,i),await hJe(e,t,r)}function py(e){e.length||(S.error("No bundle found"),(0,ehe.exit)(1));let t=new the.Table({title:"Bundles",charLength:{"\u274C":2,"\u2705":2}});e.reverse().forEach(r=>{t.addRow({Version:r.name,Created:tf(r.created_at),...r.keep!=null?{Keep:r.keep}:{}})}),S.success(t.render())}async function dy(e,t){let{data:r,error:i}=await e.from("app_versions").select().eq("app_id",t).eq("deleted",!1).order("created_at",{ascending:!1});return i&&(S.error(`App ${t} not found in database`),B.error("")),r}async function rhe(e,t){let{data:r,error:i}=await e.from("channels").select("version").eq("app_id",t);return i&&(S.error(`App ${t} not found in database`),B.error("")),r.map(n=>n.version)}async function mJe(e,t,r){let{data:i,error:n}=await e.from("app_versions").select().eq("app_id",t).eq("name",r).eq("deleted",!1).single();return(!i||n)&&(S.error(`App Version ${t}@${r} doesn't exist`),B.error("")),i}async function nhe(e,t){Z("List bundles"),await Pe(),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId,t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appid, or be in a capacitor project"),B.error(""));let i=await _e(t.apikey);await be(i,t.apikey,["write","all","read","upload"]),S.info(`Querying available versions of: ${e} in Capgo`),await Xe(i,t.apikey,e,1);let n=await dy(i,e);S.info(`Active versions in Capgo: ${n?.length}`),py(n),ee("Done \u2705"),(0,ihe.exit)()}var va=require("node:fs"),she=require("node:process");async function ahe(e,t,r){Z("Decrypt zip file"),await Pe(),(0,va.existsSync)(e)||(S.error(`Zip not found at the path ${e}`),B.error(""));let i=await se();!r.key&&!(0,va.existsSync)(Ri)&&!i.config.plugins?.CapacitorUpdater?.privateKey&&(S.error(`Private Key not found at the path ${Ri} or in ${i.path}`),B.error(""));let n=r.key||Ri,s=i.config.plugins?.CapacitorUpdater?.privateKey;!(0,va.existsSync)(n)&&!s?(S.error(`Cannot find public key ${n} or as keyData option or in ${i.path}`),B.error("")):(0,va.existsSync)(n)&&(s=(0,va.readFileSync)(n).toString());let a=(0,va.readFileSync)(e),o=Wfe(a,t,r.keyData??s??"");(0,va.writeFileSync)(`${e}_decrypted.zip`,o),ee(`Decrypted zip file at ${e}_decrypted.zip`),(0,she.exit)()}var Wu=require("node:fs"),ohe=require("node:process");async function uhe(e,t){Z("Encryption"),await Pe(),(0,Wu.existsSync)(e)||(S.error(`Error: Zip not found at the path ${e}`),B.error(""));let r=t.key||en,i=t.keyData||"";(0,Wu.existsSync)(r)&&(i=(0,Wu.readFileSync)(r).toString());let n=(0,Wu.readFileSync)(e),s=V9(n,i);S.success(`ivSessionKey: ${s.ivSessionKey}`),(0,Wu.writeFileSync)(`${e}_encrypted.zip`,s.encryptedData),S.success(`Encrypted zip saved at ${e}_encrypted.zip`),ee("Done \u2705"),(0,ohe.exit)()}var Fo=require("node:fs"),lhe=require("node:process");async function che(e,t,r){Z("Encryption"),await Pe();let i=await se(),n=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;n&&S.warning("There is still a privateKey in the config"),(0,Fo.existsSync)(e)||(S.error(`Error: Zip not found at the path ${e}`),B.error("")),s||S.warning("Warning: Missing Public Key in config");let a=r.key||Qi,o=r.keyData||"";!(0,Fo.existsSync)(a)&&!o?(S.warning(`Cannot find a private key at ${a} or as a keyData option`),S.error("Error: Missing key"),B.error("")):(0,Fo.existsSync)(a)&&(o=(0,Fo.readFileSync)(a).toString()),o&&!o.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(S.error("the private key provided is not a valid RSA Private key"),B.error(""));let u=(0,Fo.readFileSync)(e),l=ny(u,o),c=iy(t,o);S.success(`Encoded Checksum: ${c}`),S.success(`ivSessionKey: ${l.ivSessionKey}`),(0,Fo.writeFileSync)(`${e}_encrypted.zip`,l.encryptedData),S.success(`Encrypted zip saved at ${e}_encrypted.zip`),ee("Done \u2705"),(0,lhe.exit)()}var Rf=require("node:process"),fy=require("node:os"),phe=he(wO());async function gJe(e){let t={},r=[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.push((0,phe.default)(i));return await Promise.all(r).then(i=>{let n=Object.keys(e);for(let s=0;s<i.length;s+=1){let a=i[s];a&&(t[n[s]]=a)}}),t}async function yJe(){let{dependencies:e}=await li(),t={"@capgo/cli":ko.version};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let i=e[r].replace("^","").replace("~","");t[r]=i}return t}async function dhe(){S.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await se(),t=await li(),r=e?.config?.plugins?.CapacitorUpdater?.version||t?.version,i=e?.config?.appName||"";S.info(` App Name: ${i}`);let n=e?.config?.appId||"";S.info(` App ID: ${n}`),S.info(` App Version: ${r}`);let s=e?.config?.webDir||"";S.info(` Web Dir: ${s}`),S.info(` OS: ${(0,fy.platform)()} ${(0,fy.version)()}`),S.info(` Node: ${Rf.version}`),S.info(" Installed Dependencies:");let a=await yJe();Object.keys(a).length===0&&(S.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Rf.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let c=a[l];S.info(` ${l}: ${c}`)}let o=Ue();o.start("Running: Loading latest dependencies");let u=await gJe(a);o.stop("Latest Dependencies:");for(let l in u)if(Object.prototype.hasOwnProperty.call(u,l)){let c=u[l];S.info(` ${l}: ${c}`)}JSON.stringify(a)!==JSON.stringify(u)&&(S.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Rf.exit)(1)),S.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Rf.exit)()}var wa=require("node:fs");async function vJe(e,t=!0){t&&Z("Save keys \u{1F511}");let r=await se(),i=e.key||Ri,n=e.keyData||"";if(!(0,wa.existsSync)(i)&&!n)if(t)S.error(`Cannot find public key ${i} or as keyData option or in ${r.path}`),B.error("");else return!1;else(0,wa.existsSync)(i)&&(n=(0,wa.readFileSync)(i).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=n,await aa(r)),S&&(S.success(`private key saved into ${r.path} file in local directory`),S.success("your app will decode the zip archive with this key")),!0}async function fhe(e){Z("Save keys \u{1F511}"),await Pe(),await vJe(e)}async function wJe(e,t=!0){t&&Z("Create keys \u{1F511}");let{publicKey:r,privateKey:i}=H9();if((0,wa.existsSync)(en)&&!e.force)if(S.error("Public Key already exists, use --force to overwrite"),t)B.error("");else return!1;if((0,wa.writeFileSync)(en,r),(0,wa.existsSync)(Ri)&&!e.force)if(S.error("Private Key already exists, use --force to overwrite"),t)B.error("");else return!1;(0,wa.writeFileSync)(Ri,i);let n=i.replace(/\\n/g,"\\n"),s=await V8({privateKey:n});return t&&(S.success("Your RSA key has been generated"),S.success(`Public key saved in ${en}`),S.success("This key will be use to encrypt your bundle before sending it to Capgo"),S.success("Keep it safe"),S.success("Than make it unreadable by Capgo and unmodifiable by anyone"),S.success(`Private key saved in ${s.path}`),S.success("Your app will be the only one having it"),S.success("Only your users can decrypt your update"),S.success("Only you can send them an update"),ee("Done \u2705")),!0}async function hhe(e){await Pe(),await wJe(e)}var mhe=require("node:process");async function ghe(e,t,r){Z("Delete bundle"),r.apikey=r.apikey||xe();let i=await se();t=t||i?.config?.appId,r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(r.apikey);await be(n,r.apikey,["write","all"]),await Xe(n,r.apikey,t,3),r.apikey||(S.error("Missing API key, you need to provide an API key to delete your app"),B.error("")),e||(S.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error("")),S.info(`Deleting bundle ${t}@${e} from Capgo`),S.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await cy(n,t,e),S.success(`Bundle ${t}@${e} deleted in Capgo`),ee("Done"),(0,mhe.exit)()}var vhe=require("node:process");var yhe=["major","minor","metadata","patch","none"];async function whe(e,t,r){Z("Set channel"),r.apikey=r.apikey||xe();let i=await se();t=t||i?.config?.appId;let n=qt();r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let s=await _e(r.apikey),a=await be(s,r.apikey,["write","all"]);await Xe(s,r.apikey,t,4);let o=await Pn(s,t),{bundle:u,state:l,downgrade:c,latest:p,upgrade:d,ios:f,android:h,selfAssign:m,disableAutoUpdate:v,dev:y,emulator:E}=r;e||(S.error("Missing argument, you need to provide a channel"),B.error("")),p&&u&&(S.error("Cannot set latest and bundle at the same time"),B.error("")),u==null&&l==null&&p==null&&c==null&&d==null&&f==null&&h==null&&m==null&&y==null&&E==null&&v==null&&(S.error("Missing argument, you need to provide a option to set"),B.error(""));try{await Zd(s,o,r.apikey,t);let b={created_by:a,app_id:t,name:e,owner_org:o,version:void 0},w=await li(),_=p?i?.config?.plugins?.CapacitorUpdater?.version||w?.version:u;if(_!=null){let{data:T,error:A}=await s.from("app_versions").select().eq("app_id",t).eq("name",_).eq("user_id",a).eq("deleted",!1).single();(A||!T)&&(S.error(`Cannot find version ${_}`),B.error("")),S.info(`Set ${t} channel: ${e} to @${_}`),b.version=T.id}if(l!=null&&((l==="public"||l==="private")&&S.info(`Set ${t} channel: ${e} to public or private is deprecated, use default or normal instead`),S.info(`Set ${t} channel: ${e} to ${l==="public"||l==="default"?"default":"normal"}`),b.public=l==="public"||l==="default"),c!=null&&(S.info(`Set ${t} channel: ${e} to ${c?"allow":"disallow"} downgrade`),b.disable_auto_update_under_native=!c),f!=null&&(S.info(`Set ${t} channel: ${e} to ${f?"allow":"disallow"} ios update`),b.ios=!!f),h!=null&&(S.info(`Set ${t} channel: ${e} to ${h?"allow":"disallow"} android update`),b.android=!!h),m!=null&&(S.info(`Set ${t} channel: ${e} to ${m?"allow":"disallow"} self assign to this channel`),b.allow_device_self_set=!!m),v!=null){let T=v.toLocaleLowerCase();yhe.includes(T)||(S.error(`Channel strategy ${T} is not known. The possible values are: ${yhe.join(", ")}.`),B.error("")),T==="metadata"&&(T="version_number"),b.disable_auto_update=T,S.info(`Set ${t} channel: ${e} to ${T} disable update strategy to this channel`)}try{let{error:T}=await z8(s,b);T&&(S.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),B.error(""))}catch{S.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),B.error("")}await n.track({channel:"channel",event:"Set channel",icon:"\u2705",user_id:o,tags:{"app-id":t},notify:!1}).catch()}catch(b){S.error(`Unknow error ${oe(b)}`),B.error("")}ee("Done \u2705"),(0,vhe.exit)()}var _he=require("node:process");async function bhe(e,t,r){let{quiet:i}=r;i||Z("List current bundle"),r.apikey=r.apikey||xe(i);let n=await se();t=t||n?.config?.appId,r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let s=await _e(r.apikey),a=await be(s,r.apikey,["write","all","read"]);await Xe(s,r.apikey,t,1),e||(S.error("Please provide a channel to get the bundle from."),B.error(""));let{data:o,error:u}=await s.from("channels").select("version ( name )").eq("name",e).eq("app_id",t).limit(1);(u||o.length===0)&&(S.error(`Error retrieving channel ${e} for app ${t}. Perhaps the channel does not exists?`),B.error(""));let{version:l}=o[0];l||(S.error(`Error retrieving channel ${e} for app ${t}. Perhaps the channel does not exists?`),B.error("")),i?S.info(l.name):S.info(`Current bundle for channel ${e} is ${l.name}`),(0,_he.exit)()}var cF=require("node:process");var Dhe=he(Km());function _Je(e){e.length||(S.error("No apps found"),(0,cF.exit)(1));let t=new Dhe.Table({title:"Apps",charLength:{"\u274C":2,"\u2705":2}});e.reverse().forEach(r=>{t.addRow({Name:r.name,id:r.app_id,Created:tf(r.created_at)})}),S.success(t.render())}async function bJe(e){let{data:t,error:r}=await e.from("apps").select().order("created_at",{ascending:!1});return r&&(S.error("Apps not found"),B.error("")),t}async function Ehe(e){Z("List apps in Capgo"),await Pe(),e.apikey=e.apikey||xe();let t=await _e(e.apikey);await be(t,e.apikey,["write","all","read","upload"]),S.info("Getting active bundle in Capgo");let r=await bJe(t);S.info(`Active app in Capgo: ${r?.length}`),_Je(r),ee("Done \u2705"),(0,cF.exit)()}var pF=require("node:process");var hy=he(Che());async function DJe(e,t,r){for await(let i of e)S.warn(`Removing ${i.name} created on ${tf(i.created_at)}`),await cy(t,r,i.name)}function EJe(e,t,r){let i=[];return e?.forEach(n=>{hy.default.gte(n.name,t)&&hy.default.lt(n.name,`${r}`)&&i.push(n)}),i}async function She(e,t){Z("Cleanup versions in Capgo"),await Pe(),t.apikey=t.apikey||xe();let{bundle:r,keep:i=4}=t,n=t.force||!1,s=await se();e=e||s?.config?.appId,t.apikey||(S.error("Missing API key, you need to provide an API key to delete your app"),B.error("")),e||(S.error("Missing argument, you need to provide a appid, or be in a capacitor project"),B.error(""));let a=await _e(t.apikey);await be(a,t.apikey,["write","all"]),await Xe(a,t.apikey,e,3),S.info("Querying all available versions in Capgo");let o=await dy(a,e),u=await rhe(a,e);if(S.info(`Total active versions in Capgo: ${o?.length}`),o?.length===0){S.error("No versions found, aborting cleanup");return}if(r){let p=`${hy.default.inc(r,"major")}`;S.info(`Querying available versions in Capgo between ${r} and ${p}`),o=EJe(o,r,p),S.info(`Active versions in Capgo between ${r} and ${p}: ${o?.length}`)}let l=[],c=0;if(o.forEach(p=>{let d=u.find(f=>f===p.id);c<i||d?(d?p.keep="\u2705 (Linked to channel)":p.keep="\u2705",c+=1):(p.keep="\u274C",l.push(p))}),l.length===0){S.warn("Nothing to be removed, aborting removal...");return}if(py(o),!n){let p=await Qe({message:"Do you want to continue removing the versions specified?"});(gi(p)||!p)&&(S.warn("Not confirmed, aborting removal..."),(0,pF.exit)())}S.success("You have confirmed removal, removing versions now"),await DJe(l,a,e),ee("Done \u2705"),(0,pF.exit)()}var Ahe=require("node:process");async function The(e,t,r){Z("Delete channel"),r.apikey=r.apikey||xe();let i=await se();t=t||i?.config?.appId;let n=qt();r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let s=await _e(r.apikey),a=await be(s,r.apikey,["write","all"]);await Xe(s,r.apikey,t,4),S.info(`Deleting channel ${t}#${e} from Capgo`);try{let o=await _1e(s,e,t,a);o.error&&(S.error(`Cannot delete Channel \u{1F640} ${oe(o.error)}`),B.error(""));let u=await Pn(s,t);S.success("Channel deleted"),await n.track({channel:"channel",event:"Delete channel",icon:"\u2705",user_id:u,tags:{"user-id":a,"app-id":t,channel:e},notify:!1}).catch()}catch{S.error("Cannot delete Channel \u{1F640}")}ee("Done \u2705"),(0,Ahe.exit)()}var Ohe=require("node:process");async function Fhe(e,t){Z("List channels"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId;let i=qt();t.apikey||S.error("Missing API key, you need to provide a API key to upload your bundle"),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(t.apikey),s=await be(n,t.apikey,["write","all","read","upload"]);await Xe(n,t.apikey,e,1),S.info("Querying available channels in Capgo");let a=await D1e(n,e);S.info(`Active channels in Capgo: ${a?.length}`),b1e(a),await i.track({channel:"channel",event:"List channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch(),ee("Done \u2705"),(0,Ohe.exit)()}var Nhe=require("node:crypto"),Pf=require("node:fs"),khe=require("node:process");async function Rhe(e,t){Z("Set app"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId,t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let i=await _e(t.apikey),s=(await Qd(i,["admin","super_admin"])).gid,a=await be(i,t.apikey,["write","all"]);await Xe(i,t.apikey,e,4);let{name:o,icon:u,retention:l}=t;l&&Number.isNaN(Number(l))?(S.error("retention value must be a number"),B.error("")):l&&l<0&&(S.error("retention value cannot be less than 0"),B.error(""));let c,p,d=`icon_${(0,Nhe.randomUUID)()}`,f="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Pf.existsSync)(u)?(c=(0,Pf.readFileSync)(u),p=Ff.getType(u)||"image/png",S.warn(`Found app icon ${u}`)):(0,Pf.existsSync)(qn)?(c=(0,Pf.readFileSync)(qn),p=Ff.getType(qn)||"image/png",S.warn(`Found app icon ${qn}`)):S.warn(`Cannot find app icon in any of the following locations: ${u}, ${qn}`),c&&p){let{error:m}=await i.storage.from(`images/org/${s}/${e}`).upload(d,c,{contentType:p});m&&(S.error(`Could not set app ${oe(m)}`),B.error(""));let{data:v}=await i.storage.from(`images/org/${s}/${e}`).getPublicUrl(d);f=v?.publicUrl||f}let{error:h}=await i.from("apps").update({icon_url:f,name:o,retention:l?l*24*60*60:void 0}).eq("app_id",e).eq("user_id",a);h&&(S.error(`Could not set app ${oe(h)}`),B.error("")),ee("Done \u2705"),(0,khe.exit)()}var Phe=require("node:process");async function Ihe(e,t){Z("Deleting"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId;let i=qt();t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(t.apikey),s=await be(n,t.apikey,["write","all"]);await Xe(n,t.apikey,e,5);let{data:a,error:o}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",e).single(),u=a;if(!o&&(u?.owner_org.created_by??"")!==s){S.warn("Deleting the app is not recomended for users that are not the organization owner"),S.warn("You are invited as a super_admin but your are not the owner"),S.warn("It's strongly recomended that you do not continue!");let f=await Pc({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(gi(f)||f==="no")&&(S.error("Canceled deleting the app, exiting"),B.error(""))}else o&&S.warn(`Cannot get the app owner ${oe(o)}`);let{error:l}=await n.storage.from("images").remove([`org/${u?.owner_org.id}/${e}/icon`]);l&&(console.error(l,`images/org/${u?.owner_org.id}/${e}`),S.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${e}/${s}`).remove(["versions"]);c&&S.error("Could not delete app version");let{error:p}=await n.from("apps").delete().eq("app_id",e);p&&(S.error("Could not delete app"),B.error(""));let d=await Pn(n,e);await i.track({channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:d,tags:{"app-id":e},notify:!1}).catch(),S.success("App deleted in Capgo"),ee("Done \u2705"),(0,Phe.exit)()}var Lhe=he(Km());async function Bhe(e,t){Z("Check compatibility"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId;let{channel:i}=t;i||(S.error("Missing argument, you need to provide a channel"),B.error("")),t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(t.apikey);await be(n,t.apikey,["write","all","read","upload"]),await Xe(n,t.apikey,e,1);let{finalCompatibility:s}=await G8(n,e,i),a=new Lhe.Table({title:"Compatibility",charLength:{"\u274C":2,"\u2705":2}}),o=t.text?"Yes":"\u2705",u=t.text?"No":"\u274C";s.forEach(l=>{let{name:c,localVersion:p,remoteVersion:d}=l;a.addRow({Package:c,"Local version":p??"None","Remote version":d??"None",Compatible:d===p?o:u})}),S.success(a.render())}B.name(ko.name).description("Manage packages and bundle versions in Capgo Cloud").version(ko.version);B.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(M1e).option("--local","Only save in local folder");B.command("doctor").description("Get info about your Capgo app install").action(dhe);B.command("init [apikey] [appId]").description("Init a new app").action(J1e).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path");var If=B.command("app").description("Manage app");If.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(W1e).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");If.command("delete [appId]").description("Delete an app in Capgo Cloud").action(Ihe).option("-a, --apikey <apikey>","apikey to link to your account");If.command("list").alias("l").description("list apps in Capgo Cloud").action(Ehe).option("-a, --apikey <apikey>","apikey to link to your account");If.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(Zfe);If.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(boe);If.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(Rhe).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 No=B.command("bundle").description("Manage bundle");No.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(j1e).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","base64 public signing key").option("--key-v2 <key>","custom path for private signing key").option("--key-data-v2 <keyData>","base64 private signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3").option("--ignore-partial","Does not upload partial files to S3").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.");No.command("compatibility [appId]").action(Bhe).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");No.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(ghe).option("-a, --apikey <apikey>","apikey to link to your account");No.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(nhe).option("-a, --apikey <apikey>","apikey to link to your account");No.command("cleanup [appId]").alias("c").action(She).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");No.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(ahe).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","base64 private signing key");No.command("encrypt [zipPath]").description("Encrypt a zip bundle").action(uhe).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","base64 private signing key");No.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(che).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","base64 private signing key");No.command("zip [appId]").description("Zip a bundle").action(Afe).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2");var i2=B.command("channel").description("Manage channel");i2.command("add [channelId] [appId]").alias("a").description("Create channel").action(x1e).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");i2.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(The).option("-a, --apikey <apikey>","apikey to link to your account");i2.command("list [appId]").alias("l").description("List channel").action(Fhe).option("-a, --apikey <apikey>","apikey to link to your account");i2.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(bhe).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");i2.command("set [channelId] [appId]").alias("s").description("Set channel").action(whe).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices");var jhe=B.command("key_old").description("Manage old encryption key");jhe.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(fhe).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");jhe.command("create").description("Create a new encryption key").action(hhe).option("-f, --force","force generate a new one");var dF=B.command("key").description("Manage encryption key");dF.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(Kfe).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");dF.command("create").description("Create a new encryption key").action(Yfe).option("-f, --force","force generate a new one");dF.command("delete_old").description("Delete the old encryption key").action(Xfe);B.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(q1e).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>","base64 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 xJe=B.command("account").description("Manage account");xJe.command("id").description("Get your account ID").action(Doe).option("-a, --apikey <apikey>","apikey to link to your account");B.parseAsync();
410
+ `)}async function lJe(e,t,r,i){let n=ci(),s=await Qe({message:`Automatic configure end-to-end encryption in ${i} updates?`});if(await ya(s,e,t),s){let a=Ue();a.start(`Running: ${n.runner} @capgo/cli@latest key create`),await TO({force:!0},!1)?a.stop("key created \u{1F511}"):(a.stop("Error"),S.warn("Cannot create key \u274C"),ee("Bye \u{1F44B}"),(0,sn.exit)(1)),Co("onboarding-v2",e,t,"Use encryption v2")}await fs(e,t,6)}async function cJe(e,t,r,i){let n=ci(),s=await Qe({message:`Automatic build ${i} with "${n.pm} run build" ?`});if(await ya(s,e,t),s){let a=Ue(),o=await NA(),u=await hoe(o);a.start(`Running: ${n.pm} run ${u} && ${n.runner} cap sync`),(await li()).scripts[u]||(a.stop("Error"),S.warn(`Cannot find ${u} script in package.json, please add it and run \`capgo init\` again`),ee("Bye \u{1F44B}"),(0,sn.exit)()),(0,r2.execSync)(`${n.pm} run ${u} && ${n.runner} cap sync`,Y1e),a.stop("Build & Sync Done \u2705")}else S.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await fs(e,t,7)}async function pJe(e,t,r,i){let n=ci(),s=await Qe({message:`Automatic upload ${i} bundle to Capgo?`});if(await ya(s,e,t),s){let a=Ue();a.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await sy(i,{channel:t2,apikey:r},!1)?a.stop("Upload Done \u2705"):(a.stop("Error"),S.warn("Upload failed \u274C"),ee("Bye \u{1F44B}"),(0,sn.exit)())}else S.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await fs(e,t,8)}async function dJe(e,t){let r=ci(),i=await Qe({message:"Run in device now ?"});if(await ya(i,e,t),i){let n=await Pc({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});gi(n)&&(ee("Bye \u{1F44B}"),(0,sn.exit)());let s=n,a=Ue();a.start(`Running: ${r.runner} cap run ${s}`),await(0,r2.spawnSync)(r.runner,["cap","run",s],{stdio:"inherit"}),a.stop("Started Done \u2705")}else S.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await fs(e,t,9)}async function fJe(e,t,r,i){let n=await Qe({message:"Automatic check if update working in device ?"});if(await ya(n,e,t),n)S.info(`Wait logs sent to Capgo from ${i} device, Please open your app \u{1F4AA}`),await FO("onboarding-v2",r,i,t,e);else{let s=ef(i);S.info(`Check logs in https://web.capgo.app/app/p/${s}/logs to see if update works.`)}await fs(e,t,10)}async function J1e(e,t,r){let i=ci();Z("Capgo onboarding \u{1F6EB}"),await Pe();let n=qt(),s=await se();t=t||s?.config?.appId,r.apikey=e||xe();let a=Ue();(!$1e()||e)&&(a.start(`Running: ${i.runner} @capgo/cli@latest login ***`),await aF(r.apikey,r,!1),a.stop("Login Done \u2705"));let o=await _e(r.apikey);await be(o,r.apikey,["upload","all","read","write"]);let u=await Qd(o,["admin","super_admin"]),l=u.gid,c=await tJe(l,n)??0;try{c<1&&await fs(l,n,1),c<2&&(await iJe(u,n,t,r),Gu(2)),c<3&&(await nJe(l,n,r.apikey,t),Gu(3)),c<4&&(await oJe(l,n,r.apikey,t),Gu(4)),c<5&&(await uJe(l,n,r.apikey,t),Gu(5)),c<6&&(await lJe(l,n,r.apikey,t),Gu(6)),c<7&&(await cJe(l,n,r.apikey,t),Gu(7)),c<8&&(await pJe(l,n,r.apikey,t),Gu(8)),c<9&&(await dJe(l,n),Gu(9)),await fJe(l,n,r.apikey,t),await fs(l,n,0),rJe()}catch(p){console.error(p),S.error("Error during onboarding, please try again later"),(0,sn.exit)(1)}S.info("Welcome onboard \u2708\uFE0F!"),S.info("Your Capgo update system is setup"),S.info(`Next time use \`${i.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),S.info(`If you have any issue try to use the debug command \`${i.runner} @capgo/cli@latest app debug\``),ee("Bye \u{1F44B}"),(0,sn.exit)()}var ihe=require("node:process");var ehe=require("node:process");var the=he(Km());var Z1e=require("node:process");async function Q1e(e,t,r){let{data:i,error:n}=await e.from("devices_override").select().eq("app_id",t).eq("version",r.id);if(n&&(S.error(`Cannot check Device override ${t}@${r.name}`),B.error("")),i&&i.length>0)if(Z(`\u274C Version ${t}@${r.name} is used in ${i.length} device override`),await Qe({message:"unlink it?"}))for(let s of i){let a=Ue();a.start(`Unlinking device ${s.device_id}`);let{error:o}=await e.from("devices_override").delete().eq("device_id",s.device_id);o&&(a.stop(`Cannot unlink device ${s.device_id} ${oe(o)}`),(0,Z1e.exit)(1)),a.stop(`\u2705 Device ${s.device_id} unlinked`)}else S.error("Unlink it first"),B.error("")}async function hJe(e,t,r){let{error:i}=await e.from("app_versions").update({deleted:!0}).eq("app_id",t).eq("deleted",!1).eq("name",r);i&&(S.error(`App Version ${t}@${r} not found in database`),B.error(""))}async function cy(e,t,r){let i=await mJe(e,t,r);await v1e(e,t,i),await Q1e(e,t,i),await hJe(e,t,r)}function py(e){e.length||(S.error("No bundle found"),(0,ehe.exit)(1));let t=new the.Table({title:"Bundles",charLength:{"\u274C":2,"\u2705":2}});e.reverse().forEach(r=>{t.addRow({Version:r.name,Created:tf(r.created_at),...r.keep!=null?{Keep:r.keep}:{}})}),S.success(t.render())}async function dy(e,t){let{data:r,error:i}=await e.from("app_versions").select().eq("app_id",t).eq("deleted",!1).order("created_at",{ascending:!1});return i&&(S.error(`App ${t} not found in database`),B.error("")),r}async function rhe(e,t){let{data:r,error:i}=await e.from("channels").select("version").eq("app_id",t);return i&&(S.error(`App ${t} not found in database`),B.error("")),r.map(n=>n.version)}async function mJe(e,t,r){let{data:i,error:n}=await e.from("app_versions").select().eq("app_id",t).eq("name",r).eq("deleted",!1).single();return(!i||n)&&(S.error(`App Version ${t}@${r} doesn't exist`),B.error("")),i}async function nhe(e,t){Z("List bundles"),await Pe(),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId,t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appid, or be in a capacitor project"),B.error(""));let i=await _e(t.apikey);await be(i,t.apikey,["write","all","read","upload"]),S.info(`Querying available versions of: ${e} in Capgo`),await Xe(i,t.apikey,e,1);let n=await dy(i,e);S.info(`Active versions in Capgo: ${n?.length}`),py(n),ee("Done \u2705"),(0,ihe.exit)()}var va=require("node:fs"),she=require("node:process");async function ahe(e,t,r){Z("Decrypt zip file"),await Pe(),(0,va.existsSync)(e)||(S.error(`Zip not found at the path ${e}`),B.error(""));let i=await se();!r.key&&!(0,va.existsSync)(Ri)&&!i.config.plugins?.CapacitorUpdater?.privateKey&&(S.error(`Private Key not found at the path ${Ri} or in ${i.path}`),B.error(""));let n=r.key||Ri,s=i.config.plugins?.CapacitorUpdater?.privateKey;!(0,va.existsSync)(n)&&!s?(S.error(`Cannot find public key ${n} or as keyData option or in ${i.path}`),B.error("")):(0,va.existsSync)(n)&&(s=(0,va.readFileSync)(n).toString());let a=(0,va.readFileSync)(e),o=Wfe(a,t,r.keyData??s??"");(0,va.writeFileSync)(`${e}_decrypted.zip`,o),ee(`Decrypted zip file at ${e}_decrypted.zip`),(0,she.exit)()}var Wu=require("node:fs"),ohe=require("node:process");async function uhe(e,t){Z("Encryption"),await Pe(),(0,Wu.existsSync)(e)||(S.error(`Error: Zip not found at the path ${e}`),B.error(""));let r=t.key||en,i=t.keyData||"";(0,Wu.existsSync)(r)&&(i=(0,Wu.readFileSync)(r).toString());let n=(0,Wu.readFileSync)(e),s=V9(n,i);S.success(`ivSessionKey: ${s.ivSessionKey}`),(0,Wu.writeFileSync)(`${e}_encrypted.zip`,s.encryptedData),S.success(`Encrypted zip saved at ${e}_encrypted.zip`),ee("Done \u2705"),(0,ohe.exit)()}var Fo=require("node:fs"),lhe=require("node:process");async function che(e,t,r){Z("Encryption"),await Pe();let i=await se(),n=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;n&&S.warning("There is still a privateKey in the config"),(0,Fo.existsSync)(e)||(S.error(`Error: Zip not found at the path ${e}`),B.error("")),s||S.warning("Warning: Missing Public Key in config");let a=r.key||Qi,o=r.keyData||"";!(0,Fo.existsSync)(a)&&!o?(S.warning(`Cannot find a private key at ${a} or as a keyData option`),S.error("Error: Missing key"),B.error("")):(0,Fo.existsSync)(a)&&(o=(0,Fo.readFileSync)(a).toString()),o&&!o.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(S.error("the private key provided is not a valid RSA Private key"),B.error(""));let u=(0,Fo.readFileSync)(e),l=ny(u,o),c=iy(t,o);S.success(`Encoded Checksum: ${c}`),S.success(`ivSessionKey: ${l.ivSessionKey}`),(0,Fo.writeFileSync)(`${e}_encrypted.zip`,l.encryptedData),S.success(`Encrypted zip saved at ${e}_encrypted.zip`),ee("Done \u2705"),(0,lhe.exit)()}var Rf=require("node:process"),fy=require("node:os"),phe=he(wO());async function gJe(e){let t={},r=[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.push((0,phe.default)(i));return await Promise.all(r).then(i=>{let n=Object.keys(e);for(let s=0;s<i.length;s+=1){let a=i[s];a&&(t[n[s]]=a)}}),t}async function yJe(){let{dependencies:e}=await li(),t={"@capgo/cli":ko.version};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let i=e[r].replace("^","").replace("~","");t[r]=i}return t}async function dhe(){S.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await se(),t=await li(),r=e?.config?.plugins?.CapacitorUpdater?.version||t?.version,i=e?.config?.appName||"";S.info(` App Name: ${i}`);let n=e?.config?.appId||"";S.info(` App ID: ${n}`),S.info(` App Version: ${r}`);let s=e?.config?.webDir||"";S.info(` Web Dir: ${s}`),S.info(` OS: ${(0,fy.platform)()} ${(0,fy.version)()}`),S.info(` Node: ${Rf.version}`),S.info(" Installed Dependencies:");let a=await yJe();Object.keys(a).length===0&&(S.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Rf.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let c=a[l];S.info(` ${l}: ${c}`)}let o=Ue();o.start("Running: Loading latest dependencies");let u=await gJe(a);o.stop("Latest Dependencies:");for(let l in u)if(Object.prototype.hasOwnProperty.call(u,l)){let c=u[l];S.info(` ${l}: ${c}`)}JSON.stringify(a)!==JSON.stringify(u)&&(S.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Rf.exit)(1)),S.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Rf.exit)()}var wa=require("node:fs");async function vJe(e,t=!0){t&&Z("Save keys \u{1F511}");let r=await se(),i=e.key||Ri,n=e.keyData||"";if(!(0,wa.existsSync)(i)&&!n)if(t)S.error(`Cannot find public key ${i} or as keyData option or in ${r.path}`),B.error("");else return!1;else(0,wa.existsSync)(i)&&(n=(0,wa.readFileSync)(i).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=n,await aa(r)),S&&(S.success(`private key saved into ${r.path} file in local directory`),S.success("your app will decode the zip archive with this key")),!0}async function fhe(e){Z("Save keys \u{1F511}"),await Pe(),await vJe(e)}async function wJe(e,t=!0){t&&Z("Create keys \u{1F511}");let{publicKey:r,privateKey:i}=H9();if((0,wa.existsSync)(en)&&!e.force)if(S.error("Public Key already exists, use --force to overwrite"),t)B.error("");else return!1;if((0,wa.writeFileSync)(en,r),(0,wa.existsSync)(Ri)&&!e.force)if(S.error("Private Key already exists, use --force to overwrite"),t)B.error("");else return!1;(0,wa.writeFileSync)(Ri,i);let n=i.replace(/\\n/g,"\\n"),s=await V8({privateKey:n});return t&&(S.success("Your RSA key has been generated"),S.success(`Public key saved in ${en}`),S.success("This key will be use to encrypt your bundle before sending it to Capgo"),S.success("Keep it safe"),S.success("Than make it unreadable by Capgo and unmodifiable by anyone"),S.success(`Private key saved in ${s.path}`),S.success("Your app will be the only one having it"),S.success("Only your users can decrypt your update"),S.success("Only you can send them an update"),ee("Done \u2705")),!0}async function hhe(e){await Pe(),await wJe(e)}var mhe=require("node:process");async function ghe(e,t,r){Z("Delete bundle"),r.apikey=r.apikey||xe();let i=await se();t=t||i?.config?.appId,r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(r.apikey);await be(n,r.apikey,["write","all"]),await Xe(n,r.apikey,t,3),r.apikey||(S.error("Missing API key, you need to provide an API key to delete your app"),B.error("")),e||(S.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error("")),S.info(`Deleting bundle ${t}@${e} from Capgo`),S.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await cy(n,t,e),S.success(`Bundle ${t}@${e} deleted in Capgo`),ee("Done"),(0,mhe.exit)()}var vhe=require("node:process");var yhe=["major","minor","metadata","patch","none"];async function whe(e,t,r){Z("Set channel"),r.apikey=r.apikey||xe();let i=await se();t=t||i?.config?.appId;let n=qt();r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let s=await _e(r.apikey),a=await be(s,r.apikey,["write","all"]);await Xe(s,r.apikey,t,4);let o=await Pn(s,t),{bundle:u,state:l,downgrade:c,latest:p,upgrade:d,ios:f,android:h,selfAssign:m,disableAutoUpdate:v,dev:y,emulator:E}=r;e||(S.error("Missing argument, you need to provide a channel"),B.error("")),p&&u&&(S.error("Cannot set latest and bundle at the same time"),B.error("")),u==null&&l==null&&p==null&&c==null&&d==null&&f==null&&h==null&&m==null&&y==null&&E==null&&v==null&&(S.error("Missing argument, you need to provide a option to set"),B.error(""));try{await Zd(s,o,r.apikey,t);let b={created_by:a,app_id:t,name:e,owner_org:o,version:void 0},w=await li(),_=p?i?.config?.plugins?.CapacitorUpdater?.version||w?.version:u;if(_!=null){let{data:T,error:A}=await s.from("app_versions").select().eq("app_id",t).eq("name",_).eq("user_id",a).eq("deleted",!1).single();(A||!T)&&(S.error(`Cannot find version ${_}`),B.error("")),S.info(`Set ${t} channel: ${e} to @${_}`),b.version=T.id}if(l!=null&&((l==="public"||l==="private")&&S.info(`Set ${t} channel: ${e} to public or private is deprecated, use default or normal instead`),S.info(`Set ${t} channel: ${e} to ${l==="public"||l==="default"?"default":"normal"}`),b.public=l==="public"||l==="default"),c!=null&&(S.info(`Set ${t} channel: ${e} to ${c?"allow":"disallow"} downgrade`),b.disable_auto_update_under_native=!c),f!=null&&(S.info(`Set ${t} channel: ${e} to ${f?"allow":"disallow"} ios update`),b.ios=!!f),h!=null&&(S.info(`Set ${t} channel: ${e} to ${h?"allow":"disallow"} android update`),b.android=!!h),m!=null&&(S.info(`Set ${t} channel: ${e} to ${m?"allow":"disallow"} self assign to this channel`),b.allow_device_self_set=!!m),v!=null){let T=v.toLocaleLowerCase();yhe.includes(T)||(S.error(`Channel strategy ${T} is not known. The possible values are: ${yhe.join(", ")}.`),B.error("")),T==="metadata"&&(T="version_number"),b.disable_auto_update=T,S.info(`Set ${t} channel: ${e} to ${T} disable update strategy to this channel`)}try{let{error:T}=await z8(s,b);T&&(S.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),B.error(""))}catch{S.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),B.error("")}await n.track({channel:"channel",event:"Set channel",icon:"\u2705",user_id:o,tags:{"app-id":t},notify:!1}).catch()}catch(b){S.error(`Unknow error ${oe(b)}`),B.error("")}ee("Done \u2705"),(0,vhe.exit)()}var _he=require("node:process");async function bhe(e,t,r){let{quiet:i}=r;i||Z("List current bundle"),r.apikey=r.apikey||xe(i);let n=await se();t=t||n?.config?.appId,r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let s=await _e(r.apikey),a=await be(s,r.apikey,["write","all","read"]);await Xe(s,r.apikey,t,1),e||(S.error("Please provide a channel to get the bundle from."),B.error(""));let{data:o,error:u}=await s.from("channels").select("version ( name )").eq("name",e).eq("app_id",t).limit(1);(u||o.length===0)&&(S.error(`Error retrieving channel ${e} for app ${t}. Perhaps the channel does not exists?`),B.error(""));let{version:l}=o[0];l||(S.error(`Error retrieving channel ${e} for app ${t}. Perhaps the channel does not exists?`),B.error("")),i?S.info(l.name):S.info(`Current bundle for channel ${e} is ${l.name}`),(0,_he.exit)()}var cF=require("node:process");var Dhe=he(Km());function _Je(e){e.length||(S.error("No apps found"),(0,cF.exit)(1));let t=new Dhe.Table({title:"Apps",charLength:{"\u274C":2,"\u2705":2}});e.reverse().forEach(r=>{t.addRow({Name:r.name,id:r.app_id,Created:tf(r.created_at)})}),S.success(t.render())}async function bJe(e){let{data:t,error:r}=await e.from("apps").select().order("created_at",{ascending:!1});return r&&(S.error("Apps not found"),B.error("")),t}async function Ehe(e){Z("List apps in Capgo"),await Pe(),e.apikey=e.apikey||xe();let t=await _e(e.apikey);await be(t,e.apikey,["write","all","read","upload"]),S.info("Getting active bundle in Capgo");let r=await bJe(t);S.info(`Active app in Capgo: ${r?.length}`),_Je(r),ee("Done \u2705"),(0,cF.exit)()}var pF=require("node:process");var hy=he(Che());async function DJe(e,t,r){for await(let i of e)S.warn(`Removing ${i.name} created on ${tf(i.created_at)}`),await cy(t,r,i.name)}function EJe(e,t,r){let i=[];return e?.forEach(n=>{hy.default.gte(n.name,t)&&hy.default.lt(n.name,`${r}`)&&i.push(n)}),i}async function She(e,t){Z("Cleanup versions in Capgo"),await Pe(),t.apikey=t.apikey||xe();let{bundle:r,keep:i=4}=t,n=t.force||!1,s=await se();e=e||s?.config?.appId,t.apikey||(S.error("Missing API key, you need to provide an API key to delete your app"),B.error("")),e||(S.error("Missing argument, you need to provide a appid, or be in a capacitor project"),B.error(""));let a=await _e(t.apikey);await be(a,t.apikey,["write","all"]),await Xe(a,t.apikey,e,3),S.info("Querying all available versions in Capgo");let o=await dy(a,e),u=await rhe(a,e);if(S.info(`Total active versions in Capgo: ${o?.length}`),o?.length===0){S.error("No versions found, aborting cleanup");return}if(r){let p=`${hy.default.inc(r,"major")}`;S.info(`Querying available versions in Capgo between ${r} and ${p}`),o=EJe(o,r,p),S.info(`Active versions in Capgo between ${r} and ${p}: ${o?.length}`)}let l=[],c=0;if(o.forEach(p=>{let d=u.find(f=>f===p.id);c<i||d?(d?p.keep="\u2705 (Linked to channel)":p.keep="\u2705",c+=1):(p.keep="\u274C",l.push(p))}),l.length===0){S.warn("Nothing to be removed, aborting removal...");return}if(py(o),!n){let p=await Qe({message:"Do you want to continue removing the versions specified?"});(gi(p)||!p)&&(S.warn("Not confirmed, aborting removal..."),(0,pF.exit)())}S.success("You have confirmed removal, removing versions now"),await DJe(l,a,e),ee("Done \u2705"),(0,pF.exit)()}var Ahe=require("node:process");async function The(e,t,r){Z("Delete channel"),r.apikey=r.apikey||xe();let i=await se();t=t||i?.config?.appId;let n=qt();r.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),t||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let s=await _e(r.apikey),a=await be(s,r.apikey,["write","all"]);await Xe(s,r.apikey,t,4),S.info(`Deleting channel ${t}#${e} from Capgo`);try{let o=await _1e(s,e,t,a);o.error&&(S.error(`Cannot delete Channel \u{1F640} ${oe(o.error)}`),B.error(""));let u=await Pn(s,t);S.success("Channel deleted"),await n.track({channel:"channel",event:"Delete channel",icon:"\u2705",user_id:u,tags:{"user-id":a,"app-id":t,channel:e},notify:!1}).catch()}catch{S.error("Cannot delete Channel \u{1F640}")}ee("Done \u2705"),(0,Ahe.exit)()}var Ohe=require("node:process");async function Fhe(e,t){Z("List channels"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId;let i=qt();t.apikey||S.error("Missing API key, you need to provide a API key to upload your bundle"),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(t.apikey),s=await be(n,t.apikey,["write","all","read","upload"]);await Xe(n,t.apikey,e,1),S.info("Querying available channels in Capgo");let a=await D1e(n,e);S.info(`Active channels in Capgo: ${a?.length}`),b1e(a),await i.track({channel:"channel",event:"List channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch(),ee("Done \u2705"),(0,Ohe.exit)()}var Nhe=require("node:crypto"),Pf=require("node:fs"),khe=require("node:process");async function Rhe(e,t){Z("Set app"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId,t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let i=await _e(t.apikey),s=(await Qd(i,["admin","super_admin"])).gid,a=await be(i,t.apikey,["write","all"]);await Xe(i,t.apikey,e,4);let{name:o,icon:u,retention:l}=t;l&&Number.isNaN(Number(l))?(S.error("retention value must be a number"),B.error("")):l&&l<0&&(S.error("retention value cannot be less than 0"),B.error(""));let c,p,d=`icon_${(0,Nhe.randomUUID)()}`,f="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Pf.existsSync)(u)?(c=(0,Pf.readFileSync)(u),p=Ff.getType(u)||"image/png",S.warn(`Found app icon ${u}`)):(0,Pf.existsSync)(qn)?(c=(0,Pf.readFileSync)(qn),p=Ff.getType(qn)||"image/png",S.warn(`Found app icon ${qn}`)):S.warn(`Cannot find app icon in any of the following locations: ${u}, ${qn}`),c&&p){let{error:m}=await i.storage.from(`images/org/${s}/${e}`).upload(d,c,{contentType:p});m&&(S.error(`Could not set app ${oe(m)}`),B.error(""));let{data:v}=await i.storage.from(`images/org/${s}/${e}`).getPublicUrl(d);f=v?.publicUrl||f}let{error:h}=await i.from("apps").update({icon_url:f,name:o,retention:l?l*24*60*60:void 0}).eq("app_id",e).eq("user_id",a);h&&(S.error(`Could not set app ${oe(h)}`),B.error("")),ee("Done \u2705"),(0,khe.exit)()}var Phe=require("node:process");async function Ihe(e,t){Z("Deleting"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId;let i=qt();t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(t.apikey),s=await be(n,t.apikey,["write","all"]);await Xe(n,t.apikey,e,5);let{data:a,error:o}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",e).single(),u=a;if(!o&&(u?.owner_org.created_by??"")!==s){S.warn("Deleting the app is not recomended for users that are not the organization owner"),S.warn("You are invited as a super_admin but your are not the owner"),S.warn("It's strongly recomended that you do not continue!");let f=await Pc({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(gi(f)||f==="no")&&(S.error("Canceled deleting the app, exiting"),B.error(""))}else o&&S.warn(`Cannot get the app owner ${oe(o)}`);let{error:l}=await n.storage.from("images").remove([`org/${u?.owner_org.id}/${e}/icon`]);l&&(console.error(l,`images/org/${u?.owner_org.id}/${e}`),S.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${e}/${s}`).remove(["versions"]);c&&S.error("Could not delete app version");let{error:p}=await n.from("apps").delete().eq("app_id",e);p&&(S.error("Could not delete app"),B.error(""));let d=await Pn(n,e);await i.track({channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:d,tags:{"app-id":e},notify:!1}).catch(),S.success("App deleted in Capgo"),ee("Done \u2705"),(0,Phe.exit)()}var Lhe=he(Km());async function Bhe(e,t){Z("Check compatibility"),t.apikey=t.apikey||xe();let r=await se();e=e||r?.config?.appId;let{channel:i}=t;i||(S.error("Missing argument, you need to provide a channel"),B.error("")),t.apikey||(S.error("Missing API key, you need to provide a API key to upload your bundle"),B.error("")),e||(S.error("Missing argument, you need to provide a appId, or be in a capacitor project"),B.error(""));let n=await _e(t.apikey);await be(n,t.apikey,["write","all","read","upload"]),await Xe(n,t.apikey,e,1);let{finalCompatibility:s}=await G8(n,e,i),a=new Lhe.Table({title:"Compatibility",charLength:{"\u274C":2,"\u2705":2}}),o=t.text?"Yes":"\u2705",u=t.text?"No":"\u274C";s.forEach(l=>{let{name:c,localVersion:p,remoteVersion:d}=l;a.addRow({Package:c,"Local version":p??"None","Remote version":d??"None",Compatible:d===p?o:u})}),S.success(a.render())}B.name(ko.name).description("Manage packages and bundle versions in Capgo Cloud").version(ko.version);B.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(M1e).option("--local","Only save in local folder");B.command("doctor").description("Get info about your Capgo app install").action(dhe);B.command("init [apikey] [appId]").description("Init a new app").action(J1e).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path");var If=B.command("app").description("Manage app");If.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(W1e).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");If.command("delete [appId]").description("Delete an app in Capgo Cloud").action(Ihe).option("-a, --apikey <apikey>","apikey to link to your account");If.command("list").alias("l").description("list apps in Capgo Cloud").action(Ehe).option("-a, --apikey <apikey>","apikey to link to your account");If.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(Zfe);If.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(boe);If.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(Rhe).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 No=B.command("bundle").description("Manage bundle");No.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(j1e).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--key-v2 <key>","custom path for private signing key").option("--key-data-v2 <keyData>","private signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3").option("--ignore-partial","Does not upload partial files to S3").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.");No.command("compatibility [appId]").action(Bhe).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");No.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(ghe).option("-a, --apikey <apikey>","apikey to link to your account");No.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(nhe).option("-a, --apikey <apikey>","apikey to link to your account");No.command("cleanup [appId]").alias("c").action(She).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");No.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(ahe).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");No.command("encrypt [zipPath]").description("Encrypt a zip bundle").action(uhe).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");No.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(che).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");No.command("zip [appId]").description("Zip a bundle").action(Afe).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2");var i2=B.command("channel").description("Manage channel");i2.command("add [channelId] [appId]").alias("a").description("Create channel").action(x1e).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");i2.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(The).option("-a, --apikey <apikey>","apikey to link to your account");i2.command("list [appId]").alias("l").description("List channel").action(Fhe).option("-a, --apikey <apikey>","apikey to link to your account");i2.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(bhe).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");i2.command("set [channelId] [appId]").alias("s").description("Set channel").action(whe).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices");var jhe=B.command("key_old").description("Manage old encryption key");jhe.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(fhe).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");jhe.command("create").description("Create a new encryption key").action(hhe).option("-f, --force","force generate a new one");var dF=B.command("key").description("Manage encryption key");dF.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(Kfe).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");dF.command("create").description("Create a new encryption key").action(Yfe).option("-f, --force","force generate a new one");dF.command("delete_old").description("Delete the old encryption key").action(Xfe);B.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(q1e).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 xJe=B.command("account").description("Manage account");xJe.command("id").description("Get your account ID").action(Doe).option("-a, --apikey <apikey>","apikey to link to your account");B.parseAsync();
411
411
  /*! Bundled license information:
412
412
 
413
413
  is-extglob/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
- "version": "4.16.2",
3
+ "version": "4.16.4",
4
4
  "description": "A CLI to upload to capgo servers",
5
5
  "author": "github.com/riderx",
6
6
  "license": "Apache 2.0",