picgo
Version:
A tool for image uploading
1 lines • 266 kB
JavaScript
"use strict";require("dotenv/config");var e=require("fs-extra"),t=require("path"),i=require("events"),n=require("os"),r=require("commander"),s=require("inquirer"),o=require("image-size"),a=require("url"),c=require("node:process"),l=require("node:util"),_=require("chalk"),u=require("lodash"),E=require("comment-json"),d=require("axios"),p=require("node:crypto"),I=require("crypto"),g=require("util"),h=require("node:fs/promises"),C=require("@picgo/store"),f=require("dayjs"),L=require("mime-types"),m=require("md5"),U=require("node:path"),O=require("node:fs"),D=require("write-file-atomic"),P=require("resolve"),N=require("child_process"),S=require("is-wsl"),A=require("form-data"),T=require("https"),R=require("tunnel"),y=require("cross-spawn"),M=require("js-yaml"),B=require("@picgo/i18n"),G=require("@hono/node-server"),x=require("@hono/node-server/serve-static"),w=require("hono"),b=require("hono/logger"),v=require("hono/cors");function $(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}}),t.default=e,Object.freeze(t)}var F=$(p);const H=e=>{const t=`${!0===e.global?"g":""}${!0===e.ignoreCase?"i":""}`;return new RegExp(e.match,t)},k=(e,t,i)=>{if(e.imgUrl)for(const n of t){if(!(!1!==n.enable))continue;let t;try{t=H(n)}catch(e){i.log.error(e);continue}if(!t.test(e.imgUrl))continue;const r=e.imgUrl,s=r.replace(t,n.replace);if(s!==r&&void 0===e.originImgUrl&&(e.originImgUrl=r),e.imgUrl=s,""===s){const e=i.i18n?.translate("URL_REWRITE_EMPTY_RESULT")??"URL_REWRITE_EMPTY_RESULT";i.log.warn(e)}break}};function Y(e,t){return e.map(e=>{const i={...e};if("function"==typeof e.choices){const n=e.choices;i.choices=i=>{try{return n(i)}catch(i){return t?.onError?.(e.name,"choices",i),[{name:e.name,value:null}]}}}if("function"==typeof e.default){const n=e.default;i.default=i=>{try{return n(i)}catch(i){return void t?.onError?.(e.name,"default",i)}}}return i})}const V={handle:e=>{const t=e.cmd;t.program.command("install <plugins...>").description("install picgo plugin").alias("add").option("-p, --proxy <proxy>","Add proxy for installing plugins").option("-r, --registry <registry>","Choose a registry for installing plugins").action((t,i)=>{const{proxy:n,registry:r}=i,s={npmProxy:n,npmRegistry:r};e.pluginHandler.install(t,s).catch(t=>{e.log.error(t)})}),t.program.command("uninstall <plugins...>").alias("rm").description("uninstall picgo plugin").action(t=>{e.pluginHandler.uninstall(t).catch(t=>{e.log.error(t)})}),t.program.command("update <plugins...>").description("update picgo plugin").option("-p, --proxy <proxy>","Add proxy for installing plugins").option("-r, --registry <registry>","Choose a registry for installing plugins").action((t,i)=>{const{proxy:n,registry:r}=i,s={npmProxy:n,npmRegistry:r};e.pluginHandler.update(t,s).catch(t=>{e.log.error(t)})})}},q={handle:e=>{e.cmd.program.option("-c, --config <path>","set config path")}},K=e=>e.startsWith("http://")||e.startsWith("https://"),j=e=>{if(!e)return"";try{return new a.URL(e).href}catch(t){if(e.startsWith("//"))try{return new a.URL("http:"+e).href.slice(5)}catch(e){}return encodeURI(e)}},W=(...e)=>e.join("").replace(/\/{2,}/g,"/").split("/").map(e=>encodeURIComponent(e)).join("/"),Q=e=>{try{const{width:t=0,height:i=0,type:n}=o.imageSize(e);return{real:!0,width:t,height:i,extname:n?`.${n}`:".png"}}catch(e){return{real:!1,width:200,height:200,extname:".png"}}},z=async i=>{try{return{extname:t.extname(i),fileName:t.basename(i),filePath:i,buffer:await e.readFile(i),success:!0}}catch{return{reason:`read file ${i} error`,success:!1}}},J=async(e,i)=>{e=j(e);let n,r=!1,s="";const o=new Promise((o,c)=>{(async()=>{try{const c=await i.request({method:"get",url:e,resolveWithFullResponse:!0,responseType:"arraybuffer"}).then(e=>{const t=e.headers["content-type"];return t?.includes("image")&&(r=!0,s=`.${t.split("image/")[1]}`),e.data});clearTimeout(n);const l=new a.URL(e).pathname,_=decodeURIComponent(t.basename(l));o(r?{buffer:c,fileName:_,extname:s||t.extname(_)||".png",success:!0}:{buffer:c,fileName:_,extname:t.extname(_)||".png",success:!0})}catch(t){clearTimeout(n),o({success:!1,reason:`request ${e} error, ${t?.message??""}`})}})().catch(c)}),c=new Promise(t=>{n=setTimeout(()=>{t({success:!1,reason:`request ${e} timeout`})},1e4)});return Promise.race([o,c])},X=e=>/^@[^/]+\/picgo-plugin-/.test(e)?"scope":e.startsWith("picgo-plugin-")?"normal":Z(e)?"simple":"unknown",Z=i=>{if(t.isAbsolute(i))return!1;const n=t.join(process.cwd(),i);return!e.existsSync(n)&&(!i.includes("/")&&!i.includes("\\"))},ee=(e,t="")=>t?`@${t}/picgo-plugin-${e}`:`picgo-plugin-${e}`,te=(i,n=console)=>{switch(X(i)){case"normal":case"scope":return i;case"simple":return ee(i);default:{let r=i;return t.isAbsolute(i)&&e.existsSync(i)?ne(r):(r=t.join(process.cwd(),i),e.existsSync(r)?ne(r):(n.warn(`Can't find plugin ${i}`),""))}}},ie=(i,n=console)=>{switch(X(i)){case"normal":return re(i);case"scope":return re(i,!0);case"simple":return re(ee(i));default:{if(!e.existsSync(i))return n.warn(`Can't find plugin: ${i}`),"";const r=t.posix.join(i,"package.json");if(e.existsSync(r)){const t=e.readJSONSync(r)||{};return t.name?.includes("picgo-plugin-")?t.name:(n.warn(`The plugin package.json's name filed is ${t.name||"empty"}, need to include the prefix: picgo-plugin-`),"")}return n.warn(`Can't find plugin: ${i}`),""}}},ne=e=>e.split(t.sep).join("/"),re=(e,t=!1)=>{if(e.includes("@")){let i=/(.+\/)?(picgo-plugin-\w+)(@.+)*/;t&&(i=/(.+\/)?(^@[^/]+\/picgo-plugin-\w+)(@.+)*/);const n=e.match(i);return n?n[2]:(console.warn("can not remove plugin version"),e)}return e},se=[],oe=e=>se.some(t=>e.startsWith(t)),ae=e=>"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0;function ce(e){try{return JSON.parse(e)}catch(t){return e}}const le=(e=0)=>isNaN(Number(e))?0:Number(e),_e=()=>"development"===process.env.NODE_ENV;var ue,Ee,de,pe,Ie,ge,he=Object.freeze({__proto__:null,configBlackList:se,forceNumber:le,getFSFile:z,getImageSize:Q,getNormalPluginName:ie,getPluginNameType:X,getProcessPluginName:te,getURLFile:J,handleCompletePluginName:ee,handleStreamlinePluginName:e=>/^@[^/]+\/picgo-plugin-/.test(e)?e.replace(/^@[^/]+\/picgo-plugin-/,""):e.replace(/picgo-plugin-/,""),handleUnixStylePath:ne,handleUrlEncode:j,handleUrlPathSafeEncode:W,isConfigKeyInBlackList:oe,isDev:_e,isInputConfigValid:ae,isProd:()=>"production"===process.env.NODE_ENV,isSimpleName:Z,isUrl:K,removePluginVersion:re,safeParse:ce});exports.AlbumListOrder=void 0,(ue=exports.AlbumListOrder||(exports.AlbumListOrder={})).ASC="asc",ue.DESC="desc",exports.AlbumListSort=void 0,(Ee=exports.AlbumListSort||(exports.AlbumListSort={})).NEWEST="newest",Ee.OLDEST="oldest",Ee.FILE_NAME="fileName",exports.OutputFormat=void 0,(de=exports.OutputFormat||(exports.OutputFormat={})).PRETTY="pretty",de.JSON="json",exports.ILogType=void 0,(pe=exports.ILogType||(exports.ILogType={})).success="success",pe.info="info",pe.warn="warn",pe.error="error",pe.debug="debug",exports.IBuildInEvent=void 0,(Ie=exports.IBuildInEvent||(exports.IBuildInEvent={})).UPLOAD_PROGRESS="uploadProgress",Ie.FILE_UPLOAD_PROGRESS="fileUploadProgress",Ie.FAILED="failed",Ie.BEFORE_TRANSFORM="beforeTransform",Ie.BEFORE_UPLOAD="beforeUpload",Ie.AFTER_UPLOAD="afterUpload",Ie.CLOUD_IMPORT_PROGRESS="cloudImportProgress",Ie.CLOUD_ALBUM_UPDATED="cloudAlbumUpdated",Ie.FINISHED="finished",Ie.INSTALL="install",Ie.UNINSTALL="uninstall",Ie.UPDATE="update",Ie.NOTIFICATION="notification",exports.LifecycleStep=void 0,(ge=exports.LifecycleStep||(exports.LifecycleStep={})).IDLE="idle",ge.BEFORE_TRANSFORM="beforeTransform",ge.TRANSFORM="transform",ge.BEFORE_UPLOAD="beforeUpload",ge.UPLOAD="upload",ge.AFTER_UPLOAD="afterUpload",exports.IBusEvent=void 0,(exports.IBusEvent||(exports.IBusEvent={})).CONFIG_CHANGE="CONFIG_CHANGE";const Ce="picgo-clipboard-images",fe="picgo-cloud",Le="picgoCloudAutoImport",me=1048576,Ue=(e,t,i,n)=>{if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return;const r=Object.getOwnPropertyDescriptor(e,i),s=Object.getOwnPropertyDescriptor(t,i);!Oe(r,s)&&n||Object.defineProperty(e,i,s)},Oe=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},De=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Pe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Ne=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function Se(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:n}=e;for(const n of Reflect.ownKeys(t))Ue(e,t,n,i);return((e,t)=>{const i=Object.getPrototypeOf(t);i!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,i)})(e,t),((e,t,i)=>{const n=""===i?"":`with ${i.trim()}() `,r=De.bind(null,n,t.toString());Object.defineProperty(r,"name",Ne);const{writable:s,enumerable:o,configurable:a}=Pe;Object.defineProperty(e,"toString",{value:r,writable:s,enumerable:o,configurable:a})})(e,t,n),e}const Ae=new WeakMap,Te=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let i,n=0;const r=e.displayName||e.name||"<anonymous>",s=function(...o){if(Ae.set(s,++n),1===n)i=e.apply(this,o),e=void 0;else if(!0===t.throw)throw new Error(`Function \`${r}\` can only be called once`);return i};return Se(s,e),Ae.set(s,n),s};Te.callCount=e=>{if(!Ae.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Ae.get(e)};const Re=[];Re.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&Re.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&Re.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const ye=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,Me=Symbol.for("signal-exit emitter"),Be=globalThis,Ge=Object.defineProperty.bind(Object);class xe{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Be[Me])return Be[Me];Ge(Be,Me,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const i=this.listeners[e],n=i.indexOf(t);-1!==n&&(0===n&&1===i.length?i.length=0:i.splice(n,1))}emit(e,t,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const r of this.listeners[e])n=!0===r(t,i)||n;return"exit"===e&&(n=this.emit("afterExit",t,i)||n),n}}class we{}const be=globalThis.process,{onExit:ve}=($e=ye(be)?new class extends we{#e="win32"===be.platform?"SIGINT":"SIGHUP";#t=new xe;#i;#n;#r;#s={};#o=!1;constructor(e){super(),this.#i=e,this.#s={};for(const t of Re)this.#s[t]=()=>{const i=this.#i.listeners(t);let{count:n}=this.#t;const r=e;if("object"==typeof r.__signal_exit_emitter__&&"number"==typeof r.__signal_exit_emitter__.count&&(n+=r.__signal_exit_emitter__.count),i.length===n){this.unload();const i=this.#t.emit("exit",null,t),n="SIGHUP"===t?this.#e:t;i||e.kill(e.pid,n)}};this.#r=e.reallyExit,this.#n=e.emit}onExit(e,t){if(!ye(this.#i))return()=>{};!1===this.#o&&this.load();const i=t?.alwaysLast?"afterExit":"exit";return this.#t.on(i,e),()=>{this.#t.removeListener(i,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of Re)try{const t=this.#s[e];t&&this.#i.on(e,t)}catch(e){}this.#i.emit=(e,...t)=>this.#a(e,...t),this.#i.reallyExit=e=>this.#c(e)}}unload(){this.#o&&(this.#o=!1,Re.forEach(e=>{const t=this.#s[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#i.removeListener(e,t)}catch(e){}}),this.#i.emit=this.#n,this.#i.reallyExit=this.#r,this.#t.count-=1)}#c(e){return ye(this.#i)?(this.#i.exitCode=e||0,this.#t.emit("exit",this.#i.exitCode,null),this.#r.call(this.#i,this.#i.exitCode)):0}#a(e,...t){const i=this.#n;if("exit"===e&&ye(this.#i)){"number"==typeof t[0]&&(this.#i.exitCode=t[0]);const n=i.call(this.#i,e,...t);return this.#t.emit("exit",this.#i.exitCode,null),n}return i.call(this.#i,e,...t)}}(be):new class extends we{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>$e.onExit(e,t),load:()=>$e.load(),unload:()=>$e.unload()});var $e;const Fe=c.stderr.isTTY?c.stderr:c.stdout.isTTY?c.stdout:void 0,He=Fe?Te(()=>{ve(()=>{Fe.write("[?25h")},{alwaysLast:!0})}):()=>{};let ke=!1;const Ye={show:(e=c.stderr)=>{e.isTTY&&(ke=!1,e.write("[?25h"))},hide:(e=c.stderr)=>{e.isTTY&&(He(),ke=!0,e.write("[?25l"))},toggle:(e,t)=>{void 0!==e&&(ke=e),ke?Ye.show(t):Ye.hide(t)}};var Ve={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots14:{interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},dotsCircle:{interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},fish:{interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}};const qe=function({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();const Ke=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],je=[12288,12288,65281,65376,65504,65510],We=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Qe=(e,t)=>{let i=0,n=Math.floor(e.length/2)-1;for(;i<=n;){const r=Math.floor((i+n)/2),s=2*r;if(t<e[s])n=r-1;else{if(!(t>e[s+1]))return!0;i=r+1}}return!1},ze=Ke[0],Je=Ke.at(-1),Xe=je[0],Ze=je.at(-1),et=We[0],tt=We.at(-1),[it,nt]=function(e){let t=e[0],i=e[1];for(let n=0;n<e.length;n+=2){const r=e[n],s=e[n+1];if(19968>=r&&19968<=s)return[r,s];s-r>i-t&&(t=r,i=s)}return[t,i]}(We);function rt(e,{ambiguousAsWide:t=!1}={}){return function(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}(e),(e=>!(e<Xe||e>Ze)&&Qe(je,e))(e)||(e=>e>=it&&e<=nt||!(e<et||e>tt)&&Qe(We,e))(e)||t&&(e=>!(e<ze||e>Je)&&Qe(Ke,e))(e)?2:1}const st=new Intl.Segmenter,ot=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,at=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,ct=/^\p{RGI_Emoji}$/v,lt=/^[\d#*]\u20E3$/,_t=/\p{Extended_Pictographic}/gu;function ut(e){if(e.length>50)return!1;if(lt.test(e))return!0;if(e.includes("")){const t=e.match(_t);return null!==t&&t.length>=2}return!1}function Et(e){return e.replace(at,"")}function dt(e){return ot.test(e)}function pt(e,t){let i=0;if(e.length>1)for(const n of e.slice(1))n>=""&&n<=""&&(i+=rt(n.codePointAt(0),t));return i}function It(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:n=!1}=t;let r=e;if(n||!r.includes("")&&!r.includes("")||(r=function(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(qe,"")}(r)),0===r.length)return 0;if(/^[\u0020-\u007E]*$/.test(r))return r.length;let s=0;const o={ambiguousAsWide:!i};for(const{segment:e}of st.segment(r)){if(dt(e))continue;if(ct.test(e)||ut(e)){s+=2;continue}s+=rt(Et(e).codePointAt(0),o),s+=pt(e,o)}return s}const gt=new class{#l=0;#_;#u=!1;#E=!1;#d=e=>{if(!e?.length)return;3===("string"==typeof e?e.codePointAt(0):e[0])&&(c.listenerCount("SIGINT")>0?c.emit("SIGINT"):c.kill(c.pid,"SIGINT"))};start(){this.#l++,1===this.#l&&this.#p()}stop(){0!==this.#l&&0===--this.#l&&this.#I()}#p(){const{stdin:e}=c;"win32"!==c.platform&&e?.isTTY&&"function"==typeof e.setRawMode?(this.#_=e,this.#u=e.isPaused(),this.#E=Boolean(e.isRaw),e.setRawMode(!0),e.prependListener("data",this.#d),this.#u&&e.resume()):this.#_=void 0}#I(){if(!this.#_)return;const e=this.#_;e.off("data",this.#d),e.isTTY&&e.setRawMode?.(this.#E),this.#u&&e.pause(),this.#_=void 0,this.#u=!1,this.#E=!1}};var ht=Object.freeze(gt);const Ct=new Map;class ft{#g=0;#h=-1;#C=0;#f;#L;#m;#U;#O=new Map;#D=!1;#P;#N;#S=!1;color;#A(e){this.#D=!0;try{return e()}finally{this.#D=!1}}#T(){this.isSpinning&&this.render()}#R(e,t){if(null==e)return"";if("string"==typeof e)return e;if(Buffer.isBuffer(e)||ArrayBuffer.isView(e)){const i="string"==typeof t&&t&&"buffer"!==t?t:"utf8";return Buffer.from(e).toString(i)}return String(e)}#y(e){if(!e)return!1;const t=e.at(-1);return"\n"===t||"\r"===t}#M(){this.#N||(this.#N=setTimeout(()=>{this.#N=void 0,this.isSpinning&&this.#T()},200),"function"==typeof this.#N?.unref&&this.#N.unref())}#B(){this.#N&&(clearTimeout(this.#N),this.#N=void 0)}#G(e,t,i,n){return this.#x(i," ")+e+("string"==typeof t?(e?" ":"")+t:"")+this.#w(n," ")}constructor(e){"string"==typeof e&&(e={text:e}),this.#f={color:"cyan",stream:c.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#f.color,this.#m=this.#f.stream,"boolean"!=typeof this.#f.isEnabled&&(this.#f.isEnabled=function({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#m})),"boolean"!=typeof this.#f.isSilent&&(this.#f.isSilent=!1);const t=this.#f.interval;this.spinner=this.#f.spinner,this.#f.interval=t,this.text=this.#f.text,this.prefixText=this.#f.prefixText,this.suffixText=this.#f.suffixText,this.indent=this.#f.indent,"test"===c.env.NODE_ENV&&(this._stream=this.#m,this._isEnabled=this.#f.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#g},set(e){this.#g=e}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#h}}),Object.defineProperty(this,"_lineCount",{get(){const e=this.#m.columns??80,t="function"==typeof this.#f.prefixText?"":this.#f.prefixText,i="function"==typeof this.#f.suffixText?"":this.#f.suffixText,n="string"==typeof t&&""!==t?t+" ":"",r="string"==typeof i&&""!==i?" "+i:"",s=" ".repeat(this.#f.indent)+n+"-"+("string"==typeof this.#f.text?" "+this.#f.text:"")+r;return this.#b(s,e)}}))}get indent(){return this.#f.indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#f.indent=e}get interval(){return this.#f.interval??this.#L.interval??100}get spinner(){return this.#L}set spinner(e){if(this.#h=-1,this.#f.interval=void 0,"object"==typeof e){if(!Array.isArray(e.frames)||0===e.frames.length||e.frames.some(e=>"string"!=typeof e))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(void 0!==e.interval&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#L=e}else if(function(){const{env:e}=c,{TERM:t,TERM_PROGRAM:i}=e;return"win32"!==c.platform?"linux"!==t:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===i||"vscode"===i||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}())if(void 0===e)this.#L=Ve.dots;else{if("default"===e||!Ve[e])throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this.#L=Ve[e]}else this.#L=Ve.line}get text(){return this.#f.text}set text(e=""){this.#f.text=e}get prefixText(){return this.#f.prefixText}set prefixText(e=""){this.#f.prefixText=e}get suffixText(){return this.#f.suffixText}set suffixText(e=""){this.#f.suffixText=e}get isSpinning(){return void 0!==this.#U}#v(e,t,i=!1){const n="function"==typeof e?e():e;return"string"==typeof n&&""!==n?i?t+n:n+t:""}#x(e=this.#f.prefixText,t=" "){return this.#v(e,t,!1)}#w(e=this.#f.suffixText,t=" "){return this.#v(e,t,!0)}#b(e,t){let i=0;for(const n of l.stripVTControlCharacters(e).split("\n"))i+=Math.max(1,Math.ceil(It(n)/t));return i}get isEnabled(){return this.#f.isEnabled&&!this.#f.isSilent}set isEnabled(e){if("boolean"!=typeof e)throw new TypeError("The `isEnabled` option must be a boolean");this.#f.isEnabled=e}get isSilent(){return this.#f.isSilent}set isSilent(e){if("boolean"!=typeof e)throw new TypeError("The `isSilent` option must be a boolean");this.#f.isSilent=e}frame(){const e=Date.now();(-1===this.#h||e-this.#C>=this.interval)&&(this.#h=(this.#h+1)%this.#L.frames.length,this.#C=e);const{frames:t}=this.#L;let i=t[this.#h];this.color&&(i=_[this.color](i));return this.#x(this.#f.prefixText," ")+i+("string"==typeof this.text?" "+this.text:"")+this.#w(this.#f.suffixText," ")}clear(){return this.isEnabled&&this.#m.isTTY?(this.#A(()=>{this.#m.cursorTo(0);for(let e=0;e<this.#g;e++)e>0&&this.#m.moveCursor(0,-1),this.#m.clearLine(1);this.#f.indent&&this.#m.cursorTo(this.#f.indent)}),this.#g=0,this):this}#$(e){if(!e||this.#O.has(e)||!e.isTTY||"function"!=typeof e.write)return;Ct.has(e)&&console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");const t=e.write;this.#O.set(e,t),Ct.set(e,this),e.write=(i,n,r)=>this.#F(e,t,i,n,r)}#H(){if(!this.isEnabled||this.#O.size>0)return;const e=new Set([this.#m,c.stdout,c.stderr]);for(const t of e)this.#$(t)}#k(){for(const[e,t]of this.#O)e.write=t,Ct.get(e)===this&&Ct.delete(e);this.#O.clear()}#F(e,t,i,n,r){if("function"==typeof n&&(r=n,n=void 0),this.#D)return t.call(e,i,n,r);this.clear();const s=this.#R(i,n),o=this.#y(s),a=t.call(e,i,n,r);return o?this.#B():s.length>0&&this.#M(),this.isSpinning&&!this.#N&&this.render(),a}render(){if(!this.isEnabled||this.#P||this.#N)return this;const e=this.#m.isTTY;let t=!1;try{e&&(this.#A(()=>this.#m.write("[?2026h")),t=!0),this.clear();let i=this.frame();const n=this.#m.columns??80,r=this.#b(i,n),s=this.#m.rows;if(s&&s>1&&r>s){const e=i.split("\n"),t=s-1;i=[...e.slice(0,t),"... (content truncated to fit terminal)"].join("\n")}!1===this.#A(()=>this.#m.write(i))&&this.#m.isTTY&&(this.#P=()=>{this.#P=void 0,this.#T()},this.#m.once("drain",this.#P)),this.#g=this.#b(i,n)}finally{t&&this.#A(()=>this.#m.write("[?2026l"))}return this}start(e){if(e&&(this.text=e),this.isSilent)return this;if(!this.isEnabled){const e=this.text?"-":"",t=" ".repeat(this.#f.indent)+this.#G(e,this.text,this.#f.prefixText,this.#f.suffixText);return""!==t.trim()&&this.#A(()=>this.#m.write(t+"\n")),this}return this.isSpinning||(this.#f.hideCursor&&Ye.hide(this.#m),this.#f.discardStdin&&c.stdin.isTTY&&(ht.start(),this.#S=!0),this.#H(),this.render(),this.#U=setInterval(this.render.bind(this),this.interval)),this}stop(){return clearInterval(this.#U),this.#U=void 0,this.#h=-1,this.#C=0,this.#B(),this.#k(),this.#P&&(this.#m.removeListener("drain",this.#P),this.#P=void 0),this.isEnabled&&(this.clear(),this.#f.hideCursor&&Ye.show(this.#m)),this.#S&&(this.#S=!1,ht.stop()),this}succeed(e){return this.stopAndPersist({symbol:"✅",text:e})}fail(e){return this.stopAndPersist({symbol:"❌️",text:e})}warn(e){return this.stopAndPersist({symbol:"⚠️",text:e})}info(e){return this.stopAndPersist({symbol:"ℹ️",text:e})}stopAndPersist(e={}){if(this.isSilent)return this;const t=e.symbol??" ",i=e.text??this.text,n=e.prefixText??this.#f.prefixText,r=e.suffixText??this.#f.suffixText,s=this.#G(t,i,n,r)+"\n";return this.stop(),this.#A(()=>this.#m.write(s)),this}}function Lt(e){return new ft(e)}const mt=e=>{const t=Lt({text:""}),i=e.verbose||!process.stdout.isTTY,n=n=>{if(i)return t.isSpinning&&t.stop(),void console.log(e.formatVerboseText(n));const r=((e,t)=>{const i=t>0?Math.min(Math.max(e/t,0),1):0,n=Math.round(20*i),r=20-n;return"█".repeat(n)+"░".repeat(r)})(n.current,n.total);t.text=`${r} ${e.formatBarText(n)}`,t.isSpinning||t.start()};return e.ctx.on(e.event,n),{spinner:t,dispose:()=>{e.ctx.off(e.event,n),t.isSpinning&&t.stop()}}},Ut=e=>(e/me).toFixed(1),Ot=(e,t)=>{const i=t.resumed?e.i18n.translate("PICGO_CLOUD_UPLOAD_RESUMED_SUFFIX"):"";return{fileName:t.fileName,loadedMB:Ut(t.current),totalMB:Ut(t.total),partsCompleted:String(t.partsCompleted),totalParts:String(t.totalParts),resumedSuffix:i}},Dt={handle:i=>{i.cmd.program.command("upload").description("upload, go go go").arguments("[input...]").alias("u").option("--format <format>","output format: pretty | json","pretty").option("--verbose","Force per-event progress lines (one console.log per progress tick) instead of an in-place spinner. Non-TTY stdout (pipes, CI) automatically falls back to this mode regardless of the flag — --verbose is for the niche case of wanting line-by-line history on an interactive TTY (debugging multipart retries, AI agents tailing output, etc.).",!1).action(async(n,r)=>{const s=n.map(e=>K(e)?e:t.resolve(e)).filter(t=>{const n=e.existsSync(t)||K(t);return n||i.log.warn(`${t} does not exist.`),n}),o=mt({ctx:i,event:exports.IBuildInEvent.FILE_UPLOAD_PROGRESS,verbose:!0===r.verbose,formatBarText:e=>i.i18n.translate("PICGO_CLOUD_UPLOAD_PROGRESS_BAR",Ot(i,e)),formatVerboseText:e=>i.i18n.translate("PICGO_CLOUD_UPLOAD_VERBOSE",Ot(i,e))});try{await i.upload(s,{outputFormat:"json"===r.format?exports.OutputFormat.JSON:exports.OutputFormat.PRETTY})}catch(e){if(i.log.error(e instanceof Error?e:new Error(String(e))),process.argv.includes("--debug"))throw e}finally{o.dispose()}})}},Pt=e=>async t=>{try{await e.cloud.login(t)}catch(t){e.log.error(t)}},Nt=e=>async()=>{try{e.cloud.logout()}catch(t){e.log.error(t)}};var St,At,Tt,Rt,yt,Mt,Bt;exports.SyncStatus=void 0,(St=exports.SyncStatus||(exports.SyncStatus={})).SUCCESS="success",St.CONFLICT="conflict",St.FAILED="failed",exports.ConflictType=void 0,(At=exports.ConflictType||(exports.ConflictType={})).CLEAN="clean",At.CONFLICT="conflict",At.ADDED="added",At.DELETED="deleted",At.MODIFIED="modified",exports.E2EVersion=void 0,(Tt=exports.E2EVersion||(exports.E2EVersion={}))[Tt.NONE=0]="NONE",Tt[Tt.V1=1]="V1",exports.EncryptionMethod=void 0,(Rt=exports.EncryptionMethod||(exports.EncryptionMethod={})).AUTO="auto",Rt.SSE="sse",Rt.E2EE="e2ee",exports.E2EAskPinReason=void 0,(yt=exports.E2EAskPinReason||(exports.E2EAskPinReason={})).SETUP="setup",yt.DECRYPT="decrypt",yt.RETRY="retry",function(e){e.GUI="gui",e.CLI="cli"}(Mt||(Mt={})),function(e){e.AccountFrozen="ACCOUNT_FROZEN",e.ConfigConflict="CONFIG_CONFLICT",e.ConfigNotFound="CONFIG_NOT_FOUND",e.DuplicateId="DUPLICATE_ID",e.GraceRestricted="GRACE_RESTRICTED",e.ImportDisabled="IMPORT_DISABLED",e.PlanIneligible="PLAN_INELIGIBLE",e.PlanRequired="PLAN_REQUIRED",e.QuotaExceeded="QUOTA_EXCEEDED"}(Bt||(Bt={}));const Gt=process.env.PICGO_API_URL||"https://api.picgo.app",xt=process.env.PICGO_CLOUD_URL||"https://cloud.picgo.app",wt=e=>"object"==typeof e&&null!==e,bt=(e,t)=>"number"==typeof e&&Number.isFinite(e)&&e>=0?Math.floor(e):t,vt=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if("string"==typeof e||e instanceof Date){const t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}},$t=e=>(e?.plan??0)>0,Ft=e=>{let t="";for(const i of e)t+=String.fromCharCode(i);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")},Ht=e=>wt(e),kt=e=>{const t=e,i=t?.response?.data;return Ht(i)?i:void 0},Yt=e=>{const t=e,i=t?.response?.status??t?.status;return"number"==typeof i?i:void 0},Vt=e=>{const t=e,i=t?.apiCode??kt(e)?.code??t?.code;return"string"==typeof i?i:void 0},qt=(e,t="Request failed")=>{const i=kt(e)?.message??(e instanceof Error?e.message:void 0)??(wt(e)&&"string"==typeof e.message?e.message:void 0);return"string"==typeof i&&""!==i.trim()?i:t},Kt=(e,t)=>{const i=new Error(e,void 0===t?void 0:{cause:t});return i.status=Yt(t),i.apiCode=Vt(t),i};class jt{ctx;baseURL;constructor(e,t=Gt){this.ctx=e,this.baseURL=t}resolveUrl(e){return new URL(e,this.baseURL).toString()}async request(e,t){const i=t??this.ctx.getConfig("settings.picgoCloud.token"),n={...e.headers||{}};i&&(n.Authorization=`Bearer ${i}`,process.env.ENABLE_PICGO_CLOUD_DEV_MODE&&(n["CF-Access-Client-Id"]=process.env.CF_ACCESS_CLIENT_ID||"",n["CF-Access-Client-Secret"]=process.env.CF_ACCESS_CLIENT_SECRET||""));try{return await this.ctx.request({...e,url:this.resolveUrl(e.url||""),headers:n})}catch(e){if((e=>"object"==typeof e&&null!==e&&("statusCode"in e||"response"in e||"message"in e))(e))throw(e=>{const t=e.response?.body,i=Ht(t)&&"string"==typeof t.message?t.message:e.message||"Request failed",n=new Error(i),r=e.response?.status??e.statusCode??0;return n.name="AxiosError",n.isAxiosError=!0,n.status=r,Ht(t)&&"string"==typeof t.code?n.code=t.code:"string"==typeof e.code&&(n.code=e.code),n.response={status:r,data:t},n})(e);throw e}}}class Wt{client;ctx;appType=Mt.CLI;constructor(e){this.client=new jt(e),this.ctx=e}async fetchConfig(){this.appType=this.ctx.GUI_VERSION?Mt.GUI:Mt.CLI;const e=Date.now();try{const t=await this.client.request({method:"GET",url:"/api/config",params:{appType:this.appType}});return t?.config&&""!==t.config.trim()?(this.ctx.log.debug(`[ConfigService] Config fetched successfully in ${Date.now()-e} ms, version: ${t.version}`),t):null}catch(t){if(this.ctx.log.debug(`[ConfigService] Failed to fetch config in ${Date.now()-e} ms`),d.isAxiosError(t)){const e=Yt(t),i=Vt(t);if(404===e||i===Bt.ConfigNotFound)return null;const n=qt(t);throw this.ctx.log.warn("[ConfigService] Failed to fetch config:",n),Kt(n,t)}throw t}}async updateConfig(e,t,i){this.appType=this.ctx.GUI_VERSION?Mt.GUI:Mt.CLI;const n=Date.now();try{const r=await this.client.request({method:"PUT",url:"/api/config",data:{appType:this.appType,config:e,baseVersion:t,historyLimit:10,...i??{}}});return this.ctx.log.debug(`[ConfigService] Config updated successfully in ${Date.now()-n} ms, new version: ${r.version}`),{success:!0,version:r.version}}catch(e){if(this.ctx.log.debug(`[ConfigService] Failed to update config in ${Date.now()-n} ms`),d.isAxiosError(e)){const i=e.response?.data;if(Vt(e)===Bt.ConfigConflict)return{success:!1,conflict:!0,version:"number"==typeof i?.currentVersion?i.currentVersion:t};const n=qt(e);throw this.ctx.log.warn("[ConfigService] Failed to update config:",n),Kt(n,e)}throw e}}}const Qt=(e,t)=>!(!e||"object"!=typeof e)&&Object.prototype.hasOwnProperty.call(e,t),zt=e=>{const t=Object.getPrototypeOf(e),i=Object.create(t);for(const t of Object.getOwnPropertySymbols(e)){const n=Object.getOwnPropertyDescriptor(e,t);n&&Object.defineProperty(i,t,n)}return i},Jt=(e,t)=>{const i=zt(e),n=[],r=new Set;for(const t of Object.keys(e))r.has(t)||(n.push(t),r.add(t));for(const e of Object.keys(t))r.has(e)||(n.push(e),r.add(e));for(const r of n){if(!Qt(t,r)){delete i[r];continue}const n=Qt(e,r)?e[r]:void 0,s=t[r];u.isPlainObject(n)&&u.isPlainObject(s)?i[r]=Jt(n,s):i[r]=s}return i},Xt=(e,t)=>u.isEqual(e,t)?exports.ConflictType.CLEAN:void 0===e&&void 0!==t?exports.ConflictType.ADDED:void 0!==e&&void 0===t?exports.ConflictType.DELETED:exports.ConflictType.MODIFIED;class Zt{static merge3Way(e,t,i,n="root"){if(u.isEqual(t,i)){const r=Xt(e,t);return{value:t,conflict:!1,diffNode:r===exports.ConflictType.CLEAN?void 0:{key:n,status:r,snapshotValue:e,localValue:t,remoteValue:i}}}const r=u.isPlainObject(t),s=u.isPlainObject(i),o=u.isPlainObject(e);if(u.isEqual(e,t)){if(r&&s){const r=Jt(t,i),s=Xt(e,r);return{value:r,conflict:!1,diffNode:s===exports.ConflictType.CLEAN?void 0:{key:n,status:s,snapshotValue:e,localValue:t,remoteValue:i}}}const o=Xt(e,i);return{value:i,conflict:!1,diffNode:o===exports.ConflictType.CLEAN?void 0:{key:n,status:o,snapshotValue:e,localValue:t,remoteValue:i}}}if(u.isEqual(e,i)){const r=Xt(e,t);return{value:t,conflict:!1,diffNode:r===exports.ConflictType.CLEAN?void 0:{key:n,status:r,snapshotValue:e,localValue:t,remoteValue:i}}}if(r&&s&&(o||null==e)){const r=o?e:{},s=t,a=i,c=[],l=new Set;for(const e of Object.keys(s))l.has(e)||(c.push(e),l.add(e));for(const e of Object.keys(a))l.has(e)||(c.push(e),l.add(e));for(const e of Object.keys(r))l.has(e)||(c.push(e),l.add(e));const _=zt(s),u=[];let E=!1;for(const e of c){const t=Qt(r,e)?r[e]:void 0,i=Qt(s,e)?s[e]:void 0,n=Qt(a,e)?a[e]:void 0,o=Zt.merge3Way(t,i,n,e);o.conflict&&(E=!0),void 0===o.value?delete _[e]:_[e]=o.value,o.diffNode&&o.diffNode.status!==exports.ConflictType.CLEAN&&u.push(o.diffNode)}const d=E?exports.ConflictType.CONFLICT:Xt(e,_);return{value:_,conflict:E,diffNode:d===exports.ConflictType.CLEAN?void 0:{key:n,status:d,snapshotValue:e,localValue:t,remoteValue:i,children:u.length?u:void 0}}}return{value:t,conflict:!0,diffNode:{key:n,status:exports.ConflictType.CONFLICT,snapshotValue:e,localValue:t,remoteValue:i}}}}class ei extends Error{constructor(e){super(e),this.name=new.target.name}}class ti extends ei{constructor(e="Encrypted config payload is corrupted"){super(e)}}class ii extends ei{constructor(e="Unsupported E2E version"){super(e)}}class ni extends ei{constructor(e="PIN handler is required for E2E operations"){super(e)}}class ri extends ei{constructor(e="Encryption switch confirmation handler is required"){super(e)}}class si extends ei{constructor(e="Invalid PIN input"){super(e)}}class oi extends ei{constructor(e="Maximum retry attempts exceeded"){super(e)}}class ai extends ei{constructor(e="Failed to decrypt payload"){super(e)}}class ci extends ei{value;constructor(e){super("Invalid encryption method"),this.value=e}}const li=12,_i="aes-256-gcm";class ui{generateE2EPayload(e,t){const i=I.randomBytes(16),n=I.randomBytes(32),r=this.wrapDEK(n,t,i),s=this.encryptConfig(e,n);return{payload:{e2eVersion:exports.E2EVersion.V1,clientKekSalt:i.toString("base64"),clientDekEncrypted:r,config:s},dek:n}}encryptConfig(e,t){return this.encryptWithKey(Buffer.from(e,"utf8"),t)}decryptConfig(e,t){return this.decryptWithKey(e,t).toString("utf8")}wrapDEK(e,t,i){const n=this.deriveKEK(t,i);return this.encryptWithKey(e,n)}unwrapDEK(e,t,i){const n=this.deriveKEK(t,i);return this.decryptWithKey(e,n)}decodeSalt(e){const t=Buffer.from(e,"base64");if(16!==t.length)throw new ti("Invalid salt length");return t}deriveKEK(e,t){return I.pbkdf2Sync(e,t,6e5,32,"sha256")}encryptWithKey(e,t){const i=I.randomBytes(li),n=I.createCipheriv(_i,t,i),r=Buffer.concat([n.update(e),n.final()]),s=n.getAuthTag();return Buffer.concat([i,s,r]).toString("base64")}decryptWithKey(e,t){const i=Buffer.from(e,"base64");if(i.length<28)throw new ti("Encrypted payload is too short");const