||!e)return e;for(var t=e.indexOf(`
`)!=-1,r=this._styles,n=r.length;n--;){var s=Yi[r[n]];e=s.open+e.replace(s.closeRe,s.open)+s.close,t&&(e=e.replace(r_,function(o){return s.close+o+s.open}))}return e}ye.setTheme=function(i){if(typeof i=="string"){console.log("colors.setTheme now only accepts an object, not a string.  If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file.  The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in i)(function(t){ye[t]=function(r){if(typeof i[t]=="object"){var n=r;for(var s in i[t])n=ye[i[t][s]](n);return n}return ye[i[t]](r)}})(e)};function l_(){var i={};return Object.keys(Jf).forEach(function(e){i[e]={get:function(){return zf([e])}}}),i}var c_=function(e,t){var r=t.split("");return r=r.map(e),r.join("")};ye.trap=Mf();ye.zalgo=Ff();ye.maps={};ye.maps.america=jf()(ye);ye.maps.zebra=$f()(ye);ye.maps.rainbow=Hf()(ye);ye.maps.random=Wf()(ye);for(Yf in ye.maps)(function(i){ye[i]=function(e){return c_(ye.maps[i],e)}})(Yf);var Yf;Kf(ye,l_())});var eh=w((UI,Xf)=>{var u_=Qf();Xf.exports=u_});var ih=w(($I,th)=>{var _r=1e3,wr=_r*60,xr=wr*60,Ki=xr*24,f_=Ki*7,h_=Ki*365.25;th.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return p_(i);if(t==="number"&&isFinite(i))return e.long?m_(i):d_(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function p_(i){if(i=String(i),!(i.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*h_;case"weeks":case"week":case"w":return t*f_;case"days":case"day":case"d":return t*Ki;case"hours":case"hour":case"hrs":case"hr":case"h":return t*xr;case"minutes":case"minute":case"mins":case"min":case"m":return t*wr;case"seconds":case"second":case"secs":case"sec":case"s":return t*_r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function d_(i){var e=Math.abs(i);return e>=Ki?Math.round(i/Ki)+"d":e>=xr?Math.round(i/xr)+"h":e>=wr?Math.round(i/wr)+"m":e>=_r?Math.round(i/_r)+"s":i+"ms"}function m_(i){var e=Math.abs(i);return e>=Ki?vs(i,e,Ki,"day"):e>=xr?vs(i,e,xr,"hour"):e>=wr?vs(i,e,wr,"minute"):e>=_r?vs(i,e,_r,"second"):i+" ms"}function vs(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var Aa=w((VI,rh)=>{function g_(i){t.debug=t,t.default=t,t.coerce=l,t.disable=s,t.enable=n,t.enabled=o,t.humanize=ih(),t.destroy=c,Object.keys(i).forEach(u=>{t[u]=i[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let d=0;d<u.length;d++)f=(f<<5)-f+u.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,d=null,m,g;function y(...b){if(!y.enabled)return;let x=y,S=Number(new Date),k=S-(f||S);x.diff=k,x.prev=f,x.curr=S,f=S,b[0]=t.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let O=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(R,T)=>{if(R==="%%")return"%";O++;let A=t.formatters[T];if(typeof A=="function"){let C=b[O];R=A.call(x,C),b.splice(O,1),O--}return R}),t.formatArgs.call(x,b),(x.log||t.log).apply(x,b)}return y.namespace=u,y.useColors=t.useColors(),y.color=t.selectColor(u),y.extend=r,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(m!==t.namespaces&&(m=t.namespaces,g=t.enabled(u)),g),set:b=>{d=b}}),typeof t.init=="function"&&t.init(y),y}function r(u,f){let d=t(this.namespace+(typeof f=="undefined"?":":f)+u);return d.log=this.log,d}function n(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f,d=(typeof u=="string"?u:"").split(/[\s,]+/),m=d.length;for(f=0;f<m;f++)d[f]&&(u=d[f].replace(/\*/g,".*?"),u[0]==="-"?t.skips.push(new RegExp("^"+u.slice(1)+"$")):t.names.push(new RegExp("^"+u+"$")))}function s(){let u=[...t.names.map(a),...t.skips.map(a).map(f=>"-"+f)].join(",");return t.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let f,d;for(f=0,d=t.skips.length;f<d;f++)if(t.skips[f].test(u))return!1;for(f=0,d=t.names.length;f<d;f++)if(t.names[f].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}rh.exports=g_});var nh=w((xt,ys)=>{xt.formatArgs=y_;xt.save=b_;xt.load=__;xt.useColors=v_;xt.storage=w_();xt.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function v_(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function y_(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+ys.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,r=0;i[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(r=t))}),i.splice(r,0,e)}xt.log=console.debug||console.log||(()=>{});function b_(i){try{i?xt.storage.setItem("debug",i):xt.storage.removeItem("debug")}catch{}}function __(){let i;try{i=xt.storage.getItem("debug")}catch{}return!i&&typeof process!="undefined"&&"env"in process&&(i=process.env.DEBUG),i}function w_(){try{return localStorage}catch{}}ys.exports=Aa()(xt);var{formatters:x_}=ys.exports;x_.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var oh=w((HI,sh)=>{"use strict";sh.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}});var ch=w((GI,lh)=>{"use strict";var S_=require("os"),ah=require("tty"),At=oh(),{env:Ke}=process,bs;At("no-color")||At("no-colors")||At("color=false")||At("color=never")?bs=0:(At("color")||At("colors")||At("color=true")||At("color=always"))&&(bs=1);function E_(){if("FORCE_COLOR"in Ke)return Ke.FORCE_COLOR==="true"?1:Ke.FORCE_COLOR==="false"?0:Ke.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ke.FORCE_COLOR,10),3)}function O_(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function k_(i,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=E_();r!==void 0&&(bs=r);let n=t?bs:r;if(n===0)return 0;if(t){if(At("color=16m")||At("color=full")||At("color=truecolor"))return 3;if(At("color=256"))return 2}if(i&&!e&&n===void 0)return 0;let s=n||0;if(Ke.TERM==="dumb")return s;if(process.platform==="win32"){let o=S_.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Ke)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in Ke)||Ke.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ke)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ke.TEAMCITY_VERSION)?1:0;if(Ke.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ke){let o=Number.parseInt((Ke.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ke.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ke.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ke.TERM)||"COLORTERM"in Ke?1:s}function Ia(i,e={}){let t=k_(i,{streamIsTTY:i&&i.isTTY,...e});return O_(t)}lh.exports={supportsColor:Ia,stdout:Ia({isTTY:ah.isatty(1)}),stderr:Ia({isTTY:ah.isatty(2)})}});var fh=w((Xe,ws)=>{var C_=require("tty"),_s=require("util");Xe.init=R_;Xe.log=N_;Xe.formatArgs=A_;Xe.save=B_;Xe.load=L_;Xe.useColors=T_;Xe.destroy=_s.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Xe.colors=[6,2,3,4,5,1];try{let i=ch();i&&(i.stderr||i).level>=2&&(Xe.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Xe.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),i[t]=r,i},{});function T_(){return"colors"in Xe.inspectOpts?!!Xe.inspectOpts.colors:C_.isatty(process.stderr.fd)}function A_(i){let{namespace:e,useColors:t}=this;if(t){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),s=`  ${n};1m${e} \x1B[0m`;i[0]=s+i[0].split(`
`).join(`
`+s),i.push(n+"m+"+ws.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=I_()+e+" "+i[0]}function I_(){return Xe.inspectOpts.hideDate?"":new Date().toISOString()+" "}function N_(...i){return process.stderr.write(_s.format(...i)+`
`)}function B_(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function L_(){return process.env.DEBUG}function R_(i){i.inspectOpts={};let e=Object.keys(Xe.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=Xe.inspectOpts[e[t]]}ws.exports=Aa()(Xe);var{formatters:uh}=ws.exports;uh.o=function(i){return this.inspectOpts.colors=this.useColors,_s.inspect(i,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};uh.O=function(i){return this.inspectOpts.colors=this.useColors,_s.inspect(i,this.inspectOpts)}});var nn=w((WI,Na)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?Na.exports=nh():Na.exports=fh()});var gh=w((YI,mh)=>{var{hasOwnProperty:Ba}=Object.prototype,La=(i,e={})=>{typeof e=="string"&&(e={section:e}),e.align=e.align===!0,e.newline=e.newline===!0,e.sort=e.sort===!0,e.whitespace=e.whitespace===!0||e.align===!0,e.platform=e.platform||typeof process!="undefined"&&process.platform,e.bracketedArray=e.bracketedArray!==!1;let t=e.platform==="win32"?`\r
`:`
`,r=e.whitespace?" = ":"=",n=[],s=e.sort?Object.keys(i).sort():Object.keys(i),o=0;e.align&&(o=ai(s.filter(c=>i[c]===null||Array.isArray(i[c])||typeof i[c]!="object").map(c=>Array.isArray(i[c])?`${c}[]`:c).concat([""]).reduce((c,u)=>ai(c).length>=ai(u).length?c:u)).length);let a="",l=e.bracketedArray?"[]":"";for(let c of s){let u=i[c];if(u&&Array.isArray(u))for(let f of u)a+=ai(`${c}${l}`).padEnd(o," ")+r+ai(f)+t;else u&&typeof u=="object"?n.push(c):a+=ai(c).padEnd(o," ")+r+ai(u)+t}e.section&&a.length&&(a="["+ai(e.section)+"]"+(e.newline?t+t:t)+a);for(let c of n){let u=ph(c,".").join("\\."),f=(e.section?e.section+".":"")+u,d=La(i[c],{...e,section:f});a.length&&d.length&&(a+=t),a+=d}return a};function ph(i,e){var t=0,r=0,n=0,s=[];do if(n=i.indexOf(e,t),n!==-1){if(t=n+e.length,n>0&&i[n-1]==="\\")continue;s.push(i.slice(r,n)),r=n+e.length}while(n!==-1);return s.push(i.slice(r)),s}var hh=(i,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),r=t,n=null,s=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,o=i.split(/[\r\n]+/g),a={};for(let c of o){if(!c||c.match(/^\s*[;#]/)||c.match(/^\s*$/))continue;let u=c.match(s);if(!u)continue;if(u[1]!==void 0){if(n=xs(u[1]),n==="__proto__"){r=Object.create(null);continue}r=t[n]=t[n]||Object.create(null);continue}let f=xs(u[2]),d;e.bracketedArray?d=f.length>2&&f.slice(-2)==="[]":(a[f]=((a==null?void 0:a[f])||0)+1,d=a[f]>1);let m=d&&f.endsWith("[]")?f.slice(0,-2):f;if(m==="__proto__")continue;let g=u[3]?xs(u[4]):!0,y=g==="true"||g==="false"||g==="null"?JSON.parse(g):g;d&&(Ba.call(r,m)?Array.isArray(r[m])||(r[m]=[r[m]]):r[m]=[]),Array.isArray(r[m])?r[m].push(y):r[m]=y}let l=[];for(let c of Object.keys(t)){if(!Ba.call(t,c)||typeof t[c]!="object"||Array.isArray(t[c]))continue;let u=ph(c,".");r=t;let f=u.pop(),d=f.replace(/\\\./g,".");for(let m of u)m!=="__proto__"&&((!Ba.call(r,m)||typeof r[m]!="object")&&(r[m]=Object.create(null)),r=r[m]);r===t&&d===f||(r[d]=t[c],l.push(c))}for(let c of l)delete t[c];return t},dh=i=>i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"),ai=i=>typeof i!="string"||i.match(/[=\r\n]/)||i.match(/^\[/)||i.length>1&&dh(i)||i!==i.trim()?JSON.stringify(i):i.split(";").join("\\;").split("#").join("\\#"),xs=i=>{if(i=(i||"").trim(),dh(i)){i.charAt(0)==="'"&&(i=i.slice(1,-1));try{i=JSON.parse(i)}catch{}}else{let e=!1,t="";for(let r=0,n=i.length;r<n;r++){let s=i.charAt(r);if(e)"\\;#".indexOf(s)!==-1?t+=s:t+="\\"+s,e=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?e=!0:t+=s}}return e&&(t+="\\"),t.trim()}return i};mh.exports={parse:hh,decode:hh,stringify:La,encode:La,safe:ai,unsafe:xs}});var Uh=w((KI,gw)=>{gw.exports={name:"dotenv",version:"16.4.5",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec","test:coverage":"tap --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Gh=w((zI,ci)=>{var Va=require("fs"),Ha=require("path"),vw=require("os"),yw=require("crypto"),bw=Uh(),Ga=bw.version,_w=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ww(i){let e={},t=i.toString();t=t.replace(/\r\n?/mg,`
`);let r;for(;(r=_w.exec(t))!=null;){let n=r[1],s=r[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
`),s=s.replace(/\\r/g,"\r")),e[n]=s}return e}function xw(i){let e=Hh(i),t=Ve.configDotenv({path:e});if(!t.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=Vh(i).split(","),n=r.length,s;for(let o=0;o<n;o++)try{let a=r[o].trim(),l=Ow(t,a);s=Ve.decrypt(l.ciphertext,l.key);break}catch(a){if(o+1>=n)throw a}return Ve.parse(s)}function Sw(i){console.log(`[dotenv@${Ga}][INFO] ${i}`)}function Ew(i){console.log(`[dotenv@${Ga}][WARN] ${i}`)}function Ns(i){console.log(`[dotenv@${Ga}][DEBUG] ${i}`)}function Vh(i){return i&&i.DOTENV_KEY&&i.DOTENV_KEY.length>0?i.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Ow(i,e){let t;try{t=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let r=t.password;if(!r){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let n=t.searchParams.get("environment");if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let s=`DOTENV_VAULT_${n.toUpperCase()}`,o=i.parsed[s];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:r}}function Hh(i){let e=null;if(i&&i.path&&i.path.length>0)if(Array.isArray(i.path))for(let t of i.path)Va.existsSync(t)&&(e=t.endsWith(".vault")?t:`${t}.vault`);else e=i.path.endsWith(".vault")?i.path:`${i.path}.vault`;else e=Ha.resolve(process.cwd(),".env.vault");return Va.existsSync(e)?e:null}function $h(i){return i[0]==="~"?Ha.join(vw.homedir(),i.slice(1)):i}function kw(i){Sw("Loading env from encrypted .env.vault");let e=Ve._parseVault(i),t=process.env;return i&&i.processEnv!=null&&(t=i.processEnv),Ve.populate(t,e,i),{parsed:e}}function Cw(i){let e=Ha.resolve(process.cwd(),".env"),t="utf8",r=!!(i&&i.debug);i&&i.encoding?t=i.encoding:r&&Ns("No encoding is specified. UTF-8 is used by default");let n=[e];if(i&&i.path)if(!Array.isArray(i.path))n=[$h(i.path)];else{n=[];for(let l of i.path)n.push($h(l))}let s,o={};for(let l of n)try{let c=Ve.parse(Va.readFileSync(l,{encoding:t}));Ve.populate(o,c,i)}catch(c){r&&Ns(`Failed to load ${l} ${c.message}`),s=c}let a=process.env;return i&&i.processEnv!=null&&(a=i.processEnv),Ve.populate(a,o,i),s?{parsed:o,error:s}:{parsed:o}}function Tw(i){if(Vh(i).length===0)return Ve.configDotenv(i);let e=Hh(i);return e?Ve._configVault(i):(Ew(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),Ve.configDotenv(i))}function Aw(i,e){let t=Buffer.from(e.slice(-64),"hex"),r=Buffer.from(i,"base64"),n=r.subarray(0,12),s=r.subarray(-16);r=r.subarray(12,-16);try{let o=yw.createDecipheriv("aes-256-gcm",t,n);return o.setAuthTag(s),`${o.update(r)}${o.final()}`}catch(o){let a=o instanceof RangeError,l=o.message==="Invalid key length",c=o.message==="Unsupported state or unable to authenticate data";if(a||l){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(c){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw o}}function Iw(i,e,t={}){let r=!!(t&&t.debug),n=!!(t&&t.override);if(typeof e!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(e))Object.prototype.hasOwnProperty.call(i,s)?(n===!0&&(i[s]=e[s]),r&&Ns(n===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):i[s]=e[s]}var Ve={configDotenv:Cw,_configVault:kw,_parseVault:xw,config:Tw,decrypt:Aw,parse:ww,populate:Iw};ci.exports.configDotenv=Ve.configDotenv;ci.exports._configVault=Ve._configVault;ci.exports._parseVault=Ve._parseVault;ci.exports.config=Ve.config;ci.exports.decrypt=Ve.decrypt;ci.exports.parse=Ve.parse;ci.exports.populate=Ve.populate;ci.exports=Ve});var Yh=w(Wh=>{"use strict";var Nw=require("url").parse,Bw={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},Lw=String.prototype.endsWith||function(i){return i.length<=this.length&&this.indexOf(i,this.length-i.length)!==-1};function Rw(i){var e=typeof i=="string"?Nw(i):i||{},t=e.protocol,r=e.host,n=e.port;if(typeof r!="string"||!r||typeof t!="string"||(t=t.split(":",1)[0],r=r.replace(/:\d*$/,""),n=parseInt(n)||Bw[t]||0,!Pw(r,n)))return"";var s=Er("npm_config_"+t+"_proxy")||Er(t+"_proxy")||Er("npm_config_proxy")||Er("all_proxy");return s&&s.indexOf("://")===-1&&(s=t+"://"+s),s}function Pw(i,e){var t=(Er("npm_config_no_proxy")||Er("no_proxy")).toLowerCase();return t?t==="*"?!1:t.split(/[,\s]/).every(function(r){if(!r)return!0;var n=r.match(/^(.+):(\d+)$/),s=n?n[1]:r,o=n?parseInt(n[2]):0;return o&&o!==e?!0:/^[.*]/.test(s)?(s.charAt(0)==="*"&&(s=s.slice(1)),!Lw.call(i,s)):i!==s}):!0}function Er(i){return process.env[i.toLowerCase()]||process.env[i.toUpperCase()]||""}Wh.getProxyForUrl=Rw});var Jh=w(mt=>{"use strict";var Mw=mt&&mt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),qw=mt&&mt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Kh=mt&&mt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Mw(e,i,t);return qw(e,i),e};Object.defineProperty(mt,"__esModule",{value:!0});mt.req=mt.json=mt.toBuffer=void 0;var Fw=Kh(require("http")),Dw=Kh(require("https"));async function zh(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}mt.toBuffer=zh;async function jw(i){let t=(await zh(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let n=r;throw n.message+=` (input: ${t})`,n}}mt.json=jw;function Uw(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?Dw:Fw).request(i,e),n=new Promise((s,o)=>{r.once("response",s).once("error",o).end()});return r.then=n.then.bind(n),r}mt.req=Uw});var Ya=w(St=>{"use strict";var Qh=St&&St.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),$w=St&&St.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Xh=St&&St.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Qh(e,i,t);return $w(e,i),e},Vw=St&&St.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Qh(e,i,t)};Object.defineProperty(St,"__esModule",{value:!0});St.Agent=void 0;var Hw=Xh(require("net")),Zh=Xh(require("http")),Gw=require("https");Vw(Jh(),St);var Kt=Symbol("AgentBaseInternalState"),Wa=class extends Zh.Agent{constructor(e){super(e),this[Kt]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new Hw.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],n=r.indexOf(t);n!==-1&&(r.splice(n,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?Gw.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let n={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(n),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,n)).then(a=>{if(this.decrementSockets(s,o),a instanceof Zh.Agent)try{return a.addRequest(e,n)}catch(l){return r(l)}this[Kt].currentSocket=a,super.createSocket(e,t,r)},a=>{this.decrementSockets(s,o),r(a)})}createConnection(){let e=this[Kt].currentSocket;if(this[Kt].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){var e;return(e=this[Kt].defaultPort)!=null?e:this.protocol==="https:"?443:80}set defaultPort(e){this[Kt]&&(this[Kt].defaultPort=e)}get protocol(){var e;return(e=this[Kt].protocol)!=null?e:this.isSecureEndpoint()?"https:":"http:"}set protocol(e){this[Kt]&&(this[Kt].protocol=e)}};St.Agent=Wa});var ep=w(Or=>{"use strict";var Ww=Or&&Or.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Or,"__esModule",{value:!0});Or.parseProxyResponse=void 0;var Yw=Ww(nn()),Bs=(0,Yw.default)("https-proxy-agent:parse-proxy-response");function Kw(i){return new Promise((e,t)=>{let r=0,n=[];function s(){let u=i.read();u?c(u):i.once("readable",s)}function o(){i.removeListener("end",a),i.removeListener("error",l),i.removeListener("readable",s)}function a(){o(),Bs("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function l(u){o(),Bs("onerror %o",u),t(u)}function c(u){n.push(u),r+=u.length;let f=Buffer.concat(n,r),d=f.indexOf(`\r
\r
`);if(d===-1){Bs("have not received end of HTTP headers yet..."),s();return}let m=f.slice(0,d).toString("ascii").split(`\r
`),g=m.shift();if(!g)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let y=g.split(" "),b=+y[1],x=y.slice(2).join(" "),S={};for(let k of m){if(!k)continue;let O=k.indexOf(":");if(O===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${k}"`));let E=k.slice(0,O).toLowerCase(),R=k.slice(O+1).trimStart(),T=S[E];typeof T=="string"?S[E]=[T,R]:Array.isArray(T)?T.push(R):S[E]=R}Bs("got proxy server response: %o %o",g,S),o(),e({connect:{statusCode:b,statusText:x,headers:S},buffered:f})}i.on("error",l),i.on("end",a),s()})}Or.parseProxyResponse=Kw});var op=w(Nt=>{"use strict";var zw=Nt&&Nt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Jw=Nt&&Nt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),np=Nt&&Nt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&zw(e,i,t);return Jw(e,i),e},sp=Nt&&Nt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.HttpsProxyAgent=void 0;var Ls=np(require("net")),tp=np(require("tls")),Zw=sp(require("assert")),Qw=sp(nn()),Xw=Ya(),e1=require("url"),t1=ep(),ln=(0,Qw.default)("https-proxy-agent"),ip=i=>i.servername===void 0&&i.host&&!Ls.isIP(i.host)?{...i,servername:i.host}:i,Rs=class extends Xw.Agent{constructor(e,t){var s;super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new e1.URL(e):e,this.proxyHeaders=(s=t==null?void 0:t.headers)!=null?s:{},ln("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?rp(t,"headers"):null,host:r,port:n}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let n;r.protocol==="https:"?(ln("Creating `tls.Socket`: %o",this.connectOpts),n=tp.connect(ip(this.connectOpts))):(ln("Creating `net.Socket`: %o",this.connectOpts),n=Ls.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=Ls.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
`;if(r.username||r.password){let d=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(s))a+=`${d}: ${s[d]}\r
`;let l=(0,t1.parseProxyResponse)(n);n.write(`${a}\r
`);let{connect:c,buffered:u}=await l;if(e.emit("proxyConnect",c),this.emit("proxyConnect",c,e),c.statusCode===200)return e.once("socket",i1),t.secureEndpoint?(ln("Upgrading socket connection to TLS"),tp.connect({...rp(ip(t),"host","path","port"),socket:n})):n;n.destroy();let f=new Ls.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{ln("Replaying proxy buffer for failed request"),(0,Zw.default)(d.listenerCount("data")>0),d.push(u),d.push(null)}),f}};Rs.protocols=["http","https"];Nt.HttpsProxyAgent=Rs;function i1(i){i.resume()}function rp(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}});var cp=w((t2,Ps)=>{var lp=lp||function(i){return Buffer.from(i).toString("base64")};function r1(i){var e=this,t=Math.round,r=Math.floor,n=new Array(64),s=new Array(64),o=new Array(64),a=new Array(64),l,c,u,f,d=new Array(65535),m=new Array(65535),g=new Array(64),y=new Array(64),b=[],x=0,S=7,k=new Array(64),O=new Array(64),E=new Array(64),R=new Array(256),T=new Array(2048),A,C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],B=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],P=[0,1,2,3,4,5,6,7,8,9,10,11],U=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],F=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],H=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],j=[0,1,2,3,4,5,6,7,8,9,10,11],V=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],Y=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Q(I){for(var Z=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],te=0;te<64;te++){var ee=r((Z[te]*I+50)/100);ee<1?ee=1:ee>255&&(ee=255),n[C[te]]=ee}for(var le=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ce=0;ce<64;ce++){var _e=r((le[ce]*I+50)/100);_e<1?_e=1:_e>255&&(_e=255),s[C[ce]]=_e}for(var we=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Re=0,Ae=0;Ae<8;Ae++)for(var D=0;D<8;D++)o[Re]=1/(n[C[Re]]*we[Ae]*we[D]*8),a[Re]=1/(s[C[Re]]*we[Ae]*we[D]*8),Re++}function W(I,Z){for(var te=0,ee=0,le=new Array,ce=1;ce<=16;ce++){for(var _e=1;_e<=I[ce];_e++)le[Z[ee]]=[],le[Z[ee]][0]=te,le[Z[ee]][1]=ce,ee++,te++;te*=2}return le}function de(){l=W(B,P),c=W(H,j),u=W(U,F),f=W(V,Y)}function ae(){for(var I=1,Z=2,te=1;te<=15;te++){for(var ee=I;ee<Z;ee++)m[32767+ee]=te,d[32767+ee]=[],d[32767+ee][1]=te,d[32767+ee][0]=ee;for(var le=-(Z-1);le<=-I;le++)m[32767+le]=te,d[32767+le]=[],d[32767+le][1]=te,d[32767+le][0]=Z-1+le;I<<=1,Z<<=1}}function ne(){for(var I=0;I<256;I++)T[I]=19595*I,T[I+256>>0]=38470*I,T[I+512>>0]=7471*I+32768,T[I+768>>0]=-11059*I,T[I+1024>>0]=-21709*I,T[I+1280>>0]=32768*I+8421375,T[I+1536>>0]=-27439*I,T[I+1792>>0]=-5329*I}function ue(I){for(var Z=I[0],te=I[1]-1;te>=0;)Z&1<<te&&(x|=1<<S),te--,S--,S<0&&(x==255?(N(255),N(0)):N(x),S=7,x=0)}function N(I){b.push(I)}function X(I){N(I>>8&255),N(I&255)}function ke(I,Z){var te,ee,le,ce,_e,we,Re,Ae,D=0,J,se=8,Ne=64;for(J=0;J<se;++J){te=I[D],ee=I[D+1],le=I[D+2],ce=I[D+3],_e=I[D+4],we=I[D+5],Re=I[D+6],Ae=I[D+7];var oe=te+Ae,me=te-Ae,Ee=ee+Re,ie=ee-Re,xe=le+we,$e=le-we,Ie=ce+_e,pt=ce-_e,Ct=oe+Ie,ni=oe-Ie,yi=Ee+xe,bi=Ee-xe;I[D]=Ct+yi,I[D+4]=Ct-yi;var Di=(bi+ni)*.707106781;I[D+2]=ni+Di,I[D+6]=ni-Di,Ct=pt+$e,yi=$e+ie,bi=ie+me;var ji=(Ct-bi)*.382683433,gr=.5411961*Ct+ji,Ui=1.306562965*bi+ji,$i=yi*.707106781,Vi=me+$i,Hi=me-$i;I[D+5]=Hi+gr,I[D+3]=Hi-gr,I[D+1]=Vi+Ui,I[D+7]=Vi-Ui,D+=8}for(D=0,J=0;J<se;++J){te=I[D],ee=I[D+8],le=I[D+16],ce=I[D+24],_e=I[D+32],we=I[D+40],Re=I[D+48],Ae=I[D+56];var ts=te+Ae,rn=te-Ae,is=ee+Re,rs=ee-Re,ns=le+we,ss=le-we,os=ce+_e,Sa=ce-_e,Gi=ts+os,si=ts-os,Wi=is+ns,vr=is-ns;I[D]=Gi+Wi,I[D+32]=Gi-Wi;var as=(vr+si)*.707106781;I[D+16]=si+as,I[D+48]=si-as,Gi=Sa+ss,Wi=ss+rs,vr=rs+rn;var ls=(Gi-vr)*.382683433,cs=.5411961*Gi+ls,us=1.306562965*vr+ls,Yt=Wi*.707106781,fs=rn+Yt,hs=rn-Yt;I[D+40]=hs+cs,I[D+24]=hs-cs,I[D+8]=fs+us,I[D+56]=fs-us,D++}var yr;for(J=0;J<Ne;++J)yr=I[J]*Z[J],g[J]=yr>0?yr+.5|0:yr-.5|0;return g}function be(){X(65504),X(16),N(74),N(70),N(73),N(70),N(0),N(1),N(1),N(0),X(1),X(1),N(0),N(0)}function ge(I){if(I){X(65505),I[0]===69&&I[1]===120&&I[2]===105&&I[3]===102?X(I.length+2):(X(I.length+5+2),N(69),N(120),N(105),N(102),N(0));for(var Z=0;Z<I.length;Z++)N(I[Z])}}function ve(I,Z){X(65472),X(17),N(8),X(Z),X(I),N(3),N(1),N(17),N(0),N(2),N(17),N(1),N(3),N(17),N(1)}function fe(){X(65499),X(132),N(0);for(var I=0;I<64;I++)N(n[I]);N(1);for(var Z=0;Z<64;Z++)N(s[Z])}function z(){X(65476),X(418),N(0);for(var I=0;I<16;I++)N(B[I+1]);for(var Z=0;Z<=11;Z++)N(P[Z]);N(16);for(var te=0;te<16;te++)N(U[te+1]);for(var ee=0;ee<=161;ee++)N(F[ee]);N(1);for(var le=0;le<16;le++)N(H[le+1]);for(var ce=0;ce<=11;ce++)N(j[ce]);N(17);for(var _e=0;_e<16;_e++)N(V[_e+1]);for(var we=0;we<=161;we++)N(Y[we])}function $(I){typeof I=="undefined"||I.constructor!==Array||I.forEach(Z=>{if(typeof Z=="string"){X(65534);var te=Z.length;X(te+2);var ee;for(ee=0;ee<te;ee++)N(Z.charCodeAt(ee))}})}function Te(){X(65498),X(12),N(3),N(1),N(0),N(2),N(17),N(3),N(17),N(0),N(63),N(0)}function re(I,Z,te,ee,le){for(var ce=le[0],_e=le[240],we,Re=16,Ae=63,D=64,J=ke(I,Z),se=0;se<D;++se)y[C[se]]=J[se];var Ne=y[0]-te;te=y[0],Ne==0?ue(ee[0]):(we=32767+Ne,ue(ee[m[we]]),ue(d[we]));for(var oe=63;oe>0&&y[oe]==0;oe--);if(oe==0)return ue(ce),te;for(var me=1,Ee;me<=oe;){for(var ie=me;y[me]==0&&me<=oe;++me);var xe=me-ie;if(xe>=Re){Ee=xe>>4;for(var $e=1;$e<=Ee;++$e)ue(_e);xe=xe&15}we=32767+y[me],ue(le[(xe<<4)+m[we]]),ue(d[we]),me++}return oe!=Ae&&ue(ce),te}function he(){for(var I=String.fromCharCode,Z=0;Z<256;Z++)R[Z]=I(Z)}this.encode=function(I,Z){var te=new Date().getTime();Z&&ht(Z),b=new Array,x=0,S=7,X(65496),be(),$(I.comments),ge(I.exifBuffer),fe(),ve(I.width,I.height),z(),Te();var ee=0,le=0,ce=0;x=0,S=7,this.encode.displayName="_encode_";for(var _e=I.data,we=I.width,Re=I.height,Ae=we*4,D=we*3,J,se=0,Ne,oe,me,Ee,ie,xe,$e,Ie;se<Re;){for(J=0;J<Ae;){for(Ee=Ae*se+J,ie=Ee,xe=-1,$e=0,Ie=0;Ie<64;Ie++)$e=Ie>>3,xe=(Ie&7)*4,ie=Ee+$e*Ae+xe,se+$e>=Re&&(ie-=Ae*(se+1+$e-Re)),J+xe>=Ae&&(ie-=J+xe-Ae+4),Ne=_e[ie++],oe=_e[ie++],me=_e[ie++],k[Ie]=(T[Ne]+T[oe+256>>0]+T[me+512>>0]>>16)-128,O[Ie]=(T[Ne+768>>0]+T[oe+1024>>0]+T[me+1280>>0]>>16)-128,E[Ie]=(T[Ne+1280>>0]+T[oe+1536>>0]+T[me+1792>>0]>>16)-128;ee=re(k,o,ee,l,u),le=re(O,a,le,c,f),ce=re(E,a,ce,c,f),J+=32}se+=8}if(S>=0){var pt=[];pt[1]=S+1,pt[0]=(1<<S+1)-1,ue(pt)}if(X(65497),typeof Ps=="undefined")return new Uint8Array(b);return Buffer.from(b);var Ct,ni};function ht(I){if(I<=0&&(I=1),I>100&&(I=100),A!=I){var Z=0;I<50?Z=Math.floor(5e3/I):Z=Math.floor(200-I*2),Q(Z),A=I}}function bt(){var I=new Date().getTime();i||(i=50),he(),de(),ae(),ne(),ht(i);var Z=new Date().getTime()-I}bt()}typeof Ps!="undefined"?Ps.exports=ap:typeof window!="undefined"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=ap);function ap(i,e){typeof e=="undefined"&&(e=50);var t=new r1(e),r=t.encode(i,e);return{data:r,width:i.width,height:i.height}}});var fp=w((i2,za)=>{var Ka=(function(){"use strict";var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,r=799,n=3406,s=2276,o=1567,a=3784,l=5793,c=2896;function u(){}function f(S,k){for(var O=0,E=[],R,T,A=16;A>0&&!S[A-1];)A--;E.push({children:[],index:0});var C=E[0],B;for(R=0;R<A;R++){for(T=0;T<S[R];T++){for(C=E.pop(),C.children[C.index]=k[O];C.index>0;){if(E.length===0)throw new Error("Could not recreate Huffman Table");C=E.pop()}for(C.index++,E.push(C);E.length<=R;)E.push(B={children:[],index:0}),C.children[C.index]=B.children,C=B;O++}R+1<A&&(E.push(B={children:[],index:0}),C.children[C.index]=B.children,C=B)}return E[0].children}function d(S,k,O,E,R,T,A,C,B,P){var U=O.precision,F=O.samplesPerLine,H=O.scanLines,j=O.mcusPerLine,V=O.progressive,Y=O.maxH,Q=O.maxV,W=k,de=0,ae=0;function ne(){if(ae>0)return ae--,de>>ae&1;if(de=S[k++],de==255){var D=S[k++];if(D)throw new Error("unexpected marker: "+(de<<8|D).toString(16))}return ae=7,de>>>7}function ue(D){for(var J=D,se;(se=ne())!==null;){if(J=J[se],typeof J=="number")return J;if(typeof J!="object")throw new Error("invalid huffman sequence")}return null}function N(D){for(var J=0;D>0;){var se=ne();if(se===null)return;J=J<<1|se,D--}return J}function X(D){var J=N(D);return J>=1<<D-1?J:J+(-1<<D)+1}function ke(D,J){var se=ue(D.huffmanTableDC),Ne=se===0?0:X(se);J[0]=D.pred+=Ne;for(var oe=1;oe<64;){var me=ue(D.huffmanTableAC),Ee=me&15,ie=me>>4;if(Ee===0){if(ie<15)break;oe+=16;continue}oe+=ie;var xe=e[oe];J[xe]=X(Ee),oe++}}function be(D,J){var se=ue(D.huffmanTableDC),Ne=se===0?0:X(se)<<B;J[0]=D.pred+=Ne}function ge(D,J){J[0]|=ne()<<B}var ve=0;function fe(D,J){if(ve>0){ve--;return}for(var se=T,Ne=A;se<=Ne;){var oe=ue(D.huffmanTableAC),me=oe&15,Ee=oe>>4;if(me===0){if(Ee<15){ve=N(Ee)+(1<<Ee)-1;break}se+=16;continue}se+=Ee;var ie=e[se];J[ie]=X(me)*(1<<B),se++}}var z=0,$;function Te(D,J){for(var se=T,Ne=A,oe=0;se<=Ne;){var me=e[se],Ee=J[me]<0?-1:1;switch(z){case 0:var ie=ue(D.huffmanTableAC),xe=ie&15,oe=ie>>4;if(xe===0)oe<15?(ve=N(oe)+(1<<oe),z=4):(oe=16,z=1);else{if(xe!==1)throw new Error("invalid ACn encoding");$=X(xe),z=oe?2:3}continue;case 1:case 2:J[me]?J[me]+=(ne()<<B)*Ee:(oe--,oe===0&&(z=z==2?3:0));break;case 3:J[me]?J[me]+=(ne()<<B)*Ee:(J[me]=$<<B,z=0);break;case 4:J[me]&&(J[me]+=(ne()<<B)*Ee);break}se++}z===4&&(ve--,ve===0&&(z=0))}function re(D,J,se,Ne,oe){var me=se/j|0,Ee=se%j,ie=me*D.v+Ne,xe=Ee*D.h+oe;D.blocks[ie]===void 0&&P.tolerantDecoding||J(D,D.blocks[ie][xe])}function he(D,J,se){var Ne=se/D.blocksPerLine|0,oe=se%D.blocksPerLine;D.blocks[Ne]===void 0&&P.tolerantDecoding||J(D,D.blocks[Ne][oe])}var ht=E.length,bt,I,Z,te,ee,le;V?T===0?le=C===0?be:ge:le=C===0?fe:Te:le=ke;var ce=0,_e,we;ht==1?we=E[0].blocksPerLine*E[0].blocksPerColumn:we=j*O.mcusPerColumn,R||(R=we);for(var Re,Ae;ce<we;){for(I=0;I<ht;I++)E[I].pred=0;if(ve=0,ht==1)for(bt=E[0],ee=0;ee<R;ee++)he(bt,le,ce),ce++;else for(ee=0;ee<R;ee++){for(I=0;I<ht;I++)for(bt=E[I],Re=bt.h,Ae=bt.v,Z=0;Z<Ae;Z++)for(te=0;te<Re;te++)re(bt,le,ce,Z,te);if(ce++,ce===we)break}if(ce===we)do{if(S[k]===255&&S[k+1]!==0)break;k+=1}while(k<S.length-2);if(ae=0,_e=S[k]<<8|S[k+1],_e<65280)throw new Error("marker was not found");if(_e>=65488&&_e<=65495)k+=2;else break}return k-W}function m(S,k){var O=[],E=k.blocksPerLine,R=k.blocksPerColumn,T=E<<3,A=new Int32Array(64),C=new Uint8Array(64);function B(W,de,ae){var ne=k.quantizationTable,ue,N,X,ke,be,ge,ve,fe,z,$=ae,Te;for(Te=0;Te<64;Te++)$[Te]=W[Te]*ne[Te];for(Te=0;Te<8;++Te){var re=8*Te;if($[1+re]==0&&$[2+re]==0&&$[3+re]==0&&$[4+re]==0&&$[5+re]==0&&$[6+re]==0&&$[7+re]==0){z=l*$[0+re]+512>>10,$[0+re]=z,$[1+re]=z,$[2+re]=z,$[3+re]=z,$[4+re]=z,$[5+re]=z,$[6+re]=z,$[7+re]=z;continue}ue=l*$[0+re]+128>>8,N=l*$[4+re]+128>>8,X=$[2+re],ke=$[6+re],be=c*($[1+re]-$[7+re])+128>>8,fe=c*($[1+re]+$[7+re])+128>>8,ge=$[3+re]<<4,ve=$[5+re]<<4,z=ue-N+1>>1,ue=ue+N+1>>1,N=z,z=X*a+ke*o+128>>8,X=X*o-ke*a+128>>8,ke=z,z=be-ve+1>>1,be=be+ve+1>>1,ve=z,z=fe+ge+1>>1,ge=fe-ge+1>>1,fe=z,z=ue-ke+1>>1,ue=ue+ke+1>>1,ke=z,z=N-X+1>>1,N=N+X+1>>1,X=z,z=be*s+fe*n+2048>>12,be=be*n-fe*s+2048>>12,fe=z,z=ge*r+ve*t+2048>>12,ge=ge*t-ve*r+2048>>12,ve=z,$[0+re]=ue+fe,$[7+re]=ue-fe,$[1+re]=N+ve,$[6+re]=N-ve,$[2+re]=X+ge,$[5+re]=X-ge,$[3+re]=ke+be,$[4+re]=ke-be}for(Te=0;Te<8;++Te){var he=Te;if($[8+he]==0&&$[16+he]==0&&$[24+he]==0&&$[32+he]==0&&$[40+he]==0&&$[48+he]==0&&$[56+he]==0){z=l*ae[Te+0]+8192>>14,$[0+he]=z,$[8+he]=z,$[16+he]=z,$[24+he]=z,$[32+he]=z,$[40+he]=z,$[48+he]=z,$[56+he]=z;continue}ue=l*$[0+he]+2048>>12,N=l*$[32+he]+2048>>12,X=$[16+he],ke=$[48+he],be=c*($[8+he]-$[56+he])+2048>>12,fe=c*($[8+he]+$[56+he])+2048>>12,ge=$[24+he],ve=$[40+he],z=ue-N+1>>1,ue=ue+N+1>>1,N=z,z=X*a+ke*o+2048>>12,X=X*o-ke*a+2048>>12,ke=z,z=be-ve+1>>1,be=be+ve+1>>1,ve=z,z=fe+ge+1>>1,ge=fe-ge+1>>1,fe=z,z=ue-ke+1>>1,ue=ue+ke+1>>1,ke=z,z=N-X+1>>1,N=N+X+1>>1,X=z,z=be*s+fe*n+2048>>12,be=be*n-fe*s+2048>>12,fe=z,z=ge*r+ve*t+2048>>12,ge=ge*t-ve*r+2048>>12,ve=z,$[0+he]=ue+fe,$[56+he]=ue-fe,$[8+he]=N+ve,$[48+he]=N-ve,$[16+he]=X+ge,$[40+he]=X-ge,$[24+he]=ke+be,$[32+he]=ke-be}for(Te=0;Te<64;++Te){var ht=128+($[Te]+8>>4);de[Te]=ht<0?0:ht>255?255:ht}}x(T*R*8);for(var P,U,F=0;F<R;F++){var H=F<<3;for(P=0;P<8;P++)O.push(new Uint8Array(T));for(var j=0;j<E;j++){B(k.blocks[F][j],C,A);var V=0,Y=j<<3;for(U=0;U<8;U++){var Q=O[H+U];for(P=0;P<8;P++)Q[Y+P]=C[V++]}}}return O}function g(S){return S<0?0:S>255?255:S}u.prototype={load:function(k){var O=new XMLHttpRequest;O.open("GET",k,!0),O.responseType="arraybuffer",O.onload=(function(){var E=new Uint8Array(O.response||O.mozResponseArrayBuffer);this.parse(E),this.onload&&this.onload()}).bind(this),O.send(null)},parse:function(k){var O=this.opts.maxResolutionInMP*1e3*1e3,E=0,R=k.length;function T(){var ie=k[E]<<8|k[E+1];return E+=2,ie}function A(){var ie=T(),xe=k.subarray(E,E+ie-2);return E+=xe.length,xe}function C(ie){var xe=1,$e=1,Ie,pt;for(pt in ie.components)ie.components.hasOwnProperty(pt)&&(Ie=ie.components[pt],xe<Ie.h&&(xe=Ie.h),$e<Ie.v&&($e=Ie.v));var Ct=Math.ceil(ie.samplesPerLine/8/xe),ni=Math.ceil(ie.scanLines/8/$e);for(pt in ie.components)if(ie.components.hasOwnProperty(pt)){Ie=ie.components[pt];var yi=Math.ceil(Math.ceil(ie.samplesPerLine/8)*Ie.h/xe),bi=Math.ceil(Math.ceil(ie.scanLines/8)*Ie.v/$e),Di=Ct*Ie.h,ji=ni*Ie.v,gr=ji*Di,Ui=[];x(gr*256);for(var $i=0;$i<ji;$i++){for(var Vi=[],Hi=0;Hi<Di;Hi++)Vi.push(new Int32Array(64));Ui.push(Vi)}Ie.blocksPerLine=yi,Ie.blocksPerColumn=bi,Ie.blocks=Ui}ie.maxH=xe,ie.maxV=$e,ie.mcusPerLine=Ct,ie.mcusPerColumn=ni}var B=null,P=null,U=null,F,H,j=[],V=[],Y=[],Q=[],W=T(),de=-1;if(this.comments=[],W!=65496)throw new Error("SOI not found");for(W=T();W!=65497;){var ae,ne,ue;switch(W){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var N=A();if(W===65534){var X=String.fromCharCode.apply(null,N);this.comments.push(X)}W===65504&&N[0]===74&&N[1]===70&&N[2]===73&&N[3]===70&&N[4]===0&&(B={version:{major:N[5],minor:N[6]},densityUnits:N[7],xDensity:N[8]<<8|N[9],yDensity:N[10]<<8|N[11],thumbWidth:N[12],thumbHeight:N[13],thumbData:N.subarray(14,14+3*N[12]*N[13])}),W===65505&&N[0]===69&&N[1]===120&&N[2]===105&&N[3]===102&&N[4]===0&&(this.exifBuffer=N.subarray(5,N.length)),W===65518&&N[0]===65&&N[1]===100&&N[2]===111&&N[3]===98&&N[4]===101&&N[5]===0&&(P={version:N[6],flags0:N[7]<<8|N[8],flags1:N[9]<<8|N[10],transformCode:N[11]});break;case 65499:for(var ke=T(),be=ke+E-2;E<be;){var ge=k[E++];x(256);var ve=new Int32Array(64);if(ge>>4===0)for(ne=0;ne<64;ne++){var fe=e[ne];ve[fe]=k[E++]}else if(ge>>4===1)for(ne=0;ne<64;ne++){var fe=e[ne];ve[fe]=T()}else throw new Error("DQT: invalid table spec");j[ge&15]=ve}break;case 65472:case 65473:case 65474:T(),F={},F.extended=W===65473,F.progressive=W===65474,F.precision=k[E++],F.scanLines=T(),F.samplesPerLine=T(),F.components={},F.componentsOrder=[];var z=F.scanLines*F.samplesPerLine;if(z>O){var $=Math.ceil((z-O)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${$}MP`)}var Te=k[E++],re,he=0,ht=0;for(ae=0;ae<Te;ae++){re=k[E];var bt=k[E+1]>>4,I=k[E+1]&15,Z=k[E+2];if(bt<=0||I<=0)throw new Error("Invalid sampling factor, expected values above 0");F.componentsOrder.push(re),F.components[re]={h:bt,v:I,quantizationIdx:Z},E+=3}C(F),V.push(F);break;case 65476:var te=T();for(ae=2;ae<te;){var ee=k[E++],le=new Uint8Array(16),ce=0;for(ne=0;ne<16;ne++,E++)ce+=le[ne]=k[E];x(16+ce);var _e=new Uint8Array(ce);for(ne=0;ne<ce;ne++,E++)_e[ne]=k[E];ae+=17+ce,(ee>>4===0?Q:Y)[ee&15]=f(le,_e)}break;case 65501:T(),H=T();break;case 65500:T(),T();break;case 65498:var we=T(),Re=k[E++],Ae=[],D;for(ae=0;ae<Re;ae++){D=F.components[k[E++]];var J=k[E++];D.huffmanTableDC=Q[J>>4],D.huffmanTableAC=Y[J&15],Ae.push(D)}var se=k[E++],Ne=k[E++],oe=k[E++],me=d(k,E,F,Ae,H,se,Ne,oe>>4,oe&15,this.opts);E+=me;break;case 65535:k[E]!==255&&E--;break;default:if(k[E-3]==255&&k[E-2]>=192&&k[E-2]<=254){E-=3;break}else if(W===224||W==225){if(de!==-1)throw new Error(`first unknown JPEG marker at offset ${de.toString(16)}, second unknown JPEG marker ${W.toString(16)} at offset ${(E-1).toString(16)}`);de=E-1;let ie=T();if(k[E+ie-2]===255){E+=ie-2;break}}throw new Error("unknown JPEG marker "+W.toString(16))}W=T()}if(V.length!=1)throw new Error("only single frame JPEGs supported");for(var ae=0;ae<V.length;ae++){var Ee=V[ae].components;for(var ne in Ee)Ee[ne].quantizationTable=j[Ee[ne].quantizationIdx],delete Ee[ne].quantizationIdx}this.width=F.samplesPerLine,this.height=F.scanLines,this.jfif=B,this.adobe=P,this.components=[];for(var ae=0;ae<F.componentsOrder.length;ae++){var D=F.components[F.componentsOrder[ae]];this.components.push({lines:m(F,D),scaleX:D.h/F.maxH,scaleY:D.v/F.maxV})}},getData:function(k,O){var E=this.width/k,R=this.height/O,T,A,C,B,P,U,F,H,j,V,Y=0,Q,W,de,ae,ne,ue,N,X,ke,be,ge,ve=k*O*this.components.length;x(ve);var fe=new Uint8Array(ve);switch(this.components.length){case 1:for(T=this.components[0],V=0;V<O;V++)for(P=T.lines[0|V*T.scaleY*R],j=0;j<k;j++)Q=P[0|j*T.scaleX*E],fe[Y++]=Q;break;case 2:for(T=this.components[0],A=this.components[1],V=0;V<O;V++)for(P=T.lines[0|V*T.scaleY*R],U=A.lines[0|V*A.scaleY*R],j=0;j<k;j++)Q=P[0|j*T.scaleX*E],fe[Y++]=Q,Q=U[0|j*A.scaleX*E],fe[Y++]=Q;break;case 3:for(ge=!0,this.adobe&&this.adobe.transformCode?ge=!0:typeof this.opts.colorTransform!="undefined"&&(ge=!!this.opts.colorTransform),T=this.components[0],A=this.components[1],C=this.components[2],V=0;V<O;V++)for(P=T.lines[0|V*T.scaleY*R],U=A.lines[0|V*A.scaleY*R],F=C.lines[0|V*C.scaleY*R],j=0;j<k;j++)ge?(Q=P[0|j*T.scaleX*E],W=U[0|j*A.scaleX*E],de=F[0|j*C.scaleX*E],X=g(Q+1.402*(de-128)),ke=g(Q-.3441363*(W-128)-.71413636*(de-128)),be=g(Q+1.772*(W-128))):(X=P[0|j*T.scaleX*E],ke=U[0|j*A.scaleX*E],be=F[0|j*C.scaleX*E]),fe[Y++]=X,fe[Y++]=ke,fe[Y++]=be;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(ge=!1,this.adobe&&this.adobe.transformCode?ge=!0:typeof this.opts.colorTransform!="undefined"&&(ge=!!this.opts.colorTransform),T=this.components[0],A=this.components[1],C=this.components[2],B=this.components[3],V=0;V<O;V++)for(P=T.lines[0|V*T.scaleY*R],U=A.lines[0|V*A.scaleY*R],F=C.lines[0|V*C.scaleY*R],H=B.lines[0|V*B.scaleY*R],j=0;j<k;j++)ge?(Q=P[0|j*T.scaleX*E],W=U[0|j*A.scaleX*E],de=F[0|j*C.scaleX*E],ae=H[0|j*B.scaleX*E],ne=255-g(Q+1.402*(de-128)),ue=255-g(Q-.3441363*(W-128)-.71413636*(de-128)),N=255-g(Q+1.772*(W-128))):(ne=P[0|j*T.scaleX*E],ue=U[0|j*A.scaleX*E],N=F[0|j*C.scaleX*E],ae=H[0|j*B.scaleX*E]),fe[Y++]=255-ne,fe[Y++]=255-ue,fe[Y++]=255-N,fe[Y++]=255-ae;break;default:throw new Error("Unsupported color mode")}return fe},copyToImageData:function(k,O){var E=k.width,R=k.height,T=k.data,A=this.getData(E,R),C=0,B=0,P,U,F,H,j,V,Y,Q,W;switch(this.components.length){case 1:for(U=0;U<R;U++)for(P=0;P<E;P++)F=A[C++],T[B++]=F,T[B++]=F,T[B++]=F,O&&(T[B++]=255);break;case 3:for(U=0;U<R;U++)for(P=0;P<E;P++)Y=A[C++],Q=A[C++],W=A[C++],T[B++]=Y,T[B++]=Q,T[B++]=W,O&&(T[B++]=255);break;case 4:for(U=0;U<R;U++)for(P=0;P<E;P++)j=A[C++],V=A[C++],F=A[C++],H=A[C++],Y=255-g(j*(1-H/255)+H),Q=255-g(V*(1-H/255)+H),W=255-g(F*(1-H/255)+H),T[B++]=Y,T[B++]=Q,T[B++]=W,O&&(T[B++]=255);break;default:throw new Error("Unsupported color mode")}}};var y=0,b=0;function x(S=0){var k=y+S;if(k>b){var O=Math.ceil((k-b)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${O}MB`)}y=k}return u.resetMaxMemoryUsage=function(S){y=0,b=S},u.getBytesAllocated=function(){return y},u.requestMemoryAllocation=x,u})();typeof za!="undefined"?za.exports=up:typeof window!="undefined"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=up);function up(i,e={}){var t={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},r={...t,...e},n=new Uint8Array(i),s=new Ka;s.opts=r,Ka.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),s.parse(n);var o=r.formatAsRGBA?4:3,a=s.width*s.height*o;try{Ka.requestMemoryAllocation(a);var l={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:r.useTArray?new Uint8Array(a):Buffer.alloc(a)};s.comments.length>0&&(l.comments=s.comments)}catch(c){throw c instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+a):c instanceof ReferenceError&&c.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):c}return s.copyToImageData(l,r.formatAsRGBA),l}});var pp=w((r2,hp)=>{var n1=cp(),s1=fp();hp.exports={encode:n1,decode:s1}});var mp=w((n2,dp)=>{"use strict";function Ms(){this._types=Object.create(null),this._extensions=Object.create(null);for(let i=0;i<arguments.length;i++)this.define(arguments[i]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}Ms.prototype.define=function(i,e){for(let t in i){let r=i[t].map(function(n){return n.toLowerCase()});t=t.toLowerCase();for(let n=0;n<r.length;n++){let s=r[n];if(s[0]!=="*"){if(!e&&s in this._types)throw new Error('Attempt to change mapping for "'+s+'" extension from "'+this._types[s]+'" to "'+t+'". Pass `force=true` to allow this, otherwise remove "'+s+'" from the list of extensions for "'+t+'".');this._types[s]=t}}if(e||!this._extensions[t]){let n=r[0];this._extensions[t]=n[0]!=="*"?n:n.substr(1)}}};Ms.prototype.getType=function(i){i=String(i);let e=i.replace(/^.*[/\\]/,"").toLowerCase(),t=e.replace(/^.*\./,"").toLowerCase(),r=e.length<i.length;return(t.length<e.length-1||!r)&&this._types[t]||null};Ms.prototype.getExtension=function(i){return i=/^\s*([^;\s]*)/.test(i)&&RegExp.$1,i&&this._extensions[i.toLowerCase()]||null};dp.exports=Ms});var vp=w((s2,gp)=>{gp.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}});var bp=w((o2,yp)=>{yp.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}});var wp=w((a2,_p)=>{"use strict";var o1=mp();_p.exports=new o1(vp(),bp())});var Sp=w((l2,xp)=>{xp.exports=function(i,e){for(var t=[],r=0;r<i.length;r++){var n=e(i[r],r);a1(n)?t.push.apply(t,n):t.push(n)}return t};var a1=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"}});var Tp=w((c2,Cp)=>{"use strict";Cp.exports=Op;function Op(i,e,t){i instanceof RegExp&&(i=Ep(i,t)),e instanceof RegExp&&(e=Ep(e,t));var r=kp(i,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+i.length,r[1]),post:t.slice(r[1]+e.length)}}function Ep(i,e){var t=e.match(i);return t?t[0]:null}Op.range=kp;function kp(i,e,t){var r,n,s,o,a,l=t.indexOf(i),c=t.indexOf(e,l+1),u=l;if(l>=0&&c>0){if(i===e)return[l,c];for(r=[],s=t.length;u>=0&&!a;)u==l?(r.push(u),l=t.indexOf(i,u+1)):r.length==1?a=[r.pop(),c]:(n=r.pop(),n<s&&(s=n,o=c),c=t.indexOf(e,u+1)),u=l<c&&l>=0?l:c;r.length&&(a=[s,o])}return a}});var Mp=w((u2,Pp)=>{var l1=Sp(),Ap=Tp();Pp.exports=f1;var Ip="\0SLASH"+Math.random()+"\0",Np="\0OPEN"+Math.random()+"\0",Za="\0CLOSE"+Math.random()+"\0",Bp="\0COMMA"+Math.random()+"\0",Lp="\0PERIOD"+Math.random()+"\0";function Ja(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}function c1(i){return i.split("\\\\").join(Ip).split("\\{").join(Np).split("\\}").join(Za).split("\\,").join(Bp).split("\\.").join(Lp)}function u1(i){return i.split(Ip).join("\\").split(Np).join("{").split(Za).join("}").split(Bp).join(",").split(Lp).join(".")}function Rp(i){if(!i)return[""];var e=[],t=Ap("{","}",i);if(!t)return i.split(",");var r=t.pre,n=t.body,s=t.post,o=r.split(",");o[o.length-1]+="{"+n+"}";var a=Rp(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function f1(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),kr(c1(i),!0).map(u1)):[]}function h1(i){return"{"+i+"}"}function p1(i){return/^-?0\d/.test(i)}function d1(i,e){return i<=e}function m1(i,e){return i>=e}function kr(i,e){var t=[],r=Ap("{","}",i);if(!r||/\$$/.test(r.pre))return[i];var n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),o=n||s,a=r.body.indexOf(",")>=0;if(!o&&!a)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+Za+r.post,kr(i)):[i];var l;if(o)l=r.body.split(/\.\./);else if(l=Rp(r.body),l.length===1&&(l=kr(l[0],!1).map(h1),l.length===1)){var u=r.post.length?kr(r.post,!1):[""];return u.map(function(P){return r.pre+l[0]+P})}var c=r.pre,u=r.post.length?kr(r.post,!1):[""],f;if(o){var d=Ja(l[0]),m=Ja(l[1]),g=Math.max(l[0].length,l[1].length),y=l.length==3?Math.abs(Ja(l[2])):1,b=d1,x=m<d;x&&(y*=-1,b=m1);var S=l.some(p1);f=[];for(var k=d;b(k,m);k+=y){var O;if(s)O=String.fromCharCode(k),O==="\\"&&(O="");else if(O=String(k),S){var E=g-O.length;if(E>0){var R=new Array(E+1).join("0");k<0?O="-"+R+O.slice(1):O=R+O}}f.push(O)}}else f=l1(l,function(B){return kr(B,!1)});for(var T=0;T<f.length;T++)for(var A=0;A<u.length;A++){var C=c+f[T]+u[A];(!e||o||C)&&t.push(C)}return t}});var $p=w((f2,Up)=>{Up.exports=Et;Et.Minimatch=et;var cn=(function(){try{return require("path")}catch{}})()||{sep:"/"};Et.sep=cn.sep;var el=Et.GLOBSTAR=et.GLOBSTAR={},g1=Mp(),qp={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Qa="[^/]",Xa=Qa+"*?",v1="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",y1="(?:(?!(?:\\/|^)\\.).)*?",Fp=b1("().*{}+?[]^$\\!");function b1(i){return i.split("").reduce(function(e,t){return e[t]=!0,e},{})}var Dp=/\/+/;Et.filter=_1;function _1(i,e){return e=e||{},function(t,r,n){return Et(t,i,e)}}function wi(i,e){e=e||{};var t={};return Object.keys(i).forEach(function(r){t[r]=i[r]}),Object.keys(e).forEach(function(r){t[r]=e[r]}),t}Et.defaults=function(i){if(!i||typeof i!="object"||!Object.keys(i).length)return Et;var e=Et,t=function(n,s,o){return e(n,s,wi(i,o))};return t.Minimatch=function(n,s){return new e.Minimatch(n,wi(i,s))},t.Minimatch.defaults=function(n){return e.defaults(wi(i,n)).Minimatch},t.filter=function(n,s){return e.filter(n,wi(i,s))},t.defaults=function(n){return e.defaults(wi(i,n))},t.makeRe=function(n,s){return e.makeRe(n,wi(i,s))},t.braceExpand=function(n,s){return e.braceExpand(n,wi(i,s))},t.match=function(r,n,s){return e.match(r,n,wi(i,s))},t};et.defaults=function(i){return Et.defaults(i).Minimatch};function Et(i,e,t){return Fs(e),t||(t={}),!t.nocomment&&e.charAt(0)==="#"?!1:new et(e,t).match(i)}function et(i,e){if(!(this instanceof et))return new et(i,e);Fs(i),e||(e={}),i=i.trim(),!e.allowWindowsEscape&&cn.sep!=="/"&&(i=i.split(cn.sep).join("/")),this.options=e,this.set=[],this.pattern=i,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}et.prototype.debug=function(){};et.prototype.make=w1;function w1(){var i=this.pattern,e=this.options;if(!e.nocomment&&i.charAt(0)==="#"){this.comment=!0;return}if(!i){this.empty=!0;return}this.parseNegate();var t=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,t),t=this.globParts=t.map(function(r){return r.split(Dp)}),this.debug(this.pattern,t),t=t.map(function(r,n,s){return r.map(this.parse,this)},this),this.debug(this.pattern,t),t=t.filter(function(r){return r.indexOf(!1)===-1}),this.debug(this.pattern,t),this.set=t}et.prototype.parseNegate=x1;function x1(){var i=this.pattern,e=!1,t=this.options,r=0;if(!t.nonegate){for(var n=0,s=i.length;n<s&&i.charAt(n)==="!";n++)e=!e,r++;r&&(this.pattern=i.substr(r)),this.negate=e}}Et.braceExpand=function(i,e){return jp(i,e)};et.prototype.braceExpand=jp;function jp(i,e){return e||(this instanceof et?e=this.options:e={}),i=typeof i=="undefined"?this.pattern:i,Fs(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:g1(i)}var S1=1024*64,Fs=function(i){if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>S1)throw new TypeError("pattern is too long")};et.prototype.parse=E1;var qs={};function E1(i,e){Fs(i);var t=this.options;if(i==="**")if(t.noglobstar)i="*";else return el;if(i==="")return"";var r="",n=!!t.nocase,s=!1,o=[],a=[],l,c=!1,u=-1,f=-1,d=i.charAt(0)==="."?"":t.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=this;function g(){if(l){switch(l){case"*":r+=Xa,n=!0;break;case"?":r+=Qa,n=!0;break;default:r+="\\"+l;break}m.debug("clearStateChar %j %j",l,r),l=!1}}for(var y=0,b=i.length,x;y<b&&(x=i.charAt(y));y++){if(this.debug("%s	%s %s %j",i,y,r,x),s&&Fp[x]){r+="\\"+x,s=!1;continue}switch(x){case"/":return!1;case"\\":g(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s	%s %s %j <-- stateChar",i,y,r,x),c){this.debug("  in class"),x==="!"&&y===f+1&&(x="^"),r+=x;continue}m.debug("call clearStateChar %j",l),g(),l=x,t.noext&&g();continue;case"(":if(c){r+="(";continue}if(!l){r+="\\(";continue}o.push({type:l,start:y-1,reStart:r.length,open:qp[l].open,close:qp[l].close}),r+=l==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",l,r),l=!1;continue;case")":if(c||!o.length){r+="\\)";continue}g(),n=!0;var S=o.pop();r+=S.close,S.type==="!"&&a.push(S),S.reEnd=r.length;continue;case"|":if(c||!o.length||s){r+="\\|",s=!1;continue}g(),r+="|";continue;case"[":if(g(),c){r+="\\"+x;continue}c=!0,f=y,u=r.length,r+=x;continue;case"]":if(y===f+1||!c){r+="\\"+x,s=!1;continue}var k=i.substring(f+1,y);try{RegExp("["+k+"]")}catch{var O=this.parse(k,qs);r=r.substr(0,u)+"\\["+O[0]+"\\]",n=n||O[1],c=!1;continue}n=!0,c=!1,r+=x;continue;default:g(),s?s=!1:Fp[x]&&!(x==="^"&&c)&&(r+="\\"),r+=x}}for(c&&(k=i.substr(f+1),O=this.parse(k,qs),r=r.substr(0,u)+"\\["+O[0],n=n||O[1]),S=o.pop();S;S=o.pop()){var E=r.slice(S.reStart+S.open.length);this.debug("setting tail",r,S),E=E.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(de,ae,ne){return ne||(ne="\\"),ae+ae+ne+"|"}),this.debug(`tail=%j
   %s`,E,E,S,r);var R=S.type==="*"?Xa:S.type==="?"?Qa:"\\"+S.type;n=!0,r=r.slice(0,S.reStart)+R+"\\("+E}g(),s&&(r+="\\\\");var T=!1;switch(r.charAt(0)){case"[":case".":case"(":T=!0}for(var A=a.length-1;A>-1;A--){var C=a[A],B=r.slice(0,C.reStart),P=r.slice(C.reStart,C.reEnd-8),U=r.slice(C.reEnd-8,C.reEnd),F=r.slice(C.reEnd);U+=F;var H=B.split("(").length-1,j=F;for(y=0;y<H;y++)j=j.replace(/\)[+*?]?/,"");F=j;var V="";F===""&&e!==qs&&(V="$");var Y=B+P+F+V+U;r=Y}if(r!==""&&n&&(r="(?=.)"+r),T&&(r=d+r),e===qs)return[r,n];if(!n)return k1(i);var Q=t.nocase?"i":"";try{var W=new RegExp("^"+r+"$",Q)}catch{return new RegExp("$.")}return W._glob=i,W._src=r,W}Et.makeRe=function(i,e){return new et(i,e||{}).makeRe()};et.prototype.makeRe=O1;function O1(){if(this.regexp||this.regexp===!1)return this.regexp;var i=this.set;if(!i.length)return this.regexp=!1,this.regexp;var e=this.options,t=e.noglobstar?Xa:e.dot?v1:y1,r=e.nocase?"i":"",n=i.map(function(s){return s.map(function(o){return o===el?t:typeof o=="string"?C1(o):o._src}).join("\\/")}).join("|");n="^(?:"+n+")$",this.negate&&(n="^(?!"+n+").*$");try{this.regexp=new RegExp(n,r)}catch{this.regexp=!1}return this.regexp}Et.match=function(i,e,t){t=t||{};var r=new et(e,t);return i=i.filter(function(n){return r.match(n)}),r.options.nonull&&!i.length&&i.push(e),i};et.prototype.match=function(e,t){if(typeof t=="undefined"&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;var r=this.options;cn.sep!=="/"&&(e=e.split(cn.sep).join("/")),e=e.split(Dp),this.debug(this.pattern,"split",e);var n=this.set;this.debug(this.pattern,"set",n);var s,o;for(o=e.length-1;o>=0&&(s=e[o],!s);o--);for(o=0;o<n.length;o++){var a=n[o],l=e;r.matchBase&&a.length===1&&(l=[s]);var c=this.matchOne(l,a,t);if(c)return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate};et.prototype.matchOne=function(i,e,t){var r=this.options;this.debug("matchOne",{this:this,file:i,pattern:e}),this.debug("matchOne",i.length,e.length);for(var n=0,s=0,o=i.length,a=e.length;n<o&&s<a;n++,s++){this.debug("matchOne loop");var l=e[s],c=i[n];if(this.debug(e,l,c),l===!1)return!1;if(l===el){this.debug("GLOBSTAR",[e,l,c]);var u=n,f=s+1;if(f===a){for(this.debug("** at the end");n<o;n++)if(i[n]==="."||i[n]===".."||!r.dot&&i[n].charAt(0)===".")return!1;return!0}for(;u<o;){var d=i[u];if(this.debug(`
globstar while`,i,u,e,f,d),this.matchOne(i.slice(u),e.slice(f),t))return this.debug("globstar found match!",u,o,d),!0;if(d==="."||d===".."||!r.dot&&d.charAt(0)==="."){this.debug("dot detected!",i,u,e,f);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(t&&(this.debug(`
>>> no match, partial?`,i,u,e,f),u===o))}var m;if(typeof l=="string"?(m=c===l,this.debug("string match",l,c,m)):(m=c.match(l),this.debug("pattern match",l,c,m)),!m)return!1}if(n===o&&s===a)return!0;if(n===o)return t;if(s===a)return n===o-1&&i[n]==="";throw new Error("wtf?")};function k1(i){return i.replace(/\\(.)/g,"$1")}function C1(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var il=w((h2,Hp)=>{"use strict";var Vp=require("fs"),tl;function T1(){try{return Vp.statSync("/.dockerenv"),!0}catch{return!1}}function A1(){try{return Vp.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Hp.exports=()=>(tl===void 0&&(tl=T1()||A1()),tl)});var Yp=w((p2,rl)=>{"use strict";var I1=require("os"),N1=require("fs"),Gp=il(),Wp=()=>{if(process.platform!=="linux")return!1;if(I1.release().toLowerCase().includes("microsoft"))return!Gp();try{return N1.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Gp():!1}catch{return!1}};process.env.__IS_WSL_TEST__?rl.exports=Wp:rl.exports=Wp()});var zp=w((d2,Kp)=>{"use strict";Kp.exports=(i,e,t)=>{let r=n=>Object.defineProperty(i,e,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get(){let n=t();return r(n),n},set(n){r(n)}}),i}});var id=w((m2,td)=>{var B1=require("path"),L1=require("child_process"),{promises:nl,constants:ed}=require("fs"),Ds=Yp(),R1=il(),sl=zp(),Jp=B1.join(__dirname,"xdg-open"),{platform:Cr,arch:Zp}=process,P1=(()=>{let i="/mnt/",e;return async function(){if(e)return e;let t="/etc/wsl.conf",r=!1;try{await nl.access(t,ed.F_OK),r=!0}catch{}if(!r)return i;let n=await nl.readFile(t,{encoding:"utf8"}),s=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(n);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):i}})(),Qp=async(i,e)=>{let t;for(let r of i)try{return await e(r)}catch(n){t=n}throw t},js=async i=>{if(i={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...i},Array.isArray(i.app))return Qp(i.app,a=>js({...i,app:a}));let{name:e,arguments:t=[]}=i.app||{};if(t=[...t],Array.isArray(e))return Qp(e,a=>js({...i,app:{name:a,arguments:t}}));let r,n=[],s={};if(Cr==="darwin")r="open",i.wait&&n.push("--wait-apps"),i.background&&n.push("--background"),i.newInstance&&n.push("--new"),e&&n.push("-a",e);else if(Cr==="win32"||Ds&&!R1()){let a=await P1();r=Ds?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,n.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),Ds||(s.windowsVerbatimArguments=!0);let l=["Start"];i.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`,"-ArgumentList"),i.target&&t.unshift(i.target)):i.target&&l.push(`"${i.target}"`),t.length>0&&(t=t.map(c=>`"\`"${c}\`""`),l.push(t.join(","))),i.target=Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)r=e;else{let a=!__dirname||__dirname==="/",l=!1;try{await nl.access(Jp,ed.X_OK),l=!0}catch{}r=process.versions.electron||Cr==="android"||a||!l?"xdg-open":Jp}t.length>0&&n.push(...t),i.wait||(s.stdio="ignore",s.detached=!0)}i.target&&n.push(i.target),Cr==="darwin"&&t.length>0&&n.push("--args",...t);let o=L1.spawn(r,n,s);return i.wait?new Promise((a,l)=>{o.once("error",l),o.once("close",c=>{if(i.allowNonzeroExitCode&&c>0){l(new Error(`Exited with code ${c}`));return}a(o)})}):(o.unref(),o)},ol=(i,e)=>{if(typeof i!="string")throw new TypeError("Expected a `target`");return js({...e,target:i})},M1=(i,e)=>{if(typeof i!="string")throw new TypeError("Expected a `name`");let{arguments:t=[]}=e||{};if(t!=null&&!Array.isArray(t))throw new TypeError("Expected `appArguments` as Array type");return js({...e,app:{name:i,arguments:t}})};function Xp(i){if(typeof i=="string"||Array.isArray(i))return i;let{[Zp]:e}=i;if(!e)throw new Error(`${Zp} is not supported`);return e}function al({[Cr]:i},{wsl:e}){if(e&&Ds)return Xp(e);if(!i)throw new Error(`${Cr} is not supported`);return Xp(i)}var Us={};sl(Us,"chrome",()=>al({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));sl(Us,"firefox",()=>al({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));sl(Us,"edge",()=>al({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));ol.apps=Us;ol.openApp=M1;td.exports=ol});var ll=w((g2,nd)=>{"use strict";var q1=require("util"),rd=require("stream"),Vt=nd.exports=function(){rd.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};q1.inherits(Vt,rd);Vt.prototype.read=function(i,e){this._reads.push({length:Math.abs(i),allowLess:i<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))};Vt.prototype.write=function(i,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let t;return Buffer.isBuffer(i)?t=i:t=Buffer.from(i,e||this._encoding),this._buffers.push(t),this._buffered+=t.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};Vt.prototype.end=function(i,e){i&&this.write(i,e),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))};Vt.prototype.destroySoon=Vt.prototype.end;Vt.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};Vt.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};Vt.prototype._processReadAllowingLess=function(i){this._reads.shift();let e=this._buffers[0];e.length>i.length?(this._buffered-=i.length,this._buffers[0]=e.slice(i.length),i.func.call(this,e.slice(0,i.length))):(this._buffered-=e.length,this._buffers.shift(),i.func.call(this,e))};Vt.prototype._processRead=function(i){this._reads.shift();let e=0,t=0,r=Buffer.alloc(i.length);for(;e<i.length;){let n=this._buffers[t++],s=Math.min(n.length,i.length-e);n.copy(r,e,0,s),e+=s,s!==n.length&&(this._buffers[--t]=n.slice(s))}t>0&&this._buffers.splice(0,t),this._buffered-=i.length,i.func.call(this,r)};Vt.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let i=this._reads[0];if(i.allowLess)this._processReadAllowingLess(i);else if(this._buffered>=i.length)this._processRead(i);else break}this._buffers&&!this.writable&&this._end()}catch(i){this.emit("error",i)}}});var ul=w(cl=>{"use strict";var xi=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];cl.getImagePasses=function(i,e){let t=[],r=i%8,n=e%8,s=(i-r)/8,o=(e-n)/8;for(let a=0;a<xi.length;a++){let l=xi[a],c=s*l.x.length,u=o*l.y.length;for(let f=0;f<l.x.length&&l.x[f]<r;f++)c++;for(let f=0;f<l.y.length&&l.y[f]<n;f++)u++;c>0&&u>0&&t.push({width:c,height:u,index:a})}return t};cl.getInterlaceIterator=function(i){return function(e,t,r){let n=e%xi[r].x.length,s=(e-n)/xi[r].x.length*8+xi[r].x[n],o=t%xi[r].y.length,a=(t-o)/xi[r].y.length*8+xi[r].y[o];return s*4+a*i*4}}});var fl=w((y2,sd)=>{"use strict";sd.exports=function(e,t,r){let n=e+t-r,s=Math.abs(n-e),o=Math.abs(n-t),a=Math.abs(n-r);return s<=o&&s<=a?e:o<=a?t:r}});var hl=w((b2,ad)=>{"use strict";var F1=ul(),D1=fl();function od(i,e,t){let r=i*e;return t!==8&&(r=Math.ceil(r/(8/t))),r}var Tr=ad.exports=function(i,e){let t=i.width,r=i.height,n=i.interlace,s=i.bpp,o=i.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],n){let a=F1.getImagePasses(t,r);for(let l=0;l<a.length;l++)this._images.push({byteWidth:od(a[l].width,s,o),height:a[l].height,lineIndex:0})}else this._images.push({byteWidth:od(t,s,o),height:r,lineIndex:0});o===8?this._xComparison=s:o===16?this._xComparison=s*2:this._xComparison=1};Tr.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};Tr.prototype._unFilterType1=function(i,e,t){let r=this._xComparison,n=r-1;for(let s=0;s<t;s++){let o=i[1+s],a=s>n?e[s-r]:0;e[s]=o+a}};Tr.prototype._unFilterType2=function(i,e,t){let r=this._lastLine;for(let n=0;n<t;n++){let s=i[1+n],o=r?r[n]:0;e[n]=s+o}};Tr.prototype._unFilterType3=function(i,e,t){let r=this._xComparison,n=r-1,s=this._lastLine;for(let o=0;o<t;o++){let a=i[1+o],l=s?s[o]:0,c=o>n?e[o-r]:0,u=Math.floor((c+l)/2);e[o]=a+u}};Tr.prototype._unFilterType4=function(i,e,t){let r=this._xComparison,n=r-1,s=this._lastLine;for(let o=0;o<t;o++){let a=i[1+o],l=s?s[o]:0,c=o>n?e[o-r]:0,u=o>n&&s?s[o-r]:0,f=D1(c,l,u);e[o]=a+f}};Tr.prototype._reverseFilterLine=function(i){let e=i[0],t,r=this._images[this._imageIndex],n=r.byteWidth;if(e===0)t=i.slice(1,n+1);else switch(t=Buffer.alloc(n),e){case 1:this._unFilterType1(i,t,n);break;case 2:this._unFilterType2(i,t,n);break;case 3:this._unFilterType3(i,t,n);break;case 4:this._unFilterType4(i,t,n);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(t),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=t,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var ud=w((_2,cd)=>{"use strict";var j1=require("util"),ld=ll(),U1=hl(),$1=cd.exports=function(i){ld.call(this);let e=[],t=this;this._filter=new U1(i,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){t.emit("complete",Buffer.concat(e))}}),this._filter.start()};j1.inherits($1,ld)});var Ar=w((w2,fd)=>{"use strict";fd.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}});var ml=w((x2,hd)=>{"use strict";var pl=[];(function(){for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++)e&1?e=3988292384^e>>>1:e=e>>>1;pl[i]=e}})();var dl=hd.exports=function(){this._crc=-1};dl.prototype.write=function(i){for(let e=0;e<i.length;e++)this._crc=pl[(this._crc^i[e])&255]^this._crc>>>8;return!0};dl.prototype.crc32=function(){return this._crc^-1};dl.crc32=function(i){let e=-1;for(let t=0;t<i.length;t++)e=pl[(e^i[t])&255]^e>>>8;return e^-1}});var gl=w((S2,pd)=>{"use strict";var He=Ar(),V1=ml(),ze=pd.exports=function(i,e){this._options=i,i.checkCRC=i.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[He.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[He.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[He.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[He.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[He.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[He.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};ze.prototype.start=function(){this.read(He.PNG_SIGNATURE.length,this._parseSignature.bind(this))};ze.prototype._parseSignature=function(i){let e=He.PNG_SIGNATURE;for(let t=0;t<e.length;t++)if(i[t]!==e[t]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))};ze.prototype._parseChunkBegin=function(i){let e=i.readUInt32BE(0),t=i.readUInt32BE(4),r="";for(let s=4;s<8;s++)r+=String.fromCharCode(i[s]);let n=!!(i[4]&32);if(!this._hasIHDR&&t!==He.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new V1,this._crc.write(Buffer.from(r)),this._chunks[t])return this._chunks[t](e);if(!n){this.error(new Error("Unsupported critical chunk type "+r));return}this.read(e+4,this._skipChunk.bind(this))};ze.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};ze.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};ze.prototype._parseChunkEnd=function(i){let e=i.readInt32BE(0),t=this._crc.crc32();if(this._options.checkCRC&&t!==e){this.error(new Error("Crc error - "+e+" - "+t));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))};ze.prototype._handleIHDR=function(i){this.read(i,this._parseIHDR.bind(this))};ze.prototype._parseIHDR=function(i){this._crc.write(i);let e=i.readUInt32BE(0),t=i.readUInt32BE(4),r=i[8],n=i[9],s=i[10],o=i[11],a=i[12];if(r!==8&&r!==4&&r!==2&&r!==1&&r!==16){this.error(new Error("Unsupported bit depth "+r));return}if(!(n in He.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(s!==0){this.error(new Error("Unsupported compression method"));return}if(o!==0){this.error(new Error("Unsupported filter method"));return}if(a!==0&&a!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=n;let l=He.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:t,depth:r,interlace:!!a,palette:!!(n&He.COLORTYPE_PALETTE),color:!!(n&He.COLORTYPE_COLOR),alpha:!!(n&He.COLORTYPE_ALPHA),bpp:l,colorType:n}),this._handleChunkEnd()};ze.prototype._handlePLTE=function(i){this.read(i,this._parsePLTE.bind(this))};ze.prototype._parsePLTE=function(i){this._crc.write(i);let e=Math.floor(i.length/3);for(let t=0;t<e;t++)this._palette.push([i[t*3],i[t*3+1],i[t*3+2],255]);this.palette(this._palette),this._handleChunkEnd()};ze.prototype._handleTRNS=function(i){this.simpleTransparency(),this.read(i,this._parseTRNS.bind(this))};ze.prototype._parseTRNS=function(i){if(this._crc.write(i),this._colorType===He.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(i.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let e=0;e<i.length;e++)this._palette[e][3]=i[e];this.palette(this._palette)}this._colorType===He.COLORTYPE_GRAYSCALE&&this.transColor([i.readUInt16BE(0)]),this._colorType===He.COLORTYPE_COLOR&&this.transColor([i.readUInt16BE(0),i.readUInt16BE(2),i.readUInt16BE(4)]),this._handleChunkEnd()};ze.prototype._handleGAMA=function(i){this.read(i,this._parseGAMA.bind(this))};ze.prototype._parseGAMA=function(i){this._crc.write(i),this.gamma(i.readUInt32BE(0)/He.GAMMA_DIVISION),this._handleChunkEnd()};ze.prototype._handleIDAT=function(i){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-i,this._parseIDAT.bind(this,i))};ze.prototype._parseIDAT=function(i,e){if(this._crc.write(e),this._colorType===He.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(e);let t=i-e.length;t>0?this._handleIDAT(t):this._handleChunkEnd()};ze.prototype._handleIEND=function(i){this.read(i,this._parseIEND.bind(this))};ze.prototype._parseIEND=function(i){this._crc.write(i),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var vl=w(md=>{"use strict";var dd=ul(),H1=[function(){},function(i,e,t,r){if(r===e.length)throw new Error("Ran out of data");let n=e[r];i[t]=n,i[t+1]=n,i[t+2]=n,i[t+3]=255},function(i,e,t,r){if(r+1>=e.length)throw new Error("Ran out of data");let n=e[r];i[t]=n,i[t+1]=n,i[t+2]=n,i[t+3]=e[r+1]},function(i,e,t,r){if(r+2>=e.length)throw new Error("Ran out of data");i[t]=e[r],i[t+1]=e[r+1],i[t+2]=e[r+2],i[t+3]=255},function(i,e,t,r){if(r+3>=e.length)throw new Error("Ran out of data");i[t]=e[r],i[t+1]=e[r+1],i[t+2]=e[r+2],i[t+3]=e[r+3]}],G1=[function(){},function(i,e,t,r){let n=e[0];i[t]=n,i[t+1]=n,i[t+2]=n,i[t+3]=r},function(i,e,t){let r=e[0];i[t]=r,i[t+1]=r,i[t+2]=r,i[t+3]=e[1]},function(i,e,t,r){i[t]=e[0],i[t+1]=e[1],i[t+2]=e[2],i[t+3]=r},function(i,e,t){i[t]=e[0],i[t+1]=e[1],i[t+2]=e[2],i[t+3]=e[3]}];function W1(i,e){let t=[],r=0;function n(){if(r===i.length)throw new Error("Ran out of data");let s=i[r];r++;let o,a,l,c,u,f,d,m;switch(e){default:throw new Error("unrecognised depth");case 16:d=i[r],r++,t.push((s<<8)+d);break;case 4:d=s&15,m=s>>4,t.push(m,d);break;case 2:u=s&3,f=s>>2&3,d=s>>4&3,m=s>>6&3,t.push(m,d,f,u);break;case 1:o=s&1,a=s>>1&1,l=s>>2&1,c=s>>3&1,u=s>>4&1,f=s>>5&1,d=s>>6&1,m=s>>7&1,t.push(m,d,f,u,c,l,a,o);break}}return{get:function(s){for(;t.length<s;)n();let o=t.slice(0,s);return t=t.slice(s),o},resetAfterLine:function(){t.length=0},end:function(){if(r!==i.length)throw new Error("extra data found")}}}function Y1(i,e,t,r,n,s){let o=i.width,a=i.height,l=i.index;for(let c=0;c<a;c++)for(let u=0;u<o;u++){let f=t(u,c,l);H1[r](e,n,f,s),s+=r}return s}function K1(i,e,t,r,n,s){let o=i.width,a=i.height,l=i.index;for(let c=0;c<a;c++){for(let u=0;u<o;u++){let f=n.get(r),d=t(u,c,l);G1[r](e,f,d,s)}n.resetAfterLine()}}md.dataToBitMap=function(i,e){let t=e.width,r=e.height,n=e.depth,s=e.bpp,o=e.interlace,a;n!==8&&(a=W1(i,n));let l;n<=8?l=Buffer.alloc(t*r*4):l=new Uint16Array(t*r*4);let c=Math.pow(2,n)-1,u=0,f,d;if(o)f=dd.getImagePasses(t,r),d=dd.getInterlaceIterator(t,r);else{let m=0;d=function(){let g=m;return m+=4,g},f=[{width:t,height:r}]}for(let m=0;m<f.length;m++)n===8?u=Y1(f[m],l,d,s,i,u):K1(f[m],l,d,s,a,c);if(n===8){if(u!==i.length)throw new Error("extra data found")}else a.end();return l}});var yl=w((O2,gd)=>{"use strict";function z1(i,e,t,r,n){let s=0;for(let o=0;o<r;o++)for(let a=0;a<t;a++){let l=n[i[s]];if(!l)throw new Error("index "+i[s]+" not in palette");for(let c=0;c<4;c++)e[s+c]=l[c];s+=4}}function J1(i,e,t,r,n){let s=0;for(let o=0;o<r;o++)for(let a=0;a<t;a++){let l=!1;if(n.length===1?n[0]===i[s]&&(l=!0):n[0]===i[s]&&n[1]===i[s+1]&&n[2]===i[s+2]&&(l=!0),l)for(let c=0;c<4;c++)e[s+c]=0;s+=4}}function Z1(i,e,t,r,n){let s=255,o=Math.pow(2,n)-1,a=0;for(let l=0;l<r;l++)for(let c=0;c<t;c++){for(let u=0;u<4;u++)e[a+u]=Math.floor(i[a+u]*s/o+.5);a+=4}}gd.exports=function(i,e,t=!1){let r=e.depth,n=e.width,s=e.height,o=e.colorType,a=e.transColor,l=e.palette,c=i;return o===3?z1(i,c,n,s,l):(a&&J1(i,c,n,s,a),r!==8&&!t&&(r===16&&(c=Buffer.alloc(n*s*4)),Z1(i,c,n,s,r))),c}});var bd=w((k2,yd)=>{"use strict";var Q1=require("util"),bl=require("zlib"),vd=ll(),X1=ud(),ex=gl(),tx=vl(),ix=yl(),zt=yd.exports=function(i){vd.call(this),this._parser=new ex(i,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=i,this.writable=!0,this._parser.start()};Q1.inherits(zt,vd);zt.prototype._handleError=function(i){this.emit("error",i),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0};zt.prototype._inflateData=function(i){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=bl.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let t=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(t,bl.Z_MIN_CHUNK);this._inflate=bl.createInflate({chunkSize:r});let n=t,s=this.emit.bind(this,"error");this._inflate.on("error",function(a){n&&s(a)}),this._filter.on("complete",this._complete.bind(this));let o=this._filter.write.bind(this._filter);this._inflate.on("data",function(a){n&&(a.length>n&&(a=a.slice(0,n)),n-=a.length,o(a))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(i)};zt.prototype._handleMetaData=function(i){this._metaData=i,this._bitmapInfo=Object.create(i),this._filter=new X1(this._bitmapInfo)};zt.prototype._handleTransColor=function(i){this._bitmapInfo.transColor=i};zt.prototype._handlePalette=function(i){this._bitmapInfo.palette=i};zt.prototype._simpleTransparency=function(){this._metaData.alpha=!0};zt.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};zt.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};zt.prototype._complete=function(i){if(this.errord)return;let e;try{let t=tx.dataToBitMap(i,this._bitmapInfo);e=ix(t,this._bitmapInfo,this._options.skipRescale),t=null}catch(t){this._handleError(t);return}this.emit("parsed",e)}});var wd=w((C2,_d)=>{"use strict";var Bt=Ar();_d.exports=function(i,e,t,r){let n=[Bt.COLORTYPE_COLOR_ALPHA,Bt.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let g=(function(){let y=new ArrayBuffer(2);return new DataView(y).setInt16(0,256,!0),new Int16Array(y)[0]!==256})();if(r.bitDepth===8||r.bitDepth===16&&g)return i}let s=r.bitDepth!==16?i:new Uint16Array(i.buffer),o=255,a=Bt.COLORTYPE_TO_BPP_MAP[r.inputColorType];a===4&&!r.inputHasAlpha&&(a=3);let l=Bt.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(o=65535,l*=2);let c=Buffer.alloc(e*t*l),u=0,f=0,d=r.bgColor||{};d.red===void 0&&(d.red=o),d.green===void 0&&(d.green=o),d.blue===void 0&&(d.blue=o);function m(){let g,y,b,x=o;switch(r.inputColorType){case Bt.COLORTYPE_COLOR_ALPHA:x=s[u+3],g=s[u],y=s[u+1],b=s[u+2];break;case Bt.COLORTYPE_COLOR:g=s[u],y=s[u+1],b=s[u+2];break;case Bt.COLORTYPE_ALPHA:x=s[u+1],g=s[u],y=g,b=g;break;case Bt.COLORTYPE_GRAYSCALE:g=s[u],y=g,b=g;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(n||(x/=o,g=Math.min(Math.max(Math.round((1-x)*d.red+x*g),0),o),y=Math.min(Math.max(Math.round((1-x)*d.green+x*y),0),o),b=Math.min(Math.max(Math.round((1-x)*d.blue+x*b),0),o))),{red:g,green:y,blue:b,alpha:x}}for(let g=0;g<t;g++)for(let y=0;y<e;y++){let b=m(s,u);switch(r.colorType){case Bt.COLORTYPE_COLOR_ALPHA:case Bt.COLORTYPE_COLOR:r.bitDepth===8?(c[f]=b.red,c[f+1]=b.green,c[f+2]=b.blue,n&&(c[f+3]=b.alpha)):(c.writeUInt16BE(b.red,f),c.writeUInt16BE(b.green,f+2),c.writeUInt16BE(b.blue,f+4),n&&c.writeUInt16BE(b.alpha,f+6));break;case Bt.COLORTYPE_ALPHA:case Bt.COLORTYPE_GRAYSCALE:{let x=(b.red+b.green+b.blue)/3;r.bitDepth===8?(c[f]=x,n&&(c[f+1]=b.alpha)):(c.writeUInt16BE(x,f),n&&c.writeUInt16BE(b.alpha,f+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}u+=a,f+=l}return c}});var Ed=w((T2,Sd)=>{"use strict";var xd=fl();function rx(i,e,t,r,n){for(let s=0;s<t;s++)r[n+s]=i[e+s]}function nx(i,e,t){let r=0,n=e+t;for(let s=e;s<n;s++)r+=Math.abs(i[s]);return r}function sx(i,e,t,r,n,s){for(let o=0;o<t;o++){let a=o>=s?i[e+o-s]:0,l=i[e+o]-a;r[n+o]=l}}function ox(i,e,t,r){let n=0;for(let s=0;s<t;s++){let o=s>=r?i[e+s-r]:0,a=i[e+s]-o;n+=Math.abs(a)}return n}function ax(i,e,t,r,n){for(let s=0;s<t;s++){let o=e>0?i[e+s-t]:0,a=i[e+s]-o;r[n+s]=a}}function lx(i,e,t){let r=0,n=e+t;for(let s=e;s<n;s++){let o=e>0?i[s-t]:0,a=i[s]-o;r+=Math.abs(a)}return r}function cx(i,e,t,r,n,s){for(let o=0;o<t;o++){let a=o>=s?i[e+o-s]:0,l=e>0?i[e+o-t]:0,c=i[e+o]-(a+l>>1);r[n+o]=c}}function ux(i,e,t,r){let n=0;for(let s=0;s<t;s++){let o=s>=r?i[e+s-r]:0,a=e>0?i[e+s-t]:0,l=i[e+s]-(o+a>>1);n+=Math.abs(l)}return n}function fx(i,e,t,r,n,s){for(let o=0;o<t;o++){let a=o>=s?i[e+o-s]:0,l=e>0?i[e+o-t]:0,c=e>0&&o>=s?i[e+o-(t+s)]:0,u=i[e+o]-xd(a,l,c);r[n+o]=u}}function hx(i,e,t,r){let n=0;for(let s=0;s<t;s++){let o=s>=r?i[e+s-r]:0,a=e>0?i[e+s-t]:0,l=e>0&&s>=r?i[e+s-(t+r)]:0,c=i[e+s]-xd(o,a,l);n+=Math.abs(c)}return n}var px={0:rx,1:sx,2:ax,3:cx,4:fx},dx={0:nx,1:ox,2:lx,3:ux,4:hx};Sd.exports=function(i,e,t,r,n){let s;if(!("filterType"in r)||r.filterType===-1)s=[0,1,2,3,4];else if(typeof r.filterType=="number")s=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(n*=2);let o=e*n,a=0,l=0,c=Buffer.alloc((o+1)*t),u=s[0];for(let f=0;f<t;f++){if(s.length>1){let d=1/0;for(let m=0;m<s.length;m++){let g=dx[s[m]](i,l,o,n);g<d&&(u=s[m],d=g)}}c[a]=u,a++,px[u](i,l,o,c,a,n),a+=o,l+=o}return c}});var _l=w((A2,Od)=>{"use strict";var rt=Ar(),mx=ml(),gx=wd(),vx=Ed(),yx=require("zlib"),Si=Od.exports=function(i){if(this._options=i,i.deflateChunkSize=i.deflateChunkSize||32*1024,i.deflateLevel=i.deflateLevel!=null?i.deflateLevel:9,i.deflateStrategy=i.deflateStrategy!=null?i.deflateStrategy:3,i.inputHasAlpha=i.inputHasAlpha!=null?i.inputHasAlpha:!0,i.deflateFactory=i.deflateFactory||yx.createDeflate,i.bitDepth=i.bitDepth||8,i.colorType=typeof i.colorType=="number"?i.colorType:rt.COLORTYPE_COLOR_ALPHA,i.inputColorType=typeof i.inputColorType=="number"?i.inputColorType:rt.COLORTYPE_COLOR_ALPHA,[rt.COLORTYPE_GRAYSCALE,rt.COLORTYPE_COLOR,rt.COLORTYPE_COLOR_ALPHA,rt.COLORTYPE_ALPHA].indexOf(i.colorType)===-1)throw new Error("option color type:"+i.colorType+" is not supported at present");if([rt.COLORTYPE_GRAYSCALE,rt.COLORTYPE_COLOR,rt.COLORTYPE_COLOR_ALPHA,rt.COLORTYPE_ALPHA].indexOf(i.inputColorType)===-1)throw new Error("option input color type:"+i.inputColorType+" is not supported at present");if(i.bitDepth!==8&&i.bitDepth!==16)throw new Error("option bit depth:"+i.bitDepth+" is not supported at present")};Si.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};Si.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};Si.prototype.filterData=function(i,e,t){let r=gx(i,e,t,this._options),n=rt.COLORTYPE_TO_BPP_MAP[this._options.colorType];return vx(r,e,t,this._options,n)};Si.prototype._packChunk=function(i,e){let t=e?e.length:0,r=Buffer.alloc(t+12);return r.writeUInt32BE(t,0),r.writeUInt32BE(i,4),e&&e.copy(r,8),r.writeInt32BE(mx.crc32(r.slice(4,r.length-4)),r.length-4),r};Si.prototype.packGAMA=function(i){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(i*rt.GAMMA_DIVISION),0),this._packChunk(rt.TYPE_gAMA,e)};Si.prototype.packIHDR=function(i,e){let t=Buffer.alloc(13);return t.writeUInt32BE(i,0),t.writeUInt32BE(e,4),t[8]=this._options.bitDepth,t[9]=this._options.colorType,t[10]=0,t[11]=0,t[12]=0,this._packChunk(rt.TYPE_IHDR,t)};Si.prototype.packIDAT=function(i){return this._packChunk(rt.TYPE_IDAT,i)};Si.prototype.packIEND=function(){return this._packChunk(rt.TYPE_IEND,null)}});var Ad=w((I2,Td)=>{"use strict";var bx=require("util"),kd=require("stream"),_x=Ar(),wx=_l(),Cd=Td.exports=function(i){kd.call(this);let e=i||{};this._packer=new wx(e),this._deflate=this._packer.createDeflate(),this.readable=!0};bx.inherits(Cd,kd);Cd.prototype.pack=function(i,e,t,r){this.emit("data",Buffer.from(_x.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,t)),r&&this.emit("data",this._packer.packGAMA(r));let n=this._packer.filterData(i,e,t);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(s){this.emit("data",this._packer.packIDAT(s))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(n)}});var Pd=w((un,Rd)=>{"use strict";var Id=require("assert").ok,Ir=require("zlib"),xx=require("util"),Nd=require("buffer").kMaxLength;function Ji(i){if(!(this instanceof Ji))return new Ji(i);i&&i.chunkSize<Ir.Z_MIN_CHUNK&&(i.chunkSize=Ir.Z_MIN_CHUNK),Ir.Inflate.call(this,i),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,i&&i.maxLength!=null&&(this._maxLength=i.maxLength)}function Sx(i){return new Ji(i)}function Bd(i,e){e&&process.nextTick(e),i._handle&&(i._handle.close(),i._handle=null)}Ji.prototype._processChunk=function(i,e,t){if(typeof t=="function")return Ir.Inflate._processChunk.call(this,i,e,t);let r=this,n=i&&i.length,s=this._chunkSize-this._offset,o=this._maxLength,a=0,l=[],c=0,u;this.on("error",function(g){u=g});function f(g,y){if(r._hadError)return;let b=s-y;if(Id(b>=0,"have should not go down"),b>0){let x=r._buffer.slice(r._offset,r._offset+b);if(r._offset+=b,x.length>o&&(x=x.slice(0,o)),l.push(x),c+=x.length,o-=x.length,o===0)return!1}return(y===0||r._offset>=r._chunkSize)&&(s=r._chunkSize,r._offset=0,r._buffer=Buffer.allocUnsafe(r._chunkSize)),y===0?(a+=n-g,n=g,!0):!1}Id(this._handle,"zlib binding closed");let d;do d=this._handle.writeSync(e,i,a,n,this._buffer,this._offset,s),d=d||this._writeState;while(!this._hadError&&f(d[0],d[1]));if(this._hadError)throw u;if(c>=Nd)throw Bd(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+Nd.toString(16)+" bytes");let m=Buffer.concat(l,c);return Bd(this),m};xx.inherits(Ji,Ir.Inflate);function Ex(i,e){if(typeof e=="string"&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let t=i._finishFlushFlag;return t==null&&(t=Ir.Z_FINISH),i._processChunk(e,t)}function Ld(i,e){return Ex(new Ji(e),i)}Rd.exports=un=Ld;un.Inflate=Ji;un.createInflate=Sx;un.inflateSync=Ld});var wl=w((N2,qd)=>{"use strict";var Md=qd.exports=function(i){this._buffer=i,this._reads=[]};Md.prototype.read=function(i,e){this._reads.push({length:Math.abs(i),allowLess:i<0,func:e})};Md.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let i=this._reads[0];if(this._buffer.length&&(this._buffer.length>=i.length||i.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(i.length),i.func.call(this,e.slice(0,i.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var Dd=w(Fd=>{"use strict";var Ox=wl(),kx=hl();Fd.process=function(i,e){let t=[],r=new Ox(i);return new kx(e,{read:r.read.bind(r),write:function(s){t.push(s)},complete:function(){}}).start(),r.process(),Buffer.concat(t)}});var Vd=w((L2,$d)=>{"use strict";var jd=!0,Ud=require("zlib"),Cx=Pd();Ud.deflateSync||(jd=!1);var Tx=wl(),Ax=Dd(),Ix=gl(),Nx=vl(),Bx=yl();$d.exports=function(i,e){if(!jd)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let t;function r(O){t=O}let n;function s(O){n=O}function o(O){n.transColor=O}function a(O){n.palette=O}function l(){n.alpha=!0}let c;function u(O){c=O}let f=[];function d(O){f.push(O)}let m=new Tx(i);if(new Ix(e,{read:m.read.bind(m),error:r,metadata:s,gamma:u,palette:a,transColor:o,inflateData:d,simpleTransparency:l}).start(),m.process(),t)throw t;let y=Buffer.concat(f);f.length=0;let b;if(n.interlace)b=Ud.inflateSync(y);else{let E=((n.width*n.bpp*n.depth+7>>3)+1)*n.height;b=Cx(y,{chunkSize:E,maxLength:E})}if(y=null,!b||!b.length)throw new Error("bad png - invalid inflate data response");let x=Ax.process(b,n);y=null;let S=Nx.dataToBitMap(x,n);x=null;let k=Bx(S,n,e.skipRescale);return n.data=k,n.gamma=c||0,n}});var Yd=w((R2,Wd)=>{"use strict";var Hd=!0,Gd=require("zlib");Gd.deflateSync||(Hd=!1);var Lx=Ar(),Rx=_l();Wd.exports=function(i,e){if(!Hd)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let t=e||{},r=new Rx(t),n=[];n.push(Buffer.from(Lx.PNG_SIGNATURE)),n.push(r.packIHDR(i.width,i.height)),i.gamma&&n.push(r.packGAMA(i.gamma));let s=r.filterData(i.data,i.width,i.height),o=Gd.deflateSync(s,r.getDeflateOptions());if(s=null,!o||!o.length)throw new Error("bad png - invalid compressed data response");return n.push(r.packIDAT(o)),n.push(r.packIEND()),Buffer.concat(n)}});var Kd=w(xl=>{"use strict";var Px=Vd(),Mx=Yd();xl.read=function(i,e){return Px(i,e||{})};xl.write=function(i,e){return Mx(i,e)}});var Zd=w(Jd=>{"use strict";var qx=require("util"),zd=require("stream"),Fx=bd(),Dx=Ad(),jx=Kd(),lt=Jd.PNG=function(i){zd.call(this),i=i||{},this.width=i.width|0,this.height=i.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,i.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new Fx(i),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new Dx(i),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};qx.inherits(lt,zd);lt.sync=jx;lt.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};lt.prototype.parse=function(i,e){if(e){let t,r;t=function(n){this.removeListener("error",r),this.data=n,e(null,this)}.bind(this),r=function(n){this.removeListener("parsed",t),e(n,null)}.bind(this),this.once("parsed",t),this.once("error",r)}return this.end(i),this};lt.prototype.write=function(i){return this._parser.write(i),!0};lt.prototype.end=function(i){this._parser.end(i)};lt.prototype._metadata=function(i){this.width=i.width,this.height=i.height,this.emit("metadata",i)};lt.prototype._gamma=function(i){this.gamma=i};lt.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};lt.bitblt=function(i,e,t,r,n,s,o,a){if(t|=0,r|=0,n|=0,s|=0,o|=0,a|=0,t>i.width||r>i.height||t+n>i.width||r+s>i.height)throw new Error("bitblt reading outside image");if(o>e.width||a>e.height||o+n>e.width||a+s>e.height)throw new Error("bitblt writing outside image");for(let l=0;l<s;l++)i.data.copy(e.data,(a+l)*e.width+o<<2,(r+l)*i.width+t<<2,(r+l)*i.width+t+n<<2)};lt.prototype.bitblt=function(i,e,t,r,n,s,o){return lt.bitblt(this,i,e,t,r,n,s,o),this};lt.adjustGamma=function(i){if(i.gamma){for(let e=0;e<i.height;e++)for(let t=0;t<i.width;t++){let r=i.width*e+t<<2;for(let n=0;n<3;n++){let s=i.data[r+n]/255;s=Math.pow(s,1/2.2/i.gamma),i.data[r+n]=Math.round(s*255)}}i.gamma=0}};lt.prototype.adjustGamma=function(){lt.adjustGamma(this)}});var fn=w(El=>{var $s=class extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Sl=class extends $s{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};El.CommanderError=$s;El.InvalidArgumentError=Sl});var Vs=w(kl=>{var{InvalidArgumentError:Ux}=fn(),Ol=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Ux(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function $x(i){let e=i.name()+(i.variadic===!0?"...":"");return i.required?"<"+e+">":"["+e+"]"}kl.Argument=Ol;kl.humanReadableArgName=$x});var Al=w(Tl=>{var{humanReadableArgName:Vx}=Vs(),Cl=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){var t,r;this.helpWidth=(r=(t=this.helpWidth)!=null?t:e.helpWidth)!=null?r:80}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((n,s)=>n.name().localeCompare(s.name())),t}compareOptions(e,t){let r=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(n=>!n.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!n&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!n&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let n=r.options.filter(s=>!s.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(r=>Vx(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,t){var f;let r=t.padWidth(e,t),n=(f=t.helpWidth)!=null?f:80;function s(d,m){return t.formatItem(d,r,m,t)}let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(a),n),""]));let l=t.visibleArguments(e).map(d=>s(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));l.length>0&&(o=o.concat([t.styleTitle("Arguments:"),...l,""]));let c=t.visibleOptions(e).map(d=>s(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));if(c.length>0&&(o=o.concat([t.styleTitle("Options:"),...c,""])),t.showGlobalOptions){let d=t.visibleGlobalOptions(e).map(m=>s(t.styleOptionTerm(t.optionTerm(m)),t.styleOptionDescription(t.optionDescription(m))));d.length>0&&(o=o.concat([t.styleTitle("Global Options:"),...d,""]))}let u=t.visibleCommands(e).map(d=>s(t.styleSubcommandTerm(t.subcommandTerm(d)),t.styleSubcommandDescription(t.subcommandDescription(d))));return u.length>0&&(o=o.concat([t.styleTitle("Commands:"),...u,""])),o.join(`
`)}displayWidth(e){return Qd(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){var d;let o=" ".repeat(2);if(!r)return o+e;let a=e.padEnd(t+e.length-n.displayWidth(e)),l=2,u=((d=this.helpWidth)!=null?d:80)-t-l-2,f;return u<this.minWidthToWrap||n.preformatted(r)?f=r:f=n.boxWrap(r,u).replace(/\n/g,`
`+" ".repeat(t+l)),o+a+" ".repeat(l)+f.replace(/\n/g,`
${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return r.forEach(o=>{let a=o.match(n);if(a===null){s.push("");return}let l=[a.shift()],c=this.displayWidth(l[0]);a.forEach(u=>{let f=this.displayWidth(u);if(c+f<=t){l.push(u),c+=f;return}s.push(l.join(""));let d=u.trimStart();l=[d],c=this.displayWidth(d)}),s.push(l.join(""))}),s.join(`
`)}};function Qd(i){let e=/\x1b\[\d*(;\d*)*m/g;return i.replace(e,"")}Tl.Help=Cl;Tl.stripColor=Qd});var Ll=w(Bl=>{var{InvalidArgumentError:Hx}=fn(),Il=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=Gx(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Hx(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Xd(this.name().replace(/^no-/,"")):Xd(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Nl=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg,s=n!==void 0?n:!1;return t.negate===(s===e)}};function Xd(i){return i.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Gx(i){let e,t,r=/^-[^-]$/,n=/^--[^-]/,s=i.split(/[ |,]+/).concat("guard");if(r.test(s[0])&&(e=s.shift()),n.test(s[0])&&(t=s.shift()),!e&&r.test(s[0])&&(e=s.shift()),!e&&n.test(s[0])&&(e=t,t=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${i}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
- a short flag is a single dash and a single character
  - either use a single dash and a single character (for a short flag)
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(o)?new Error(`${a}
- too many short flags`):n.test(o)?new Error(`${a}
- too many long flags`):new Error(`${a}
- unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${i}'.`);return{shortFlag:e,longFlag:t}}Bl.Option=Il;Bl.DualOptions=Nl});var tm=w(em=>{function Wx(i,e){if(Math.abs(i.length-e.length)>3)return Math.max(i.length,e.length);let t=[];for(let r=0;r<=i.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=e.length;r++)for(let n=1;n<=i.length;n++){let s=1;i[n-1]===e[r-1]?s=0:s=1,t[n][r]=Math.min(t[n-1][r]+1,t[n][r-1]+1,t[n-1][r-1]+s),n>1&&r>1&&i[n-1]===e[r-2]&&i[n-2]===e[r-1]&&(t[n][r]=Math.min(t[n][r],t[n-2][r-2]+1))}return t[i.length][e.length]}function Yx(i,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=i.startsWith("--");t&&(i=i.slice(2),e=e.map(o=>o.slice(2)));let r=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=Wx(i,o),l=Math.max(i.length,o.length);(l-a)/l>s&&(a<n?(n=a,r=[o]):a===n&&r.push(o))}),r.sort((o,a)=>o.localeCompare(a)),t&&(r=r.map(o=>`--${o}`)),r.length>1?`
(Did you mean one of ${r.join(", ")}?)`:r.length===1?`
(Did you mean ${r[0]}?)`:""}em.suggestSimilar=Yx});var sm=w(Fl=>{var Kx=require("node:events").EventEmitter,Rl=require("node:child_process"),ui=require("node:path"),Hs=require("node:fs"),Oe=require("node:process"),{Argument:zx,humanReadableArgName:Jx}=Vs(),{CommanderError:Pl}=fn(),{Help:Zx,stripColor:Qx}=Al(),{Option:im,DualOptions:Xx}=Ll(),{suggestSimilar:rm}=tm(),Ml=class i extends Kx{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>Oe.stdout.write(t),writeErr:t=>Oe.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>Oe.stdout.isTTY?Oe.stdout.columns:void 0,getErrHelpWidth:()=>Oe.stderr.isTTY?Oe.stderr.columns:void 0,getOutHasColors:()=>{var t,r,n;return(n=ql())!=null?n:Oe.stdout.isTTY&&((r=(t=Oe.stdout).hasColors)==null?void 0:r.call(t))},getErrHasColors:()=>{var t,r,n;return(n=ql())!=null?n:Oe.stderr.isTTY&&((r=(t=Oe.stderr).hasColors)==null?void 0:r.call(t))},stripColor:t=>Qx(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,s=r;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return n&&(l.description(n),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),n?this:l}createCommand(e){return new i(e)}createHelp(){return Object.assign(new Zx,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new zx(e,t)}argument(e,t,r,n){let s=this.createArgument(e,t);return typeof r=="function"?s.default(n).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e!=null?e:"help [command]";let[,r,n]=e.match(/([^ ]+) *(.*)/),s=t!=null?t:"display help for command",o=this.createCommand(r);return o.helpOption(!1),n&&o.arguments(n),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){var t;return((t=this._addImplicitHelpCommand)!=null?t:this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new Pl(e,t,r)),Oe.exit(e)}action(e){let t=r=>{let n=this.registeredArguments.length,s=r.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new im(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${n} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
-  already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=n=>[n.name()].concat(n.aliases()),r=t(e).find(n=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let l=this.getOptionValue(r);s!==null&&e.parseArg?s=this._callParseArg(e,s,l,o):s!==null&&e.variadic&&(s=e._concatValue(s,l)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(r,s,a)};return this.on("option:"+t,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;n(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;n(s,o,"env")}),this}_optionEx(e,t,r,n,s){if(typeof t=="object"&&t instanceof im)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(t,r);if(o.makeOptionMandatory(!!e.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(l,c)=>{let u=a.exec(l);return u?u[0]:c},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(e)!==void 0&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){var n,s;if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){(n=Oe.versions)!=null&&n.electron&&(t.from="electron");let o=(s=Oe.execArgv)!=null?s:[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(t.from="eval")}e===void 0&&(e=Oe.argv),this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":Oe.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(Hs.existsSync(e))return;let n=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
 - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
 - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
 - ${n}`;throw new Error(s)}_executeSubCommand(e,t){t=t.slice();let r=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(u,f){let d=ui.resolve(u,f);if(Hs.existsSync(d))return d;if(n.includes(ui.extname(f)))return;let m=n.find(g=>Hs.existsSync(`${d}${g}`));if(m)return`${d}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Hs.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=ui.resolve(ui.dirname(u),a)}if(a){let u=s(a,o);if(!u&&!e._executableFile&&this._scriptPath){let f=ui.basename(this._scriptPath,ui.extname(this._scriptPath));f!==this._name&&(u=s(a,`${f}-${e._name}`))}o=u||o}r=n.includes(ui.extname(o));let l;Oe.platform!=="win32"?r?(t.unshift(o),t=nm(Oe.execArgv).concat(t),l=Rl.spawn(Oe.argv[0],t,{stdio:"inherit"})):l=Rl.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),t.unshift(o),t=nm(Oe.execArgv).concat(t),l=Rl.spawn(Oe.execPath,t,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{Oe.on(f,()=>{l.killed===!1&&l.exitCode===null&&l.kill(f)})});let c=this._exitCallback;l.on("close",u=>{u=u!=null?u:1,c?c(new Pl(u,"commander.executeSubCommandAsync","(close)")):Oe.exit(u)}),l.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(u.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)Oe.exit(1);else{let f=new Pl(1,"commander.executeSubCommandAsync","(error)");f.nestedError=u,c(f)}}),this.runningCommand=l}_dispatchSubcommand(e,t,r){let n=this._findCommand(e);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(r));else return n._parseCommand(t,r)}),s}_dispatchHelpCommand(e){var r,n,s,o;e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[(o=(s=(r=this._getHelpOption())==null?void 0:r.long)!=null?s:(n=this._getHelpOption())==null?void 0:n.short)!=null?o:"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(r,n,s)=>{let o=n;if(n!==null&&r.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${r.name()}'.`;o=this._callParseArg(r,n,s,a)}return o};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let s=r.defaultValue;r.variadic?n<this.args.length?(s=this.args.slice(n),r.parseArg&&(s=s.reduce((o,a)=>e(r,a,o),r.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],r.parseArg&&(s=e(r,s,r.defaultValue))),t[n]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(o=>{n.push({hookedCommand:s,callback:o})})}),t==="postAction"&&n.reverse(),n.forEach(s=>{r=this._chainOrCall(r,()=>s.callback(s.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(s=>{n=this._chainOrCall(n,()=>s(this,t))}),n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,t)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(r=>{let n=r.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(r=>r.conflictsWith.length>0).forEach(r=>{let n=e.find(s=>r.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(r,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t,s=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=null;for(;s.length;){let l=s.shift();if(l==="--"){n===r&&n.push(l),n.push(...s);break}if(a&&!o(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let c=this._findOption(l);if(c){if(c.required){let u=s.shift();u===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,u)}else if(c.optional){let u=null;s.length>0&&!o(s[0])&&(u=s.shift()),this.emit(`option:${c.name()}`,u)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let c=this._findOption(`-${l[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,l.slice(2)):(this.emit(`option:${c.name()}`),s.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let c=l.indexOf("="),u=this._findOption(l.slice(0,c));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,l.slice(c+1));continue}}if(o(l)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(l)){t.push(l),s.length>0&&r.push(...s);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l),s.length>0&&t.push(...s);break}else if(this._defaultCommandName){r.push(l),s.length>0&&r.push(...s);break}}if(this._passThroughOptions){n.push(l),s.length>0&&n.push(...s);break}n.push(l)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let n=this.options[r].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
`),this.outputHelp({error:!0}));let r=t||{},n=r.exitCode||1,s=r.code||"commander.error";this._exit(n,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Oe.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Oe.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Xx(this.options),t=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(n=>!t(n)).forEach(n=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=o=>{let a=o.attributeName(),l=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),u=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&l===!1||c.presetArg!==void 0&&l===c.presetArg)?c:u||o},n=o=>{let a=r(o),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);t=rm(e,n)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),t=rm(e,n)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){var n;if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let r=(n=this.parent)==null?void 0:n._findCommand(e);if(r){let s=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(r=>Jx(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=ui.basename(e,ui.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=t.formatHelp(this,t);return r.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let t=!!e.error,r,n,s;return t?(r=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(r=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),r(a)),hasColors:n,helpWidth:s}}outputHelp(e){var o;let t;typeof e=="function"&&(t=e,e=void 0);let r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:r.error});if(t&&(s=t(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(s),(o=this._getHelpOption())!=null&&o.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(e,t){var r;return typeof e=="boolean"?(e?this._helpOption=(r=this._helpOption)!=null?r:void 0:this._helpOption=null,this):(e=e!=null?e:"-h, --help",t=t!=null?t:"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){var r;this.outputHelp(e);let t=Number((r=Oe.exitCode)!=null?r:0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,s=>{let o;typeof t=="function"?o=t({error:s.error,command:s.command}):o=t,o&&s.write(`${o}
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function nm(i){return i.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",n="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?n=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],n=s[4]),t&&n!=="0"?`${t}=${r}:${parseInt(n)+1}`:e})}function ql(){if(Oe.env.NO_COLOR||Oe.env.FORCE_COLOR==="0"||Oe.env.FORCE_COLOR==="false")return!1;if(Oe.env.FORCE_COLOR||Oe.env.CLICOLOR_FORCE!==void 0)return!0}Fl.Command=Ml;Fl.useColor=ql});var cm=w(Lt=>{var{Argument:om}=Vs(),{Command:Dl}=sm(),{CommanderError:eS,InvalidArgumentError:am}=fn(),{Help:tS}=Al(),{Option:lm}=Ll();Lt.program=new Dl;Lt.createCommand=i=>new Dl(i);Lt.createOption=(i,e)=>new lm(i,e);Lt.createArgument=(i,e)=>new om(i,e);Lt.Command=Dl;Lt.Option=lm;Lt.Argument=om;Lt.Help=tS;Lt.CommanderError=eS;Lt.InvalidArgumentError=am;Lt.InvalidOptionArgumentError=am});var mm=w((pm,dm)=>{pm=dm.exports=Nr;function Nr(i,e){if(this.stream=e.stream||process.stderr,typeof e=="number"){var t=e;e={},e.total=t}else{if(e=e||{},typeof i!="string")throw new Error("format required");if(typeof e.total!="number")throw new Error("total required")}this.fmt=i,this.curr=e.curr||0,this.total=e.total,this.width=e.width||this.total,this.clear=e.clear,this.chars={complete:e.complete||"=",incomplete:e.incomplete||"-",head:e.head||e.complete||"="},this.renderThrottle=e.renderThrottle!==0?e.renderThrottle||16:0,this.lastRender=-1/0,this.callback=e.callback||function(){},this.tokens={},this.lastDraw=""}Nr.prototype.tick=function(i,e){if(i!==0&&(i=i||1),typeof i=="object"&&(e=i,i=1),e&&(this.tokens=e),this.curr==0&&(this.start=new Date),this.curr+=i,this.render(),this.curr>=this.total){this.render(void 0,!0),this.complete=!0,this.terminate(),this.callback(this);return}};Nr.prototype.render=function(i,e){if(e=e!==void 0?e:!1,i&&(this.tokens=i),!!this.stream.isTTY){var t=Date.now(),r=t-this.lastRender;if(!(!e&&r<this.renderThrottle)){this.lastRender=t;var n=this.curr/this.total;n=Math.min(Math.max(n,0),1);var s=Math.floor(n*100),o,a,l,c=new Date-this.start,u=s==100?0:c*(this.total/this.curr-1),f=this.curr/(c/1e3),d=this.fmt.replace(":current",this.curr).replace(":total",this.total).replace(":elapsed",isNaN(c)?"0.0":(c/1e3).toFixed(1)).replace(":eta",isNaN(u)||!isFinite(u)?"0.0":(u/1e3).toFixed(1)).replace(":percent",s.toFixed(0)+"%").replace(":rate",Math.round(f)),m=Math.max(0,this.stream.columns-d.replace(":bar","").length);m&&process.platform==="win32"&&(m=m-1);var g=Math.min(this.width,m);if(l=Math.round(g*n),a=Array(Math.max(0,l+1)).join(this.chars.complete),o=Array(Math.max(0,g-l+1)).join(this.chars.incomplete),l>0&&(a=a.slice(0,-1)+this.chars.head),d=d.replace(":bar",a+o),this.tokens)for(var y in this.tokens)d=d.replace(":"+y,this.tokens[y]);this.lastDraw!==d&&(this.stream.cursorTo(0),this.stream.write(d),this.stream.clearLine(1),this.lastDraw=d)}}};Nr.prototype.update=function(i,e){var t=Math.floor(i*this.total),r=t-this.curr;this.tick(r,e)};Nr.prototype.interrupt=function(i){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(i),this.stream.write(`
`),this.stream.write(this.lastDraw)};Nr.prototype.terminate=function(){this.clear?this.stream.clearLine&&(this.stream.clearLine(),this.stream.cursorTo(0)):this.stream.write(`
`)}});var vm=w((eN,gm)=>{gm.exports=mm()});var wm=w(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});var ym=require("buffer"),Zi={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};fi.ERRORS=Zi;function iS(i){if(!ym.Buffer.isEncoding(i))throw new Error(Zi.INVALID_ENCODING)}fi.checkEncoding=iS;function bm(i){return typeof i=="number"&&isFinite(i)&&oS(i)}fi.isFiniteInteger=bm;function _m(i,e){if(typeof i=="number"){if(!bm(i)||i<0)throw new Error(e?Zi.INVALID_OFFSET:Zi.INVALID_LENGTH)}else throw new Error(e?Zi.INVALID_OFFSET_NON_NUMBER:Zi.INVALID_LENGTH_NON_NUMBER)}function rS(i){_m(i,!1)}fi.checkLengthValue=rS;function nS(i){_m(i,!0)}fi.checkOffsetValue=nS;function sS(i,e){if(i<0||i>e.length)throw new Error(Zi.INVALID_TARGET_OFFSET)}fi.checkTargetOffset=sS;function oS(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}function aS(i){if(typeof BigInt=="undefined")throw new Error("Platform does not support JS BigInt type.");if(typeof ym.Buffer.prototype[i]=="undefined")throw new Error(`Platform does not support Buffer.prototype.${i}.`)}fi.bigIntAndBufferInt64Check=aS});var Sm=w(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var pe=wm(),xm=4096,lS="utf8",jl=class i{constructor(e){if(this.length=0,this._encoding=lS,this._writeOffset=0,this._readOffset=0,i.isSmartBufferOptions(e))if(e.encoding&&(pe.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(pe.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(pe.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(pe.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(xm);else{if(typeof e!="undefined")throw new Error(pe.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(xm)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return pe.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return pe.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){return pe.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return pe.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return pe.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return pe.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return pe.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return pe.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,t){return pe.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return pe.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return pe.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return pe.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(pe.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t!="undefined"&&pe.checkEncoding(t);let n=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,n}insertString(e,t,r){return pe.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e!="undefined"&&pe.checkEncoding(e);let t=this.length;for(let n=this._readOffset;n<this.length;n++)if(this._buff[n]===0){t=n;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return pe.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e!="undefined"&&pe.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),n=this._buff.slice(this._readOffset,r);return this._readOffset=r,n}insertBuffer(e,t){return pe.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return pe.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t!="undefined"&&pe.checkOffsetValue(t),this.writeBuffer(e,t),this.writeUInt8(0,typeof t=="number"?t+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){pe.checkOffsetValue(e),pe.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){pe.checkOffsetValue(e),pe.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){pe.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let t=typeof e=="string"?e:this._encoding;return pe.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,n){let s=this._writeOffset,o=this._encoding;typeof r=="number"?s=r:typeof r=="string"&&(pe.checkEncoding(r),o=r),typeof n=="string"&&(pe.checkEncoding(n),o=n);let a=Buffer.byteLength(e,o);return t?this.ensureInsertable(a,s):this._ensureWriteable(a,s),this._buff.write(e,s,a,o),t?this._writeOffset+=a:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,s+a):this._writeOffset+=a,this}_handleBuffer(e,t,r){let n=typeof r=="number"?r:this._writeOffset;return t?this.ensureInsertable(e.length,n):this._ensureWriteable(e.length,n),e.copy(this._buff,n),t?this._writeOffset+=e.length:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,n+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t!="undefined"&&(pe.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(pe.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){pe.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,n=t*3/2+1;n<e&&(n=e),this._buff=Buffer.allocUnsafe(n),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let n=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r=="undefined"&&(this._readOffset+=t),n}_insertNumberValue(e,t,r,n){return pe.checkOffsetValue(n),this.ensureInsertable(t,n),e.call(this._buff,r,n),this._writeOffset+=t,this}_writeNumberValue(e,t,r,n){if(typeof n=="number"){if(n<0)throw new Error(pe.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);pe.checkOffsetValue(n)}let s=typeof n=="number"?n:this._writeOffset;return this._ensureWriteable(t,s),e.call(this._buff,r,s),typeof n=="number"?this._writeOffset=Math.max(this._writeOffset,s+t):this._writeOffset+=t,this}};Ul.SmartBuffer=jl});var $l=w(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.SOCKS5_NO_ACCEPTABLE_AUTH=Be.SOCKS5_CUSTOM_AUTH_END=Be.SOCKS5_CUSTOM_AUTH_START=Be.SOCKS_INCOMING_PACKET_SIZES=Be.SocksClientState=Be.Socks5Response=Be.Socks5HostType=Be.Socks5Auth=Be.Socks4Response=Be.SocksCommand=Be.ERRORS=Be.DEFAULT_TIMEOUT=void 0;var cS=3e4;Be.DEFAULT_TIMEOUT=cS;var uS={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};Be.ERRORS=uS;var fS={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:i=>i+7,Socks4Response:8};Be.SOCKS_INCOMING_PACKET_SIZES=fS;var Em;(function(i){i[i.connect=1]="connect",i[i.bind=2]="bind",i[i.associate=3]="associate"})(Em||(Be.SocksCommand=Em={}));var Om;(function(i){i[i.Granted=90]="Granted",i[i.Failed=91]="Failed",i[i.Rejected=92]="Rejected",i[i.RejectedIdent=93]="RejectedIdent"})(Om||(Be.Socks4Response=Om={}));var km;(function(i){i[i.NoAuth=0]="NoAuth",i[i.GSSApi=1]="GSSApi",i[i.UserPass=2]="UserPass"})(km||(Be.Socks5Auth=km={}));var hS=128;Be.SOCKS5_CUSTOM_AUTH_START=hS;var pS=254;Be.SOCKS5_CUSTOM_AUTH_END=pS;var dS=255;Be.SOCKS5_NO_ACCEPTABLE_AUTH=dS;var Cm;(function(i){i[i.Granted=0]="Granted",i[i.Failure=1]="Failure",i[i.NotAllowed=2]="NotAllowed",i[i.NetworkUnreachable=3]="NetworkUnreachable",i[i.HostUnreachable=4]="HostUnreachable",i[i.ConnectionRefused=5]="ConnectionRefused",i[i.TTLExpired=6]="TTLExpired",i[i.CommandNotSupported=7]="CommandNotSupported",i[i.AddressNotSupported=8]="AddressNotSupported"})(Cm||(Be.Socks5Response=Cm={}));var Tm;(function(i){i[i.IPv4=1]="IPv4",i[i.Hostname=3]="Hostname",i[i.IPv6=4]="IPv6"})(Tm||(Be.Socks5HostType=Tm={}));var Am;(function(i){i[i.Created=0]="Created",i[i.Connecting=1]="Connecting",i[i.Connected=2]="Connected",i[i.SentInitialHandshake=3]="SentInitialHandshake",i[i.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",i[i.SentAuthentication=5]="SentAuthentication",i[i.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",i[i.SentFinalHandshake=7]="SentFinalHandshake",i[i.ReceivedFinalResponse=8]="ReceivedFinalResponse",i[i.BoundWaitingForConnection=9]="BoundWaitingForConnection",i[i.Established=10]="Established",i[i.Disconnected=11]="Disconnected",i[i.Error=99]="Error"})(Am||(Be.SocksClientState=Am={}))});var Hl=w(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.shuffleArray=Br.SocksClientError=void 0;var Vl=class extends Error{constructor(e,t){super(e),this.options=t}};Br.SocksClientError=Vl;function mS(i){for(let e=i.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[i[e],i[t]]=[i[t],i[e]]}}Br.shuffleArray=mS});var Gl=w(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.isCorrect=Lr.isInSubnet=void 0;function gS(i){return this.subnetMask<i.subnetMask?!1:this.mask(i.subnetMask)===i.mask()}Lr.isInSubnet=gS;function vS(i){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===i&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}Lr.isCorrect=vS});var Wl=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.RE_SUBNET_STRING=Jt.RE_ADDRESS=Jt.GROUPS=Jt.BITS=void 0;Jt.BITS=32;Jt.GROUPS=4;Jt.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Jt.RE_SUBNET_STRING=/\/\d{1,2}$/});var Ws=w(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.AddressError=void 0;var Yl=class extends Error{constructor(e,t){super(e),this.name="AddressError",t!==null&&(this.parseMessage=t)}};Gs.AddressError=Yl});var Kl=w((Ys,Im)=>{(function(){var i,e=0xdeadbeefcafe,t=(e&16777215)==15715070;function r(h,p,v){h!=null&&(typeof h=="number"?this.fromNumber(h,p,v):p==null&&typeof h!="string"?this.fromString(h,256):this.fromString(h,p))}function n(){return new r(null)}function s(h,p,v,_,L,M){for(;--M>=0;){var G=p*this[h++]+v[_]+L;L=Math.floor(G/67108864),v[_++]=G&67108863}return L}function o(h,p,v,_,L,M){for(var G=p&32767,K=p>>15;--M>=0;){var Pe=this[h]&32767,Ye=this[h++]>>15,Tt=K*Pe+Ye*G;Pe=G*Pe+((Tt&32767)<<15)+v[_]+(L&1073741823),L=(Pe>>>30)+(Tt>>>15)+K*Ye+(L>>>30),v[_++]=Pe&1073741823}return L}function a(h,p,v,_,L,M){for(var G=p&16383,K=p>>14;--M>=0;){var Pe=this[h]&16383,Ye=this[h++]>>14,Tt=K*Pe+Ye*G;Pe=G*Pe+((Tt&16383)<<14)+v[_]+L,L=(Pe>>28)+(Tt>>14)+K*Ye,v[_++]=Pe&268435455}return L}var l=typeof navigator!="undefined";l&&t&&navigator.appName=="Microsoft Internet Explorer"?(r.prototype.am=o,i=30):l&&t&&navigator.appName!="Netscape"?(r.prototype.am=s,i=26):(r.prototype.am=a,i=28),r.prototype.DB=i,r.prototype.DM=(1<<i)-1,r.prototype.DV=1<<i;var c=52;r.prototype.FV=Math.pow(2,c),r.prototype.F1=c-i,r.prototype.F2=2*i-c;var u="0123456789abcdefghijklmnopqrstuvwxyz",f=new Array,d,m;for(d=48,m=0;m<=9;++m)f[d++]=m;for(d=97,m=10;m<36;++m)f[d++]=m;for(d=65,m=10;m<36;++m)f[d++]=m;function g(h){return u.charAt(h)}function y(h,p){var v=f[h.charCodeAt(p)];return v==null?-1:v}function b(h){for(var p=this.t-1;p>=0;--p)h[p]=this[p];h.t=this.t,h.s=this.s}function x(h){this.t=1,this.s=h<0?-1:0,h>0?this[0]=h:h<-1?this[0]=h+this.DV:this.t=0}function S(h){var p=n();return p.fromInt(h),p}function k(h,p){var v;if(p==16)v=4;else if(p==8)v=3;else if(p==256)v=8;else if(p==2)v=1;else if(p==32)v=5;else if(p==4)v=2;else{this.fromRadix(h,p);return}this.t=0,this.s=0;for(var _=h.length,L=!1,M=0;--_>=0;){var G=v==8?h[_]&255:y(h,_);if(G<0){h.charAt(_)=="-"&&(L=!0);continue}L=!1,M==0?this[this.t++]=G:M+v>this.DB?(this[this.t-1]|=(G&(1<<this.DB-M)-1)<<M,this[this.t++]=G>>this.DB-M):this[this.t-1]|=G<<M,M+=v,M>=this.DB&&(M-=this.DB)}v==8&&(h[0]&128)!=0&&(this.s=-1,M>0&&(this[this.t-1]|=(1<<this.DB-M)-1<<M)),this.clamp(),L&&r.ZERO.subTo(this,this)}function O(){for(var h=this.s&this.DM;this.t>0&&this[this.t-1]==h;)--this.t}function E(h){if(this.s<0)return"-"+this.negate().toString(h);var p;if(h==16)p=4;else if(h==8)p=3;else if(h==2)p=1;else if(h==32)p=5;else if(h==4)p=2;else return this.toRadix(h);var v=(1<<p)-1,_,L=!1,M="",G=this.t,K=this.DB-G*this.DB%p;if(G-- >0)for(K<this.DB&&(_=this[G]>>K)>0&&(L=!0,M=g(_));G>=0;)K<p?(_=(this[G]&(1<<K)-1)<<p-K,_|=this[--G]>>(K+=this.DB-p)):(_=this[G]>>(K-=p)&v,K<=0&&(K+=this.DB,--G)),_>0&&(L=!0),L&&(M+=g(_));return L?M:"0"}function R(){var h=n();return r.ZERO.subTo(this,h),h}function T(){return this.s<0?this.negate():this}function A(h){var p=this.s-h.s;if(p!=0)return p;var v=this.t;if(p=v-h.t,p!=0)return this.s<0?-p:p;for(;--v>=0;)if((p=this[v]-h[v])!=0)return p;return 0}function C(h){var p=1,v;return(v=h>>>16)!=0&&(h=v,p+=16),(v=h>>8)!=0&&(h=v,p+=8),(v=h>>4)!=0&&(h=v,p+=4),(v=h>>2)!=0&&(h=v,p+=2),(v=h>>1)!=0&&(h=v,p+=1),p}function B(){return this.t<=0?0:this.DB*(this.t-1)+C(this[this.t-1]^this.s&this.DM)}function P(h,p){var v;for(v=this.t-1;v>=0;--v)p[v+h]=this[v];for(v=h-1;v>=0;--v)p[v]=0;p.t=this.t+h,p.s=this.s}function U(h,p){for(var v=h;v<this.t;++v)p[v-h]=this[v];p.t=Math.max(this.t-h,0),p.s=this.s}function F(h,p){var v=h%this.DB,_=this.DB-v,L=(1<<_)-1,M=Math.floor(h/this.DB),G=this.s<<v&this.DM,K;for(K=this.t-1;K>=0;--K)p[K+M+1]=this[K]>>_|G,G=(this[K]&L)<<v;for(K=M-1;K>=0;--K)p[K]=0;p[M]=G,p.t=this.t+M+1,p.s=this.s,p.clamp()}function H(h,p){p.s=this.s;var v=Math.floor(h/this.DB);if(v>=this.t){p.t=0;return}var _=h%this.DB,L=this.DB-_,M=(1<<_)-1;p[0]=this[v]>>_;for(var G=v+1;G<this.t;++G)p[G-v-1]|=(this[G]&M)<<L,p[G-v]=this[G]>>_;_>0&&(p[this.t-v-1]|=(this.s&M)<<L),p.t=this.t-v,p.clamp()}function j(h,p){for(var v=0,_=0,L=Math.min(h.t,this.t);v<L;)_+=this[v]-h[v],p[v++]=_&this.DM,_>>=this.DB;if(h.t<this.t){for(_-=h.s;v<this.t;)_+=this[v],p[v++]=_&this.DM,_>>=this.DB;_+=this.s}else{for(_+=this.s;v<h.t;)_-=h[v],p[v++]=_&this.DM,_>>=this.DB;_-=h.s}p.s=_<0?-1:0,_<-1?p[v++]=this.DV+_:_>0&&(p[v++]=_),p.t=v,p.clamp()}function V(h,p){var v=this.abs(),_=h.abs(),L=v.t;for(p.t=L+_.t;--L>=0;)p[L]=0;for(L=0;L<_.t;++L)p[L+v.t]=v.am(0,_[L],p,L,0,v.t);p.s=0,p.clamp(),this.s!=h.s&&r.ZERO.subTo(p,p)}function Y(h){for(var p=this.abs(),v=h.t=2*p.t;--v>=0;)h[v]=0;for(v=0;v<p.t-1;++v){var _=p.am(v,p[v],h,2*v,0,1);(h[v+p.t]+=p.am(v+1,2*p[v],h,2*v+1,_,p.t-v-1))>=p.DV&&(h[v+p.t]-=p.DV,h[v+p.t+1]=1)}h.t>0&&(h[h.t-1]+=p.am(v,p[v],h,2*v,0,1)),h.s=0,h.clamp()}function Q(h,p,v){var _=h.abs();if(!(_.t<=0)){var L=this.abs();if(L.t<_.t){p!=null&&p.fromInt(0),v!=null&&this.copyTo(v);return}v==null&&(v=n());var M=n(),G=this.s,K=h.s,Pe=this.DB-C(_[_.t-1]);Pe>0?(_.lShiftTo(Pe,M),L.lShiftTo(Pe,v)):(_.copyTo(M),L.copyTo(v));var Ye=M.t,Tt=M[Ye-1];if(Tt!=0){var wt=Tt*(1<<this.F1)+(Ye>1?M[Ye-2]>>this.F2:0),oi=this.FV/wt,ds=(1<<this.F1)/wt,jt=1<<this.F2,Ut=v.t,ms=Ut-Ye,_i=p==null?n():p;for(M.dlShiftTo(ms,_i),v.compareTo(_i)>=0&&(v[v.t++]=1,v.subTo(_i,v)),r.ONE.dlShiftTo(Ye,_i),_i.subTo(M,M);M.t<Ye;)M[M.t++]=0;for(;--ms>=0;){var Ca=v[--Ut]==Tt?this.DM:Math.floor(v[Ut]*oi+(v[Ut-1]+jt)*ds);if((v[Ut]+=M.am(0,Ca,v,ms,0,Ye))<Ca)for(M.dlShiftTo(ms,_i),v.subTo(_i,v);v[Ut]<--Ca;)v.subTo(_i,v)}p!=null&&(v.drShiftTo(Ye,p),G!=K&&r.ZERO.subTo(p,p)),v.t=Ye,v.clamp(),Pe>0&&v.rShiftTo(Pe,v),G<0&&r.ZERO.subTo(v,v)}}}function W(h){var p=n();return this.abs().divRemTo(h,null,p),this.s<0&&p.compareTo(r.ZERO)>0&&h.subTo(p,p),p}function de(h){this.m=h}function ae(h){return h.s<0||h.compareTo(this.m)>=0?h.mod(this.m):h}function ne(h){return h}function ue(h){h.divRemTo(this.m,null,h)}function N(h,p,v){h.multiplyTo(p,v),this.reduce(v)}function X(h,p){h.squareTo(p),this.reduce(p)}de.prototype.convert=ae,de.prototype.revert=ne,de.prototype.reduce=ue,de.prototype.mulTo=N,de.prototype.sqrTo=X;function ke(){if(this.t<1)return 0;var h=this[0];if((h&1)==0)return 0;var p=h&3;return p=p*(2-(h&15)*p)&15,p=p*(2-(h&255)*p)&255,p=p*(2-((h&65535)*p&65535))&65535,p=p*(2-h*p%this.DV)%this.DV,p>0?this.DV-p:-p}function be(h){this.m=h,this.mp=h.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<h.DB-15)-1,this.mt2=2*h.t}function ge(h){var p=n();return h.abs().dlShiftTo(this.m.t,p),p.divRemTo(this.m,null,p),h.s<0&&p.compareTo(r.ZERO)>0&&this.m.subTo(p,p),p}function ve(h){var p=n();return h.copyTo(p),this.reduce(p),p}function fe(h){for(;h.t<=this.mt2;)h[h.t++]=0;for(var p=0;p<this.m.t;++p){var v=h[p]&32767,_=v*this.mpl+((v*this.mph+(h[p]>>15)*this.mpl&this.um)<<15)&h.DM;for(v=p+this.m.t,h[v]+=this.m.am(0,_,h,p,0,this.m.t);h[v]>=h.DV;)h[v]-=h.DV,h[++v]++}h.clamp(),h.drShiftTo(this.m.t,h),h.compareTo(this.m)>=0&&h.subTo(this.m,h)}function z(h,p){h.squareTo(p),this.reduce(p)}function $(h,p,v){h.multiplyTo(p,v),this.reduce(v)}be.prototype.convert=ge,be.prototype.revert=ve,be.prototype.reduce=fe,be.prototype.mulTo=$,be.prototype.sqrTo=z;function Te(){return(this.t>0?this[0]&1:this.s)==0}function re(h,p){if(h>4294967295||h<1)return r.ONE;var v=n(),_=n(),L=p.convert(this),M=C(h)-1;for(L.copyTo(v);--M>=0;)if(p.sqrTo(v,_),(h&1<<M)>0)p.mulTo(_,L,v);else{var G=v;v=_,_=G}return p.revert(v)}function he(h,p){var v;return h<256||p.isEven()?v=new de(p):v=new be(p),this.exp(h,v)}r.prototype.copyTo=b,r.prototype.fromInt=x,r.prototype.fromString=k,r.prototype.clamp=O,r.prototype.dlShiftTo=P,r.prototype.drShiftTo=U,r.prototype.lShiftTo=F,r.prototype.rShiftTo=H,r.prototype.subTo=j,r.prototype.multiplyTo=V,r.prototype.squareTo=Y,r.prototype.divRemTo=Q,r.prototype.invDigit=ke,r.prototype.isEven=Te,r.prototype.exp=re,r.prototype.toString=E,r.prototype.negate=R,r.prototype.abs=T,r.prototype.compareTo=A,r.prototype.bitLength=B,r.prototype.mod=W,r.prototype.modPowInt=he,r.ZERO=S(0),r.ONE=S(1);function ht(){var h=n();return this.copyTo(h),h}function bt(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function I(){return this.t==0?this.s:this[0]<<24>>24}function Z(){return this.t==0?this.s:this[0]<<16>>16}function te(h){return Math.floor(Math.LN2*this.DB/Math.log(h))}function ee(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function le(h){if(h==null&&(h=10),this.signum()==0||h<2||h>36)return"0";var p=this.chunkSize(h),v=Math.pow(h,p),_=S(v),L=n(),M=n(),G="";for(this.divRemTo(_,L,M);L.signum()>0;)G=(v+M.intValue()).toString(h).substr(1)+G,L.divRemTo(_,L,M);return M.intValue().toString(h)+G}function ce(h,p){this.fromInt(0),p==null&&(p=10);for(var v=this.chunkSize(p),_=Math.pow(p,v),L=!1,M=0,G=0,K=0;K<h.length;++K){var Pe=y(h,K);if(Pe<0){h.charAt(K)=="-"&&this.signum()==0&&(L=!0);continue}G=p*G+Pe,++M>=v&&(this.dMultiply(_),this.dAddOffset(G,0),M=0,G=0)}M>0&&(this.dMultiply(Math.pow(p,M)),this.dAddOffset(G,0)),L&&r.ZERO.subTo(this,this)}function _e(h,p,v){if(typeof p=="number")if(h<2)this.fromInt(1);else for(this.fromNumber(h,v),this.testBit(h-1)||this.bitwiseTo(r.ONE.shiftLeft(h-1),oe,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(p);)this.dAddOffset(2,0),this.bitLength()>h&&this.subTo(r.ONE.shiftLeft(h-1),this);else{var _=new Array,L=h&7;_.length=(h>>3)+1,p.nextBytes(_),L>0?_[0]&=(1<<L)-1:_[0]=0,this.fromString(_,256)}}function we(){var h=this.t,p=new Array;p[0]=this.s;var v=this.DB-h*this.DB%8,_,L=0;if(h-- >0)for(v<this.DB&&(_=this[h]>>v)!=(this.s&this.DM)>>v&&(p[L++]=_|this.s<<this.DB-v);h>=0;)v<8?(_=(this[h]&(1<<v)-1)<<8-v,_|=this[--h]>>(v+=this.DB-8)):(_=this[h]>>(v-=8)&255,v<=0&&(v+=this.DB,--h)),(_&128)!=0&&(_|=-256),L==0&&(this.s&128)!=(_&128)&&++L,(L>0||_!=this.s)&&(p[L++]=_);return p}function Re(h){return this.compareTo(h)==0}function Ae(h){return this.compareTo(h)<0?this:h}function D(h){return this.compareTo(h)>0?this:h}function J(h,p,v){var _,L,M=Math.min(h.t,this.t);for(_=0;_<M;++_)v[_]=p(this[_],h[_]);if(h.t<this.t){for(L=h.s&this.DM,_=M;_<this.t;++_)v[_]=p(this[_],L);v.t=this.t}else{for(L=this.s&this.DM,_=M;_<h.t;++_)v[_]=p(L,h[_]);v.t=h.t}v.s=p(this.s,h.s),v.clamp()}function se(h,p){return h&p}function Ne(h){var p=n();return this.bitwiseTo(h,se,p),p}function oe(h,p){return h|p}function me(h){var p=n();return this.bitwiseTo(h,oe,p),p}function Ee(h,p){return h^p}function ie(h){var p=n();return this.bitwiseTo(h,Ee,p),p}function xe(h,p){return h&~p}function $e(h){var p=n();return this.bitwiseTo(h,xe,p),p}function Ie(){for(var h=n(),p=0;p<this.t;++p)h[p]=this.DM&~this[p];return h.t=this.t,h.s=~this.s,h}function pt(h){var p=n();return h<0?this.rShiftTo(-h,p):this.lShiftTo(h,p),p}function Ct(h){var p=n();return h<0?this.lShiftTo(-h,p):this.rShiftTo(h,p),p}function ni(h){if(h==0)return-1;var p=0;return(h&65535)==0&&(h>>=16,p+=16),(h&255)==0&&(h>>=8,p+=8),(h&15)==0&&(h>>=4,p+=4),(h&3)==0&&(h>>=2,p+=2),(h&1)==0&&++p,p}function yi(){for(var h=0;h<this.t;++h)if(this[h]!=0)return h*this.DB+ni(this[h]);return this.s<0?this.t*this.DB:-1}function bi(h){for(var p=0;h!=0;)h&=h-1,++p;return p}function Di(){for(var h=0,p=this.s&this.DM,v=0;v<this.t;++v)h+=bi(this[v]^p);return h}function ji(h){var p=Math.floor(h/this.DB);return p>=this.t?this.s!=0:(this[p]&1<<h%this.DB)!=0}function gr(h,p){var v=r.ONE.shiftLeft(h);return this.bitwiseTo(v,p,v),v}function Ui(h){return this.changeBit(h,oe)}function $i(h){return this.changeBit(h,xe)}function Vi(h){return this.changeBit(h,Ee)}function Hi(h,p){for(var v=0,_=0,L=Math.min(h.t,this.t);v<L;)_+=this[v]+h[v],p[v++]=_&this.DM,_>>=this.DB;if(h.t<this.t){for(_+=h.s;v<this.t;)_+=this[v],p[v++]=_&this.DM,_>>=this.DB;_+=this.s}else{for(_+=this.s;v<h.t;)_+=h[v],p[v++]=_&this.DM,_>>=this.DB;_+=h.s}p.s=_<0?-1:0,_>0?p[v++]=_:_<-1&&(p[v++]=this.DV+_),p.t=v,p.clamp()}function ts(h){var p=n();return this.addTo(h,p),p}function rn(h){var p=n();return this.subTo(h,p),p}function is(h){var p=n();return this.multiplyTo(h,p),p}function rs(){var h=n();return this.squareTo(h),h}function ns(h){var p=n();return this.divRemTo(h,p,null),p}function ss(h){var p=n();return this.divRemTo(h,null,p),p}function os(h){var p=n(),v=n();return this.divRemTo(h,p,v),new Array(p,v)}function Sa(h){this[this.t]=this.am(0,h-1,this,0,0,this.t),++this.t,this.clamp()}function Gi(h,p){if(h!=0){for(;this.t<=p;)this[this.t++]=0;for(this[p]+=h;this[p]>=this.DV;)this[p]-=this.DV,++p>=this.t&&(this[this.t++]=0),++this[p]}}function si(){}function Wi(h){return h}function vr(h,p,v){h.multiplyTo(p,v)}function as(h,p){h.squareTo(p)}si.prototype.convert=Wi,si.prototype.revert=Wi,si.prototype.mulTo=vr,si.prototype.sqrTo=as;function ls(h){return this.exp(h,new si)}function cs(h,p,v){var _=Math.min(this.t+h.t,p);for(v.s=0,v.t=_;_>0;)v[--_]=0;var L;for(L=v.t-this.t;_<L;++_)v[_+this.t]=this.am(0,h[_],v,_,0,this.t);for(L=Math.min(h.t,p);_<L;++_)this.am(0,h[_],v,_,0,p-_);v.clamp()}function us(h,p,v){--p;var _=v.t=this.t+h.t-p;for(v.s=0;--_>=0;)v[_]=0;for(_=Math.max(p-this.t,0);_<h.t;++_)v[this.t+_-p]=this.am(p-_,h[_],v,0,0,this.t+_-p);v.clamp(),v.drShiftTo(1,v)}function Yt(h){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*h.t,this.r2),this.mu=this.r2.divide(h),this.m=h}function fs(h){if(h.s<0||h.t>2*this.m.t)return h.mod(this.m);if(h.compareTo(this.m)<0)return h;var p=n();return h.copyTo(p),this.reduce(p),p}function hs(h){return h}function yr(h){for(h.drShiftTo(this.m.t-1,this.r2),h.t>this.m.t+1&&(h.t=this.m.t+1,h.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);h.compareTo(this.r2)<0;)h.dAddOffset(1,this.m.t+1);for(h.subTo(this.r2,h);h.compareTo(this.m)>=0;)h.subTo(this.m,h)}function Bb(h,p){h.squareTo(p),this.reduce(p)}function Lb(h,p,v){h.multiplyTo(p,v),this.reduce(v)}Yt.prototype.convert=fs,Yt.prototype.revert=hs,Yt.prototype.reduce=yr,Yt.prototype.mulTo=Lb,Yt.prototype.sqrTo=Bb;function Rb(h,p){var v=h.bitLength(),_,L=S(1),M;if(v<=0)return L;v<18?_=1:v<48?_=3:v<144?_=4:v<768?_=5:_=6,v<8?M=new de(p):p.isEven()?M=new Yt(p):M=new be(p);var G=new Array,K=3,Pe=_-1,Ye=(1<<_)-1;if(G[1]=M.convert(this),_>1){var Tt=n();for(M.sqrTo(G[1],Tt);K<=Ye;)G[K]=n(),M.mulTo(Tt,G[K-2],G[K]),K+=2}var wt=h.t-1,oi,ds=!0,jt=n(),Ut;for(v=C(h[wt])-1;wt>=0;){for(v>=Pe?oi=h[wt]>>v-Pe&Ye:(oi=(h[wt]&(1<<v+1)-1)<<Pe-v,wt>0&&(oi|=h[wt-1]>>this.DB+v-Pe)),K=_;(oi&1)==0;)oi>>=1,--K;if((v-=K)<0&&(v+=this.DB,--wt),ds)G[oi].copyTo(L),ds=!1;else{for(;K>1;)M.sqrTo(L,jt),M.sqrTo(jt,L),K-=2;K>0?M.sqrTo(L,jt):(Ut=L,L=jt,jt=Ut),M.mulTo(jt,G[oi],L)}for(;wt>=0&&(h[wt]&1<<v)==0;)M.sqrTo(L,jt),Ut=L,L=jt,jt=Ut,--v<0&&(v=this.DB-1,--wt)}return M.revert(L)}function Pb(h){var p=this.s<0?this.negate():this.clone(),v=h.s<0?h.negate():h.clone();if(p.compareTo(v)<0){var _=p;p=v,v=_}var L=p.getLowestSetBit(),M=v.getLowestSetBit();if(M<0)return p;for(L<M&&(M=L),M>0&&(p.rShiftTo(M,p),v.rShiftTo(M,v));p.signum()>0;)(L=p.getLowestSetBit())>0&&p.rShiftTo(L,p),(L=v.getLowestSetBit())>0&&v.rShiftTo(L,v),p.compareTo(v)>=0?(p.subTo(v,p),p.rShiftTo(1,p)):(v.subTo(p,v),v.rShiftTo(1,v));return M>0&&v.lShiftTo(M,v),v}function Mb(h){if(h<=0)return 0;var p=this.DV%h,v=this.s<0?h-1:0;if(this.t>0)if(p==0)v=this[0]%h;else for(var _=this.t-1;_>=0;--_)v=(p*v+this[_])%h;return v}function qb(h){var p=h.isEven();if(this.isEven()&&p||h.signum()==0)return r.ZERO;for(var v=h.clone(),_=this.clone(),L=S(1),M=S(0),G=S(0),K=S(1);v.signum()!=0;){for(;v.isEven();)v.rShiftTo(1,v),p?((!L.isEven()||!M.isEven())&&(L.addTo(this,L),M.subTo(h,M)),L.rShiftTo(1,L)):M.isEven()||M.subTo(h,M),M.rShiftTo(1,M);for(;_.isEven();)_.rShiftTo(1,_),p?((!G.isEven()||!K.isEven())&&(G.addTo(this,G),K.subTo(h,K)),G.rShiftTo(1,G)):K.isEven()||K.subTo(h,K),K.rShiftTo(1,K);v.compareTo(_)>=0?(v.subTo(_,v),p&&L.subTo(G,L),M.subTo(K,M)):(_.subTo(v,_),p&&G.subTo(L,G),K.subTo(M,K))}if(_.compareTo(r.ONE)!=0)return r.ZERO;if(K.compareTo(h)>=0)return K.subtract(h);if(K.signum()<0)K.addTo(h,K);else return K;return K.signum()<0?K.add(h):K}var ot=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Fb=(1<<26)/ot[ot.length-1];function Db(h){var p,v=this.abs();if(v.t==1&&v[0]<=ot[ot.length-1]){for(p=0;p<ot.length;++p)if(v[0]==ot[p])return!0;return!1}if(v.isEven())return!1;for(p=1;p<ot.length;){for(var _=ot[p],L=p+1;L<ot.length&&_<Fb;)_*=ot[L++];for(_=v.modInt(_);p<L;)if(_%ot[p++]==0)return!1}return v.millerRabin(h)}function jb(h){var p=this.subtract(r.ONE),v=p.getLowestSetBit();if(v<=0)return!1;var _=p.shiftRight(v);h=h+1>>1,h>ot.length&&(h=ot.length);for(var L=n(),M=0;M<h;++M){L.fromInt(ot[Math.floor(Math.random()*ot.length)]);var G=L.modPow(_,this);if(G.compareTo(r.ONE)!=0&&G.compareTo(p)!=0){for(var K=1;K++<v&&G.compareTo(p)!=0;)if(G=G.modPowInt(2,this),G.compareTo(r.ONE)==0)return!1;if(G.compareTo(p)!=0)return!1}}return!0}r.prototype.chunkSize=te,r.prototype.toRadix=le,r.prototype.fromRadix=ce,r.prototype.fromNumber=_e,r.prototype.bitwiseTo=J,r.prototype.changeBit=gr,r.prototype.addTo=Hi,r.prototype.dMultiply=Sa,r.prototype.dAddOffset=Gi,r.prototype.multiplyLowerTo=cs,r.prototype.multiplyUpperTo=us,r.prototype.modInt=Mb,r.prototype.millerRabin=jb,r.prototype.clone=ht,r.prototype.intValue=bt,r.prototype.byteValue=I,r.prototype.shortValue=Z,r.prototype.signum=ee,r.prototype.toByteArray=we,r.prototype.equals=Re,r.prototype.min=Ae,r.prototype.max=D,r.prototype.and=Ne,r.prototype.or=me,r.prototype.xor=ie,r.prototype.andNot=$e,r.prototype.not=Ie,r.prototype.shiftLeft=pt,r.prototype.shiftRight=Ct,r.prototype.getLowestSetBit=yi,r.prototype.bitCount=Di,r.prototype.testBit=ji,r.prototype.setBit=Ui,r.prototype.clearBit=$i,r.prototype.flipBit=Vi,r.prototype.add=ts,r.prototype.subtract=rn,r.prototype.multiply=is,r.prototype.divide=ns,r.prototype.remainder=ss,r.prototype.divideAndRemainder=os,r.prototype.modPow=Rb,r.prototype.modInverse=qb,r.prototype.pow=ls,r.prototype.gcd=Pb,r.prototype.isProbablePrime=Db,r.prototype.square=rs,r.prototype.Barrett=Yt;var ps,_t,We;function Ub(h){_t[We++]^=h&255,_t[We++]^=h>>8&255,_t[We++]^=h>>16&255,_t[We++]^=h>>24&255,We>=ka&&(We-=ka)}function xf(){Ub(new Date().getTime())}if(_t==null){_t=new Array,We=0;var Dt;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Sf=new Uint8Array(32);for(window.crypto.getRandomValues(Sf),Dt=0;Dt<32;++Dt)_t[We++]=Sf[Dt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Ef=window.crypto.random(32);for(Dt=0;Dt<Ef.length;++Dt)_t[We++]=Ef.charCodeAt(Dt)&255}}for(;We<ka;)Dt=Math.floor(65536*Math.random()),_t[We++]=Dt>>>8,_t[We++]=Dt&255;We=0,xf()}function $b(){if(ps==null){for(xf(),ps=Wb(),ps.init(_t),We=0;We<_t.length;++We)_t[We]=0;We=0}return ps.next()}function Vb(h){var p;for(p=0;p<h.length;++p)h[p]=$b()}function Ea(){}Ea.prototype.nextBytes=Vb;function Oa(){this.i=0,this.j=0,this.S=new Array}function Hb(h){var p,v,_;for(p=0;p<256;++p)this.S[p]=p;for(v=0,p=0;p<256;++p)v=v+this.S[p]+h[p%h.length]&255,_=this.S[p],this.S[p]=this.S[v],this.S[v]=_;this.i=0,this.j=0}function Gb(){var h;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,h=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=h,this.S[h+this.S[this.i]&255]}Oa.prototype.init=Hb,Oa.prototype.next=Gb;function Wb(){return new Oa}var ka=256;typeof Ys!="undefined"?Ys=Im.exports={default:r,BigInteger:r,SecureRandom:Ea}:this.jsbn={BigInteger:r,SecureRandom:Ea}}).call(Ys)});var hn=w(Ks=>{(function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(o){return r(s(o),arguments)}function t(o,a){return e.apply(null,[o].concat(a||[]))}function r(o,a){var l=1,c=o.length,u,f="",d,m,g,y,b,x,S,k;for(d=0;d<c;d++)if(typeof o[d]=="string")f+=o[d];else if(typeof o[d]=="object"){if(g=o[d],g.keys)for(u=a[l],m=0;m<g.keys.length;m++){if(u==null)throw new Error(e('[sprintf] Cannot access property "%s" of undefined value "%s"',g.keys[m],g.keys[m-1]));u=u[g.keys[m]]}else g.param_no?u=a[g.param_no]:u=a[l++];if(i.not_type.test(g.type)&&i.not_primitive.test(g.type)&&u instanceof Function&&(u=u()),i.numeric_arg.test(g.type)&&typeof u!="number"&&isNaN(u))throw new TypeError(e("[sprintf] expecting number but found %T",u));switch(i.number.test(g.type)&&(S=u>=0),g.type){case"b":u=parseInt(u,10).toString(2);break;case"c":u=String.fromCharCode(parseInt(u,10));break;case"d":case"i":u=parseInt(u,10);break;case"j":u=JSON.stringify(u,null,g.width?parseInt(g.width):0);break;case"e":u=g.precision?parseFloat(u).toExponential(g.precision):parseFloat(u).toExponential();break;case"f":u=g.precision?parseFloat(u).toFixed(g.precision):parseFloat(u);break;case"g":u=g.precision?String(Number(u.toPrecision(g.precision))):parseFloat(u);break;case"o":u=(parseInt(u,10)>>>0).toString(8);break;case"s":u=String(u),u=g.precision?u.substring(0,g.precision):u;break;case"t":u=String(!!u),u=g.precision?u.substring(0,g.precision):u;break;case"T":u=Object.prototype.toString.call(u).slice(8,-1).toLowerCase(),u=g.precision?u.substring(0,g.precision):u;break;case"u":u=parseInt(u,10)>>>0;break;case"v":u=u.valueOf(),u=g.precision?u.substring(0,g.precision):u;break;case"x":u=(parseInt(u,10)>>>0).toString(16);break;case"X":u=(parseInt(u,10)>>>0).toString(16).toUpperCase();break}i.json.test(g.type)?f+=u:(i.number.test(g.type)&&(!S||g.sign)?(k=S?"+":"-",u=u.toString().replace(i.sign,"")):k="",b=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",x=g.width-(k+u).length,y=g.width&&x>0?b.repeat(x):"",f+=g.align?k+u+y:b==="0"?k+y+u:y+k+u)}return f}var n=Object.create(null);function s(o){if(n[o])return n[o];for(var a=o,l,c=[],u=0;a;){if((l=i.text.exec(a))!==null)c.push(l[0]);else if((l=i.modulo.exec(a))!==null)c.push("%");else if((l=i.placeholder.exec(a))!==null){if(l[2]){u|=1;var f=[],d=l[2],m=[];if((m=i.key.exec(d))!==null)for(f.push(m[1]);(d=d.substring(m[0].length))!=="";)if((m=i.key_access.exec(d))!==null)f.push(m[1]);else if((m=i.index_access.exec(d))!==null)f.push(m[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=f}else u|=2;if(u===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(l[0].length)}return n[o]=c}typeof Ks!="undefined"&&(Ks.sprintf=e,Ks.vsprintf=t),typeof window!="undefined"&&(window.sprintf=e,window.vsprintf=t,typeof define=="function"&&define.amd&&define(function(){return{sprintf:e,vsprintf:t}}))})()});var Jl=w(Zt=>{"use strict";var yS=Zt&&Zt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),bS=Zt&&Zt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Lm=Zt&&Zt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&yS(e,i,t);return bS(e,i),e};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.Address4=void 0;var Nm=Lm(Gl()),Ht=Lm(Wl()),Bm=Ws(),pn=Kl(),Rr=hn(),zl=class i{constructor(e){this.groups=Ht.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Nm.isCorrect(Ht.BITS),this.isInSubnet=Nm.isInSubnet,this.address=e;let t=Ht.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>Ht.BITS)throw new Bm.AddressError("Invalid subnet mask.");e=e.replace(Ht.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new i(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(Ht.RE_ADDRESS))throw new Bm.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],n;for(n=0;n<8;n+=2){let s=t.slice(n,n+2);r.push(parseInt(s,16))}return new i(r.join("."))}static fromInteger(e){return i.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new i(r)}toHex(){return this.parsedAddress.map(e=>(0,Rr.sprintf)("%02x",parseInt(e,10))).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<Ht.GROUPS;t+=2){let r=(0,Rr.sprintf)("%02x%02x",parseInt(this.parsedAddress[t],10),parseInt(this.parsedAddress[t+1],10));e.push((0,Rr.sprintf)("%x",parseInt(r,16)))}return e.join(":")}bigInteger(){return new pn.BigInteger(this.parsedAddress.map(e=>(0,Rr.sprintf)("%02x",parseInt(e,10))).join(""),16)}_startAddress(){return new pn.BigInteger(this.mask()+"0".repeat(Ht.BITS-this.subnetMask),2)}startAddress(){return i.fromBigInteger(this._startAddress())}startAddressExclusive(){let e=new pn.BigInteger("1");return i.fromBigInteger(this._startAddress().add(e))}_endAddress(){return new pn.BigInteger(this.mask()+"1".repeat(Ht.BITS-this.subnetMask),2)}endAddress(){return i.fromBigInteger(this._endAddress())}endAddressExclusive(){let e=new pn.BigInteger("1");return i.fromBigInteger(this._endAddress().subtract(e))}static fromBigInteger(e){return i.fromInteger(parseInt(e.toString(),10))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:(0,Rr.sprintf)("%s.in-addr.arpa.",t)}isMulticast(){return this.isInSubnet(new i("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(Ht.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(Ht.RE_ADDRESS,(0,Rr.sprintf)('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',e.slice(0,2).join("."),e.slice(2,4).join(".")))}};Zt.Address4=zl});var Zl=w(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.RE_URL_WITH_PORT=Fe.RE_URL=Fe.RE_ZONE_STRING=Fe.RE_SUBNET_STRING=Fe.RE_BAD_ADDRESS=Fe.RE_BAD_CHARACTERS=Fe.TYPES=Fe.SCOPES=Fe.GROUPS=Fe.BITS=void 0;Fe.BITS=128;Fe.GROUPS=8;Fe.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};Fe.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};Fe.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;Fe.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;Fe.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;Fe.RE_ZONE_STRING=/%.*$/;Fe.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);Fe.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var Ql=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.simpleGroup=Qt.spanLeadingZeroes=Qt.spanAll=Qt.spanAllZeroes=void 0;var Rm=hn();function Pm(i){return i.replace(/(0+)/g,'<span class="zero">$1</span>')}Qt.spanAllZeroes=Pm;function _S(i,e=0){return i.split("").map((r,n)=>(0,Rm.sprintf)('<span class="digit value-%s position-%d">%s</span>',r,n+e,Pm(r))).join("")}Qt.spanAll=_S;function Mm(i){return i.replace(/^(0+)/,'<span class="zero">$1</span>')}function wS(i){return i.split(":").map(t=>Mm(t)).join(":")}Qt.spanLeadingZeroes=wS;function xS(i,e=0){return i.split(":").map((r,n)=>/group-v4/.test(r)?r:(0,Rm.sprintf)('<span class="hover-group group-%d">%s</span>',n+e,Mm(r)))}Qt.simpleGroup=xS});var qm=w(Je=>{"use strict";var SS=Je&&Je.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),ES=Je&&Je.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),OS=Je&&Je.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&SS(e,i,t);return ES(e,i),e};Object.defineProperty(Je,"__esModule",{value:!0});Je.possibleElisions=Je.simpleRegularExpression=Je.ADDRESS_BOUNDARY=Je.padGroup=Je.groupPossibilities=void 0;var kS=OS(Zl()),Pr=hn();function Js(i){return(0,Pr.sprintf)("(%s)",i.join("|"))}Je.groupPossibilities=Js;function zs(i){return i.length<4?(0,Pr.sprintf)("0{0,%d}%s",4-i.length,i):i}Je.padGroup=zs;Je.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function CS(i){let e=[];i.forEach((r,n)=>{parseInt(r,16)===0&&e.push(n)});let t=e.map(r=>i.map((n,s)=>{if(s===r){let o=s===0||s===kS.GROUPS-1?":":"";return Js([zs(n),o])}return zs(n)}).join(":"));return t.push(i.map(zs).join(":")),Js(t)}Je.simpleRegularExpression=CS;function TS(i,e,t){let r=e?"":":",n=t?"":":",s=[];!e&&!t&&s.push("::"),e&&t&&s.push(""),(t&&!e||!t&&e)&&s.push(":"),s.push((0,Pr.sprintf)("%s(:0{1,4}){1,%d}",r,i-1)),s.push((0,Pr.sprintf)("(0{1,4}:){1,%d}%s",i-1,n)),s.push((0,Pr.sprintf)("(0{1,4}:){%d}0{1,4}",i-1));for(let o=1;o<i-1;o++)for(let a=1;a<i-o;a++)s.push((0,Pr.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",a,i-a-o-1));return Js(s)}Je.possibleElisions=TS});var Um=w(Xt=>{"use strict";var AS=Xt&&Xt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),IS=Xt&&Xt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Qs=Xt&&Xt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&AS(e,i,t);return IS(e,i),e};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.Address6=void 0;var Fm=Qs(Gl()),Xl=Qs(Wl()),Le=Qs(Zl()),ec=Qs(Ql()),Qi=Jl(),Xi=qm(),hi=Ws(),ct=Kl(),ut=hn();function Zs(i){if(!i)throw new Error("Assertion failed.")}function NS(i){let e=/(\d+)(\d{3})/;for(;e.test(i);)i=i.replace(e,"$1,$2");return i}function BS(i){return i=i.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),i=i.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),i}function LS(i,e){let t=[],r=[],n;for(n=0;n<i.length;n++)n<e[0]?t.push(i[n]):n>e[1]&&r.push(i[n]);return t.concat(["compact"]).concat(r)}function Dm(i){return(0,ut.sprintf)("%04x",parseInt(i,16))}function jm(i){return i&255}var tc=class i{constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=Fm.isInSubnet,this.isCorrect=Fm.isCorrect(Le.BITS),t===void 0?this.groups=Le.GROUPS:this.groups=t,this.address=e;let r=Le.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>Le.BITS)throw new hi.AddressError("Invalid subnet mask.");e=e.replace(Le.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new hi.AddressError("Invalid subnet mask.");let n=Le.RE_ZONE_STRING.exec(e);n&&(this.zone=n[0],e=e.replace(Le.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new i(e),!0}catch{return!1}}static fromBigInteger(e){let t=e.toString(16).padStart(32,"0"),r=[],n;for(n=0;n<Le.GROUPS;n++)r.push(t.slice(n*4,(n+1)*4));return new i(r.join(":"))}static fromURL(e){let t,r=null,n;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(n=Le.RE_URL_WITH_PORT.exec(e),n===null)return{error:"failed to parse address with port",address:null,port:null};t=n[1],r=n[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),n=Le.RE_URL.exec(e),n===null)return{error:"failed to parse address from URL",address:null,port:null};t=n[1]}else t=e;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new i(t),port:r}}static fromAddress4(e){let t=new Qi.Address4(e),r=Le.BITS-(Xl.BITS-t.subnetMask);return new i(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new hi.AddressError("Invalid 'ip6.arpa' form.");let n=t.split(".").reverse();for(let s=r;s>0;s--){let o=s*4;n.splice(o,0,":")}return t=n.join(""),new i(t)}microsoftTranscription(){return(0,ut.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=Le.BITS-this.subnetMask,r=Math.abs(e-Le.BITS),n=t-r;return n<0?"0":NS(new ct.BigInteger("2",10).pow(n).toString(10))}_startAddress(){return new ct.BigInteger(this.mask()+"0".repeat(Le.BITS-this.subnetMask),2)}startAddress(){return i.fromBigInteger(this._startAddress())}startAddressExclusive(){let e=new ct.BigInteger("1");return i.fromBigInteger(this._startAddress().add(e))}_endAddress(){return new ct.BigInteger(this.mask()+"1".repeat(Le.BITS-this.subnetMask),2)}endAddress(){return i.fromBigInteger(this._endAddress())}endAddressExclusive(){let e=new ct.BigInteger("1");return i.fromBigInteger(this._endAddress().subtract(e))}getScope(){let e=Le.SCOPES[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys(Le.TYPES))if(this.isInSubnet(new i(e)))return Le.TYPES[e];return"Global unicast"}getBits(e,t){return new ct.BigInteger(this.getBitsBase2(e,t),2)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,Le.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:(0,ut.sprintf)("%s.ip6.arpa.",r):e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,n=[];for(e=0;e<this.parsedAddress.length;e++){let a=parseInt(this.parsedAddress[e],16);a===0&&r++,a!==0&&r>0&&(r>1&&n.push([e-r,e-1]),r=0)}r>1&&n.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let s=n.map(a=>a[1]-a[0]+1);if(n.length>0){let a=s.indexOf(Math.max(...s));t=LS(this.parsedAddress,n[a])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!=="compact"&&(t[e]=parseInt(t[e],16).toString(16));let o=t.join(":");return o=o.replace(/^compact$/,"::"),o=o.replace(/^compact|compact$/,":"),o=o.replace(/compact/,""),o}binaryZeroPad(){return this.bigInteger().toString(2).padStart(Le.BITS,"0")}parse4in6(e){let t=e.split(":"),n=t.slice(-1)[0].match(Xl.RE_ADDRESS);if(n){this.parsedAddress4=n[0],this.address4=new Qi.Address4(this.parsedAddress4);for(let s=0;s<this.address4.groups;s++)if(/^0[0-9]+/.test(this.address4.parsedAddress[s]))throw new hi.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(Xl.RE_ADDRESS,this.address4.parsedAddress.map(BS).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e}parse(e){e=this.parse4in6(e);let t=e.match(Le.RE_BAD_CHARACTERS);if(t)throw new hi.AddressError((0,ut.sprintf)("Bad character%s detected in address: %s",t.length>1?"s":"",t.join("")),e.replace(Le.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match(Le.RE_BAD_ADDRESS);if(r)throw new hi.AddressError((0,ut.sprintf)("Address failed regex: %s",r.join("")),e.replace(Le.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let n=[],s=e.split("::");if(s.length===2){let o=s[0].split(":"),a=s[1].split(":");o.length===1&&o[0]===""&&(o=[]),a.length===1&&a[0]===""&&(a=[]);let l=this.groups-(o.length+a.length);if(!l)throw new hi.AddressError("Error parsing groups");this.elidedGroups=l,this.elisionBegin=o.length,this.elisionEnd=o.length+this.elidedGroups,n=n.concat(o);for(let c=0;c<l;c++)n.push("0");n=n.concat(a)}else if(s.length===1)n=e.split(":"),this.elidedGroups=0;else throw new hi.AddressError("Too many :: groups found");if(n=n.map(o=>(0,ut.sprintf)("%x",parseInt(o,16))),n.length!==this.groups)throw new hi.AddressError("Incorrect number of groups found");return n}canonicalForm(){return this.parsedAddress.map(Dm).join(":")}decimal(){return this.parsedAddress.map(e=>(0,ut.sprintf)("%05d",parseInt(e,16))).join(":")}bigInteger(){return new ct.BigInteger(this.parsedAddress.map(Dm).join(""),16)}to4(){let e=this.binaryZeroPad().split("");return Qi.Address4.fromHex(new ct.BigInteger(e.slice(96,128).join(""),2).toString(16))}to4in6(){let e=this.to4(),r=new i(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),n="";return/:$/.test(r)||(n=":"),r+n+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),t=this.getBits(80,96).xor(new ct.BigInteger("ffff",16)).toString(),r=Qi.Address4.fromHex(this.getBitsBase16(32,64)),n=Qi.Address4.fromHex(this.getBits(96,128).xor(new ct.BigInteger("ffffffff",16)).toString(16)),s=this.getBits(64,80),o=this.getBitsBase2(64,80),a=s.testBit(15),l=s.testBit(14),c=s.testBit(8),u=s.testBit(9),f=new ct.BigInteger(o.slice(2,6)+o.slice(8,16),2).toString(10);return{prefix:(0,ut.sprintf)("%s:%s",e.slice(0,4),e.slice(4,8)),server4:r.address,client4:n.address,flags:o,coneNat:a,microsoft:{reserved:l,universalLocal:u,groupIndividual:c,nonce:f},udpPort:t}}inspect6to4(){let e=this.getBitsBase16(0,16),t=Qi.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:(0,ut.sprintf)("%s",e.slice(0,4)),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new i(e)}toByteArray(){let e=this.bigInteger().toByteArray();return e.length===17&&e[0]===0?e.slice(1):e}toUnsignedByteArray(){return this.toByteArray().map(jm)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(jm))}static fromUnsignedByteArray(e){let t=new ct.BigInteger("256",10),r=new ct.BigInteger("0",10),n=new ct.BigInteger("1",10);for(let s=e.length-1;s>=0;s--)r=r.add(n.multiply(new ct.BigInteger(e[s].toString(10),10))),n=n.multiply(t);return i.fromBigInteger(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new i("2001::/32"))}is6to4(){return this.isInSubnet(new i("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=(0,ut.sprintf)(":%s",e),(0,ut.sprintf)("http://[%s]%s/",this.correctForm(),e)}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;return e.v4&&(t=this.to4in6),e.className?(0,ut.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',e.prefix,t.call(this),e.className):(0,ut.sprintf)('<a href="%1$s%2$s">%2$s</a>',e.prefix,t.call(this))}group(){if(this.elidedGroups===0)return ec.simpleGroup(this.address).join(":");Zs(typeof this.elidedGroups=="number"),Zs(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...ec.simpleGroup(t)):e.push("");let n=["hover-group"];for(let s=this.elisionBegin;s<this.elisionBegin+this.elidedGroups;s++)n.push((0,ut.sprintf)("group-%d",s));return e.push((0,ut.sprintf)('<span class="%s"></span>',n.join(" "))),r.length?e.push(...ec.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(Zs(this.address4 instanceof Qi.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new i(this.correctForm());if(r.elidedGroups===0)t.push((0,Xi.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===Le.GROUPS)t.push((0,Xi.possibleElisions)(Le.GROUPS));else{let n=r.address.split("::");n[0].length&&t.push((0,Xi.simpleRegularExpression)(n[0].split(":"))),Zs(typeof r.elidedGroups=="number"),t.push((0,Xi.possibleElisions)(r.elidedGroups,n[0].length!==0,n[1].length!==0)),n[1].length&&t.push((0,Xi.simpleRegularExpression)(n[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",Xi.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",Xi.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Xt.Address6=tc});var ic=w(nt=>{"use strict";var RS=nt&&nt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),PS=nt&&nt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),MS=nt&&nt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&RS(e,i,t);return PS(e,i),e};Object.defineProperty(nt,"__esModule",{value:!0});nt.v6=nt.AddressError=nt.Address6=nt.Address4=void 0;var qS=Jl();Object.defineProperty(nt,"Address4",{enumerable:!0,get:function(){return qS.Address4}});var FS=Um();Object.defineProperty(nt,"Address6",{enumerable:!0,get:function(){return FS.Address6}});var DS=Ws();Object.defineProperty(nt,"AddressError",{enumerable:!0,get:function(){return DS.AddressError}});var jS=MS(Ql());nt.v6={helpers:jS}});var Ym=w(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.ipToBuffer=Rt.int32ToIpv4=Rt.ipv4ToInt32=Rt.validateSocksClientChainOptions=Rt.validateSocksClientOptions=void 0;var ft=Hl(),Ze=$l(),US=require("stream"),rc=ic(),$m=require("net");function $S(i,e=["connect","bind","associate"]){if(!Ze.SocksCommand[i.command])throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksCommand,i);if(e.indexOf(i.command)===-1)throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksCommandForOperation,i);if(!Hm(i.destination))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsDestination,i);if(!Gm(i.proxy))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsProxy,i);if(Vm(i.proxy,i),i.timeout&&!Wm(i.timeout))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsTimeout,i);if(i.existing_socket&&!(i.existing_socket instanceof US.Duplex))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsExistingSocket,i)}Rt.validateSocksClientOptions=$S;function VS(i){if(i.command!=="connect")throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksCommandChain,i);if(!Hm(i.destination))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsDestination,i);if(!(i.proxies&&Array.isArray(i.proxies)&&i.proxies.length>=2))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsProxiesLength,i);if(i.proxies.forEach(e=>{if(!Gm(e))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsProxy,i);Vm(e,i)}),i.timeout&&!Wm(i.timeout))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsTimeout,i)}Rt.validateSocksClientChainOptions=VS;function Vm(i,e){if(i.custom_auth_method!==void 0){if(i.custom_auth_method<Ze.SOCKS5_CUSTOM_AUTH_START||i.custom_auth_method>Ze.SOCKS5_CUSTOM_AUTH_END)throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(i.custom_auth_request_handler===void 0||typeof i.custom_auth_request_handler!="function")throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_size===void 0)throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_handler===void 0||typeof i.custom_auth_response_handler!="function")throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}function Hm(i){return i&&typeof i.host=="string"&&typeof i.port=="number"&&i.port>=0&&i.port<=65535}function Gm(i){return i&&(typeof i.host=="string"||typeof i.ipaddress=="string")&&typeof i.port=="number"&&i.port>=0&&i.port<=65535&&(i.type===4||i.type===5)}function Wm(i){return typeof i=="number"&&i>0}function HS(i){return new rc.Address4(i).toArray().reduce((t,r)=>(t<<8)+r,0)}Rt.ipv4ToInt32=HS;function GS(i){let e=i>>>24&255,t=i>>>16&255,r=i>>>8&255,n=i&255;return[e,t,r,n].join(".")}Rt.int32ToIpv4=GS;function WS(i){if($m.isIPv4(i)){let e=new rc.Address4(i);return Buffer.from(e.toArray())}else if($m.isIPv6(i)){let e=new rc.Address6(i);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}Rt.ipToBuffer=WS});var Km=w(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.ReceiveBuffer=void 0;var nc=class{constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};Xs.ReceiveBuffer=nc});var zm=w(Ei=>{"use strict";var Mr=Ei&&Ei.__awaiter||function(i,e,t,r){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(a,l)}c((r=r.apply(i,e||[])).next())})};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.SocksClientError=Ei.SocksClient=void 0;var YS=require("events"),qr=require("net"),gt=Sm(),q=$l(),Ot=Ym(),KS=Km(),oc=Hl();Object.defineProperty(Ei,"SocksClientError",{enumerable:!0,get:function(){return oc.SocksClientError}});var sc=ic(),ac=class i extends YS.EventEmitter{constructor(e){super(),this.options=Object.assign({},e),(0,Ot.validateSocksClientOptions)(e),this.setState(q.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,n)=>{try{(0,Ot.validateSocksClientOptions)(e,["connect"])}catch(o){return typeof t=="function"?(t(o),r(o)):n(o)}let s=new i(e);s.connect(e.existing_socket),s.once("established",o=>{s.removeAllListeners(),typeof t=="function"&&t(null,o),r(o)}),s.once("error",o=>{s.removeAllListeners(),typeof t=="function"?(t(o),r(o)):n(o)})})}static createConnectionChain(e,t){return new Promise((r,n)=>Mr(this,void 0,void 0,function*(){try{(0,Ot.validateSocksClientChainOptions)(e)}catch(s){return typeof t=="function"?(t(s),r(s)):n(s)}e.randomizeChain&&(0,oc.shuffleArray)(e.proxies);try{let s;for(let o=0;o<e.proxies.length;o++){let a=e.proxies[o],l=o===e.proxies.length-1?e.destination:{host:e.proxies[o+1].host||e.proxies[o+1].ipaddress,port:e.proxies[o+1].port},c=yield i.createConnection({command:"connect",proxy:a,destination:l,existing_socket:s});s=s||c.socket}typeof t=="function"?(t(null,{socket:s}),r({socket:s})):r({socket:s})}catch(s){typeof t=="function"?(t(s),r(s)):n(s)}}))}static createUDPFrame(e){let t=new gt.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),qr.isIPv4(e.remoteHost.host)?(t.writeUInt8(q.Socks5HostType.IPv4),t.writeUInt32BE((0,Ot.ipv4ToInt32)(e.remoteHost.host))):qr.isIPv6(e.remoteHost.host)?(t.writeUInt8(q.Socks5HostType.IPv6),t.writeBuffer((0,Ot.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(q.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=gt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r=t.readUInt8(),n=t.readUInt8(),s;n===q.Socks5HostType.IPv4?s=(0,Ot.int32ToIpv4)(t.readUInt32BE()):n===q.Socks5HostType.IPv6?s=sc.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():s=t.readString(t.readUInt8());let o=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:s,port:o},data:t.readBuffer()}}setState(e){this.state!==q.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||q.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new qr.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(q.SocksClientState.Connecting),this.receiveBuffer=new KS.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let n=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",n)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==q.SocksClientState.Established&&this.state!==q.SocksClientState.BoundWaitingForConnection&&this.closeSocket(q.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(q.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(q.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==q.SocksClientState.Established&&this.state!==q.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===q.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===q.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===q.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===q.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(q.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(q.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==q.SocksClientState.Error&&(this.setState(q.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new oc.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new gt.SmartBuffer;t.writeUInt8(4),t.writeUInt8(q.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),qr.isIPv4(this.options.destination.host)?(t.writeBuffer((0,Ot.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==q.Socks4Response.Granted)this.closeSocket(`${q.ERRORS.Socks4ProxyRejectedConnection} - (${q.Socks4Response[e[1]]})`);else if(q.SocksCommand[this.options.command]===q.SocksCommand.bind){let t=gt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Ot.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(q.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(q.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==q.Socks4Response.Granted)this.closeSocket(`${q.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${q.Socks4Response[e[1]]})`);else{let t=gt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Ot.int32ToIpv4)(t.readUInt32BE())};this.setState(q.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new gt.SmartBuffer,t=[q.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(q.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(q.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(q.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===q.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(q.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===q.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=q.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===q.Socks5Auth.UserPass?(this.socks5ChosenAuthType=q.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(q.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new gt.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(q.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return Mr(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(q.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return Mr(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return Mr(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return Mr(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return Mr(this,void 0,void 0,function*(){this.setState(q.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===q.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===q.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(q.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new gt.SmartBuffer;e.writeUInt8(5),e.writeUInt8(q.SocksCommand[this.options.command]),e.writeUInt8(0),qr.isIPv4(this.options.destination.host)?(e.writeUInt8(q.Socks5HostType.IPv4),e.writeBuffer((0,Ot.ipToBuffer)(this.options.destination.host))):qr.isIPv6(this.options.destination.host)?(e.writeUInt8(q.Socks5HostType.IPv6),e.writeBuffer((0,Ot.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(q.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(q.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==q.Socks5Response.Granted)this.closeSocket(`${q.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${q.Socks5Response[e[1]]}`);else{let t=e[3],r,n;if(t===q.Socks5HostType.IPv4){let s=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<s){this.nextRequiredPacketBufferSize=s;return}n=gt.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)),r={host:(0,Ot.int32ToIpv4)(n.readUInt32BE()),port:n.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===q.Socks5HostType.Hostname){let s=e[4],o=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(s);if(this.receiveBuffer.length<o){this.nextRequiredPacketBufferSize=o;return}n=gt.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)),r={host:n.readString(s),port:n.readUInt16BE()}}else if(t===q.Socks5HostType.IPv6){let s=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<s){this.nextRequiredPacketBufferSize=s;return}n=gt.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)),r={host:sc.Address6.fromByteArray(Array.from(n.readBuffer(16))).canonicalForm(),port:n.readUInt16BE()}}this.setState(q.SocksClientState.ReceivedFinalResponse),q.SocksCommand[this.options.command]===q.SocksCommand.connect?(this.setState(q.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):q.SocksCommand[this.options.command]===q.SocksCommand.bind?(this.setState(q.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):q.SocksCommand[this.options.command]===q.SocksCommand.associate&&(this.setState(q.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==q.Socks5Response.Granted)this.closeSocket(`${q.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${q.Socks5Response[e[1]]}`);else{let t=e[3],r,n;if(t===q.Socks5HostType.IPv4){let s=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<s){this.nextRequiredPacketBufferSize=s;return}n=gt.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)),r={host:(0,Ot.int32ToIpv4)(n.readUInt32BE()),port:n.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===q.Socks5HostType.Hostname){let s=e[4],o=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(s);if(this.receiveBuffer.length<o){this.nextRequiredPacketBufferSize=o;return}n=gt.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)),r={host:n.readString(s),port:n.readUInt16BE()}}else if(t===q.Socks5HostType.IPv6){let s=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<s){this.nextRequiredPacketBufferSize=s;return}n=gt.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)),r={host:sc.Address6.fromByteArray(Array.from(n.readBuffer(16))).canonicalForm(),port:n.readUInt16BE()}}this.setState(q.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Ei.SocksClient=ac});var Jm=w(er=>{"use strict";var zS=er&&er.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),JS=er&&er.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&zS(e,i,t)};Object.defineProperty(er,"__esModule",{value:!0});JS(zm(),er)});var Zm=w(Pt=>{"use strict";var ZS=Pt&&Pt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),QS=Pt&&Pt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),lc=Pt&&Pt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&ZS(e,i,t);return QS(e,i),e},XS=Pt&&Pt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.SocksProxyAgent=void 0;var eE=Jm(),tE=Ya(),iE=XS(nn()),rE=lc(require("dns")),nE=lc(require("net")),sE=lc(require("tls")),oE=require("url"),eo=(0,iE.default)("socks-proxy-agent"),aE=i=>i.servername===void 0&&i.host&&!nE.isIP(i.host)?{...i,servername:i.host}:i;function lE(i){let e=!1,t=5,r=i.hostname,n=parseInt(i.port,10)||1080;switch(i.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":t=5;break;case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(i.protocol)}`)}let s={host:r,port:n,type:t};return i.username&&Object.defineProperty(s,"userId",{value:decodeURIComponent(i.username),enumerable:!1}),i.password!=null&&Object.defineProperty(s,"password",{value:decodeURIComponent(i.password),enumerable:!1}),{lookup:e,proxy:s}}var to=class extends tE.Agent{constructor(e,t){var o,a;super(t);let r=typeof e=="string"?new oE.URL(e):e,{proxy:n,lookup:s}=lE(r);this.shouldLookup=s,this.proxy=n,this.timeout=(o=t==null?void 0:t.timeout)!=null?o:null,this.socketOptions=(a=t==null?void 0:t.socketOptions)!=null?a:null}async connect(e,t){var d;let{shouldLookup:r,proxy:n,timeout:s}=this;if(!t.host)throw new Error("No `host` defined!");let{host:o}=t,{port:a,lookup:l=rE.lookup}=t;r&&(o=await new Promise((m,g)=>{l(o,{},(y,b)=>{y?g(y):m(b)})}));let c={proxy:n,destination:{host:o,port:typeof a=="number"?a:parseInt(a,10)},command:"connect",timeout:s!=null?s:void 0,socket_options:(d=this.socketOptions)!=null?d:void 0},u=m=>{e.destroy(),f.destroy(),m&&m.destroy()};eo("Creating socks proxy connection: %o",c);let{socket:f}=await eE.SocksClient.createConnection(c);if(eo("Successfully created socks proxy connection"),s!==null&&(f.setTimeout(s),f.on("timeout",()=>u())),t.secureEndpoint){eo("Upgrading socket connection to TLS");let m=sE.connect({...cE(aE(t),"host","path","port"),socket:f});return m.once("error",g=>{eo("Socket TLS error",g.message),u(m)}),m}return f}};to.protocols=["socks","socks4","socks4a","socks5","socks5h"];Pt.SocksProxyAgent=to;function cE(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}});var tg=w((_N,eg)=>{"use strict";var{Duplex:uE}=require("stream");function Qm(i){i.emit("close")}function fE(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Xm(i){this.removeListener("error",Xm),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function hE(i,e){let t=!0,r=new uE({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(s,o){let a=!o&&r._readableState.objectMode?s.toString():s;r.push(a)||i.pause()}),i.once("error",function(s){r.destroyed||(t=!1,r.destroy(s))}),i.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(n,s){if(i.readyState===i.CLOSED){s(n),process.nextTick(Qm,r);return}let o=!1;i.once("error",function(l){o=!0,s(l)}),i.once("close",function(){o||s(n),process.nextTick(Qm,r)}),t&&i.terminate()},r._final=function(n){if(i.readyState===i.CONNECTING){i.once("open",function(){r._final(n)});return}i._socket!==null&&(i._socket._writableState.finished?(n(),r._readableState.endEmitted&&r.destroy()):(i._socket.once("finish",function(){n()}),i.close()))},r._read=function(){i.isPaused&&i.resume()},r._write=function(n,s,o){if(i.readyState===i.CONNECTING){i.once("open",function(){r._write(n,s,o)});return}i.send(n,o)},r.on("end",fE),r.on("error",Xm),r}eg.exports=hE});var Oi=w((wN,ig)=>{"use strict";ig.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var dn=w((xN,io)=>{"use strict";var{EMPTY_BUFFER:pE}=Oi(),cc=Buffer[Symbol.species];function dE(i,e){if(i.length===0)return pE;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),r=0;for(let n=0;n<i.length;n++){let s=i[n];t.set(s,r),r+=s.length}return r<e?new cc(t.buffer,t.byteOffset,r):t}function rg(i,e,t,r,n){for(let s=0;s<n;s++)t[r+s]=i[s]^e[s&3]}function ng(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function mE(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function uc(i){if(uc.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new cc(i):ArrayBuffer.isView(i)?e=new cc(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),uc.readOnly=!1),e}io.exports={concat:dE,mask:rg,toArrayBuffer:mE,toBuffer:uc,unmask:ng};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=require("bufferutil");io.exports.mask=function(e,t,r,n,s){s<48?rg(e,t,r,n,s):i.mask(e,t,r,n,s)},io.exports.unmask=function(e,t){e.length<32?ng(e,t):i.unmask(e,t)}}catch{}});var ag=w((SN,og)=>{"use strict";var sg=Symbol("kDone"),fc=Symbol("kRun"),hc=class{constructor(e){this[sg]=()=>{this.pending--,this[fc]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[fc]()}[fc](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[sg])}}};og.exports=hc});var vn=w((EN,fg)=>{"use strict";var mn=require("zlib"),lg=dn(),gE=ag(),{kStatusCode:cg}=Oi(),vE=Buffer[Symbol.species],yE=Buffer.from([0,0,255,255]),so=Symbol("permessage-deflate"),pi=Symbol("total-length"),gn=Symbol("callback"),ki=Symbol("buffers"),no=Symbol("error"),ro,pc=class{constructor(e,t,r){if(this._maxPayload=r|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!ro){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ro=new gE(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[gn];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,r=e.find(n=>!(t.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>n.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(r.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?r.client_max_window_bits=t.clientMaxWindowBits:(r.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(r=>{let n=t[r];if(n.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(n=n[0],r==="client_max_window_bits"){if(n!==!0){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else if(r==="server_max_window_bits"){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else throw new Error(`Unknown parameter "${r}"`);t[r]=n})}),e}decompress(e,t,r){ro.add(n=>{this._decompress(e,t,(s,o)=>{n(),r(s,o)})})}compress(e,t,r){ro.add(n=>{this._compress(e,t,(s,o)=>{n(),r(s,o)})})}_decompress(e,t,r){let n=this._isServer?"client":"server";if(!this._inflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?mn.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=mn.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[so]=this,this._inflate[pi]=0,this._inflate[ki]=[],this._inflate.on("error",_E),this._inflate.on("data",ug)}this._inflate[gn]=r,this._inflate.write(e),t&&this._inflate.write(yE),this._inflate.flush(()=>{let s=this._inflate[no];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=lg.concat(this._inflate[ki],this._inflate[pi]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[pi]=0,this._inflate[ki]=[],t&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,t,r){let n=this._isServer?"server":"client";if(!this._deflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?mn.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=mn.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[pi]=0,this._deflate[ki]=[],this._deflate.on("data",bE)}this._deflate[gn]=r,this._deflate.write(e),this._deflate.flush(mn.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=lg.concat(this._deflate[ki],this._deflate[pi]);t&&(s=new vE(s.buffer,s.byteOffset,s.length-4)),this._deflate[gn]=null,this._deflate[pi]=0,this._deflate[ki]=[],t&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};fg.exports=pc;function bE(i){this[ki].push(i),this[pi]+=i.length}function ug(i){if(this[pi]+=i.length,this[so]._maxPayload<1||this[pi]<=this[so]._maxPayload){this[ki].push(i);return}this[no]=new RangeError("Max payload size exceeded"),this[no].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[no][cg]=1009,this.removeListener("data",ug),this.reset()}function _E(i){this[so]._inflate=null,i[cg]=1007,this[gn](i)}});var yn=w((ON,oo)=>{"use strict";var{isUtf8:hg}=require("buffer"),wE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function xE(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function dc(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}oo.exports={isValidStatusCode:xE,isValidUTF8:dc,tokenChars:wE};if(hg)oo.exports.isValidUTF8=function(i){return i.length<24?dc(i):hg(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=require("utf-8-validate");oo.exports.isValidUTF8=function(e){return e.length<32?dc(e):i(e)}}catch{}});var bc=w((kN,bg)=>{"use strict";var{Writable:SE}=require("stream"),pg=vn(),{BINARY_TYPES:EE,EMPTY_BUFFER:dg,kStatusCode:OE,kWebSocket:kE}=Oi(),{concat:mc,toArrayBuffer:CE,unmask:TE}=dn(),{isValidStatusCode:AE,isValidUTF8:mg}=yn(),ao=Buffer[Symbol.species],Mt=0,gg=1,vg=2,yg=3,gc=4,vc=5,lo=6,yc=class extends SE{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||EE[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[kE]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Mt}_write(e,t,r){if(this._opcode===8&&this._state==Mt)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new ao(r.buffer,r.byteOffset+e,r.length-e),new ao(r.buffer,r.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let r=this._buffers[0],n=t.length-e;e>=r.length?t.set(this._buffers.shift(),n):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=new ao(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case Mt:this.getInfo(e);break;case gg:this.getPayloadLength16(e);break;case vg:this.getPayloadLength64(e);break;case yg:this.getMask();break;case gc:this.getData(e);break;case vc:case lo:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let r=(t[0]&64)===64;if(r&&!this._extensions[pg.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=gg:this._payloadLength===127?this._state=vg:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);if(r>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=yg:this._state=gc}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=gc}getData(e){let t=dg;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&TE(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=vc,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[pg.extensionName].decompress(e,this._fin,(n,s)=>{if(n)return t(n);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===Mt&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=Mt;return}let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=mc(r,t):this._binaryType==="arraybuffer"?n=CE(mc(r,t)):n=r,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Mt):(this._state=lo,setImmediate(()=>{this.emit("message",n,!0),this._state=Mt,this.startLoop(e)}))}else{let n=mc(r,t);if(!this._skipUTF8Validation&&!mg(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===vc||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Mt):(this._state=lo,setImmediate(()=>{this.emit("message",n,!1),this._state=Mt,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,dg),this.end();else{let r=e.readUInt16BE(0);if(!AE(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let n=new ao(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!mg(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",r,n),this.end()}this._state=Mt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Mt):(this._state=lo,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Mt,this.startLoop(t)}))}createError(e,t,r,n,s){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[OE]=n,o}};bg.exports=yc});var wc=w((TN,xg)=>{"use strict";var{Duplex:CN}=require("stream"),{randomFillSync:IE}=require("crypto"),_g=vn(),{EMPTY_BUFFER:NE}=Oi(),{isValidStatusCode:BE}=yn(),{mask:wg,toBuffer:Fr}=dn(),Gt=Symbol("kByteLength"),LE=Buffer.alloc(4),co=8*1024,tr,Dr=co,_c=class i{constructor(e,t,r){this._extensions=t||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let r,n=!1,s=2,o=!1;t.mask&&(r=t.maskBuffer||LE,t.generateMask?t.generateMask(r):(Dr===co&&(tr===void 0&&(tr=Buffer.alloc(co)),IE(tr,0,co),Dr=0),r[0]=tr[Dr++],r[1]=tr[Dr++],r[2]=tr[Dr++],r[3]=tr[Dr++]),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[Gt]!==void 0?a=t[Gt]:(e=Buffer.from(e),a=e.length):(a=e.length,n=t.mask&&t.readOnly&&!o);let l=a;a>=65536?(s+=8,l=127):a>125&&(s+=2,l=126);let c=Buffer.allocUnsafe(n?a+s:s);return c[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(c[0]|=64),c[1]=l,l===126?c.writeUInt16BE(a,2):l===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),t.mask?(c[1]|=128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o?[c,e]:n?(wg(e,r,c,s,a),[c]):(wg(e,r,e,0,a),[c,e])):[c,e]}close(e,t,r,n){let s;if(e===void 0)s=NE;else{if(typeof e!="number"||!BE(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[Gt]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,o,n]):this.sendFrame(i.frame(s,o),n)}ping(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=Fr(e),n=e.length,s=Fr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[Gt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}pong(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=Fr(e),n=e.length,s=Fr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[Gt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}send(e,t,r){let n=this._extensions[_g.extensionName],s=t.binary?2:1,o=t.compress,a,l;if(typeof e=="string"?(a=Buffer.byteLength(e),l=!1):(e=Fr(e),a=e.length,l=Fr.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=n._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0),n){let c={[Gt]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:o};this._deflating?this.enqueue([this.dispatch,e,this._compress,c,r]):this.dispatch(e,this._compress,c,r)}else this.sendFrame(i.frame(e,{[Gt]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:!1}),r)}dispatch(e,t,r,n){if(!t){this.sendFrame(i.frame(e,r),n);return}let s=this._extensions[_g.extensionName];this._bufferedBytes+=r[Gt],this._deflating=!0,s.compress(e,r.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");typeof n=="function"&&n(l);for(let c=0;c<this._queue.length;c++){let u=this._queue[c],f=u[u.length-1];typeof f=="function"&&f(l)}return}this._bufferedBytes-=r[Gt],this._deflating=!1,r.readOnly=!1,this.sendFrame(i.frame(a,r),n),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][Gt],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Gt],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};xg.exports=_c});var Ng=w((AN,Ig)=>{"use strict";var{kForOnEventAttribute:bn,kListener:xc}=Oi(),Sg=Symbol("kCode"),Eg=Symbol("kData"),Og=Symbol("kError"),kg=Symbol("kMessage"),Cg=Symbol("kReason"),jr=Symbol("kTarget"),Tg=Symbol("kType"),Ag=Symbol("kWasClean"),di=class{constructor(e){this[jr]=null,this[Tg]=e}get target(){return this[jr]}get type(){return this[Tg]}};Object.defineProperty(di.prototype,"target",{enumerable:!0});Object.defineProperty(di.prototype,"type",{enumerable:!0});var ir=class extends di{constructor(e,t={}){super(e),this[Sg]=t.code===void 0?0:t.code,this[Cg]=t.reason===void 0?"":t.reason,this[Ag]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Sg]}get reason(){return this[Cg]}get wasClean(){return this[Ag]}};Object.defineProperty(ir.prototype,"code",{enumerable:!0});Object.defineProperty(ir.prototype,"reason",{enumerable:!0});Object.defineProperty(ir.prototype,"wasClean",{enumerable:!0});var Ur=class extends di{constructor(e,t={}){super(e),this[Og]=t.error===void 0?null:t.error,this[kg]=t.message===void 0?"":t.message}get error(){return this[Og]}get message(){return this[kg]}};Object.defineProperty(Ur.prototype,"error",{enumerable:!0});Object.defineProperty(Ur.prototype,"message",{enumerable:!0});var _n=class extends di{constructor(e,t={}){super(e),this[Eg]=t.data===void 0?null:t.data}get data(){return this[Eg]}};Object.defineProperty(_n.prototype,"data",{enumerable:!0});var RE={addEventListener(i,e,t={}){for(let n of this.listeners(i))if(!t[bn]&&n[xc]===e&&!n[bn])return;let r;if(i==="message")r=function(s,o){let a=new _n("message",{data:o?s:s.toString()});a[jr]=this,uo(e,this,a)};else if(i==="close")r=function(s,o){let a=new ir("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[jr]=this,uo(e,this,a)};else if(i==="error")r=function(s){let o=new Ur("error",{error:s,message:s.message});o[jr]=this,uo(e,this,o)};else if(i==="open")r=function(){let s=new di("open");s[jr]=this,uo(e,this,s)};else return;r[bn]=!!t[bn],r[xc]=e,t.once?this.once(i,r):this.on(i,r)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[xc]===e&&!t[bn]){this.removeListener(i,t);break}}};Ig.exports={CloseEvent:ir,ErrorEvent:Ur,Event:di,EventTarget:RE,MessageEvent:_n};function uo(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var Sc=w((IN,Bg)=>{"use strict";var{tokenChars:wn}=yn();function ei(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function PE(i){let e=Object.create(null),t=Object.create(null),r=!1,n=!1,s=!1,o,a,l=-1,c=-1,u=-1,f=0;for(;f<i.length;f++)if(c=i.charCodeAt(f),o===void 0)if(u===-1&&wn[c]===1)l===-1&&(l=f);else if(f!==0&&(c===32||c===9))u===-1&&l!==-1&&(u=f);else if(c===59||c===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let m=i.slice(l,u);c===44?(ei(e,m,t),t=Object.create(null)):o=m,l=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&wn[c]===1)l===-1&&(l=f);else if(c===32||c===9)u===-1&&l!==-1&&(u=f);else if(c===59||c===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),ei(t,i.slice(l,u),!0),c===44&&(ei(e,o,t),t=Object.create(null),o=void 0),l=u=-1}else if(c===61&&l!==-1&&u===-1)a=i.slice(l,f),l=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(n){if(wn[c]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1?l=f:r||(r=!0),n=!1}else if(s)if(wn[c]===1)l===-1&&(l=f);else if(c===34&&l!==-1)s=!1,u=f;else if(c===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(c===34&&i.charCodeAt(f-1)===61)s=!0;else if(u===-1&&wn[c]===1)l===-1&&(l=f);else if(l!==-1&&(c===32||c===9))u===-1&&(u=f);else if(c===59||c===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let m=i.slice(l,u);r&&(m=m.replace(/\\/g,""),r=!1),ei(t,a,m),c===44&&(ei(e,o,t),t=Object.create(null),o=void 0),a=void 0,l=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(l===-1||s||c===32||c===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let d=i.slice(l,u);return o===void 0?ei(e,d,t):(a===void 0?ei(t,d,!0):r?ei(t,a,d.replace(/\\/g,"")):ei(t,a,d),ei(e,o,t)),e}function ME(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(r=>[e].concat(Object.keys(r).map(n=>{let s=r[n];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Bg.exports={format:ME,parse:PE}});var Tc=w((LN,Vg)=>{"use strict";var qE=require("events"),FE=require("https"),DE=require("http"),Pg=require("net"),jE=require("tls"),{randomBytes:UE,createHash:$E}=require("crypto"),{Duplex:NN,Readable:BN}=require("stream"),{URL:Ec}=require("url"),Ci=vn(),VE=bc(),HE=wc(),{BINARY_TYPES:Lg,EMPTY_BUFFER:fo,GUID:GE,kForOnEventAttribute:Oc,kListener:WE,kStatusCode:YE,kWebSocket:st,NOOP:Mg}=Oi(),{EventTarget:{addEventListener:KE,removeEventListener:zE}}=Ng(),{format:JE,parse:ZE}=Sc(),{toBuffer:QE}=dn(),XE=30*1e3,qg=Symbol("kAborted"),kc=[8,13],mi=["CONNECTING","OPEN","CLOSING","CLOSED"],eO=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,De=class i extends qE{constructor(e,t,r){super(),this._binaryType=Lg[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=fo,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(r=t,t=[]):t=[t]),Fg(this,e,t,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Lg.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){let n=new VE({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new HE(e,this._extensions,r.generateMask),this._receiver=n,this._socket=e,n[st]=this,e[st]=this,n.on("conclude",rO),n.on("drain",nO),n.on("error",sO),n.on("message",oO),n.on("ping",aO),n.on("pong",lO),e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",jg),e.on("data",po),e.on("end",Ug),e.on("error",$g),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ci.extensionName]&&this._extensions[Ci.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){kt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),XE)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){Cc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||fo,t,r)}pong(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){Cc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||fo,t,r)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(r=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){Cc(this,e,r);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Ci.extensionName]||(n.compress=!1),this._sender.send(e||fo,n,r)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){kt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(De,"CONNECTING",{enumerable:!0,value:mi.indexOf("CONNECTING")});Object.defineProperty(De.prototype,"CONNECTING",{enumerable:!0,value:mi.indexOf("CONNECTING")});Object.defineProperty(De,"OPEN",{enumerable:!0,value:mi.indexOf("OPEN")});Object.defineProperty(De.prototype,"OPEN",{enumerable:!0,value:mi.indexOf("OPEN")});Object.defineProperty(De,"CLOSING",{enumerable:!0,value:mi.indexOf("CLOSING")});Object.defineProperty(De.prototype,"CLOSING",{enumerable:!0,value:mi.indexOf("CLOSING")});Object.defineProperty(De,"CLOSED",{enumerable:!0,value:mi.indexOf("CLOSED")});Object.defineProperty(De.prototype,"CLOSED",{enumerable:!0,value:mi.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(De.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(De.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[Oc])return e[WE];return null},set(e){for(let t of this.listeners(i))if(t[Oc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[Oc]:!0})}})});De.prototype.addEventListener=KE;De.prototype.removeEventListener=zE;Vg.exports=De;function Fg(i,e,t,r){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:kc[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(i._autoPong=n.autoPong,!kc.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${kc.join(", ")})`);let s;if(e instanceof Ec)s=e;else try{s=new Ec(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),i._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",l;if(s.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:a&&!s.pathname?l="The URL's pathname is empty":s.hash&&(l="The URL contains a fragment identifier"),l){let y=new SyntaxError(l);if(i._redirects===0)throw y;ho(i,y);return}let c=o?443:80,u=UE(16).toString("base64"),f=o?FE.request:DE.request,d=new Set,m;if(n.createConnection=n.createConnection||(o?iO:tO),n.defaultPort=n.defaultPort||c,n.port=s.port||c,n.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},n.path=s.pathname+s.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(m=new Ci(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=JE({[Ci.extensionName]:m.offer()})),t.length){for(let y of t){if(typeof y!="string"||!eO.test(y)||d.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(y)}n.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(s.username||s.password)&&(n.auth=`${s.username}:${s.password}`),a){let y=n.path.split(":");n.socketPath=y[0],n.path=y[1]}let g;if(n.followRedirects){if(i._redirects===0){i._originalIpc=a,i._originalSecure=o,i._originalHostOrSocketPath=a?n.socketPath:s.host;let y=r&&r.headers;if(r={...r,headers:{}},y)for(let[b,x]of Object.entries(y))r.headers[b.toLowerCase()]=x}else if(i.listenerCount("redirect")===0){let y=a?i._originalIpc?n.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:s.host===i._originalHostOrSocketPath;(!y||i._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,y||delete n.headers.host,n.auth=void 0)}n.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=i._req=f(n),i._redirects&&i.emit("redirect",i.url,g)}else g=i._req=f(n);n.timeout&&g.on("timeout",()=>{kt(i,g,"Opening handshake has timed out")}),g.on("error",y=>{g===null||g[qg]||(g=i._req=null,ho(i,y))}),g.on("response",y=>{let b=y.headers.location,x=y.statusCode;if(b&&n.followRedirects&&x>=300&&x<400){if(++i._redirects>n.maxRedirects){kt(i,g,"Maximum redirects exceeded");return}g.abort();let S;try{S=new Ec(b,e)}catch{let O=new SyntaxError(`Invalid URL: ${b}`);ho(i,O);return}Fg(i,S,t,r)}else i.emit("unexpected-response",g,y)||kt(i,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,b,x)=>{if(i.emit("upgrade",y),i.readyState!==De.CONNECTING)return;g=i._req=null;let S=y.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){kt(i,b,"Invalid Upgrade header");return}let k=$E("sha1").update(u+GE).digest("base64");if(y.headers["sec-websocket-accept"]!==k){kt(i,b,"Invalid Sec-WebSocket-Accept header");return}let O=y.headers["sec-websocket-protocol"],E;if(O!==void 0?d.size?d.has(O)||(E="Server sent an invalid subprotocol"):E="Server sent a subprotocol but none was requested":d.size&&(E="Server sent no subprotocol"),E){kt(i,b,E);return}O&&(i._protocol=O);let R=y.headers["sec-websocket-extensions"];if(R!==void 0){if(!m){kt(i,b,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let T;try{T=ZE(R)}catch{kt(i,b,"Invalid Sec-WebSocket-Extensions header");return}let A=Object.keys(T);if(A.length!==1||A[0]!==Ci.extensionName){kt(i,b,"Server indicated an extension that was not requested");return}try{m.accept(T[Ci.extensionName])}catch{kt(i,b,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[Ci.extensionName]=m}i.setSocket(b,x,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,i):g.end()}function ho(i,e){i._readyState=De.CLOSING,i.emit("error",e),i.emitClose()}function tO(i){return i.path=i.socketPath,Pg.connect(i)}function iO(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=Pg.isIP(i.host)?"":i.host),jE.connect(i)}function kt(i,e,t){i._readyState=De.CLOSING;let r=new Error(t);Error.captureStackTrace(r,kt),e.setHeader?(e[qg]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(ho,i,r)):(e.destroy(r),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function Cc(i,e,t){if(e){let r=QE(e).length;i._socket?i._sender._bufferedBytes+=r:i._bufferedAmount+=r}if(t){let r=new Error(`WebSocket is not open: readyState ${i.readyState} (${mi[i.readyState]})`);process.nextTick(t,r)}}function rO(i,e){let t=this[st];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[st]!==void 0&&(t._socket.removeListener("data",po),process.nextTick(Dg,t._socket),i===1005?t.close():t.close(i,e))}function nO(){let i=this[st];i.isPaused||i._socket.resume()}function sO(i){let e=this[st];e._socket[st]!==void 0&&(e._socket.removeListener("data",po),process.nextTick(Dg,e._socket),e.close(i[YE])),e.emit("error",i)}function Rg(){this[st].emitClose()}function oO(i,e){this[st].emit("message",i,e)}function aO(i){let e=this[st];e._autoPong&&e.pong(i,!this._isServer,Mg),e.emit("ping",i)}function lO(i){this[st].emit("pong",i)}function Dg(i){i.resume()}function jg(){let i=this[st];this.removeListener("close",jg),this.removeListener("data",po),this.removeListener("end",Ug),i._readyState=De.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[st]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",Rg),i._receiver.on("finish",Rg))}function po(i){this[st]._receiver.write(i)||this.pause()}function Ug(){let i=this[st];i._readyState=De.CLOSING,i._receiver.end(),this.end()}function $g(){let i=this[st];this.removeListener("error",$g),this.on("error",Mg),i&&(i._readyState=De.CLOSING,this.destroy())}});var Gg=w((RN,Hg)=>{"use strict";var{tokenChars:cO}=yn();function uO(i){let e=new Set,t=-1,r=-1,n=0;for(n;n<i.length;n++){let o=i.charCodeAt(n);if(r===-1&&cO[o]===1)t===-1&&(t=n);else if(n!==0&&(o===32||o===9))r===-1&&t!==-1&&(r=n);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${n}`);r===-1&&(r=n);let a=i.slice(t,r);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=r=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(t===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=i.slice(t,n);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}Hg.exports={parse:uO}});var Qg=w((MN,Zg)=>{"use strict";var fO=require("events"),mo=require("http"),{Duplex:PN}=require("stream"),{createHash:hO}=require("crypto"),Wg=Sc(),rr=vn(),pO=Gg(),dO=Tc(),{GUID:mO,kWebSocket:gO}=Oi(),vO=/^[+/0-9A-Za-z]{22}==$/,Yg=0,Kg=1,Jg=2,Ac=class extends fO{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:dO,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=mo.createServer((r,n)=>{let s=mo.STATUS_CODES[426];n.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),n.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=yO(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,s,o)=>{this.handleUpgrade(n,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Yg}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Jg){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(xn,this);return}if(e&&this.once("close",e),this._state!==Kg)if(this._state=Kg,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(xn,this):process.nextTick(xn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{xn(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,r,n){t.on("error",zg);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){nr(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){nr(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!vO.test(s)){nr(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==8&&a!==13){nr(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){Sn(t,400);return}let l=e.headers["sec-websocket-protocol"],c=new Set;if(l!==void 0)try{c=pO.parse(l)}catch{nr(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let d=new rr(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let m=Wg.parse(u);m[rr.extensionName]&&(d.accept(m[rr.extensionName]),f[rr.extensionName]=d)}catch{nr(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(m,g,y,b)=>{if(!m)return Sn(t,g||401,y,b);this.completeUpgrade(f,s,c,e,t,r,n)});return}if(!this.options.verifyClient(d))return Sn(t,401)}this.completeUpgrade(f,s,c,e,t,r,n)}completeUpgrade(e,t,r,n,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[gO])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Yg)return Sn(s,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${hO("sha1").update(t+mO).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(r.size){let f=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;f&&(c.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[rr.extensionName]){let f=e[rr.extensionName].params,d=Wg.format({[rr.extensionName]:[f]});c.push(`Sec-WebSocket-Extensions: ${d}`),u._extensions=e}this.emit("headers",c,n),s.write(c.concat(`\r
`).join(`\r
`)),s.removeListener("error",zg),u.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(xn,this)})),a(u,n)}};Zg.exports=Ac;function yO(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let r of Object.keys(e))i.removeListener(r,e[r])}}function xn(i){i._state=Jg,i.emit("close")}function zg(){this.destroy()}function Sn(i,e,t,r){t=t||mo.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...r},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${mo.STATUS_CODES[e]}\r
`+Object.keys(r).map(n=>`${n}: ${r[n]}`).join(`\r
`)+`\r
\r
`+t)}function nr(i,e,t,r,n){if(i.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,nr),i.emit("wsClientError",s,t,e)}else Sn(t,r,n)}});var Se=w(tt=>{"use strict";var Lc=Symbol.for("yaml.alias"),t0=Symbol.for("yaml.document"),go=Symbol.for("yaml.map"),i0=Symbol.for("yaml.pair"),Rc=Symbol.for("yaml.scalar"),vo=Symbol.for("yaml.seq"),gi=Symbol.for("yaml.node.type"),_O=i=>!!i&&typeof i=="object"&&i[gi]===Lc,wO=i=>!!i&&typeof i=="object"&&i[gi]===t0,xO=i=>!!i&&typeof i=="object"&&i[gi]===go,SO=i=>!!i&&typeof i=="object"&&i[gi]===i0,r0=i=>!!i&&typeof i=="object"&&i[gi]===Rc,EO=i=>!!i&&typeof i=="object"&&i[gi]===vo;function n0(i){if(i&&typeof i=="object")switch(i[gi]){case go:case vo:return!0}return!1}function OO(i){if(i&&typeof i=="object")switch(i[gi]){case Lc:case go:case Rc:case vo:return!0}return!1}var kO=i=>(r0(i)||n0(i))&&!!i.anchor;tt.ALIAS=Lc;tt.DOC=t0;tt.MAP=go;tt.NODE_TYPE=gi;tt.PAIR=i0;tt.SCALAR=Rc;tt.SEQ=vo;tt.hasAnchor=kO;tt.isAlias=_O;tt.isCollection=n0;tt.isDocument=wO;tt.isMap=xO;tt.isNode=OO;tt.isPair=SO;tt.isScalar=r0;tt.isSeq=EO});var En=w(Pc=>{"use strict";var Ge=Se(),vt=Symbol("break visit"),s0=Symbol("skip children"),ti=Symbol("remove node");function yo(i,e){let t=o0(e);Ge.isDocument(i)?$r(null,i.contents,t,Object.freeze([i]))===ti&&(i.contents=null):$r(null,i,t,Object.freeze([]))}yo.BREAK=vt;yo.SKIP=s0;yo.REMOVE=ti;function $r(i,e,t,r){let n=a0(i,e,t,r);if(Ge.isNode(n)||Ge.isPair(n))return l0(i,r,n),$r(i,n,t,r);if(typeof n!="symbol"){if(Ge.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=$r(s,e.items[s],t,r);if(typeof o=="number")s=o-1;else{if(o===vt)return vt;o===ti&&(e.items.splice(s,1),s-=1)}}}else if(Ge.isPair(e)){r=Object.freeze(r.concat(e));let s=$r("key",e.key,t,r);if(s===vt)return vt;s===ti&&(e.key=null);let o=$r("value",e.value,t,r);if(o===vt)return vt;o===ti&&(e.value=null)}}return n}async function bo(i,e){let t=o0(e);Ge.isDocument(i)?await Vr(null,i.contents,t,Object.freeze([i]))===ti&&(i.contents=null):await Vr(null,i,t,Object.freeze([]))}bo.BREAK=vt;bo.SKIP=s0;bo.REMOVE=ti;async function Vr(i,e,t,r){let n=await a0(i,e,t,r);if(Ge.isNode(n)||Ge.isPair(n))return l0(i,r,n),Vr(i,n,t,r);if(typeof n!="symbol"){if(Ge.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=await Vr(s,e.items[s],t,r);if(typeof o=="number")s=o-1;else{if(o===vt)return vt;o===ti&&(e.items.splice(s,1),s-=1)}}}else if(Ge.isPair(e)){r=Object.freeze(r.concat(e));let s=await Vr("key",e.key,t,r);if(s===vt)return vt;s===ti&&(e.key=null);let o=await Vr("value",e.value,t,r);if(o===vt)return vt;o===ti&&(e.value=null)}}return n}function o0(i){return typeof i=="object"&&(i.Collection||i.Node||i.Value)?Object.assign({Alias:i.Node,Map:i.Node,Scalar:i.Node,Seq:i.Node},i.Value&&{Map:i.Value,Scalar:i.Value,Seq:i.Value},i.Collection&&{Map:i.Collection,Seq:i.Collection},i):i}function a0(i,e,t,r){var n,s,o,a,l;if(typeof t=="function")return t(i,e,r);if(Ge.isMap(e))return(n=t.Map)==null?void 0:n.call(t,i,e,r);if(Ge.isSeq(e))return(s=t.Seq)==null?void 0:s.call(t,i,e,r);if(Ge.isPair(e))return(o=t.Pair)==null?void 0:o.call(t,i,e,r);if(Ge.isScalar(e))return(a=t.Scalar)==null?void 0:a.call(t,i,e,r);if(Ge.isAlias(e))return(l=t.Alias)==null?void 0:l.call(t,i,e,r)}function l0(i,e,t){let r=e[e.length-1];if(Ge.isCollection(r))r.items[i]=t;else if(Ge.isPair(r))i==="key"?r.key=t:r.value=t;else if(Ge.isDocument(r))r.contents=t;else{let n=Ge.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Pc.visit=yo;Pc.visitAsync=bo});var Mc=w(u0=>{"use strict";var c0=Se(),CO=En(),TO={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},AO=i=>i.replace(/[!,[\]{}]/g,e=>TO[e]),On=class i{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},i.defaultYaml,e),this.tags=Object.assign({},i.defaultTags,t)}clone(){let e=new i(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new i(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:i.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},i.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:i.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},i.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(n)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+AO(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&c0.isNode(e.contents)){let s={};CO.visit(e.contents,(o,a)=>{c0.isNode(a)&&a.tag&&(s[a.tag]=!0)}),n=Object.keys(s)}else n=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(a=>a.startsWith(o)))&&t.push(`%TAG ${s} ${o}`);return t.join(`
`)}};On.defaultYaml={explicit:!1,version:"1.2"};On.defaultTags={"!!":"tag:yaml.org,2002:"};u0.Directives=On});var _o=w(kn=>{"use strict";var f0=Se(),IO=En();function NO(i){if(/[\x00-\x19\s,[\]{}]/.test(i)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(i)}`;throw new Error(t)}return!0}function h0(i){let e=new Set;return IO.visit(i,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function p0(i,e){for(let t=1;;++t){let r=`${i}${t}`;if(!e.has(r))return r}}function BO(i,e){let t=[],r=new Map,n=null;return{onAnchor:s=>{t.push(s),n||(n=h0(i));let o=p0(e,n);return n.add(o),o},setAnchors:()=>{for(let s of t){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(f0.isScalar(o.node)||f0.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}kn.anchorIsValid=NO;kn.anchorNames=h0;kn.createNodeAnchors=BO;kn.findNewAnchor=p0});var qc=w(d0=>{"use strict";function Cn(i,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let n=0,s=r.length;n<s;++n){let o=r[n],a=Cn(i,r,String(n),o);a===void 0?delete r[n]:a!==o&&(r[n]=a)}else if(r instanceof Map)for(let n of Array.from(r.keys())){let s=r.get(n),o=Cn(i,r,n,s);o===void 0?r.delete(n):o!==s&&r.set(n,o)}else if(r instanceof Set)for(let n of Array.from(r)){let s=Cn(i,r,n,n);s===void 0?r.delete(n):s!==n&&(r.delete(n),r.add(s))}else for(let[n,s]of Object.entries(r)){let o=Cn(i,r,n,s);o===void 0?delete r[n]:o!==s&&(r[n]=o)}return i.call(e,t,r)}d0.applyReviver=Cn});var Ti=w(g0=>{"use strict";var LO=Se();function m0(i,e,t){if(Array.isArray(i))return i.map((r,n)=>m0(r,String(n),t));if(i&&typeof i.toJSON=="function"){if(!t||!LO.hasAnchor(i))return i.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(i,r),t.onCreate=s=>{r.res=s,delete t.onCreate};let n=i.toJSON(e,t);return t.onCreate&&t.onCreate(n),n}return typeof i=="bigint"&&!(t!=null&&t.keep)?Number(i):i}g0.toJS=m0});var wo=w(y0=>{"use strict";var RO=qc(),v0=Se(),PO=Ti(),Fc=class{constructor(e){Object.defineProperty(this,v0.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:n,reviver:s}={}){if(!v0.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=PO.toJS(this,"",o);if(typeof n=="function")for(let{count:l,res:c}of o.anchors.values())n(c,l);return typeof s=="function"?RO.applyReviver(s,{"":a},"",a):a}};y0.NodeBase=Fc});var Tn=w(_0=>{"use strict";var MO=_o(),b0=En(),xo=Se(),qO=wo(),FO=Ti(),Dc=class extends qO.NodeBase{constructor(e){super(xo.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return b0.visit(e,{Node:(r,n)=>{if(n===this)return b0.visit.BREAK;n.anchor===this.source&&(t=n)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:n,maxAliasCount:s}=t,o=this.resolve(n);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(FO.toJS(o,null,t),a=r.get(o)),!a||a.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=So(n,o,r)),a.count*a.aliasCount>s)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,r){let n=`*${this.source}`;if(e){if(MO.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${n} `}return n}};function So(i,e,t){if(xo.isAlias(e)){let r=e.resolve(i),n=t&&r&&t.get(r);return n?n.count*n.aliasCount:0}else if(xo.isCollection(e)){let r=0;for(let n of e.items){let s=So(i,n,t);s>r&&(r=s)}return r}else if(xo.isPair(e)){let r=So(i,e.key,t),n=So(i,e.value,t);return Math.max(r,n)}return 1}_0.Alias=Dc});var Ue=w(jc=>{"use strict";var DO=Se(),jO=wo(),UO=Ti(),$O=i=>!i||typeof i!="function"&&typeof i!="object",Ai=class extends jO.NodeBase{constructor(e){super(DO.SCALAR),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:UO.toJS(this.value,e,t)}toString(){return String(this.value)}};Ai.BLOCK_FOLDED="BLOCK_FOLDED";Ai.BLOCK_LITERAL="BLOCK_LITERAL";Ai.PLAIN="PLAIN";Ai.QUOTE_DOUBLE="QUOTE_DOUBLE";Ai.QUOTE_SINGLE="QUOTE_SINGLE";jc.Scalar=Ai;jc.isScalarValue=$O});var An=w(x0=>{"use strict";var VO=Tn(),sr=Se(),w0=Ue(),HO="tag:yaml.org,2002:";function GO(i,e,t){var r;if(e){let n=t.filter(o=>o.tag===e),s=(r=n.find(o=>!o.format))!=null?r:n[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(n=>{var s;return((s=n.identify)==null?void 0:s.call(n,i))&&!n.format})}function WO(i,e,t){var f,d,m;if(sr.isDocument(i)&&(i=i.contents),sr.isNode(i))return i;if(sr.isPair(i)){let g=(d=(f=t.schema[sr.MAP]).createNode)==null?void 0:d.call(f,t.schema,null,t);return g.items.push(i),g}(i instanceof String||i instanceof Number||i instanceof Boolean||typeof BigInt!="undefined"&&i instanceof BigInt)&&(i=i.valueOf());let{aliasDuplicateObjects:r,onAnchor:n,onTagObj:s,schema:o,sourceObjects:a}=t,l;if(r&&i&&typeof i=="object"){if(l=a.get(i),l)return l.anchor||(l.anchor=n(i)),new VO.Alias(l.anchor);l={anchor:null,node:null},a.set(i,l)}e!=null&&e.startsWith("!!")&&(e=HO+e.slice(2));let c=GO(i,e,o.tags);if(!c){if(i&&typeof i.toJSON=="function"&&(i=i.toJSON()),!i||typeof i!="object"){let g=new w0.Scalar(i);return l&&(l.node=g),g}c=i instanceof Map?o[sr.MAP]:Symbol.iterator in Object(i)?o[sr.SEQ]:o[sr.MAP]}s&&(s(c),delete t.onTagObj);let u=c!=null&&c.createNode?c.createNode(t.schema,i,t):typeof((m=c==null?void 0:c.nodeClass)==null?void 0:m.from)=="function"?c.nodeClass.from(t.schema,i,t):new w0.Scalar(i);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}x0.createNode=WO});var Oo=w(Eo=>{"use strict";var YO=An(),ii=Se(),KO=wo();function Uc(i,e,t){let r=t;for(let n=e.length-1;n>=0;--n){let s=e[n];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return YO.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:i,sourceObjects:new Map})}var S0=i=>i==null||typeof i=="object"&&!!i[Symbol.iterator]().next().done,$c=class extends KO.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>ii.isNode(r)||ii.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(S0(e))this.add(t);else{let[r,...n]=e,s=this.get(r,!0);if(ii.isCollection(s))s.addIn(n,t);else if(s===void 0&&this.schema)this.set(r,Uc(this.schema,n,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let n=this.get(t,!0);if(ii.isCollection(n))return n.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,s=this.get(r,!0);return n.length===0?!t&&ii.isScalar(s)?s.value:s:ii.isCollection(s)?s.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!ii.isPair(t))return!1;let r=t.value;return r==null||e&&ii.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let n=this.get(t,!0);return ii.isCollection(n)?n.hasIn(r):!1}setIn(e,t){let[r,...n]=e;if(n.length===0)this.set(r,t);else{let s=this.get(r,!0);if(ii.isCollection(s))s.setIn(n,t);else if(s===void 0&&this.schema)this.set(r,Uc(this.schema,n,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}};Eo.Collection=$c;Eo.collectionFromPath=Uc;Eo.isEmptyPath=S0});var In=w(ko=>{"use strict";var zO=i=>i.replace(/^(?!$)(?: $)?/gm,"#");function Vc(i,e){return/^\n+$/.test(i)?i.substring(1):e?i.replace(/^(?! *$)/gm,e):i}var JO=(i,e,t)=>i.endsWith(`
`)?Vc(t,e):t.includes(`
`)?`
`+Vc(t,e):(i.endsWith(" ")?"":" ")+t;ko.indentComment=Vc;ko.lineComment=JO;ko.stringifyComment=zO});var O0=w(Nn=>{"use strict";var ZO="flow",Hc="block",Co="quoted";function QO(i,e,t="flow",{indentAtStart:r,lineWidth:n=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!n||n<0)return i;n<s&&(s=0);let l=Math.max(1+s,1+n-e.length);if(i.length<=l)return i;let c=[],u={},f=n-e.length;typeof r=="number"&&(r>n-Math.max(2,s)?c.push(0):f=n-r);let d,m,g=!1,y=-1,b=-1,x=-1;t===Hc&&(y=E0(i,y,e.length),y!==-1&&(f=y+l));for(let k;k=i[y+=1];){if(t===Co&&k==="\\"){switch(b=y,i[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}x=y}if(k===`
`)t===Hc&&(y=E0(i,y,e.length)),f=y+e.length+l,d=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
`&&m!=="	"){let O=i[y+1];O&&O!==" "&&O!==`
`&&O!=="	"&&(d=y)}if(y>=f)if(d)c.push(d),f=d+l,d=void 0;else if(t===Co){for(;m===" "||m==="	";)m=k,k=i[y+=1],g=!0;let O=y>x+1?y-2:b-1;if(u[O])return i;c.push(O),u[O]=!0,f=O+l,d=void 0}else g=!0}m=k}if(g&&a&&a(),c.length===0)return i;o&&o();let S=i.slice(0,c[0]);for(let k=0;k<c.length;++k){let O=c[k],E=c[k+1]||i.length;O===0?S=`
${e}${i.slice(0,E)}`:(t===Co&&u[O]&&(S+=`${i[O]}\\`),S+=`
${e}${i.slice(O+1,E)}`)}return S}function E0(i,e,t){let r=e,n=e+1,s=i[n];for(;s===" "||s==="	";)if(e<n+t)s=i[++e];else{do s=i[++e];while(s&&s!==`
`);r=e,n=e+1,s=i[n]}return r}Nn.FOLD_BLOCK=Hc;Nn.FOLD_FLOW=ZO;Nn.FOLD_QUOTED=Co;Nn.foldFlowLines=QO});var Ln=w(k0=>{"use strict";var ri=Ue(),Ii=O0(),Ao=(i,e)=>({indentAtStart:e?i.indent.length:i.indentAtStart,lineWidth:i.options.lineWidth,minContentWidth:i.options.minContentWidth}),Io=i=>/^(%|---|\.\.\.)/m.test(i);function XO(i,e,t){if(!e||e<0)return!1;let r=e-t,n=i.length;if(n<=r)return!1;for(let s=0,o=0;s<n;++s)if(i[s]===`
`){if(s-o>r)return!0;if(o=s+1,n-o<=r)return!1}return!0}function Bn(i,e){let t=JSON.stringify(i);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,n=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Io(i)?"  ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let u=t.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||t[l+2]==='"'||t.length<n)l+=1;else{for(o+=t.slice(a,l)+`

`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
`,l+=2;o+=s,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,r?o:Ii.foldFlowLines(o,s,Ii.FOLD_QUOTED,Ao(e,!1))}function Gc(i,e){if(e.options.singleQuote===!1||e.implicitKey&&i.includes(`
`)||/[ \t]\n|\n[ \t]/.test(i))return Bn(i,e);let t=e.indent||(Io(i)?"  ":""),r="'"+i.replace(/'/g,"''").replace(/\n+/g,`$&
${t}`)+"'";return e.implicitKey?r:Ii.foldFlowLines(r,t,Ii.FOLD_FLOW,Ao(e,!1))}function Hr(i,e){let{singleQuote:t}=e.options,r;if(t===!1)r=Bn;else{let n=i.includes('"'),s=i.includes("'");n&&!s?r=Gc:s&&!n?r=Bn:r=t?Gc:Bn}return r(i,e)}var Wc;try{Wc=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch{Wc=/\n+(?!\n|$)/g}function To({comment:i,type:e,value:t},r,n,s){let{blockQuote:o,commentString:a,lineWidth:l}=r.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Hr(t,r);let c=r.indent||(r.forceBlockIndent||Io(t)?"  ":""),u=o==="literal"?!0:o==="folded"||e===ri.Scalar.BLOCK_FOLDED?!1:e===ri.Scalar.BLOCK_LITERAL?!0:!XO(t,l,c.length);if(!t)return u?`|
`:`>
`;let f,d;for(d=t.length;d>0;--d){let R=t[d-1];if(R!==`
`&&R!=="	"&&R!==" ")break}let m=t.substring(d),g=m.indexOf(`
`);g===-1?f="-":t===m||g!==m.length-1?(f="+",s&&s()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
`&&(m=m.slice(0,-1)),m=m.replace(Wc,`$&${c}`));let y=!1,b,x=-1;for(b=0;b<t.length;++b){let R=t[b];if(R===" ")y=!0;else if(R===`
`)x=b;else break}let S=t.substring(0,x<b?x+1:b);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let O=(u?"|":">")+(y?c?"2":"1":"")+f;if(i&&(O+=" "+a(i.replace(/ ?[\r\n]+/g," ")),n&&n()),u)return t=t.replace(/\n+/g,`$&${c}`),`${O}
${c}${S}${t}${m}`;t=t.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let E=Ii.foldFlowLines(`${S}${t}${m}`,c,Ii.FOLD_BLOCK,Ao(r,!0));return`${O}
${c}${E}`}function ek(i,e,t,r){let{type:n,value:s}=i,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&s.includes(`
`)||u&&/[[\]{},]/.test(s))return Hr(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
`)?Hr(s,e):To(i,e,t,r);if(!a&&!u&&n!==ri.Scalar.PLAIN&&s.includes(`
`))return To(i,e,t,r);if(Io(s)){if(l==="")return e.forceBlockIndent=!0,To(i,e,t,r);if(a&&l===c)return Hr(s,e)}let f=s.replace(/\n+/g,`$&
${l}`);if(o){let d=y=>{var b;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((b=y.test)==null?void 0:b.test(f))},{compat:m,tags:g}=e.doc.schema;if(g.some(d)||m!=null&&m.some(d))return Hr(s,e)}return a?f:Ii.foldFlowLines(f,l,Ii.FOLD_FLOW,Ao(e,!1))}function tk(i,e,t,r){let{implicitKey:n,inFlow:s}=e,o=typeof i.value=="string"?i:Object.assign({},i,{value:String(i.value)}),{type:a}=i;a!==ri.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ri.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case ri.Scalar.BLOCK_FOLDED:case ri.Scalar.BLOCK_LITERAL:return n||s?Hr(o.value,e):To(o,e,t,r);case ri.Scalar.QUOTE_DOUBLE:return Bn(o.value,e);case ri.Scalar.QUOTE_SINGLE:return Gc(o.value,e);case ri.Scalar.PLAIN:return ek(o,e,t,r);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=n&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}k0.stringifyString=tk});var Rn=w(Yc=>{"use strict";var ik=_o(),Ni=Se(),rk=In(),nk=Ln();function sk(i,e){let t=Object.assign({blockQuote:!0,commentString:rk.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},i.schema.toStringOptions,e),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:i,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):"  ",inFlow:r,options:t}}function ok(i,e){var n,s,o,a;if(e.tag){let l=i.filter(c=>c.tag===e.tag);if(l.length>0)return(n=l.find(c=>c.format===e.format))!=null?n:l[0]}let t,r;if(Ni.isScalar(e)){r=e.value;let l=i.filter(c=>{var u;return(u=c.identify)==null?void 0:u.call(c,r)});if(l.length>1){let c=l.filter(u=>u.test);c.length>0&&(l=c)}t=(s=l.find(c=>c.format===e.format))!=null?s:l.find(c=>!c.format)}else r=e,t=i.find(l=>l.nodeClass&&r instanceof l.nodeClass);if(!t){let l=(a=(o=r==null?void 0:r.constructor)==null?void 0:o.name)!=null?a:typeof r;throw new Error(`Tag not resolved for ${l} value`)}return t}function ak(i,e,{anchors:t,doc:r}){if(!r.directives)return"";let n=[],s=(Ni.isScalar(i)||Ni.isCollection(i))&&i.anchor;s&&ik.anchorIsValid(s)&&(t.add(s),n.push(`&${s}`));let o=i.tag?i.tag:e.default?null:e.tag;return o&&n.push(r.directives.tagString(o)),n.join(" ")}function lk(i,e,t,r){var l,c;if(Ni.isPair(i))return i.toString(e,t,r);if(Ni.isAlias(i)){if(e.doc.directives)return i.toString(e);if((l=e.resolvedAliases)!=null&&l.has(i))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(i):e.resolvedAliases=new Set([i]),i=i.resolve(e.doc)}let n,s=Ni.isNode(i)?i:e.doc.createNode(i,{onTagObj:u=>n=u});n||(n=ok(e.doc.schema.tags,s));let o=ak(s,n,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);let a=typeof n.stringify=="function"?n.stringify(s,e,t,r):Ni.isScalar(s)?nk.stringifyString(s,e,t,r):s.toString(e,t,r);return o?Ni.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
${e.indent}${a}`:a}Yc.createStringifyContext=sk;Yc.stringify=lk});var I0=w(A0=>{"use strict";var vi=Se(),C0=Ue(),T0=Rn(),Pn=In();function ck({key:i,value:e},t,r,n){var T,A;let{allNullValues:s,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=t,d=vi.isNode(i)&&i.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(vi.isCollection(i)||!vi.isNode(i)&&typeof i=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!i||d&&e==null&&!t.inFlow||vi.isCollection(i)||(vi.isScalar(i)?i.type===C0.Scalar.BLOCK_FOLDED||i.type===C0.Scalar.BLOCK_LITERAL:typeof i=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:a+l});let g=!1,y=!1,b=T0.stringify(i,t,()=>g=!0,()=>y=!0);if(!m&&!t.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(s||e==null)return g&&r&&r(),b===""?"?":m?`? ${b}`:b}else if(s&&!f||e==null&&m)return b=`? ${b}`,d&&!g?b+=Pn.lineComment(b,t.indent,c(d)):y&&n&&n(),b;g&&(d=null),m?(d&&(b+=Pn.lineComment(b,t.indent,c(d))),b=`? ${b}
${a}:`):(b=`${b}:`,d&&(b+=Pn.lineComment(b,t.indent,c(d))));let x,S,k;vi.isNode(e)?(x=!!e.spaceBefore,S=e.commentBefore,k=e.comment):(x=!1,S=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!d&&vi.isScalar(e)&&(t.indentAtStart=b.length+1),y=!1,!u&&l.length>=2&&!t.inFlow&&!m&&vi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let O=!1,E=T0.stringify(e,t,()=>O=!0,()=>y=!0),R=" ";if(d||x||S){if(R=x?`
`:"",S){let C=c(S);R+=`
${Pn.indentComment(C,t.indent)}`}E===""&&!t.inFlow?R===`
`&&(R=`

`):R+=`
${t.indent}`}else if(!m&&vi.isCollection(e)){let C=E[0],B=E.indexOf(`
`),P=B!==-1,U=(A=(T=t.inFlow)!=null?T:e.flow)!=null?A:e.items.length===0;if(P||!U){let F=!1;if(P&&(C==="&"||C==="!")){let H=E.indexOf(" ");C==="&"&&H!==-1&&H<B&&E[H+1]==="!"&&(H=E.indexOf(" ",H+1)),(H===-1||B<H)&&(F=!0)}F||(R=`
${t.indent}`)}}else(E===""||E[0]===`
`)&&(R="");return b+=R+E,t.inFlow?O&&r&&r():k&&!O?b+=Pn.lineComment(b,t.indent,c(k)):y&&n&&n(),b}A0.stringifyPair=ck});var zc=w(Kc=>{"use strict";function uk(i,...e){i==="debug"&&console.log(...e)}function fk(i,e){(i==="debug"||i==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Kc.debug=uk;Kc.warn=fk});var Ro=w(Lo=>{"use strict";var Mn=Se(),N0=Ue(),No="<<",Bo={identify:i=>i===No||typeof i=="symbol"&&i.description===No,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new N0.Scalar(Symbol(No)),{addToJSMap:B0}),stringify:()=>No},hk=(i,e)=>(Bo.identify(e)||Mn.isScalar(e)&&(!e.type||e.type===N0.Scalar.PLAIN)&&Bo.identify(e.value))&&(i==null?void 0:i.doc.schema.tags.some(t=>t.tag===Bo.tag&&t.default));function B0(i,e,t){if(t=i&&Mn.isAlias(t)?t.resolve(i.doc):t,Mn.isSeq(t))for(let r of t.items)Jc(i,e,r);else if(Array.isArray(t))for(let r of t)Jc(i,e,r);else Jc(i,e,t)}function Jc(i,e,t){let r=i&&Mn.isAlias(t)?t.resolve(i.doc):t;if(!Mn.isMap(r))throw new Error("Merge sources must be maps or map aliases");let n=r.toJSON(null,i,Map);for(let[s,o]of n)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Lo.addMergeToJSMap=B0;Lo.isMergeKey=hk;Lo.merge=Bo});var Qc=w(P0=>{"use strict";var pk=zc(),L0=Ro(),dk=Rn(),R0=Se(),Zc=Ti();function mk(i,e,{key:t,value:r}){if(R0.isNode(t)&&t.addToJSMap)t.addToJSMap(i,e,r);else if(L0.isMergeKey(i,t))L0.addMergeToJSMap(i,e,r);else{let n=Zc.toJS(t,"",i);if(e instanceof Map)e.set(n,Zc.toJS(r,n,i));else if(e instanceof Set)e.add(n);else{let s=gk(t,n,i),o=Zc.toJS(r,s,i);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function gk(i,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(R0.isNode(i)&&(t!=null&&t.doc)){let r=dk.createStringifyContext(t.doc,{});r.anchors=new Set;for(let s of t.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let n=i.toString(r);if(!t.mapKeyWarned){let s=JSON.stringify(n);s.length>40&&(s=s.substring(0,36)+'..."'),pk.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return n}return JSON.stringify(e)}P0.addPairToJSMap=mk});var Bi=w(Xc=>{"use strict";var M0=An(),vk=I0(),yk=Qc(),Po=Se();function bk(i,e,t){let r=M0.createNode(i,void 0,t),n=M0.createNode(e,void 0,t);return new Mo(r,n)}var Mo=class i{constructor(e,t=null){Object.defineProperty(this,Po.NODE_TYPE,{value:Po.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return Po.isNode(t)&&(t=t.clone(e)),Po.isNode(r)&&(r=r.clone(e)),new i(t,r)}toJSON(e,t){let r=t!=null&&t.mapAsMap?new Map:{};return yk.addPairToJSMap(t,r,this)}toString(e,t,r){return e!=null&&e.doc?vk.stringifyPair(this,e,t,r):JSON.stringify(this)}};Xc.Pair=Mo;Xc.createPair=bk});var eu=w(F0=>{"use strict";var or=Se(),q0=Rn(),qo=In();function _k(i,e,t){var s;return(((s=e.inFlow)!=null?s:i.flow)?xk:wk)(i,e,t)}function wk({comment:i,items:e},t,{blockItemPrefix:r,flowChars:n,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,u=Object.assign({},t,{indent:s,type:null}),f=!1,d=[];for(let g=0;g<e.length;++g){let y=e[g],b=null;if(or.isNode(y))!f&&y.spaceBefore&&d.push(""),Fo(t,d,y.commentBefore,f),y.comment&&(b=y.comment);else if(or.isPair(y)){let S=or.isNode(y.key)?y.key:null;S&&(!f&&S.spaceBefore&&d.push(""),Fo(t,d,S.commentBefore,f))}f=!1;let x=q0.stringify(y,u,()=>b=null,()=>f=!0);b&&(x+=qo.lineComment(x,s,c(b))),f&&b&&(f=!1),d.push(r+x)}let m;if(d.length===0)m=n.start+n.end;else{m=d[0];for(let g=1;g<d.length;++g){let y=d[g];m+=y?`
${l}${y}`:`
`}}return i?(m+=`
`+qo.indentComment(c(i),l),a&&a()):f&&o&&o(),m}function xk({items:i},e,{flowChars:t,itemIndent:r}){let{indent:n,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;let l=Object.assign({},e,{indent:r,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let g=0;g<i.length;++g){let y=i[g],b=null;if(or.isNode(y))y.spaceBefore&&f.push(""),Fo(e,f,y.commentBefore,!1),y.comment&&(b=y.comment);else if(or.isPair(y)){let S=or.isNode(y.key)?y.key:null;S&&(S.spaceBefore&&f.push(""),Fo(e,f,S.commentBefore,!1),S.comment&&(c=!0));let k=or.isNode(y.value)?y.value:null;k?(k.comment&&(b=k.comment),k.commentBefore&&(c=!0)):y.value==null&&(S!=null&&S.comment)&&(b=S.comment)}b&&(c=!0);let x=q0.stringify(y,l,()=>b=null);g<i.length-1&&(x+=","),b&&(x+=qo.lineComment(x,r,a(b))),!c&&(f.length>u||x.includes(`
`))&&(c=!0),f.push(x),u=f.length}let{start:d,end:m}=t;if(f.length===0)return d+m;if(!c){let g=f.reduce((y,b)=>y+b.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=d;for(let y of f)g+=y?`
${s}${n}${y}`:`
`;return`${g}
${n}${m}`}else return`${d}${o}${f.join(" ")}${o}${m}`}function Fo({indent:i,options:{commentString:e}},t,r,n){if(r&&n&&(r=r.replace(/^\n+/,"")),r){let s=qo.indentComment(e(r),i);t.push(s.trimStart())}}F0.stringifyCollection=_k});var Ri=w(iu=>{"use strict";var Sk=eu(),Ek=Qc(),Ok=Oo(),Li=Se(),Do=Bi(),kk=Ue();function qn(i,e){let t=Li.isScalar(e)?e.value:e;for(let r of i)if(Li.isPair(r)&&(r.key===e||r.key===t||Li.isScalar(r.key)&&r.key.value===t))return r}var tu=class extends Ok.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Li.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:s}=r,o=new this(e),a=(l,c)=>{if(typeof s=="function")c=s.call(t,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||n)&&o.items.push(Do.createPair(l,c,r))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){var o;let r;Li.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Do.Pair(e,e==null?void 0:e.value):r=new Do.Pair(e.key,e.value);let n=qn(this.items,r.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(n){if(!t)throw new Error(`Key ${r.key} already set`);Li.isScalar(n.value)&&kk.isScalarValue(r.value)?n.value.value=r.value:n.value=r.value}else if(s){let a=this.items.findIndex(l=>s(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(e){let t=qn(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var s;let r=qn(this.items,e),n=r==null?void 0:r.value;return(s=!t&&Li.isScalar(n)?n.value:n)!=null?s:void 0}has(e){return!!qn(this.items,e)}set(e,t){this.add(new Do.Pair(e,t),!0)}toJSON(e,t,r){let n=r?new r:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(n);for(let s of this.items)Ek.addPairToJSMap(t,n,s);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Li.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Sk.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};iu.YAMLMap=tu;iu.findPair=qn});var Gr=w(j0=>{"use strict";var Ck=Se(),D0=Ri(),Tk={collection:"map",default:!0,nodeClass:D0.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(i,e){return Ck.isMap(i)||e("Expected a mapping for this tag"),i},createNode:(i,e,t)=>D0.YAMLMap.from(i,e,t)};j0.map=Tk});var Pi=w(U0=>{"use strict";var Ak=An(),Ik=eu(),Nk=Oo(),Uo=Se(),Bk=Ue(),Lk=Ti(),ru=class extends Nk.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Uo.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=jo(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=jo(e);if(typeof r!="number")return;let n=this.items[r];return!t&&Uo.isScalar(n)?n.value:n}has(e){let t=jo(e);return typeof t=="number"&&t<this.items.length}set(e,t){let r=jo(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[r];Uo.isScalar(n)&&Bk.isScalarValue(t)?n.value=t:this.items[r]=t}toJSON(e,t){let r=[];t!=null&&t.onCreate&&t.onCreate(r);let n=0;for(let s of this.items)r.push(Lk.toJS(s,String(n++),t));return r}toString(e,t,r){return e?Ik.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+"  ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:n}=r,s=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof n=="function"){let l=t instanceof Set?a:String(o++);a=n.call(t,l,a)}s.items.push(Ak.createNode(a,void 0,r))}}return s}};function jo(i){let e=Uo.isScalar(i)?i.value:i;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}U0.YAMLSeq=ru});var Wr=w(V0=>{"use strict";var Rk=Se(),$0=Pi(),Pk={collection:"seq",default:!0,nodeClass:$0.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(i,e){return Rk.isSeq(i)||e("Expected a sequence for this tag"),i},createNode:(i,e,t)=>$0.YAMLSeq.from(i,e,t)};V0.seq=Pk});var Fn=w(H0=>{"use strict";var Mk=Ln(),qk={identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify(i,e,t,r){return e=Object.assign({actualString:!0},e),Mk.stringifyString(i,e,t,r)}};H0.string=qk});var $o=w(Y0=>{"use strict";var G0=Ue(),W0={identify:i=>i==null,createNode:()=>new G0.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new G0.Scalar(null),stringify:({source:i},e)=>typeof i=="string"&&W0.test.test(i)?i:e.options.nullStr};Y0.nullTag=W0});var nu=w(z0=>{"use strict";var Fk=Ue(),K0={identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:i=>new Fk.Scalar(i[0]==="t"||i[0]==="T"),stringify({source:i,value:e},t){if(i&&K0.test.test(i)){let r=i[0]==="t"||i[0]==="T";if(e===r)return i}return e?t.options.trueStr:t.options.falseStr}};z0.boolTag=K0});var Yr=w(J0=>{"use strict";function Dk({format:i,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);let n=typeof r=="number"?r:Number(r);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let s=JSON.stringify(r);if(!i&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}J0.stringifyNumber=Dk});var ou=w(Vo=>{"use strict";var jk=Ue(),su=Yr(),Uk={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:su.stringifyNumber},$k={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i),stringify(i){let e=Number(i.value);return isFinite(e)?e.toExponential():su.stringifyNumber(i)}},Vk={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(i){let e=new jk.Scalar(parseFloat(i)),t=i.indexOf(".");return t!==-1&&i[i.length-1]==="0"&&(e.minFractionDigits=i.length-t-1),e},stringify:su.stringifyNumber};Vo.float=Vk;Vo.floatExp=$k;Vo.floatNaN=Uk});var lu=w(Go=>{"use strict";var Z0=Yr(),Ho=i=>typeof i=="bigint"||Number.isInteger(i),au=(i,e,t,{intAsBigInt:r})=>r?BigInt(i):parseInt(i.substring(e),t);function Q0(i,e,t){let{value:r}=i;return Ho(r)&&r>=0?t+r.toString(e):Z0.stringifyNumber(i)}var Hk={identify:i=>Ho(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(i,e,t)=>au(i,2,8,t),stringify:i=>Q0(i,8,"0o")},Gk={identify:Ho,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(i,e,t)=>au(i,0,10,t),stringify:Z0.stringifyNumber},Wk={identify:i=>Ho(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(i,e,t)=>au(i,2,16,t),stringify:i=>Q0(i,16,"0x")};Go.int=Gk;Go.intHex=Wk;Go.intOct=Hk});var ev=w(X0=>{"use strict";var Yk=Gr(),Kk=$o(),zk=Wr(),Jk=Fn(),Zk=nu(),cu=ou(),uu=lu(),Qk=[Yk.map,zk.seq,Jk.string,Kk.nullTag,Zk.boolTag,uu.intOct,uu.int,uu.intHex,cu.floatNaN,cu.floatExp,cu.float];X0.schema=Qk});var rv=w(iv=>{"use strict";var Xk=Ue(),eC=Gr(),tC=Wr();function tv(i){return typeof i=="bigint"||Number.isInteger(i)}var Wo=({value:i})=>JSON.stringify(i),iC=[{identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify:Wo},{identify:i=>i==null,createNode:()=>new Xk.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Wo},{identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:i=>i==="true",stringify:Wo},{identify:tv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(i,e,{intAsBigInt:t})=>t?BigInt(i):parseInt(i,10),stringify:({value:i})=>tv(i)?i.toString():JSON.stringify(i)},{identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:i=>parseFloat(i),stringify:Wo}],rC={default:!0,tag:"",test:/^/,resolve(i,e){return e(`Unresolved plain scalar ${JSON.stringify(i)}`),i}},nC=[eC.map,tC.seq].concat(iC,rC);iv.schema=nC});var hu=w(nv=>{"use strict";var fu=Ue(),sC=Ln(),oC={identify:i=>i instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(i,e){if(typeof Buffer=="function")return Buffer.from(i,"base64");if(typeof atob=="function"){let t=atob(i.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),i},stringify({comment:i,type:e,value:t},r,n,s){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=fu.Scalar.BLOCK_LITERAL),e!==fu.Scalar.QUOTE_DOUBLE){let l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)u[f]=a.substr(d,l);a=u.join(e===fu.Scalar.BLOCK_LITERAL?`
`:" ")}return sC.stringifyString({comment:i,type:e,value:a},r,n,s)}};nv.binary=oC});var zo=w(Ko=>{"use strict";var Yo=Se(),pu=Bi(),aC=Ue(),lC=Pi();function sv(i,e){var t;if(Yo.isSeq(i))for(let r=0;r<i.items.length;++r){let n=i.items[r];if(!Yo.isPair(n)){if(Yo.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let s=n.items[0]||new pu.Pair(new aC.Scalar(null));if(n.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${n.commentBefore}
${s.key.commentBefore}`:n.commentBefore),n.comment){let o=(t=s.value)!=null?t:s.key;o.comment=o.comment?`${n.comment}
${o.comment}`:n.comment}n=s}i.items[r]=Yo.isPair(n)?n:new pu.Pair(n)}}else e("Expected a sequence for this tag");return i}function ov(i,e,t){let{replacer:r}=t,n=new lC.YAMLSeq(i);n.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(s++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;n.items.push(pu.createPair(a,l,t))}return n}var cC={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:sv,createNode:ov};Ko.createPairs=ov;Ko.pairs=cC;Ko.resolvePairs=sv});var gu=w(mu=>{"use strict";var av=Se(),du=Ti(),Dn=Ri(),uC=Pi(),lv=zo(),ar=class i extends uC.YAMLSeq{constructor(){super(),this.add=Dn.YAMLMap.prototype.add.bind(this),this.delete=Dn.YAMLMap.prototype.delete.bind(this),this.get=Dn.YAMLMap.prototype.get.bind(this),this.has=Dn.YAMLMap.prototype.has.bind(this),this.set=Dn.YAMLMap.prototype.set.bind(this),this.tag=i.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t!=null&&t.onCreate&&t.onCreate(r);for(let n of this.items){let s,o;if(av.isPair(n)?(s=du.toJS(n.key,"",t),o=du.toJS(n.value,s,t)):s=du.toJS(n,"",t),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,t,r){let n=lv.createPairs(e,t,r),s=new this;return s.items=n.items,s}};ar.tag="tag:yaml.org,2002:omap";var fC={collection:"seq",identify:i=>i instanceof Map,nodeClass:ar,default:!1,tag:"tag:yaml.org,2002:omap",resolve(i,e){let t=lv.resolvePairs(i,e),r=[];for(let{key:n}of t.items)av.isScalar(n)&&(r.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):r.push(n.value));return Object.assign(new ar,t)},createNode:(i,e,t)=>ar.from(i,e,t)};mu.YAMLOMap=ar;mu.omap=fC});var pv=w(vu=>{"use strict";var cv=Ue();function uv({value:i,source:e},t){return e&&(i?fv:hv).test.test(e)?e:i?t.options.trueStr:t.options.falseStr}var fv={identify:i=>i===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new cv.Scalar(!0),stringify:uv},hv={identify:i=>i===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new cv.Scalar(!1),stringify:uv};vu.falseTag=hv;vu.trueTag=fv});var dv=w(Jo=>{"use strict";var hC=Ue(),yu=Yr(),pC={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yu.stringifyNumber},dC={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i.replace(/_/g,"")),stringify(i){let e=Number(i.value);return isFinite(e)?e.toExponential():yu.stringifyNumber(i)}},mC={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(i){let e=new hC.Scalar(parseFloat(i.replace(/_/g,""))),t=i.indexOf(".");if(t!==-1){let r=i.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:yu.stringifyNumber};Jo.float=mC;Jo.floatExp=dC;Jo.floatNaN=pC});var gv=w(Un=>{"use strict";var mv=Yr(),jn=i=>typeof i=="bigint"||Number.isInteger(i);function Zo(i,e,t,{intAsBigInt:r}){let n=i[0];if((n==="-"||n==="+")&&(e+=1),i=i.substring(e).replace(/_/g,""),r){switch(t){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`;break}let o=BigInt(i);return n==="-"?BigInt(-1)*o:o}let s=parseInt(i,t);return n==="-"?-1*s:s}function bu(i,e,t){let{value:r}=i;if(jn(r)){let n=r.toString(e);return r<0?"-"+t+n.substr(1):t+n}return mv.stringifyNumber(i)}var gC={identify:jn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(i,e,t)=>Zo(i,2,2,t),stringify:i=>bu(i,2,"0b")},vC={identify:jn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(i,e,t)=>Zo(i,1,8,t),stringify:i=>bu(i,8,"0")},yC={identify:jn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(i,e,t)=>Zo(i,0,10,t),stringify:mv.stringifyNumber},bC={identify:jn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(i,e,t)=>Zo(i,2,16,t),stringify:i=>bu(i,16,"0x")};Un.int=yC;Un.intBin=gC;Un.intHex=bC;Un.intOct=vC});var wu=w(_u=>{"use strict";var ea=Se(),Qo=Bi(),Xo=Ri(),lr=class i extends Xo.YAMLMap{constructor(e){super(e),this.tag=i.tag}add(e){let t;ea.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Qo.Pair(e.key,null):t=new Qo.Pair(e,null),Xo.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=Xo.findPair(this.items,e);return!t&&ea.isPair(r)?ea.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Xo.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new Qo.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof n=="function"&&(o=n.call(t,o,o)),s.items.push(Qo.createPair(o,null,r));return s}};lr.tag="tag:yaml.org,2002:set";var _C={collection:"map",identify:i=>i instanceof Set,nodeClass:lr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(i,e,t)=>lr.from(i,e,t),resolve(i,e){if(ea.isMap(i)){if(i.hasAllNullValues(!0))return Object.assign(new lr,i);e("Set items must all have null values")}else e("Expected a mapping for this tag");return i}};_u.YAMLSet=lr;_u.set=_C});var Su=w(ta=>{"use strict";var wC=Yr();function xu(i,e){let t=i[0],r=t==="-"||t==="+"?i.substring(1):i,n=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*n(60)+n(a),n(0));return t==="-"?n(-1)*s:s}function vv(i){let{value:e}=i,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return wC.stringifyNumber(i);let r="";e<0&&(r="-",e*=t(-1));let n=t(60),s=[e%n];return e<60?s.unshift(0):(e=(e-s[0])/n,s.unshift(e%n),e>=60&&(e=(e-s[0])/n,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var xC={identify:i=>typeof i=="bigint"||Number.isInteger(i),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(i,e,{intAsBigInt:t})=>xu(i,t),stringify:vv},SC={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:i=>xu(i,!1),stringify:vv},yv={identify:i=>i instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(i){let e=i.match(yv.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,n,s,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,r-1,n,s||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=xu(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:i})=>i.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};ta.floatTime=SC;ta.intTime=xC;ta.timestamp=yv});var wv=w(_v=>{"use strict";var EC=Gr(),OC=$o(),kC=Wr(),CC=Fn(),TC=hu(),bv=pv(),Eu=dv(),ia=gv(),AC=Ro(),IC=gu(),NC=zo(),BC=wu(),Ou=Su(),LC=[EC.map,kC.seq,CC.string,OC.nullTag,bv.trueTag,bv.falseTag,ia.intBin,ia.intOct,ia.int,ia.intHex,Eu.floatNaN,Eu.floatExp,Eu.float,TC.binary,AC.merge,IC.omap,NC.pairs,BC.set,Ou.intTime,Ou.floatTime,Ou.timestamp];_v.schema=LC});var Nv=w(Tu=>{"use strict";var Ov=Gr(),RC=$o(),kv=Wr(),PC=Fn(),MC=nu(),ku=ou(),Cu=lu(),qC=ev(),FC=rv(),Cv=hu(),$n=Ro(),Tv=gu(),Av=zo(),xv=wv(),Iv=wu(),ra=Su(),Sv=new Map([["core",qC.schema],["failsafe",[Ov.map,kv.seq,PC.string]],["json",FC.schema],["yaml11",xv.schema],["yaml-1.1",xv.schema]]),Ev={binary:Cv.binary,bool:MC.boolTag,float:ku.float,floatExp:ku.floatExp,floatNaN:ku.floatNaN,floatTime:ra.floatTime,int:Cu.int,intHex:Cu.intHex,intOct:Cu.intOct,intTime:ra.intTime,map:Ov.map,merge:$n.merge,null:RC.nullTag,omap:Tv.omap,pairs:Av.pairs,seq:kv.seq,set:Iv.set,timestamp:ra.timestamp},DC={"tag:yaml.org,2002:binary":Cv.binary,"tag:yaml.org,2002:merge":$n.merge,"tag:yaml.org,2002:omap":Tv.omap,"tag:yaml.org,2002:pairs":Av.pairs,"tag:yaml.org,2002:set":Iv.set,"tag:yaml.org,2002:timestamp":ra.timestamp};function jC(i,e,t){let r=Sv.get(e);if(r&&!i)return t&&!r.includes($n.merge)?r.concat($n.merge):r.slice();let n=r;if(!n)if(Array.isArray(i))n=[];else{let s=Array.from(Sv.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(i))for(let s of i)n=n.concat(s);else typeof i=="function"&&(n=i(n.slice()));return t&&(n=n.concat($n.merge)),n.reduce((s,o)=>{let a=typeof o=="string"?Ev[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Ev).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(a)||s.push(a),s},[])}Tu.coreKnownTags=DC;Tu.getTags=jC});var Nu=w(Bv=>{"use strict";var Au=Se(),UC=Gr(),$C=Wr(),VC=Fn(),na=Nv(),HC=(i,e)=>i.key<e.key?-1:i.key>e.key?1:0,Iu=class i{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?na.getTags(e,"compat"):e?na.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=n?na.coreKnownTags:{},this.tags=na.getTags(t,this.name,r),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,Au.MAP,{value:UC.map}),Object.defineProperty(this,Au.SCALAR,{value:VC.string}),Object.defineProperty(this,Au.SEQ,{value:$C.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?HC:null}clone(){let e=Object.create(i.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Bv.Schema=Iu});var Rv=w(Lv=>{"use strict";var GC=Se(),Bu=Rn(),Vn=In();function WC(i,e){var l;let t=[],r=e.directives===!0;if(e.directives!==!1&&i.directives){let c=i.directives.toString(i);c?(t.push(c),r=!0):i.directives.docStart&&(r=!0)}r&&t.push("---");let n=Bu.createStringifyContext(i,e),{commentString:s}=n.options;if(i.commentBefore){t.length!==1&&t.unshift("");let c=s(i.commentBefore);t.unshift(Vn.indentComment(c,""))}let o=!1,a=null;if(i.contents){if(GC.isNode(i.contents)){if(i.contents.spaceBefore&&r&&t.push(""),i.contents.commentBefore){let f=s(i.contents.commentBefore);t.push(Vn.indentComment(f,""))}n.forceBlockIndent=!!i.comment,a=i.contents.comment}let c=a?void 0:()=>o=!0,u=Bu.stringify(i.contents,n,()=>a=null,c);a&&(u+=Vn.lineComment(u,"",s(a))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(Bu.stringify(i.contents,n));if((l=i.directives)!=null&&l.docEnd)if(i.comment){let c=s(i.comment);c.includes(`
`)?(t.push("..."),t.push(Vn.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=i.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Vn.indentComment(s(c),"")))}return t.join(`
`)+`
`}Lv.stringifyDocument=WC});var Hn=w(Pv=>{"use strict";var YC=Tn(),Kr=Oo(),qt=Se(),KC=Bi(),zC=Ti(),JC=Nu(),ZC=Rv(),Lu=_o(),QC=qc(),XC=An(),Ru=Mc(),Pu=class i{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,qt.NODE_TYPE,{value:qt.DOC});let n=null;typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ru.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(i.prototype,{[qt.NODE_TYPE]:{value:qt.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=qt.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){zr(this.contents)&&this.contents.add(e)}addIn(e,t){zr(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=Lu.anchorNames(this);e.anchor=!t||r.has(t)?Lu.findNewAnchor(t||"a",r):t}return new YC.Alias(e.anchor)}createNode(e,t,r){let n;if(typeof t=="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let b=S=>typeof S=="number"||S instanceof String||S instanceof Number,x=t.filter(b).map(String);x.length>0&&(t=t.concat(x)),n=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=r!=null?r:{},{onAnchor:f,setAnchors:d,sourceObjects:m}=Lu.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:s!=null?s:!0,keepUndefined:l!=null?l:!1,onAnchor:f,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:m},y=XC.createNode(e,u,g);return a&&qt.isCollection(y)&&(y.flow=!0),d(),y}createPair(e,t,r={}){let n=this.createNode(e,null,r),s=this.createNode(t,null,r);return new KC.Pair(n,s)}delete(e){return zr(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Kr.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):zr(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return qt.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Kr.isEmptyPath(e)?!t&&qt.isScalar(this.contents)?this.contents.value:this.contents:qt.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return qt.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Kr.isEmptyPath(e)?this.contents!==void 0:qt.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Kr.collectionFromPath(this.schema,[e],t):zr(this.contents)&&this.contents.set(e,t)}setIn(e,t){Kr.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Kr.collectionFromPath(this.schema,Array.from(e),t):zr(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ru.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ru.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new JC.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=zC.toJS(this.contents,t!=null?t:"",a);if(typeof s=="function")for(let{count:c,res:u}of a.anchors.values())s(u,c);return typeof o=="function"?QC.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return ZC.stringifyDocument(this,e)}};function zr(i){if(qt.isCollection(i))return!0;throw new Error("Expected a YAML collection as document contents")}Pv.Document=Pu});var Yn=w(Wn=>{"use strict";var Gn=class extends Error{constructor(e,t,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=t}},Mu=class extends Gn{constructor(e,t,r){super("YAMLParseError",e,t,r)}},qu=class extends Gn{constructor(e,t,r){super("YAMLWarning",e,t,r)}},eT=(i,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:r,col:n}=t.linePos[0];t.message+=` at line ${r}, column ${n}`;let s=n-1,o=i.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,s))){let a=i.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l&&l.line===r&&l.col>n&&(a=Math.max(1,Math.min(l.col-n,80-s)));let c=" ".repeat(s)+"^".repeat(a);t.message+=`:

${o}
${c}
`}};Wn.YAMLError=Gn;Wn.YAMLParseError=Mu;Wn.YAMLWarning=qu;Wn.prettifyError=eT});var Kn=w(Mv=>{"use strict";function tT(i,{flow:e,indicator:t,next:r,offset:n,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",m=!1,g=!1,y=null,b=null,x=null,S=null,k=null,O=null,E=null;for(let A of i)switch(g&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&s(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),y&&(c&&A.type!=="comment"&&A.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),A.type){case"space":!e&&(t!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&A.source.includes("	")&&(y=A),u=!0;break;case"comment":{u||s(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=A.source.substring(1)||" ";f?f+=d+C:f=C,d="",c=!1;break}case"newline":c?f?f+=A.source:l=!0:d+=A.source,c=!0,m=!0,(b||x)&&(S=A),u=!0;break;case"anchor":b&&s(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&s(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=A,E===null&&(E=A.offset),c=!1,u=!1,g=!0;break;case"tag":{x&&s(A,"MULTIPLE_TAGS","A node can have at most one tag"),x=A,E===null&&(E=A.offset),c=!1,u=!1,g=!0;break}case t:(b||x)&&s(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),O&&s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e!=null?e:"collection"}`),O=A,c=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&s(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=A,c=!1,u=!1;break}default:s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),c=!1,u=!1}let R=i[i.length-1],T=R?R.offset+R.source.length:n;return g&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(c&&y.indent<=o||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:O,spaceBefore:l,comment:f,hasNewline:m,anchor:b,tag:x,newlineAfterProp:S,end:T,start:E!=null?E:T}}Mv.resolveProps=tT});var sa=w(qv=>{"use strict";function Fu(i){if(!i)return null;switch(i.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(i.source.includes(`
`))return!0;if(i.end){for(let e of i.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of i.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Fu(e.key)||Fu(e.value))return!0}return!1;default:return!0}}qv.containsNewline=Fu});var Du=w(Fv=>{"use strict";var iT=sa();function rT(i,e,t){if((e==null?void 0:e.type)==="flow-collection"){let r=e.end[0];r.indent===i&&(r.source==="]"||r.source==="}")&&iT.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Fv.flowIndentCheck=rT});var ju=w(jv=>{"use strict";var Dv=Se();function nT(i,e,t){let{uniqueKeys:r}=i.options;if(r===!1)return!1;let n=typeof r=="function"?r:(s,o)=>s===o||Dv.isScalar(s)&&Dv.isScalar(o)&&s.value===o.value;return e.some(s=>n(s.key,t))}jv.mapIncludes=nT});var Wv=w(Gv=>{"use strict";var Uv=Bi(),sT=Ri(),$v=Kn(),oT=sa(),Vv=Du(),aT=ju(),Hv="All mapping items must start at the same column";function lT({composeNode:i,composeEmptyNode:e},t,r,n,s){var u,f;let o=(u=s==null?void 0:s.nodeClass)!=null?u:sT.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=r.offset,c=null;for(let d of r.items){let{start:m,key:g,sep:y,value:b}=d,x=$v.resolveProps(m,{indicator:"explicit-key-ind",next:g!=null?g:y==null?void 0:y[0],offset:l,onError:n,parentIndent:r.indent,startOnNewline:!0}),S=!x.found;if(S){if(g&&(g.type==="block-seq"?n(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&n(l,"BAD_INDENT",Hv)),!x.anchor&&!x.tag&&!y){c=x.end,x.comment&&(a.comment?a.comment+=`
`+x.comment:a.comment=x.comment);continue}(x.newlineAfterProp||oT.containsNewline(g))&&n(g!=null?g:m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((f=x.found)==null?void 0:f.indent)!==r.indent&&n(l,"BAD_INDENT",Hv);t.atKey=!0;let k=x.end,O=g?i(t,g,x,n):e(t,k,m,null,x,n);t.schema.compat&&Vv.flowIndentCheck(r.indent,g,n),t.atKey=!1,aT.mapIncludes(t,a.items,O)&&n(k,"DUPLICATE_KEY","Map keys must be unique");let E=$v.resolveProps(y!=null?y:[],{indicator:"map-value-ind",next:b,offset:O.range[2],onError:n,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(l=E.end,E.found){S&&((b==null?void 0:b.type)==="block-map"&&!E.hasNewline&&n(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&x.start<E.found.offset-1024&&n(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=b?i(t,b,E,n):e(t,l,y,null,E,n);t.schema.compat&&Vv.flowIndentCheck(r.indent,b,n),l=R.range[2];let T=new Uv.Pair(O,R);t.options.keepSourceTokens&&(T.srcToken=d),a.items.push(T)}else{S&&n(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&(O.comment?O.comment+=`
`+E.comment:O.comment=E.comment);let R=new Uv.Pair(O);t.options.keepSourceTokens&&(R.srcToken=d),a.items.push(R)}}return c&&c<l&&n(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c!=null?c:l],a}Gv.resolveBlockMap=lT});var Kv=w(Yv=>{"use strict";var cT=Pi(),uT=Kn(),fT=Du();function hT({composeNode:i,composeEmptyNode:e},t,r,n,s){var u;let o=(u=s==null?void 0:s.nodeClass)!=null?u:cT.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=r.offset,c=null;for(let{start:f,value:d}of r.items){let m=uT.resolveProps(f,{indicator:"seq-item-ind",next:d,offset:l,onError:n,parentIndent:r.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||d)d&&d.type==="block-seq"?n(m.end,"BAD_INDENT","All sequence items must start at the same column"):n(l,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(a.comment=m.comment);continue}let g=d?i(t,d,m,n):e(t,m.end,f,null,m,n);t.schema.compat&&fT.flowIndentCheck(r.indent,d,n),l=g.range[2],a.items.push(g)}return a.range=[r.offset,l,c!=null?c:l],a}Yv.resolveBlockSeq=hT});var Jr=w(zv=>{"use strict";function pT(i,e,t,r){let n="";if(i){let s=!1,o="";for(let a of i){let{source:l,type:c}=a;switch(c){case"space":s=!0;break;case"comment":{t&&!s&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";n?n+=o+u:n=u,o="";break}case"newline":n&&(o+=l),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:n,offset:e}}zv.resolveEnd=pT});var Xv=w(Qv=>{"use strict";var dT=Se(),mT=Bi(),Jv=Ri(),gT=Pi(),vT=Jr(),Zv=Kn(),yT=sa(),bT=ju(),Uu="Block collections are not allowed within flow collections",$u=i=>i&&(i.type==="block-map"||i.type==="block-seq");function _T({composeNode:i,composeEmptyNode:e},t,r,n,s){var b,x;let o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(b=s==null?void 0:s.nodeClass)!=null?b:o?Jv.YAMLMap:gT.YAMLSeq,c=new l(t.schema);c.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){let k=r.items[S],{start:O,key:E,sep:R,value:T}=k,A=Zv.resolveProps(O,{flow:a,indicator:"explicit-key-ind",next:E!=null?E:R==null?void 0:R[0],offset:f,onError:n,parentIndent:r.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!R&&!T){S===0&&A.comma?n(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<r.items.length-1&&n(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
`+A.comment:c.comment=A.comment),f=A.end;continue}!o&&t.options.strict&&yT.containsNewline(E)&&n(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)A.comma&&n(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||n(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let C="";e:for(let B of O)switch(B.type){case"comma":case"space":break;case"comment":C=B.source.substring(1);break e;default:break e}if(C){let B=c.items[c.items.length-1];dT.isPair(B)&&(B=(x=B.value)!=null?x:B.key),B.comment?B.comment+=`
`+C:B.comment=C,A.comment=A.comment.substring(C.length+1)}}if(!o&&!R&&!A.found){let C=T?i(t,T,A,n):e(t,A.end,R,null,A,n);c.items.push(C),f=C.range[2],$u(T)&&n(C.range,"BLOCK_IN_FLOW",Uu)}else{t.atKey=!0;let C=A.end,B=E?i(t,E,A,n):e(t,C,O,null,A,n);$u(E)&&n(B.range,"BLOCK_IN_FLOW",Uu),t.atKey=!1;let P=Zv.resolveProps(R!=null?R:[],{flow:a,indicator:"map-value-ind",next:T,offset:B.range[2],onError:n,parentIndent:r.indent,startOnNewline:!1});if(P.found){if(!o&&!A.found&&t.options.strict){if(R)for(let H of R){if(H===P.found)break;if(H.type==="newline"){n(H,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<P.found.offset-1024&&n(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source&&T.source[0]===":"?n(T,"MISSING_CHAR",`Missing space after : in ${a}`):n(P.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let U=T?i(t,T,P,n):P.found?e(t,P.end,R,null,P,n):null;U?$u(T)&&n(U.range,"BLOCK_IN_FLOW",Uu):P.comment&&(B.comment?B.comment+=`
`+P.comment:B.comment=P.comment);let F=new mT.Pair(B,U);if(t.options.keepSourceTokens&&(F.srcToken=k),o){let H=c;bT.mapIncludes(t,H.items,B)&&n(C,"DUPLICATE_KEY","Map keys must be unique"),H.items.push(F)}else{let H=new Jv.YAMLMap(t.schema);H.flow=!0,H.items.push(F);let j=(U!=null?U:B).range;H.range=[B.range[0],j[1],j[2]],c.items.push(H)}f=U?U.range[2]:P.end}}let d=o?"}":"]",[m,...g]=r.end,y=f;if(m&&m.source===d)y=m.offset+m.source.length;else{let S=a[0].toUpperCase()+a.substring(1),k=u?`${S} must end with a ${d}`:`${S} in block collection must be sufficiently indented and end with a ${d}`;n(f,u?"MISSING_CHAR":"BAD_INDENT",k),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let S=vT.resolveEnd(g,y,t.options.strict,n);S.comment&&(c.comment?c.comment+=`
`+S.comment:c.comment=S.comment),c.range=[r.offset,y,S.offset]}else c.range=[r.offset,y,y];return c}Qv.resolveFlowCollection=_T});var ty=w(ey=>{"use strict";var wT=Se(),xT=Ue(),ST=Ri(),ET=Pi(),OT=Wv(),kT=Kv(),CT=Xv();function Vu(i,e,t,r,n,s){let o=t.type==="block-map"?OT.resolveBlockMap(i,e,t,r,s):t.type==="block-seq"?kT.resolveBlockSeq(i,e,t,r,s):CT.resolveFlowCollection(i,e,t,r,s),a=o.constructor;return n==="!"||n===a.tagName?(o.tag=a.tagName,o):(n&&(o.tag=n),o)}function TT(i,e,t,r,n){var d,m;let s=r.tag,o=s?e.directives.tagName(s.source,g=>n(s,"TAG_RESOLVE_FAILED",g)):null;if(t.type==="block-seq"){let{anchor:g,newlineAfterProp:y}=r,b=g&&s?g.offset>s.offset?g:s:g!=null?g:s;b&&(!y||y.offset<b.offset)&&n(b,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===ST.YAMLMap.tagName&&a==="map"||o===ET.YAMLSeq.tagName&&a==="seq")return Vu(i,e,t,n,o);let l=e.schema.tags.find(g=>g.tag===o&&g.collection===a);if(!l){let g=e.schema.knownTags[o];if(g&&g.collection===a)e.schema.tags.push(Object.assign({},g,{default:!1})),l=g;else return g!=null&&g.collection?n(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${a} collection, but expects ${g.collection}`,!0):n(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Vu(i,e,t,n,o)}let c=Vu(i,e,t,n,o,l),u=(m=(d=l.resolve)==null?void 0:d.call(l,c,g=>n(s,"TAG_RESOLVE_FAILED",g),e.options))!=null?m:c,f=wT.isNode(u)?u:new xT.Scalar(u);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}ey.composeCollection=TT});var Gu=w(iy=>{"use strict";var Hu=Ue();function AT(i,e,t){let r=e.offset,n=IT(e,i.options.strict,t);if(!n)return{value:"",type:null,comment:"",range:[r,r,r]};let s=n.mode===">"?Hu.Scalar.BLOCK_FOLDED:Hu.Scalar.BLOCK_LITERAL,o=e.source?NT(e.source):[],a=o.length;for(let y=o.length-1;y>=0;--y){let b=o[y][1];if(b===""||b==="\r")a=y;else break}if(a===0){let y=n.chomp==="+"&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):"",b=r+n.length;return e.source&&(b+=e.source.length),{value:y,type:s,comment:n.comment,range:[r,b,b]}}let l=e.indent+n.indent,c=e.offset+n.length,u=0;for(let y=0;y<a;++y){let[b,x]=o[y];if(x===""||x==="\r")n.indent===0&&b.length>l&&(l=b.length);else{b.length<l&&t(c+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(l=b.length),u=y,l===0&&!i.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=b.length+x.length+1}for(let y=o.length-1;y>=a;--y)o[y][0].length>l&&(a=y+1);let f="",d="",m=!1;for(let y=0;y<u;++y)f+=o[y][0].slice(l)+`
`;for(let y=u;y<a;++y){let[b,x]=o[y];c+=b.length+x.length+1;let S=x[x.length-1]==="\r";if(S&&(x=x.slice(0,-1)),x&&b.length<l){let O=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;t(c-x.length-(S?2:1),"BAD_INDENT",O),b=""}s===Hu.Scalar.BLOCK_LITERAL?(f+=d+b.slice(l)+x,d=`
`):b.length>l||x[0]==="	"?(d===" "?d=`
`:!m&&d===`
`&&(d=`

`),f+=d+b.slice(l)+x,d=`
`,m=!0):x===""?d===`
`?f+=`
`:d=`
`:(f+=d+x,d=" ",m=!1)}switch(n.chomp){case"-":break;case"+":for(let y=a;y<o.length;++y)f+=`
`+o[y][0].slice(l);f[f.length-1]!==`
`&&(f+=`
`);break;default:f+=`
`}let g=r+n.length+e.source.length;return{value:f,type:s,comment:n.comment,range:[r,g,g]}}function IT({offset:i,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],s=n[0],o=0,a="",l=-1;for(let d=1;d<n.length;++d){let m=n[d];if(!a&&(m==="-"||m==="+"))a=m;else{let g=Number(m);!o&&g?o=g:l===-1&&(l=i+d)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let c=!1,u="",f=n.length;for(let d=1;d<e.length;++d){let m=e[d];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,u=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",g);let y=m.source;y&&typeof y=="string"&&(f+=y.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:f}}function NT(i){let e=i.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),s=[r!=null&&r[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}iy.resolveBlockScalar=AT});var Yu=w(ny=>{"use strict";var Wu=Ue(),BT=Jr();function LT(i,e,t){let{offset:r,type:n,source:s,end:o}=i,a,l,c=(d,m,g)=>t(r+d,m,g);switch(n){case"scalar":a=Wu.Scalar.PLAIN,l=RT(s,c);break;case"single-quoted-scalar":a=Wu.Scalar.QUOTE_SINGLE,l=PT(s,c);break;case"double-quoted-scalar":a=Wu.Scalar.QUOTE_DOUBLE,l=MT(s,c);break;default:return t(i,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,f=BT.resolveEnd(o,u,e,t);return{value:l,type:a,comment:f.comment,range:[r,u,f.offset]}}function RT(i,e){let t="";switch(i[0]){case"	":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${i[0]}`;break}case"@":case"`":{t=`reserved character ${i[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),ry(i)}function PT(i,e){return(i[i.length-1]!=="'"||i.length===1)&&e(i.length,"MISSING_CHAR","Missing closing 'quote"),ry(i.slice(1,-1)).replace(/''/g,"'")}function ry(i){var l;let e,t;try{e=new RegExp(`(.*?)(?<![ 	])[ 	]*\r?
`,"sy"),t=new RegExp(`[ 	]*(.*?)(?:(?<![ 	])[ 	]*)?\r?
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(i);if(!r)return i;let n=r[1],s=" ",o=e.lastIndex;for(t.lastIndex=o;r=t.exec(i);)r[1]===""?s===`
`?n+=s:s=`
`:(n+=s+r[1],s=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(i),n+s+((l=r==null?void 0:r[1])!=null?l:"")}function MT(i,e){let t="";for(let r=1;r<i.length-1;++r){let n=i[r];if(!(n==="\r"&&i[r+1]===`
`))if(n===`
`){let{fold:s,offset:o}=qT(i,r);t+=s,r=o}else if(n==="\\"){let s=i[++r],o=FT[s];if(o)t+=o;else if(s===`
`)for(s=i[r+1];s===" "||s==="	";)s=i[++r+1];else if(s==="\r"&&i[r+1]===`
`)for(s=i[++r+1];s===" "||s==="	";)s=i[++r+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];t+=DT(i,r+1,a,e),r+=a}else{let a=i.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(n===" "||n==="	"){let s=r,o=i[r+1];for(;o===" "||o==="	";)o=i[++r+1];o!==`
`&&!(o==="\r"&&i[r+2]===`
`)&&(t+=r>s?i.slice(s,r+1):n)}else t+=n}return(i[i.length-1]!=='"'||i.length===1)&&e(i.length,"MISSING_CHAR",'Missing closing "quote'),t}function qT(i,e){let t="",r=i[e+1];for(;(r===" "||r==="	"||r===`
`||r==="\r")&&!(r==="\r"&&i[e+2]!==`
`);)r===`
`&&(t+=`
`),e+=1,r=i[e+1];return t||(t=" "),{fold:t,offset:e}}var FT={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:"	",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","	":"	"};function DT(i,e,t,r){let n=i.substr(e,t),o=n.length===t&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(o)){let a=i.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}ny.resolveFlowScalar=LT});var ay=w(oy=>{"use strict";var cr=Se(),sy=Ue(),jT=Gu(),UT=Yu();function $T(i,e,t,r){let{value:n,type:s,comment:o,range:a}=e.type==="block-scalar"?jT.resolveBlockScalar(i,e,r):UT.resolveFlowScalar(e,i.options.strict,r),l=t?i.directives.tagName(t.source,f=>r(t,"TAG_RESOLVE_FAILED",f)):null,c;i.options.stringKeys&&i.atKey?c=i.schema[cr.SCALAR]:l?c=VT(i.schema,n,l,t,r):e.type==="scalar"?c=HT(i,n,e,r):c=i.schema[cr.SCALAR];let u;try{let f=c.resolve(n,d=>r(t!=null?t:e,"TAG_RESOLVE_FAILED",d),i.options);u=cr.isScalar(f)?f:new sy.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);r(t!=null?t:e,"TAG_RESOLVE_FAILED",d),u=new sy.Scalar(n)}return u.range=a,u.source=n,s&&(u.type=s),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function VT(i,e,t,r,n){var a;if(t==="!")return i[cr.SCALAR];let s=[];for(let l of i.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if((a=l.test)!=null&&a.test(e))return l;let o=i.knownTags[t];return o&&!o.collection?(i.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),i[cr.SCALAR])}function HT({atKey:i,directives:e,schema:t},r,n,s){var a;let o=t.tags.find(l=>{var c;return(l.default===!0||i&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||t[cr.SCALAR];if(t.compat){let l=(a=t.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))}))!=null?a:t[cr.SCALAR];if(o.tag!==l.tag){let c=e.tagString(o.tag),u=e.tagString(l.tag),f=`Value may be parsed as either ${c} or ${u}`;s(n,"TAG_RESOLVE_FAILED",f,!0)}}return o}oy.composeScalar=$T});var cy=w(ly=>{"use strict";function GT(i,e,t){if(e){t===null&&(t=e.length);for(let r=t-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":i-=n.source.length;continue}for(n=e[++r];(n==null?void 0:n.type)==="space";)i+=n.source.length,n=e[++r];break}}return i}ly.emptyScalarPosition=GT});var hy=w(zu=>{"use strict";var WT=Tn(),YT=Se(),KT=ty(),uy=ay(),zT=Jr(),JT=cy(),ZT={composeNode:fy,composeEmptyNode:Ku};function fy(i,e,t,r){let n=i.atKey,{spaceBefore:s,comment:o,anchor:a,tag:l}=t,c,u=!0;switch(e.type){case"alias":c=QT(i,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=uy.composeScalar(i,e,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=KT.composeCollection(ZT,i,e,t,r),a&&(c.anchor=a.source.substring(1));break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),c=Ku(i,e.offset,void 0,null,t,r),u=!1}}return a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),n&&i.options.stringKeys&&(!YT.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l!=null?l:e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),i.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Ku(i,e,t,r,{spaceBefore:n,comment:s,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:JT.emptyScalarPosition(e,t,r),indent:-1,source:""},f=uy.composeScalar(i,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function QT({options:i},{offset:e,source:t,end:r},n){let s=new WT.Alias(t.substring(1));s.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&n(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=zT.resolveEnd(r,o,i.strict,n);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}zu.composeEmptyNode=Ku;zu.composeNode=fy});var my=w(dy=>{"use strict";var XT=Hn(),py=hy(),eA=Jr(),tA=Kn();function iA(i,e,{offset:t,start:r,value:n,end:s},o){let a=Object.assign({_directives:e},i),l=new XT.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=tA.resolveProps(r,{indicator:"doc-start",next:n!=null?n:s==null?void 0:s[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=n?py.composeNode(c,n,u,o):py.composeEmptyNode(c,u.end,r,null,u,o);let f=l.contents.range[2],d=eA.resolveEnd(s,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[t,f,d.offset],l}dy.composeDoc=iA});var Zu=w(yy=>{"use strict";var rA=Mc(),nA=Hn(),zn=Yn(),gy=Se(),sA=my(),oA=Jr();function Jn(i){if(typeof i=="number")return[i,i+1];if(Array.isArray(i))return i.length===2?i:[i[0],i[1]];let{offset:e,source:t}=i;return[e,e+(typeof t=="string"?t.length:1)]}function vy(i){var n;let e="",t=!1,r=!1;for(let s=0;s<i.length;++s){let o=i[s];switch(o[0]){case"#":e+=(e===""?"":r?`

`:`
`)+(o.substring(1)||" "),t=!0,r=!1;break;case"%":((n=i[s+1])==null?void 0:n[0])!=="#"&&(s+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}var Ju=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,s)=>{let o=Jn(t);s?this.warnings.push(new zn.YAMLWarning(o,r,n)):this.errors.push(new zn.YAMLParseError(o,r,n))},this.directives=new rA.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=vy(this.prelude);if(r){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
${r}`:r;else if(n||e.directives.docStart||!s)e.commentBefore=r;else if(gy.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];gy.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
${a}`:r}else{let o=s.commentBefore;s.commentBefore=o?`${r}
${o}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:vy(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(t,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let s=Jn(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=sA.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new zn.YAMLParseError(Jn(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new zn.YAMLParseError(Jn(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=oA.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new zn.YAMLParseError(Jn(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),n=new nA.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}};yy.Composer=Ju});var wy=w(oa=>{"use strict";var aA=Gu(),lA=Yu(),cA=Yn(),by=Ln();function uA(i,e=!0,t){if(i){let r=(n,s,o)=>{let a=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(t)t(a,s,o);else throw new cA.YAMLParseError([a,a+1],s,o)};switch(i.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return lA.resolveFlowScalar(i,e,r);case"block-scalar":return aA.resolveBlockScalar({options:{strict:e}},i,r)}}return null}function fA(i,e){var c;let{implicitKey:t=!1,indent:r,inFlow:n=!1,offset:s=-1,type:o="PLAIN"}=e,a=by.stringifyString({type:o,value:i},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:r,source:`
`}];switch(a[0]){case"|":case">":{let u=a.indexOf(`
`),f=a.substring(0,u),d=a.substring(u+1)+`
`,m=[{type:"block-scalar-header",offset:s,indent:r,source:f}];return _y(m,l)||m.push({type:"newline",offset:-1,indent:r,source:`
`}),{type:"block-scalar",offset:s,indent:r,props:m,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}}function hA(i,e,t={}){let{afterKey:r=!1,implicitKey:n=!1,inFlow:s=!1,type:o}=t,a="indent"in i?i.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(i.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=i.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=by.stringifyString({type:o,value:e},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":pA(i,l);break;case'"':Qu(i,l,"double-quoted-scalar");break;case"'":Qu(i,l,"single-quoted-scalar");break;default:Qu(i,l,"scalar")}}function pA(i,e){let t=e.indexOf(`
`),r=e.substring(0,t),n=e.substring(t+1)+`
`;if(i.type==="block-scalar"){let s=i.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,i.source=n}else{let{offset:s}=i,o="indent"in i?i.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];_y(a,"end"in i?i.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
`});for(let l of Object.keys(i))l!=="type"&&l!=="offset"&&delete i[l];Object.assign(i,{type:"block-scalar",indent:o,props:a,source:n})}}function _y(i,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":i.push(t);break;case"newline":return i.push(t),!0}return!1}function Qu(i,e,t){switch(i.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":i.type=t,i.source=e;break;case"block-scalar":{let r=i.props.slice(1),n=e.length;i.props[0].type==="block-scalar-header"&&(n-=i.props[0].source.length);for(let s of r)s.offset+=n;delete i.props,Object.assign(i,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let n={type:"newline",offset:i.offset+e.length,indent:i.indent,source:`
`};delete i.items,Object.assign(i,{type:t,source:e,end:[n]});break}default:{let r="indent"in i?i.indent:-1,n="end"in i&&Array.isArray(i.end)?i.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(i))s!=="type"&&s!=="offset"&&delete i[s];Object.assign(i,{type:t,indent:r,source:e,end:n})}}}oa.createScalarToken=fA;oa.resolveAsScalar=uA;oa.setScalarValue=hA});var Sy=w(xy=>{"use strict";var dA=i=>"type"in i?la(i):aa(i);function la(i){switch(i.type){case"block-scalar":{let e="";for(let t of i.props)e+=la(t);return e+i.source}case"block-map":case"block-seq":{let e="";for(let t of i.items)e+=aa(t);return e}case"flow-collection":{let e=i.start.source;for(let t of i.items)e+=aa(t);for(let t of i.end)e+=t.source;return e}case"document":{let e=aa(i);if(i.end)for(let t of i.end)e+=t.source;return e}default:{let e=i.source;if("end"in i&&i.end)for(let t of i.end)e+=t.source;return e}}}function aa({start:i,key:e,sep:t,value:r}){let n="";for(let s of i)n+=s.source;if(e&&(n+=la(e)),t)for(let s of t)n+=s.source;return r&&(n+=la(r)),n}xy.stringify=dA});var Cy=w(ky=>{"use strict";var Xu=Symbol("break visit"),mA=Symbol("skip children"),Ey=Symbol("remove item");function ur(i,e){"type"in i&&i.type==="document"&&(i={start:i.start,value:i.value}),Oy(Object.freeze([]),i,e)}ur.BREAK=Xu;ur.SKIP=mA;ur.REMOVE=Ey;ur.itemAtPath=(i,e)=>{let t=i;for(let[r,n]of e){let s=t==null?void 0:t[r];if(s&&"items"in s)t=s.items[n];else return}return t};ur.parentCollection=(i,e)=>{let t=ur.itemAtPath(i,e.slice(0,-1)),r=e[e.length-1][0],n=t==null?void 0:t[r];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function Oy(i,e,t){let r=t(e,i);if(typeof r=="symbol")return r;for(let n of["key","value"]){let s=e[n];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Oy(Object.freeze(i.concat([[n,o]])),s.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Xu)return Xu;a===Ey&&(s.items.splice(o,1),o-=1)}}typeof r=="function"&&n==="key"&&(r=r(e,i))}}return typeof r=="function"?r(e,i):r}ky.visit=ur});var ca=w(yt=>{"use strict";var ef=wy(),gA=Sy(),vA=Cy(),tf="\uFEFF",rf="