stk-codegen 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -96,7 +96,7 @@ var p=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),E=Sy
96
96
  * This source code is licensed under the MIT license found in the
97
97
  * LICENSE file in the root directory of this source tree.
98
98
  */
99
- function push(u,A){var p=u.length;u.push(A);e:for(;0<p;){var y=p-1>>>1,E=u[y];if(0<compare(E,A))u[y]=A,u[p]=E,p=y;else break e}}function peek(u){return 0===u.length?null:u[0]}function pop(u){if(0===u.length)return null;var A=u[0],p=u.pop();if(p!==A){u[0]=p;e:for(var y=0,E=u.length,C=E>>>1;y<C;){var I=2*(y+1)-1,w=u[I],v=I+1,B=u[v];if(0>compare(w,p))v<E&&0>compare(B,w)?(u[y]=B,u[v]=p,y=v):(u[y]=w,u[I]=p,y=I);else if(v<E&&0>compare(B,p))u[y]=B,u[v]=p,y=v;else break e}}return A}function compare(u,A){var p=u.sortIndex-A.sortIndex;return 0!==p?p:u.id-A.id}A.unstable_now=void 0;if("object"===typeof performance&&"function"===typeof performance.now){var p=performance;A.unstable_now=function(){return p.now()}}else{var y=Date,E=y.now();A.unstable_now=function(){return y.now()-E}}var C=[],I=[],w=1,v=null,B=3,S=!1,D=!1,k=!1,Q=!1,F="function"===typeof setTimeout?setTimeout:null,R="function"===typeof clearTimeout?clearTimeout:null,_="undefined"!==typeof setImmediate?setImmediate:null;function advanceTimers(u){for(var A=peek(I);null!==A;){if(null===A.callback)pop(I);else if(A.startTime<=u)pop(I),A.sortIndex=A.expirationTime,push(C,A);else break;A=peek(I)}}function handleTimeout(u){k=!1;advanceTimers(u);if(!D)if(null!==peek(C))D=!0,P||(P=!0,G());else{var A=peek(I);null!==A&&requestHostTimeout(handleTimeout,A.startTime-u)}}var P=!1,O=-1,U=5,H=-1;function shouldYieldToHost(){return Q?!0:A.unstable_now()-H<U?!1:!0}function performWorkUntilDeadline(){Q=!1;if(P){var u=A.unstable_now();H=u;var p=!0;try{e:{D=!1;k&&(k=!1,R(O),O=-1);S=!0;var y=B;try{t:{advanceTimers(u);for(v=peek(C);null!==v&&!(v.expirationTime>u&&shouldYieldToHost());){var E=v.callback;if("function"===typeof E){v.callback=null;B=v.priorityLevel;var w=E(v.expirationTime<=u);u=A.unstable_now();if("function"===typeof w){v.callback=w;advanceTimers(u);p=!0;break t}v===peek(C)&&pop(C);advanceTimers(u)}else pop(C);v=peek(C)}if(null!==v)p=!0;else{var F=peek(I);null!==F&&requestHostTimeout(handleTimeout,F.startTime-u);p=!1}}break e}finally{v=null,B=y,S=!1}p=void 0}}finally{p?G():P=!1}}}var G;if("function"===typeof _)G=function(){_(performWorkUntilDeadline)};else if("undefined"!==typeof MessageChannel){var j=new MessageChannel,$=j.port2;j.port1.onmessage=performWorkUntilDeadline;G=function(){$.postMessage(null)}}else G=function(){F(performWorkUntilDeadline,0)};function requestHostTimeout(u,p){O=F((function(){u(A.unstable_now())}),p)}A.unstable_IdlePriority=5;A.unstable_ImmediatePriority=1;A.unstable_LowPriority=4;A.unstable_NormalPriority=3;A.unstable_Profiling=null;A.unstable_UserBlockingPriority=2;A.unstable_cancelCallback=function(u){u.callback=null};A.unstable_forceFrameRate=function(u){0>u||125<u?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<u?Math.floor(1e3/u):5};A.unstable_getCurrentPriorityLevel=function(){return B};A.unstable_next=function(u){switch(B){case 1:case 2:case 3:var A=3;break;default:A=B}var p=B;B=A;try{return u()}finally{B=p}};A.unstable_requestPaint=function(){Q=!0};A.unstable_runWithPriority=function(u,A){switch(u){case 1:case 2:case 3:case 4:case 5:break;default:u=3}var p=B;B=u;try{return A()}finally{B=p}};A.unstable_scheduleCallback=function(u,p,y){var E=A.unstable_now();"object"===typeof y&&null!==y?(y=y.delay,y="number"===typeof y&&0<y?E+y:E):y=E;switch(u){case 1:var v=-1;break;case 2:v=250;break;case 5:v=1073741823;break;case 4:v=1e4;break;default:v=5e3}v=y+v;u={id:w++,callback:p,priorityLevel:u,startTime:y,expirationTime:v,sortIndex:-1};y>E?(u.sortIndex=y,push(I,u),null===peek(C)&&u===peek(I)&&(k?(R(O),O=-1):k=!0,requestHostTimeout(handleTimeout,y-E))):(u.sortIndex=v,push(C,u),D||S||(D=!0,P||(P=!0,G())));return u};A.unstable_shouldYield=shouldYieldToHost;A.unstable_wrapCallback=function(u){var A=B;return function(){var p=B;B=A;try{return u.apply(this,arguments)}finally{B=p}}}},8916:(u,A,p)=>{if(process.env.NODE_ENV==="production"){u.exports=p(2695)}else{u.exports=p(275)}},7741:(u,A,p)=>{const y=p(5897);const{MAX_LENGTH:E,MAX_SAFE_INTEGER:C}=p(3439);const{safeRe:I,t:w}=p(3569);const v=p(574);const{compareIdentifiers:B}=p(2070);class SemVer{constructor(u,A){A=v(A);if(u instanceof SemVer){if(u.loose===!!A.loose&&u.includePrerelease===!!A.includePrerelease){return u}else{u=u.version}}else if(typeof u!=="string"){throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`)}if(u.length>E){throw new TypeError(`version is longer than ${E} characters`)}y("SemVer",u,A);this.options=A;this.loose=!!A.loose;this.includePrerelease=!!A.includePrerelease;const p=u.trim().match(A.loose?I[w.LOOSE]:I[w.FULL]);if(!p){throw new TypeError(`Invalid Version: ${u}`)}this.raw=u;this.major=+p[1];this.minor=+p[2];this.patch=+p[3];if(this.major>C||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>C||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>C||this.patch<0){throw new TypeError("Invalid patch version")}if(!p[4]){this.prerelease=[]}else{this.prerelease=p[4].split(".").map((u=>{if(/^[0-9]+$/.test(u)){const A=+u;if(A>=0&&A<C){return A}}return u}))}this.build=p[5]?p[5].split("."):[];this.format()}format(){this.version=`${this.major}.${this.minor}.${this.patch}`;if(this.prerelease.length){this.version+=`-${this.prerelease.join(".")}`}return this.version}toString(){return this.version}compare(u){y("SemVer.compare",this.version,this.options,u);if(!(u instanceof SemVer)){if(typeof u==="string"&&u===this.version){return 0}u=new SemVer(u,this.options)}if(u.version===this.version){return 0}return this.compareMain(u)||this.comparePre(u)}compareMain(u){if(!(u instanceof SemVer)){u=new SemVer(u,this.options)}if(this.major<u.major){return-1}if(this.major>u.major){return 1}if(this.minor<u.minor){return-1}if(this.minor>u.minor){return 1}if(this.patch<u.patch){return-1}if(this.patch>u.patch){return 1}return 0}comparePre(u){if(!(u instanceof SemVer)){u=new SemVer(u,this.options)}if(this.prerelease.length&&!u.prerelease.length){return-1}else if(!this.prerelease.length&&u.prerelease.length){return 1}else if(!this.prerelease.length&&!u.prerelease.length){return 0}let A=0;do{const p=this.prerelease[A];const E=u.prerelease[A];y("prerelease compare",A,p,E);if(p===undefined&&E===undefined){return 0}else if(E===undefined){return 1}else if(p===undefined){return-1}else if(p===E){continue}else{return B(p,E)}}while(++A)}compareBuild(u){if(!(u instanceof SemVer)){u=new SemVer(u,this.options)}let A=0;do{const p=this.build[A];const E=u.build[A];y("build compare",A,p,E);if(p===undefined&&E===undefined){return 0}else if(E===undefined){return 1}else if(p===undefined){return-1}else if(p===E){continue}else{return B(p,E)}}while(++A)}inc(u,A,p){if(u.startsWith("pre")){if(!A&&p===false){throw new Error("invalid increment argument: identifier is empty")}if(A){const u=`-${A}`.match(this.options.loose?I[w.PRERELEASELOOSE]:I[w.PRERELEASE]);if(!u||u[1]!==A){throw new Error(`invalid identifier: ${A}`)}}}switch(u){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",A,p);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",A,p);break;case"prepatch":this.prerelease.length=0;this.inc("patch",A,p);this.inc("pre",A,p);break;case"prerelease":if(this.prerelease.length===0){this.inc("patch",A,p)}this.inc("pre",A,p);break;case"release":if(this.prerelease.length===0){throw new Error(`version ${this.raw} is not a prerelease`)}this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0){this.major++}this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0){this.minor++}this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0){this.patch++}this.prerelease=[];break;case"pre":{const u=Number(p)?1:0;if(this.prerelease.length===0){this.prerelease=[u]}else{let y=this.prerelease.length;while(--y>=0){if(typeof this.prerelease[y]==="number"){this.prerelease[y]++;y=-2}}if(y===-1){if(A===this.prerelease.join(".")&&p===false){throw new Error("invalid increment argument: identifier already exists")}this.prerelease.push(u)}}if(A){let y=[A,u];if(p===false){y=[A]}if(B(this.prerelease[0],A)===0){if(isNaN(this.prerelease[1])){this.prerelease=y}}else{this.prerelease=y}}break}default:throw new Error(`invalid increment argument: ${u}`)}this.raw=this.format();if(this.build.length){this.raw+=`+${this.build.join(".")}`}return this}}u.exports=SemVer},5969:(u,A,p)=>{const y=p(8091);const clean=(u,A)=>{const p=y(u.trim().replace(/^[=v]+/,""),A);return p?p.version:null};u.exports=clean},8091:(u,A,p)=>{const y=p(7741);const parse=(u,A,p=false)=>{if(u instanceof y){return u}try{return new y(u,A)}catch(u){if(!p){return null}throw u}};u.exports=parse},3490:(u,A,p)=>{const y=p(8091);const valid=(u,A)=>{const p=y(u,A);return p?p.version:null};u.exports=valid},3439:u=>{const A="2.0.0";const p=256;const y=Number.MAX_SAFE_INTEGER||9007199254740991;const E=16;const C=p-6;const I=["major","premajor","minor","preminor","patch","prepatch","prerelease"];u.exports={MAX_LENGTH:p,MAX_SAFE_COMPONENT_LENGTH:E,MAX_SAFE_BUILD_LENGTH:C,MAX_SAFE_INTEGER:y,RELEASE_TYPES:I,SEMVER_SPEC_VERSION:A,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},5897:u=>{const A=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...u)=>console.error("SEMVER",...u):()=>{};u.exports=A},2070:u=>{const A=/^[0-9]+$/;const compareIdentifiers=(u,p)=>{if(typeof u==="number"&&typeof p==="number"){return u===p?0:u<p?-1:1}const y=A.test(u);const E=A.test(p);if(y&&E){u=+u;p=+p}return u===p?0:y&&!E?-1:E&&!y?1:u<p?-1:1};const rcompareIdentifiers=(u,A)=>compareIdentifiers(A,u);u.exports={compareIdentifiers:compareIdentifiers,rcompareIdentifiers:rcompareIdentifiers}},574:u=>{const A=Object.freeze({loose:true});const p=Object.freeze({});const parseOptions=u=>{if(!u){return p}if(typeof u!=="object"){return A}return u};u.exports=parseOptions},3569:(u,A,p)=>{const{MAX_SAFE_COMPONENT_LENGTH:y,MAX_SAFE_BUILD_LENGTH:E,MAX_LENGTH:C}=p(3439);const I=p(5897);A=u.exports={};const w=A.re=[];const v=A.safeRe=[];const B=A.src=[];const S=A.safeSrc=[];const D=A.t={};let k=0;const Q="[a-zA-Z0-9-]";const F=[["\\s",1],["\\d",C],[Q,E]];const makeSafeRegex=u=>{for(const[A,p]of F){u=u.split(`${A}*`).join(`${A}{0,${p}}`).split(`${A}+`).join(`${A}{1,${p}}`)}return u};const createToken=(u,A,p)=>{const y=makeSafeRegex(A);const E=k++;I(u,E,A);D[u]=E;B[E]=A;S[E]=y;w[E]=new RegExp(A,p?"g":undefined);v[E]=new RegExp(y,p?"g":undefined)};createToken("NUMERICIDENTIFIER","0|[1-9]\\d*");createToken("NUMERICIDENTIFIERLOOSE","\\d+");createToken("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Q}*`);createToken("MAINVERSION",`(${B[D.NUMERICIDENTIFIER]})\\.`+`(${B[D.NUMERICIDENTIFIER]})\\.`+`(${B[D.NUMERICIDENTIFIER]})`);createToken("MAINVERSIONLOOSE",`(${B[D.NUMERICIDENTIFIERLOOSE]})\\.`+`(${B[D.NUMERICIDENTIFIERLOOSE]})\\.`+`(${B[D.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASEIDENTIFIER",`(?:${B[D.NONNUMERICIDENTIFIER]}|${B[D.NUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${B[D.NONNUMERICIDENTIFIER]}|${B[D.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASE",`(?:-(${B[D.PRERELEASEIDENTIFIER]}(?:\\.${B[D.PRERELEASEIDENTIFIER]})*))`);createToken("PRERELEASELOOSE",`(?:-?(${B[D.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${B[D.PRERELEASEIDENTIFIERLOOSE]})*))`);createToken("BUILDIDENTIFIER",`${Q}+`);createToken("BUILD",`(?:\\+(${B[D.BUILDIDENTIFIER]}(?:\\.${B[D.BUILDIDENTIFIER]})*))`);createToken("FULLPLAIN",`v?${B[D.MAINVERSION]}${B[D.PRERELEASE]}?${B[D.BUILD]}?`);createToken("FULL",`^${B[D.FULLPLAIN]}$`);createToken("LOOSEPLAIN",`[v=\\s]*${B[D.MAINVERSIONLOOSE]}${B[D.PRERELEASELOOSE]}?${B[D.BUILD]}?`);createToken("LOOSE",`^${B[D.LOOSEPLAIN]}$`);createToken("GTLT","((?:<|>)?=?)");createToken("XRANGEIDENTIFIERLOOSE",`${B[D.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);createToken("XRANGEIDENTIFIER",`${B[D.NUMERICIDENTIFIER]}|x|X|\\*`);createToken("XRANGEPLAIN",`[v=\\s]*(${B[D.XRANGEIDENTIFIER]})`+`(?:\\.(${B[D.XRANGEIDENTIFIER]})`+`(?:\\.(${B[D.XRANGEIDENTIFIER]})`+`(?:${B[D.PRERELEASE]})?${B[D.BUILD]}?`+`)?)?`);createToken("XRANGEPLAINLOOSE",`[v=\\s]*(${B[D.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${B[D.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${B[D.XRANGEIDENTIFIERLOOSE]})`+`(?:${B[D.PRERELEASELOOSE]})?${B[D.BUILD]}?`+`)?)?`);createToken("XRANGE",`^${B[D.GTLT]}\\s*${B[D.XRANGEPLAIN]}$`);createToken("XRANGELOOSE",`^${B[D.GTLT]}\\s*${B[D.XRANGEPLAINLOOSE]}$`);createToken("COERCEPLAIN",`${"(^|[^\\d])"+"(\\d{1,"}${y}})`+`(?:\\.(\\d{1,${y}}))?`+`(?:\\.(\\d{1,${y}}))?`);createToken("COERCE",`${B[D.COERCEPLAIN]}(?:$|[^\\d])`);createToken("COERCEFULL",B[D.COERCEPLAIN]+`(?:${B[D.PRERELEASE]})?`+`(?:${B[D.BUILD]})?`+`(?:$|[^\\d])`);createToken("COERCERTL",B[D.COERCE],true);createToken("COERCERTLFULL",B[D.COERCEFULL],true);createToken("LONETILDE","(?:~>?)");createToken("TILDETRIM",`(\\s*)${B[D.LONETILDE]}\\s+`,true);A.tildeTrimReplace="$1~";createToken("TILDE",`^${B[D.LONETILDE]}${B[D.XRANGEPLAIN]}$`);createToken("TILDELOOSE",`^${B[D.LONETILDE]}${B[D.XRANGEPLAINLOOSE]}$`);createToken("LONECARET","(?:\\^)");createToken("CARETTRIM",`(\\s*)${B[D.LONECARET]}\\s+`,true);A.caretTrimReplace="$1^";createToken("CARET",`^${B[D.LONECARET]}${B[D.XRANGEPLAIN]}$`);createToken("CARETLOOSE",`^${B[D.LONECARET]}${B[D.XRANGEPLAINLOOSE]}$`);createToken("COMPARATORLOOSE",`^${B[D.GTLT]}\\s*(${B[D.LOOSEPLAIN]})$|^$`);createToken("COMPARATOR",`^${B[D.GTLT]}\\s*(${B[D.FULLPLAIN]})$|^$`);createToken("COMPARATORTRIM",`(\\s*)${B[D.GTLT]}\\s*(${B[D.LOOSEPLAIN]}|${B[D.XRANGEPLAIN]})`,true);A.comparatorTrimReplace="$1$2$3";createToken("HYPHENRANGE",`^\\s*(${B[D.XRANGEPLAIN]})`+`\\s+-\\s+`+`(${B[D.XRANGEPLAIN]})`+`\\s*$`);createToken("HYPHENRANGELOOSE",`^\\s*(${B[D.XRANGEPLAINLOOSE]})`+`\\s+-\\s+`+`(${B[D.XRANGEPLAINLOOSE]})`+`\\s*$`);createToken("STAR","(<|>)?=?\\s*\\*");createToken("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");createToken("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4205:(u,A,p)=>{const y=p(7600);u.exports=(u="")=>{const A=u.match(y);if(!A){return null}const[p,E]=A[0].replace(/#! ?/,"").split(" ");const C=p.split("/").pop();if(C==="env"){return E}return E?`${C} ${E}`:C}},7600:u=>{u.exports=/^#!(.*)/},7417:(u,A,p)=>{var y=global.process;const processOk=function(u){return u&&typeof u==="object"&&typeof u.removeListener==="function"&&typeof u.emit==="function"&&typeof u.reallyExit==="function"&&typeof u.listeners==="function"&&typeof u.kill==="function"&&typeof u.pid==="number"&&typeof u.on==="function"};if(!processOk(y)){u.exports=function(){return function(){}}}else{var E=p(2613);var C=p(9424);var I=/^win/i.test(y.platform);var w=p(4434);if(typeof w!=="function"){w=w.EventEmitter}var v;if(y.__signal_exit_emitter__){v=y.__signal_exit_emitter__}else{v=y.__signal_exit_emitter__=new w;v.count=0;v.emitted={}}if(!v.infinite){v.setMaxListeners(Infinity);v.infinite=true}u.exports=function(u,A){if(!processOk(global.process)){return function(){}}E.equal(typeof u,"function","a callback must be provided for exit handler");if(k===false){Q()}var p="exit";if(A&&A.alwaysLast){p="afterexit"}var remove=function(){v.removeListener(p,u);if(v.listeners("exit").length===0&&v.listeners("afterexit").length===0){B()}};v.on(p,u);return remove};var B=function unload(){if(!k||!processOk(global.process)){return}k=false;C.forEach((function(u){try{y.removeListener(u,D[u])}catch(u){}}));y.emit=_;y.reallyExit=F;v.count-=1};u.exports.unload=B;var S=function emit(u,A,p){if(v.emitted[u]){return}v.emitted[u]=true;v.emit(u,A,p)};var D={};C.forEach((function(u){D[u]=function listener(){if(!processOk(global.process)){return}var A=y.listeners(u);if(A.length===v.count){B();S("exit",null,u);S("afterexit",null,u);if(I&&u==="SIGHUP"){u="SIGINT"}y.kill(y.pid,u)}}}));u.exports.signals=function(){return C};var k=false;var Q=function load(){if(k||!processOk(global.process)){return}k=true;v.count+=1;C=C.filter((function(u){try{y.on(u,D[u]);return true}catch(u){return false}}));y.emit=P;y.reallyExit=R};u.exports.load=Q;var F=y.reallyExit;var R=function processReallyExit(u){if(!processOk(global.process)){return}y.exitCode=u||0;S("exit",y.exitCode,null);S("afterexit",y.exitCode,null);F.call(y,y.exitCode)};var _=y.emit;var P=function processEmit(u,A){if(u==="exit"&&processOk(global.process)){if(A!==undefined){y.exitCode=A}var p=_.apply(this,arguments);S("exit",y.exitCode,null);S("afterexit",y.exitCode,null);return p}else{return _.apply(this,arguments)}}}},9424:u=>{u.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){u.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){u.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},6820:(u,A,p)=>{var y=p(4093);var E=p(8423);function valid(u){try{y(u);return true}catch(u){return false}}function sortTranspositions(u,A){var p=A[0].length-u[0].length;if(p!==0)return p;return u[0].toUpperCase().localeCompare(A[0].toUpperCase())}var C=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(sortTranspositions);var I=0;var w=1;var v=[function(u){return u.toUpperCase()},function(u){return u.trim()},function(u){return u.replace(/\./g,"")},function(u){return u.replace(/\s+/g,"")},function(u){return u.replace(/\s+/g,"-")},function(u){return u.replace("v","-")},function(u){return u.replace(/,?\s*(\d)/,"-$1")},function(u){return u.replace(/,?\s*(\d)/,"-$1.0")},function(u){return u.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(u){return u.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(u){return u[0].toUpperCase()+u.slice(1)},function(u){return u.replace("/","-")},function(u){return u.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(u){if(u.indexOf("3.0")!==-1){return u+"-or-later"}else{return u+"-only"}},function(u){return u+"only"},function(u){return u.replace(/(\d)$/,"-$1.0")},function(u){return u.replace(/(-| )?(\d)$/,"-$2-Clause")},function(u){return u.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(u){return u.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(u){return u.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(u){return u.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(u){return u.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(u){return u.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(u){return"CC-"+u},function(u){return"CC-"+u+"-4.0"},function(u){return u.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(u){return"CC-"+u.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}];var B=E.map((function(u){var A=/^(.*)-\d+\.\d+$/.exec(u);return A?[A[0],A[1]]:[u,null]})).reduce((function(u,A){var p=A[1];u[p]=u[p]||[];u[p].push(A[0]);return u}),{});var S=Object.keys(B).map((function makeEntries(u){return[u,B[u]]})).filter((function identifySoleVersions(u){return u[1].length===1&&u[0]!==null&&u[0]!=="APL"})).map((function createLastResorts(u){return[u[0],u[1][0]]}));B=undefined;var D=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(S).sort(sortTranspositions);var k=0;var Q=1;var validTransformation=function(u){for(var A=0;A<v.length;A++){var p=v[A](u).trim();if(p!==u&&valid(p)){return p}}return null};var validLastResort=function(u){var A=u.toUpperCase();for(var p=0;p<D.length;p++){var y=D[p];if(A.indexOf(y[k])>-1){return y[Q]}}return null};var anyCorrection=function(u,A){for(var p=0;p<C.length;p++){var y=C[p];var E=y[I];if(u.indexOf(E)>-1){var v=u.replace(E,y[w]);var B=A(v);if(B!==null){return B}}}return null};u.exports=function(u,A){A=A||{};var p=A.upgrade===undefined?true:!!A.upgrade;function postprocess(u){return p?upgradeGPLs(u):u}var y=typeof u==="string"&&u.trim().length!==0;if(!y){throw Error("Invalid argument. Expected non-empty string.")}u=u.trim();if(valid(u)){return postprocess(u)}var E=u.replace(/\+$/,"").trim();if(valid(E)){return postprocess(E)}var C=validTransformation(u);if(C!==null){return postprocess(C)}C=anyCorrection(u,(function(u){if(valid(u)){return u}return validTransformation(u)}));if(C!==null){return postprocess(C)}C=validLastResort(u);if(C!==null){return postprocess(C)}C=anyCorrection(u,validLastResort);if(C!==null){return postprocess(C)}return null};function upgradeGPLs(u){if(["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(u)!==-1){return u+"-only"}else if(["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(u)!==-1){return u.replace(/\+$/,"-or-later")}else if(["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(u)!==-1){return u+"-or-later"}else{return u}}},4093:(u,A,p)=>{var y=p(5632);var E=p(2306);u.exports=function(u){return E(y(u))}},2306:u=>{u.exports=function(u){var A=0;function hasMore(){return A<u.length}function token(){return hasMore()?u[A]:null}function next(){if(!hasMore()){throw new Error}A++}function parseOperator(u){var A=token();if(A&&A.type==="OPERATOR"&&u===A.string){next();return A.string}}function parseWith(){if(parseOperator("WITH")){var u=token();if(u&&u.type==="EXCEPTION"){next();return u.string}throw new Error("Expected exception after `WITH`")}}function parseLicenseRef(){var u=A;var p="";var y=token();if(y.type==="DOCUMENTREF"){next();p+="DocumentRef-"+y.string+":";if(!parseOperator(":")){throw new Error("Expected `:` after `DocumentRef-...`")}}y=token();if(y.type==="LICENSEREF"){next();p+="LicenseRef-"+y.string;return{license:p}}A=u}function parseLicense(){var u=token();if(u&&u.type==="LICENSE"){next();var A={license:u.string};if(parseOperator("+")){A.plus=true}var p=parseWith();if(p){A.exception=p}return A}}function parseParenthesizedExpression(){var u=parseOperator("(");if(!u){return}var A=y();if(!parseOperator(")")){throw new Error("Expected `)`")}return A}function parseAtom(){return parseParenthesizedExpression()||parseLicenseRef()||parseLicense()}function makeBinaryOpParser(u,A){return function parseBinaryOp(){var p=A();if(!p){return}if(!parseOperator(u)){return p}var y=parseBinaryOp();if(!y){throw new Error("Expected expression")}return{left:p,conjunction:u.toLowerCase(),right:y}}}var p=makeBinaryOpParser("AND",parseAtom);var y=makeBinaryOpParser("OR",p);var E=y();if(!E||hasMore()){throw new Error("Syntax error")}return E}},5632:(u,A,p)=>{var y=[].concat(p(8423)).concat(p(5048));var E=p(173);u.exports=function(u){var A=0;function hasMore(){return A<u.length}function read(p){if(p instanceof RegExp){var y=u.slice(A);var E=y.match(p);if(E){A+=E[0].length;return E[0]}}else{if(u.indexOf(p,A)===A){A+=p.length;return p}}}function skipWhitespace(){read(/[ ]*/)}function operator(){var p;var y=["WITH","AND","OR","(",")",":","+"];for(var E=0;E<y.length;E++){p=read(y[E]);if(p){break}}if(p==="+"&&A>1&&u[A-2]===" "){throw new Error("Space before `+`")}return p&&{type:"OPERATOR",string:p}}function idstring(){return read(/[A-Za-z0-9-.]+/)}function expectIdstring(){var u=idstring();if(!u){throw new Error("Expected idstring at offset "+A)}return u}function documentRef(){if(read("DocumentRef-")){var u=expectIdstring();return{type:"DOCUMENTREF",string:u}}}function licenseRef(){if(read("LicenseRef-")){var u=expectIdstring();return{type:"LICENSEREF",string:u}}}function identifier(){var u=A;var p=idstring();if(y.indexOf(p)!==-1){return{type:"LICENSE",string:p}}else if(E.indexOf(p)!==-1){return{type:"EXCEPTION",string:p}}A=u}function parseToken(){return operator()||documentRef()||licenseRef()||identifier()}var p=[];while(hasMore()){skipWhitespace();if(!hasMore()){break}var C=parseToken();if(!C){throw new Error("Unexpected `"+u[A]+"` at offset "+A)}p.push(C)}return p}},4491:(u,A,p)=>{const y=p(6833);const E=typeof process==="object"&&process&&typeof process.cwd==="function"?process.cwd():".";const C=[].concat(p(3339).builtinModules,"bootstrap_node","node").map((u=>new RegExp(`(?:\\((?:node:)?${u}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${u}(?:\\.js)?:\\d+:\\d+$)`)));C.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);class StackUtils{constructor(u){u={ignoredPackages:[],...u};if("internals"in u===false){u.internals=StackUtils.nodeInternals()}if("cwd"in u===false){u.cwd=E}this._cwd=u.cwd.replace(/\\/g,"/");this._internals=[].concat(u.internals,ignoredPackagesRegExp(u.ignoredPackages));this._wrapCallSite=u.wrapCallSite||false}static nodeInternals(){return[...C]}clean(u,A=0){A=" ".repeat(A);if(!Array.isArray(u)){u=u.split("\n")}if(!/^\s*at /.test(u[0])&&/^\s*at /.test(u[1])){u=u.slice(1)}let p=false;let y=null;const E=[];u.forEach((u=>{u=u.replace(/\\/g,"/");if(this._internals.some((A=>A.test(u)))){return}const A=/^\s*at /.test(u);if(p){u=u.trimEnd().replace(/^(\s+)at /,"$1")}else{u=u.trim();if(A){u=u.slice(3)}}u=u.replace(`${this._cwd}/`,"");if(u){if(A){if(y){E.push(y);y=null}E.push(u)}else{p=true;y=u}}}));return E.map((u=>`${A}${u}\n`)).join("")}captureString(u,A=this.captureString){if(typeof u==="function"){A=u;u=Infinity}const{stackTraceLimit:p}=Error;if(u){Error.stackTraceLimit=u}const y={};Error.captureStackTrace(y,A);const{stack:E}=y;Error.stackTraceLimit=p;return this.clean(E)}capture(u,A=this.capture){if(typeof u==="function"){A=u;u=Infinity}const{prepareStackTrace:p,stackTraceLimit:y}=Error;Error.prepareStackTrace=(u,A)=>{if(this._wrapCallSite){return A.map(this._wrapCallSite)}return A};if(u){Error.stackTraceLimit=u}const E={};Error.captureStackTrace(E,A);const{stack:C}=E;Object.assign(Error,{prepareStackTrace:p,stackTraceLimit:y});return C}at(u=this.at){const[A]=this.capture(1,u);if(!A){return{}}const p={line:A.getLineNumber(),column:A.getColumnNumber()};setFile(p,A.getFileName(),this._cwd);if(A.isConstructor()){Object.defineProperty(p,"constructor",{value:true,configurable:true})}if(A.isEval()){p.evalOrigin=A.getEvalOrigin()}if(A.isNative()){p.native=true}let y;try{y=A.getTypeName()}catch(u){}if(y&&y!=="Object"&&y!=="[object Object]"){p.type=y}const E=A.getFunctionName();if(E){p.function=E}const C=A.getMethodName();if(C&&E!==C){p.method=C}return p}parseLine(u){const A=u&&u.match(I);if(!A){return null}const p=A[1]==="new";let y=A[2];const E=A[3];const C=A[4];const v=Number(A[5]);const B=Number(A[6]);let S=A[7];const D=A[8];const k=A[9];const Q=A[10]==="native";const F=A[11]===")";let R;const _={};if(D){_.line=Number(D)}if(k){_.column=Number(k)}if(F&&S){let u=0;for(let A=S.length-1;A>0;A--){if(S.charAt(A)===")"){u++}else if(S.charAt(A)==="("&&S.charAt(A-1)===" "){u--;if(u===-1&&S.charAt(A-1)===" "){const u=S.slice(0,A-1);const p=S.slice(A+1);S=p;y+=` (${u}`;break}}}}if(y){const u=y.match(w);if(u){y=u[1];R=u[2]}}setFile(_,S,this._cwd);if(p){Object.defineProperty(_,"constructor",{value:true,configurable:true})}if(E){_.evalOrigin=E;_.evalLine=v;_.evalColumn=B;_.evalFile=C&&C.replace(/\\/g,"/")}if(Q){_.native=true}if(y){_.function=y}if(R&&y!==R){_.method=R}return _}}function setFile(u,A,p){if(A){A=A.replace(/\\/g,"/");if(A.startsWith(`${p}/`)){A=A.slice(p.length+1)}u.file=A}}function ignoredPackagesRegExp(u){if(u.length===0){return[]}const A=u.map((u=>y(u)));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${A.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}const I=new RegExp("^"+"(?:\\s*at )?"+"(?:(new) )?"+"(?:(.*?) \\()?"+"(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?"+"(?:(.+?):(\\d+):(\\d+)|(native))"+"(\\)?)$");const w=/^(.*?) \[as (.*?)\]$/;u.exports=StackUtils},6708:(u,A,p)=>{const y=p(857);const E=p(2018);const C=p(7435);const{env:I}=process;let w;if(C("no-color")||C("no-colors")||C("color=false")||C("color=never")){w=0}else if(C("color")||C("colors")||C("color=true")||C("color=always")){w=1}if("FORCE_COLOR"in I){if(I.FORCE_COLOR==="true"){w=1}else if(I.FORCE_COLOR==="false"){w=0}else{w=I.FORCE_COLOR.length===0?1:Math.min(parseInt(I.FORCE_COLOR,10),3)}}function translateLevel(u){if(u===0){return false}return{level:u,hasBasic:true,has256:u>=2,has16m:u>=3}}function supportsColor(u,A){if(w===0){return 0}if(C("color=16m")||C("color=full")||C("color=truecolor")){return 3}if(C("color=256")){return 2}if(u&&!A&&w===undefined){return 0}const p=w||0;if(I.TERM==="dumb"){return p}if(process.platform==="win32"){const u=y.release().split(".");if(Number(u[0])>=10&&Number(u[2])>=10586){return Number(u[2])>=14931?3:2}return 1}if("CI"in I){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((u=>u in I))||I.CI_NAME==="codeship"){return 1}return p}if("TEAMCITY_VERSION"in I){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(I.TEAMCITY_VERSION)?1:0}if(I.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in I){const u=parseInt((I.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(I.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(I.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(I.TERM)){return 1}if("COLORTERM"in I){return 1}return p}function getSupportLevel(u){const A=supportsColor(u,u&&u.isTTY);return translateLevel(A)}u.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,E.isatty(1))),stderr:translateLevel(supportsColor(true,E.isatty(2)))}},5118:(u,A)=>{A.fromCallback=function(u){return Object.defineProperty((function(...A){if(typeof A[A.length-1]==="function")u.apply(this,A);else{return new Promise(((p,y)=>{A.push(((u,A)=>u!=null?y(u):p(A)));u.apply(this,A)}))}}),"name",{value:u.name})};A.fromPromise=function(u){return Object.defineProperty((function(...A){const p=A[A.length-1];if(typeof p!=="function")return u.apply(this,A);else{A.pop();u.apply(this,A).then((u=>p(null,u)),p)}}),"name",{value:u.name})}},2314:(u,A,p)=>{var y=p(4093);var E=p(6820);var C="license should be "+'a valid SPDX license expression (without "LicenseRef"), '+'"UNLICENSED", or '+'"SEE LICENSE IN <filename>"';var I=/^SEE LICEN[CS]E IN (.+)$/;function startsWith(u,A){return A.slice(0,u.length)===u}function usesLicenseRef(u){if(u.hasOwnProperty("license")){var A=u.license;return startsWith("LicenseRef",A)||startsWith("DocumentRef",A)}else{return usesLicenseRef(u.left)||usesLicenseRef(u.right)}}u.exports=function(u){var A;try{A=y(u)}catch(A){var p;if(u==="UNLICENSED"||u==="UNLICENCED"){return{validForOldPackages:true,validForNewPackages:true,unlicensed:true}}else if(p=I.exec(u)){return{validForOldPackages:true,validForNewPackages:true,inFile:p[1]}}else{var w={validForOldPackages:false,validForNewPackages:false,warnings:[C]};if(u.trim().length!==0){var v=E(u);if(v){w.warnings.push('license is similar to the valid expression "'+v+'"')}}return w}}if(usesLicenseRef(A)){return{validForNewPackages:false,validForOldPackages:false,spdx:true,warnings:[C]}}else{return{validForNewPackages:true,validForOldPackages:true,spdx:true}}}},1828:(u,A,p)=>{const y=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const E=p(6928);const C=y?";":":";const I=p(845);const getNotFoundError=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"});const getPathInfo=(u,A)=>{const p=A.colon||C;const E=u.match(/\//)||y&&u.match(/\\/)?[""]:[...y?[process.cwd()]:[],...(A.path||process.env.PATH||"").split(p)];const I=y?A.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const w=y?I.split(p):[""];if(y){if(u.indexOf(".")!==-1&&w[0]!=="")w.unshift("")}return{pathEnv:E,pathExt:w,pathExtExe:I}};const which=(u,A,p)=>{if(typeof A==="function"){p=A;A={}}if(!A)A={};const{pathEnv:y,pathExt:C,pathExtExe:w}=getPathInfo(u,A);const v=[];const step=p=>new Promise(((C,I)=>{if(p===y.length)return A.all&&v.length?C(v):I(getNotFoundError(u));const w=y[p];const B=/^".*"$/.test(w)?w.slice(1,-1):w;const S=E.join(B,u);const D=!B&&/^\.[\\\/]/.test(u)?u.slice(0,2)+S:S;C(subStep(D,p,0))}));const subStep=(u,p,y)=>new Promise(((E,B)=>{if(y===C.length)return E(step(p+1));const S=C[y];I(u+S,{pathExt:w},((C,I)=>{if(!C&&I){if(A.all)v.push(u+S);else return E(u+S)}return E(subStep(u,p,y+1))}))}));return p?step(0).then((u=>p(null,u)),p):step(0)};const whichSync=(u,A)=>{A=A||{};const{pathEnv:p,pathExt:y,pathExtExe:C}=getPathInfo(u,A);const w=[];for(let v=0;v<p.length;v++){const B=p[v];const S=/^".*"$/.test(B)?B.slice(1,-1):B;const D=E.join(S,u);const k=!S&&/^\.[\\\/]/.test(u)?u.slice(0,2)+D:D;for(let u=0;u<y.length;u++){const p=k+y[u];try{const u=I.sync(p,{pathExt:C});if(u){if(A.all)w.push(p);else return p}}catch(u){}}}if(A.all&&w.length)return w;if(A.nothrow)return null;throw getNotFoundError(u)};u.exports=which;which.sync=whichSync},6039:u=>{u.exports=wrappy;function wrappy(u,A){if(u&&A)return wrappy(u)(A);if(typeof u!=="function")throw new TypeError("need wrapper function");Object.keys(u).forEach((function(A){wrapper[A]=u[A]}));return wrapper;function wrapper(){var A=new Array(arguments.length);for(var p=0;p<A.length;p++){A[p]=arguments[p]}var y=u.apply(this,A);var E=A[A.length-1];if(typeof y==="function"&&y!==E){Object.keys(E).forEach((function(u){y[u]=E[u]}))}return y}}},1900:(u,A,p)=>{const{EMPTY_BUFFER:y}=p(4136);const E=Buffer[Symbol.species];function concat(u,A){if(u.length===0)return y;if(u.length===1)return u[0];const p=Buffer.allocUnsafe(A);let C=0;for(let A=0;A<u.length;A++){const y=u[A];p.set(y,C);C+=y.length}if(C<A){return new E(p.buffer,p.byteOffset,C)}return p}function _mask(u,A,p,y,E){for(let C=0;C<E;C++){p[y+C]=u[C]^A[C&3]}}function _unmask(u,A){for(let p=0;p<u.length;p++){u[p]^=A[p&3]}}function toArrayBuffer(u){if(u.length===u.buffer.byteLength){return u.buffer}return u.buffer.slice(u.byteOffset,u.byteOffset+u.length)}function toBuffer(u){toBuffer.readOnly=true;if(Buffer.isBuffer(u))return u;let A;if(u instanceof ArrayBuffer){A=new E(u)}else if(ArrayBuffer.isView(u)){A=new E(u.buffer,u.byteOffset,u.byteLength)}else{A=Buffer.from(u);toBuffer.readOnly=false}return A}u.exports={concat:concat,mask:_mask,toArrayBuffer:toArrayBuffer,toBuffer:toBuffer,unmask:_unmask};if(!process.env.WS_NO_BUFFER_UTIL){try{const A=p(8340);u.exports.mask=function(u,p,y,E,C){if(C<48)_mask(u,p,y,E,C);else A.mask(u,p,y,E,C)};u.exports.unmask=function(u,p){if(u.length<32)_unmask(u,p);else A.unmask(u,p)}}catch(u){}}},4136:u=>{const A=["nodebuffer","arraybuffer","fragments"];const p=typeof Blob!=="undefined";if(p)A.push("blob");u.exports={BINARY_TYPES:A,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:p,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}},7011:(u,A,p)=>{const{kForOnEventAttribute:y,kListener:E}=p(4136);const C=Symbol("kCode");const I=Symbol("kData");const w=Symbol("kError");const v=Symbol("kMessage");const B=Symbol("kReason");const S=Symbol("kTarget");const D=Symbol("kType");const k=Symbol("kWasClean");class Event{constructor(u){this[S]=null;this[D]=u}get target(){return this[S]}get type(){return this[D]}}Object.defineProperty(Event.prototype,"target",{enumerable:true});Object.defineProperty(Event.prototype,"type",{enumerable:true});class CloseEvent extends Event{constructor(u,A={}){super(u);this[C]=A.code===undefined?0:A.code;this[B]=A.reason===undefined?"":A.reason;this[k]=A.wasClean===undefined?false:A.wasClean}get code(){return this[C]}get reason(){return this[B]}get wasClean(){return this[k]}}Object.defineProperty(CloseEvent.prototype,"code",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"reason",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"wasClean",{enumerable:true});class ErrorEvent extends Event{constructor(u,A={}){super(u);this[w]=A.error===undefined?null:A.error;this[v]=A.message===undefined?"":A.message}get error(){return this[w]}get message(){return this[v]}}Object.defineProperty(ErrorEvent.prototype,"error",{enumerable:true});Object.defineProperty(ErrorEvent.prototype,"message",{enumerable:true});class MessageEvent extends Event{constructor(u,A={}){super(u);this[I]=A.data===undefined?null:A.data}get data(){return this[I]}}Object.defineProperty(MessageEvent.prototype,"data",{enumerable:true});const Q={addEventListener(u,A,p={}){for(const C of this.listeners(u)){if(!p[y]&&C[E]===A&&!C[y]){return}}let C;if(u==="message"){C=function onMessage(u,p){const y=new MessageEvent("message",{data:p?u:u.toString()});y[S]=this;callListener(A,this,y)}}else if(u==="close"){C=function onClose(u,p){const y=new CloseEvent("close",{code:u,reason:p.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});y[S]=this;callListener(A,this,y)}}else if(u==="error"){C=function onError(u){const p=new ErrorEvent("error",{error:u,message:u.message});p[S]=this;callListener(A,this,p)}}else if(u==="open"){C=function onOpen(){const u=new Event("open");u[S]=this;callListener(A,this,u)}}else{return}C[y]=!!p[y];C[E]=A;if(p.once){this.once(u,C)}else{this.on(u,C)}},removeEventListener(u,A){for(const p of this.listeners(u)){if(p[E]===A&&!p[y]){this.removeListener(u,p);break}}}};u.exports={CloseEvent:CloseEvent,ErrorEvent:ErrorEvent,Event:Event,EventTarget:Q,MessageEvent:MessageEvent};function callListener(u,A,p){if(typeof u==="object"&&u.handleEvent){u.handleEvent.call(u,p)}else{u.call(A,p)}}},7232:(u,A,p)=>{const{tokenChars:y}=p(2010);function push(u,A,p){if(u[A]===undefined)u[A]=[p];else u[A].push(p)}function parse(u){const A=Object.create(null);let p=Object.create(null);let E=false;let C=false;let I=false;let w;let v;let B=-1;let S=-1;let D=-1;let k=0;for(;k<u.length;k++){S=u.charCodeAt(k);if(w===undefined){if(D===-1&&y[S]===1){if(B===-1)B=k}else if(k!==0&&(S===32||S===9)){if(D===-1&&B!==-1)D=k}else if(S===59||S===44){if(B===-1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(D===-1)D=k;const y=u.slice(B,D);if(S===44){push(A,y,p);p=Object.create(null)}else{w=y}B=D=-1}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}else if(v===undefined){if(D===-1&&y[S]===1){if(B===-1)B=k}else if(S===32||S===9){if(D===-1&&B!==-1)D=k}else if(S===59||S===44){if(B===-1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(D===-1)D=k;push(p,u.slice(B,D),true);if(S===44){push(A,w,p);p=Object.create(null);w=undefined}B=D=-1}else if(S===61&&B!==-1&&D===-1){v=u.slice(B,k);B=D=-1}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}else{if(C){if(y[S]!==1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(B===-1)B=k;else if(!E)E=true;C=false}else if(I){if(y[S]===1){if(B===-1)B=k}else if(S===34&&B!==-1){I=false;D=k}else if(S===92){C=true}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}else if(S===34&&u.charCodeAt(k-1)===61){I=true}else if(D===-1&&y[S]===1){if(B===-1)B=k}else if(B!==-1&&(S===32||S===9)){if(D===-1)D=k}else if(S===59||S===44){if(B===-1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(D===-1)D=k;let y=u.slice(B,D);if(E){y=y.replace(/\\/g,"");E=false}push(p,v,y);if(S===44){push(A,w,p);p=Object.create(null);w=undefined}v=undefined;B=D=-1}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}}if(B===-1||I||S===32||S===9){throw new SyntaxError("Unexpected end of input")}if(D===-1)D=k;const Q=u.slice(B,D);if(w===undefined){push(A,Q,p)}else{if(v===undefined){push(p,Q,true)}else if(E){push(p,v,Q.replace(/\\/g,""))}else{push(p,v,Q)}push(A,w,p)}return A}function format(u){return Object.keys(u).map((A=>{let p=u[A];if(!Array.isArray(p))p=[p];return p.map((u=>[A].concat(Object.keys(u).map((A=>{let p=u[A];if(!Array.isArray(p))p=[p];return p.map((u=>u===true?A:`${A}=${u}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")}u.exports={format:format,parse:parse}},8293:u=>{const A=Symbol("kDone");const p=Symbol("kRun");class Limiter{constructor(u){this[A]=()=>{this.pending--;this[p]()};this.concurrency=u||Infinity;this.jobs=[];this.pending=0}add(u){this.jobs.push(u);this[p]()}[p](){if(this.pending===this.concurrency)return;if(this.jobs.length){const u=this.jobs.shift();this.pending++;u(this[A])}}}u.exports=Limiter},101:(u,A,p)=>{const y=p(3106);const E=p(1900);const C=p(8293);const{kStatusCode:I}=p(4136);const w=Buffer[Symbol.species];const v=Buffer.from([0,0,255,255]);const B=Symbol("permessage-deflate");const S=Symbol("total-length");const D=Symbol("callback");const k=Symbol("buffers");const Q=Symbol("error");let F;class PerMessageDeflate{constructor(u,A,p){this._maxPayload=p|0;this._options=u||{};this._threshold=this._options.threshold!==undefined?this._options.threshold:1024;this._isServer=!!A;this._deflate=null;this._inflate=null;this.params=null;if(!F){const u=this._options.concurrencyLimit!==undefined?this._options.concurrencyLimit:10;F=new C(u)}}static get extensionName(){return"permessage-deflate"}offer(){const u={};if(this._options.serverNoContextTakeover){u.server_no_context_takeover=true}if(this._options.clientNoContextTakeover){u.client_no_context_takeover=true}if(this._options.serverMaxWindowBits){u.server_max_window_bits=this._options.serverMaxWindowBits}if(this._options.clientMaxWindowBits){u.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits==null){u.client_max_window_bits=true}return u}accept(u){u=this.normalizeParams(u);this.params=this._isServer?this.acceptAsServer(u):this.acceptAsClient(u);return this.params}cleanup(){if(this._inflate){this._inflate.close();this._inflate=null}if(this._deflate){const u=this._deflate[D];this._deflate.close();this._deflate=null;if(u){u(new Error("The deflate stream was closed while data was being processed"))}}}acceptAsServer(u){const A=this._options;const p=u.find((u=>{if(A.serverNoContextTakeover===false&&u.server_no_context_takeover||u.server_max_window_bits&&(A.serverMaxWindowBits===false||typeof A.serverMaxWindowBits==="number"&&A.serverMaxWindowBits>u.server_max_window_bits)||typeof A.clientMaxWindowBits==="number"&&!u.client_max_window_bits){return false}return true}));if(!p){throw new Error("None of the extension offers can be accepted")}if(A.serverNoContextTakeover){p.server_no_context_takeover=true}if(A.clientNoContextTakeover){p.client_no_context_takeover=true}if(typeof A.serverMaxWindowBits==="number"){p.server_max_window_bits=A.serverMaxWindowBits}if(typeof A.clientMaxWindowBits==="number"){p.client_max_window_bits=A.clientMaxWindowBits}else if(p.client_max_window_bits===true||A.clientMaxWindowBits===false){delete p.client_max_window_bits}return p}acceptAsClient(u){const A=u[0];if(this._options.clientNoContextTakeover===false&&A.client_no_context_takeover){throw new Error('Unexpected parameter "client_no_context_takeover"')}if(!A.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number"){A.client_max_window_bits=this._options.clientMaxWindowBits}}else if(this._options.clientMaxWindowBits===false||typeof this._options.clientMaxWindowBits==="number"&&A.client_max_window_bits>this._options.clientMaxWindowBits){throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}return A}normalizeParams(u){u.forEach((u=>{Object.keys(u).forEach((A=>{let p=u[A];if(p.length>1){throw new Error(`Parameter "${A}" must have only a single value`)}p=p[0];if(A==="client_max_window_bits"){if(p!==true){const u=+p;if(!Number.isInteger(u)||u<8||u>15){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}p=u}else if(!this._isServer){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}}else if(A==="server_max_window_bits"){const u=+p;if(!Number.isInteger(u)||u<8||u>15){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}p=u}else if(A==="client_no_context_takeover"||A==="server_no_context_takeover"){if(p!==true){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}}else{throw new Error(`Unknown parameter "${A}"`)}u[A]=p}))}));return u}decompress(u,A,p){F.add((y=>{this._decompress(u,A,((u,A)=>{y();p(u,A)}))}))}compress(u,A,p){F.add((y=>{this._compress(u,A,((u,A)=>{y();p(u,A)}))}))}_decompress(u,A,p){const C=this._isServer?"client":"server";if(!this._inflate){const u=`${C}_max_window_bits`;const A=typeof this.params[u]!=="number"?y.Z_DEFAULT_WINDOWBITS:this.params[u];this._inflate=y.createInflateRaw({...this._options.zlibInflateOptions,windowBits:A});this._inflate[B]=this;this._inflate[S]=0;this._inflate[k]=[];this._inflate.on("error",inflateOnError);this._inflate.on("data",inflateOnData)}this._inflate[D]=p;this._inflate.write(u);if(A)this._inflate.write(v);this._inflate.flush((()=>{const u=this._inflate[Q];if(u){this._inflate.close();this._inflate=null;p(u);return}const y=E.concat(this._inflate[k],this._inflate[S]);if(this._inflate._readableState.endEmitted){this._inflate.close();this._inflate=null}else{this._inflate[S]=0;this._inflate[k]=[];if(A&&this.params[`${C}_no_context_takeover`]){this._inflate.reset()}}p(null,y)}))}_compress(u,A,p){const C=this._isServer?"server":"client";if(!this._deflate){const u=`${C}_max_window_bits`;const A=typeof this.params[u]!=="number"?y.Z_DEFAULT_WINDOWBITS:this.params[u];this._deflate=y.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:A});this._deflate[S]=0;this._deflate[k]=[];this._deflate.on("data",deflateOnData)}this._deflate[D]=p;this._deflate.write(u);this._deflate.flush(y.Z_SYNC_FLUSH,(()=>{if(!this._deflate){return}let u=E.concat(this._deflate[k],this._deflate[S]);if(A){u=new w(u.buffer,u.byteOffset,u.length-4)}this._deflate[D]=null;this._deflate[S]=0;this._deflate[k]=[];if(A&&this.params[`${C}_no_context_takeover`]){this._deflate.reset()}p(null,u)}))}}u.exports=PerMessageDeflate;function deflateOnData(u){this[k].push(u);this[S]+=u.length}function inflateOnData(u){this[S]+=u.length;if(this[B]._maxPayload<1||this[S]<=this[B]._maxPayload){this[k].push(u);return}this[Q]=new RangeError("Max payload size exceeded");this[Q].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH";this[Q][I]=1009;this.removeListener("data",inflateOnData);this.reset()}function inflateOnError(u){this[B]._inflate=null;if(this[Q]){this[D](this[Q]);return}u[I]=1007;this[D](u)}},5372:(u,A,p)=>{const{Writable:y}=p(2203);const E=p(101);const{BINARY_TYPES:C,EMPTY_BUFFER:I,kStatusCode:w,kWebSocket:v}=p(4136);const{concat:B,toArrayBuffer:S,unmask:D}=p(1900);const{isValidStatusCode:k,isValidUTF8:Q}=p(2010);const F=Buffer[Symbol.species];const R=0;const _=1;const P=2;const O=3;const U=4;const H=5;const G=6;class Receiver extends y{constructor(u={}){super();this._allowSynchronousEvents=u.allowSynchronousEvents!==undefined?u.allowSynchronousEvents:true;this._binaryType=u.binaryType||C[0];this._extensions=u.extensions||{};this._isServer=!!u.isServer;this._maxPayload=u.maxPayload|0;this._skipUTF8Validation=!!u.skipUTF8Validation;this[v]=undefined;this._bufferedBytes=0;this._buffers=[];this._compressed=false;this._payloadLength=0;this._mask=undefined;this._fragmented=0;this._masked=false;this._fin=false;this._opcode=0;this._totalPayloadLength=0;this._messageLength=0;this._fragments=[];this._errored=false;this._loop=false;this._state=R}_write(u,A,p){if(this._opcode===8&&this._state==R)return p();this._bufferedBytes+=u.length;this._buffers.push(u);this.startLoop(p)}consume(u){this._bufferedBytes-=u;if(u===this._buffers[0].length)return this._buffers.shift();if(u<this._buffers[0].length){const A=this._buffers[0];this._buffers[0]=new F(A.buffer,A.byteOffset+u,A.length-u);return new F(A.buffer,A.byteOffset,u)}const A=Buffer.allocUnsafe(u);do{const p=this._buffers[0];const y=A.length-u;if(u>=p.length){A.set(this._buffers.shift(),y)}else{A.set(new Uint8Array(p.buffer,p.byteOffset,u),y);this._buffers[0]=new F(p.buffer,p.byteOffset+u,p.length-u)}u-=p.length}while(u>0);return A}startLoop(u){this._loop=true;do{switch(this._state){case R:this.getInfo(u);break;case _:this.getPayloadLength16(u);break;case P:this.getPayloadLength64(u);break;case O:this.getMask();break;case U:this.getData(u);break;case H:case G:this._loop=false;return}}while(this._loop);if(!this._errored)u()}getInfo(u){if(this._bufferedBytes<2){this._loop=false;return}const A=this.consume(2);if((A[0]&48)!==0){const A=this.createError(RangeError,"RSV2 and RSV3 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_2_3");u(A);return}const p=(A[0]&64)===64;if(p&&!this._extensions[E.extensionName]){const A=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");u(A);return}this._fin=(A[0]&128)===128;this._opcode=A[0]&15;this._payloadLength=A[1]&127;if(this._opcode===0){if(p){const A=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");u(A);return}if(!this._fragmented){const A=this.createError(RangeError,"invalid opcode 0",true,1002,"WS_ERR_INVALID_OPCODE");u(A);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){const A=this.createError(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE");u(A);return}this._compressed=p}else if(this._opcode>7&&this._opcode<11){if(!this._fin){const A=this.createError(RangeError,"FIN must be set",true,1002,"WS_ERR_EXPECTED_FIN");u(A);return}if(p){const A=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");u(A);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){const A=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,true,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");u(A);return}}else{const A=this.createError(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE");u(A);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;this._masked=(A[1]&128)===128;if(this._isServer){if(!this._masked){const A=this.createError(RangeError,"MASK must be set",true,1002,"WS_ERR_EXPECTED_MASK");u(A);return}}else if(this._masked){const A=this.createError(RangeError,"MASK must be clear",true,1002,"WS_ERR_UNEXPECTED_MASK");u(A);return}if(this._payloadLength===126)this._state=_;else if(this._payloadLength===127)this._state=P;else this.haveLength(u)}getPayloadLength16(u){if(this._bufferedBytes<2){this._loop=false;return}this._payloadLength=this.consume(2).readUInt16BE(0);this.haveLength(u)}getPayloadLength64(u){if(this._bufferedBytes<8){this._loop=false;return}const A=this.consume(8);const p=A.readUInt32BE(0);if(p>Math.pow(2,53-32)-1){const A=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",false,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");u(A);return}this._payloadLength=p*Math.pow(2,32)+A.readUInt32BE(4);this.haveLength(u)}haveLength(u){if(this._payloadLength&&this._opcode<8){this._totalPayloadLength+=this._payloadLength;if(this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){const A=this.createError(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");u(A);return}}if(this._masked)this._state=O;else this._state=U}getMask(){if(this._bufferedBytes<4){this._loop=false;return}this._mask=this.consume(4);this._state=U}getData(u){let A=I;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=false;return}A=this.consume(this._payloadLength);if(this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0){D(A,this._mask)}}if(this._opcode>7){this.controlMessage(A,u);return}if(this._compressed){this._state=H;this.decompress(A,u);return}if(A.length){this._messageLength=this._totalPayloadLength;this._fragments.push(A)}this.dataMessage(u)}decompress(u,A){const p=this._extensions[E.extensionName];p.decompress(u,this._fin,((u,p)=>{if(u)return A(u);if(p.length){this._messageLength+=p.length;if(this._messageLength>this._maxPayload&&this._maxPayload>0){const u=this.createError(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");A(u);return}this._fragments.push(p)}this.dataMessage(A);if(this._state===R)this.startLoop(A)}))}dataMessage(u){if(!this._fin){this._state=R;return}const A=this._messageLength;const p=this._fragments;this._totalPayloadLength=0;this._messageLength=0;this._fragmented=0;this._fragments=[];if(this._opcode===2){let y;if(this._binaryType==="nodebuffer"){y=B(p,A)}else if(this._binaryType==="arraybuffer"){y=S(B(p,A))}else if(this._binaryType==="blob"){y=new Blob(p)}else{y=p}if(this._allowSynchronousEvents){this.emit("message",y,true);this._state=R}else{this._state=G;setImmediate((()=>{this.emit("message",y,true);this._state=R;this.startLoop(u)}))}}else{const y=B(p,A);if(!this._skipUTF8Validation&&!Q(y)){const A=this.createError(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8");u(A);return}if(this._state===H||this._allowSynchronousEvents){this.emit("message",y,false);this._state=R}else{this._state=G;setImmediate((()=>{this.emit("message",y,false);this._state=R;this.startLoop(u)}))}}}controlMessage(u,A){if(this._opcode===8){if(u.length===0){this._loop=false;this.emit("conclude",1005,I);this.end()}else{const p=u.readUInt16BE(0);if(!k(p)){const u=this.createError(RangeError,`invalid status code ${p}`,true,1002,"WS_ERR_INVALID_CLOSE_CODE");A(u);return}const y=new F(u.buffer,u.byteOffset+2,u.length-2);if(!this._skipUTF8Validation&&!Q(y)){const u=this.createError(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8");A(u);return}this._loop=false;this.emit("conclude",p,y);this.end()}this._state=R;return}if(this._allowSynchronousEvents){this.emit(this._opcode===9?"ping":"pong",u);this._state=R}else{this._state=G;setImmediate((()=>{this.emit(this._opcode===9?"ping":"pong",u);this._state=R;this.startLoop(A)}))}}createError(u,A,p,y,E){this._loop=false;this._errored=true;const C=new u(p?`Invalid WebSocket frame: ${A}`:A);Error.captureStackTrace(C,this.createError);C.code=E;C[w]=y;return C}}u.exports=Receiver},6996:(u,A,p)=>{const{Duplex:y}=p(2203);const{randomFillSync:E}=p(6982);const C=p(101);const{EMPTY_BUFFER:I,kWebSocket:w,NOOP:v}=p(4136);const{isBlob:B,isValidStatusCode:S}=p(2010);const{mask:D,toBuffer:k}=p(1900);const Q=Symbol("kByteLength");const F=Buffer.alloc(4);const R=8*1024;let _;let P=R;const O=0;const U=1;const H=2;class Sender{constructor(u,A,p){this._extensions=A||{};if(p){this._generateMask=p;this._maskBuffer=Buffer.alloc(4)}this._socket=u;this._firstFragment=true;this._compress=false;this._bufferedBytes=0;this._queue=[];this._state=O;this.onerror=v;this[w]=undefined}static frame(u,A){let p;let y=false;let C=2;let I=false;if(A.mask){p=A.maskBuffer||F;if(A.generateMask){A.generateMask(p)}else{if(P===R){if(_===undefined){_=Buffer.alloc(R)}E(_,0,R);P=0}p[0]=_[P++];p[1]=_[P++];p[2]=_[P++];p[3]=_[P++]}I=(p[0]|p[1]|p[2]|p[3])===0;C=6}let w;if(typeof u==="string"){if((!A.mask||I)&&A[Q]!==undefined){w=A[Q]}else{u=Buffer.from(u);w=u.length}}else{w=u.length;y=A.mask&&A.readOnly&&!I}let v=w;if(w>=65536){C+=8;v=127}else if(w>125){C+=2;v=126}const B=Buffer.allocUnsafe(y?w+C:C);B[0]=A.fin?A.opcode|128:A.opcode;if(A.rsv1)B[0]|=64;B[1]=v;if(v===126){B.writeUInt16BE(w,2)}else if(v===127){B[2]=B[3]=0;B.writeUIntBE(w,4,6)}if(!A.mask)return[B,u];B[1]|=128;B[C-4]=p[0];B[C-3]=p[1];B[C-2]=p[2];B[C-1]=p[3];if(I)return[B,u];if(y){D(u,p,B,C,w);return[B]}D(u,p,u,0,w);return[B,u]}close(u,A,p,y){let E;if(u===undefined){E=I}else if(typeof u!=="number"||!S(u)){throw new TypeError("First argument must be a valid error code number")}else if(A===undefined||!A.length){E=Buffer.allocUnsafe(2);E.writeUInt16BE(u,0)}else{const p=Buffer.byteLength(A);if(p>123){throw new RangeError("The message must not be greater than 123 bytes")}E=Buffer.allocUnsafe(2+p);E.writeUInt16BE(u,0);if(typeof A==="string"){E.write(A,2)}else{E.set(A,2)}}const C={[Q]:E.length,fin:true,generateMask:this._generateMask,mask:p,maskBuffer:this._maskBuffer,opcode:8,readOnly:false,rsv1:false};if(this._state!==O){this.enqueue([this.dispatch,E,false,C,y])}else{this.sendFrame(Sender.frame(E,C),y)}}ping(u,A,p){let y;let E;if(typeof u==="string"){y=Buffer.byteLength(u);E=false}else if(B(u)){y=u.size;E=false}else{u=k(u);y=u.length;E=k.readOnly}if(y>125){throw new RangeError("The data size must not be greater than 125 bytes")}const C={[Q]:y,fin:true,generateMask:this._generateMask,mask:A,maskBuffer:this._maskBuffer,opcode:9,readOnly:E,rsv1:false};if(B(u)){if(this._state!==O){this.enqueue([this.getBlobData,u,false,C,p])}else{this.getBlobData(u,false,C,p)}}else if(this._state!==O){this.enqueue([this.dispatch,u,false,C,p])}else{this.sendFrame(Sender.frame(u,C),p)}}pong(u,A,p){let y;let E;if(typeof u==="string"){y=Buffer.byteLength(u);E=false}else if(B(u)){y=u.size;E=false}else{u=k(u);y=u.length;E=k.readOnly}if(y>125){throw new RangeError("The data size must not be greater than 125 bytes")}const C={[Q]:y,fin:true,generateMask:this._generateMask,mask:A,maskBuffer:this._maskBuffer,opcode:10,readOnly:E,rsv1:false};if(B(u)){if(this._state!==O){this.enqueue([this.getBlobData,u,false,C,p])}else{this.getBlobData(u,false,C,p)}}else if(this._state!==O){this.enqueue([this.dispatch,u,false,C,p])}else{this.sendFrame(Sender.frame(u,C),p)}}send(u,A,p){const y=this._extensions[C.extensionName];let E=A.binary?2:1;let I=A.compress;let w;let v;if(typeof u==="string"){w=Buffer.byteLength(u);v=false}else if(B(u)){w=u.size;v=false}else{u=k(u);w=u.length;v=k.readOnly}if(this._firstFragment){this._firstFragment=false;if(I&&y&&y.params[y._isServer?"server_no_context_takeover":"client_no_context_takeover"]){I=w>=y._threshold}this._compress=I}else{I=false;E=0}if(A.fin)this._firstFragment=true;const S={[Q]:w,fin:A.fin,generateMask:this._generateMask,mask:A.mask,maskBuffer:this._maskBuffer,opcode:E,readOnly:v,rsv1:I};if(B(u)){if(this._state!==O){this.enqueue([this.getBlobData,u,this._compress,S,p])}else{this.getBlobData(u,this._compress,S,p)}}else if(this._state!==O){this.enqueue([this.dispatch,u,this._compress,S,p])}else{this.dispatch(u,this._compress,S,p)}}getBlobData(u,A,p,y){this._bufferedBytes+=p[Q];this._state=H;u.arrayBuffer().then((u=>{if(this._socket.destroyed){const u=new Error("The socket was closed while the blob was being read");process.nextTick(callCallbacks,this,u,y);return}this._bufferedBytes-=p[Q];const E=k(u);if(!A){this._state=O;this.sendFrame(Sender.frame(E,p),y);this.dequeue()}else{this.dispatch(E,A,p,y)}})).catch((u=>{process.nextTick(onError,this,u,y)}))}dispatch(u,A,p,y){if(!A){this.sendFrame(Sender.frame(u,p),y);return}const E=this._extensions[C.extensionName];this._bufferedBytes+=p[Q];this._state=U;E.compress(u,p.fin,((u,A)=>{if(this._socket.destroyed){const u=new Error("The socket was closed while data was being compressed");callCallbacks(this,u,y);return}this._bufferedBytes-=p[Q];this._state=O;p.readOnly=false;this.sendFrame(Sender.frame(A,p),y);this.dequeue()}))}dequeue(){while(this._state===O&&this._queue.length){const u=this._queue.shift();this._bufferedBytes-=u[3][Q];Reflect.apply(u[0],this,u.slice(1))}}enqueue(u){this._bufferedBytes+=u[3][Q];this._queue.push(u)}sendFrame(u,A){if(u.length===2){this._socket.cork();this._socket.write(u[0]);this._socket.write(u[1],A);this._socket.uncork()}else{this._socket.write(u[0],A)}}}u.exports=Sender;function callCallbacks(u,A,p){if(typeof p==="function")p(A);for(let p=0;p<u._queue.length;p++){const y=u._queue[p];const E=y[y.length-1];if(typeof E==="function")E(A)}}function onError(u,A,p){callCallbacks(u,A,p);u.onerror(A)}},213:(u,A,p)=>{const y=p(7494);const{Duplex:E}=p(2203);function emitClose(u){u.emit("close")}function duplexOnEnd(){if(!this.destroyed&&this._writableState.finished){this.destroy()}}function duplexOnError(u){this.removeListener("error",duplexOnError);this.destroy();if(this.listenerCount("error")===0){this.emit("error",u)}}function createWebSocketStream(u,A){let p=true;const y=new E({...A,autoDestroy:false,emitClose:false,objectMode:false,writableObjectMode:false});u.on("message",(function message(A,p){const E=!p&&y._readableState.objectMode?A.toString():A;if(!y.push(E))u.pause()}));u.once("error",(function error(u){if(y.destroyed)return;p=false;y.destroy(u)}));u.once("close",(function close(){if(y.destroyed)return;y.push(null)}));y._destroy=function(A,E){if(u.readyState===u.CLOSED){E(A);process.nextTick(emitClose,y);return}let C=false;u.once("error",(function error(u){C=true;E(u)}));u.once("close",(function close(){if(!C)E(A);process.nextTick(emitClose,y)}));if(p)u.terminate()};y._final=function(A){if(u.readyState===u.CONNECTING){u.once("open",(function open(){y._final(A)}));return}if(u._socket===null)return;if(u._socket._writableState.finished){A();if(y._readableState.endEmitted)y.destroy()}else{u._socket.once("finish",(function finish(){A()}));u.close()}};y._read=function(){if(u.isPaused)u.resume()};y._write=function(A,p,E){if(u.readyState===u.CONNECTING){u.once("open",(function open(){y._write(A,p,E)}));return}u.send(A,E)};y.on("end",duplexOnEnd);y.on("error",duplexOnError);return y}u.exports=createWebSocketStream},7747:(u,A,p)=>{const{tokenChars:y}=p(2010);function parse(u){const A=new Set;let p=-1;let E=-1;let C=0;for(C;C<u.length;C++){const I=u.charCodeAt(C);if(E===-1&&y[I]===1){if(p===-1)p=C}else if(C!==0&&(I===32||I===9)){if(E===-1&&p!==-1)E=C}else if(I===44){if(p===-1){throw new SyntaxError(`Unexpected character at index ${C}`)}if(E===-1)E=C;const y=u.slice(p,E);if(A.has(y)){throw new SyntaxError(`The "${y}" subprotocol is duplicated`)}A.add(y);p=E=-1}else{throw new SyntaxError(`Unexpected character at index ${C}`)}}if(p===-1||E!==-1){throw new SyntaxError("Unexpected end of input")}const I=u.slice(p,C);if(A.has(I)){throw new SyntaxError(`The "${I}" subprotocol is duplicated`)}A.add(I);return A}u.exports={parse:parse}},2010:(u,A,p)=>{const{isUtf8:y}=p(181);const{hasBlob:E}=p(4136);const C=[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 isValidStatusCode(u){return u>=1e3&&u<=1014&&u!==1004&&u!==1005&&u!==1006||u>=3e3&&u<=4999}function _isValidUTF8(u){const A=u.length;let p=0;while(p<A){if((u[p]&128)===0){p++}else if((u[p]&224)===192){if(p+1===A||(u[p+1]&192)!==128||(u[p]&254)===192){return false}p+=2}else if((u[p]&240)===224){if(p+2>=A||(u[p+1]&192)!==128||(u[p+2]&192)!==128||u[p]===224&&(u[p+1]&224)===128||u[p]===237&&(u[p+1]&224)===160){return false}p+=3}else if((u[p]&248)===240){if(p+3>=A||(u[p+1]&192)!==128||(u[p+2]&192)!==128||(u[p+3]&192)!==128||u[p]===240&&(u[p+1]&240)===128||u[p]===244&&u[p+1]>143||u[p]>244){return false}p+=4}else{return false}}return true}function isBlob(u){return E&&typeof u==="object"&&typeof u.arrayBuffer==="function"&&typeof u.type==="string"&&typeof u.stream==="function"&&(u[Symbol.toStringTag]==="Blob"||u[Symbol.toStringTag]==="File")}u.exports={isBlob:isBlob,isValidStatusCode:isValidStatusCode,isValidUTF8:_isValidUTF8,tokenChars:C};if(y){u.exports.isValidUTF8=function(u){return u.length<24?_isValidUTF8(u):y(u)}}else if(!process.env.WS_NO_UTF_8_VALIDATE){try{const A=p(2461);u.exports.isValidUTF8=function(u){return u.length<32?_isValidUTF8(u):A(u)}}catch(u){}}},544:(u,A,p)=>{const y=p(4434);const E=p(8611);const{Duplex:C}=p(2203);const{createHash:I}=p(6982);const w=p(7232);const v=p(101);const B=p(7747);const S=p(7494);const{GUID:D,kWebSocket:k}=p(4136);const Q=/^[+/0-9A-Za-z]{22}==$/;const F=0;const R=1;const _=2;class WebSocketServer extends y{constructor(u,A){super();u={allowSynchronousEvents:true,autoPong:true,maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:false,handleProtocols:null,clientTracking:true,verifyClient:null,noServer:false,backlog:null,server:null,host:null,path:null,port:null,WebSocket:S,...u};if(u.port==null&&!u.server&&!u.noServer||u.port!=null&&(u.server||u.noServer)||u.server&&u.noServer){throw new TypeError('One and only one of the "port", "server", or "noServer" options '+"must be specified")}if(u.port!=null){this._server=E.createServer(((u,A)=>{const p=E.STATUS_CODES[426];A.writeHead(426,{"Content-Length":p.length,"Content-Type":"text/plain"});A.end(p)}));this._server.listen(u.port,u.host,u.backlog,A)}else if(u.server){this._server=u.server}if(this._server){const u=this.emit.bind(this,"connection");this._removeListeners=addListeners(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(A,p,y)=>{this.handleUpgrade(A,p,y,u)}})}if(u.perMessageDeflate===true)u.perMessageDeflate={};if(u.clientTracking){this.clients=new Set;this._shouldEmitClose=false}this.options=u;this._state=F}address(){if(this.options.noServer){throw new Error('The server is operating in "noServer" mode')}if(!this._server)return null;return this._server.address()}close(u){if(this._state===_){if(u){this.once("close",(()=>{u(new Error("The server is not running"))}))}process.nextTick(emitClose,this);return}if(u)this.once("close",u);if(this._state===R)return;this._state=R;if(this.options.noServer||this.options.server){if(this._server){this._removeListeners();this._removeListeners=this._server=null}if(this.clients){if(!this.clients.size){process.nextTick(emitClose,this)}else{this._shouldEmitClose=true}}else{process.nextTick(emitClose,this)}}else{const u=this._server;this._removeListeners();this._removeListeners=this._server=null;u.close((()=>{emitClose(this)}))}}shouldHandle(u){if(this.options.path){const A=u.url.indexOf("?");const p=A!==-1?u.url.slice(0,A):u.url;if(p!==this.options.path)return false}return true}handleUpgrade(u,A,p,y){A.on("error",socketOnError);const E=u.headers["sec-websocket-key"];const C=u.headers.upgrade;const I=+u.headers["sec-websocket-version"];if(u.method!=="GET"){const p="Invalid HTTP method";abortHandshakeOrEmitwsClientError(this,u,A,405,p);return}if(C===undefined||C.toLowerCase()!=="websocket"){const p="Invalid Upgrade header";abortHandshakeOrEmitwsClientError(this,u,A,400,p);return}if(E===undefined||!Q.test(E)){const p="Missing or invalid Sec-WebSocket-Key header";abortHandshakeOrEmitwsClientError(this,u,A,400,p);return}if(I!==13&&I!==8){const p="Missing or invalid Sec-WebSocket-Version header";abortHandshakeOrEmitwsClientError(this,u,A,400,p,{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(u)){abortHandshake(A,400);return}const S=u.headers["sec-websocket-protocol"];let D=new Set;if(S!==undefined){try{D=B.parse(S)}catch(p){const y="Invalid Sec-WebSocket-Protocol header";abortHandshakeOrEmitwsClientError(this,u,A,400,y);return}}const k=u.headers["sec-websocket-extensions"];const F={};if(this.options.perMessageDeflate&&k!==undefined){const p=new v(this.options.perMessageDeflate,true,this.options.maxPayload);try{const u=w.parse(k);if(u[v.extensionName]){p.accept(u[v.extensionName]);F[v.extensionName]=p}}catch(p){const y="Invalid or unacceptable Sec-WebSocket-Extensions header";abortHandshakeOrEmitwsClientError(this,u,A,400,y);return}}if(this.options.verifyClient){const C={origin:u.headers[`${I===8?"sec-websocket-origin":"origin"}`],secure:!!(u.socket.authorized||u.socket.encrypted),req:u};if(this.options.verifyClient.length===2){this.options.verifyClient(C,((C,I,w,v)=>{if(!C){return abortHandshake(A,I||401,w,v)}this.completeUpgrade(F,E,D,u,A,p,y)}));return}if(!this.options.verifyClient(C))return abortHandshake(A,401)}this.completeUpgrade(F,E,D,u,A,p,y)}completeUpgrade(u,A,p,y,E,C,B){if(!E.readable||!E.writable)return E.destroy();if(E[k]){throw new Error("server.handleUpgrade() was called more than once with the same "+"socket, possibly due to a misconfiguration")}if(this._state>F)return abortHandshake(E,503);const S=I("sha1").update(A+D).digest("base64");const Q=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${S}`];const R=new this.options.WebSocket(null,undefined,this.options);if(p.size){const u=this.options.handleProtocols?this.options.handleProtocols(p,y):p.values().next().value;if(u){Q.push(`Sec-WebSocket-Protocol: ${u}`);R._protocol=u}}if(u[v.extensionName]){const A=u[v.extensionName].params;const p=w.format({[v.extensionName]:[A]});Q.push(`Sec-WebSocket-Extensions: ${p}`);R._extensions=u}this.emit("headers",Q,y);E.write(Q.concat("\r\n").join("\r\n"));E.removeListener("error",socketOnError);R.setSocket(E,C,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation});if(this.clients){this.clients.add(R);R.on("close",(()=>{this.clients.delete(R);if(this._shouldEmitClose&&!this.clients.size){process.nextTick(emitClose,this)}}))}B(R,y)}}u.exports=WebSocketServer;function addListeners(u,A){for(const p of Object.keys(A))u.on(p,A[p]);return function removeListeners(){for(const p of Object.keys(A)){u.removeListener(p,A[p])}}}function emitClose(u){u._state=_;u.emit("close")}function socketOnError(){this.destroy()}function abortHandshake(u,A,p,y){p=p||E.STATUS_CODES[A];y={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(p),...y};u.once("finish",u.destroy);u.end(`HTTP/1.1 ${A} ${E.STATUS_CODES[A]}\r\n`+Object.keys(y).map((u=>`${u}: ${y[u]}`)).join("\r\n")+"\r\n\r\n"+p)}function abortHandshakeOrEmitwsClientError(u,A,p,y,E,C){if(u.listenerCount("wsClientError")){const y=new Error(E);Error.captureStackTrace(y,abortHandshakeOrEmitwsClientError);u.emit("wsClientError",y,p,A)}else{abortHandshake(p,y,E,C)}}},7494:(u,A,p)=>{const y=p(4434);const E=p(5692);const C=p(8611);const I=p(9278);const w=p(4756);const{randomBytes:v,createHash:B}=p(6982);const{Duplex:S,Readable:D}=p(2203);const{URL:k}=p(7016);const Q=p(101);const F=p(5372);const R=p(6996);const{isBlob:_}=p(2010);const{BINARY_TYPES:P,EMPTY_BUFFER:O,GUID:U,kForOnEventAttribute:H,kListener:G,kStatusCode:j,kWebSocket:$,NOOP:q}=p(4136);const{EventTarget:{addEventListener:K,removeEventListener:J}}=p(7011);const{format:ee,parse:te}=p(7232);const{toBuffer:ne}=p(1900);const re=30*1e3;const se=Symbol("kAborted");const ie=[8,13];const oe=["CONNECTING","OPEN","CLOSING","CLOSED"];const ae=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class WebSocket extends y{constructor(u,A,p){super();this._binaryType=P[0];this._closeCode=1006;this._closeFrameReceived=false;this._closeFrameSent=false;this._closeMessage=O;this._closeTimer=null;this._errorEmitted=false;this._extensions={};this._paused=false;this._protocol="";this._readyState=WebSocket.CONNECTING;this._receiver=null;this._sender=null;this._socket=null;if(u!==null){this._bufferedAmount=0;this._isServer=false;this._redirects=0;if(A===undefined){A=[]}else if(!Array.isArray(A)){if(typeof A==="object"&&A!==null){p=A;A=[]}else{A=[A]}}initAsClient(this,u,A,p)}else{this._autoPong=p.autoPong;this._isServer=true}}get binaryType(){return this._binaryType}set binaryType(u){if(!P.includes(u))return;this._binaryType=u;if(this._receiver)this._receiver._binaryType=u}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}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(u,A,p){const y=new F({allowSynchronousEvents:p.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:p.maxPayload,skipUTF8Validation:p.skipUTF8Validation});const E=new R(u,this._extensions,p.generateMask);this._receiver=y;this._sender=E;this._socket=u;y[$]=this;E[$]=this;u[$]=this;y.on("conclude",receiverOnConclude);y.on("drain",receiverOnDrain);y.on("error",receiverOnError);y.on("message",receiverOnMessage);y.on("ping",receiverOnPing);y.on("pong",receiverOnPong);E.onerror=senderOnError;if(u.setTimeout)u.setTimeout(0);if(u.setNoDelay)u.setNoDelay();if(A.length>0)u.unshift(A);u.on("close",socketOnClose);u.on("data",socketOnData);u.on("end",socketOnEnd);u.on("error",socketOnError);this._readyState=WebSocket.OPEN;this.emit("open")}emitClose(){if(!this._socket){this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[Q.extensionName]){this._extensions[Q.extensionName].cleanup()}this._receiver.removeAllListeners();this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage)}close(u,A){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const u="WebSocket was closed before the connection was established";abortHandshake(this,this._req,u);return}if(this.readyState===WebSocket.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)){this._socket.end()}return}this._readyState=WebSocket.CLOSING;this._sender.close(u,A,!this._isServer,(u=>{if(u)return;this._closeFrameSent=true;if(this._closeFrameReceived||this._receiver._writableState.errorEmitted){this._socket.end()}}));setCloseTimer(this)}pause(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=true;this._socket.pause()}ping(u,A,p){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof u==="function"){p=u;u=A=undefined}else if(typeof A==="function"){p=A;A=undefined}if(typeof u==="number")u=u.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,u,p);return}if(A===undefined)A=!this._isServer;this._sender.ping(u||O,A,p)}pong(u,A,p){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof u==="function"){p=u;u=A=undefined}else if(typeof A==="function"){p=A;A=undefined}if(typeof u==="number")u=u.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,u,p);return}if(A===undefined)A=!this._isServer;this._sender.pong(u||O,A,p)}resume(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=false;if(!this._receiver._writableState.needDrain)this._socket.resume()}send(u,A,p){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof A==="function"){p=A;A={}}if(typeof u==="number")u=u.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,u,p);return}const y={binary:typeof u!=="string",mask:!this._isServer,compress:true,fin:true,...A};if(!this._extensions[Q.extensionName]){y.compress=false}this._sender.send(u||O,y,p)}terminate(){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const u="WebSocket was closed before the connection was established";abortHandshake(this,this._req,u);return}if(this._socket){this._readyState=WebSocket.CLOSING;this._socket.destroy()}}}Object.defineProperty(WebSocket,"CONNECTING",{enumerable:true,value:oe.indexOf("CONNECTING")});Object.defineProperty(WebSocket.prototype,"CONNECTING",{enumerable:true,value:oe.indexOf("CONNECTING")});Object.defineProperty(WebSocket,"OPEN",{enumerable:true,value:oe.indexOf("OPEN")});Object.defineProperty(WebSocket.prototype,"OPEN",{enumerable:true,value:oe.indexOf("OPEN")});Object.defineProperty(WebSocket,"CLOSING",{enumerable:true,value:oe.indexOf("CLOSING")});Object.defineProperty(WebSocket.prototype,"CLOSING",{enumerable:true,value:oe.indexOf("CLOSING")});Object.defineProperty(WebSocket,"CLOSED",{enumerable:true,value:oe.indexOf("CLOSED")});Object.defineProperty(WebSocket.prototype,"CLOSED",{enumerable:true,value:oe.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((u=>{Object.defineProperty(WebSocket.prototype,u,{enumerable:true})}));["open","error","close","message"].forEach((u=>{Object.defineProperty(WebSocket.prototype,`on${u}`,{enumerable:true,get(){for(const A of this.listeners(u)){if(A[H])return A[G]}return null},set(A){for(const A of this.listeners(u)){if(A[H]){this.removeListener(u,A);break}}if(typeof A!=="function")return;this.addEventListener(u,A,{[H]:true})}})}));WebSocket.prototype.addEventListener=K;WebSocket.prototype.removeEventListener=J;u.exports=WebSocket;function initAsClient(u,A,p,y){const I={allowSynchronousEvents:true,autoPong:true,protocolVersion:ie[1],maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:true,followRedirects:false,maxRedirects:10,...y,socketPath:undefined,hostname:undefined,protocol:undefined,timeout:undefined,method:"GET",host:undefined,path:undefined,port:undefined};u._autoPong=I.autoPong;if(!ie.includes(I.protocolVersion)){throw new RangeError(`Unsupported protocol version: ${I.protocolVersion} `+`(supported versions: ${ie.join(", ")})`)}let w;if(A instanceof k){w=A}else{try{w=new k(A)}catch(u){throw new SyntaxError(`Invalid URL: ${A}`)}}if(w.protocol==="http:"){w.protocol="ws:"}else if(w.protocol==="https:"){w.protocol="wss:"}u._url=w.href;const S=w.protocol==="wss:";const D=w.protocol==="ws+unix:";let F;if(w.protocol!=="ws:"&&!S&&!D){F='The URL\'s protocol must be one of "ws:", "wss:", '+'"http:", "https:", or "ws+unix:"'}else if(D&&!w.pathname){F="The URL's pathname is empty"}else if(w.hash){F="The URL contains a fragment identifier"}if(F){const A=new SyntaxError(F);if(u._redirects===0){throw A}else{emitErrorAndClose(u,A);return}}const R=S?443:80;const _=v(16).toString("base64");const P=S?E.request:C.request;const O=new Set;let H;I.createConnection=I.createConnection||(S?tlsConnect:netConnect);I.defaultPort=I.defaultPort||R;I.port=w.port||R;I.host=w.hostname.startsWith("[")?w.hostname.slice(1,-1):w.hostname;I.headers={...I.headers,"Sec-WebSocket-Version":I.protocolVersion,"Sec-WebSocket-Key":_,Connection:"Upgrade",Upgrade:"websocket"};I.path=w.pathname+w.search;I.timeout=I.handshakeTimeout;if(I.perMessageDeflate){H=new Q(I.perMessageDeflate!==true?I.perMessageDeflate:{},false,I.maxPayload);I.headers["Sec-WebSocket-Extensions"]=ee({[Q.extensionName]:H.offer()})}if(p.length){for(const u of p){if(typeof u!=="string"||!ae.test(u)||O.has(u)){throw new SyntaxError("An invalid or duplicated subprotocol was specified")}O.add(u)}I.headers["Sec-WebSocket-Protocol"]=p.join(",")}if(I.origin){if(I.protocolVersion<13){I.headers["Sec-WebSocket-Origin"]=I.origin}else{I.headers.Origin=I.origin}}if(w.username||w.password){I.auth=`${w.username}:${w.password}`}if(D){const u=I.path.split(":");I.socketPath=u[0];I.path=u[1]}let G;if(I.followRedirects){if(u._redirects===0){u._originalIpc=D;u._originalSecure=S;u._originalHostOrSocketPath=D?I.socketPath:w.host;const A=y&&y.headers;y={...y,headers:{}};if(A){for(const[u,p]of Object.entries(A)){y.headers[u.toLowerCase()]=p}}}else if(u.listenerCount("redirect")===0){const A=D?u._originalIpc?I.socketPath===u._originalHostOrSocketPath:false:u._originalIpc?false:w.host===u._originalHostOrSocketPath;if(!A||u._originalSecure&&!S){delete I.headers.authorization;delete I.headers.cookie;if(!A)delete I.headers.host;I.auth=undefined}}if(I.auth&&!y.headers.authorization){y.headers.authorization="Basic "+Buffer.from(I.auth).toString("base64")}G=u._req=P(I);if(u._redirects){u.emit("redirect",u.url,G)}}else{G=u._req=P(I)}if(I.timeout){G.on("timeout",(()=>{abortHandshake(u,G,"Opening handshake has timed out")}))}G.on("error",(A=>{if(G===null||G[se])return;G=u._req=null;emitErrorAndClose(u,A)}));G.on("response",(E=>{const C=E.headers.location;const w=E.statusCode;if(C&&I.followRedirects&&w>=300&&w<400){if(++u._redirects>I.maxRedirects){abortHandshake(u,G,"Maximum redirects exceeded");return}G.abort();let E;try{E=new k(C,A)}catch(A){const p=new SyntaxError(`Invalid URL: ${C}`);emitErrorAndClose(u,p);return}initAsClient(u,E,p,y)}else if(!u.emit("unexpected-response",G,E)){abortHandshake(u,G,`Unexpected server response: ${E.statusCode}`)}}));G.on("upgrade",((A,p,y)=>{u.emit("upgrade",A);if(u.readyState!==WebSocket.CONNECTING)return;G=u._req=null;const E=A.headers.upgrade;if(E===undefined||E.toLowerCase()!=="websocket"){abortHandshake(u,p,"Invalid Upgrade header");return}const C=B("sha1").update(_+U).digest("base64");if(A.headers["sec-websocket-accept"]!==C){abortHandshake(u,p,"Invalid Sec-WebSocket-Accept header");return}const w=A.headers["sec-websocket-protocol"];let v;if(w!==undefined){if(!O.size){v="Server sent a subprotocol but none was requested"}else if(!O.has(w)){v="Server sent an invalid subprotocol"}}else if(O.size){v="Server sent no subprotocol"}if(v){abortHandshake(u,p,v);return}if(w)u._protocol=w;const S=A.headers["sec-websocket-extensions"];if(S!==undefined){if(!H){const A="Server sent a Sec-WebSocket-Extensions header but no extension "+"was requested";abortHandshake(u,p,A);return}let A;try{A=te(S)}catch(A){const y="Invalid Sec-WebSocket-Extensions header";abortHandshake(u,p,y);return}const y=Object.keys(A);if(y.length!==1||y[0]!==Q.extensionName){const A="Server indicated an extension that was not requested";abortHandshake(u,p,A);return}try{H.accept(A[Q.extensionName])}catch(A){const y="Invalid Sec-WebSocket-Extensions header";abortHandshake(u,p,y);return}u._extensions[Q.extensionName]=H}u.setSocket(p,y,{allowSynchronousEvents:I.allowSynchronousEvents,generateMask:I.generateMask,maxPayload:I.maxPayload,skipUTF8Validation:I.skipUTF8Validation})}));if(I.finishRequest){I.finishRequest(G,u)}else{G.end()}}function emitErrorAndClose(u,A){u._readyState=WebSocket.CLOSING;u._errorEmitted=true;u.emit("error",A);u.emitClose()}function netConnect(u){u.path=u.socketPath;return I.connect(u)}function tlsConnect(u){u.path=undefined;if(!u.servername&&u.servername!==""){u.servername=I.isIP(u.host)?"":u.host}return w.connect(u)}function abortHandshake(u,A,p){u._readyState=WebSocket.CLOSING;const y=new Error(p);Error.captureStackTrace(y,abortHandshake);if(A.setHeader){A[se]=true;A.abort();if(A.socket&&!A.socket.destroyed){A.socket.destroy()}process.nextTick(emitErrorAndClose,u,y)}else{A.destroy(y);A.once("error",u.emit.bind(u,"error"));A.once("close",u.emitClose.bind(u))}}function sendAfterClose(u,A,p){if(A){const p=_(A)?A.size:ne(A).length;if(u._socket)u._sender._bufferedBytes+=p;else u._bufferedAmount+=p}if(p){const A=new Error(`WebSocket is not open: readyState ${u.readyState} `+`(${oe[u.readyState]})`);process.nextTick(p,A)}}function receiverOnConclude(u,A){const p=this[$];p._closeFrameReceived=true;p._closeMessage=A;p._closeCode=u;if(p._socket[$]===undefined)return;p._socket.removeListener("data",socketOnData);process.nextTick(resume,p._socket);if(u===1005)p.close();else p.close(u,A)}function receiverOnDrain(){const u=this[$];if(!u.isPaused)u._socket.resume()}function receiverOnError(u){const A=this[$];if(A._socket[$]!==undefined){A._socket.removeListener("data",socketOnData);process.nextTick(resume,A._socket);A.close(u[j])}if(!A._errorEmitted){A._errorEmitted=true;A.emit("error",u)}}function receiverOnFinish(){this[$].emitClose()}function receiverOnMessage(u,A){this[$].emit("message",u,A)}function receiverOnPing(u){const A=this[$];if(A._autoPong)A.pong(u,!this._isServer,q);A.emit("ping",u)}function receiverOnPong(u){this[$].emit("pong",u)}function resume(u){u.resume()}function senderOnError(u){const A=this[$];if(A.readyState===WebSocket.CLOSED)return;if(A.readyState===WebSocket.OPEN){A._readyState=WebSocket.CLOSING;setCloseTimer(A)}this._socket.end();if(!A._errorEmitted){A._errorEmitted=true;A.emit("error",u)}}function setCloseTimer(u){u._closeTimer=setTimeout(u._socket.destroy.bind(u._socket),re)}function socketOnClose(){const u=this[$];this.removeListener("close",socketOnClose);this.removeListener("data",socketOnData);this.removeListener("end",socketOnEnd);u._readyState=WebSocket.CLOSING;let A;if(!this._readableState.endEmitted&&!u._closeFrameReceived&&!u._receiver._writableState.errorEmitted&&(A=u._socket.read())!==null){u._receiver.write(A)}u._receiver.end();this[$]=undefined;clearTimeout(u._closeTimer);if(u._receiver._writableState.finished||u._receiver._writableState.errorEmitted){u.emitClose()}else{u._receiver.on("error",receiverOnFinish);u._receiver.on("finish",receiverOnFinish)}}function socketOnData(u){if(!this[$]._receiver.write(u)){this.pause()}}function socketOnEnd(){const u=this[$];u._readyState=WebSocket.CLOSING;u._receiver.end();this.end()}function socketOnError(){const u=this[$];this.removeListener("error",socketOnError);this.on("error",q);if(u){u._readyState=WebSocket.CLOSING;this.destroy()}}},6793:u=>{u.exports=function(u){u.prototype[Symbol.iterator]=function*(){for(let u=this.head;u;u=u.next){yield u.value}}}},2305:(u,A,p)=>{u.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(u){var A=this;if(!(A instanceof Yallist)){A=new Yallist}A.tail=null;A.head=null;A.length=0;if(u&&typeof u.forEach==="function"){u.forEach((function(u){A.push(u)}))}else if(arguments.length>0){for(var p=0,y=arguments.length;p<y;p++){A.push(arguments[p])}}return A}Yallist.prototype.removeNode=function(u){if(u.list!==this){throw new Error("removing node which does not belong to this list")}var A=u.next;var p=u.prev;if(A){A.prev=p}if(p){p.next=A}if(u===this.head){this.head=A}if(u===this.tail){this.tail=p}u.list.length--;u.next=null;u.prev=null;u.list=null;return A};Yallist.prototype.unshiftNode=function(u){if(u===this.head){return}if(u.list){u.list.removeNode(u)}var A=this.head;u.list=this;u.next=A;if(A){A.prev=u}this.head=u;if(!this.tail){this.tail=u}this.length++};Yallist.prototype.pushNode=function(u){if(u===this.tail){return}if(u.list){u.list.removeNode(u)}var A=this.tail;u.list=this;u.prev=A;if(A){A.next=u}this.tail=u;if(!this.head){this.head=u}this.length++};Yallist.prototype.push=function(){for(var u=0,A=arguments.length;u<A;u++){push(this,arguments[u])}return this.length};Yallist.prototype.unshift=function(){for(var u=0,A=arguments.length;u<A;u++){unshift(this,arguments[u])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var u=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return u};Yallist.prototype.shift=function(){if(!this.head){return undefined}var u=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return u};Yallist.prototype.forEach=function(u,A){A=A||this;for(var p=this.head,y=0;p!==null;y++){u.call(A,p.value,y,this);p=p.next}};Yallist.prototype.forEachReverse=function(u,A){A=A||this;for(var p=this.tail,y=this.length-1;p!==null;y--){u.call(A,p.value,y,this);p=p.prev}};Yallist.prototype.get=function(u){for(var A=0,p=this.head;p!==null&&A<u;A++){p=p.next}if(A===u&&p!==null){return p.value}};Yallist.prototype.getReverse=function(u){for(var A=0,p=this.tail;p!==null&&A<u;A++){p=p.prev}if(A===u&&p!==null){return p.value}};Yallist.prototype.map=function(u,A){A=A||this;var p=new Yallist;for(var y=this.head;y!==null;){p.push(u.call(A,y.value,this));y=y.next}return p};Yallist.prototype.mapReverse=function(u,A){A=A||this;var p=new Yallist;for(var y=this.tail;y!==null;){p.push(u.call(A,y.value,this));y=y.prev}return p};Yallist.prototype.reduce=function(u,A){var p;var y=this.head;if(arguments.length>1){p=A}else if(this.head){y=this.head.next;p=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var E=0;y!==null;E++){p=u(p,y.value,E);y=y.next}return p};Yallist.prototype.reduceReverse=function(u,A){var p;var y=this.tail;if(arguments.length>1){p=A}else if(this.tail){y=this.tail.prev;p=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var E=this.length-1;y!==null;E--){p=u(p,y.value,E);y=y.prev}return p};Yallist.prototype.toArray=function(){var u=new Array(this.length);for(var A=0,p=this.head;p!==null;A++){u[A]=p.value;p=p.next}return u};Yallist.prototype.toArrayReverse=function(){var u=new Array(this.length);for(var A=0,p=this.tail;p!==null;A++){u[A]=p.value;p=p.prev}return u};Yallist.prototype.slice=function(u,A){A=A||this.length;if(A<0){A+=this.length}u=u||0;if(u<0){u+=this.length}var p=new Yallist;if(A<u||A<0){return p}if(u<0){u=0}if(A>this.length){A=this.length}for(var y=0,E=this.head;E!==null&&y<u;y++){E=E.next}for(;E!==null&&y<A;y++,E=E.next){p.push(E.value)}return p};Yallist.prototype.sliceReverse=function(u,A){A=A||this.length;if(A<0){A+=this.length}u=u||0;if(u<0){u+=this.length}var p=new Yallist;if(A<u||A<0){return p}if(u<0){u=0}if(A>this.length){A=this.length}for(var y=this.length,E=this.tail;E!==null&&y>A;y--){E=E.prev}for(;E!==null&&y>u;y--,E=E.prev){p.push(E.value)}return p};Yallist.prototype.splice=function(u,A,...p){if(u>this.length){u=this.length-1}if(u<0){u=this.length+u}for(var y=0,E=this.head;E!==null&&y<u;y++){E=E.next}var C=[];for(var y=0;E&&y<A;y++){C.push(E.value);E=this.removeNode(E)}if(E===null){E=this.tail}if(E!==this.head&&E!==this.tail){E=E.prev}for(var y=0;y<p.length;y++){E=insert(this,E,p[y])}return C};Yallist.prototype.reverse=function(){var u=this.head;var A=this.tail;for(var p=u;p!==null;p=p.prev){var y=p.prev;p.prev=p.next;p.next=y}this.head=A;this.tail=u;return this};function insert(u,A,p){var y=A===u.head?new Node(p,null,A,u):new Node(p,A,A.next,u);if(y.next===null){u.tail=y}if(y.prev===null){u.head=y}u.length++;return y}function push(u,A){u.tail=new Node(A,u.tail,null,u);if(!u.head){u.head=u.tail}u.length++}function unshift(u,A){u.head=new Node(A,null,u.head,u);if(!u.tail){u.tail=u.head}u.length++}function Node(u,A,p,y){if(!(this instanceof Node)){return new Node(u,A,p,y)}this.list=y;this.value=u;if(A){A.next=this;this.prev=A}else{this.prev=null}if(p){p.prev=this;this.next=p}else{this.next=null}}try{p(6793)(Yallist)}catch(u){}},7955:(u,A,p)=>{var y=p(9896);var E=p(3106);var C=p(3749);var I=p(7215);var w=p(9023);var v=p(4434).EventEmitter;var B=p(2203).Transform;var S=p(2203).PassThrough;var D=p(2203).Writable;A.open=open;A.fromFd=fromFd;A.fromBuffer=fromBuffer;A.fromRandomAccessReader=fromRandomAccessReader;A.dosDateTimeToDate=dosDateTimeToDate;A.validateFileName=validateFileName;A.ZipFile=ZipFile;A.Entry=Entry;A.RandomAccessReader=RandomAccessReader;function open(u,A,p){if(typeof A==="function"){p=A;A=null}if(A==null)A={};if(A.autoClose==null)A.autoClose=true;if(A.lazyEntries==null)A.lazyEntries=false;if(A.decodeStrings==null)A.decodeStrings=true;if(A.validateEntrySizes==null)A.validateEntrySizes=true;if(A.strictFileNames==null)A.strictFileNames=false;if(p==null)p=defaultCallback;y.open(u,"r",(function(u,E){if(u)return p(u);fromFd(E,A,(function(u,A){if(u)y.close(E,defaultCallback);p(u,A)}))}))}function fromFd(u,A,p){if(typeof A==="function"){p=A;A=null}if(A==null)A={};if(A.autoClose==null)A.autoClose=false;if(A.lazyEntries==null)A.lazyEntries=false;if(A.decodeStrings==null)A.decodeStrings=true;if(A.validateEntrySizes==null)A.validateEntrySizes=true;if(A.strictFileNames==null)A.strictFileNames=false;if(p==null)p=defaultCallback;y.fstat(u,(function(y,E){if(y)return p(y);var I=C.createFromFd(u,{autoClose:true});fromRandomAccessReader(I,E.size,A,p)}))}function fromBuffer(u,A,p){if(typeof A==="function"){p=A;A=null}if(A==null)A={};A.autoClose=false;if(A.lazyEntries==null)A.lazyEntries=false;if(A.decodeStrings==null)A.decodeStrings=true;if(A.validateEntrySizes==null)A.validateEntrySizes=true;if(A.strictFileNames==null)A.strictFileNames=false;var y=C.createFromBuffer(u,{maxChunkSize:65536});fromRandomAccessReader(y,u.length,A,p)}function fromRandomAccessReader(u,A,p,y){if(typeof p==="function"){y=p;p=null}if(p==null)p={};if(p.autoClose==null)p.autoClose=true;if(p.lazyEntries==null)p.lazyEntries=false;if(p.decodeStrings==null)p.decodeStrings=true;var E=!!p.decodeStrings;if(p.validateEntrySizes==null)p.validateEntrySizes=true;if(p.strictFileNames==null)p.strictFileNames=false;if(y==null)y=defaultCallback;if(typeof A!=="number")throw new Error("expected totalSize parameter to be a number");if(A>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}u.ref();var C=22;var I=65535;var w=Math.min(C+I,A);var v=Q(w);var B=A-v.length;readAndAssertNoEof(u,v,0,w,B,(function(I){if(I)return y(I);for(var S=w-C;S>=0;S-=1){if(v.readUInt32LE(S)!==101010256)continue;var D=v.slice(S);var k=D.readUInt16LE(4);if(k!==0){return y(new Error("multi-disk zip files are not supported: found disk number: "+k))}var F=D.readUInt16LE(10);var R=D.readUInt32LE(16);var _=D.readUInt16LE(20);var P=D.length-C;if(_!==P){return y(new Error("invalid comment length. expected: "+P+". found: "+_))}var O=E?decodeBuffer(D,22,D.length,false):D.slice(22);if(!(F===65535||R===4294967295)){return y(null,new ZipFile(u,R,A,F,O,p.autoClose,p.lazyEntries,E,p.validateEntrySizes,p.strictFileNames))}var U=Q(20);var H=B+S-U.length;readAndAssertNoEof(u,U,0,U.length,H,(function(C){if(C)return y(C);if(U.readUInt32LE(0)!==117853008){return y(new Error("invalid zip64 end of central directory locator signature"))}var I=readUInt64LE(U,8);var w=Q(56);readAndAssertNoEof(u,w,0,w.length,I,(function(C){if(C)return y(C);if(w.readUInt32LE(0)!==101075792){return y(new Error("invalid zip64 end of central directory record signature"))}F=readUInt64LE(w,32);R=readUInt64LE(w,48);return y(null,new ZipFile(u,R,A,F,O,p.autoClose,p.lazyEntries,E,p.validateEntrySizes,p.strictFileNames))}))}));return}y(new Error("end of central directory record signature not found"))}))}w.inherits(ZipFile,v);function ZipFile(u,A,p,y,E,C,I,w,B,S){var D=this;v.call(D);D.reader=u;D.reader.on("error",(function(u){emitError(D,u)}));D.reader.once("close",(function(){D.emit("close")}));D.readEntryCursor=A;D.fileSize=p;D.entryCount=y;D.comment=E;D.entriesRead=0;D.autoClose=!!C;D.lazyEntries=!!I;D.decodeStrings=!!w;D.validateEntrySizes=!!B;D.strictFileNames=!!S;D.isOpen=true;D.emittedError=false;if(!D.lazyEntries)D._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(u,A){if(u.autoClose)u.close();emitError(u,A)}function emitError(u,A){if(u.emittedError)return;u.emittedError=true;u.emit("error",A)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var u=this;if(u.entryCount===u.entriesRead){setImmediate((function(){if(u.autoClose)u.close();if(u.emittedError)return;u.emit("end")}));return}if(u.emittedError)return;var A=Q(46);readAndAssertNoEof(u.reader,A,0,A.length,u.readEntryCursor,(function(p){if(p)return emitErrorAndAutoClose(u,p);if(u.emittedError)return;var y=new Entry;var E=A.readUInt32LE(0);if(E!==33639248)return emitErrorAndAutoClose(u,new Error("invalid central directory file header signature: 0x"+E.toString(16)));y.versionMadeBy=A.readUInt16LE(4);y.versionNeededToExtract=A.readUInt16LE(6);y.generalPurposeBitFlag=A.readUInt16LE(8);y.compressionMethod=A.readUInt16LE(10);y.lastModFileTime=A.readUInt16LE(12);y.lastModFileDate=A.readUInt16LE(14);y.crc32=A.readUInt32LE(16);y.compressedSize=A.readUInt32LE(20);y.uncompressedSize=A.readUInt32LE(24);y.fileNameLength=A.readUInt16LE(28);y.extraFieldLength=A.readUInt16LE(30);y.fileCommentLength=A.readUInt16LE(32);y.internalFileAttributes=A.readUInt16LE(36);y.externalFileAttributes=A.readUInt32LE(38);y.relativeOffsetOfLocalHeader=A.readUInt32LE(42);if(y.generalPurposeBitFlag&64)return emitErrorAndAutoClose(u,new Error("strong encryption is not supported"));u.readEntryCursor+=46;A=Q(y.fileNameLength+y.extraFieldLength+y.fileCommentLength);readAndAssertNoEof(u.reader,A,0,A.length,u.readEntryCursor,(function(p){if(p)return emitErrorAndAutoClose(u,p);if(u.emittedError)return;var E=(y.generalPurposeBitFlag&2048)!==0;y.fileName=u.decodeStrings?decodeBuffer(A,0,y.fileNameLength,E):A.slice(0,y.fileNameLength);var C=y.fileNameLength+y.extraFieldLength;var w=A.slice(y.fileNameLength,C);y.extraFields=[];var v=0;while(v<w.length-3){var B=w.readUInt16LE(v+0);var S=w.readUInt16LE(v+2);var D=v+4;var k=D+S;if(k>w.length)return emitErrorAndAutoClose(u,new Error("extra field length exceeds extra field buffer size"));var F=Q(S);w.copy(F,0,D,k);y.extraFields.push({id:B,data:F});v=k}y.fileComment=u.decodeStrings?decodeBuffer(A,C,C+y.fileCommentLength,E):A.slice(C,C+y.fileCommentLength);y.comment=y.fileComment;u.readEntryCursor+=A.length;u.entriesRead+=1;if(y.uncompressedSize===4294967295||y.compressedSize===4294967295||y.relativeOffsetOfLocalHeader===4294967295){var R=null;for(var v=0;v<y.extraFields.length;v++){var _=y.extraFields[v];if(_.id===1){R=_.data;break}}if(R==null){return emitErrorAndAutoClose(u,new Error("expected zip64 extended information extra field"))}var P=0;if(y.uncompressedSize===4294967295){if(P+8>R.length){return emitErrorAndAutoClose(u,new Error("zip64 extended information extra field does not include uncompressed size"))}y.uncompressedSize=readUInt64LE(R,P);P+=8}if(y.compressedSize===4294967295){if(P+8>R.length){return emitErrorAndAutoClose(u,new Error("zip64 extended information extra field does not include compressed size"))}y.compressedSize=readUInt64LE(R,P);P+=8}if(y.relativeOffsetOfLocalHeader===4294967295){if(P+8>R.length){return emitErrorAndAutoClose(u,new Error("zip64 extended information extra field does not include relative header offset"))}y.relativeOffsetOfLocalHeader=readUInt64LE(R,P);P+=8}}if(u.decodeStrings){for(var v=0;v<y.extraFields.length;v++){var _=y.extraFields[v];if(_.id===28789){if(_.data.length<6){continue}if(_.data.readUInt8(0)!==1){continue}var O=_.data.readUInt32LE(1);if(I.unsigned(A.slice(0,y.fileNameLength))!==O){continue}y.fileName=decodeBuffer(_.data,5,_.data.length,true);break}}}if(u.validateEntrySizes&&y.compressionMethod===0){var U=y.uncompressedSize;if(y.isEncrypted()){U+=12}if(y.compressedSize!==U){var H="compressed/uncompressed size mismatch for stored file: "+y.compressedSize+" != "+y.uncompressedSize;return emitErrorAndAutoClose(u,new Error(H))}}if(u.decodeStrings){if(!u.strictFileNames){y.fileName=y.fileName.replace(/\\/g,"/")}var G=validateFileName(y.fileName,u.validateFileNameOptions);if(G!=null)return emitErrorAndAutoClose(u,new Error(G))}u.emit("entry",y);if(!u.lazyEntries)u._readEntry()}))}))};ZipFile.prototype.openReadStream=function(u,A,p){var y=this;var C=0;var I=u.compressedSize;if(p==null){p=A;A={}}else{if(A.decrypt!=null){if(!u.isEncrypted()){throw new Error("options.decrypt can only be specified for encrypted entries")}if(A.decrypt!==false)throw new Error("invalid options.decrypt value: "+A.decrypt);if(u.isCompressed()){if(A.decompress!==false)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(A.decompress!=null){if(!u.isCompressed()){throw new Error("options.decompress can only be specified for compressed entries")}if(!(A.decompress===false||A.decompress===true)){throw new Error("invalid options.decompress value: "+A.decompress)}}if(A.start!=null||A.end!=null){if(u.isCompressed()&&A.decompress!==false){throw new Error("start/end range not allowed for compressed entry without options.decompress === false")}if(u.isEncrypted()&&A.decrypt!==false){throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}}if(A.start!=null){C=A.start;if(C<0)throw new Error("options.start < 0");if(C>u.compressedSize)throw new Error("options.start > entry.compressedSize")}if(A.end!=null){I=A.end;if(I<0)throw new Error("options.end < 0");if(I>u.compressedSize)throw new Error("options.end > entry.compressedSize");if(I<C)throw new Error("options.end < options.start")}}if(!y.isOpen)return p(new Error("closed"));if(u.isEncrypted()){if(A.decrypt!==false)return p(new Error("entry is encrypted, and options.decrypt !== false"))}y.reader.ref();var w=Q(30);readAndAssertNoEof(y.reader,w,0,w.length,u.relativeOffsetOfLocalHeader,(function(v){try{if(v)return p(v);var B=w.readUInt32LE(0);if(B!==67324752){return p(new Error("invalid local file header signature: 0x"+B.toString(16)))}var S=w.readUInt16LE(26);var D=w.readUInt16LE(28);var k=u.relativeOffsetOfLocalHeader+w.length+S+D;var Q;if(u.compressionMethod===0){Q=false}else if(u.compressionMethod===8){Q=A.decompress!=null?A.decompress:true}else{return p(new Error("unsupported compression method: "+u.compressionMethod))}var F=k;var R=F+u.compressedSize;if(u.compressedSize!==0){if(R>y.fileSize){return p(new Error("file data overflows file bounds: "+F+" + "+u.compressedSize+" > "+y.fileSize))}}var _=y.reader.createReadStream({start:F+C,end:F+I});var P=_;if(Q){var O=false;var U=E.createInflateRaw();_.on("error",(function(u){setImmediate((function(){if(!O)U.emit("error",u)}))}));_.pipe(U);if(y.validateEntrySizes){P=new AssertByteCountStream(u.uncompressedSize);U.on("error",(function(u){setImmediate((function(){if(!O)P.emit("error",u)}))}));U.pipe(P)}else{P=U}P.destroy=function(){O=true;if(U!==P)U.unpipe(P);_.unpipe(U);_.destroy()}}p(null,P)}finally{y.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(u,A){var p=u&31;var y=(u>>5&15)-1;var E=(u>>9&127)+1980;var C=0;var I=(A&31)*2;var w=A>>5&63;var v=A>>11&31;return new Date(E,y,p,v,w,I,C)}function validateFileName(u){if(u.indexOf("\\")!==-1){return"invalid characters in fileName: "+u}if(/^[a-zA-Z]:/.test(u)||/^\//.test(u)){return"absolute path: "+u}if(u.split("/").indexOf("..")!==-1){return"invalid relative path: "+u}return null}function readAndAssertNoEof(u,A,p,y,E,C){if(y===0){return setImmediate((function(){C(null,Q(0))}))}u.read(A,p,y,E,(function(u,A){if(u)return C(u);if(A<y){return C(new Error("unexpected EOF"))}C()}))}w.inherits(AssertByteCountStream,B);function AssertByteCountStream(u){B.call(this);this.actualByteCount=0;this.expectedByteCount=u}AssertByteCountStream.prototype._transform=function(u,A,p){this.actualByteCount+=u.length;if(this.actualByteCount>this.expectedByteCount){var y="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return p(new Error(y))}p(null,u)};AssertByteCountStream.prototype._flush=function(u){if(this.actualByteCount<this.expectedByteCount){var A="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return u(new Error(A))}u()};w.inherits(RandomAccessReader,v);function RandomAccessReader(){v.call(this);this.refCount=0}RandomAccessReader.prototype.ref=function(){this.refCount+=1};RandomAccessReader.prototype.unref=function(){var u=this;u.refCount-=1;if(u.refCount>0)return;if(u.refCount<0)throw new Error("invalid unref");u.close(onCloseDone);function onCloseDone(A){if(A)return u.emit("error",A);u.emit("close")}};RandomAccessReader.prototype.createReadStream=function(u){var A=u.start;var p=u.end;if(A===p){var y=new S;setImmediate((function(){y.end()}));return y}var E=this._readStreamForRange(A,p);var C=false;var I=new RefUnrefFilter(this);E.on("error",(function(u){setImmediate((function(){if(!C)I.emit("error",u)}))}));I.destroy=function(){E.unpipe(I);I.unref();E.destroy()};var w=new AssertByteCountStream(p-A);I.on("error",(function(u){setImmediate((function(){if(!C)w.emit("error",u)}))}));w.destroy=function(){C=true;I.unpipe(w);I.destroy()};return E.pipe(I).pipe(w)};RandomAccessReader.prototype._readStreamForRange=function(u,A){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(u,A,p,y,E){var C=this.createReadStream({start:y,end:y+p});var I=new D;var w=0;I._write=function(p,y,E){p.copy(u,A+w,0,p.length);w+=p.length;E()};I.on("finish",E);C.on("error",(function(u){E(u)}));C.pipe(I)};RandomAccessReader.prototype.close=function(u){setImmediate(u)};w.inherits(RefUnrefFilter,S);function RefUnrefFilter(u){S.call(this);this.context=u;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(u){this.unref();u()};RefUnrefFilter.prototype.unref=function(u){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var k="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(u,A,p,y){if(y){return u.toString("utf8",A,p)}else{var E="";for(var C=A;C<p;C++){E+=k[u[C]]}return E}}function readUInt64LE(u,A){var p=u.readUInt32LE(A);var y=u.readUInt32LE(A+4);return y*4294967296+p}var Q;if(typeof Buffer.allocUnsafe==="function"){Q=function(u){return Buffer.allocUnsafe(u)}}else{Q=function(u){return new Buffer(u)}}function defaultCallback(u){if(u)throw u}},5983:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{q:()=>App});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(6256);var B=p(1184);var S=p(9402);var D=p(5420);var k=p(7765);var Q=p(7208);var F=p(2618);var R=p(3746);var _=p(3425);var P=u([w,v,B,S,D,k,Q,R,_]);[w,v,B,S,D,k,Q,R,_]=P.then?(await P)():P;const App=({autonomous:u=false})=>{const{coreState:A,coreViewModel:p,agentStatus:y,isAutonomous:I,toggleAutonomous:P,pendingShellCommand:O,approveShellCommand:U,rejectShellCommand:H,approveDiff:G,rejectDiff:j,submitUserInput:$,searchFiles:q,activeShellCommand:K,handleShellCompletion:J,childProcess:ee,sendInputToShell:te,inputText:ne,setInputText:re,isShellActive:se,setIsShellActive:ie,cancelCurrentInteraction:oe}=(0,F.f)({autonomous:u});const[ae,le]=(0,C.useState)(false);const[ce,ue]=(0,C.useState)(false);(0,w.Ge)(((u,A)=>{if(A.ctrl&&(u==="t"||u==="T")||u===""){P();return}if(se){if(A.ctrl&&u==="c"){te("");return}if(A.return){te("\n");return}if(A.backspace){te("\b");return}if(u){te(u);return}return}if(A.escape&&y.isVisible){oe();return}if(A.ctrl&&u==="c"){if(ce){process.exit(0)}else{ue(true)}}else{ue(false)}}));const handleSubmit=(u,A)=>{$(u,A)};(0,C.useEffect)((()=>{if(K){ie(true)}else{ie(false)}}),[K]);const de=!p.activeDiffReview&&!O&&!A.isBootstrapping&&!y.isVisible;const fe=A.bootstrapFinished?p.staticMessages.filter((u=>!u.isBootstrap)):p.staticMessages;return(0,E.jsxs)(w.az,{flexDirection:"column",width:"100%",height:"100%",children:[!A.bootstrapFinished?(0,E.jsx)(_.A,{status:A.connectionStatus,isBootstrapping:A.isBootstrapping}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(B.s,{messages:fe,liveAgentMessage:p.liveAgentMessage,activeShellRun:p.activeShellRun,activeDiffReview:p.activeDiffReview,onShellComplete:J,childProcess:ee,sendInputToShell:te,onApproveDiff:G,onRejectDiff:j}),O&&(0,E.jsx)(Q.A,{command:O.parameters.command,onApprove:U,onReject:H}),y.isVisible&&(0,E.jsx)(v.A,{isVisible:y.isVisible,text:y.text}),ae&&(0,E.jsx)(R.A,{}),(0,E.jsx)(k.A,{isActive:de,isShellActive:se,isAutonomous:I,onSubmit:handleSubmit,searchFiles:q,value:ne,onChange:re,setShowEscapeClear:le})]}),(0,E.jsx)(D.A,{isAutonomous:I}),ce&&(0,E.jsx)(S.A,{})]})};y()}catch(u){y(u)}}))},3352:(u,A,p)=>{p.a(u,(async(u,A)=>{try{var y=p(9790);var E=p(5184);var C=p(4302);var I=p(5983);var w=p(786);var v=p(6878);var B=u([E,I]);[E,I]=B.then?(await B)():B;const S=(0,C.A)(`\n\tUsage\n\t $ stk-codegen\n\n\tOptions\n\t --autonomous Run in autonomous mode\n`,{importMeta:import.meta,flags:{autonomous:{type:"boolean",default:false}}});const startCli=async u=>{await(0,w.x)();const restoreTerminal=()=>{if(process.stdin.isTTY){process.stdin.setRawMode(false)}};if(process.stdin.isTTY){process.stdin.setRawMode(true)}const A=process.stdout.isTTY&&process.env["STK_CODEGEN_ALT_BUFFER"]!=="0";const p=(0,E.XX)((0,y.jsx)(I.q,{autonomous:u.autonomous}),{exitOnCtrlC:false,maxFps:45,incrementalRendering:v.$.ENABLE_INCREMENTAL_RENDERING});try{await p.waitUntilExit()}finally{restoreTerminal();process.exit(0)}};startCli(S.flags);A()}catch(u){A(u)}}))},6256:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(9930);var w=u([C,I]);[C,I]=w.then?(await w)():w;const AgentStatus=({isVisible:u,text:A="Agent is thinking..."})=>{if(!u){return null}return(0,E.jsxs)(C.az,{borderColor:"#800020",children:[(0,E.jsx)(I.A,{type:"dots"}),(0,E.jsx)(C.az,{marginLeft:1,children:(0,E.jsxs)(C.EY,{color:"#ff8080",children:[A," (esc to cancel)"]})})]})};const v=AgentStatus;y()}catch(u){y(u)}}))},3425:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(9930);var w=u([C,I]);[C,I]=w.then?(await w)():w;const BootstrapStatus=({status:u,isBootstrapping:A})=>{let p="";if(u==="connecting"){p="Conectando ao servidor..."}else if(A){p="Carregando contexto do projeto. Isso pode levar alguns segundos..."}return(0,E.jsx)(C.az,{flexDirection:"column",alignItems:"center",paddingY:1,children:(0,E.jsx)(C.az,{children:(0,E.jsxs)(C.EY,{children:[(0,E.jsx)(I.A,{type:"dots"}),(0,E.jsx)(C.EY,{children:" "}),p]})})})};const v=BootstrapStatus;y()}catch(u){y(u)}}))},1184:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{s:()=>Conversation});var E=p(9790);var C=p(5184);var I=p(727);var w=p(3480);var v=p(313);var B=p(6183);var S=p(2113);var D=u([C,I,w,v,B,S]);[C,I,w,v,B,S]=D.then?(await D)():D;const renderStaticMessage=(u,A)=>{if(u.role==="tool_execution"){return(0,E.jsx)(S.A,{toolName:u.toolName,toolParams:u.toolParams,status:u.status},u.id)}return(0,E.jsx)(w.e,{message:{id:u.id,sender:u.role,text:u.text,status:"completed",highlightedBlock:u.highlightedBlock},activeShellCommand:undefined,childProcess:null,handleShellCompletion:A},u.id)};const LiveAgentMessageView=({liveAgentMessage:u,onShellComplete:A})=>(0,E.jsx)(w.e,{message:{id:u.id,sender:u.role,text:u.text,status:"running",stream:{status:"streaming"},highlightedBlock:u.highlightedBlock},activeShellCommand:undefined,childProcess:null,handleShellCompletion:A},u.id);const Conversation=({messages:u,liveAgentMessage:A,activeShellRun:p,activeDiffReview:y,onShellComplete:w,childProcess:S,onApproveDiff:D,onRejectDiff:k})=>(0,E.jsxs)(I.P,{children:[(0,E.jsx)(C.jC,{items:u,children:u=>renderStaticMessage(u,w)}),A&&(0,E.jsx)(LiveAgentMessageView,{liveAgentMessage:A,onShellComplete:w}),p&&(0,E.jsx)(v.A,{command:p.command,onComplete:w,childProcess:S,coreShellRun:p}),y&&(0,E.jsx)(B.Ay,{toolName:y.toolName,toolParams:y.toolParams,oldContent:y.oldContent,newContent:y.newContent,onApprove:D,onReject:k,isCompleted:false,coreDiffReview:y})]});y()}catch(u){y(u)}}))},6183:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{Ay:()=>F});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(4104);var B=p(4536);var S=p(4378);var D=u([w]);w=(D.then?(await D)():D)[0];const k=500;const Q=3;const normalizeContent=u=>u.replace(/\r\n/g,"\n").replace(/\r/g,"\n");const getTerminalColumns=()=>{const u=process.stdout;if(u&&typeof u.columns==="number"&&u.columns>0){return u.columns}return 80};const wrapLineToWidth=(u,A)=>{const p=u.replace(/\t/g," ");if(p.length<=A){return[p]}const y=[];for(let u=0;u<p.length;u+=A){y.push(p.slice(u,u+A))}return y.length?y:[""]};const DiffDecisionHint=()=>(0,E.jsx)(w.az,{marginTop:1,children:(0,E.jsxs)(w.EY,{children:["Press ","<Enter>"," to ",(0,E.jsx)(w.EY,{color:"green",children:"Accept"})," or 'r' to"," ",(0,E.jsx)(w.EY,{color:"red",children:"Reject"}),"."]})});const DiffViewStatic=({oldContent:u,newContent:A,filePath:p,toolName:y,toolParams:I,isCompleted:B,action:D,maxVisibleLines:F})=>{const R=(0,C.useMemo)((()=>normalizeContent(u)),[u]);const _=(0,C.useMemo)((()=>normalizeContent(A)),[A]);const P=(0,C.useMemo)((()=>v.Pp(R,_)),[R,_]);const O=(0,C.useMemo)((()=>{const u=[];let A=1;let p=1;P.forEach((y=>{const E=y.value.replace(/\n$/,"");const C=E===""?[""]:E.split("\n");C.forEach((E=>{let C="unchanged";let I=null;let w=null;if(y.added){C="added";w=p++}else if(y.removed){C="removed";I=A++}else{C="unchanged";I=A++;w=p++}u.push({index:u.length,type:C,text:E,oldLineNumber:I,newLineNumber:w})}))}));return u}),[P]);const U=(0,C.useMemo)((()=>{const u=new Array(O.length).fill(false);const A=[];O.forEach(((p,y)=>{if(p.type==="added"||p.type==="removed"){u[y]=true;A.push(y)}}));A.forEach((A=>{const p=Math.max(0,A-Q);const y=Math.min(O.length-1,A+Q);for(let A=p;A<=y;A++){u[A]=true}}));return u}),[O]);const H=D==="accept"?"Changes accepted":"Changes rejected";const G=D==="accept"?"green":"red";const j=y?(0,S.M)(y,I):p;const $=getTerminalColumns();const q=8;const K=Math.max($-q-4,20);const J=F??k;if(R===_&&!B){return(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,marginBottom:1,children:[(0,E.jsxs)(w.EY,{bold:true,children:["File: ",j]}),(0,E.jsx)(w.EY,{children:"No changes detected. The file content will remain the same unless you edit it."})]})}return(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,marginBottom:1,children:[(0,E.jsxs)(w.EY,{bold:true,children:["File: ",j]}),B?(0,E.jsxs)(w.EY,{color:G,children:["4 ",H]}):(0,E.jsx)(w.EY,{bold:true,children:"Review Changes:"}),(0,E.jsx)(w.az,{flexDirection:"column",marginTop:1,children:(()=>{const u=[];let A=0;let p=false;for(let y=0;y<O.length;y++){if(p)break;if(!U[y])continue;const C=O[y];if(!C)continue;const I=C.type==="added"?C.newLineNumber:C.type==="removed"?C.oldLineNumber:C.newLineNumber;let v=" ";let B="grey";if(C.type==="added"){v="+";B="green"}else if(C.type==="removed"){v="-";B="red"}const S=wrapLineToWidth(C.text,K);for(let C=0;C<S.length;C++){if(A>=J){p=true;break}const D=S[C];const k=C===0;const Q=`${y}-${C}`;u.push((0,E.jsxs)(w.az,{flexDirection:"row",children:[(0,E.jsxs)(w.EY,{color:"gray",children:[k&&I!==null&&I!==undefined?String(I).padStart(4):" "," "]}),(0,E.jsxs)(w.EY,{color:B,children:[k?v:" "," ",D]})]},Q));A++}}if(p){const p=O.length;const y=p-A;u.push((0,E.jsx)(w.az,{marginTop:1,children:!B&&F!=null?(0,E.jsxs)(w.EY,{color:"yellow",children:["A visualização deste arquivo foi truncada para limitar a altura da tela. Restam aproximadamente ",y," ","linha(s) não exibidas. Pressione Ctrl+S para ver o conteúdo completo em modo estático."]}):(0,E.jsxs)(w.EY,{color:"yellow",children:["Diff truncado para ",J," linhas para evitar lentidão e flickering. ",y," linha(s) adicional(is) não estão sendo exibidas."]})},"truncated"))}return u})()})]})};const DiffView=({oldContent:u,newContent:A,filePath:p,toolName:y,toolParams:C,isCompleted:I,action:v,maxVisibleLines:S,coreDiffReview:D,onApprove:k,onReject:Q})=>{const F=D?D.status!=="pending":I;(0,w.Ge)(((u,A)=>{if(A.return){k()}if(u==="r"){Q()}}),{isActive:!F});const{diffReviewHeight:R}=(0,B.SB)();const _=!F&&S==null?R:S;return(0,E.jsxs)(w.az,{flexDirection:"column",children:[(0,E.jsx)(DiffViewStatic,{oldContent:u,newContent:A,filePath:p,toolName:y,toolParams:C,isCompleted:F,action:v,maxVisibleLines:_}),!F&&(0,E.jsx)(DiffDecisionHint,{})]})};const F=DiffView;y()}catch(u){y(u)}}))},3746:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const EscapeClearIndicator=()=>(0,E.jsx)(C.az,{children:(0,E.jsx)(C.EY,{color:"gray",children:"Press ESC again to clear."})});const w=EscapeClearIndicator;y()}catch(u){y(u)}}))},9402:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const ExitIndicator=()=>(0,E.jsx)(C.az,{children:(0,E.jsx)(C.EY,{color:"yellow",children:"Press Ctrl+C again to exit"})});const w=ExitIndicator;y()}catch(u){y(u)}}))},5420:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(4953);var w=u([C]);C=(w.then?(await w)():w)[0];const Footer=({isAutonomous:u=false})=>{const{cwd:A,branch:p}=(0,I.q)();const y=u?"AUTO":"APPROVAL";const w=u?"yellow":"gray";return(0,E.jsxs)(C.az,{width:"100%",justifyContent:"space-between",children:[(0,E.jsxs)(C.EY,{children:[(0,E.jsx)(C.EY,{color:"green",children:A}),p&&(0,E.jsxs)(C.EY,{color:"gray",children:[" (",p,")"]})]}),(0,E.jsx)(C.EY,{color:w,children:y})]})};const v=Footer;y()}catch(u){y(u)}}))},7765:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>Q});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(4760);var B=p(1096);var S=p(3345);var D=p(1196);var k=u([w]);w=(k.then?(await k)():k)[0];const Input=({value:u,onChange:A,onSubmit:p,searchFiles:y,isShellActive:I=false,setShowEscapeClear:k,isActive:Q,isAutonomous:F=false})=>{const[R,_]=(0,C.useState)(new v.a(u));const[P,O]=(0,C.useState)([]);const[U,H]=(0,C.useState)([]);const[G,j]=(0,C.useState)(1);(0,C.useEffect)((()=>{_((A=>{if(A.value===u)return A;return new v.a(u)}))}),[u]);const[$,q]=(0,C.useState)(-1);const[K,J]=(0,C.useState)(null);const ee=(0,S.P)();const[te,ne]=(0,C.useState)(null);(0,C.useEffect)((()=>{const fetchSuggestions=async()=>{const u=R.value;if(u.startsWith("/")){J("magic");const A=u.slice(1);const p=ee.filter((u=>u.startsWith(A))).slice(0,5);O(p);q(p.length>0?0:-1)}else if(u.includes("@")){J("file");const A=u.lastIndexOf("@");const p=u.substring(A+1);if(p.length>0){const u=await y(`**/*${p}*`,{ignore:["**/node_modules/**","**/.git/**","**/dist/**"]});O(u.slice(0,5));q(u.length>0?0:-1)}else{O([])}}else{J(null);O([])}};fetchSuggestions()}),[R.value,y,ee]);(0,w.Ge)(((u,y)=>{if(process.env["STK_DEBUG_INPUT"]==="1"){console.error("[STK_DEBUG_INPUT]",{rawInput:u,key:y})}const E=R.clone();let C=false;const I=typeof u==="string"&&!y.return&&(u.length>1||u.includes("\n")||u.includes("\r"));if(y.escape){if(te){clearTimeout(te);ne(null);k(false);_(new v.a(""));O([]);q(-1);H([]);j(1)}else{k(true);const u=setTimeout((()=>{ne(null);k(false)}),800);ne(u)}return}if(P.length>0){if(y.upArrow){q((u=>(u-1+P.length)%P.length));return}if(y.downArrow){q((u=>(u+1)%P.length));return}if(y.tab||y.return){const u=P[$>-1?$:0];if(u){let A="";if(K==="magic"){A=`/${u}`}else if(K==="file"){const p=R.value.lastIndexOf("@");A=R.value.substring(0,p+1)+u+" "}_(new v.a(A));O([]);q(-1);J(null)}return}}if(y.meta){if(u==="f")E.moveCursorWordRight();else if(u==="b")E.moveCursorWordLeft()}else if(y.ctrl&&(u==="v"||u==="")){(async()=>{const u=await(0,D.F)();if(!u){return}H((A=>{const p=G;const y=[...A,{id:p,base64:u.base64,mimeType:u.mimeType}];return y}));const p=`[IMG#${G}]`;const y=R.clone();y.insertText(p);_(y);A(y.value);j((u=>u+1))})();return}else if(y.ctrl&&u==="j"){E.insert("\n");C=true}else if(y.ctrl){if(u==="a")E.moveCursorToStart();else if(u==="e")E.moveCursorToEnd()}else if(y.leftArrow)E.moveCursorLeft();else if(y.rightArrow)E.moveCursorRight();else if((0,B.g)(y)){const u=E.value;const p=E.cursorPosition;const y=u.slice(0,p);const I=y.match(/\[IMG#(\d+)\]$/);if(I){const y=I[0].length;const E=p-y;const w=u.slice(0,E)+u.slice(p);const B=new v.a(w);B.moveCursorToStart();for(let u=0;u<E;u++)B.moveCursorRight();H((u=>u.filter((u=>u.id!==Number(I[1])))));_(B);A(B.value);C=false;return}E.backspace();C=true}else if((0,B.O)()){const u=E.value;const p=E.cursorPosition;const y=u.slice(p);const I=y.match(/^\[IMG#(\d+)\]/);if(I){const y=I[0].length;const E=u.slice(0,p)+u.slice(p+y);const w=new v.a(E);w.moveCursorToStart();for(let u=0;u<p;u++)w.moveCursorRight();H((u=>u.filter((u=>u.id!==Number(I[1])))));_(w);A(w.value);C=false;return}E.delete();C=true}else if(I&&u){const A=u.replace(/\r\n/g,"\n").replace(/\r/g,"\n");E.insertText(A);C=true}else if(y.return&&y.shift){E.insert("\n");C=true}else if(y.return){const u=U.length>0?{images:U.map((u=>({base64:u.base64,mimeType:u.mimeType})))}:undefined;p(R.value,u);if(R.value!==""){_(new v.a(""))}H([]);j(1);return}else if(u){for(const A of u){E.insert(A)}C=true}if(C){if(I){O([]);q(-1);J(null)}_(E);A(E.value)}else{_(E)}}),{isActive:Q});const CustomTextInput=({buffer:u})=>{const A=u.value;const p=u.cursorPosition;const y=A.slice(0,p);const C=A.slice(p,p+1);const I=A.slice(p+1);if(C==="\n"){return(0,E.jsxs)(w.EY,{children:[y,(0,E.jsx)(w.EY,{inverse:true,children:" "}),"",I]})}const v=C||" ";return(0,E.jsxs)(w.EY,{children:[y,(0,E.jsx)(w.EY,{inverse:true,children:v}),I]})};return(0,E.jsxs)(w.az,{flexDirection:"column",children:[P.length>0&&(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"single",paddingX:1,children:[(0,E.jsx)(w.EY,{bold:true,children:"Suggestions"}),P.map(((u,A)=>(0,E.jsxs)(w.EY,{color:A===$?"blue":"white",children:[A===$?"> ":" ",u]},u)))]}),(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"single",borderColor:F?"yellow":undefined,paddingX:1,children:[U.length>0&&(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsxs)(w.EY,{color:"green",children:[U.length," imagem(s) anexada(s):"," ",U.map((u=>`[IMG#${u.id}]`)).join(" ")]})}),(0,E.jsxs)(w.az,{flexDirection:"row",children:[(0,E.jsx)(w.az,{marginRight:1,children:(0,E.jsx)(w.EY,{color:I?"yellow":"cyan",children:I?"(shell)$":">"})}),(0,E.jsx)(w.az,{flexGrow:1,children:(0,E.jsx)(CustomTextInput,{buffer:R})})]})]})]})};const Q=I().memo(Input);y()}catch(u){y(u)}}))},727:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{P:()=>LimitedHeightBox});var E=p(9790);var C=p(5184);var I=p(4536);var w=u([C]);C=(w.then?(await w)():w)[0];const LimitedHeightBox=({maxRatio:u=.6,minLines:A=5,children:p,...y})=>{(0,I.SB)();return(0,E.jsx)(C.az,{flexDirection:"column",...y,children:p})};var v=null&&LimitedHeightBox;y()}catch(u){y(u)}}))},3480:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{e:()=>S});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(5183);var B=u([w]);w=(B.then?(await B)():B)[0];const CodeBlock=({content:u,language:A})=>(0,E.jsxs)(w.az,{flexDirection:"column",marginBottom:1,borderStyle:"round",borderColor:"cyan",children:[A&&(0,E.jsx)(w.az,{paddingX:1,paddingTop:0,paddingBottom:0,children:(0,E.jsx)(w.EY,{color:"cyanBright",children:A})}),(0,E.jsx)(w.az,{paddingX:1,paddingBottom:0,paddingTop:A?0:0,children:(0,E.jsx)(w.EY,{children:u})})]});const renderInlineAgentText=u=>{const A=(0,v.y)(u??"");if(!A.length){return(0,E.jsx)(w.EY,{children:u})}return(0,E.jsx)(w.EY,{children:A.map(((u,A)=>u.type==="code"?(0,E.jsx)(w.EY,{color:"#ff7bda",children:u.content},`code-${A}`):(0,E.jsx)(w.EY,{children:u.content},`text-${A}`)))})};const Message=({message:u,activeShellCommand:A,childProcess:p,handleShellCompletion:y,context:C="live"})=>{if(u.sender==="user"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsxs)(w.EY,{color:"yellowBright",children:["> ",u.text]})})}if(u.sender==="agent_thought"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsx)(w.EY,{color:"gray",italic:true,children:u.text})})}if(u.sender==="agent"){if(process.env["STK_DEBUG_AGENT_STREAM"]==="1"){console.log("[agent-render]",JSON.stringify(u.text))}if(u.highlightedBlock){return(0,E.jsx)(CodeBlock,{content:u.highlightedBlock.content,language:u.highlightedBlock.language})}return(0,E.jsx)(w.az,{marginBottom:1,children:renderInlineAgentText(u.text)})}if(u.sender==="agent_error"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsx)(w.EY,{color:"red",children:u.text})})}if(u.sender==="system"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsx)(w.EY,{color:"gray",children:u.text})})}if(u.sender==="tool_execution"){return null}return null};const S=I().memo(Message);y()}catch(u){y(u)}}))},7208:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const ShellConfirmation=({command:u,onApprove:A,onReject:p})=>{(0,C.Ge)(((u,y)=>{if(u.toLowerCase()==="y"){A()}else if(u.toLowerCase()==="n"){p()}}));return(0,E.jsxs)(C.az,{flexDirection:"column",padding:1,borderColor:"yellow",borderStyle:"round",children:[(0,E.jsx)(C.EY,{children:"The agent wants to run the following shell command:"}),(0,E.jsx)(C.az,{marginTop:1,paddingX:1,borderStyle:"round",borderColor:"gray",children:(0,E.jsx)(C.EY,{children:u})}),(0,E.jsx)(C.az,{marginTop:1,children:(0,E.jsx)(C.EY,{color:"yellow",children:"Do you want to run this command? (y/n)"})})]})};const w=ShellConfirmation;y()}catch(u){y(u)}}))},313:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const ShellExecution=({command:u,childProcess:A,onComplete:p,coreShellRun:y})=>{const I=y?.status??"running";const w=y?.visibleOutput??[y?.stdout,y?.stderr].filter(Boolean).join("\n");const v=w?w.split("\n"):[];const B=y?.isVisuallyTruncated&&y.visibleLinesCount!=null&&y.totalLines!=null;return(0,E.jsxs)(C.az,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,children:[(0,E.jsxs)(C.EY,{color:"white",children:["$ ",u]}),(0,E.jsxs)(C.EY,{color:"gray",children:["Status: ",I]}),B&&(0,E.jsxs)(C.EY,{color:"yellow",children:["A saída deste comando é muito longa; mostrando últimas"," ",y.visibleLinesCount," de ",y.totalLines," ","linhas."]}),v.length>0?(0,E.jsx)(E.Fragment,{children:v.map(((u,A)=>(0,E.jsx)(C.EY,{children:u},A)))}):(0,E.jsx)(C.EY,{color:"gray",children:"Aguardando saída do comando..."})]})};const w=ShellExecution;y()}catch(u){y(u)}}))},2113:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(4378);var w=u([C]);C=(w.then?(await w)():w)[0];const ToolExecution=({toolName:u,toolParams:A,status:p})=>{const y=p==="finished"||p==="completed";const w=y?"✓":"·";const v=y?"green":"yellow";const B=(0,I.M)(u,A);return(0,E.jsx)(C.az,{children:(0,E.jsxs)(C.EY,{color:"gray",children:[(0,E.jsx)(C.EY,{color:v,children:w})," ",B]})})};const v=ToolExecution;y()}catch(u){y(u)}}))},6878:(u,A,p)=>{p.d(A,{$:()=>y});class Config{WORKSPACE_DIR;BACKEND_URL;CURRENT_VERSION;DISABLE_RIPGREP;ENABLE_INCREMENTAL_RENDERING;constructor(){this.WORKSPACE_DIR=process.env["CLI_WORKSPACE_DIR"]||process.cwd();this.BACKEND_URL=process.env["CLI_BACKEND_URL"]||"https://labs-codegen-api.dev.stackspot.com";this.CURRENT_VERSION="1.1.0";this.DISABLE_RIPGREP=(process.env["CLI_DISABLE_RIPGREP"]||"").toLowerCase()==="true";this.ENABLE_INCREMENTAL_RENDERING=process.env["ENABLE_INCREMENTAL_RENDERING"]==="true"||false}}const y=new Config},3646:(u,A,p)=>{p.d(A,{R:()=>E,h:()=>reduceCoreState});var y=p(6878);const E={messages:[],shellRuns:[],diffReviews:[],agentStatus:{label:"Idle",phase:"idle"},stream:{buffer:"",status:"idle",generationId:undefined},activeGenerationId:undefined,isBootstrapping:false,bootstrapFinished:false,connectionStatus:"disconnected"};const generateId=()=>Math.random().toString(36).slice(2);function reduceCoreState(u,A){switch(A.type){case"USER_SENT_MESSAGE":{const p={id:generateId(),role:"user",text:A.text,createdAt:Date.now(),isFinal:true};return{...u,messages:[...u.messages,p]}}case"AGENT_STREAM_STARTED":{const p={id:A.messageId,role:"agent",text:"",createdAt:Date.now(),isStreaming:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p],stream:{currentMessageId:A.messageId,buffer:"",status:"streaming",generationId:A.generationId},agentStatus:{label:"Thinking…",phase:"streaming"}}}case"AGENT_DELTA_RECEIVED":{const p=1e3;if(u.stream.status!=="streaming"||!u.stream.currentMessageId){const p=generateId();const y={id:p,role:"agent",text:A.delta,createdAt:Date.now(),isStreaming:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,y],stream:{currentMessageId:p,buffer:"",status:"streaming",generationId:A.generationId},agentStatus:{label:"Thinking…",phase:"streaming"}}}const y=u.messages.findIndex((A=>A.id===u.stream.currentMessageId));if(y===-1){const p=generateId();const y={id:p,role:"agent",text:A.delta,createdAt:Date.now(),isStreaming:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,y],stream:{currentMessageId:p,buffer:"",status:"streaming",generationId:A.generationId},agentStatus:{label:"Thinking…",phase:"streaming"}}}const E=u.messages[y];const C=(E.text??"")+A.delta;if(C.length<=p){return{...u,activeGenerationId:A.generationId??u.activeGenerationId,stream:{...u.stream,generationId:A.generationId??u.stream.generationId},messages:u.messages.map(((u,p)=>p===y?{...u,text:C,generationId:A.generationId??u.generationId}:u))}}const I="\n\n";let w=C.lastIndexOf(I);if(w===-1){w=C.lastIndexOf(" ")}if(w===-1||w<p/2){return{...u,activeGenerationId:A.generationId??u.activeGenerationId,stream:{...u.stream,generationId:A.generationId??u.stream.generationId},messages:u.messages.map(((u,p)=>p===y?{...u,text:C,generationId:A.generationId??u.generationId}:u))}}const v=C.slice(0,w);const B=C.slice(w);const S={...E,text:v,isStreaming:false,isFinal:true};const D=generateId();const k={...E,id:D,text:B,generationId:A.generationId??E.generationId};const Q=[...u.messages.slice(0,y),S,...u.messages.slice(y+1),k];return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:Q,stream:{...u.stream,currentMessageId:D,generationId:A.generationId??u.stream.generationId}}}case"AGENT_STREAM_FLUSH":{return u}case"AGENT_STREAM_FINISHED":{const{currentMessageId:p}=u.stream;if(!p){return{...u,activeGenerationId:A.generationId&&u.activeGenerationId===A.generationId?undefined:u.activeGenerationId,stream:{currentMessageId:undefined,buffer:"",status:"finished",generationId:undefined},agentStatus:{label:"Idle",phase:"idle"}}}return{...u,activeGenerationId:A.generationId&&u.activeGenerationId===A.generationId?undefined:u.activeGenerationId,messages:u.messages.map((u=>u.id===p?{...u,isStreaming:false,isFinal:true}:u)),stream:{currentMessageId:undefined,buffer:"",status:"finished",generationId:undefined},agentStatus:{label:"Idle",phase:"idle"}}}case"SHELL_RUN_STARTED":{const p={id:A.runId,command:A.command,status:"running",stdout:"",stderr:"",startedAt:Date.now()};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,shellRuns:[...u.shellRuns,p],agentStatus:{label:`Running shell: ${A.command}`,phase:"running_tool"}}}case"SHELL_OUTPUT_RECEIVED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,shellRuns:u.shellRuns.map((u=>{if(u.id!==A.runId)return u;return{...u,stdout:u.stdout+(A.stdoutDelta??""),stderr:u.stderr+(A.stderrDelta??"")}}))}}case"SHELL_RUN_FINISHED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,shellRuns:u.shellRuns.map((u=>u.id===A.runId?{...u,status:A.exitCode===0?"finished":"error",finishedAt:Date.now()}:u)),agentStatus:{label:"Idle",phase:"idle"}}}case"DIFF_REVIEW_OPENED":{const p={id:A.reviewId,title:A.title,toolName:A.toolName,toolParams:A.toolParams,oldContent:A.oldContent,newContent:A.newContent,status:"pending"};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,diffReviews:[...u.diffReviews,p]}}case"DIFF_REVIEW_RESOLVED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,diffReviews:u.diffReviews.map((u=>u.id===A.reviewId?{...u,status:A.result}:u))}}case"ERROR_OCCURRED":{const p={id:generateId(),role:"agent_error",text:A.message,createdAt:Date.now(),isFinal:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p]}}case"TOOL_RESULT_MESSAGE":{const p={id:generateId(),role:"system",text:A.text,createdAt:Date.now(),isFinal:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p]}}case"TOOL_EXECUTION_STARTED":{const p={id:generateId(),role:"tool_execution",text:"",toolId:A.toolId,toolName:A.toolName,toolParams:A.toolParams,createdAt:Date.now(),isFinal:false,status:"running",isBootstrap:u.isBootstrapping,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p]}}case"TOOL_EXECUTION_FINISHED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:u.messages.map((u=>u.toolId===A.toolId?{...u,status:"finished",isFinal:true,generationId:A.generationId??u.generationId}:u))}}case"TOOL_EXECUTION_ERROR":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:u.messages.map((u=>u.toolId===A.toolId?{...u,status:"error",isFinal:true,text:A.error,generationId:A.generationId??u.generationId}:u))}}case"BOOTSTRAP_STARTED":{return{...u,isBootstrapping:true}}case"BOOTSTRAP_FINISHED":{const A={id:generateId(),role:"system",text:`Contexto do projeto carregado. (CLI v${y.$.CURRENT_VERSION})`,createdAt:Date.now(),isFinal:true};return{...u,isBootstrapping:false,bootstrapFinished:true,messages:[...u.messages,A]}}case"CONNECTION_STATUS_CHANGED":{return{...u,connectionStatus:A.status}}default:return u}}},4953:(u,A,p)=>{p.d(A,{q:()=>useGitInfo});var y=p(9896);var E=p.n(y);var C=p(5317);var I=p.n(C);var w=p(3102);var v=p.n(w);const isGitRepo=()=>{try{(0,C.execSync)("git rev-parse --is-inside-work-tree",{stdio:["ignore","ignore","ignore"]});return true}catch{return false}};const useGitInfo=()=>{const[u,A]=(0,w.useState)("");const[p,y]=(0,w.useState)(false);(0,w.useEffect)((()=>{const getGitBranch=()=>{if(!isGitRepo())return"";try{return(0,C.execSync)("git rev-parse --abbrev-ref HEAD",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch(u){return""}};A(getGitBranch());y(E().existsSync("CODEGEN.md"))}),[]);return{cwd:process.cwd(),branch:u,hasCodegenSpec:p}}},2618:(u,A,p)=>{p.d(A,{f:()=>useAgent});var y=p(1943);var E=p(6928);var C=p.n(E);var I=p(3102);var w=p(6657);var v=p(1910);var B=p(6878);const ReadFile=async u=>{const{file_path:A,offset:p,limit:E}=u;try{const u=C().resolve(B.$.WORKSPACE_DIR,A);let I=await(0,y.readFile)(u,"utf-8");const w=I.split("\n");let v=false;let S;let D;if(p!==undefined&&E!==undefined){D=w.length;const u=p;const A=Math.min(p+E,w.length);I=w.slice(u,A).join("\n");v=A<w.length;S=[u+1,A]}if(v){return{content:`\nIMPORTANT: The file content has been truncated.\nStatus: Showing lines ${S[0]}-${S[1]} of ${D} total lines.\nAction: To read more of the file, you can use the 'offset' and 'limit' parameters in a subsequent 'ReadFile' call. For example, to read the next section of the file, use offset: ${S[1]}.\n\n--- FILE CONTENT (truncated) ---\n${I}`}}return{content:I}}catch(u){return{error:u.message}}};const ReadFolder=async u=>{const{dir_path:A=".",ignore:p}=u;try{const u=C().resolve(B.$.WORKSPACE_DIR,A);const E=await(0,y.readdir)(u,{withFileTypes:true});const I=[];for(const A of E){if(p&&p.some((u=>new RegExp(u).test(A.name)))){continue}const E=C().join(u,A.name);const w=await(0,y.stat)(E);I.push({name:A.name,path:E,isDirectory:A.isDirectory(),size:w.size,modifiedTime:w.mtime})}I.sort(((u,A)=>{if(u.isDirectory&&!A.isDirectory)return-1;if(!u.isDirectory&&A.isDirectory)return 1;return u.name.localeCompare(A.name)}));const w=I.map((u=>`${u.isDirectory?"[DIR] ":""}${u.name}`)).join("\n");return{llmContent:`Directory listing for ${u}:\n${w}`,returnDisplay:`Listed ${I.length} item(s).`}}catch(u){return{error:u.message}}};const Shell=async u=>Promise.resolve({command:u.command,directory:u.dir_path,stdout:"(empty)",stderr:"(This command was executed interactively)",error:"(none)",exitCode:0});const balanced=(u,A,p)=>{const y=u instanceof RegExp?maybeMatch(u,p):u;const E=A instanceof RegExp?maybeMatch(A,p):A;const C=y!==null&&E!=null&&range(y,E,p);return C&&{start:C[0],end:C[1],pre:p.slice(0,C[0]),body:p.slice(C[0]+y.length,C[1]),post:p.slice(C[1]+E.length)}};const maybeMatch=(u,A)=>{const p=A.match(u);return p?p[0]:null};const range=(u,A,p)=>{let y,E,C,I=undefined,w;let v=p.indexOf(u);let B=p.indexOf(A,v+1);let S=v;if(v>=0&&B>0){if(u===A){return[v,B]}y=[];C=p.length;while(S>=0&&!w){if(S===v){y.push(S);v=p.indexOf(u,S+1)}else if(y.length===1){const u=y.pop();if(u!==undefined)w=[u,B]}else{E=y.pop();if(E!==undefined&&E<C){C=E;I=B}B=p.indexOf(A,S+1)}S=v<B&&v>=0?v:B}if(y.length&&I!==undefined){w=[C,I]}}return w};const S="\0SLASH"+Math.random()+"\0";const D="\0OPEN"+Math.random()+"\0";const k="\0CLOSE"+Math.random()+"\0";const Q="\0COMMA"+Math.random()+"\0";const F="\0PERIOD"+Math.random()+"\0";const R=new RegExp(S,"g");const _=new RegExp(D,"g");const P=new RegExp(k,"g");const O=new RegExp(Q,"g");const U=new RegExp(F,"g");const H=/\\\\/g;const G=/\\{/g;const j=/\\}/g;const $=/\\,/g;const q=/\\./g;function numeric(u){return!isNaN(u)?parseInt(u,10):u.charCodeAt(0)}function escapeBraces(u){return u.replace(H,S).replace(G,D).replace(j,k).replace($,Q).replace(q,F)}function unescapeBraces(u){return u.replace(R,"\\").replace(_,"{").replace(P,"}").replace(O,",").replace(U,".")}function parseCommaParts(u){if(!u){return[""]}const A=[];const p=balanced("{","}",u);if(!p){return u.split(",")}const{pre:y,body:E,post:C}=p;const I=y.split(",");I[I.length-1]+="{"+E+"}";const w=parseCommaParts(C);if(C.length){I[I.length-1]+=w.shift();I.push.apply(I,w)}A.push.apply(A,I);return A}function expand(u){if(!u){return[]}if(u.slice(0,2)==="{}"){u="\\{\\}"+u.slice(2)}return expand_(escapeBraces(u),true).map(unescapeBraces)}function embrace(u){return"{"+u+"}"}function isPadded(u){return/^-?0\d/.test(u)}function lte(u,A){return u<=A}function gte(u,A){return u>=A}function expand_(u,A){const p=[];const y=balanced("{","}",u);if(!y)return[u];const E=y.pre;const C=y.post.length?expand_(y.post,false):[""];if(/\$$/.test(y.pre)){for(let u=0;u<C.length;u++){const A=E+"{"+y.body+"}"+C[u];p.push(A)}}else{const I=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(y.body);const w=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(y.body);const v=I||w;const B=y.body.indexOf(",")>=0;if(!v&&!B){if(y.post.match(/,(?!,).*\}/)){u=y.pre+"{"+y.body+k+y.post;return expand_(u)}return[u]}let S;if(v){S=y.body.split(/\.\./)}else{S=parseCommaParts(y.body);if(S.length===1&&S[0]!==undefined){S=expand_(S[0],false).map(embrace);if(S.length===1){return C.map((u=>y.pre+S[0]+u))}}}let D;if(v&&S[0]!==undefined&&S[1]!==undefined){const u=numeric(S[0]);const A=numeric(S[1]);const p=Math.max(S[0].length,S[1].length);let y=S.length===3&&S[2]!==undefined?Math.abs(numeric(S[2])):1;let E=lte;const C=A<u;if(C){y*=-1;E=gte}const I=S.some(isPadded);D=[];for(let C=u;E(C,A);C+=y){let u;if(w){u=String.fromCharCode(C);if(u==="\\"){u=""}}else{u=String(C);if(I){const A=p-u.length;if(A>0){const p=new Array(A+1).join("0");if(C<0){u="-"+p+u.slice(1)}else{u=p+u}}}}D.push(u)}}else{D=[];for(let u=0;u<S.length;u++){D.push.apply(D,expand_(S[u],false))}}for(let u=0;u<D.length;u++){for(let y=0;y<C.length;y++){const I=E+D[u]+C[y];if(!A||v||I){p.push(I)}}}}return p}const K=1024*64;const assertValidPattern=u=>{if(typeof u!=="string"){throw new TypeError("invalid pattern")}if(u.length>K){throw new TypeError("pattern is too long")}};const J={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=u=>u.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=u=>u.join("");const parseClass=(u,A)=>{const p=A;if(u.charAt(p)!=="["){throw new Error("not in a brace expression")}const y=[];const E=[];let C=p+1;let I=false;let w=false;let v=false;let B=false;let S=p;let D="";e:while(C<u.length){const A=u.charAt(C);if((A==="!"||A==="^")&&C===p+1){B=true;C++;continue}if(A==="]"&&I&&!v){S=C+1;break}I=true;if(A==="\\"){if(!v){v=true;C++;continue}}if(A==="["&&!v){for(const[A,[I,v,B]]of Object.entries(J)){if(u.startsWith(A,C)){if(D){return["$.",false,u.length-p,true]}C+=A.length;if(B)E.push(I);else y.push(I);w=w||v;continue e}}}v=false;if(D){if(A>D){y.push(braceEscape(D)+"-"+braceEscape(A))}else if(A===D){y.push(braceEscape(A))}D="";C++;continue}if(u.startsWith("-]",C+1)){y.push(braceEscape(A+"-"));C+=2;continue}if(u.startsWith("-",C+1)){D=A;C+=2;continue}y.push(braceEscape(A));C++}if(S<C){return["",false,0,false]}if(!y.length&&!E.length){return["$.",false,u.length-p,true]}if(E.length===0&&y.length===1&&/^\\?.$/.test(y[0])&&!B){const u=y[0].length===2?y[0].slice(-1):y[0];return[regexpEscape(u),false,S-p,false]}const k="["+(B?"^":"")+rangesToString(y)+"]";const Q="["+(B?"":"^")+rangesToString(E)+"]";const F=y.length&&E.length?"("+k+"|"+Q+")":y.length?k:Q;return[F,w,S-p,true]};const unescape_unescape=(u,{windowsPathsNoEscape:A=false,magicalBraces:p=true}={})=>{if(p){return A?u.replace(/\[([^\/\\])\]/g,"$1"):u.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")}return A?u.replace(/\[([^\/\\{}])\]/g,"$1"):u.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};const ee=new Set(["!","?","+","*","@"]);const isExtglobType=u=>ee.has(u);const te="(?!(?:^|/)\\.\\.?(?:$|/))";const ne="(?!\\.)";const re=new Set(["[","."]);const se=new Set(["..","."]);const ie=new Set("().*{}+?[]^$\\!");const regExpEscape=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const oe="[^/]";const ae=oe+"*?";const le=oe+"+?";class AST{type;#e;#t;#n=false;#r=[];#s;#i;#o;#a=false;#l;#c;#u=false;constructor(u,A,p={}){this.type=u;if(u)this.#t=true;this.#s=A;this.#e=this.#s?this.#s.#e:this;this.#l=this.#e===this?p:this.#e.#l;this.#o=this.#e===this?[]:this.#e.#o;if(u==="!"&&!this.#e.#a)this.#o.push(this);this.#i=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==undefined)return this.#t;for(const u of this.#r){if(typeof u==="string")continue;if(u.type||u.hasMagic)return this.#t=true}return this.#t}toString(){if(this.#c!==undefined)return this.#c;if(!this.type){return this.#c=this.#r.map((u=>String(u))).join("")}else{return this.#c=this.type+"("+this.#r.map((u=>String(u))).join("|")+")"}}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString();this.#a=true;let u;while(u=this.#o.pop()){if(u.type!=="!")continue;let A=u;let p=A.#s;while(p){for(let y=A.#i+1;!p.type&&y<p.#r.length;y++){for(const A of u.#r){if(typeof A==="string"){throw new Error("string part in extglob AST??")}A.copyIn(p.#r[y])}}A=p;p=A.#s}}return this}push(...u){for(const A of u){if(A==="")continue;if(typeof A!=="string"&&!(A instanceof AST&&A.#s===this)){throw new Error("invalid part: "+A)}this.#r.push(A)}}toJSON(){const u=this.type===null?this.#r.slice().map((u=>typeof u==="string"?u:u.toJSON())):[this.type,...this.#r.map((u=>u.toJSON()))];if(this.isStart()&&!this.type)u.unshift([]);if(this.isEnd()&&(this===this.#e||this.#e.#a&&this.#s?.type==="!")){u.push({})}return u}isStart(){if(this.#e===this)return true;if(!this.#s?.isStart())return false;if(this.#i===0)return true;const u=this.#s;for(let A=0;A<this.#i;A++){const p=u.#r[A];if(!(p instanceof AST&&p.type==="!")){return false}}return true}isEnd(){if(this.#e===this)return true;if(this.#s?.type==="!")return true;if(!this.#s?.isEnd())return false;if(!this.type)return this.#s?.isEnd();const u=this.#s?this.#s.#r.length:0;return this.#i===u-1}copyIn(u){if(typeof u==="string")this.push(u);else this.push(u.clone(this))}clone(u){const A=new AST(this.type,u);for(const u of this.#r){A.copyIn(u)}return A}static#f(u,A,p,y){let E=false;let C=false;let I=-1;let w=false;if(A.type===null){let v=p;let B="";while(v<u.length){const p=u.charAt(v++);if(E||p==="\\"){E=!E;B+=p;continue}if(C){if(v===I+1){if(p==="^"||p==="!"){w=true}}else if(p==="]"&&!(v===I+2&&w)){C=false}B+=p;continue}else if(p==="["){C=true;I=v;w=false;B+=p;continue}if(!y.noext&&isExtglobType(p)&&u.charAt(v)==="("){A.push(B);B="";const E=new AST(p,A);v=AST.#f(u,E,v,y);A.push(E);continue}B+=p}A.push(B);return v}let v=p+1;let B=new AST(null,A);const S=[];let D="";while(v<u.length){const p=u.charAt(v++);if(E||p==="\\"){E=!E;D+=p;continue}if(C){if(v===I+1){if(p==="^"||p==="!"){w=true}}else if(p==="]"&&!(v===I+2&&w)){C=false}D+=p;continue}else if(p==="["){C=true;I=v;w=false;D+=p;continue}if(isExtglobType(p)&&u.charAt(v)==="("){B.push(D);D="";const A=new AST(p,B);B.push(A);v=AST.#f(u,A,v,y);continue}if(p==="|"){B.push(D);D="";S.push(B);B=new AST(null,A);continue}if(p===")"){if(D===""&&A.#r.length===0){A.#u=true}B.push(D);D="";A.push(...S,B);return v}D+=p}A.type=null;A.#t=undefined;A.#r=[u.substring(p-1)];return v}static fromGlob(u,A={}){const p=new AST(null,undefined,A);AST.#f(u,p,0,A);return p}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();const u=this.toString();const[A,p,y,E]=this.toRegExpSource();const C=y||this.#t||this.#l.nocase&&!this.#l.nocaseMagicOnly&&u.toUpperCase()!==u.toLowerCase();if(!C){return p}const I=(this.#l.nocase?"i":"")+(E?"u":"");return Object.assign(new RegExp(`^${A}$`,I),{_src:A,_glob:u})}get options(){return this.#l}toRegExpSource(u){const A=u??!!this.#l.dot;if(this.#e===this)this.#d();if(!this.type){const p=this.isStart()&&this.isEnd()&&!this.#r.some((u=>typeof u!=="string"));const y=this.#r.map((A=>{const[y,E,C,I]=typeof A==="string"?AST.#A(A,this.#t,p):A.toRegExpSource(u);this.#t=this.#t||C;this.#n=this.#n||I;return y})).join("");let E="";if(this.isStart()){if(typeof this.#r[0]==="string"){const p=this.#r.length===1&&se.has(this.#r[0]);if(!p){const p=re;const C=A&&p.has(y.charAt(0))||y.startsWith("\\.")&&p.has(y.charAt(2))||y.startsWith("\\.\\.")&&p.has(y.charAt(4));const I=!A&&!u&&p.has(y.charAt(0));E=C?te:I?ne:""}}}let C="";if(this.isEnd()&&this.#e.#a&&this.#s?.type==="!"){C="(?:$|\\/)"}const I=E+y+C;return[I,unescape_unescape(y),this.#t=!!this.#t,this.#n]}const p=this.type==="*"||this.type==="+";const y=this.type==="!"?"(?:(?!(?:":"(?:";let E=this.#h(A);if(this.isStart()&&this.isEnd()&&!E&&this.type!=="!"){const u=this.toString();this.#r=[u];this.type=null;this.#t=undefined;return[u,unescape_unescape(this.toString()),false,false]}let C=!p||u||A||!ne?"":this.#h(true);if(C===E){C=""}if(C){E=`(?:${E})(?:${C})*?`}let I="";if(this.type==="!"&&this.#u){I=(this.isStart()&&!A?ne:"")+le}else{const p=this.type==="!"?"))"+(this.isStart()&&!A&&!u?ne:"")+ae+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&C?")":this.type==="*"&&C?`)?`:`)${this.type}`;I=y+E+p}return[I,unescape_unescape(E),this.#t=!!this.#t,this.#n]}#h(u){return this.#r.map((A=>{if(typeof A==="string"){throw new Error("string type in extglob ast??")}const[p,y,E,C]=A.toRegExpSource(u);this.#n=this.#n||C;return p})).filter((u=>!(this.isStart()&&this.isEnd())||!!u)).join("|")}static#A(u,A,p=false){let y=false;let E="";let C=false;for(let I=0;I<u.length;I++){const w=u.charAt(I);if(y){y=false;E+=(ie.has(w)?"\\":"")+w;continue}if(w==="\\"){if(I===u.length-1){E+="\\\\"}else{y=true}continue}if(w==="["){const[p,y,w,v]=parseClass(u,I);if(w){E+=p;C=C||y;I+=w-1;A=A||v;continue}}if(w==="*"){E+=p&&u==="*"?le:ae;A=true;continue}if(w==="?"){E+=oe;A=true;continue}E+=regExpEscape(w)}return[E,unescape_unescape(u),!!A,C]}}const escape_escape=(u,{windowsPathsNoEscape:A=false,magicalBraces:p=false}={})=>{if(p){return A?u.replace(/[?*()[\]{}]/g,"[$&]"):u.replace(/[?*()[\]\\{}]/g,"\\$&")}return A?u.replace(/[?*()[\]]/g,"[$&]"):u.replace(/[?*()[\]\\]/g,"\\$&")};const minimatch=(u,A,p={})=>{assertValidPattern(A);if(!p.nocomment&&A.charAt(0)==="#"){return false}return new Minimatch(A,p).match(u)};const ce=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=u=>A=>!A.startsWith(".")&&A.endsWith(u);const starDotExtTestDot=u=>A=>A.endsWith(u);const starDotExtTestNocase=u=>{u=u.toLowerCase();return A=>!A.startsWith(".")&&A.toLowerCase().endsWith(u)};const starDotExtTestNocaseDot=u=>{u=u.toLowerCase();return A=>A.toLowerCase().endsWith(u)};const ue=/^\*+\.\*+$/;const starDotStarTest=u=>!u.startsWith(".")&&u.includes(".");const starDotStarTestDot=u=>u!=="."&&u!==".."&&u.includes(".");const de=/^\.\*+$/;const dotStarTest=u=>u!=="."&&u!==".."&&u.startsWith(".");const fe=/^\*+$/;const starTest=u=>u.length!==0&&!u.startsWith(".");const starTestDot=u=>u.length!==0&&u!=="."&&u!=="..";const Ae=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([u,A=""])=>{const p=qmarksTestNoExt([u]);if(!A)return p;A=A.toLowerCase();return u=>p(u)&&u.toLowerCase().endsWith(A)};const qmarksTestNocaseDot=([u,A=""])=>{const p=qmarksTestNoExtDot([u]);if(!A)return p;A=A.toLowerCase();return u=>p(u)&&u.toLowerCase().endsWith(A)};const qmarksTestDot=([u,A=""])=>{const p=qmarksTestNoExtDot([u]);return!A?p:u=>p(u)&&u.endsWith(A)};const qmarksTest=([u,A=""])=>{const p=qmarksTestNoExt([u]);return!A?p:u=>p(u)&&u.endsWith(A)};const qmarksTestNoExt=([u])=>{const A=u.length;return u=>u.length===A&&!u.startsWith(".")};const qmarksTestNoExtDot=([u])=>{const A=u.length;return u=>u.length===A&&u!=="."&&u!==".."};const he=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const pe={win32:{sep:"\\"},posix:{sep:"/"}};const ge=he==="win32"?pe.win32.sep:pe.posix.sep;minimatch.sep=ge;const me=Symbol("globstar **");minimatch.GLOBSTAR=me;const ye="[^/]";const Ee=ye+"*?";const Ce="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const Ie="(?:(?!(?:\\/|^)\\.).)*?";const esm_filter=(u,A={})=>p=>minimatch(p,u,A);minimatch.filter=esm_filter;const ext=(u,A={})=>Object.assign({},u,A);const defaults=u=>{if(!u||typeof u!=="object"||!Object.keys(u).length){return minimatch}const A=minimatch;const m=(p,y,E={})=>A(p,y,ext(u,E));return Object.assign(m,{Minimatch:class Minimatch extends A.Minimatch{constructor(A,p={}){super(A,ext(u,p))}static defaults(p){return A.defaults(ext(u,p)).Minimatch}},AST:class AST extends A.AST{constructor(A,p,y={}){super(A,p,ext(u,y))}static fromGlob(p,y={}){return A.AST.fromGlob(p,ext(u,y))}},unescape:(p,y={})=>A.unescape(p,ext(u,y)),escape:(p,y={})=>A.escape(p,ext(u,y)),filter:(p,y={})=>A.filter(p,ext(u,y)),defaults:p=>A.defaults(ext(u,p)),makeRe:(p,y={})=>A.makeRe(p,ext(u,y)),braceExpand:(p,y={})=>A.braceExpand(p,ext(u,y)),match:(p,y,E={})=>A.match(p,y,ext(u,E)),sep:A.sep,GLOBSTAR:me})};minimatch.defaults=defaults;const braceExpand=(u,A={})=>{assertValidPattern(u);if(A.nobrace||!/\{(?:(?!\{).)*\}/.test(u)){return[u]}return expand(u)};minimatch.braceExpand=braceExpand;const makeRe=(u,A={})=>new Minimatch(u,A).makeRe();minimatch.makeRe=makeRe;const match=(u,A,p={})=>{const y=new Minimatch(A,p);u=u.filter((u=>y.match(u)));if(y.options.nonull&&!u.length){u.push(A)}return u};minimatch.match=match;const be=/[?*]|[+@!]\(.*?\)|\[|\]/;const esm_regExpEscape=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(u,A={}){assertValidPattern(u);A=A||{};this.options=A;this.pattern=u;this.platform=A.platform||he;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!A.windowsPathsNoEscape||A.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!A.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!A.nonegate;this.comment=false;this.empty=false;this.partial=!!A.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=A.windowsNoMagicRoot!==undefined?A.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const u of this.set){for(const A of u){if(typeof A!=="string")return true}}return false}debug(...u){}make(){const u=this.pattern;const A=this.options;if(!A.nocomment&&u.charAt(0)==="#"){this.comment=true;return}if(!u){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(A.debug){this.debug=(...u)=>console.error(...u)}this.debug(this.pattern,this.globSet);const p=this.globSet.map((u=>this.slashSplit(u)));this.globParts=this.preprocess(p);this.debug(this.pattern,this.globParts);let y=this.globParts.map(((u,A,p)=>{if(this.isWindows&&this.windowsNoMagicRoot){const A=u[0]===""&&u[1]===""&&(u[2]==="?"||!be.test(u[2]))&&!be.test(u[3]);const p=/^[a-z]:/i.test(u[0]);if(A){return[...u.slice(0,4),...u.slice(4).map((u=>this.parse(u)))]}else if(p){return[u[0],...u.slice(1).map((u=>this.parse(u)))]}}return u.map((u=>this.parse(u)))}));this.debug(this.pattern,y);this.set=y.filter((u=>u.indexOf(false)===-1));if(this.isWindows){for(let u=0;u<this.set.length;u++){const A=this.set[u];if(A[0]===""&&A[1]===""&&this.globParts[u][2]==="?"&&typeof A[3]==="string"&&/^[a-z]:$/i.test(A[3])){A[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(u){if(this.options.noglobstar){for(let A=0;A<u.length;A++){for(let p=0;p<u[A].length;p++){if(u[A][p]==="**"){u[A][p]="*"}}}}const{optimizationLevel:A=1}=this.options;if(A>=2){u=this.firstPhasePreProcess(u);u=this.secondPhasePreProcess(u)}else if(A>=1){u=this.levelOneOptimize(u)}else{u=this.adjascentGlobstarOptimize(u)}return u}adjascentGlobstarOptimize(u){return u.map((u=>{let A=-1;while(-1!==(A=u.indexOf("**",A+1))){let p=A;while(u[p+1]==="**"){p++}if(p!==A){u.splice(A,p-A)}}return u}))}levelOneOptimize(u){return u.map((u=>{u=u.reduce(((u,A)=>{const p=u[u.length-1];if(A==="**"&&p==="**"){return u}if(A===".."){if(p&&p!==".."&&p!=="."&&p!=="**"){u.pop();return u}}u.push(A);return u}),[]);return u.length===0?[""]:u}))}levelTwoFileOptimize(u){if(!Array.isArray(u)){u=this.slashSplit(u)}let A=false;do{A=false;if(!this.preserveMultipleSlashes){for(let p=1;p<u.length-1;p++){const y=u[p];if(p===1&&y===""&&u[0]==="")continue;if(y==="."||y===""){A=true;u.splice(p,1);p--}}if(u[0]==="."&&u.length===2&&(u[1]==="."||u[1]==="")){A=true;u.pop()}}let p=0;while(-1!==(p=u.indexOf("..",p+1))){const y=u[p-1];if(y&&y!=="."&&y!==".."&&y!=="**"){A=true;u.splice(p-1,2);p-=2}}}while(A);return u.length===0?[""]:u}firstPhasePreProcess(u){let A=false;do{A=false;for(let p of u){let y=-1;while(-1!==(y=p.indexOf("**",y+1))){let E=y;while(p[E+1]==="**"){E++}if(E>y){p.splice(y+1,E-y)}let C=p[y+1];const I=p[y+2];const w=p[y+3];if(C!=="..")continue;if(!I||I==="."||I===".."||!w||w==="."||w===".."){continue}A=true;p.splice(y,1);const v=p.slice(0);v[y]="**";u.push(v);y--}if(!this.preserveMultipleSlashes){for(let u=1;u<p.length-1;u++){const y=p[u];if(u===1&&y===""&&p[0]==="")continue;if(y==="."||y===""){A=true;p.splice(u,1);u--}}if(p[0]==="."&&p.length===2&&(p[1]==="."||p[1]==="")){A=true;p.pop()}}let E=0;while(-1!==(E=p.indexOf("..",E+1))){const u=p[E-1];if(u&&u!=="."&&u!==".."&&u!=="**"){A=true;const u=E===1&&p[E+1]==="**";const y=u?["."]:[];p.splice(E-1,2,...y);if(p.length===0)p.push("");E-=2}}}}while(A);return u}secondPhasePreProcess(u){for(let A=0;A<u.length-1;A++){for(let p=A+1;p<u.length;p++){const y=this.partsMatch(u[A],u[p],!this.preserveMultipleSlashes);if(y){u[A]=[];u[p]=y;break}}}return u.filter((u=>u.length))}partsMatch(u,A,p=false){let y=0;let E=0;let C=[];let I="";while(y<u.length&&E<A.length){if(u[y]===A[E]){C.push(I==="b"?A[E]:u[y]);y++;E++}else if(p&&u[y]==="**"&&A[E]===u[y+1]){C.push(u[y]);y++}else if(p&&A[E]==="**"&&u[y]===A[E+1]){C.push(A[E]);E++}else if(u[y]==="*"&&A[E]&&(this.options.dot||!A[E].startsWith("."))&&A[E]!=="**"){if(I==="b")return false;I="a";C.push(u[y]);y++;E++}else if(A[E]==="*"&&u[y]&&(this.options.dot||!u[y].startsWith("."))&&u[y]!=="**"){if(I==="a")return false;I="b";C.push(A[E]);y++;E++}else{return false}}return u.length===A.length&&C}parseNegate(){if(this.nonegate)return;const u=this.pattern;let A=false;let p=0;for(let y=0;y<u.length&&u.charAt(y)==="!";y++){A=!A;p++}if(p)this.pattern=u.slice(p);this.negate=A}matchOne(u,A,p=false){const y=this.options;if(this.isWindows){const p=typeof u[0]==="string"&&/^[a-z]:$/i.test(u[0]);const y=!p&&u[0]===""&&u[1]===""&&u[2]==="?"&&/^[a-z]:$/i.test(u[3]);const E=typeof A[0]==="string"&&/^[a-z]:$/i.test(A[0]);const C=!E&&A[0]===""&&A[1]===""&&A[2]==="?"&&typeof A[3]==="string"&&/^[a-z]:$/i.test(A[3]);const I=y?3:p?0:undefined;const w=C?3:E?0:undefined;if(typeof I==="number"&&typeof w==="number"){const[p,y]=[u[I],A[w]];if(p.toLowerCase()===y.toLowerCase()){A[w]=p;if(w>I){A=A.slice(w)}else if(I>w){u=u.slice(I)}}}}const{optimizationLevel:E=1}=this.options;if(E>=2){u=this.levelTwoFileOptimize(u)}this.debug("matchOne",this,{file:u,pattern:A});this.debug("matchOne",u.length,A.length);for(var C=0,I=0,w=u.length,v=A.length;C<w&&I<v;C++,I++){this.debug("matchOne loop");var B=A[I];var S=u[C];this.debug(A,B,S);if(B===false){return false}if(B===me){this.debug("GLOBSTAR",[A,B,S]);var D=C;var k=I+1;if(k===v){this.debug("** at the end");for(;C<w;C++){if(u[C]==="."||u[C]===".."||!y.dot&&u[C].charAt(0)===".")return false}return true}while(D<w){var Q=u[D];this.debug("\nglobstar while",u,D,A,k,Q);if(this.matchOne(u.slice(D),A.slice(k),p)){this.debug("globstar found match!",D,w,Q);return true}else{if(Q==="."||Q===".."||!y.dot&&Q.charAt(0)==="."){this.debug("dot detected!",u,D,A,k);break}this.debug("globstar swallow a segment, and continue");D++}}if(p){this.debug("\n>>> no match, partial?",u,D,A,k);if(D===w){return true}}return false}let E;if(typeof B==="string"){E=S===B;this.debug("string match",B,S,E)}else{E=B.test(S);this.debug("pattern match",B,S,E)}if(!E)return false}if(C===w&&I===v){return true}else if(C===w){return p}else if(I===v){return C===w-1&&u[C]===""}else{throw new Error("wtf?")}}braceExpand(){return braceExpand(this.pattern,this.options)}parse(u){assertValidPattern(u);const A=this.options;if(u==="**")return me;if(u==="")return"";let p;let y=null;if(p=u.match(fe)){y=A.dot?starTestDot:starTest}else if(p=u.match(ce)){y=(A.nocase?A.dot?starDotExtTestNocaseDot:starDotExtTestNocase:A.dot?starDotExtTestDot:starDotExtTest)(p[1])}else if(p=u.match(Ae)){y=(A.nocase?A.dot?qmarksTestNocaseDot:qmarksTestNocase:A.dot?qmarksTestDot:qmarksTest)(p)}else if(p=u.match(ue)){y=A.dot?starDotStarTestDot:starDotStarTest}else if(p=u.match(de)){y=dotStarTest}const E=AST.fromGlob(u,this.options).toMMPattern();if(y&&typeof E==="object"){Reflect.defineProperty(E,"test",{value:y})}return E}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const u=this.set;if(!u.length){this.regexp=false;return this.regexp}const A=this.options;const p=A.noglobstar?Ee:A.dot?Ce:Ie;const y=new Set(A.nocase?["i"]:[]);let E=u.map((u=>{const A=u.map((u=>{if(u instanceof RegExp){for(const A of u.flags.split(""))y.add(A)}return typeof u==="string"?esm_regExpEscape(u):u===me?me:u._src}));A.forEach(((u,y)=>{const E=A[y+1];const C=A[y-1];if(u!==me||C===me){return}if(C===undefined){if(E!==undefined&&E!==me){A[y+1]="(?:\\/|"+p+"\\/)?"+E}else{A[y]=p}}else if(E===undefined){A[y-1]=C+"(?:\\/|\\/"+p+")?"}else if(E!==me){A[y-1]=C+"(?:\\/|\\/"+p+"\\/)"+E;A[y+1]=me}}));const E=A.filter((u=>u!==me));if(this.partial&&E.length>=1){const u=[];for(let A=1;A<=E.length;A++){u.push(E.slice(0,A).join("/"))}return"(?:"+u.join("|")+")"}return E.join("/")})).join("|");const[C,I]=u.length>1?["(?:",")"]:["",""];E="^"+C+E+I+"$";if(this.partial){E="^(?:\\/|"+C+E.slice(1,-1)+I+")$"}if(this.negate)E="^(?!"+E+").+$";try{this.regexp=new RegExp(E,[...y].join(""))}catch(u){this.regexp=false}return this.regexp}slashSplit(u){if(this.preserveMultipleSlashes){return u.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(u)){return["",...u.split(/\/+/)]}else{return u.split(/\/+/)}}match(u,A=this.partial){this.debug("match",u,this.pattern);if(this.comment){return false}if(this.empty){return u===""}if(u==="/"&&A){return true}const p=this.options;if(this.isWindows){u=u.split("\\").join("/")}const y=this.slashSplit(u);this.debug(this.pattern,"split",y);const E=this.set;this.debug(this.pattern,"set",E);let C=y[y.length-1];if(!C){for(let u=y.length-2;!C&&u>=0;u--){C=y[u]}}for(let u=0;u<E.length;u++){const I=E[u];let w=y;if(p.matchBase&&I.length===1){w=[C]}const v=this.matchOne(w,I,A);if(v){if(p.flipNegate){return true}return!this.negate}}if(p.flipNegate){return false}return this.negate}static defaults(u){return minimatch.defaults(u).Minimatch}}minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape_escape;minimatch.unescape=unescape_unescape;var we=p(3136);const ve=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const Be=new Set;const Se=typeof process==="object"&&!!process?process:{};const emitWarning=(u,A,p,y)=>{typeof Se.emitWarning==="function"?Se.emitWarning(u,A,p,y):console.error(`[${p}] ${A}: ${u}`)};let De=globalThis.AbortController;let ke=globalThis.AbortSignal;if(typeof De==="undefined"){ke=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(u,A){this._onabort.push(A)}};De=class AbortController{constructor(){warnACPolyfill()}signal=new ke;abort(u){if(this.signal.aborted)return;this.signal.reason=u;this.signal.aborted=true;for(const A of this.signal._onabort){A(u)}this.signal.onabort?.(u)}};let u=Se.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!u)return;u=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=u=>!Be.has(u);const Qe=Symbol("type");const isPosInt=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u);const getUintArray=u=>!isPosInt(u)?null:u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(u){super(u);this.fill(0)}}class Stack{heap;length;static#p=false;static create(u){const A=getUintArray(u);if(!A)return[];Stack.#p=true;const p=new Stack(u,A);Stack.#p=false;return p}constructor(u,A){if(!Stack.#p){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new A(u);this.length=0}push(u){this.heap[this.length++]=u}pop(){return this.heap[--this.length]}}class LRUCache{#g;#m;#y;#E;#C;#I;#b;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#v;#B;#S;#D;#k;#Q;#F;#x;#R;#_;#T;#N;#L;#P;#O;#M;#U;#H;#G;static unsafeExposeInternals(u){return{starts:u.#L,ttls:u.#P,autopurgeTimers:u.#O,sizes:u.#N,keyMap:u.#S,keyList:u.#D,valList:u.#k,next:u.#Q,prev:u.#F,get head(){return u.#x},get tail(){return u.#R},free:u.#_,isBackgroundFetch:A=>u.#W(A),backgroundFetch:(A,p,y,E)=>u.#j(A,p,y,E),moveToTail:A=>u.#z(A),indexes:A=>u.#$(A),rindexes:A=>u.#q(A),isStale:A=>u.#V(A)}}get max(){return this.#g}get maxSize(){return this.#m}get calculatedSize(){return this.#B}get size(){return this.#v}get fetchMethod(){return this.#I}get memoMethod(){return this.#b}get dispose(){return this.#y}get onInsert(){return this.#E}get disposeAfter(){return this.#C}constructor(u){const{max:A=0,ttl:p,ttlResolution:y=1,ttlAutopurge:E,updateAgeOnGet:C,updateAgeOnHas:I,allowStale:w,dispose:v,onInsert:B,disposeAfter:S,noDisposeOnSet:D,noUpdateTTL:k,maxSize:Q=0,maxEntrySize:F=0,sizeCalculation:R,fetchMethod:_,memoMethod:P,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:U,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:G,ignoreFetchAbort:j,perf:$}=u;if($!==undefined){if(typeof $?.now!=="function"){throw new TypeError("perf option must have a now() method if specified")}}this.#w=$??ve;if(A!==0&&!isPosInt(A)){throw new TypeError("max option must be a nonnegative integer")}const q=A?getUintArray(A):Array;if(!q){throw new Error("invalid max value: "+A)}this.#g=A;this.#m=Q;this.maxEntrySize=F||this.#m;this.sizeCalculation=R;if(this.sizeCalculation){if(!this.#m&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(P!==undefined&&typeof P!=="function"){throw new TypeError("memoMethod must be a function if defined")}this.#b=P;if(_!==undefined&&typeof _!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#I=_;this.#U=!!_;this.#S=new Map;this.#D=new Array(A).fill(undefined);this.#k=new Array(A).fill(undefined);this.#Q=new q(A);this.#F=new q(A);this.#x=0;this.#R=0;this.#_=Stack.create(A);this.#v=0;this.#B=0;if(typeof v==="function"){this.#y=v}if(typeof B==="function"){this.#E=B}if(typeof S==="function"){this.#C=S;this.#T=[]}else{this.#C=undefined;this.#T=undefined}this.#M=!!this.#y;this.#G=!!this.#E;this.#H=!!this.#C;this.noDisposeOnSet=!!D;this.noUpdateTTL=!!k;this.noDeleteOnFetchRejection=!!O;this.allowStaleOnFetchRejection=!!H;this.allowStaleOnFetchAbort=!!G;this.ignoreFetchAbort=!!j;if(this.maxEntrySize!==0){if(this.#m!==0){if(!isPosInt(this.#m)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#K()}this.allowStale=!!w;this.noDeleteOnStaleGet=!!U;this.updateAgeOnGet=!!C;this.updateAgeOnHas=!!I;this.ttlResolution=isPosInt(y)||y===0?y:1;this.ttlAutopurge=!!E;this.ttl=p||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#J()}if(this.#g===0&&this.ttl===0&&this.#m===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#m){const u="LRU_CACHE_UNBOUNDED";if(shouldWarn(u)){Be.add(u);const A="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(A,"UnboundedCacheWarning",u,LRUCache)}}}getRemainingTTL(u){return this.#S.has(u)?Infinity:0}#J(){const u=new ZeroArray(this.#g);const A=new ZeroArray(this.#g);this.#P=u;this.#L=A;const p=this.ttlAutopurge?new Array(this.#g):undefined;this.#O=p;this.#Y=(y,E,C=this.#w.now())=>{A[y]=E!==0?C:0;u[y]=E;if(p?.[y]){clearTimeout(p[y]);p[y]=undefined}if(E!==0&&p){const u=setTimeout((()=>{if(this.#V(y)){this.#X(this.#D[y],"expire")}}),E+1);if(u.unref){u.unref()}p[y]=u}};this.#Z=p=>{A[p]=u[p]!==0?this.#w.now():0};this.#ee=(p,E)=>{if(u[E]){const C=u[E];const I=A[E];if(!C||!I)return;p.ttl=C;p.start=I;p.now=y||getNow();const w=p.now-I;p.remainingTTL=C-w}};let y=0;const getNow=()=>{const u=this.#w.now();if(this.ttlResolution>0){y=u;const A=setTimeout((()=>y=0),this.ttlResolution);if(A.unref){A.unref()}}return u};this.getRemainingTTL=p=>{const E=this.#S.get(p);if(E===undefined){return 0}const C=u[E];const I=A[E];if(!C||!I){return Infinity}const w=(y||getNow())-I;return C-w};this.#V=p=>{const E=A[p];const C=u[p];return!!C&&!!E&&(y||getNow())-E>C}}#Z=()=>{};#ee=()=>{};#Y=()=>{};#V=()=>false;#K(){const u=new ZeroArray(this.#g);this.#B=0;this.#N=u;this.#te=A=>{this.#B-=u[A];u[A]=0};this.#ne=(u,A,p,y)=>{if(this.#W(A)){return 0}if(!isPosInt(p)){if(y){if(typeof y!=="function"){throw new TypeError("sizeCalculation must be a function")}p=y(A,u);if(!isPosInt(p)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return p};this.#re=(A,p,y)=>{u[A]=p;if(this.#m){const p=this.#m-u[A];while(this.#B>p){this.#se(true)}}this.#B+=u[A];if(y){y.entrySize=p;y.totalCalculatedSize=this.#B}}}#te=u=>{};#re=(u,A,p)=>{};#ne=(u,A,p,y)=>{if(p||y){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#$({allowStale:u=this.allowStale}={}){if(this.#v){for(let A=this.#R;true;){if(!this.#ie(A)){break}if(u||!this.#V(A)){yield A}if(A===this.#x){break}else{A=this.#F[A]}}}}*#q({allowStale:u=this.allowStale}={}){if(this.#v){for(let A=this.#x;true;){if(!this.#ie(A)){break}if(u||!this.#V(A)){yield A}if(A===this.#R){break}else{A=this.#Q[A]}}}}#ie(u){return u!==undefined&&this.#S.get(this.#D[u])===u}*entries(){for(const u of this.#$()){if(this.#k[u]!==undefined&&this.#D[u]!==undefined&&!this.#W(this.#k[u])){yield[this.#D[u],this.#k[u]]}}}*rentries(){for(const u of this.#q()){if(this.#k[u]!==undefined&&this.#D[u]!==undefined&&!this.#W(this.#k[u])){yield[this.#D[u],this.#k[u]]}}}*keys(){for(const u of this.#$()){const A=this.#D[u];if(A!==undefined&&!this.#W(this.#k[u])){yield A}}}*rkeys(){for(const u of this.#q()){const A=this.#D[u];if(A!==undefined&&!this.#W(this.#k[u])){yield A}}}*values(){for(const u of this.#$()){const A=this.#k[u];if(A!==undefined&&!this.#W(this.#k[u])){yield this.#k[u]}}}*rvalues(){for(const u of this.#q()){const A=this.#k[u];if(A!==undefined&&!this.#W(this.#k[u])){yield this.#k[u]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(u,A={}){for(const p of this.#$()){const y=this.#k[p];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined)continue;if(u(E,this.#D[p],this)){return this.get(this.#D[p],A)}}}forEach(u,A=this){for(const p of this.#$()){const y=this.#k[p];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.#D[p],this)}}rforEach(u,A=this){for(const p of this.#q()){const y=this.#k[p];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.#D[p],this)}}purgeStale(){let u=false;for(const A of this.#q({allowStale:true})){if(this.#V(A)){this.#X(this.#D[A],"expire");u=true}}return u}info(u){const A=this.#S.get(u);if(A===undefined)return undefined;const p=this.#k[A];const y=this.#W(p)?p.__staleWhileFetching:p;if(y===undefined)return undefined;const E={value:y};if(this.#P&&this.#L){const u=this.#P[A];const p=this.#L[A];if(u&&p){const A=u-(this.#w.now()-p);E.ttl=A;E.start=Date.now()}}if(this.#N){E.size=this.#N[A]}return E}dump(){const u=[];for(const A of this.#$({allowStale:true})){const p=this.#D[A];const y=this.#k[A];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined||p===undefined)continue;const C={value:E};if(this.#P&&this.#L){C.ttl=this.#P[A];const u=this.#w.now()-this.#L[A];C.start=Math.floor(Date.now()-u)}if(this.#N){C.size=this.#N[A]}u.unshift([p,C])}return u}load(u){this.clear();for(const[A,p]of u){if(p.start){const u=Date.now()-p.start;p.start=this.#w.now()-u}this.set(A,p.value,p)}}set(u,A,p={}){if(A===undefined){this.delete(u);return this}const{ttl:y=this.ttl,start:E,noDisposeOnSet:C=this.noDisposeOnSet,sizeCalculation:I=this.sizeCalculation,status:w}=p;let{noUpdateTTL:v=this.noUpdateTTL}=p;const B=this.#ne(u,A,p.size||0,I);if(this.maxEntrySize&&B>this.maxEntrySize){if(w){w.set="miss";w.maxEntrySizeExceeded=true}this.#X(u,"set");return this}let S=this.#v===0?undefined:this.#S.get(u);if(S===undefined){S=this.#v===0?this.#R:this.#_.length!==0?this.#_.pop():this.#v===this.#g?this.#se(false):this.#v;this.#D[S]=u;this.#k[S]=A;this.#S.set(u,S);this.#Q[this.#R]=S;this.#F[S]=this.#R;this.#R=S;this.#v++;this.#re(S,B,w);if(w)w.set="add";v=false;if(this.#G){this.#E?.(A,u,"add")}}else{this.#z(S);const p=this.#k[S];if(A!==p){if(this.#U&&this.#W(p)){p.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:A}=p;if(A!==undefined&&!C){if(this.#M){this.#y?.(A,u,"set")}if(this.#H){this.#T?.push([A,u,"set"])}}}else if(!C){if(this.#M){this.#y?.(p,u,"set")}if(this.#H){this.#T?.push([p,u,"set"])}}this.#te(S);this.#re(S,B,w);this.#k[S]=A;if(w){w.set="replace";const u=p&&this.#W(p)?p.__staleWhileFetching:p;if(u!==undefined)w.oldValue=u}}else if(w){w.set="update"}if(this.#G){this.onInsert?.(A,u,A===p?"update":"replace")}}if(y!==0&&!this.#P){this.#J()}if(this.#P){if(!v){this.#Y(S,y,E)}if(w)this.#ee(w,S)}if(!C&&this.#H&&this.#T){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}return this}pop(){try{while(this.#v){const u=this.#k[this.#x];this.#se(true);if(this.#W(u)){if(u.__staleWhileFetching){return u.__staleWhileFetching}}else if(u!==undefined){return u}}}finally{if(this.#H&&this.#T){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}}}#se(u){const A=this.#x;const p=this.#D[A];const y=this.#k[A];if(this.#U&&this.#W(y)){y.__abortController.abort(new Error("evicted"))}else if(this.#M||this.#H){if(this.#M){this.#y?.(y,p,"evict")}if(this.#H){this.#T?.push([y,p,"evict"])}}this.#te(A);if(this.#O?.[A]){clearTimeout(this.#O[A]);this.#O[A]=undefined}if(u){this.#D[A]=undefined;this.#k[A]=undefined;this.#_.push(A)}if(this.#v===1){this.#x=this.#R=0;this.#_.length=0}else{this.#x=this.#Q[A]}this.#S.delete(p);this.#v--;return A}has(u,A={}){const{updateAgeOnHas:p=this.updateAgeOnHas,status:y}=A;const E=this.#S.get(u);if(E!==undefined){const u=this.#k[E];if(this.#W(u)&&u.__staleWhileFetching===undefined){return false}if(!this.#V(E)){if(p){this.#Z(E)}if(y){y.has="hit";this.#ee(y,E)}return true}else if(y){y.has="stale";this.#ee(y,E)}}else if(y){y.has="miss"}return false}peek(u,A={}){const{allowStale:p=this.allowStale}=A;const y=this.#S.get(u);if(y===undefined||!p&&this.#V(y)){return}const E=this.#k[y];return this.#W(E)?E.__staleWhileFetching:E}#j(u,A,p,y){const E=A===undefined?undefined:this.#k[A];if(this.#W(E)){return E}const C=new De;const{signal:I}=p;I?.addEventListener("abort",(()=>C.abort(I.reason)),{signal:C.signal});const w={signal:C.signal,options:p,context:y};const cb=(y,E=false)=>{const{aborted:I}=C.signal;const B=p.ignoreFetchAbort&&y!==undefined;if(p.status){if(I&&!E){p.status.fetchAborted=true;p.status.fetchError=C.signal.reason;if(B)p.status.fetchAbortIgnored=true}else{p.status.fetchResolved=true}}if(I&&!B&&!E){return fetchFail(C.signal.reason)}const S=v;const D=this.#k[A];if(D===v||B&&E&&D===undefined){if(y===undefined){if(S.__staleWhileFetching!==undefined){this.#k[A]=S.__staleWhileFetching}else{this.#X(u,"fetch")}}else{if(p.status)p.status.fetchUpdated=true;this.set(u,y,w.options)}}return y};const eb=u=>{if(p.status){p.status.fetchRejected=true;p.status.fetchError=u}return fetchFail(u)};const fetchFail=y=>{const{aborted:E}=C.signal;const I=E&&p.allowStaleOnFetchAbort;const w=I||p.allowStaleOnFetchRejection;const B=w||p.noDeleteOnFetchRejection;const S=v;if(this.#k[A]===v){const p=!B||S.__staleWhileFetching===undefined;if(p){this.#X(u,"fetch")}else if(!I){this.#k[A]=S.__staleWhileFetching}}if(w){if(p.status&&S.__staleWhileFetching!==undefined){p.status.returnedStale=true}return S.__staleWhileFetching}else if(S.__returned===S){throw y}};const pcall=(A,y)=>{const I=this.#I?.(u,E,w);if(I&&I instanceof Promise){I.then((u=>A(u===undefined?undefined:u)),y)}C.signal.addEventListener("abort",(()=>{if(!p.ignoreFetchAbort||p.allowStaleOnFetchAbort){A(undefined);if(p.allowStaleOnFetchAbort){A=u=>cb(u,true)}}}))};if(p.status)p.status.fetchDispatched=true;const v=new Promise(pcall).then(cb,eb);const B=Object.assign(v,{__abortController:C,__staleWhileFetching:E,__returned:undefined});if(A===undefined){this.set(u,B,{...w.options,status:undefined});A=this.#S.get(u)}else{this.#k[A]=B}return B}#W(u){if(!this.#U)return false;const A=u;return!!A&&A instanceof Promise&&A.hasOwnProperty("__staleWhileFetching")&&A.__abortController instanceof De}async fetch(u,A={}){const{allowStale:p=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:E=this.noDeleteOnStaleGet,ttl:C=this.ttl,noDisposeOnSet:I=this.noDisposeOnSet,size:w=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:B=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:D=this.allowStaleOnFetchRejection,ignoreFetchAbort:k=this.ignoreFetchAbort,allowStaleOnFetchAbort:Q=this.allowStaleOnFetchAbort,context:F,forceRefresh:R=false,status:_,signal:P}=A;if(!this.#U){if(_)_.fetch="get";return this.get(u,{allowStale:p,updateAgeOnGet:y,noDeleteOnStaleGet:E,status:_})}const O={allowStale:p,updateAgeOnGet:y,noDeleteOnStaleGet:E,ttl:C,noDisposeOnSet:I,size:w,sizeCalculation:v,noUpdateTTL:B,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:Q,ignoreFetchAbort:k,status:_,signal:P};let U=this.#S.get(u);if(U===undefined){if(_)_.fetch="miss";const A=this.#j(u,U,O,F);return A.__returned=A}else{const A=this.#k[U];if(this.#W(A)){const u=p&&A.__staleWhileFetching!==undefined;if(_){_.fetch="inflight";if(u)_.returnedStale=true}return u?A.__staleWhileFetching:A.__returned=A}const E=this.#V(U);if(!R&&!E){if(_)_.fetch="hit";this.#z(U);if(y){this.#Z(U)}if(_)this.#ee(_,U);return A}const C=this.#j(u,U,O,F);const I=C.__staleWhileFetching!==undefined;const w=I&&p;if(_){_.fetch=E?"stale":"refresh";if(w&&E)_.returnedStale=true}return w?C.__staleWhileFetching:C.__returned=C}}async forceFetch(u,A={}){const p=await this.fetch(u,A);if(p===undefined)throw new Error("fetch() returned undefined");return p}memo(u,A={}){const p=this.#b;if(!p){throw new Error("no memoMethod provided to constructor")}const{context:y,forceRefresh:E,...C}=A;const I=this.get(u,C);if(!E&&I!==undefined)return I;const w=p(u,I,{options:C,context:y});this.set(u,w,C);return w}get(u,A={}){const{allowStale:p=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:E=this.noDeleteOnStaleGet,status:C}=A;const I=this.#S.get(u);if(I!==undefined){const A=this.#k[I];const w=this.#W(A);if(C)this.#ee(C,I);if(this.#V(I)){if(C)C.get="stale";if(!w){if(!E){this.#X(u,"expire")}if(C&&p)C.returnedStale=true;return p?A:undefined}else{if(C&&p&&A.__staleWhileFetching!==undefined){C.returnedStale=true}return p?A.__staleWhileFetching:undefined}}else{if(C)C.get="hit";if(w){return A.__staleWhileFetching}this.#z(I);if(y){this.#Z(I)}return A}}else if(C){C.get="miss"}}#oe(u,A){this.#F[A]=u;this.#Q[u]=A}#z(u){if(u!==this.#R){if(u===this.#x){this.#x=this.#Q[u]}else{this.#oe(this.#F[u],this.#Q[u])}this.#oe(this.#R,u);this.#R=u}}delete(u){return this.#X(u,"delete")}#X(u,A){let p=false;if(this.#v!==0){const y=this.#S.get(u);if(y!==undefined){if(this.#O?.[y]){clearTimeout(this.#O?.[y]);this.#O[y]=undefined}p=true;if(this.#v===1){this.#ae(A)}else{this.#te(y);const p=this.#k[y];if(this.#W(p)){p.__abortController.abort(new Error("deleted"))}else if(this.#M||this.#H){if(this.#M){this.#y?.(p,u,A)}if(this.#H){this.#T?.push([p,u,A])}}this.#S.delete(u);this.#D[y]=undefined;this.#k[y]=undefined;if(y===this.#R){this.#R=this.#F[y]}else if(y===this.#x){this.#x=this.#Q[y]}else{const u=this.#F[y];this.#Q[u]=this.#Q[y];const A=this.#Q[y];this.#F[A]=this.#F[y]}this.#v--;this.#_.push(y)}}}if(this.#H&&this.#T?.length){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}return p}clear(){return this.#ae("delete")}#ae(u){for(const A of this.#q({allowStale:true})){const p=this.#k[A];if(this.#W(p)){p.__abortController.abort(new Error("deleted"))}else{const y=this.#D[A];if(this.#M){this.#y?.(p,y,u)}if(this.#H){this.#T?.push([p,y,u])}}}this.#S.clear();this.#k.fill(undefined);this.#D.fill(undefined);if(this.#P&&this.#L){this.#P.fill(0);this.#L.fill(0);for(const u of this.#O??[]){if(u!==undefined)clearTimeout(u)}this.#O?.fill(undefined)}if(this.#N){this.#N.fill(0)}this.#x=0;this.#R=0;this.#_.length=0;this.#B=0;this.#v=0;if(this.#H&&this.#T){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}}}var Fe=p(6760);var xe=p(9896);var Re=p.n(xe);var _e=p(3024);var Te=p.t(_e,2);var Ne=p(1455);var Le=p(8474);var Pe=p(7075);const Oe=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:string_decoder");const Me=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=u=>!!u&&typeof u==="object"&&(u instanceof Minipass||u instanceof Pe||isReadable(u)||isWritable(u));const isReadable=u=>!!u&&typeof u==="object"&&u instanceof Le.EventEmitter&&typeof u.pipe==="function"&&u.pipe!==Pe.Writable.prototype.pipe;const isWritable=u=>!!u&&typeof u==="object"&&u instanceof Le.EventEmitter&&typeof u.write==="function"&&typeof u.end==="function";const Ue=Symbol("EOF");const He=Symbol("maybeEmitEnd");const Ge=Symbol("emittedEnd");const We=Symbol("emittingEnd");const je=Symbol("emittedError");const ze=Symbol("closed");const $e=Symbol("read");const qe=Symbol("flush");const Ve=Symbol("flushChunk");const Ke=Symbol("encoding");const Je=Symbol("decoder");const Ye=Symbol("flowing");const Xe=Symbol("paused");const Ze=Symbol("resume");const et=Symbol("buffer");const tt=Symbol("pipes");const nt=Symbol("bufferLength");const rt=Symbol("bufferPush");const st=Symbol("bufferShift");const it=Symbol("objectMode");const ot=Symbol("destroyed");const at=Symbol("error");const lt=Symbol("emitData");const ct=Symbol("emitEnd");const ut=Symbol("emitEnd2");const dt=Symbol("async");const ft=Symbol("abort");const At=Symbol("aborted");const ht=Symbol("signal");const pt=Symbol("dataListeners");const gt=Symbol("discarded");const defer=u=>Promise.resolve().then(u);const nodefer=u=>u();const isEndish=u=>u==="end"||u==="finish"||u==="prefinish";const isArrayBufferLike=u=>u instanceof ArrayBuffer||!!u&&typeof u==="object"&&u.constructor&&u.constructor.name==="ArrayBuffer"&&u.byteLength>=0;const isArrayBufferView=u=>!Buffer.isBuffer(u)&&ArrayBuffer.isView(u);class Pipe{src;dest;opts;ondrain;constructor(u,A,p){this.src=u;this.dest=A;this.opts=p;this.ondrain=()=>u[Ze]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(u){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(u,A,p){super(u,A,p);this.proxyErrors=u=>A.emit("error",u);u.on("error",this.proxyErrors)}}const isObjectModeOptions=u=>!!u.objectMode;const isEncodingOptions=u=>!u.objectMode&&!!u.encoding&&u.encoding!=="buffer";class Minipass extends Le.EventEmitter{[Ye]=false;[Xe]=false;[tt]=[];[et]=[];[it];[Ke];[dt];[Je];[Ue]=false;[Ge]=false;[We]=false;[ze]=false;[je]=null;[nt]=0;[ot]=false;[ht];[At]=false;[pt]=0;[gt]=false;writable=true;readable=true;constructor(...u){const A=u[0]||{};super();if(A.objectMode&&typeof A.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(A)){this[it]=true;this[Ke]=null}else if(isEncodingOptions(A)){this[Ke]=A.encoding;this[it]=false}else{this[it]=false;this[Ke]=null}this[dt]=!!A.async;this[Je]=this[Ke]?new Oe.StringDecoder(this[Ke]):null;if(A&&A.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[et]})}if(A&&A.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[tt]})}const{signal:p}=A;if(p){this[ht]=p;if(p.aborted){this[ft]()}else{p.addEventListener("abort",(()=>this[ft]()))}}}get bufferLength(){return this[nt]}get encoding(){return this[Ke]}set encoding(u){throw new Error("Encoding must be set at instantiation time")}setEncoding(u){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[it]}set objectMode(u){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[dt]}set["async"](u){this[dt]=this[dt]||!!u}[ft](){this[At]=true;this.emit("abort",this[ht]?.reason);this.destroy(this[ht]?.reason)}get aborted(){return this[At]}set aborted(u){}write(u,A,p){if(this[At])return false;if(this[Ue])throw new Error("write after end");if(this[ot]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof A==="function"){p=A;A="utf8"}if(!A)A="utf8";const y=this[dt]?defer:nodefer;if(!this[it]&&!Buffer.isBuffer(u)){if(isArrayBufferView(u)){u=Buffer.from(u.buffer,u.byteOffset,u.byteLength)}else if(isArrayBufferLike(u)){u=Buffer.from(u)}else if(typeof u!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[it]){if(this[Ye]&&this[nt]!==0)this[qe](true);if(this[Ye])this.emit("data",u);else this[rt](u);if(this[nt]!==0)this.emit("readable");if(p)y(p);return this[Ye]}if(!u.length){if(this[nt]!==0)this.emit("readable");if(p)y(p);return this[Ye]}if(typeof u==="string"&&!(A===this[Ke]&&!this[Je]?.lastNeed)){u=Buffer.from(u,A)}if(Buffer.isBuffer(u)&&this[Ke]){u=this[Je].write(u)}if(this[Ye]&&this[nt]!==0)this[qe](true);if(this[Ye])this.emit("data",u);else this[rt](u);if(this[nt]!==0)this.emit("readable");if(p)y(p);return this[Ye]}read(u){if(this[ot])return null;this[gt]=false;if(this[nt]===0||u===0||u&&u>this[nt]){this[He]();return null}if(this[it])u=null;if(this[et].length>1&&!this[it]){this[et]=[this[Ke]?this[et].join(""):Buffer.concat(this[et],this[nt])]}const A=this[$e](u||null,this[et][0]);this[He]();return A}[$e](u,A){if(this[it])this[st]();else{const p=A;if(u===p.length||u===null)this[st]();else if(typeof p==="string"){this[et][0]=p.slice(u);A=p.slice(0,u);this[nt]-=u}else{this[et][0]=p.subarray(u);A=p.subarray(0,u);this[nt]-=u}}this.emit("data",A);if(!this[et].length&&!this[Ue])this.emit("drain");return A}end(u,A,p){if(typeof u==="function"){p=u;u=undefined}if(typeof A==="function"){p=A;A="utf8"}if(u!==undefined)this.write(u,A);if(p)this.once("end",p);this[Ue]=true;this.writable=false;if(this[Ye]||!this[Xe])this[He]();return this}[Ze](){if(this[ot])return;if(!this[pt]&&!this[tt].length){this[gt]=true}this[Xe]=false;this[Ye]=true;this.emit("resume");if(this[et].length)this[qe]();else if(this[Ue])this[He]();else this.emit("drain")}resume(){return this[Ze]()}pause(){this[Ye]=false;this[Xe]=true;this[gt]=false}get destroyed(){return this[ot]}get flowing(){return this[Ye]}get paused(){return this[Xe]}[rt](u){if(this[it])this[nt]+=1;else this[nt]+=u.length;this[et].push(u)}[st](){if(this[it])this[nt]-=1;else this[nt]-=this[et][0].length;return this[et].shift()}[qe](u=false){do{}while(this[Ve](this[st]())&&this[et].length);if(!u&&!this[et].length&&!this[Ue])this.emit("drain")}[Ve](u){this.emit("data",u);return this[Ye]}pipe(u,A){if(this[ot])return u;this[gt]=false;const p=this[Ge];A=A||{};if(u===Me.stdout||u===Me.stderr)A.end=false;else A.end=A.end!==false;A.proxyErrors=!!A.proxyErrors;if(p){if(A.end)u.end()}else{this[tt].push(!A.proxyErrors?new Pipe(this,u,A):new PipeProxyErrors(this,u,A));if(this[dt])defer((()=>this[Ze]()));else this[Ze]()}return u}unpipe(u){const A=this[tt].find((A=>A.dest===u));if(A){if(this[tt].length===1){if(this[Ye]&&this[pt]===0){this[Ye]=false}this[tt]=[]}else this[tt].splice(this[tt].indexOf(A),1);A.unpipe()}}addListener(u,A){return this.on(u,A)}on(u,A){const p=super.on(u,A);if(u==="data"){this[gt]=false;this[pt]++;if(!this[tt].length&&!this[Ye]){this[Ze]()}}else if(u==="readable"&&this[nt]!==0){super.emit("readable")}else if(isEndish(u)&&this[Ge]){super.emit(u);this.removeAllListeners(u)}else if(u==="error"&&this[je]){const u=A;if(this[dt])defer((()=>u.call(this,this[je])));else u.call(this,this[je])}return p}removeListener(u,A){return this.off(u,A)}off(u,A){const p=super.off(u,A);if(u==="data"){this[pt]=this.listeners("data").length;if(this[pt]===0&&!this[gt]&&!this[tt].length){this[Ye]=false}}return p}removeAllListeners(u){const A=super.removeAllListeners(u);if(u==="data"||u===undefined){this[pt]=0;if(!this[gt]&&!this[tt].length){this[Ye]=false}}return A}get emittedEnd(){return this[Ge]}[He](){if(!this[We]&&!this[Ge]&&!this[ot]&&this[et].length===0&&this[Ue]){this[We]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[ze])this.emit("close");this[We]=false}}emit(u,...A){const p=A[0];if(u!=="error"&&u!=="close"&&u!==ot&&this[ot]){return false}else if(u==="data"){return!this[it]&&!p?false:this[dt]?(defer((()=>this[lt](p))),true):this[lt](p)}else if(u==="end"){return this[ct]()}else if(u==="close"){this[ze]=true;if(!this[Ge]&&!this[ot])return false;const u=super.emit("close");this.removeAllListeners("close");return u}else if(u==="error"){this[je]=p;super.emit(at,p);const u=!this[ht]||this.listeners("error").length?super.emit("error",p):false;this[He]();return u}else if(u==="resume"){const u=super.emit("resume");this[He]();return u}else if(u==="finish"||u==="prefinish"){const A=super.emit(u);this.removeAllListeners(u);return A}const y=super.emit(u,...A);this[He]();return y}[lt](u){for(const A of this[tt]){if(A.dest.write(u)===false)this.pause()}const A=this[gt]?false:super.emit("data",u);this[He]();return A}[ct](){if(this[Ge])return false;this[Ge]=true;this.readable=false;return this[dt]?(defer((()=>this[ut]())),true):this[ut]()}[ut](){if(this[Je]){const u=this[Je].end();if(u){for(const A of this[tt]){A.dest.write(u)}if(!this[gt])super.emit("data",u)}}for(const u of this[tt]){u.end()}const u=super.emit("end");this.removeAllListeners("end");return u}async collect(){const u=Object.assign([],{dataLength:0});if(!this[it])u.dataLength=0;const A=this.promise();this.on("data",(A=>{u.push(A);if(!this[it])u.dataLength+=A.length}));await A;return u}async concat(){if(this[it]){throw new Error("cannot concat in objectMode")}const u=await this.collect();return this[Ke]?u.join(""):Buffer.concat(u,u.dataLength)}async promise(){return new Promise(((u,A)=>{this.on(ot,(()=>A(new Error("stream destroyed"))));this.on("error",(u=>A(u)));this.on("end",(()=>u()))}))}[Symbol.asyncIterator](){this[gt]=false;let u=false;const stop=async()=>{this.pause();u=true;return{value:undefined,done:true}};const next=()=>{if(u)return stop();const A=this.read();if(A!==null)return Promise.resolve({done:false,value:A});if(this[Ue])return stop();let p;let y;const onerr=u=>{this.off("data",ondata);this.off("end",onend);this.off(ot,ondestroy);stop();y(u)};const ondata=u=>{this.off("error",onerr);this.off("end",onend);this.off(ot,ondestroy);this.pause();p({value:u,done:!!this[Ue]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(ot,ondestroy);stop();p({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((u,A)=>{y=A;p=u;this.once(ot,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[gt]=false;let u=false;const stop=()=>{this.pause();this.off(at,stop);this.off(ot,stop);this.off("end",stop);u=true;return{done:true,value:undefined}};const next=()=>{if(u)return stop();const A=this.read();return A===null?stop():{done:false,value:A}};this.once("end",stop);this.once(at,stop);this.once(ot,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(u){if(this[ot]){if(u)this.emit("error",u);else this.emit(ot);return this}this[ot]=true;this[gt]=true;this[et].length=0;this[nt]=0;const A=this;if(typeof A.close==="function"&&!this[ze])A.close();if(u)this.emit("error",u);else this.emit(ot);return this}static get isStream(){return isStream}}const mt=xe.realpathSync.native;const yt={lstatSync:xe.lstatSync,readdir:xe.readdir,readdirSync:xe.readdirSync,readlinkSync:xe.readlinkSync,realpathSync:mt,promises:{lstat:Ne.lstat,readdir:Ne.readdir,readlink:Ne.readlink,realpath:Ne.realpath}};const fsFromOption=u=>!u||u===yt||u===Te?yt:{...yt,...u,promises:{...yt.promises,...u.promises||{}}};const Et=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=u=>u.replace(/\//g,"\\").replace(Et,"$1\\");const Ct=/[\\\/]/;const It=0;const bt=1;const wt=2;const vt=4;const Bt=6;const St=8;const Dt=10;const kt=12;const Qt=15;const Ft=~Qt;const xt=16;const Rt=32;const _t=64;const Tt=128;const Nt=256;const Lt=512;const Pt=_t|Tt|Lt;const Ot=1023;const entToType=u=>u.isFile()?St:u.isDirectory()?vt:u.isSymbolicLink()?Dt:u.isCharacterDevice()?wt:u.isBlockDevice()?Bt:u.isSocket()?kt:u.isFIFO()?bt:It;const Mt=new LRUCache({max:2**12});const normalize=u=>{const A=Mt.get(u);if(A)return A;const p=u.normalize("NFKD");Mt.set(u,p);return p};const Ut=new LRUCache({max:2**12});const normalizeNocase=u=>{const A=Ut.get(u);if(A)return A;const p=normalize(u.toLowerCase());Ut.set(u,p);return p};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(u=16*1024){super({maxSize:u,sizeCalculation:u=>u.length+1})}}const Ht=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#le;#ce;get dev(){return this.#ce}#ue;get mode(){return this.#ue}#de;get nlink(){return this.#de}#fe;get uid(){return this.#fe}#Ae;get gid(){return this.#Ae}#he;get rdev(){return this.#he}#pe;get blksize(){return this.#pe}#ge;get ino(){return this.#ge}#v;get size(){return this.#v}#me;get blocks(){return this.#me}#ye;get atimeMs(){return this.#ye}#Ee;get mtimeMs(){return this.#Ee}#Ce;get ctimeMs(){return this.#Ce}#Ie;get birthtimeMs(){return this.#Ie}#be;get atime(){return this.#be}#we;get mtime(){return this.#we}#ve;get ctime(){return this.#ve}#Be;get birthtime(){return this.#Be}#Se;#De;#ke;#Qe;#Fe;#xe;#Re;#_e;#Te;#Ne;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(u,A=It,p,y,E,C,I){this.name=u;this.#Se=E?normalizeNocase(u):normalize(u);this.#Re=A&Ot;this.nocase=E;this.roots=y;this.root=p||this;this.#_e=C;this.#ke=I.fullpath;this.#Fe=I.relative;this.#xe=I.relativePosix;this.parent=I.parent;if(this.parent){this.#le=this.parent.#le}else{this.#le=fsFromOption(I.fs)}}depth(){if(this.#De!==undefined)return this.#De;if(!this.parent)return this.#De=0;return this.#De=this.parent.depth()+1}childrenCache(){return this.#_e}resolve(u){if(!u){return this}const A=this.getRootString(u);const p=u.substring(A.length);const y=p.split(this.splitSep);const E=A?this.getRoot(A).#Le(y):this.#Le(y);return E}#Le(u){let A=this;for(const p of u){A=A.child(p)}return A}children(){const u=this.#_e.get(this);if(u){return u}const A=Object.assign([],{provisional:0});this.#_e.set(this,A);this.#Re&=~xt;return A}child(u,A){if(u===""||u==="."){return this}if(u===".."){return this.parent||this}const p=this.children();const y=this.nocase?normalizeNocase(u):normalize(u);for(const u of p){if(u.#Se===y){return u}}const E=this.parent?this.sep:"";const C=this.#ke?this.#ke+E+u:undefined;const I=this.newChild(u,It,{...A,parent:this,fullpath:C});if(!this.canReaddir()){I.#Re|=Tt}p.push(I);return I}relative(){if(this.isCWD)return"";if(this.#Fe!==undefined){return this.#Fe}const u=this.name;const A=this.parent;if(!A){return this.#Fe=this.name}const p=A.relative();return p+(!p||!A.parent?"":this.sep)+u}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#xe!==undefined)return this.#xe;const u=this.name;const A=this.parent;if(!A){return this.#xe=this.fullpathPosix()}const p=A.relativePosix();return p+(!p||!A.parent?"":"/")+u}fullpath(){if(this.#ke!==undefined){return this.#ke}const u=this.name;const A=this.parent;if(!A){return this.#ke=this.name}const p=A.fullpath();const y=p+(!A.parent?"":this.sep)+u;return this.#ke=y}fullpathPosix(){if(this.#Qe!==undefined)return this.#Qe;if(this.sep==="/")return this.#Qe=this.fullpath();if(!this.parent){const u=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(u)){return this.#Qe=`//?/${u}`}else{return this.#Qe=u}}const u=this.parent;const A=u.fullpathPosix();const p=A+(!A||!u.parent?"":"/")+this.name;return this.#Qe=p}isUnknown(){return(this.#Re&Qt)===It}isType(u){return this[`is${u}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Re&Qt)===St}isDirectory(){return(this.#Re&Qt)===vt}isCharacterDevice(){return(this.#Re&Qt)===wt}isBlockDevice(){return(this.#Re&Qt)===Bt}isFIFO(){return(this.#Re&Qt)===bt}isSocket(){return(this.#Re&Qt)===kt}isSymbolicLink(){return(this.#Re&Dt)===Dt}lstatCached(){return this.#Re&Rt?this:undefined}readlinkCached(){return this.#Te}realpathCached(){return this.#Ne}readdirCached(){const u=this.children();return u.slice(0,u.provisional)}canReadlink(){if(this.#Te)return true;if(!this.parent)return false;const u=this.#Re&Qt;return!(u!==It&&u!==Dt||this.#Re&Nt||this.#Re&Tt)}calledReaddir(){return!!(this.#Re&xt)}isENOENT(){return!!(this.#Re&Tt)}isNamed(u){return!this.nocase?this.#Se===normalize(u):this.#Se===normalizeNocase(u)}async readlink(){const u=this.#Te;if(u){return u}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const u=await this.#le.promises.readlink(this.fullpath());const A=(await this.parent.realpath())?.resolve(u);if(A){return this.#Te=A}}catch(u){this.#Pe(u.code);return undefined}}readlinkSync(){const u=this.#Te;if(u){return u}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const u=this.#le.readlinkSync(this.fullpath());const A=this.parent.realpathSync()?.resolve(u);if(A){return this.#Te=A}}catch(u){this.#Pe(u.code);return undefined}}#Oe(u){this.#Re|=xt;for(let A=u.provisional;A<u.length;A++){const p=u[A];if(p)p.#Me()}}#Me(){if(this.#Re&Tt)return;this.#Re=(this.#Re|Tt)&Ft;this.#Ue()}#Ue(){const u=this.children();u.provisional=0;for(const A of u){A.#Me()}}#He(){this.#Re|=Lt;this.#Ge()}#Ge(){if(this.#Re&_t)return;let u=this.#Re;if((u&Qt)===vt)u&=Ft;this.#Re=u|_t;this.#Ue()}#We(u=""){if(u==="ENOTDIR"||u==="EPERM"){this.#Ge()}else if(u==="ENOENT"){this.#Me()}else{this.children().provisional=0}}#je(u=""){if(u==="ENOTDIR"){const u=this.parent;u.#Ge()}else if(u==="ENOENT"){this.#Me()}}#Pe(u=""){let A=this.#Re;A|=Nt;if(u==="ENOENT")A|=Tt;if(u==="EINVAL"||u==="UNKNOWN"){A&=Ft}this.#Re=A;if(u==="ENOTDIR"&&this.parent){this.parent.#Ge()}}#ze(u,A){return this.#$e(u,A)||this.#qe(u,A)}#qe(u,A){const p=entToType(u);const y=this.newChild(u.name,p,{parent:this});const E=y.#Re&Qt;if(E!==vt&&E!==Dt&&E!==It){y.#Re|=_t}A.unshift(y);A.provisional++;return y}#$e(u,A){for(let p=A.provisional;p<A.length;p++){const y=A[p];const E=this.nocase?normalizeNocase(u.name):normalize(u.name);if(E!==y.#Se){continue}return this.#Ve(u,y,p,A)}}#Ve(u,A,p,y){const E=A.name;A.#Re=A.#Re&Ft|entToType(u);if(E!==u.name)A.name=u.name;if(p!==y.provisional){if(p===y.length-1)y.pop();else y.splice(p,1);y.unshift(A)}y.provisional++;return A}async lstat(){if((this.#Re&Tt)===0){try{this.#Ke(await this.#le.promises.lstat(this.fullpath()));return this}catch(u){this.#je(u.code)}}}lstatSync(){if((this.#Re&Tt)===0){try{this.#Ke(this.#le.lstatSync(this.fullpath()));return this}catch(u){this.#je(u.code)}}}#Ke(u){const{atime:A,atimeMs:p,birthtime:y,birthtimeMs:E,blksize:C,blocks:I,ctime:w,ctimeMs:v,dev:B,gid:S,ino:D,mode:k,mtime:Q,mtimeMs:F,nlink:R,rdev:_,size:P,uid:O}=u;this.#be=A;this.#ye=p;this.#Be=y;this.#Ie=E;this.#pe=C;this.#me=I;this.#ve=w;this.#Ce=v;this.#ce=B;this.#Ae=S;this.#ge=D;this.#ue=k;this.#we=Q;this.#Ee=F;this.#de=R;this.#he=_;this.#v=P;this.#fe=O;const U=entToType(u);this.#Re=this.#Re&Ft|U|Rt;if(U!==It&&U!==vt&&U!==Dt){this.#Re|=_t}}#Je=[];#Ye=false;#Xe(u){this.#Ye=false;const A=this.#Je.slice();this.#Je.length=0;A.forEach((A=>A(null,u)))}readdirCB(u,A=false){if(!this.canReaddir()){if(A)u(null,[]);else queueMicrotask((()=>u(null,[])));return}const p=this.children();if(this.calledReaddir()){const y=p.slice(0,p.provisional);if(A)u(null,y);else queueMicrotask((()=>u(null,y)));return}this.#Je.push(u);if(this.#Ye){return}this.#Ye=true;const y=this.fullpath();this.#le.readdir(y,{withFileTypes:true},((u,A)=>{if(u){this.#We(u.code);p.provisional=0}else{for(const u of A){this.#ze(u,p)}this.#Oe(p)}this.#Xe(p.slice(0,p.provisional));return}))}#Ze;async readdir(){if(!this.canReaddir()){return[]}const u=this.children();if(this.calledReaddir()){return u.slice(0,u.provisional)}const A=this.fullpath();if(this.#Ze){await this.#Ze}else{let resolve=()=>{};this.#Ze=new Promise((u=>resolve=u));try{for(const p of await this.#le.promises.readdir(A,{withFileTypes:true})){this.#ze(p,u)}this.#Oe(u)}catch(A){this.#We(A.code);u.provisional=0}this.#Ze=undefined;resolve()}return u.slice(0,u.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const u=this.children();if(this.calledReaddir()){return u.slice(0,u.provisional)}const A=this.fullpath();try{for(const p of this.#le.readdirSync(A,{withFileTypes:true})){this.#ze(p,u)}this.#Oe(u)}catch(A){this.#We(A.code);u.provisional=0}return u.slice(0,u.provisional)}canReaddir(){if(this.#Re&Pt)return false;const u=Qt&this.#Re;if(!(u===It||u===vt||u===Dt)){return false}return true}shouldWalk(u,A){return(this.#Re&vt)===vt&&!(this.#Re&Pt)&&!u.has(this)&&(!A||A(this))}async realpath(){if(this.#Ne)return this.#Ne;if((Lt|Nt|Tt)&this.#Re)return undefined;try{const u=await this.#le.promises.realpath(this.fullpath());return this.#Ne=this.resolve(u)}catch(u){this.#He()}}realpathSync(){if(this.#Ne)return this.#Ne;if((Lt|Nt|Tt)&this.#Re)return undefined;try{const u=this.#le.realpathSync(this.fullpath());return this.#Ne=this.resolve(u)}catch(u){this.#He()}}[Ht](u){if(u===this)return;u.isCWD=false;this.isCWD=true;const A=new Set([]);let p=[];let y=this;while(y&&y.parent){A.add(y);y.#Fe=p.join(this.sep);y.#xe=p.join("/");y=y.parent;p.push("..")}y=u;while(y&&y.parent&&!A.has(y)){y.#Fe=undefined;y.#xe=undefined;y=y.parent}}}class PathWin32 extends PathBase{sep="\\";splitSep=Ct;constructor(u,A=It,p,y,E,C,I){super(u,A,p,y,E,C,I)}newChild(u,A=It,p={}){return new PathWin32(u,A,this.root,this.roots,this.nocase,this.childrenCache(),p)}getRootString(u){return Fe.win32.parse(u).root}getRoot(u){u=uncToDrive(u.toUpperCase());if(u===this.root.name){return this.root}for(const[A,p]of Object.entries(this.roots)){if(this.sameRoot(u,A)){return this.roots[u]=p}}return this.roots[u]=new PathScurryWin32(u,this).root}sameRoot(u,A=this.root.name){u=u.toUpperCase().replace(/\//g,"\\").replace(Et,"$1\\");return u===A}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(u,A=It,p,y,E,C,I){super(u,A,p,y,E,C,I)}getRootString(u){return u.startsWith("/")?"/":""}getRoot(u){return this.root}newChild(u,A=It,p={}){return new PathPosix(u,A,this.root,this.roots,this.nocase,this.childrenCache(),p)}}class PathScurryBase{root;rootPath;roots;cwd;#et;#tt;#_e;nocase;#le;constructor(u=process.cwd(),A,p,{nocase:y,childrenCacheSize:E=16*1024,fs:C=yt}={}){this.#le=fsFromOption(C);if(u instanceof URL||u.startsWith("file://")){u=(0,we.fileURLToPath)(u)}const I=A.resolve(u);this.roots=Object.create(null);this.rootPath=this.parseRootPath(I);this.#et=new ResolveCache;this.#tt=new ResolveCache;this.#_e=new ChildrenCache(E);const w=I.substring(this.rootPath.length).split(p);if(w.length===1&&!w[0]){w.pop()}if(y===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=y;this.root=this.newRoot(this.#le);this.roots[this.rootPath]=this.root;let v=this.root;let B=w.length-1;const S=A.sep;let D=this.rootPath;let k=false;for(const u of w){const A=B--;v=v.child(u,{relative:new Array(A).fill("..").join(S),relativePosix:new Array(A).fill("..").join("/"),fullpath:D+=(k?"":S)+u});k=true}this.cwd=v}depth(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.depth()}childrenCache(){return this.#_e}resolve(...u){let A="";for(let p=u.length-1;p>=0;p--){const y=u[p];if(!y||y===".")continue;A=A?`${y}/${A}`:y;if(this.isAbsolute(y)){break}}const p=this.#et.get(A);if(p!==undefined){return p}const y=this.cwd.resolve(A).fullpath();this.#et.set(A,y);return y}resolvePosix(...u){let A="";for(let p=u.length-1;p>=0;p--){const y=u[p];if(!y||y===".")continue;A=A?`${y}/${A}`:y;if(this.isAbsolute(y)){break}}const p=this.#tt.get(A);if(p!==undefined){return p}const y=this.cwd.resolve(A).fullpathPosix();this.#tt.set(A,y);return y}relative(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.relative()}relativePosix(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.relativePosix()}basename(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.name}dirname(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return(u.parent||u).fullpath()}async readdir(u=this.cwd,A={withFileTypes:true}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p}=A;if(!u.canReaddir()){return[]}else{const A=await u.readdir();return p?A:A.map((u=>u.name))}}readdirSync(u=this.cwd,A={withFileTypes:true}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true}=A;if(!u.canReaddir()){return[]}else if(p){return u.readdirSync()}else{return u.readdirSync().map((u=>u.name))}}async lstat(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.lstat()}lstatSync(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.lstatSync()}async readlink(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=await u.readlink();return A?p:p?.fullpath()}readlinkSync(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=u.readlinkSync();return A?p:p?.fullpath()}async realpath(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=await u.realpath();return A?p:p?.fullpath()}realpathSync(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=u.realpathSync();return A?p:p?.fullpath()}async walk(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=[];if(!E||E(u)){I.push(p?u:u.fullpath())}const w=new Set;const walk=(u,A)=>{w.add(u);u.readdirCB(((u,v)=>{if(u){return A(u)}let B=v.length;if(!B)return A();const next=()=>{if(--B===0){A()}};for(const u of v){if(!E||E(u)){I.push(p?u:u.fullpath())}if(y&&u.isSymbolicLink()){u.realpath().then((u=>u?.isUnknown()?u.lstat():u)).then((u=>u?.shouldWalk(w,C)?walk(u,next):next()))}else{if(u.shouldWalk(w,C)){walk(u,next)}else{next()}}}}),true)};const v=u;return new Promise(((u,A)=>{walk(v,(p=>{if(p)return A(p);u(I)}))}))}walkSync(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=[];if(!E||E(u)){I.push(p?u:u.fullpath())}const w=new Set([u]);for(const u of w){const A=u.readdirSync();for(const u of A){if(!E||E(u)){I.push(p?u:u.fullpath())}let A=u;if(u.isSymbolicLink()){if(!(y&&(A=u.realpathSync())))continue;if(A.isUnknown())A.lstatSync()}if(A.shouldWalk(w,C)){w.add(A)}}}return I}[Symbol.asyncIterator](){return this.iterate()}iterate(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}return this.stream(u,A)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;if(!E||E(u)){yield p?u:u.fullpath()}const I=new Set([u]);for(const u of I){const A=u.readdirSync();for(const u of A){if(!E||E(u)){yield p?u:u.fullpath()}let A=u;if(u.isSymbolicLink()){if(!(y&&(A=u.realpathSync())))continue;if(A.isUnknown())A.lstatSync()}if(A.shouldWalk(I,C)){I.add(A)}}}}stream(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=new Minipass({objectMode:true});if(!E||E(u)){I.write(p?u:u.fullpath())}const w=new Set;const v=[u];let B=0;const process=()=>{let u=false;while(!u){const A=v.shift();if(!A){if(B===0)I.end();return}B++;w.add(A);const onReaddir=(A,D,k=false)=>{if(A)return I.emit("error",A);if(y&&!k){const u=[];for(const A of D){if(A.isSymbolicLink()){u.push(A.realpath().then((u=>u?.isUnknown()?u.lstat():u)))}}if(u.length){Promise.all(u).then((()=>onReaddir(null,D,true)));return}}for(const A of D){if(A&&(!E||E(A))){if(!I.write(p?A:A.fullpath())){u=true}}}B--;for(const u of D){const A=u.realpathCached()||u;if(A.shouldWalk(w,C)){v.push(A)}}if(u&&!I.flowing){I.once("drain",process)}else if(!S){process()}};let S=true;A.readdirCB(onReaddir,true);S=false}};process();return I}streamSync(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=new Minipass({objectMode:true});const w=new Set;if(!E||E(u)){I.write(p?u:u.fullpath())}const v=[u];let B=0;const process=()=>{let u=false;while(!u){const A=v.shift();if(!A){if(B===0)I.end();return}B++;w.add(A);const S=A.readdirSync();for(const A of S){if(!E||E(A)){if(!I.write(p?A:A.fullpath())){u=true}}}B--;for(const u of S){let A=u;if(u.isSymbolicLink()){if(!(y&&(A=u.realpathSync())))continue;if(A.isUnknown())A.lstatSync()}if(A.shouldWalk(w,C)){v.push(A)}}}if(u&&!I.flowing)I.once("drain",process)};process();return I}chdir(u=this.cwd){const A=this.cwd;this.cwd=typeof u==="string"?this.cwd.resolve(u):u;this.cwd[Ht](A)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(u=process.cwd(),A={}){const{nocase:p=true}=A;super(u,Fe.win32,"\\",{...A,nocase:p});this.nocase=p;for(let u=this.cwd;u;u=u.parent){u.nocase=this.nocase}}parseRootPath(u){return Fe.win32.parse(u).root.toUpperCase()}newRoot(u){return new PathWin32(this.rootPath,vt,undefined,this.roots,this.nocase,this.childrenCache(),{fs:u})}isAbsolute(u){return u.startsWith("/")||u.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(u)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(u=process.cwd(),A={}){const{nocase:p=false}=A;super(u,Fe.posix,"/",{...A,nocase:p});this.nocase=p}parseRootPath(u){return"/"}newRoot(u){return new PathPosix(this.rootPath,vt,undefined,this.roots,this.nocase,this.childrenCache(),{fs:u})}isAbsolute(u){return u.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(u=process.cwd(),A={}){const{nocase:p=true}=A;super(u,{...A,nocase:p})}}const Gt=process.platform==="win32"?PathWin32:PathPosix;const Wt=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;const isPatternList=u=>u.length>=1;const isGlobList=u=>u.length>=1;class Pattern{#nt;#rt;#st;length;#it;#ot;#at;#lt;#ct;#ut;#dt=true;constructor(u,A,p,y){if(!isPatternList(u)){throw new TypeError("empty pattern list")}if(!isGlobList(A)){throw new TypeError("empty glob list")}if(A.length!==u.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=u.length;if(p<0||p>=this.length){throw new TypeError("index out of range")}this.#nt=u;this.#rt=A;this.#st=p;this.#it=y;if(this.#st===0){if(this.isUNC()){const[u,A,p,y,...E]=this.#nt;const[C,I,w,v,...B]=this.#rt;if(E[0]===""){E.shift();B.shift()}const S=[u,A,p,y,""].join("/");const D=[C,I,w,v,""].join("/");this.#nt=[S,...E];this.#rt=[D,...B];this.length=this.#nt.length}else if(this.isDrive()||this.isAbsolute()){const[u,...A]=this.#nt;const[p,...y]=this.#rt;if(A[0]===""){A.shift();y.shift()}const E=u+"/";const C=p+"/";this.#nt=[E,...A];this.#rt=[C,...y];this.length=this.#nt.length}}}pattern(){return this.#nt[this.#st]}isString(){return typeof this.#nt[this.#st]==="string"}isGlobstar(){return this.#nt[this.#st]===me}isRegExp(){return this.#nt[this.#st]instanceof RegExp}globString(){return this.#at=this.#at||(this.#st===0?this.isAbsolute()?this.#rt[0]+this.#rt.slice(1).join("/"):this.#rt.join("/"):this.#rt.slice(this.#st).join("/"))}hasMore(){return this.length>this.#st+1}rest(){if(this.#ot!==undefined)return this.#ot;if(!this.hasMore())return this.#ot=null;this.#ot=new Pattern(this.#nt,this.#rt,this.#st+1,this.#it);this.#ot.#ut=this.#ut;this.#ot.#ct=this.#ct;this.#ot.#lt=this.#lt;return this.#ot}isUNC(){const u=this.#nt;return this.#ct!==undefined?this.#ct:this.#ct=this.#it==="win32"&&this.#st===0&&u[0]===""&&u[1]===""&&typeof u[2]==="string"&&!!u[2]&&typeof u[3]==="string"&&!!u[3]}isDrive(){const u=this.#nt;return this.#lt!==undefined?this.#lt:this.#lt=this.#it==="win32"&&this.#st===0&&this.length>1&&typeof u[0]==="string"&&/^[a-z]:$/i.test(u[0])}isAbsolute(){const u=this.#nt;return this.#ut!==undefined?this.#ut:this.#ut=u[0]===""&&u.length>1||this.isDrive()||this.isUNC()}root(){const u=this.#nt[0];return typeof u==="string"&&this.isAbsolute()&&this.#st===0?u:""}checkFollowGlobstar(){return!(this.#st===0||!this.isGlobstar()||!this.#dt)}markFollowGlobstar(){if(this.#st===0||!this.isGlobstar()||!this.#dt)return false;this.#dt=false;return true}}const jt=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(u,{nobrace:A,nocase:p,noext:y,noglobstar:E,platform:C=jt}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=C;this.mmopts={dot:true,nobrace:A,nocase:p,noext:y,noglobstar:E,optimizationLevel:2,platform:C,nocomment:true,nonegate:true};for(const A of u)this.add(A)}add(u){const A=new Minimatch(u,this.mmopts);for(let u=0;u<A.set.length;u++){const p=A.set[u];const y=A.globParts[u];if(!p||!y){throw new Error("invalid pattern object")}while(p[0]==="."&&y[0]==="."){p.shift();y.shift()}const E=new Pattern(p,y,0,this.platform);const C=new Minimatch(E.globString(),this.mmopts);const I=y[y.length-1]==="**";const w=E.isAbsolute();if(w)this.absolute.push(C);else this.relative.push(C);if(I){if(w)this.absoluteChildren.push(C);else this.relativeChildren.push(C)}}}ignored(u){const A=u.fullpath();const p=`${A}/`;const y=u.relative()||".";const E=`${y}/`;for(const u of this.relative){if(u.match(y)||u.match(E))return true}for(const u of this.absolute){if(u.match(A)||u.match(p))return true}return false}childrenIgnored(u){const A=u.fullpath()+"/";const p=(u.relative()||".")+"/";for(const u of this.relativeChildren){if(u.match(p))return true}for(const u of this.absoluteChildren){if(u.match(A))return true}return false}}class HasWalkedCache{store;constructor(u=new Map){this.store=u}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(u,A){return this.store.get(u.fullpath())?.has(A.globString())}storeWalked(u,A){const p=u.fullpath();const y=this.store.get(p);if(y)y.add(A.globString());else this.store.set(p,new Set([A.globString()]))}}class MatchRecord{store=new Map;add(u,A,p){const y=(A?2:0)|(p?1:0);const E=this.store.get(u);this.store.set(u,E===undefined?y:y&E)}entries(){return[...this.store.entries()].map((([u,A])=>[u,!!(A&2),!!(A&1)]))}}class SubWalks{store=new Map;add(u,A){if(!u.canReaddir()){return}const p=this.store.get(u);if(p){if(!p.find((u=>u.globString()===A.globString()))){p.push(A)}}else this.store.set(u,[A])}get(u){const A=this.store.get(u);if(!A){throw new Error("attempting to walk unknown path")}return A}entries(){return this.keys().map((u=>[u,this.store.get(u)]))}keys(){return[...this.store.keys()].filter((u=>u.canReaddir()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(u,A){this.opts=u;this.follow=!!u.follow;this.dot=!!u.dot;this.hasWalkedCache=A?A.copy():new HasWalkedCache}processPatterns(u,A){this.patterns=A;const p=A.map((A=>[u,A]));for(let[u,A]of p){this.hasWalkedCache.storeWalked(u,A);const p=A.root();const y=A.isAbsolute()&&this.opts.absolute!==false;if(p){u=u.resolve(p==="/"&&this.opts.root!==undefined?this.opts.root:p);const y=A.rest();if(!y){this.matches.add(u,true,false);continue}else{A=y}}if(u.isENOENT())continue;let E;let C;let I=false;while(typeof(E=A.pattern())==="string"&&(C=A.rest())){const p=u.resolve(E);u=p;A=C;I=true}E=A.pattern();C=A.rest();if(I){if(this.hasWalkedCache.hasWalked(u,A))continue;this.hasWalkedCache.storeWalked(u,A)}if(typeof E==="string"){const A=E===".."||E===""||E===".";this.matches.add(u.resolve(E),y,A);continue}else if(E===me){if(!u.isSymbolicLink()||this.follow||A.checkFollowGlobstar()){this.subwalks.add(u,A)}const p=C?.pattern();const E=C?.rest();if(!C||(p===""||p===".")&&!E){this.matches.add(u,y,p===""||p===".")}else{if(p===".."){const A=u.parent||u;if(!E)this.matches.add(A,y,true);else if(!this.hasWalkedCache.hasWalked(A,E)){this.subwalks.add(A,E)}}}}else if(E instanceof RegExp){this.subwalks.add(u,A)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(u,A){const p=this.subwalks.get(u);const y=this.child();for(const u of A){for(const A of p){const p=A.isAbsolute();const E=A.pattern();const C=A.rest();if(E===me){y.testGlobstar(u,A,C,p)}else if(E instanceof RegExp){y.testRegExp(u,E,C,p)}else{y.testString(u,E,C,p)}}}return y}testGlobstar(u,A,p,y){if(this.dot||!u.name.startsWith(".")){if(!A.hasMore()){this.matches.add(u,y,false)}if(u.canReaddir()){if(this.follow||!u.isSymbolicLink()){this.subwalks.add(u,A)}else if(u.isSymbolicLink()){if(p&&A.checkFollowGlobstar()){this.subwalks.add(u,p)}else if(A.markFollowGlobstar()){this.subwalks.add(u,A)}}}}if(p){const A=p.pattern();if(typeof A==="string"&&A!==".."&&A!==""&&A!=="."){this.testString(u,A,p.rest(),y)}else if(A===".."){const A=u.parent||u;this.subwalks.add(A,p)}else if(A instanceof RegExp){this.testRegExp(u,A,p.rest(),y)}}}testRegExp(u,A,p,y){if(!A.test(u.name))return;if(!p){this.matches.add(u,y,false)}else{this.subwalks.add(u,p)}}testString(u,A,p,y){if(!u.isNamed(A))return;if(!p){this.matches.add(u,y,false)}else{this.subwalks.add(u,p)}}}const makeIgnore=(u,A)=>typeof u==="string"?new Ignore([u],A):Array.isArray(u)?new Ignore(u,A):u;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#ft=[];#At;#ht;signal;maxDepth;includeChildMatches;constructor(u,A,p){this.patterns=u;this.path=A;this.opts=p;this.#ht=!p.posix&&p.platform==="win32"?"\\":"/";this.includeChildMatches=p.includeChildMatches!==false;if(p.ignore||!this.includeChildMatches){this.#At=makeIgnore(p.ignore??[],p);if(!this.includeChildMatches&&typeof this.#At.add!=="function"){const u="cannot ignore child matches, ignore lacks add() method.";throw new Error(u)}}this.maxDepth=p.maxDepth||Infinity;if(p.signal){this.signal=p.signal;this.signal.addEventListener("abort",(()=>{this.#ft.length=0}))}}#pt(u){return this.seen.has(u)||!!this.#At?.ignored?.(u)}#gt(u){return!!this.#At?.childrenIgnored?.(u)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let u=undefined;while(!this.paused&&(u=this.#ft.shift())){u()}}onResume(u){if(this.signal?.aborted)return;if(!this.paused){u()}else{this.#ft.push(u)}}async matchCheck(u,A){if(A&&this.opts.nodir)return undefined;let p;if(this.opts.realpath){p=u.realpathCached()||await u.realpath();if(!p)return undefined;u=p}const y=u.isUnknown()||this.opts.stat;const E=y?await u.lstat():u;if(this.opts.follow&&this.opts.nodir&&E?.isSymbolicLink()){const u=await E.realpath();if(u&&(u.isUnknown()||this.opts.stat)){await u.lstat()}}return this.matchCheckTest(E,A)}matchCheckTest(u,A){return u&&(this.maxDepth===Infinity||u.depth()<=this.maxDepth)&&(!A||u.canReaddir())&&(!this.opts.nodir||!u.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!u.isSymbolicLink()||!u.realpathCached()?.isDirectory())&&!this.#pt(u)?u:undefined}matchCheckSync(u,A){if(A&&this.opts.nodir)return undefined;let p;if(this.opts.realpath){p=u.realpathCached()||u.realpathSync();if(!p)return undefined;u=p}const y=u.isUnknown()||this.opts.stat;const E=y?u.lstatSync():u;if(this.opts.follow&&this.opts.nodir&&E?.isSymbolicLink()){const u=E.realpathSync();if(u&&(u?.isUnknown()||this.opts.stat)){u.lstatSync()}}return this.matchCheckTest(E,A)}matchFinish(u,A){if(this.#pt(u))return;if(!this.includeChildMatches&&this.#At?.add){const A=`${u.relativePosix()}/**`;this.#At.add(A)}const p=this.opts.absolute===undefined?A:this.opts.absolute;this.seen.add(u);const y=this.opts.mark&&u.isDirectory()?this.#ht:"";if(this.opts.withFileTypes){this.matchEmit(u)}else if(p){const A=this.opts.posix?u.fullpathPosix():u.fullpath();this.matchEmit(A+y)}else{const A=this.opts.posix?u.relativePosix():u.relative();const p=this.opts.dotRelative&&!A.startsWith(".."+this.#ht)?"."+this.#ht:"";this.matchEmit(!A?"."+y:p+A+y)}}async match(u,A,p){const y=await this.matchCheck(u,p);if(y)this.matchFinish(y,A)}matchSync(u,A,p){const y=this.matchCheckSync(u,p);if(y)this.matchFinish(y,A)}walkCB(u,A,p){if(this.signal?.aborted)p();this.walkCB2(u,A,new Processor(this.opts),p)}walkCB2(u,A,p,y){if(this.#gt(u))return y();if(this.signal?.aborted)y();if(this.paused){this.onResume((()=>this.walkCB2(u,A,p,y)));return}p.processPatterns(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;E++;this.match(u,A,y).then((()=>next()))}for(const u of p.subwalkTargets()){if(this.maxDepth!==Infinity&&u.depth()>=this.maxDepth){continue}E++;const A=u.readdirCached();if(u.calledReaddir())this.walkCB3(u,A,p,next);else{u.readdirCB(((A,y)=>this.walkCB3(u,y,p,next)),true)}}next()}walkCB3(u,A,p,y){p=p.filterEntries(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;E++;this.match(u,A,y).then((()=>next()))}for(const[u,A]of p.subwalks.entries()){E++;this.walkCB2(u,A,p.child(),next)}next()}walkCBSync(u,A,p){if(this.signal?.aborted)p();this.walkCB2Sync(u,A,new Processor(this.opts),p)}walkCB2Sync(u,A,p,y){if(this.#gt(u))return y();if(this.signal?.aborted)y();if(this.paused){this.onResume((()=>this.walkCB2Sync(u,A,p,y)));return}p.processPatterns(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;this.matchSync(u,A,y)}for(const u of p.subwalkTargets()){if(this.maxDepth!==Infinity&&u.depth()>=this.maxDepth){continue}E++;const A=u.readdirSync();this.walkCB3Sync(u,A,p,next)}next()}walkCB3Sync(u,A,p,y){p=p.filterEntries(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;this.matchSync(u,A,y)}for(const[u,A]of p.subwalks.entries()){E++;this.walkCB2Sync(u,A,p.child(),next)}next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(u,A,p){super(u,A,p)}matchEmit(u){this.matches.add(u)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((u,A)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){A(this.signal.reason)}else{u(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}class GlobStream extends GlobUtil{results;constructor(u,A,p){super(u,A,p);this.results=new Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(u){this.results.write(u);if(!this.results.flowing)this.pause()}stream(){const u=this.path;if(u.isUnknown()){u.lstat().then((()=>{this.walkCB(u,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(u,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}const zt=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(u,A){if(!A)throw new TypeError("glob options required");this.withFileTypes=!!A.withFileTypes;this.signal=A.signal;this.follow=!!A.follow;this.dot=!!A.dot;this.dotRelative=!!A.dotRelative;this.nodir=!!A.nodir;this.mark=!!A.mark;if(!A.cwd){this.cwd=""}else if(A.cwd instanceof URL||A.cwd.startsWith("file://")){A.cwd=(0,we.fileURLToPath)(A.cwd)}this.cwd=A.cwd||"";this.root=A.root;this.magicalBraces=!!A.magicalBraces;this.nobrace=!!A.nobrace;this.noext=!!A.noext;this.realpath=!!A.realpath;this.absolute=A.absolute;this.includeChildMatches=A.includeChildMatches!==false;this.noglobstar=!!A.noglobstar;this.matchBase=!!A.matchBase;this.maxDepth=typeof A.maxDepth==="number"?A.maxDepth:Infinity;this.stat=!!A.stat;this.ignore=A.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof u==="string"){u=[u]}this.windowsPathsNoEscape=!!A.windowsPathsNoEscape||A.allowWindowsEscape===false;if(this.windowsPathsNoEscape){u=u.map((u=>u.replace(/\\/g,"/")))}if(this.matchBase){if(A.noglobstar){throw new TypeError("base matching requires globstar")}u=u.map((u=>u.includes("/")?u:`./**/${u}`))}this.pattern=u;this.platform=A.platform||zt;this.opts={...A,platform:this.platform};if(A.scurry){this.scurry=A.scurry;if(A.nocase!==undefined&&A.nocase!==A.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const u=A.platform==="win32"?PathScurryWin32:A.platform==="darwin"?PathScurryDarwin:A.platform?PathScurryPosix:Wt;this.scurry=new u(this.cwd,{nocase:A.nocase,fs:A.fs})}this.nocase=this.scurry.nocase;const p=this.platform==="darwin"||this.platform==="win32";const y={...A,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:p,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const E=this.pattern.map((u=>new Minimatch(u,y)));const[C,I]=E.reduce(((u,A)=>{u[0].push(...A.set);u[1].push(...A.globParts);return u}),[[],[]]);this.patterns=C.map(((u,A)=>{const p=I[A];if(!p)throw new Error("invalid pattern object");return new Pattern(u,p,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(u,A={})=>{if(!Array.isArray(u)){u=[u]}for(const p of u){if(new Minimatch(p,A).hasMagic())return true}return false};function globStreamSync(u,A={}){return new Glob(u,A).streamSync()}function globStream(u,A={}){return new Glob(u,A).stream()}function globSync(u,A={}){return new Glob(u,A).walkSync()}async function glob_(u,A={}){return new Glob(u,A).walk()}function globIterateSync(u,A={}){return new Glob(u,A).iterateSync()}function globIterate(u,A={}){return new Glob(u,A).iterate()}const $t=globStreamSync;const qt=Object.assign(globStream,{sync:globStreamSync});const Vt=globIterateSync;const Kt=Object.assign(globIterate,{sync:globIterateSync});const Jt=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});const Yt=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:Jt,globStream:globStream,stream:qt,globStreamSync:globStreamSync,streamSync:$t,globIterate:globIterate,iterate:Kt,globIterateSync:globIterateSync,iterateSync:Vt,Glob:Glob,hasMagic:hasMagic,escape:escape_escape,unescape:unescape_unescape});Yt.glob=Yt;const FindFiles=async u=>{const{pattern:A,dir_path:p=".",case_sensitive:E=false,ignore:I=[]}=u;try{const u=C().resolve(B.$.WORKSPACE_DIR,p);let w=[];try{const u=C().resolve(B.$.WORKSPACE_DIR,".gitignore");const A=await(0,y.readFile)(u,"utf-8");w=A.split("\n").filter((u=>u.trim()&&!u.trim().startsWith("#"))).map((u=>u.trim())).map((u=>u.endsWith("/")?`${u}**`:u)).filter((u=>!u.startsWith(".codegen")))}catch(u){}const v=[...I,...w];const S=await Yt(A,{cwd:u,absolute:true,stat:true,nocase:!E,ignore:v});const D=await Promise.all(S.map((async u=>{const A=await(0,y.stat)(u);return{file:u,mtime:A.mtime}})));D.sort(((u,A)=>A.mtime.getTime()-u.mtime.getTime()));return{files:D.map((u=>u.file))}}catch(u){return{error:u.message}}};var Xt=p(5317);var Zt=p(857);var en=p.n(Zt);const normalizeLine=u=>{if(u.startsWith("Error: ")){return u.slice("Error: ".length)}if(u.startsWith("VError: ")){return u.slice("VError: ".length)}return u};const getCombinedMessage=(u,A)=>{const p=normalizeLine(`${u}`);if(A){return`${A}: ${p}`}return p};const tn="\n";const getNewLineIndex=(u,A=undefined)=>u.indexOf(tn,A);const mergeStacks=(u,A)=>{if(!A){return u}const p=getNewLineIndex(u);const y=getNewLineIndex(A);if(y===-1){return u}const E=u.slice(0,p);const C=A.slice(y);const I=normalizeLine(A.slice(0,y));if(E.includes(I)){return E+C}return A};class VError extends Error{constructor(u,A){const p=getCombinedMessage(u,A);super(p);this.name="VError";if(u instanceof Error){this.stack=mergeStacks(this.stack,u.stack)}if(u.codeFrame){this.codeFrame=u.codeFrame}if(u.code){this.code=u.code}}}function isPlainObject(u){if(typeof u!=="object"||u===null){return false}const A=Object.getPrototypeOf(u);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(Symbol.toStringTag in u)&&!(Symbol.iterator in u)}const safeNormalizeFileUrl=(u,A)=>{const p=normalizeFileUrl(normalizeDenoExecPath(u));if(typeof p!=="string"){throw new TypeError(`${A} must be a string or a file URL: ${p}.`)}return p};const normalizeDenoExecPath=u=>isDenoExecPath(u)?u.toString():u;const isDenoExecPath=u=>typeof u!=="string"&&u&&Object.getPrototypeOf(u)===String.prototype;const normalizeFileUrl=u=>u instanceof URL?(0,we.fileURLToPath)(u):u;const normalizeParameters=(u,A=[],p={})=>{const y=safeNormalizeFileUrl(u,"First argument");const[E,C]=isPlainObject(A)?[[],A]:[A,p];if(!Array.isArray(E)){throw new TypeError(`Second argument must be either an array of arguments or an options object: ${E}`)}if(E.some((u=>typeof u==="object"&&u!==null))){throw new TypeError(`Second argument must be an array of strings: ${E}`)}const I=E.map(String);const w=I.find((u=>u.includes("\0")));if(w!==undefined){throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${w}`)}if(!isPlainObject(C)){throw new TypeError(`Last argument must be an options object: ${C}`)}return[y,I,C]};const nn=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");const{toString:rn}=Object.prototype;const isArrayBuffer=u=>rn.call(u)==="[object ArrayBuffer]";const isUint8Array=u=>rn.call(u)==="[object Uint8Array]";const bufferToUint8Array=u=>new Uint8Array(u.buffer,u.byteOffset,u.byteLength);const sn=new TextEncoder;const stringToUint8Array=u=>sn.encode(u);const on=new TextDecoder;const uint8ArrayToString=u=>on.decode(u);const joinToString=(u,A)=>{const p=uint8ArraysToStrings(u,A);return p.join("")};const uint8ArraysToStrings=(u,A)=>{if(A==="utf8"&&u.every((u=>typeof u==="string"))){return u}const p=new Oe.StringDecoder(A);const y=u.map((u=>typeof u==="string"?stringToUint8Array(u):u)).map((u=>p.write(u)));const E=p.end();return E===""?y:[...y,E]};const joinToUint8Array=u=>{if(u.length===1&&isUint8Array(u[0])){return u[0]}return concatUint8Arrays(stringsToUint8Arrays(u))};const stringsToUint8Arrays=u=>u.map((u=>typeof u==="string"?stringToUint8Array(u):u));const concatUint8Arrays=u=>{const A=new Uint8Array(getJoinLength(u));let p=0;for(const y of u){A.set(y,p);p+=y.length}return A};const getJoinLength=u=>{let A=0;for(const p of u){A+=p.length}return A};const isTemplateString=u=>Array.isArray(u)&&Array.isArray(u.raw);const parseTemplates=(u,A)=>{let p=[];for(const[y,E]of u.entries()){p=parseTemplate({templates:u,expressions:A,tokens:p,index:y,template:E})}if(p.length===0){throw new TypeError("Template script must not be empty")}const[y,...E]=p;return[y,E,{}]};const parseTemplate=({templates:u,expressions:A,tokens:p,index:y,template:E})=>{if(E===undefined){throw new TypeError(`Invalid backslash sequence: ${u.raw[y]}`)}const{nextTokens:C,leadingWhitespaces:I,trailingWhitespaces:w}=splitByWhitespaces(E,u.raw[y]);const v=concatTokens(p,C,I);if(y===A.length){return v}const B=A[y];const S=Array.isArray(B)?B.map((u=>parseExpression(u))):[parseExpression(B)];return concatTokens(v,S,w)};const splitByWhitespaces=(u,A)=>{if(A.length===0){return{nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false}}const p=[];let y=0;const E=an.has(A[0]);for(let E=0,C=0;E<u.length;E+=1,C+=1){const I=A[C];if(an.has(I)){if(y!==E){p.push(u.slice(y,E))}y=E+1}else if(I==="\\"){const u=A[C+1];if(u==="\n"){E-=1;C+=1}else if(u==="u"&&A[C+2]==="{"){C=A.indexOf("}",C+3)}else{C+=ln[u]??1}}}const C=y===u.length;if(!C){p.push(u.slice(y))}return{nextTokens:p,leadingWhitespaces:E,trailingWhitespaces:C}};const an=new Set([" ","\t","\r","\n"]);const ln={x:3,u:5};const concatTokens=(u,A,p)=>p||u.length===0||A.length===0?[...u,...A]:[...u.slice(0,-1),`${u.at(-1)}${A[0]}`,...A.slice(1)];const parseExpression=u=>{const A=typeof u;if(A==="string"){return u}if(A==="number"){return String(u)}if(isPlainObject(u)&&("stdout"in u||"isMaxBuffer"in u)){return getSubprocessResult(u)}if(u instanceof nn.ChildProcess||Object.prototype.toString.call(u)==="[object Promise]"){throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.")}throw new TypeError(`Unexpected "${A}" in template expression`)};const getSubprocessResult=({stdout:u})=>{if(typeof u==="string"){return u}if(isUint8Array(u)){return uint8ArrayToString(u)}if(u===undefined){throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.')}throw new TypeError(`Unexpected "${typeof u}" stdout in template expression`)};const cn=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util");var un=p(1708);const isStandardStream=u=>dn.includes(u);const dn=[un.stdin,un.stdout,un.stderr];const fn=["stdin","stdout","stderr"];const getStreamName=u=>fn[u]??`stdio[${u}]`;const normalizeFdSpecificOptions=u=>{const A={...u};for(const p of gn){A[p]=normalizeFdSpecificOption(u,p)}return A};const normalizeFdSpecificOption=(u,A)=>{const p=Array.from({length:getStdioLength(u)+1});const y=normalizeFdSpecificValue(u[A],p,A);return addDefaultValue(y,A)};const getStdioLength=({stdio:u})=>Array.isArray(u)?Math.max(u.length,fn.length):fn.length;const normalizeFdSpecificValue=(u,A,p)=>isPlainObject(u)?normalizeOptionObject(u,A,p):A.fill(u);const normalizeOptionObject=(u,A,p)=>{for(const y of Object.keys(u).sort(compareFdName)){for(const E of parseFdName(y,p,A)){A[E]=u[y]}}return A};const compareFdName=(u,A)=>getFdNameOrder(u)<getFdNameOrder(A)?1:-1;const getFdNameOrder=u=>{if(u==="stdout"||u==="stderr"){return 0}return u==="all"?2:1};const parseFdName=(u,A,p)=>{if(u==="ipc"){return[p.length-1]}const y=parseFd(u);if(y===undefined||y===0){throw new TypeError(`"${A}.${u}" is invalid.\nIt must be "${A}.stdout", "${A}.stderr", "${A}.all", "${A}.ipc", or "${A}.fd3", "${A}.fd4" (and so on).`)}if(y>=p.length){throw new TypeError(`"${A}.${u}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}return y==="all"?[1,2]:[y]};const parseFd=u=>{if(u==="all"){return u}if(fn.includes(u)){return fn.indexOf(u)}const A=An.exec(u);if(A!==null){return Number(A[1])}};const An=/^fd(\d+)$/;const addDefaultValue=(u,A)=>u.map((u=>u===undefined?pn[A]:u));const hn=(0,cn.debuglog)("execa").enabled?"full":"none";const pn={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:hn,stripFinalNewline:true};const gn=["lines","buffer","maxBuffer","verbose","stripFinalNewline"];const getFdSpecificValue=(u,A)=>A==="ipc"?u.at(-1):u[A];const isVerbose=({verbose:u},A)=>getFdVerbose(u,A)!=="none";const isFullVerbose=({verbose:u},A)=>!["none","short"].includes(getFdVerbose(u,A));const getVerboseFunction=({verbose:u},A)=>{const p=getFdVerbose(u,A);return isVerboseFunction(p)?p:undefined};const getFdVerbose=(u,A)=>A===undefined?getFdGenericVerbose(u):getFdSpecificValue(u,A);const getFdGenericVerbose=u=>u.find((u=>isVerboseFunction(u)))??mn.findLast((A=>u.includes(A)));const isVerboseFunction=u=>typeof u==="function";const mn=["none","short","full"];const joinCommand=(u,A)=>{const p=[u,...A];const y=p.join(" ");const E=p.map((u=>quoteString(escapeControlCharacters(u)))).join(" ");return{command:y,escapedCommand:E}};const escapeLines=u=>(0,cn.stripVTControlCharacters)(u).split("\n").map((u=>escapeControlCharacters(u))).join("\n");const escapeControlCharacters=u=>u.replaceAll(yn,(u=>escapeControlCharacter(u)));const escapeControlCharacter=u=>{const A=En[u];if(A!==undefined){return A}const p=u.codePointAt(0);const y=p.toString(16);return p<=Cn?`\\u${y.padStart(4,"0")}`:`\\U${y}`};const getSpecialCharRegExp=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}};const yn=getSpecialCharRegExp();const En={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};const Cn=65535;const quoteString=u=>{if(In.test(u)){return u}return un.platform==="win32"?`"${u.replaceAll('"','""')}"`:`'${u.replaceAll("'","'\\''")}'`};const In=/^[\w./-]+$/;function isUnicodeSupported(){const{env:u}=un;const{TERM:A,TERM_PROGRAM:p}=u;if(un.platform!=="win32"){return A!=="linux"}return Boolean(u.WT_SESSION)||Boolean(u.TERMINUS_SUBLIME)||u.ConEmuTask==="{cmd::Cmder}"||p==="Terminus-Sublime"||p==="vscode"||A==="xterm-256color"||A==="alacritty"||A==="rxvt-unicode"||A==="rxvt-unicode-256color"||u.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const bn={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"};const wn={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"};const vn={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"};const Bn={...bn,...wn};const Sn={...bn,...vn};const Dn=isUnicodeSupported();const kn=Dn?Bn:Sn;const Qn=kn;const Fn=Object.entries(wn);const replaceSymbols=(u,{useFallback:A=!Dn}={})=>{if(A){for(const[A,p]of Fn){u=u.replaceAll(p,Sn[A])}}return u};var xn=p(7066);const Rn=xn?.WriteStream?.prototype?.hasColors?.()??false;const format=(u,A)=>{if(!Rn){return u=>u}const p=`[${u}m`;const y=`[${A}m`;return u=>{const E=u+"";let C=E.indexOf(y);if(C===-1){return p+E+y}let I=p;let w=0;const v=A===22;const B=(v?y:"")+p;while(C!==-1){I+=E.slice(w,C)+B;w=C+y.length;C=E.indexOf(y,w)}I+=E.slice(w)+y;return I}};const _n=format(0,0);const Tn=format(1,22);const Nn=format(2,22);const Ln=format(3,23);const Pn=format(4,24);const On=format(53,55);const Mn=format(7,27);const Un=format(8,28);const Hn=format(9,29);const Gn=format(30,39);const Wn=format(31,39);const jn=format(32,39);const zn=format(33,39);const $n=format(34,39);const qn=format(35,39);const Vn=format(36,39);const Kn=format(37,39);const Jn=format(90,39);const Yn=format(40,49);const Xn=format(41,49);const Zn=format(42,49);const er=format(43,49);const tr=format(44,49);const nr=format(45,49);const rr=format(46,49);const sr=format(47,49);const ir=format(100,49);const or=format(91,39);const ar=format(92,39);const lr=format(93,39);const cr=format(94,39);const ur=format(95,39);const dr=format(96,39);const fr=format(97,39);const Ar=format(101,49);const hr=format(102,49);const pr=format(103,49);const gr=format(104,49);const mr=format(105,49);const yr=format(106,49);const Er=format(107,49);const defaultVerboseFunction=({type:u,message:A,timestamp:p,piped:y,commandId:E,result:{failed:C=false}={},options:{reject:I=true}})=>{const w=serializeTimestamp(p);const v=Cr[u]({failed:C,reject:I,piped:y});const B=Ir[u]({reject:I});return`${Jn(`[${w}]`)} ${Jn(`[${E}]`)} ${B(v)} ${B(A)}`};const serializeTimestamp=u=>`${padField(u.getHours(),2)}:${padField(u.getMinutes(),2)}:${padField(u.getSeconds(),2)}.${padField(u.getMilliseconds(),3)}`;const padField=(u,A)=>String(u).padStart(A,"0");const getFinalIcon=({failed:u,reject:A})=>{if(!u){return Qn.tick}return A?Qn.cross:Qn.warning};const Cr={command:({piped:u})=>u?"|":"$",output:()=>" ",ipc:()=>"*",error:getFinalIcon,duration:getFinalIcon};const identity=u=>u;const Ir={command:()=>Tn,output:()=>identity,ipc:()=>identity,error:({reject:u})=>u?or:lr,duration:()=>Jn};const applyVerboseOnLines=(u,A,p)=>{const y=getVerboseFunction(A,p);return u.map((({verboseLine:u,verboseObject:A})=>applyVerboseFunction(u,A,y))).filter((u=>u!==undefined)).map((u=>appendNewline(u))).join("")};const applyVerboseFunction=(u,A,p)=>{if(p===undefined){return u}const y=p(u,A);if(typeof y==="string"){return y}};const appendNewline=u=>u.endsWith("\n")?u:`${u}\n`;const verboseLog=({type:u,verboseMessage:A,fdNumber:p,verboseInfo:y,result:E})=>{const C=getVerboseObject({type:u,result:E,verboseInfo:y});const I=getPrintedLines(A,C);const w=applyVerboseOnLines(I,y,p);if(w!==""){console.warn(w.slice(0,-1))}};const getVerboseObject=({type:u,result:A,verboseInfo:{escapedCommand:p,commandId:y,rawOptions:{piped:E=false,...C}}})=>({type:u,escapedCommand:p,commandId:`${y}`,timestamp:new Date,piped:E,result:A,options:C});const getPrintedLines=(u,A)=>u.split("\n").map((u=>getPrintedLine({...A,message:u})));const getPrintedLine=u=>{const A=defaultVerboseFunction(u);return{verboseLine:A,verboseObject:u}};const serializeVerboseMessage=u=>{const A=typeof u==="string"?u:(0,cn.inspect)(u);const p=escapeLines(A);return p.replaceAll("\t"," ".repeat(br))};const br=2;const logCommand=(u,A)=>{if(!isVerbose(A)){return}verboseLog({type:"command",verboseMessage:u,verboseInfo:A})};const getVerboseInfo=(u,A,p)=>{validateVerbose(u);const y=getCommandId(u);return{verbose:u,escapedCommand:A,commandId:y,rawOptions:p}};const getCommandId=u=>isVerbose({verbose:u})?wr++:undefined;let wr=0n;const validateVerbose=u=>{for(const A of u){if(A===false){throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".')}if(A===true){throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".')}if(!mn.includes(A)&&!isVerboseFunction(A)){const u=mn.map((u=>`'${u}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${A}. Allowed values are: ${u} or a function.`)}}};const getStartTime=()=>un.hrtime.bigint();const getDurationMs=u=>Number(un.hrtime.bigint()-u)/1e6;const handleCommand=(u,A,p)=>{const y=getStartTime();const{command:E,escapedCommand:C}=joinCommand(u,A);const I=normalizeFdSpecificOption(p,"verbose");const w=getVerboseInfo(I,C,{...p});logCommand(C,w);return{command:E,escapedCommand:C,startTime:y,verboseInfo:w}};var vr=p(6186);function pathKey(u={}){const{env:A=process.env,platform:p=process.platform}=u;if(p!=="win32"){return"PATH"}return Object.keys(A).reverse().find((u=>u.toUpperCase()==="PATH"))||"Path"}const Br=(0,cn.promisify)(nn.execFile);function toPath(u){return u instanceof URL?(0,we.fileURLToPath)(u):u}function rootDirectory(u){return path.parse(toPath(u)).root}function traversePathUp(u){return{*[Symbol.iterator](){let A=Fe.resolve(toPath(u));let p;while(p!==A){yield A;p=A;A=Fe.resolve(A,"..")}}}}const Sr=null&&10*1024*1024;async function execFile(u,A,p={}){return Br(u,A,{maxBuffer:Sr,...p})}function execFileSync(u,A=[],p={}){return execFileSyncOriginal(u,A,{maxBuffer:Sr,encoding:"utf8",stdio:"pipe",...p})}const npmRunPath=({cwd:u=un.cwd(),path:A=un.env[pathKey()],preferLocal:p=true,execPath:y=un.execPath,addExecPath:E=true}={})=>{const C=Fe.resolve(toPath(u));const I=[];const w=A.split(Fe.delimiter);if(p){applyPreferLocal(I,w,C)}if(E){applyExecPath(I,w,y,C)}return A===""||A===Fe.delimiter?`${I.join(Fe.delimiter)}${A}`:[...I,A].join(Fe.delimiter)};const applyPreferLocal=(u,A,p)=>{for(const y of traversePathUp(p)){const p=Fe.join(y,"node_modules/.bin");if(!A.includes(p)){u.push(p)}}};const applyExecPath=(u,A,p,y)=>{const E=Fe.resolve(y,toPath(p),"..");if(!A.includes(E)){u.push(E)}};const npmRunPathEnv=({env:u=un.env,...A}={})=>{u={...u};const p=pathKey({env:u});A.path=u[p];u[p]=npmRunPath(A);return u};const Dr=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:timers/promises");const getFinalError=(u,A,p)=>{const y=p?ExecaSyncError:ExecaError;const E=u instanceof DiscardedError?{}:{cause:u};return new y(A,E)};class DiscardedError extends Error{}const setErrorName=(u,A)=>{Object.defineProperty(u.prototype,"name",{value:A,writable:true,enumerable:false,configurable:true});Object.defineProperty(u.prototype,kr,{value:true,writable:false,enumerable:false,configurable:false})};const isExecaError=u=>isErrorInstance(u)&&kr in u;const kr=Symbol("isExecaError");const isErrorInstance=u=>Object.prototype.toString.call(u)==="[object Error]";class ExecaError extends Error{}setErrorName(ExecaError,ExecaError.name);class ExecaSyncError extends Error{}setErrorName(ExecaSyncError,ExecaSyncError.name);var Qr=p(8161);const getRealtimeSignals=()=>{const u=xr-Fr+1;return Array.from({length:u},getRealtimeSignal)};const getRealtimeSignal=(u,A)=>({name:`SIGRT${A+1}`,number:Fr+A,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"});const Fr=34;const xr=64;const Rr=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];const getSignals=()=>{const u=getRealtimeSignals();const A=[...Rr,...u].map(normalizeSignal);return A};const normalizeSignal=({name:u,number:A,description:p,action:y,forced:E=false,standard:C})=>{const{signals:{[u]:I}}=Qr.constants;const w=I!==undefined;const v=w?I:A;return{name:u,number:v,description:p,supported:w,action:y,forced:E,standard:C}};const getSignalsByName=()=>{const u=getSignals();return Object.fromEntries(u.map(getSignalByName))};const getSignalByName=({name:u,number:A,description:p,supported:y,action:E,forced:C,standard:I})=>[u,{name:u,number:A,description:p,supported:y,action:E,forced:C,standard:I}];const _r=getSignalsByName();const getSignalsByNumber=()=>{const u=getSignals();const A=xr+1;const p=Array.from({length:A},((A,p)=>getSignalByNumber(p,u)));return Object.assign({},...p)};const getSignalByNumber=(u,A)=>{const p=findSignalByNumber(u,A);if(p===undefined){return{}}const{name:y,description:E,supported:C,action:I,forced:w,standard:v}=p;return{[u]:{name:y,number:u,description:E,supported:C,action:I,forced:w,standard:v}}};const findSignalByNumber=(u,A)=>{const p=A.find((({name:A})=>Qr.constants.signals[A]===u));if(p!==undefined){return p}return A.find((A=>A.number===u))};const Tr=getSignalsByNumber();const normalizeKillSignal=u=>{const A="option `killSignal`";if(u===0){throw new TypeError(`Invalid ${A}: 0 cannot be used.`)}return signal_normalizeSignal(u,A)};const normalizeSignalArgument=u=>u===0?u:signal_normalizeSignal(u,"`subprocess.kill()`'s argument");const signal_normalizeSignal=(u,A)=>{if(Number.isInteger(u)){return normalizeSignalInteger(u,A)}if(typeof u==="string"){return normalizeSignalName(u,A)}throw new TypeError(`Invalid ${A} ${String(u)}: it must be a string or an integer.\n${getAvailableSignals()}`)};const normalizeSignalInteger=(u,A)=>{if(Nr.has(u)){return Nr.get(u)}throw new TypeError(`Invalid ${A} ${u}: this signal integer does not exist.\n${getAvailableSignals()}`)};const getSignalsIntegerToName=()=>new Map(Object.entries(Qr.constants.signals).reverse().map((([u,A])=>[A,u])));const Nr=getSignalsIntegerToName();const normalizeSignalName=(u,A)=>{if(u in Qr.constants.signals){return u}if(u.toUpperCase()in Qr.constants.signals){throw new TypeError(`Invalid ${A} '${u}': please rename it to '${u.toUpperCase()}'.`)}throw new TypeError(`Invalid ${A} '${u}': this signal name does not exist.\n${getAvailableSignals()}`)};const getAvailableSignals=()=>`Available signal names: ${getAvailableSignalNames()}.\nAvailable signal numbers: ${getAvailableSignalIntegers()}.`;const getAvailableSignalNames=()=>Object.keys(Qr.constants.signals).sort().map((u=>`'${u}'`)).join(", ");const getAvailableSignalIntegers=()=>[...new Set(Object.values(Qr.constants.signals).sort(((u,A)=>u-A)))].join(", ");const getSignalDescription=u=>_r[u].description;const normalizeForceKillAfterDelay=u=>{if(u===false){return u}if(u===true){return Lr}if(!Number.isFinite(u)||u<0){throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${u}\` (${typeof u})`)}return u};const Lr=1e3*5;const subprocessKill=({kill:u,options:{forceKillAfterDelay:A,killSignal:p},onInternalError:y,context:E,controller:C},I,w)=>{const{signal:v,error:B}=parseKillArguments(I,w,p);emitKillError(B,y);const S=u(v);setKillTimeout({kill:u,signal:v,forceKillAfterDelay:A,killSignal:p,killResult:S,context:E,controller:C});return S};const parseKillArguments=(u,A,p)=>{const[y=p,E]=isErrorInstance(u)?[undefined,u]:[u,A];if(typeof y!=="string"&&!Number.isInteger(y)){throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(y)}`)}if(E!==undefined&&!isErrorInstance(E)){throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${E}`)}return{signal:normalizeSignalArgument(y),error:E}};const emitKillError=(u,A)=>{if(u!==undefined){A.reject(u)}};const setKillTimeout=async({kill:u,signal:A,forceKillAfterDelay:p,killSignal:y,killResult:E,context:C,controller:I})=>{if(A===y&&E){killOnTimeout({kill:u,forceKillAfterDelay:p,context:C,controllerSignal:I.signal})}};const killOnTimeout=async({kill:u,forceKillAfterDelay:A,context:p,controllerSignal:y})=>{if(A===false){return}try{await(0,Dr.setTimeout)(A,undefined,{signal:y});if(u("SIGKILL")){p.isForcefullyTerminated??=true}}catch{}};const onAbortedSignal=async(u,A)=>{if(!u.aborted){await(0,Le.once)(u,"abort",{signal:A})}};const validateCancelSignal=({cancelSignal:u})=>{if(u!==undefined&&Object.prototype.toString.call(u)!=="[object AbortSignal]"){throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(u)}`)}};const throwOnCancel=({subprocess:u,cancelSignal:A,gracefulCancel:p,context:y,controller:E})=>A===undefined||p?[]:[terminateOnCancel(u,A,y,E)];const terminateOnCancel=async(u,A,p,{signal:y})=>{await onAbortedSignal(A,y);p.terminationReason??="cancel";u.kill();throw A.reason};const validateIpcMethod=({methodName:u,isSubprocess:A,ipc:p,isConnected:y})=>{validateIpcOption(u,A,p);validateConnection(u,A,y)};const validateIpcOption=(u,A,p)=>{if(!p){throw new Error(`${getMethodName(u,A)} can only be used if the \`ipc\` option is \`true\`.`)}};const validateConnection=(u,A,p)=>{if(!p){throw new Error(`${getMethodName(u,A)} cannot be used: the ${getOtherProcessName(A)} has already exited or disconnected.`)}};const throwOnEarlyDisconnect=u=>{throw new Error(`${getMethodName("getOneMessage",u)} could not complete: the ${getOtherProcessName(u)} exited or disconnected.`)};const throwOnStrictDeadlockError=u=>{throw new Error(`${getMethodName("sendMessage",u)} failed: the ${getOtherProcessName(u)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${getMethodName("getOneMessage",u)},\n\t${getMethodName("sendMessage",u,"message, {strict: true}")},\n]);`)};const getStrictResponseError=(u,A)=>new Error(`${getMethodName("sendMessage",A)} failed when sending an acknowledgment response to the ${getOtherProcessName(A)}.`,{cause:u});const throwOnMissingStrict=u=>{throw new Error(`${getMethodName("sendMessage",u)} failed: the ${getOtherProcessName(u)} is not listening to incoming messages.`)};const throwOnStrictDisconnect=u=>{throw new Error(`${getMethodName("sendMessage",u)} failed: the ${getOtherProcessName(u)} exited without listening to incoming messages.`)};const getAbortDisconnectError=()=>new Error(`\`cancelSignal\` aborted: the ${getOtherProcessName(true)} disconnected.`);const throwOnMissingParent=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")};const handleEpipeError=({error:u,methodName:A,isSubprocess:p})=>{if(u.code==="EPIPE"){throw new Error(`${getMethodName(A,p)} cannot be used: the ${getOtherProcessName(p)} is disconnecting.`,{cause:u})}};const handleSerializationError=({error:u,methodName:A,isSubprocess:p,message:y})=>{if(isSerializationError(u)){throw new Error(`${getMethodName(A,p)}'s argument type is invalid: the message cannot be serialized: ${String(y)}.`,{cause:u})}};const isSerializationError=({code:u,message:A})=>Pr.has(u)||Or.some((u=>A.includes(u)));const Pr=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]);const Or=["could not be cloned","circular structure","call stack size exceeded"];const getMethodName=(u,A,p="")=>u==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${getNamespaceName(A)}${u}(${p})`;const getNamespaceName=u=>u?"":"subprocess.";const getOtherProcessName=u=>u?"parent process":"subprocess";const disconnect=u=>{if(u.connected){u.disconnect()}};const createDeferred=()=>{const u={};const A=new Promise(((A,p)=>{Object.assign(u,{resolve:A,reject:p})}));return Object.assign(A,u)};const getToStream=(u,A="stdin")=>{const p=true;const{options:y,fileDescriptors:E}=Mr.get(u);const C=getFdNumber(E,A,p);const I=u.stdio[C];if(I===null){throw new TypeError(getInvalidStdioOptionMessage(C,A,y,p))}return I};const getFromStream=(u,A="stdout")=>{const p=false;const{options:y,fileDescriptors:E}=Mr.get(u);const C=getFdNumber(E,A,p);const I=C==="all"?u.all:u.stdio[C];if(I===null||I===undefined){throw new TypeError(getInvalidStdioOptionMessage(C,A,y,p))}return I};const Mr=new WeakMap;const getFdNumber=(u,A,p)=>{const y=parseFdNumber(A,p);validateFdNumber(y,A,p,u);return y};const parseFdNumber=(u,A)=>{const p=parseFd(u);if(p!==undefined){return p}const{validOptions:y,defaultValue:E}=A?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${getOptionName(A)}" must not be "${u}".\nIt must be ${y} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${E}".`)};const validateFdNumber=(u,A,p,y)=>{const E=y[getUsedDescriptor(u)];if(E===undefined){throw new TypeError(`"${getOptionName(p)}" must not be ${A}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}if(E.direction==="input"&&!p){throw new TypeError(`"${getOptionName(p)}" must not be ${A}. It must be a readable stream, not writable.`)}if(E.direction!=="input"&&p){throw new TypeError(`"${getOptionName(p)}" must not be ${A}. It must be a writable stream, not readable.`)}};const getInvalidStdioOptionMessage=(u,A,p,y)=>{if(u==="all"&&!p.all){return'The "all" option must be true to use "from: \'all\'".'}const{optionName:E,optionValue:C}=getInvalidStdioOption(u,p);return`The "${E}: ${serializeOptionValue(C)}" option is incompatible with using "${getOptionName(y)}: ${serializeOptionValue(A)}".\nPlease set this option with "pipe" instead.`};const getInvalidStdioOption=(u,{stdin:A,stdout:p,stderr:y,stdio:E})=>{const C=getUsedDescriptor(u);if(C===0&&A!==undefined){return{optionName:"stdin",optionValue:A}}if(C===1&&p!==undefined){return{optionName:"stdout",optionValue:p}}if(C===2&&y!==undefined){return{optionName:"stderr",optionValue:y}}return{optionName:`stdio[${C}]`,optionValue:E[C]}};const getUsedDescriptor=u=>u==="all"?1:u;const getOptionName=u=>u?"to":"from";const serializeOptionValue=u=>{if(typeof u==="string"){return`'${u}'`}return typeof u==="number"?`${u}`:"Stream"};const incrementMaxListeners=(u,A,p)=>{const y=u.getMaxListeners();if(y===0||y===Number.POSITIVE_INFINITY){return}u.setMaxListeners(y+A);(0,Le.addAbortListener)(p,(()=>{u.setMaxListeners(u.getMaxListeners()-A)}))};const addReference=(u,A)=>{if(A){addReferenceCount(u)}};const addReferenceCount=u=>{u.refCounted()};const removeReference=(u,A)=>{if(A){removeReferenceCount(u)}};const removeReferenceCount=u=>{u.unrefCounted()};const undoAddedReferences=(u,A)=>{if(A){removeReferenceCount(u);removeReferenceCount(u)}};const redoAddedReferences=(u,A)=>{if(A){addReferenceCount(u);addReferenceCount(u)}};const onMessage=async({anyProcess:u,channel:A,isSubprocess:p,ipcEmitter:y},E)=>{if(handleStrictResponse(E)||handleAbort(E)){return}if(!Ur.has(u)){Ur.set(u,[])}const C=Ur.get(u);C.push(E);if(C.length>1){return}while(C.length>0){await waitForOutgoingMessages(u,y,E);await Dr.scheduler.yield();const I=await handleStrictRequest({wrappedMessage:C[0],anyProcess:u,channel:A,isSubprocess:p,ipcEmitter:y});C.shift();y.emit("message",I);y.emit("message:done")}};const onDisconnect=async({anyProcess:u,channel:A,isSubprocess:p,ipcEmitter:y,boundOnMessage:E})=>{abortOnDisconnect();const C=Ur.get(u);while(C?.length>0){await(0,Le.once)(y,"message:done")}u.removeListener("message",E);redoAddedReferences(A,p);y.connected=false;y.emit("disconnect")};const Ur=new WeakMap;const getIpcEmitter=(u,A,p)=>{if(Hr.has(u)){return Hr.get(u)}const y=new Le.EventEmitter;y.connected=true;Hr.set(u,y);forwardEvents({ipcEmitter:y,anyProcess:u,channel:A,isSubprocess:p});return y};const Hr=new WeakMap;const forwardEvents=({ipcEmitter:u,anyProcess:A,channel:p,isSubprocess:y})=>{const E=onMessage.bind(undefined,{anyProcess:A,channel:p,isSubprocess:y,ipcEmitter:u});A.on("message",E);A.once("disconnect",onDisconnect.bind(undefined,{anyProcess:A,channel:p,isSubprocess:y,ipcEmitter:u,boundOnMessage:E}));undoAddedReferences(p,y)};const isConnected=u=>{const A=Hr.get(u);return A===undefined?u.channel!==null:A.connected};const handleSendStrict=({anyProcess:u,channel:A,isSubprocess:p,message:y,strict:E})=>{if(!E){return y}const C=getIpcEmitter(u,A,p);const I=hasMessageListeners(u,C);return{id:Gr++,type:jr,message:y,hasListeners:I}};let Gr=0n;const validateStrictDeadlock=(u,A)=>{if(A?.type!==jr||A.hasListeners){return}for(const{id:A}of u){if(A!==undefined){Wr[A].resolve({isDeadlock:true,hasListeners:false})}}};const handleStrictRequest=async({wrappedMessage:u,anyProcess:A,channel:p,isSubprocess:y,ipcEmitter:E})=>{if(u?.type!==jr||!A.connected){return u}const{id:C,message:I}=u;const w={id:C,type:zr,message:hasMessageListeners(A,E)};try{await sendMessage({anyProcess:A,channel:p,isSubprocess:y,ipc:true},w)}catch(u){E.emit("strict:error",u)}return I};const handleStrictResponse=u=>{if(u?.type!==zr){return false}const{id:A,message:p}=u;Wr[A]?.resolve({isDeadlock:false,hasListeners:p});return true};const waitForStrictResponse=async(u,A,p)=>{if(u?.type!==jr){return}const y=createDeferred();Wr[u.id]=y;const E=new AbortController;try{const{isDeadlock:u,hasListeners:C}=await Promise.race([y,throwOnDisconnect(A,p,E)]);if(u){throwOnStrictDeadlockError(p)}if(!C){throwOnMissingStrict(p)}}finally{E.abort();delete Wr[u.id]}};const Wr={};const throwOnDisconnect=async(u,A,{signal:p})=>{incrementMaxListeners(u,1,p);await(0,Le.once)(u,"disconnect",{signal:p});throwOnStrictDisconnect(A)};const jr="execa:ipc:request";const zr="execa:ipc:response";const startSendMessage=(u,A,p)=>{if(!$r.has(u)){$r.set(u,new Set)}const y=$r.get(u);const E=createDeferred();const C=p?A.id:undefined;const I={onMessageSent:E,id:C};y.add(I);return{outgoingMessages:y,outgoingMessage:I}};const endSendMessage=({outgoingMessages:u,outgoingMessage:A})=>{u.delete(A);A.onMessageSent.resolve()};const waitForOutgoingMessages=async(u,A,p)=>{while(!hasMessageListeners(u,A)&&$r.get(u)?.size>0){const A=[...$r.get(u)];validateStrictDeadlock(A,p);await Promise.all(A.map((({onMessageSent:u})=>u)))}};const $r=new WeakMap;const hasMessageListeners=(u,A)=>A.listenerCount("message")>getMinListenerCount(u);const getMinListenerCount=u=>Mr.has(u)&&!getFdSpecificValue(Mr.get(u).options.buffer,"ipc")?1:0;const sendMessage=({anyProcess:u,channel:A,isSubprocess:p,ipc:y},E,{strict:C=false}={})=>{const I="sendMessage";validateIpcMethod({methodName:I,isSubprocess:p,ipc:y,isConnected:u.connected});return sendMessageAsync({anyProcess:u,channel:A,methodName:I,isSubprocess:p,message:E,strict:C})};const sendMessageAsync=async({anyProcess:u,channel:A,methodName:p,isSubprocess:y,message:E,strict:C})=>{const I=handleSendStrict({anyProcess:u,channel:A,isSubprocess:y,message:E,strict:C});const w=startSendMessage(u,I,C);try{await sendOneMessage({anyProcess:u,methodName:p,isSubprocess:y,wrappedMessage:I,message:E})}catch(A){disconnect(u);throw A}finally{endSendMessage(w)}};const sendOneMessage=async({anyProcess:u,methodName:A,isSubprocess:p,wrappedMessage:y,message:E})=>{const C=getSendMethod(u);try{await Promise.all([waitForStrictResponse(y,u,p),C(y)])}catch(u){handleEpipeError({error:u,methodName:A,isSubprocess:p});handleSerializationError({error:u,methodName:A,isSubprocess:p,message:E});throw u}};const getSendMethod=u=>{if(qr.has(u)){return qr.get(u)}const A=(0,cn.promisify)(u.send.bind(u));qr.set(u,A);return A};const qr=new WeakMap;const sendAbort=(u,A)=>{const p="cancelSignal";validateConnection(p,false,u.connected);return sendOneMessage({anyProcess:u,methodName:p,isSubprocess:false,wrappedMessage:{type:Kr,message:A},message:A})};const getCancelSignal=async({anyProcess:u,channel:A,isSubprocess:p,ipc:y})=>{await startIpc({anyProcess:u,channel:A,isSubprocess:p,ipc:y});return Jr.signal};const startIpc=async({anyProcess:u,channel:A,isSubprocess:p,ipc:y})=>{if(Vr){return}Vr=true;if(!y){throwOnMissingParent();return}if(A===null){abortOnDisconnect();return}getIpcEmitter(u,A,p);await Dr.scheduler.yield()};let Vr=false;const handleAbort=u=>{if(u?.type!==Kr){return false}Jr.abort(u.message);return true};const Kr="execa:ipc:cancel";const abortOnDisconnect=()=>{Jr.abort(getAbortDisconnectError())};const Jr=new AbortController;const validateGracefulCancel=({gracefulCancel:u,cancelSignal:A,ipc:p,serialization:y})=>{if(!u){return}if(A===undefined){throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.")}if(!p){throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.")}if(y==="json"){throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}};const throwOnGracefulCancel=({subprocess:u,cancelSignal:A,gracefulCancel:p,forceKillAfterDelay:y,context:E,controller:C})=>p?[sendOnAbort({subprocess:u,cancelSignal:A,forceKillAfterDelay:y,context:E,controller:C})]:[];const sendOnAbort=async({subprocess:u,cancelSignal:A,forceKillAfterDelay:p,context:y,controller:{signal:E}})=>{await onAbortedSignal(A,E);const C=getReason(A);await sendAbort(u,C);killOnTimeout({kill:u.kill,forceKillAfterDelay:p,context:y,controllerSignal:E});y.terminationReason??="gracefulCancel";throw A.reason};const getReason=({reason:u})=>{if(!(u instanceof DOMException)){return u}const A=new Error(u.message);Object.defineProperty(A,"stack",{value:u.stack,enumerable:false,configurable:true,writable:true});return A};const timeout_validateTimeout=({timeout:u})=>{if(u!==undefined&&(!Number.isFinite(u)||u<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${u}\` (${typeof u})`)}};const throwOnTimeout=(u,A,p,y)=>A===0||A===undefined?[]:[killAfterTimeout(u,A,p,y)];const killAfterTimeout=async(u,A,p,{signal:y})=>{await(0,Dr.setTimeout)(A,undefined,{signal:y});p.terminationReason??="timeout";u.kill();throw new DiscardedError};const mapNode=({options:u})=>{if(u.node===false){throw new TypeError('The "node" option cannot be false with `execaNode()`.')}return{options:{...u,node:true}}};const handleNodeOption=(u,A,{node:p=false,nodePath:y=un.execPath,nodeOptions:E=un.execArgv.filter((u=>!u.startsWith("--inspect"))),cwd:C,execPath:I,...w})=>{if(I!==undefined){throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.')}const v=safeNormalizeFileUrl(y,'The "nodePath" option');const B=Fe.resolve(C,v);const S={...w,nodePath:B,node:p,cwd:C};if(!p){return[u,A,S]}if(Fe.basename(u,".exe")==="node"){throw new TypeError('When the "node" option is true, the first argument does not need to be "node".')}return[B,[...E,u,...A],{ipc:true,...S,shell:false}]};const Yr=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:v8");const validateIpcInputOption=({ipcInput:u,ipc:A,serialization:p})=>{if(u===undefined){return}if(!A){throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.")}Xr[p](u)};const validateAdvancedInput=u=>{try{(0,Yr.serialize)(u)}catch(u){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:u})}};const validateJsonInput=u=>{try{JSON.stringify(u)}catch(u){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:u})}};const Xr={advanced:validateAdvancedInput,json:validateJsonInput};const sendIpcInput=async(u,A)=>{if(A===undefined){return}await u.sendMessage(A)};const validateEncoding=({encoding:u})=>{if(ts.has(u)){return}const A=getCorrectEncoding(u);if(A!==undefined){throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(u)}\`.\nPlease rename it to ${serializeEncoding(A)}.`)}const p=[...ts].map((u=>serializeEncoding(u))).join(", ");throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(u)}\`.\nPlease rename it to one of: ${p}.`)};const Zr=new Set(["utf8","utf16le"]);const es=new Set(["buffer","hex","base64","base64url","latin1","ascii"]);const ts=new Set([...Zr,...es]);const getCorrectEncoding=u=>{if(u===null){return"buffer"}if(typeof u!=="string"){return}const A=u.toLowerCase();if(A in ns){return ns[A]}if(ts.has(A)){return A}};const ns={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"};const serializeEncoding=u=>typeof u==="string"?`"${u}"`:String(u);const normalizeCwd=(u=getDefaultCwd())=>{const A=safeNormalizeFileUrl(u,'The "cwd" option');return Fe.resolve(A)};const getDefaultCwd=()=>{try{return un.cwd()}catch(u){u.message=`The current directory does not exist.\n${u.message}`;throw u}};const fixCwdError=(u,A)=>{if(A===getDefaultCwd()){return u}let p;try{p=(0,_e.statSync)(A)}catch(p){return`The "cwd" option is invalid: ${A}.\n${p.message}\n${u}`}if(!p.isDirectory()){return`The "cwd" option is not a directory: ${A}.\n${u}`}return u};const normalizeOptions=(u,A,p)=>{p.cwd=normalizeCwd(p.cwd);const[y,E,C]=handleNodeOption(u,A,p);const{command:I,args:w,options:v}=vr._parse(y,E,C);const B=normalizeFdSpecificOptions(v);const S=addDefaultOptions(B);timeout_validateTimeout(S);validateEncoding(S);validateIpcInputOption(S);validateCancelSignal(S);validateGracefulCancel(S);S.shell=normalizeFileUrl(S.shell);S.env=getEnv(S);S.killSignal=normalizeKillSignal(S.killSignal);S.forceKillAfterDelay=normalizeForceKillAfterDelay(S.forceKillAfterDelay);S.lines=S.lines.map(((u,A)=>u&&!es.has(S.encoding)&&S.buffer[A]));if(un.platform==="win32"&&Fe.basename(I,".exe")==="cmd"){w.unshift("/q")}return{file:I,commandArguments:w,options:S}};const addDefaultOptions=({extendEnv:u=true,preferLocal:A=false,cwd:p,localDir:y=p,encoding:E="utf8",reject:C=true,cleanup:I=true,all:w=false,windowsHide:v=true,killSignal:B="SIGTERM",forceKillAfterDelay:S=true,gracefulCancel:D=false,ipcInput:k,ipc:Q=k!==undefined||D,serialization:F="advanced",...R})=>({...R,extendEnv:u,preferLocal:A,cwd:p,localDirectory:y,encoding:E,reject:C,cleanup:I,all:w,windowsHide:v,killSignal:B,forceKillAfterDelay:S,gracefulCancel:D,ipcInput:k,ipc:Q,serialization:F});const getEnv=({env:u,extendEnv:A,preferLocal:p,node:y,localDirectory:E,nodePath:C})=>{const I=A?{...un.env,...u}:u;if(p||y){return npmRunPathEnv({env:I,cwd:E,execPath:C,preferLocal:p,addExecPath:y})}return I};const concatenateShell=(u,A,p)=>p.shell&&A.length>0?[[u,...A].join(" "),[],p]:[u,A,p];function strip_final_newline_stripFinalNewline(u){if(typeof u==="string"){return stripFinalNewlineString(u)}if(!(ArrayBuffer.isView(u)&&u.BYTES_PER_ELEMENT===1)){throw new Error("Input must be a string or a Uint8Array")}return stripFinalNewlineBinary(u)}const stripFinalNewlineString=u=>u.at(-1)===rs?u.slice(0,u.at(-2)===os?-2:-1):u;const stripFinalNewlineBinary=u=>u.at(-1)===ss?u.subarray(0,u.at(-2)===as?-2:-1):u;const rs="\n";const ss=rs.codePointAt(0);const os="\r";const as=os.codePointAt(0);function is_stream_isStream(u,{checkOpen:A=true}={}){return u!==null&&typeof u==="object"&&(u.writable||u.readable||!A||u.writable===undefined&&u.readable===undefined)&&typeof u.pipe==="function"}function isWritableStream(u,{checkOpen:A=true}={}){return is_stream_isStream(u,{checkOpen:A})&&(u.writable||!A)&&typeof u.write==="function"&&typeof u.end==="function"&&typeof u.writable==="boolean"&&typeof u.writableObjectMode==="boolean"&&typeof u.destroy==="function"&&typeof u.destroyed==="boolean"}function isReadableStream(u,{checkOpen:A=true}={}){return is_stream_isStream(u,{checkOpen:A})&&(u.readable||!A)&&typeof u.read==="function"&&typeof u.readable==="boolean"&&typeof u.readableObjectMode==="boolean"&&typeof u.destroy==="function"&&typeof u.destroyed==="boolean"}function isDuplexStream(u,A){return isWritableStream(u,A)&&isReadableStream(u,A)}function isTransformStream(u,A){return isDuplexStream(u,A)&&typeof u._transform==="function"}const ls=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class c{#mt;#yt;#Et=!1;#Ct=void 0;constructor(u,A){this.#mt=u,this.#yt=A}next(){const e=()=>this.#It();return this.#Ct=this.#Ct?this.#Ct.then(e,e):e(),this.#Ct}return(u){const t=()=>this.#bt(u);return this.#Ct?this.#Ct.then(t,t):t()}async#It(){if(this.#Et)return{done:!0,value:void 0};let u;try{u=await this.#mt.read()}catch(u){throw this.#Ct=void 0,this.#Et=!0,this.#mt.releaseLock(),u}return u.done&&(this.#Ct=void 0,this.#Et=!0,this.#mt.releaseLock()),u}async#bt(u){if(this.#Et)return{done:!0,value:u};if(this.#Et=!0,!this.#yt){const A=this.#mt.cancel(u);return this.#mt.releaseLock(),await A,{done:!0,value:u}}return this.#mt.releaseLock(),{done:!0,value:u}}}const cs=Symbol();function i(){return this[cs].next()}Object.defineProperty(i,"name",{value:"next"});function o(u){return this[cs].return(u)}Object.defineProperty(o,"name",{value:"return"});const us=Object.create(ls,{next:{enumerable:!0,configurable:!0,writable:!0,value:i},return:{enumerable:!0,configurable:!0,writable:!0,value:o}});function h({preventCancel:u=!1}={}){const A=this.getReader(),p=new c(A,u),y=Object.create(us);return y[cs]=p,y}const getAsyncIterable=u=>{if(isReadableStream(u,{checkOpen:false})&&fs.on!==undefined){return getStreamIterable(u)}if(typeof u?.[Symbol.asyncIterator]==="function"){return u}if(ds.call(u)==="[object ReadableStream]"){return h.call(u)}throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")};const{toString:ds}=Object.prototype;const getStreamIterable=async function*(u){const A=new AbortController;const p={};handleStreamEnd(u,A,p);try{for await(const[p]of fs.on(u,"data",{signal:A.signal})){yield p}}catch(u){if(p.error!==undefined){throw p.error}else if(!A.signal.aborted){throw u}}finally{u.destroy()}};const handleStreamEnd=async(u,A,p)=>{try{await fs.finished(u,{cleanup:true,readable:true,writable:false,error:false})}catch(u){p.error=u}finally{A.abort()}};const fs={};const getStreamContents=async(u,{init:A,convertChunk:p,getSize:y,truncateChunk:E,addChunk:C,getFinalChunk:I,finalize:w},{maxBuffer:v=Number.POSITIVE_INFINITY}={})=>{const B=getAsyncIterable(u);const S=A();S.length=0;try{for await(const u of B){const A=getChunkType(u);const I=p[A](u,S);appendChunk({convertedChunk:I,state:S,getSize:y,truncateChunk:E,addChunk:C,maxBuffer:v})}appendFinalChunk({state:S,convertChunk:p,getSize:y,truncateChunk:E,addChunk:C,getFinalChunk:I,maxBuffer:v});return w(S)}catch(u){const A=typeof u==="object"&&u!==null?u:new Error(u);A.bufferedData=w(S);throw A}};const appendFinalChunk=({state:u,getSize:A,truncateChunk:p,addChunk:y,getFinalChunk:E,maxBuffer:C})=>{const I=E(u);if(I!==undefined){appendChunk({convertedChunk:I,state:u,getSize:A,truncateChunk:p,addChunk:y,maxBuffer:C})}};const appendChunk=({convertedChunk:u,state:A,getSize:p,truncateChunk:y,addChunk:E,maxBuffer:C})=>{const I=p(u);const w=A.length+I;if(w<=C){addNewChunk(u,A,E,w);return}const v=y(u,C-A.length);if(v!==undefined){addNewChunk(v,A,E,C)}throw new MaxBufferError};const addNewChunk=(u,A,p,y)=>{A.contents=p(u,A,y);A.length=y};const getChunkType=u=>{const A=typeof u;if(A==="string"){return"string"}if(A!=="object"||u===null){return"others"}if(globalThis.Buffer?.isBuffer(u)){return"buffer"}const p=As.call(u);if(p==="[object ArrayBuffer]"){return"arrayBuffer"}if(p==="[object DataView]"){return"dataView"}if(Number.isInteger(u.byteLength)&&Number.isInteger(u.byteOffset)&&As.call(u.buffer)==="[object ArrayBuffer]"){return"typedArray"}return"others"};const{toString:As}=Object.prototype;class MaxBufferError extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const handleMaxBuffer=({error:u,stream:A,readableObjectMode:p,lines:y,encoding:E,fdNumber:C})=>{if(!(u instanceof MaxBufferError)){throw u}if(C==="all"){return u}const I=getMaxBufferUnit(p,y,E);u.maxBufferInfo={fdNumber:C,unit:I};A.destroy();throw u};const getMaxBufferUnit=(u,A,p)=>{if(u){return"objects"}if(A){return"lines"}if(p==="buffer"){return"bytes"}return"characters"};const checkIpcMaxBuffer=(u,A,p)=>{if(A.length!==p){return}const y=new MaxBufferError;y.maxBufferInfo={fdNumber:"ipc"};throw y};const getMaxBufferMessage=(u,A)=>{const{streamName:p,threshold:y,unit:E}=getMaxBufferInfo(u,A);return`Command's ${p} was larger than ${y} ${E}`};const getMaxBufferInfo=(u,A)=>{if(u?.maxBufferInfo===undefined){return{streamName:"output",threshold:A[1],unit:"bytes"}}const{maxBufferInfo:{fdNumber:p,unit:y}}=u;delete u.maxBufferInfo;const E=getFdSpecificValue(A,p);if(p==="ipc"){return{streamName:"IPC output",threshold:E,unit:"messages"}}return{streamName:getStreamName(p),threshold:E,unit:y}};const isMaxBufferSync=(u,A,p)=>u?.code==="ENOBUFS"&&A!==null&&A.some((u=>u!==null&&u.length>getMaxBufferSync(p)));const truncateMaxBufferSync=(u,A,p)=>{if(!A){return u}const y=getMaxBufferSync(p);return u.length>y?u.slice(0,y):u};const getMaxBufferSync=([,u])=>u;const createMessages=({stdio:u,all:A,ipcOutput:p,originalError:y,signal:E,signalDescription:C,exitCode:I,escapedCommand:w,timedOut:v,isCanceled:B,isGracefullyCanceled:S,isMaxBuffer:D,isForcefullyTerminated:k,forceKillAfterDelay:Q,killSignal:F,maxBuffer:R,timeout:_,cwd:P})=>{const O=y?.code;const U=getErrorPrefix({originalError:y,timedOut:v,timeout:_,isMaxBuffer:D,maxBuffer:R,errorCode:O,signal:E,signalDescription:C,exitCode:I,isCanceled:B,isGracefullyCanceled:S,isForcefullyTerminated:k,forceKillAfterDelay:Q,killSignal:F});const H=getOriginalMessage(y,P);const G=H===undefined?"":`\n${H}`;const j=`${U}: ${w}${G}`;const $=A===undefined?[u[2],u[1]]:[A];const q=[j,...$,...u.slice(3),p.map((u=>serializeIpcMessage(u))).join("\n")].map((u=>escapeLines(strip_final_newline_stripFinalNewline(serializeMessagePart(u))))).filter(Boolean).join("\n\n");return{originalMessage:H,shortMessage:j,message:q}};const getErrorPrefix=({originalError:u,timedOut:A,timeout:p,isMaxBuffer:y,maxBuffer:E,errorCode:C,signal:I,signalDescription:w,exitCode:v,isCanceled:B,isGracefullyCanceled:S,isForcefullyTerminated:D,forceKillAfterDelay:k,killSignal:Q})=>{const F=getForcefulSuffix(D,k);if(A){return`Command timed out after ${p} milliseconds${F}`}if(S){if(I===undefined){return`Command was gracefully canceled with exit code ${v}`}return D?`Command was gracefully canceled${F}`:`Command was gracefully canceled with ${I} (${w})`}if(B){return`Command was canceled${F}`}if(y){return`${getMaxBufferMessage(u,E)}${F}`}if(C!==undefined){return`Command failed with ${C}${F}`}if(D){return`Command was killed with ${Q} (${getSignalDescription(Q)})${F}`}if(I!==undefined){return`Command was killed with ${I} (${w})`}if(v!==undefined){return`Command failed with exit code ${v}`}return"Command failed"};const getForcefulSuffix=(u,A)=>u?` and was forcefully terminated after ${A} milliseconds`:"";const getOriginalMessage=(u,A)=>{if(u instanceof DiscardedError){return}const p=isExecaError(u)?u.originalMessage:String(u?.message??u);const y=escapeLines(fixCwdError(p,A));return y===""?undefined:y};const serializeIpcMessage=u=>typeof u==="string"?u:(0,cn.inspect)(u);const serializeMessagePart=u=>Array.isArray(u)?u.map((u=>strip_final_newline_stripFinalNewline(serializeMessageItem(u)))).filter(Boolean).join("\n"):serializeMessageItem(u);const serializeMessageItem=u=>{if(typeof u==="string"){return u}if(isUint8Array(u)){return uint8ArrayToString(u)}return""};const makeSuccessResult=({command:u,escapedCommand:A,stdio:p,all:y,ipcOutput:E,options:{cwd:C},startTime:I})=>omitUndefinedProperties({command:u,escapedCommand:A,cwd:C,durationMs:getDurationMs(I),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:p[1],stderr:p[2],all:y,stdio:p,ipcOutput:E,pipedFrom:[]});const makeEarlyError=({error:u,command:A,escapedCommand:p,fileDescriptors:y,options:E,startTime:C,isSync:I})=>makeError({error:u,command:A,escapedCommand:p,startTime:C,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:y.length}),ipcOutput:[],options:E,isSync:I});const makeError=({error:u,command:A,escapedCommand:p,startTime:y,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:B,signal:S,stdio:D,all:k,ipcOutput:Q,options:{timeoutDuration:F,timeout:R=F,forceKillAfterDelay:_,killSignal:P,cwd:O,maxBuffer:U},isSync:H})=>{const{exitCode:G,signal:j,signalDescription:$}=normalizeExitPayload(B,S);const{originalMessage:q,shortMessage:K,message:J}=createMessages({stdio:D,all:k,ipcOutput:Q,originalError:u,signal:j,signalDescription:$,exitCode:G,escapedCommand:p,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,forceKillAfterDelay:_,killSignal:P,maxBuffer:U,timeout:R,cwd:O});const ee=getFinalError(u,J,H);Object.assign(ee,getErrorProperties({error:ee,command:A,escapedCommand:p,startTime:y,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:G,signal:j,signalDescription:$,stdio:D,all:k,ipcOutput:Q,cwd:O,originalMessage:q,shortMessage:K}));return ee};const getErrorProperties=({error:u,command:A,escapedCommand:p,startTime:y,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:B,signal:S,signalDescription:D,stdio:k,all:Q,ipcOutput:F,cwd:R,originalMessage:_,shortMessage:P})=>omitUndefinedProperties({shortMessage:P,originalMessage:_,command:A,escapedCommand:p,cwd:R,durationMs:getDurationMs(y),failed:true,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isTerminated:S!==undefined,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:B,signal:S,signalDescription:D,code:u.cause?.code,stdout:k[1],stderr:k[2],all:Q,stdio:k,ipcOutput:F,pipedFrom:[]});const omitUndefinedProperties=u=>Object.fromEntries(Object.entries(u).filter((([,u])=>u!==undefined)));const normalizeExitPayload=(u,A)=>{const p=u===null?undefined:u;const y=A===null?undefined:A;const E=y===undefined?undefined:getSignalDescription(A);return{exitCode:p,signal:y,signalDescription:E}};const toZeroIfInfinity=u=>Number.isFinite(u)?u:0;function parseNumber(u){return{days:Math.trunc(u/864e5),hours:Math.trunc(u/36e5%24),minutes:Math.trunc(u/6e4%60),seconds:Math.trunc(u/1e3%60),milliseconds:Math.trunc(u%1e3),microseconds:Math.trunc(toZeroIfInfinity(u*1e3)%1e3),nanoseconds:Math.trunc(toZeroIfInfinity(u*1e6)%1e3)}}function parseBigint(u){return{days:u/86400000n,hours:u/3600000n%24n,minutes:u/60000n%60n,seconds:u/1000n%60n,milliseconds:u%1000n,microseconds:0n,nanoseconds:0n}}function parseMilliseconds(u){switch(typeof u){case"number":{if(Number.isFinite(u)){return parseNumber(u)}break}case"bigint":{return parseBigint(u)}}throw new TypeError("Expected a finite number or bigint")}const isZero=u=>u===0||u===0n;const pluralize=(u,A)=>A===1||A===1n?u:`${u}s`;const hs=1e-7;const ps=24n*60n*60n*1000n;function prettyMilliseconds(u,A){const p=typeof u==="bigint";if(!p&&!Number.isFinite(u)){throw new TypeError("Expected a finite number or bigint")}A={...A};const y=u<0?"-":"";u=u<0?-u:u;if(A.colonNotation){A.compact=false;A.formatSubMilliseconds=false;A.separateMilliseconds=false;A.verbose=false}if(A.compact){A.unitCount=1;A.secondsDecimalDigits=0;A.millisecondsDecimalDigits=0}let E=[];const floorDecimals=(u,A)=>{const p=Math.floor(u*10**A+hs);const y=Math.round(p)/10**A;return y.toFixed(A)};const add=(u,p,y,C)=>{if((E.length===0||!A.colonNotation)&&isZero(u)&&!(A.colonNotation&&y==="m")){return}C??=String(u);if(A.colonNotation){const u=C.includes(".")?C.split(".")[0].length:C.length;const A=E.length>0?2:1;C="0".repeat(Math.max(0,A-u))+C}else{C+=A.verbose?" "+pluralize(p,u):y}E.push(C)};const C=parseMilliseconds(u);const I=BigInt(C.days);if(A.hideYearAndDays){add(BigInt(I)*24n+BigInt(C.hours),"hour","h")}else{if(A.hideYear){add(I,"day","d")}else{add(I/365n,"year","y");add(I%365n,"day","d")}add(Number(C.hours),"hour","h")}add(Number(C.minutes),"minute","m");if(!A.hideSeconds){if(A.separateMilliseconds||A.formatSubMilliseconds||!A.colonNotation&&u<1e3&&!A.subSecondsAsDecimals){const u=Number(C.seconds);const p=Number(C.milliseconds);const y=Number(C.microseconds);const E=Number(C.nanoseconds);add(u,"second","s");if(A.formatSubMilliseconds){add(p,"millisecond","ms");add(y,"microsecond","µs");add(E,"nanosecond","ns")}else{const u=p+y/1e3+E/1e6;const C=typeof A.millisecondsDecimalDigits==="number"?A.millisecondsDecimalDigits:0;const I=u>=1?Math.round(u):Math.ceil(u);const w=C?u.toFixed(C):I;add(Number.parseFloat(w),"millisecond","ms",w)}}else{const y=(p?Number(u%ps):u)/1e3%60;const E=typeof A.secondsDecimalDigits==="number"?A.secondsDecimalDigits:1;const C=floorDecimals(y,E);const I=A.keepDecimalsOnWholeSeconds?C:C.replace(/\.0+$/,"");add(Number.parseFloat(I),"second","s",I)}}if(E.length===0){return y+"0"+(A.verbose?" milliseconds":"ms")}const w=A.colonNotation?":":" ";if(typeof A.unitCount==="number"){E=E.slice(0,Math.max(A.unitCount,1))}return y+E.join(w)}const logError=(u,A)=>{if(u.failed){verboseLog({type:"error",verboseMessage:u.shortMessage,verboseInfo:A,result:u})}};const logResult=(u,A)=>{if(!isVerbose(A)){return}logError(u,A);logDuration(u,A)};const logDuration=(u,A)=>{const p=`(done in ${prettyMilliseconds(u.durationMs)})`;verboseLog({type:"duration",verboseMessage:p,verboseInfo:A,result:u})};const handleResult=(u,A,{reject:p})=>{logResult(u,A);if(u.failed&&p){throw u}return u};const getStdioItemType=(u,A)=>{if(isAsyncGenerator(u)){return"asyncGenerator"}if(isSyncGenerator(u)){return"generator"}if(isUrl(u)){return"fileUrl"}if(isFilePathObject(u)){return"filePath"}if(isWebStream(u)){return"webStream"}if(is_stream_isStream(u,{checkOpen:false})){return"native"}if(isUint8Array(u)){return"uint8Array"}if(isAsyncIterableObject(u)){return"asyncIterable"}if(isIterableObject(u)){return"iterable"}if(type_isTransformStream(u)){return getTransformStreamType({transform:u},A)}if(isTransformOptions(u)){return getTransformObjectType(u,A)}return"native"};const getTransformObjectType=(u,A)=>{if(isDuplexStream(u.transform,{checkOpen:false})){return getDuplexType(u,A)}if(type_isTransformStream(u.transform)){return getTransformStreamType(u,A)}return getGeneratorObjectType(u,A)};const getDuplexType=(u,A)=>{validateNonGeneratorType(u,A,"Duplex stream");return"duplex"};const getTransformStreamType=(u,A)=>{validateNonGeneratorType(u,A,"web TransformStream");return"webTransform"};const validateNonGeneratorType=({final:u,binary:A,objectMode:p},y,E)=>{checkUndefinedOption(u,`${y}.final`,E);checkUndefinedOption(A,`${y}.binary`,E);checkBooleanOption(p,`${y}.objectMode`)};const checkUndefinedOption=(u,A,p)=>{if(u!==undefined){throw new TypeError(`The \`${A}\` option can only be defined when using a generator, not a ${p}.`)}};const getGeneratorObjectType=({transform:u,final:A,binary:p,objectMode:y},E)=>{if(u!==undefined&&!isGenerator(u)){throw new TypeError(`The \`${E}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`)}if(isDuplexStream(A,{checkOpen:false})){throw new TypeError(`The \`${E}.final\` option must not be a Duplex stream.`)}if(type_isTransformStream(A)){throw new TypeError(`The \`${E}.final\` option must not be a web TransformStream.`)}if(A!==undefined&&!isGenerator(A)){throw new TypeError(`The \`${E}.final\` option must be a generator.`)}checkBooleanOption(p,`${E}.binary`);checkBooleanOption(y,`${E}.objectMode`);return isAsyncGenerator(u)||isAsyncGenerator(A)?"asyncGenerator":"generator"};const checkBooleanOption=(u,A)=>{if(u!==undefined&&typeof u!=="boolean"){throw new TypeError(`The \`${A}\` option must use a boolean.`)}};const isGenerator=u=>isAsyncGenerator(u)||isSyncGenerator(u);const isAsyncGenerator=u=>Object.prototype.toString.call(u)==="[object AsyncGeneratorFunction]";const isSyncGenerator=u=>Object.prototype.toString.call(u)==="[object GeneratorFunction]";const isTransformOptions=u=>isPlainObject(u)&&(u.transform!==undefined||u.final!==undefined);const isUrl=u=>Object.prototype.toString.call(u)==="[object URL]";const isRegularUrl=u=>isUrl(u)&&u.protocol!=="file:";const isFilePathObject=u=>isPlainObject(u)&&Object.keys(u).length>0&&Object.keys(u).every((u=>gs.has(u)))&&isFilePathString(u.file);const gs=new Set(["file","append"]);const isFilePathString=u=>typeof u==="string";const isUnknownStdioString=(u,A)=>u==="native"&&typeof A==="string"&&!ms.has(A);const ms=new Set(["ipc","ignore","inherit","overlapped","pipe"]);const type_isReadableStream=u=>Object.prototype.toString.call(u)==="[object ReadableStream]";const type_isWritableStream=u=>Object.prototype.toString.call(u)==="[object WritableStream]";const isWebStream=u=>type_isReadableStream(u)||type_isWritableStream(u);const type_isTransformStream=u=>type_isReadableStream(u?.readable)&&type_isWritableStream(u?.writable);const isAsyncIterableObject=u=>isObject(u)&&typeof u[Symbol.asyncIterator]==="function";const isIterableObject=u=>isObject(u)&&typeof u[Symbol.iterator]==="function";const isObject=u=>typeof u==="object"&&u!==null;const ys=new Set(["generator","asyncGenerator","duplex","webTransform"]);const Es=new Set(["fileUrl","filePath","fileNumber"]);const Cs=new Set(["fileUrl","filePath"]);const Is=new Set([...Cs,"webStream","nodeStream"]);const bs=new Set(["webTransform","duplex"]);const ws={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};const getTransformObjectModes=(u,A,p,y)=>y==="output"?getOutputObjectModes(u,A,p):getInputObjectModes(u,A,p);const getOutputObjectModes=(u,A,p)=>{const y=A!==0&&p[A-1].value.readableObjectMode;const E=u??y;return{writableObjectMode:y,readableObjectMode:E}};const getInputObjectModes=(u,A,p)=>{const y=A===0?u===true:p[A-1].value.readableObjectMode;const E=A!==p.length-1&&(u??y);return{writableObjectMode:y,readableObjectMode:E}};const getFdObjectMode=(u,A)=>{const p=u.findLast((({type:u})=>ys.has(u)));if(p===undefined){return false}return A==="input"?p.value.writableObjectMode:p.value.readableObjectMode};const normalizeTransforms=(u,A,p,y)=>[...u.filter((({type:u})=>!ys.has(u))),...getTransforms(u,A,p,y)];const getTransforms=(u,A,p,{encoding:y})=>{const E=u.filter((({type:u})=>ys.has(u)));const C=Array.from({length:E.length});for(const[u,I]of Object.entries(E)){C[u]=normalizeTransform({stdioItem:I,index:Number(u),newTransforms:C,optionName:A,direction:p,encoding:y})}return sortTransforms(C,p)};const normalizeTransform=({stdioItem:u,stdioItem:{type:A},index:p,newTransforms:y,optionName:E,direction:C,encoding:I})=>{if(A==="duplex"){return normalizeDuplex({stdioItem:u,optionName:E})}if(A==="webTransform"){return normalizeTransformStream({stdioItem:u,index:p,newTransforms:y,direction:C})}return normalizeGenerator({stdioItem:u,index:p,newTransforms:y,direction:C,encoding:I})};const normalizeDuplex=({stdioItem:u,stdioItem:{value:{transform:A,transform:{writableObjectMode:p,readableObjectMode:y},objectMode:E=y}},optionName:C})=>{if(E&&!y){throw new TypeError(`The \`${C}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`)}if(!E&&y){throw new TypeError(`The \`${C}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`)}return{...u,value:{transform:A,writableObjectMode:p,readableObjectMode:y}}};const normalizeTransformStream=({stdioItem:u,stdioItem:{value:A},index:p,newTransforms:y,direction:E})=>{const{transform:C,objectMode:I}=isPlainObject(A)?A:{transform:A};const{writableObjectMode:w,readableObjectMode:v}=getTransformObjectModes(I,p,y,E);return{...u,value:{transform:C,writableObjectMode:w,readableObjectMode:v}}};const normalizeGenerator=({stdioItem:u,stdioItem:{value:A},index:p,newTransforms:y,direction:E,encoding:C})=>{const{transform:I,final:w,binary:v=false,preserveNewlines:B=false,objectMode:S}=isPlainObject(A)?A:{transform:A};const D=v||es.has(C);const{writableObjectMode:k,readableObjectMode:Q}=getTransformObjectModes(S,p,y,E);return{...u,value:{transform:I,final:w,binary:D,preserveNewlines:B,writableObjectMode:k,readableObjectMode:Q}}};const sortTransforms=(u,A)=>A==="input"?u.reverse():u;const getStreamDirection=(u,A,p)=>{const y=u.map((u=>getStdioItemDirection(u,A)));if(y.includes("input")&&y.includes("output")){throw new TypeError(`The \`${p}\` option must not be an array of both readable and writable values.`)}return y.find(Boolean)??Ss};const getStdioItemDirection=({type:u,value:A},p)=>vs[p]??Bs[u](A);const vs=["input","output","output"];const anyDirection=()=>undefined;const alwaysInput=()=>"input";const Bs={generator:anyDirection,asyncGenerator:anyDirection,fileUrl:anyDirection,filePath:anyDirection,iterable:alwaysInput,asyncIterable:alwaysInput,uint8Array:alwaysInput,webStream:u=>type_isWritableStream(u)?"output":"input",nodeStream(u){if(!isReadableStream(u,{checkOpen:false})){return"output"}return isWritableStream(u,{checkOpen:false})?undefined:"input"},webTransform:anyDirection,duplex:anyDirection,native(u){const A=getStandardStreamDirection(u);if(A!==undefined){return A}if(is_stream_isStream(u,{checkOpen:false})){return Bs.nodeStream(u)}}};const getStandardStreamDirection=u=>{if([0,un.stdin].includes(u)){return"input"}if([1,2,un.stdout,un.stderr].includes(u)){return"output"}};const Ss="output";const normalizeIpcStdioArray=(u,A)=>A&&!u.includes("ipc")?[...u,"ipc"]:u;const normalizeStdioOption=({stdio:u,ipc:A,buffer:p,...y},E,C)=>{const I=getStdioArray(u,y).map(((u,A)=>stdio_option_addDefaultValue(u,A)));return C?normalizeStdioSync(I,p,E):normalizeIpcStdioArray(I,A)};const getStdioArray=(u,A)=>{if(u===undefined){return fn.map((u=>A[u]))}if(hasAlias(A)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${fn.map((u=>`\`${u}\``)).join(", ")}`)}if(typeof u==="string"){return[u,u,u]}if(!Array.isArray(u)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``)}const p=Math.max(u.length,fn.length);return Array.from({length:p},((A,p)=>u[p]))};const hasAlias=u=>fn.some((A=>u[A]!==undefined));const stdio_option_addDefaultValue=(u,A)=>{if(Array.isArray(u)){return u.map((u=>stdio_option_addDefaultValue(u,A)))}if(u===null||u===undefined){return A>=fn.length?"ignore":"pipe"}return u};const normalizeStdioSync=(u,A,p)=>u.map(((u,y)=>!A[y]&&y!==0&&!isFullVerbose(p,y)&&isOutputPipeOnly(u)?"ignore":u));const isOutputPipeOnly=u=>u==="pipe"||Array.isArray(u)&&u.every((u=>u==="pipe"));const handleNativeStream=({stdioItem:u,stdioItem:{type:A},isStdioArray:p,fdNumber:y,direction:E,isSync:C})=>{if(!p||A!=="native"){return u}return C?handleNativeStreamSync({stdioItem:u,fdNumber:y,direction:E}):handleNativeStreamAsync({stdioItem:u,fdNumber:y})};const handleNativeStreamSync=({stdioItem:u,stdioItem:{value:A,optionName:p},fdNumber:y,direction:E})=>{const C=getTargetFd({value:A,optionName:p,fdNumber:y,direction:E});if(C!==undefined){return C}if(is_stream_isStream(A,{checkOpen:false})){throw new TypeError(`The \`${p}: Stream\` option cannot both be an array and include a stream with synchronous methods.`)}return u};const getTargetFd=({value:u,optionName:A,fdNumber:p,direction:y})=>{const E=getTargetFdNumber(u,p);if(E===undefined){return}if(y==="output"){return{type:"fileNumber",value:E,optionName:A}}if(xn.isatty(E)){throw new TypeError(`The \`${A}: ${serializeOptionValue(u)}\` option is invalid: it cannot be a TTY with synchronous methods.`)}return{type:"uint8Array",value:bufferToUint8Array((0,_e.readFileSync)(E)),optionName:A}};const getTargetFdNumber=(u,A)=>{if(u==="inherit"){return A}if(typeof u==="number"){return u}const p=dn.indexOf(u);if(p!==-1){return p}};const handleNativeStreamAsync=({stdioItem:u,stdioItem:{value:A,optionName:p},fdNumber:y})=>{if(A==="inherit"){return{type:"nodeStream",value:getStandardStream(y,A,p),optionName:p}}if(typeof A==="number"){return{type:"nodeStream",value:getStandardStream(A,A,p),optionName:p}}if(is_stream_isStream(A,{checkOpen:false})){return{type:"nodeStream",value:A,optionName:p}}return u};const getStandardStream=(u,A,p)=>{const y=dn[u];if(y===undefined){throw new TypeError(`The \`${p}: ${A}\` option is invalid: no such standard stream.`)}return y};const handleInputOptions=({input:u,inputFile:A},p)=>p===0?[...handleInputOption(u),...handleInputFileOption(A)]:[];const handleInputOption=u=>u===undefined?[]:[{type:getInputType(u),value:u,optionName:"input"}];const getInputType=u=>{if(isReadableStream(u,{checkOpen:false})){return"nodeStream"}if(typeof u==="string"){return"string"}if(isUint8Array(u)){return"uint8Array"}throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")};const handleInputFileOption=u=>u===undefined?[]:[{...getInputFileType(u),optionName:"inputFile"}];const getInputFileType=u=>{if(isUrl(u)){return{type:"fileUrl",value:u}}if(isFilePathString(u)){return{type:"filePath",value:{file:u}}}throw new Error("The `inputFile` option must be a file path string or a file URL.")};const filterDuplicates=u=>u.filter(((A,p)=>u.every(((u,y)=>A.value!==u.value||p>=y||A.type==="generator"||A.type==="asyncGenerator"))));const getDuplicateStream=({stdioItem:{type:u,value:A,optionName:p},direction:y,fileDescriptors:E,isSync:C})=>{const I=getOtherStdioItems(E,u);if(I.length===0){return}if(C){validateDuplicateStreamSync({otherStdioItems:I,type:u,value:A,optionName:p,direction:y});return}if(Is.has(u)){return getDuplicateStreamInstance({otherStdioItems:I,type:u,value:A,optionName:p,direction:y})}if(bs.has(u)){validateDuplicateTransform({otherStdioItems:I,type:u,value:A,optionName:p})}};const getOtherStdioItems=(u,A)=>u.flatMap((({direction:u,stdioItems:p})=>p.filter((u=>u.type===A)).map((A=>({...A,direction:u})))));const validateDuplicateStreamSync=({otherStdioItems:u,type:A,value:p,optionName:y,direction:E})=>{if(Cs.has(A)){getDuplicateStreamInstance({otherStdioItems:u,type:A,value:p,optionName:y,direction:E})}};const getDuplicateStreamInstance=({otherStdioItems:u,type:A,value:p,optionName:y,direction:E})=>{const C=u.filter((u=>hasSameValue(u,p)));if(C.length===0){return}const I=C.find((u=>u.direction!==E));throwOnDuplicateStream(I,y,A);return E==="output"?C[0].stream:undefined};const hasSameValue=({type:u,value:A},p)=>{if(u==="filePath"){return A.file===p.file}if(u==="fileUrl"){return A.href===p.href}return A===p};const validateDuplicateTransform=({otherStdioItems:u,type:A,value:p,optionName:y})=>{const E=u.find((({value:{transform:u}})=>u===p.transform));throwOnDuplicateStream(E,y,A)};const throwOnDuplicateStream=(u,A,p)=>{if(u!==undefined){throw new TypeError(`The \`${u.optionName}\` and \`${A}\` options must not target ${ws[p]} that is the same.`)}};const handleStdio=(u,A,p,y)=>{const E=normalizeStdioOption(A,p,y);const C=E.map(((u,p)=>getFileDescriptor({stdioOption:u,fdNumber:p,options:A,isSync:y})));const I=getFinalFileDescriptors({initialFileDescriptors:C,addProperties:u,options:A,isSync:y});A.stdio=I.map((({stdioItems:u})=>forwardStdio(u)));return I};const getFileDescriptor=({stdioOption:u,fdNumber:A,options:p,isSync:y})=>{const E=getStreamName(A);const{stdioItems:C,isStdioArray:I}=initializeStdioItems({stdioOption:u,fdNumber:A,options:p,optionName:E});const w=getStreamDirection(C,A,E);const v=C.map((u=>handleNativeStream({stdioItem:u,isStdioArray:I,fdNumber:A,direction:w,isSync:y})));const B=normalizeTransforms(v,E,w,p);const S=getFdObjectMode(B,w);validateFileObjectMode(B,S);return{direction:w,objectMode:S,stdioItems:B}};const initializeStdioItems=({stdioOption:u,fdNumber:A,options:p,optionName:y})=>{const E=Array.isArray(u)?u:[u];const C=[...E.map((u=>initializeStdioItem(u,y))),...handleInputOptions(p,A)];const I=filterDuplicates(C);const w=I.length>1;validateStdioArray(I,w,y);validateStreams(I);return{stdioItems:I,isStdioArray:w}};const initializeStdioItem=(u,A)=>({type:getStdioItemType(u,A),value:u,optionName:A});const validateStdioArray=(u,A,p)=>{if(u.length===0){throw new TypeError(`The \`${p}\` option must not be an empty array.`)}if(!A){return}for(const{value:A,optionName:p}of u){if(Ds.has(A)){throw new Error(`The \`${p}\` option must not include \`${A}\`.`)}}};const Ds=new Set(["ignore","ipc"]);const validateStreams=u=>{for(const A of u){validateFileStdio(A)}};const validateFileStdio=({type:u,value:A,optionName:p})=>{if(isRegularUrl(A)){throw new TypeError(`The \`${p}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`)}if(isUnknownStdioString(u,A)){throw new TypeError(`The \`${p}: { file: '...' }\` option must be used instead of \`${p}: '...'\`.`)}};const validateFileObjectMode=(u,A)=>{if(!A){return}const p=u.find((({type:u})=>Es.has(u)));if(p!==undefined){throw new TypeError(`The \`${p.optionName}\` option cannot use both files and transforms in objectMode.`)}};const getFinalFileDescriptors=({initialFileDescriptors:u,addProperties:A,options:p,isSync:y})=>{const E=[];try{for(const C of u){E.push(getFinalFileDescriptor({fileDescriptor:C,fileDescriptors:E,addProperties:A,options:p,isSync:y}))}return E}catch(u){cleanupCustomStreams(E);throw u}};const getFinalFileDescriptor=({fileDescriptor:{direction:u,objectMode:A,stdioItems:p},fileDescriptors:y,addProperties:E,options:C,isSync:I})=>{const w=p.map((A=>addStreamProperties({stdioItem:A,addProperties:E,direction:u,options:C,fileDescriptors:y,isSync:I})));return{direction:u,objectMode:A,stdioItems:w}};const addStreamProperties=({stdioItem:u,addProperties:A,direction:p,options:y,fileDescriptors:E,isSync:C})=>{const I=getDuplicateStream({stdioItem:u,direction:p,fileDescriptors:E,isSync:C});if(I!==undefined){return{...u,stream:I}}return{...u,...A[p][u.type](u,y)}};const cleanupCustomStreams=u=>{for(const{stdioItems:A}of u){for(const{stream:u}of A){if(u!==undefined&&!isStandardStream(u)){u.destroy()}}}};const forwardStdio=u=>{if(u.length>1){return u.some((({value:u})=>u==="overlapped"))?"overlapped":"pipe"}const[{type:A,value:p}]=u;return A==="native"?p:"pipe"};const handleStdioSync=(u,A)=>handleStdio(Qs,u,A,true);const forbiddenIfSync=({type:u,optionName:A})=>{throwInvalidSyncValue(A,ws[u])};const forbiddenNativeIfSync=({optionName:u,value:A})=>{if(A==="ipc"||A==="overlapped"){throwInvalidSyncValue(u,`"${A}"`)}return{}};const throwInvalidSyncValue=(u,A)=>{throw new TypeError(`The \`${u}\` option cannot be ${A} with synchronous methods.`)};const ks={generator(){},asyncGenerator:forbiddenIfSync,webStream:forbiddenIfSync,nodeStream:forbiddenIfSync,webTransform:forbiddenIfSync,duplex:forbiddenIfSync,asyncIterable:forbiddenIfSync,native:forbiddenNativeIfSync};const Qs={input:{...ks,fileUrl:({value:u})=>({contents:[bufferToUint8Array((0,_e.readFileSync)(u))]}),filePath:({value:{file:u}})=>({contents:[bufferToUint8Array((0,_e.readFileSync)(u))]}),fileNumber:forbiddenIfSync,iterable:({value:u})=>({contents:[...u]}),string:({value:u})=>({contents:[u]}),uint8Array:({value:u})=>({contents:[u]})},output:{...ks,fileUrl:({value:u})=>({path:u}),filePath:({value:{file:u,append:A}})=>({path:u,append:A}),fileNumber:({value:u})=>({path:u}),iterable:forbiddenIfSync,string:forbiddenIfSync,uint8Array:forbiddenIfSync}};const stripNewline=(u,{stripFinalNewline:A},p)=>getStripFinalNewline(A,p)&&u!==undefined&&!Array.isArray(u)?strip_final_newline_stripFinalNewline(u):u;const getStripFinalNewline=(u,A)=>A==="all"?u[1]||u[2]:u[A];const getSplitLinesGenerator=(u,A,p,y)=>u||p?undefined:initializeSplitLines(A,y);const splitLinesSync=(u,A,p)=>p?u.flatMap((u=>splitLinesItemSync(u,A))):splitLinesItemSync(u,A);const splitLinesItemSync=(u,A)=>{const{transform:p,final:y}=initializeSplitLines(A,{});return[...p(u),...y()]};const initializeSplitLines=(u,A)=>{A.previousChunks="";return{transform:splitGenerator.bind(undefined,A,u),final:linesFinal.bind(undefined,A)}};const splitGenerator=function*(u,A,p){if(typeof p!=="string"){yield p;return}let{previousChunks:y}=u;let E=-1;for(let C=0;C<p.length;C+=1){if(p[C]==="\n"){const I=getNewlineLength(p,C,A,u);let w=p.slice(E+1,C+1-I);if(y.length>0){w=concatString(y,w);y=""}yield w;E=C}}if(E!==p.length-1){y=concatString(y,p.slice(E+1))}u.previousChunks=y};const getNewlineLength=(u,A,p,y)=>{if(p){return 0}y.isWindowsNewline=A!==0&&u[A-1]==="\r";return y.isWindowsNewline?2:1};const linesFinal=function*({previousChunks:u}){if(u.length>0){yield u}};const getAppendNewlineGenerator=({binary:u,preserveNewlines:A,readableObjectMode:p,state:y})=>u||A||p?undefined:{transform:appendNewlineGenerator.bind(undefined,y)};const appendNewlineGenerator=function*({isWindowsNewline:u=false},A){const{unixNewline:p,windowsNewline:y,LF:E,concatBytes:C}=typeof A==="string"?Fs:xs;if(A.at(-1)===E){yield A;return}const I=u?y:p;yield C(A,I)};const concatString=(u,A)=>`${u}${A}`;const Fs={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:concatString};const concatUint8Array=(u,A)=>{const p=new Uint8Array(u.length+A.length);p.set(u,0);p.set(A,u.length);return p};const xs={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:concatUint8Array};var Rs=p(4573);const getValidateTransformInput=(u,A)=>u?undefined:validateStringTransformInput.bind(undefined,A);const validateStringTransformInput=function*(u,A){if(typeof A!=="string"&&!isUint8Array(A)&&!Rs.Buffer.isBuffer(A)){throw new TypeError(`The \`${u}\` option's transform must use "objectMode: true" to receive as input: ${typeof A}.`)}yield A};const getValidateTransformReturn=(u,A)=>u?validateObjectTransformReturn.bind(undefined,A):validateStringTransformReturn.bind(undefined,A);const validateObjectTransformReturn=function*(u,A){validateEmptyReturn(u,A);yield A};const validateStringTransformReturn=function*(u,A){validateEmptyReturn(u,A);if(typeof A!=="string"&&!isUint8Array(A)){throw new TypeError(`The \`${u}\` option's function must yield a string or an Uint8Array, not ${typeof A}.`)}yield A};const validateEmptyReturn=(u,A)=>{if(A===null||A===undefined){throw new TypeError(`The \`${u}\` option's function must not call \`yield ${A}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)}};const getEncodingTransformGenerator=(u,A,p)=>{if(p){return}if(u){return{transform:encodingUint8ArrayGenerator.bind(undefined,new TextEncoder)}}const y=new Oe.StringDecoder(A);return{transform:encodingStringGenerator.bind(undefined,y),final:encodingStringFinal.bind(undefined,y)}};const encodingUint8ArrayGenerator=function*(u,A){if(Rs.Buffer.isBuffer(A)){yield bufferToUint8Array(A)}else if(typeof A==="string"){yield u.encode(A)}else{yield A}};const encodingStringGenerator=function*(u,A){yield isUint8Array(A)?u.write(A):A};const encodingStringFinal=function*(u){const A=u.end();if(A!==""){yield A}};const _s=(0,cn.callbackify)((async(u,A,p,y)=>{A.currentIterable=u(...p);try{for await(const u of A.currentIterable){y.push(u)}}finally{delete A.currentIterable}}));const transformChunk=async function*(u,A,p){if(p===A.length){yield u;return}const{transform:y=identityGenerator}=A[p];for await(const E of y(u)){yield*transformChunk(E,A,p+1)}};const finalChunks=async function*(u){for(const[A,{final:p}]of Object.entries(u)){yield*generatorFinalChunks(p,Number(A),u)}};const generatorFinalChunks=async function*(u,A,p){if(u===undefined){return}for await(const y of u()){yield*transformChunk(y,p,A+1)}};const Ts=(0,cn.callbackify)((async({currentIterable:u},A)=>{if(u!==undefined){await(A?u.throw(A):u.return());return}if(A){throw A}}));const identityGenerator=function*(u){yield u};const pushChunksSync=(u,A,p,y)=>{try{for(const y of u(...A)){p.push(y)}y()}catch(u){y(u)}};const runTransformSync=(u,A)=>[...A.flatMap((A=>[...transformChunkSync(A,u,0)])),...finalChunksSync(u)];const transformChunkSync=function*(u,A,p){if(p===A.length){yield u;return}const{transform:y=run_sync_identityGenerator}=A[p];for(const E of y(u)){yield*transformChunkSync(E,A,p+1)}};const finalChunksSync=function*(u){for(const[A,{final:p}]of Object.entries(u)){yield*generatorFinalChunksSync(p,Number(A),u)}};const generatorFinalChunksSync=function*(u,A,p){if(u===undefined){return}for(const y of u()){yield*transformChunkSync(y,p,A+1)}};const run_sync_identityGenerator=function*(u){yield u};const generatorToStream=({value:u,value:{transform:A,final:p,writableObjectMode:y,readableObjectMode:E},optionName:C},{encoding:I})=>{const w={};const v=addInternalGenerators(u,I,C);const B=isAsyncGenerator(A);const S=isAsyncGenerator(p);const D=B?_s.bind(undefined,transformChunk,w):pushChunksSync.bind(undefined,transformChunkSync);const k=B||S?_s.bind(undefined,finalChunks,w):pushChunksSync.bind(undefined,finalChunksSync);const Q=B||S?Ts.bind(undefined,w):undefined;const F=new Pe.Transform({writableObjectMode:y,writableHighWaterMark:(0,Pe.getDefaultHighWaterMark)(y),readableObjectMode:E,readableHighWaterMark:(0,Pe.getDefaultHighWaterMark)(E),transform(u,A,p){D([u,v,0],this,p)},flush(u){k([v],this,u)},destroy:Q});return{stream:F}};const runGeneratorsSync=(u,A,p,y)=>{const E=A.filter((({type:u})=>u==="generator"));const C=y?E.reverse():E;for(const{value:A,optionName:y}of C){const E=addInternalGenerators(A,p,y);u=runTransformSync(E,u)}return u};const addInternalGenerators=({transform:u,final:A,binary:p,writableObjectMode:y,readableObjectMode:E,preserveNewlines:C},I,w)=>{const v={};return[{transform:getValidateTransformInput(y,w)},getEncodingTransformGenerator(p,I,y),getSplitLinesGenerator(p,C,y,v),{transform:u,final:A},{transform:getValidateTransformReturn(E,w)},getAppendNewlineGenerator({binary:p,preserveNewlines:C,readableObjectMode:E,state:v})].filter(Boolean)};const addInputOptionsSync=(u,A)=>{for(const p of getInputFdNumbers(u)){addInputOptionSync(u,p,A)}};const getInputFdNumbers=u=>new Set(Object.entries(u).filter((([,{direction:u}])=>u==="input")).map((([u])=>Number(u))));const addInputOptionSync=(u,A,p)=>{const{stdioItems:y}=u[A];const E=y.filter((({contents:u})=>u!==undefined));if(E.length===0){return}if(A!==0){const[{type:u,optionName:A}]=E;throw new TypeError(`Only the \`stdin\` option, not \`${A}\`, can be ${ws[u]} with synchronous methods.`)}const C=E.map((({contents:u})=>u));const I=C.map((u=>applySingleInputGeneratorsSync(u,y)));p.input=joinToUint8Array(I)};const applySingleInputGeneratorsSync=(u,A)=>{const p=runGeneratorsSync(u,A,"utf8",true);validateSerializable(p);return joinToUint8Array(p)};const validateSerializable=u=>{const A=u.find((u=>typeof u!=="string"&&!isUint8Array(u)));if(A!==undefined){throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${A}.`)}};const shouldLogOutput=({stdioItems:u,encoding:A,verboseInfo:p,fdNumber:y})=>y!=="all"&&isFullVerbose(p,y)&&!es.has(A)&&fdUsesVerbose(y)&&(u.some((({type:u,value:A})=>u==="native"&&Ns.has(A)))||u.every((({type:u})=>ys.has(u))));const fdUsesVerbose=u=>u===1||u===2;const Ns=new Set(["pipe","overlapped"]);const logLines=async(u,A,p,y)=>{for await(const E of u){if(!isPipingStream(A)){logLine(E,p,y)}}};const logLinesSync=(u,A,p)=>{for(const y of u){logLine(y,A,p)}};const isPipingStream=u=>u._readableState.pipes.length>0;const logLine=(u,A,p)=>{const y=serializeVerboseMessage(u);verboseLog({type:"output",verboseMessage:y,fdNumber:A,verboseInfo:p})};const transformOutputSync=({fileDescriptors:u,syncResult:{output:A},options:p,isMaxBuffer:y,verboseInfo:E})=>{if(A===null){return{output:Array.from({length:3})}}const C={};const I=new Set([]);const w=A.map(((A,w)=>transformOutputResultSync({result:A,fileDescriptors:u,fdNumber:w,state:C,outputFiles:I,isMaxBuffer:y,verboseInfo:E},p)));return{output:w,...C}};const transformOutputResultSync=({result:u,fileDescriptors:A,fdNumber:p,state:y,outputFiles:E,isMaxBuffer:C,verboseInfo:I},{buffer:w,encoding:v,lines:B,stripFinalNewline:S,maxBuffer:D})=>{if(u===null){return}const k=truncateMaxBufferSync(u,C,D);const Q=bufferToUint8Array(k);const{stdioItems:F,objectMode:R}=A[p];const _=runOutputGeneratorsSync([Q],F,v,y);const{serializedResult:P,finalResult:O=P}=serializeChunks({chunks:_,objectMode:R,encoding:v,lines:B,stripFinalNewline:S,fdNumber:p});logOutputSync({serializedResult:P,fdNumber:p,state:y,verboseInfo:I,encoding:v,stdioItems:F,objectMode:R});const U=w[p]?O:undefined;try{if(y.error===undefined){writeToFiles(P,F,E)}return U}catch(u){y.error=u;return U}};const runOutputGeneratorsSync=(u,A,p,y)=>{try{return runGeneratorsSync(u,A,p,false)}catch(A){y.error=A;return u}};const serializeChunks=({chunks:u,objectMode:A,encoding:p,lines:y,stripFinalNewline:E,fdNumber:C})=>{if(A){return{serializedResult:u}}if(p==="buffer"){return{serializedResult:joinToUint8Array(u)}}const I=joinToString(u,p);if(y[C]){return{serializedResult:I,finalResult:splitLinesSync(I,!E[C],A)}}return{serializedResult:I}};const logOutputSync=({serializedResult:u,fdNumber:A,state:p,verboseInfo:y,encoding:E,stdioItems:C,objectMode:I})=>{if(!shouldLogOutput({stdioItems:C,encoding:E,verboseInfo:y,fdNumber:A})){return}const w=splitLinesSync(u,false,I);try{logLinesSync(w,A,y)}catch(u){p.error??=u}};const writeToFiles=(u,A,p)=>{for(const{path:y,append:E}of A.filter((({type:u})=>Es.has(u)))){const A=typeof y==="string"?y:y.toString();if(E||p.has(A)){(0,_e.appendFileSync)(y,u)}else{p.add(A);(0,_e.writeFileSync)(y,u)}}};const getAllSync=([,u,A],p)=>{if(!p.all){return}if(u===undefined){return A}if(A===undefined){return u}if(Array.isArray(u)){return Array.isArray(A)?[...u,...A]:[...u,stripNewline(A,p,"all")]}if(Array.isArray(A)){return[stripNewline(u,p,"all"),...A]}if(isUint8Array(u)&&isUint8Array(A)){return concatUint8Arrays([u,A])}return`${u}${A}`};const waitForExit=async(u,A)=>{const[p,y]=await waitForExitOrError(u);A.isForcefullyTerminated??=false;return[p,y]};const waitForExitOrError=async u=>{const[A,p]=await Promise.allSettled([(0,Le.once)(u,"spawn"),(0,Le.once)(u,"exit")]);if(A.status==="rejected"){return[]}return p.status==="rejected"?waitForSubprocessExit(u):p.value};const waitForSubprocessExit=async u=>{try{return await(0,Le.once)(u,"exit")}catch{return waitForSubprocessExit(u)}};const waitForSuccessfulExit=async u=>{const[A,p]=await u;if(!isSubprocessErrorExit(A,p)&&isFailedExit(A,p)){throw new DiscardedError}return[A,p]};const isSubprocessErrorExit=(u,A)=>u===undefined&&A===undefined;const isFailedExit=(u,A)=>u!==0||A!==null;const getExitResultSync=({error:u,status:A,signal:p,output:y},{maxBuffer:E})=>{const C=getResultError(u,A,p);const I=C?.code==="ETIMEDOUT";const w=isMaxBufferSync(C,y,E);return{resultError:C,exitCode:A,signal:p,timedOut:I,isMaxBuffer:w}};const getResultError=(u,A,p)=>{if(u!==undefined){return u}return isFailedExit(A,p)?new DiscardedError:undefined};const execaCoreSync=(u,A,p)=>{const{file:y,commandArguments:E,command:C,escapedCommand:I,startTime:w,verboseInfo:v,options:B,fileDescriptors:S}=handleSyncArguments(u,A,p);const D=spawnSubprocessSync({file:y,commandArguments:E,options:B,command:C,escapedCommand:I,verboseInfo:v,fileDescriptors:S,startTime:w});return handleResult(D,v,B)};const handleSyncArguments=(u,A,p)=>{const{command:y,escapedCommand:E,startTime:C,verboseInfo:I}=handleCommand(u,A,p);const w=normalizeSyncOptions(p);const{file:v,commandArguments:B,options:S}=normalizeOptions(u,A,w);validateSyncOptions(S);const D=handleStdioSync(S,I);return{file:v,commandArguments:B,command:y,escapedCommand:E,startTime:C,verboseInfo:I,options:S,fileDescriptors:D}};const normalizeSyncOptions=u=>u.node&&!u.ipc?{...u,ipc:false}:u;const validateSyncOptions=({ipc:u,ipcInput:A,detached:p,cancelSignal:y})=>{if(A){throwInvalidSyncOption("ipcInput")}if(u){throwInvalidSyncOption("ipc: true")}if(p){throwInvalidSyncOption("detached: true")}if(y){throwInvalidSyncOption("cancelSignal")}};const throwInvalidSyncOption=u=>{throw new TypeError(`The "${u}" option cannot be used with synchronous methods.`)};const spawnSubprocessSync=({file:u,commandArguments:A,options:p,command:y,escapedCommand:E,verboseInfo:C,fileDescriptors:I,startTime:w})=>{const v=runSubprocessSync({file:u,commandArguments:A,options:p,command:y,escapedCommand:E,fileDescriptors:I,startTime:w});if(v.failed){return v}const{resultError:B,exitCode:S,signal:D,timedOut:k,isMaxBuffer:Q}=getExitResultSync(v,p);const{output:F,error:R=B}=transformOutputSync({fileDescriptors:I,syncResult:v,options:p,isMaxBuffer:Q,verboseInfo:C});const _=F.map(((u,A)=>stripNewline(u,p,A)));const P=stripNewline(getAllSync(F,p),p,"all");return getSyncResult({error:R,exitCode:S,signal:D,timedOut:k,isMaxBuffer:Q,stdio:_,all:P,options:p,command:y,escapedCommand:E,startTime:w})};const runSubprocessSync=({file:u,commandArguments:A,options:p,command:y,escapedCommand:E,fileDescriptors:C,startTime:I})=>{try{addInputOptionsSync(C,p);const y=normalizeSpawnSyncOptions(p);return(0,nn.spawnSync)(...concatenateShell(u,A,y))}catch(u){return makeEarlyError({error:u,command:y,escapedCommand:E,fileDescriptors:C,options:p,startTime:I,isSync:true})}};const normalizeSpawnSyncOptions=({encoding:u,maxBuffer:A,...p})=>({...p,encoding:"buffer",maxBuffer:getMaxBufferSync(A)});const getSyncResult=({error:u,exitCode:A,signal:p,timedOut:y,isMaxBuffer:E,stdio:C,all:I,options:w,command:v,escapedCommand:B,startTime:S})=>u===undefined?makeSuccessResult({command:v,escapedCommand:B,stdio:C,all:I,ipcOutput:[],options:w,startTime:S}):makeError({error:u,command:v,escapedCommand:B,timedOut:y,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:E,isForcefullyTerminated:false,exitCode:A,signal:p,stdio:C,all:I,ipcOutput:[],options:w,startTime:S,isSync:true});const getOneMessage=({anyProcess:u,channel:A,isSubprocess:p,ipc:y},{reference:E=true,filter:C}={})=>{validateIpcMethod({methodName:"getOneMessage",isSubprocess:p,ipc:y,isConnected:isConnected(u)});return getOneMessageAsync({anyProcess:u,channel:A,isSubprocess:p,filter:C,reference:E})};const getOneMessageAsync=async({anyProcess:u,channel:A,isSubprocess:p,filter:y,reference:E})=>{addReference(A,E);const C=getIpcEmitter(u,A,p);const I=new AbortController;try{return await Promise.race([getMessage(C,y,I),get_one_throwOnDisconnect(C,p,I),throwOnStrictError(C,p,I)])}catch(A){disconnect(u);throw A}finally{I.abort();removeReference(A,E)}};const getMessage=async(u,A,{signal:p})=>{if(A===undefined){const[A]=await(0,Le.once)(u,"message",{signal:p});return A}for await(const[y]of(0,Le.on)(u,"message",{signal:p})){if(A(y)){return y}}};const get_one_throwOnDisconnect=async(u,A,{signal:p})=>{await(0,Le.once)(u,"disconnect",{signal:p});throwOnEarlyDisconnect(A)};const throwOnStrictError=async(u,A,{signal:p})=>{const[y]=await(0,Le.once)(u,"strict:error",{signal:p});throw getStrictResponseError(y,A)};const getEachMessage=({anyProcess:u,channel:A,isSubprocess:p,ipc:y},{reference:E=true}={})=>loopOnMessages({anyProcess:u,channel:A,isSubprocess:p,ipc:y,shouldAwait:!p,reference:E});const loopOnMessages=({anyProcess:u,channel:A,isSubprocess:p,ipc:y,shouldAwait:E,reference:C})=>{validateIpcMethod({methodName:"getEachMessage",isSubprocess:p,ipc:y,isConnected:isConnected(u)});addReference(A,C);const I=getIpcEmitter(u,A,p);const w=new AbortController;const v={};stopOnDisconnect(u,I,w);abortOnStrictError({ipcEmitter:I,isSubprocess:p,controller:w,state:v});return iterateOnMessages({anyProcess:u,channel:A,ipcEmitter:I,isSubprocess:p,shouldAwait:E,controller:w,state:v,reference:C})};const stopOnDisconnect=async(u,A,p)=>{try{await(0,Le.once)(A,"disconnect",{signal:p.signal});p.abort()}catch{}};const abortOnStrictError=async({ipcEmitter:u,isSubprocess:A,controller:p,state:y})=>{try{const[E]=await(0,Le.once)(u,"strict:error",{signal:p.signal});y.error=getStrictResponseError(E,A);p.abort()}catch{}};const iterateOnMessages=async function*({anyProcess:u,channel:A,ipcEmitter:p,isSubprocess:y,shouldAwait:E,controller:C,state:I,reference:w}){try{for await(const[u]of(0,Le.on)(p,"message",{signal:C.signal})){throwIfStrictError(I);yield u}}catch{throwIfStrictError(I)}finally{C.abort();removeReference(A,w);if(!y){disconnect(u)}if(E){await u}}};const throwIfStrictError=({error:u})=>{if(u){throw u}};const addIpcMethods=(u,{ipc:A})=>{Object.assign(u,getIpcMethods(u,false,A))};const getIpcExport=()=>{const u=un;const A=true;const p=un.channel!==undefined;return{...getIpcMethods(u,A,p),getCancelSignal:getCancelSignal.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p})}};const getIpcMethods=(u,A,p)=>({sendMessage:sendMessage.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p}),getOneMessage:getOneMessage.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p}),getEachMessage:getEachMessage.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p})});const handleEarlyError=({error:u,command:A,escapedCommand:p,fileDescriptors:y,options:E,startTime:C,verboseInfo:I})=>{cleanupCustomStreams(y);const w=new nn.ChildProcess;createDummyStreams(w,y);Object.assign(w,{readable:readable,writable:writable,duplex:duplex});const v=makeEarlyError({error:u,command:A,escapedCommand:p,fileDescriptors:y,options:E,startTime:C,isSync:false});const B=handleDummyPromise(v,I,E);return{subprocess:w,promise:B}};const createDummyStreams=(u,A)=>{const p=createDummyStream();const y=createDummyStream();const E=createDummyStream();const C=Array.from({length:A.length-3},createDummyStream);const I=createDummyStream();const w=[p,y,E,...C];Object.assign(u,{stdin:p,stdout:y,stderr:E,all:I,stdio:w})};const createDummyStream=()=>{const u=new Pe.PassThrough;u.end();return u};const readable=()=>new Pe.Readable({read(){}});const writable=()=>new Pe.Writable({write(){}});const duplex=()=>new Pe.Duplex({read(){},write(){}});const handleDummyPromise=async(u,A,p)=>handleResult(u,A,p);const handleStdioAsync=(u,A)=>handleStdio(Ps,u,A,false);const forbiddenIfAsync=({type:u,optionName:A})=>{throw new TypeError(`The \`${A}\` option cannot be ${ws[u]}.`)};const Ls={fileNumber:forbiddenIfAsync,generator:generatorToStream,asyncGenerator:generatorToStream,nodeStream:({value:u})=>({stream:u}),webTransform({value:{transform:u,writableObjectMode:A,readableObjectMode:p}}){const y=A||p;const E=Pe.Duplex.fromWeb(u,{objectMode:y});return{stream:E}},duplex:({value:{transform:u}})=>({stream:u}),native(){}};const Ps={input:{...Ls,fileUrl:({value:u})=>({stream:(0,_e.createReadStream)(u)}),filePath:({value:{file:u}})=>({stream:(0,_e.createReadStream)(u)}),webStream:({value:u})=>({stream:Pe.Readable.fromWeb(u)}),iterable:({value:u})=>({stream:Pe.Readable.from(u)}),asyncIterable:({value:u})=>({stream:Pe.Readable.from(u)}),string:({value:u})=>({stream:Pe.Readable.from(u)}),uint8Array:({value:u})=>({stream:Pe.Readable.from(Rs.Buffer.from(u))})},output:{...Ls,fileUrl:({value:u})=>({stream:(0,_e.createWriteStream)(u)}),filePath:({value:{file:u,append:A}})=>({stream:(0,_e.createWriteStream)(u,A?{flags:"a"}:{})}),webStream:({value:u})=>({stream:Pe.Writable.fromWeb(u)}),iterable:forbiddenIfAsync,asyncIterable:forbiddenIfAsync,string:forbiddenIfAsync,uint8Array:forbiddenIfAsync}};const Os=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises");function mergeStreams(u){if(!Array.isArray(u)){throw new TypeError(`Expected an array, got \`${typeof u}\`.`)}for(const A of u){validateStream(A)}const A=u.some((({readableObjectMode:u})=>u));const p=getHighWaterMark(u,A);const y=new MergedStream({objectMode:A,writableHighWaterMark:p,readableHighWaterMark:p});for(const A of u){y.add(A)}return y}const getHighWaterMark=(u,A)=>{if(u.length===0){return(0,Pe.getDefaultHighWaterMark)(A)}const p=u.filter((({readableObjectMode:u})=>u===A)).map((({readableHighWaterMark:u})=>u));return Math.max(...p)};class MergedStream extends Pe.PassThrough{#wt=new Set([]);#vt=new Set([]);#Bt=new Set([]);#St;#Dt=Symbol("unpipe");#kt=new WeakMap;add(u){validateStream(u);if(this.#wt.has(u)){return}this.#wt.add(u);this.#St??=onMergedStreamFinished(this,this.#wt,this.#Dt);const A=endWhenStreamsDone({passThroughStream:this,stream:u,streams:this.#wt,ended:this.#vt,aborted:this.#Bt,onFinished:this.#St,unpipeEvent:this.#Dt});this.#kt.set(u,A);u.pipe(this,{end:false})}async remove(u){validateStream(u);if(!this.#wt.has(u)){return false}const A=this.#kt.get(u);if(A===undefined){return false}this.#kt.delete(u);u.unpipe(this);await A;return true}}const onMergedStreamFinished=async(u,A,p)=>{updateMaxListeners(u,Ms);const y=new AbortController;try{await Promise.race([onMergedStreamEnd(u,y),onInputStreamsUnpipe(u,A,p,y)])}finally{y.abort();updateMaxListeners(u,-Ms)}};const onMergedStreamEnd=async(u,{signal:A})=>{try{await(0,Os.finished)(u,{signal:A,cleanup:true})}catch(A){errorOrAbortStream(u,A);throw A}};const onInputStreamsUnpipe=async(u,A,p,{signal:y})=>{for await(const[E]of(0,Le.on)(u,"unpipe",{signal:y})){if(A.has(E)){E.emit(p)}}};const validateStream=u=>{if(typeof u?.pipe!=="function"){throw new TypeError(`Expected a readable stream, got: \`${typeof u}\`.`)}};const endWhenStreamsDone=async({passThroughStream:u,stream:A,streams:p,ended:y,aborted:E,onFinished:C,unpipeEvent:I})=>{updateMaxListeners(u,Us);const w=new AbortController;try{await Promise.race([afterMergedStreamFinished(C,A,w),onInputStreamEnd({passThroughStream:u,stream:A,streams:p,ended:y,aborted:E,controller:w}),onInputStreamUnpipe({stream:A,streams:p,ended:y,aborted:E,unpipeEvent:I,controller:w})])}finally{w.abort();updateMaxListeners(u,-Us)}if(p.size>0&&p.size===y.size+E.size){if(y.size===0&&E.size>0){abortStream(u)}else{endStream(u)}}};const afterMergedStreamFinished=async(u,A,{signal:p})=>{try{await u;if(!p.aborted){abortStream(A)}}catch(u){if(!p.aborted){errorOrAbortStream(A,u)}}};const onInputStreamEnd=async({passThroughStream:u,stream:A,streams:p,ended:y,aborted:E,controller:{signal:C}})=>{try{await(0,Os.finished)(A,{signal:C,cleanup:true,readable:true,writable:false});if(p.has(A)){y.add(A)}}catch(y){if(C.aborted||!p.has(A)){return}if(isAbortError(y)){E.add(A)}else{errorStream(u,y)}}};const onInputStreamUnpipe=async({stream:u,streams:A,ended:p,aborted:y,unpipeEvent:E,controller:{signal:C}})=>{await(0,Le.once)(u,E,{signal:C});if(!u.readable){return(0,Le.once)(C,"abort",{signal:C})}A.delete(u);p.delete(u);y.delete(u)};const endStream=u=>{if(u.writable){u.end()}};const errorOrAbortStream=(u,A)=>{if(isAbortError(A)){abortStream(u)}else{errorStream(u,A)}};const isAbortError=u=>u?.code==="ERR_STREAM_PREMATURE_CLOSE";const abortStream=u=>{if(u.readable||u.writable){u.destroy()}};const errorStream=(u,A)=>{if(!u.destroyed){u.once("error",noop);u.destroy(A)}};const noop=()=>{};const updateMaxListeners=(u,A)=>{const p=u.getMaxListeners();if(p!==0&&p!==Number.POSITIVE_INFINITY){u.setMaxListeners(p+A)}};const Ms=2;const Us=1;const pipeStreams=(u,A)=>{u.pipe(A);onSourceFinish(u,A);onDestinationFinish(u,A)};const onSourceFinish=async(u,A)=>{if(isStandardStream(u)||isStandardStream(A)){return}try{await(0,Os.finished)(u,{cleanup:true,readable:true,writable:false})}catch{}endDestinationStream(A)};const endDestinationStream=u=>{if(u.writable){u.end()}};const onDestinationFinish=async(u,A)=>{if(isStandardStream(u)||isStandardStream(A)){return}try{await(0,Os.finished)(A,{cleanup:true,readable:false,writable:true})}catch{}abortSourceStream(u)};const abortSourceStream=u=>{if(u.readable){u.destroy()}};const pipeOutputAsync=(u,A,p)=>{const y=new Map;for(const[E,{stdioItems:C,direction:I}]of Object.entries(A)){for(const{stream:A}of C.filter((({type:u})=>ys.has(u)))){pipeTransform(u,A,I,E)}for(const{stream:A}of C.filter((({type:u})=>!ys.has(u)))){pipeStdioItem({subprocess:u,stream:A,direction:I,fdNumber:E,pipeGroups:y,controller:p})}}for(const[u,A]of y.entries()){const p=A.length===1?A[0]:mergeStreams(A);pipeStreams(p,u)}};const pipeTransform=(u,A,p,y)=>{if(p==="output"){pipeStreams(u.stdio[y],A)}else{pipeStreams(A,u.stdio[y])}const E=Hs[y];if(E!==undefined){u[E]=A}u.stdio[y]=A};const Hs=["stdin","stdout","stderr"];const pipeStdioItem=({subprocess:u,stream:A,direction:p,fdNumber:y,pipeGroups:E,controller:C})=>{if(A===undefined){return}setStandardStreamMaxListeners(A,C);const[I,w]=p==="output"?[A,u.stdio[y]]:[u.stdio[y],A];const v=E.get(I)??[];E.set(I,[...v,w])};const setStandardStreamMaxListeners=(u,{signal:A})=>{if(isStandardStream(u)){incrementMaxListeners(u,Gs,A)}};const Gs=2;const Ws=[];Ws.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32"){Ws.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){Ws.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")}const processOk=u=>!!u&&typeof u==="object"&&typeof u.removeListener==="function"&&typeof u.emit==="function"&&typeof u.reallyExit==="function"&&typeof u.listeners==="function"&&typeof u.kill==="function"&&typeof u.pid==="number"&&typeof u.on==="function";const js=Symbol.for("signal-exit emitter");const zs=globalThis;const $s=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(zs[js]){return zs[js]}$s(zs,js,{value:this,writable:false,enumerable:false,configurable:false})}on(u,A){this.listeners[u].push(A)}removeListener(u,A){const p=this.listeners[u];const y=p.indexOf(A);if(y===-1){return}if(y===0&&p.length===1){p.length=0}else{p.splice(y,1)}}emit(u,A,p){if(this.emitted[u]){return false}this.emitted[u]=true;let y=false;for(const E of this.listeners[u]){y=E(A,p)===true||y}if(u==="exit"){y=this.emit("afterExit",A,p)||y}return y}}class SignalExitBase{}const signalExitWrap=u=>({onExit(A,p){return u.onExit(A,p)},load(){return u.load()},unload(){return u.unload()}});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#Qt=qs.platform==="win32"?"SIGINT":"SIGHUP";#Ft=new Emitter;#xt;#Rt;#_t;#Tt={};#Nt=false;constructor(u){super();this.#xt=u;this.#Tt={};for(const A of Ws){this.#Tt[A]=()=>{const p=this.#xt.listeners(A);let{count:y}=this.#Ft;const E=u;if(typeof E.__signal_exit_emitter__==="object"&&typeof E.__signal_exit_emitter__.count==="number"){y+=E.__signal_exit_emitter__.count}if(p.length===y){this.unload();const p=this.#Ft.emit("exit",null,A);const y=A==="SIGHUP"?this.#Qt:A;if(!p)u.kill(u.pid,y)}}}this.#_t=u.reallyExit;this.#Rt=u.emit}onExit(u,A){if(!processOk(this.#xt)){return()=>{}}if(this.#Nt===false){this.load()}const p=A?.alwaysLast?"afterExit":"exit";this.#Ft.on(p,u);return()=>{this.#Ft.removeListener(p,u);if(this.#Ft.listeners["exit"].length===0&&this.#Ft.listeners["afterExit"].length===0){this.unload()}}}load(){if(this.#Nt){return}this.#Nt=true;this.#Ft.count+=1;for(const u of Ws){try{const A=this.#Tt[u];if(A)this.#xt.on(u,A)}catch(u){}}this.#xt.emit=(u,...A)=>this.#Lt(u,...A);this.#xt.reallyExit=u=>this.#Pt(u)}unload(){if(!this.#Nt){return}this.#Nt=false;Ws.forEach((u=>{const A=this.#Tt[u];if(!A){throw new Error("Listener not defined for signal: "+u)}try{this.#xt.removeListener(u,A)}catch(u){}}));this.#xt.emit=this.#Rt;this.#xt.reallyExit=this.#_t;this.#Ft.count-=1}#Pt(u){if(!processOk(this.#xt)){return 0}this.#xt.exitCode=u||0;this.#Ft.emit("exit",this.#xt.exitCode,null);return this.#_t.call(this.#xt,this.#xt.exitCode)}#Lt(u,...A){const p=this.#Rt;if(u==="exit"&&processOk(this.#xt)){if(typeof A[0]==="number"){this.#xt.exitCode=A[0]}const y=p.call(this.#xt,u,...A);this.#Ft.emit("exit",this.#xt.exitCode,null);return y}else{return p.call(this.#xt,u,...A)}}}const qs=globalThis.process;const{onExit:Vs,load:Ks,unload:Js}=signalExitWrap(processOk(qs)?new SignalExit(qs):new SignalExitFallback);const cleanupOnExit=(u,{cleanup:A,detached:p},{signal:y})=>{if(!A||p){return}const E=Vs((()=>{u.kill()}));(0,Le.addAbortListener)(y,(()=>{E()}))};const normalizePipeArguments=({source:u,sourcePromise:A,boundOptions:p,createNested:y},...E)=>{const C=getStartTime();const{destination:I,destinationStream:w,destinationError:v,from:B,unpipeSignal:S}=getDestinationStream(p,y,E);const{sourceStream:D,sourceError:k}=getSourceStream(u,B);const{options:Q,fileDescriptors:F}=Mr.get(u);return{sourcePromise:A,sourceStream:D,sourceOptions:Q,sourceError:k,destination:I,destinationStream:w,destinationError:v,unpipeSignal:S,fileDescriptors:F,startTime:C}};const getDestinationStream=(u,A,p)=>{try{const{destination:y,pipeOptions:{from:E,to:C,unpipeSignal:I}={}}=getDestination(u,A,...p);const w=getToStream(y,C);return{destination:y,destinationStream:w,from:E,unpipeSignal:I}}catch(u){return{destinationError:u}}};const getDestination=(u,A,p,...y)=>{if(Array.isArray(p)){const E=A(mapDestinationArguments,u)(p,...y);return{destination:E,pipeOptions:u}}if(typeof p==="string"||p instanceof URL||isDenoExecPath(p)){if(Object.keys(u).length>0){throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).')}const[E,C,I]=normalizeParameters(p,...y);const w=A(mapDestinationArguments)(E,C,I);return{destination:w,pipeOptions:I}}if(Mr.has(p)){if(Object.keys(u).length>0){throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).")}return{destination:p,pipeOptions:y[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${p}`)};const mapDestinationArguments=({options:u})=>({options:{...u,stdin:"pipe",piped:true}});const getSourceStream=(u,A)=>{try{const p=getFromStream(u,A);return{sourceStream:p}}catch(u){return{sourceError:u}}};const handlePipeArgumentsError=({sourceStream:u,sourceError:A,destinationStream:p,destinationError:y,fileDescriptors:E,sourceOptions:C,startTime:I})=>{const w=getPipeArgumentsError({sourceStream:u,sourceError:A,destinationStream:p,destinationError:y});if(w!==undefined){throw createNonCommandError({error:w,fileDescriptors:E,sourceOptions:C,startTime:I})}};const getPipeArgumentsError=({sourceStream:u,sourceError:A,destinationStream:p,destinationError:y})=>{if(A!==undefined&&y!==undefined){return y}if(y!==undefined){abortSourceStream(u);return y}if(A!==undefined){endDestinationStream(p);return A}};const createNonCommandError=({error:u,fileDescriptors:A,sourceOptions:p,startTime:y})=>makeEarlyError({error:u,command:Ys,escapedCommand:Ys,fileDescriptors:A,options:p,startTime:y,isSync:false});const Ys="source.pipe(destination)";const waitForBothSubprocesses=async u=>{const[{status:A,reason:p,value:y=p},{status:E,reason:C,value:I=C}]=await u;if(!I.pipedFrom.includes(y)){I.pipedFrom.push(y)}if(E==="rejected"){throw I}if(A==="rejected"){throw y}return I};const pipeSubprocessStream=(u,A,p)=>{const y=Xs.has(A)?pipeMoreSubprocessStream(u,A):pipeFirstSubprocessStream(u,A);incrementMaxListeners(u,Zs,p.signal);incrementMaxListeners(A,ei,p.signal);cleanupMergedStreamsMap(A);return y};const pipeFirstSubprocessStream=(u,A)=>{const p=mergeStreams([u]);pipeStreams(p,A);Xs.set(A,p);return p};const pipeMoreSubprocessStream=(u,A)=>{const p=Xs.get(A);p.add(u);return p};const cleanupMergedStreamsMap=async u=>{try{await(0,Os.finished)(u,{cleanup:true,readable:false,writable:true})}catch{}Xs.delete(u)};const Xs=new WeakMap;const Zs=2;const ei=1;const unpipeOnAbort=(u,A)=>u===undefined?[]:[unpipeOnSignalAbort(u,A)];const unpipeOnSignalAbort=async(u,{sourceStream:A,mergedStream:p,fileDescriptors:y,sourceOptions:E,startTime:C})=>{await(0,cn.aborted)(u,A);await p.remove(A);const I=new Error("Pipe canceled by `unpipeSignal` option.");throw createNonCommandError({error:I,fileDescriptors:y,sourceOptions:E,startTime:C})};const pipeToSubprocess=(u,...A)=>{if(isPlainObject(A[0])){return pipeToSubprocess.bind(undefined,{...u,boundOptions:{...u.boundOptions,...A[0]}})}const{destination:p,...y}=normalizePipeArguments(u,...A);const E=handlePipePromise({...y,destination:p});E.pipe=pipeToSubprocess.bind(undefined,{...u,source:p,sourcePromise:E,boundOptions:{}});return E};const handlePipePromise=async({sourcePromise:u,sourceStream:A,sourceOptions:p,sourceError:y,destination:E,destinationStream:C,destinationError:I,unpipeSignal:w,fileDescriptors:v,startTime:B})=>{const S=getSubprocessPromises(u,E);handlePipeArgumentsError({sourceStream:A,sourceError:y,destinationStream:C,destinationError:I,fileDescriptors:v,sourceOptions:p,startTime:B});const D=new AbortController;try{const u=pipeSubprocessStream(A,C,D);return await Promise.race([waitForBothSubprocesses(S),...unpipeOnAbort(w,{sourceStream:A,mergedStream:u,sourceOptions:p,fileDescriptors:v,startTime:B})])}finally{D.abort()}};const getSubprocessPromises=(u,A)=>Promise.allSettled([u,A]);const utils_identity=u=>u;const utils_noop=()=>undefined;const getContentsProperty=({contents:u})=>u;const throwObjectStream=u=>{throw new Error(`Streams in object mode are not supported: ${String(u)}`)};const getLengthProperty=u=>u.length;async function getStreamAsArray(u,A){return getStreamContents(u,ti,A)}const initArray=()=>({contents:[]});const increment=()=>1;const addArrayChunk=(u,{contents:A})=>{A.push(u);return A};const ti={init:initArray,convertChunk:{string:utils_identity,buffer:utils_identity,arrayBuffer:utils_identity,dataView:utils_identity,typedArray:utils_identity,others:utils_identity},getSize:increment,truncateChunk:utils_noop,addChunk:addArrayChunk,getFinalChunk:utils_noop,finalize:getContentsProperty};async function getStreamAsArrayBuffer(u,A){return getStreamContents(u,si,A)}const initArrayBuffer=()=>({contents:new ArrayBuffer(0)});const useTextEncoder=u=>ni.encode(u);const ni=new TextEncoder;const useUint8Array=u=>new Uint8Array(u);const useUint8ArrayWithOffset=u=>new Uint8Array(u.buffer,u.byteOffset,u.byteLength);const truncateArrayBufferChunk=(u,A)=>u.slice(0,A);const addArrayBufferChunk=(u,{contents:A,length:p},y)=>{const E=hasArrayBufferResize()?resizeArrayBuffer(A,y):resizeArrayBufferSlow(A,y);new Uint8Array(E).set(u,p);return E};const resizeArrayBufferSlow=(u,A)=>{if(A<=u.byteLength){return u}const p=new ArrayBuffer(getNewContentsLength(A));new Uint8Array(p).set(new Uint8Array(u),0);return p};const resizeArrayBuffer=(u,A)=>{if(A<=u.maxByteLength){u.resize(A);return u}const p=new ArrayBuffer(A,{maxByteLength:getNewContentsLength(A)});new Uint8Array(p).set(new Uint8Array(u),0);return p};const getNewContentsLength=u=>ri**Math.ceil(Math.log(u)/Math.log(ri));const ri=2;const finalizeArrayBuffer=({contents:u,length:A})=>hasArrayBufferResize()?u:u.slice(0,A);const hasArrayBufferResize=()=>"resize"in ArrayBuffer.prototype;const si={init:initArrayBuffer,convertChunk:{string:useTextEncoder,buffer:useUint8Array,arrayBuffer:useUint8Array,dataView:useUint8ArrayWithOffset,typedArray:useUint8ArrayWithOffset,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateArrayBufferChunk,addChunk:addArrayBufferChunk,getFinalChunk:utils_noop,finalize:finalizeArrayBuffer};async function getStreamAsString(u,A){return getStreamContents(u,ii,A)}const initString=()=>({contents:"",textDecoder:new TextDecoder});const useTextDecoder=(u,{textDecoder:A})=>A.decode(u,{stream:true});const addStringChunk=(u,{contents:A})=>A+u;const truncateStringChunk=(u,A)=>u.slice(0,A);const getFinalStringChunk=({textDecoder:u})=>{const A=u.decode();return A===""?undefined:A};const ii={init:initString,convertChunk:{string:utils_identity,buffer:useTextDecoder,arrayBuffer:useTextDecoder,dataView:useTextDecoder,typedArray:useTextDecoder,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateStringChunk,addChunk:addStringChunk,getFinalChunk:getFinalStringChunk,finalize:getContentsProperty};const iterateOnSubprocessStream=({subprocessStdout:u,subprocess:A,binary:p,shouldEncode:y,encoding:E,preserveNewlines:C})=>{const I=new AbortController;stopReadingOnExit(A,I);return iterateOnStream({stream:u,controller:I,binary:p,shouldEncode:!u.readableObjectMode&&y,encoding:E,shouldSplit:!u.readableObjectMode,preserveNewlines:C})};const stopReadingOnExit=async(u,A)=>{try{await u}catch{}finally{A.abort()}};const iterateForResult=({stream:u,onStreamEnd:A,lines:p,encoding:y,stripFinalNewline:E,allMixed:C})=>{const I=new AbortController;stopReadingOnStreamEnd(A,I,u);const w=u.readableObjectMode&&!C;return iterateOnStream({stream:u,controller:I,binary:y==="buffer",shouldEncode:!w,encoding:y,shouldSplit:!w&&p,preserveNewlines:!E})};const stopReadingOnStreamEnd=async(u,A,p)=>{try{await u}catch{p.destroy()}finally{A.abort()}};const iterateOnStream=({stream:u,controller:A,binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I})=>{const w=(0,Le.on)(u,"data",{signal:A.signal,highWaterMark:ai,highWatermark:ai});return iterateOnData({onStdoutChunk:w,controller:A,binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I})};const oi=(0,Pe.getDefaultHighWaterMark)(true);const ai=oi;const iterateOnData=async function*({onStdoutChunk:u,controller:A,binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I}){const w=getGenerators({binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I});try{for await(const[A]of u){yield*transformChunkSync(A,w,0)}}catch(u){if(!A.signal.aborted){throw u}}finally{yield*finalChunksSync(w)}};const getGenerators=({binary:u,shouldEncode:A,encoding:p,shouldSplit:y,preserveNewlines:E})=>[getEncodingTransformGenerator(u,p,!A),getSplitLinesGenerator(u,E,!y,{})].filter(Boolean);const getStreamOutput=async({stream:u,onStreamEnd:A,fdNumber:p,encoding:y,buffer:E,maxBuffer:C,lines:I,allMixed:w,stripFinalNewline:v,verboseInfo:B,streamInfo:S})=>{const D=logOutputAsync({stream:u,onStreamEnd:A,fdNumber:p,encoding:y,allMixed:w,verboseInfo:B,streamInfo:S});if(!E){await Promise.all([resumeStream(u),D]);return}const k=getStripFinalNewline(v,p);const Q=iterateForResult({stream:u,onStreamEnd:A,lines:I,encoding:y,stripFinalNewline:k,allMixed:w});const[F]=await Promise.all([contents_getStreamContents({stream:u,iterable:Q,fdNumber:p,encoding:y,maxBuffer:C,lines:I}),D]);return F};const logOutputAsync=async({stream:u,onStreamEnd:A,fdNumber:p,encoding:y,allMixed:E,verboseInfo:C,streamInfo:{fileDescriptors:I}})=>{if(!shouldLogOutput({stdioItems:I[p]?.stdioItems,encoding:y,verboseInfo:C,fdNumber:p})){return}const w=iterateForResult({stream:u,onStreamEnd:A,lines:true,encoding:y,stripFinalNewline:true,allMixed:E});await logLines(w,u,p,C)};const resumeStream=async u=>{await(0,Dr.setImmediate)();if(u.readableFlowing===null){u.resume()}};const contents_getStreamContents=async({stream:u,stream:{readableObjectMode:A},iterable:p,fdNumber:y,encoding:E,maxBuffer:C,lines:I})=>{try{if(A||I){return await getStreamAsArray(p,{maxBuffer:C})}if(E==="buffer"){return new Uint8Array(await getStreamAsArrayBuffer(p,{maxBuffer:C}))}return await getStreamAsString(p,{maxBuffer:C})}catch(p){return handleBufferedData(handleMaxBuffer({error:p,stream:u,readableObjectMode:A,lines:I,encoding:E,fdNumber:y}))}};const getBufferedData=async u=>{try{return await u}catch(u){return handleBufferedData(u)}};const handleBufferedData=({bufferedData:u})=>isArrayBuffer(u)?new Uint8Array(u):u;const waitForStream=async(u,A,p,{isSameDirection:y,stopOnExit:E=false}={})=>{const C=handleStdinDestroy(u,p);const I=new AbortController;try{await Promise.race([...E?[p.exitPromise]:[],(0,Os.finished)(u,{cleanup:true,signal:I.signal})])}catch(u){if(!C.stdinCleanedUp){handleStreamError(u,A,p,y)}}finally{I.abort()}};const handleStdinDestroy=(u,{originalStreams:[A],subprocess:p})=>{const y={stdinCleanedUp:false};if(u===A){spyOnStdinDestroy(u,p,y)}return y};const spyOnStdinDestroy=(u,A,p)=>{const{_destroy:y}=u;u._destroy=(...E)=>{setStdinCleanedUp(A,p);y.call(u,...E)}};const setStdinCleanedUp=({exitCode:u,signalCode:A},p)=>{if(u!==null||A!==null){p.stdinCleanedUp=true}};const handleStreamError=(u,A,p,y)=>{if(!shouldIgnoreStreamError(u,A,p,y)){throw u}};const shouldIgnoreStreamError=(u,A,p,y=true)=>{if(p.propagating){return isStreamEpipe(u)||isStreamAbort(u)}p.propagating=true;return isInputFileDescriptor(p,A)===y?isStreamEpipe(u):isStreamAbort(u)};const isInputFileDescriptor=({fileDescriptors:u},A)=>A!=="all"&&u[A].direction==="input";const isStreamAbort=u=>u?.code==="ERR_STREAM_PREMATURE_CLOSE";const isStreamEpipe=u=>u?.code==="EPIPE";const waitForStdioStreams=({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:C,verboseInfo:I,streamInfo:w})=>u.stdio.map(((u,v)=>waitForSubprocessStream({stream:u,fdNumber:v,encoding:A,buffer:p[v],maxBuffer:y[v],lines:E[v],allMixed:false,stripFinalNewline:C,verboseInfo:I,streamInfo:w})));const waitForSubprocessStream=async({stream:u,fdNumber:A,encoding:p,buffer:y,maxBuffer:E,lines:C,allMixed:I,stripFinalNewline:w,verboseInfo:v,streamInfo:B})=>{if(!u){return}const S=waitForStream(u,A,B);if(isInputFileDescriptor(B,A)){await S;return}const[D]=await Promise.all([getStreamOutput({stream:u,onStreamEnd:S,fdNumber:A,encoding:p,buffer:y,maxBuffer:E,lines:C,allMixed:I,stripFinalNewline:w,verboseInfo:v,streamInfo:B}),S]);return D};const makeAllStream=({stdout:u,stderr:A},{all:p})=>p&&(u||A)?mergeStreams([u,A].filter(Boolean)):undefined;const waitForAllStream=({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:C,verboseInfo:I,streamInfo:w})=>waitForSubprocessStream({...getAllStream(u,p),fdNumber:"all",encoding:A,maxBuffer:y[1]+y[2],lines:E[1]||E[2],allMixed:getAllMixed(u),stripFinalNewline:C,verboseInfo:I,streamInfo:w});const getAllStream=({stdout:u,stderr:A,all:p},[,y,E])=>{const C=y||E;if(!C){return{stream:p,buffer:C}}if(!y){return{stream:A,buffer:C}}if(!E){return{stream:u,buffer:C}}return{stream:p,buffer:C}};const getAllMixed=({all:u,stdout:A,stderr:p})=>u&&A&&p&&A.readableObjectMode!==p.readableObjectMode;const shouldLogIpc=u=>isFullVerbose(u,"ipc");const logIpcOutput=(u,A)=>{const p=serializeVerboseMessage(u);verboseLog({type:"ipc",verboseMessage:p,fdNumber:"ipc",verboseInfo:A})};const waitForIpcOutput=async({subprocess:u,buffer:A,maxBuffer:p,ipc:y,ipcOutput:E,verboseInfo:C})=>{if(!y){return E}const I=shouldLogIpc(C);const w=getFdSpecificValue(A,"ipc");const v=getFdSpecificValue(p,"ipc");for await(const A of loopOnMessages({anyProcess:u,channel:u.channel,isSubprocess:false,ipc:y,shouldAwait:false,reference:true})){if(w){checkIpcMaxBuffer(u,E,v);E.push(A)}if(I){logIpcOutput(A,C)}}return E};const getBufferedIpcOutput=async(u,A)=>{await Promise.allSettled([u]);return A};const waitForSubprocessResult=async({subprocess:u,options:{encoding:A,buffer:p,maxBuffer:y,lines:E,timeoutDuration:C,cancelSignal:I,gracefulCancel:w,forceKillAfterDelay:v,stripFinalNewline:B,ipc:S,ipcInput:D},context:k,verboseInfo:Q,fileDescriptors:F,originalStreams:R,onInternalError:_,controller:P})=>{const O=waitForExit(u,k);const U={originalStreams:R,fileDescriptors:F,subprocess:u,exitPromise:O,propagating:false};const H=waitForStdioStreams({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:B,verboseInfo:Q,streamInfo:U});const G=waitForAllStream({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:B,verboseInfo:Q,streamInfo:U});const j=[];const $=waitForIpcOutput({subprocess:u,buffer:p,maxBuffer:y,ipc:S,ipcOutput:j,verboseInfo:Q});const q=waitForOriginalStreams(R,u,U);const K=waitForCustomStreamsEnd(F,U);try{return await Promise.race([Promise.all([{},waitForSuccessfulExit(O),Promise.all(H),G,$,sendIpcInput(u,D),...q,...K]),_,throwOnSubprocessError(u,P),...throwOnTimeout(u,C,k,P),...throwOnCancel({subprocess:u,cancelSignal:I,gracefulCancel:w,context:k,controller:P}),...throwOnGracefulCancel({subprocess:u,cancelSignal:I,gracefulCancel:w,forceKillAfterDelay:v,context:k,controller:P})])}catch(u){k.terminationReason??="other";return Promise.all([{error:u},O,Promise.all(H.map((u=>getBufferedData(u)))),getBufferedData(G),getBufferedIpcOutput($,j),Promise.allSettled(q),Promise.allSettled(K)])}};const waitForOriginalStreams=(u,A,p)=>u.map(((u,y)=>u===A.stdio[y]?undefined:waitForStream(u,y,p)));const waitForCustomStreamsEnd=(u,A)=>u.flatMap((({stdioItems:u},p)=>u.filter((({value:u,stream:A=u})=>is_stream_isStream(A,{checkOpen:false})&&!isStandardStream(A))).map((({type:u,value:y,stream:E=y})=>waitForStream(E,p,A,{isSameDirection:ys.has(u),stopOnExit:u==="native"})))));const throwOnSubprocessError=async(u,{signal:A})=>{const[p]=await(0,Le.once)(u,"error",{signal:A});throw p};const initializeConcurrentStreams=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap});const addConcurrentStream=(u,A,p)=>{const y=u[p];if(!y.has(A)){y.set(A,[])}const E=y.get(A);const C=createDeferred();E.push(C);const I=C.resolve.bind(C);return{resolve:I,promises:E}};const waitForConcurrentStreams=async({resolve:u,promises:A},p)=>{u();const[y]=await Promise.race([Promise.allSettled([true,p]),Promise.all([false,...A])]);return!y};const safeWaitForSubprocessStdin=async u=>{if(u===undefined){return}try{await waitForSubprocessStdin(u)}catch{}};const safeWaitForSubprocessStdout=async u=>{if(u===undefined){return}try{await waitForSubprocessStdout(u)}catch{}};const waitForSubprocessStdin=async u=>{await(0,Os.finished)(u,{cleanup:true,readable:false,writable:true})};const waitForSubprocessStdout=async u=>{await(0,Os.finished)(u,{cleanup:true,readable:true,writable:false})};const waitForSubprocess=async(u,A)=>{await u;if(A){throw A}};const destroyOtherStream=(u,A,p)=>{if(p&&!isStreamAbort(p)){u.destroy(p)}else if(A){u.destroy()}};const createReadable=({subprocess:u,concurrentStreams:A,encoding:p},{from:y,binary:E=true,preserveNewlines:C=true}={})=>{const I=E||es.has(p);const{subprocessStdout:w,waitReadableDestroy:v}=getSubprocessStdout(u,y,A);const{readableEncoding:B,readableObjectMode:S,readableHighWaterMark:D}=getReadableOptions(w,I);const{read:k,onStdoutDataDone:Q}=getReadableMethods({subprocessStdout:w,subprocess:u,binary:I,encoding:p,preserveNewlines:C});const F=new Pe.Readable({read:k,destroy:(0,cn.callbackify)(onReadableDestroy.bind(undefined,{subprocessStdout:w,subprocess:u,waitReadableDestroy:v})),highWaterMark:D,objectMode:S,encoding:B});onStdoutFinished({subprocessStdout:w,onStdoutDataDone:Q,readable:F,subprocess:u});return F};const getSubprocessStdout=(u,A,p)=>{const y=getFromStream(u,A);const E=addConcurrentStream(p,y,"readableDestroy");return{subprocessStdout:y,waitReadableDestroy:E}};const getReadableOptions=({readableEncoding:u,readableObjectMode:A,readableHighWaterMark:p},y)=>y?{readableEncoding:u,readableObjectMode:A,readableHighWaterMark:p}:{readableEncoding:u,readableObjectMode:true,readableHighWaterMark:oi};const getReadableMethods=({subprocessStdout:u,subprocess:A,binary:p,encoding:y,preserveNewlines:E})=>{const C=createDeferred();const I=iterateOnSubprocessStream({subprocessStdout:u,subprocess:A,binary:p,shouldEncode:!p,encoding:y,preserveNewlines:E});return{read(){onRead(this,I,C)},onStdoutDataDone:C}};const onRead=async(u,A,p)=>{try{const{value:y,done:E}=await A.next();if(E){p.resolve()}else{u.push(y)}}catch{}};const onStdoutFinished=async({subprocessStdout:u,onStdoutDataDone:A,readable:p,subprocess:y,subprocessStdin:E})=>{try{await waitForSubprocessStdout(u);await y;await safeWaitForSubprocessStdin(E);await A;if(p.readable){p.push(null)}}catch(u){await safeWaitForSubprocessStdin(E);destroyOtherReadable(p,u)}};const onReadableDestroy=async({subprocessStdout:u,subprocess:A,waitReadableDestroy:p},y)=>{if(await waitForConcurrentStreams(p,A)){destroyOtherReadable(u,y);await waitForSubprocess(A,y)}};const destroyOtherReadable=(u,A)=>{destroyOtherStream(u,u.readable,A)};const createWritable=({subprocess:u,concurrentStreams:A},{to:p}={})=>{const{subprocessStdin:y,waitWritableFinal:E,waitWritableDestroy:C}=getSubprocessStdin(u,p,A);const I=new Pe.Writable({...getWritableMethods(y,u,E),destroy:(0,cn.callbackify)(onWritableDestroy.bind(undefined,{subprocessStdin:y,subprocess:u,waitWritableFinal:E,waitWritableDestroy:C})),highWaterMark:y.writableHighWaterMark,objectMode:y.writableObjectMode});onStdinFinished(y,I);return I};const getSubprocessStdin=(u,A,p)=>{const y=getToStream(u,A);const E=addConcurrentStream(p,y,"writableFinal");const C=addConcurrentStream(p,y,"writableDestroy");return{subprocessStdin:y,waitWritableFinal:E,waitWritableDestroy:C}};const getWritableMethods=(u,A,p)=>({write:onWrite.bind(undefined,u),final:(0,cn.callbackify)(onWritableFinal.bind(undefined,u,A,p))});const onWrite=(u,A,p,y)=>{if(u.write(A,p)){y()}else{u.once("drain",y)}};const onWritableFinal=async(u,A,p)=>{if(await waitForConcurrentStreams(p,A)){if(u.writable){u.end()}await A}};const onStdinFinished=async(u,A,p)=>{try{await waitForSubprocessStdin(u);if(A.writable){A.end()}}catch(u){await safeWaitForSubprocessStdout(p);destroyOtherWritable(A,u)}};const onWritableDestroy=async({subprocessStdin:u,subprocess:A,waitWritableFinal:p,waitWritableDestroy:y},E)=>{await waitForConcurrentStreams(p,A);if(await waitForConcurrentStreams(y,A)){destroyOtherWritable(u,E);await waitForSubprocess(A,E)}};const destroyOtherWritable=(u,A)=>{destroyOtherStream(u,u.writable,A)};const createDuplex=({subprocess:u,concurrentStreams:A,encoding:p},{from:y,to:E,binary:C=true,preserveNewlines:I=true}={})=>{const w=C||es.has(p);const{subprocessStdout:v,waitReadableDestroy:B}=getSubprocessStdout(u,y,A);const{subprocessStdin:S,waitWritableFinal:D,waitWritableDestroy:k}=getSubprocessStdin(u,E,A);const{readableEncoding:Q,readableObjectMode:F,readableHighWaterMark:R}=getReadableOptions(v,w);const{read:_,onStdoutDataDone:P}=getReadableMethods({subprocessStdout:v,subprocess:u,binary:w,encoding:p,preserveNewlines:I});const O=new Pe.Duplex({read:_,...getWritableMethods(S,u,D),destroy:(0,cn.callbackify)(onDuplexDestroy.bind(undefined,{subprocessStdout:v,subprocessStdin:S,subprocess:u,waitReadableDestroy:B,waitWritableFinal:D,waitWritableDestroy:k})),readableHighWaterMark:R,writableHighWaterMark:S.writableHighWaterMark,readableObjectMode:F,writableObjectMode:S.writableObjectMode,encoding:Q});onStdoutFinished({subprocessStdout:v,onStdoutDataDone:P,readable:O,subprocess:u,subprocessStdin:S});onStdinFinished(S,O,v);return O};const onDuplexDestroy=async({subprocessStdout:u,subprocessStdin:A,subprocess:p,waitReadableDestroy:y,waitWritableFinal:E,waitWritableDestroy:C},I)=>{await Promise.all([onReadableDestroy({subprocessStdout:u,subprocess:p,waitReadableDestroy:y},I),onWritableDestroy({subprocessStdin:A,subprocess:p,waitWritableFinal:E,waitWritableDestroy:C},I)])};const createIterable=(u,A,{from:p,binary:y=false,preserveNewlines:E=false}={})=>{const C=y||es.has(A);const I=getFromStream(u,p);const w=iterateOnSubprocessStream({subprocessStdout:I,subprocess:u,binary:C,shouldEncode:true,encoding:A,preserveNewlines:E});return iterateOnStdoutData(w,I,u)};const iterateOnStdoutData=async function*(u,A,p){try{yield*u}finally{if(A.readable){A.destroy()}await p}};const addConvertedStreams=(u,{encoding:A})=>{const p=initializeConcurrentStreams();u.readable=createReadable.bind(undefined,{subprocess:u,concurrentStreams:p,encoding:A});u.writable=createWritable.bind(undefined,{subprocess:u,concurrentStreams:p});u.duplex=createDuplex.bind(undefined,{subprocess:u,concurrentStreams:p,encoding:A});u.iterable=createIterable.bind(undefined,u,A);u[Symbol.asyncIterator]=createIterable.bind(undefined,u,A,{})};const mergePromise=(u,A)=>{for(const[p,y]of ci){const E=y.value.bind(A);Reflect.defineProperty(u,p,{...y,value:E})}};const li=(async()=>{})().constructor.prototype;const ci=["then","catch","finally"].map((u=>[u,Reflect.getOwnPropertyDescriptor(li,u)]));const execaCoreAsync=(u,A,p,y)=>{const{file:E,commandArguments:C,command:I,escapedCommand:w,startTime:v,verboseInfo:B,options:S,fileDescriptors:D}=handleAsyncArguments(u,A,p);const{subprocess:k,promise:Q}=spawnSubprocessAsync({file:E,commandArguments:C,options:S,startTime:v,verboseInfo:B,command:I,escapedCommand:w,fileDescriptors:D});k.pipe=pipeToSubprocess.bind(undefined,{source:k,sourcePromise:Q,boundOptions:{},createNested:y});mergePromise(k,Q);Mr.set(k,{options:S,fileDescriptors:D});return k};const handleAsyncArguments=(u,A,p)=>{const{command:y,escapedCommand:E,startTime:C,verboseInfo:I}=handleCommand(u,A,p);const{file:w,commandArguments:v,options:B}=normalizeOptions(u,A,p);const S=handleAsyncOptions(B);const D=handleStdioAsync(S,I);return{file:w,commandArguments:v,command:y,escapedCommand:E,startTime:C,verboseInfo:I,options:S,fileDescriptors:D}};const handleAsyncOptions=({timeout:u,signal:A,...p})=>{if(A!==undefined){throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.')}return{...p,timeoutDuration:u}};const spawnSubprocessAsync=({file:u,commandArguments:A,options:p,startTime:y,verboseInfo:E,command:C,escapedCommand:I,fileDescriptors:w})=>{let v;try{v=(0,nn.spawn)(...concatenateShell(u,A,p))}catch(u){return handleEarlyError({error:u,command:C,escapedCommand:I,fileDescriptors:w,options:p,startTime:y,verboseInfo:E})}const B=new AbortController;(0,Le.setMaxListeners)(Number.POSITIVE_INFINITY,B.signal);const S=[...v.stdio];pipeOutputAsync(v,w,B);cleanupOnExit(v,p,B);const D={};const k=createDeferred();v.kill=subprocessKill.bind(undefined,{kill:v.kill.bind(v),options:p,onInternalError:k,context:D,controller:B});v.all=makeAllStream(v,p);addConvertedStreams(v,p);addIpcMethods(v,p);const Q=handlePromise({subprocess:v,options:p,startTime:y,verboseInfo:E,fileDescriptors:w,originalStreams:S,command:C,escapedCommand:I,context:D,onInternalError:k,controller:B});return{subprocess:v,promise:Q}};const handlePromise=async({subprocess:u,options:A,startTime:p,verboseInfo:y,fileDescriptors:E,originalStreams:C,command:I,escapedCommand:w,context:v,onInternalError:B,controller:S})=>{const[D,[k,Q],F,R,_]=await waitForSubprocessResult({subprocess:u,options:A,context:v,verboseInfo:y,fileDescriptors:E,originalStreams:C,onInternalError:B,controller:S});S.abort();B.resolve();const P=F.map(((u,p)=>stripNewline(u,A,p)));const O=stripNewline(R,A,"all");const U=getAsyncResult({errorInfo:D,exitCode:k,signal:Q,stdio:P,all:O,ipcOutput:_,context:v,options:A,command:I,escapedCommand:w,startTime:p});return handleResult(U,y,A)};const getAsyncResult=({errorInfo:u,exitCode:A,signal:p,stdio:y,all:E,ipcOutput:C,context:I,options:w,command:v,escapedCommand:B,startTime:S})=>"error"in u?makeError({error:u.error,command:v,escapedCommand:B,timedOut:I.terminationReason==="timeout",isCanceled:I.terminationReason==="cancel"||I.terminationReason==="gracefulCancel",isGracefullyCanceled:I.terminationReason==="gracefulCancel",isMaxBuffer:u.error instanceof MaxBufferError,isForcefullyTerminated:I.isForcefullyTerminated,exitCode:A,signal:p,stdio:y,all:E,ipcOutput:C,options:w,startTime:S,isSync:false}):makeSuccessResult({command:v,escapedCommand:B,stdio:y,all:E,ipcOutput:C,options:w,startTime:S});const mergeOptions=(u,A)=>{const p=Object.fromEntries(Object.entries(A).map((([A,p])=>[A,mergeOption(A,u[A],p)])));return{...u,...p}};const mergeOption=(u,A,p)=>{if(ui.has(u)&&isPlainObject(A)&&isPlainObject(p)){return{...A,...p}}return p};const ui=new Set(["env",...gn]);const createExeca=(u,A,p,y)=>{const createNested=(u,A,y)=>createExeca(u,A,p,y);const boundExeca=(...E)=>callBoundExeca({mapArguments:u,deepOptions:p,boundOptions:A,setBoundExeca:y,createNested:createNested},...E);if(y!==undefined){y(boundExeca,createNested,A)}return boundExeca};const callBoundExeca=({mapArguments:u,deepOptions:A={},boundOptions:p={},setBoundExeca:y,createNested:E},C,...I)=>{if(isPlainObject(C)){return E(u,mergeOptions(p,C),y)}const{file:w,commandArguments:v,options:B,isSync:S}=parseArguments({mapArguments:u,firstArgument:C,nextArguments:I,deepOptions:A,boundOptions:p});return S?execaCoreSync(w,v,B):execaCoreAsync(w,v,B,E)};const parseArguments=({mapArguments:u,firstArgument:A,nextArguments:p,deepOptions:y,boundOptions:E})=>{const C=isTemplateString(A)?parseTemplates(A,p):[A,...p];const[I,w,v]=normalizeParameters(...C);const B=mergeOptions(mergeOptions(y,E),v);const{file:S=I,commandArguments:D=w,options:k=B,isSync:Q=false}=u({file:I,commandArguments:w,options:B});return{file:S,commandArguments:D,options:k,isSync:Q}};const mapCommandAsync=({file:u,commandArguments:A})=>parseCommand(u,A);const mapCommandSync=({file:u,commandArguments:A})=>({...parseCommand(u,A),isSync:true});const parseCommand=(u,A)=>{if(A.length>0){throw new TypeError(`The command and its arguments must be passed as a single string: ${u} ${A}.`)}const[p,...y]=parseCommandString(u);return{file:p,commandArguments:y}};const parseCommandString=u=>{if(typeof u!=="string"){throw new TypeError(`The command must be a string: ${String(u)}.`)}const A=u.trim();if(A===""){return[]}const p=[];for(const u of A.split(di)){const A=p.at(-1);if(A&&A.endsWith("\\")){p[p.length-1]=`${A.slice(0,-1)} ${u}`}else{p.push(u)}}return p};const di=/ +/g;const setScriptSync=(u,A,p)=>{u.sync=A(mapScriptSync,p);u.s=u.sync};const mapScriptAsync=({options:u})=>getScriptOptions(u);const mapScriptSync=({options:u})=>({...getScriptOptions(u),isSync:true});const getScriptOptions=u=>({options:{...getScriptStdinOption(u),...u}});const getScriptStdinOption=({input:u,inputFile:A,stdio:p})=>u===undefined&&A===undefined&&p===undefined?{stdin:"inherit"}:{};const fi={preferLocal:true};const Ai=createExeca((()=>({})));const hi=createExeca((()=>({isSync:true})));const pi=createExeca(mapCommandAsync);const gi=createExeca(mapCommandSync);const mi=createExeca(mapNode);const yi=createExeca(mapScriptAsync,{},fi,setScriptSync);const{sendMessage:Ei,getOneMessage:Ci,getEachMessage:Ii,getCancelSignal:bi}=getIpcExport();var wi=p(5606);var vi=p(1159);function keysOf(u){return Object.keys(u)}const Bi=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(u){return Bi.includes(u)}const Si=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Bi];function isObjectTypeName(u){return Si.includes(u)}const Di=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(u){return Di.includes(u)}const ki=["positive number","negative number","Class","string with a number","null or undefined","Iterable","AsyncIterable","native Promise","EnumCase","string with a URL","truthy","falsy","primitive","integer","plain object","TypedArray","array-like","tuple-like","Node.js Stream","infinite number","empty array","non-empty array","empty string","empty string or whitespace","non-empty string","non-empty string and not whitespace","empty object","non-empty object","empty set","non-empty set","empty map","non-empty map","PropertyKey","even integer","odd integer","T","in range","predicate returns truthy for any value","predicate returns truthy for all values","valid Date","valid length","whitespace string",...Si,...Di];const getObjectType=u=>{const A=Object.prototype.toString.call(u).slice(8,-1);if(/HTML\w+Element/.test(A)&&isHtmlElement(u)){return"HTMLElement"}if(isObjectTypeName(A)){return A}return undefined};function detect(u){if(u===null){return"null"}switch(typeof u){case"undefined":{return"undefined"}case"string":{return"string"}case"number":{return Number.isNaN(u)?"NaN":"number"}case"boolean":{return"boolean"}case"function":{return"Function"}case"bigint":{return"bigint"}case"symbol":{return"symbol"}default:}if(isObservable(u)){return"Observable"}if(isArray(u)){return"Array"}if(isBuffer(u)){return"Buffer"}const A=getObjectType(u);if(A&&A!=="Object"){return A}if(hasPromiseApi(u)){return"Promise"}if(u instanceof String||u instanceof Boolean||u instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}function hasPromiseApi(u){return isFunction(u?.then)&&isFunction(u?.catch)}const Qi=Object.assign(detect,{all:isAll,any:isAny,array:isArray,arrayBuffer:distribution_isArrayBuffer,arrayLike:isArrayLike,asyncFunction:isAsyncFunction,asyncGenerator:distribution_isAsyncGenerator,asyncGeneratorFunction:isAsyncGeneratorFunction,asyncIterable:isAsyncIterable,bigint:isBigint,bigInt64Array:isBigInt64Array,bigUint64Array:isBigUint64Array,blob:isBlob,boolean:isBoolean,boundFunction:isBoundFunction,buffer:isBuffer,class:isClass,dataView:isDataView,date:isDate,detect:detect,directInstanceOf:isDirectInstanceOf,emptyArray:isEmptyArray,emptyMap:isEmptyMap,emptyObject:isEmptyObject,emptySet:isEmptySet,emptyString:isEmptyString,emptyStringOrWhitespace:isEmptyStringOrWhitespace,enumCase:isEnumCase,error:isError,evenInteger:isEvenInteger,falsy:isFalsy,float32Array:isFloat32Array,float64Array:isFloat64Array,formData:isFormData,function:isFunction,generator:distribution_isGenerator,generatorFunction:isGeneratorFunction,htmlElement:isHtmlElement,infinite:isInfinite,inRange:isInRange,int16Array:isInt16Array,int32Array:isInt32Array,int8Array:isInt8Array,integer:isInteger,iterable:isIterable,map:isMap,nan:isNan,nativePromise:isNativePromise,negativeNumber:isNegativeNumber,nodeStream:isNodeStream,nonEmptyArray:isNonEmptyArray,nonEmptyMap:isNonEmptyMap,nonEmptyObject:isNonEmptyObject,nonEmptySet:isNonEmptySet,nonEmptyString:isNonEmptyString,nonEmptyStringAndNotWhitespace:isNonEmptyStringAndNotWhitespace,null:isNull,nullOrUndefined:isNullOrUndefined,number:isNumber,numericString:isNumericString,object:distribution_isObject,observable:isObservable,oddInteger:isOddInteger,plainObject:distribution_isPlainObject,positiveNumber:isPositiveNumber,primitive:isPrimitive,promise:isPromise,propertyKey:isPropertyKey,regExp:isRegExp,safeInteger:isSafeInteger,set:isSet,sharedArrayBuffer:isSharedArrayBuffer,string:isString,symbol:isSymbol,truthy:isTruthy,tupleLike:isTupleLike,typedArray:isTypedArray,uint16Array:isUint16Array,uint32Array:isUint32Array,uint8Array:distribution_isUint8Array,uint8ClampedArray:isUint8ClampedArray,undefined:isUndefined,urlInstance:isUrlInstance,urlSearchParams:isUrlSearchParams,urlString:isUrlString,optional:isOptional,validDate:isValidDate,validLength:isValidLength,weakMap:isWeakMap,weakRef:isWeakRef,weakSet:isWeakSet,whitespaceString:isWhitespaceString});function isAbsoluteModule2(u){return A=>isInteger(A)&&Math.abs(A%2)===u}function validatePredicateArray(u,A){if(u.length===0){if(A){}else{throw new TypeError("Invalid predicate array")}return}for(const A of u){if(!isFunction(A)){throw new TypeError(`Invalid predicate: ${JSON.stringify(A)}`)}}}function isAll(u,...A){if(Array.isArray(u)){const p=u;validatePredicateArray(p,A.length===0);const combinedPredicate=u=>p.every((A=>A(u)));if(A.length===0){return combinedPredicate}return predicateOnArray(Array.prototype.every,combinedPredicate,A)}return predicateOnArray(Array.prototype.every,u,A)}function isAny(u,...A){if(Array.isArray(u)){const p=u;validatePredicateArray(p,A.length===0);const combinedPredicate=u=>p.some((A=>A(u)));if(A.length===0){return combinedPredicate}return predicateOnArray(Array.prototype.some,combinedPredicate,A)}return predicateOnArray(Array.prototype.some,u,A)}function isOptional(u,A){return isUndefined(u)||A(u)}function isArray(u,A){if(!Array.isArray(u)){return false}if(!isFunction(A)){return true}return u.every((u=>A(u)))}function distribution_isArrayBuffer(u){return getObjectType(u)==="ArrayBuffer"}function isArrayLike(u){return!isNullOrUndefined(u)&&!isFunction(u)&&isValidLength(u.length)}function isAsyncFunction(u){return getObjectType(u)==="AsyncFunction"}function distribution_isAsyncGenerator(u){return isAsyncIterable(u)&&isFunction(u.next)&&isFunction(u.throw)}function isAsyncGeneratorFunction(u){return getObjectType(u)==="AsyncGeneratorFunction"}function isAsyncIterable(u){return isFunction(u?.[Symbol.asyncIterator])}function isBigint(u){return typeof u==="bigint"}function isBigInt64Array(u){return getObjectType(u)==="BigInt64Array"}function isBigUint64Array(u){return getObjectType(u)==="BigUint64Array"}function isBlob(u){return getObjectType(u)==="Blob"}function isBoolean(u){return u===true||u===false}function isBoundFunction(u){return isFunction(u)&&!Object.hasOwn(u,"prototype")}function isBuffer(u){return u?.constructor?.isBuffer?.(u)??false}function isClass(u){return isFunction(u)&&/^class(\s+|{)/.test(u.toString())}function isDataView(u){return getObjectType(u)==="DataView"}function isDate(u){return getObjectType(u)==="Date"}function isDirectInstanceOf(u,A){if(u===undefined||u===null){return false}return Object.getPrototypeOf(u)===A.prototype}function isEmptyArray(u){return isArray(u)&&u.length===0}function isEmptyMap(u){return isMap(u)&&u.size===0}function isEmptyObject(u){return distribution_isObject(u)&&!isMap(u)&&!isSet(u)&&Object.keys(u).length===0}function isEmptySet(u){return isSet(u)&&u.size===0}function isEmptyString(u){return isString(u)&&u.length===0}function isEmptyStringOrWhitespace(u){return isEmptyString(u)||isWhitespaceString(u)}function isEnumCase(u,A){return Object.values(A).includes(u)}function isError(u){return getObjectType(u)==="Error"}function isEvenInteger(u){return isAbsoluteModule2(0)(u)}function isFalsy(u){return!u}function isFloat32Array(u){return getObjectType(u)==="Float32Array"}function isFloat64Array(u){return getObjectType(u)==="Float64Array"}function isFormData(u){return getObjectType(u)==="FormData"}function isFunction(u){return typeof u==="function"}function distribution_isGenerator(u){return isIterable(u)&&isFunction(u?.next)&&isFunction(u?.throw)}function isGeneratorFunction(u){return getObjectType(u)==="GeneratorFunction"}const Fi=1;const xi=["innerHTML","ownerDocument","style","attributes","nodeValue"];function isHtmlElement(u){return distribution_isObject(u)&&u.nodeType===Fi&&isString(u.nodeName)&&!distribution_isPlainObject(u)&&xi.every((A=>A in u))}function isInfinite(u){return u===Number.POSITIVE_INFINITY||u===Number.NEGATIVE_INFINITY}function isInRange(u,A){if(isNumber(A)){return u>=Math.min(0,A)&&u<=Math.max(A,0)}if(isArray(A)&&A.length===2){return u>=Math.min(...A)&&u<=Math.max(...A)}throw new TypeError(`Invalid range: ${JSON.stringify(A)}`)}function isInt16Array(u){return getObjectType(u)==="Int16Array"}function isInt32Array(u){return getObjectType(u)==="Int32Array"}function isInt8Array(u){return getObjectType(u)==="Int8Array"}function isInteger(u){return Number.isInteger(u)}function isIterable(u){return isFunction(u?.[Symbol.iterator])}function isMap(u){return getObjectType(u)==="Map"}function isNan(u){return Number.isNaN(u)}function isNativePromise(u){return getObjectType(u)==="Promise"}function isNegativeNumber(u){return isNumber(u)&&u<0}function isNodeStream(u){return distribution_isObject(u)&&isFunction(u.pipe)&&!isObservable(u)}function isNonEmptyArray(u){return isArray(u)&&u.length>0}function isNonEmptyMap(u){return isMap(u)&&u.size>0}function isNonEmptyObject(u){return distribution_isObject(u)&&!isMap(u)&&!isSet(u)&&Object.keys(u).length>0}function isNonEmptySet(u){return isSet(u)&&u.size>0}function isNonEmptyString(u){return isString(u)&&u.length>0}function isNonEmptyStringAndNotWhitespace(u){return isString(u)&&!isEmptyStringOrWhitespace(u)}function isNull(u){return u===null}function isNullOrUndefined(u){return isNull(u)||isUndefined(u)}function isNumber(u){return typeof u==="number"&&!Number.isNaN(u)}function isNumericString(u){return isString(u)&&!isEmptyStringOrWhitespace(u)&&!Number.isNaN(Number(u))}function distribution_isObject(u){return!isNull(u)&&(typeof u==="object"||isFunction(u))}function isObservable(u){if(!u){return false}if(Symbol.observable!==undefined&&u===u[Symbol.observable]?.()){return true}if(u===u["@@observable"]?.()){return true}return false}function isOddInteger(u){return isAbsoluteModule2(1)(u)}function distribution_isPlainObject(u){if(typeof u!=="object"||u===null){return false}const A=Object.getPrototypeOf(u);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(Symbol.toStringTag in u)&&!(Symbol.iterator in u)}function isPositiveNumber(u){return isNumber(u)&&u>0}function isPrimitive(u){return isNull(u)||isPrimitiveTypeName(typeof u)}function isPromise(u){return isNativePromise(u)||hasPromiseApi(u)}function isPropertyKey(u){return isAny([isString,isNumber,isSymbol],u)}function isRegExp(u){return getObjectType(u)==="RegExp"}function isSafeInteger(u){return Number.isSafeInteger(u)}function isSet(u){return getObjectType(u)==="Set"}function isSharedArrayBuffer(u){return getObjectType(u)==="SharedArrayBuffer"}function isString(u){return typeof u==="string"}function isSymbol(u){return typeof u==="symbol"}function isTruthy(u){return Boolean(u)}function isTupleLike(u,A){if(isArray(A)&&isArray(u)&&A.length===u.length){return A.every(((A,p)=>A(u[p])))}return false}function isTypedArray(u){return isTypedArrayName(getObjectType(u))}function isUint16Array(u){return getObjectType(u)==="Uint16Array"}function isUint32Array(u){return getObjectType(u)==="Uint32Array"}function distribution_isUint8Array(u){return getObjectType(u)==="Uint8Array"}function isUint8ClampedArray(u){return getObjectType(u)==="Uint8ClampedArray"}function isUndefined(u){return u===undefined}function isUrlInstance(u){return getObjectType(u)==="URL"}function isUrlSearchParams(u){return getObjectType(u)==="URLSearchParams"}function isUrlString(u){if(!isString(u)){return false}try{new URL(u);return true}catch{return false}}function isValidDate(u){return isDate(u)&&!isNan(Number(u))}function isValidLength(u){return isSafeInteger(u)&&u>=0}function isWeakMap(u){return getObjectType(u)==="WeakMap"}function isWeakRef(u){return getObjectType(u)==="WeakRef"}function isWeakSet(u){return getObjectType(u)==="WeakSet"}function isWhitespaceString(u){return isString(u)&&/^\s+$/.test(u)}function predicateOnArray(u,A,p){if(!isFunction(A)){throw new TypeError(`Invalid predicate: ${JSON.stringify(A)}`)}if(p.length===0){throw new TypeError("Invalid number of values")}return u.call(p,A)}function typeErrorMessage(u,A){return`Expected value which is \`${u}\`, received value of type \`${Qi(A)}\`.`}function unique(u){return Array.from(new Set(u))}const Ri=new Intl.ListFormat("en",{style:"long",type:"conjunction"});const _i=new Intl.ListFormat("en",{style:"long",type:"disjunction"});function typeErrorMessageMultipleValues(u,A){const p=unique((isArray(u)?u:[u]).map((u=>`\`${u}\``)));const y=unique(A.map((u=>`\`${Qi(u)}\``)));return`Expected values which are ${_i.format(p)}. Received values of type${y.length>1?"s":""} ${Ri.format(y)}.`}const Ti={all:assertAll,any:assertAny,optional:assertOptional,array:assertArray,arrayBuffer:assertArrayBuffer,arrayLike:assertArrayLike,asyncFunction:assertAsyncFunction,asyncGenerator:assertAsyncGenerator,asyncGeneratorFunction:assertAsyncGeneratorFunction,asyncIterable:assertAsyncIterable,bigint:assertBigint,bigInt64Array:assertBigInt64Array,bigUint64Array:assertBigUint64Array,blob:assertBlob,boolean:assertBoolean,boundFunction:assertBoundFunction,buffer:assertBuffer,class:assertClass,dataView:assertDataView,date:assertDate,directInstanceOf:assertDirectInstanceOf,emptyArray:assertEmptyArray,emptyMap:assertEmptyMap,emptyObject:assertEmptyObject,emptySet:assertEmptySet,emptyString:assertEmptyString,emptyStringOrWhitespace:assertEmptyStringOrWhitespace,enumCase:assertEnumCase,error:assertError,evenInteger:assertEvenInteger,falsy:assertFalsy,float32Array:assertFloat32Array,float64Array:assertFloat64Array,formData:assertFormData,function:assertFunction,generator:assertGenerator,generatorFunction:assertGeneratorFunction,htmlElement:assertHtmlElement,infinite:assertInfinite,inRange:assertInRange,int16Array:assertInt16Array,int32Array:assertInt32Array,int8Array:assertInt8Array,integer:assertInteger,iterable:assertIterable,map:assertMap,nan:assertNan,nativePromise:assertNativePromise,negativeNumber:assertNegativeNumber,nodeStream:assertNodeStream,nonEmptyArray:assertNonEmptyArray,nonEmptyMap:assertNonEmptyMap,nonEmptyObject:assertNonEmptyObject,nonEmptySet:assertNonEmptySet,nonEmptyString:assertNonEmptyString,nonEmptyStringAndNotWhitespace:assertNonEmptyStringAndNotWhitespace,null:assertNull,nullOrUndefined:assertNullOrUndefined,number:assertNumber,numericString:assertNumericString,object:assertObject,observable:assertObservable,oddInteger:assertOddInteger,plainObject:assertPlainObject,positiveNumber:assertPositiveNumber,primitive:assertPrimitive,promise:assertPromise,propertyKey:assertPropertyKey,regExp:assertRegExp,safeInteger:assertSafeInteger,set:assertSet,sharedArrayBuffer:assertSharedArrayBuffer,string:assertString,symbol:assertSymbol,truthy:assertTruthy,tupleLike:assertTupleLike,typedArray:assertTypedArray,uint16Array:assertUint16Array,uint32Array:assertUint32Array,uint8Array:assertUint8Array,uint8ClampedArray:assertUint8ClampedArray,undefined:assertUndefined,urlInstance:assertUrlInstance,urlSearchParams:assertUrlSearchParams,urlString:assertUrlString,validDate:assertValidDate,validLength:assertValidLength,weakMap:assertWeakMap,weakRef:assertWeakRef,weakSet:assertWeakSet,whitespaceString:assertWhitespaceString};const Ni={isArray:"Array",isArrayBuffer:"ArrayBuffer",isArrayLike:"array-like",isAsyncFunction:"AsyncFunction",isAsyncGenerator:"AsyncGenerator",isAsyncGeneratorFunction:"AsyncGeneratorFunction",isAsyncIterable:"AsyncIterable",isBigint:"bigint",isBigInt64Array:"BigInt64Array",isBigUint64Array:"BigUint64Array",isBlob:"Blob",isBoolean:"boolean",isBoundFunction:"Function",isBuffer:"Buffer",isClass:"Class",isDataView:"DataView",isDate:"Date",isDirectInstanceOf:"T",isEmptyArray:"empty array",isEmptyMap:"empty map",isEmptyObject:"empty object",isEmptySet:"empty set",isEmptyString:"empty string",isEmptyStringOrWhitespace:"empty string or whitespace",isEnumCase:"EnumCase",isError:"Error",isEvenInteger:"even integer",isFalsy:"falsy",isFloat32Array:"Float32Array",isFloat64Array:"Float64Array",isFormData:"FormData",isFunction:"Function",isGenerator:"Generator",isGeneratorFunction:"GeneratorFunction",isHtmlElement:"HTMLElement",isInfinite:"infinite number",isInRange:"in range",isInt16Array:"Int16Array",isInt32Array:"Int32Array",isInt8Array:"Int8Array",isInteger:"integer",isIterable:"Iterable",isMap:"Map",isNan:"NaN",isNativePromise:"native Promise",isNegativeNumber:"negative number",isNodeStream:"Node.js Stream",isNonEmptyArray:"non-empty array",isNonEmptyMap:"non-empty map",isNonEmptyObject:"non-empty object",isNonEmptySet:"non-empty set",isNonEmptyString:"non-empty string",isNonEmptyStringAndNotWhitespace:"non-empty string and not whitespace",isNull:"null",isNullOrUndefined:"null or undefined",isNumber:"number",isNumericString:"string with a number",isObject:"Object",isObservable:"Observable",isOddInteger:"odd integer",isPlainObject:"plain object",isPositiveNumber:"positive number",isPrimitive:"primitive",isPromise:"Promise",isPropertyKey:"PropertyKey",isRegExp:"RegExp",isSafeInteger:"integer",isSet:"Set",isSharedArrayBuffer:"SharedArrayBuffer",isString:"string",isSymbol:"symbol",isTruthy:"truthy",isTupleLike:"tuple-like",isTypedArray:"TypedArray",isUint16Array:"Uint16Array",isUint32Array:"Uint32Array",isUint8Array:"Uint8Array",isUint8ClampedArray:"Uint8ClampedArray",isUndefined:"undefined",isUrlInstance:"URL",isUrlSearchParams:"URLSearchParams",isUrlString:"string with a URL",isValidDate:"valid Date",isValidLength:"valid length",isWeakMap:"WeakMap",isWeakRef:"WeakRef",isWeakSet:"WeakSet",isWhitespaceString:"whitespace string"};const Li=keysOf(Ni);function isIsMethodName(u){return Li.includes(u)}function assertAll(u,...A){if(A.length===0){throw new TypeError("Invalid number of values")}if(!isAll(u,...A)){const p=u;const y=!Array.isArray(u)&&isIsMethodName(p.name)?Ni[p.name]:"predicate returns truthy for all values";throw new TypeError(typeErrorMessageMultipleValues(y,A))}}function assertAny(u,...A){if(A.length===0){throw new TypeError("Invalid number of values")}if(!isAny(u,...A)){const p=Array.isArray(u)?u:[u];const y=p.map((u=>isIsMethodName(u.name)?Ni[u.name]:"predicate returns truthy for any value"));throw new TypeError(typeErrorMessageMultipleValues(y,A))}}function assertOptional(u,A,p){if(!isUndefined(u)){A(u,p)}}function assertArray(u,A,p){if(!isArray(u)){throw new TypeError(p??typeErrorMessage("Array",u))}if(A){for(const y of u){A(y,p)}}}function assertArrayBuffer(u,A){if(!distribution_isArrayBuffer(u)){throw new TypeError(A??typeErrorMessage("ArrayBuffer",u))}}function assertArrayLike(u,A){if(!isArrayLike(u)){throw new TypeError(A??typeErrorMessage("array-like",u))}}function assertAsyncFunction(u,A){if(!isAsyncFunction(u)){throw new TypeError(A??typeErrorMessage("AsyncFunction",u))}}function assertAsyncGenerator(u,A){if(!distribution_isAsyncGenerator(u)){throw new TypeError(A??typeErrorMessage("AsyncGenerator",u))}}function assertAsyncGeneratorFunction(u,A){if(!isAsyncGeneratorFunction(u)){throw new TypeError(A??typeErrorMessage("AsyncGeneratorFunction",u))}}function assertAsyncIterable(u,A){if(!isAsyncIterable(u)){throw new TypeError(A??typeErrorMessage("AsyncIterable",u))}}function assertBigint(u,A){if(!isBigint(u)){throw new TypeError(A??typeErrorMessage("bigint",u))}}function assertBigInt64Array(u,A){if(!isBigInt64Array(u)){throw new TypeError(A??typeErrorMessage("BigInt64Array",u))}}function assertBigUint64Array(u,A){if(!isBigUint64Array(u)){throw new TypeError(A??typeErrorMessage("BigUint64Array",u))}}function assertBlob(u,A){if(!isBlob(u)){throw new TypeError(A??typeErrorMessage("Blob",u))}}function assertBoolean(u,A){if(!isBoolean(u)){throw new TypeError(A??typeErrorMessage("boolean",u))}}function assertBoundFunction(u,A){if(!isBoundFunction(u)){throw new TypeError(A??typeErrorMessage("Function",u))}}function assertBuffer(u,A){if(!isBuffer(u)){throw new TypeError(A??typeErrorMessage("Buffer",u))}}function assertClass(u,A){if(!isClass(u)){throw new TypeError(A??typeErrorMessage("Class",u))}}function assertDataView(u,A){if(!isDataView(u)){throw new TypeError(A??typeErrorMessage("DataView",u))}}function assertDate(u,A){if(!isDate(u)){throw new TypeError(A??typeErrorMessage("Date",u))}}function assertDirectInstanceOf(u,A,p){if(!isDirectInstanceOf(u,A)){throw new TypeError(p??typeErrorMessage("T",u))}}function assertEmptyArray(u,A){if(!isEmptyArray(u)){throw new TypeError(A??typeErrorMessage("empty array",u))}}function assertEmptyMap(u,A){if(!isEmptyMap(u)){throw new TypeError(A??typeErrorMessage("empty map",u))}}function assertEmptyObject(u,A){if(!isEmptyObject(u)){throw new TypeError(A??typeErrorMessage("empty object",u))}}function assertEmptySet(u,A){if(!isEmptySet(u)){throw new TypeError(A??typeErrorMessage("empty set",u))}}function assertEmptyString(u,A){if(!isEmptyString(u)){throw new TypeError(A??typeErrorMessage("empty string",u))}}function assertEmptyStringOrWhitespace(u,A){if(!isEmptyStringOrWhitespace(u)){throw new TypeError(A??typeErrorMessage("empty string or whitespace",u))}}function assertEnumCase(u,A,p){if(!isEnumCase(u,A)){throw new TypeError(p??typeErrorMessage("EnumCase",u))}}function assertError(u,A){if(!isError(u)){throw new TypeError(A??typeErrorMessage("Error",u))}}function assertEvenInteger(u,A){if(!isEvenInteger(u)){throw new TypeError(A??typeErrorMessage("even integer",u))}}function assertFalsy(u,A){if(!isFalsy(u)){throw new TypeError(A??typeErrorMessage("falsy",u))}}function assertFloat32Array(u,A){if(!isFloat32Array(u)){throw new TypeError(A??typeErrorMessage("Float32Array",u))}}function assertFloat64Array(u,A){if(!isFloat64Array(u)){throw new TypeError(A??typeErrorMessage("Float64Array",u))}}function assertFormData(u,A){if(!isFormData(u)){throw new TypeError(A??typeErrorMessage("FormData",u))}}function assertFunction(u,A){if(!isFunction(u)){throw new TypeError(A??typeErrorMessage("Function",u))}}function assertGenerator(u,A){if(!distribution_isGenerator(u)){throw new TypeError(A??typeErrorMessage("Generator",u))}}function assertGeneratorFunction(u,A){if(!isGeneratorFunction(u)){throw new TypeError(A??typeErrorMessage("GeneratorFunction",u))}}function assertHtmlElement(u,A){if(!isHtmlElement(u)){throw new TypeError(A??typeErrorMessage("HTMLElement",u))}}function assertInfinite(u,A){if(!isInfinite(u)){throw new TypeError(A??typeErrorMessage("infinite number",u))}}function assertInRange(u,A,p){if(!isInRange(u,A)){throw new TypeError(p??typeErrorMessage("in range",u))}}function assertInt16Array(u,A){if(!isInt16Array(u)){throw new TypeError(A??typeErrorMessage("Int16Array",u))}}function assertInt32Array(u,A){if(!isInt32Array(u)){throw new TypeError(A??typeErrorMessage("Int32Array",u))}}function assertInt8Array(u,A){if(!isInt8Array(u)){throw new TypeError(A??typeErrorMessage("Int8Array",u))}}function assertInteger(u,A){if(!isInteger(u)){throw new TypeError(A??typeErrorMessage("integer",u))}}function assertIterable(u,A){if(!isIterable(u)){throw new TypeError(A??typeErrorMessage("Iterable",u))}}function assertMap(u,A){if(!isMap(u)){throw new TypeError(A??typeErrorMessage("Map",u))}}function assertNan(u,A){if(!isNan(u)){throw new TypeError(A??typeErrorMessage("NaN",u))}}function assertNativePromise(u,A){if(!isNativePromise(u)){throw new TypeError(A??typeErrorMessage("native Promise",u))}}function assertNegativeNumber(u,A){if(!isNegativeNumber(u)){throw new TypeError(A??typeErrorMessage("negative number",u))}}function assertNodeStream(u,A){if(!isNodeStream(u)){throw new TypeError(A??typeErrorMessage("Node.js Stream",u))}}function assertNonEmptyArray(u,A){if(!isNonEmptyArray(u)){throw new TypeError(A??typeErrorMessage("non-empty array",u))}}function assertNonEmptyMap(u,A){if(!isNonEmptyMap(u)){throw new TypeError(A??typeErrorMessage("non-empty map",u))}}function assertNonEmptyObject(u,A){if(!isNonEmptyObject(u)){throw new TypeError(A??typeErrorMessage("non-empty object",u))}}function assertNonEmptySet(u,A){if(!isNonEmptySet(u)){throw new TypeError(A??typeErrorMessage("non-empty set",u))}}function assertNonEmptyString(u,A){if(!isNonEmptyString(u)){throw new TypeError(A??typeErrorMessage("non-empty string",u))}}function assertNonEmptyStringAndNotWhitespace(u,A){if(!isNonEmptyStringAndNotWhitespace(u)){throw new TypeError(A??typeErrorMessage("non-empty string and not whitespace",u))}}function assertNull(u,A){if(!isNull(u)){throw new TypeError(A??typeErrorMessage("null",u))}}function assertNullOrUndefined(u,A){if(!isNullOrUndefined(u)){throw new TypeError(A??typeErrorMessage("null or undefined",u))}}function assertNumber(u,A){if(!isNumber(u)){throw new TypeError(A??typeErrorMessage("number",u))}}function assertNumericString(u,A){if(!isNumericString(u)){throw new TypeError(A??typeErrorMessage("string with a number",u))}}function assertObject(u,A){if(!distribution_isObject(u)){throw new TypeError(A??typeErrorMessage("Object",u))}}function assertObservable(u,A){if(!isObservable(u)){throw new TypeError(A??typeErrorMessage("Observable",u))}}function assertOddInteger(u,A){if(!isOddInteger(u)){throw new TypeError(A??typeErrorMessage("odd integer",u))}}function assertPlainObject(u,A){if(!distribution_isPlainObject(u)){throw new TypeError(A??typeErrorMessage("plain object",u))}}function assertPositiveNumber(u,A){if(!isPositiveNumber(u)){throw new TypeError(A??typeErrorMessage("positive number",u))}}function assertPrimitive(u,A){if(!isPrimitive(u)){throw new TypeError(A??typeErrorMessage("primitive",u))}}function assertPromise(u,A){if(!isPromise(u)){throw new TypeError(A??typeErrorMessage("Promise",u))}}function assertPropertyKey(u,A){if(!isPropertyKey(u)){throw new TypeError(A??typeErrorMessage("PropertyKey",u))}}function assertRegExp(u,A){if(!isRegExp(u)){throw new TypeError(A??typeErrorMessage("RegExp",u))}}function assertSafeInteger(u,A){if(!isSafeInteger(u)){throw new TypeError(A??typeErrorMessage("integer",u))}}function assertSet(u,A){if(!isSet(u)){throw new TypeError(A??typeErrorMessage("Set",u))}}function assertSharedArrayBuffer(u,A){if(!isSharedArrayBuffer(u)){throw new TypeError(A??typeErrorMessage("SharedArrayBuffer",u))}}function assertString(u,A){if(!isString(u)){throw new TypeError(A??typeErrorMessage("string",u))}}function assertSymbol(u,A){if(!isSymbol(u)){throw new TypeError(A??typeErrorMessage("symbol",u))}}function assertTruthy(u,A){if(!isTruthy(u)){throw new TypeError(A??typeErrorMessage("truthy",u))}}function assertTupleLike(u,A,p){if(!isTupleLike(u,A)){throw new TypeError(p??typeErrorMessage("tuple-like",u))}}function assertTypedArray(u,A){if(!isTypedArray(u)){throw new TypeError(A??typeErrorMessage("TypedArray",u))}}function assertUint16Array(u,A){if(!isUint16Array(u)){throw new TypeError(A??typeErrorMessage("Uint16Array",u))}}function assertUint32Array(u,A){if(!isUint32Array(u)){throw new TypeError(A??typeErrorMessage("Uint32Array",u))}}function assertUint8Array(u,A){if(!distribution_isUint8Array(u)){throw new TypeError(A??typeErrorMessage("Uint8Array",u))}}function assertUint8ClampedArray(u,A){if(!isUint8ClampedArray(u)){throw new TypeError(A??typeErrorMessage("Uint8ClampedArray",u))}}function assertUndefined(u,A){if(!isUndefined(u)){throw new TypeError(A??typeErrorMessage("undefined",u))}}function assertUrlInstance(u,A){if(!isUrlInstance(u)){throw new TypeError(A??typeErrorMessage("URL",u))}}function assertUrlSearchParams(u,A){if(!isUrlSearchParams(u)){throw new TypeError(A??typeErrorMessage("URLSearchParams",u))}}function assertUrlString(u,A){if(!isUrlString(u)){throw new TypeError(A??typeErrorMessage("string with a URL",u))}}function assertValidDate(u,A){if(!isValidDate(u)){throw new TypeError(A??typeErrorMessage("valid Date",u))}}function assertValidLength(u,A){if(!isValidLength(u)){throw new TypeError(A??typeErrorMessage("valid length",u))}}function assertWeakMap(u,A){if(!isWeakMap(u)){throw new TypeError(A??typeErrorMessage("WeakMap",u))}}function assertWeakRef(u,A){if(!isWeakRef(u)){throw new TypeError(A??typeErrorMessage("WeakRef",u))}}function assertWeakSet(u,A){if(!isWeakSet(u)){throw new TypeError(A??typeErrorMessage("WeakSet",u))}}function assertWhitespaceString(u,A){if(!isWhitespaceString(u)){throw new TypeError(A??typeErrorMessage("whitespace string",u))}}const Pi=Qi;class CancelError extends Error{constructor(u){super(u||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}const Oi=Object.freeze({pending:Symbol("pending"),canceled:Symbol("canceled"),resolved:Symbol("resolved"),rejected:Symbol("rejected")});class PCancelable{static fn(u){return(...A)=>new PCancelable(((p,y,E)=>{A.push(E);u(...A).then(p,y)}))}#Ot=[];#Mt=true;#Ut=Oi.pending;#Ht;#Gt;constructor(u){this.#Ht=new Promise(((A,p)=>{this.#Gt=p;const onResolve=u=>{if(this.#Ut!==Oi.canceled||!onCancel.shouldReject){A(u);this.#Wt(Oi.resolved)}};const onReject=u=>{if(this.#Ut!==Oi.canceled||!onCancel.shouldReject){p(u);this.#Wt(Oi.rejected)}};const onCancel=u=>{if(this.#Ut!==Oi.pending){throw new Error(`The \`onCancel\` handler was attached after the promise ${this.#Ut.description}.`)}this.#Ot.push(u)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this.#Mt,set:u=>{this.#Mt=u}}});u(onResolve,onReject,onCancel)}))}then(u,A){return this.#Ht.then(u,A)}catch(u){return this.#Ht.catch(u)}finally(u){return this.#Ht.finally(u)}cancel(u){if(this.#Ut!==Oi.pending){return}this.#Wt(Oi.canceled);if(this.#Ot.length>0){try{for(const u of this.#Ot){u()}}catch(u){this.#Gt(u);return}}if(this.#Mt){this.#Gt(new CancelError(u))}}get isCanceled(){return this.#Ut===Oi.canceled}#Wt(u){if(this.#Ut===Oi.pending){this.#Ut=u}}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(u){return Pi.object(u)&&"_onResponse"in u}class RequestError extends Error{name="RequestError";code="ERR_GOT_REQUEST_ERROR";input;stack;response;request;timings;constructor(u,A,p){super(u,{cause:A});Error.captureStackTrace(this,this.constructor);if(A.code){this.code=A.code}this.input=A.input;if(isRequest(p)){Object.defineProperty(this,"request",{enumerable:false,value:p});Object.defineProperty(this,"response",{enumerable:false,value:p.response});this.options=p.options}else{this.options=p}this.timings=this.request?.timings;if(Pi.string(A.stack)&&Pi.string(this.stack)){const u=this.stack.indexOf(this.message)+this.message.length;const p=this.stack.slice(u).split("\n").reverse();const y=A.stack.slice(A.stack.indexOf(A.message)+A.message.length).split("\n").reverse();while(y.length>0&&y[0]===p[0]){p.shift()}this.stack=`${this.stack.slice(0,u)}${p.reverse().join("\n")}${y.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{name="MaxRedirectsError";code="ERR_TOO_MANY_REDIRECTS";constructor(u){super(`Redirected ${u.options.maxRedirects} times. Aborting.`,{},u)}}class HTTPError extends RequestError{name="HTTPError";code="ERR_NON_2XX_3XX_RESPONSE";constructor(u){super(`Request failed with status code ${u.statusCode} (${u.statusMessage}): ${u.request.options.method} ${u.request.options.url.toString()}`,{},u.request)}}class CacheError extends RequestError{name="CacheError";constructor(u,A){super(u.message,u,A);if(this.code==="ERR_GOT_REQUEST_ERROR"){this.code="ERR_CACHE_ACCESS"}}}class UploadError extends RequestError{name="UploadError";constructor(u,A){super(u.message,u,A);if(this.code==="ERR_GOT_REQUEST_ERROR"){this.code="ERR_UPLOAD"}}}class TimeoutError extends RequestError{name="TimeoutError";timings;event;constructor(u,A,p){super(u.message,u,p);this.event=u.event;this.timings=A}}class ReadError extends RequestError{name="ReadError";constructor(u,A){super(u.message,u,A);if(this.code==="ERR_GOT_REQUEST_ERROR"){this.code="ERR_READING_RESPONSE_STREAM"}}}class RetryError extends RequestError{name="RetryError";code="ERR_RETRYING";constructor(u){super("Retrying",{},u)}}class AbortError extends RequestError{name="AbortError";code="ERR_ABORTED";constructor(u){super("This operation was aborted.",{},u)}}const Mi=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:http");const Ui=new TextEncoder;function byteLength(u){if(typeof u==="string"){return Ui.encode(u).byteLength}if(ArrayBuffer.isView(u)||u instanceof ArrayBuffer||u instanceof SharedArrayBuffer){return u.byteLength}return 0}const Hi=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");async function getStreamAsBuffer(u,A){if(!("Buffer"in globalThis)){throw new Error("getStreamAsBuffer() is only supported in Node.js")}try{return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(u,A))}catch(u){if(u.bufferedData!==undefined){u.bufferedData=arrayBufferToNodeBuffer(u.bufferedData)}throw u}}const arrayBufferToNodeBuffer=u=>globalThis.Buffer.from(u);var Gi=p(4625);var Wi=p(181);var _serialize=(u,A=true)=>{if(u===void 0||u===null){return"null"}if(typeof u==="string"){return JSON.stringify(A&&u.startsWith(":")?`:${u}`:u)}if(Wi.Buffer.isBuffer(u)){return JSON.stringify(`:base64:${u.toString("base64")}`)}if(u?.toJSON){u=u.toJSON()}if(typeof u==="object"){let p="";const y=Array.isArray(u);p=y?"[":"{";let E=true;for(const C in u){const I=typeof u[C]==="function"||!y&&u[C]===void 0;if(!Object.hasOwn(u,C)||I){continue}if(!E){p+=","}E=false;if(y){p+=_serialize(u[C],A)}else if(u[C]!==void 0){p+=`${_serialize(C,false)}:${_serialize(u[C],A)}`}}p+=y?"]":"}";return p}return JSON.stringify(u)};var defaultSerialize=u=>_serialize(u,true);var defaultDeserialize=u=>JSON.parse(u,((u,A)=>{if(typeof A==="string"){if(A.startsWith(":base64:")){return Wi.Buffer.from(A.slice(8),"base64")}return A.startsWith(":")?A.slice(1):A}return A}));var ji=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map;this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(u,A){this.on(u,A)}on(u,A){if(!this._eventListeners.has(u)){this._eventListeners.set(u,[])}const p=this._eventListeners.get(u);if(p){if(p.length>=this._maxListeners){console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${p.length+1} ${u} listeners added. Use setMaxListeners() to increase limit.`)}p.push(A)}return this}removeListener(u,A){this.off(u,A)}off(u,A){const p=this._eventListeners.get(u)??[];const y=p.indexOf(A);if(y!==-1){p.splice(y,1)}if(p.length===0){this._eventListeners.delete(u)}}once(u,A){const onceListener=(...p)=>{A(...p);this.off(u,onceListener)};this.on(u,onceListener)}emit(u,...A){const p=this._eventListeners.get(u);if(p&&p.length>0){for(const u of p){u(...A)}}}listeners(u){return this._eventListeners.get(u)??[]}removeAllListeners(u){if(u){this._eventListeners.delete(u)}else{this._eventListeners.clear()}}setMaxListeners(u){this._maxListeners=u}};var zi=ji;var $i=class extends zi{_hookHandlers;constructor(){super();this._hookHandlers=new Map}addHandler(u,A){const p=this._hookHandlers.get(u);if(p){p.push(A)}else{this._hookHandlers.set(u,[A])}}removeHandler(u,A){const p=this._hookHandlers.get(u);if(p){const u=p.indexOf(A);if(u!==-1){p.splice(u,1)}}}trigger(u,A){const p=this._hookHandlers.get(u);if(p){for(const y of p){try{y(A)}catch(A){this.emit("error",new Error(`Error in hook handler for event "${u}": ${A.message}`))}}}}get handlers(){return new Map(this._hookHandlers)}};var qi=$i;var Vi=class extends zi{enabled=true;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(u){super();if(u!==void 0){this.enabled=u}this.reset()}hit(){if(this.enabled){this.hits++}}miss(){if(this.enabled){this.misses++}}set(){if(this.enabled){this.sets++}}delete(){if(this.enabled){this.deletes++}}hitsOrMisses(u){for(const A of u){if(A===void 0){this.miss()}else{this.hit()}}}reset(){this.hits=0;this.misses=0;this.sets=0;this.deletes=0;this.errors=0}};var Ki=Vi;var Ji=(u=>{u["PRE_SET"]="preSet";u["POST_SET"]="postSet";u["PRE_GET"]="preGet";u["POST_GET"]="postGet";u["PRE_GET_MANY"]="preGetMany";u["POST_GET_MANY"]="postGetMany";u["PRE_GET_RAW"]="preGetRaw";u["POST_GET_RAW"]="postGetRaw";u["PRE_GET_MANY_RAW"]="preGetManyRaw";u["POST_GET_MANY_RAW"]="postGetManyRaw";u["PRE_DELETE"]="preDelete";u["POST_DELETE"]="postDelete";return u})(Ji||{});var Yi=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"];var Xi=class extends zi{opts;iterator;hooks=new qi;stats=new Ki(false);_ttl;_namespace;_store=new Map;_serialize=defaultSerialize;_deserialize=defaultDeserialize;_compression;_useKeyPrefix=true;_throwOnErrors=false;constructor(u,A){super();A??={};u??={};this.opts={namespace:"keyv",serialize:defaultSerialize,deserialize:defaultDeserialize,emitErrors:true,store:new Map,...A};if(u&&u.get){this.opts.store=u}else{this.opts={...this.opts,...u}}this._store=this.opts.store??new Map;this._compression=this.opts.compression;this._serialize=this.opts.serialize;this._deserialize=this.opts.deserialize;if(this.opts.namespace){this._namespace=this.opts.namespace}if(this._store){if(!this._isValidStorageAdapter(this._store)){throw new Error("Invalid storage adapter")}if(typeof this._store.on==="function"){this._store.on("error",(u=>this.emit("error",u)))}this._store.namespace=this._namespace;if(typeof this._store[Symbol.iterator]==="function"&&this._store instanceof Map){this.iterator=this.generateIterator(this._store)}else if("iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()){this.iterator=this.generateIterator(this._store.iterator.bind(this._store))}}if(this.opts.stats){this.stats.enabled=this.opts.stats}if(this.opts.ttl){this._ttl=this.opts.ttl}if(this.opts.useKeyPrefix!==void 0){this._useKeyPrefix=this.opts.useKeyPrefix}if(this.opts.throwOnErrors!==void 0){this._throwOnErrors=this.opts.throwOnErrors}}get store(){return this._store}set store(u){if(this._isValidStorageAdapter(u)){this._store=u;this.opts.store=u;if(typeof u.on==="function"){u.on("error",(u=>this.emit("error",u)))}if(this._namespace){this._store.namespace=this._namespace}if(typeof u[Symbol.iterator]==="function"&&u instanceof Map){this.iterator=this.generateIterator(u)}else if("iterator"in u&&u.opts&&this._checkIterableAdapter()){this.iterator=this.generateIterator(u.iterator?.bind(u))}}else{throw new Error("Invalid storage adapter")}}get compression(){return this._compression}set compression(u){this._compression=u}get namespace(){return this._namespace}set namespace(u){this._namespace=u;this.opts.namespace=u;this._store.namespace=u;if(this.opts.store){this.opts.store.namespace=u}}get ttl(){return this._ttl}set ttl(u){this.opts.ttl=u;this._ttl=u}get serialize(){return this._serialize}set serialize(u){this.opts.serialize=u;this._serialize=u}get deserialize(){return this._deserialize}set deserialize(u){this.opts.deserialize=u;this._deserialize=u}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(u){this._useKeyPrefix=u;this.opts.useKeyPrefix=u}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(u){this._throwOnErrors=u;this.opts.throwOnErrors=u}generateIterator(u){const function_=async function*(){for await(const[A,p]of typeof u==="function"?u(this._store.namespace):u){const u=await this.deserializeData(p);if(this._useKeyPrefix&&this._store.namespace&&!A.includes(this._store.namespace)){continue}if(typeof u.expires==="number"&&Date.now()>u.expires){this.delete(A);continue}yield[this._getKeyUnprefix(A),u.value]}};return function_.bind(this)}_checkIterableAdapter(){return Yi.includes(this._store.opts.dialect)||Yi.some((u=>this._store.opts.url.includes(u)))}_getKeyPrefix(u){if(!this._useKeyPrefix){return u}if(!this._namespace){return u}return`${this._namespace}:${u}`}_getKeyPrefixArray(u){if(!this._useKeyPrefix){return u}if(!this._namespace){return u}return u.map((u=>`${this._namespace}:${u}`))}_getKeyUnprefix(u){if(!this._useKeyPrefix){return u}return u.split(":").splice(1).join(":")}_isValidStorageAdapter(u){return u instanceof Map||typeof u.get==="function"&&typeof u.set==="function"&&typeof u.delete==="function"&&typeof u.clear==="function"}async get(u,A){const{store:p}=this.opts;const y=Array.isArray(u);const E=y?this._getKeyPrefixArray(u):this._getKeyPrefix(u);const isDataExpired=u=>typeof u.expires==="number"&&Date.now()>u.expires;if(y){if(A?.raw===true){return this.getMany(u,{raw:true})}return this.getMany(u,{raw:false})}this.hooks.trigger("preGet",{key:E});let C;try{C=await p.get(E)}catch(u){if(this.throwOnErrors){throw u}}const I=typeof C==="string"||this.opts.compression?await this.deserializeData(C):C;if(I===void 0||I===null){this.hooks.trigger("postGet",{key:E,value:void 0});this.stats.miss();return void 0}if(isDataExpired(I)){await this.delete(u);this.hooks.trigger("postGet",{key:E,value:void 0});this.stats.miss();return void 0}this.hooks.trigger("postGet",{key:E,value:I});this.stats.hit();return A?.raw?I:I.value}async getMany(u,A){const{store:p}=this.opts;const y=this._getKeyPrefixArray(u);const isDataExpired=u=>typeof u.expires==="number"&&Date.now()>u.expires;this.hooks.trigger("preGetMany",{keys:y});if(p.getMany===void 0){const u=y.map((async u=>{const y=await p.get(u);const E=typeof y==="string"||this.opts.compression?await this.deserializeData(y):y;if(E===void 0||E===null){return void 0}if(isDataExpired(E)){await this.delete(u);return void 0}return A?.raw?E:E.value}));const E=await Promise.allSettled(u);const C=E.map((u=>u.value));this.hooks.trigger("postGetMany",C);if(C.length>0){this.stats.hit()}return C}const E=await p.getMany(y);const C=[];const I=[];for(const p in E){let y=E[p];if(typeof y==="string"){y=await this.deserializeData(y)}if(y===void 0||y===null){C.push(void 0);continue}if(isDataExpired(y)){I.push(u[p]);C.push(void 0);continue}const w=A?.raw?y:y.value;C.push(w)}if(I.length>0){await this.deleteMany(I)}this.hooks.trigger("postGetMany",C);if(C.length>0){this.stats.hit()}return C}async getRaw(u){const{store:A}=this.opts;const p=this._getKeyPrefix(u);this.hooks.trigger("preGetRaw",{key:p});const y=await A.get(p);if(y===void 0||y===null){this.hooks.trigger("postGetRaw",{key:p,value:void 0});this.stats.miss();return void 0}const E=typeof y==="string"||this.opts.compression?await this.deserializeData(y):y;if(E!==void 0&&E.expires!==void 0&&E.expires!==null&&E.expires<Date.now()){this.hooks.trigger("postGetRaw",{key:p,value:void 0});this.stats.miss();await this.delete(u);return void 0}this.stats.hit();this.hooks.trigger("postGetRaw",{key:p,value:E});return E}async getManyRaw(u){const{store:A}=this.opts;const p=this._getKeyPrefixArray(u);if(u.length===0){const A=Array.from({length:u.length}).fill(void 0);this.stats.misses+=u.length;this.hooks.trigger("postGetManyRaw",{keys:p,values:A});return A}let y=[];if(A.getMany===void 0){const u=p.map((async u=>{const p=await A.get(u);if(p!==void 0&&p!==null){return this.deserializeData(p)}return void 0}));const E=await Promise.allSettled(u);y=E.map((u=>u.value))}else{const u=await A.getMany(p);for(const A of u){if(A!==void 0&&A!==null){y.push(await this.deserializeData(A))}else{y.push(void 0)}}}const E=[];const isDataExpired=u=>typeof u.expires==="number"&&Date.now()>u.expires;for(const[u,A]of y.entries()){if(A!==void 0&&isDataExpired(A)){E.push(p[u]);y[u]=void 0}}if(E.length>0){await this.deleteMany(E)}this.stats.hitsOrMisses(y);this.hooks.trigger("postGetManyRaw",{keys:p,values:y});return y}async set(u,A,p){const y={key:u,value:A,ttl:p};this.hooks.trigger("preSet",y);const E=this._getKeyPrefix(y.key);y.ttl??=this._ttl;if(y.ttl===0){y.ttl=void 0}const{store:C}=this.opts;const I=typeof y.ttl==="number"?Date.now()+y.ttl:void 0;if(typeof y.value==="symbol"){this.emit("error","symbol cannot be serialized");throw new Error("symbol cannot be serialized")}const w={value:y.value,expires:I};const v=await this.serializeData(w);let B=true;try{const u=await C.set(E,v,y.ttl);if(typeof u==="boolean"){B=u}}catch(u){B=false;this.emit("error",u);if(this._throwOnErrors){throw u}}this.hooks.trigger("postSet",{key:E,value:v,ttl:p});this.stats.set();return B}async setMany(u){let A=[];try{if(this._store.setMany===void 0){const p=[];for(const A of u){p.push(this.set(A.key,A.value,A.ttl))}const y=await Promise.all(p);A=y}else{const p=await Promise.all(u.map((async({key:u,value:A,ttl:p})=>{p??=this._ttl;if(p===0){p=void 0}const y=typeof p==="number"?Date.now()+p:void 0;if(typeof A==="symbol"){this.emit("error","symbol cannot be serialized");throw new Error("symbol cannot be serialized")}const E={value:A,expires:y};const C=await this.serializeData(E);const I=this._getKeyPrefix(u);return{key:I,value:C,ttl:p}})));A=await this._store.setMany(p)}}catch(p){this.emit("error",p);if(this._throwOnErrors){throw p}A=u.map((()=>false))}return A}async delete(u){const{store:A}=this.opts;if(Array.isArray(u)){return this.deleteMany(u)}const p=this._getKeyPrefix(u);this.hooks.trigger("preDelete",{key:p});let y=true;try{const u=await A.delete(p);if(typeof u==="boolean"){y=u}}catch(u){y=false;this.emit("error",u);if(this._throwOnErrors){throw u}}this.hooks.trigger("postDelete",{key:p,value:y});this.stats.delete();return y}async deleteMany(u){try{const{store:A}=this.opts;const p=this._getKeyPrefixArray(u);this.hooks.trigger("preDelete",{key:p});if(A.deleteMany!==void 0){return await A.deleteMany(p)}const y=p.map((async u=>A.delete(u)));const E=await Promise.all(y);const C=E.every(Boolean);this.hooks.trigger("postDelete",{key:p,value:C});return C}catch(u){this.emit("error",u);if(this._throwOnErrors){throw u}return false}}async clear(){this.emit("clear");const{store:u}=this.opts;try{await u.clear()}catch(u){this.emit("error",u);if(this._throwOnErrors){throw u}}}async has(u){if(Array.isArray(u)){return this.hasMany(u)}const A=this._getKeyPrefix(u);const{store:p}=this.opts;if(p.has!==void 0&&!(p instanceof Map)){return p.has(A)}let y;try{y=await p.get(A)}catch(u){this.emit("error",u);if(this._throwOnErrors){throw u}return false}if(y){const u=await this.deserializeData(y);if(u){if(u.expires===void 0||u.expires===null){return true}return u.expires>Date.now()}}return false}async hasMany(u){const A=this._getKeyPrefixArray(u);const{store:p}=this.opts;if(p.hasMany!==void 0){return p.hasMany(A)}const y=[];for(const A of u){y.push(await this.has(A))}return y}async disconnect(){const{store:u}=this.opts;this.emit("disconnect");if(typeof u.disconnect==="function"){return u.disconnect()}}emit(u,...A){if(u==="error"&&!this.opts.emitErrors){return}super.emit(u,...A)}async serializeData(u){if(!this._serialize){return u}if(this._compression?.compress){return this._serialize({value:await this._compression.compress(u.value),expires:u.expires})}return this._serialize(u)}async deserializeData(u){if(!this._deserialize){return u}if(this._compression?.decompress&&typeof u==="string"){const A=await this._deserialize(u);return{value:await this._compression.decompress(A?.value),expires:A?.expires}}if(typeof u==="string"){return this._deserialize(u)}return void 0}};var Zi=null&&Xi;
99
+ function push(u,A){var p=u.length;u.push(A);e:for(;0<p;){var y=p-1>>>1,E=u[y];if(0<compare(E,A))u[y]=A,u[p]=E,p=y;else break e}}function peek(u){return 0===u.length?null:u[0]}function pop(u){if(0===u.length)return null;var A=u[0],p=u.pop();if(p!==A){u[0]=p;e:for(var y=0,E=u.length,C=E>>>1;y<C;){var I=2*(y+1)-1,w=u[I],v=I+1,B=u[v];if(0>compare(w,p))v<E&&0>compare(B,w)?(u[y]=B,u[v]=p,y=v):(u[y]=w,u[I]=p,y=I);else if(v<E&&0>compare(B,p))u[y]=B,u[v]=p,y=v;else break e}}return A}function compare(u,A){var p=u.sortIndex-A.sortIndex;return 0!==p?p:u.id-A.id}A.unstable_now=void 0;if("object"===typeof performance&&"function"===typeof performance.now){var p=performance;A.unstable_now=function(){return p.now()}}else{var y=Date,E=y.now();A.unstable_now=function(){return y.now()-E}}var C=[],I=[],w=1,v=null,B=3,S=!1,D=!1,k=!1,Q=!1,F="function"===typeof setTimeout?setTimeout:null,R="function"===typeof clearTimeout?clearTimeout:null,_="undefined"!==typeof setImmediate?setImmediate:null;function advanceTimers(u){for(var A=peek(I);null!==A;){if(null===A.callback)pop(I);else if(A.startTime<=u)pop(I),A.sortIndex=A.expirationTime,push(C,A);else break;A=peek(I)}}function handleTimeout(u){k=!1;advanceTimers(u);if(!D)if(null!==peek(C))D=!0,P||(P=!0,G());else{var A=peek(I);null!==A&&requestHostTimeout(handleTimeout,A.startTime-u)}}var P=!1,O=-1,U=5,H=-1;function shouldYieldToHost(){return Q?!0:A.unstable_now()-H<U?!1:!0}function performWorkUntilDeadline(){Q=!1;if(P){var u=A.unstable_now();H=u;var p=!0;try{e:{D=!1;k&&(k=!1,R(O),O=-1);S=!0;var y=B;try{t:{advanceTimers(u);for(v=peek(C);null!==v&&!(v.expirationTime>u&&shouldYieldToHost());){var E=v.callback;if("function"===typeof E){v.callback=null;B=v.priorityLevel;var w=E(v.expirationTime<=u);u=A.unstable_now();if("function"===typeof w){v.callback=w;advanceTimers(u);p=!0;break t}v===peek(C)&&pop(C);advanceTimers(u)}else pop(C);v=peek(C)}if(null!==v)p=!0;else{var F=peek(I);null!==F&&requestHostTimeout(handleTimeout,F.startTime-u);p=!1}}break e}finally{v=null,B=y,S=!1}p=void 0}}finally{p?G():P=!1}}}var G;if("function"===typeof _)G=function(){_(performWorkUntilDeadline)};else if("undefined"!==typeof MessageChannel){var j=new MessageChannel,$=j.port2;j.port1.onmessage=performWorkUntilDeadline;G=function(){$.postMessage(null)}}else G=function(){F(performWorkUntilDeadline,0)};function requestHostTimeout(u,p){O=F((function(){u(A.unstable_now())}),p)}A.unstable_IdlePriority=5;A.unstable_ImmediatePriority=1;A.unstable_LowPriority=4;A.unstable_NormalPriority=3;A.unstable_Profiling=null;A.unstable_UserBlockingPriority=2;A.unstable_cancelCallback=function(u){u.callback=null};A.unstable_forceFrameRate=function(u){0>u||125<u?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<u?Math.floor(1e3/u):5};A.unstable_getCurrentPriorityLevel=function(){return B};A.unstable_next=function(u){switch(B){case 1:case 2:case 3:var A=3;break;default:A=B}var p=B;B=A;try{return u()}finally{B=p}};A.unstable_requestPaint=function(){Q=!0};A.unstable_runWithPriority=function(u,A){switch(u){case 1:case 2:case 3:case 4:case 5:break;default:u=3}var p=B;B=u;try{return A()}finally{B=p}};A.unstable_scheduleCallback=function(u,p,y){var E=A.unstable_now();"object"===typeof y&&null!==y?(y=y.delay,y="number"===typeof y&&0<y?E+y:E):y=E;switch(u){case 1:var v=-1;break;case 2:v=250;break;case 5:v=1073741823;break;case 4:v=1e4;break;default:v=5e3}v=y+v;u={id:w++,callback:p,priorityLevel:u,startTime:y,expirationTime:v,sortIndex:-1};y>E?(u.sortIndex=y,push(I,u),null===peek(C)&&u===peek(I)&&(k?(R(O),O=-1):k=!0,requestHostTimeout(handleTimeout,y-E))):(u.sortIndex=v,push(C,u),D||S||(D=!0,P||(P=!0,G())));return u};A.unstable_shouldYield=shouldYieldToHost;A.unstable_wrapCallback=function(u){var A=B;return function(){var p=B;B=A;try{return u.apply(this,arguments)}finally{B=p}}}},8916:(u,A,p)=>{if(process.env.NODE_ENV==="production"){u.exports=p(2695)}else{u.exports=p(275)}},7741:(u,A,p)=>{const y=p(5897);const{MAX_LENGTH:E,MAX_SAFE_INTEGER:C}=p(3439);const{safeRe:I,t:w}=p(3569);const v=p(574);const{compareIdentifiers:B}=p(2070);class SemVer{constructor(u,A){A=v(A);if(u instanceof SemVer){if(u.loose===!!A.loose&&u.includePrerelease===!!A.includePrerelease){return u}else{u=u.version}}else if(typeof u!=="string"){throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`)}if(u.length>E){throw new TypeError(`version is longer than ${E} characters`)}y("SemVer",u,A);this.options=A;this.loose=!!A.loose;this.includePrerelease=!!A.includePrerelease;const p=u.trim().match(A.loose?I[w.LOOSE]:I[w.FULL]);if(!p){throw new TypeError(`Invalid Version: ${u}`)}this.raw=u;this.major=+p[1];this.minor=+p[2];this.patch=+p[3];if(this.major>C||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>C||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>C||this.patch<0){throw new TypeError("Invalid patch version")}if(!p[4]){this.prerelease=[]}else{this.prerelease=p[4].split(".").map((u=>{if(/^[0-9]+$/.test(u)){const A=+u;if(A>=0&&A<C){return A}}return u}))}this.build=p[5]?p[5].split("."):[];this.format()}format(){this.version=`${this.major}.${this.minor}.${this.patch}`;if(this.prerelease.length){this.version+=`-${this.prerelease.join(".")}`}return this.version}toString(){return this.version}compare(u){y("SemVer.compare",this.version,this.options,u);if(!(u instanceof SemVer)){if(typeof u==="string"&&u===this.version){return 0}u=new SemVer(u,this.options)}if(u.version===this.version){return 0}return this.compareMain(u)||this.comparePre(u)}compareMain(u){if(!(u instanceof SemVer)){u=new SemVer(u,this.options)}if(this.major<u.major){return-1}if(this.major>u.major){return 1}if(this.minor<u.minor){return-1}if(this.minor>u.minor){return 1}if(this.patch<u.patch){return-1}if(this.patch>u.patch){return 1}return 0}comparePre(u){if(!(u instanceof SemVer)){u=new SemVer(u,this.options)}if(this.prerelease.length&&!u.prerelease.length){return-1}else if(!this.prerelease.length&&u.prerelease.length){return 1}else if(!this.prerelease.length&&!u.prerelease.length){return 0}let A=0;do{const p=this.prerelease[A];const E=u.prerelease[A];y("prerelease compare",A,p,E);if(p===undefined&&E===undefined){return 0}else if(E===undefined){return 1}else if(p===undefined){return-1}else if(p===E){continue}else{return B(p,E)}}while(++A)}compareBuild(u){if(!(u instanceof SemVer)){u=new SemVer(u,this.options)}let A=0;do{const p=this.build[A];const E=u.build[A];y("build compare",A,p,E);if(p===undefined&&E===undefined){return 0}else if(E===undefined){return 1}else if(p===undefined){return-1}else if(p===E){continue}else{return B(p,E)}}while(++A)}inc(u,A,p){if(u.startsWith("pre")){if(!A&&p===false){throw new Error("invalid increment argument: identifier is empty")}if(A){const u=`-${A}`.match(this.options.loose?I[w.PRERELEASELOOSE]:I[w.PRERELEASE]);if(!u||u[1]!==A){throw new Error(`invalid identifier: ${A}`)}}}switch(u){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",A,p);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",A,p);break;case"prepatch":this.prerelease.length=0;this.inc("patch",A,p);this.inc("pre",A,p);break;case"prerelease":if(this.prerelease.length===0){this.inc("patch",A,p)}this.inc("pre",A,p);break;case"release":if(this.prerelease.length===0){throw new Error(`version ${this.raw} is not a prerelease`)}this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0){this.major++}this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0){this.minor++}this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0){this.patch++}this.prerelease=[];break;case"pre":{const u=Number(p)?1:0;if(this.prerelease.length===0){this.prerelease=[u]}else{let y=this.prerelease.length;while(--y>=0){if(typeof this.prerelease[y]==="number"){this.prerelease[y]++;y=-2}}if(y===-1){if(A===this.prerelease.join(".")&&p===false){throw new Error("invalid increment argument: identifier already exists")}this.prerelease.push(u)}}if(A){let y=[A,u];if(p===false){y=[A]}if(B(this.prerelease[0],A)===0){if(isNaN(this.prerelease[1])){this.prerelease=y}}else{this.prerelease=y}}break}default:throw new Error(`invalid increment argument: ${u}`)}this.raw=this.format();if(this.build.length){this.raw+=`+${this.build.join(".")}`}return this}}u.exports=SemVer},5969:(u,A,p)=>{const y=p(8091);const clean=(u,A)=>{const p=y(u.trim().replace(/^[=v]+/,""),A);return p?p.version:null};u.exports=clean},8091:(u,A,p)=>{const y=p(7741);const parse=(u,A,p=false)=>{if(u instanceof y){return u}try{return new y(u,A)}catch(u){if(!p){return null}throw u}};u.exports=parse},3490:(u,A,p)=>{const y=p(8091);const valid=(u,A)=>{const p=y(u,A);return p?p.version:null};u.exports=valid},3439:u=>{const A="2.0.0";const p=256;const y=Number.MAX_SAFE_INTEGER||9007199254740991;const E=16;const C=p-6;const I=["major","premajor","minor","preminor","patch","prepatch","prerelease"];u.exports={MAX_LENGTH:p,MAX_SAFE_COMPONENT_LENGTH:E,MAX_SAFE_BUILD_LENGTH:C,MAX_SAFE_INTEGER:y,RELEASE_TYPES:I,SEMVER_SPEC_VERSION:A,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},5897:u=>{const A=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...u)=>console.error("SEMVER",...u):()=>{};u.exports=A},2070:u=>{const A=/^[0-9]+$/;const compareIdentifiers=(u,p)=>{if(typeof u==="number"&&typeof p==="number"){return u===p?0:u<p?-1:1}const y=A.test(u);const E=A.test(p);if(y&&E){u=+u;p=+p}return u===p?0:y&&!E?-1:E&&!y?1:u<p?-1:1};const rcompareIdentifiers=(u,A)=>compareIdentifiers(A,u);u.exports={compareIdentifiers:compareIdentifiers,rcompareIdentifiers:rcompareIdentifiers}},574:u=>{const A=Object.freeze({loose:true});const p=Object.freeze({});const parseOptions=u=>{if(!u){return p}if(typeof u!=="object"){return A}return u};u.exports=parseOptions},3569:(u,A,p)=>{const{MAX_SAFE_COMPONENT_LENGTH:y,MAX_SAFE_BUILD_LENGTH:E,MAX_LENGTH:C}=p(3439);const I=p(5897);A=u.exports={};const w=A.re=[];const v=A.safeRe=[];const B=A.src=[];const S=A.safeSrc=[];const D=A.t={};let k=0;const Q="[a-zA-Z0-9-]";const F=[["\\s",1],["\\d",C],[Q,E]];const makeSafeRegex=u=>{for(const[A,p]of F){u=u.split(`${A}*`).join(`${A}{0,${p}}`).split(`${A}+`).join(`${A}{1,${p}}`)}return u};const createToken=(u,A,p)=>{const y=makeSafeRegex(A);const E=k++;I(u,E,A);D[u]=E;B[E]=A;S[E]=y;w[E]=new RegExp(A,p?"g":undefined);v[E]=new RegExp(y,p?"g":undefined)};createToken("NUMERICIDENTIFIER","0|[1-9]\\d*");createToken("NUMERICIDENTIFIERLOOSE","\\d+");createToken("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Q}*`);createToken("MAINVERSION",`(${B[D.NUMERICIDENTIFIER]})\\.`+`(${B[D.NUMERICIDENTIFIER]})\\.`+`(${B[D.NUMERICIDENTIFIER]})`);createToken("MAINVERSIONLOOSE",`(${B[D.NUMERICIDENTIFIERLOOSE]})\\.`+`(${B[D.NUMERICIDENTIFIERLOOSE]})\\.`+`(${B[D.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASEIDENTIFIER",`(?:${B[D.NONNUMERICIDENTIFIER]}|${B[D.NUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${B[D.NONNUMERICIDENTIFIER]}|${B[D.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASE",`(?:-(${B[D.PRERELEASEIDENTIFIER]}(?:\\.${B[D.PRERELEASEIDENTIFIER]})*))`);createToken("PRERELEASELOOSE",`(?:-?(${B[D.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${B[D.PRERELEASEIDENTIFIERLOOSE]})*))`);createToken("BUILDIDENTIFIER",`${Q}+`);createToken("BUILD",`(?:\\+(${B[D.BUILDIDENTIFIER]}(?:\\.${B[D.BUILDIDENTIFIER]})*))`);createToken("FULLPLAIN",`v?${B[D.MAINVERSION]}${B[D.PRERELEASE]}?${B[D.BUILD]}?`);createToken("FULL",`^${B[D.FULLPLAIN]}$`);createToken("LOOSEPLAIN",`[v=\\s]*${B[D.MAINVERSIONLOOSE]}${B[D.PRERELEASELOOSE]}?${B[D.BUILD]}?`);createToken("LOOSE",`^${B[D.LOOSEPLAIN]}$`);createToken("GTLT","((?:<|>)?=?)");createToken("XRANGEIDENTIFIERLOOSE",`${B[D.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);createToken("XRANGEIDENTIFIER",`${B[D.NUMERICIDENTIFIER]}|x|X|\\*`);createToken("XRANGEPLAIN",`[v=\\s]*(${B[D.XRANGEIDENTIFIER]})`+`(?:\\.(${B[D.XRANGEIDENTIFIER]})`+`(?:\\.(${B[D.XRANGEIDENTIFIER]})`+`(?:${B[D.PRERELEASE]})?${B[D.BUILD]}?`+`)?)?`);createToken("XRANGEPLAINLOOSE",`[v=\\s]*(${B[D.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${B[D.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${B[D.XRANGEIDENTIFIERLOOSE]})`+`(?:${B[D.PRERELEASELOOSE]})?${B[D.BUILD]}?`+`)?)?`);createToken("XRANGE",`^${B[D.GTLT]}\\s*${B[D.XRANGEPLAIN]}$`);createToken("XRANGELOOSE",`^${B[D.GTLT]}\\s*${B[D.XRANGEPLAINLOOSE]}$`);createToken("COERCEPLAIN",`${"(^|[^\\d])"+"(\\d{1,"}${y}})`+`(?:\\.(\\d{1,${y}}))?`+`(?:\\.(\\d{1,${y}}))?`);createToken("COERCE",`${B[D.COERCEPLAIN]}(?:$|[^\\d])`);createToken("COERCEFULL",B[D.COERCEPLAIN]+`(?:${B[D.PRERELEASE]})?`+`(?:${B[D.BUILD]})?`+`(?:$|[^\\d])`);createToken("COERCERTL",B[D.COERCE],true);createToken("COERCERTLFULL",B[D.COERCEFULL],true);createToken("LONETILDE","(?:~>?)");createToken("TILDETRIM",`(\\s*)${B[D.LONETILDE]}\\s+`,true);A.tildeTrimReplace="$1~";createToken("TILDE",`^${B[D.LONETILDE]}${B[D.XRANGEPLAIN]}$`);createToken("TILDELOOSE",`^${B[D.LONETILDE]}${B[D.XRANGEPLAINLOOSE]}$`);createToken("LONECARET","(?:\\^)");createToken("CARETTRIM",`(\\s*)${B[D.LONECARET]}\\s+`,true);A.caretTrimReplace="$1^";createToken("CARET",`^${B[D.LONECARET]}${B[D.XRANGEPLAIN]}$`);createToken("CARETLOOSE",`^${B[D.LONECARET]}${B[D.XRANGEPLAINLOOSE]}$`);createToken("COMPARATORLOOSE",`^${B[D.GTLT]}\\s*(${B[D.LOOSEPLAIN]})$|^$`);createToken("COMPARATOR",`^${B[D.GTLT]}\\s*(${B[D.FULLPLAIN]})$|^$`);createToken("COMPARATORTRIM",`(\\s*)${B[D.GTLT]}\\s*(${B[D.LOOSEPLAIN]}|${B[D.XRANGEPLAIN]})`,true);A.comparatorTrimReplace="$1$2$3";createToken("HYPHENRANGE",`^\\s*(${B[D.XRANGEPLAIN]})`+`\\s+-\\s+`+`(${B[D.XRANGEPLAIN]})`+`\\s*$`);createToken("HYPHENRANGELOOSE",`^\\s*(${B[D.XRANGEPLAINLOOSE]})`+`\\s+-\\s+`+`(${B[D.XRANGEPLAINLOOSE]})`+`\\s*$`);createToken("STAR","(<|>)?=?\\s*\\*");createToken("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");createToken("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4205:(u,A,p)=>{const y=p(7600);u.exports=(u="")=>{const A=u.match(y);if(!A){return null}const[p,E]=A[0].replace(/#! ?/,"").split(" ");const C=p.split("/").pop();if(C==="env"){return E}return E?`${C} ${E}`:C}},7600:u=>{u.exports=/^#!(.*)/},7417:(u,A,p)=>{var y=global.process;const processOk=function(u){return u&&typeof u==="object"&&typeof u.removeListener==="function"&&typeof u.emit==="function"&&typeof u.reallyExit==="function"&&typeof u.listeners==="function"&&typeof u.kill==="function"&&typeof u.pid==="number"&&typeof u.on==="function"};if(!processOk(y)){u.exports=function(){return function(){}}}else{var E=p(2613);var C=p(9424);var I=/^win/i.test(y.platform);var w=p(4434);if(typeof w!=="function"){w=w.EventEmitter}var v;if(y.__signal_exit_emitter__){v=y.__signal_exit_emitter__}else{v=y.__signal_exit_emitter__=new w;v.count=0;v.emitted={}}if(!v.infinite){v.setMaxListeners(Infinity);v.infinite=true}u.exports=function(u,A){if(!processOk(global.process)){return function(){}}E.equal(typeof u,"function","a callback must be provided for exit handler");if(k===false){Q()}var p="exit";if(A&&A.alwaysLast){p="afterexit"}var remove=function(){v.removeListener(p,u);if(v.listeners("exit").length===0&&v.listeners("afterexit").length===0){B()}};v.on(p,u);return remove};var B=function unload(){if(!k||!processOk(global.process)){return}k=false;C.forEach((function(u){try{y.removeListener(u,D[u])}catch(u){}}));y.emit=_;y.reallyExit=F;v.count-=1};u.exports.unload=B;var S=function emit(u,A,p){if(v.emitted[u]){return}v.emitted[u]=true;v.emit(u,A,p)};var D={};C.forEach((function(u){D[u]=function listener(){if(!processOk(global.process)){return}var A=y.listeners(u);if(A.length===v.count){B();S("exit",null,u);S("afterexit",null,u);if(I&&u==="SIGHUP"){u="SIGINT"}y.kill(y.pid,u)}}}));u.exports.signals=function(){return C};var k=false;var Q=function load(){if(k||!processOk(global.process)){return}k=true;v.count+=1;C=C.filter((function(u){try{y.on(u,D[u]);return true}catch(u){return false}}));y.emit=P;y.reallyExit=R};u.exports.load=Q;var F=y.reallyExit;var R=function processReallyExit(u){if(!processOk(global.process)){return}y.exitCode=u||0;S("exit",y.exitCode,null);S("afterexit",y.exitCode,null);F.call(y,y.exitCode)};var _=y.emit;var P=function processEmit(u,A){if(u==="exit"&&processOk(global.process)){if(A!==undefined){y.exitCode=A}var p=_.apply(this,arguments);S("exit",y.exitCode,null);S("afterexit",y.exitCode,null);return p}else{return _.apply(this,arguments)}}}},9424:u=>{u.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){u.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){u.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},6820:(u,A,p)=>{var y=p(4093);var E=p(8423);function valid(u){try{y(u);return true}catch(u){return false}}function sortTranspositions(u,A){var p=A[0].length-u[0].length;if(p!==0)return p;return u[0].toUpperCase().localeCompare(A[0].toUpperCase())}var C=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(sortTranspositions);var I=0;var w=1;var v=[function(u){return u.toUpperCase()},function(u){return u.trim()},function(u){return u.replace(/\./g,"")},function(u){return u.replace(/\s+/g,"")},function(u){return u.replace(/\s+/g,"-")},function(u){return u.replace("v","-")},function(u){return u.replace(/,?\s*(\d)/,"-$1")},function(u){return u.replace(/,?\s*(\d)/,"-$1.0")},function(u){return u.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(u){return u.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(u){return u[0].toUpperCase()+u.slice(1)},function(u){return u.replace("/","-")},function(u){return u.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(u){if(u.indexOf("3.0")!==-1){return u+"-or-later"}else{return u+"-only"}},function(u){return u+"only"},function(u){return u.replace(/(\d)$/,"-$1.0")},function(u){return u.replace(/(-| )?(\d)$/,"-$2-Clause")},function(u){return u.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(u){return u.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(u){return u.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(u){return u.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(u){return u.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(u){return u.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(u){return"CC-"+u},function(u){return"CC-"+u+"-4.0"},function(u){return u.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(u){return"CC-"+u.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}];var B=E.map((function(u){var A=/^(.*)-\d+\.\d+$/.exec(u);return A?[A[0],A[1]]:[u,null]})).reduce((function(u,A){var p=A[1];u[p]=u[p]||[];u[p].push(A[0]);return u}),{});var S=Object.keys(B).map((function makeEntries(u){return[u,B[u]]})).filter((function identifySoleVersions(u){return u[1].length===1&&u[0]!==null&&u[0]!=="APL"})).map((function createLastResorts(u){return[u[0],u[1][0]]}));B=undefined;var D=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(S).sort(sortTranspositions);var k=0;var Q=1;var validTransformation=function(u){for(var A=0;A<v.length;A++){var p=v[A](u).trim();if(p!==u&&valid(p)){return p}}return null};var validLastResort=function(u){var A=u.toUpperCase();for(var p=0;p<D.length;p++){var y=D[p];if(A.indexOf(y[k])>-1){return y[Q]}}return null};var anyCorrection=function(u,A){for(var p=0;p<C.length;p++){var y=C[p];var E=y[I];if(u.indexOf(E)>-1){var v=u.replace(E,y[w]);var B=A(v);if(B!==null){return B}}}return null};u.exports=function(u,A){A=A||{};var p=A.upgrade===undefined?true:!!A.upgrade;function postprocess(u){return p?upgradeGPLs(u):u}var y=typeof u==="string"&&u.trim().length!==0;if(!y){throw Error("Invalid argument. Expected non-empty string.")}u=u.trim();if(valid(u)){return postprocess(u)}var E=u.replace(/\+$/,"").trim();if(valid(E)){return postprocess(E)}var C=validTransformation(u);if(C!==null){return postprocess(C)}C=anyCorrection(u,(function(u){if(valid(u)){return u}return validTransformation(u)}));if(C!==null){return postprocess(C)}C=validLastResort(u);if(C!==null){return postprocess(C)}C=anyCorrection(u,validLastResort);if(C!==null){return postprocess(C)}return null};function upgradeGPLs(u){if(["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(u)!==-1){return u+"-only"}else if(["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(u)!==-1){return u.replace(/\+$/,"-or-later")}else if(["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(u)!==-1){return u+"-or-later"}else{return u}}},4093:(u,A,p)=>{var y=p(5632);var E=p(2306);u.exports=function(u){return E(y(u))}},2306:u=>{u.exports=function(u){var A=0;function hasMore(){return A<u.length}function token(){return hasMore()?u[A]:null}function next(){if(!hasMore()){throw new Error}A++}function parseOperator(u){var A=token();if(A&&A.type==="OPERATOR"&&u===A.string){next();return A.string}}function parseWith(){if(parseOperator("WITH")){var u=token();if(u&&u.type==="EXCEPTION"){next();return u.string}throw new Error("Expected exception after `WITH`")}}function parseLicenseRef(){var u=A;var p="";var y=token();if(y.type==="DOCUMENTREF"){next();p+="DocumentRef-"+y.string+":";if(!parseOperator(":")){throw new Error("Expected `:` after `DocumentRef-...`")}}y=token();if(y.type==="LICENSEREF"){next();p+="LicenseRef-"+y.string;return{license:p}}A=u}function parseLicense(){var u=token();if(u&&u.type==="LICENSE"){next();var A={license:u.string};if(parseOperator("+")){A.plus=true}var p=parseWith();if(p){A.exception=p}return A}}function parseParenthesizedExpression(){var u=parseOperator("(");if(!u){return}var A=y();if(!parseOperator(")")){throw new Error("Expected `)`")}return A}function parseAtom(){return parseParenthesizedExpression()||parseLicenseRef()||parseLicense()}function makeBinaryOpParser(u,A){return function parseBinaryOp(){var p=A();if(!p){return}if(!parseOperator(u)){return p}var y=parseBinaryOp();if(!y){throw new Error("Expected expression")}return{left:p,conjunction:u.toLowerCase(),right:y}}}var p=makeBinaryOpParser("AND",parseAtom);var y=makeBinaryOpParser("OR",p);var E=y();if(!E||hasMore()){throw new Error("Syntax error")}return E}},5632:(u,A,p)=>{var y=[].concat(p(8423)).concat(p(5048));var E=p(173);u.exports=function(u){var A=0;function hasMore(){return A<u.length}function read(p){if(p instanceof RegExp){var y=u.slice(A);var E=y.match(p);if(E){A+=E[0].length;return E[0]}}else{if(u.indexOf(p,A)===A){A+=p.length;return p}}}function skipWhitespace(){read(/[ ]*/)}function operator(){var p;var y=["WITH","AND","OR","(",")",":","+"];for(var E=0;E<y.length;E++){p=read(y[E]);if(p){break}}if(p==="+"&&A>1&&u[A-2]===" "){throw new Error("Space before `+`")}return p&&{type:"OPERATOR",string:p}}function idstring(){return read(/[A-Za-z0-9-.]+/)}function expectIdstring(){var u=idstring();if(!u){throw new Error("Expected idstring at offset "+A)}return u}function documentRef(){if(read("DocumentRef-")){var u=expectIdstring();return{type:"DOCUMENTREF",string:u}}}function licenseRef(){if(read("LicenseRef-")){var u=expectIdstring();return{type:"LICENSEREF",string:u}}}function identifier(){var u=A;var p=idstring();if(y.indexOf(p)!==-1){return{type:"LICENSE",string:p}}else if(E.indexOf(p)!==-1){return{type:"EXCEPTION",string:p}}A=u}function parseToken(){return operator()||documentRef()||licenseRef()||identifier()}var p=[];while(hasMore()){skipWhitespace();if(!hasMore()){break}var C=parseToken();if(!C){throw new Error("Unexpected `"+u[A]+"` at offset "+A)}p.push(C)}return p}},4491:(u,A,p)=>{const y=p(6833);const E=typeof process==="object"&&process&&typeof process.cwd==="function"?process.cwd():".";const C=[].concat(p(3339).builtinModules,"bootstrap_node","node").map((u=>new RegExp(`(?:\\((?:node:)?${u}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${u}(?:\\.js)?:\\d+:\\d+$)`)));C.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);class StackUtils{constructor(u){u={ignoredPackages:[],...u};if("internals"in u===false){u.internals=StackUtils.nodeInternals()}if("cwd"in u===false){u.cwd=E}this._cwd=u.cwd.replace(/\\/g,"/");this._internals=[].concat(u.internals,ignoredPackagesRegExp(u.ignoredPackages));this._wrapCallSite=u.wrapCallSite||false}static nodeInternals(){return[...C]}clean(u,A=0){A=" ".repeat(A);if(!Array.isArray(u)){u=u.split("\n")}if(!/^\s*at /.test(u[0])&&/^\s*at /.test(u[1])){u=u.slice(1)}let p=false;let y=null;const E=[];u.forEach((u=>{u=u.replace(/\\/g,"/");if(this._internals.some((A=>A.test(u)))){return}const A=/^\s*at /.test(u);if(p){u=u.trimEnd().replace(/^(\s+)at /,"$1")}else{u=u.trim();if(A){u=u.slice(3)}}u=u.replace(`${this._cwd}/`,"");if(u){if(A){if(y){E.push(y);y=null}E.push(u)}else{p=true;y=u}}}));return E.map((u=>`${A}${u}\n`)).join("")}captureString(u,A=this.captureString){if(typeof u==="function"){A=u;u=Infinity}const{stackTraceLimit:p}=Error;if(u){Error.stackTraceLimit=u}const y={};Error.captureStackTrace(y,A);const{stack:E}=y;Error.stackTraceLimit=p;return this.clean(E)}capture(u,A=this.capture){if(typeof u==="function"){A=u;u=Infinity}const{prepareStackTrace:p,stackTraceLimit:y}=Error;Error.prepareStackTrace=(u,A)=>{if(this._wrapCallSite){return A.map(this._wrapCallSite)}return A};if(u){Error.stackTraceLimit=u}const E={};Error.captureStackTrace(E,A);const{stack:C}=E;Object.assign(Error,{prepareStackTrace:p,stackTraceLimit:y});return C}at(u=this.at){const[A]=this.capture(1,u);if(!A){return{}}const p={line:A.getLineNumber(),column:A.getColumnNumber()};setFile(p,A.getFileName(),this._cwd);if(A.isConstructor()){Object.defineProperty(p,"constructor",{value:true,configurable:true})}if(A.isEval()){p.evalOrigin=A.getEvalOrigin()}if(A.isNative()){p.native=true}let y;try{y=A.getTypeName()}catch(u){}if(y&&y!=="Object"&&y!=="[object Object]"){p.type=y}const E=A.getFunctionName();if(E){p.function=E}const C=A.getMethodName();if(C&&E!==C){p.method=C}return p}parseLine(u){const A=u&&u.match(I);if(!A){return null}const p=A[1]==="new";let y=A[2];const E=A[3];const C=A[4];const v=Number(A[5]);const B=Number(A[6]);let S=A[7];const D=A[8];const k=A[9];const Q=A[10]==="native";const F=A[11]===")";let R;const _={};if(D){_.line=Number(D)}if(k){_.column=Number(k)}if(F&&S){let u=0;for(let A=S.length-1;A>0;A--){if(S.charAt(A)===")"){u++}else if(S.charAt(A)==="("&&S.charAt(A-1)===" "){u--;if(u===-1&&S.charAt(A-1)===" "){const u=S.slice(0,A-1);const p=S.slice(A+1);S=p;y+=` (${u}`;break}}}}if(y){const u=y.match(w);if(u){y=u[1];R=u[2]}}setFile(_,S,this._cwd);if(p){Object.defineProperty(_,"constructor",{value:true,configurable:true})}if(E){_.evalOrigin=E;_.evalLine=v;_.evalColumn=B;_.evalFile=C&&C.replace(/\\/g,"/")}if(Q){_.native=true}if(y){_.function=y}if(R&&y!==R){_.method=R}return _}}function setFile(u,A,p){if(A){A=A.replace(/\\/g,"/");if(A.startsWith(`${p}/`)){A=A.slice(p.length+1)}u.file=A}}function ignoredPackagesRegExp(u){if(u.length===0){return[]}const A=u.map((u=>y(u)));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${A.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}const I=new RegExp("^"+"(?:\\s*at )?"+"(?:(new) )?"+"(?:(.*?) \\()?"+"(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?"+"(?:(.+?):(\\d+):(\\d+)|(native))"+"(\\)?)$");const w=/^(.*?) \[as (.*?)\]$/;u.exports=StackUtils},6708:(u,A,p)=>{const y=p(857);const E=p(2018);const C=p(7435);const{env:I}=process;let w;if(C("no-color")||C("no-colors")||C("color=false")||C("color=never")){w=0}else if(C("color")||C("colors")||C("color=true")||C("color=always")){w=1}if("FORCE_COLOR"in I){if(I.FORCE_COLOR==="true"){w=1}else if(I.FORCE_COLOR==="false"){w=0}else{w=I.FORCE_COLOR.length===0?1:Math.min(parseInt(I.FORCE_COLOR,10),3)}}function translateLevel(u){if(u===0){return false}return{level:u,hasBasic:true,has256:u>=2,has16m:u>=3}}function supportsColor(u,A){if(w===0){return 0}if(C("color=16m")||C("color=full")||C("color=truecolor")){return 3}if(C("color=256")){return 2}if(u&&!A&&w===undefined){return 0}const p=w||0;if(I.TERM==="dumb"){return p}if(process.platform==="win32"){const u=y.release().split(".");if(Number(u[0])>=10&&Number(u[2])>=10586){return Number(u[2])>=14931?3:2}return 1}if("CI"in I){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((u=>u in I))||I.CI_NAME==="codeship"){return 1}return p}if("TEAMCITY_VERSION"in I){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(I.TEAMCITY_VERSION)?1:0}if(I.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in I){const u=parseInt((I.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(I.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(I.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(I.TERM)){return 1}if("COLORTERM"in I){return 1}return p}function getSupportLevel(u){const A=supportsColor(u,u&&u.isTTY);return translateLevel(A)}u.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,E.isatty(1))),stderr:translateLevel(supportsColor(true,E.isatty(2)))}},5118:(u,A)=>{A.fromCallback=function(u){return Object.defineProperty((function(...A){if(typeof A[A.length-1]==="function")u.apply(this,A);else{return new Promise(((p,y)=>{A.push(((u,A)=>u!=null?y(u):p(A)));u.apply(this,A)}))}}),"name",{value:u.name})};A.fromPromise=function(u){return Object.defineProperty((function(...A){const p=A[A.length-1];if(typeof p!=="function")return u.apply(this,A);else{A.pop();u.apply(this,A).then((u=>p(null,u)),p)}}),"name",{value:u.name})}},2314:(u,A,p)=>{var y=p(4093);var E=p(6820);var C="license should be "+'a valid SPDX license expression (without "LicenseRef"), '+'"UNLICENSED", or '+'"SEE LICENSE IN <filename>"';var I=/^SEE LICEN[CS]E IN (.+)$/;function startsWith(u,A){return A.slice(0,u.length)===u}function usesLicenseRef(u){if(u.hasOwnProperty("license")){var A=u.license;return startsWith("LicenseRef",A)||startsWith("DocumentRef",A)}else{return usesLicenseRef(u.left)||usesLicenseRef(u.right)}}u.exports=function(u){var A;try{A=y(u)}catch(A){var p;if(u==="UNLICENSED"||u==="UNLICENCED"){return{validForOldPackages:true,validForNewPackages:true,unlicensed:true}}else if(p=I.exec(u)){return{validForOldPackages:true,validForNewPackages:true,inFile:p[1]}}else{var w={validForOldPackages:false,validForNewPackages:false,warnings:[C]};if(u.trim().length!==0){var v=E(u);if(v){w.warnings.push('license is similar to the valid expression "'+v+'"')}}return w}}if(usesLicenseRef(A)){return{validForNewPackages:false,validForOldPackages:false,spdx:true,warnings:[C]}}else{return{validForNewPackages:true,validForOldPackages:true,spdx:true}}}},1828:(u,A,p)=>{const y=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const E=p(6928);const C=y?";":":";const I=p(845);const getNotFoundError=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"});const getPathInfo=(u,A)=>{const p=A.colon||C;const E=u.match(/\//)||y&&u.match(/\\/)?[""]:[...y?[process.cwd()]:[],...(A.path||process.env.PATH||"").split(p)];const I=y?A.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const w=y?I.split(p):[""];if(y){if(u.indexOf(".")!==-1&&w[0]!=="")w.unshift("")}return{pathEnv:E,pathExt:w,pathExtExe:I}};const which=(u,A,p)=>{if(typeof A==="function"){p=A;A={}}if(!A)A={};const{pathEnv:y,pathExt:C,pathExtExe:w}=getPathInfo(u,A);const v=[];const step=p=>new Promise(((C,I)=>{if(p===y.length)return A.all&&v.length?C(v):I(getNotFoundError(u));const w=y[p];const B=/^".*"$/.test(w)?w.slice(1,-1):w;const S=E.join(B,u);const D=!B&&/^\.[\\\/]/.test(u)?u.slice(0,2)+S:S;C(subStep(D,p,0))}));const subStep=(u,p,y)=>new Promise(((E,B)=>{if(y===C.length)return E(step(p+1));const S=C[y];I(u+S,{pathExt:w},((C,I)=>{if(!C&&I){if(A.all)v.push(u+S);else return E(u+S)}return E(subStep(u,p,y+1))}))}));return p?step(0).then((u=>p(null,u)),p):step(0)};const whichSync=(u,A)=>{A=A||{};const{pathEnv:p,pathExt:y,pathExtExe:C}=getPathInfo(u,A);const w=[];for(let v=0;v<p.length;v++){const B=p[v];const S=/^".*"$/.test(B)?B.slice(1,-1):B;const D=E.join(S,u);const k=!S&&/^\.[\\\/]/.test(u)?u.slice(0,2)+D:D;for(let u=0;u<y.length;u++){const p=k+y[u];try{const u=I.sync(p,{pathExt:C});if(u){if(A.all)w.push(p);else return p}}catch(u){}}}if(A.all&&w.length)return w;if(A.nothrow)return null;throw getNotFoundError(u)};u.exports=which;which.sync=whichSync},6039:u=>{u.exports=wrappy;function wrappy(u,A){if(u&&A)return wrappy(u)(A);if(typeof u!=="function")throw new TypeError("need wrapper function");Object.keys(u).forEach((function(A){wrapper[A]=u[A]}));return wrapper;function wrapper(){var A=new Array(arguments.length);for(var p=0;p<A.length;p++){A[p]=arguments[p]}var y=u.apply(this,A);var E=A[A.length-1];if(typeof y==="function"&&y!==E){Object.keys(E).forEach((function(u){y[u]=E[u]}))}return y}}},1900:(u,A,p)=>{const{EMPTY_BUFFER:y}=p(4136);const E=Buffer[Symbol.species];function concat(u,A){if(u.length===0)return y;if(u.length===1)return u[0];const p=Buffer.allocUnsafe(A);let C=0;for(let A=0;A<u.length;A++){const y=u[A];p.set(y,C);C+=y.length}if(C<A){return new E(p.buffer,p.byteOffset,C)}return p}function _mask(u,A,p,y,E){for(let C=0;C<E;C++){p[y+C]=u[C]^A[C&3]}}function _unmask(u,A){for(let p=0;p<u.length;p++){u[p]^=A[p&3]}}function toArrayBuffer(u){if(u.length===u.buffer.byteLength){return u.buffer}return u.buffer.slice(u.byteOffset,u.byteOffset+u.length)}function toBuffer(u){toBuffer.readOnly=true;if(Buffer.isBuffer(u))return u;let A;if(u instanceof ArrayBuffer){A=new E(u)}else if(ArrayBuffer.isView(u)){A=new E(u.buffer,u.byteOffset,u.byteLength)}else{A=Buffer.from(u);toBuffer.readOnly=false}return A}u.exports={concat:concat,mask:_mask,toArrayBuffer:toArrayBuffer,toBuffer:toBuffer,unmask:_unmask};if(!process.env.WS_NO_BUFFER_UTIL){try{const A=p(8340);u.exports.mask=function(u,p,y,E,C){if(C<48)_mask(u,p,y,E,C);else A.mask(u,p,y,E,C)};u.exports.unmask=function(u,p){if(u.length<32)_unmask(u,p);else A.unmask(u,p)}}catch(u){}}},4136:u=>{const A=["nodebuffer","arraybuffer","fragments"];const p=typeof Blob!=="undefined";if(p)A.push("blob");u.exports={BINARY_TYPES:A,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:p,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}},7011:(u,A,p)=>{const{kForOnEventAttribute:y,kListener:E}=p(4136);const C=Symbol("kCode");const I=Symbol("kData");const w=Symbol("kError");const v=Symbol("kMessage");const B=Symbol("kReason");const S=Symbol("kTarget");const D=Symbol("kType");const k=Symbol("kWasClean");class Event{constructor(u){this[S]=null;this[D]=u}get target(){return this[S]}get type(){return this[D]}}Object.defineProperty(Event.prototype,"target",{enumerable:true});Object.defineProperty(Event.prototype,"type",{enumerable:true});class CloseEvent extends Event{constructor(u,A={}){super(u);this[C]=A.code===undefined?0:A.code;this[B]=A.reason===undefined?"":A.reason;this[k]=A.wasClean===undefined?false:A.wasClean}get code(){return this[C]}get reason(){return this[B]}get wasClean(){return this[k]}}Object.defineProperty(CloseEvent.prototype,"code",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"reason",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"wasClean",{enumerable:true});class ErrorEvent extends Event{constructor(u,A={}){super(u);this[w]=A.error===undefined?null:A.error;this[v]=A.message===undefined?"":A.message}get error(){return this[w]}get message(){return this[v]}}Object.defineProperty(ErrorEvent.prototype,"error",{enumerable:true});Object.defineProperty(ErrorEvent.prototype,"message",{enumerable:true});class MessageEvent extends Event{constructor(u,A={}){super(u);this[I]=A.data===undefined?null:A.data}get data(){return this[I]}}Object.defineProperty(MessageEvent.prototype,"data",{enumerable:true});const Q={addEventListener(u,A,p={}){for(const C of this.listeners(u)){if(!p[y]&&C[E]===A&&!C[y]){return}}let C;if(u==="message"){C=function onMessage(u,p){const y=new MessageEvent("message",{data:p?u:u.toString()});y[S]=this;callListener(A,this,y)}}else if(u==="close"){C=function onClose(u,p){const y=new CloseEvent("close",{code:u,reason:p.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});y[S]=this;callListener(A,this,y)}}else if(u==="error"){C=function onError(u){const p=new ErrorEvent("error",{error:u,message:u.message});p[S]=this;callListener(A,this,p)}}else if(u==="open"){C=function onOpen(){const u=new Event("open");u[S]=this;callListener(A,this,u)}}else{return}C[y]=!!p[y];C[E]=A;if(p.once){this.once(u,C)}else{this.on(u,C)}},removeEventListener(u,A){for(const p of this.listeners(u)){if(p[E]===A&&!p[y]){this.removeListener(u,p);break}}}};u.exports={CloseEvent:CloseEvent,ErrorEvent:ErrorEvent,Event:Event,EventTarget:Q,MessageEvent:MessageEvent};function callListener(u,A,p){if(typeof u==="object"&&u.handleEvent){u.handleEvent.call(u,p)}else{u.call(A,p)}}},7232:(u,A,p)=>{const{tokenChars:y}=p(2010);function push(u,A,p){if(u[A]===undefined)u[A]=[p];else u[A].push(p)}function parse(u){const A=Object.create(null);let p=Object.create(null);let E=false;let C=false;let I=false;let w;let v;let B=-1;let S=-1;let D=-1;let k=0;for(;k<u.length;k++){S=u.charCodeAt(k);if(w===undefined){if(D===-1&&y[S]===1){if(B===-1)B=k}else if(k!==0&&(S===32||S===9)){if(D===-1&&B!==-1)D=k}else if(S===59||S===44){if(B===-1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(D===-1)D=k;const y=u.slice(B,D);if(S===44){push(A,y,p);p=Object.create(null)}else{w=y}B=D=-1}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}else if(v===undefined){if(D===-1&&y[S]===1){if(B===-1)B=k}else if(S===32||S===9){if(D===-1&&B!==-1)D=k}else if(S===59||S===44){if(B===-1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(D===-1)D=k;push(p,u.slice(B,D),true);if(S===44){push(A,w,p);p=Object.create(null);w=undefined}B=D=-1}else if(S===61&&B!==-1&&D===-1){v=u.slice(B,k);B=D=-1}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}else{if(C){if(y[S]!==1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(B===-1)B=k;else if(!E)E=true;C=false}else if(I){if(y[S]===1){if(B===-1)B=k}else if(S===34&&B!==-1){I=false;D=k}else if(S===92){C=true}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}else if(S===34&&u.charCodeAt(k-1)===61){I=true}else if(D===-1&&y[S]===1){if(B===-1)B=k}else if(B!==-1&&(S===32||S===9)){if(D===-1)D=k}else if(S===59||S===44){if(B===-1){throw new SyntaxError(`Unexpected character at index ${k}`)}if(D===-1)D=k;let y=u.slice(B,D);if(E){y=y.replace(/\\/g,"");E=false}push(p,v,y);if(S===44){push(A,w,p);p=Object.create(null);w=undefined}v=undefined;B=D=-1}else{throw new SyntaxError(`Unexpected character at index ${k}`)}}}if(B===-1||I||S===32||S===9){throw new SyntaxError("Unexpected end of input")}if(D===-1)D=k;const Q=u.slice(B,D);if(w===undefined){push(A,Q,p)}else{if(v===undefined){push(p,Q,true)}else if(E){push(p,v,Q.replace(/\\/g,""))}else{push(p,v,Q)}push(A,w,p)}return A}function format(u){return Object.keys(u).map((A=>{let p=u[A];if(!Array.isArray(p))p=[p];return p.map((u=>[A].concat(Object.keys(u).map((A=>{let p=u[A];if(!Array.isArray(p))p=[p];return p.map((u=>u===true?A:`${A}=${u}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")}u.exports={format:format,parse:parse}},8293:u=>{const A=Symbol("kDone");const p=Symbol("kRun");class Limiter{constructor(u){this[A]=()=>{this.pending--;this[p]()};this.concurrency=u||Infinity;this.jobs=[];this.pending=0}add(u){this.jobs.push(u);this[p]()}[p](){if(this.pending===this.concurrency)return;if(this.jobs.length){const u=this.jobs.shift();this.pending++;u(this[A])}}}u.exports=Limiter},101:(u,A,p)=>{const y=p(3106);const E=p(1900);const C=p(8293);const{kStatusCode:I}=p(4136);const w=Buffer[Symbol.species];const v=Buffer.from([0,0,255,255]);const B=Symbol("permessage-deflate");const S=Symbol("total-length");const D=Symbol("callback");const k=Symbol("buffers");const Q=Symbol("error");let F;class PerMessageDeflate{constructor(u,A,p){this._maxPayload=p|0;this._options=u||{};this._threshold=this._options.threshold!==undefined?this._options.threshold:1024;this._isServer=!!A;this._deflate=null;this._inflate=null;this.params=null;if(!F){const u=this._options.concurrencyLimit!==undefined?this._options.concurrencyLimit:10;F=new C(u)}}static get extensionName(){return"permessage-deflate"}offer(){const u={};if(this._options.serverNoContextTakeover){u.server_no_context_takeover=true}if(this._options.clientNoContextTakeover){u.client_no_context_takeover=true}if(this._options.serverMaxWindowBits){u.server_max_window_bits=this._options.serverMaxWindowBits}if(this._options.clientMaxWindowBits){u.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits==null){u.client_max_window_bits=true}return u}accept(u){u=this.normalizeParams(u);this.params=this._isServer?this.acceptAsServer(u):this.acceptAsClient(u);return this.params}cleanup(){if(this._inflate){this._inflate.close();this._inflate=null}if(this._deflate){const u=this._deflate[D];this._deflate.close();this._deflate=null;if(u){u(new Error("The deflate stream was closed while data was being processed"))}}}acceptAsServer(u){const A=this._options;const p=u.find((u=>{if(A.serverNoContextTakeover===false&&u.server_no_context_takeover||u.server_max_window_bits&&(A.serverMaxWindowBits===false||typeof A.serverMaxWindowBits==="number"&&A.serverMaxWindowBits>u.server_max_window_bits)||typeof A.clientMaxWindowBits==="number"&&!u.client_max_window_bits){return false}return true}));if(!p){throw new Error("None of the extension offers can be accepted")}if(A.serverNoContextTakeover){p.server_no_context_takeover=true}if(A.clientNoContextTakeover){p.client_no_context_takeover=true}if(typeof A.serverMaxWindowBits==="number"){p.server_max_window_bits=A.serverMaxWindowBits}if(typeof A.clientMaxWindowBits==="number"){p.client_max_window_bits=A.clientMaxWindowBits}else if(p.client_max_window_bits===true||A.clientMaxWindowBits===false){delete p.client_max_window_bits}return p}acceptAsClient(u){const A=u[0];if(this._options.clientNoContextTakeover===false&&A.client_no_context_takeover){throw new Error('Unexpected parameter "client_no_context_takeover"')}if(!A.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number"){A.client_max_window_bits=this._options.clientMaxWindowBits}}else if(this._options.clientMaxWindowBits===false||typeof this._options.clientMaxWindowBits==="number"&&A.client_max_window_bits>this._options.clientMaxWindowBits){throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}return A}normalizeParams(u){u.forEach((u=>{Object.keys(u).forEach((A=>{let p=u[A];if(p.length>1){throw new Error(`Parameter "${A}" must have only a single value`)}p=p[0];if(A==="client_max_window_bits"){if(p!==true){const u=+p;if(!Number.isInteger(u)||u<8||u>15){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}p=u}else if(!this._isServer){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}}else if(A==="server_max_window_bits"){const u=+p;if(!Number.isInteger(u)||u<8||u>15){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}p=u}else if(A==="client_no_context_takeover"||A==="server_no_context_takeover"){if(p!==true){throw new TypeError(`Invalid value for parameter "${A}": ${p}`)}}else{throw new Error(`Unknown parameter "${A}"`)}u[A]=p}))}));return u}decompress(u,A,p){F.add((y=>{this._decompress(u,A,((u,A)=>{y();p(u,A)}))}))}compress(u,A,p){F.add((y=>{this._compress(u,A,((u,A)=>{y();p(u,A)}))}))}_decompress(u,A,p){const C=this._isServer?"client":"server";if(!this._inflate){const u=`${C}_max_window_bits`;const A=typeof this.params[u]!=="number"?y.Z_DEFAULT_WINDOWBITS:this.params[u];this._inflate=y.createInflateRaw({...this._options.zlibInflateOptions,windowBits:A});this._inflate[B]=this;this._inflate[S]=0;this._inflate[k]=[];this._inflate.on("error",inflateOnError);this._inflate.on("data",inflateOnData)}this._inflate[D]=p;this._inflate.write(u);if(A)this._inflate.write(v);this._inflate.flush((()=>{const u=this._inflate[Q];if(u){this._inflate.close();this._inflate=null;p(u);return}const y=E.concat(this._inflate[k],this._inflate[S]);if(this._inflate._readableState.endEmitted){this._inflate.close();this._inflate=null}else{this._inflate[S]=0;this._inflate[k]=[];if(A&&this.params[`${C}_no_context_takeover`]){this._inflate.reset()}}p(null,y)}))}_compress(u,A,p){const C=this._isServer?"server":"client";if(!this._deflate){const u=`${C}_max_window_bits`;const A=typeof this.params[u]!=="number"?y.Z_DEFAULT_WINDOWBITS:this.params[u];this._deflate=y.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:A});this._deflate[S]=0;this._deflate[k]=[];this._deflate.on("data",deflateOnData)}this._deflate[D]=p;this._deflate.write(u);this._deflate.flush(y.Z_SYNC_FLUSH,(()=>{if(!this._deflate){return}let u=E.concat(this._deflate[k],this._deflate[S]);if(A){u=new w(u.buffer,u.byteOffset,u.length-4)}this._deflate[D]=null;this._deflate[S]=0;this._deflate[k]=[];if(A&&this.params[`${C}_no_context_takeover`]){this._deflate.reset()}p(null,u)}))}}u.exports=PerMessageDeflate;function deflateOnData(u){this[k].push(u);this[S]+=u.length}function inflateOnData(u){this[S]+=u.length;if(this[B]._maxPayload<1||this[S]<=this[B]._maxPayload){this[k].push(u);return}this[Q]=new RangeError("Max payload size exceeded");this[Q].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH";this[Q][I]=1009;this.removeListener("data",inflateOnData);this.reset()}function inflateOnError(u){this[B]._inflate=null;if(this[Q]){this[D](this[Q]);return}u[I]=1007;this[D](u)}},5372:(u,A,p)=>{const{Writable:y}=p(2203);const E=p(101);const{BINARY_TYPES:C,EMPTY_BUFFER:I,kStatusCode:w,kWebSocket:v}=p(4136);const{concat:B,toArrayBuffer:S,unmask:D}=p(1900);const{isValidStatusCode:k,isValidUTF8:Q}=p(2010);const F=Buffer[Symbol.species];const R=0;const _=1;const P=2;const O=3;const U=4;const H=5;const G=6;class Receiver extends y{constructor(u={}){super();this._allowSynchronousEvents=u.allowSynchronousEvents!==undefined?u.allowSynchronousEvents:true;this._binaryType=u.binaryType||C[0];this._extensions=u.extensions||{};this._isServer=!!u.isServer;this._maxPayload=u.maxPayload|0;this._skipUTF8Validation=!!u.skipUTF8Validation;this[v]=undefined;this._bufferedBytes=0;this._buffers=[];this._compressed=false;this._payloadLength=0;this._mask=undefined;this._fragmented=0;this._masked=false;this._fin=false;this._opcode=0;this._totalPayloadLength=0;this._messageLength=0;this._fragments=[];this._errored=false;this._loop=false;this._state=R}_write(u,A,p){if(this._opcode===8&&this._state==R)return p();this._bufferedBytes+=u.length;this._buffers.push(u);this.startLoop(p)}consume(u){this._bufferedBytes-=u;if(u===this._buffers[0].length)return this._buffers.shift();if(u<this._buffers[0].length){const A=this._buffers[0];this._buffers[0]=new F(A.buffer,A.byteOffset+u,A.length-u);return new F(A.buffer,A.byteOffset,u)}const A=Buffer.allocUnsafe(u);do{const p=this._buffers[0];const y=A.length-u;if(u>=p.length){A.set(this._buffers.shift(),y)}else{A.set(new Uint8Array(p.buffer,p.byteOffset,u),y);this._buffers[0]=new F(p.buffer,p.byteOffset+u,p.length-u)}u-=p.length}while(u>0);return A}startLoop(u){this._loop=true;do{switch(this._state){case R:this.getInfo(u);break;case _:this.getPayloadLength16(u);break;case P:this.getPayloadLength64(u);break;case O:this.getMask();break;case U:this.getData(u);break;case H:case G:this._loop=false;return}}while(this._loop);if(!this._errored)u()}getInfo(u){if(this._bufferedBytes<2){this._loop=false;return}const A=this.consume(2);if((A[0]&48)!==0){const A=this.createError(RangeError,"RSV2 and RSV3 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_2_3");u(A);return}const p=(A[0]&64)===64;if(p&&!this._extensions[E.extensionName]){const A=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");u(A);return}this._fin=(A[0]&128)===128;this._opcode=A[0]&15;this._payloadLength=A[1]&127;if(this._opcode===0){if(p){const A=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");u(A);return}if(!this._fragmented){const A=this.createError(RangeError,"invalid opcode 0",true,1002,"WS_ERR_INVALID_OPCODE");u(A);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){const A=this.createError(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE");u(A);return}this._compressed=p}else if(this._opcode>7&&this._opcode<11){if(!this._fin){const A=this.createError(RangeError,"FIN must be set",true,1002,"WS_ERR_EXPECTED_FIN");u(A);return}if(p){const A=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");u(A);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){const A=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,true,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");u(A);return}}else{const A=this.createError(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE");u(A);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;this._masked=(A[1]&128)===128;if(this._isServer){if(!this._masked){const A=this.createError(RangeError,"MASK must be set",true,1002,"WS_ERR_EXPECTED_MASK");u(A);return}}else if(this._masked){const A=this.createError(RangeError,"MASK must be clear",true,1002,"WS_ERR_UNEXPECTED_MASK");u(A);return}if(this._payloadLength===126)this._state=_;else if(this._payloadLength===127)this._state=P;else this.haveLength(u)}getPayloadLength16(u){if(this._bufferedBytes<2){this._loop=false;return}this._payloadLength=this.consume(2).readUInt16BE(0);this.haveLength(u)}getPayloadLength64(u){if(this._bufferedBytes<8){this._loop=false;return}const A=this.consume(8);const p=A.readUInt32BE(0);if(p>Math.pow(2,53-32)-1){const A=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",false,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");u(A);return}this._payloadLength=p*Math.pow(2,32)+A.readUInt32BE(4);this.haveLength(u)}haveLength(u){if(this._payloadLength&&this._opcode<8){this._totalPayloadLength+=this._payloadLength;if(this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){const A=this.createError(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");u(A);return}}if(this._masked)this._state=O;else this._state=U}getMask(){if(this._bufferedBytes<4){this._loop=false;return}this._mask=this.consume(4);this._state=U}getData(u){let A=I;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=false;return}A=this.consume(this._payloadLength);if(this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0){D(A,this._mask)}}if(this._opcode>7){this.controlMessage(A,u);return}if(this._compressed){this._state=H;this.decompress(A,u);return}if(A.length){this._messageLength=this._totalPayloadLength;this._fragments.push(A)}this.dataMessage(u)}decompress(u,A){const p=this._extensions[E.extensionName];p.decompress(u,this._fin,((u,p)=>{if(u)return A(u);if(p.length){this._messageLength+=p.length;if(this._messageLength>this._maxPayload&&this._maxPayload>0){const u=this.createError(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");A(u);return}this._fragments.push(p)}this.dataMessage(A);if(this._state===R)this.startLoop(A)}))}dataMessage(u){if(!this._fin){this._state=R;return}const A=this._messageLength;const p=this._fragments;this._totalPayloadLength=0;this._messageLength=0;this._fragmented=0;this._fragments=[];if(this._opcode===2){let y;if(this._binaryType==="nodebuffer"){y=B(p,A)}else if(this._binaryType==="arraybuffer"){y=S(B(p,A))}else if(this._binaryType==="blob"){y=new Blob(p)}else{y=p}if(this._allowSynchronousEvents){this.emit("message",y,true);this._state=R}else{this._state=G;setImmediate((()=>{this.emit("message",y,true);this._state=R;this.startLoop(u)}))}}else{const y=B(p,A);if(!this._skipUTF8Validation&&!Q(y)){const A=this.createError(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8");u(A);return}if(this._state===H||this._allowSynchronousEvents){this.emit("message",y,false);this._state=R}else{this._state=G;setImmediate((()=>{this.emit("message",y,false);this._state=R;this.startLoop(u)}))}}}controlMessage(u,A){if(this._opcode===8){if(u.length===0){this._loop=false;this.emit("conclude",1005,I);this.end()}else{const p=u.readUInt16BE(0);if(!k(p)){const u=this.createError(RangeError,`invalid status code ${p}`,true,1002,"WS_ERR_INVALID_CLOSE_CODE");A(u);return}const y=new F(u.buffer,u.byteOffset+2,u.length-2);if(!this._skipUTF8Validation&&!Q(y)){const u=this.createError(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8");A(u);return}this._loop=false;this.emit("conclude",p,y);this.end()}this._state=R;return}if(this._allowSynchronousEvents){this.emit(this._opcode===9?"ping":"pong",u);this._state=R}else{this._state=G;setImmediate((()=>{this.emit(this._opcode===9?"ping":"pong",u);this._state=R;this.startLoop(A)}))}}createError(u,A,p,y,E){this._loop=false;this._errored=true;const C=new u(p?`Invalid WebSocket frame: ${A}`:A);Error.captureStackTrace(C,this.createError);C.code=E;C[w]=y;return C}}u.exports=Receiver},6996:(u,A,p)=>{const{Duplex:y}=p(2203);const{randomFillSync:E}=p(6982);const C=p(101);const{EMPTY_BUFFER:I,kWebSocket:w,NOOP:v}=p(4136);const{isBlob:B,isValidStatusCode:S}=p(2010);const{mask:D,toBuffer:k}=p(1900);const Q=Symbol("kByteLength");const F=Buffer.alloc(4);const R=8*1024;let _;let P=R;const O=0;const U=1;const H=2;class Sender{constructor(u,A,p){this._extensions=A||{};if(p){this._generateMask=p;this._maskBuffer=Buffer.alloc(4)}this._socket=u;this._firstFragment=true;this._compress=false;this._bufferedBytes=0;this._queue=[];this._state=O;this.onerror=v;this[w]=undefined}static frame(u,A){let p;let y=false;let C=2;let I=false;if(A.mask){p=A.maskBuffer||F;if(A.generateMask){A.generateMask(p)}else{if(P===R){if(_===undefined){_=Buffer.alloc(R)}E(_,0,R);P=0}p[0]=_[P++];p[1]=_[P++];p[2]=_[P++];p[3]=_[P++]}I=(p[0]|p[1]|p[2]|p[3])===0;C=6}let w;if(typeof u==="string"){if((!A.mask||I)&&A[Q]!==undefined){w=A[Q]}else{u=Buffer.from(u);w=u.length}}else{w=u.length;y=A.mask&&A.readOnly&&!I}let v=w;if(w>=65536){C+=8;v=127}else if(w>125){C+=2;v=126}const B=Buffer.allocUnsafe(y?w+C:C);B[0]=A.fin?A.opcode|128:A.opcode;if(A.rsv1)B[0]|=64;B[1]=v;if(v===126){B.writeUInt16BE(w,2)}else if(v===127){B[2]=B[3]=0;B.writeUIntBE(w,4,6)}if(!A.mask)return[B,u];B[1]|=128;B[C-4]=p[0];B[C-3]=p[1];B[C-2]=p[2];B[C-1]=p[3];if(I)return[B,u];if(y){D(u,p,B,C,w);return[B]}D(u,p,u,0,w);return[B,u]}close(u,A,p,y){let E;if(u===undefined){E=I}else if(typeof u!=="number"||!S(u)){throw new TypeError("First argument must be a valid error code number")}else if(A===undefined||!A.length){E=Buffer.allocUnsafe(2);E.writeUInt16BE(u,0)}else{const p=Buffer.byteLength(A);if(p>123){throw new RangeError("The message must not be greater than 123 bytes")}E=Buffer.allocUnsafe(2+p);E.writeUInt16BE(u,0);if(typeof A==="string"){E.write(A,2)}else{E.set(A,2)}}const C={[Q]:E.length,fin:true,generateMask:this._generateMask,mask:p,maskBuffer:this._maskBuffer,opcode:8,readOnly:false,rsv1:false};if(this._state!==O){this.enqueue([this.dispatch,E,false,C,y])}else{this.sendFrame(Sender.frame(E,C),y)}}ping(u,A,p){let y;let E;if(typeof u==="string"){y=Buffer.byteLength(u);E=false}else if(B(u)){y=u.size;E=false}else{u=k(u);y=u.length;E=k.readOnly}if(y>125){throw new RangeError("The data size must not be greater than 125 bytes")}const C={[Q]:y,fin:true,generateMask:this._generateMask,mask:A,maskBuffer:this._maskBuffer,opcode:9,readOnly:E,rsv1:false};if(B(u)){if(this._state!==O){this.enqueue([this.getBlobData,u,false,C,p])}else{this.getBlobData(u,false,C,p)}}else if(this._state!==O){this.enqueue([this.dispatch,u,false,C,p])}else{this.sendFrame(Sender.frame(u,C),p)}}pong(u,A,p){let y;let E;if(typeof u==="string"){y=Buffer.byteLength(u);E=false}else if(B(u)){y=u.size;E=false}else{u=k(u);y=u.length;E=k.readOnly}if(y>125){throw new RangeError("The data size must not be greater than 125 bytes")}const C={[Q]:y,fin:true,generateMask:this._generateMask,mask:A,maskBuffer:this._maskBuffer,opcode:10,readOnly:E,rsv1:false};if(B(u)){if(this._state!==O){this.enqueue([this.getBlobData,u,false,C,p])}else{this.getBlobData(u,false,C,p)}}else if(this._state!==O){this.enqueue([this.dispatch,u,false,C,p])}else{this.sendFrame(Sender.frame(u,C),p)}}send(u,A,p){const y=this._extensions[C.extensionName];let E=A.binary?2:1;let I=A.compress;let w;let v;if(typeof u==="string"){w=Buffer.byteLength(u);v=false}else if(B(u)){w=u.size;v=false}else{u=k(u);w=u.length;v=k.readOnly}if(this._firstFragment){this._firstFragment=false;if(I&&y&&y.params[y._isServer?"server_no_context_takeover":"client_no_context_takeover"]){I=w>=y._threshold}this._compress=I}else{I=false;E=0}if(A.fin)this._firstFragment=true;const S={[Q]:w,fin:A.fin,generateMask:this._generateMask,mask:A.mask,maskBuffer:this._maskBuffer,opcode:E,readOnly:v,rsv1:I};if(B(u)){if(this._state!==O){this.enqueue([this.getBlobData,u,this._compress,S,p])}else{this.getBlobData(u,this._compress,S,p)}}else if(this._state!==O){this.enqueue([this.dispatch,u,this._compress,S,p])}else{this.dispatch(u,this._compress,S,p)}}getBlobData(u,A,p,y){this._bufferedBytes+=p[Q];this._state=H;u.arrayBuffer().then((u=>{if(this._socket.destroyed){const u=new Error("The socket was closed while the blob was being read");process.nextTick(callCallbacks,this,u,y);return}this._bufferedBytes-=p[Q];const E=k(u);if(!A){this._state=O;this.sendFrame(Sender.frame(E,p),y);this.dequeue()}else{this.dispatch(E,A,p,y)}})).catch((u=>{process.nextTick(onError,this,u,y)}))}dispatch(u,A,p,y){if(!A){this.sendFrame(Sender.frame(u,p),y);return}const E=this._extensions[C.extensionName];this._bufferedBytes+=p[Q];this._state=U;E.compress(u,p.fin,((u,A)=>{if(this._socket.destroyed){const u=new Error("The socket was closed while data was being compressed");callCallbacks(this,u,y);return}this._bufferedBytes-=p[Q];this._state=O;p.readOnly=false;this.sendFrame(Sender.frame(A,p),y);this.dequeue()}))}dequeue(){while(this._state===O&&this._queue.length){const u=this._queue.shift();this._bufferedBytes-=u[3][Q];Reflect.apply(u[0],this,u.slice(1))}}enqueue(u){this._bufferedBytes+=u[3][Q];this._queue.push(u)}sendFrame(u,A){if(u.length===2){this._socket.cork();this._socket.write(u[0]);this._socket.write(u[1],A);this._socket.uncork()}else{this._socket.write(u[0],A)}}}u.exports=Sender;function callCallbacks(u,A,p){if(typeof p==="function")p(A);for(let p=0;p<u._queue.length;p++){const y=u._queue[p];const E=y[y.length-1];if(typeof E==="function")E(A)}}function onError(u,A,p){callCallbacks(u,A,p);u.onerror(A)}},213:(u,A,p)=>{const y=p(7494);const{Duplex:E}=p(2203);function emitClose(u){u.emit("close")}function duplexOnEnd(){if(!this.destroyed&&this._writableState.finished){this.destroy()}}function duplexOnError(u){this.removeListener("error",duplexOnError);this.destroy();if(this.listenerCount("error")===0){this.emit("error",u)}}function createWebSocketStream(u,A){let p=true;const y=new E({...A,autoDestroy:false,emitClose:false,objectMode:false,writableObjectMode:false});u.on("message",(function message(A,p){const E=!p&&y._readableState.objectMode?A.toString():A;if(!y.push(E))u.pause()}));u.once("error",(function error(u){if(y.destroyed)return;p=false;y.destroy(u)}));u.once("close",(function close(){if(y.destroyed)return;y.push(null)}));y._destroy=function(A,E){if(u.readyState===u.CLOSED){E(A);process.nextTick(emitClose,y);return}let C=false;u.once("error",(function error(u){C=true;E(u)}));u.once("close",(function close(){if(!C)E(A);process.nextTick(emitClose,y)}));if(p)u.terminate()};y._final=function(A){if(u.readyState===u.CONNECTING){u.once("open",(function open(){y._final(A)}));return}if(u._socket===null)return;if(u._socket._writableState.finished){A();if(y._readableState.endEmitted)y.destroy()}else{u._socket.once("finish",(function finish(){A()}));u.close()}};y._read=function(){if(u.isPaused)u.resume()};y._write=function(A,p,E){if(u.readyState===u.CONNECTING){u.once("open",(function open(){y._write(A,p,E)}));return}u.send(A,E)};y.on("end",duplexOnEnd);y.on("error",duplexOnError);return y}u.exports=createWebSocketStream},7747:(u,A,p)=>{const{tokenChars:y}=p(2010);function parse(u){const A=new Set;let p=-1;let E=-1;let C=0;for(C;C<u.length;C++){const I=u.charCodeAt(C);if(E===-1&&y[I]===1){if(p===-1)p=C}else if(C!==0&&(I===32||I===9)){if(E===-1&&p!==-1)E=C}else if(I===44){if(p===-1){throw new SyntaxError(`Unexpected character at index ${C}`)}if(E===-1)E=C;const y=u.slice(p,E);if(A.has(y)){throw new SyntaxError(`The "${y}" subprotocol is duplicated`)}A.add(y);p=E=-1}else{throw new SyntaxError(`Unexpected character at index ${C}`)}}if(p===-1||E!==-1){throw new SyntaxError("Unexpected end of input")}const I=u.slice(p,C);if(A.has(I)){throw new SyntaxError(`The "${I}" subprotocol is duplicated`)}A.add(I);return A}u.exports={parse:parse}},2010:(u,A,p)=>{const{isUtf8:y}=p(181);const{hasBlob:E}=p(4136);const C=[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 isValidStatusCode(u){return u>=1e3&&u<=1014&&u!==1004&&u!==1005&&u!==1006||u>=3e3&&u<=4999}function _isValidUTF8(u){const A=u.length;let p=0;while(p<A){if((u[p]&128)===0){p++}else if((u[p]&224)===192){if(p+1===A||(u[p+1]&192)!==128||(u[p]&254)===192){return false}p+=2}else if((u[p]&240)===224){if(p+2>=A||(u[p+1]&192)!==128||(u[p+2]&192)!==128||u[p]===224&&(u[p+1]&224)===128||u[p]===237&&(u[p+1]&224)===160){return false}p+=3}else if((u[p]&248)===240){if(p+3>=A||(u[p+1]&192)!==128||(u[p+2]&192)!==128||(u[p+3]&192)!==128||u[p]===240&&(u[p+1]&240)===128||u[p]===244&&u[p+1]>143||u[p]>244){return false}p+=4}else{return false}}return true}function isBlob(u){return E&&typeof u==="object"&&typeof u.arrayBuffer==="function"&&typeof u.type==="string"&&typeof u.stream==="function"&&(u[Symbol.toStringTag]==="Blob"||u[Symbol.toStringTag]==="File")}u.exports={isBlob:isBlob,isValidStatusCode:isValidStatusCode,isValidUTF8:_isValidUTF8,tokenChars:C};if(y){u.exports.isValidUTF8=function(u){return u.length<24?_isValidUTF8(u):y(u)}}else if(!process.env.WS_NO_UTF_8_VALIDATE){try{const A=p(2461);u.exports.isValidUTF8=function(u){return u.length<32?_isValidUTF8(u):A(u)}}catch(u){}}},544:(u,A,p)=>{const y=p(4434);const E=p(8611);const{Duplex:C}=p(2203);const{createHash:I}=p(6982);const w=p(7232);const v=p(101);const B=p(7747);const S=p(7494);const{GUID:D,kWebSocket:k}=p(4136);const Q=/^[+/0-9A-Za-z]{22}==$/;const F=0;const R=1;const _=2;class WebSocketServer extends y{constructor(u,A){super();u={allowSynchronousEvents:true,autoPong:true,maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:false,handleProtocols:null,clientTracking:true,verifyClient:null,noServer:false,backlog:null,server:null,host:null,path:null,port:null,WebSocket:S,...u};if(u.port==null&&!u.server&&!u.noServer||u.port!=null&&(u.server||u.noServer)||u.server&&u.noServer){throw new TypeError('One and only one of the "port", "server", or "noServer" options '+"must be specified")}if(u.port!=null){this._server=E.createServer(((u,A)=>{const p=E.STATUS_CODES[426];A.writeHead(426,{"Content-Length":p.length,"Content-Type":"text/plain"});A.end(p)}));this._server.listen(u.port,u.host,u.backlog,A)}else if(u.server){this._server=u.server}if(this._server){const u=this.emit.bind(this,"connection");this._removeListeners=addListeners(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(A,p,y)=>{this.handleUpgrade(A,p,y,u)}})}if(u.perMessageDeflate===true)u.perMessageDeflate={};if(u.clientTracking){this.clients=new Set;this._shouldEmitClose=false}this.options=u;this._state=F}address(){if(this.options.noServer){throw new Error('The server is operating in "noServer" mode')}if(!this._server)return null;return this._server.address()}close(u){if(this._state===_){if(u){this.once("close",(()=>{u(new Error("The server is not running"))}))}process.nextTick(emitClose,this);return}if(u)this.once("close",u);if(this._state===R)return;this._state=R;if(this.options.noServer||this.options.server){if(this._server){this._removeListeners();this._removeListeners=this._server=null}if(this.clients){if(!this.clients.size){process.nextTick(emitClose,this)}else{this._shouldEmitClose=true}}else{process.nextTick(emitClose,this)}}else{const u=this._server;this._removeListeners();this._removeListeners=this._server=null;u.close((()=>{emitClose(this)}))}}shouldHandle(u){if(this.options.path){const A=u.url.indexOf("?");const p=A!==-1?u.url.slice(0,A):u.url;if(p!==this.options.path)return false}return true}handleUpgrade(u,A,p,y){A.on("error",socketOnError);const E=u.headers["sec-websocket-key"];const C=u.headers.upgrade;const I=+u.headers["sec-websocket-version"];if(u.method!=="GET"){const p="Invalid HTTP method";abortHandshakeOrEmitwsClientError(this,u,A,405,p);return}if(C===undefined||C.toLowerCase()!=="websocket"){const p="Invalid Upgrade header";abortHandshakeOrEmitwsClientError(this,u,A,400,p);return}if(E===undefined||!Q.test(E)){const p="Missing or invalid Sec-WebSocket-Key header";abortHandshakeOrEmitwsClientError(this,u,A,400,p);return}if(I!==13&&I!==8){const p="Missing or invalid Sec-WebSocket-Version header";abortHandshakeOrEmitwsClientError(this,u,A,400,p,{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(u)){abortHandshake(A,400);return}const S=u.headers["sec-websocket-protocol"];let D=new Set;if(S!==undefined){try{D=B.parse(S)}catch(p){const y="Invalid Sec-WebSocket-Protocol header";abortHandshakeOrEmitwsClientError(this,u,A,400,y);return}}const k=u.headers["sec-websocket-extensions"];const F={};if(this.options.perMessageDeflate&&k!==undefined){const p=new v(this.options.perMessageDeflate,true,this.options.maxPayload);try{const u=w.parse(k);if(u[v.extensionName]){p.accept(u[v.extensionName]);F[v.extensionName]=p}}catch(p){const y="Invalid or unacceptable Sec-WebSocket-Extensions header";abortHandshakeOrEmitwsClientError(this,u,A,400,y);return}}if(this.options.verifyClient){const C={origin:u.headers[`${I===8?"sec-websocket-origin":"origin"}`],secure:!!(u.socket.authorized||u.socket.encrypted),req:u};if(this.options.verifyClient.length===2){this.options.verifyClient(C,((C,I,w,v)=>{if(!C){return abortHandshake(A,I||401,w,v)}this.completeUpgrade(F,E,D,u,A,p,y)}));return}if(!this.options.verifyClient(C))return abortHandshake(A,401)}this.completeUpgrade(F,E,D,u,A,p,y)}completeUpgrade(u,A,p,y,E,C,B){if(!E.readable||!E.writable)return E.destroy();if(E[k]){throw new Error("server.handleUpgrade() was called more than once with the same "+"socket, possibly due to a misconfiguration")}if(this._state>F)return abortHandshake(E,503);const S=I("sha1").update(A+D).digest("base64");const Q=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${S}`];const R=new this.options.WebSocket(null,undefined,this.options);if(p.size){const u=this.options.handleProtocols?this.options.handleProtocols(p,y):p.values().next().value;if(u){Q.push(`Sec-WebSocket-Protocol: ${u}`);R._protocol=u}}if(u[v.extensionName]){const A=u[v.extensionName].params;const p=w.format({[v.extensionName]:[A]});Q.push(`Sec-WebSocket-Extensions: ${p}`);R._extensions=u}this.emit("headers",Q,y);E.write(Q.concat("\r\n").join("\r\n"));E.removeListener("error",socketOnError);R.setSocket(E,C,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation});if(this.clients){this.clients.add(R);R.on("close",(()=>{this.clients.delete(R);if(this._shouldEmitClose&&!this.clients.size){process.nextTick(emitClose,this)}}))}B(R,y)}}u.exports=WebSocketServer;function addListeners(u,A){for(const p of Object.keys(A))u.on(p,A[p]);return function removeListeners(){for(const p of Object.keys(A)){u.removeListener(p,A[p])}}}function emitClose(u){u._state=_;u.emit("close")}function socketOnError(){this.destroy()}function abortHandshake(u,A,p,y){p=p||E.STATUS_CODES[A];y={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(p),...y};u.once("finish",u.destroy);u.end(`HTTP/1.1 ${A} ${E.STATUS_CODES[A]}\r\n`+Object.keys(y).map((u=>`${u}: ${y[u]}`)).join("\r\n")+"\r\n\r\n"+p)}function abortHandshakeOrEmitwsClientError(u,A,p,y,E,C){if(u.listenerCount("wsClientError")){const y=new Error(E);Error.captureStackTrace(y,abortHandshakeOrEmitwsClientError);u.emit("wsClientError",y,p,A)}else{abortHandshake(p,y,E,C)}}},7494:(u,A,p)=>{const y=p(4434);const E=p(5692);const C=p(8611);const I=p(9278);const w=p(4756);const{randomBytes:v,createHash:B}=p(6982);const{Duplex:S,Readable:D}=p(2203);const{URL:k}=p(7016);const Q=p(101);const F=p(5372);const R=p(6996);const{isBlob:_}=p(2010);const{BINARY_TYPES:P,EMPTY_BUFFER:O,GUID:U,kForOnEventAttribute:H,kListener:G,kStatusCode:j,kWebSocket:$,NOOP:q}=p(4136);const{EventTarget:{addEventListener:K,removeEventListener:J}}=p(7011);const{format:ee,parse:te}=p(7232);const{toBuffer:ne}=p(1900);const re=30*1e3;const se=Symbol("kAborted");const ie=[8,13];const oe=["CONNECTING","OPEN","CLOSING","CLOSED"];const ae=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class WebSocket extends y{constructor(u,A,p){super();this._binaryType=P[0];this._closeCode=1006;this._closeFrameReceived=false;this._closeFrameSent=false;this._closeMessage=O;this._closeTimer=null;this._errorEmitted=false;this._extensions={};this._paused=false;this._protocol="";this._readyState=WebSocket.CONNECTING;this._receiver=null;this._sender=null;this._socket=null;if(u!==null){this._bufferedAmount=0;this._isServer=false;this._redirects=0;if(A===undefined){A=[]}else if(!Array.isArray(A)){if(typeof A==="object"&&A!==null){p=A;A=[]}else{A=[A]}}initAsClient(this,u,A,p)}else{this._autoPong=p.autoPong;this._isServer=true}}get binaryType(){return this._binaryType}set binaryType(u){if(!P.includes(u))return;this._binaryType=u;if(this._receiver)this._receiver._binaryType=u}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}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(u,A,p){const y=new F({allowSynchronousEvents:p.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:p.maxPayload,skipUTF8Validation:p.skipUTF8Validation});const E=new R(u,this._extensions,p.generateMask);this._receiver=y;this._sender=E;this._socket=u;y[$]=this;E[$]=this;u[$]=this;y.on("conclude",receiverOnConclude);y.on("drain",receiverOnDrain);y.on("error",receiverOnError);y.on("message",receiverOnMessage);y.on("ping",receiverOnPing);y.on("pong",receiverOnPong);E.onerror=senderOnError;if(u.setTimeout)u.setTimeout(0);if(u.setNoDelay)u.setNoDelay();if(A.length>0)u.unshift(A);u.on("close",socketOnClose);u.on("data",socketOnData);u.on("end",socketOnEnd);u.on("error",socketOnError);this._readyState=WebSocket.OPEN;this.emit("open")}emitClose(){if(!this._socket){this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[Q.extensionName]){this._extensions[Q.extensionName].cleanup()}this._receiver.removeAllListeners();this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage)}close(u,A){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const u="WebSocket was closed before the connection was established";abortHandshake(this,this._req,u);return}if(this.readyState===WebSocket.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)){this._socket.end()}return}this._readyState=WebSocket.CLOSING;this._sender.close(u,A,!this._isServer,(u=>{if(u)return;this._closeFrameSent=true;if(this._closeFrameReceived||this._receiver._writableState.errorEmitted){this._socket.end()}}));setCloseTimer(this)}pause(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=true;this._socket.pause()}ping(u,A,p){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof u==="function"){p=u;u=A=undefined}else if(typeof A==="function"){p=A;A=undefined}if(typeof u==="number")u=u.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,u,p);return}if(A===undefined)A=!this._isServer;this._sender.ping(u||O,A,p)}pong(u,A,p){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof u==="function"){p=u;u=A=undefined}else if(typeof A==="function"){p=A;A=undefined}if(typeof u==="number")u=u.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,u,p);return}if(A===undefined)A=!this._isServer;this._sender.pong(u||O,A,p)}resume(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=false;if(!this._receiver._writableState.needDrain)this._socket.resume()}send(u,A,p){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof A==="function"){p=A;A={}}if(typeof u==="number")u=u.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,u,p);return}const y={binary:typeof u!=="string",mask:!this._isServer,compress:true,fin:true,...A};if(!this._extensions[Q.extensionName]){y.compress=false}this._sender.send(u||O,y,p)}terminate(){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const u="WebSocket was closed before the connection was established";abortHandshake(this,this._req,u);return}if(this._socket){this._readyState=WebSocket.CLOSING;this._socket.destroy()}}}Object.defineProperty(WebSocket,"CONNECTING",{enumerable:true,value:oe.indexOf("CONNECTING")});Object.defineProperty(WebSocket.prototype,"CONNECTING",{enumerable:true,value:oe.indexOf("CONNECTING")});Object.defineProperty(WebSocket,"OPEN",{enumerable:true,value:oe.indexOf("OPEN")});Object.defineProperty(WebSocket.prototype,"OPEN",{enumerable:true,value:oe.indexOf("OPEN")});Object.defineProperty(WebSocket,"CLOSING",{enumerable:true,value:oe.indexOf("CLOSING")});Object.defineProperty(WebSocket.prototype,"CLOSING",{enumerable:true,value:oe.indexOf("CLOSING")});Object.defineProperty(WebSocket,"CLOSED",{enumerable:true,value:oe.indexOf("CLOSED")});Object.defineProperty(WebSocket.prototype,"CLOSED",{enumerable:true,value:oe.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((u=>{Object.defineProperty(WebSocket.prototype,u,{enumerable:true})}));["open","error","close","message"].forEach((u=>{Object.defineProperty(WebSocket.prototype,`on${u}`,{enumerable:true,get(){for(const A of this.listeners(u)){if(A[H])return A[G]}return null},set(A){for(const A of this.listeners(u)){if(A[H]){this.removeListener(u,A);break}}if(typeof A!=="function")return;this.addEventListener(u,A,{[H]:true})}})}));WebSocket.prototype.addEventListener=K;WebSocket.prototype.removeEventListener=J;u.exports=WebSocket;function initAsClient(u,A,p,y){const I={allowSynchronousEvents:true,autoPong:true,protocolVersion:ie[1],maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:true,followRedirects:false,maxRedirects:10,...y,socketPath:undefined,hostname:undefined,protocol:undefined,timeout:undefined,method:"GET",host:undefined,path:undefined,port:undefined};u._autoPong=I.autoPong;if(!ie.includes(I.protocolVersion)){throw new RangeError(`Unsupported protocol version: ${I.protocolVersion} `+`(supported versions: ${ie.join(", ")})`)}let w;if(A instanceof k){w=A}else{try{w=new k(A)}catch(u){throw new SyntaxError(`Invalid URL: ${A}`)}}if(w.protocol==="http:"){w.protocol="ws:"}else if(w.protocol==="https:"){w.protocol="wss:"}u._url=w.href;const S=w.protocol==="wss:";const D=w.protocol==="ws+unix:";let F;if(w.protocol!=="ws:"&&!S&&!D){F='The URL\'s protocol must be one of "ws:", "wss:", '+'"http:", "https:", or "ws+unix:"'}else if(D&&!w.pathname){F="The URL's pathname is empty"}else if(w.hash){F="The URL contains a fragment identifier"}if(F){const A=new SyntaxError(F);if(u._redirects===0){throw A}else{emitErrorAndClose(u,A);return}}const R=S?443:80;const _=v(16).toString("base64");const P=S?E.request:C.request;const O=new Set;let H;I.createConnection=I.createConnection||(S?tlsConnect:netConnect);I.defaultPort=I.defaultPort||R;I.port=w.port||R;I.host=w.hostname.startsWith("[")?w.hostname.slice(1,-1):w.hostname;I.headers={...I.headers,"Sec-WebSocket-Version":I.protocolVersion,"Sec-WebSocket-Key":_,Connection:"Upgrade",Upgrade:"websocket"};I.path=w.pathname+w.search;I.timeout=I.handshakeTimeout;if(I.perMessageDeflate){H=new Q(I.perMessageDeflate!==true?I.perMessageDeflate:{},false,I.maxPayload);I.headers["Sec-WebSocket-Extensions"]=ee({[Q.extensionName]:H.offer()})}if(p.length){for(const u of p){if(typeof u!=="string"||!ae.test(u)||O.has(u)){throw new SyntaxError("An invalid or duplicated subprotocol was specified")}O.add(u)}I.headers["Sec-WebSocket-Protocol"]=p.join(",")}if(I.origin){if(I.protocolVersion<13){I.headers["Sec-WebSocket-Origin"]=I.origin}else{I.headers.Origin=I.origin}}if(w.username||w.password){I.auth=`${w.username}:${w.password}`}if(D){const u=I.path.split(":");I.socketPath=u[0];I.path=u[1]}let G;if(I.followRedirects){if(u._redirects===0){u._originalIpc=D;u._originalSecure=S;u._originalHostOrSocketPath=D?I.socketPath:w.host;const A=y&&y.headers;y={...y,headers:{}};if(A){for(const[u,p]of Object.entries(A)){y.headers[u.toLowerCase()]=p}}}else if(u.listenerCount("redirect")===0){const A=D?u._originalIpc?I.socketPath===u._originalHostOrSocketPath:false:u._originalIpc?false:w.host===u._originalHostOrSocketPath;if(!A||u._originalSecure&&!S){delete I.headers.authorization;delete I.headers.cookie;if(!A)delete I.headers.host;I.auth=undefined}}if(I.auth&&!y.headers.authorization){y.headers.authorization="Basic "+Buffer.from(I.auth).toString("base64")}G=u._req=P(I);if(u._redirects){u.emit("redirect",u.url,G)}}else{G=u._req=P(I)}if(I.timeout){G.on("timeout",(()=>{abortHandshake(u,G,"Opening handshake has timed out")}))}G.on("error",(A=>{if(G===null||G[se])return;G=u._req=null;emitErrorAndClose(u,A)}));G.on("response",(E=>{const C=E.headers.location;const w=E.statusCode;if(C&&I.followRedirects&&w>=300&&w<400){if(++u._redirects>I.maxRedirects){abortHandshake(u,G,"Maximum redirects exceeded");return}G.abort();let E;try{E=new k(C,A)}catch(A){const p=new SyntaxError(`Invalid URL: ${C}`);emitErrorAndClose(u,p);return}initAsClient(u,E,p,y)}else if(!u.emit("unexpected-response",G,E)){abortHandshake(u,G,`Unexpected server response: ${E.statusCode}`)}}));G.on("upgrade",((A,p,y)=>{u.emit("upgrade",A);if(u.readyState!==WebSocket.CONNECTING)return;G=u._req=null;const E=A.headers.upgrade;if(E===undefined||E.toLowerCase()!=="websocket"){abortHandshake(u,p,"Invalid Upgrade header");return}const C=B("sha1").update(_+U).digest("base64");if(A.headers["sec-websocket-accept"]!==C){abortHandshake(u,p,"Invalid Sec-WebSocket-Accept header");return}const w=A.headers["sec-websocket-protocol"];let v;if(w!==undefined){if(!O.size){v="Server sent a subprotocol but none was requested"}else if(!O.has(w)){v="Server sent an invalid subprotocol"}}else if(O.size){v="Server sent no subprotocol"}if(v){abortHandshake(u,p,v);return}if(w)u._protocol=w;const S=A.headers["sec-websocket-extensions"];if(S!==undefined){if(!H){const A="Server sent a Sec-WebSocket-Extensions header but no extension "+"was requested";abortHandshake(u,p,A);return}let A;try{A=te(S)}catch(A){const y="Invalid Sec-WebSocket-Extensions header";abortHandshake(u,p,y);return}const y=Object.keys(A);if(y.length!==1||y[0]!==Q.extensionName){const A="Server indicated an extension that was not requested";abortHandshake(u,p,A);return}try{H.accept(A[Q.extensionName])}catch(A){const y="Invalid Sec-WebSocket-Extensions header";abortHandshake(u,p,y);return}u._extensions[Q.extensionName]=H}u.setSocket(p,y,{allowSynchronousEvents:I.allowSynchronousEvents,generateMask:I.generateMask,maxPayload:I.maxPayload,skipUTF8Validation:I.skipUTF8Validation})}));if(I.finishRequest){I.finishRequest(G,u)}else{G.end()}}function emitErrorAndClose(u,A){u._readyState=WebSocket.CLOSING;u._errorEmitted=true;u.emit("error",A);u.emitClose()}function netConnect(u){u.path=u.socketPath;return I.connect(u)}function tlsConnect(u){u.path=undefined;if(!u.servername&&u.servername!==""){u.servername=I.isIP(u.host)?"":u.host}return w.connect(u)}function abortHandshake(u,A,p){u._readyState=WebSocket.CLOSING;const y=new Error(p);Error.captureStackTrace(y,abortHandshake);if(A.setHeader){A[se]=true;A.abort();if(A.socket&&!A.socket.destroyed){A.socket.destroy()}process.nextTick(emitErrorAndClose,u,y)}else{A.destroy(y);A.once("error",u.emit.bind(u,"error"));A.once("close",u.emitClose.bind(u))}}function sendAfterClose(u,A,p){if(A){const p=_(A)?A.size:ne(A).length;if(u._socket)u._sender._bufferedBytes+=p;else u._bufferedAmount+=p}if(p){const A=new Error(`WebSocket is not open: readyState ${u.readyState} `+`(${oe[u.readyState]})`);process.nextTick(p,A)}}function receiverOnConclude(u,A){const p=this[$];p._closeFrameReceived=true;p._closeMessage=A;p._closeCode=u;if(p._socket[$]===undefined)return;p._socket.removeListener("data",socketOnData);process.nextTick(resume,p._socket);if(u===1005)p.close();else p.close(u,A)}function receiverOnDrain(){const u=this[$];if(!u.isPaused)u._socket.resume()}function receiverOnError(u){const A=this[$];if(A._socket[$]!==undefined){A._socket.removeListener("data",socketOnData);process.nextTick(resume,A._socket);A.close(u[j])}if(!A._errorEmitted){A._errorEmitted=true;A.emit("error",u)}}function receiverOnFinish(){this[$].emitClose()}function receiverOnMessage(u,A){this[$].emit("message",u,A)}function receiverOnPing(u){const A=this[$];if(A._autoPong)A.pong(u,!this._isServer,q);A.emit("ping",u)}function receiverOnPong(u){this[$].emit("pong",u)}function resume(u){u.resume()}function senderOnError(u){const A=this[$];if(A.readyState===WebSocket.CLOSED)return;if(A.readyState===WebSocket.OPEN){A._readyState=WebSocket.CLOSING;setCloseTimer(A)}this._socket.end();if(!A._errorEmitted){A._errorEmitted=true;A.emit("error",u)}}function setCloseTimer(u){u._closeTimer=setTimeout(u._socket.destroy.bind(u._socket),re)}function socketOnClose(){const u=this[$];this.removeListener("close",socketOnClose);this.removeListener("data",socketOnData);this.removeListener("end",socketOnEnd);u._readyState=WebSocket.CLOSING;let A;if(!this._readableState.endEmitted&&!u._closeFrameReceived&&!u._receiver._writableState.errorEmitted&&(A=u._socket.read())!==null){u._receiver.write(A)}u._receiver.end();this[$]=undefined;clearTimeout(u._closeTimer);if(u._receiver._writableState.finished||u._receiver._writableState.errorEmitted){u.emitClose()}else{u._receiver.on("error",receiverOnFinish);u._receiver.on("finish",receiverOnFinish)}}function socketOnData(u){if(!this[$]._receiver.write(u)){this.pause()}}function socketOnEnd(){const u=this[$];u._readyState=WebSocket.CLOSING;u._receiver.end();this.end()}function socketOnError(){const u=this[$];this.removeListener("error",socketOnError);this.on("error",q);if(u){u._readyState=WebSocket.CLOSING;this.destroy()}}},6793:u=>{u.exports=function(u){u.prototype[Symbol.iterator]=function*(){for(let u=this.head;u;u=u.next){yield u.value}}}},2305:(u,A,p)=>{u.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(u){var A=this;if(!(A instanceof Yallist)){A=new Yallist}A.tail=null;A.head=null;A.length=0;if(u&&typeof u.forEach==="function"){u.forEach((function(u){A.push(u)}))}else if(arguments.length>0){for(var p=0,y=arguments.length;p<y;p++){A.push(arguments[p])}}return A}Yallist.prototype.removeNode=function(u){if(u.list!==this){throw new Error("removing node which does not belong to this list")}var A=u.next;var p=u.prev;if(A){A.prev=p}if(p){p.next=A}if(u===this.head){this.head=A}if(u===this.tail){this.tail=p}u.list.length--;u.next=null;u.prev=null;u.list=null;return A};Yallist.prototype.unshiftNode=function(u){if(u===this.head){return}if(u.list){u.list.removeNode(u)}var A=this.head;u.list=this;u.next=A;if(A){A.prev=u}this.head=u;if(!this.tail){this.tail=u}this.length++};Yallist.prototype.pushNode=function(u){if(u===this.tail){return}if(u.list){u.list.removeNode(u)}var A=this.tail;u.list=this;u.prev=A;if(A){A.next=u}this.tail=u;if(!this.head){this.head=u}this.length++};Yallist.prototype.push=function(){for(var u=0,A=arguments.length;u<A;u++){push(this,arguments[u])}return this.length};Yallist.prototype.unshift=function(){for(var u=0,A=arguments.length;u<A;u++){unshift(this,arguments[u])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var u=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return u};Yallist.prototype.shift=function(){if(!this.head){return undefined}var u=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return u};Yallist.prototype.forEach=function(u,A){A=A||this;for(var p=this.head,y=0;p!==null;y++){u.call(A,p.value,y,this);p=p.next}};Yallist.prototype.forEachReverse=function(u,A){A=A||this;for(var p=this.tail,y=this.length-1;p!==null;y--){u.call(A,p.value,y,this);p=p.prev}};Yallist.prototype.get=function(u){for(var A=0,p=this.head;p!==null&&A<u;A++){p=p.next}if(A===u&&p!==null){return p.value}};Yallist.prototype.getReverse=function(u){for(var A=0,p=this.tail;p!==null&&A<u;A++){p=p.prev}if(A===u&&p!==null){return p.value}};Yallist.prototype.map=function(u,A){A=A||this;var p=new Yallist;for(var y=this.head;y!==null;){p.push(u.call(A,y.value,this));y=y.next}return p};Yallist.prototype.mapReverse=function(u,A){A=A||this;var p=new Yallist;for(var y=this.tail;y!==null;){p.push(u.call(A,y.value,this));y=y.prev}return p};Yallist.prototype.reduce=function(u,A){var p;var y=this.head;if(arguments.length>1){p=A}else if(this.head){y=this.head.next;p=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var E=0;y!==null;E++){p=u(p,y.value,E);y=y.next}return p};Yallist.prototype.reduceReverse=function(u,A){var p;var y=this.tail;if(arguments.length>1){p=A}else if(this.tail){y=this.tail.prev;p=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var E=this.length-1;y!==null;E--){p=u(p,y.value,E);y=y.prev}return p};Yallist.prototype.toArray=function(){var u=new Array(this.length);for(var A=0,p=this.head;p!==null;A++){u[A]=p.value;p=p.next}return u};Yallist.prototype.toArrayReverse=function(){var u=new Array(this.length);for(var A=0,p=this.tail;p!==null;A++){u[A]=p.value;p=p.prev}return u};Yallist.prototype.slice=function(u,A){A=A||this.length;if(A<0){A+=this.length}u=u||0;if(u<0){u+=this.length}var p=new Yallist;if(A<u||A<0){return p}if(u<0){u=0}if(A>this.length){A=this.length}for(var y=0,E=this.head;E!==null&&y<u;y++){E=E.next}for(;E!==null&&y<A;y++,E=E.next){p.push(E.value)}return p};Yallist.prototype.sliceReverse=function(u,A){A=A||this.length;if(A<0){A+=this.length}u=u||0;if(u<0){u+=this.length}var p=new Yallist;if(A<u||A<0){return p}if(u<0){u=0}if(A>this.length){A=this.length}for(var y=this.length,E=this.tail;E!==null&&y>A;y--){E=E.prev}for(;E!==null&&y>u;y--,E=E.prev){p.push(E.value)}return p};Yallist.prototype.splice=function(u,A,...p){if(u>this.length){u=this.length-1}if(u<0){u=this.length+u}for(var y=0,E=this.head;E!==null&&y<u;y++){E=E.next}var C=[];for(var y=0;E&&y<A;y++){C.push(E.value);E=this.removeNode(E)}if(E===null){E=this.tail}if(E!==this.head&&E!==this.tail){E=E.prev}for(var y=0;y<p.length;y++){E=insert(this,E,p[y])}return C};Yallist.prototype.reverse=function(){var u=this.head;var A=this.tail;for(var p=u;p!==null;p=p.prev){var y=p.prev;p.prev=p.next;p.next=y}this.head=A;this.tail=u;return this};function insert(u,A,p){var y=A===u.head?new Node(p,null,A,u):new Node(p,A,A.next,u);if(y.next===null){u.tail=y}if(y.prev===null){u.head=y}u.length++;return y}function push(u,A){u.tail=new Node(A,u.tail,null,u);if(!u.head){u.head=u.tail}u.length++}function unshift(u,A){u.head=new Node(A,null,u.head,u);if(!u.tail){u.tail=u.head}u.length++}function Node(u,A,p,y){if(!(this instanceof Node)){return new Node(u,A,p,y)}this.list=y;this.value=u;if(A){A.next=this;this.prev=A}else{this.prev=null}if(p){p.prev=this;this.next=p}else{this.next=null}}try{p(6793)(Yallist)}catch(u){}},7955:(u,A,p)=>{var y=p(9896);var E=p(3106);var C=p(3749);var I=p(7215);var w=p(9023);var v=p(4434).EventEmitter;var B=p(2203).Transform;var S=p(2203).PassThrough;var D=p(2203).Writable;A.open=open;A.fromFd=fromFd;A.fromBuffer=fromBuffer;A.fromRandomAccessReader=fromRandomAccessReader;A.dosDateTimeToDate=dosDateTimeToDate;A.validateFileName=validateFileName;A.ZipFile=ZipFile;A.Entry=Entry;A.RandomAccessReader=RandomAccessReader;function open(u,A,p){if(typeof A==="function"){p=A;A=null}if(A==null)A={};if(A.autoClose==null)A.autoClose=true;if(A.lazyEntries==null)A.lazyEntries=false;if(A.decodeStrings==null)A.decodeStrings=true;if(A.validateEntrySizes==null)A.validateEntrySizes=true;if(A.strictFileNames==null)A.strictFileNames=false;if(p==null)p=defaultCallback;y.open(u,"r",(function(u,E){if(u)return p(u);fromFd(E,A,(function(u,A){if(u)y.close(E,defaultCallback);p(u,A)}))}))}function fromFd(u,A,p){if(typeof A==="function"){p=A;A=null}if(A==null)A={};if(A.autoClose==null)A.autoClose=false;if(A.lazyEntries==null)A.lazyEntries=false;if(A.decodeStrings==null)A.decodeStrings=true;if(A.validateEntrySizes==null)A.validateEntrySizes=true;if(A.strictFileNames==null)A.strictFileNames=false;if(p==null)p=defaultCallback;y.fstat(u,(function(y,E){if(y)return p(y);var I=C.createFromFd(u,{autoClose:true});fromRandomAccessReader(I,E.size,A,p)}))}function fromBuffer(u,A,p){if(typeof A==="function"){p=A;A=null}if(A==null)A={};A.autoClose=false;if(A.lazyEntries==null)A.lazyEntries=false;if(A.decodeStrings==null)A.decodeStrings=true;if(A.validateEntrySizes==null)A.validateEntrySizes=true;if(A.strictFileNames==null)A.strictFileNames=false;var y=C.createFromBuffer(u,{maxChunkSize:65536});fromRandomAccessReader(y,u.length,A,p)}function fromRandomAccessReader(u,A,p,y){if(typeof p==="function"){y=p;p=null}if(p==null)p={};if(p.autoClose==null)p.autoClose=true;if(p.lazyEntries==null)p.lazyEntries=false;if(p.decodeStrings==null)p.decodeStrings=true;var E=!!p.decodeStrings;if(p.validateEntrySizes==null)p.validateEntrySizes=true;if(p.strictFileNames==null)p.strictFileNames=false;if(y==null)y=defaultCallback;if(typeof A!=="number")throw new Error("expected totalSize parameter to be a number");if(A>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}u.ref();var C=22;var I=65535;var w=Math.min(C+I,A);var v=Q(w);var B=A-v.length;readAndAssertNoEof(u,v,0,w,B,(function(I){if(I)return y(I);for(var S=w-C;S>=0;S-=1){if(v.readUInt32LE(S)!==101010256)continue;var D=v.slice(S);var k=D.readUInt16LE(4);if(k!==0){return y(new Error("multi-disk zip files are not supported: found disk number: "+k))}var F=D.readUInt16LE(10);var R=D.readUInt32LE(16);var _=D.readUInt16LE(20);var P=D.length-C;if(_!==P){return y(new Error("invalid comment length. expected: "+P+". found: "+_))}var O=E?decodeBuffer(D,22,D.length,false):D.slice(22);if(!(F===65535||R===4294967295)){return y(null,new ZipFile(u,R,A,F,O,p.autoClose,p.lazyEntries,E,p.validateEntrySizes,p.strictFileNames))}var U=Q(20);var H=B+S-U.length;readAndAssertNoEof(u,U,0,U.length,H,(function(C){if(C)return y(C);if(U.readUInt32LE(0)!==117853008){return y(new Error("invalid zip64 end of central directory locator signature"))}var I=readUInt64LE(U,8);var w=Q(56);readAndAssertNoEof(u,w,0,w.length,I,(function(C){if(C)return y(C);if(w.readUInt32LE(0)!==101075792){return y(new Error("invalid zip64 end of central directory record signature"))}F=readUInt64LE(w,32);R=readUInt64LE(w,48);return y(null,new ZipFile(u,R,A,F,O,p.autoClose,p.lazyEntries,E,p.validateEntrySizes,p.strictFileNames))}))}));return}y(new Error("end of central directory record signature not found"))}))}w.inherits(ZipFile,v);function ZipFile(u,A,p,y,E,C,I,w,B,S){var D=this;v.call(D);D.reader=u;D.reader.on("error",(function(u){emitError(D,u)}));D.reader.once("close",(function(){D.emit("close")}));D.readEntryCursor=A;D.fileSize=p;D.entryCount=y;D.comment=E;D.entriesRead=0;D.autoClose=!!C;D.lazyEntries=!!I;D.decodeStrings=!!w;D.validateEntrySizes=!!B;D.strictFileNames=!!S;D.isOpen=true;D.emittedError=false;if(!D.lazyEntries)D._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(u,A){if(u.autoClose)u.close();emitError(u,A)}function emitError(u,A){if(u.emittedError)return;u.emittedError=true;u.emit("error",A)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var u=this;if(u.entryCount===u.entriesRead){setImmediate((function(){if(u.autoClose)u.close();if(u.emittedError)return;u.emit("end")}));return}if(u.emittedError)return;var A=Q(46);readAndAssertNoEof(u.reader,A,0,A.length,u.readEntryCursor,(function(p){if(p)return emitErrorAndAutoClose(u,p);if(u.emittedError)return;var y=new Entry;var E=A.readUInt32LE(0);if(E!==33639248)return emitErrorAndAutoClose(u,new Error("invalid central directory file header signature: 0x"+E.toString(16)));y.versionMadeBy=A.readUInt16LE(4);y.versionNeededToExtract=A.readUInt16LE(6);y.generalPurposeBitFlag=A.readUInt16LE(8);y.compressionMethod=A.readUInt16LE(10);y.lastModFileTime=A.readUInt16LE(12);y.lastModFileDate=A.readUInt16LE(14);y.crc32=A.readUInt32LE(16);y.compressedSize=A.readUInt32LE(20);y.uncompressedSize=A.readUInt32LE(24);y.fileNameLength=A.readUInt16LE(28);y.extraFieldLength=A.readUInt16LE(30);y.fileCommentLength=A.readUInt16LE(32);y.internalFileAttributes=A.readUInt16LE(36);y.externalFileAttributes=A.readUInt32LE(38);y.relativeOffsetOfLocalHeader=A.readUInt32LE(42);if(y.generalPurposeBitFlag&64)return emitErrorAndAutoClose(u,new Error("strong encryption is not supported"));u.readEntryCursor+=46;A=Q(y.fileNameLength+y.extraFieldLength+y.fileCommentLength);readAndAssertNoEof(u.reader,A,0,A.length,u.readEntryCursor,(function(p){if(p)return emitErrorAndAutoClose(u,p);if(u.emittedError)return;var E=(y.generalPurposeBitFlag&2048)!==0;y.fileName=u.decodeStrings?decodeBuffer(A,0,y.fileNameLength,E):A.slice(0,y.fileNameLength);var C=y.fileNameLength+y.extraFieldLength;var w=A.slice(y.fileNameLength,C);y.extraFields=[];var v=0;while(v<w.length-3){var B=w.readUInt16LE(v+0);var S=w.readUInt16LE(v+2);var D=v+4;var k=D+S;if(k>w.length)return emitErrorAndAutoClose(u,new Error("extra field length exceeds extra field buffer size"));var F=Q(S);w.copy(F,0,D,k);y.extraFields.push({id:B,data:F});v=k}y.fileComment=u.decodeStrings?decodeBuffer(A,C,C+y.fileCommentLength,E):A.slice(C,C+y.fileCommentLength);y.comment=y.fileComment;u.readEntryCursor+=A.length;u.entriesRead+=1;if(y.uncompressedSize===4294967295||y.compressedSize===4294967295||y.relativeOffsetOfLocalHeader===4294967295){var R=null;for(var v=0;v<y.extraFields.length;v++){var _=y.extraFields[v];if(_.id===1){R=_.data;break}}if(R==null){return emitErrorAndAutoClose(u,new Error("expected zip64 extended information extra field"))}var P=0;if(y.uncompressedSize===4294967295){if(P+8>R.length){return emitErrorAndAutoClose(u,new Error("zip64 extended information extra field does not include uncompressed size"))}y.uncompressedSize=readUInt64LE(R,P);P+=8}if(y.compressedSize===4294967295){if(P+8>R.length){return emitErrorAndAutoClose(u,new Error("zip64 extended information extra field does not include compressed size"))}y.compressedSize=readUInt64LE(R,P);P+=8}if(y.relativeOffsetOfLocalHeader===4294967295){if(P+8>R.length){return emitErrorAndAutoClose(u,new Error("zip64 extended information extra field does not include relative header offset"))}y.relativeOffsetOfLocalHeader=readUInt64LE(R,P);P+=8}}if(u.decodeStrings){for(var v=0;v<y.extraFields.length;v++){var _=y.extraFields[v];if(_.id===28789){if(_.data.length<6){continue}if(_.data.readUInt8(0)!==1){continue}var O=_.data.readUInt32LE(1);if(I.unsigned(A.slice(0,y.fileNameLength))!==O){continue}y.fileName=decodeBuffer(_.data,5,_.data.length,true);break}}}if(u.validateEntrySizes&&y.compressionMethod===0){var U=y.uncompressedSize;if(y.isEncrypted()){U+=12}if(y.compressedSize!==U){var H="compressed/uncompressed size mismatch for stored file: "+y.compressedSize+" != "+y.uncompressedSize;return emitErrorAndAutoClose(u,new Error(H))}}if(u.decodeStrings){if(!u.strictFileNames){y.fileName=y.fileName.replace(/\\/g,"/")}var G=validateFileName(y.fileName,u.validateFileNameOptions);if(G!=null)return emitErrorAndAutoClose(u,new Error(G))}u.emit("entry",y);if(!u.lazyEntries)u._readEntry()}))}))};ZipFile.prototype.openReadStream=function(u,A,p){var y=this;var C=0;var I=u.compressedSize;if(p==null){p=A;A={}}else{if(A.decrypt!=null){if(!u.isEncrypted()){throw new Error("options.decrypt can only be specified for encrypted entries")}if(A.decrypt!==false)throw new Error("invalid options.decrypt value: "+A.decrypt);if(u.isCompressed()){if(A.decompress!==false)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(A.decompress!=null){if(!u.isCompressed()){throw new Error("options.decompress can only be specified for compressed entries")}if(!(A.decompress===false||A.decompress===true)){throw new Error("invalid options.decompress value: "+A.decompress)}}if(A.start!=null||A.end!=null){if(u.isCompressed()&&A.decompress!==false){throw new Error("start/end range not allowed for compressed entry without options.decompress === false")}if(u.isEncrypted()&&A.decrypt!==false){throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}}if(A.start!=null){C=A.start;if(C<0)throw new Error("options.start < 0");if(C>u.compressedSize)throw new Error("options.start > entry.compressedSize")}if(A.end!=null){I=A.end;if(I<0)throw new Error("options.end < 0");if(I>u.compressedSize)throw new Error("options.end > entry.compressedSize");if(I<C)throw new Error("options.end < options.start")}}if(!y.isOpen)return p(new Error("closed"));if(u.isEncrypted()){if(A.decrypt!==false)return p(new Error("entry is encrypted, and options.decrypt !== false"))}y.reader.ref();var w=Q(30);readAndAssertNoEof(y.reader,w,0,w.length,u.relativeOffsetOfLocalHeader,(function(v){try{if(v)return p(v);var B=w.readUInt32LE(0);if(B!==67324752){return p(new Error("invalid local file header signature: 0x"+B.toString(16)))}var S=w.readUInt16LE(26);var D=w.readUInt16LE(28);var k=u.relativeOffsetOfLocalHeader+w.length+S+D;var Q;if(u.compressionMethod===0){Q=false}else if(u.compressionMethod===8){Q=A.decompress!=null?A.decompress:true}else{return p(new Error("unsupported compression method: "+u.compressionMethod))}var F=k;var R=F+u.compressedSize;if(u.compressedSize!==0){if(R>y.fileSize){return p(new Error("file data overflows file bounds: "+F+" + "+u.compressedSize+" > "+y.fileSize))}}var _=y.reader.createReadStream({start:F+C,end:F+I});var P=_;if(Q){var O=false;var U=E.createInflateRaw();_.on("error",(function(u){setImmediate((function(){if(!O)U.emit("error",u)}))}));_.pipe(U);if(y.validateEntrySizes){P=new AssertByteCountStream(u.uncompressedSize);U.on("error",(function(u){setImmediate((function(){if(!O)P.emit("error",u)}))}));U.pipe(P)}else{P=U}P.destroy=function(){O=true;if(U!==P)U.unpipe(P);_.unpipe(U);_.destroy()}}p(null,P)}finally{y.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(u,A){var p=u&31;var y=(u>>5&15)-1;var E=(u>>9&127)+1980;var C=0;var I=(A&31)*2;var w=A>>5&63;var v=A>>11&31;return new Date(E,y,p,v,w,I,C)}function validateFileName(u){if(u.indexOf("\\")!==-1){return"invalid characters in fileName: "+u}if(/^[a-zA-Z]:/.test(u)||/^\//.test(u)){return"absolute path: "+u}if(u.split("/").indexOf("..")!==-1){return"invalid relative path: "+u}return null}function readAndAssertNoEof(u,A,p,y,E,C){if(y===0){return setImmediate((function(){C(null,Q(0))}))}u.read(A,p,y,E,(function(u,A){if(u)return C(u);if(A<y){return C(new Error("unexpected EOF"))}C()}))}w.inherits(AssertByteCountStream,B);function AssertByteCountStream(u){B.call(this);this.actualByteCount=0;this.expectedByteCount=u}AssertByteCountStream.prototype._transform=function(u,A,p){this.actualByteCount+=u.length;if(this.actualByteCount>this.expectedByteCount){var y="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return p(new Error(y))}p(null,u)};AssertByteCountStream.prototype._flush=function(u){if(this.actualByteCount<this.expectedByteCount){var A="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return u(new Error(A))}u()};w.inherits(RandomAccessReader,v);function RandomAccessReader(){v.call(this);this.refCount=0}RandomAccessReader.prototype.ref=function(){this.refCount+=1};RandomAccessReader.prototype.unref=function(){var u=this;u.refCount-=1;if(u.refCount>0)return;if(u.refCount<0)throw new Error("invalid unref");u.close(onCloseDone);function onCloseDone(A){if(A)return u.emit("error",A);u.emit("close")}};RandomAccessReader.prototype.createReadStream=function(u){var A=u.start;var p=u.end;if(A===p){var y=new S;setImmediate((function(){y.end()}));return y}var E=this._readStreamForRange(A,p);var C=false;var I=new RefUnrefFilter(this);E.on("error",(function(u){setImmediate((function(){if(!C)I.emit("error",u)}))}));I.destroy=function(){E.unpipe(I);I.unref();E.destroy()};var w=new AssertByteCountStream(p-A);I.on("error",(function(u){setImmediate((function(){if(!C)w.emit("error",u)}))}));w.destroy=function(){C=true;I.unpipe(w);I.destroy()};return E.pipe(I).pipe(w)};RandomAccessReader.prototype._readStreamForRange=function(u,A){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(u,A,p,y,E){var C=this.createReadStream({start:y,end:y+p});var I=new D;var w=0;I._write=function(p,y,E){p.copy(u,A+w,0,p.length);w+=p.length;E()};I.on("finish",E);C.on("error",(function(u){E(u)}));C.pipe(I)};RandomAccessReader.prototype.close=function(u){setImmediate(u)};w.inherits(RefUnrefFilter,S);function RefUnrefFilter(u){S.call(this);this.context=u;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(u){this.unref();u()};RefUnrefFilter.prototype.unref=function(u){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var k="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(u,A,p,y){if(y){return u.toString("utf8",A,p)}else{var E="";for(var C=A;C<p;C++){E+=k[u[C]]}return E}}function readUInt64LE(u,A){var p=u.readUInt32LE(A);var y=u.readUInt32LE(A+4);return y*4294967296+p}var Q;if(typeof Buffer.allocUnsafe==="function"){Q=function(u){return Buffer.allocUnsafe(u)}}else{Q=function(u){return new Buffer(u)}}function defaultCallback(u){if(u)throw u}},5983:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{q:()=>App});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(6256);var B=p(1184);var S=p(9402);var D=p(5420);var k=p(7765);var Q=p(7208);var F=p(2618);var R=p(3746);var _=p(3425);var P=u([w,v,B,S,D,k,Q,R,_]);[w,v,B,S,D,k,Q,R,_]=P.then?(await P)():P;const App=({autonomous:u=false})=>{const{coreState:A,coreViewModel:p,agentStatus:y,isAutonomous:I,toggleAutonomous:P,pendingShellCommand:O,approveShellCommand:U,rejectShellCommand:H,approveDiff:G,rejectDiff:j,submitUserInput:$,searchFiles:q,activeShellCommand:K,handleShellCompletion:J,childProcess:ee,sendInputToShell:te,inputText:ne,setInputText:re,isShellActive:se,setIsShellActive:ie,cancelCurrentInteraction:oe}=(0,F.f)({autonomous:u});const[ae,le]=(0,C.useState)(false);const[ce,ue]=(0,C.useState)(false);(0,w.Ge)(((u,A)=>{if(A.ctrl&&(u==="t"||u==="T")||u===""){P();return}if(se){if(A.ctrl&&u==="c"){te("");return}if(A.return){te("\n");return}if(A.backspace){te("\b");return}if(u){te(u);return}return}if(A.escape&&y.isVisible){oe();return}if(A.ctrl&&u==="c"){if(ce){process.exit(0)}else{ue(true)}}else{ue(false)}}));const handleSubmit=(u,A)=>{$(u,A)};(0,C.useEffect)((()=>{if(K){ie(true)}else{ie(false)}}),[K]);const de=!p.activeDiffReview&&!O&&!A.isBootstrapping&&!y.isVisible;const fe=A.bootstrapFinished?p.staticMessages.filter((u=>!u.isBootstrap)):p.staticMessages;return(0,E.jsxs)(w.az,{flexDirection:"column",width:"100%",height:"100%",children:[!A.bootstrapFinished?(0,E.jsx)(_.A,{status:A.connectionStatus,isBootstrapping:A.isBootstrapping}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(B.s,{messages:fe,liveAgentMessage:p.liveAgentMessage,activeShellRun:p.activeShellRun,activeDiffReview:p.activeDiffReview,onShellComplete:J,childProcess:ee,sendInputToShell:te,onApproveDiff:G,onRejectDiff:j}),O&&(0,E.jsx)(Q.A,{command:O.parameters.command,onApprove:U,onReject:H}),y.isVisible&&(0,E.jsx)(v.A,{isVisible:y.isVisible,text:y.text}),ae&&(0,E.jsx)(R.A,{}),(0,E.jsx)(k.A,{isActive:de,isShellActive:se,isAutonomous:I,onSubmit:handleSubmit,searchFiles:q,value:ne,onChange:re,setShowEscapeClear:le})]}),(0,E.jsx)(D.A,{isAutonomous:I}),ce&&(0,E.jsx)(S.A,{})]})};y()}catch(u){y(u)}}))},3352:(u,A,p)=>{p.a(u,(async(u,A)=>{try{var y=p(9790);var E=p(5184);var C=p(4302);var I=p(5983);var w=p(786);var v=p(6878);var B=u([E,I]);[E,I]=B.then?(await B)():B;const S=(0,C.A)(`\n\tUsage\n\t $ stk-codegen\n\n\tOptions\n\t --autonomous Run in autonomous mode\n`,{importMeta:import.meta,flags:{autonomous:{type:"boolean",default:false}}});const startCli=async u=>{await(0,w.x)();const restoreTerminal=()=>{if(process.stdin.isTTY){process.stdin.setRawMode(false)}};if(process.stdin.isTTY){process.stdin.setRawMode(true)}const A=(0,E.XX)((0,y.jsx)(I.q,{autonomous:u.autonomous}),{exitOnCtrlC:false,maxFps:45,incrementalRendering:v.$.ENABLE_INCREMENTAL_RENDERING});try{await A.waitUntilExit()}finally{restoreTerminal();process.exit(0)}};startCli(S.flags);A()}catch(u){A(u)}}))},6256:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(9930);var w=u([C,I]);[C,I]=w.then?(await w)():w;const AgentStatus=({isVisible:u,text:A="Agent is thinking..."})=>{if(!u){return null}return(0,E.jsxs)(C.az,{borderColor:"#800020",children:[(0,E.jsx)(I.A,{type:"dots"}),(0,E.jsx)(C.az,{marginLeft:1,children:(0,E.jsxs)(C.EY,{color:"#ff8080",children:[A," (esc to cancel)"]})})]})};const v=AgentStatus;y()}catch(u){y(u)}}))},3425:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(9930);var w=u([C,I]);[C,I]=w.then?(await w)():w;const BootstrapStatus=({status:u,isBootstrapping:A})=>{let p="";if(u==="connecting"){p="Conectando ao servidor..."}else if(A){p="Carregando contexto do projeto. Isso pode levar alguns segundos..."}return(0,E.jsx)(C.az,{flexDirection:"column",alignItems:"center",paddingY:1,children:(0,E.jsx)(C.az,{children:(0,E.jsxs)(C.EY,{children:[(0,E.jsx)(I.A,{type:"dots"}),(0,E.jsx)(C.EY,{children:" "}),p]})})})};const v=BootstrapStatus;y()}catch(u){y(u)}}))},1184:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{s:()=>Conversation});var E=p(9790);var C=p(5184);var I=p(727);var w=p(3480);var v=p(313);var B=p(6183);var S=p(2113);var D=u([C,I,w,v,B,S]);[C,I,w,v,B,S]=D.then?(await D)():D;const renderStaticMessage=(u,A)=>{if(u.role==="tool_execution"){return(0,E.jsx)(S.A,{toolName:u.toolName,toolParams:u.toolParams,status:u.status},u.id)}return(0,E.jsx)(w.e,{message:{id:u.id,sender:u.role,text:u.text,status:"completed",highlightedBlock:u.highlightedBlock},activeShellCommand:undefined,childProcess:null,handleShellCompletion:A},u.id)};const LiveAgentMessageView=({liveAgentMessage:u,onShellComplete:A})=>(0,E.jsx)(w.e,{message:{id:u.id,sender:u.role,text:u.text,status:"running",stream:{status:"streaming"},highlightedBlock:u.highlightedBlock},activeShellCommand:undefined,childProcess:null,handleShellCompletion:A},u.id);const Conversation=({messages:u,liveAgentMessage:A,activeShellRun:p,activeDiffReview:y,onShellComplete:w,childProcess:S,onApproveDiff:D,onRejectDiff:k})=>(0,E.jsxs)(I.P,{children:[(0,E.jsx)(C.jC,{items:u,children:u=>renderStaticMessage(u,w)}),A&&(0,E.jsx)(LiveAgentMessageView,{liveAgentMessage:A,onShellComplete:w}),p&&(0,E.jsx)(v.A,{command:p.command,onComplete:w,childProcess:S,coreShellRun:p}),y&&(0,E.jsx)(B.Ay,{toolName:y.toolName,toolParams:y.toolParams,oldContent:y.oldContent,newContent:y.newContent,onApprove:D,onReject:k,isCompleted:false,coreDiffReview:y})]});y()}catch(u){y(u)}}))},6183:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{Ay:()=>F});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(4104);var B=p(4536);var S=p(4378);var D=u([w]);w=(D.then?(await D)():D)[0];const k=500;const Q=3;const normalizeContent=u=>u.replace(/\r\n/g,"\n").replace(/\r/g,"\n");const getTerminalColumns=()=>{const u=process.stdout;if(u&&typeof u.columns==="number"&&u.columns>0){return u.columns}return 80};const wrapLineToWidth=(u,A)=>{const p=u.replace(/\t/g," ");if(p.length<=A){return[p]}const y=[];for(let u=0;u<p.length;u+=A){y.push(p.slice(u,u+A))}return y.length?y:[""]};const DiffDecisionHint=()=>(0,E.jsx)(w.az,{marginTop:1,children:(0,E.jsxs)(w.EY,{children:["Press ","<Enter>"," to ",(0,E.jsx)(w.EY,{color:"green",children:"Accept"})," or 'r' to"," ",(0,E.jsx)(w.EY,{color:"red",children:"Reject"}),"."]})});const DiffViewStatic=({oldContent:u,newContent:A,filePath:p,toolName:y,toolParams:I,isCompleted:B,action:D,maxVisibleLines:F})=>{const R=(0,C.useMemo)((()=>normalizeContent(u)),[u]);const _=(0,C.useMemo)((()=>normalizeContent(A)),[A]);const P=(0,C.useMemo)((()=>v.Pp(R,_)),[R,_]);const O=(0,C.useMemo)((()=>{const u=[];let A=1;let p=1;P.forEach((y=>{const E=y.value.replace(/\n$/,"");const C=E===""?[""]:E.split("\n");C.forEach((E=>{let C="unchanged";let I=null;let w=null;if(y.added){C="added";w=p++}else if(y.removed){C="removed";I=A++}else{C="unchanged";I=A++;w=p++}u.push({index:u.length,type:C,text:E,oldLineNumber:I,newLineNumber:w})}))}));return u}),[P]);const U=(0,C.useMemo)((()=>{const u=new Array(O.length).fill(false);const A=[];O.forEach(((p,y)=>{if(p.type==="added"||p.type==="removed"){u[y]=true;A.push(y)}}));A.forEach((A=>{const p=Math.max(0,A-Q);const y=Math.min(O.length-1,A+Q);for(let A=p;A<=y;A++){u[A]=true}}));return u}),[O]);const H=D==="accept"?"Changes accepted":"Changes rejected";const G=D==="accept"?"green":"red";const j=y?(0,S.M)(y,I):p;const $=getTerminalColumns();const q=8;const K=Math.max($-q-4,20);const J=F??k;if(R===_&&!B){return(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,marginBottom:1,children:[(0,E.jsxs)(w.EY,{bold:true,children:["File: ",j]}),(0,E.jsx)(w.EY,{children:"No changes detected. The file content will remain the same unless you edit it."})]})}return(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,marginBottom:1,children:[(0,E.jsxs)(w.EY,{bold:true,children:["File: ",j]}),B?(0,E.jsxs)(w.EY,{color:G,children:["4 ",H]}):(0,E.jsx)(w.EY,{bold:true,children:"Review Changes:"}),(0,E.jsx)(w.az,{flexDirection:"column",marginTop:1,children:(()=>{const u=[];let A=0;let p=false;for(let y=0;y<O.length;y++){if(p)break;if(!U[y])continue;const C=O[y];if(!C)continue;const I=C.type==="added"?C.newLineNumber:C.type==="removed"?C.oldLineNumber:C.newLineNumber;let v=" ";let B="grey";if(C.type==="added"){v="+";B="green"}else if(C.type==="removed"){v="-";B="red"}const S=wrapLineToWidth(C.text,K);for(let C=0;C<S.length;C++){if(A>=J){p=true;break}const D=S[C];const k=C===0;const Q=`${y}-${C}`;u.push((0,E.jsxs)(w.az,{flexDirection:"row",children:[(0,E.jsxs)(w.EY,{color:"gray",children:[k&&I!==null&&I!==undefined?String(I).padStart(4):" "," "]}),(0,E.jsxs)(w.EY,{color:B,children:[k?v:" "," ",D]})]},Q));A++}}if(p){const p=O.length;const y=p-A;u.push((0,E.jsx)(w.az,{marginTop:1,children:!B&&F!=null?(0,E.jsxs)(w.EY,{color:"yellow",children:["A visualização deste arquivo foi truncada para limitar a altura da tela. Restam aproximadamente ",y," ","linha(s) não exibidas. Pressione Ctrl+S para ver o conteúdo completo em modo estático."]}):(0,E.jsxs)(w.EY,{color:"yellow",children:["Diff truncado para ",J," linhas para evitar lentidão e flickering. ",y," linha(s) adicional(is) não estão sendo exibidas."]})},"truncated"))}return u})()})]})};const DiffView=({oldContent:u,newContent:A,filePath:p,toolName:y,toolParams:C,isCompleted:I,action:v,maxVisibleLines:S,coreDiffReview:D,onApprove:k,onReject:Q})=>{const F=D?D.status!=="pending":I;(0,w.Ge)(((u,A)=>{if(A.return){k()}if(u==="r"){Q()}}),{isActive:!F});const{diffReviewHeight:R}=(0,B.SB)();const _=!F&&S==null?R:S;return(0,E.jsxs)(w.az,{flexDirection:"column",children:[(0,E.jsx)(DiffViewStatic,{oldContent:u,newContent:A,filePath:p,toolName:y,toolParams:C,isCompleted:F,action:v,maxVisibleLines:_}),!F&&(0,E.jsx)(DiffDecisionHint,{})]})};const F=DiffView;y()}catch(u){y(u)}}))},3746:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const EscapeClearIndicator=()=>(0,E.jsx)(C.az,{children:(0,E.jsx)(C.EY,{color:"gray",children:"Press ESC again to clear."})});const w=EscapeClearIndicator;y()}catch(u){y(u)}}))},9402:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const ExitIndicator=()=>(0,E.jsx)(C.az,{children:(0,E.jsx)(C.EY,{color:"yellow",children:"Press Ctrl+C again to exit"})});const w=ExitIndicator;y()}catch(u){y(u)}}))},5420:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(4953);var w=u([C]);C=(w.then?(await w)():w)[0];const Footer=({isAutonomous:u=false})=>{const{cwd:A,branch:p}=(0,I.q)();const y=u?"AUTO":"APPROVAL";const w=u?"yellow":"gray";return(0,E.jsxs)(C.az,{width:"100%",justifyContent:"space-between",children:[(0,E.jsxs)(C.EY,{children:[(0,E.jsx)(C.EY,{color:"green",children:A}),p&&(0,E.jsxs)(C.EY,{color:"gray",children:[" (",p,")"]})]}),(0,E.jsx)(C.EY,{color:w,children:y})]})};const v=Footer;y()}catch(u){y(u)}}))},7765:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>Q});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(4760);var B=p(1096);var S=p(3345);var D=p(1196);var k=u([w]);w=(k.then?(await k)():k)[0];const Input=({value:u,onChange:A,onSubmit:p,searchFiles:y,isShellActive:I=false,setShowEscapeClear:k,isActive:Q,isAutonomous:F=false})=>{const[R,_]=(0,C.useState)(new v.a(u));const[P,O]=(0,C.useState)([]);const[U,H]=(0,C.useState)([]);const[G,j]=(0,C.useState)(1);(0,C.useEffect)((()=>{_((A=>{if(A.value===u)return A;return new v.a(u)}))}),[u]);const[$,q]=(0,C.useState)(-1);const[K,J]=(0,C.useState)(null);const ee=(0,S.P)();const[te,ne]=(0,C.useState)(null);(0,C.useEffect)((()=>{const fetchSuggestions=async()=>{const u=R.value;if(u.startsWith("/")){J("magic");const A=u.slice(1);const p=ee.filter((u=>u.startsWith(A))).slice(0,5);O(p);q(p.length>0?0:-1)}else if(u.includes("@")){J("file");const A=u.lastIndexOf("@");const p=u.substring(A+1);if(p.length>0){const u=await y(`**/*${p}*`,{ignore:["**/node_modules/**","**/.git/**","**/dist/**"]});O(u.slice(0,5));q(u.length>0?0:-1)}else{O([])}}else{J(null);O([])}};fetchSuggestions()}),[R.value,y,ee]);(0,w.Ge)(((u,y)=>{if(process.env["STK_DEBUG_INPUT"]==="1"){console.error("[STK_DEBUG_INPUT]",{rawInput:u,key:y})}const E=R.clone();let C=false;const I=typeof u==="string"&&!y.return&&(u.length>1||u.includes("\n")||u.includes("\r"));if(y.escape){if(te){clearTimeout(te);ne(null);k(false);_(new v.a(""));O([]);q(-1);H([]);j(1)}else{k(true);const u=setTimeout((()=>{ne(null);k(false)}),800);ne(u)}return}if(P.length>0){if(y.upArrow){q((u=>(u-1+P.length)%P.length));return}if(y.downArrow){q((u=>(u+1)%P.length));return}if(y.tab||y.return){const u=P[$>-1?$:0];if(u){let A="";if(K==="magic"){A=`/${u}`}else if(K==="file"){const p=R.value.lastIndexOf("@");A=R.value.substring(0,p+1)+u+" "}_(new v.a(A));O([]);q(-1);J(null)}return}}if(y.meta){if(u==="f")E.moveCursorWordRight();else if(u==="b")E.moveCursorWordLeft()}else if(y.ctrl&&(u==="v"||u==="")){(async()=>{const u=await(0,D.F)();if(!u){return}H((A=>{const p=G;const y=[...A,{id:p,base64:u.base64,mimeType:u.mimeType}];return y}));const p=`[IMG#${G}]`;const y=R.clone();y.insertText(p);_(y);A(y.value);j((u=>u+1))})();return}else if(y.ctrl&&u==="j"){E.insert("\n");C=true}else if(y.ctrl){if(u==="a")E.moveCursorToStart();else if(u==="e")E.moveCursorToEnd()}else if(y.leftArrow)E.moveCursorLeft();else if(y.rightArrow)E.moveCursorRight();else if((0,B.g)(y)){const u=E.value;const p=E.cursorPosition;const y=u.slice(0,p);const I=y.match(/\[IMG#(\d+)\]$/);if(I){const y=I[0].length;const E=p-y;const w=u.slice(0,E)+u.slice(p);const B=new v.a(w);B.moveCursorToStart();for(let u=0;u<E;u++)B.moveCursorRight();H((u=>u.filter((u=>u.id!==Number(I[1])))));_(B);A(B.value);C=false;return}E.backspace();C=true}else if((0,B.O)()){const u=E.value;const p=E.cursorPosition;const y=u.slice(p);const I=y.match(/^\[IMG#(\d+)\]/);if(I){const y=I[0].length;const E=u.slice(0,p)+u.slice(p+y);const w=new v.a(E);w.moveCursorToStart();for(let u=0;u<p;u++)w.moveCursorRight();H((u=>u.filter((u=>u.id!==Number(I[1])))));_(w);A(w.value);C=false;return}E.delete();C=true}else if(I&&u){const A=u.replace(/\r\n/g,"\n").replace(/\r/g,"\n");E.insertText(A);C=true}else if(y.return&&y.shift){E.insert("\n");C=true}else if(y.return){const u=U.length>0?{images:U.map((u=>({base64:u.base64,mimeType:u.mimeType})))}:undefined;p(R.value,u);if(R.value!==""){_(new v.a(""))}H([]);j(1);return}else if(u){for(const A of u){E.insert(A)}C=true}if(C){if(I){O([]);q(-1);J(null)}_(E);A(E.value)}else{_(E)}}),{isActive:Q});const CustomTextInput=({buffer:u})=>{const A=u.value;const p=u.cursorPosition;const y=A.slice(0,p);const C=A.slice(p,p+1);const I=A.slice(p+1);if(C==="\n"){return(0,E.jsxs)(w.EY,{children:[y,(0,E.jsx)(w.EY,{inverse:true,children:" "}),"",I]})}const v=C||" ";return(0,E.jsxs)(w.EY,{children:[y,(0,E.jsx)(w.EY,{inverse:true,children:v}),I]})};return(0,E.jsxs)(w.az,{flexDirection:"column",children:[P.length>0&&(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"single",paddingX:1,children:[(0,E.jsx)(w.EY,{bold:true,children:"Suggestions"}),P.map(((u,A)=>(0,E.jsxs)(w.EY,{color:A===$?"blue":"white",children:[A===$?"> ":" ",u]},u)))]}),(0,E.jsxs)(w.az,{flexDirection:"column",borderStyle:"single",borderColor:F?"yellow":undefined,paddingX:1,children:[U.length>0&&(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsxs)(w.EY,{color:"green",children:[U.length," imagem(s) anexada(s):"," ",U.map((u=>`[IMG#${u.id}]`)).join(" ")]})}),(0,E.jsxs)(w.az,{flexDirection:"row",children:[(0,E.jsx)(w.az,{marginRight:1,children:(0,E.jsx)(w.EY,{color:I?"yellow":"cyan",children:I?"(shell)$":">"})}),(0,E.jsx)(w.az,{flexGrow:1,children:(0,E.jsx)(CustomTextInput,{buffer:R})})]})]})]})};const Q=I().memo(Input);y()}catch(u){y(u)}}))},727:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{P:()=>LimitedHeightBox});var E=p(9790);var C=p(5184);var I=p(4536);var w=u([C]);C=(w.then?(await w)():w)[0];const LimitedHeightBox=({maxRatio:u=.6,minLines:A=5,children:p,...y})=>{(0,I.SB)();return(0,E.jsx)(C.az,{flexDirection:"column",...y,children:p})};var v=null&&LimitedHeightBox;y()}catch(u){y(u)}}))},3480:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{e:()=>S});var E=p(9790);var C=p(3102);var I=p.n(C);var w=p(5184);var v=p(5183);var B=u([w]);w=(B.then?(await B)():B)[0];const CodeBlock=({content:u,language:A})=>(0,E.jsxs)(w.az,{flexDirection:"column",marginBottom:1,borderStyle:"round",borderColor:"cyan",children:[A&&(0,E.jsx)(w.az,{paddingX:1,paddingTop:0,paddingBottom:0,children:(0,E.jsx)(w.EY,{color:"cyanBright",children:A})}),(0,E.jsx)(w.az,{paddingX:1,paddingBottom:0,paddingTop:A?0:0,children:(0,E.jsx)(w.EY,{children:u})})]});const renderInlineAgentText=u=>{const A=(0,v.y)(u??"");if(!A.length){return(0,E.jsx)(w.EY,{children:u})}return(0,E.jsx)(w.EY,{children:A.map(((u,A)=>u.type==="code"?(0,E.jsx)(w.EY,{color:"#ff7bda",children:u.content},`code-${A}`):(0,E.jsx)(w.EY,{children:u.content},`text-${A}`)))})};const Message=({message:u,activeShellCommand:A,childProcess:p,handleShellCompletion:y,context:C="live"})=>{if(u.sender==="user"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsxs)(w.EY,{color:"yellowBright",children:["> ",u.text]})})}if(u.sender==="agent_thought"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsx)(w.EY,{color:"gray",italic:true,children:u.text})})}if(u.sender==="agent"){if(process.env["STK_DEBUG_AGENT_STREAM"]==="1"){console.log("[agent-render]",JSON.stringify(u.text))}if(u.highlightedBlock){return(0,E.jsx)(CodeBlock,{content:u.highlightedBlock.content,language:u.highlightedBlock.language})}return(0,E.jsx)(w.az,{marginBottom:1,children:renderInlineAgentText(u.text)})}if(u.sender==="agent_error"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsx)(w.EY,{color:"red",children:u.text})})}if(u.sender==="system"){return(0,E.jsx)(w.az,{marginBottom:1,children:(0,E.jsx)(w.EY,{color:"gray",children:u.text})})}if(u.sender==="tool_execution"){return null}return null};const S=I().memo(Message);y()}catch(u){y(u)}}))},7208:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const ShellConfirmation=({command:u,onApprove:A,onReject:p})=>{(0,C.Ge)(((u,y)=>{if(u.toLowerCase()==="y"){A()}else if(u.toLowerCase()==="n"){p()}}));return(0,E.jsxs)(C.az,{flexDirection:"column",padding:1,borderColor:"yellow",borderStyle:"round",children:[(0,E.jsx)(C.EY,{children:"The agent wants to run the following shell command:"}),(0,E.jsx)(C.az,{marginTop:1,paddingX:1,borderStyle:"round",borderColor:"gray",children:(0,E.jsx)(C.EY,{children:u})}),(0,E.jsx)(C.az,{marginTop:1,children:(0,E.jsx)(C.EY,{color:"yellow",children:"Do you want to run this command? (y/n)"})})]})};const w=ShellConfirmation;y()}catch(u){y(u)}}))},313:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(9790);var C=p(5184);var I=u([C]);C=(I.then?(await I)():I)[0];const ShellExecution=({command:u,childProcess:A,onComplete:p,coreShellRun:y})=>{const I=y?.status??"running";const w=y?.visibleOutput??[y?.stdout,y?.stderr].filter(Boolean).join("\n");const v=w?w.split("\n"):[];const B=y?.isVisuallyTruncated&&y.visibleLinesCount!=null&&y.totalLines!=null;return(0,E.jsxs)(C.az,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,children:[(0,E.jsxs)(C.EY,{color:"white",children:["$ ",u]}),(0,E.jsxs)(C.EY,{color:"gray",children:["Status: ",I]}),B&&(0,E.jsxs)(C.EY,{color:"yellow",children:["A saída deste comando é muito longa; mostrando últimas"," ",y.visibleLinesCount," de ",y.totalLines," ","linhas."]}),v.length>0?(0,E.jsx)(E.Fragment,{children:v.map(((u,A)=>(0,E.jsx)(C.EY,{children:u},A)))}):(0,E.jsx)(C.EY,{color:"gray",children:"Aguardando saída do comando..."})]})};const w=ShellExecution;y()}catch(u){y(u)}}))},2113:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(9790);var C=p(5184);var I=p(4378);var w=u([C]);C=(w.then?(await w)():w)[0];const ToolExecution=({toolName:u,toolParams:A,status:p})=>{const y=p==="finished"||p==="completed";const w=y?"✓":"·";const v=y?"green":"yellow";const B=(0,I.M)(u,A);return(0,E.jsx)(C.az,{children:(0,E.jsxs)(C.EY,{color:"gray",children:[(0,E.jsx)(C.EY,{color:v,children:w})," ",B]})})};const v=ToolExecution;y()}catch(u){y(u)}}))},6878:(u,A,p)=>{p.d(A,{$:()=>y});class Config{WORKSPACE_DIR;BACKEND_URL;CURRENT_VERSION;DISABLE_RIPGREP;ENABLE_INCREMENTAL_RENDERING;constructor(){this.WORKSPACE_DIR=process.env["CLI_WORKSPACE_DIR"]||process.cwd();this.BACKEND_URL=process.env["CLI_BACKEND_URL"]||"https://labs-codegen-api.prd.stackspot.com";this.CURRENT_VERSION="1.1.1";this.DISABLE_RIPGREP=(process.env["CLI_DISABLE_RIPGREP"]||"").toLowerCase()==="true";this.ENABLE_INCREMENTAL_RENDERING=process.env["ENABLE_INCREMENTAL_RENDERING"]==="true"||true}}const y=new Config},3646:(u,A,p)=>{p.d(A,{R:()=>E,h:()=>reduceCoreState});var y=p(6878);const E={messages:[],shellRuns:[],diffReviews:[],agentStatus:{label:"Idle",phase:"idle"},stream:{buffer:"",status:"idle",generationId:undefined},activeGenerationId:undefined,isBootstrapping:false,bootstrapFinished:false,connectionStatus:"disconnected"};const generateId=()=>Math.random().toString(36).slice(2);function reduceCoreState(u,A){switch(A.type){case"USER_SENT_MESSAGE":{const p={id:generateId(),role:"user",text:A.text,createdAt:Date.now(),isFinal:true};return{...u,messages:[...u.messages,p]}}case"AGENT_STREAM_STARTED":{const p={id:A.messageId,role:"agent",text:"",createdAt:Date.now(),isStreaming:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p],stream:{currentMessageId:A.messageId,buffer:"",status:"streaming",generationId:A.generationId},agentStatus:{label:"Thinking…",phase:"streaming"}}}case"AGENT_DELTA_RECEIVED":{const p=1e3;if(u.stream.status!=="streaming"||!u.stream.currentMessageId){const p=generateId();const y={id:p,role:"agent",text:A.delta,createdAt:Date.now(),isStreaming:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,y],stream:{currentMessageId:p,buffer:"",status:"streaming",generationId:A.generationId},agentStatus:{label:"Thinking…",phase:"streaming"}}}const y=u.messages.findIndex((A=>A.id===u.stream.currentMessageId));if(y===-1){const p=generateId();const y={id:p,role:"agent",text:A.delta,createdAt:Date.now(),isStreaming:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,y],stream:{currentMessageId:p,buffer:"",status:"streaming",generationId:A.generationId},agentStatus:{label:"Thinking…",phase:"streaming"}}}const E=u.messages[y];const C=(E.text??"")+A.delta;if(C.length<=p){return{...u,activeGenerationId:A.generationId??u.activeGenerationId,stream:{...u.stream,generationId:A.generationId??u.stream.generationId},messages:u.messages.map(((u,p)=>p===y?{...u,text:C,generationId:A.generationId??u.generationId}:u))}}const I="\n\n";let w=C.lastIndexOf(I);if(w===-1){w=C.lastIndexOf(" ")}if(w===-1||w<p/2){return{...u,activeGenerationId:A.generationId??u.activeGenerationId,stream:{...u.stream,generationId:A.generationId??u.stream.generationId},messages:u.messages.map(((u,p)=>p===y?{...u,text:C,generationId:A.generationId??u.generationId}:u))}}const v=C.slice(0,w);const B=C.slice(w);const S={...E,text:v,isStreaming:false,isFinal:true};const D=generateId();const k={...E,id:D,text:B,generationId:A.generationId??E.generationId};const Q=[...u.messages.slice(0,y),S,...u.messages.slice(y+1),k];return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:Q,stream:{...u.stream,currentMessageId:D,generationId:A.generationId??u.stream.generationId}}}case"AGENT_STREAM_FLUSH":{return u}case"AGENT_STREAM_FINISHED":{const{currentMessageId:p}=u.stream;if(!p){return{...u,activeGenerationId:A.generationId&&u.activeGenerationId===A.generationId?undefined:u.activeGenerationId,stream:{currentMessageId:undefined,buffer:"",status:"finished",generationId:undefined},agentStatus:{label:"Idle",phase:"idle"}}}return{...u,activeGenerationId:A.generationId&&u.activeGenerationId===A.generationId?undefined:u.activeGenerationId,messages:u.messages.map((u=>u.id===p?{...u,isStreaming:false,isFinal:true}:u)),stream:{currentMessageId:undefined,buffer:"",status:"finished",generationId:undefined},agentStatus:{label:"Idle",phase:"idle"}}}case"SHELL_RUN_STARTED":{const p={id:A.runId,command:A.command,status:"running",stdout:"",stderr:"",startedAt:Date.now()};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,shellRuns:[...u.shellRuns,p],agentStatus:{label:`Running shell: ${A.command}`,phase:"running_tool"}}}case"SHELL_OUTPUT_RECEIVED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,shellRuns:u.shellRuns.map((u=>{if(u.id!==A.runId)return u;return{...u,stdout:u.stdout+(A.stdoutDelta??""),stderr:u.stderr+(A.stderrDelta??"")}}))}}case"SHELL_RUN_FINISHED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,shellRuns:u.shellRuns.map((u=>u.id===A.runId?{...u,status:A.exitCode===0?"finished":"error",finishedAt:Date.now()}:u)),agentStatus:{label:"Idle",phase:"idle"}}}case"DIFF_REVIEW_OPENED":{const p={id:A.reviewId,title:A.title,toolName:A.toolName,toolParams:A.toolParams,oldContent:A.oldContent,newContent:A.newContent,status:"pending"};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,diffReviews:[...u.diffReviews,p]}}case"DIFF_REVIEW_RESOLVED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,diffReviews:u.diffReviews.map((u=>u.id===A.reviewId?{...u,status:A.result}:u))}}case"ERROR_OCCURRED":{const p={id:generateId(),role:"agent_error",text:A.message,createdAt:Date.now(),isFinal:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p]}}case"TOOL_RESULT_MESSAGE":{const p={id:generateId(),role:"system",text:A.text,createdAt:Date.now(),isFinal:true,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p]}}case"TOOL_EXECUTION_STARTED":{const p={id:generateId(),role:"tool_execution",text:"",toolId:A.toolId,toolName:A.toolName,toolParams:A.toolParams,createdAt:Date.now(),isFinal:false,status:"running",isBootstrap:u.isBootstrapping,generationId:A.generationId};return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:[...u.messages,p]}}case"TOOL_EXECUTION_FINISHED":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:u.messages.map((u=>u.toolId===A.toolId?{...u,status:"finished",isFinal:true,generationId:A.generationId??u.generationId}:u))}}case"TOOL_EXECUTION_ERROR":{return{...u,activeGenerationId:A.generationId??u.activeGenerationId,messages:u.messages.map((u=>u.toolId===A.toolId?{...u,status:"error",isFinal:true,text:A.error,generationId:A.generationId??u.generationId}:u))}}case"BOOTSTRAP_STARTED":{return{...u,isBootstrapping:true}}case"BOOTSTRAP_FINISHED":{const A={id:generateId(),role:"system",text:`Contexto do projeto carregado. (CLI v${y.$.CURRENT_VERSION})`,createdAt:Date.now(),isFinal:true};return{...u,isBootstrapping:false,bootstrapFinished:true,messages:[...u.messages,A]}}case"CONNECTION_STATUS_CHANGED":{return{...u,connectionStatus:A.status}}default:return u}}},4953:(u,A,p)=>{p.d(A,{q:()=>useGitInfo});var y=p(9896);var E=p.n(y);var C=p(5317);var I=p.n(C);var w=p(3102);var v=p.n(w);const isGitRepo=()=>{try{(0,C.execSync)("git rev-parse --is-inside-work-tree",{stdio:["ignore","ignore","ignore"]});return true}catch{return false}};const useGitInfo=()=>{const[u,A]=(0,w.useState)("");const[p,y]=(0,w.useState)(false);(0,w.useEffect)((()=>{const getGitBranch=()=>{if(!isGitRepo())return"";try{return(0,C.execSync)("git rev-parse --abbrev-ref HEAD",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch(u){return""}};A(getGitBranch());y(E().existsSync("CODEGEN.md"))}),[]);return{cwd:process.cwd(),branch:u,hasCodegenSpec:p}}},2618:(u,A,p)=>{p.d(A,{f:()=>useAgent});var y=p(1943);var E=p(6928);var C=p.n(E);var I=p(3102);var w=p(6657);var v=p(1910);var B=p(6878);const ReadFile=async u=>{const{file_path:A,offset:p,limit:E}=u;try{const u=C().resolve(B.$.WORKSPACE_DIR,A);let I=await(0,y.readFile)(u,"utf-8");const w=I.split("\n");let v=false;let S;let D;if(p!==undefined&&E!==undefined){D=w.length;const u=p;const A=Math.min(p+E,w.length);I=w.slice(u,A).join("\n");v=A<w.length;S=[u+1,A]}if(v){return{content:`\nIMPORTANT: The file content has been truncated.\nStatus: Showing lines ${S[0]}-${S[1]} of ${D} total lines.\nAction: To read more of the file, you can use the 'offset' and 'limit' parameters in a subsequent 'ReadFile' call. For example, to read the next section of the file, use offset: ${S[1]}.\n\n--- FILE CONTENT (truncated) ---\n${I}`}}return{content:I}}catch(u){return{error:u.message}}};const ReadFolder=async u=>{const{dir_path:A=".",ignore:p}=u;try{const u=C().resolve(B.$.WORKSPACE_DIR,A);const E=await(0,y.readdir)(u,{withFileTypes:true});const I=[];for(const A of E){if(p&&p.some((u=>new RegExp(u).test(A.name)))){continue}const E=C().join(u,A.name);const w=await(0,y.stat)(E);I.push({name:A.name,path:E,isDirectory:A.isDirectory(),size:w.size,modifiedTime:w.mtime})}I.sort(((u,A)=>{if(u.isDirectory&&!A.isDirectory)return-1;if(!u.isDirectory&&A.isDirectory)return 1;return u.name.localeCompare(A.name)}));const w=I.map((u=>`${u.isDirectory?"[DIR] ":""}${u.name}`)).join("\n");return{llmContent:`Directory listing for ${u}:\n${w}`,returnDisplay:`Listed ${I.length} item(s).`}}catch(u){return{error:u.message}}};const Shell=async u=>Promise.resolve({command:u.command,directory:u.dir_path,stdout:"(empty)",stderr:"(This command was executed interactively)",error:"(none)",exitCode:0});const balanced=(u,A,p)=>{const y=u instanceof RegExp?maybeMatch(u,p):u;const E=A instanceof RegExp?maybeMatch(A,p):A;const C=y!==null&&E!=null&&range(y,E,p);return C&&{start:C[0],end:C[1],pre:p.slice(0,C[0]),body:p.slice(C[0]+y.length,C[1]),post:p.slice(C[1]+E.length)}};const maybeMatch=(u,A)=>{const p=A.match(u);return p?p[0]:null};const range=(u,A,p)=>{let y,E,C,I=undefined,w;let v=p.indexOf(u);let B=p.indexOf(A,v+1);let S=v;if(v>=0&&B>0){if(u===A){return[v,B]}y=[];C=p.length;while(S>=0&&!w){if(S===v){y.push(S);v=p.indexOf(u,S+1)}else if(y.length===1){const u=y.pop();if(u!==undefined)w=[u,B]}else{E=y.pop();if(E!==undefined&&E<C){C=E;I=B}B=p.indexOf(A,S+1)}S=v<B&&v>=0?v:B}if(y.length&&I!==undefined){w=[C,I]}}return w};const S="\0SLASH"+Math.random()+"\0";const D="\0OPEN"+Math.random()+"\0";const k="\0CLOSE"+Math.random()+"\0";const Q="\0COMMA"+Math.random()+"\0";const F="\0PERIOD"+Math.random()+"\0";const R=new RegExp(S,"g");const _=new RegExp(D,"g");const P=new RegExp(k,"g");const O=new RegExp(Q,"g");const U=new RegExp(F,"g");const H=/\\\\/g;const G=/\\{/g;const j=/\\}/g;const $=/\\,/g;const q=/\\./g;function numeric(u){return!isNaN(u)?parseInt(u,10):u.charCodeAt(0)}function escapeBraces(u){return u.replace(H,S).replace(G,D).replace(j,k).replace($,Q).replace(q,F)}function unescapeBraces(u){return u.replace(R,"\\").replace(_,"{").replace(P,"}").replace(O,",").replace(U,".")}function parseCommaParts(u){if(!u){return[""]}const A=[];const p=balanced("{","}",u);if(!p){return u.split(",")}const{pre:y,body:E,post:C}=p;const I=y.split(",");I[I.length-1]+="{"+E+"}";const w=parseCommaParts(C);if(C.length){I[I.length-1]+=w.shift();I.push.apply(I,w)}A.push.apply(A,I);return A}function expand(u){if(!u){return[]}if(u.slice(0,2)==="{}"){u="\\{\\}"+u.slice(2)}return expand_(escapeBraces(u),true).map(unescapeBraces)}function embrace(u){return"{"+u+"}"}function isPadded(u){return/^-?0\d/.test(u)}function lte(u,A){return u<=A}function gte(u,A){return u>=A}function expand_(u,A){const p=[];const y=balanced("{","}",u);if(!y)return[u];const E=y.pre;const C=y.post.length?expand_(y.post,false):[""];if(/\$$/.test(y.pre)){for(let u=0;u<C.length;u++){const A=E+"{"+y.body+"}"+C[u];p.push(A)}}else{const I=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(y.body);const w=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(y.body);const v=I||w;const B=y.body.indexOf(",")>=0;if(!v&&!B){if(y.post.match(/,(?!,).*\}/)){u=y.pre+"{"+y.body+k+y.post;return expand_(u)}return[u]}let S;if(v){S=y.body.split(/\.\./)}else{S=parseCommaParts(y.body);if(S.length===1&&S[0]!==undefined){S=expand_(S[0],false).map(embrace);if(S.length===1){return C.map((u=>y.pre+S[0]+u))}}}let D;if(v&&S[0]!==undefined&&S[1]!==undefined){const u=numeric(S[0]);const A=numeric(S[1]);const p=Math.max(S[0].length,S[1].length);let y=S.length===3&&S[2]!==undefined?Math.abs(numeric(S[2])):1;let E=lte;const C=A<u;if(C){y*=-1;E=gte}const I=S.some(isPadded);D=[];for(let C=u;E(C,A);C+=y){let u;if(w){u=String.fromCharCode(C);if(u==="\\"){u=""}}else{u=String(C);if(I){const A=p-u.length;if(A>0){const p=new Array(A+1).join("0");if(C<0){u="-"+p+u.slice(1)}else{u=p+u}}}}D.push(u)}}else{D=[];for(let u=0;u<S.length;u++){D.push.apply(D,expand_(S[u],false))}}for(let u=0;u<D.length;u++){for(let y=0;y<C.length;y++){const I=E+D[u]+C[y];if(!A||v||I){p.push(I)}}}}return p}const K=1024*64;const assertValidPattern=u=>{if(typeof u!=="string"){throw new TypeError("invalid pattern")}if(u.length>K){throw new TypeError("pattern is too long")}};const J={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=u=>u.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=u=>u.join("");const parseClass=(u,A)=>{const p=A;if(u.charAt(p)!=="["){throw new Error("not in a brace expression")}const y=[];const E=[];let C=p+1;let I=false;let w=false;let v=false;let B=false;let S=p;let D="";e:while(C<u.length){const A=u.charAt(C);if((A==="!"||A==="^")&&C===p+1){B=true;C++;continue}if(A==="]"&&I&&!v){S=C+1;break}I=true;if(A==="\\"){if(!v){v=true;C++;continue}}if(A==="["&&!v){for(const[A,[I,v,B]]of Object.entries(J)){if(u.startsWith(A,C)){if(D){return["$.",false,u.length-p,true]}C+=A.length;if(B)E.push(I);else y.push(I);w=w||v;continue e}}}v=false;if(D){if(A>D){y.push(braceEscape(D)+"-"+braceEscape(A))}else if(A===D){y.push(braceEscape(A))}D="";C++;continue}if(u.startsWith("-]",C+1)){y.push(braceEscape(A+"-"));C+=2;continue}if(u.startsWith("-",C+1)){D=A;C+=2;continue}y.push(braceEscape(A));C++}if(S<C){return["",false,0,false]}if(!y.length&&!E.length){return["$.",false,u.length-p,true]}if(E.length===0&&y.length===1&&/^\\?.$/.test(y[0])&&!B){const u=y[0].length===2?y[0].slice(-1):y[0];return[regexpEscape(u),false,S-p,false]}const k="["+(B?"^":"")+rangesToString(y)+"]";const Q="["+(B?"":"^")+rangesToString(E)+"]";const F=y.length&&E.length?"("+k+"|"+Q+")":y.length?k:Q;return[F,w,S-p,true]};const unescape_unescape=(u,{windowsPathsNoEscape:A=false,magicalBraces:p=true}={})=>{if(p){return A?u.replace(/\[([^\/\\])\]/g,"$1"):u.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")}return A?u.replace(/\[([^\/\\{}])\]/g,"$1"):u.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};const ee=new Set(["!","?","+","*","@"]);const isExtglobType=u=>ee.has(u);const te="(?!(?:^|/)\\.\\.?(?:$|/))";const ne="(?!\\.)";const re=new Set(["[","."]);const se=new Set(["..","."]);const ie=new Set("().*{}+?[]^$\\!");const regExpEscape=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const oe="[^/]";const ae=oe+"*?";const le=oe+"+?";class AST{type;#e;#t;#n=false;#r=[];#s;#i;#o;#a=false;#l;#c;#u=false;constructor(u,A,p={}){this.type=u;if(u)this.#t=true;this.#s=A;this.#e=this.#s?this.#s.#e:this;this.#l=this.#e===this?p:this.#e.#l;this.#o=this.#e===this?[]:this.#e.#o;if(u==="!"&&!this.#e.#a)this.#o.push(this);this.#i=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==undefined)return this.#t;for(const u of this.#r){if(typeof u==="string")continue;if(u.type||u.hasMagic)return this.#t=true}return this.#t}toString(){if(this.#c!==undefined)return this.#c;if(!this.type){return this.#c=this.#r.map((u=>String(u))).join("")}else{return this.#c=this.type+"("+this.#r.map((u=>String(u))).join("|")+")"}}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString();this.#a=true;let u;while(u=this.#o.pop()){if(u.type!=="!")continue;let A=u;let p=A.#s;while(p){for(let y=A.#i+1;!p.type&&y<p.#r.length;y++){for(const A of u.#r){if(typeof A==="string"){throw new Error("string part in extglob AST??")}A.copyIn(p.#r[y])}}A=p;p=A.#s}}return this}push(...u){for(const A of u){if(A==="")continue;if(typeof A!=="string"&&!(A instanceof AST&&A.#s===this)){throw new Error("invalid part: "+A)}this.#r.push(A)}}toJSON(){const u=this.type===null?this.#r.slice().map((u=>typeof u==="string"?u:u.toJSON())):[this.type,...this.#r.map((u=>u.toJSON()))];if(this.isStart()&&!this.type)u.unshift([]);if(this.isEnd()&&(this===this.#e||this.#e.#a&&this.#s?.type==="!")){u.push({})}return u}isStart(){if(this.#e===this)return true;if(!this.#s?.isStart())return false;if(this.#i===0)return true;const u=this.#s;for(let A=0;A<this.#i;A++){const p=u.#r[A];if(!(p instanceof AST&&p.type==="!")){return false}}return true}isEnd(){if(this.#e===this)return true;if(this.#s?.type==="!")return true;if(!this.#s?.isEnd())return false;if(!this.type)return this.#s?.isEnd();const u=this.#s?this.#s.#r.length:0;return this.#i===u-1}copyIn(u){if(typeof u==="string")this.push(u);else this.push(u.clone(this))}clone(u){const A=new AST(this.type,u);for(const u of this.#r){A.copyIn(u)}return A}static#f(u,A,p,y){let E=false;let C=false;let I=-1;let w=false;if(A.type===null){let v=p;let B="";while(v<u.length){const p=u.charAt(v++);if(E||p==="\\"){E=!E;B+=p;continue}if(C){if(v===I+1){if(p==="^"||p==="!"){w=true}}else if(p==="]"&&!(v===I+2&&w)){C=false}B+=p;continue}else if(p==="["){C=true;I=v;w=false;B+=p;continue}if(!y.noext&&isExtglobType(p)&&u.charAt(v)==="("){A.push(B);B="";const E=new AST(p,A);v=AST.#f(u,E,v,y);A.push(E);continue}B+=p}A.push(B);return v}let v=p+1;let B=new AST(null,A);const S=[];let D="";while(v<u.length){const p=u.charAt(v++);if(E||p==="\\"){E=!E;D+=p;continue}if(C){if(v===I+1){if(p==="^"||p==="!"){w=true}}else if(p==="]"&&!(v===I+2&&w)){C=false}D+=p;continue}else if(p==="["){C=true;I=v;w=false;D+=p;continue}if(isExtglobType(p)&&u.charAt(v)==="("){B.push(D);D="";const A=new AST(p,B);B.push(A);v=AST.#f(u,A,v,y);continue}if(p==="|"){B.push(D);D="";S.push(B);B=new AST(null,A);continue}if(p===")"){if(D===""&&A.#r.length===0){A.#u=true}B.push(D);D="";A.push(...S,B);return v}D+=p}A.type=null;A.#t=undefined;A.#r=[u.substring(p-1)];return v}static fromGlob(u,A={}){const p=new AST(null,undefined,A);AST.#f(u,p,0,A);return p}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();const u=this.toString();const[A,p,y,E]=this.toRegExpSource();const C=y||this.#t||this.#l.nocase&&!this.#l.nocaseMagicOnly&&u.toUpperCase()!==u.toLowerCase();if(!C){return p}const I=(this.#l.nocase?"i":"")+(E?"u":"");return Object.assign(new RegExp(`^${A}$`,I),{_src:A,_glob:u})}get options(){return this.#l}toRegExpSource(u){const A=u??!!this.#l.dot;if(this.#e===this)this.#d();if(!this.type){const p=this.isStart()&&this.isEnd()&&!this.#r.some((u=>typeof u!=="string"));const y=this.#r.map((A=>{const[y,E,C,I]=typeof A==="string"?AST.#A(A,this.#t,p):A.toRegExpSource(u);this.#t=this.#t||C;this.#n=this.#n||I;return y})).join("");let E="";if(this.isStart()){if(typeof this.#r[0]==="string"){const p=this.#r.length===1&&se.has(this.#r[0]);if(!p){const p=re;const C=A&&p.has(y.charAt(0))||y.startsWith("\\.")&&p.has(y.charAt(2))||y.startsWith("\\.\\.")&&p.has(y.charAt(4));const I=!A&&!u&&p.has(y.charAt(0));E=C?te:I?ne:""}}}let C="";if(this.isEnd()&&this.#e.#a&&this.#s?.type==="!"){C="(?:$|\\/)"}const I=E+y+C;return[I,unescape_unescape(y),this.#t=!!this.#t,this.#n]}const p=this.type==="*"||this.type==="+";const y=this.type==="!"?"(?:(?!(?:":"(?:";let E=this.#h(A);if(this.isStart()&&this.isEnd()&&!E&&this.type!=="!"){const u=this.toString();this.#r=[u];this.type=null;this.#t=undefined;return[u,unescape_unescape(this.toString()),false,false]}let C=!p||u||A||!ne?"":this.#h(true);if(C===E){C=""}if(C){E=`(?:${E})(?:${C})*?`}let I="";if(this.type==="!"&&this.#u){I=(this.isStart()&&!A?ne:"")+le}else{const p=this.type==="!"?"))"+(this.isStart()&&!A&&!u?ne:"")+ae+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&C?")":this.type==="*"&&C?`)?`:`)${this.type}`;I=y+E+p}return[I,unescape_unescape(E),this.#t=!!this.#t,this.#n]}#h(u){return this.#r.map((A=>{if(typeof A==="string"){throw new Error("string type in extglob ast??")}const[p,y,E,C]=A.toRegExpSource(u);this.#n=this.#n||C;return p})).filter((u=>!(this.isStart()&&this.isEnd())||!!u)).join("|")}static#A(u,A,p=false){let y=false;let E="";let C=false;for(let I=0;I<u.length;I++){const w=u.charAt(I);if(y){y=false;E+=(ie.has(w)?"\\":"")+w;continue}if(w==="\\"){if(I===u.length-1){E+="\\\\"}else{y=true}continue}if(w==="["){const[p,y,w,v]=parseClass(u,I);if(w){E+=p;C=C||y;I+=w-1;A=A||v;continue}}if(w==="*"){E+=p&&u==="*"?le:ae;A=true;continue}if(w==="?"){E+=oe;A=true;continue}E+=regExpEscape(w)}return[E,unescape_unescape(u),!!A,C]}}const escape_escape=(u,{windowsPathsNoEscape:A=false,magicalBraces:p=false}={})=>{if(p){return A?u.replace(/[?*()[\]{}]/g,"[$&]"):u.replace(/[?*()[\]\\{}]/g,"\\$&")}return A?u.replace(/[?*()[\]]/g,"[$&]"):u.replace(/[?*()[\]\\]/g,"\\$&")};const minimatch=(u,A,p={})=>{assertValidPattern(A);if(!p.nocomment&&A.charAt(0)==="#"){return false}return new Minimatch(A,p).match(u)};const ce=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=u=>A=>!A.startsWith(".")&&A.endsWith(u);const starDotExtTestDot=u=>A=>A.endsWith(u);const starDotExtTestNocase=u=>{u=u.toLowerCase();return A=>!A.startsWith(".")&&A.toLowerCase().endsWith(u)};const starDotExtTestNocaseDot=u=>{u=u.toLowerCase();return A=>A.toLowerCase().endsWith(u)};const ue=/^\*+\.\*+$/;const starDotStarTest=u=>!u.startsWith(".")&&u.includes(".");const starDotStarTestDot=u=>u!=="."&&u!==".."&&u.includes(".");const de=/^\.\*+$/;const dotStarTest=u=>u!=="."&&u!==".."&&u.startsWith(".");const fe=/^\*+$/;const starTest=u=>u.length!==0&&!u.startsWith(".");const starTestDot=u=>u.length!==0&&u!=="."&&u!=="..";const Ae=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([u,A=""])=>{const p=qmarksTestNoExt([u]);if(!A)return p;A=A.toLowerCase();return u=>p(u)&&u.toLowerCase().endsWith(A)};const qmarksTestNocaseDot=([u,A=""])=>{const p=qmarksTestNoExtDot([u]);if(!A)return p;A=A.toLowerCase();return u=>p(u)&&u.toLowerCase().endsWith(A)};const qmarksTestDot=([u,A=""])=>{const p=qmarksTestNoExtDot([u]);return!A?p:u=>p(u)&&u.endsWith(A)};const qmarksTest=([u,A=""])=>{const p=qmarksTestNoExt([u]);return!A?p:u=>p(u)&&u.endsWith(A)};const qmarksTestNoExt=([u])=>{const A=u.length;return u=>u.length===A&&!u.startsWith(".")};const qmarksTestNoExtDot=([u])=>{const A=u.length;return u=>u.length===A&&u!=="."&&u!==".."};const he=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const pe={win32:{sep:"\\"},posix:{sep:"/"}};const ge=he==="win32"?pe.win32.sep:pe.posix.sep;minimatch.sep=ge;const me=Symbol("globstar **");minimatch.GLOBSTAR=me;const ye="[^/]";const Ee=ye+"*?";const Ce="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const Ie="(?:(?!(?:\\/|^)\\.).)*?";const esm_filter=(u,A={})=>p=>minimatch(p,u,A);minimatch.filter=esm_filter;const ext=(u,A={})=>Object.assign({},u,A);const defaults=u=>{if(!u||typeof u!=="object"||!Object.keys(u).length){return minimatch}const A=minimatch;const m=(p,y,E={})=>A(p,y,ext(u,E));return Object.assign(m,{Minimatch:class Minimatch extends A.Minimatch{constructor(A,p={}){super(A,ext(u,p))}static defaults(p){return A.defaults(ext(u,p)).Minimatch}},AST:class AST extends A.AST{constructor(A,p,y={}){super(A,p,ext(u,y))}static fromGlob(p,y={}){return A.AST.fromGlob(p,ext(u,y))}},unescape:(p,y={})=>A.unescape(p,ext(u,y)),escape:(p,y={})=>A.escape(p,ext(u,y)),filter:(p,y={})=>A.filter(p,ext(u,y)),defaults:p=>A.defaults(ext(u,p)),makeRe:(p,y={})=>A.makeRe(p,ext(u,y)),braceExpand:(p,y={})=>A.braceExpand(p,ext(u,y)),match:(p,y,E={})=>A.match(p,y,ext(u,E)),sep:A.sep,GLOBSTAR:me})};minimatch.defaults=defaults;const braceExpand=(u,A={})=>{assertValidPattern(u);if(A.nobrace||!/\{(?:(?!\{).)*\}/.test(u)){return[u]}return expand(u)};minimatch.braceExpand=braceExpand;const makeRe=(u,A={})=>new Minimatch(u,A).makeRe();minimatch.makeRe=makeRe;const match=(u,A,p={})=>{const y=new Minimatch(A,p);u=u.filter((u=>y.match(u)));if(y.options.nonull&&!u.length){u.push(A)}return u};minimatch.match=match;const be=/[?*]|[+@!]\(.*?\)|\[|\]/;const esm_regExpEscape=u=>u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(u,A={}){assertValidPattern(u);A=A||{};this.options=A;this.pattern=u;this.platform=A.platform||he;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!A.windowsPathsNoEscape||A.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!A.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!A.nonegate;this.comment=false;this.empty=false;this.partial=!!A.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=A.windowsNoMagicRoot!==undefined?A.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const u of this.set){for(const A of u){if(typeof A!=="string")return true}}return false}debug(...u){}make(){const u=this.pattern;const A=this.options;if(!A.nocomment&&u.charAt(0)==="#"){this.comment=true;return}if(!u){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(A.debug){this.debug=(...u)=>console.error(...u)}this.debug(this.pattern,this.globSet);const p=this.globSet.map((u=>this.slashSplit(u)));this.globParts=this.preprocess(p);this.debug(this.pattern,this.globParts);let y=this.globParts.map(((u,A,p)=>{if(this.isWindows&&this.windowsNoMagicRoot){const A=u[0]===""&&u[1]===""&&(u[2]==="?"||!be.test(u[2]))&&!be.test(u[3]);const p=/^[a-z]:/i.test(u[0]);if(A){return[...u.slice(0,4),...u.slice(4).map((u=>this.parse(u)))]}else if(p){return[u[0],...u.slice(1).map((u=>this.parse(u)))]}}return u.map((u=>this.parse(u)))}));this.debug(this.pattern,y);this.set=y.filter((u=>u.indexOf(false)===-1));if(this.isWindows){for(let u=0;u<this.set.length;u++){const A=this.set[u];if(A[0]===""&&A[1]===""&&this.globParts[u][2]==="?"&&typeof A[3]==="string"&&/^[a-z]:$/i.test(A[3])){A[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(u){if(this.options.noglobstar){for(let A=0;A<u.length;A++){for(let p=0;p<u[A].length;p++){if(u[A][p]==="**"){u[A][p]="*"}}}}const{optimizationLevel:A=1}=this.options;if(A>=2){u=this.firstPhasePreProcess(u);u=this.secondPhasePreProcess(u)}else if(A>=1){u=this.levelOneOptimize(u)}else{u=this.adjascentGlobstarOptimize(u)}return u}adjascentGlobstarOptimize(u){return u.map((u=>{let A=-1;while(-1!==(A=u.indexOf("**",A+1))){let p=A;while(u[p+1]==="**"){p++}if(p!==A){u.splice(A,p-A)}}return u}))}levelOneOptimize(u){return u.map((u=>{u=u.reduce(((u,A)=>{const p=u[u.length-1];if(A==="**"&&p==="**"){return u}if(A===".."){if(p&&p!==".."&&p!=="."&&p!=="**"){u.pop();return u}}u.push(A);return u}),[]);return u.length===0?[""]:u}))}levelTwoFileOptimize(u){if(!Array.isArray(u)){u=this.slashSplit(u)}let A=false;do{A=false;if(!this.preserveMultipleSlashes){for(let p=1;p<u.length-1;p++){const y=u[p];if(p===1&&y===""&&u[0]==="")continue;if(y==="."||y===""){A=true;u.splice(p,1);p--}}if(u[0]==="."&&u.length===2&&(u[1]==="."||u[1]==="")){A=true;u.pop()}}let p=0;while(-1!==(p=u.indexOf("..",p+1))){const y=u[p-1];if(y&&y!=="."&&y!==".."&&y!=="**"){A=true;u.splice(p-1,2);p-=2}}}while(A);return u.length===0?[""]:u}firstPhasePreProcess(u){let A=false;do{A=false;for(let p of u){let y=-1;while(-1!==(y=p.indexOf("**",y+1))){let E=y;while(p[E+1]==="**"){E++}if(E>y){p.splice(y+1,E-y)}let C=p[y+1];const I=p[y+2];const w=p[y+3];if(C!=="..")continue;if(!I||I==="."||I===".."||!w||w==="."||w===".."){continue}A=true;p.splice(y,1);const v=p.slice(0);v[y]="**";u.push(v);y--}if(!this.preserveMultipleSlashes){for(let u=1;u<p.length-1;u++){const y=p[u];if(u===1&&y===""&&p[0]==="")continue;if(y==="."||y===""){A=true;p.splice(u,1);u--}}if(p[0]==="."&&p.length===2&&(p[1]==="."||p[1]==="")){A=true;p.pop()}}let E=0;while(-1!==(E=p.indexOf("..",E+1))){const u=p[E-1];if(u&&u!=="."&&u!==".."&&u!=="**"){A=true;const u=E===1&&p[E+1]==="**";const y=u?["."]:[];p.splice(E-1,2,...y);if(p.length===0)p.push("");E-=2}}}}while(A);return u}secondPhasePreProcess(u){for(let A=0;A<u.length-1;A++){for(let p=A+1;p<u.length;p++){const y=this.partsMatch(u[A],u[p],!this.preserveMultipleSlashes);if(y){u[A]=[];u[p]=y;break}}}return u.filter((u=>u.length))}partsMatch(u,A,p=false){let y=0;let E=0;let C=[];let I="";while(y<u.length&&E<A.length){if(u[y]===A[E]){C.push(I==="b"?A[E]:u[y]);y++;E++}else if(p&&u[y]==="**"&&A[E]===u[y+1]){C.push(u[y]);y++}else if(p&&A[E]==="**"&&u[y]===A[E+1]){C.push(A[E]);E++}else if(u[y]==="*"&&A[E]&&(this.options.dot||!A[E].startsWith("."))&&A[E]!=="**"){if(I==="b")return false;I="a";C.push(u[y]);y++;E++}else if(A[E]==="*"&&u[y]&&(this.options.dot||!u[y].startsWith("."))&&u[y]!=="**"){if(I==="a")return false;I="b";C.push(A[E]);y++;E++}else{return false}}return u.length===A.length&&C}parseNegate(){if(this.nonegate)return;const u=this.pattern;let A=false;let p=0;for(let y=0;y<u.length&&u.charAt(y)==="!";y++){A=!A;p++}if(p)this.pattern=u.slice(p);this.negate=A}matchOne(u,A,p=false){const y=this.options;if(this.isWindows){const p=typeof u[0]==="string"&&/^[a-z]:$/i.test(u[0]);const y=!p&&u[0]===""&&u[1]===""&&u[2]==="?"&&/^[a-z]:$/i.test(u[3]);const E=typeof A[0]==="string"&&/^[a-z]:$/i.test(A[0]);const C=!E&&A[0]===""&&A[1]===""&&A[2]==="?"&&typeof A[3]==="string"&&/^[a-z]:$/i.test(A[3]);const I=y?3:p?0:undefined;const w=C?3:E?0:undefined;if(typeof I==="number"&&typeof w==="number"){const[p,y]=[u[I],A[w]];if(p.toLowerCase()===y.toLowerCase()){A[w]=p;if(w>I){A=A.slice(w)}else if(I>w){u=u.slice(I)}}}}const{optimizationLevel:E=1}=this.options;if(E>=2){u=this.levelTwoFileOptimize(u)}this.debug("matchOne",this,{file:u,pattern:A});this.debug("matchOne",u.length,A.length);for(var C=0,I=0,w=u.length,v=A.length;C<w&&I<v;C++,I++){this.debug("matchOne loop");var B=A[I];var S=u[C];this.debug(A,B,S);if(B===false){return false}if(B===me){this.debug("GLOBSTAR",[A,B,S]);var D=C;var k=I+1;if(k===v){this.debug("** at the end");for(;C<w;C++){if(u[C]==="."||u[C]===".."||!y.dot&&u[C].charAt(0)===".")return false}return true}while(D<w){var Q=u[D];this.debug("\nglobstar while",u,D,A,k,Q);if(this.matchOne(u.slice(D),A.slice(k),p)){this.debug("globstar found match!",D,w,Q);return true}else{if(Q==="."||Q===".."||!y.dot&&Q.charAt(0)==="."){this.debug("dot detected!",u,D,A,k);break}this.debug("globstar swallow a segment, and continue");D++}}if(p){this.debug("\n>>> no match, partial?",u,D,A,k);if(D===w){return true}}return false}let E;if(typeof B==="string"){E=S===B;this.debug("string match",B,S,E)}else{E=B.test(S);this.debug("pattern match",B,S,E)}if(!E)return false}if(C===w&&I===v){return true}else if(C===w){return p}else if(I===v){return C===w-1&&u[C]===""}else{throw new Error("wtf?")}}braceExpand(){return braceExpand(this.pattern,this.options)}parse(u){assertValidPattern(u);const A=this.options;if(u==="**")return me;if(u==="")return"";let p;let y=null;if(p=u.match(fe)){y=A.dot?starTestDot:starTest}else if(p=u.match(ce)){y=(A.nocase?A.dot?starDotExtTestNocaseDot:starDotExtTestNocase:A.dot?starDotExtTestDot:starDotExtTest)(p[1])}else if(p=u.match(Ae)){y=(A.nocase?A.dot?qmarksTestNocaseDot:qmarksTestNocase:A.dot?qmarksTestDot:qmarksTest)(p)}else if(p=u.match(ue)){y=A.dot?starDotStarTestDot:starDotStarTest}else if(p=u.match(de)){y=dotStarTest}const E=AST.fromGlob(u,this.options).toMMPattern();if(y&&typeof E==="object"){Reflect.defineProperty(E,"test",{value:y})}return E}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const u=this.set;if(!u.length){this.regexp=false;return this.regexp}const A=this.options;const p=A.noglobstar?Ee:A.dot?Ce:Ie;const y=new Set(A.nocase?["i"]:[]);let E=u.map((u=>{const A=u.map((u=>{if(u instanceof RegExp){for(const A of u.flags.split(""))y.add(A)}return typeof u==="string"?esm_regExpEscape(u):u===me?me:u._src}));A.forEach(((u,y)=>{const E=A[y+1];const C=A[y-1];if(u!==me||C===me){return}if(C===undefined){if(E!==undefined&&E!==me){A[y+1]="(?:\\/|"+p+"\\/)?"+E}else{A[y]=p}}else if(E===undefined){A[y-1]=C+"(?:\\/|\\/"+p+")?"}else if(E!==me){A[y-1]=C+"(?:\\/|\\/"+p+"\\/)"+E;A[y+1]=me}}));const E=A.filter((u=>u!==me));if(this.partial&&E.length>=1){const u=[];for(let A=1;A<=E.length;A++){u.push(E.slice(0,A).join("/"))}return"(?:"+u.join("|")+")"}return E.join("/")})).join("|");const[C,I]=u.length>1?["(?:",")"]:["",""];E="^"+C+E+I+"$";if(this.partial){E="^(?:\\/|"+C+E.slice(1,-1)+I+")$"}if(this.negate)E="^(?!"+E+").+$";try{this.regexp=new RegExp(E,[...y].join(""))}catch(u){this.regexp=false}return this.regexp}slashSplit(u){if(this.preserveMultipleSlashes){return u.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(u)){return["",...u.split(/\/+/)]}else{return u.split(/\/+/)}}match(u,A=this.partial){this.debug("match",u,this.pattern);if(this.comment){return false}if(this.empty){return u===""}if(u==="/"&&A){return true}const p=this.options;if(this.isWindows){u=u.split("\\").join("/")}const y=this.slashSplit(u);this.debug(this.pattern,"split",y);const E=this.set;this.debug(this.pattern,"set",E);let C=y[y.length-1];if(!C){for(let u=y.length-2;!C&&u>=0;u--){C=y[u]}}for(let u=0;u<E.length;u++){const I=E[u];let w=y;if(p.matchBase&&I.length===1){w=[C]}const v=this.matchOne(w,I,A);if(v){if(p.flipNegate){return true}return!this.negate}}if(p.flipNegate){return false}return this.negate}static defaults(u){return minimatch.defaults(u).Minimatch}}minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape_escape;minimatch.unescape=unescape_unescape;var we=p(3136);const ve=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const Be=new Set;const Se=typeof process==="object"&&!!process?process:{};const emitWarning=(u,A,p,y)=>{typeof Se.emitWarning==="function"?Se.emitWarning(u,A,p,y):console.error(`[${p}] ${A}: ${u}`)};let De=globalThis.AbortController;let ke=globalThis.AbortSignal;if(typeof De==="undefined"){ke=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(u,A){this._onabort.push(A)}};De=class AbortController{constructor(){warnACPolyfill()}signal=new ke;abort(u){if(this.signal.aborted)return;this.signal.reason=u;this.signal.aborted=true;for(const A of this.signal._onabort){A(u)}this.signal.onabort?.(u)}};let u=Se.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!u)return;u=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=u=>!Be.has(u);const Qe=Symbol("type");const isPosInt=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u);const getUintArray=u=>!isPosInt(u)?null:u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(u){super(u);this.fill(0)}}class Stack{heap;length;static#p=false;static create(u){const A=getUintArray(u);if(!A)return[];Stack.#p=true;const p=new Stack(u,A);Stack.#p=false;return p}constructor(u,A){if(!Stack.#p){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new A(u);this.length=0}push(u){this.heap[this.length++]=u}pop(){return this.heap[--this.length]}}class LRUCache{#g;#m;#y;#E;#C;#I;#b;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#v;#B;#S;#D;#k;#Q;#F;#x;#R;#_;#T;#N;#L;#P;#O;#M;#U;#H;#G;static unsafeExposeInternals(u){return{starts:u.#L,ttls:u.#P,autopurgeTimers:u.#O,sizes:u.#N,keyMap:u.#S,keyList:u.#D,valList:u.#k,next:u.#Q,prev:u.#F,get head(){return u.#x},get tail(){return u.#R},free:u.#_,isBackgroundFetch:A=>u.#W(A),backgroundFetch:(A,p,y,E)=>u.#j(A,p,y,E),moveToTail:A=>u.#z(A),indexes:A=>u.#$(A),rindexes:A=>u.#q(A),isStale:A=>u.#V(A)}}get max(){return this.#g}get maxSize(){return this.#m}get calculatedSize(){return this.#B}get size(){return this.#v}get fetchMethod(){return this.#I}get memoMethod(){return this.#b}get dispose(){return this.#y}get onInsert(){return this.#E}get disposeAfter(){return this.#C}constructor(u){const{max:A=0,ttl:p,ttlResolution:y=1,ttlAutopurge:E,updateAgeOnGet:C,updateAgeOnHas:I,allowStale:w,dispose:v,onInsert:B,disposeAfter:S,noDisposeOnSet:D,noUpdateTTL:k,maxSize:Q=0,maxEntrySize:F=0,sizeCalculation:R,fetchMethod:_,memoMethod:P,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:U,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:G,ignoreFetchAbort:j,perf:$}=u;if($!==undefined){if(typeof $?.now!=="function"){throw new TypeError("perf option must have a now() method if specified")}}this.#w=$??ve;if(A!==0&&!isPosInt(A)){throw new TypeError("max option must be a nonnegative integer")}const q=A?getUintArray(A):Array;if(!q){throw new Error("invalid max value: "+A)}this.#g=A;this.#m=Q;this.maxEntrySize=F||this.#m;this.sizeCalculation=R;if(this.sizeCalculation){if(!this.#m&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(P!==undefined&&typeof P!=="function"){throw new TypeError("memoMethod must be a function if defined")}this.#b=P;if(_!==undefined&&typeof _!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#I=_;this.#U=!!_;this.#S=new Map;this.#D=new Array(A).fill(undefined);this.#k=new Array(A).fill(undefined);this.#Q=new q(A);this.#F=new q(A);this.#x=0;this.#R=0;this.#_=Stack.create(A);this.#v=0;this.#B=0;if(typeof v==="function"){this.#y=v}if(typeof B==="function"){this.#E=B}if(typeof S==="function"){this.#C=S;this.#T=[]}else{this.#C=undefined;this.#T=undefined}this.#M=!!this.#y;this.#G=!!this.#E;this.#H=!!this.#C;this.noDisposeOnSet=!!D;this.noUpdateTTL=!!k;this.noDeleteOnFetchRejection=!!O;this.allowStaleOnFetchRejection=!!H;this.allowStaleOnFetchAbort=!!G;this.ignoreFetchAbort=!!j;if(this.maxEntrySize!==0){if(this.#m!==0){if(!isPosInt(this.#m)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#K()}this.allowStale=!!w;this.noDeleteOnStaleGet=!!U;this.updateAgeOnGet=!!C;this.updateAgeOnHas=!!I;this.ttlResolution=isPosInt(y)||y===0?y:1;this.ttlAutopurge=!!E;this.ttl=p||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#J()}if(this.#g===0&&this.ttl===0&&this.#m===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#m){const u="LRU_CACHE_UNBOUNDED";if(shouldWarn(u)){Be.add(u);const A="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(A,"UnboundedCacheWarning",u,LRUCache)}}}getRemainingTTL(u){return this.#S.has(u)?Infinity:0}#J(){const u=new ZeroArray(this.#g);const A=new ZeroArray(this.#g);this.#P=u;this.#L=A;const p=this.ttlAutopurge?new Array(this.#g):undefined;this.#O=p;this.#Y=(y,E,C=this.#w.now())=>{A[y]=E!==0?C:0;u[y]=E;if(p?.[y]){clearTimeout(p[y]);p[y]=undefined}if(E!==0&&p){const u=setTimeout((()=>{if(this.#V(y)){this.#X(this.#D[y],"expire")}}),E+1);if(u.unref){u.unref()}p[y]=u}};this.#Z=p=>{A[p]=u[p]!==0?this.#w.now():0};this.#ee=(p,E)=>{if(u[E]){const C=u[E];const I=A[E];if(!C||!I)return;p.ttl=C;p.start=I;p.now=y||getNow();const w=p.now-I;p.remainingTTL=C-w}};let y=0;const getNow=()=>{const u=this.#w.now();if(this.ttlResolution>0){y=u;const A=setTimeout((()=>y=0),this.ttlResolution);if(A.unref){A.unref()}}return u};this.getRemainingTTL=p=>{const E=this.#S.get(p);if(E===undefined){return 0}const C=u[E];const I=A[E];if(!C||!I){return Infinity}const w=(y||getNow())-I;return C-w};this.#V=p=>{const E=A[p];const C=u[p];return!!C&&!!E&&(y||getNow())-E>C}}#Z=()=>{};#ee=()=>{};#Y=()=>{};#V=()=>false;#K(){const u=new ZeroArray(this.#g);this.#B=0;this.#N=u;this.#te=A=>{this.#B-=u[A];u[A]=0};this.#ne=(u,A,p,y)=>{if(this.#W(A)){return 0}if(!isPosInt(p)){if(y){if(typeof y!=="function"){throw new TypeError("sizeCalculation must be a function")}p=y(A,u);if(!isPosInt(p)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return p};this.#re=(A,p,y)=>{u[A]=p;if(this.#m){const p=this.#m-u[A];while(this.#B>p){this.#se(true)}}this.#B+=u[A];if(y){y.entrySize=p;y.totalCalculatedSize=this.#B}}}#te=u=>{};#re=(u,A,p)=>{};#ne=(u,A,p,y)=>{if(p||y){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#$({allowStale:u=this.allowStale}={}){if(this.#v){for(let A=this.#R;true;){if(!this.#ie(A)){break}if(u||!this.#V(A)){yield A}if(A===this.#x){break}else{A=this.#F[A]}}}}*#q({allowStale:u=this.allowStale}={}){if(this.#v){for(let A=this.#x;true;){if(!this.#ie(A)){break}if(u||!this.#V(A)){yield A}if(A===this.#R){break}else{A=this.#Q[A]}}}}#ie(u){return u!==undefined&&this.#S.get(this.#D[u])===u}*entries(){for(const u of this.#$()){if(this.#k[u]!==undefined&&this.#D[u]!==undefined&&!this.#W(this.#k[u])){yield[this.#D[u],this.#k[u]]}}}*rentries(){for(const u of this.#q()){if(this.#k[u]!==undefined&&this.#D[u]!==undefined&&!this.#W(this.#k[u])){yield[this.#D[u],this.#k[u]]}}}*keys(){for(const u of this.#$()){const A=this.#D[u];if(A!==undefined&&!this.#W(this.#k[u])){yield A}}}*rkeys(){for(const u of this.#q()){const A=this.#D[u];if(A!==undefined&&!this.#W(this.#k[u])){yield A}}}*values(){for(const u of this.#$()){const A=this.#k[u];if(A!==undefined&&!this.#W(this.#k[u])){yield this.#k[u]}}}*rvalues(){for(const u of this.#q()){const A=this.#k[u];if(A!==undefined&&!this.#W(this.#k[u])){yield this.#k[u]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(u,A={}){for(const p of this.#$()){const y=this.#k[p];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined)continue;if(u(E,this.#D[p],this)){return this.get(this.#D[p],A)}}}forEach(u,A=this){for(const p of this.#$()){const y=this.#k[p];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.#D[p],this)}}rforEach(u,A=this){for(const p of this.#q()){const y=this.#k[p];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.#D[p],this)}}purgeStale(){let u=false;for(const A of this.#q({allowStale:true})){if(this.#V(A)){this.#X(this.#D[A],"expire");u=true}}return u}info(u){const A=this.#S.get(u);if(A===undefined)return undefined;const p=this.#k[A];const y=this.#W(p)?p.__staleWhileFetching:p;if(y===undefined)return undefined;const E={value:y};if(this.#P&&this.#L){const u=this.#P[A];const p=this.#L[A];if(u&&p){const A=u-(this.#w.now()-p);E.ttl=A;E.start=Date.now()}}if(this.#N){E.size=this.#N[A]}return E}dump(){const u=[];for(const A of this.#$({allowStale:true})){const p=this.#D[A];const y=this.#k[A];const E=this.#W(y)?y.__staleWhileFetching:y;if(E===undefined||p===undefined)continue;const C={value:E};if(this.#P&&this.#L){C.ttl=this.#P[A];const u=this.#w.now()-this.#L[A];C.start=Math.floor(Date.now()-u)}if(this.#N){C.size=this.#N[A]}u.unshift([p,C])}return u}load(u){this.clear();for(const[A,p]of u){if(p.start){const u=Date.now()-p.start;p.start=this.#w.now()-u}this.set(A,p.value,p)}}set(u,A,p={}){if(A===undefined){this.delete(u);return this}const{ttl:y=this.ttl,start:E,noDisposeOnSet:C=this.noDisposeOnSet,sizeCalculation:I=this.sizeCalculation,status:w}=p;let{noUpdateTTL:v=this.noUpdateTTL}=p;const B=this.#ne(u,A,p.size||0,I);if(this.maxEntrySize&&B>this.maxEntrySize){if(w){w.set="miss";w.maxEntrySizeExceeded=true}this.#X(u,"set");return this}let S=this.#v===0?undefined:this.#S.get(u);if(S===undefined){S=this.#v===0?this.#R:this.#_.length!==0?this.#_.pop():this.#v===this.#g?this.#se(false):this.#v;this.#D[S]=u;this.#k[S]=A;this.#S.set(u,S);this.#Q[this.#R]=S;this.#F[S]=this.#R;this.#R=S;this.#v++;this.#re(S,B,w);if(w)w.set="add";v=false;if(this.#G){this.#E?.(A,u,"add")}}else{this.#z(S);const p=this.#k[S];if(A!==p){if(this.#U&&this.#W(p)){p.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:A}=p;if(A!==undefined&&!C){if(this.#M){this.#y?.(A,u,"set")}if(this.#H){this.#T?.push([A,u,"set"])}}}else if(!C){if(this.#M){this.#y?.(p,u,"set")}if(this.#H){this.#T?.push([p,u,"set"])}}this.#te(S);this.#re(S,B,w);this.#k[S]=A;if(w){w.set="replace";const u=p&&this.#W(p)?p.__staleWhileFetching:p;if(u!==undefined)w.oldValue=u}}else if(w){w.set="update"}if(this.#G){this.onInsert?.(A,u,A===p?"update":"replace")}}if(y!==0&&!this.#P){this.#J()}if(this.#P){if(!v){this.#Y(S,y,E)}if(w)this.#ee(w,S)}if(!C&&this.#H&&this.#T){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}return this}pop(){try{while(this.#v){const u=this.#k[this.#x];this.#se(true);if(this.#W(u)){if(u.__staleWhileFetching){return u.__staleWhileFetching}}else if(u!==undefined){return u}}}finally{if(this.#H&&this.#T){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}}}#se(u){const A=this.#x;const p=this.#D[A];const y=this.#k[A];if(this.#U&&this.#W(y)){y.__abortController.abort(new Error("evicted"))}else if(this.#M||this.#H){if(this.#M){this.#y?.(y,p,"evict")}if(this.#H){this.#T?.push([y,p,"evict"])}}this.#te(A);if(this.#O?.[A]){clearTimeout(this.#O[A]);this.#O[A]=undefined}if(u){this.#D[A]=undefined;this.#k[A]=undefined;this.#_.push(A)}if(this.#v===1){this.#x=this.#R=0;this.#_.length=0}else{this.#x=this.#Q[A]}this.#S.delete(p);this.#v--;return A}has(u,A={}){const{updateAgeOnHas:p=this.updateAgeOnHas,status:y}=A;const E=this.#S.get(u);if(E!==undefined){const u=this.#k[E];if(this.#W(u)&&u.__staleWhileFetching===undefined){return false}if(!this.#V(E)){if(p){this.#Z(E)}if(y){y.has="hit";this.#ee(y,E)}return true}else if(y){y.has="stale";this.#ee(y,E)}}else if(y){y.has="miss"}return false}peek(u,A={}){const{allowStale:p=this.allowStale}=A;const y=this.#S.get(u);if(y===undefined||!p&&this.#V(y)){return}const E=this.#k[y];return this.#W(E)?E.__staleWhileFetching:E}#j(u,A,p,y){const E=A===undefined?undefined:this.#k[A];if(this.#W(E)){return E}const C=new De;const{signal:I}=p;I?.addEventListener("abort",(()=>C.abort(I.reason)),{signal:C.signal});const w={signal:C.signal,options:p,context:y};const cb=(y,E=false)=>{const{aborted:I}=C.signal;const B=p.ignoreFetchAbort&&y!==undefined;if(p.status){if(I&&!E){p.status.fetchAborted=true;p.status.fetchError=C.signal.reason;if(B)p.status.fetchAbortIgnored=true}else{p.status.fetchResolved=true}}if(I&&!B&&!E){return fetchFail(C.signal.reason)}const S=v;const D=this.#k[A];if(D===v||B&&E&&D===undefined){if(y===undefined){if(S.__staleWhileFetching!==undefined){this.#k[A]=S.__staleWhileFetching}else{this.#X(u,"fetch")}}else{if(p.status)p.status.fetchUpdated=true;this.set(u,y,w.options)}}return y};const eb=u=>{if(p.status){p.status.fetchRejected=true;p.status.fetchError=u}return fetchFail(u)};const fetchFail=y=>{const{aborted:E}=C.signal;const I=E&&p.allowStaleOnFetchAbort;const w=I||p.allowStaleOnFetchRejection;const B=w||p.noDeleteOnFetchRejection;const S=v;if(this.#k[A]===v){const p=!B||S.__staleWhileFetching===undefined;if(p){this.#X(u,"fetch")}else if(!I){this.#k[A]=S.__staleWhileFetching}}if(w){if(p.status&&S.__staleWhileFetching!==undefined){p.status.returnedStale=true}return S.__staleWhileFetching}else if(S.__returned===S){throw y}};const pcall=(A,y)=>{const I=this.#I?.(u,E,w);if(I&&I instanceof Promise){I.then((u=>A(u===undefined?undefined:u)),y)}C.signal.addEventListener("abort",(()=>{if(!p.ignoreFetchAbort||p.allowStaleOnFetchAbort){A(undefined);if(p.allowStaleOnFetchAbort){A=u=>cb(u,true)}}}))};if(p.status)p.status.fetchDispatched=true;const v=new Promise(pcall).then(cb,eb);const B=Object.assign(v,{__abortController:C,__staleWhileFetching:E,__returned:undefined});if(A===undefined){this.set(u,B,{...w.options,status:undefined});A=this.#S.get(u)}else{this.#k[A]=B}return B}#W(u){if(!this.#U)return false;const A=u;return!!A&&A instanceof Promise&&A.hasOwnProperty("__staleWhileFetching")&&A.__abortController instanceof De}async fetch(u,A={}){const{allowStale:p=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:E=this.noDeleteOnStaleGet,ttl:C=this.ttl,noDisposeOnSet:I=this.noDisposeOnSet,size:w=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:B=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:D=this.allowStaleOnFetchRejection,ignoreFetchAbort:k=this.ignoreFetchAbort,allowStaleOnFetchAbort:Q=this.allowStaleOnFetchAbort,context:F,forceRefresh:R=false,status:_,signal:P}=A;if(!this.#U){if(_)_.fetch="get";return this.get(u,{allowStale:p,updateAgeOnGet:y,noDeleteOnStaleGet:E,status:_})}const O={allowStale:p,updateAgeOnGet:y,noDeleteOnStaleGet:E,ttl:C,noDisposeOnSet:I,size:w,sizeCalculation:v,noUpdateTTL:B,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:Q,ignoreFetchAbort:k,status:_,signal:P};let U=this.#S.get(u);if(U===undefined){if(_)_.fetch="miss";const A=this.#j(u,U,O,F);return A.__returned=A}else{const A=this.#k[U];if(this.#W(A)){const u=p&&A.__staleWhileFetching!==undefined;if(_){_.fetch="inflight";if(u)_.returnedStale=true}return u?A.__staleWhileFetching:A.__returned=A}const E=this.#V(U);if(!R&&!E){if(_)_.fetch="hit";this.#z(U);if(y){this.#Z(U)}if(_)this.#ee(_,U);return A}const C=this.#j(u,U,O,F);const I=C.__staleWhileFetching!==undefined;const w=I&&p;if(_){_.fetch=E?"stale":"refresh";if(w&&E)_.returnedStale=true}return w?C.__staleWhileFetching:C.__returned=C}}async forceFetch(u,A={}){const p=await this.fetch(u,A);if(p===undefined)throw new Error("fetch() returned undefined");return p}memo(u,A={}){const p=this.#b;if(!p){throw new Error("no memoMethod provided to constructor")}const{context:y,forceRefresh:E,...C}=A;const I=this.get(u,C);if(!E&&I!==undefined)return I;const w=p(u,I,{options:C,context:y});this.set(u,w,C);return w}get(u,A={}){const{allowStale:p=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:E=this.noDeleteOnStaleGet,status:C}=A;const I=this.#S.get(u);if(I!==undefined){const A=this.#k[I];const w=this.#W(A);if(C)this.#ee(C,I);if(this.#V(I)){if(C)C.get="stale";if(!w){if(!E){this.#X(u,"expire")}if(C&&p)C.returnedStale=true;return p?A:undefined}else{if(C&&p&&A.__staleWhileFetching!==undefined){C.returnedStale=true}return p?A.__staleWhileFetching:undefined}}else{if(C)C.get="hit";if(w){return A.__staleWhileFetching}this.#z(I);if(y){this.#Z(I)}return A}}else if(C){C.get="miss"}}#oe(u,A){this.#F[A]=u;this.#Q[u]=A}#z(u){if(u!==this.#R){if(u===this.#x){this.#x=this.#Q[u]}else{this.#oe(this.#F[u],this.#Q[u])}this.#oe(this.#R,u);this.#R=u}}delete(u){return this.#X(u,"delete")}#X(u,A){let p=false;if(this.#v!==0){const y=this.#S.get(u);if(y!==undefined){if(this.#O?.[y]){clearTimeout(this.#O?.[y]);this.#O[y]=undefined}p=true;if(this.#v===1){this.#ae(A)}else{this.#te(y);const p=this.#k[y];if(this.#W(p)){p.__abortController.abort(new Error("deleted"))}else if(this.#M||this.#H){if(this.#M){this.#y?.(p,u,A)}if(this.#H){this.#T?.push([p,u,A])}}this.#S.delete(u);this.#D[y]=undefined;this.#k[y]=undefined;if(y===this.#R){this.#R=this.#F[y]}else if(y===this.#x){this.#x=this.#Q[y]}else{const u=this.#F[y];this.#Q[u]=this.#Q[y];const A=this.#Q[y];this.#F[A]=this.#F[y]}this.#v--;this.#_.push(y)}}}if(this.#H&&this.#T?.length){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}return p}clear(){return this.#ae("delete")}#ae(u){for(const A of this.#q({allowStale:true})){const p=this.#k[A];if(this.#W(p)){p.__abortController.abort(new Error("deleted"))}else{const y=this.#D[A];if(this.#M){this.#y?.(p,y,u)}if(this.#H){this.#T?.push([p,y,u])}}}this.#S.clear();this.#k.fill(undefined);this.#D.fill(undefined);if(this.#P&&this.#L){this.#P.fill(0);this.#L.fill(0);for(const u of this.#O??[]){if(u!==undefined)clearTimeout(u)}this.#O?.fill(undefined)}if(this.#N){this.#N.fill(0)}this.#x=0;this.#R=0;this.#_.length=0;this.#B=0;this.#v=0;if(this.#H&&this.#T){const u=this.#T;let A;while(A=u?.shift()){this.#C?.(...A)}}}}var Fe=p(6760);var xe=p(9896);var Re=p.n(xe);var _e=p(3024);var Te=p.t(_e,2);var Ne=p(1455);var Le=p(8474);var Pe=p(7075);const Oe=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:string_decoder");const Me=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=u=>!!u&&typeof u==="object"&&(u instanceof Minipass||u instanceof Pe||isReadable(u)||isWritable(u));const isReadable=u=>!!u&&typeof u==="object"&&u instanceof Le.EventEmitter&&typeof u.pipe==="function"&&u.pipe!==Pe.Writable.prototype.pipe;const isWritable=u=>!!u&&typeof u==="object"&&u instanceof Le.EventEmitter&&typeof u.write==="function"&&typeof u.end==="function";const Ue=Symbol("EOF");const He=Symbol("maybeEmitEnd");const Ge=Symbol("emittedEnd");const We=Symbol("emittingEnd");const je=Symbol("emittedError");const ze=Symbol("closed");const $e=Symbol("read");const qe=Symbol("flush");const Ve=Symbol("flushChunk");const Ke=Symbol("encoding");const Je=Symbol("decoder");const Ye=Symbol("flowing");const Xe=Symbol("paused");const Ze=Symbol("resume");const et=Symbol("buffer");const tt=Symbol("pipes");const nt=Symbol("bufferLength");const rt=Symbol("bufferPush");const st=Symbol("bufferShift");const it=Symbol("objectMode");const ot=Symbol("destroyed");const at=Symbol("error");const lt=Symbol("emitData");const ct=Symbol("emitEnd");const ut=Symbol("emitEnd2");const dt=Symbol("async");const ft=Symbol("abort");const At=Symbol("aborted");const ht=Symbol("signal");const pt=Symbol("dataListeners");const gt=Symbol("discarded");const defer=u=>Promise.resolve().then(u);const nodefer=u=>u();const isEndish=u=>u==="end"||u==="finish"||u==="prefinish";const isArrayBufferLike=u=>u instanceof ArrayBuffer||!!u&&typeof u==="object"&&u.constructor&&u.constructor.name==="ArrayBuffer"&&u.byteLength>=0;const isArrayBufferView=u=>!Buffer.isBuffer(u)&&ArrayBuffer.isView(u);class Pipe{src;dest;opts;ondrain;constructor(u,A,p){this.src=u;this.dest=A;this.opts=p;this.ondrain=()=>u[Ze]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(u){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(u,A,p){super(u,A,p);this.proxyErrors=u=>A.emit("error",u);u.on("error",this.proxyErrors)}}const isObjectModeOptions=u=>!!u.objectMode;const isEncodingOptions=u=>!u.objectMode&&!!u.encoding&&u.encoding!=="buffer";class Minipass extends Le.EventEmitter{[Ye]=false;[Xe]=false;[tt]=[];[et]=[];[it];[Ke];[dt];[Je];[Ue]=false;[Ge]=false;[We]=false;[ze]=false;[je]=null;[nt]=0;[ot]=false;[ht];[At]=false;[pt]=0;[gt]=false;writable=true;readable=true;constructor(...u){const A=u[0]||{};super();if(A.objectMode&&typeof A.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(A)){this[it]=true;this[Ke]=null}else if(isEncodingOptions(A)){this[Ke]=A.encoding;this[it]=false}else{this[it]=false;this[Ke]=null}this[dt]=!!A.async;this[Je]=this[Ke]?new Oe.StringDecoder(this[Ke]):null;if(A&&A.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[et]})}if(A&&A.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[tt]})}const{signal:p}=A;if(p){this[ht]=p;if(p.aborted){this[ft]()}else{p.addEventListener("abort",(()=>this[ft]()))}}}get bufferLength(){return this[nt]}get encoding(){return this[Ke]}set encoding(u){throw new Error("Encoding must be set at instantiation time")}setEncoding(u){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[it]}set objectMode(u){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[dt]}set["async"](u){this[dt]=this[dt]||!!u}[ft](){this[At]=true;this.emit("abort",this[ht]?.reason);this.destroy(this[ht]?.reason)}get aborted(){return this[At]}set aborted(u){}write(u,A,p){if(this[At])return false;if(this[Ue])throw new Error("write after end");if(this[ot]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof A==="function"){p=A;A="utf8"}if(!A)A="utf8";const y=this[dt]?defer:nodefer;if(!this[it]&&!Buffer.isBuffer(u)){if(isArrayBufferView(u)){u=Buffer.from(u.buffer,u.byteOffset,u.byteLength)}else if(isArrayBufferLike(u)){u=Buffer.from(u)}else if(typeof u!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[it]){if(this[Ye]&&this[nt]!==0)this[qe](true);if(this[Ye])this.emit("data",u);else this[rt](u);if(this[nt]!==0)this.emit("readable");if(p)y(p);return this[Ye]}if(!u.length){if(this[nt]!==0)this.emit("readable");if(p)y(p);return this[Ye]}if(typeof u==="string"&&!(A===this[Ke]&&!this[Je]?.lastNeed)){u=Buffer.from(u,A)}if(Buffer.isBuffer(u)&&this[Ke]){u=this[Je].write(u)}if(this[Ye]&&this[nt]!==0)this[qe](true);if(this[Ye])this.emit("data",u);else this[rt](u);if(this[nt]!==0)this.emit("readable");if(p)y(p);return this[Ye]}read(u){if(this[ot])return null;this[gt]=false;if(this[nt]===0||u===0||u&&u>this[nt]){this[He]();return null}if(this[it])u=null;if(this[et].length>1&&!this[it]){this[et]=[this[Ke]?this[et].join(""):Buffer.concat(this[et],this[nt])]}const A=this[$e](u||null,this[et][0]);this[He]();return A}[$e](u,A){if(this[it])this[st]();else{const p=A;if(u===p.length||u===null)this[st]();else if(typeof p==="string"){this[et][0]=p.slice(u);A=p.slice(0,u);this[nt]-=u}else{this[et][0]=p.subarray(u);A=p.subarray(0,u);this[nt]-=u}}this.emit("data",A);if(!this[et].length&&!this[Ue])this.emit("drain");return A}end(u,A,p){if(typeof u==="function"){p=u;u=undefined}if(typeof A==="function"){p=A;A="utf8"}if(u!==undefined)this.write(u,A);if(p)this.once("end",p);this[Ue]=true;this.writable=false;if(this[Ye]||!this[Xe])this[He]();return this}[Ze](){if(this[ot])return;if(!this[pt]&&!this[tt].length){this[gt]=true}this[Xe]=false;this[Ye]=true;this.emit("resume");if(this[et].length)this[qe]();else if(this[Ue])this[He]();else this.emit("drain")}resume(){return this[Ze]()}pause(){this[Ye]=false;this[Xe]=true;this[gt]=false}get destroyed(){return this[ot]}get flowing(){return this[Ye]}get paused(){return this[Xe]}[rt](u){if(this[it])this[nt]+=1;else this[nt]+=u.length;this[et].push(u)}[st](){if(this[it])this[nt]-=1;else this[nt]-=this[et][0].length;return this[et].shift()}[qe](u=false){do{}while(this[Ve](this[st]())&&this[et].length);if(!u&&!this[et].length&&!this[Ue])this.emit("drain")}[Ve](u){this.emit("data",u);return this[Ye]}pipe(u,A){if(this[ot])return u;this[gt]=false;const p=this[Ge];A=A||{};if(u===Me.stdout||u===Me.stderr)A.end=false;else A.end=A.end!==false;A.proxyErrors=!!A.proxyErrors;if(p){if(A.end)u.end()}else{this[tt].push(!A.proxyErrors?new Pipe(this,u,A):new PipeProxyErrors(this,u,A));if(this[dt])defer((()=>this[Ze]()));else this[Ze]()}return u}unpipe(u){const A=this[tt].find((A=>A.dest===u));if(A){if(this[tt].length===1){if(this[Ye]&&this[pt]===0){this[Ye]=false}this[tt]=[]}else this[tt].splice(this[tt].indexOf(A),1);A.unpipe()}}addListener(u,A){return this.on(u,A)}on(u,A){const p=super.on(u,A);if(u==="data"){this[gt]=false;this[pt]++;if(!this[tt].length&&!this[Ye]){this[Ze]()}}else if(u==="readable"&&this[nt]!==0){super.emit("readable")}else if(isEndish(u)&&this[Ge]){super.emit(u);this.removeAllListeners(u)}else if(u==="error"&&this[je]){const u=A;if(this[dt])defer((()=>u.call(this,this[je])));else u.call(this,this[je])}return p}removeListener(u,A){return this.off(u,A)}off(u,A){const p=super.off(u,A);if(u==="data"){this[pt]=this.listeners("data").length;if(this[pt]===0&&!this[gt]&&!this[tt].length){this[Ye]=false}}return p}removeAllListeners(u){const A=super.removeAllListeners(u);if(u==="data"||u===undefined){this[pt]=0;if(!this[gt]&&!this[tt].length){this[Ye]=false}}return A}get emittedEnd(){return this[Ge]}[He](){if(!this[We]&&!this[Ge]&&!this[ot]&&this[et].length===0&&this[Ue]){this[We]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[ze])this.emit("close");this[We]=false}}emit(u,...A){const p=A[0];if(u!=="error"&&u!=="close"&&u!==ot&&this[ot]){return false}else if(u==="data"){return!this[it]&&!p?false:this[dt]?(defer((()=>this[lt](p))),true):this[lt](p)}else if(u==="end"){return this[ct]()}else if(u==="close"){this[ze]=true;if(!this[Ge]&&!this[ot])return false;const u=super.emit("close");this.removeAllListeners("close");return u}else if(u==="error"){this[je]=p;super.emit(at,p);const u=!this[ht]||this.listeners("error").length?super.emit("error",p):false;this[He]();return u}else if(u==="resume"){const u=super.emit("resume");this[He]();return u}else if(u==="finish"||u==="prefinish"){const A=super.emit(u);this.removeAllListeners(u);return A}const y=super.emit(u,...A);this[He]();return y}[lt](u){for(const A of this[tt]){if(A.dest.write(u)===false)this.pause()}const A=this[gt]?false:super.emit("data",u);this[He]();return A}[ct](){if(this[Ge])return false;this[Ge]=true;this.readable=false;return this[dt]?(defer((()=>this[ut]())),true):this[ut]()}[ut](){if(this[Je]){const u=this[Je].end();if(u){for(const A of this[tt]){A.dest.write(u)}if(!this[gt])super.emit("data",u)}}for(const u of this[tt]){u.end()}const u=super.emit("end");this.removeAllListeners("end");return u}async collect(){const u=Object.assign([],{dataLength:0});if(!this[it])u.dataLength=0;const A=this.promise();this.on("data",(A=>{u.push(A);if(!this[it])u.dataLength+=A.length}));await A;return u}async concat(){if(this[it]){throw new Error("cannot concat in objectMode")}const u=await this.collect();return this[Ke]?u.join(""):Buffer.concat(u,u.dataLength)}async promise(){return new Promise(((u,A)=>{this.on(ot,(()=>A(new Error("stream destroyed"))));this.on("error",(u=>A(u)));this.on("end",(()=>u()))}))}[Symbol.asyncIterator](){this[gt]=false;let u=false;const stop=async()=>{this.pause();u=true;return{value:undefined,done:true}};const next=()=>{if(u)return stop();const A=this.read();if(A!==null)return Promise.resolve({done:false,value:A});if(this[Ue])return stop();let p;let y;const onerr=u=>{this.off("data",ondata);this.off("end",onend);this.off(ot,ondestroy);stop();y(u)};const ondata=u=>{this.off("error",onerr);this.off("end",onend);this.off(ot,ondestroy);this.pause();p({value:u,done:!!this[Ue]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(ot,ondestroy);stop();p({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((u,A)=>{y=A;p=u;this.once(ot,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[gt]=false;let u=false;const stop=()=>{this.pause();this.off(at,stop);this.off(ot,stop);this.off("end",stop);u=true;return{done:true,value:undefined}};const next=()=>{if(u)return stop();const A=this.read();return A===null?stop():{done:false,value:A}};this.once("end",stop);this.once(at,stop);this.once(ot,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(u){if(this[ot]){if(u)this.emit("error",u);else this.emit(ot);return this}this[ot]=true;this[gt]=true;this[et].length=0;this[nt]=0;const A=this;if(typeof A.close==="function"&&!this[ze])A.close();if(u)this.emit("error",u);else this.emit(ot);return this}static get isStream(){return isStream}}const mt=xe.realpathSync.native;const yt={lstatSync:xe.lstatSync,readdir:xe.readdir,readdirSync:xe.readdirSync,readlinkSync:xe.readlinkSync,realpathSync:mt,promises:{lstat:Ne.lstat,readdir:Ne.readdir,readlink:Ne.readlink,realpath:Ne.realpath}};const fsFromOption=u=>!u||u===yt||u===Te?yt:{...yt,...u,promises:{...yt.promises,...u.promises||{}}};const Et=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=u=>u.replace(/\//g,"\\").replace(Et,"$1\\");const Ct=/[\\\/]/;const It=0;const bt=1;const wt=2;const vt=4;const Bt=6;const St=8;const Dt=10;const kt=12;const Qt=15;const Ft=~Qt;const xt=16;const Rt=32;const _t=64;const Tt=128;const Nt=256;const Lt=512;const Pt=_t|Tt|Lt;const Ot=1023;const entToType=u=>u.isFile()?St:u.isDirectory()?vt:u.isSymbolicLink()?Dt:u.isCharacterDevice()?wt:u.isBlockDevice()?Bt:u.isSocket()?kt:u.isFIFO()?bt:It;const Mt=new LRUCache({max:2**12});const normalize=u=>{const A=Mt.get(u);if(A)return A;const p=u.normalize("NFKD");Mt.set(u,p);return p};const Ut=new LRUCache({max:2**12});const normalizeNocase=u=>{const A=Ut.get(u);if(A)return A;const p=normalize(u.toLowerCase());Ut.set(u,p);return p};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(u=16*1024){super({maxSize:u,sizeCalculation:u=>u.length+1})}}const Ht=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#le;#ce;get dev(){return this.#ce}#ue;get mode(){return this.#ue}#de;get nlink(){return this.#de}#fe;get uid(){return this.#fe}#Ae;get gid(){return this.#Ae}#he;get rdev(){return this.#he}#pe;get blksize(){return this.#pe}#ge;get ino(){return this.#ge}#v;get size(){return this.#v}#me;get blocks(){return this.#me}#ye;get atimeMs(){return this.#ye}#Ee;get mtimeMs(){return this.#Ee}#Ce;get ctimeMs(){return this.#Ce}#Ie;get birthtimeMs(){return this.#Ie}#be;get atime(){return this.#be}#we;get mtime(){return this.#we}#ve;get ctime(){return this.#ve}#Be;get birthtime(){return this.#Be}#Se;#De;#ke;#Qe;#Fe;#xe;#Re;#_e;#Te;#Ne;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(u,A=It,p,y,E,C,I){this.name=u;this.#Se=E?normalizeNocase(u):normalize(u);this.#Re=A&Ot;this.nocase=E;this.roots=y;this.root=p||this;this.#_e=C;this.#ke=I.fullpath;this.#Fe=I.relative;this.#xe=I.relativePosix;this.parent=I.parent;if(this.parent){this.#le=this.parent.#le}else{this.#le=fsFromOption(I.fs)}}depth(){if(this.#De!==undefined)return this.#De;if(!this.parent)return this.#De=0;return this.#De=this.parent.depth()+1}childrenCache(){return this.#_e}resolve(u){if(!u){return this}const A=this.getRootString(u);const p=u.substring(A.length);const y=p.split(this.splitSep);const E=A?this.getRoot(A).#Le(y):this.#Le(y);return E}#Le(u){let A=this;for(const p of u){A=A.child(p)}return A}children(){const u=this.#_e.get(this);if(u){return u}const A=Object.assign([],{provisional:0});this.#_e.set(this,A);this.#Re&=~xt;return A}child(u,A){if(u===""||u==="."){return this}if(u===".."){return this.parent||this}const p=this.children();const y=this.nocase?normalizeNocase(u):normalize(u);for(const u of p){if(u.#Se===y){return u}}const E=this.parent?this.sep:"";const C=this.#ke?this.#ke+E+u:undefined;const I=this.newChild(u,It,{...A,parent:this,fullpath:C});if(!this.canReaddir()){I.#Re|=Tt}p.push(I);return I}relative(){if(this.isCWD)return"";if(this.#Fe!==undefined){return this.#Fe}const u=this.name;const A=this.parent;if(!A){return this.#Fe=this.name}const p=A.relative();return p+(!p||!A.parent?"":this.sep)+u}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#xe!==undefined)return this.#xe;const u=this.name;const A=this.parent;if(!A){return this.#xe=this.fullpathPosix()}const p=A.relativePosix();return p+(!p||!A.parent?"":"/")+u}fullpath(){if(this.#ke!==undefined){return this.#ke}const u=this.name;const A=this.parent;if(!A){return this.#ke=this.name}const p=A.fullpath();const y=p+(!A.parent?"":this.sep)+u;return this.#ke=y}fullpathPosix(){if(this.#Qe!==undefined)return this.#Qe;if(this.sep==="/")return this.#Qe=this.fullpath();if(!this.parent){const u=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(u)){return this.#Qe=`//?/${u}`}else{return this.#Qe=u}}const u=this.parent;const A=u.fullpathPosix();const p=A+(!A||!u.parent?"":"/")+this.name;return this.#Qe=p}isUnknown(){return(this.#Re&Qt)===It}isType(u){return this[`is${u}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Re&Qt)===St}isDirectory(){return(this.#Re&Qt)===vt}isCharacterDevice(){return(this.#Re&Qt)===wt}isBlockDevice(){return(this.#Re&Qt)===Bt}isFIFO(){return(this.#Re&Qt)===bt}isSocket(){return(this.#Re&Qt)===kt}isSymbolicLink(){return(this.#Re&Dt)===Dt}lstatCached(){return this.#Re&Rt?this:undefined}readlinkCached(){return this.#Te}realpathCached(){return this.#Ne}readdirCached(){const u=this.children();return u.slice(0,u.provisional)}canReadlink(){if(this.#Te)return true;if(!this.parent)return false;const u=this.#Re&Qt;return!(u!==It&&u!==Dt||this.#Re&Nt||this.#Re&Tt)}calledReaddir(){return!!(this.#Re&xt)}isENOENT(){return!!(this.#Re&Tt)}isNamed(u){return!this.nocase?this.#Se===normalize(u):this.#Se===normalizeNocase(u)}async readlink(){const u=this.#Te;if(u){return u}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const u=await this.#le.promises.readlink(this.fullpath());const A=(await this.parent.realpath())?.resolve(u);if(A){return this.#Te=A}}catch(u){this.#Pe(u.code);return undefined}}readlinkSync(){const u=this.#Te;if(u){return u}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const u=this.#le.readlinkSync(this.fullpath());const A=this.parent.realpathSync()?.resolve(u);if(A){return this.#Te=A}}catch(u){this.#Pe(u.code);return undefined}}#Oe(u){this.#Re|=xt;for(let A=u.provisional;A<u.length;A++){const p=u[A];if(p)p.#Me()}}#Me(){if(this.#Re&Tt)return;this.#Re=(this.#Re|Tt)&Ft;this.#Ue()}#Ue(){const u=this.children();u.provisional=0;for(const A of u){A.#Me()}}#He(){this.#Re|=Lt;this.#Ge()}#Ge(){if(this.#Re&_t)return;let u=this.#Re;if((u&Qt)===vt)u&=Ft;this.#Re=u|_t;this.#Ue()}#We(u=""){if(u==="ENOTDIR"||u==="EPERM"){this.#Ge()}else if(u==="ENOENT"){this.#Me()}else{this.children().provisional=0}}#je(u=""){if(u==="ENOTDIR"){const u=this.parent;u.#Ge()}else if(u==="ENOENT"){this.#Me()}}#Pe(u=""){let A=this.#Re;A|=Nt;if(u==="ENOENT")A|=Tt;if(u==="EINVAL"||u==="UNKNOWN"){A&=Ft}this.#Re=A;if(u==="ENOTDIR"&&this.parent){this.parent.#Ge()}}#ze(u,A){return this.#$e(u,A)||this.#qe(u,A)}#qe(u,A){const p=entToType(u);const y=this.newChild(u.name,p,{parent:this});const E=y.#Re&Qt;if(E!==vt&&E!==Dt&&E!==It){y.#Re|=_t}A.unshift(y);A.provisional++;return y}#$e(u,A){for(let p=A.provisional;p<A.length;p++){const y=A[p];const E=this.nocase?normalizeNocase(u.name):normalize(u.name);if(E!==y.#Se){continue}return this.#Ve(u,y,p,A)}}#Ve(u,A,p,y){const E=A.name;A.#Re=A.#Re&Ft|entToType(u);if(E!==u.name)A.name=u.name;if(p!==y.provisional){if(p===y.length-1)y.pop();else y.splice(p,1);y.unshift(A)}y.provisional++;return A}async lstat(){if((this.#Re&Tt)===0){try{this.#Ke(await this.#le.promises.lstat(this.fullpath()));return this}catch(u){this.#je(u.code)}}}lstatSync(){if((this.#Re&Tt)===0){try{this.#Ke(this.#le.lstatSync(this.fullpath()));return this}catch(u){this.#je(u.code)}}}#Ke(u){const{atime:A,atimeMs:p,birthtime:y,birthtimeMs:E,blksize:C,blocks:I,ctime:w,ctimeMs:v,dev:B,gid:S,ino:D,mode:k,mtime:Q,mtimeMs:F,nlink:R,rdev:_,size:P,uid:O}=u;this.#be=A;this.#ye=p;this.#Be=y;this.#Ie=E;this.#pe=C;this.#me=I;this.#ve=w;this.#Ce=v;this.#ce=B;this.#Ae=S;this.#ge=D;this.#ue=k;this.#we=Q;this.#Ee=F;this.#de=R;this.#he=_;this.#v=P;this.#fe=O;const U=entToType(u);this.#Re=this.#Re&Ft|U|Rt;if(U!==It&&U!==vt&&U!==Dt){this.#Re|=_t}}#Je=[];#Ye=false;#Xe(u){this.#Ye=false;const A=this.#Je.slice();this.#Je.length=0;A.forEach((A=>A(null,u)))}readdirCB(u,A=false){if(!this.canReaddir()){if(A)u(null,[]);else queueMicrotask((()=>u(null,[])));return}const p=this.children();if(this.calledReaddir()){const y=p.slice(0,p.provisional);if(A)u(null,y);else queueMicrotask((()=>u(null,y)));return}this.#Je.push(u);if(this.#Ye){return}this.#Ye=true;const y=this.fullpath();this.#le.readdir(y,{withFileTypes:true},((u,A)=>{if(u){this.#We(u.code);p.provisional=0}else{for(const u of A){this.#ze(u,p)}this.#Oe(p)}this.#Xe(p.slice(0,p.provisional));return}))}#Ze;async readdir(){if(!this.canReaddir()){return[]}const u=this.children();if(this.calledReaddir()){return u.slice(0,u.provisional)}const A=this.fullpath();if(this.#Ze){await this.#Ze}else{let resolve=()=>{};this.#Ze=new Promise((u=>resolve=u));try{for(const p of await this.#le.promises.readdir(A,{withFileTypes:true})){this.#ze(p,u)}this.#Oe(u)}catch(A){this.#We(A.code);u.provisional=0}this.#Ze=undefined;resolve()}return u.slice(0,u.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const u=this.children();if(this.calledReaddir()){return u.slice(0,u.provisional)}const A=this.fullpath();try{for(const p of this.#le.readdirSync(A,{withFileTypes:true})){this.#ze(p,u)}this.#Oe(u)}catch(A){this.#We(A.code);u.provisional=0}return u.slice(0,u.provisional)}canReaddir(){if(this.#Re&Pt)return false;const u=Qt&this.#Re;if(!(u===It||u===vt||u===Dt)){return false}return true}shouldWalk(u,A){return(this.#Re&vt)===vt&&!(this.#Re&Pt)&&!u.has(this)&&(!A||A(this))}async realpath(){if(this.#Ne)return this.#Ne;if((Lt|Nt|Tt)&this.#Re)return undefined;try{const u=await this.#le.promises.realpath(this.fullpath());return this.#Ne=this.resolve(u)}catch(u){this.#He()}}realpathSync(){if(this.#Ne)return this.#Ne;if((Lt|Nt|Tt)&this.#Re)return undefined;try{const u=this.#le.realpathSync(this.fullpath());return this.#Ne=this.resolve(u)}catch(u){this.#He()}}[Ht](u){if(u===this)return;u.isCWD=false;this.isCWD=true;const A=new Set([]);let p=[];let y=this;while(y&&y.parent){A.add(y);y.#Fe=p.join(this.sep);y.#xe=p.join("/");y=y.parent;p.push("..")}y=u;while(y&&y.parent&&!A.has(y)){y.#Fe=undefined;y.#xe=undefined;y=y.parent}}}class PathWin32 extends PathBase{sep="\\";splitSep=Ct;constructor(u,A=It,p,y,E,C,I){super(u,A,p,y,E,C,I)}newChild(u,A=It,p={}){return new PathWin32(u,A,this.root,this.roots,this.nocase,this.childrenCache(),p)}getRootString(u){return Fe.win32.parse(u).root}getRoot(u){u=uncToDrive(u.toUpperCase());if(u===this.root.name){return this.root}for(const[A,p]of Object.entries(this.roots)){if(this.sameRoot(u,A)){return this.roots[u]=p}}return this.roots[u]=new PathScurryWin32(u,this).root}sameRoot(u,A=this.root.name){u=u.toUpperCase().replace(/\//g,"\\").replace(Et,"$1\\");return u===A}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(u,A=It,p,y,E,C,I){super(u,A,p,y,E,C,I)}getRootString(u){return u.startsWith("/")?"/":""}getRoot(u){return this.root}newChild(u,A=It,p={}){return new PathPosix(u,A,this.root,this.roots,this.nocase,this.childrenCache(),p)}}class PathScurryBase{root;rootPath;roots;cwd;#et;#tt;#_e;nocase;#le;constructor(u=process.cwd(),A,p,{nocase:y,childrenCacheSize:E=16*1024,fs:C=yt}={}){this.#le=fsFromOption(C);if(u instanceof URL||u.startsWith("file://")){u=(0,we.fileURLToPath)(u)}const I=A.resolve(u);this.roots=Object.create(null);this.rootPath=this.parseRootPath(I);this.#et=new ResolveCache;this.#tt=new ResolveCache;this.#_e=new ChildrenCache(E);const w=I.substring(this.rootPath.length).split(p);if(w.length===1&&!w[0]){w.pop()}if(y===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=y;this.root=this.newRoot(this.#le);this.roots[this.rootPath]=this.root;let v=this.root;let B=w.length-1;const S=A.sep;let D=this.rootPath;let k=false;for(const u of w){const A=B--;v=v.child(u,{relative:new Array(A).fill("..").join(S),relativePosix:new Array(A).fill("..").join("/"),fullpath:D+=(k?"":S)+u});k=true}this.cwd=v}depth(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.depth()}childrenCache(){return this.#_e}resolve(...u){let A="";for(let p=u.length-1;p>=0;p--){const y=u[p];if(!y||y===".")continue;A=A?`${y}/${A}`:y;if(this.isAbsolute(y)){break}}const p=this.#et.get(A);if(p!==undefined){return p}const y=this.cwd.resolve(A).fullpath();this.#et.set(A,y);return y}resolvePosix(...u){let A="";for(let p=u.length-1;p>=0;p--){const y=u[p];if(!y||y===".")continue;A=A?`${y}/${A}`:y;if(this.isAbsolute(y)){break}}const p=this.#tt.get(A);if(p!==undefined){return p}const y=this.cwd.resolve(A).fullpathPosix();this.#tt.set(A,y);return y}relative(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.relative()}relativePosix(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.relativePosix()}basename(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.name}dirname(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return(u.parent||u).fullpath()}async readdir(u=this.cwd,A={withFileTypes:true}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p}=A;if(!u.canReaddir()){return[]}else{const A=await u.readdir();return p?A:A.map((u=>u.name))}}readdirSync(u=this.cwd,A={withFileTypes:true}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true}=A;if(!u.canReaddir()){return[]}else if(p){return u.readdirSync()}else{return u.readdirSync().map((u=>u.name))}}async lstat(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.lstat()}lstatSync(u=this.cwd){if(typeof u==="string"){u=this.cwd.resolve(u)}return u.lstatSync()}async readlink(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=await u.readlink();return A?p:p?.fullpath()}readlinkSync(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=u.readlinkSync();return A?p:p?.fullpath()}async realpath(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=await u.realpath();return A?p:p?.fullpath()}realpathSync(u=this.cwd,{withFileTypes:A}={withFileTypes:false}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u.withFileTypes;u=this.cwd}const p=u.realpathSync();return A?p:p?.fullpath()}async walk(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=[];if(!E||E(u)){I.push(p?u:u.fullpath())}const w=new Set;const walk=(u,A)=>{w.add(u);u.readdirCB(((u,v)=>{if(u){return A(u)}let B=v.length;if(!B)return A();const next=()=>{if(--B===0){A()}};for(const u of v){if(!E||E(u)){I.push(p?u:u.fullpath())}if(y&&u.isSymbolicLink()){u.realpath().then((u=>u?.isUnknown()?u.lstat():u)).then((u=>u?.shouldWalk(w,C)?walk(u,next):next()))}else{if(u.shouldWalk(w,C)){walk(u,next)}else{next()}}}}),true)};const v=u;return new Promise(((u,A)=>{walk(v,(p=>{if(p)return A(p);u(I)}))}))}walkSync(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=[];if(!E||E(u)){I.push(p?u:u.fullpath())}const w=new Set([u]);for(const u of w){const A=u.readdirSync();for(const u of A){if(!E||E(u)){I.push(p?u:u.fullpath())}let A=u;if(u.isSymbolicLink()){if(!(y&&(A=u.realpathSync())))continue;if(A.isUnknown())A.lstatSync()}if(A.shouldWalk(w,C)){w.add(A)}}}return I}[Symbol.asyncIterator](){return this.iterate()}iterate(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}return this.stream(u,A)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;if(!E||E(u)){yield p?u:u.fullpath()}const I=new Set([u]);for(const u of I){const A=u.readdirSync();for(const u of A){if(!E||E(u)){yield p?u:u.fullpath()}let A=u;if(u.isSymbolicLink()){if(!(y&&(A=u.realpathSync())))continue;if(A.isUnknown())A.lstatSync()}if(A.shouldWalk(I,C)){I.add(A)}}}}stream(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=new Minipass({objectMode:true});if(!E||E(u)){I.write(p?u:u.fullpath())}const w=new Set;const v=[u];let B=0;const process=()=>{let u=false;while(!u){const A=v.shift();if(!A){if(B===0)I.end();return}B++;w.add(A);const onReaddir=(A,D,k=false)=>{if(A)return I.emit("error",A);if(y&&!k){const u=[];for(const A of D){if(A.isSymbolicLink()){u.push(A.realpath().then((u=>u?.isUnknown()?u.lstat():u)))}}if(u.length){Promise.all(u).then((()=>onReaddir(null,D,true)));return}}for(const A of D){if(A&&(!E||E(A))){if(!I.write(p?A:A.fullpath())){u=true}}}B--;for(const u of D){const A=u.realpathCached()||u;if(A.shouldWalk(w,C)){v.push(A)}}if(u&&!I.flowing){I.once("drain",process)}else if(!S){process()}};let S=true;A.readdirCB(onReaddir,true);S=false}};process();return I}streamSync(u=this.cwd,A={}){if(typeof u==="string"){u=this.cwd.resolve(u)}else if(!(u instanceof PathBase)){A=u;u=this.cwd}const{withFileTypes:p=true,follow:y=false,filter:E,walkFilter:C}=A;const I=new Minipass({objectMode:true});const w=new Set;if(!E||E(u)){I.write(p?u:u.fullpath())}const v=[u];let B=0;const process=()=>{let u=false;while(!u){const A=v.shift();if(!A){if(B===0)I.end();return}B++;w.add(A);const S=A.readdirSync();for(const A of S){if(!E||E(A)){if(!I.write(p?A:A.fullpath())){u=true}}}B--;for(const u of S){let A=u;if(u.isSymbolicLink()){if(!(y&&(A=u.realpathSync())))continue;if(A.isUnknown())A.lstatSync()}if(A.shouldWalk(w,C)){v.push(A)}}}if(u&&!I.flowing)I.once("drain",process)};process();return I}chdir(u=this.cwd){const A=this.cwd;this.cwd=typeof u==="string"?this.cwd.resolve(u):u;this.cwd[Ht](A)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(u=process.cwd(),A={}){const{nocase:p=true}=A;super(u,Fe.win32,"\\",{...A,nocase:p});this.nocase=p;for(let u=this.cwd;u;u=u.parent){u.nocase=this.nocase}}parseRootPath(u){return Fe.win32.parse(u).root.toUpperCase()}newRoot(u){return new PathWin32(this.rootPath,vt,undefined,this.roots,this.nocase,this.childrenCache(),{fs:u})}isAbsolute(u){return u.startsWith("/")||u.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(u)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(u=process.cwd(),A={}){const{nocase:p=false}=A;super(u,Fe.posix,"/",{...A,nocase:p});this.nocase=p}parseRootPath(u){return"/"}newRoot(u){return new PathPosix(this.rootPath,vt,undefined,this.roots,this.nocase,this.childrenCache(),{fs:u})}isAbsolute(u){return u.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(u=process.cwd(),A={}){const{nocase:p=true}=A;super(u,{...A,nocase:p})}}const Gt=process.platform==="win32"?PathWin32:PathPosix;const Wt=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;const isPatternList=u=>u.length>=1;const isGlobList=u=>u.length>=1;class Pattern{#nt;#rt;#st;length;#it;#ot;#at;#lt;#ct;#ut;#dt=true;constructor(u,A,p,y){if(!isPatternList(u)){throw new TypeError("empty pattern list")}if(!isGlobList(A)){throw new TypeError("empty glob list")}if(A.length!==u.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=u.length;if(p<0||p>=this.length){throw new TypeError("index out of range")}this.#nt=u;this.#rt=A;this.#st=p;this.#it=y;if(this.#st===0){if(this.isUNC()){const[u,A,p,y,...E]=this.#nt;const[C,I,w,v,...B]=this.#rt;if(E[0]===""){E.shift();B.shift()}const S=[u,A,p,y,""].join("/");const D=[C,I,w,v,""].join("/");this.#nt=[S,...E];this.#rt=[D,...B];this.length=this.#nt.length}else if(this.isDrive()||this.isAbsolute()){const[u,...A]=this.#nt;const[p,...y]=this.#rt;if(A[0]===""){A.shift();y.shift()}const E=u+"/";const C=p+"/";this.#nt=[E,...A];this.#rt=[C,...y];this.length=this.#nt.length}}}pattern(){return this.#nt[this.#st]}isString(){return typeof this.#nt[this.#st]==="string"}isGlobstar(){return this.#nt[this.#st]===me}isRegExp(){return this.#nt[this.#st]instanceof RegExp}globString(){return this.#at=this.#at||(this.#st===0?this.isAbsolute()?this.#rt[0]+this.#rt.slice(1).join("/"):this.#rt.join("/"):this.#rt.slice(this.#st).join("/"))}hasMore(){return this.length>this.#st+1}rest(){if(this.#ot!==undefined)return this.#ot;if(!this.hasMore())return this.#ot=null;this.#ot=new Pattern(this.#nt,this.#rt,this.#st+1,this.#it);this.#ot.#ut=this.#ut;this.#ot.#ct=this.#ct;this.#ot.#lt=this.#lt;return this.#ot}isUNC(){const u=this.#nt;return this.#ct!==undefined?this.#ct:this.#ct=this.#it==="win32"&&this.#st===0&&u[0]===""&&u[1]===""&&typeof u[2]==="string"&&!!u[2]&&typeof u[3]==="string"&&!!u[3]}isDrive(){const u=this.#nt;return this.#lt!==undefined?this.#lt:this.#lt=this.#it==="win32"&&this.#st===0&&this.length>1&&typeof u[0]==="string"&&/^[a-z]:$/i.test(u[0])}isAbsolute(){const u=this.#nt;return this.#ut!==undefined?this.#ut:this.#ut=u[0]===""&&u.length>1||this.isDrive()||this.isUNC()}root(){const u=this.#nt[0];return typeof u==="string"&&this.isAbsolute()&&this.#st===0?u:""}checkFollowGlobstar(){return!(this.#st===0||!this.isGlobstar()||!this.#dt)}markFollowGlobstar(){if(this.#st===0||!this.isGlobstar()||!this.#dt)return false;this.#dt=false;return true}}const jt=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(u,{nobrace:A,nocase:p,noext:y,noglobstar:E,platform:C=jt}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=C;this.mmopts={dot:true,nobrace:A,nocase:p,noext:y,noglobstar:E,optimizationLevel:2,platform:C,nocomment:true,nonegate:true};for(const A of u)this.add(A)}add(u){const A=new Minimatch(u,this.mmopts);for(let u=0;u<A.set.length;u++){const p=A.set[u];const y=A.globParts[u];if(!p||!y){throw new Error("invalid pattern object")}while(p[0]==="."&&y[0]==="."){p.shift();y.shift()}const E=new Pattern(p,y,0,this.platform);const C=new Minimatch(E.globString(),this.mmopts);const I=y[y.length-1]==="**";const w=E.isAbsolute();if(w)this.absolute.push(C);else this.relative.push(C);if(I){if(w)this.absoluteChildren.push(C);else this.relativeChildren.push(C)}}}ignored(u){const A=u.fullpath();const p=`${A}/`;const y=u.relative()||".";const E=`${y}/`;for(const u of this.relative){if(u.match(y)||u.match(E))return true}for(const u of this.absolute){if(u.match(A)||u.match(p))return true}return false}childrenIgnored(u){const A=u.fullpath()+"/";const p=(u.relative()||".")+"/";for(const u of this.relativeChildren){if(u.match(p))return true}for(const u of this.absoluteChildren){if(u.match(A))return true}return false}}class HasWalkedCache{store;constructor(u=new Map){this.store=u}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(u,A){return this.store.get(u.fullpath())?.has(A.globString())}storeWalked(u,A){const p=u.fullpath();const y=this.store.get(p);if(y)y.add(A.globString());else this.store.set(p,new Set([A.globString()]))}}class MatchRecord{store=new Map;add(u,A,p){const y=(A?2:0)|(p?1:0);const E=this.store.get(u);this.store.set(u,E===undefined?y:y&E)}entries(){return[...this.store.entries()].map((([u,A])=>[u,!!(A&2),!!(A&1)]))}}class SubWalks{store=new Map;add(u,A){if(!u.canReaddir()){return}const p=this.store.get(u);if(p){if(!p.find((u=>u.globString()===A.globString()))){p.push(A)}}else this.store.set(u,[A])}get(u){const A=this.store.get(u);if(!A){throw new Error("attempting to walk unknown path")}return A}entries(){return this.keys().map((u=>[u,this.store.get(u)]))}keys(){return[...this.store.keys()].filter((u=>u.canReaddir()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(u,A){this.opts=u;this.follow=!!u.follow;this.dot=!!u.dot;this.hasWalkedCache=A?A.copy():new HasWalkedCache}processPatterns(u,A){this.patterns=A;const p=A.map((A=>[u,A]));for(let[u,A]of p){this.hasWalkedCache.storeWalked(u,A);const p=A.root();const y=A.isAbsolute()&&this.opts.absolute!==false;if(p){u=u.resolve(p==="/"&&this.opts.root!==undefined?this.opts.root:p);const y=A.rest();if(!y){this.matches.add(u,true,false);continue}else{A=y}}if(u.isENOENT())continue;let E;let C;let I=false;while(typeof(E=A.pattern())==="string"&&(C=A.rest())){const p=u.resolve(E);u=p;A=C;I=true}E=A.pattern();C=A.rest();if(I){if(this.hasWalkedCache.hasWalked(u,A))continue;this.hasWalkedCache.storeWalked(u,A)}if(typeof E==="string"){const A=E===".."||E===""||E===".";this.matches.add(u.resolve(E),y,A);continue}else if(E===me){if(!u.isSymbolicLink()||this.follow||A.checkFollowGlobstar()){this.subwalks.add(u,A)}const p=C?.pattern();const E=C?.rest();if(!C||(p===""||p===".")&&!E){this.matches.add(u,y,p===""||p===".")}else{if(p===".."){const A=u.parent||u;if(!E)this.matches.add(A,y,true);else if(!this.hasWalkedCache.hasWalked(A,E)){this.subwalks.add(A,E)}}}}else if(E instanceof RegExp){this.subwalks.add(u,A)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(u,A){const p=this.subwalks.get(u);const y=this.child();for(const u of A){for(const A of p){const p=A.isAbsolute();const E=A.pattern();const C=A.rest();if(E===me){y.testGlobstar(u,A,C,p)}else if(E instanceof RegExp){y.testRegExp(u,E,C,p)}else{y.testString(u,E,C,p)}}}return y}testGlobstar(u,A,p,y){if(this.dot||!u.name.startsWith(".")){if(!A.hasMore()){this.matches.add(u,y,false)}if(u.canReaddir()){if(this.follow||!u.isSymbolicLink()){this.subwalks.add(u,A)}else if(u.isSymbolicLink()){if(p&&A.checkFollowGlobstar()){this.subwalks.add(u,p)}else if(A.markFollowGlobstar()){this.subwalks.add(u,A)}}}}if(p){const A=p.pattern();if(typeof A==="string"&&A!==".."&&A!==""&&A!=="."){this.testString(u,A,p.rest(),y)}else if(A===".."){const A=u.parent||u;this.subwalks.add(A,p)}else if(A instanceof RegExp){this.testRegExp(u,A,p.rest(),y)}}}testRegExp(u,A,p,y){if(!A.test(u.name))return;if(!p){this.matches.add(u,y,false)}else{this.subwalks.add(u,p)}}testString(u,A,p,y){if(!u.isNamed(A))return;if(!p){this.matches.add(u,y,false)}else{this.subwalks.add(u,p)}}}const makeIgnore=(u,A)=>typeof u==="string"?new Ignore([u],A):Array.isArray(u)?new Ignore(u,A):u;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#ft=[];#At;#ht;signal;maxDepth;includeChildMatches;constructor(u,A,p){this.patterns=u;this.path=A;this.opts=p;this.#ht=!p.posix&&p.platform==="win32"?"\\":"/";this.includeChildMatches=p.includeChildMatches!==false;if(p.ignore||!this.includeChildMatches){this.#At=makeIgnore(p.ignore??[],p);if(!this.includeChildMatches&&typeof this.#At.add!=="function"){const u="cannot ignore child matches, ignore lacks add() method.";throw new Error(u)}}this.maxDepth=p.maxDepth||Infinity;if(p.signal){this.signal=p.signal;this.signal.addEventListener("abort",(()=>{this.#ft.length=0}))}}#pt(u){return this.seen.has(u)||!!this.#At?.ignored?.(u)}#gt(u){return!!this.#At?.childrenIgnored?.(u)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let u=undefined;while(!this.paused&&(u=this.#ft.shift())){u()}}onResume(u){if(this.signal?.aborted)return;if(!this.paused){u()}else{this.#ft.push(u)}}async matchCheck(u,A){if(A&&this.opts.nodir)return undefined;let p;if(this.opts.realpath){p=u.realpathCached()||await u.realpath();if(!p)return undefined;u=p}const y=u.isUnknown()||this.opts.stat;const E=y?await u.lstat():u;if(this.opts.follow&&this.opts.nodir&&E?.isSymbolicLink()){const u=await E.realpath();if(u&&(u.isUnknown()||this.opts.stat)){await u.lstat()}}return this.matchCheckTest(E,A)}matchCheckTest(u,A){return u&&(this.maxDepth===Infinity||u.depth()<=this.maxDepth)&&(!A||u.canReaddir())&&(!this.opts.nodir||!u.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!u.isSymbolicLink()||!u.realpathCached()?.isDirectory())&&!this.#pt(u)?u:undefined}matchCheckSync(u,A){if(A&&this.opts.nodir)return undefined;let p;if(this.opts.realpath){p=u.realpathCached()||u.realpathSync();if(!p)return undefined;u=p}const y=u.isUnknown()||this.opts.stat;const E=y?u.lstatSync():u;if(this.opts.follow&&this.opts.nodir&&E?.isSymbolicLink()){const u=E.realpathSync();if(u&&(u?.isUnknown()||this.opts.stat)){u.lstatSync()}}return this.matchCheckTest(E,A)}matchFinish(u,A){if(this.#pt(u))return;if(!this.includeChildMatches&&this.#At?.add){const A=`${u.relativePosix()}/**`;this.#At.add(A)}const p=this.opts.absolute===undefined?A:this.opts.absolute;this.seen.add(u);const y=this.opts.mark&&u.isDirectory()?this.#ht:"";if(this.opts.withFileTypes){this.matchEmit(u)}else if(p){const A=this.opts.posix?u.fullpathPosix():u.fullpath();this.matchEmit(A+y)}else{const A=this.opts.posix?u.relativePosix():u.relative();const p=this.opts.dotRelative&&!A.startsWith(".."+this.#ht)?"."+this.#ht:"";this.matchEmit(!A?"."+y:p+A+y)}}async match(u,A,p){const y=await this.matchCheck(u,p);if(y)this.matchFinish(y,A)}matchSync(u,A,p){const y=this.matchCheckSync(u,p);if(y)this.matchFinish(y,A)}walkCB(u,A,p){if(this.signal?.aborted)p();this.walkCB2(u,A,new Processor(this.opts),p)}walkCB2(u,A,p,y){if(this.#gt(u))return y();if(this.signal?.aborted)y();if(this.paused){this.onResume((()=>this.walkCB2(u,A,p,y)));return}p.processPatterns(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;E++;this.match(u,A,y).then((()=>next()))}for(const u of p.subwalkTargets()){if(this.maxDepth!==Infinity&&u.depth()>=this.maxDepth){continue}E++;const A=u.readdirCached();if(u.calledReaddir())this.walkCB3(u,A,p,next);else{u.readdirCB(((A,y)=>this.walkCB3(u,y,p,next)),true)}}next()}walkCB3(u,A,p,y){p=p.filterEntries(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;E++;this.match(u,A,y).then((()=>next()))}for(const[u,A]of p.subwalks.entries()){E++;this.walkCB2(u,A,p.child(),next)}next()}walkCBSync(u,A,p){if(this.signal?.aborted)p();this.walkCB2Sync(u,A,new Processor(this.opts),p)}walkCB2Sync(u,A,p,y){if(this.#gt(u))return y();if(this.signal?.aborted)y();if(this.paused){this.onResume((()=>this.walkCB2Sync(u,A,p,y)));return}p.processPatterns(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;this.matchSync(u,A,y)}for(const u of p.subwalkTargets()){if(this.maxDepth!==Infinity&&u.depth()>=this.maxDepth){continue}E++;const A=u.readdirSync();this.walkCB3Sync(u,A,p,next)}next()}walkCB3Sync(u,A,p,y){p=p.filterEntries(u,A);let E=1;const next=()=>{if(--E===0)y()};for(const[u,A,y]of p.matches.entries()){if(this.#pt(u))continue;this.matchSync(u,A,y)}for(const[u,A]of p.subwalks.entries()){E++;this.walkCB2Sync(u,A,p.child(),next)}next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(u,A,p){super(u,A,p)}matchEmit(u){this.matches.add(u)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((u,A)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){A(this.signal.reason)}else{u(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}class GlobStream extends GlobUtil{results;constructor(u,A,p){super(u,A,p);this.results=new Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(u){this.results.write(u);if(!this.results.flowing)this.pause()}stream(){const u=this.path;if(u.isUnknown()){u.lstat().then((()=>{this.walkCB(u,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(u,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}const zt=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(u,A){if(!A)throw new TypeError("glob options required");this.withFileTypes=!!A.withFileTypes;this.signal=A.signal;this.follow=!!A.follow;this.dot=!!A.dot;this.dotRelative=!!A.dotRelative;this.nodir=!!A.nodir;this.mark=!!A.mark;if(!A.cwd){this.cwd=""}else if(A.cwd instanceof URL||A.cwd.startsWith("file://")){A.cwd=(0,we.fileURLToPath)(A.cwd)}this.cwd=A.cwd||"";this.root=A.root;this.magicalBraces=!!A.magicalBraces;this.nobrace=!!A.nobrace;this.noext=!!A.noext;this.realpath=!!A.realpath;this.absolute=A.absolute;this.includeChildMatches=A.includeChildMatches!==false;this.noglobstar=!!A.noglobstar;this.matchBase=!!A.matchBase;this.maxDepth=typeof A.maxDepth==="number"?A.maxDepth:Infinity;this.stat=!!A.stat;this.ignore=A.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof u==="string"){u=[u]}this.windowsPathsNoEscape=!!A.windowsPathsNoEscape||A.allowWindowsEscape===false;if(this.windowsPathsNoEscape){u=u.map((u=>u.replace(/\\/g,"/")))}if(this.matchBase){if(A.noglobstar){throw new TypeError("base matching requires globstar")}u=u.map((u=>u.includes("/")?u:`./**/${u}`))}this.pattern=u;this.platform=A.platform||zt;this.opts={...A,platform:this.platform};if(A.scurry){this.scurry=A.scurry;if(A.nocase!==undefined&&A.nocase!==A.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const u=A.platform==="win32"?PathScurryWin32:A.platform==="darwin"?PathScurryDarwin:A.platform?PathScurryPosix:Wt;this.scurry=new u(this.cwd,{nocase:A.nocase,fs:A.fs})}this.nocase=this.scurry.nocase;const p=this.platform==="darwin"||this.platform==="win32";const y={...A,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:p,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const E=this.pattern.map((u=>new Minimatch(u,y)));const[C,I]=E.reduce(((u,A)=>{u[0].push(...A.set);u[1].push(...A.globParts);return u}),[[],[]]);this.patterns=C.map(((u,A)=>{const p=I[A];if(!p)throw new Error("invalid pattern object");return new Pattern(u,p,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(u,A={})=>{if(!Array.isArray(u)){u=[u]}for(const p of u){if(new Minimatch(p,A).hasMagic())return true}return false};function globStreamSync(u,A={}){return new Glob(u,A).streamSync()}function globStream(u,A={}){return new Glob(u,A).stream()}function globSync(u,A={}){return new Glob(u,A).walkSync()}async function glob_(u,A={}){return new Glob(u,A).walk()}function globIterateSync(u,A={}){return new Glob(u,A).iterateSync()}function globIterate(u,A={}){return new Glob(u,A).iterate()}const $t=globStreamSync;const qt=Object.assign(globStream,{sync:globStreamSync});const Vt=globIterateSync;const Kt=Object.assign(globIterate,{sync:globIterateSync});const Jt=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});const Yt=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:Jt,globStream:globStream,stream:qt,globStreamSync:globStreamSync,streamSync:$t,globIterate:globIterate,iterate:Kt,globIterateSync:globIterateSync,iterateSync:Vt,Glob:Glob,hasMagic:hasMagic,escape:escape_escape,unescape:unescape_unescape});Yt.glob=Yt;const FindFiles=async u=>{const{pattern:A,dir_path:p=".",case_sensitive:E=false,ignore:I=[]}=u;try{const u=C().resolve(B.$.WORKSPACE_DIR,p);let w=[];try{const u=C().resolve(B.$.WORKSPACE_DIR,".gitignore");const A=await(0,y.readFile)(u,"utf-8");w=A.split("\n").filter((u=>u.trim()&&!u.trim().startsWith("#"))).map((u=>u.trim())).map((u=>u.endsWith("/")?`${u}**`:u)).filter((u=>!u.startsWith(".codegen")))}catch(u){}const v=[...I,...w];const S=await Yt(A,{cwd:u,absolute:true,stat:true,nocase:!E,ignore:v});const D=await Promise.all(S.map((async u=>{const A=await(0,y.stat)(u);return{file:u,mtime:A.mtime}})));D.sort(((u,A)=>A.mtime.getTime()-u.mtime.getTime()));return{files:D.map((u=>u.file))}}catch(u){return{error:u.message}}};var Xt=p(5317);var Zt=p(857);var en=p.n(Zt);const normalizeLine=u=>{if(u.startsWith("Error: ")){return u.slice("Error: ".length)}if(u.startsWith("VError: ")){return u.slice("VError: ".length)}return u};const getCombinedMessage=(u,A)=>{const p=normalizeLine(`${u}`);if(A){return`${A}: ${p}`}return p};const tn="\n";const getNewLineIndex=(u,A=undefined)=>u.indexOf(tn,A);const mergeStacks=(u,A)=>{if(!A){return u}const p=getNewLineIndex(u);const y=getNewLineIndex(A);if(y===-1){return u}const E=u.slice(0,p);const C=A.slice(y);const I=normalizeLine(A.slice(0,y));if(E.includes(I)){return E+C}return A};class VError extends Error{constructor(u,A){const p=getCombinedMessage(u,A);super(p);this.name="VError";if(u instanceof Error){this.stack=mergeStacks(this.stack,u.stack)}if(u.codeFrame){this.codeFrame=u.codeFrame}if(u.code){this.code=u.code}}}function isPlainObject(u){if(typeof u!=="object"||u===null){return false}const A=Object.getPrototypeOf(u);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(Symbol.toStringTag in u)&&!(Symbol.iterator in u)}const safeNormalizeFileUrl=(u,A)=>{const p=normalizeFileUrl(normalizeDenoExecPath(u));if(typeof p!=="string"){throw new TypeError(`${A} must be a string or a file URL: ${p}.`)}return p};const normalizeDenoExecPath=u=>isDenoExecPath(u)?u.toString():u;const isDenoExecPath=u=>typeof u!=="string"&&u&&Object.getPrototypeOf(u)===String.prototype;const normalizeFileUrl=u=>u instanceof URL?(0,we.fileURLToPath)(u):u;const normalizeParameters=(u,A=[],p={})=>{const y=safeNormalizeFileUrl(u,"First argument");const[E,C]=isPlainObject(A)?[[],A]:[A,p];if(!Array.isArray(E)){throw new TypeError(`Second argument must be either an array of arguments or an options object: ${E}`)}if(E.some((u=>typeof u==="object"&&u!==null))){throw new TypeError(`Second argument must be an array of strings: ${E}`)}const I=E.map(String);const w=I.find((u=>u.includes("\0")));if(w!==undefined){throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${w}`)}if(!isPlainObject(C)){throw new TypeError(`Last argument must be an options object: ${C}`)}return[y,I,C]};const nn=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");const{toString:rn}=Object.prototype;const isArrayBuffer=u=>rn.call(u)==="[object ArrayBuffer]";const isUint8Array=u=>rn.call(u)==="[object Uint8Array]";const bufferToUint8Array=u=>new Uint8Array(u.buffer,u.byteOffset,u.byteLength);const sn=new TextEncoder;const stringToUint8Array=u=>sn.encode(u);const on=new TextDecoder;const uint8ArrayToString=u=>on.decode(u);const joinToString=(u,A)=>{const p=uint8ArraysToStrings(u,A);return p.join("")};const uint8ArraysToStrings=(u,A)=>{if(A==="utf8"&&u.every((u=>typeof u==="string"))){return u}const p=new Oe.StringDecoder(A);const y=u.map((u=>typeof u==="string"?stringToUint8Array(u):u)).map((u=>p.write(u)));const E=p.end();return E===""?y:[...y,E]};const joinToUint8Array=u=>{if(u.length===1&&isUint8Array(u[0])){return u[0]}return concatUint8Arrays(stringsToUint8Arrays(u))};const stringsToUint8Arrays=u=>u.map((u=>typeof u==="string"?stringToUint8Array(u):u));const concatUint8Arrays=u=>{const A=new Uint8Array(getJoinLength(u));let p=0;for(const y of u){A.set(y,p);p+=y.length}return A};const getJoinLength=u=>{let A=0;for(const p of u){A+=p.length}return A};const isTemplateString=u=>Array.isArray(u)&&Array.isArray(u.raw);const parseTemplates=(u,A)=>{let p=[];for(const[y,E]of u.entries()){p=parseTemplate({templates:u,expressions:A,tokens:p,index:y,template:E})}if(p.length===0){throw new TypeError("Template script must not be empty")}const[y,...E]=p;return[y,E,{}]};const parseTemplate=({templates:u,expressions:A,tokens:p,index:y,template:E})=>{if(E===undefined){throw new TypeError(`Invalid backslash sequence: ${u.raw[y]}`)}const{nextTokens:C,leadingWhitespaces:I,trailingWhitespaces:w}=splitByWhitespaces(E,u.raw[y]);const v=concatTokens(p,C,I);if(y===A.length){return v}const B=A[y];const S=Array.isArray(B)?B.map((u=>parseExpression(u))):[parseExpression(B)];return concatTokens(v,S,w)};const splitByWhitespaces=(u,A)=>{if(A.length===0){return{nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false}}const p=[];let y=0;const E=an.has(A[0]);for(let E=0,C=0;E<u.length;E+=1,C+=1){const I=A[C];if(an.has(I)){if(y!==E){p.push(u.slice(y,E))}y=E+1}else if(I==="\\"){const u=A[C+1];if(u==="\n"){E-=1;C+=1}else if(u==="u"&&A[C+2]==="{"){C=A.indexOf("}",C+3)}else{C+=ln[u]??1}}}const C=y===u.length;if(!C){p.push(u.slice(y))}return{nextTokens:p,leadingWhitespaces:E,trailingWhitespaces:C}};const an=new Set([" ","\t","\r","\n"]);const ln={x:3,u:5};const concatTokens=(u,A,p)=>p||u.length===0||A.length===0?[...u,...A]:[...u.slice(0,-1),`${u.at(-1)}${A[0]}`,...A.slice(1)];const parseExpression=u=>{const A=typeof u;if(A==="string"){return u}if(A==="number"){return String(u)}if(isPlainObject(u)&&("stdout"in u||"isMaxBuffer"in u)){return getSubprocessResult(u)}if(u instanceof nn.ChildProcess||Object.prototype.toString.call(u)==="[object Promise]"){throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.")}throw new TypeError(`Unexpected "${A}" in template expression`)};const getSubprocessResult=({stdout:u})=>{if(typeof u==="string"){return u}if(isUint8Array(u)){return uint8ArrayToString(u)}if(u===undefined){throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.')}throw new TypeError(`Unexpected "${typeof u}" stdout in template expression`)};const cn=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util");var un=p(1708);const isStandardStream=u=>dn.includes(u);const dn=[un.stdin,un.stdout,un.stderr];const fn=["stdin","stdout","stderr"];const getStreamName=u=>fn[u]??`stdio[${u}]`;const normalizeFdSpecificOptions=u=>{const A={...u};for(const p of gn){A[p]=normalizeFdSpecificOption(u,p)}return A};const normalizeFdSpecificOption=(u,A)=>{const p=Array.from({length:getStdioLength(u)+1});const y=normalizeFdSpecificValue(u[A],p,A);return addDefaultValue(y,A)};const getStdioLength=({stdio:u})=>Array.isArray(u)?Math.max(u.length,fn.length):fn.length;const normalizeFdSpecificValue=(u,A,p)=>isPlainObject(u)?normalizeOptionObject(u,A,p):A.fill(u);const normalizeOptionObject=(u,A,p)=>{for(const y of Object.keys(u).sort(compareFdName)){for(const E of parseFdName(y,p,A)){A[E]=u[y]}}return A};const compareFdName=(u,A)=>getFdNameOrder(u)<getFdNameOrder(A)?1:-1;const getFdNameOrder=u=>{if(u==="stdout"||u==="stderr"){return 0}return u==="all"?2:1};const parseFdName=(u,A,p)=>{if(u==="ipc"){return[p.length-1]}const y=parseFd(u);if(y===undefined||y===0){throw new TypeError(`"${A}.${u}" is invalid.\nIt must be "${A}.stdout", "${A}.stderr", "${A}.all", "${A}.ipc", or "${A}.fd3", "${A}.fd4" (and so on).`)}if(y>=p.length){throw new TypeError(`"${A}.${u}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}return y==="all"?[1,2]:[y]};const parseFd=u=>{if(u==="all"){return u}if(fn.includes(u)){return fn.indexOf(u)}const A=An.exec(u);if(A!==null){return Number(A[1])}};const An=/^fd(\d+)$/;const addDefaultValue=(u,A)=>u.map((u=>u===undefined?pn[A]:u));const hn=(0,cn.debuglog)("execa").enabled?"full":"none";const pn={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:hn,stripFinalNewline:true};const gn=["lines","buffer","maxBuffer","verbose","stripFinalNewline"];const getFdSpecificValue=(u,A)=>A==="ipc"?u.at(-1):u[A];const isVerbose=({verbose:u},A)=>getFdVerbose(u,A)!=="none";const isFullVerbose=({verbose:u},A)=>!["none","short"].includes(getFdVerbose(u,A));const getVerboseFunction=({verbose:u},A)=>{const p=getFdVerbose(u,A);return isVerboseFunction(p)?p:undefined};const getFdVerbose=(u,A)=>A===undefined?getFdGenericVerbose(u):getFdSpecificValue(u,A);const getFdGenericVerbose=u=>u.find((u=>isVerboseFunction(u)))??mn.findLast((A=>u.includes(A)));const isVerboseFunction=u=>typeof u==="function";const mn=["none","short","full"];const joinCommand=(u,A)=>{const p=[u,...A];const y=p.join(" ");const E=p.map((u=>quoteString(escapeControlCharacters(u)))).join(" ");return{command:y,escapedCommand:E}};const escapeLines=u=>(0,cn.stripVTControlCharacters)(u).split("\n").map((u=>escapeControlCharacters(u))).join("\n");const escapeControlCharacters=u=>u.replaceAll(yn,(u=>escapeControlCharacter(u)));const escapeControlCharacter=u=>{const A=En[u];if(A!==undefined){return A}const p=u.codePointAt(0);const y=p.toString(16);return p<=Cn?`\\u${y.padStart(4,"0")}`:`\\U${y}`};const getSpecialCharRegExp=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}};const yn=getSpecialCharRegExp();const En={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};const Cn=65535;const quoteString=u=>{if(In.test(u)){return u}return un.platform==="win32"?`"${u.replaceAll('"','""')}"`:`'${u.replaceAll("'","'\\''")}'`};const In=/^[\w./-]+$/;function isUnicodeSupported(){const{env:u}=un;const{TERM:A,TERM_PROGRAM:p}=u;if(un.platform!=="win32"){return A!=="linux"}return Boolean(u.WT_SESSION)||Boolean(u.TERMINUS_SUBLIME)||u.ConEmuTask==="{cmd::Cmder}"||p==="Terminus-Sublime"||p==="vscode"||A==="xterm-256color"||A==="alacritty"||A==="rxvt-unicode"||A==="rxvt-unicode-256color"||u.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const bn={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"};const wn={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"};const vn={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"};const Bn={...bn,...wn};const Sn={...bn,...vn};const Dn=isUnicodeSupported();const kn=Dn?Bn:Sn;const Qn=kn;const Fn=Object.entries(wn);const replaceSymbols=(u,{useFallback:A=!Dn}={})=>{if(A){for(const[A,p]of Fn){u=u.replaceAll(p,Sn[A])}}return u};var xn=p(7066);const Rn=xn?.WriteStream?.prototype?.hasColors?.()??false;const format=(u,A)=>{if(!Rn){return u=>u}const p=`[${u}m`;const y=`[${A}m`;return u=>{const E=u+"";let C=E.indexOf(y);if(C===-1){return p+E+y}let I=p;let w=0;const v=A===22;const B=(v?y:"")+p;while(C!==-1){I+=E.slice(w,C)+B;w=C+y.length;C=E.indexOf(y,w)}I+=E.slice(w)+y;return I}};const _n=format(0,0);const Tn=format(1,22);const Nn=format(2,22);const Ln=format(3,23);const Pn=format(4,24);const On=format(53,55);const Mn=format(7,27);const Un=format(8,28);const Hn=format(9,29);const Gn=format(30,39);const Wn=format(31,39);const jn=format(32,39);const zn=format(33,39);const $n=format(34,39);const qn=format(35,39);const Vn=format(36,39);const Kn=format(37,39);const Jn=format(90,39);const Yn=format(40,49);const Xn=format(41,49);const Zn=format(42,49);const er=format(43,49);const tr=format(44,49);const nr=format(45,49);const rr=format(46,49);const sr=format(47,49);const ir=format(100,49);const or=format(91,39);const ar=format(92,39);const lr=format(93,39);const cr=format(94,39);const ur=format(95,39);const dr=format(96,39);const fr=format(97,39);const Ar=format(101,49);const hr=format(102,49);const pr=format(103,49);const gr=format(104,49);const mr=format(105,49);const yr=format(106,49);const Er=format(107,49);const defaultVerboseFunction=({type:u,message:A,timestamp:p,piped:y,commandId:E,result:{failed:C=false}={},options:{reject:I=true}})=>{const w=serializeTimestamp(p);const v=Cr[u]({failed:C,reject:I,piped:y});const B=Ir[u]({reject:I});return`${Jn(`[${w}]`)} ${Jn(`[${E}]`)} ${B(v)} ${B(A)}`};const serializeTimestamp=u=>`${padField(u.getHours(),2)}:${padField(u.getMinutes(),2)}:${padField(u.getSeconds(),2)}.${padField(u.getMilliseconds(),3)}`;const padField=(u,A)=>String(u).padStart(A,"0");const getFinalIcon=({failed:u,reject:A})=>{if(!u){return Qn.tick}return A?Qn.cross:Qn.warning};const Cr={command:({piped:u})=>u?"|":"$",output:()=>" ",ipc:()=>"*",error:getFinalIcon,duration:getFinalIcon};const identity=u=>u;const Ir={command:()=>Tn,output:()=>identity,ipc:()=>identity,error:({reject:u})=>u?or:lr,duration:()=>Jn};const applyVerboseOnLines=(u,A,p)=>{const y=getVerboseFunction(A,p);return u.map((({verboseLine:u,verboseObject:A})=>applyVerboseFunction(u,A,y))).filter((u=>u!==undefined)).map((u=>appendNewline(u))).join("")};const applyVerboseFunction=(u,A,p)=>{if(p===undefined){return u}const y=p(u,A);if(typeof y==="string"){return y}};const appendNewline=u=>u.endsWith("\n")?u:`${u}\n`;const verboseLog=({type:u,verboseMessage:A,fdNumber:p,verboseInfo:y,result:E})=>{const C=getVerboseObject({type:u,result:E,verboseInfo:y});const I=getPrintedLines(A,C);const w=applyVerboseOnLines(I,y,p);if(w!==""){console.warn(w.slice(0,-1))}};const getVerboseObject=({type:u,result:A,verboseInfo:{escapedCommand:p,commandId:y,rawOptions:{piped:E=false,...C}}})=>({type:u,escapedCommand:p,commandId:`${y}`,timestamp:new Date,piped:E,result:A,options:C});const getPrintedLines=(u,A)=>u.split("\n").map((u=>getPrintedLine({...A,message:u})));const getPrintedLine=u=>{const A=defaultVerboseFunction(u);return{verboseLine:A,verboseObject:u}};const serializeVerboseMessage=u=>{const A=typeof u==="string"?u:(0,cn.inspect)(u);const p=escapeLines(A);return p.replaceAll("\t"," ".repeat(br))};const br=2;const logCommand=(u,A)=>{if(!isVerbose(A)){return}verboseLog({type:"command",verboseMessage:u,verboseInfo:A})};const getVerboseInfo=(u,A,p)=>{validateVerbose(u);const y=getCommandId(u);return{verbose:u,escapedCommand:A,commandId:y,rawOptions:p}};const getCommandId=u=>isVerbose({verbose:u})?wr++:undefined;let wr=0n;const validateVerbose=u=>{for(const A of u){if(A===false){throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".')}if(A===true){throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".')}if(!mn.includes(A)&&!isVerboseFunction(A)){const u=mn.map((u=>`'${u}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${A}. Allowed values are: ${u} or a function.`)}}};const getStartTime=()=>un.hrtime.bigint();const getDurationMs=u=>Number(un.hrtime.bigint()-u)/1e6;const handleCommand=(u,A,p)=>{const y=getStartTime();const{command:E,escapedCommand:C}=joinCommand(u,A);const I=normalizeFdSpecificOption(p,"verbose");const w=getVerboseInfo(I,C,{...p});logCommand(C,w);return{command:E,escapedCommand:C,startTime:y,verboseInfo:w}};var vr=p(6186);function pathKey(u={}){const{env:A=process.env,platform:p=process.platform}=u;if(p!=="win32"){return"PATH"}return Object.keys(A).reverse().find((u=>u.toUpperCase()==="PATH"))||"Path"}const Br=(0,cn.promisify)(nn.execFile);function toPath(u){return u instanceof URL?(0,we.fileURLToPath)(u):u}function rootDirectory(u){return path.parse(toPath(u)).root}function traversePathUp(u){return{*[Symbol.iterator](){let A=Fe.resolve(toPath(u));let p;while(p!==A){yield A;p=A;A=Fe.resolve(A,"..")}}}}const Sr=null&&10*1024*1024;async function execFile(u,A,p={}){return Br(u,A,{maxBuffer:Sr,...p})}function execFileSync(u,A=[],p={}){return execFileSyncOriginal(u,A,{maxBuffer:Sr,encoding:"utf8",stdio:"pipe",...p})}const npmRunPath=({cwd:u=un.cwd(),path:A=un.env[pathKey()],preferLocal:p=true,execPath:y=un.execPath,addExecPath:E=true}={})=>{const C=Fe.resolve(toPath(u));const I=[];const w=A.split(Fe.delimiter);if(p){applyPreferLocal(I,w,C)}if(E){applyExecPath(I,w,y,C)}return A===""||A===Fe.delimiter?`${I.join(Fe.delimiter)}${A}`:[...I,A].join(Fe.delimiter)};const applyPreferLocal=(u,A,p)=>{for(const y of traversePathUp(p)){const p=Fe.join(y,"node_modules/.bin");if(!A.includes(p)){u.push(p)}}};const applyExecPath=(u,A,p,y)=>{const E=Fe.resolve(y,toPath(p),"..");if(!A.includes(E)){u.push(E)}};const npmRunPathEnv=({env:u=un.env,...A}={})=>{u={...u};const p=pathKey({env:u});A.path=u[p];u[p]=npmRunPath(A);return u};const Dr=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:timers/promises");const getFinalError=(u,A,p)=>{const y=p?ExecaSyncError:ExecaError;const E=u instanceof DiscardedError?{}:{cause:u};return new y(A,E)};class DiscardedError extends Error{}const setErrorName=(u,A)=>{Object.defineProperty(u.prototype,"name",{value:A,writable:true,enumerable:false,configurable:true});Object.defineProperty(u.prototype,kr,{value:true,writable:false,enumerable:false,configurable:false})};const isExecaError=u=>isErrorInstance(u)&&kr in u;const kr=Symbol("isExecaError");const isErrorInstance=u=>Object.prototype.toString.call(u)==="[object Error]";class ExecaError extends Error{}setErrorName(ExecaError,ExecaError.name);class ExecaSyncError extends Error{}setErrorName(ExecaSyncError,ExecaSyncError.name);var Qr=p(8161);const getRealtimeSignals=()=>{const u=xr-Fr+1;return Array.from({length:u},getRealtimeSignal)};const getRealtimeSignal=(u,A)=>({name:`SIGRT${A+1}`,number:Fr+A,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"});const Fr=34;const xr=64;const Rr=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];const getSignals=()=>{const u=getRealtimeSignals();const A=[...Rr,...u].map(normalizeSignal);return A};const normalizeSignal=({name:u,number:A,description:p,action:y,forced:E=false,standard:C})=>{const{signals:{[u]:I}}=Qr.constants;const w=I!==undefined;const v=w?I:A;return{name:u,number:v,description:p,supported:w,action:y,forced:E,standard:C}};const getSignalsByName=()=>{const u=getSignals();return Object.fromEntries(u.map(getSignalByName))};const getSignalByName=({name:u,number:A,description:p,supported:y,action:E,forced:C,standard:I})=>[u,{name:u,number:A,description:p,supported:y,action:E,forced:C,standard:I}];const _r=getSignalsByName();const getSignalsByNumber=()=>{const u=getSignals();const A=xr+1;const p=Array.from({length:A},((A,p)=>getSignalByNumber(p,u)));return Object.assign({},...p)};const getSignalByNumber=(u,A)=>{const p=findSignalByNumber(u,A);if(p===undefined){return{}}const{name:y,description:E,supported:C,action:I,forced:w,standard:v}=p;return{[u]:{name:y,number:u,description:E,supported:C,action:I,forced:w,standard:v}}};const findSignalByNumber=(u,A)=>{const p=A.find((({name:A})=>Qr.constants.signals[A]===u));if(p!==undefined){return p}return A.find((A=>A.number===u))};const Tr=getSignalsByNumber();const normalizeKillSignal=u=>{const A="option `killSignal`";if(u===0){throw new TypeError(`Invalid ${A}: 0 cannot be used.`)}return signal_normalizeSignal(u,A)};const normalizeSignalArgument=u=>u===0?u:signal_normalizeSignal(u,"`subprocess.kill()`'s argument");const signal_normalizeSignal=(u,A)=>{if(Number.isInteger(u)){return normalizeSignalInteger(u,A)}if(typeof u==="string"){return normalizeSignalName(u,A)}throw new TypeError(`Invalid ${A} ${String(u)}: it must be a string or an integer.\n${getAvailableSignals()}`)};const normalizeSignalInteger=(u,A)=>{if(Nr.has(u)){return Nr.get(u)}throw new TypeError(`Invalid ${A} ${u}: this signal integer does not exist.\n${getAvailableSignals()}`)};const getSignalsIntegerToName=()=>new Map(Object.entries(Qr.constants.signals).reverse().map((([u,A])=>[A,u])));const Nr=getSignalsIntegerToName();const normalizeSignalName=(u,A)=>{if(u in Qr.constants.signals){return u}if(u.toUpperCase()in Qr.constants.signals){throw new TypeError(`Invalid ${A} '${u}': please rename it to '${u.toUpperCase()}'.`)}throw new TypeError(`Invalid ${A} '${u}': this signal name does not exist.\n${getAvailableSignals()}`)};const getAvailableSignals=()=>`Available signal names: ${getAvailableSignalNames()}.\nAvailable signal numbers: ${getAvailableSignalIntegers()}.`;const getAvailableSignalNames=()=>Object.keys(Qr.constants.signals).sort().map((u=>`'${u}'`)).join(", ");const getAvailableSignalIntegers=()=>[...new Set(Object.values(Qr.constants.signals).sort(((u,A)=>u-A)))].join(", ");const getSignalDescription=u=>_r[u].description;const normalizeForceKillAfterDelay=u=>{if(u===false){return u}if(u===true){return Lr}if(!Number.isFinite(u)||u<0){throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${u}\` (${typeof u})`)}return u};const Lr=1e3*5;const subprocessKill=({kill:u,options:{forceKillAfterDelay:A,killSignal:p},onInternalError:y,context:E,controller:C},I,w)=>{const{signal:v,error:B}=parseKillArguments(I,w,p);emitKillError(B,y);const S=u(v);setKillTimeout({kill:u,signal:v,forceKillAfterDelay:A,killSignal:p,killResult:S,context:E,controller:C});return S};const parseKillArguments=(u,A,p)=>{const[y=p,E]=isErrorInstance(u)?[undefined,u]:[u,A];if(typeof y!=="string"&&!Number.isInteger(y)){throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(y)}`)}if(E!==undefined&&!isErrorInstance(E)){throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${E}`)}return{signal:normalizeSignalArgument(y),error:E}};const emitKillError=(u,A)=>{if(u!==undefined){A.reject(u)}};const setKillTimeout=async({kill:u,signal:A,forceKillAfterDelay:p,killSignal:y,killResult:E,context:C,controller:I})=>{if(A===y&&E){killOnTimeout({kill:u,forceKillAfterDelay:p,context:C,controllerSignal:I.signal})}};const killOnTimeout=async({kill:u,forceKillAfterDelay:A,context:p,controllerSignal:y})=>{if(A===false){return}try{await(0,Dr.setTimeout)(A,undefined,{signal:y});if(u("SIGKILL")){p.isForcefullyTerminated??=true}}catch{}};const onAbortedSignal=async(u,A)=>{if(!u.aborted){await(0,Le.once)(u,"abort",{signal:A})}};const validateCancelSignal=({cancelSignal:u})=>{if(u!==undefined&&Object.prototype.toString.call(u)!=="[object AbortSignal]"){throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(u)}`)}};const throwOnCancel=({subprocess:u,cancelSignal:A,gracefulCancel:p,context:y,controller:E})=>A===undefined||p?[]:[terminateOnCancel(u,A,y,E)];const terminateOnCancel=async(u,A,p,{signal:y})=>{await onAbortedSignal(A,y);p.terminationReason??="cancel";u.kill();throw A.reason};const validateIpcMethod=({methodName:u,isSubprocess:A,ipc:p,isConnected:y})=>{validateIpcOption(u,A,p);validateConnection(u,A,y)};const validateIpcOption=(u,A,p)=>{if(!p){throw new Error(`${getMethodName(u,A)} can only be used if the \`ipc\` option is \`true\`.`)}};const validateConnection=(u,A,p)=>{if(!p){throw new Error(`${getMethodName(u,A)} cannot be used: the ${getOtherProcessName(A)} has already exited or disconnected.`)}};const throwOnEarlyDisconnect=u=>{throw new Error(`${getMethodName("getOneMessage",u)} could not complete: the ${getOtherProcessName(u)} exited or disconnected.`)};const throwOnStrictDeadlockError=u=>{throw new Error(`${getMethodName("sendMessage",u)} failed: the ${getOtherProcessName(u)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${getMethodName("getOneMessage",u)},\n\t${getMethodName("sendMessage",u,"message, {strict: true}")},\n]);`)};const getStrictResponseError=(u,A)=>new Error(`${getMethodName("sendMessage",A)} failed when sending an acknowledgment response to the ${getOtherProcessName(A)}.`,{cause:u});const throwOnMissingStrict=u=>{throw new Error(`${getMethodName("sendMessage",u)} failed: the ${getOtherProcessName(u)} is not listening to incoming messages.`)};const throwOnStrictDisconnect=u=>{throw new Error(`${getMethodName("sendMessage",u)} failed: the ${getOtherProcessName(u)} exited without listening to incoming messages.`)};const getAbortDisconnectError=()=>new Error(`\`cancelSignal\` aborted: the ${getOtherProcessName(true)} disconnected.`);const throwOnMissingParent=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")};const handleEpipeError=({error:u,methodName:A,isSubprocess:p})=>{if(u.code==="EPIPE"){throw new Error(`${getMethodName(A,p)} cannot be used: the ${getOtherProcessName(p)} is disconnecting.`,{cause:u})}};const handleSerializationError=({error:u,methodName:A,isSubprocess:p,message:y})=>{if(isSerializationError(u)){throw new Error(`${getMethodName(A,p)}'s argument type is invalid: the message cannot be serialized: ${String(y)}.`,{cause:u})}};const isSerializationError=({code:u,message:A})=>Pr.has(u)||Or.some((u=>A.includes(u)));const Pr=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]);const Or=["could not be cloned","circular structure","call stack size exceeded"];const getMethodName=(u,A,p="")=>u==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${getNamespaceName(A)}${u}(${p})`;const getNamespaceName=u=>u?"":"subprocess.";const getOtherProcessName=u=>u?"parent process":"subprocess";const disconnect=u=>{if(u.connected){u.disconnect()}};const createDeferred=()=>{const u={};const A=new Promise(((A,p)=>{Object.assign(u,{resolve:A,reject:p})}));return Object.assign(A,u)};const getToStream=(u,A="stdin")=>{const p=true;const{options:y,fileDescriptors:E}=Mr.get(u);const C=getFdNumber(E,A,p);const I=u.stdio[C];if(I===null){throw new TypeError(getInvalidStdioOptionMessage(C,A,y,p))}return I};const getFromStream=(u,A="stdout")=>{const p=false;const{options:y,fileDescriptors:E}=Mr.get(u);const C=getFdNumber(E,A,p);const I=C==="all"?u.all:u.stdio[C];if(I===null||I===undefined){throw new TypeError(getInvalidStdioOptionMessage(C,A,y,p))}return I};const Mr=new WeakMap;const getFdNumber=(u,A,p)=>{const y=parseFdNumber(A,p);validateFdNumber(y,A,p,u);return y};const parseFdNumber=(u,A)=>{const p=parseFd(u);if(p!==undefined){return p}const{validOptions:y,defaultValue:E}=A?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${getOptionName(A)}" must not be "${u}".\nIt must be ${y} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${E}".`)};const validateFdNumber=(u,A,p,y)=>{const E=y[getUsedDescriptor(u)];if(E===undefined){throw new TypeError(`"${getOptionName(p)}" must not be ${A}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}if(E.direction==="input"&&!p){throw new TypeError(`"${getOptionName(p)}" must not be ${A}. It must be a readable stream, not writable.`)}if(E.direction!=="input"&&p){throw new TypeError(`"${getOptionName(p)}" must not be ${A}. It must be a writable stream, not readable.`)}};const getInvalidStdioOptionMessage=(u,A,p,y)=>{if(u==="all"&&!p.all){return'The "all" option must be true to use "from: \'all\'".'}const{optionName:E,optionValue:C}=getInvalidStdioOption(u,p);return`The "${E}: ${serializeOptionValue(C)}" option is incompatible with using "${getOptionName(y)}: ${serializeOptionValue(A)}".\nPlease set this option with "pipe" instead.`};const getInvalidStdioOption=(u,{stdin:A,stdout:p,stderr:y,stdio:E})=>{const C=getUsedDescriptor(u);if(C===0&&A!==undefined){return{optionName:"stdin",optionValue:A}}if(C===1&&p!==undefined){return{optionName:"stdout",optionValue:p}}if(C===2&&y!==undefined){return{optionName:"stderr",optionValue:y}}return{optionName:`stdio[${C}]`,optionValue:E[C]}};const getUsedDescriptor=u=>u==="all"?1:u;const getOptionName=u=>u?"to":"from";const serializeOptionValue=u=>{if(typeof u==="string"){return`'${u}'`}return typeof u==="number"?`${u}`:"Stream"};const incrementMaxListeners=(u,A,p)=>{const y=u.getMaxListeners();if(y===0||y===Number.POSITIVE_INFINITY){return}u.setMaxListeners(y+A);(0,Le.addAbortListener)(p,(()=>{u.setMaxListeners(u.getMaxListeners()-A)}))};const addReference=(u,A)=>{if(A){addReferenceCount(u)}};const addReferenceCount=u=>{u.refCounted()};const removeReference=(u,A)=>{if(A){removeReferenceCount(u)}};const removeReferenceCount=u=>{u.unrefCounted()};const undoAddedReferences=(u,A)=>{if(A){removeReferenceCount(u);removeReferenceCount(u)}};const redoAddedReferences=(u,A)=>{if(A){addReferenceCount(u);addReferenceCount(u)}};const onMessage=async({anyProcess:u,channel:A,isSubprocess:p,ipcEmitter:y},E)=>{if(handleStrictResponse(E)||handleAbort(E)){return}if(!Ur.has(u)){Ur.set(u,[])}const C=Ur.get(u);C.push(E);if(C.length>1){return}while(C.length>0){await waitForOutgoingMessages(u,y,E);await Dr.scheduler.yield();const I=await handleStrictRequest({wrappedMessage:C[0],anyProcess:u,channel:A,isSubprocess:p,ipcEmitter:y});C.shift();y.emit("message",I);y.emit("message:done")}};const onDisconnect=async({anyProcess:u,channel:A,isSubprocess:p,ipcEmitter:y,boundOnMessage:E})=>{abortOnDisconnect();const C=Ur.get(u);while(C?.length>0){await(0,Le.once)(y,"message:done")}u.removeListener("message",E);redoAddedReferences(A,p);y.connected=false;y.emit("disconnect")};const Ur=new WeakMap;const getIpcEmitter=(u,A,p)=>{if(Hr.has(u)){return Hr.get(u)}const y=new Le.EventEmitter;y.connected=true;Hr.set(u,y);forwardEvents({ipcEmitter:y,anyProcess:u,channel:A,isSubprocess:p});return y};const Hr=new WeakMap;const forwardEvents=({ipcEmitter:u,anyProcess:A,channel:p,isSubprocess:y})=>{const E=onMessage.bind(undefined,{anyProcess:A,channel:p,isSubprocess:y,ipcEmitter:u});A.on("message",E);A.once("disconnect",onDisconnect.bind(undefined,{anyProcess:A,channel:p,isSubprocess:y,ipcEmitter:u,boundOnMessage:E}));undoAddedReferences(p,y)};const isConnected=u=>{const A=Hr.get(u);return A===undefined?u.channel!==null:A.connected};const handleSendStrict=({anyProcess:u,channel:A,isSubprocess:p,message:y,strict:E})=>{if(!E){return y}const C=getIpcEmitter(u,A,p);const I=hasMessageListeners(u,C);return{id:Gr++,type:jr,message:y,hasListeners:I}};let Gr=0n;const validateStrictDeadlock=(u,A)=>{if(A?.type!==jr||A.hasListeners){return}for(const{id:A}of u){if(A!==undefined){Wr[A].resolve({isDeadlock:true,hasListeners:false})}}};const handleStrictRequest=async({wrappedMessage:u,anyProcess:A,channel:p,isSubprocess:y,ipcEmitter:E})=>{if(u?.type!==jr||!A.connected){return u}const{id:C,message:I}=u;const w={id:C,type:zr,message:hasMessageListeners(A,E)};try{await sendMessage({anyProcess:A,channel:p,isSubprocess:y,ipc:true},w)}catch(u){E.emit("strict:error",u)}return I};const handleStrictResponse=u=>{if(u?.type!==zr){return false}const{id:A,message:p}=u;Wr[A]?.resolve({isDeadlock:false,hasListeners:p});return true};const waitForStrictResponse=async(u,A,p)=>{if(u?.type!==jr){return}const y=createDeferred();Wr[u.id]=y;const E=new AbortController;try{const{isDeadlock:u,hasListeners:C}=await Promise.race([y,throwOnDisconnect(A,p,E)]);if(u){throwOnStrictDeadlockError(p)}if(!C){throwOnMissingStrict(p)}}finally{E.abort();delete Wr[u.id]}};const Wr={};const throwOnDisconnect=async(u,A,{signal:p})=>{incrementMaxListeners(u,1,p);await(0,Le.once)(u,"disconnect",{signal:p});throwOnStrictDisconnect(A)};const jr="execa:ipc:request";const zr="execa:ipc:response";const startSendMessage=(u,A,p)=>{if(!$r.has(u)){$r.set(u,new Set)}const y=$r.get(u);const E=createDeferred();const C=p?A.id:undefined;const I={onMessageSent:E,id:C};y.add(I);return{outgoingMessages:y,outgoingMessage:I}};const endSendMessage=({outgoingMessages:u,outgoingMessage:A})=>{u.delete(A);A.onMessageSent.resolve()};const waitForOutgoingMessages=async(u,A,p)=>{while(!hasMessageListeners(u,A)&&$r.get(u)?.size>0){const A=[...$r.get(u)];validateStrictDeadlock(A,p);await Promise.all(A.map((({onMessageSent:u})=>u)))}};const $r=new WeakMap;const hasMessageListeners=(u,A)=>A.listenerCount("message")>getMinListenerCount(u);const getMinListenerCount=u=>Mr.has(u)&&!getFdSpecificValue(Mr.get(u).options.buffer,"ipc")?1:0;const sendMessage=({anyProcess:u,channel:A,isSubprocess:p,ipc:y},E,{strict:C=false}={})=>{const I="sendMessage";validateIpcMethod({methodName:I,isSubprocess:p,ipc:y,isConnected:u.connected});return sendMessageAsync({anyProcess:u,channel:A,methodName:I,isSubprocess:p,message:E,strict:C})};const sendMessageAsync=async({anyProcess:u,channel:A,methodName:p,isSubprocess:y,message:E,strict:C})=>{const I=handleSendStrict({anyProcess:u,channel:A,isSubprocess:y,message:E,strict:C});const w=startSendMessage(u,I,C);try{await sendOneMessage({anyProcess:u,methodName:p,isSubprocess:y,wrappedMessage:I,message:E})}catch(A){disconnect(u);throw A}finally{endSendMessage(w)}};const sendOneMessage=async({anyProcess:u,methodName:A,isSubprocess:p,wrappedMessage:y,message:E})=>{const C=getSendMethod(u);try{await Promise.all([waitForStrictResponse(y,u,p),C(y)])}catch(u){handleEpipeError({error:u,methodName:A,isSubprocess:p});handleSerializationError({error:u,methodName:A,isSubprocess:p,message:E});throw u}};const getSendMethod=u=>{if(qr.has(u)){return qr.get(u)}const A=(0,cn.promisify)(u.send.bind(u));qr.set(u,A);return A};const qr=new WeakMap;const sendAbort=(u,A)=>{const p="cancelSignal";validateConnection(p,false,u.connected);return sendOneMessage({anyProcess:u,methodName:p,isSubprocess:false,wrappedMessage:{type:Kr,message:A},message:A})};const getCancelSignal=async({anyProcess:u,channel:A,isSubprocess:p,ipc:y})=>{await startIpc({anyProcess:u,channel:A,isSubprocess:p,ipc:y});return Jr.signal};const startIpc=async({anyProcess:u,channel:A,isSubprocess:p,ipc:y})=>{if(Vr){return}Vr=true;if(!y){throwOnMissingParent();return}if(A===null){abortOnDisconnect();return}getIpcEmitter(u,A,p);await Dr.scheduler.yield()};let Vr=false;const handleAbort=u=>{if(u?.type!==Kr){return false}Jr.abort(u.message);return true};const Kr="execa:ipc:cancel";const abortOnDisconnect=()=>{Jr.abort(getAbortDisconnectError())};const Jr=new AbortController;const validateGracefulCancel=({gracefulCancel:u,cancelSignal:A,ipc:p,serialization:y})=>{if(!u){return}if(A===undefined){throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.")}if(!p){throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.")}if(y==="json"){throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}};const throwOnGracefulCancel=({subprocess:u,cancelSignal:A,gracefulCancel:p,forceKillAfterDelay:y,context:E,controller:C})=>p?[sendOnAbort({subprocess:u,cancelSignal:A,forceKillAfterDelay:y,context:E,controller:C})]:[];const sendOnAbort=async({subprocess:u,cancelSignal:A,forceKillAfterDelay:p,context:y,controller:{signal:E}})=>{await onAbortedSignal(A,E);const C=getReason(A);await sendAbort(u,C);killOnTimeout({kill:u.kill,forceKillAfterDelay:p,context:y,controllerSignal:E});y.terminationReason??="gracefulCancel";throw A.reason};const getReason=({reason:u})=>{if(!(u instanceof DOMException)){return u}const A=new Error(u.message);Object.defineProperty(A,"stack",{value:u.stack,enumerable:false,configurable:true,writable:true});return A};const timeout_validateTimeout=({timeout:u})=>{if(u!==undefined&&(!Number.isFinite(u)||u<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${u}\` (${typeof u})`)}};const throwOnTimeout=(u,A,p,y)=>A===0||A===undefined?[]:[killAfterTimeout(u,A,p,y)];const killAfterTimeout=async(u,A,p,{signal:y})=>{await(0,Dr.setTimeout)(A,undefined,{signal:y});p.terminationReason??="timeout";u.kill();throw new DiscardedError};const mapNode=({options:u})=>{if(u.node===false){throw new TypeError('The "node" option cannot be false with `execaNode()`.')}return{options:{...u,node:true}}};const handleNodeOption=(u,A,{node:p=false,nodePath:y=un.execPath,nodeOptions:E=un.execArgv.filter((u=>!u.startsWith("--inspect"))),cwd:C,execPath:I,...w})=>{if(I!==undefined){throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.')}const v=safeNormalizeFileUrl(y,'The "nodePath" option');const B=Fe.resolve(C,v);const S={...w,nodePath:B,node:p,cwd:C};if(!p){return[u,A,S]}if(Fe.basename(u,".exe")==="node"){throw new TypeError('When the "node" option is true, the first argument does not need to be "node".')}return[B,[...E,u,...A],{ipc:true,...S,shell:false}]};const Yr=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:v8");const validateIpcInputOption=({ipcInput:u,ipc:A,serialization:p})=>{if(u===undefined){return}if(!A){throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.")}Xr[p](u)};const validateAdvancedInput=u=>{try{(0,Yr.serialize)(u)}catch(u){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:u})}};const validateJsonInput=u=>{try{JSON.stringify(u)}catch(u){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:u})}};const Xr={advanced:validateAdvancedInput,json:validateJsonInput};const sendIpcInput=async(u,A)=>{if(A===undefined){return}await u.sendMessage(A)};const validateEncoding=({encoding:u})=>{if(ts.has(u)){return}const A=getCorrectEncoding(u);if(A!==undefined){throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(u)}\`.\nPlease rename it to ${serializeEncoding(A)}.`)}const p=[...ts].map((u=>serializeEncoding(u))).join(", ");throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(u)}\`.\nPlease rename it to one of: ${p}.`)};const Zr=new Set(["utf8","utf16le"]);const es=new Set(["buffer","hex","base64","base64url","latin1","ascii"]);const ts=new Set([...Zr,...es]);const getCorrectEncoding=u=>{if(u===null){return"buffer"}if(typeof u!=="string"){return}const A=u.toLowerCase();if(A in ns){return ns[A]}if(ts.has(A)){return A}};const ns={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"};const serializeEncoding=u=>typeof u==="string"?`"${u}"`:String(u);const normalizeCwd=(u=getDefaultCwd())=>{const A=safeNormalizeFileUrl(u,'The "cwd" option');return Fe.resolve(A)};const getDefaultCwd=()=>{try{return un.cwd()}catch(u){u.message=`The current directory does not exist.\n${u.message}`;throw u}};const fixCwdError=(u,A)=>{if(A===getDefaultCwd()){return u}let p;try{p=(0,_e.statSync)(A)}catch(p){return`The "cwd" option is invalid: ${A}.\n${p.message}\n${u}`}if(!p.isDirectory()){return`The "cwd" option is not a directory: ${A}.\n${u}`}return u};const normalizeOptions=(u,A,p)=>{p.cwd=normalizeCwd(p.cwd);const[y,E,C]=handleNodeOption(u,A,p);const{command:I,args:w,options:v}=vr._parse(y,E,C);const B=normalizeFdSpecificOptions(v);const S=addDefaultOptions(B);timeout_validateTimeout(S);validateEncoding(S);validateIpcInputOption(S);validateCancelSignal(S);validateGracefulCancel(S);S.shell=normalizeFileUrl(S.shell);S.env=getEnv(S);S.killSignal=normalizeKillSignal(S.killSignal);S.forceKillAfterDelay=normalizeForceKillAfterDelay(S.forceKillAfterDelay);S.lines=S.lines.map(((u,A)=>u&&!es.has(S.encoding)&&S.buffer[A]));if(un.platform==="win32"&&Fe.basename(I,".exe")==="cmd"){w.unshift("/q")}return{file:I,commandArguments:w,options:S}};const addDefaultOptions=({extendEnv:u=true,preferLocal:A=false,cwd:p,localDir:y=p,encoding:E="utf8",reject:C=true,cleanup:I=true,all:w=false,windowsHide:v=true,killSignal:B="SIGTERM",forceKillAfterDelay:S=true,gracefulCancel:D=false,ipcInput:k,ipc:Q=k!==undefined||D,serialization:F="advanced",...R})=>({...R,extendEnv:u,preferLocal:A,cwd:p,localDirectory:y,encoding:E,reject:C,cleanup:I,all:w,windowsHide:v,killSignal:B,forceKillAfterDelay:S,gracefulCancel:D,ipcInput:k,ipc:Q,serialization:F});const getEnv=({env:u,extendEnv:A,preferLocal:p,node:y,localDirectory:E,nodePath:C})=>{const I=A?{...un.env,...u}:u;if(p||y){return npmRunPathEnv({env:I,cwd:E,execPath:C,preferLocal:p,addExecPath:y})}return I};const concatenateShell=(u,A,p)=>p.shell&&A.length>0?[[u,...A].join(" "),[],p]:[u,A,p];function strip_final_newline_stripFinalNewline(u){if(typeof u==="string"){return stripFinalNewlineString(u)}if(!(ArrayBuffer.isView(u)&&u.BYTES_PER_ELEMENT===1)){throw new Error("Input must be a string or a Uint8Array")}return stripFinalNewlineBinary(u)}const stripFinalNewlineString=u=>u.at(-1)===rs?u.slice(0,u.at(-2)===os?-2:-1):u;const stripFinalNewlineBinary=u=>u.at(-1)===ss?u.subarray(0,u.at(-2)===as?-2:-1):u;const rs="\n";const ss=rs.codePointAt(0);const os="\r";const as=os.codePointAt(0);function is_stream_isStream(u,{checkOpen:A=true}={}){return u!==null&&typeof u==="object"&&(u.writable||u.readable||!A||u.writable===undefined&&u.readable===undefined)&&typeof u.pipe==="function"}function isWritableStream(u,{checkOpen:A=true}={}){return is_stream_isStream(u,{checkOpen:A})&&(u.writable||!A)&&typeof u.write==="function"&&typeof u.end==="function"&&typeof u.writable==="boolean"&&typeof u.writableObjectMode==="boolean"&&typeof u.destroy==="function"&&typeof u.destroyed==="boolean"}function isReadableStream(u,{checkOpen:A=true}={}){return is_stream_isStream(u,{checkOpen:A})&&(u.readable||!A)&&typeof u.read==="function"&&typeof u.readable==="boolean"&&typeof u.readableObjectMode==="boolean"&&typeof u.destroy==="function"&&typeof u.destroyed==="boolean"}function isDuplexStream(u,A){return isWritableStream(u,A)&&isReadableStream(u,A)}function isTransformStream(u,A){return isDuplexStream(u,A)&&typeof u._transform==="function"}const ls=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class c{#mt;#yt;#Et=!1;#Ct=void 0;constructor(u,A){this.#mt=u,this.#yt=A}next(){const e=()=>this.#It();return this.#Ct=this.#Ct?this.#Ct.then(e,e):e(),this.#Ct}return(u){const t=()=>this.#bt(u);return this.#Ct?this.#Ct.then(t,t):t()}async#It(){if(this.#Et)return{done:!0,value:void 0};let u;try{u=await this.#mt.read()}catch(u){throw this.#Ct=void 0,this.#Et=!0,this.#mt.releaseLock(),u}return u.done&&(this.#Ct=void 0,this.#Et=!0,this.#mt.releaseLock()),u}async#bt(u){if(this.#Et)return{done:!0,value:u};if(this.#Et=!0,!this.#yt){const A=this.#mt.cancel(u);return this.#mt.releaseLock(),await A,{done:!0,value:u}}return this.#mt.releaseLock(),{done:!0,value:u}}}const cs=Symbol();function i(){return this[cs].next()}Object.defineProperty(i,"name",{value:"next"});function o(u){return this[cs].return(u)}Object.defineProperty(o,"name",{value:"return"});const us=Object.create(ls,{next:{enumerable:!0,configurable:!0,writable:!0,value:i},return:{enumerable:!0,configurable:!0,writable:!0,value:o}});function h({preventCancel:u=!1}={}){const A=this.getReader(),p=new c(A,u),y=Object.create(us);return y[cs]=p,y}const getAsyncIterable=u=>{if(isReadableStream(u,{checkOpen:false})&&fs.on!==undefined){return getStreamIterable(u)}if(typeof u?.[Symbol.asyncIterator]==="function"){return u}if(ds.call(u)==="[object ReadableStream]"){return h.call(u)}throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")};const{toString:ds}=Object.prototype;const getStreamIterable=async function*(u){const A=new AbortController;const p={};handleStreamEnd(u,A,p);try{for await(const[p]of fs.on(u,"data",{signal:A.signal})){yield p}}catch(u){if(p.error!==undefined){throw p.error}else if(!A.signal.aborted){throw u}}finally{u.destroy()}};const handleStreamEnd=async(u,A,p)=>{try{await fs.finished(u,{cleanup:true,readable:true,writable:false,error:false})}catch(u){p.error=u}finally{A.abort()}};const fs={};const getStreamContents=async(u,{init:A,convertChunk:p,getSize:y,truncateChunk:E,addChunk:C,getFinalChunk:I,finalize:w},{maxBuffer:v=Number.POSITIVE_INFINITY}={})=>{const B=getAsyncIterable(u);const S=A();S.length=0;try{for await(const u of B){const A=getChunkType(u);const I=p[A](u,S);appendChunk({convertedChunk:I,state:S,getSize:y,truncateChunk:E,addChunk:C,maxBuffer:v})}appendFinalChunk({state:S,convertChunk:p,getSize:y,truncateChunk:E,addChunk:C,getFinalChunk:I,maxBuffer:v});return w(S)}catch(u){const A=typeof u==="object"&&u!==null?u:new Error(u);A.bufferedData=w(S);throw A}};const appendFinalChunk=({state:u,getSize:A,truncateChunk:p,addChunk:y,getFinalChunk:E,maxBuffer:C})=>{const I=E(u);if(I!==undefined){appendChunk({convertedChunk:I,state:u,getSize:A,truncateChunk:p,addChunk:y,maxBuffer:C})}};const appendChunk=({convertedChunk:u,state:A,getSize:p,truncateChunk:y,addChunk:E,maxBuffer:C})=>{const I=p(u);const w=A.length+I;if(w<=C){addNewChunk(u,A,E,w);return}const v=y(u,C-A.length);if(v!==undefined){addNewChunk(v,A,E,C)}throw new MaxBufferError};const addNewChunk=(u,A,p,y)=>{A.contents=p(u,A,y);A.length=y};const getChunkType=u=>{const A=typeof u;if(A==="string"){return"string"}if(A!=="object"||u===null){return"others"}if(globalThis.Buffer?.isBuffer(u)){return"buffer"}const p=As.call(u);if(p==="[object ArrayBuffer]"){return"arrayBuffer"}if(p==="[object DataView]"){return"dataView"}if(Number.isInteger(u.byteLength)&&Number.isInteger(u.byteOffset)&&As.call(u.buffer)==="[object ArrayBuffer]"){return"typedArray"}return"others"};const{toString:As}=Object.prototype;class MaxBufferError extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const handleMaxBuffer=({error:u,stream:A,readableObjectMode:p,lines:y,encoding:E,fdNumber:C})=>{if(!(u instanceof MaxBufferError)){throw u}if(C==="all"){return u}const I=getMaxBufferUnit(p,y,E);u.maxBufferInfo={fdNumber:C,unit:I};A.destroy();throw u};const getMaxBufferUnit=(u,A,p)=>{if(u){return"objects"}if(A){return"lines"}if(p==="buffer"){return"bytes"}return"characters"};const checkIpcMaxBuffer=(u,A,p)=>{if(A.length!==p){return}const y=new MaxBufferError;y.maxBufferInfo={fdNumber:"ipc"};throw y};const getMaxBufferMessage=(u,A)=>{const{streamName:p,threshold:y,unit:E}=getMaxBufferInfo(u,A);return`Command's ${p} was larger than ${y} ${E}`};const getMaxBufferInfo=(u,A)=>{if(u?.maxBufferInfo===undefined){return{streamName:"output",threshold:A[1],unit:"bytes"}}const{maxBufferInfo:{fdNumber:p,unit:y}}=u;delete u.maxBufferInfo;const E=getFdSpecificValue(A,p);if(p==="ipc"){return{streamName:"IPC output",threshold:E,unit:"messages"}}return{streamName:getStreamName(p),threshold:E,unit:y}};const isMaxBufferSync=(u,A,p)=>u?.code==="ENOBUFS"&&A!==null&&A.some((u=>u!==null&&u.length>getMaxBufferSync(p)));const truncateMaxBufferSync=(u,A,p)=>{if(!A){return u}const y=getMaxBufferSync(p);return u.length>y?u.slice(0,y):u};const getMaxBufferSync=([,u])=>u;const createMessages=({stdio:u,all:A,ipcOutput:p,originalError:y,signal:E,signalDescription:C,exitCode:I,escapedCommand:w,timedOut:v,isCanceled:B,isGracefullyCanceled:S,isMaxBuffer:D,isForcefullyTerminated:k,forceKillAfterDelay:Q,killSignal:F,maxBuffer:R,timeout:_,cwd:P})=>{const O=y?.code;const U=getErrorPrefix({originalError:y,timedOut:v,timeout:_,isMaxBuffer:D,maxBuffer:R,errorCode:O,signal:E,signalDescription:C,exitCode:I,isCanceled:B,isGracefullyCanceled:S,isForcefullyTerminated:k,forceKillAfterDelay:Q,killSignal:F});const H=getOriginalMessage(y,P);const G=H===undefined?"":`\n${H}`;const j=`${U}: ${w}${G}`;const $=A===undefined?[u[2],u[1]]:[A];const q=[j,...$,...u.slice(3),p.map((u=>serializeIpcMessage(u))).join("\n")].map((u=>escapeLines(strip_final_newline_stripFinalNewline(serializeMessagePart(u))))).filter(Boolean).join("\n\n");return{originalMessage:H,shortMessage:j,message:q}};const getErrorPrefix=({originalError:u,timedOut:A,timeout:p,isMaxBuffer:y,maxBuffer:E,errorCode:C,signal:I,signalDescription:w,exitCode:v,isCanceled:B,isGracefullyCanceled:S,isForcefullyTerminated:D,forceKillAfterDelay:k,killSignal:Q})=>{const F=getForcefulSuffix(D,k);if(A){return`Command timed out after ${p} milliseconds${F}`}if(S){if(I===undefined){return`Command was gracefully canceled with exit code ${v}`}return D?`Command was gracefully canceled${F}`:`Command was gracefully canceled with ${I} (${w})`}if(B){return`Command was canceled${F}`}if(y){return`${getMaxBufferMessage(u,E)}${F}`}if(C!==undefined){return`Command failed with ${C}${F}`}if(D){return`Command was killed with ${Q} (${getSignalDescription(Q)})${F}`}if(I!==undefined){return`Command was killed with ${I} (${w})`}if(v!==undefined){return`Command failed with exit code ${v}`}return"Command failed"};const getForcefulSuffix=(u,A)=>u?` and was forcefully terminated after ${A} milliseconds`:"";const getOriginalMessage=(u,A)=>{if(u instanceof DiscardedError){return}const p=isExecaError(u)?u.originalMessage:String(u?.message??u);const y=escapeLines(fixCwdError(p,A));return y===""?undefined:y};const serializeIpcMessage=u=>typeof u==="string"?u:(0,cn.inspect)(u);const serializeMessagePart=u=>Array.isArray(u)?u.map((u=>strip_final_newline_stripFinalNewline(serializeMessageItem(u)))).filter(Boolean).join("\n"):serializeMessageItem(u);const serializeMessageItem=u=>{if(typeof u==="string"){return u}if(isUint8Array(u)){return uint8ArrayToString(u)}return""};const makeSuccessResult=({command:u,escapedCommand:A,stdio:p,all:y,ipcOutput:E,options:{cwd:C},startTime:I})=>omitUndefinedProperties({command:u,escapedCommand:A,cwd:C,durationMs:getDurationMs(I),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:p[1],stderr:p[2],all:y,stdio:p,ipcOutput:E,pipedFrom:[]});const makeEarlyError=({error:u,command:A,escapedCommand:p,fileDescriptors:y,options:E,startTime:C,isSync:I})=>makeError({error:u,command:A,escapedCommand:p,startTime:C,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:y.length}),ipcOutput:[],options:E,isSync:I});const makeError=({error:u,command:A,escapedCommand:p,startTime:y,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:B,signal:S,stdio:D,all:k,ipcOutput:Q,options:{timeoutDuration:F,timeout:R=F,forceKillAfterDelay:_,killSignal:P,cwd:O,maxBuffer:U},isSync:H})=>{const{exitCode:G,signal:j,signalDescription:$}=normalizeExitPayload(B,S);const{originalMessage:q,shortMessage:K,message:J}=createMessages({stdio:D,all:k,ipcOutput:Q,originalError:u,signal:j,signalDescription:$,exitCode:G,escapedCommand:p,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,forceKillAfterDelay:_,killSignal:P,maxBuffer:U,timeout:R,cwd:O});const ee=getFinalError(u,J,H);Object.assign(ee,getErrorProperties({error:ee,command:A,escapedCommand:p,startTime:y,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:G,signal:j,signalDescription:$,stdio:D,all:k,ipcOutput:Q,cwd:O,originalMessage:q,shortMessage:K}));return ee};const getErrorProperties=({error:u,command:A,escapedCommand:p,startTime:y,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:B,signal:S,signalDescription:D,stdio:k,all:Q,ipcOutput:F,cwd:R,originalMessage:_,shortMessage:P})=>omitUndefinedProperties({shortMessage:P,originalMessage:_,command:A,escapedCommand:p,cwd:R,durationMs:getDurationMs(y),failed:true,timedOut:E,isCanceled:C,isGracefullyCanceled:I,isTerminated:S!==undefined,isMaxBuffer:w,isForcefullyTerminated:v,exitCode:B,signal:S,signalDescription:D,code:u.cause?.code,stdout:k[1],stderr:k[2],all:Q,stdio:k,ipcOutput:F,pipedFrom:[]});const omitUndefinedProperties=u=>Object.fromEntries(Object.entries(u).filter((([,u])=>u!==undefined)));const normalizeExitPayload=(u,A)=>{const p=u===null?undefined:u;const y=A===null?undefined:A;const E=y===undefined?undefined:getSignalDescription(A);return{exitCode:p,signal:y,signalDescription:E}};const toZeroIfInfinity=u=>Number.isFinite(u)?u:0;function parseNumber(u){return{days:Math.trunc(u/864e5),hours:Math.trunc(u/36e5%24),minutes:Math.trunc(u/6e4%60),seconds:Math.trunc(u/1e3%60),milliseconds:Math.trunc(u%1e3),microseconds:Math.trunc(toZeroIfInfinity(u*1e3)%1e3),nanoseconds:Math.trunc(toZeroIfInfinity(u*1e6)%1e3)}}function parseBigint(u){return{days:u/86400000n,hours:u/3600000n%24n,minutes:u/60000n%60n,seconds:u/1000n%60n,milliseconds:u%1000n,microseconds:0n,nanoseconds:0n}}function parseMilliseconds(u){switch(typeof u){case"number":{if(Number.isFinite(u)){return parseNumber(u)}break}case"bigint":{return parseBigint(u)}}throw new TypeError("Expected a finite number or bigint")}const isZero=u=>u===0||u===0n;const pluralize=(u,A)=>A===1||A===1n?u:`${u}s`;const hs=1e-7;const ps=24n*60n*60n*1000n;function prettyMilliseconds(u,A){const p=typeof u==="bigint";if(!p&&!Number.isFinite(u)){throw new TypeError("Expected a finite number or bigint")}A={...A};const y=u<0?"-":"";u=u<0?-u:u;if(A.colonNotation){A.compact=false;A.formatSubMilliseconds=false;A.separateMilliseconds=false;A.verbose=false}if(A.compact){A.unitCount=1;A.secondsDecimalDigits=0;A.millisecondsDecimalDigits=0}let E=[];const floorDecimals=(u,A)=>{const p=Math.floor(u*10**A+hs);const y=Math.round(p)/10**A;return y.toFixed(A)};const add=(u,p,y,C)=>{if((E.length===0||!A.colonNotation)&&isZero(u)&&!(A.colonNotation&&y==="m")){return}C??=String(u);if(A.colonNotation){const u=C.includes(".")?C.split(".")[0].length:C.length;const A=E.length>0?2:1;C="0".repeat(Math.max(0,A-u))+C}else{C+=A.verbose?" "+pluralize(p,u):y}E.push(C)};const C=parseMilliseconds(u);const I=BigInt(C.days);if(A.hideYearAndDays){add(BigInt(I)*24n+BigInt(C.hours),"hour","h")}else{if(A.hideYear){add(I,"day","d")}else{add(I/365n,"year","y");add(I%365n,"day","d")}add(Number(C.hours),"hour","h")}add(Number(C.minutes),"minute","m");if(!A.hideSeconds){if(A.separateMilliseconds||A.formatSubMilliseconds||!A.colonNotation&&u<1e3&&!A.subSecondsAsDecimals){const u=Number(C.seconds);const p=Number(C.milliseconds);const y=Number(C.microseconds);const E=Number(C.nanoseconds);add(u,"second","s");if(A.formatSubMilliseconds){add(p,"millisecond","ms");add(y,"microsecond","µs");add(E,"nanosecond","ns")}else{const u=p+y/1e3+E/1e6;const C=typeof A.millisecondsDecimalDigits==="number"?A.millisecondsDecimalDigits:0;const I=u>=1?Math.round(u):Math.ceil(u);const w=C?u.toFixed(C):I;add(Number.parseFloat(w),"millisecond","ms",w)}}else{const y=(p?Number(u%ps):u)/1e3%60;const E=typeof A.secondsDecimalDigits==="number"?A.secondsDecimalDigits:1;const C=floorDecimals(y,E);const I=A.keepDecimalsOnWholeSeconds?C:C.replace(/\.0+$/,"");add(Number.parseFloat(I),"second","s",I)}}if(E.length===0){return y+"0"+(A.verbose?" milliseconds":"ms")}const w=A.colonNotation?":":" ";if(typeof A.unitCount==="number"){E=E.slice(0,Math.max(A.unitCount,1))}return y+E.join(w)}const logError=(u,A)=>{if(u.failed){verboseLog({type:"error",verboseMessage:u.shortMessage,verboseInfo:A,result:u})}};const logResult=(u,A)=>{if(!isVerbose(A)){return}logError(u,A);logDuration(u,A)};const logDuration=(u,A)=>{const p=`(done in ${prettyMilliseconds(u.durationMs)})`;verboseLog({type:"duration",verboseMessage:p,verboseInfo:A,result:u})};const handleResult=(u,A,{reject:p})=>{logResult(u,A);if(u.failed&&p){throw u}return u};const getStdioItemType=(u,A)=>{if(isAsyncGenerator(u)){return"asyncGenerator"}if(isSyncGenerator(u)){return"generator"}if(isUrl(u)){return"fileUrl"}if(isFilePathObject(u)){return"filePath"}if(isWebStream(u)){return"webStream"}if(is_stream_isStream(u,{checkOpen:false})){return"native"}if(isUint8Array(u)){return"uint8Array"}if(isAsyncIterableObject(u)){return"asyncIterable"}if(isIterableObject(u)){return"iterable"}if(type_isTransformStream(u)){return getTransformStreamType({transform:u},A)}if(isTransformOptions(u)){return getTransformObjectType(u,A)}return"native"};const getTransformObjectType=(u,A)=>{if(isDuplexStream(u.transform,{checkOpen:false})){return getDuplexType(u,A)}if(type_isTransformStream(u.transform)){return getTransformStreamType(u,A)}return getGeneratorObjectType(u,A)};const getDuplexType=(u,A)=>{validateNonGeneratorType(u,A,"Duplex stream");return"duplex"};const getTransformStreamType=(u,A)=>{validateNonGeneratorType(u,A,"web TransformStream");return"webTransform"};const validateNonGeneratorType=({final:u,binary:A,objectMode:p},y,E)=>{checkUndefinedOption(u,`${y}.final`,E);checkUndefinedOption(A,`${y}.binary`,E);checkBooleanOption(p,`${y}.objectMode`)};const checkUndefinedOption=(u,A,p)=>{if(u!==undefined){throw new TypeError(`The \`${A}\` option can only be defined when using a generator, not a ${p}.`)}};const getGeneratorObjectType=({transform:u,final:A,binary:p,objectMode:y},E)=>{if(u!==undefined&&!isGenerator(u)){throw new TypeError(`The \`${E}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`)}if(isDuplexStream(A,{checkOpen:false})){throw new TypeError(`The \`${E}.final\` option must not be a Duplex stream.`)}if(type_isTransformStream(A)){throw new TypeError(`The \`${E}.final\` option must not be a web TransformStream.`)}if(A!==undefined&&!isGenerator(A)){throw new TypeError(`The \`${E}.final\` option must be a generator.`)}checkBooleanOption(p,`${E}.binary`);checkBooleanOption(y,`${E}.objectMode`);return isAsyncGenerator(u)||isAsyncGenerator(A)?"asyncGenerator":"generator"};const checkBooleanOption=(u,A)=>{if(u!==undefined&&typeof u!=="boolean"){throw new TypeError(`The \`${A}\` option must use a boolean.`)}};const isGenerator=u=>isAsyncGenerator(u)||isSyncGenerator(u);const isAsyncGenerator=u=>Object.prototype.toString.call(u)==="[object AsyncGeneratorFunction]";const isSyncGenerator=u=>Object.prototype.toString.call(u)==="[object GeneratorFunction]";const isTransformOptions=u=>isPlainObject(u)&&(u.transform!==undefined||u.final!==undefined);const isUrl=u=>Object.prototype.toString.call(u)==="[object URL]";const isRegularUrl=u=>isUrl(u)&&u.protocol!=="file:";const isFilePathObject=u=>isPlainObject(u)&&Object.keys(u).length>0&&Object.keys(u).every((u=>gs.has(u)))&&isFilePathString(u.file);const gs=new Set(["file","append"]);const isFilePathString=u=>typeof u==="string";const isUnknownStdioString=(u,A)=>u==="native"&&typeof A==="string"&&!ms.has(A);const ms=new Set(["ipc","ignore","inherit","overlapped","pipe"]);const type_isReadableStream=u=>Object.prototype.toString.call(u)==="[object ReadableStream]";const type_isWritableStream=u=>Object.prototype.toString.call(u)==="[object WritableStream]";const isWebStream=u=>type_isReadableStream(u)||type_isWritableStream(u);const type_isTransformStream=u=>type_isReadableStream(u?.readable)&&type_isWritableStream(u?.writable);const isAsyncIterableObject=u=>isObject(u)&&typeof u[Symbol.asyncIterator]==="function";const isIterableObject=u=>isObject(u)&&typeof u[Symbol.iterator]==="function";const isObject=u=>typeof u==="object"&&u!==null;const ys=new Set(["generator","asyncGenerator","duplex","webTransform"]);const Es=new Set(["fileUrl","filePath","fileNumber"]);const Cs=new Set(["fileUrl","filePath"]);const Is=new Set([...Cs,"webStream","nodeStream"]);const bs=new Set(["webTransform","duplex"]);const ws={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};const getTransformObjectModes=(u,A,p,y)=>y==="output"?getOutputObjectModes(u,A,p):getInputObjectModes(u,A,p);const getOutputObjectModes=(u,A,p)=>{const y=A!==0&&p[A-1].value.readableObjectMode;const E=u??y;return{writableObjectMode:y,readableObjectMode:E}};const getInputObjectModes=(u,A,p)=>{const y=A===0?u===true:p[A-1].value.readableObjectMode;const E=A!==p.length-1&&(u??y);return{writableObjectMode:y,readableObjectMode:E}};const getFdObjectMode=(u,A)=>{const p=u.findLast((({type:u})=>ys.has(u)));if(p===undefined){return false}return A==="input"?p.value.writableObjectMode:p.value.readableObjectMode};const normalizeTransforms=(u,A,p,y)=>[...u.filter((({type:u})=>!ys.has(u))),...getTransforms(u,A,p,y)];const getTransforms=(u,A,p,{encoding:y})=>{const E=u.filter((({type:u})=>ys.has(u)));const C=Array.from({length:E.length});for(const[u,I]of Object.entries(E)){C[u]=normalizeTransform({stdioItem:I,index:Number(u),newTransforms:C,optionName:A,direction:p,encoding:y})}return sortTransforms(C,p)};const normalizeTransform=({stdioItem:u,stdioItem:{type:A},index:p,newTransforms:y,optionName:E,direction:C,encoding:I})=>{if(A==="duplex"){return normalizeDuplex({stdioItem:u,optionName:E})}if(A==="webTransform"){return normalizeTransformStream({stdioItem:u,index:p,newTransforms:y,direction:C})}return normalizeGenerator({stdioItem:u,index:p,newTransforms:y,direction:C,encoding:I})};const normalizeDuplex=({stdioItem:u,stdioItem:{value:{transform:A,transform:{writableObjectMode:p,readableObjectMode:y},objectMode:E=y}},optionName:C})=>{if(E&&!y){throw new TypeError(`The \`${C}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`)}if(!E&&y){throw new TypeError(`The \`${C}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`)}return{...u,value:{transform:A,writableObjectMode:p,readableObjectMode:y}}};const normalizeTransformStream=({stdioItem:u,stdioItem:{value:A},index:p,newTransforms:y,direction:E})=>{const{transform:C,objectMode:I}=isPlainObject(A)?A:{transform:A};const{writableObjectMode:w,readableObjectMode:v}=getTransformObjectModes(I,p,y,E);return{...u,value:{transform:C,writableObjectMode:w,readableObjectMode:v}}};const normalizeGenerator=({stdioItem:u,stdioItem:{value:A},index:p,newTransforms:y,direction:E,encoding:C})=>{const{transform:I,final:w,binary:v=false,preserveNewlines:B=false,objectMode:S}=isPlainObject(A)?A:{transform:A};const D=v||es.has(C);const{writableObjectMode:k,readableObjectMode:Q}=getTransformObjectModes(S,p,y,E);return{...u,value:{transform:I,final:w,binary:D,preserveNewlines:B,writableObjectMode:k,readableObjectMode:Q}}};const sortTransforms=(u,A)=>A==="input"?u.reverse():u;const getStreamDirection=(u,A,p)=>{const y=u.map((u=>getStdioItemDirection(u,A)));if(y.includes("input")&&y.includes("output")){throw new TypeError(`The \`${p}\` option must not be an array of both readable and writable values.`)}return y.find(Boolean)??Ss};const getStdioItemDirection=({type:u,value:A},p)=>vs[p]??Bs[u](A);const vs=["input","output","output"];const anyDirection=()=>undefined;const alwaysInput=()=>"input";const Bs={generator:anyDirection,asyncGenerator:anyDirection,fileUrl:anyDirection,filePath:anyDirection,iterable:alwaysInput,asyncIterable:alwaysInput,uint8Array:alwaysInput,webStream:u=>type_isWritableStream(u)?"output":"input",nodeStream(u){if(!isReadableStream(u,{checkOpen:false})){return"output"}return isWritableStream(u,{checkOpen:false})?undefined:"input"},webTransform:anyDirection,duplex:anyDirection,native(u){const A=getStandardStreamDirection(u);if(A!==undefined){return A}if(is_stream_isStream(u,{checkOpen:false})){return Bs.nodeStream(u)}}};const getStandardStreamDirection=u=>{if([0,un.stdin].includes(u)){return"input"}if([1,2,un.stdout,un.stderr].includes(u)){return"output"}};const Ss="output";const normalizeIpcStdioArray=(u,A)=>A&&!u.includes("ipc")?[...u,"ipc"]:u;const normalizeStdioOption=({stdio:u,ipc:A,buffer:p,...y},E,C)=>{const I=getStdioArray(u,y).map(((u,A)=>stdio_option_addDefaultValue(u,A)));return C?normalizeStdioSync(I,p,E):normalizeIpcStdioArray(I,A)};const getStdioArray=(u,A)=>{if(u===undefined){return fn.map((u=>A[u]))}if(hasAlias(A)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${fn.map((u=>`\`${u}\``)).join(", ")}`)}if(typeof u==="string"){return[u,u,u]}if(!Array.isArray(u)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``)}const p=Math.max(u.length,fn.length);return Array.from({length:p},((A,p)=>u[p]))};const hasAlias=u=>fn.some((A=>u[A]!==undefined));const stdio_option_addDefaultValue=(u,A)=>{if(Array.isArray(u)){return u.map((u=>stdio_option_addDefaultValue(u,A)))}if(u===null||u===undefined){return A>=fn.length?"ignore":"pipe"}return u};const normalizeStdioSync=(u,A,p)=>u.map(((u,y)=>!A[y]&&y!==0&&!isFullVerbose(p,y)&&isOutputPipeOnly(u)?"ignore":u));const isOutputPipeOnly=u=>u==="pipe"||Array.isArray(u)&&u.every((u=>u==="pipe"));const handleNativeStream=({stdioItem:u,stdioItem:{type:A},isStdioArray:p,fdNumber:y,direction:E,isSync:C})=>{if(!p||A!=="native"){return u}return C?handleNativeStreamSync({stdioItem:u,fdNumber:y,direction:E}):handleNativeStreamAsync({stdioItem:u,fdNumber:y})};const handleNativeStreamSync=({stdioItem:u,stdioItem:{value:A,optionName:p},fdNumber:y,direction:E})=>{const C=getTargetFd({value:A,optionName:p,fdNumber:y,direction:E});if(C!==undefined){return C}if(is_stream_isStream(A,{checkOpen:false})){throw new TypeError(`The \`${p}: Stream\` option cannot both be an array and include a stream with synchronous methods.`)}return u};const getTargetFd=({value:u,optionName:A,fdNumber:p,direction:y})=>{const E=getTargetFdNumber(u,p);if(E===undefined){return}if(y==="output"){return{type:"fileNumber",value:E,optionName:A}}if(xn.isatty(E)){throw new TypeError(`The \`${A}: ${serializeOptionValue(u)}\` option is invalid: it cannot be a TTY with synchronous methods.`)}return{type:"uint8Array",value:bufferToUint8Array((0,_e.readFileSync)(E)),optionName:A}};const getTargetFdNumber=(u,A)=>{if(u==="inherit"){return A}if(typeof u==="number"){return u}const p=dn.indexOf(u);if(p!==-1){return p}};const handleNativeStreamAsync=({stdioItem:u,stdioItem:{value:A,optionName:p},fdNumber:y})=>{if(A==="inherit"){return{type:"nodeStream",value:getStandardStream(y,A,p),optionName:p}}if(typeof A==="number"){return{type:"nodeStream",value:getStandardStream(A,A,p),optionName:p}}if(is_stream_isStream(A,{checkOpen:false})){return{type:"nodeStream",value:A,optionName:p}}return u};const getStandardStream=(u,A,p)=>{const y=dn[u];if(y===undefined){throw new TypeError(`The \`${p}: ${A}\` option is invalid: no such standard stream.`)}return y};const handleInputOptions=({input:u,inputFile:A},p)=>p===0?[...handleInputOption(u),...handleInputFileOption(A)]:[];const handleInputOption=u=>u===undefined?[]:[{type:getInputType(u),value:u,optionName:"input"}];const getInputType=u=>{if(isReadableStream(u,{checkOpen:false})){return"nodeStream"}if(typeof u==="string"){return"string"}if(isUint8Array(u)){return"uint8Array"}throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")};const handleInputFileOption=u=>u===undefined?[]:[{...getInputFileType(u),optionName:"inputFile"}];const getInputFileType=u=>{if(isUrl(u)){return{type:"fileUrl",value:u}}if(isFilePathString(u)){return{type:"filePath",value:{file:u}}}throw new Error("The `inputFile` option must be a file path string or a file URL.")};const filterDuplicates=u=>u.filter(((A,p)=>u.every(((u,y)=>A.value!==u.value||p>=y||A.type==="generator"||A.type==="asyncGenerator"))));const getDuplicateStream=({stdioItem:{type:u,value:A,optionName:p},direction:y,fileDescriptors:E,isSync:C})=>{const I=getOtherStdioItems(E,u);if(I.length===0){return}if(C){validateDuplicateStreamSync({otherStdioItems:I,type:u,value:A,optionName:p,direction:y});return}if(Is.has(u)){return getDuplicateStreamInstance({otherStdioItems:I,type:u,value:A,optionName:p,direction:y})}if(bs.has(u)){validateDuplicateTransform({otherStdioItems:I,type:u,value:A,optionName:p})}};const getOtherStdioItems=(u,A)=>u.flatMap((({direction:u,stdioItems:p})=>p.filter((u=>u.type===A)).map((A=>({...A,direction:u})))));const validateDuplicateStreamSync=({otherStdioItems:u,type:A,value:p,optionName:y,direction:E})=>{if(Cs.has(A)){getDuplicateStreamInstance({otherStdioItems:u,type:A,value:p,optionName:y,direction:E})}};const getDuplicateStreamInstance=({otherStdioItems:u,type:A,value:p,optionName:y,direction:E})=>{const C=u.filter((u=>hasSameValue(u,p)));if(C.length===0){return}const I=C.find((u=>u.direction!==E));throwOnDuplicateStream(I,y,A);return E==="output"?C[0].stream:undefined};const hasSameValue=({type:u,value:A},p)=>{if(u==="filePath"){return A.file===p.file}if(u==="fileUrl"){return A.href===p.href}return A===p};const validateDuplicateTransform=({otherStdioItems:u,type:A,value:p,optionName:y})=>{const E=u.find((({value:{transform:u}})=>u===p.transform));throwOnDuplicateStream(E,y,A)};const throwOnDuplicateStream=(u,A,p)=>{if(u!==undefined){throw new TypeError(`The \`${u.optionName}\` and \`${A}\` options must not target ${ws[p]} that is the same.`)}};const handleStdio=(u,A,p,y)=>{const E=normalizeStdioOption(A,p,y);const C=E.map(((u,p)=>getFileDescriptor({stdioOption:u,fdNumber:p,options:A,isSync:y})));const I=getFinalFileDescriptors({initialFileDescriptors:C,addProperties:u,options:A,isSync:y});A.stdio=I.map((({stdioItems:u})=>forwardStdio(u)));return I};const getFileDescriptor=({stdioOption:u,fdNumber:A,options:p,isSync:y})=>{const E=getStreamName(A);const{stdioItems:C,isStdioArray:I}=initializeStdioItems({stdioOption:u,fdNumber:A,options:p,optionName:E});const w=getStreamDirection(C,A,E);const v=C.map((u=>handleNativeStream({stdioItem:u,isStdioArray:I,fdNumber:A,direction:w,isSync:y})));const B=normalizeTransforms(v,E,w,p);const S=getFdObjectMode(B,w);validateFileObjectMode(B,S);return{direction:w,objectMode:S,stdioItems:B}};const initializeStdioItems=({stdioOption:u,fdNumber:A,options:p,optionName:y})=>{const E=Array.isArray(u)?u:[u];const C=[...E.map((u=>initializeStdioItem(u,y))),...handleInputOptions(p,A)];const I=filterDuplicates(C);const w=I.length>1;validateStdioArray(I,w,y);validateStreams(I);return{stdioItems:I,isStdioArray:w}};const initializeStdioItem=(u,A)=>({type:getStdioItemType(u,A),value:u,optionName:A});const validateStdioArray=(u,A,p)=>{if(u.length===0){throw new TypeError(`The \`${p}\` option must not be an empty array.`)}if(!A){return}for(const{value:A,optionName:p}of u){if(Ds.has(A)){throw new Error(`The \`${p}\` option must not include \`${A}\`.`)}}};const Ds=new Set(["ignore","ipc"]);const validateStreams=u=>{for(const A of u){validateFileStdio(A)}};const validateFileStdio=({type:u,value:A,optionName:p})=>{if(isRegularUrl(A)){throw new TypeError(`The \`${p}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`)}if(isUnknownStdioString(u,A)){throw new TypeError(`The \`${p}: { file: '...' }\` option must be used instead of \`${p}: '...'\`.`)}};const validateFileObjectMode=(u,A)=>{if(!A){return}const p=u.find((({type:u})=>Es.has(u)));if(p!==undefined){throw new TypeError(`The \`${p.optionName}\` option cannot use both files and transforms in objectMode.`)}};const getFinalFileDescriptors=({initialFileDescriptors:u,addProperties:A,options:p,isSync:y})=>{const E=[];try{for(const C of u){E.push(getFinalFileDescriptor({fileDescriptor:C,fileDescriptors:E,addProperties:A,options:p,isSync:y}))}return E}catch(u){cleanupCustomStreams(E);throw u}};const getFinalFileDescriptor=({fileDescriptor:{direction:u,objectMode:A,stdioItems:p},fileDescriptors:y,addProperties:E,options:C,isSync:I})=>{const w=p.map((A=>addStreamProperties({stdioItem:A,addProperties:E,direction:u,options:C,fileDescriptors:y,isSync:I})));return{direction:u,objectMode:A,stdioItems:w}};const addStreamProperties=({stdioItem:u,addProperties:A,direction:p,options:y,fileDescriptors:E,isSync:C})=>{const I=getDuplicateStream({stdioItem:u,direction:p,fileDescriptors:E,isSync:C});if(I!==undefined){return{...u,stream:I}}return{...u,...A[p][u.type](u,y)}};const cleanupCustomStreams=u=>{for(const{stdioItems:A}of u){for(const{stream:u}of A){if(u!==undefined&&!isStandardStream(u)){u.destroy()}}}};const forwardStdio=u=>{if(u.length>1){return u.some((({value:u})=>u==="overlapped"))?"overlapped":"pipe"}const[{type:A,value:p}]=u;return A==="native"?p:"pipe"};const handleStdioSync=(u,A)=>handleStdio(Qs,u,A,true);const forbiddenIfSync=({type:u,optionName:A})=>{throwInvalidSyncValue(A,ws[u])};const forbiddenNativeIfSync=({optionName:u,value:A})=>{if(A==="ipc"||A==="overlapped"){throwInvalidSyncValue(u,`"${A}"`)}return{}};const throwInvalidSyncValue=(u,A)=>{throw new TypeError(`The \`${u}\` option cannot be ${A} with synchronous methods.`)};const ks={generator(){},asyncGenerator:forbiddenIfSync,webStream:forbiddenIfSync,nodeStream:forbiddenIfSync,webTransform:forbiddenIfSync,duplex:forbiddenIfSync,asyncIterable:forbiddenIfSync,native:forbiddenNativeIfSync};const Qs={input:{...ks,fileUrl:({value:u})=>({contents:[bufferToUint8Array((0,_e.readFileSync)(u))]}),filePath:({value:{file:u}})=>({contents:[bufferToUint8Array((0,_e.readFileSync)(u))]}),fileNumber:forbiddenIfSync,iterable:({value:u})=>({contents:[...u]}),string:({value:u})=>({contents:[u]}),uint8Array:({value:u})=>({contents:[u]})},output:{...ks,fileUrl:({value:u})=>({path:u}),filePath:({value:{file:u,append:A}})=>({path:u,append:A}),fileNumber:({value:u})=>({path:u}),iterable:forbiddenIfSync,string:forbiddenIfSync,uint8Array:forbiddenIfSync}};const stripNewline=(u,{stripFinalNewline:A},p)=>getStripFinalNewline(A,p)&&u!==undefined&&!Array.isArray(u)?strip_final_newline_stripFinalNewline(u):u;const getStripFinalNewline=(u,A)=>A==="all"?u[1]||u[2]:u[A];const getSplitLinesGenerator=(u,A,p,y)=>u||p?undefined:initializeSplitLines(A,y);const splitLinesSync=(u,A,p)=>p?u.flatMap((u=>splitLinesItemSync(u,A))):splitLinesItemSync(u,A);const splitLinesItemSync=(u,A)=>{const{transform:p,final:y}=initializeSplitLines(A,{});return[...p(u),...y()]};const initializeSplitLines=(u,A)=>{A.previousChunks="";return{transform:splitGenerator.bind(undefined,A,u),final:linesFinal.bind(undefined,A)}};const splitGenerator=function*(u,A,p){if(typeof p!=="string"){yield p;return}let{previousChunks:y}=u;let E=-1;for(let C=0;C<p.length;C+=1){if(p[C]==="\n"){const I=getNewlineLength(p,C,A,u);let w=p.slice(E+1,C+1-I);if(y.length>0){w=concatString(y,w);y=""}yield w;E=C}}if(E!==p.length-1){y=concatString(y,p.slice(E+1))}u.previousChunks=y};const getNewlineLength=(u,A,p,y)=>{if(p){return 0}y.isWindowsNewline=A!==0&&u[A-1]==="\r";return y.isWindowsNewline?2:1};const linesFinal=function*({previousChunks:u}){if(u.length>0){yield u}};const getAppendNewlineGenerator=({binary:u,preserveNewlines:A,readableObjectMode:p,state:y})=>u||A||p?undefined:{transform:appendNewlineGenerator.bind(undefined,y)};const appendNewlineGenerator=function*({isWindowsNewline:u=false},A){const{unixNewline:p,windowsNewline:y,LF:E,concatBytes:C}=typeof A==="string"?Fs:xs;if(A.at(-1)===E){yield A;return}const I=u?y:p;yield C(A,I)};const concatString=(u,A)=>`${u}${A}`;const Fs={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:concatString};const concatUint8Array=(u,A)=>{const p=new Uint8Array(u.length+A.length);p.set(u,0);p.set(A,u.length);return p};const xs={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:concatUint8Array};var Rs=p(4573);const getValidateTransformInput=(u,A)=>u?undefined:validateStringTransformInput.bind(undefined,A);const validateStringTransformInput=function*(u,A){if(typeof A!=="string"&&!isUint8Array(A)&&!Rs.Buffer.isBuffer(A)){throw new TypeError(`The \`${u}\` option's transform must use "objectMode: true" to receive as input: ${typeof A}.`)}yield A};const getValidateTransformReturn=(u,A)=>u?validateObjectTransformReturn.bind(undefined,A):validateStringTransformReturn.bind(undefined,A);const validateObjectTransformReturn=function*(u,A){validateEmptyReturn(u,A);yield A};const validateStringTransformReturn=function*(u,A){validateEmptyReturn(u,A);if(typeof A!=="string"&&!isUint8Array(A)){throw new TypeError(`The \`${u}\` option's function must yield a string or an Uint8Array, not ${typeof A}.`)}yield A};const validateEmptyReturn=(u,A)=>{if(A===null||A===undefined){throw new TypeError(`The \`${u}\` option's function must not call \`yield ${A}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)}};const getEncodingTransformGenerator=(u,A,p)=>{if(p){return}if(u){return{transform:encodingUint8ArrayGenerator.bind(undefined,new TextEncoder)}}const y=new Oe.StringDecoder(A);return{transform:encodingStringGenerator.bind(undefined,y),final:encodingStringFinal.bind(undefined,y)}};const encodingUint8ArrayGenerator=function*(u,A){if(Rs.Buffer.isBuffer(A)){yield bufferToUint8Array(A)}else if(typeof A==="string"){yield u.encode(A)}else{yield A}};const encodingStringGenerator=function*(u,A){yield isUint8Array(A)?u.write(A):A};const encodingStringFinal=function*(u){const A=u.end();if(A!==""){yield A}};const _s=(0,cn.callbackify)((async(u,A,p,y)=>{A.currentIterable=u(...p);try{for await(const u of A.currentIterable){y.push(u)}}finally{delete A.currentIterable}}));const transformChunk=async function*(u,A,p){if(p===A.length){yield u;return}const{transform:y=identityGenerator}=A[p];for await(const E of y(u)){yield*transformChunk(E,A,p+1)}};const finalChunks=async function*(u){for(const[A,{final:p}]of Object.entries(u)){yield*generatorFinalChunks(p,Number(A),u)}};const generatorFinalChunks=async function*(u,A,p){if(u===undefined){return}for await(const y of u()){yield*transformChunk(y,p,A+1)}};const Ts=(0,cn.callbackify)((async({currentIterable:u},A)=>{if(u!==undefined){await(A?u.throw(A):u.return());return}if(A){throw A}}));const identityGenerator=function*(u){yield u};const pushChunksSync=(u,A,p,y)=>{try{for(const y of u(...A)){p.push(y)}y()}catch(u){y(u)}};const runTransformSync=(u,A)=>[...A.flatMap((A=>[...transformChunkSync(A,u,0)])),...finalChunksSync(u)];const transformChunkSync=function*(u,A,p){if(p===A.length){yield u;return}const{transform:y=run_sync_identityGenerator}=A[p];for(const E of y(u)){yield*transformChunkSync(E,A,p+1)}};const finalChunksSync=function*(u){for(const[A,{final:p}]of Object.entries(u)){yield*generatorFinalChunksSync(p,Number(A),u)}};const generatorFinalChunksSync=function*(u,A,p){if(u===undefined){return}for(const y of u()){yield*transformChunkSync(y,p,A+1)}};const run_sync_identityGenerator=function*(u){yield u};const generatorToStream=({value:u,value:{transform:A,final:p,writableObjectMode:y,readableObjectMode:E},optionName:C},{encoding:I})=>{const w={};const v=addInternalGenerators(u,I,C);const B=isAsyncGenerator(A);const S=isAsyncGenerator(p);const D=B?_s.bind(undefined,transformChunk,w):pushChunksSync.bind(undefined,transformChunkSync);const k=B||S?_s.bind(undefined,finalChunks,w):pushChunksSync.bind(undefined,finalChunksSync);const Q=B||S?Ts.bind(undefined,w):undefined;const F=new Pe.Transform({writableObjectMode:y,writableHighWaterMark:(0,Pe.getDefaultHighWaterMark)(y),readableObjectMode:E,readableHighWaterMark:(0,Pe.getDefaultHighWaterMark)(E),transform(u,A,p){D([u,v,0],this,p)},flush(u){k([v],this,u)},destroy:Q});return{stream:F}};const runGeneratorsSync=(u,A,p,y)=>{const E=A.filter((({type:u})=>u==="generator"));const C=y?E.reverse():E;for(const{value:A,optionName:y}of C){const E=addInternalGenerators(A,p,y);u=runTransformSync(E,u)}return u};const addInternalGenerators=({transform:u,final:A,binary:p,writableObjectMode:y,readableObjectMode:E,preserveNewlines:C},I,w)=>{const v={};return[{transform:getValidateTransformInput(y,w)},getEncodingTransformGenerator(p,I,y),getSplitLinesGenerator(p,C,y,v),{transform:u,final:A},{transform:getValidateTransformReturn(E,w)},getAppendNewlineGenerator({binary:p,preserveNewlines:C,readableObjectMode:E,state:v})].filter(Boolean)};const addInputOptionsSync=(u,A)=>{for(const p of getInputFdNumbers(u)){addInputOptionSync(u,p,A)}};const getInputFdNumbers=u=>new Set(Object.entries(u).filter((([,{direction:u}])=>u==="input")).map((([u])=>Number(u))));const addInputOptionSync=(u,A,p)=>{const{stdioItems:y}=u[A];const E=y.filter((({contents:u})=>u!==undefined));if(E.length===0){return}if(A!==0){const[{type:u,optionName:A}]=E;throw new TypeError(`Only the \`stdin\` option, not \`${A}\`, can be ${ws[u]} with synchronous methods.`)}const C=E.map((({contents:u})=>u));const I=C.map((u=>applySingleInputGeneratorsSync(u,y)));p.input=joinToUint8Array(I)};const applySingleInputGeneratorsSync=(u,A)=>{const p=runGeneratorsSync(u,A,"utf8",true);validateSerializable(p);return joinToUint8Array(p)};const validateSerializable=u=>{const A=u.find((u=>typeof u!=="string"&&!isUint8Array(u)));if(A!==undefined){throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${A}.`)}};const shouldLogOutput=({stdioItems:u,encoding:A,verboseInfo:p,fdNumber:y})=>y!=="all"&&isFullVerbose(p,y)&&!es.has(A)&&fdUsesVerbose(y)&&(u.some((({type:u,value:A})=>u==="native"&&Ns.has(A)))||u.every((({type:u})=>ys.has(u))));const fdUsesVerbose=u=>u===1||u===2;const Ns=new Set(["pipe","overlapped"]);const logLines=async(u,A,p,y)=>{for await(const E of u){if(!isPipingStream(A)){logLine(E,p,y)}}};const logLinesSync=(u,A,p)=>{for(const y of u){logLine(y,A,p)}};const isPipingStream=u=>u._readableState.pipes.length>0;const logLine=(u,A,p)=>{const y=serializeVerboseMessage(u);verboseLog({type:"output",verboseMessage:y,fdNumber:A,verboseInfo:p})};const transformOutputSync=({fileDescriptors:u,syncResult:{output:A},options:p,isMaxBuffer:y,verboseInfo:E})=>{if(A===null){return{output:Array.from({length:3})}}const C={};const I=new Set([]);const w=A.map(((A,w)=>transformOutputResultSync({result:A,fileDescriptors:u,fdNumber:w,state:C,outputFiles:I,isMaxBuffer:y,verboseInfo:E},p)));return{output:w,...C}};const transformOutputResultSync=({result:u,fileDescriptors:A,fdNumber:p,state:y,outputFiles:E,isMaxBuffer:C,verboseInfo:I},{buffer:w,encoding:v,lines:B,stripFinalNewline:S,maxBuffer:D})=>{if(u===null){return}const k=truncateMaxBufferSync(u,C,D);const Q=bufferToUint8Array(k);const{stdioItems:F,objectMode:R}=A[p];const _=runOutputGeneratorsSync([Q],F,v,y);const{serializedResult:P,finalResult:O=P}=serializeChunks({chunks:_,objectMode:R,encoding:v,lines:B,stripFinalNewline:S,fdNumber:p});logOutputSync({serializedResult:P,fdNumber:p,state:y,verboseInfo:I,encoding:v,stdioItems:F,objectMode:R});const U=w[p]?O:undefined;try{if(y.error===undefined){writeToFiles(P,F,E)}return U}catch(u){y.error=u;return U}};const runOutputGeneratorsSync=(u,A,p,y)=>{try{return runGeneratorsSync(u,A,p,false)}catch(A){y.error=A;return u}};const serializeChunks=({chunks:u,objectMode:A,encoding:p,lines:y,stripFinalNewline:E,fdNumber:C})=>{if(A){return{serializedResult:u}}if(p==="buffer"){return{serializedResult:joinToUint8Array(u)}}const I=joinToString(u,p);if(y[C]){return{serializedResult:I,finalResult:splitLinesSync(I,!E[C],A)}}return{serializedResult:I}};const logOutputSync=({serializedResult:u,fdNumber:A,state:p,verboseInfo:y,encoding:E,stdioItems:C,objectMode:I})=>{if(!shouldLogOutput({stdioItems:C,encoding:E,verboseInfo:y,fdNumber:A})){return}const w=splitLinesSync(u,false,I);try{logLinesSync(w,A,y)}catch(u){p.error??=u}};const writeToFiles=(u,A,p)=>{for(const{path:y,append:E}of A.filter((({type:u})=>Es.has(u)))){const A=typeof y==="string"?y:y.toString();if(E||p.has(A)){(0,_e.appendFileSync)(y,u)}else{p.add(A);(0,_e.writeFileSync)(y,u)}}};const getAllSync=([,u,A],p)=>{if(!p.all){return}if(u===undefined){return A}if(A===undefined){return u}if(Array.isArray(u)){return Array.isArray(A)?[...u,...A]:[...u,stripNewline(A,p,"all")]}if(Array.isArray(A)){return[stripNewline(u,p,"all"),...A]}if(isUint8Array(u)&&isUint8Array(A)){return concatUint8Arrays([u,A])}return`${u}${A}`};const waitForExit=async(u,A)=>{const[p,y]=await waitForExitOrError(u);A.isForcefullyTerminated??=false;return[p,y]};const waitForExitOrError=async u=>{const[A,p]=await Promise.allSettled([(0,Le.once)(u,"spawn"),(0,Le.once)(u,"exit")]);if(A.status==="rejected"){return[]}return p.status==="rejected"?waitForSubprocessExit(u):p.value};const waitForSubprocessExit=async u=>{try{return await(0,Le.once)(u,"exit")}catch{return waitForSubprocessExit(u)}};const waitForSuccessfulExit=async u=>{const[A,p]=await u;if(!isSubprocessErrorExit(A,p)&&isFailedExit(A,p)){throw new DiscardedError}return[A,p]};const isSubprocessErrorExit=(u,A)=>u===undefined&&A===undefined;const isFailedExit=(u,A)=>u!==0||A!==null;const getExitResultSync=({error:u,status:A,signal:p,output:y},{maxBuffer:E})=>{const C=getResultError(u,A,p);const I=C?.code==="ETIMEDOUT";const w=isMaxBufferSync(C,y,E);return{resultError:C,exitCode:A,signal:p,timedOut:I,isMaxBuffer:w}};const getResultError=(u,A,p)=>{if(u!==undefined){return u}return isFailedExit(A,p)?new DiscardedError:undefined};const execaCoreSync=(u,A,p)=>{const{file:y,commandArguments:E,command:C,escapedCommand:I,startTime:w,verboseInfo:v,options:B,fileDescriptors:S}=handleSyncArguments(u,A,p);const D=spawnSubprocessSync({file:y,commandArguments:E,options:B,command:C,escapedCommand:I,verboseInfo:v,fileDescriptors:S,startTime:w});return handleResult(D,v,B)};const handleSyncArguments=(u,A,p)=>{const{command:y,escapedCommand:E,startTime:C,verboseInfo:I}=handleCommand(u,A,p);const w=normalizeSyncOptions(p);const{file:v,commandArguments:B,options:S}=normalizeOptions(u,A,w);validateSyncOptions(S);const D=handleStdioSync(S,I);return{file:v,commandArguments:B,command:y,escapedCommand:E,startTime:C,verboseInfo:I,options:S,fileDescriptors:D}};const normalizeSyncOptions=u=>u.node&&!u.ipc?{...u,ipc:false}:u;const validateSyncOptions=({ipc:u,ipcInput:A,detached:p,cancelSignal:y})=>{if(A){throwInvalidSyncOption("ipcInput")}if(u){throwInvalidSyncOption("ipc: true")}if(p){throwInvalidSyncOption("detached: true")}if(y){throwInvalidSyncOption("cancelSignal")}};const throwInvalidSyncOption=u=>{throw new TypeError(`The "${u}" option cannot be used with synchronous methods.`)};const spawnSubprocessSync=({file:u,commandArguments:A,options:p,command:y,escapedCommand:E,verboseInfo:C,fileDescriptors:I,startTime:w})=>{const v=runSubprocessSync({file:u,commandArguments:A,options:p,command:y,escapedCommand:E,fileDescriptors:I,startTime:w});if(v.failed){return v}const{resultError:B,exitCode:S,signal:D,timedOut:k,isMaxBuffer:Q}=getExitResultSync(v,p);const{output:F,error:R=B}=transformOutputSync({fileDescriptors:I,syncResult:v,options:p,isMaxBuffer:Q,verboseInfo:C});const _=F.map(((u,A)=>stripNewline(u,p,A)));const P=stripNewline(getAllSync(F,p),p,"all");return getSyncResult({error:R,exitCode:S,signal:D,timedOut:k,isMaxBuffer:Q,stdio:_,all:P,options:p,command:y,escapedCommand:E,startTime:w})};const runSubprocessSync=({file:u,commandArguments:A,options:p,command:y,escapedCommand:E,fileDescriptors:C,startTime:I})=>{try{addInputOptionsSync(C,p);const y=normalizeSpawnSyncOptions(p);return(0,nn.spawnSync)(...concatenateShell(u,A,y))}catch(u){return makeEarlyError({error:u,command:y,escapedCommand:E,fileDescriptors:C,options:p,startTime:I,isSync:true})}};const normalizeSpawnSyncOptions=({encoding:u,maxBuffer:A,...p})=>({...p,encoding:"buffer",maxBuffer:getMaxBufferSync(A)});const getSyncResult=({error:u,exitCode:A,signal:p,timedOut:y,isMaxBuffer:E,stdio:C,all:I,options:w,command:v,escapedCommand:B,startTime:S})=>u===undefined?makeSuccessResult({command:v,escapedCommand:B,stdio:C,all:I,ipcOutput:[],options:w,startTime:S}):makeError({error:u,command:v,escapedCommand:B,timedOut:y,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:E,isForcefullyTerminated:false,exitCode:A,signal:p,stdio:C,all:I,ipcOutput:[],options:w,startTime:S,isSync:true});const getOneMessage=({anyProcess:u,channel:A,isSubprocess:p,ipc:y},{reference:E=true,filter:C}={})=>{validateIpcMethod({methodName:"getOneMessage",isSubprocess:p,ipc:y,isConnected:isConnected(u)});return getOneMessageAsync({anyProcess:u,channel:A,isSubprocess:p,filter:C,reference:E})};const getOneMessageAsync=async({anyProcess:u,channel:A,isSubprocess:p,filter:y,reference:E})=>{addReference(A,E);const C=getIpcEmitter(u,A,p);const I=new AbortController;try{return await Promise.race([getMessage(C,y,I),get_one_throwOnDisconnect(C,p,I),throwOnStrictError(C,p,I)])}catch(A){disconnect(u);throw A}finally{I.abort();removeReference(A,E)}};const getMessage=async(u,A,{signal:p})=>{if(A===undefined){const[A]=await(0,Le.once)(u,"message",{signal:p});return A}for await(const[y]of(0,Le.on)(u,"message",{signal:p})){if(A(y)){return y}}};const get_one_throwOnDisconnect=async(u,A,{signal:p})=>{await(0,Le.once)(u,"disconnect",{signal:p});throwOnEarlyDisconnect(A)};const throwOnStrictError=async(u,A,{signal:p})=>{const[y]=await(0,Le.once)(u,"strict:error",{signal:p});throw getStrictResponseError(y,A)};const getEachMessage=({anyProcess:u,channel:A,isSubprocess:p,ipc:y},{reference:E=true}={})=>loopOnMessages({anyProcess:u,channel:A,isSubprocess:p,ipc:y,shouldAwait:!p,reference:E});const loopOnMessages=({anyProcess:u,channel:A,isSubprocess:p,ipc:y,shouldAwait:E,reference:C})=>{validateIpcMethod({methodName:"getEachMessage",isSubprocess:p,ipc:y,isConnected:isConnected(u)});addReference(A,C);const I=getIpcEmitter(u,A,p);const w=new AbortController;const v={};stopOnDisconnect(u,I,w);abortOnStrictError({ipcEmitter:I,isSubprocess:p,controller:w,state:v});return iterateOnMessages({anyProcess:u,channel:A,ipcEmitter:I,isSubprocess:p,shouldAwait:E,controller:w,state:v,reference:C})};const stopOnDisconnect=async(u,A,p)=>{try{await(0,Le.once)(A,"disconnect",{signal:p.signal});p.abort()}catch{}};const abortOnStrictError=async({ipcEmitter:u,isSubprocess:A,controller:p,state:y})=>{try{const[E]=await(0,Le.once)(u,"strict:error",{signal:p.signal});y.error=getStrictResponseError(E,A);p.abort()}catch{}};const iterateOnMessages=async function*({anyProcess:u,channel:A,ipcEmitter:p,isSubprocess:y,shouldAwait:E,controller:C,state:I,reference:w}){try{for await(const[u]of(0,Le.on)(p,"message",{signal:C.signal})){throwIfStrictError(I);yield u}}catch{throwIfStrictError(I)}finally{C.abort();removeReference(A,w);if(!y){disconnect(u)}if(E){await u}}};const throwIfStrictError=({error:u})=>{if(u){throw u}};const addIpcMethods=(u,{ipc:A})=>{Object.assign(u,getIpcMethods(u,false,A))};const getIpcExport=()=>{const u=un;const A=true;const p=un.channel!==undefined;return{...getIpcMethods(u,A,p),getCancelSignal:getCancelSignal.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p})}};const getIpcMethods=(u,A,p)=>({sendMessage:sendMessage.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p}),getOneMessage:getOneMessage.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p}),getEachMessage:getEachMessage.bind(undefined,{anyProcess:u,channel:u.channel,isSubprocess:A,ipc:p})});const handleEarlyError=({error:u,command:A,escapedCommand:p,fileDescriptors:y,options:E,startTime:C,verboseInfo:I})=>{cleanupCustomStreams(y);const w=new nn.ChildProcess;createDummyStreams(w,y);Object.assign(w,{readable:readable,writable:writable,duplex:duplex});const v=makeEarlyError({error:u,command:A,escapedCommand:p,fileDescriptors:y,options:E,startTime:C,isSync:false});const B=handleDummyPromise(v,I,E);return{subprocess:w,promise:B}};const createDummyStreams=(u,A)=>{const p=createDummyStream();const y=createDummyStream();const E=createDummyStream();const C=Array.from({length:A.length-3},createDummyStream);const I=createDummyStream();const w=[p,y,E,...C];Object.assign(u,{stdin:p,stdout:y,stderr:E,all:I,stdio:w})};const createDummyStream=()=>{const u=new Pe.PassThrough;u.end();return u};const readable=()=>new Pe.Readable({read(){}});const writable=()=>new Pe.Writable({write(){}});const duplex=()=>new Pe.Duplex({read(){},write(){}});const handleDummyPromise=async(u,A,p)=>handleResult(u,A,p);const handleStdioAsync=(u,A)=>handleStdio(Ps,u,A,false);const forbiddenIfAsync=({type:u,optionName:A})=>{throw new TypeError(`The \`${A}\` option cannot be ${ws[u]}.`)};const Ls={fileNumber:forbiddenIfAsync,generator:generatorToStream,asyncGenerator:generatorToStream,nodeStream:({value:u})=>({stream:u}),webTransform({value:{transform:u,writableObjectMode:A,readableObjectMode:p}}){const y=A||p;const E=Pe.Duplex.fromWeb(u,{objectMode:y});return{stream:E}},duplex:({value:{transform:u}})=>({stream:u}),native(){}};const Ps={input:{...Ls,fileUrl:({value:u})=>({stream:(0,_e.createReadStream)(u)}),filePath:({value:{file:u}})=>({stream:(0,_e.createReadStream)(u)}),webStream:({value:u})=>({stream:Pe.Readable.fromWeb(u)}),iterable:({value:u})=>({stream:Pe.Readable.from(u)}),asyncIterable:({value:u})=>({stream:Pe.Readable.from(u)}),string:({value:u})=>({stream:Pe.Readable.from(u)}),uint8Array:({value:u})=>({stream:Pe.Readable.from(Rs.Buffer.from(u))})},output:{...Ls,fileUrl:({value:u})=>({stream:(0,_e.createWriteStream)(u)}),filePath:({value:{file:u,append:A}})=>({stream:(0,_e.createWriteStream)(u,A?{flags:"a"}:{})}),webStream:({value:u})=>({stream:Pe.Writable.fromWeb(u)}),iterable:forbiddenIfAsync,asyncIterable:forbiddenIfAsync,string:forbiddenIfAsync,uint8Array:forbiddenIfAsync}};const Os=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises");function mergeStreams(u){if(!Array.isArray(u)){throw new TypeError(`Expected an array, got \`${typeof u}\`.`)}for(const A of u){validateStream(A)}const A=u.some((({readableObjectMode:u})=>u));const p=getHighWaterMark(u,A);const y=new MergedStream({objectMode:A,writableHighWaterMark:p,readableHighWaterMark:p});for(const A of u){y.add(A)}return y}const getHighWaterMark=(u,A)=>{if(u.length===0){return(0,Pe.getDefaultHighWaterMark)(A)}const p=u.filter((({readableObjectMode:u})=>u===A)).map((({readableHighWaterMark:u})=>u));return Math.max(...p)};class MergedStream extends Pe.PassThrough{#wt=new Set([]);#vt=new Set([]);#Bt=new Set([]);#St;#Dt=Symbol("unpipe");#kt=new WeakMap;add(u){validateStream(u);if(this.#wt.has(u)){return}this.#wt.add(u);this.#St??=onMergedStreamFinished(this,this.#wt,this.#Dt);const A=endWhenStreamsDone({passThroughStream:this,stream:u,streams:this.#wt,ended:this.#vt,aborted:this.#Bt,onFinished:this.#St,unpipeEvent:this.#Dt});this.#kt.set(u,A);u.pipe(this,{end:false})}async remove(u){validateStream(u);if(!this.#wt.has(u)){return false}const A=this.#kt.get(u);if(A===undefined){return false}this.#kt.delete(u);u.unpipe(this);await A;return true}}const onMergedStreamFinished=async(u,A,p)=>{updateMaxListeners(u,Ms);const y=new AbortController;try{await Promise.race([onMergedStreamEnd(u,y),onInputStreamsUnpipe(u,A,p,y)])}finally{y.abort();updateMaxListeners(u,-Ms)}};const onMergedStreamEnd=async(u,{signal:A})=>{try{await(0,Os.finished)(u,{signal:A,cleanup:true})}catch(A){errorOrAbortStream(u,A);throw A}};const onInputStreamsUnpipe=async(u,A,p,{signal:y})=>{for await(const[E]of(0,Le.on)(u,"unpipe",{signal:y})){if(A.has(E)){E.emit(p)}}};const validateStream=u=>{if(typeof u?.pipe!=="function"){throw new TypeError(`Expected a readable stream, got: \`${typeof u}\`.`)}};const endWhenStreamsDone=async({passThroughStream:u,stream:A,streams:p,ended:y,aborted:E,onFinished:C,unpipeEvent:I})=>{updateMaxListeners(u,Us);const w=new AbortController;try{await Promise.race([afterMergedStreamFinished(C,A,w),onInputStreamEnd({passThroughStream:u,stream:A,streams:p,ended:y,aborted:E,controller:w}),onInputStreamUnpipe({stream:A,streams:p,ended:y,aborted:E,unpipeEvent:I,controller:w})])}finally{w.abort();updateMaxListeners(u,-Us)}if(p.size>0&&p.size===y.size+E.size){if(y.size===0&&E.size>0){abortStream(u)}else{endStream(u)}}};const afterMergedStreamFinished=async(u,A,{signal:p})=>{try{await u;if(!p.aborted){abortStream(A)}}catch(u){if(!p.aborted){errorOrAbortStream(A,u)}}};const onInputStreamEnd=async({passThroughStream:u,stream:A,streams:p,ended:y,aborted:E,controller:{signal:C}})=>{try{await(0,Os.finished)(A,{signal:C,cleanup:true,readable:true,writable:false});if(p.has(A)){y.add(A)}}catch(y){if(C.aborted||!p.has(A)){return}if(isAbortError(y)){E.add(A)}else{errorStream(u,y)}}};const onInputStreamUnpipe=async({stream:u,streams:A,ended:p,aborted:y,unpipeEvent:E,controller:{signal:C}})=>{await(0,Le.once)(u,E,{signal:C});if(!u.readable){return(0,Le.once)(C,"abort",{signal:C})}A.delete(u);p.delete(u);y.delete(u)};const endStream=u=>{if(u.writable){u.end()}};const errorOrAbortStream=(u,A)=>{if(isAbortError(A)){abortStream(u)}else{errorStream(u,A)}};const isAbortError=u=>u?.code==="ERR_STREAM_PREMATURE_CLOSE";const abortStream=u=>{if(u.readable||u.writable){u.destroy()}};const errorStream=(u,A)=>{if(!u.destroyed){u.once("error",noop);u.destroy(A)}};const noop=()=>{};const updateMaxListeners=(u,A)=>{const p=u.getMaxListeners();if(p!==0&&p!==Number.POSITIVE_INFINITY){u.setMaxListeners(p+A)}};const Ms=2;const Us=1;const pipeStreams=(u,A)=>{u.pipe(A);onSourceFinish(u,A);onDestinationFinish(u,A)};const onSourceFinish=async(u,A)=>{if(isStandardStream(u)||isStandardStream(A)){return}try{await(0,Os.finished)(u,{cleanup:true,readable:true,writable:false})}catch{}endDestinationStream(A)};const endDestinationStream=u=>{if(u.writable){u.end()}};const onDestinationFinish=async(u,A)=>{if(isStandardStream(u)||isStandardStream(A)){return}try{await(0,Os.finished)(A,{cleanup:true,readable:false,writable:true})}catch{}abortSourceStream(u)};const abortSourceStream=u=>{if(u.readable){u.destroy()}};const pipeOutputAsync=(u,A,p)=>{const y=new Map;for(const[E,{stdioItems:C,direction:I}]of Object.entries(A)){for(const{stream:A}of C.filter((({type:u})=>ys.has(u)))){pipeTransform(u,A,I,E)}for(const{stream:A}of C.filter((({type:u})=>!ys.has(u)))){pipeStdioItem({subprocess:u,stream:A,direction:I,fdNumber:E,pipeGroups:y,controller:p})}}for(const[u,A]of y.entries()){const p=A.length===1?A[0]:mergeStreams(A);pipeStreams(p,u)}};const pipeTransform=(u,A,p,y)=>{if(p==="output"){pipeStreams(u.stdio[y],A)}else{pipeStreams(A,u.stdio[y])}const E=Hs[y];if(E!==undefined){u[E]=A}u.stdio[y]=A};const Hs=["stdin","stdout","stderr"];const pipeStdioItem=({subprocess:u,stream:A,direction:p,fdNumber:y,pipeGroups:E,controller:C})=>{if(A===undefined){return}setStandardStreamMaxListeners(A,C);const[I,w]=p==="output"?[A,u.stdio[y]]:[u.stdio[y],A];const v=E.get(I)??[];E.set(I,[...v,w])};const setStandardStreamMaxListeners=(u,{signal:A})=>{if(isStandardStream(u)){incrementMaxListeners(u,Gs,A)}};const Gs=2;const Ws=[];Ws.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32"){Ws.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){Ws.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")}const processOk=u=>!!u&&typeof u==="object"&&typeof u.removeListener==="function"&&typeof u.emit==="function"&&typeof u.reallyExit==="function"&&typeof u.listeners==="function"&&typeof u.kill==="function"&&typeof u.pid==="number"&&typeof u.on==="function";const js=Symbol.for("signal-exit emitter");const zs=globalThis;const $s=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(zs[js]){return zs[js]}$s(zs,js,{value:this,writable:false,enumerable:false,configurable:false})}on(u,A){this.listeners[u].push(A)}removeListener(u,A){const p=this.listeners[u];const y=p.indexOf(A);if(y===-1){return}if(y===0&&p.length===1){p.length=0}else{p.splice(y,1)}}emit(u,A,p){if(this.emitted[u]){return false}this.emitted[u]=true;let y=false;for(const E of this.listeners[u]){y=E(A,p)===true||y}if(u==="exit"){y=this.emit("afterExit",A,p)||y}return y}}class SignalExitBase{}const signalExitWrap=u=>({onExit(A,p){return u.onExit(A,p)},load(){return u.load()},unload(){return u.unload()}});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#Qt=qs.platform==="win32"?"SIGINT":"SIGHUP";#Ft=new Emitter;#xt;#Rt;#_t;#Tt={};#Nt=false;constructor(u){super();this.#xt=u;this.#Tt={};for(const A of Ws){this.#Tt[A]=()=>{const p=this.#xt.listeners(A);let{count:y}=this.#Ft;const E=u;if(typeof E.__signal_exit_emitter__==="object"&&typeof E.__signal_exit_emitter__.count==="number"){y+=E.__signal_exit_emitter__.count}if(p.length===y){this.unload();const p=this.#Ft.emit("exit",null,A);const y=A==="SIGHUP"?this.#Qt:A;if(!p)u.kill(u.pid,y)}}}this.#_t=u.reallyExit;this.#Rt=u.emit}onExit(u,A){if(!processOk(this.#xt)){return()=>{}}if(this.#Nt===false){this.load()}const p=A?.alwaysLast?"afterExit":"exit";this.#Ft.on(p,u);return()=>{this.#Ft.removeListener(p,u);if(this.#Ft.listeners["exit"].length===0&&this.#Ft.listeners["afterExit"].length===0){this.unload()}}}load(){if(this.#Nt){return}this.#Nt=true;this.#Ft.count+=1;for(const u of Ws){try{const A=this.#Tt[u];if(A)this.#xt.on(u,A)}catch(u){}}this.#xt.emit=(u,...A)=>this.#Lt(u,...A);this.#xt.reallyExit=u=>this.#Pt(u)}unload(){if(!this.#Nt){return}this.#Nt=false;Ws.forEach((u=>{const A=this.#Tt[u];if(!A){throw new Error("Listener not defined for signal: "+u)}try{this.#xt.removeListener(u,A)}catch(u){}}));this.#xt.emit=this.#Rt;this.#xt.reallyExit=this.#_t;this.#Ft.count-=1}#Pt(u){if(!processOk(this.#xt)){return 0}this.#xt.exitCode=u||0;this.#Ft.emit("exit",this.#xt.exitCode,null);return this.#_t.call(this.#xt,this.#xt.exitCode)}#Lt(u,...A){const p=this.#Rt;if(u==="exit"&&processOk(this.#xt)){if(typeof A[0]==="number"){this.#xt.exitCode=A[0]}const y=p.call(this.#xt,u,...A);this.#Ft.emit("exit",this.#xt.exitCode,null);return y}else{return p.call(this.#xt,u,...A)}}}const qs=globalThis.process;const{onExit:Vs,load:Ks,unload:Js}=signalExitWrap(processOk(qs)?new SignalExit(qs):new SignalExitFallback);const cleanupOnExit=(u,{cleanup:A,detached:p},{signal:y})=>{if(!A||p){return}const E=Vs((()=>{u.kill()}));(0,Le.addAbortListener)(y,(()=>{E()}))};const normalizePipeArguments=({source:u,sourcePromise:A,boundOptions:p,createNested:y},...E)=>{const C=getStartTime();const{destination:I,destinationStream:w,destinationError:v,from:B,unpipeSignal:S}=getDestinationStream(p,y,E);const{sourceStream:D,sourceError:k}=getSourceStream(u,B);const{options:Q,fileDescriptors:F}=Mr.get(u);return{sourcePromise:A,sourceStream:D,sourceOptions:Q,sourceError:k,destination:I,destinationStream:w,destinationError:v,unpipeSignal:S,fileDescriptors:F,startTime:C}};const getDestinationStream=(u,A,p)=>{try{const{destination:y,pipeOptions:{from:E,to:C,unpipeSignal:I}={}}=getDestination(u,A,...p);const w=getToStream(y,C);return{destination:y,destinationStream:w,from:E,unpipeSignal:I}}catch(u){return{destinationError:u}}};const getDestination=(u,A,p,...y)=>{if(Array.isArray(p)){const E=A(mapDestinationArguments,u)(p,...y);return{destination:E,pipeOptions:u}}if(typeof p==="string"||p instanceof URL||isDenoExecPath(p)){if(Object.keys(u).length>0){throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).')}const[E,C,I]=normalizeParameters(p,...y);const w=A(mapDestinationArguments)(E,C,I);return{destination:w,pipeOptions:I}}if(Mr.has(p)){if(Object.keys(u).length>0){throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).")}return{destination:p,pipeOptions:y[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${p}`)};const mapDestinationArguments=({options:u})=>({options:{...u,stdin:"pipe",piped:true}});const getSourceStream=(u,A)=>{try{const p=getFromStream(u,A);return{sourceStream:p}}catch(u){return{sourceError:u}}};const handlePipeArgumentsError=({sourceStream:u,sourceError:A,destinationStream:p,destinationError:y,fileDescriptors:E,sourceOptions:C,startTime:I})=>{const w=getPipeArgumentsError({sourceStream:u,sourceError:A,destinationStream:p,destinationError:y});if(w!==undefined){throw createNonCommandError({error:w,fileDescriptors:E,sourceOptions:C,startTime:I})}};const getPipeArgumentsError=({sourceStream:u,sourceError:A,destinationStream:p,destinationError:y})=>{if(A!==undefined&&y!==undefined){return y}if(y!==undefined){abortSourceStream(u);return y}if(A!==undefined){endDestinationStream(p);return A}};const createNonCommandError=({error:u,fileDescriptors:A,sourceOptions:p,startTime:y})=>makeEarlyError({error:u,command:Ys,escapedCommand:Ys,fileDescriptors:A,options:p,startTime:y,isSync:false});const Ys="source.pipe(destination)";const waitForBothSubprocesses=async u=>{const[{status:A,reason:p,value:y=p},{status:E,reason:C,value:I=C}]=await u;if(!I.pipedFrom.includes(y)){I.pipedFrom.push(y)}if(E==="rejected"){throw I}if(A==="rejected"){throw y}return I};const pipeSubprocessStream=(u,A,p)=>{const y=Xs.has(A)?pipeMoreSubprocessStream(u,A):pipeFirstSubprocessStream(u,A);incrementMaxListeners(u,Zs,p.signal);incrementMaxListeners(A,ei,p.signal);cleanupMergedStreamsMap(A);return y};const pipeFirstSubprocessStream=(u,A)=>{const p=mergeStreams([u]);pipeStreams(p,A);Xs.set(A,p);return p};const pipeMoreSubprocessStream=(u,A)=>{const p=Xs.get(A);p.add(u);return p};const cleanupMergedStreamsMap=async u=>{try{await(0,Os.finished)(u,{cleanup:true,readable:false,writable:true})}catch{}Xs.delete(u)};const Xs=new WeakMap;const Zs=2;const ei=1;const unpipeOnAbort=(u,A)=>u===undefined?[]:[unpipeOnSignalAbort(u,A)];const unpipeOnSignalAbort=async(u,{sourceStream:A,mergedStream:p,fileDescriptors:y,sourceOptions:E,startTime:C})=>{await(0,cn.aborted)(u,A);await p.remove(A);const I=new Error("Pipe canceled by `unpipeSignal` option.");throw createNonCommandError({error:I,fileDescriptors:y,sourceOptions:E,startTime:C})};const pipeToSubprocess=(u,...A)=>{if(isPlainObject(A[0])){return pipeToSubprocess.bind(undefined,{...u,boundOptions:{...u.boundOptions,...A[0]}})}const{destination:p,...y}=normalizePipeArguments(u,...A);const E=handlePipePromise({...y,destination:p});E.pipe=pipeToSubprocess.bind(undefined,{...u,source:p,sourcePromise:E,boundOptions:{}});return E};const handlePipePromise=async({sourcePromise:u,sourceStream:A,sourceOptions:p,sourceError:y,destination:E,destinationStream:C,destinationError:I,unpipeSignal:w,fileDescriptors:v,startTime:B})=>{const S=getSubprocessPromises(u,E);handlePipeArgumentsError({sourceStream:A,sourceError:y,destinationStream:C,destinationError:I,fileDescriptors:v,sourceOptions:p,startTime:B});const D=new AbortController;try{const u=pipeSubprocessStream(A,C,D);return await Promise.race([waitForBothSubprocesses(S),...unpipeOnAbort(w,{sourceStream:A,mergedStream:u,sourceOptions:p,fileDescriptors:v,startTime:B})])}finally{D.abort()}};const getSubprocessPromises=(u,A)=>Promise.allSettled([u,A]);const utils_identity=u=>u;const utils_noop=()=>undefined;const getContentsProperty=({contents:u})=>u;const throwObjectStream=u=>{throw new Error(`Streams in object mode are not supported: ${String(u)}`)};const getLengthProperty=u=>u.length;async function getStreamAsArray(u,A){return getStreamContents(u,ti,A)}const initArray=()=>({contents:[]});const increment=()=>1;const addArrayChunk=(u,{contents:A})=>{A.push(u);return A};const ti={init:initArray,convertChunk:{string:utils_identity,buffer:utils_identity,arrayBuffer:utils_identity,dataView:utils_identity,typedArray:utils_identity,others:utils_identity},getSize:increment,truncateChunk:utils_noop,addChunk:addArrayChunk,getFinalChunk:utils_noop,finalize:getContentsProperty};async function getStreamAsArrayBuffer(u,A){return getStreamContents(u,si,A)}const initArrayBuffer=()=>({contents:new ArrayBuffer(0)});const useTextEncoder=u=>ni.encode(u);const ni=new TextEncoder;const useUint8Array=u=>new Uint8Array(u);const useUint8ArrayWithOffset=u=>new Uint8Array(u.buffer,u.byteOffset,u.byteLength);const truncateArrayBufferChunk=(u,A)=>u.slice(0,A);const addArrayBufferChunk=(u,{contents:A,length:p},y)=>{const E=hasArrayBufferResize()?resizeArrayBuffer(A,y):resizeArrayBufferSlow(A,y);new Uint8Array(E).set(u,p);return E};const resizeArrayBufferSlow=(u,A)=>{if(A<=u.byteLength){return u}const p=new ArrayBuffer(getNewContentsLength(A));new Uint8Array(p).set(new Uint8Array(u),0);return p};const resizeArrayBuffer=(u,A)=>{if(A<=u.maxByteLength){u.resize(A);return u}const p=new ArrayBuffer(A,{maxByteLength:getNewContentsLength(A)});new Uint8Array(p).set(new Uint8Array(u),0);return p};const getNewContentsLength=u=>ri**Math.ceil(Math.log(u)/Math.log(ri));const ri=2;const finalizeArrayBuffer=({contents:u,length:A})=>hasArrayBufferResize()?u:u.slice(0,A);const hasArrayBufferResize=()=>"resize"in ArrayBuffer.prototype;const si={init:initArrayBuffer,convertChunk:{string:useTextEncoder,buffer:useUint8Array,arrayBuffer:useUint8Array,dataView:useUint8ArrayWithOffset,typedArray:useUint8ArrayWithOffset,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateArrayBufferChunk,addChunk:addArrayBufferChunk,getFinalChunk:utils_noop,finalize:finalizeArrayBuffer};async function getStreamAsString(u,A){return getStreamContents(u,ii,A)}const initString=()=>({contents:"",textDecoder:new TextDecoder});const useTextDecoder=(u,{textDecoder:A})=>A.decode(u,{stream:true});const addStringChunk=(u,{contents:A})=>A+u;const truncateStringChunk=(u,A)=>u.slice(0,A);const getFinalStringChunk=({textDecoder:u})=>{const A=u.decode();return A===""?undefined:A};const ii={init:initString,convertChunk:{string:utils_identity,buffer:useTextDecoder,arrayBuffer:useTextDecoder,dataView:useTextDecoder,typedArray:useTextDecoder,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateStringChunk,addChunk:addStringChunk,getFinalChunk:getFinalStringChunk,finalize:getContentsProperty};const iterateOnSubprocessStream=({subprocessStdout:u,subprocess:A,binary:p,shouldEncode:y,encoding:E,preserveNewlines:C})=>{const I=new AbortController;stopReadingOnExit(A,I);return iterateOnStream({stream:u,controller:I,binary:p,shouldEncode:!u.readableObjectMode&&y,encoding:E,shouldSplit:!u.readableObjectMode,preserveNewlines:C})};const stopReadingOnExit=async(u,A)=>{try{await u}catch{}finally{A.abort()}};const iterateForResult=({stream:u,onStreamEnd:A,lines:p,encoding:y,stripFinalNewline:E,allMixed:C})=>{const I=new AbortController;stopReadingOnStreamEnd(A,I,u);const w=u.readableObjectMode&&!C;return iterateOnStream({stream:u,controller:I,binary:y==="buffer",shouldEncode:!w,encoding:y,shouldSplit:!w&&p,preserveNewlines:!E})};const stopReadingOnStreamEnd=async(u,A,p)=>{try{await u}catch{p.destroy()}finally{A.abort()}};const iterateOnStream=({stream:u,controller:A,binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I})=>{const w=(0,Le.on)(u,"data",{signal:A.signal,highWaterMark:ai,highWatermark:ai});return iterateOnData({onStdoutChunk:w,controller:A,binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I})};const oi=(0,Pe.getDefaultHighWaterMark)(true);const ai=oi;const iterateOnData=async function*({onStdoutChunk:u,controller:A,binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I}){const w=getGenerators({binary:p,shouldEncode:y,encoding:E,shouldSplit:C,preserveNewlines:I});try{for await(const[A]of u){yield*transformChunkSync(A,w,0)}}catch(u){if(!A.signal.aborted){throw u}}finally{yield*finalChunksSync(w)}};const getGenerators=({binary:u,shouldEncode:A,encoding:p,shouldSplit:y,preserveNewlines:E})=>[getEncodingTransformGenerator(u,p,!A),getSplitLinesGenerator(u,E,!y,{})].filter(Boolean);const getStreamOutput=async({stream:u,onStreamEnd:A,fdNumber:p,encoding:y,buffer:E,maxBuffer:C,lines:I,allMixed:w,stripFinalNewline:v,verboseInfo:B,streamInfo:S})=>{const D=logOutputAsync({stream:u,onStreamEnd:A,fdNumber:p,encoding:y,allMixed:w,verboseInfo:B,streamInfo:S});if(!E){await Promise.all([resumeStream(u),D]);return}const k=getStripFinalNewline(v,p);const Q=iterateForResult({stream:u,onStreamEnd:A,lines:I,encoding:y,stripFinalNewline:k,allMixed:w});const[F]=await Promise.all([contents_getStreamContents({stream:u,iterable:Q,fdNumber:p,encoding:y,maxBuffer:C,lines:I}),D]);return F};const logOutputAsync=async({stream:u,onStreamEnd:A,fdNumber:p,encoding:y,allMixed:E,verboseInfo:C,streamInfo:{fileDescriptors:I}})=>{if(!shouldLogOutput({stdioItems:I[p]?.stdioItems,encoding:y,verboseInfo:C,fdNumber:p})){return}const w=iterateForResult({stream:u,onStreamEnd:A,lines:true,encoding:y,stripFinalNewline:true,allMixed:E});await logLines(w,u,p,C)};const resumeStream=async u=>{await(0,Dr.setImmediate)();if(u.readableFlowing===null){u.resume()}};const contents_getStreamContents=async({stream:u,stream:{readableObjectMode:A},iterable:p,fdNumber:y,encoding:E,maxBuffer:C,lines:I})=>{try{if(A||I){return await getStreamAsArray(p,{maxBuffer:C})}if(E==="buffer"){return new Uint8Array(await getStreamAsArrayBuffer(p,{maxBuffer:C}))}return await getStreamAsString(p,{maxBuffer:C})}catch(p){return handleBufferedData(handleMaxBuffer({error:p,stream:u,readableObjectMode:A,lines:I,encoding:E,fdNumber:y}))}};const getBufferedData=async u=>{try{return await u}catch(u){return handleBufferedData(u)}};const handleBufferedData=({bufferedData:u})=>isArrayBuffer(u)?new Uint8Array(u):u;const waitForStream=async(u,A,p,{isSameDirection:y,stopOnExit:E=false}={})=>{const C=handleStdinDestroy(u,p);const I=new AbortController;try{await Promise.race([...E?[p.exitPromise]:[],(0,Os.finished)(u,{cleanup:true,signal:I.signal})])}catch(u){if(!C.stdinCleanedUp){handleStreamError(u,A,p,y)}}finally{I.abort()}};const handleStdinDestroy=(u,{originalStreams:[A],subprocess:p})=>{const y={stdinCleanedUp:false};if(u===A){spyOnStdinDestroy(u,p,y)}return y};const spyOnStdinDestroy=(u,A,p)=>{const{_destroy:y}=u;u._destroy=(...E)=>{setStdinCleanedUp(A,p);y.call(u,...E)}};const setStdinCleanedUp=({exitCode:u,signalCode:A},p)=>{if(u!==null||A!==null){p.stdinCleanedUp=true}};const handleStreamError=(u,A,p,y)=>{if(!shouldIgnoreStreamError(u,A,p,y)){throw u}};const shouldIgnoreStreamError=(u,A,p,y=true)=>{if(p.propagating){return isStreamEpipe(u)||isStreamAbort(u)}p.propagating=true;return isInputFileDescriptor(p,A)===y?isStreamEpipe(u):isStreamAbort(u)};const isInputFileDescriptor=({fileDescriptors:u},A)=>A!=="all"&&u[A].direction==="input";const isStreamAbort=u=>u?.code==="ERR_STREAM_PREMATURE_CLOSE";const isStreamEpipe=u=>u?.code==="EPIPE";const waitForStdioStreams=({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:C,verboseInfo:I,streamInfo:w})=>u.stdio.map(((u,v)=>waitForSubprocessStream({stream:u,fdNumber:v,encoding:A,buffer:p[v],maxBuffer:y[v],lines:E[v],allMixed:false,stripFinalNewline:C,verboseInfo:I,streamInfo:w})));const waitForSubprocessStream=async({stream:u,fdNumber:A,encoding:p,buffer:y,maxBuffer:E,lines:C,allMixed:I,stripFinalNewline:w,verboseInfo:v,streamInfo:B})=>{if(!u){return}const S=waitForStream(u,A,B);if(isInputFileDescriptor(B,A)){await S;return}const[D]=await Promise.all([getStreamOutput({stream:u,onStreamEnd:S,fdNumber:A,encoding:p,buffer:y,maxBuffer:E,lines:C,allMixed:I,stripFinalNewline:w,verboseInfo:v,streamInfo:B}),S]);return D};const makeAllStream=({stdout:u,stderr:A},{all:p})=>p&&(u||A)?mergeStreams([u,A].filter(Boolean)):undefined;const waitForAllStream=({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:C,verboseInfo:I,streamInfo:w})=>waitForSubprocessStream({...getAllStream(u,p),fdNumber:"all",encoding:A,maxBuffer:y[1]+y[2],lines:E[1]||E[2],allMixed:getAllMixed(u),stripFinalNewline:C,verboseInfo:I,streamInfo:w});const getAllStream=({stdout:u,stderr:A,all:p},[,y,E])=>{const C=y||E;if(!C){return{stream:p,buffer:C}}if(!y){return{stream:A,buffer:C}}if(!E){return{stream:u,buffer:C}}return{stream:p,buffer:C}};const getAllMixed=({all:u,stdout:A,stderr:p})=>u&&A&&p&&A.readableObjectMode!==p.readableObjectMode;const shouldLogIpc=u=>isFullVerbose(u,"ipc");const logIpcOutput=(u,A)=>{const p=serializeVerboseMessage(u);verboseLog({type:"ipc",verboseMessage:p,fdNumber:"ipc",verboseInfo:A})};const waitForIpcOutput=async({subprocess:u,buffer:A,maxBuffer:p,ipc:y,ipcOutput:E,verboseInfo:C})=>{if(!y){return E}const I=shouldLogIpc(C);const w=getFdSpecificValue(A,"ipc");const v=getFdSpecificValue(p,"ipc");for await(const A of loopOnMessages({anyProcess:u,channel:u.channel,isSubprocess:false,ipc:y,shouldAwait:false,reference:true})){if(w){checkIpcMaxBuffer(u,E,v);E.push(A)}if(I){logIpcOutput(A,C)}}return E};const getBufferedIpcOutput=async(u,A)=>{await Promise.allSettled([u]);return A};const waitForSubprocessResult=async({subprocess:u,options:{encoding:A,buffer:p,maxBuffer:y,lines:E,timeoutDuration:C,cancelSignal:I,gracefulCancel:w,forceKillAfterDelay:v,stripFinalNewline:B,ipc:S,ipcInput:D},context:k,verboseInfo:Q,fileDescriptors:F,originalStreams:R,onInternalError:_,controller:P})=>{const O=waitForExit(u,k);const U={originalStreams:R,fileDescriptors:F,subprocess:u,exitPromise:O,propagating:false};const H=waitForStdioStreams({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:B,verboseInfo:Q,streamInfo:U});const G=waitForAllStream({subprocess:u,encoding:A,buffer:p,maxBuffer:y,lines:E,stripFinalNewline:B,verboseInfo:Q,streamInfo:U});const j=[];const $=waitForIpcOutput({subprocess:u,buffer:p,maxBuffer:y,ipc:S,ipcOutput:j,verboseInfo:Q});const q=waitForOriginalStreams(R,u,U);const K=waitForCustomStreamsEnd(F,U);try{return await Promise.race([Promise.all([{},waitForSuccessfulExit(O),Promise.all(H),G,$,sendIpcInput(u,D),...q,...K]),_,throwOnSubprocessError(u,P),...throwOnTimeout(u,C,k,P),...throwOnCancel({subprocess:u,cancelSignal:I,gracefulCancel:w,context:k,controller:P}),...throwOnGracefulCancel({subprocess:u,cancelSignal:I,gracefulCancel:w,forceKillAfterDelay:v,context:k,controller:P})])}catch(u){k.terminationReason??="other";return Promise.all([{error:u},O,Promise.all(H.map((u=>getBufferedData(u)))),getBufferedData(G),getBufferedIpcOutput($,j),Promise.allSettled(q),Promise.allSettled(K)])}};const waitForOriginalStreams=(u,A,p)=>u.map(((u,y)=>u===A.stdio[y]?undefined:waitForStream(u,y,p)));const waitForCustomStreamsEnd=(u,A)=>u.flatMap((({stdioItems:u},p)=>u.filter((({value:u,stream:A=u})=>is_stream_isStream(A,{checkOpen:false})&&!isStandardStream(A))).map((({type:u,value:y,stream:E=y})=>waitForStream(E,p,A,{isSameDirection:ys.has(u),stopOnExit:u==="native"})))));const throwOnSubprocessError=async(u,{signal:A})=>{const[p]=await(0,Le.once)(u,"error",{signal:A});throw p};const initializeConcurrentStreams=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap});const addConcurrentStream=(u,A,p)=>{const y=u[p];if(!y.has(A)){y.set(A,[])}const E=y.get(A);const C=createDeferred();E.push(C);const I=C.resolve.bind(C);return{resolve:I,promises:E}};const waitForConcurrentStreams=async({resolve:u,promises:A},p)=>{u();const[y]=await Promise.race([Promise.allSettled([true,p]),Promise.all([false,...A])]);return!y};const safeWaitForSubprocessStdin=async u=>{if(u===undefined){return}try{await waitForSubprocessStdin(u)}catch{}};const safeWaitForSubprocessStdout=async u=>{if(u===undefined){return}try{await waitForSubprocessStdout(u)}catch{}};const waitForSubprocessStdin=async u=>{await(0,Os.finished)(u,{cleanup:true,readable:false,writable:true})};const waitForSubprocessStdout=async u=>{await(0,Os.finished)(u,{cleanup:true,readable:true,writable:false})};const waitForSubprocess=async(u,A)=>{await u;if(A){throw A}};const destroyOtherStream=(u,A,p)=>{if(p&&!isStreamAbort(p)){u.destroy(p)}else if(A){u.destroy()}};const createReadable=({subprocess:u,concurrentStreams:A,encoding:p},{from:y,binary:E=true,preserveNewlines:C=true}={})=>{const I=E||es.has(p);const{subprocessStdout:w,waitReadableDestroy:v}=getSubprocessStdout(u,y,A);const{readableEncoding:B,readableObjectMode:S,readableHighWaterMark:D}=getReadableOptions(w,I);const{read:k,onStdoutDataDone:Q}=getReadableMethods({subprocessStdout:w,subprocess:u,binary:I,encoding:p,preserveNewlines:C});const F=new Pe.Readable({read:k,destroy:(0,cn.callbackify)(onReadableDestroy.bind(undefined,{subprocessStdout:w,subprocess:u,waitReadableDestroy:v})),highWaterMark:D,objectMode:S,encoding:B});onStdoutFinished({subprocessStdout:w,onStdoutDataDone:Q,readable:F,subprocess:u});return F};const getSubprocessStdout=(u,A,p)=>{const y=getFromStream(u,A);const E=addConcurrentStream(p,y,"readableDestroy");return{subprocessStdout:y,waitReadableDestroy:E}};const getReadableOptions=({readableEncoding:u,readableObjectMode:A,readableHighWaterMark:p},y)=>y?{readableEncoding:u,readableObjectMode:A,readableHighWaterMark:p}:{readableEncoding:u,readableObjectMode:true,readableHighWaterMark:oi};const getReadableMethods=({subprocessStdout:u,subprocess:A,binary:p,encoding:y,preserveNewlines:E})=>{const C=createDeferred();const I=iterateOnSubprocessStream({subprocessStdout:u,subprocess:A,binary:p,shouldEncode:!p,encoding:y,preserveNewlines:E});return{read(){onRead(this,I,C)},onStdoutDataDone:C}};const onRead=async(u,A,p)=>{try{const{value:y,done:E}=await A.next();if(E){p.resolve()}else{u.push(y)}}catch{}};const onStdoutFinished=async({subprocessStdout:u,onStdoutDataDone:A,readable:p,subprocess:y,subprocessStdin:E})=>{try{await waitForSubprocessStdout(u);await y;await safeWaitForSubprocessStdin(E);await A;if(p.readable){p.push(null)}}catch(u){await safeWaitForSubprocessStdin(E);destroyOtherReadable(p,u)}};const onReadableDestroy=async({subprocessStdout:u,subprocess:A,waitReadableDestroy:p},y)=>{if(await waitForConcurrentStreams(p,A)){destroyOtherReadable(u,y);await waitForSubprocess(A,y)}};const destroyOtherReadable=(u,A)=>{destroyOtherStream(u,u.readable,A)};const createWritable=({subprocess:u,concurrentStreams:A},{to:p}={})=>{const{subprocessStdin:y,waitWritableFinal:E,waitWritableDestroy:C}=getSubprocessStdin(u,p,A);const I=new Pe.Writable({...getWritableMethods(y,u,E),destroy:(0,cn.callbackify)(onWritableDestroy.bind(undefined,{subprocessStdin:y,subprocess:u,waitWritableFinal:E,waitWritableDestroy:C})),highWaterMark:y.writableHighWaterMark,objectMode:y.writableObjectMode});onStdinFinished(y,I);return I};const getSubprocessStdin=(u,A,p)=>{const y=getToStream(u,A);const E=addConcurrentStream(p,y,"writableFinal");const C=addConcurrentStream(p,y,"writableDestroy");return{subprocessStdin:y,waitWritableFinal:E,waitWritableDestroy:C}};const getWritableMethods=(u,A,p)=>({write:onWrite.bind(undefined,u),final:(0,cn.callbackify)(onWritableFinal.bind(undefined,u,A,p))});const onWrite=(u,A,p,y)=>{if(u.write(A,p)){y()}else{u.once("drain",y)}};const onWritableFinal=async(u,A,p)=>{if(await waitForConcurrentStreams(p,A)){if(u.writable){u.end()}await A}};const onStdinFinished=async(u,A,p)=>{try{await waitForSubprocessStdin(u);if(A.writable){A.end()}}catch(u){await safeWaitForSubprocessStdout(p);destroyOtherWritable(A,u)}};const onWritableDestroy=async({subprocessStdin:u,subprocess:A,waitWritableFinal:p,waitWritableDestroy:y},E)=>{await waitForConcurrentStreams(p,A);if(await waitForConcurrentStreams(y,A)){destroyOtherWritable(u,E);await waitForSubprocess(A,E)}};const destroyOtherWritable=(u,A)=>{destroyOtherStream(u,u.writable,A)};const createDuplex=({subprocess:u,concurrentStreams:A,encoding:p},{from:y,to:E,binary:C=true,preserveNewlines:I=true}={})=>{const w=C||es.has(p);const{subprocessStdout:v,waitReadableDestroy:B}=getSubprocessStdout(u,y,A);const{subprocessStdin:S,waitWritableFinal:D,waitWritableDestroy:k}=getSubprocessStdin(u,E,A);const{readableEncoding:Q,readableObjectMode:F,readableHighWaterMark:R}=getReadableOptions(v,w);const{read:_,onStdoutDataDone:P}=getReadableMethods({subprocessStdout:v,subprocess:u,binary:w,encoding:p,preserveNewlines:I});const O=new Pe.Duplex({read:_,...getWritableMethods(S,u,D),destroy:(0,cn.callbackify)(onDuplexDestroy.bind(undefined,{subprocessStdout:v,subprocessStdin:S,subprocess:u,waitReadableDestroy:B,waitWritableFinal:D,waitWritableDestroy:k})),readableHighWaterMark:R,writableHighWaterMark:S.writableHighWaterMark,readableObjectMode:F,writableObjectMode:S.writableObjectMode,encoding:Q});onStdoutFinished({subprocessStdout:v,onStdoutDataDone:P,readable:O,subprocess:u,subprocessStdin:S});onStdinFinished(S,O,v);return O};const onDuplexDestroy=async({subprocessStdout:u,subprocessStdin:A,subprocess:p,waitReadableDestroy:y,waitWritableFinal:E,waitWritableDestroy:C},I)=>{await Promise.all([onReadableDestroy({subprocessStdout:u,subprocess:p,waitReadableDestroy:y},I),onWritableDestroy({subprocessStdin:A,subprocess:p,waitWritableFinal:E,waitWritableDestroy:C},I)])};const createIterable=(u,A,{from:p,binary:y=false,preserveNewlines:E=false}={})=>{const C=y||es.has(A);const I=getFromStream(u,p);const w=iterateOnSubprocessStream({subprocessStdout:I,subprocess:u,binary:C,shouldEncode:true,encoding:A,preserveNewlines:E});return iterateOnStdoutData(w,I,u)};const iterateOnStdoutData=async function*(u,A,p){try{yield*u}finally{if(A.readable){A.destroy()}await p}};const addConvertedStreams=(u,{encoding:A})=>{const p=initializeConcurrentStreams();u.readable=createReadable.bind(undefined,{subprocess:u,concurrentStreams:p,encoding:A});u.writable=createWritable.bind(undefined,{subprocess:u,concurrentStreams:p});u.duplex=createDuplex.bind(undefined,{subprocess:u,concurrentStreams:p,encoding:A});u.iterable=createIterable.bind(undefined,u,A);u[Symbol.asyncIterator]=createIterable.bind(undefined,u,A,{})};const mergePromise=(u,A)=>{for(const[p,y]of ci){const E=y.value.bind(A);Reflect.defineProperty(u,p,{...y,value:E})}};const li=(async()=>{})().constructor.prototype;const ci=["then","catch","finally"].map((u=>[u,Reflect.getOwnPropertyDescriptor(li,u)]));const execaCoreAsync=(u,A,p,y)=>{const{file:E,commandArguments:C,command:I,escapedCommand:w,startTime:v,verboseInfo:B,options:S,fileDescriptors:D}=handleAsyncArguments(u,A,p);const{subprocess:k,promise:Q}=spawnSubprocessAsync({file:E,commandArguments:C,options:S,startTime:v,verboseInfo:B,command:I,escapedCommand:w,fileDescriptors:D});k.pipe=pipeToSubprocess.bind(undefined,{source:k,sourcePromise:Q,boundOptions:{},createNested:y});mergePromise(k,Q);Mr.set(k,{options:S,fileDescriptors:D});return k};const handleAsyncArguments=(u,A,p)=>{const{command:y,escapedCommand:E,startTime:C,verboseInfo:I}=handleCommand(u,A,p);const{file:w,commandArguments:v,options:B}=normalizeOptions(u,A,p);const S=handleAsyncOptions(B);const D=handleStdioAsync(S,I);return{file:w,commandArguments:v,command:y,escapedCommand:E,startTime:C,verboseInfo:I,options:S,fileDescriptors:D}};const handleAsyncOptions=({timeout:u,signal:A,...p})=>{if(A!==undefined){throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.')}return{...p,timeoutDuration:u}};const spawnSubprocessAsync=({file:u,commandArguments:A,options:p,startTime:y,verboseInfo:E,command:C,escapedCommand:I,fileDescriptors:w})=>{let v;try{v=(0,nn.spawn)(...concatenateShell(u,A,p))}catch(u){return handleEarlyError({error:u,command:C,escapedCommand:I,fileDescriptors:w,options:p,startTime:y,verboseInfo:E})}const B=new AbortController;(0,Le.setMaxListeners)(Number.POSITIVE_INFINITY,B.signal);const S=[...v.stdio];pipeOutputAsync(v,w,B);cleanupOnExit(v,p,B);const D={};const k=createDeferred();v.kill=subprocessKill.bind(undefined,{kill:v.kill.bind(v),options:p,onInternalError:k,context:D,controller:B});v.all=makeAllStream(v,p);addConvertedStreams(v,p);addIpcMethods(v,p);const Q=handlePromise({subprocess:v,options:p,startTime:y,verboseInfo:E,fileDescriptors:w,originalStreams:S,command:C,escapedCommand:I,context:D,onInternalError:k,controller:B});return{subprocess:v,promise:Q}};const handlePromise=async({subprocess:u,options:A,startTime:p,verboseInfo:y,fileDescriptors:E,originalStreams:C,command:I,escapedCommand:w,context:v,onInternalError:B,controller:S})=>{const[D,[k,Q],F,R,_]=await waitForSubprocessResult({subprocess:u,options:A,context:v,verboseInfo:y,fileDescriptors:E,originalStreams:C,onInternalError:B,controller:S});S.abort();B.resolve();const P=F.map(((u,p)=>stripNewline(u,A,p)));const O=stripNewline(R,A,"all");const U=getAsyncResult({errorInfo:D,exitCode:k,signal:Q,stdio:P,all:O,ipcOutput:_,context:v,options:A,command:I,escapedCommand:w,startTime:p});return handleResult(U,y,A)};const getAsyncResult=({errorInfo:u,exitCode:A,signal:p,stdio:y,all:E,ipcOutput:C,context:I,options:w,command:v,escapedCommand:B,startTime:S})=>"error"in u?makeError({error:u.error,command:v,escapedCommand:B,timedOut:I.terminationReason==="timeout",isCanceled:I.terminationReason==="cancel"||I.terminationReason==="gracefulCancel",isGracefullyCanceled:I.terminationReason==="gracefulCancel",isMaxBuffer:u.error instanceof MaxBufferError,isForcefullyTerminated:I.isForcefullyTerminated,exitCode:A,signal:p,stdio:y,all:E,ipcOutput:C,options:w,startTime:S,isSync:false}):makeSuccessResult({command:v,escapedCommand:B,stdio:y,all:E,ipcOutput:C,options:w,startTime:S});const mergeOptions=(u,A)=>{const p=Object.fromEntries(Object.entries(A).map((([A,p])=>[A,mergeOption(A,u[A],p)])));return{...u,...p}};const mergeOption=(u,A,p)=>{if(ui.has(u)&&isPlainObject(A)&&isPlainObject(p)){return{...A,...p}}return p};const ui=new Set(["env",...gn]);const createExeca=(u,A,p,y)=>{const createNested=(u,A,y)=>createExeca(u,A,p,y);const boundExeca=(...E)=>callBoundExeca({mapArguments:u,deepOptions:p,boundOptions:A,setBoundExeca:y,createNested:createNested},...E);if(y!==undefined){y(boundExeca,createNested,A)}return boundExeca};const callBoundExeca=({mapArguments:u,deepOptions:A={},boundOptions:p={},setBoundExeca:y,createNested:E},C,...I)=>{if(isPlainObject(C)){return E(u,mergeOptions(p,C),y)}const{file:w,commandArguments:v,options:B,isSync:S}=parseArguments({mapArguments:u,firstArgument:C,nextArguments:I,deepOptions:A,boundOptions:p});return S?execaCoreSync(w,v,B):execaCoreAsync(w,v,B,E)};const parseArguments=({mapArguments:u,firstArgument:A,nextArguments:p,deepOptions:y,boundOptions:E})=>{const C=isTemplateString(A)?parseTemplates(A,p):[A,...p];const[I,w,v]=normalizeParameters(...C);const B=mergeOptions(mergeOptions(y,E),v);const{file:S=I,commandArguments:D=w,options:k=B,isSync:Q=false}=u({file:I,commandArguments:w,options:B});return{file:S,commandArguments:D,options:k,isSync:Q}};const mapCommandAsync=({file:u,commandArguments:A})=>parseCommand(u,A);const mapCommandSync=({file:u,commandArguments:A})=>({...parseCommand(u,A),isSync:true});const parseCommand=(u,A)=>{if(A.length>0){throw new TypeError(`The command and its arguments must be passed as a single string: ${u} ${A}.`)}const[p,...y]=parseCommandString(u);return{file:p,commandArguments:y}};const parseCommandString=u=>{if(typeof u!=="string"){throw new TypeError(`The command must be a string: ${String(u)}.`)}const A=u.trim();if(A===""){return[]}const p=[];for(const u of A.split(di)){const A=p.at(-1);if(A&&A.endsWith("\\")){p[p.length-1]=`${A.slice(0,-1)} ${u}`}else{p.push(u)}}return p};const di=/ +/g;const setScriptSync=(u,A,p)=>{u.sync=A(mapScriptSync,p);u.s=u.sync};const mapScriptAsync=({options:u})=>getScriptOptions(u);const mapScriptSync=({options:u})=>({...getScriptOptions(u),isSync:true});const getScriptOptions=u=>({options:{...getScriptStdinOption(u),...u}});const getScriptStdinOption=({input:u,inputFile:A,stdio:p})=>u===undefined&&A===undefined&&p===undefined?{stdin:"inherit"}:{};const fi={preferLocal:true};const Ai=createExeca((()=>({})));const hi=createExeca((()=>({isSync:true})));const pi=createExeca(mapCommandAsync);const gi=createExeca(mapCommandSync);const mi=createExeca(mapNode);const yi=createExeca(mapScriptAsync,{},fi,setScriptSync);const{sendMessage:Ei,getOneMessage:Ci,getEachMessage:Ii,getCancelSignal:bi}=getIpcExport();var wi=p(5606);var vi=p(1159);function keysOf(u){return Object.keys(u)}const Bi=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(u){return Bi.includes(u)}const Si=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Bi];function isObjectTypeName(u){return Si.includes(u)}const Di=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(u){return Di.includes(u)}const ki=["positive number","negative number","Class","string with a number","null or undefined","Iterable","AsyncIterable","native Promise","EnumCase","string with a URL","truthy","falsy","primitive","integer","plain object","TypedArray","array-like","tuple-like","Node.js Stream","infinite number","empty array","non-empty array","empty string","empty string or whitespace","non-empty string","non-empty string and not whitespace","empty object","non-empty object","empty set","non-empty set","empty map","non-empty map","PropertyKey","even integer","odd integer","T","in range","predicate returns truthy for any value","predicate returns truthy for all values","valid Date","valid length","whitespace string",...Si,...Di];const getObjectType=u=>{const A=Object.prototype.toString.call(u).slice(8,-1);if(/HTML\w+Element/.test(A)&&isHtmlElement(u)){return"HTMLElement"}if(isObjectTypeName(A)){return A}return undefined};function detect(u){if(u===null){return"null"}switch(typeof u){case"undefined":{return"undefined"}case"string":{return"string"}case"number":{return Number.isNaN(u)?"NaN":"number"}case"boolean":{return"boolean"}case"function":{return"Function"}case"bigint":{return"bigint"}case"symbol":{return"symbol"}default:}if(isObservable(u)){return"Observable"}if(isArray(u)){return"Array"}if(isBuffer(u)){return"Buffer"}const A=getObjectType(u);if(A&&A!=="Object"){return A}if(hasPromiseApi(u)){return"Promise"}if(u instanceof String||u instanceof Boolean||u instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}function hasPromiseApi(u){return isFunction(u?.then)&&isFunction(u?.catch)}const Qi=Object.assign(detect,{all:isAll,any:isAny,array:isArray,arrayBuffer:distribution_isArrayBuffer,arrayLike:isArrayLike,asyncFunction:isAsyncFunction,asyncGenerator:distribution_isAsyncGenerator,asyncGeneratorFunction:isAsyncGeneratorFunction,asyncIterable:isAsyncIterable,bigint:isBigint,bigInt64Array:isBigInt64Array,bigUint64Array:isBigUint64Array,blob:isBlob,boolean:isBoolean,boundFunction:isBoundFunction,buffer:isBuffer,class:isClass,dataView:isDataView,date:isDate,detect:detect,directInstanceOf:isDirectInstanceOf,emptyArray:isEmptyArray,emptyMap:isEmptyMap,emptyObject:isEmptyObject,emptySet:isEmptySet,emptyString:isEmptyString,emptyStringOrWhitespace:isEmptyStringOrWhitespace,enumCase:isEnumCase,error:isError,evenInteger:isEvenInteger,falsy:isFalsy,float32Array:isFloat32Array,float64Array:isFloat64Array,formData:isFormData,function:isFunction,generator:distribution_isGenerator,generatorFunction:isGeneratorFunction,htmlElement:isHtmlElement,infinite:isInfinite,inRange:isInRange,int16Array:isInt16Array,int32Array:isInt32Array,int8Array:isInt8Array,integer:isInteger,iterable:isIterable,map:isMap,nan:isNan,nativePromise:isNativePromise,negativeNumber:isNegativeNumber,nodeStream:isNodeStream,nonEmptyArray:isNonEmptyArray,nonEmptyMap:isNonEmptyMap,nonEmptyObject:isNonEmptyObject,nonEmptySet:isNonEmptySet,nonEmptyString:isNonEmptyString,nonEmptyStringAndNotWhitespace:isNonEmptyStringAndNotWhitespace,null:isNull,nullOrUndefined:isNullOrUndefined,number:isNumber,numericString:isNumericString,object:distribution_isObject,observable:isObservable,oddInteger:isOddInteger,plainObject:distribution_isPlainObject,positiveNumber:isPositiveNumber,primitive:isPrimitive,promise:isPromise,propertyKey:isPropertyKey,regExp:isRegExp,safeInteger:isSafeInteger,set:isSet,sharedArrayBuffer:isSharedArrayBuffer,string:isString,symbol:isSymbol,truthy:isTruthy,tupleLike:isTupleLike,typedArray:isTypedArray,uint16Array:isUint16Array,uint32Array:isUint32Array,uint8Array:distribution_isUint8Array,uint8ClampedArray:isUint8ClampedArray,undefined:isUndefined,urlInstance:isUrlInstance,urlSearchParams:isUrlSearchParams,urlString:isUrlString,optional:isOptional,validDate:isValidDate,validLength:isValidLength,weakMap:isWeakMap,weakRef:isWeakRef,weakSet:isWeakSet,whitespaceString:isWhitespaceString});function isAbsoluteModule2(u){return A=>isInteger(A)&&Math.abs(A%2)===u}function validatePredicateArray(u,A){if(u.length===0){if(A){}else{throw new TypeError("Invalid predicate array")}return}for(const A of u){if(!isFunction(A)){throw new TypeError(`Invalid predicate: ${JSON.stringify(A)}`)}}}function isAll(u,...A){if(Array.isArray(u)){const p=u;validatePredicateArray(p,A.length===0);const combinedPredicate=u=>p.every((A=>A(u)));if(A.length===0){return combinedPredicate}return predicateOnArray(Array.prototype.every,combinedPredicate,A)}return predicateOnArray(Array.prototype.every,u,A)}function isAny(u,...A){if(Array.isArray(u)){const p=u;validatePredicateArray(p,A.length===0);const combinedPredicate=u=>p.some((A=>A(u)));if(A.length===0){return combinedPredicate}return predicateOnArray(Array.prototype.some,combinedPredicate,A)}return predicateOnArray(Array.prototype.some,u,A)}function isOptional(u,A){return isUndefined(u)||A(u)}function isArray(u,A){if(!Array.isArray(u)){return false}if(!isFunction(A)){return true}return u.every((u=>A(u)))}function distribution_isArrayBuffer(u){return getObjectType(u)==="ArrayBuffer"}function isArrayLike(u){return!isNullOrUndefined(u)&&!isFunction(u)&&isValidLength(u.length)}function isAsyncFunction(u){return getObjectType(u)==="AsyncFunction"}function distribution_isAsyncGenerator(u){return isAsyncIterable(u)&&isFunction(u.next)&&isFunction(u.throw)}function isAsyncGeneratorFunction(u){return getObjectType(u)==="AsyncGeneratorFunction"}function isAsyncIterable(u){return isFunction(u?.[Symbol.asyncIterator])}function isBigint(u){return typeof u==="bigint"}function isBigInt64Array(u){return getObjectType(u)==="BigInt64Array"}function isBigUint64Array(u){return getObjectType(u)==="BigUint64Array"}function isBlob(u){return getObjectType(u)==="Blob"}function isBoolean(u){return u===true||u===false}function isBoundFunction(u){return isFunction(u)&&!Object.hasOwn(u,"prototype")}function isBuffer(u){return u?.constructor?.isBuffer?.(u)??false}function isClass(u){return isFunction(u)&&/^class(\s+|{)/.test(u.toString())}function isDataView(u){return getObjectType(u)==="DataView"}function isDate(u){return getObjectType(u)==="Date"}function isDirectInstanceOf(u,A){if(u===undefined||u===null){return false}return Object.getPrototypeOf(u)===A.prototype}function isEmptyArray(u){return isArray(u)&&u.length===0}function isEmptyMap(u){return isMap(u)&&u.size===0}function isEmptyObject(u){return distribution_isObject(u)&&!isMap(u)&&!isSet(u)&&Object.keys(u).length===0}function isEmptySet(u){return isSet(u)&&u.size===0}function isEmptyString(u){return isString(u)&&u.length===0}function isEmptyStringOrWhitespace(u){return isEmptyString(u)||isWhitespaceString(u)}function isEnumCase(u,A){return Object.values(A).includes(u)}function isError(u){return getObjectType(u)==="Error"}function isEvenInteger(u){return isAbsoluteModule2(0)(u)}function isFalsy(u){return!u}function isFloat32Array(u){return getObjectType(u)==="Float32Array"}function isFloat64Array(u){return getObjectType(u)==="Float64Array"}function isFormData(u){return getObjectType(u)==="FormData"}function isFunction(u){return typeof u==="function"}function distribution_isGenerator(u){return isIterable(u)&&isFunction(u?.next)&&isFunction(u?.throw)}function isGeneratorFunction(u){return getObjectType(u)==="GeneratorFunction"}const Fi=1;const xi=["innerHTML","ownerDocument","style","attributes","nodeValue"];function isHtmlElement(u){return distribution_isObject(u)&&u.nodeType===Fi&&isString(u.nodeName)&&!distribution_isPlainObject(u)&&xi.every((A=>A in u))}function isInfinite(u){return u===Number.POSITIVE_INFINITY||u===Number.NEGATIVE_INFINITY}function isInRange(u,A){if(isNumber(A)){return u>=Math.min(0,A)&&u<=Math.max(A,0)}if(isArray(A)&&A.length===2){return u>=Math.min(...A)&&u<=Math.max(...A)}throw new TypeError(`Invalid range: ${JSON.stringify(A)}`)}function isInt16Array(u){return getObjectType(u)==="Int16Array"}function isInt32Array(u){return getObjectType(u)==="Int32Array"}function isInt8Array(u){return getObjectType(u)==="Int8Array"}function isInteger(u){return Number.isInteger(u)}function isIterable(u){return isFunction(u?.[Symbol.iterator])}function isMap(u){return getObjectType(u)==="Map"}function isNan(u){return Number.isNaN(u)}function isNativePromise(u){return getObjectType(u)==="Promise"}function isNegativeNumber(u){return isNumber(u)&&u<0}function isNodeStream(u){return distribution_isObject(u)&&isFunction(u.pipe)&&!isObservable(u)}function isNonEmptyArray(u){return isArray(u)&&u.length>0}function isNonEmptyMap(u){return isMap(u)&&u.size>0}function isNonEmptyObject(u){return distribution_isObject(u)&&!isMap(u)&&!isSet(u)&&Object.keys(u).length>0}function isNonEmptySet(u){return isSet(u)&&u.size>0}function isNonEmptyString(u){return isString(u)&&u.length>0}function isNonEmptyStringAndNotWhitespace(u){return isString(u)&&!isEmptyStringOrWhitespace(u)}function isNull(u){return u===null}function isNullOrUndefined(u){return isNull(u)||isUndefined(u)}function isNumber(u){return typeof u==="number"&&!Number.isNaN(u)}function isNumericString(u){return isString(u)&&!isEmptyStringOrWhitespace(u)&&!Number.isNaN(Number(u))}function distribution_isObject(u){return!isNull(u)&&(typeof u==="object"||isFunction(u))}function isObservable(u){if(!u){return false}if(Symbol.observable!==undefined&&u===u[Symbol.observable]?.()){return true}if(u===u["@@observable"]?.()){return true}return false}function isOddInteger(u){return isAbsoluteModule2(1)(u)}function distribution_isPlainObject(u){if(typeof u!=="object"||u===null){return false}const A=Object.getPrototypeOf(u);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(Symbol.toStringTag in u)&&!(Symbol.iterator in u)}function isPositiveNumber(u){return isNumber(u)&&u>0}function isPrimitive(u){return isNull(u)||isPrimitiveTypeName(typeof u)}function isPromise(u){return isNativePromise(u)||hasPromiseApi(u)}function isPropertyKey(u){return isAny([isString,isNumber,isSymbol],u)}function isRegExp(u){return getObjectType(u)==="RegExp"}function isSafeInteger(u){return Number.isSafeInteger(u)}function isSet(u){return getObjectType(u)==="Set"}function isSharedArrayBuffer(u){return getObjectType(u)==="SharedArrayBuffer"}function isString(u){return typeof u==="string"}function isSymbol(u){return typeof u==="symbol"}function isTruthy(u){return Boolean(u)}function isTupleLike(u,A){if(isArray(A)&&isArray(u)&&A.length===u.length){return A.every(((A,p)=>A(u[p])))}return false}function isTypedArray(u){return isTypedArrayName(getObjectType(u))}function isUint16Array(u){return getObjectType(u)==="Uint16Array"}function isUint32Array(u){return getObjectType(u)==="Uint32Array"}function distribution_isUint8Array(u){return getObjectType(u)==="Uint8Array"}function isUint8ClampedArray(u){return getObjectType(u)==="Uint8ClampedArray"}function isUndefined(u){return u===undefined}function isUrlInstance(u){return getObjectType(u)==="URL"}function isUrlSearchParams(u){return getObjectType(u)==="URLSearchParams"}function isUrlString(u){if(!isString(u)){return false}try{new URL(u);return true}catch{return false}}function isValidDate(u){return isDate(u)&&!isNan(Number(u))}function isValidLength(u){return isSafeInteger(u)&&u>=0}function isWeakMap(u){return getObjectType(u)==="WeakMap"}function isWeakRef(u){return getObjectType(u)==="WeakRef"}function isWeakSet(u){return getObjectType(u)==="WeakSet"}function isWhitespaceString(u){return isString(u)&&/^\s+$/.test(u)}function predicateOnArray(u,A,p){if(!isFunction(A)){throw new TypeError(`Invalid predicate: ${JSON.stringify(A)}`)}if(p.length===0){throw new TypeError("Invalid number of values")}return u.call(p,A)}function typeErrorMessage(u,A){return`Expected value which is \`${u}\`, received value of type \`${Qi(A)}\`.`}function unique(u){return Array.from(new Set(u))}const Ri=new Intl.ListFormat("en",{style:"long",type:"conjunction"});const _i=new Intl.ListFormat("en",{style:"long",type:"disjunction"});function typeErrorMessageMultipleValues(u,A){const p=unique((isArray(u)?u:[u]).map((u=>`\`${u}\``)));const y=unique(A.map((u=>`\`${Qi(u)}\``)));return`Expected values which are ${_i.format(p)}. Received values of type${y.length>1?"s":""} ${Ri.format(y)}.`}const Ti={all:assertAll,any:assertAny,optional:assertOptional,array:assertArray,arrayBuffer:assertArrayBuffer,arrayLike:assertArrayLike,asyncFunction:assertAsyncFunction,asyncGenerator:assertAsyncGenerator,asyncGeneratorFunction:assertAsyncGeneratorFunction,asyncIterable:assertAsyncIterable,bigint:assertBigint,bigInt64Array:assertBigInt64Array,bigUint64Array:assertBigUint64Array,blob:assertBlob,boolean:assertBoolean,boundFunction:assertBoundFunction,buffer:assertBuffer,class:assertClass,dataView:assertDataView,date:assertDate,directInstanceOf:assertDirectInstanceOf,emptyArray:assertEmptyArray,emptyMap:assertEmptyMap,emptyObject:assertEmptyObject,emptySet:assertEmptySet,emptyString:assertEmptyString,emptyStringOrWhitespace:assertEmptyStringOrWhitespace,enumCase:assertEnumCase,error:assertError,evenInteger:assertEvenInteger,falsy:assertFalsy,float32Array:assertFloat32Array,float64Array:assertFloat64Array,formData:assertFormData,function:assertFunction,generator:assertGenerator,generatorFunction:assertGeneratorFunction,htmlElement:assertHtmlElement,infinite:assertInfinite,inRange:assertInRange,int16Array:assertInt16Array,int32Array:assertInt32Array,int8Array:assertInt8Array,integer:assertInteger,iterable:assertIterable,map:assertMap,nan:assertNan,nativePromise:assertNativePromise,negativeNumber:assertNegativeNumber,nodeStream:assertNodeStream,nonEmptyArray:assertNonEmptyArray,nonEmptyMap:assertNonEmptyMap,nonEmptyObject:assertNonEmptyObject,nonEmptySet:assertNonEmptySet,nonEmptyString:assertNonEmptyString,nonEmptyStringAndNotWhitespace:assertNonEmptyStringAndNotWhitespace,null:assertNull,nullOrUndefined:assertNullOrUndefined,number:assertNumber,numericString:assertNumericString,object:assertObject,observable:assertObservable,oddInteger:assertOddInteger,plainObject:assertPlainObject,positiveNumber:assertPositiveNumber,primitive:assertPrimitive,promise:assertPromise,propertyKey:assertPropertyKey,regExp:assertRegExp,safeInteger:assertSafeInteger,set:assertSet,sharedArrayBuffer:assertSharedArrayBuffer,string:assertString,symbol:assertSymbol,truthy:assertTruthy,tupleLike:assertTupleLike,typedArray:assertTypedArray,uint16Array:assertUint16Array,uint32Array:assertUint32Array,uint8Array:assertUint8Array,uint8ClampedArray:assertUint8ClampedArray,undefined:assertUndefined,urlInstance:assertUrlInstance,urlSearchParams:assertUrlSearchParams,urlString:assertUrlString,validDate:assertValidDate,validLength:assertValidLength,weakMap:assertWeakMap,weakRef:assertWeakRef,weakSet:assertWeakSet,whitespaceString:assertWhitespaceString};const Ni={isArray:"Array",isArrayBuffer:"ArrayBuffer",isArrayLike:"array-like",isAsyncFunction:"AsyncFunction",isAsyncGenerator:"AsyncGenerator",isAsyncGeneratorFunction:"AsyncGeneratorFunction",isAsyncIterable:"AsyncIterable",isBigint:"bigint",isBigInt64Array:"BigInt64Array",isBigUint64Array:"BigUint64Array",isBlob:"Blob",isBoolean:"boolean",isBoundFunction:"Function",isBuffer:"Buffer",isClass:"Class",isDataView:"DataView",isDate:"Date",isDirectInstanceOf:"T",isEmptyArray:"empty array",isEmptyMap:"empty map",isEmptyObject:"empty object",isEmptySet:"empty set",isEmptyString:"empty string",isEmptyStringOrWhitespace:"empty string or whitespace",isEnumCase:"EnumCase",isError:"Error",isEvenInteger:"even integer",isFalsy:"falsy",isFloat32Array:"Float32Array",isFloat64Array:"Float64Array",isFormData:"FormData",isFunction:"Function",isGenerator:"Generator",isGeneratorFunction:"GeneratorFunction",isHtmlElement:"HTMLElement",isInfinite:"infinite number",isInRange:"in range",isInt16Array:"Int16Array",isInt32Array:"Int32Array",isInt8Array:"Int8Array",isInteger:"integer",isIterable:"Iterable",isMap:"Map",isNan:"NaN",isNativePromise:"native Promise",isNegativeNumber:"negative number",isNodeStream:"Node.js Stream",isNonEmptyArray:"non-empty array",isNonEmptyMap:"non-empty map",isNonEmptyObject:"non-empty object",isNonEmptySet:"non-empty set",isNonEmptyString:"non-empty string",isNonEmptyStringAndNotWhitespace:"non-empty string and not whitespace",isNull:"null",isNullOrUndefined:"null or undefined",isNumber:"number",isNumericString:"string with a number",isObject:"Object",isObservable:"Observable",isOddInteger:"odd integer",isPlainObject:"plain object",isPositiveNumber:"positive number",isPrimitive:"primitive",isPromise:"Promise",isPropertyKey:"PropertyKey",isRegExp:"RegExp",isSafeInteger:"integer",isSet:"Set",isSharedArrayBuffer:"SharedArrayBuffer",isString:"string",isSymbol:"symbol",isTruthy:"truthy",isTupleLike:"tuple-like",isTypedArray:"TypedArray",isUint16Array:"Uint16Array",isUint32Array:"Uint32Array",isUint8Array:"Uint8Array",isUint8ClampedArray:"Uint8ClampedArray",isUndefined:"undefined",isUrlInstance:"URL",isUrlSearchParams:"URLSearchParams",isUrlString:"string with a URL",isValidDate:"valid Date",isValidLength:"valid length",isWeakMap:"WeakMap",isWeakRef:"WeakRef",isWeakSet:"WeakSet",isWhitespaceString:"whitespace string"};const Li=keysOf(Ni);function isIsMethodName(u){return Li.includes(u)}function assertAll(u,...A){if(A.length===0){throw new TypeError("Invalid number of values")}if(!isAll(u,...A)){const p=u;const y=!Array.isArray(u)&&isIsMethodName(p.name)?Ni[p.name]:"predicate returns truthy for all values";throw new TypeError(typeErrorMessageMultipleValues(y,A))}}function assertAny(u,...A){if(A.length===0){throw new TypeError("Invalid number of values")}if(!isAny(u,...A)){const p=Array.isArray(u)?u:[u];const y=p.map((u=>isIsMethodName(u.name)?Ni[u.name]:"predicate returns truthy for any value"));throw new TypeError(typeErrorMessageMultipleValues(y,A))}}function assertOptional(u,A,p){if(!isUndefined(u)){A(u,p)}}function assertArray(u,A,p){if(!isArray(u)){throw new TypeError(p??typeErrorMessage("Array",u))}if(A){for(const y of u){A(y,p)}}}function assertArrayBuffer(u,A){if(!distribution_isArrayBuffer(u)){throw new TypeError(A??typeErrorMessage("ArrayBuffer",u))}}function assertArrayLike(u,A){if(!isArrayLike(u)){throw new TypeError(A??typeErrorMessage("array-like",u))}}function assertAsyncFunction(u,A){if(!isAsyncFunction(u)){throw new TypeError(A??typeErrorMessage("AsyncFunction",u))}}function assertAsyncGenerator(u,A){if(!distribution_isAsyncGenerator(u)){throw new TypeError(A??typeErrorMessage("AsyncGenerator",u))}}function assertAsyncGeneratorFunction(u,A){if(!isAsyncGeneratorFunction(u)){throw new TypeError(A??typeErrorMessage("AsyncGeneratorFunction",u))}}function assertAsyncIterable(u,A){if(!isAsyncIterable(u)){throw new TypeError(A??typeErrorMessage("AsyncIterable",u))}}function assertBigint(u,A){if(!isBigint(u)){throw new TypeError(A??typeErrorMessage("bigint",u))}}function assertBigInt64Array(u,A){if(!isBigInt64Array(u)){throw new TypeError(A??typeErrorMessage("BigInt64Array",u))}}function assertBigUint64Array(u,A){if(!isBigUint64Array(u)){throw new TypeError(A??typeErrorMessage("BigUint64Array",u))}}function assertBlob(u,A){if(!isBlob(u)){throw new TypeError(A??typeErrorMessage("Blob",u))}}function assertBoolean(u,A){if(!isBoolean(u)){throw new TypeError(A??typeErrorMessage("boolean",u))}}function assertBoundFunction(u,A){if(!isBoundFunction(u)){throw new TypeError(A??typeErrorMessage("Function",u))}}function assertBuffer(u,A){if(!isBuffer(u)){throw new TypeError(A??typeErrorMessage("Buffer",u))}}function assertClass(u,A){if(!isClass(u)){throw new TypeError(A??typeErrorMessage("Class",u))}}function assertDataView(u,A){if(!isDataView(u)){throw new TypeError(A??typeErrorMessage("DataView",u))}}function assertDate(u,A){if(!isDate(u)){throw new TypeError(A??typeErrorMessage("Date",u))}}function assertDirectInstanceOf(u,A,p){if(!isDirectInstanceOf(u,A)){throw new TypeError(p??typeErrorMessage("T",u))}}function assertEmptyArray(u,A){if(!isEmptyArray(u)){throw new TypeError(A??typeErrorMessage("empty array",u))}}function assertEmptyMap(u,A){if(!isEmptyMap(u)){throw new TypeError(A??typeErrorMessage("empty map",u))}}function assertEmptyObject(u,A){if(!isEmptyObject(u)){throw new TypeError(A??typeErrorMessage("empty object",u))}}function assertEmptySet(u,A){if(!isEmptySet(u)){throw new TypeError(A??typeErrorMessage("empty set",u))}}function assertEmptyString(u,A){if(!isEmptyString(u)){throw new TypeError(A??typeErrorMessage("empty string",u))}}function assertEmptyStringOrWhitespace(u,A){if(!isEmptyStringOrWhitespace(u)){throw new TypeError(A??typeErrorMessage("empty string or whitespace",u))}}function assertEnumCase(u,A,p){if(!isEnumCase(u,A)){throw new TypeError(p??typeErrorMessage("EnumCase",u))}}function assertError(u,A){if(!isError(u)){throw new TypeError(A??typeErrorMessage("Error",u))}}function assertEvenInteger(u,A){if(!isEvenInteger(u)){throw new TypeError(A??typeErrorMessage("even integer",u))}}function assertFalsy(u,A){if(!isFalsy(u)){throw new TypeError(A??typeErrorMessage("falsy",u))}}function assertFloat32Array(u,A){if(!isFloat32Array(u)){throw new TypeError(A??typeErrorMessage("Float32Array",u))}}function assertFloat64Array(u,A){if(!isFloat64Array(u)){throw new TypeError(A??typeErrorMessage("Float64Array",u))}}function assertFormData(u,A){if(!isFormData(u)){throw new TypeError(A??typeErrorMessage("FormData",u))}}function assertFunction(u,A){if(!isFunction(u)){throw new TypeError(A??typeErrorMessage("Function",u))}}function assertGenerator(u,A){if(!distribution_isGenerator(u)){throw new TypeError(A??typeErrorMessage("Generator",u))}}function assertGeneratorFunction(u,A){if(!isGeneratorFunction(u)){throw new TypeError(A??typeErrorMessage("GeneratorFunction",u))}}function assertHtmlElement(u,A){if(!isHtmlElement(u)){throw new TypeError(A??typeErrorMessage("HTMLElement",u))}}function assertInfinite(u,A){if(!isInfinite(u)){throw new TypeError(A??typeErrorMessage("infinite number",u))}}function assertInRange(u,A,p){if(!isInRange(u,A)){throw new TypeError(p??typeErrorMessage("in range",u))}}function assertInt16Array(u,A){if(!isInt16Array(u)){throw new TypeError(A??typeErrorMessage("Int16Array",u))}}function assertInt32Array(u,A){if(!isInt32Array(u)){throw new TypeError(A??typeErrorMessage("Int32Array",u))}}function assertInt8Array(u,A){if(!isInt8Array(u)){throw new TypeError(A??typeErrorMessage("Int8Array",u))}}function assertInteger(u,A){if(!isInteger(u)){throw new TypeError(A??typeErrorMessage("integer",u))}}function assertIterable(u,A){if(!isIterable(u)){throw new TypeError(A??typeErrorMessage("Iterable",u))}}function assertMap(u,A){if(!isMap(u)){throw new TypeError(A??typeErrorMessage("Map",u))}}function assertNan(u,A){if(!isNan(u)){throw new TypeError(A??typeErrorMessage("NaN",u))}}function assertNativePromise(u,A){if(!isNativePromise(u)){throw new TypeError(A??typeErrorMessage("native Promise",u))}}function assertNegativeNumber(u,A){if(!isNegativeNumber(u)){throw new TypeError(A??typeErrorMessage("negative number",u))}}function assertNodeStream(u,A){if(!isNodeStream(u)){throw new TypeError(A??typeErrorMessage("Node.js Stream",u))}}function assertNonEmptyArray(u,A){if(!isNonEmptyArray(u)){throw new TypeError(A??typeErrorMessage("non-empty array",u))}}function assertNonEmptyMap(u,A){if(!isNonEmptyMap(u)){throw new TypeError(A??typeErrorMessage("non-empty map",u))}}function assertNonEmptyObject(u,A){if(!isNonEmptyObject(u)){throw new TypeError(A??typeErrorMessage("non-empty object",u))}}function assertNonEmptySet(u,A){if(!isNonEmptySet(u)){throw new TypeError(A??typeErrorMessage("non-empty set",u))}}function assertNonEmptyString(u,A){if(!isNonEmptyString(u)){throw new TypeError(A??typeErrorMessage("non-empty string",u))}}function assertNonEmptyStringAndNotWhitespace(u,A){if(!isNonEmptyStringAndNotWhitespace(u)){throw new TypeError(A??typeErrorMessage("non-empty string and not whitespace",u))}}function assertNull(u,A){if(!isNull(u)){throw new TypeError(A??typeErrorMessage("null",u))}}function assertNullOrUndefined(u,A){if(!isNullOrUndefined(u)){throw new TypeError(A??typeErrorMessage("null or undefined",u))}}function assertNumber(u,A){if(!isNumber(u)){throw new TypeError(A??typeErrorMessage("number",u))}}function assertNumericString(u,A){if(!isNumericString(u)){throw new TypeError(A??typeErrorMessage("string with a number",u))}}function assertObject(u,A){if(!distribution_isObject(u)){throw new TypeError(A??typeErrorMessage("Object",u))}}function assertObservable(u,A){if(!isObservable(u)){throw new TypeError(A??typeErrorMessage("Observable",u))}}function assertOddInteger(u,A){if(!isOddInteger(u)){throw new TypeError(A??typeErrorMessage("odd integer",u))}}function assertPlainObject(u,A){if(!distribution_isPlainObject(u)){throw new TypeError(A??typeErrorMessage("plain object",u))}}function assertPositiveNumber(u,A){if(!isPositiveNumber(u)){throw new TypeError(A??typeErrorMessage("positive number",u))}}function assertPrimitive(u,A){if(!isPrimitive(u)){throw new TypeError(A??typeErrorMessage("primitive",u))}}function assertPromise(u,A){if(!isPromise(u)){throw new TypeError(A??typeErrorMessage("Promise",u))}}function assertPropertyKey(u,A){if(!isPropertyKey(u)){throw new TypeError(A??typeErrorMessage("PropertyKey",u))}}function assertRegExp(u,A){if(!isRegExp(u)){throw new TypeError(A??typeErrorMessage("RegExp",u))}}function assertSafeInteger(u,A){if(!isSafeInteger(u)){throw new TypeError(A??typeErrorMessage("integer",u))}}function assertSet(u,A){if(!isSet(u)){throw new TypeError(A??typeErrorMessage("Set",u))}}function assertSharedArrayBuffer(u,A){if(!isSharedArrayBuffer(u)){throw new TypeError(A??typeErrorMessage("SharedArrayBuffer",u))}}function assertString(u,A){if(!isString(u)){throw new TypeError(A??typeErrorMessage("string",u))}}function assertSymbol(u,A){if(!isSymbol(u)){throw new TypeError(A??typeErrorMessage("symbol",u))}}function assertTruthy(u,A){if(!isTruthy(u)){throw new TypeError(A??typeErrorMessage("truthy",u))}}function assertTupleLike(u,A,p){if(!isTupleLike(u,A)){throw new TypeError(p??typeErrorMessage("tuple-like",u))}}function assertTypedArray(u,A){if(!isTypedArray(u)){throw new TypeError(A??typeErrorMessage("TypedArray",u))}}function assertUint16Array(u,A){if(!isUint16Array(u)){throw new TypeError(A??typeErrorMessage("Uint16Array",u))}}function assertUint32Array(u,A){if(!isUint32Array(u)){throw new TypeError(A??typeErrorMessage("Uint32Array",u))}}function assertUint8Array(u,A){if(!distribution_isUint8Array(u)){throw new TypeError(A??typeErrorMessage("Uint8Array",u))}}function assertUint8ClampedArray(u,A){if(!isUint8ClampedArray(u)){throw new TypeError(A??typeErrorMessage("Uint8ClampedArray",u))}}function assertUndefined(u,A){if(!isUndefined(u)){throw new TypeError(A??typeErrorMessage("undefined",u))}}function assertUrlInstance(u,A){if(!isUrlInstance(u)){throw new TypeError(A??typeErrorMessage("URL",u))}}function assertUrlSearchParams(u,A){if(!isUrlSearchParams(u)){throw new TypeError(A??typeErrorMessage("URLSearchParams",u))}}function assertUrlString(u,A){if(!isUrlString(u)){throw new TypeError(A??typeErrorMessage("string with a URL",u))}}function assertValidDate(u,A){if(!isValidDate(u)){throw new TypeError(A??typeErrorMessage("valid Date",u))}}function assertValidLength(u,A){if(!isValidLength(u)){throw new TypeError(A??typeErrorMessage("valid length",u))}}function assertWeakMap(u,A){if(!isWeakMap(u)){throw new TypeError(A??typeErrorMessage("WeakMap",u))}}function assertWeakRef(u,A){if(!isWeakRef(u)){throw new TypeError(A??typeErrorMessage("WeakRef",u))}}function assertWeakSet(u,A){if(!isWeakSet(u)){throw new TypeError(A??typeErrorMessage("WeakSet",u))}}function assertWhitespaceString(u,A){if(!isWhitespaceString(u)){throw new TypeError(A??typeErrorMessage("whitespace string",u))}}const Pi=Qi;class CancelError extends Error{constructor(u){super(u||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}const Oi=Object.freeze({pending:Symbol("pending"),canceled:Symbol("canceled"),resolved:Symbol("resolved"),rejected:Symbol("rejected")});class PCancelable{static fn(u){return(...A)=>new PCancelable(((p,y,E)=>{A.push(E);u(...A).then(p,y)}))}#Ot=[];#Mt=true;#Ut=Oi.pending;#Ht;#Gt;constructor(u){this.#Ht=new Promise(((A,p)=>{this.#Gt=p;const onResolve=u=>{if(this.#Ut!==Oi.canceled||!onCancel.shouldReject){A(u);this.#Wt(Oi.resolved)}};const onReject=u=>{if(this.#Ut!==Oi.canceled||!onCancel.shouldReject){p(u);this.#Wt(Oi.rejected)}};const onCancel=u=>{if(this.#Ut!==Oi.pending){throw new Error(`The \`onCancel\` handler was attached after the promise ${this.#Ut.description}.`)}this.#Ot.push(u)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this.#Mt,set:u=>{this.#Mt=u}}});u(onResolve,onReject,onCancel)}))}then(u,A){return this.#Ht.then(u,A)}catch(u){return this.#Ht.catch(u)}finally(u){return this.#Ht.finally(u)}cancel(u){if(this.#Ut!==Oi.pending){return}this.#Wt(Oi.canceled);if(this.#Ot.length>0){try{for(const u of this.#Ot){u()}}catch(u){this.#Gt(u);return}}if(this.#Mt){this.#Gt(new CancelError(u))}}get isCanceled(){return this.#Ut===Oi.canceled}#Wt(u){if(this.#Ut===Oi.pending){this.#Ut=u}}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(u){return Pi.object(u)&&"_onResponse"in u}class RequestError extends Error{name="RequestError";code="ERR_GOT_REQUEST_ERROR";input;stack;response;request;timings;constructor(u,A,p){super(u,{cause:A});Error.captureStackTrace(this,this.constructor);if(A.code){this.code=A.code}this.input=A.input;if(isRequest(p)){Object.defineProperty(this,"request",{enumerable:false,value:p});Object.defineProperty(this,"response",{enumerable:false,value:p.response});this.options=p.options}else{this.options=p}this.timings=this.request?.timings;if(Pi.string(A.stack)&&Pi.string(this.stack)){const u=this.stack.indexOf(this.message)+this.message.length;const p=this.stack.slice(u).split("\n").reverse();const y=A.stack.slice(A.stack.indexOf(A.message)+A.message.length).split("\n").reverse();while(y.length>0&&y[0]===p[0]){p.shift()}this.stack=`${this.stack.slice(0,u)}${p.reverse().join("\n")}${y.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{name="MaxRedirectsError";code="ERR_TOO_MANY_REDIRECTS";constructor(u){super(`Redirected ${u.options.maxRedirects} times. Aborting.`,{},u)}}class HTTPError extends RequestError{name="HTTPError";code="ERR_NON_2XX_3XX_RESPONSE";constructor(u){super(`Request failed with status code ${u.statusCode} (${u.statusMessage}): ${u.request.options.method} ${u.request.options.url.toString()}`,{},u.request)}}class CacheError extends RequestError{name="CacheError";constructor(u,A){super(u.message,u,A);if(this.code==="ERR_GOT_REQUEST_ERROR"){this.code="ERR_CACHE_ACCESS"}}}class UploadError extends RequestError{name="UploadError";constructor(u,A){super(u.message,u,A);if(this.code==="ERR_GOT_REQUEST_ERROR"){this.code="ERR_UPLOAD"}}}class TimeoutError extends RequestError{name="TimeoutError";timings;event;constructor(u,A,p){super(u.message,u,p);this.event=u.event;this.timings=A}}class ReadError extends RequestError{name="ReadError";constructor(u,A){super(u.message,u,A);if(this.code==="ERR_GOT_REQUEST_ERROR"){this.code="ERR_READING_RESPONSE_STREAM"}}}class RetryError extends RequestError{name="RetryError";code="ERR_RETRYING";constructor(u){super("Retrying",{},u)}}class AbortError extends RequestError{name="AbortError";code="ERR_ABORTED";constructor(u){super("This operation was aborted.",{},u)}}const Mi=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:http");const Ui=new TextEncoder;function byteLength(u){if(typeof u==="string"){return Ui.encode(u).byteLength}if(ArrayBuffer.isView(u)||u instanceof ArrayBuffer||u instanceof SharedArrayBuffer){return u.byteLength}return 0}const Hi=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");async function getStreamAsBuffer(u,A){if(!("Buffer"in globalThis)){throw new Error("getStreamAsBuffer() is only supported in Node.js")}try{return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(u,A))}catch(u){if(u.bufferedData!==undefined){u.bufferedData=arrayBufferToNodeBuffer(u.bufferedData)}throw u}}const arrayBufferToNodeBuffer=u=>globalThis.Buffer.from(u);var Gi=p(4625);var Wi=p(181);var _serialize=(u,A=true)=>{if(u===void 0||u===null){return"null"}if(typeof u==="string"){return JSON.stringify(A&&u.startsWith(":")?`:${u}`:u)}if(Wi.Buffer.isBuffer(u)){return JSON.stringify(`:base64:${u.toString("base64")}`)}if(u?.toJSON){u=u.toJSON()}if(typeof u==="object"){let p="";const y=Array.isArray(u);p=y?"[":"{";let E=true;for(const C in u){const I=typeof u[C]==="function"||!y&&u[C]===void 0;if(!Object.hasOwn(u,C)||I){continue}if(!E){p+=","}E=false;if(y){p+=_serialize(u[C],A)}else if(u[C]!==void 0){p+=`${_serialize(C,false)}:${_serialize(u[C],A)}`}}p+=y?"]":"}";return p}return JSON.stringify(u)};var defaultSerialize=u=>_serialize(u,true);var defaultDeserialize=u=>JSON.parse(u,((u,A)=>{if(typeof A==="string"){if(A.startsWith(":base64:")){return Wi.Buffer.from(A.slice(8),"base64")}return A.startsWith(":")?A.slice(1):A}return A}));var ji=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map;this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(u,A){this.on(u,A)}on(u,A){if(!this._eventListeners.has(u)){this._eventListeners.set(u,[])}const p=this._eventListeners.get(u);if(p){if(p.length>=this._maxListeners){console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${p.length+1} ${u} listeners added. Use setMaxListeners() to increase limit.`)}p.push(A)}return this}removeListener(u,A){this.off(u,A)}off(u,A){const p=this._eventListeners.get(u)??[];const y=p.indexOf(A);if(y!==-1){p.splice(y,1)}if(p.length===0){this._eventListeners.delete(u)}}once(u,A){const onceListener=(...p)=>{A(...p);this.off(u,onceListener)};this.on(u,onceListener)}emit(u,...A){const p=this._eventListeners.get(u);if(p&&p.length>0){for(const u of p){u(...A)}}}listeners(u){return this._eventListeners.get(u)??[]}removeAllListeners(u){if(u){this._eventListeners.delete(u)}else{this._eventListeners.clear()}}setMaxListeners(u){this._maxListeners=u}};var zi=ji;var $i=class extends zi{_hookHandlers;constructor(){super();this._hookHandlers=new Map}addHandler(u,A){const p=this._hookHandlers.get(u);if(p){p.push(A)}else{this._hookHandlers.set(u,[A])}}removeHandler(u,A){const p=this._hookHandlers.get(u);if(p){const u=p.indexOf(A);if(u!==-1){p.splice(u,1)}}}trigger(u,A){const p=this._hookHandlers.get(u);if(p){for(const y of p){try{y(A)}catch(A){this.emit("error",new Error(`Error in hook handler for event "${u}": ${A.message}`))}}}}get handlers(){return new Map(this._hookHandlers)}};var qi=$i;var Vi=class extends zi{enabled=true;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(u){super();if(u!==void 0){this.enabled=u}this.reset()}hit(){if(this.enabled){this.hits++}}miss(){if(this.enabled){this.misses++}}set(){if(this.enabled){this.sets++}}delete(){if(this.enabled){this.deletes++}}hitsOrMisses(u){for(const A of u){if(A===void 0){this.miss()}else{this.hit()}}}reset(){this.hits=0;this.misses=0;this.sets=0;this.deletes=0;this.errors=0}};var Ki=Vi;var Ji=(u=>{u["PRE_SET"]="preSet";u["POST_SET"]="postSet";u["PRE_GET"]="preGet";u["POST_GET"]="postGet";u["PRE_GET_MANY"]="preGetMany";u["POST_GET_MANY"]="postGetMany";u["PRE_GET_RAW"]="preGetRaw";u["POST_GET_RAW"]="postGetRaw";u["PRE_GET_MANY_RAW"]="preGetManyRaw";u["POST_GET_MANY_RAW"]="postGetManyRaw";u["PRE_DELETE"]="preDelete";u["POST_DELETE"]="postDelete";return u})(Ji||{});var Yi=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"];var Xi=class extends zi{opts;iterator;hooks=new qi;stats=new Ki(false);_ttl;_namespace;_store=new Map;_serialize=defaultSerialize;_deserialize=defaultDeserialize;_compression;_useKeyPrefix=true;_throwOnErrors=false;constructor(u,A){super();A??={};u??={};this.opts={namespace:"keyv",serialize:defaultSerialize,deserialize:defaultDeserialize,emitErrors:true,store:new Map,...A};if(u&&u.get){this.opts.store=u}else{this.opts={...this.opts,...u}}this._store=this.opts.store??new Map;this._compression=this.opts.compression;this._serialize=this.opts.serialize;this._deserialize=this.opts.deserialize;if(this.opts.namespace){this._namespace=this.opts.namespace}if(this._store){if(!this._isValidStorageAdapter(this._store)){throw new Error("Invalid storage adapter")}if(typeof this._store.on==="function"){this._store.on("error",(u=>this.emit("error",u)))}this._store.namespace=this._namespace;if(typeof this._store[Symbol.iterator]==="function"&&this._store instanceof Map){this.iterator=this.generateIterator(this._store)}else if("iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()){this.iterator=this.generateIterator(this._store.iterator.bind(this._store))}}if(this.opts.stats){this.stats.enabled=this.opts.stats}if(this.opts.ttl){this._ttl=this.opts.ttl}if(this.opts.useKeyPrefix!==void 0){this._useKeyPrefix=this.opts.useKeyPrefix}if(this.opts.throwOnErrors!==void 0){this._throwOnErrors=this.opts.throwOnErrors}}get store(){return this._store}set store(u){if(this._isValidStorageAdapter(u)){this._store=u;this.opts.store=u;if(typeof u.on==="function"){u.on("error",(u=>this.emit("error",u)))}if(this._namespace){this._store.namespace=this._namespace}if(typeof u[Symbol.iterator]==="function"&&u instanceof Map){this.iterator=this.generateIterator(u)}else if("iterator"in u&&u.opts&&this._checkIterableAdapter()){this.iterator=this.generateIterator(u.iterator?.bind(u))}}else{throw new Error("Invalid storage adapter")}}get compression(){return this._compression}set compression(u){this._compression=u}get namespace(){return this._namespace}set namespace(u){this._namespace=u;this.opts.namespace=u;this._store.namespace=u;if(this.opts.store){this.opts.store.namespace=u}}get ttl(){return this._ttl}set ttl(u){this.opts.ttl=u;this._ttl=u}get serialize(){return this._serialize}set serialize(u){this.opts.serialize=u;this._serialize=u}get deserialize(){return this._deserialize}set deserialize(u){this.opts.deserialize=u;this._deserialize=u}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(u){this._useKeyPrefix=u;this.opts.useKeyPrefix=u}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(u){this._throwOnErrors=u;this.opts.throwOnErrors=u}generateIterator(u){const function_=async function*(){for await(const[A,p]of typeof u==="function"?u(this._store.namespace):u){const u=await this.deserializeData(p);if(this._useKeyPrefix&&this._store.namespace&&!A.includes(this._store.namespace)){continue}if(typeof u.expires==="number"&&Date.now()>u.expires){this.delete(A);continue}yield[this._getKeyUnprefix(A),u.value]}};return function_.bind(this)}_checkIterableAdapter(){return Yi.includes(this._store.opts.dialect)||Yi.some((u=>this._store.opts.url.includes(u)))}_getKeyPrefix(u){if(!this._useKeyPrefix){return u}if(!this._namespace){return u}return`${this._namespace}:${u}`}_getKeyPrefixArray(u){if(!this._useKeyPrefix){return u}if(!this._namespace){return u}return u.map((u=>`${this._namespace}:${u}`))}_getKeyUnprefix(u){if(!this._useKeyPrefix){return u}return u.split(":").splice(1).join(":")}_isValidStorageAdapter(u){return u instanceof Map||typeof u.get==="function"&&typeof u.set==="function"&&typeof u.delete==="function"&&typeof u.clear==="function"}async get(u,A){const{store:p}=this.opts;const y=Array.isArray(u);const E=y?this._getKeyPrefixArray(u):this._getKeyPrefix(u);const isDataExpired=u=>typeof u.expires==="number"&&Date.now()>u.expires;if(y){if(A?.raw===true){return this.getMany(u,{raw:true})}return this.getMany(u,{raw:false})}this.hooks.trigger("preGet",{key:E});let C;try{C=await p.get(E)}catch(u){if(this.throwOnErrors){throw u}}const I=typeof C==="string"||this.opts.compression?await this.deserializeData(C):C;if(I===void 0||I===null){this.hooks.trigger("postGet",{key:E,value:void 0});this.stats.miss();return void 0}if(isDataExpired(I)){await this.delete(u);this.hooks.trigger("postGet",{key:E,value:void 0});this.stats.miss();return void 0}this.hooks.trigger("postGet",{key:E,value:I});this.stats.hit();return A?.raw?I:I.value}async getMany(u,A){const{store:p}=this.opts;const y=this._getKeyPrefixArray(u);const isDataExpired=u=>typeof u.expires==="number"&&Date.now()>u.expires;this.hooks.trigger("preGetMany",{keys:y});if(p.getMany===void 0){const u=y.map((async u=>{const y=await p.get(u);const E=typeof y==="string"||this.opts.compression?await this.deserializeData(y):y;if(E===void 0||E===null){return void 0}if(isDataExpired(E)){await this.delete(u);return void 0}return A?.raw?E:E.value}));const E=await Promise.allSettled(u);const C=E.map((u=>u.value));this.hooks.trigger("postGetMany",C);if(C.length>0){this.stats.hit()}return C}const E=await p.getMany(y);const C=[];const I=[];for(const p in E){let y=E[p];if(typeof y==="string"){y=await this.deserializeData(y)}if(y===void 0||y===null){C.push(void 0);continue}if(isDataExpired(y)){I.push(u[p]);C.push(void 0);continue}const w=A?.raw?y:y.value;C.push(w)}if(I.length>0){await this.deleteMany(I)}this.hooks.trigger("postGetMany",C);if(C.length>0){this.stats.hit()}return C}async getRaw(u){const{store:A}=this.opts;const p=this._getKeyPrefix(u);this.hooks.trigger("preGetRaw",{key:p});const y=await A.get(p);if(y===void 0||y===null){this.hooks.trigger("postGetRaw",{key:p,value:void 0});this.stats.miss();return void 0}const E=typeof y==="string"||this.opts.compression?await this.deserializeData(y):y;if(E!==void 0&&E.expires!==void 0&&E.expires!==null&&E.expires<Date.now()){this.hooks.trigger("postGetRaw",{key:p,value:void 0});this.stats.miss();await this.delete(u);return void 0}this.stats.hit();this.hooks.trigger("postGetRaw",{key:p,value:E});return E}async getManyRaw(u){const{store:A}=this.opts;const p=this._getKeyPrefixArray(u);if(u.length===0){const A=Array.from({length:u.length}).fill(void 0);this.stats.misses+=u.length;this.hooks.trigger("postGetManyRaw",{keys:p,values:A});return A}let y=[];if(A.getMany===void 0){const u=p.map((async u=>{const p=await A.get(u);if(p!==void 0&&p!==null){return this.deserializeData(p)}return void 0}));const E=await Promise.allSettled(u);y=E.map((u=>u.value))}else{const u=await A.getMany(p);for(const A of u){if(A!==void 0&&A!==null){y.push(await this.deserializeData(A))}else{y.push(void 0)}}}const E=[];const isDataExpired=u=>typeof u.expires==="number"&&Date.now()>u.expires;for(const[u,A]of y.entries()){if(A!==void 0&&isDataExpired(A)){E.push(p[u]);y[u]=void 0}}if(E.length>0){await this.deleteMany(E)}this.stats.hitsOrMisses(y);this.hooks.trigger("postGetManyRaw",{keys:p,values:y});return y}async set(u,A,p){const y={key:u,value:A,ttl:p};this.hooks.trigger("preSet",y);const E=this._getKeyPrefix(y.key);y.ttl??=this._ttl;if(y.ttl===0){y.ttl=void 0}const{store:C}=this.opts;const I=typeof y.ttl==="number"?Date.now()+y.ttl:void 0;if(typeof y.value==="symbol"){this.emit("error","symbol cannot be serialized");throw new Error("symbol cannot be serialized")}const w={value:y.value,expires:I};const v=await this.serializeData(w);let B=true;try{const u=await C.set(E,v,y.ttl);if(typeof u==="boolean"){B=u}}catch(u){B=false;this.emit("error",u);if(this._throwOnErrors){throw u}}this.hooks.trigger("postSet",{key:E,value:v,ttl:p});this.stats.set();return B}async setMany(u){let A=[];try{if(this._store.setMany===void 0){const p=[];for(const A of u){p.push(this.set(A.key,A.value,A.ttl))}const y=await Promise.all(p);A=y}else{const p=await Promise.all(u.map((async({key:u,value:A,ttl:p})=>{p??=this._ttl;if(p===0){p=void 0}const y=typeof p==="number"?Date.now()+p:void 0;if(typeof A==="symbol"){this.emit("error","symbol cannot be serialized");throw new Error("symbol cannot be serialized")}const E={value:A,expires:y};const C=await this.serializeData(E);const I=this._getKeyPrefix(u);return{key:I,value:C,ttl:p}})));A=await this._store.setMany(p)}}catch(p){this.emit("error",p);if(this._throwOnErrors){throw p}A=u.map((()=>false))}return A}async delete(u){const{store:A}=this.opts;if(Array.isArray(u)){return this.deleteMany(u)}const p=this._getKeyPrefix(u);this.hooks.trigger("preDelete",{key:p});let y=true;try{const u=await A.delete(p);if(typeof u==="boolean"){y=u}}catch(u){y=false;this.emit("error",u);if(this._throwOnErrors){throw u}}this.hooks.trigger("postDelete",{key:p,value:y});this.stats.delete();return y}async deleteMany(u){try{const{store:A}=this.opts;const p=this._getKeyPrefixArray(u);this.hooks.trigger("preDelete",{key:p});if(A.deleteMany!==void 0){return await A.deleteMany(p)}const y=p.map((async u=>A.delete(u)));const E=await Promise.all(y);const C=E.every(Boolean);this.hooks.trigger("postDelete",{key:p,value:C});return C}catch(u){this.emit("error",u);if(this._throwOnErrors){throw u}return false}}async clear(){this.emit("clear");const{store:u}=this.opts;try{await u.clear()}catch(u){this.emit("error",u);if(this._throwOnErrors){throw u}}}async has(u){if(Array.isArray(u)){return this.hasMany(u)}const A=this._getKeyPrefix(u);const{store:p}=this.opts;if(p.has!==void 0&&!(p instanceof Map)){return p.has(A)}let y;try{y=await p.get(A)}catch(u){this.emit("error",u);if(this._throwOnErrors){throw u}return false}if(y){const u=await this.deserializeData(y);if(u){if(u.expires===void 0||u.expires===null){return true}return u.expires>Date.now()}}return false}async hasMany(u){const A=this._getKeyPrefixArray(u);const{store:p}=this.opts;if(p.hasMany!==void 0){return p.hasMany(A)}const y=[];for(const A of u){y.push(await this.has(A))}return y}async disconnect(){const{store:u}=this.opts;this.emit("disconnect");if(typeof u.disconnect==="function"){return u.disconnect()}}emit(u,...A){if(u==="error"&&!this.opts.emitErrors){return}super.emit(u,...A)}async serializeData(u){if(!this._serialize){return u}if(this._compression?.compress){return this._serialize({value:await this._compression.compress(u.value),expires:u.expires})}return this._serialize(u)}async deserializeData(u){if(!this._deserialize){return u}if(this._compression?.decompress&&typeof u==="string"){const A=await this._deserialize(u);return{value:await this._compression.decompress(A?.value),expires:A?.expires}}if(typeof u==="string"){return this._deserialize(u)}return void 0}};var Zi=null&&Xi;
100
100
  /* v8 ignore next -- @preserve */const eo=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function mimicResponse(u,A){if(A._readableState.autoDestroy){throw new Error("The second stream must have the `autoDestroy` option set to `false`")}const p=new Set([...Object.keys(u),...eo]);const y={};for(const E of p){if(E in A){continue}y[E]={get(){const A=u[E];const p=typeof A==="function";return p?A.bind(u):A},set(A){u[E]=A},enumerable:true,configurable:false}}Object.defineProperties(A,y);u.once("aborted",(()=>{A.destroy();A.emit("aborted")}));u.once("close",(()=>{if(u.complete){if(A.readable){A.once("end",(()=>{A.emit("close")}))}else{A.emit("close")}}else{A.emit("close")}}));return A}const to="text/plain";const no="us-ascii";const testParameter=(u,A)=>A.some((A=>A instanceof RegExp?A.test(u):A===u));const ro=new Set(["https:","http:","file:"]);const hasCustomProtocol=u=>{try{const{protocol:A}=new URL(u);return A.endsWith(":")&&!A.includes(".")&&!ro.has(A)}catch{return false}};const normalizeDataURL=(u,{stripHash:A})=>{const p=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(u);if(!p){throw new Error(`Invalid URL: ${u}`)}const{type:y,data:E,hash:C}=p.groups;const I=y.split(";");const w=I.at(-1)==="base64";if(w){I.pop()}const v=I.shift()?.toLowerCase()??"";const B=I.map((u=>{let[A,p=""]=u.split("=").map((u=>u.trim()));if(A==="charset"){p=p.toLowerCase();if(p===no){return""}}return`${A}${p?`=${p}`:""}`})).filter(Boolean);const S=[...B];if(w){S.push("base64")}if(S.length>0||v&&v!==to){S.unshift(v)}const D=A||!C?"":`#${C}`;return`data:${S.join(";")},${w?E.trim():E}${D}`};function normalizeUrl(u,A){A={defaultProtocol:"http",normalizeProtocol:true,forceHttp:false,forceHttps:false,stripAuthentication:true,stripHash:false,stripTextFragment:true,stripWWW:true,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:true,removeSingleSlash:true,removeDirectoryIndex:false,removeExplicitPort:false,sortQueryParameters:true,removePath:false,transformPath:false,...A};if(typeof A.defaultProtocol==="string"&&!A.defaultProtocol.endsWith(":")){A.defaultProtocol=`${A.defaultProtocol}:`}u=u.trim();if(/^data:/i.test(u)){return normalizeDataURL(u,A)}if(hasCustomProtocol(u)){return u}const p=u.startsWith("//");const y=!p&&/^\.*\//.test(u);if(!y){u=u.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,A.defaultProtocol)}const E=new URL(u);if(A.forceHttp&&A.forceHttps){throw new Error("The `forceHttp` and `forceHttps` options cannot be used together")}if(A.forceHttp&&E.protocol==="https:"){E.protocol="http:"}if(A.forceHttps&&E.protocol==="http:"){E.protocol="https:"}if(A.stripAuthentication){E.username="";E.password=""}if(A.stripHash){E.hash=""}else if(A.stripTextFragment){E.hash=E.hash.replace(/#?:~:text.*?$/i,"")}if(E.pathname){const u=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let A=0;let p="";for(;;){const y=u.exec(E.pathname);if(!y){break}const C=y[0];const I=y.index;const w=E.pathname.slice(A,I);p+=w.replace(/\/{2,}/g,"/");p+=C;A=I+C.length}const y=E.pathname.slice(A,E.pathname.length);p+=y.replace(/\/{2,}/g,"/");E.pathname=p}if(E.pathname){try{E.pathname=decodeURI(E.pathname).replace(/\\/g,"%5C")}catch{}}if(A.removeDirectoryIndex===true){A.removeDirectoryIndex=[/^index\.[a-z]+$/]}if(Array.isArray(A.removeDirectoryIndex)&&A.removeDirectoryIndex.length>0){const u=E.pathname.split("/").filter(Boolean);const p=u.at(-1);if(p&&testParameter(p,A.removeDirectoryIndex)){u.pop();E.pathname=u.length>0?`/${u.join("/")}/`:"/"}}if(A.removePath){E.pathname="/"}if(A.transformPath&&typeof A.transformPath==="function"){const u=E.pathname.split("/").filter(Boolean);const p=A.transformPath(u);E.pathname=p?.length>0?`/${p.join("/")}`:"/"}if(E.hostname){E.hostname=E.hostname.replace(/\.$/,"");if(A.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(E.hostname)){E.hostname=E.hostname.replace(/^www\./,"")}}if(Array.isArray(A.removeQueryParameters)){for(const u of[...E.searchParams.keys()]){if(testParameter(u,A.removeQueryParameters)){E.searchParams.delete(u)}}}if(!Array.isArray(A.keepQueryParameters)&&A.removeQueryParameters===true){E.search=""}if(Array.isArray(A.keepQueryParameters)&&A.keepQueryParameters.length>0){for(const u of[...E.searchParams.keys()]){if(!testParameter(u,A.keepQueryParameters)){E.searchParams.delete(u)}}}if(A.sortQueryParameters){const u=E.search;E.searchParams.sort();try{E.search=decodeURIComponent(E.search)}catch{}const A=u.slice(1).split("&").filter((u=>u&&!u.includes("=")));for(const u of A){const A=decodeURIComponent(u);E.search=E.search.replace(`?${A}=`,`?${A}`).replace(`&${A}=`,`&${A}`)}}if(A.removeTrailingSlash){E.pathname=E.pathname.replace(/\/$/,"")}if(A.removeExplicitPort&&E.port){E.port=""}const C=u;u=E.toString();if(!A.removeSingleSlash&&E.pathname==="/"&&!C.endsWith("/")&&E.hash===""){u=u.replace(/\/$/,"")}if((A.removeTrailingSlash||E.pathname==="/")&&E.hash===""&&A.removeSingleSlash){u=u.replace(/\/$/,"")}if(p&&!A.normalizeProtocol){u=u.replace(/^http:\/\//,"//")}if(A.stripProtocol){u=u.replace(/^(?:https?:)?\/\//,"")}return u}function lowercaseKeys(u){return Object.fromEntries(Object.entries(u).map((([u,A])=>[u.toLowerCase(),A])))}class Response extends Pe.Readable{statusCode;headers;body;url;complete;constructor({statusCode:u,headers:A,body:p,url:y}){if(typeof u!=="number"){throw new TypeError("Argument `statusCode` should be a number")}if(typeof A!=="object"){throw new TypeError("Argument `headers` should be an object")}if(!(p instanceof Uint8Array)){throw new TypeError("Argument `body` should be a buffer")}if(typeof y!=="string"){throw new TypeError("Argument `url` should be a string")}let E=false;super({read(){if(!E){E=true;this.push(p);return}this.push(null)}});this.statusCode=u;this.headers=lowercaseKeys(A);this.body=p;this.url=y;this.complete=true}}class types_RequestError extends Error{constructor(u){super(u.message);Object.defineProperties(this,Object.getOwnPropertyDescriptors(u))}}class types_CacheError extends Error{constructor(u){super(u.message);Object.defineProperties(this,Object.getOwnPropertyDescriptors(u))}}class CacheableRequest{constructor(u,A){this.cache=new Xi({namespace:"cacheable-request"});this.hooks=new Map;this.request=()=>(u,A)=>{let p;if(typeof u==="string"){p=normalizeUrlObject(parseWithWhatwg(u));u={}}else if(u instanceof we.URL){p=normalizeUrlObject(parseWithWhatwg(u.toString()));u={}}else{const[A,...y]=(u.path??"").split("?");const E=y.length>0?`?${y.join("?")}`:"";p=normalizeUrlObject({...u,pathname:A,search:E})}u={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...u,...urlObjectToRequestOptions(p)};u.headers=Object.fromEntries(so(u.headers).map((([u,A])=>[u.toLowerCase(),A])));const y=new Le;const E=normalizeUrl(we.format(p),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});let C=`${u.method}:${E}`;if(u.body&&u.method!==undefined&&["POST","PATCH","PUT"].includes(u.method)){if(u.body instanceof Pe.Readable){u.cache=false}else{C+=`:${Hi.createHash("md5").update(u.body).digest("hex")}`}}let I=false;let w=false;const makeRequest=u=>{w=true;let p=false;let requestErrorCallback=()=>{};const E=new Promise((u=>{requestErrorCallback=()=>{if(!p){p=true;u()}}}));const handler=async p=>{if(I){p.status=p.statusCode;const A=Gi.fromObject(I.cachePolicy);const y=A.revalidatedPolicy(u,p);if(!y.modified){p.resume();await new Promise((u=>{p.once("end",u)}));const u=convertHeaders(y.policy.responseHeaders());const E=convertHeaders(A.responseHeaders());const C=["content-encoding","content-type","content-length","content-language","content-location","etag"];for(const A of C){if(E[A]!==undefined&&u[A]===undefined){u[A]=E[A]}}p=new Response({statusCode:I.statusCode,headers:u,body:I.body,url:I.url});p.cachePolicy=y.policy;p.fromCache=true}}if(!p.fromCache){p.cachePolicy=new Gi(u,p,u);p.fromCache=false}let w;if(u.cache&&p.cachePolicy.storable()){w=cloneResponse(p);(async()=>{try{const A=getStreamAsBuffer(p);await Promise.race([E,new Promise((u=>p.once("end",u))),new Promise((u=>p.once("close",u)))]);const y=await A;let w={url:p.url,statusCode:p.fromCache?I.statusCode:p.statusCode,body:y,cachePolicy:p.cachePolicy.toObject()};let v=u.strictTtl?p.cachePolicy.timeToLive():undefined;if(u.maxTtl){v=v?Math.min(v,u.maxTtl):u.maxTtl}if(this.hooks.size>0){for(const u of this.hooks.keys()){w=await this.runHook(u,w,p)}}await this.cache.set(C,w,v);
101
101
  /* c8 ignore next -- @preserve */}catch(u){
102
102
  /* c8 ignore next -- @preserve */
@@ -107,7 +107,7 @@ y.emit("error",new types_CacheError(u));
107
107
  y.emit("error",new types_CacheError(u));
108
108
  /* c8 ignore next -- @preserve */}})()}y.emit("response",w??p);if(typeof A==="function"){A(w??p)}};try{const A=this.cacheRequest(u,handler);A.once("error",requestErrorCallback);A.once("abort",requestErrorCallback);A.once("destroy",requestErrorCallback);y.emit("request",A)}catch(u){y.emit("error",new types_RequestError(u))}};(async()=>{const get=async u=>{await Promise.resolve();const p=u.cache?await this.cache.get(C):undefined;if(p===undefined&&!u.forceRefresh){makeRequest(u);return}const E=Gi.fromObject(p.cachePolicy);if(E.satisfiesWithoutRevalidation(u)&&!u.forceRefresh){const u=convertHeaders(E.responseHeaders());const C=p.body;const I=Buffer.from(C);const w=new Response({statusCode:p.statusCode,headers:u,body:I,url:p.url});w.cachePolicy=E;w.fromCache=true;y.emit("response",w);if(typeof A==="function"){A(w)}}else if(E.satisfiesWithoutRevalidation(u)&&Date.now()>=E.timeToLive()&&u.forceRefresh){await this.cache.delete(C);u.headers=E.revalidationHeaders(u);makeRequest(u)}else{I=p;u.headers=E.revalidationHeaders(u);makeRequest(u)}};const errorHandler=u=>y.emit("error",new types_CacheError(u));if(this.cache instanceof Xi){const u=this.cache;u.once("error",errorHandler);y.on("error",(()=>{u.removeListener("error",errorHandler)}));y.on("response",(()=>{u.removeListener("error",errorHandler)}))}try{await get(u)}catch(A){
109
109
  /* v8 ignore next -- @preserve */
110
- if(u.automaticFailover&&!w){makeRequest(u)}y.emit("error",new types_CacheError(A))}})();return y};this.addHook=(u,A)=>{if(!this.hooks.has(u)){this.hooks.set(u,A)}};this.removeHook=u=>this.hooks.delete(u);this.getHook=u=>this.hooks.get(u);this.runHook=async(u,...A)=>this.hooks.get(u)?.(...A);if(A){if(A instanceof Xi){this.cache=A}else{this.cache=new Xi({store:A,namespace:"cacheable-request"})}}this.request=this.request.bind(this);this.cacheRequest=u}}const so=Object.entries;const cloneResponse=u=>{const A=new Pe.PassThrough({autoDestroy:false});mimicResponse(u,A);return u.pipe(A)};const urlObjectToRequestOptions=u=>{const A={...u};A.path=`${u.pathname||"/"}${u.search||""}`;delete A.pathname;delete A.search;return A};const normalizeUrlObject=u=>({protocol:u.protocol,auth:u.auth,hostname:u.hostname||u.host||"localhost",port:u.port,pathname:u.pathname,search:u.search});const convertHeaders=u=>{const A=[];for(const p of Object.keys(u)){A[p.toLowerCase()]=u[p]}return A};const parseWithWhatwg=u=>{const A=new we.URL(u);return{protocol:A.protocol,slashes:true,auth:A.username||A.password?`${A.username}:${A.password}`:undefined,host:A.host,port:A.port,hostname:A.hostname,hash:A.hash,search:A.search,query:Object.fromEntries(A.searchParams),pathname:A.pathname,path:A.pathname+A.search,href:A.href}};const io=CacheableRequest;const oo="onResponse";const ao=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib");const lo=typeof ao.createZstdDecompress==="function";function decompressResponse(u){const A=(u.headers["content-encoding"]||"").toLowerCase();const p=["gzip","deflate","br"];if(lo){p.push("zstd")}if(!p.includes(A)){return u}let y=true;const E={...u.headers};const C=new Pe.PassThrough({autoDestroy:false});C.once("error",(()=>{u.destroy()}));function handleContentEncoding(p){let E;if(A==="zstd"){E=ao.createZstdDecompress()}else if(A==="br"){E=ao.createBrotliDecompress()}else if(A==="deflate"&&p.length>0&&(p[0]&8)===0){E=ao.createInflateRaw()}else{E=ao.createUnzip()}E.once("error",(A=>{if(y&&!u.readable){C.end();return}C.destroy(A)}));I.pipe(E).pipe(C)}const I=new Pe.Transform({transform(u,A,p){if(y===false){p(null,u);return}y=false;handleContentEncoding(u);p(null,u)},flush(u){if(y){C.end()}u()}});delete E["content-encoding"];delete E["content-length"];C.headers=E;mimicResponse(u,C);u.pipe(I);return C}var __typeError=u=>{throw TypeError(u)};var __accessCheck=(u,A,p)=>A.has(u)||__typeError("Cannot "+p);var __privateGet=(u,A,p)=>(__accessCheck(u,A,"read from private field"),p?p.call(u):A.get(u));var __privateAdd=(u,A,p)=>A.has(u)?__typeError("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(u):A.set(u,p);var __privateSet=(u,A,p,y)=>(__accessCheck(u,A,"write to private field"),y?y.call(u,p):A.set(u,p),p);var __privateMethod=(u,A,p)=>(__accessCheck(u,A,"access private method"),p);var co=65536;function*chunk(u){if(u.byteLength<=co){yield u;return}let A=0;while(A<u.byteLength){const p=Math.min(u.byteLength-A,co);const y=u.buffer.slice(A,A+p);A+=y.byteLength;yield new Uint8Array(y)}}var uo="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let u=16;let A="";while(u--){A+=uo[Math.random()*uo.length<<0]}return A}var escapeName=u=>String(u).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");var lib_isFunction=u=>typeof u==="function";var isReadableStreamFallback=u=>!!u&&typeof u==="object"&&!Array.isArray(u)&&lib_isFunction(u.getReader);var lib_isAsyncIterable=u=>lib_isFunction(u[Symbol.asyncIterator]);async function*readStream(u){const A=u.getReader();while(true){const{done:u,value:p}=await A.read();if(u){break}yield p}}async function*chunkStream(u){for await(const A of u){yield*chunk(A)}}var getStreamIterator=u=>{if(lib_isAsyncIterable(u)){return chunkStream(u)}if(isReadableStreamFallback(u)){return chunkStream(readStream(u))}throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")};var isFile=u=>Boolean(u&&typeof u==="object"&&lib_isFunction(u.constructor)&&u[Symbol.toStringTag]==="File"&&lib_isFunction(u.stream)&&u.name!=null);var lib_isFormData=u=>Boolean(u&&lib_isFunction(u.constructor)&&u[Symbol.toStringTag]==="FormData"&&lib_isFunction(u.append)&&lib_isFunction(u.getAll)&&lib_isFunction(u.entries)&&lib_isFunction(u[Symbol.iterator]));var getType=u=>Object.prototype.toString.call(u).slice(8,-1).toLowerCase();function lib_isPlainObject(u){if(getType(u)!=="object"){return false}const A=Object.getPrototypeOf(u);if(A===null||A===void 0){return true}return A.constructor?.toString?.()===Object.toString()}var normalizeValue=u=>String(u).replace(/\r|\n/g,((u,A,p)=>{if(u==="\r"&&p[A+1]!=="\n"||u==="\n"&&p[A-1]!=="\r"){return"\r\n"}return u}));function getProperty(u,A){if(typeof A==="string"){for(const[p,y]of Object.entries(u)){if(A.toLowerCase()===p.toLowerCase()){return y}}}return void 0}var proxyHeaders=u=>new Proxy(u,{get:(u,A)=>getProperty(u,A),has:(u,A)=>getProperty(u,A)!==void 0});var fo={enableAdditionalHeaders:false};var Ao={writable:false,configurable:false};var ho,po,go,mo,yo,Eo,Co,Io,bo,wo,vo;var Bo=class{constructor(u,A,p){__privateAdd(this,bo);__privateAdd(this,ho,"\r\n");__privateAdd(this,po);__privateAdd(this,go);__privateAdd(this,mo,"-".repeat(2));__privateAdd(this,yo,new TextEncoder);__privateAdd(this,Eo);__privateAdd(this,Co);__privateAdd(this,Io);if(!lib_isFormData(u)){throw new TypeError("Expected first argument to be a FormData instance.")}let y;if(lib_isPlainObject(A)){p=A}else{y=A}if(!y){y=`form-data-encoder-${createBoundary()}`}if(typeof y!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(p&&!lib_isPlainObject(p)){throw new TypeError("Expected options argument to be an object.")}__privateSet(this,Co,Array.from(u.entries()));__privateSet(this,Io,{...fo,...p});__privateSet(this,po,__privateGet(this,yo).encode(__privateGet(this,ho)));__privateSet(this,go,__privateGet(this,po).byteLength);this.boundary=y;this.contentType=`multipart/form-data; boundary=${this.boundary}`;__privateSet(this,Eo,__privateGet(this,yo).encode(`${__privateGet(this,mo)}${this.boundary}${__privateGet(this,mo)}${__privateGet(this,ho).repeat(2)}`));const E={"Content-Type":this.contentType};const C=__privateMethod(this,bo,vo).call(this);if(C){this.contentLength=C;E["Content-Length"]=C}this.headers=proxyHeaders(Object.freeze(E));Object.defineProperties(this,{boundary:Ao,contentType:Ao,contentLength:Ao,headers:Ao})}*values(){for(const[u,A]of __privateGet(this,Co)){const p=isFile(A)?A:__privateGet(this,yo).encode(normalizeValue(A));yield __privateMethod(this,bo,wo).call(this,u,p);yield p;yield __privateGet(this,po)}yield __privateGet(this,Eo)}async*encode(){for(const u of this.values()){if(isFile(u)){yield*getStreamIterator(u.stream())}else{yield*chunk(u)}}}[Symbol.iterator](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};ho=new WeakMap;po=new WeakMap;go=new WeakMap;mo=new WeakMap;yo=new WeakMap;Eo=new WeakMap;Co=new WeakMap;Io=new WeakMap;bo=new WeakSet;wo=function(u,A){let p="";p+=`${__privateGet(this,mo)}${this.boundary}${__privateGet(this,ho)}`;p+=`Content-Disposition: form-data; name="${escapeName(u)}"`;if(isFile(A)){p+=`; filename="${escapeName(A.name)}"${__privateGet(this,ho)}`;p+=`Content-Type: ${A.type||"application/octet-stream"}`}if(__privateGet(this,Io).enableAdditionalHeaders===true){const u=isFile(A)?A.size:A.byteLength;if(u!=null&&!isNaN(u)){p+=`${__privateGet(this,ho)}Content-Length: ${u}`}}return __privateGet(this,yo).encode(`${p}${__privateGet(this,ho).repeat(2)}`)};vo=function(){let u=0;for(const[A,p]of __privateGet(this,Co)){const y=isFile(p)?p:__privateGet(this,yo).encode(normalizeValue(p));const E=isFile(y)?y.size:y.byteLength;if(E==null||isNaN(E)){return void 0}u+=__privateMethod(this,bo,wo).call(this,A,y).byteLength;u+=E;u+=__privateGet(this,go)}return String(u+__privateGet(this,Eo).byteLength)};function isTlsSocket(u){return"encrypted"in u}const deferToConnect=(u,A)=>{let p;if(typeof A==="function"){const u=A;p={connect:u}}else{p=A}const y=typeof p.connect==="function";const E=typeof p.secureConnect==="function";const C=typeof p.close==="function";const onConnect=()=>{if(y){p.connect()}if(isTlsSocket(u)&&E){if(u.authorized){p.secureConnect()}else{u.once("secureConnect",p.secureConnect)}}if(C){u.once("close",p.close)}};if(u.writable&&!u.connecting){onConnect()}else if(u.connecting){u.once("connect",onConnect)}else if(u.destroyed&&C){const A="_hadError"in u?Boolean(u._hadError):false;p.close(A)}};const So=deferToConnect;const timer=u=>{if(u.timings){return u.timings}const A={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};u.timings=A;const handleError=u=>{u.once(Le.errorMonitor,(()=>{A.error=Date.now();A.phases.total=A.error-A.start}))};handleError(u);const onAbort=()=>{A.abort=Date.now();A.phases.total=A.abort-A.start};u.prependOnceListener("abort",onAbort);const onSocket=u=>{A.socket=Date.now();A.phases.wait=A.socket-A.start;if(cn.types.isProxy(u)){return}const p=u.writable&&!u.connecting;if(p){A.lookup=A.socket;A.connect=A.socket;if(u.__initial_connection_timings__){A.phases.dns=u.__initial_connection_timings__.dnsPhase;A.phases.tcp=u.__initial_connection_timings__.tcpPhase;A.phases.tls=u.__initial_connection_timings__.tlsPhase;if(A.phases.tls!==undefined){A.secureConnect=A.socket}}else{A.phases.dns=0;A.phases.tcp=0}return}const lookupListener=()=>{A.lookup=Date.now();A.phases.dns=A.lookup-A.socket};u.prependOnceListener("lookup",lookupListener);So(u,{connect(){A.connect=Date.now();if(A.lookup===undefined){u.removeListener("lookup",lookupListener);A.lookup=A.socket;A.phases.dns=0}A.phases.tcp=A.connect-A.lookup;if(A.phases.tcp===0&&A.phases.dns&&A.phases.dns>0){A.phases.dns=0}if(!u.__initial_connection_timings__){u.__initial_connection_timings__={dnsPhase:A.phases.dns,tcpPhase:A.phases.tcp}}},secureConnect(){A.secureConnect=Date.now();A.phases.tls=A.secureConnect-A.connect;if(u.__initial_connection_timings__){u.__initial_connection_timings__.tlsPhase=A.phases.tls}}})};if(u.socket){onSocket(u.socket)}else{u.prependOnceListener("socket",onSocket)}const onUpload=()=>{A.upload=Date.now();const u=A.secureConnect??A.connect;if(u!==undefined){A.phases.request=A.upload-u}};if(u.writableFinished){onUpload()}else{u.prependOnceListener("finish",onUpload)}u.prependOnceListener("response",(p=>{A.response=Date.now();A.phases.firstByte=A.response-A.upload;p.timings=A;handleError(p);p.prependOnceListener("end",(()=>{u.off("abort",onAbort);p.off("aborted",onAbort);if(A.phases.total!==undefined){return}A.end=Date.now();A.phases.download=A.end-A.response;A.phases.total=A.end-A.start}));p.prependOnceListener("aborted",onAbort)}));return A};const Do=timer;function is_form_data_isFormData(u){return Pi.nodeStream(u)&&Pi.function(u.getBoundary)}async function getBodySize(u,A){if(A&&"content-length"in A){return Number(A["content-length"])}if(!u){return 0}if(Pi.string(u)){return(new TextEncoder).encode(u).byteLength}if(Pi.buffer(u)){return u.length}if(Pi.typedArray(u)){return u.byteLength}if(is_form_data_isFormData(u)){try{return await(0,cn.promisify)(u.getLength.bind(u))()}catch(u){const A=u;throw new Error("Cannot determine content-length for form-data with stream(s) of unknown length. "+"This is a limitation of the `form-data` package. "+"To fix this, either:\n"+"1. Use the `knownLength` option when appending streams:\n"+" form.append('file', stream, {knownLength: 12345});\n"+"2. Switch to spec-compliant FormData (formdata-node package)\n"+"See: https://github.com/form-data/form-data#alternative-submission-methods\n"+`Original error: ${A.message}`)}}return undefined}function proxyEvents(u,A,p){const y={};for(const E of p){const eventFunction=(...u)=>{A.emit(E,...u)};y[E]=eventFunction;u.on(E,eventFunction)}return()=>{for(const[A,p]of Object.entries(y)){u.off(A,p)}}}const ko=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net");function unhandle(){const u=[];return{once(A,p,y){A.once(p,y);u.push({origin:A,event:p,fn:y})},unhandleAll(){for(const A of u){const{origin:u,event:p,fn:y}=A;u.removeListener(p,y)}u.length=0}}}const Qo=Symbol("reentry");const timed_out_noop=()=>{};class timed_out_TimeoutError extends Error{event;name="TimeoutError";code="ETIMEDOUT";constructor(u,A){super(`Timeout awaiting '${A}' for ${u}ms`);this.event=A}}function timedOut(u,A,p){if(Qo in u){return timed_out_noop}u[Qo]=true;const y=[];const{once:E,unhandleAll:C}=unhandle();const I=new Map;const addTimeout=(u,A,p)=>{const E=setTimeout(A,u,u,p);E.unref?.();const cancel=()=>{I.set(p,true);clearTimeout(E)};y.push(cancel);return cancel};const{host:w,hostname:v}=p;const timeoutHandler=(A,p)=>{setTimeout((()=>{if(!I.has(p)){u.destroy(new timed_out_TimeoutError(A,p))}}),0)};const cancelTimeouts=()=>{for(const u of y){u()}C()};u.once("error",(A=>{cancelTimeouts();if(u.listenerCount("error")===0){throw A}}));if(A.request!==undefined){const p=addTimeout(A.request,timeoutHandler,"request");E(u,"response",(u=>{E(u,"end",p)}))}if(A.socket!==undefined){const{socket:p}=A;const socketTimeoutHandler=()=>{timeoutHandler(p,"socket")};u.setTimeout(p,socketTimeoutHandler);y.push((()=>{u.removeListener("timeout",socketTimeoutHandler)}))}const B=A.lookup!==undefined;const S=A.connect!==undefined;const D=A.secureConnect!==undefined;const k=A.send!==undefined;if(B||S||D||k){E(u,"socket",(y=>{const{socketPath:C}=u;if(y.connecting){const u=Boolean(C??ko.isIP(v??w??"")!==0);if(B&&!u&&y.address().address===undefined){const u=addTimeout(A.lookup,timeoutHandler,"lookup");E(y,"lookup",u)}if(S){const timeConnect=()=>addTimeout(A.connect,timeoutHandler,"connect");if(u){E(y,"connect",timeConnect())}else{E(y,"lookup",(u=>{if(u===null){E(y,"connect",timeConnect())}}))}}if(D&&p.protocol==="https:"){E(y,"connect",(()=>{const u=addTimeout(A.secureConnect,timeoutHandler,"secureConnect");E(y,"secureConnect",u)}))}}if(k){const timeRequest=()=>addTimeout(A.send,timeoutHandler,"send");if(y.connecting){E(y,"connect",(()=>{E(u,"upload-complete",timeRequest())}))}else{E(u,"upload-complete",timeRequest())}}}))}if(A.response!==undefined){E(u,"upload-complete",(()=>{const p=addTimeout(A.response,timeoutHandler,"response");E(u,"response",p)}))}if(A.read!==undefined){E(u,"response",(u=>{const p=addTimeout(A.read,timeoutHandler,"read");E(u,"end",p)}))}return cancelTimeouts}function urlToOptions(u){u=u;const A={protocol:u.protocol,hostname:Pi.string(u.hostname)&&u.hostname.startsWith("[")?u.hostname.slice(1,-1):u.hostname,host:u.host,hash:u.hash,search:u.search,pathname:u.pathname,href:u.href,path:`${u.pathname||""}${u.search||""}`};if(Pi.string(u.port)&&u.port.length>0){A.port=Number(u.port)}if(u.username||u.password){A.auth=`${u.username||""}:${u.password||""}`}return A}class WeakableMap{weakMap=new WeakMap;map=new Map;set(u,A){if(typeof u==="object"){this.weakMap.set(u,A)}else{this.map.set(u,A)}}get(u){if(typeof u==="object"){return this.weakMap.get(u)}return this.map.get(u)}has(u){if(typeof u==="object"){return this.weakMap.has(u)}return this.map.has(u)}}const calculateRetryDelay=({attemptCount:u,retryOptions:A,error:p,retryAfter:y,computedValue:E})=>{if(p.name==="RetryError"){return 1}if(u>A.limit){return 0}const C=A.methods.includes(p.options.method);const I=A.errorCodes.includes(p.code);const w=p.response&&A.statusCodes.includes(p.response.statusCode);if(!C||!I&&!w){return 0}if(p.response){if(y){if(y>E){return 0}return y}if(p.response.statusCode===413){return 0}}const v=Math.random()*A.noise;return Math.min(2**(u-1)*1e3,A.backoffLimit)+v};const Fo=calculateRetryDelay;const xo=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tls");const Ro=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https");const _o=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns");const{Resolver:To}=_o.promises;const No=Symbol("cacheableLookupCreateConnection");const Lo=Symbol("cacheableLookupInstance");const Po=Symbol("expires");const Oo=typeof _o.ALL==="number";const verifyAgent=u=>{if(!(u&&typeof u.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=u=>{for(const A of u){if(A.family===6){continue}A.address=`::ffff:${A.address}`;A.family=6}};const getIfaceInfo=()=>{let u=false;let A=false;for(const p of Object.values(Qr.networkInterfaces())){for(const y of p){if(y.internal){continue}if(y.family==="IPv6"){A=true}else{u=true}if(u&&A){return{has4:u,has6:A}}}}return{has4:u,has6:A}};const source_isIterable=u=>Symbol.iterator in u;const ignoreNoResultErrors=u=>u.catch((u=>{if(u.code==="ENODATA"||u.code==="ENOTFOUND"||u.code==="ENOENT"){return[]}throw u}));const Mo={ttl:true};const Uo={all:true};const Ho={all:true,family:4};const Go={all:true,family:6};class CacheableLookup{constructor({cache:u=new Map,maxTtl:A=Infinity,fallbackDuration:p=3600,errorTtl:y=.15,resolver:E=new To,lookup:C=_o.lookup}={}){this.maxTtl=A;this.errorTtl=y;this._cache=u;this._resolver=E;this._dnsLookup=C&&(0,cn.promisify)(C);this.stats={cache:0,query:0};if(this._resolver instanceof To){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=(0,cn.promisify)(this._resolver.resolve4.bind(this._resolver));this._resolve6=(0,cn.promisify)(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=p;if(p>0){const u=setInterval((()=>{this._hostnamesToFallback.clear()}),p*1e3);if(u.unref){u.unref()}this._fallbackInterval=u}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(u){this.clear();this._resolver.setServers(u)}get servers(){return this._resolver.getServers()}lookup(u,A,p){if(typeof A==="function"){p=A;A={}}else if(typeof A==="number"){A={family:A}}if(!p){throw new Error("Callback must be a function.")}this.lookupAsync(u,A).then((u=>{if(A.all){p(null,u)}else{p(null,u.address,u.family,u.expires,u.ttl,u.source)}}),p)}async lookupAsync(u,A={}){if(typeof A==="number"){A={family:A}}let p=await this.query(u);if(A.family===6){const u=p.filter((u=>u.family===6));if(A.hints&_o.V4MAPPED){if(Oo&&A.hints&_o.ALL||u.length===0){map4to6(p)}else{p=u}}else{p=u}}else if(A.family===4){p=p.filter((u=>u.family===4))}if(A.hints&_o.ADDRCONFIG){const{_iface:u}=this;p=p.filter((A=>A.family===6?u.has6:u.has4))}if(p.length===0){const A=new Error(`cacheableLookup ENOTFOUND ${u}`);A.code="ENOTFOUND";A.hostname=u;throw A}if(A.all){return p}return p[0]}async query(u){let A="cache";let p=await this._cache.get(u);if(p){this.stats.cache++}if(!p){const y=this._pending[u];if(y){this.stats.cache++;p=await y}else{A="query";const y=this.queryAndCache(u);this._pending[u]=y;this.stats.query++;try{p=await y}finally{delete this._pending[u]}}}p=p.map((u=>({...u,source:A})));return p}async _resolve(u){const[A,p]=await Promise.all([ignoreNoResultErrors(this._resolve4(u,Mo)),ignoreNoResultErrors(this._resolve6(u,Mo))]);let y=0;let E=0;let C=0;const I=Date.now();for(const u of A){u.family=4;u.expires=I+u.ttl*1e3;y=Math.max(y,u.ttl)}for(const u of p){u.family=6;u.expires=I+u.ttl*1e3;E=Math.max(E,u.ttl)}if(A.length>0){if(p.length>0){C=Math.min(y,E)}else{C=y}}else{C=E}return{entries:[...A,...p],cacheTtl:C}}async _lookup(u){try{const[A,p]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(u,Ho)),ignoreNoResultErrors(this._dnsLookup(u,Go))]);return{entries:[...A,...p],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(u,A,p){if(this.maxTtl>0&&p>0){p=Math.min(p,this.maxTtl)*1e3;A[Po]=Date.now()+p;try{await this._cache.set(u,A,p)}catch(u){this.lookupAsync=async()=>{const A=new Error("Cache Error. Please recreate the CacheableLookup instance.");A.cause=u;throw A}}if(source_isIterable(this._cache)){this._tick(p)}}}async queryAndCache(u){if(this._hostnamesToFallback.has(u)){return this._dnsLookup(u,Uo)}let A=await this._resolve(u);if(A.entries.length===0&&this._dnsLookup){A=await this._lookup(u);if(A.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(u)}}const p=A.entries.length===0?this.errorTtl:A.cacheTtl;await this._set(u,A.entries,p);return A.entries}_tick(u){const A=this._nextRemovalTime;if(!A||u<A){clearTimeout(this._removalTimeout);this._nextRemovalTime=u;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let u=Infinity;const A=Date.now();for(const[p,y]of this._cache){const E=y[Po];if(A>=E){this._cache.delete(p)}else if(E<u){u=E}}if(u!==Infinity){this._tick(u-A)}}),u);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(u){verifyAgent(u);if(No in u){throw new Error("CacheableLookup has been already installed")}u[No]=u.createConnection;u[Lo]=this;u.createConnection=(A,p)=>{if(!("lookup"in A)){A.lookup=this.lookup}return u[No](A,p)}}uninstall(u){verifyAgent(u);if(u[No]){if(u[Lo]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}u.createConnection=u[No];delete u[No];delete u[Lo]}}updateInterfaceInfo(){const{_iface:u}=this;this._iface=getIfaceInfo();if(u.has4&&!this._iface.has4||u.has6&&!this._iface.has6){this._cache.clear()}}clear(u){if(u){this._cache.delete(u);return}this._cache.clear()}}var Wo=p(882);function parseLinkHeader(u){const A=[];const p=u.split(",");for(const y of p){const[p,...E]=y.split(";");const C=p.trim();if(C[0]!=="<"||C.at(-1)!==">"){throw new Error(`Invalid format of the Link header reference: ${C}`)}const I=C.slice(1,-1);const w={};if(E.length===0){throw new Error(`Unexpected end of Link header parameters: ${E.join(";")}`)}for(const A of E){const p=A.trim();const y=p.indexOf("=");if(y===-1){throw new Error(`Failed to parse Link header: ${u}`)}const E=p.slice(0,y).trim();const C=p.slice(y+1).trim();w[E]=C}A.push({reference:I,parameters:w})}return A}const[jo,zo]=un.versions.node.split(".").map(Number);function wrapAssertionWithContext(u,A){try{A()}catch(A){if(A instanceof Error){A.message=`Option '${u}': ${A.message}`}throw A}}function options_assertAny(u,A,p){wrapAssertionWithContext(u,(()=>{Ti.any(A,p)}))}function options_assertPlainObject(u,A){wrapAssertionWithContext(u,(()=>{Ti.plainObject(A)}))}function validateSearchParameters(u){for(const A in u){const p=u[A];options_assertAny(`searchParams.${A}`,[Pi.string,Pi.number,Pi.boolean,Pi.null,Pi.undefined],p)}}const $o=new Map;let qo;const getGlobalDnsCache=()=>{if(qo){return qo}qo=new CacheableLookup;return qo};const wrapQuickLruIfNeeded=u=>{if(u?.[Symbol.toStringTag]==="QuickLRU"&&typeof u.evict==="function"){return{get(A){return u.get(A)},set(A,p,y){if(y===undefined){u.set(A,p)}else{u.set(A,p,{maxAge:y})}return true},delete(A){return u.delete(A)},clear(){return u.clear()},has(A){return u.has(A)}}}return u};const Vo={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],beforeCache:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,copyPipedHeaders:true,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:u})=>u,backoffLimit:Number.POSITIVE_INFINITY,noise:100,enforceRetryRules:false},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,serverName:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined,secureOptions:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(u){if(u.request.options.responseType==="json"){return u.body}return JSON.parse(u.body)},paginate({response:u}){const A=u.headers.link;if(typeof A!=="string"||A.trim()===""){return false}const p=parseLinkHeader(A);const y=p.find((u=>u.parameters.rel==="next"||u.parameters.rel==='"next"'));if(y){return{url:new URL(y.reference,u.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined,signal:undefined,enableUnixSockets:false,strictContentLength:false};const cloneInternals=u=>{const{hooks:A,retry:p}=u;const y={...u,context:{...u.context},cacheOptions:{...u.cacheOptions},https:{...u.https},agent:{...u.agent},headers:{...u.headers},retry:{...p,errorCodes:[...p.errorCodes],methods:[...p.methods],statusCodes:[...p.statusCodes]},timeout:{...u.timeout},hooks:{init:[...A.init],beforeRequest:[...A.beforeRequest],beforeError:[...A.beforeError],beforeRedirect:[...A.beforeRedirect],beforeRetry:[...A.beforeRetry],beforeCache:[...A.beforeCache],afterResponse:[...A.afterResponse]},searchParams:u.searchParams?new URLSearchParams(u.searchParams):undefined,pagination:{...u.pagination}};return y};const cloneRaw=u=>{const{hooks:A,retry:p}=u;const y={...u};if(Pi.object(u.context)){y.context={...u.context}}if(Pi.object(u.cacheOptions)){y.cacheOptions={...u.cacheOptions}}if(Pi.object(u.https)){y.https={...u.https}}if(Pi.object(u.cacheOptions)){y.cacheOptions={...y.cacheOptions}}if(Pi.object(u.agent)){y.agent={...u.agent}}if(Pi.object(u.headers)){y.headers={...u.headers}}if(Pi.object(p)){y.retry={...p};if(Pi.array(p.errorCodes)){y.retry.errorCodes=[...p.errorCodes]}if(Pi.array(p.methods)){y.retry.methods=[...p.methods]}if(Pi.array(p.statusCodes)){y.retry.statusCodes=[...p.statusCodes]}}if(Pi.object(u.timeout)){y.timeout={...u.timeout}}if(Pi.object(A)){y.hooks={...A};if(Pi.array(A.init)){y.hooks.init=[...A.init]}if(Pi.array(A.beforeRequest)){y.hooks.beforeRequest=[...A.beforeRequest]}if(Pi.array(A.beforeError)){y.hooks.beforeError=[...A.beforeError]}if(Pi.array(A.beforeRedirect)){y.hooks.beforeRedirect=[...A.beforeRedirect]}if(Pi.array(A.beforeRetry)){y.hooks.beforeRetry=[...A.beforeRetry]}if(Pi.array(A.beforeCache)){y.hooks.beforeCache=[...A.beforeCache]}if(Pi.array(A.afterResponse)){y.hooks.afterResponse=[...A.afterResponse]}}if(u.searchParams){if(Pi.string(u.searchParams)){y.searchParams=u.searchParams}else if(u.searchParams instanceof URLSearchParams){y.searchParams=new URLSearchParams(u.searchParams)}else if(Pi.object(u.searchParams)){y.searchParams={...u.searchParams}}}if(Pi.object(u.pagination)){y.pagination={...u.pagination}}return y};const getHttp2TimeoutOption=u=>{const A=[u.timeout.socket,u.timeout.connect,u.timeout.lookup,u.timeout.request,u.timeout.secureConnect].filter((u=>typeof u==="number"));if(A.length>0){return Math.min(...A)}return undefined};const init=(u,A,p)=>{const y=u.hooks?.init;if(y){for(const u of y){u(A,p)}}};class Options{_unixOptions;_internals;_merging=false;_init;constructor(u,A,p){options_assertAny("input",[Pi.string,Pi.urlInstance,Pi.object,Pi.undefined],u);options_assertAny("options",[Pi.object,Pi.undefined],A);options_assertAny("defaults",[Pi.object,Pi.undefined],p);if(u instanceof Options||A instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(p?._internals??p??Vo);this._init=[...p?._init??[]];try{if(Pi.plainObject(u)){try{this.merge(u);this.merge(A)}finally{this.url=u.url}}else{try{this.merge(A)}finally{if(A?.url!==undefined){if(u===undefined){this.url=A.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(u!==undefined){this.url=u}}}}catch(u){u.options=this;throw u}}merge(u){if(!u){return}if(u instanceof Options){const A=[...u._init];for(const u of A){this.merge(u)}return}u=cloneRaw(u);init(this,u,this);init(u,u,this);this._merging=true;if("isStream"in u){this.isStream=u.isStream}try{let A=false;for(const p in u){if(p==="mutableDefaults"||p==="handlers"){continue}if(p==="url"){continue}if(p==="preserveHooks"){continue}if(!(p in this)){throw new Error(`Unexpected option: ${p}`)}const y=u[p];if(y===undefined){continue}this[p]=y;A=true}if(A){this._init.push(u)}}finally{this._merging=false}}get request(){return this._internals.request}set request(u){options_assertAny("request",[Pi.function,Pi.undefined],u);this._internals.request=u}get agent(){return this._internals.agent}set agent(u){options_assertPlainObject("agent",u);for(const A in u){if(!(A in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${A}`)}options_assertAny(`agent.${A}`,[Pi.object,Pi.undefined,u=>u===false],u[A])}if(this._merging){Object.assign(this._internals.agent,u)}else{this._internals.agent={...u}}}get h2session(){return this._internals.h2session}set h2session(u){this._internals.h2session=u}get decompress(){return this._internals.decompress}set decompress(u){Ti.boolean(u);this._internals.decompress=u}get timeout(){return this._internals.timeout}set timeout(u){options_assertPlainObject("timeout",u);for(const A in u){if(!(A in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${A}`)}options_assertAny(`timeout.${A}`,[Pi.number,Pi.undefined],u[A])}if(this._merging){Object.assign(this._internals.timeout,u)}else{this._internals.timeout={...u}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(u){options_assertAny("prefixUrl",[Pi.string,Pi.urlInstance],u);if(u===""){this._internals.prefixUrl="";return}u=u.toString();if(!u.endsWith("/")){u+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:A}=this._internals.url;this._internals.url.href=u+A.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=u}get body(){return this._internals.body}set body(u){options_assertAny("body",[Pi.string,Pi.buffer,Pi.nodeStream,Pi.generator,Pi.asyncGenerator,Pi.iterable,Pi.asyncIterable,lib_isFormData,Pi.typedArray,Pi.undefined],u);if(Pi.nodeStream(u)){Ti.truthy(u.readable)}if(u!==undefined){Ti.undefined(this._internals.form);Ti.undefined(this._internals.json)}this._internals.body=u}get form(){return this._internals.form}set form(u){options_assertAny("form",[Pi.plainObject,Pi.undefined],u);if(u!==undefined){Ti.undefined(this._internals.body);Ti.undefined(this._internals.json)}this._internals.form=u}get json(){return this._internals.json}set json(u){if(u!==undefined){Ti.undefined(this._internals.body);Ti.undefined(this._internals.form)}this._internals.json=u}get url(){return this._internals.url}set url(u){options_assertAny("url",[Pi.string,Pi.urlInstance,Pi.undefined],u);if(u===undefined){this._internals.url=undefined;return}if(Pi.string(u)&&u.startsWith("/")){throw new Error("`url` must not start with a slash")}const A=u.toString();const p=Pi.urlInstance(u)||/^[a-z][a-z\d+.-]*:\/\//i.test(A);const y=p?A:`${this.prefixUrl}${A}`;const E=new URL(y);this._internals.url=E;if(E.protocol==="unix:"){E.href=`http://unix${E.pathname}${E.search}`}if(E.protocol!=="http:"&&E.protocol!=="https:"){const u=new Error(`Unsupported protocol: ${E.protocol}`);u.code="ERR_UNSUPPORTED_PROTOCOL";throw u}if(this._internals.username){E.username=this._internals.username;this._internals.username=""}if(this._internals.password){E.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){E.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(E.hostname==="unix"){if(!this._internals.enableUnixSockets){throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled")}const u=/(?<socketPath>.+?):(?<path>.+)/.exec(`${E.pathname}${E.search}`);if(u?.groups){const{socketPath:A,path:p}=u.groups;this._unixOptions={socketPath:A,path:p,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(u){options_assertAny("cookieJar",[Pi.object,Pi.undefined],u);if(u===undefined){this._internals.cookieJar=undefined;return}let{setCookie:A,getCookieString:p}=u;Ti.function(A);Ti.function(p);if(A.length===4&&p.length===0){A=(0,cn.promisify)(A.bind(u));p=(0,cn.promisify)(p.bind(u));this._internals.cookieJar={setCookie:A,getCookieString:p}}else{this._internals.cookieJar=u}}get signal(){return this._internals.signal}set signal(u){Ti.object(u);this._internals.signal=u}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(u){Ti.boolean(u);this._internals.ignoreInvalidCookies=u}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new URLSearchParams}return this._internals.searchParams}set searchParams(u){options_assertAny("searchParams",[Pi.string,Pi.object,Pi.undefined],u);const A=this._internals.url;if(u===undefined){this._internals.searchParams=undefined;if(A){A.search=""}return}const p=this.searchParams;let y;if(Pi.string(u)){y=new URLSearchParams(u)}else if(u instanceof URLSearchParams){y=u}else{validateSearchParameters(u);y=new URLSearchParams;for(const A in u){const E=u[A];if(E===null){y.append(A,"")}else if(E===undefined){p.delete(A)}else{y.append(A,E)}}}if(this._merging){for(const u of y.keys()){p.delete(u)}for(const[u,A]of y){p.append(u,A)}}else if(A){A.search=p.toString()}else{this._internals.searchParams=p}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(u){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(u){options_assertAny("dnsLookup",[Pi.function,Pi.undefined],u);this._internals.dnsLookup=u}get dnsCache(){return this._internals.dnsCache}set dnsCache(u){options_assertAny("dnsCache",[Pi.object,Pi.boolean,Pi.undefined],u);if(u===true){this._internals.dnsCache=getGlobalDnsCache()}else if(u===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=u}}get context(){return this._internals.context}set context(u){Ti.object(u);if(this._merging){Object.assign(this._internals.context,u)}else{this._internals.context={...u}}}get hooks(){return this._internals.hooks}set hooks(u){Ti.object(u);for(const A in u){if(!(A in this._internals.hooks)){throw new Error(`Unexpected hook event: ${A}`)}const p=A;const y=u[p];options_assertAny(`hooks.${A}`,[Pi.array,Pi.undefined],y);if(y){for(const u of y){Ti.function(u)}}if(this._merging){if(y){this._internals.hooks[p].push(...y)}}else{if(!y){throw new Error(`Missing hook event: ${A}`)}this._internals.hooks[A]=[...y]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(u){options_assertAny("followRedirect",[Pi.boolean,Pi.function],u);this._internals.followRedirect=u}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(u){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(u){Ti.number(u);this._internals.maxRedirects=u}get cache(){return this._internals.cache}set cache(u){options_assertAny("cache",[Pi.object,Pi.string,Pi.boolean,Pi.undefined],u);if(u===true){this._internals.cache=$o}else if(u===false){this._internals.cache=undefined}else{this._internals.cache=wrapQuickLruIfNeeded(u)}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(u){Ti.boolean(u);this._internals.throwHttpErrors=u}get username(){const u=this._internals.url;const A=u?u.username:this._internals.username;return decodeURIComponent(A)}set username(u){Ti.string(u);const A=this._internals.url;const p=encodeURIComponent(u);if(A){A.username=p}else{this._internals.username=p}}get password(){const u=this._internals.url;const A=u?u.password:this._internals.password;return decodeURIComponent(A)}set password(u){Ti.string(u);const A=this._internals.url;const p=encodeURIComponent(u);if(A){A.password=p}else{this._internals.password=p}}get http2(){return this._internals.http2}set http2(u){Ti.boolean(u);this._internals.http2=u}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(u){Ti.boolean(u);this._internals.allowGetBody=u}get copyPipedHeaders(){return this._internals.copyPipedHeaders}set copyPipedHeaders(u){Ti.boolean(u);this._internals.copyPipedHeaders=u}get headers(){return this._internals.headers}set headers(u){options_assertPlainObject("headers",u);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(u))}else{this._internals.headers=lowercaseKeys(u)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(u){Ti.boolean(u);this._internals.methodRewriting=u}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(u){if(u!==undefined&&u!==4&&u!==6){throw new TypeError(`Invalid DNS lookup IP version: ${u}`)}this._internals.dnsLookupIpVersion=u}get parseJson(){return this._internals.parseJson}set parseJson(u){Ti.function(u);this._internals.parseJson=u}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(u){Ti.function(u);this._internals.stringifyJson=u}get retry(){return this._internals.retry}set retry(u){options_assertPlainObject("retry",u);options_assertAny("retry.calculateDelay",[Pi.function,Pi.undefined],u.calculateDelay);options_assertAny("retry.maxRetryAfter",[Pi.number,Pi.undefined],u.maxRetryAfter);options_assertAny("retry.limit",[Pi.number,Pi.undefined],u.limit);options_assertAny("retry.methods",[Pi.array,Pi.undefined],u.methods);options_assertAny("retry.statusCodes",[Pi.array,Pi.undefined],u.statusCodes);options_assertAny("retry.errorCodes",[Pi.array,Pi.undefined],u.errorCodes);options_assertAny("retry.noise",[Pi.number,Pi.undefined],u.noise);options_assertAny("retry.enforceRetryRules",[Pi.boolean,Pi.undefined],u.enforceRetryRules);if(u.noise&&Math.abs(u.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${u.noise}`)}for(const A in u){if(!(A in this._internals.retry)){throw new Error(`Unexpected retry option: ${A}`)}}if(this._merging){Object.assign(this._internals.retry,u)}else{this._internals.retry={...u}}const{retry:A}=this._internals;A.methods=[...new Set(A.methods.map((u=>u.toUpperCase())))];A.statusCodes=[...new Set(A.statusCodes)];A.errorCodes=[...new Set(A.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(u){options_assertAny("localAddress",[Pi.string,Pi.undefined],u);this._internals.localAddress=u}get method(){return this._internals.method}set method(u){Ti.string(u);this._internals.method=u.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(u){options_assertAny("createConnection",[Pi.function,Pi.undefined],u);this._internals.createConnection=u}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(u){options_assertPlainObject("cacheOptions",u);options_assertAny("cacheOptions.shared",[Pi.boolean,Pi.undefined],u.shared);options_assertAny("cacheOptions.cacheHeuristic",[Pi.number,Pi.undefined],u.cacheHeuristic);options_assertAny("cacheOptions.immutableMinTimeToLive",[Pi.number,Pi.undefined],u.immutableMinTimeToLive);options_assertAny("cacheOptions.ignoreCargoCult",[Pi.boolean,Pi.undefined],u.ignoreCargoCult);for(const A in u){if(!(A in this._internals.cacheOptions)){throw new Error(`Cache option \`${A}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,u)}else{this._internals.cacheOptions={...u}}}get https(){return this._internals.https}set https(u){options_assertPlainObject("https",u);options_assertAny("https.rejectUnauthorized",[Pi.boolean,Pi.undefined],u.rejectUnauthorized);options_assertAny("https.checkServerIdentity",[Pi.function,Pi.undefined],u.checkServerIdentity);options_assertAny("https.serverName",[Pi.string,Pi.undefined],u.serverName);options_assertAny("https.certificateAuthority",[Pi.string,Pi.object,Pi.array,Pi.undefined],u.certificateAuthority);options_assertAny("https.key",[Pi.string,Pi.object,Pi.array,Pi.undefined],u.key);options_assertAny("https.certificate",[Pi.string,Pi.object,Pi.array,Pi.undefined],u.certificate);options_assertAny("https.passphrase",[Pi.string,Pi.undefined],u.passphrase);options_assertAny("https.pfx",[Pi.string,Pi.buffer,Pi.array,Pi.undefined],u.pfx);options_assertAny("https.alpnProtocols",[Pi.array,Pi.undefined],u.alpnProtocols);options_assertAny("https.ciphers",[Pi.string,Pi.undefined],u.ciphers);options_assertAny("https.dhparam",[Pi.string,Pi.buffer,Pi.undefined],u.dhparam);options_assertAny("https.signatureAlgorithms",[Pi.string,Pi.undefined],u.signatureAlgorithms);options_assertAny("https.minVersion",[Pi.string,Pi.undefined],u.minVersion);options_assertAny("https.maxVersion",[Pi.string,Pi.undefined],u.maxVersion);options_assertAny("https.honorCipherOrder",[Pi.boolean,Pi.undefined],u.honorCipherOrder);options_assertAny("https.tlsSessionLifetime",[Pi.number,Pi.undefined],u.tlsSessionLifetime);options_assertAny("https.ecdhCurve",[Pi.string,Pi.undefined],u.ecdhCurve);options_assertAny("https.certificateRevocationLists",[Pi.string,Pi.buffer,Pi.array,Pi.undefined],u.certificateRevocationLists);options_assertAny("https.secureOptions",[Pi.number,Pi.undefined],u.secureOptions);for(const A in u){if(!(A in this._internals.https)){throw new Error(`HTTPS option \`${A}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,u)}else{this._internals.https={...u}}}get encoding(){return this._internals.encoding}set encoding(u){if(u===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}options_assertAny("encoding",[Pi.string,Pi.undefined],u);this._internals.encoding=u}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(u){Ti.boolean(u);this._internals.resolveBodyOnly=u}get isStream(){return this._internals.isStream}set isStream(u){Ti.boolean(u);this._internals.isStream=u}get responseType(){return this._internals.responseType}set responseType(u){if(u===undefined){this._internals.responseType="text";return}if(u!=="text"&&u!=="buffer"&&u!=="json"){throw new Error(`Invalid \`responseType\` option: ${u}`)}this._internals.responseType=u}get pagination(){return this._internals.pagination}set pagination(u){Ti.object(u);if(this._merging){Object.assign(this._internals.pagination,u)}else{this._internals.pagination=u}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(u){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(u){Ti.boolean(u);this._internals.setHost=u}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(u){options_assertAny("maxHeaderSize",[Pi.number,Pi.undefined],u);this._internals.maxHeaderSize=u}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(u){Ti.boolean(u);this._internals.enableUnixSockets=u}get strictContentLength(){return this._internals.strictContentLength}set strictContentLength(u){Ti.boolean(u);this._internals.strictContentLength=u}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](u,A){return(0,cn.inspect)(this._internals,A)}createNativeRequestOptions(){const u=this._internals;const A=u.url;let p;if(A.protocol==="https:"){if(u.http2){p={...u.agent,http2:u.agent.http2??Wo.globalAgent}}else{p=u.agent.https}}else{p=u.agent.http}const{https:y}=u;let{pfx:E}=y;if(Pi.array(E)&&Pi.plainObject(E[0])){E=E.map((u=>({buf:u.buffer,passphrase:u.passphrase})))}return{...u.cacheOptions,...this._unixOptions,ALPNProtocols:y.alpnProtocols,ca:y.certificateAuthority,cert:y.certificate,key:y.key,passphrase:y.passphrase,pfx:y.pfx,rejectUnauthorized:y.rejectUnauthorized,checkServerIdentity:y.checkServerIdentity??xo.checkServerIdentity,servername:y.serverName,ciphers:y.ciphers,honorCipherOrder:y.honorCipherOrder,minVersion:y.minVersion,maxVersion:y.maxVersion,sigalgs:y.signatureAlgorithms,sessionTimeout:y.tlsSessionLifetime,dhparam:y.dhparam,ecdhCurve:y.ecdhCurve,crl:y.certificateRevocationLists,secureOptions:y.secureOptions,lookup:u.dnsLookup??u.dnsCache?.lookup,family:u.dnsLookupIpVersion,agent:p,setHost:u.setHost,method:u.method,maxHeaderSize:u.maxHeaderSize,localAddress:u.localAddress,headers:u.headers,createConnection:u.createConnection,timeout:u.http2?getHttp2TimeoutOption(u):undefined,h2session:u.h2session}}getRequestFunction(){const u=this._internals.url;const{request:A}=this._internals;if(!A&&u){return this.getFallbackRequestFunction()}return A}getFallbackRequestFunction(){const u=this._internals.url;if(!u){return}if(u.protocol==="https:"){if(this._internals.http2){if(jo<15||jo===15&&zo<10){const u=new Error("To use the `http2` option, install Node.js 15.10.0 or above");u.code="EUNSUPPORTED";throw u}return Wo.auto}return Ro.request}return Mi.request}freeze(){const u=this._internals;Object.freeze(u);Object.freeze(u.hooks);Object.freeze(u.hooks.afterResponse);Object.freeze(u.hooks.beforeError);Object.freeze(u.hooks.beforeRedirect);Object.freeze(u.hooks.beforeRequest);Object.freeze(u.hooks.beforeRetry);Object.freeze(u.hooks.init);Object.freeze(u.https);Object.freeze(u.cacheOptions);Object.freeze(u.agent);Object.freeze(u.headers);Object.freeze(u.timeout);Object.freeze(u.retry);Object.freeze(u.retry.errorCodes);Object.freeze(u.retry.methods);Object.freeze(u.retry.statusCodes)}}const isResponseOk=u=>{const{statusCode:A}=u;const{followRedirect:p}=u.request.options;const y=typeof p==="function"?p(u):p;const E=y?299:399;return A>=200&&A<=E||A===304};class ParseError extends RequestError{name="ParseError";code="ERR_BODY_PARSE_FAILURE";constructor(u,A){const{options:p}=A.request;super(`${u.message} in "${p.url.toString()}"`,u,A.request)}}const parseBody=(u,A,p,y)=>{const{rawBody:E}=u;try{if(A==="text"){return E.toString(y)}if(A==="json"){return E.length===0?"":p(E.toString(y))}if(A==="buffer"){return E}}catch(A){throw new ParseError(A,u)}throw new ParseError({message:`Unknown body type '${A}'`,name:"Error"},u)};function isClientRequest(u){return u.writable&&!u.writableEnded}const Ko=isClientRequest;function isUnixSocketURL(u){return u.protocol==="unix:"||u.hostname==="unix"}function getUnixSocketPath(u){if(!isUnixSocketURL(u)){return undefined}return/(?<socketPath>.+?):(?<path>.+)/.exec(`${u.pathname}${u.search}`)?.groups?.socketPath}const Jo=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:diagnostics_channel");const Yo={requestCreate:Jo.channel("got:request:create"),requestStart:Jo.channel("got:request:start"),responseStart:Jo.channel("got:response:start"),responseEnd:Jo.channel("got:response:end"),retry:Jo.channel("got:request:retry"),error:Jo.channel("got:request:error"),redirect:Jo.channel("got:response:redirect")};function generateRequestId(){return(0,Hi.randomUUID)()}function publishRequestCreate(u){if(Yo.requestCreate.hasSubscribers){Yo.requestCreate.publish(u)}}function publishRequestStart(u){if(Yo.requestStart.hasSubscribers){Yo.requestStart.publish(u)}}function publishResponseStart(u){if(Yo.responseStart.hasSubscribers){Yo.responseStart.publish(u)}}function publishResponseEnd(u){if(Yo.responseEnd.hasSubscribers){Yo.responseEnd.publish(u)}}function publishRetry(u){if(Yo.retry.hasSubscribers){Yo.retry.publish(u)}}function publishError(u){if(Yo.error.hasSubscribers){Yo.error.publish(u)}}function publishRedirect(u){if(Yo.redirect.hasSubscribers){Yo.redirect.publish(u)}}const Xo=Pi.string(un.versions.brotli);const Zo=Pi.string(un.versions.zstd);const ea=new Set(["GET","HEAD"]);const ta=new WeakableMap;const ra=new Set([300,301,302,303,304,307,308]);const ia=new WeakSet;const oa=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends Pe.Duplex{["constructor"];_noPipe;options;response;requestUrl;redirectUrls=[];retryCount=0;_stopReading=false;_stopRetry=core_noop;_downloadedSize=0;_uploadedSize=0;_pipedServerResponses=new Set;_request;_responseSize;_bodySize;_unproxyEvents=core_noop;_isFromCache;_triggerRead=false;_jobs=[];_cancelTimeouts=core_noop;_removeListeners=core_noop;_nativeResponse;_flushed=false;_aborted=false;_expectedContentLength;_compressedBytesCount;_requestId=generateRequestId();_requestInitialized=false;constructor(u,A,p){super({autoDestroy:false,highWaterMark:0});this.on("pipe",(u=>{if(this.options.copyPipedHeaders&&u?.headers){Object.assign(this.options.headers,u.headers)}}));this.on("newListener",(u=>{if(u==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(u,A,p);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url;publishRequestCreate({requestId:this._requestId,url:this.options.url?.toString()??"",method:this.options.method})}catch(u){const{options:A}=u;if(A){this.options=A}this.flush=async()=>{this.flush=async()=>{};un.nextTick((()=>{if(this.options){this._beforeError(u)}else{const A=u instanceof RequestError?u:new RequestError(u.message,u,this);this.destroy(A)}}))};return}const{body:y}=this.options;if(Pi.nodeStream(y)){y.once("error",(u=>{if(this._flushed){this._beforeError(new UploadError(u,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(u,this))}}}))}if(this.options.signal){const abort=()=>{if(this.options.signal?.reason?.name==="TimeoutError"){this.destroy(new TimeoutError(this.options.signal.reason,this.timings,this))}else{this.destroy(new AbortError(this))}};if(this.options.signal.aborted){abort()}else{this.options.signal.addEventListener("abort",abort);this._removeListeners=()=>{this.options.signal?.removeEventListener("abort",abort)}}}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const u of this._jobs){u()}this._jobs.length=0;this._requestInitialized=true}catch(u){this._beforeError(u)}}_beforeError(u){if(this._stopReading){return}const{response:A,options:p}=this;const y=this.retryCount+(u.name==="RetryError"?0:1);this._stopReading=true;if(!(u instanceof RequestError)){u=new RequestError(u.message,u,this)}const E=u;void(async()=>{if(A?.readable&&!A.rawBody&&!this._request?.socket?.destroyed){A.setEncoding(this.readableEncoding);const u=await this._setRawBody(A);if(u){A.body=A.rawBody.toString()}}if(this.listenerCount("retry")!==0){let C;try{let u;if(A&&"retry-after"in A.headers){u=Number(A.headers["retry-after"]);if(Number.isNaN(u)){u=Date.parse(A.headers["retry-after"])-Date.now();if(u<=0){u=1}}else{u*=1e3}}const I=p.retry;const w=Fo({attemptCount:y,retryOptions:I,error:E,retryAfter:u,computedValue:I.maxRetryAfter??p.timeout.request??Number.POSITIVE_INFINITY});if(I.enforceRetryRules&&w===0){C=0}else{C=await I.calculateDelay({attemptCount:y,retryOptions:I,error:E,retryAfter:u,computedValue:w})}}catch(u){void this._error(new RequestError(u.message,u,this));return}if(C){await new Promise((u=>{const A=setTimeout(u,C);this._stopRetry=()=>{clearTimeout(A);u()}}));if(this.destroyed){return}const A=this.options.body;try{for(const u of this.options.hooks.beforeRetry){await u(E,this.retryCount+1)}}catch(u){void this._error(new RequestError(u.message,u,this));return}if(this.destroyed){return}const y=this.options.body;const I=A!==y;if(I){const u=A;this.options.body=undefined;this.destroy();if(Pi.nodeStream(u)&&u!==y){u.destroy()}if(Pi.nodeStream(y)&&(y.readableEnded||y.destroyed)){throw new TypeError("The reassigned stream body must be readable. Ensure you provide a fresh, readable stream in the beforeRetry hook.")}this.options._internals.body=y}else{this.destroy()}publishRetry({requestId:this._requestId,retryCount:this.retryCount+1,error:E,delay:C});this.emit("retry",this.retryCount+1,u,(u=>{const A=new Request(p.url,u,p);A.retryCount=this.retryCount+1;un.nextTick((()=>{void A.flush()}));return A}));return}}void this._error(E)})()}_read(){this._triggerRead=true;const{response:u}=this;if(u&&!this._stopReading){if(u.readableLength){this._triggerRead=false}let A;while((A=u.read())!==null){this._downloadedSize+=A.length;const u=this.downloadProgress;if(u.percent<1){this.emit("downloadProgress",u)}this.push(A)}}}_write(u,A,p){const write=()=>{this._writeRequest(u,A,p)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(u){const endRequest=()=>{if(!this._request||this._request.destroyed){u();return}this._request.end((A=>{if(this._request?._writableState?.errored){return}if(!A){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request?.emit("upload-complete")}u(A)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(u,A){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();this._removeListeners();if(this.options){const{body:u}=this.options;if(Pi.nodeStream(u)){u.destroy()}}if(this._request){this._request.destroy()}const p=this._request?.timings;if(p&&Pi.undefined(p.end)&&!Pi.undefined(p.response)&&Pi.undefined(p.error)&&Pi.undefined(p.abort)){p.end=Date.now();if(Pi.undefined(p.phases.total)){p.phases.download=p.end-p.response;p.phases.total=p.end-p.start}}if(u!==null&&!Pi.undefined(u)){const A=u instanceof Error&&ia.has(u);if(!A&&!(u instanceof RequestError)){u=u instanceof Error?new RequestError(u.message,u,this):new RequestError(String(u),{},this)}}A(u)}pipe(u,A){if(u instanceof Mi.ServerResponse){this._pipedServerResponses.add(u)}return super.pipe(u,A)}unpipe(u){if(u instanceof Mi.ServerResponse){this._pipedServerResponses.delete(u)}super.unpipe(u);return this}_checkContentLengthMismatch(){if(this.options.strictContentLength&&this._expectedContentLength!==undefined){const u=this._compressedBytesCount??this._downloadedSize;if(u!==this._expectedContentLength){this._beforeError(new ReadError({message:`Content-Length mismatch: expected ${this._expectedContentLength} bytes, received ${u} bytes`,name:"Error",code:"ERR_HTTP_CONTENT_LENGTH_MISMATCH"},this));return true}}return false}async _finalizeBody(){const{options:u}=this;const{headers:A}=u;const p=!Pi.undefined(u.form);const y=!Pi.undefined(u.json);const E=!Pi.undefined(u.body);const C=ea.has(u.method)&&!(u.method==="GET"&&u.allowGetBody);if(p||y||E){if(C){throw new TypeError(`The \`${u.method}\` method cannot be used with a body`)}const y=!Pi.string(A["content-type"]);if(E){if(lib_isFormData(u.body)){const p=new Bo(u.body);if(y){A["content-type"]=p.headers["Content-Type"]}if("Content-Length"in p.headers){A["content-length"]=p.headers["Content-Length"]}u.body=p.encode()}if(is_form_data_isFormData(u.body)&&y){A["content-type"]=`multipart/form-data; boundary=${u.body.getBoundary()}`}}else if(p){if(y){A["content-type"]="application/x-www-form-urlencoded"}const{form:p}=u;u.form=undefined;u.body=new URLSearchParams(p).toString()}else{if(y){A["content-type"]="application/json"}const{json:p}=u;u.json=undefined;u.body=u.stringifyJson(p)}const I=await getBodySize(u.body,u.headers);if(Pi.undefined(A["content-length"])&&Pi.undefined(A["transfer-encoding"])&&!C&&!Pi.undefined(I)){A["content-length"]=String(I)}}if(u.responseType==="json"&&!("accept"in u.headers)){u.headers.accept="application/json"}this._bodySize=Number(A["content-length"])||undefined}async _onResponseBase(u){if(this.isAborted){return}const{options:A}=this;const{url:p}=A;this._nativeResponse=u;const y=u.statusCode;const{method:E}=A;const C=E==="HEAD"||y>=100&&y<200||y===204||y===205||y===304;if(A.decompress&&!C){if(A.strictContentLength){this._compressedBytesCount=0;this._nativeResponse.on("data",(u=>{this._compressedBytesCount+=byteLength(u)}))}u=decompressResponse(u)}const I=u;I.statusMessage=I.statusMessage||Mi.STATUS_CODES[y];I.url=A.url.toString();I.requestUrl=this.requestUrl;I.redirectUrls=this.redirectUrls;I.request=this;I.isFromCache=this._nativeResponse.fromCache??false;I.ip=this.ip;I.retryCount=this.retryCount;I.ok=isResponseOk(I);this._isFromCache=I.isFromCache;this._responseSize=Number(u.headers["content-length"])||undefined;this.response=I;publishResponseStart({requestId:this._requestId,url:I.url,statusCode:y,headers:u.headers,isFromCache:I.isFromCache});u.once("error",(A=>{this._aborted=true;u.destroy();this._beforeError(new ReadError(A,this))}));u.once("aborted",(()=>{this._aborted=true;if(!this._checkContentLengthMismatch()){this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}}));const w=u.headers["set-cookie"];if(Pi.object(A.cookieJar)&&w){let u=w.map((async u=>A.cookieJar.setCookie(u,p.toString())));if(A.ignoreInvalidCookies){u=u.map((async u=>{try{await u}catch{}}))}try{await Promise.all(u)}catch(u){this._beforeError(u);return}}if(this.isAborted){return}if(u.headers.location&&ra.has(y)){const E=typeof A.followRedirect==="function"?A.followRedirect(I):A.followRedirect;if(E){u.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=A.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;this._downloadedSize=0;const E=new Options(undefined,undefined,this.options);const C=y===303&&E.method!=="GET"&&E.method!=="HEAD";const w=y!==307&&y!==308;const v=E.methodRewriting&&w;if(C||v){E.method="GET";E.body=undefined;E.json=undefined;E.form=undefined;delete E.headers["content-length"]}try{const A=Rs.Buffer.from(u.headers.location,"binary").toString();const C=new URL(A,p);if(!isUnixSocketURL(p)&&isUnixSocketURL(C)){this._beforeError(new RequestError("Cannot redirect to UNIX socket",{},this));return}const w=C.hostname!==p.hostname||C.port!==p.port||getUnixSocketPath(p)!==getUnixSocketPath(C);if(w){if("host"in E.headers){delete E.headers.host}if("cookie"in E.headers){delete E.headers.cookie}if("authorization"in E.headers){delete E.headers.authorization}if(E.username||E.password){E.username="";E.password=""}}else{C.username=E.username;C.password=E.password}this.redirectUrls.push(C);E.url=C;for(const u of E.hooks.beforeRedirect){await u(E,I)}publishRedirect({requestId:this._requestId,fromUrl:p.toString(),toUrl:C.toString(),statusCode:y});this.emit("redirect",E,I);this.options=E;await this._makeRequest()}catch(u){this._beforeError(u);return}return}}if(A.isStream&&A.throwHttpErrors&&!isResponseOk(I)){this._beforeError(new HTTPError(I));return}const v=u!==this._nativeResponse;if(!C&&(!v||A.strictContentLength)){const u=this._nativeResponse.headers["content-length"];if(u!==undefined){const A=Number(u);if(!Number.isNaN(A)&&A>=0){this._expectedContentLength=A}}}u.once("end",(()=>{if(this._checkContentLengthMismatch()){return}this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress);publishResponseEnd({requestId:this._requestId,url:I.url,statusCode:y,bodySize:this._downloadedSize,timings:this.timings});this.push(null)}));this.emit("downloadProgress",this.downloadProgress);u.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{u.resume()}));this.on("pause",(()=>{u.pause()}));if(this._noPipe){const A=await this._setRawBody();if(A){this.emit("response",u)}return}this.emit("response",u);for(const A of this._pipedServerResponses){if(A.headersSent){continue}const p=u!==this._nativeResponse;for(const y in u.headers){if(Object.hasOwn(u.headers,y)){const E=u.headers[y];if(p&&(y==="content-encoding"||y==="content-length")){continue}if(E!==undefined){A.setHeader(y,E)}}}A.statusCode=y}}async _setRawBody(u=this){if(u.readableEnded){return false}try{const A=await u.toArray();const p=isBuffer(A.at(0))?Rs.Buffer.concat(A):Rs.Buffer.from(A.join(""));if(!this.isAborted){this.response.rawBody=p;return true}}catch{}return false}async _onResponse(u){try{await this._onResponseBase(u)}catch(u){this._beforeError(u)}}_onRequest(u){const{options:A}=this;const{timeout:p,url:y}=A;publishRequestStart({requestId:this._requestId,url:y?.toString()??"",method:A.method,headers:A.headers});Do(u);this._cancelTimeouts=timedOut(u,p,y);if(this.options.http2){u.removeAllListeners("timeout");u.once("socket",(u=>{u.removeAllListeners("timeout")}))}const E=A.cache?"cacheableResponse":"response";u.once(E,(u=>{void this._onResponse(u)}));u.once("error",(A=>{this._aborted=true;u.destroy();A=A instanceof timed_out_TimeoutError?new TimeoutError(A,this.timings,this):new RequestError(A.message,A,this);this._beforeError(A)}));this._unproxyEvents=proxyEvents(u,this,oa);this._request=u;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",u)}async _asyncWrite(u){return new Promise(((A,p)=>{super.write(u,(u=>{if(u){p(u);return}A()}))}))}_sendBody(){const{body:u}=this.options;const A=this.redirectUrls.length===0?this:this._request??this;if(Pi.nodeStream(u)){u.pipe(A)}else if(Pi.buffer(u)){this._writeRequest(u,undefined,(()=>{}));A.end()}else if(Pi.typedArray(u)){const p=u;const y=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);this._writeRequest(y,undefined,(()=>{}));A.end()}else if(Pi.asyncIterable(u)||Pi.iterable(u)&&!Pi.string(u)&&!isBuffer(u)){(async()=>{try{for await(const A of u){await this._asyncWrite(A)}super.end()}catch(u){this._beforeError(u)}})()}else if(Pi.undefined(u)){const u=ea.has(this.options.method)&&!(this.options.method==="GET"&&this.options.allowGetBody);if((this._noPipe??false)||u||A!==this){A.end()}}else{this._writeRequest(u,undefined,(()=>{}));A.end()}}_prepareCache(u){if(ta.has(u)){return}const A=new io(((u,A)=>{const p=A?p=>{const{beforeCacheHooks:y,gotRequest:E}=u;if(!y||y.length===0){A(p);return}try{for(const u of y){const y=u(p);if(y===false){p.headers["cache-control"]="no-cache, no-store, must-revalidate";p.headers.pragma="no-cache";p.headers.expires="0";A(p);return}if(Pi.promise(y)){throw new TypeError("beforeCache hooks must be synchronous. The hook returned a Promise, but this hook must return synchronously. If you need async logic, use beforeRequest hook instead.")}if(y!==undefined){throw new TypeError("beforeCache hook must return false or undefined. To modify the response, mutate it directly.")}}}catch(u){if(E){E._beforeError(u instanceof RequestError?u:new RequestError(u.message,u,E));return}console.error("Got: beforeCache hook error (request context unavailable):",u);A(p);return}A(p)}:A;const y=u._request(u,p);if(Pi.promise(y)){y.once=(u,A)=>{if(u==="error"){(async()=>{try{await y}catch(u){A(u)}})()}else if(u==="abort"||u==="destroy"){(async()=>{try{const p=await y;p.once(u,A)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${u}`)}return y}}return y}),u);ta.set(u,A.request())}async _createCacheableRequest(u,A){return new Promise(((p,y)=>{Object.assign(A,urlToOptions(u));let E;const C=ta.get(A.cache)(A,(async u=>{u._readableState.autoDestroy=false;if(E){const fix=()=>{if(u.req){u.complete=u.req.res.complete}else if(u.complete===undefined){u.complete=true}};u.prependOnceListener("end",fix);fix();(await E).emit("cacheableResponse",u)}p(u)}));C.once("error",y);C.once("request",(async u=>{E=u;p(E)}))}))}async _makeRequest(){const{options:u}=this;const{headers:A,username:p,password:y}=u;const E=u.cookieJar;for(const u in A){if(Pi.undefined(A[u])){delete A[u]}else if(Pi.null(A[u])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${u}\` header`)}}if(u.decompress&&Pi.undefined(A["accept-encoding"])){const u=["gzip","deflate"];if(Xo){u.push("br")}if(Zo){u.push("zstd")}A["accept-encoding"]=u.join(", ")}if(p||y){const u=Rs.Buffer.from(`${p}:${y}`).toString("base64");A.authorization=`Basic ${u}`}if(E){const p=await E.getCookieString(u.url.toString());if(Pi.nonEmptyString(p)){A.cookie=p}}let C;for(const A of u.hooks.beforeRequest){const p=await A(u,{retryCount:this.retryCount});if(!Pi.undefined(p)){C=()=>p;break}}C||=u.getRequestFunction();const I=u.url;this._requestOptions=u.createNativeRequestOptions();if(u.cache){this._requestOptions._request=C;this._requestOptions.cache=u.cache;this._requestOptions.body=u.body;this._requestOptions.beforeCacheHooks=u.hooks.beforeCache;this._requestOptions.gotRequest=this;try{this._prepareCache(u.cache)}catch(u){throw new CacheError(u,this)}}const w=u.cache?this._createCacheableRequest:C;try{let A=w(I,this._requestOptions);if(Pi.promise(A)){A=await A}if(Pi.undefined(A)){A=u.getFallbackRequestFunction()(I,this._requestOptions);if(Pi.promise(A)){A=await A}}if(Ko(A)){this._onRequest(A)}else if(this.writableEnded){void this._onResponse(A)}else{this.once("finish",(()=>{void this._onResponse(A)}));this._sendBody()}}catch(u){if(u instanceof types_CacheError){throw new CacheError(u,this)}throw u}}async _error(u){try{if(this.options&&u instanceof HTTPError&&!this.options.throwHttpErrors){}else if(this.options){const A=this.options.hooks.beforeError;if(A.length>0){for(const p of A){u=await p(u);if(!(u instanceof Error)){throw new TypeError(`The \`beforeError\` hook must return an Error instance. Received ${Pi.string(u)?"string":String(typeof u)}.`)}}if(!(u instanceof RequestError)){ia.add(u)}}}}catch(A){u=new RequestError(A.message,A,this)}publishError({requestId:this._requestId,url:this.options?.url?.toString()??"",error:u,timings:this.timings});this.destroy(u);if(this._noPipe){un.nextTick((()=>{this.emit("error",u)}))}}_writeRequest(u,A,p){if(!this._request||this._request.destroyed){p();return}this._request.write(u,A,(y=>{if(!y&&!this._request.destroyed){const p=typeof u==="string"?Rs.Buffer.from(u,A):u;this._uploadedSize+=byteLength(p);const y=this.uploadProgress;if(y.percent<1){this.emit("uploadProgress",y)}}p(y)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let u;if(this._responseSize){u=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){u=1}else{u=0}return{percent:u,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let u;if(this._bodySize){u=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){u=1}else{u=0}return{percent:u,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}get isReadonly(){return!Pi.undefined(this.options?.body)||!Pi.undefined(this.options?.json)||!Pi.undefined(this.options?.form)}}class types_CancelError extends RequestError{constructor(u){super("Promise was canceled",{},u);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const aa=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(u){let A;let p;let y;const E=new Le.EventEmitter;let C=false;const I=new PCancelable(((w,v,B)=>{B((()=>{A.destroy()}));B.shouldReject=false;B((()=>{C=true;v(new types_CancelError(A))}));const makeRequest=S=>{B((()=>{}));const D=u??new Request(undefined,undefined,y);D.retryCount=S;D._noPipe=true;A=D;D.once("response",(async u=>{const A=(u.headers["content-encoding"]??"").toLowerCase();const y=A==="gzip"||A==="deflate"||A==="br"||A==="zstd";const{options:E}=D;if(y&&!E.decompress){u.body=u.rawBody}else{try{u.body=parseBody(u,E.responseType,E.parseJson,E.encoding)}catch(A){try{u.body=u.rawBody.toString()}catch(A){D._beforeError(new ParseError(A,u));return}if(isResponseOk(u)){D._beforeError(A);return}}}try{const A=E.hooks.afterResponse;for(const[p,y]of A.entries()){u=await y(u,(async u=>{const A=u.preserveHooks??false;E.merge(u);E.prefixUrl="";if(u.url){E.url=u.url}if(!A){E.hooks.afterResponse=E.hooks.afterResponse.slice(0,p)}throw new RetryError(D)}));if(!(Pi.object(u)&&Pi.number(u.statusCode)&&"body"in u)){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(u){D._beforeError(u);return}p=u;if(!isResponseOk(u)){D._beforeError(new HTTPError(u));return}D.destroy();C=true;w(D.options.resolveBodyOnly?u.body:u)}));let k=false;const onError=u=>{if(I.isCanceled){return}if(!D._stopReading){D._beforeError(u);return}if(k){return}k=true;C=true;const{options:A}=D;if(u instanceof HTTPError&&!A.throwHttpErrors){const{response:A}=u;D.destroy();w(D.options.resolveBodyOnly?A.body:A);return}v(u)};D.on("error",onError);const Q=D.options?.body;D.once("retry",((A,p)=>{u=undefined;if(C){return}const E=D.options.body;if(Q===E&&Pi.nodeStream(E)){p.message="Cannot retry with consumed body stream";onError(p);return}y=D.options;makeRequest(A)}));proxyEvents(D,E,aa);if(Pi.undefined(u)){void D.flush()}};makeRequest(0)}));I.on=(u,A)=>{E.on(u,A);return I};I.off=(u,A)=>{E.off(u,A);return I};const shortcut=(u,A)=>{const y=(async()=>{await u;const{options:y}=p.request;return parseBody(p,A,y.parseJson,y.encoding)})();Object.defineProperties(y,Object.getOwnPropertyDescriptors(u));return y};I.json=function(){if(A.options){const{headers:u}=A.options;if(!A.writableFinished&&!("accept"in u)){u.accept="application/json"}}return shortcut(this,"json")};I.buffer=function(){return shortcut(this,"buffer")};I.text=function(){return shortcut(this,"text")};return I}const isGotInstance=u=>Pi.function(u);const la=["get","post","put","patch","head","delete"];const create=u=>{u={options:new Options(undefined,undefined,u.options),handlers:[...u.handlers],mutableDefaults:u.mutableDefaults};Object.defineProperty(u,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(A,p,y=u.options)=>{const E=new Request(A,p,y);let C;const lastHandler=u=>{E.options=u;E._noPipe=!u?.isStream;void E.flush();if(u?.isStream){return E}C||=asPromise(E);return C};let I=0;const iterateHandlers=A=>{const p=u.handlers[I++]??lastHandler;const y=p(A,iterateHandlers);if(Pi.promise(y)&&!E.options?.isStream){C||=asPromise(E);if(y!==C){const u=Object.getOwnPropertyDescriptors(C);for(const A in u){if(A in y){delete u[A]}}Object.defineProperties(y,u);y.cancel=C.cancel}}return y};return iterateHandlers(E.options)};got.extend=(...A)=>{const p=new Options(undefined,undefined,u.options);const y=[...u.handlers];let E;for(const u of A){if(isGotInstance(u)){p.merge(u.defaults.options);y.push(...u.defaults.handlers);E=u.defaults.mutableDefaults}else{p.merge(u);if(u.handlers){y.push(...u.handlers)}E=u.mutableDefaults}}return create({options:p,handlers:y,mutableDefaults:Boolean(E)})};const paginateEach=async function*(A,p){let y=new Options(A,p,u.options);y.resolveBodyOnly=false;const{pagination:E}=y;Ti.function(E.transform);Ti.function(E.shouldContinue);Ti.function(E.filter);Ti.function(E.paginate);Ti.number(E.countLimit);Ti.number(E.requestLimit);Ti.number(E.backoff);const C=[];let{countLimit:I}=E;let w=0;while(w<E.requestLimit){if(w!==0){await(0,Dr.setTimeout)(E.backoff)}const u=await got(undefined,undefined,y);const A=await E.transform(u);const p=[];Ti.array(A);for(const u of A){if(E.filter({item:u,currentItems:p,allItems:C})){if(!E.shouldContinue({item:u,currentItems:p,allItems:C})){return}yield u;if(E.stackAllItems){C.push(u)}p.push(u);if(--I<=0){return}}}const v=E.paginate({response:u,currentItems:p,allItems:C});if(v===false){return}if(v===u.request.options){y=u.request.options}else{y.merge(v);try{Ti.any([Pi.urlInstance,Pi.undefined],v.url)}catch(u){if(u instanceof Error){u.message=`Option 'pagination.paginate.url': ${u.message}`}throw u}if(v.url!==undefined){y.prefixUrl="";y.url=v.url}}w++}};got.paginate=paginateEach;got.paginate.all=async(u,A)=>{const p=[];for await(const y of paginateEach(u,A)){p.push(y)}return p};got.paginate.each=paginateEach;got.stream=(u,A)=>got(u,{...A,isStream:true});for(const u of la){got[u]=(A,p)=>got(A,{...p,method:u});got.stream[u]=(A,p)=>got(A,{...p,method:u,isStream:true})}if(!u.mutableDefaults){Object.freeze(u.handlers);u.options.freeze()}Object.defineProperty(got,"defaults",{value:u,writable:false,configurable:false,enumerable:true});return got};const ca=create;const da={options:new Options,handlers:[],mutableDefaults:false};const fa=ca(da);const ha=fa;var pa=p(2473);const ga=Zt.homedir();const{env:ma}=process;const Ca=ma.XDG_DATA_HOME||(ga?E.join(ga,".local","share"):undefined);const ba=ma.XDG_CONFIG_HOME||(ga?E.join(ga,".config"):undefined);const va=ma.XDG_STATE_HOME||(ga?E.join(ga,".local","state"):undefined);const Sa=ma.XDG_CACHE_HOME||(ga?E.join(ga,".cache"):undefined);const ka=ma.XDG_RUNTIME_DIR||undefined;const Qa=(ma.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(Ca){Qa.unshift(Ca)}const Fa=(ma.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(ba){Fa.unshift(ba)}const{mkdir:xa,createWriteStream:_a,move:Na}=vi;const Ga=(0,Fe.dirname)((0,we.fileURLToPath)(import.meta.url));const ja=`microsoft/ripgrep-prebuilt`;const qa=process.env.RIPGREP_VERSION||"v13.0.0-10";const Va=(0,Fe.join)(Ga,"../bin");const getTarget=()=>{const u=process.env.npm_config_arch||Qr.arch();const A=process.env.platform||Qr.platform();switch(A){case"darwin":switch(u){case"arm64":return"aarch64-apple-darwin.tar.gz";default:return"x86_64-apple-darwin.tar.gz"}case"win32":switch(u){case"x64":return"x86_64-pc-windows-msvc.zip";case"arm":return"aarch64-pc-windows-msvc.zip";default:return"i686-pc-windows-msvc.zip"}case"linux":switch(u){case"x64":return"x86_64-unknown-linux-musl.tar.gz";case"arm":case"armv7l":return"arm-unknown-linux-gnueabihf.tar.gz";case"arm64":return"aarch64-unknown-linux-gnu.tar.gz";case"ppc64":return"powerpc64le-unknown-linux-gnu.tar.gz";case"s390x":return"s390x-unknown-linux-gnu.tar.gz";default:return"i686-unknown-linux-musl.tar.gz"}default:throw new VError("Unknown platform: "+A)}};const downloadFile=async(u,A)=>{let p=undefined;try{p=await vi.mkdtemp(E.join(Qr.tmpdir(),"download-ripgrep"));const y=E.join(p,"tmp-file");await(0,Os.pipeline)(ha.stream(u),_a(y));await xa((0,Fe.dirname)(A),{recursive:true});await Na(y,A)}catch(A){throw new VError(A,`Failed to download "${u}"`)}finally{if(p){await vi.rm(p,{recursive:true,force:true})}}};const unzip=async(u,A)=>{try{await xa(A,{recursive:true});await wi(u,{dir:A})}catch(A){throw new VError(A,`Failed to unzip "${u}"`)}};const untarGz=async(u,A)=>{try{await xa(A,{recursive:true});await Ai("tar",["xvf",u,"-C",A])}catch(A){throw new VError(A,`Failed to extract "${u}"`)}};const downloadRipGrep=async u=>{const A=getTarget();const p=`https://github.com/${ja}/releases/download/${qa}/ripgrep-${qa}-${A}`;const y=`${Sa}/vscode-ripgrep/ripgrep-${qa}-${A}`;const E=u??Va;if(!await(0,pa.s)(y)){await downloadFile(p,y)}else{console.info(`File ${y} has been cached`)}if(y.endsWith(".tar.gz")){await untarGz(y,E)}else if(y.endsWith(".zip")){await unzip(y,E)}else{throw new VError(`Invalid downloadPath ${y}`)}};const Ka=(0,Fe.dirname)((0,we.fileURLToPath)(import.meta.url));const Ya=(0,Fe.join)(Ka,"..","bin",`rg${process.platform==="win32"?".exe":""}`);const escapeRegex=u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const readGitignorePatterns=async()=>{try{const u=C().resolve(B.$.WORKSPACE_DIR,".gitignore");const A=await(0,y.readFile)(u,"utf-8");return A.split("\n").filter((u=>u.trim()&&!u.trim().startsWith("#"))).map((u=>u.trim())).map((u=>u.endsWith("/")?`${u}**`:u)).filter((u=>!u.startsWith(".codegen")))}catch{return[]}};const buildMatcher=(u,A,p)=>{const y=A?escapeRegex(u):u;const E=p?"g":"gi";return new RegExp(y,E)};const searchTextFallback=async u=>{const{pattern:A,dir_path:p=".",include:E,case_sensitive:I=false,fixed_strings:w,context:v}=u;const S=C().resolve(B.$.WORKSPACE_DIR,p);const D=await readGitignorePatterns();const k=await Yt(E||"**/*",{cwd:S,absolute:true,nodir:true,dot:false,ignore:D,nocase:!I});const Q=buildMatcher(A,w,I);const F=[];for(const u of k){let A;try{A=await(0,y.readFile)(u,"utf-8")}catch{continue}const p=A.split(/\r?\n/);for(let A=0;A<p.length;A++){const y=p[A];if(y===undefined)continue;Q.lastIndex=0;if(!Q.test(y))continue;const E=v?Math.max(0,A-v):A;const I=v?Math.min(p.length-1,A+v):A;for(let A=E;A<=I;A++){const y=p[A];if(y===undefined)continue;F.push({file:C().relative(B.$.WORKSPACE_DIR,u),line:A+1,content:y})}A=I}}return{matches:F}};const withSuppressedConsoleInfo=async u=>{const A=console.info;try{console.info=()=>{};return await u()}finally{console.info=A}};const ensureRipgrepAvailable=async()=>{try{const u=Re().mkdtempSync(C().join(en().tmpdir(),"ripgrep-"));await withSuppressedConsoleInfo((()=>downloadRipGrep(u)));return C().join(u,"rg")}catch(u){return null}};const SearchText=async u=>{if(B.$.DISABLE_RIPGREP){return await searchTextFallback(u)}const A=await ensureRipgrepAvailable();if(!A){return await searchTextFallback(u)}const{pattern:p,dir_path:y=".",include:E,case_sensitive:I,fixed_strings:w,context:v}=u;const S=C().resolve(B.$.WORKSPACE_DIR,y);const D=["--json"];if(!I){D.push("--ignore-case")}if(w){D.push("--fixed-strings");D.push(p)}else{D.push("--regexp",p)}if(v){D.push("--context",v.toString())}if(E){D.push("--glob",E)}D.push(S);try{const u=await new Promise(((u,p)=>{const y=(0,Xt.spawn)(A,D,{windowsHide:true});const E=[];const C=[];y.stdout.on("data",(u=>E.push(u)));y.stderr.on("data",(u=>C.push(u)));y.on("error",(u=>p(u)));y.on("close",(A=>{if(A===0){u(Buffer.concat(E).toString("utf8"))}else if(A===1){u("")}else{p(new Error(`ripgrep exited with code ${A}: ${Buffer.concat(C).toString("utf8")}`))}}))}));const p=u.trim().split("\n").map((u=>{try{const A=JSON.parse(u);if(A.type==="match"){const u=A.data;return{file:C().relative(B.$.WORKSPACE_DIR,u.path.text),line:u.line_number,content:u.lines.text.trimEnd()}}}catch{}return null})).filter(Boolean);return{matches:p}}catch{return await searchTextFallback(u)}};const WriteFile=async u=>{const{file_path:A,content:p}=u;if(!A){return{error:"Missing parameter: file_path must be provided."}}if(p===undefined){return{error:"Missing parameter: content must be provided."}}try{const u=C().resolve(B.$.WORKSPACE_DIR,A);const E=C().dirname(u);await(0,y.mkdir)(E,{recursive:true});await(0,y.writeFile)(u,p,"utf-8");return{success:true}}catch(u){return{error:u.message}}};const Edit=async u=>{const{file_path:A,old_string:p,new_string:E,expected_replacements:I=1}=u;if(!A){return{error:"Missing parameter: file_path must be provided."}}if(p===undefined){return{error:"Missing parameter: old_string must be provided."}}if(E===undefined){return{error:"Missing parameter: new_string must be provided."}}try{const u=C().resolve(B.$.WORKSPACE_DIR,A);let w="";try{w=await(0,y.readFile)(u,"utf-8")}catch(u){if(u.code!=="ENOENT"){throw u}}const v=new RegExp(p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");let S=0;const D=w.replace(v,(()=>{S++;return E}));if(S!==I){return{error:`Expected ${I} replacements, but made ${S}.`}}await(0,y.writeFile)(u,D,"utf-8");return{success:true,replacementsMade:S}}catch(u){return{error:u.message}}};const ReadManyFiles=async u=>{const{include:A,exclude:p=[]}=u;if(!A||A.length===0){return{error:"Missing parameter: include must be provided."}}try{const u=await Yt(A,{cwd:B.$.WORKSPACE_DIR,ignore:p,nodir:true,absolute:true});let E="";for(const A of u){const u=await(0,y.readFile)(A,"utf-8");E+=`--- ${C().relative(B.$.WORKSPACE_DIR,A)} ---\n\n${u}\n\n`}E+="--- End of content ---";return{content:E}}catch(u){return{error:u.message}}};const SaveMemory=async u=>{const{fact:A}=u;if(!A){return{error:"Missing parameter: fact must be provided."}}const p=C().join(en().homedir(),".codegen","CODEGEN.md");const E="## CodeGen Added Memories";try{await Re().promises.mkdir(C().dirname(p),{recursive:true});let u="";try{u=await(0,y.readFile)(p,"utf-8")}catch(u){if(u.code!=="ENOENT"){throw u}}const I=`- ${A.trim()}`;let w="";if(u.includes(E)){w=u.replace(E,`${E}\n${I}`)}else{w=`${u}\n\n${E}\n${I}\n`}await(0,y.writeFile)(p,w,"utf-8");return{success:true}}catch(u){return{error:u.message}}};var el;(function(u){u["Root"]="root";u["Text"]="text";u["Directive"]="directive";u["Comment"]="comment";u["Script"]="script";u["Style"]="style";u["Tag"]="tag";u["CDATA"]="cdata";u["Doctype"]="doctype"})(el||(el={}));function esm_isTag(u){return u.type===el.Tag||u.type===el.Script||u.type===el.Style}const tl=el.Root;const nl=el.Text;const rl=el.Directive;const sl=el.Comment;const il=el.Script;const ol=el.Style;const al=el.Tag;const ll=el.CDATA;const cl=el.Doctype;class Node{constructor(){this.parent=null;this.prev=null;this.next=null;this.startIndex=null;this.endIndex=null}get parentNode(){return this.parent}set parentNode(u){this.parent=u}get previousSibling(){return this.prev}set previousSibling(u){this.prev=u}get nextSibling(){return this.next}set nextSibling(u){this.next=u}cloneNode(u=false){return cloneNode(this,u)}}class DataNode extends Node{constructor(u){super();this.data=u}get nodeValue(){return this.data}set nodeValue(u){this.data=u}}class node_Text extends DataNode{constructor(){super(...arguments);this.type=el.Text}get nodeType(){return 3}}class node_Comment extends DataNode{constructor(){super(...arguments);this.type=el.Comment}get nodeType(){return 8}}class ProcessingInstruction extends DataNode{constructor(u,A){super(A);this.name=u;this.type=el.Directive}get nodeType(){return 1}}class NodeWithChildren extends Node{constructor(u){super();this.children=u}get firstChild(){var u;return(u=this.children[0])!==null&&u!==void 0?u:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(u){this.children=u}}class node_CDATA extends NodeWithChildren{constructor(){super(...arguments);this.type=el.CDATA}get nodeType(){return 4}}class Document extends NodeWithChildren{constructor(){super(...arguments);this.type=el.Root}get nodeType(){return 9}}class Element extends NodeWithChildren{constructor(u,A,p=[],y=(u==="script"?el.Script:u==="style"?el.Style:el.Tag)){super(p);this.name=u;this.attribs=A;this.type=y}get nodeType(){return 1}get tagName(){return this.name}set tagName(u){this.name=u}get attributes(){return Object.keys(this.attribs).map((u=>{var A,p;return{name:u,value:this.attribs[u],namespace:(A=this["x-attribsNamespace"])===null||A===void 0?void 0:A[u],prefix:(p=this["x-attribsPrefix"])===null||p===void 0?void 0:p[u]}}))}}function node_isTag(u){return esm_isTag(u)}function node_isCDATA(u){return u.type===el.CDATA}function node_isText(u){return u.type===el.Text}function node_isComment(u){return u.type===el.Comment}function isDirective(u){return u.type===el.Directive}function isDocument(u){return u.type===el.Root}function node_hasChildren(u){return Object.prototype.hasOwnProperty.call(u,"children")}function cloneNode(u,A=false){let p;if(node_isText(u)){p=new node_Text(u.data)}else if(node_isComment(u)){p=new node_Comment(u.data)}else if(node_isTag(u)){const y=A?cloneChildren(u.children):[];const E=new Element(u.name,{...u.attribs},y);y.forEach((u=>u.parent=E));if(u.namespace!=null){E.namespace=u.namespace}if(u["x-attribsNamespace"]){E["x-attribsNamespace"]={...u["x-attribsNamespace"]}}if(u["x-attribsPrefix"]){E["x-attribsPrefix"]={...u["x-attribsPrefix"]}}p=E}else if(node_isCDATA(u)){const y=A?cloneChildren(u.children):[];const E=new node_CDATA(y);y.forEach((u=>u.parent=E));p=E}else if(isDocument(u)){const y=A?cloneChildren(u.children):[];const E=new Document(y);y.forEach((u=>u.parent=E));if(u["x-mode"]){E["x-mode"]=u["x-mode"]}p=E}else if(isDirective(u)){const A=new ProcessingInstruction(u.name,u.data);if(u["x-name"]!=null){A["x-name"]=u["x-name"];A["x-publicId"]=u["x-publicId"];A["x-systemId"]=u["x-systemId"]}p=A}else{throw new Error(`Not implemented yet: ${u.type}`)}p.startIndex=u.startIndex;p.endIndex=u.endIndex;if(u.sourceCodeLocation!=null){p.sourceCodeLocation=u.sourceCodeLocation}return p}function cloneChildren(u){const A=u.map((u=>cloneNode(u,true)));for(let u=1;u<A.length;u++){A[u].prev=A[u-1];A[u-1].next=A[u]}return A}const ul={withStartIndices:false,withEndIndices:false,xmlMode:false};class esm_DomHandler{constructor(u,A,p){this.dom=[];this.root=new Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null;if(typeof A==="function"){p=A;A=ul}if(typeof u==="object"){A=u;u=undefined}this.callback=u!==null&&u!==void 0?u:null;this.options=A!==null&&A!==void 0?A:ul;this.elementCB=p!==null&&p!==void 0?p:null}onparserinit(u){this.parser=u}onreset(){this.dom=[];this.root=new Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null}onend(){if(this.done)return;this.done=true;this.parser=null;this.handleCallback(null)}onerror(u){this.handleCallback(u)}onclosetag(){this.lastNode=null;const u=this.tagStack.pop();if(this.options.withEndIndices){u.endIndex=this.parser.endIndex}if(this.elementCB)this.elementCB(u)}onopentag(u,A){const p=this.options.xmlMode?el.Tag:undefined;const y=new Element(u,A,undefined,p);this.addNode(y);this.tagStack.push(y)}ontext(u){const{lastNode:A}=this;if(A&&A.type===el.Text){A.data+=u;if(this.options.withEndIndices){A.endIndex=this.parser.endIndex}}else{const A=new node_Text(u);this.addNode(A);this.lastNode=A}}oncomment(u){if(this.lastNode&&this.lastNode.type===el.Comment){this.lastNode.data+=u;return}const A=new node_Comment(u);this.addNode(A);this.lastNode=A}oncommentend(){this.lastNode=null}oncdatastart(){const u=new node_Text("");const A=new node_CDATA([u]);this.addNode(A);u.parent=A;this.lastNode=u}oncdataend(){this.lastNode=null}onprocessinginstruction(u,A){const p=new ProcessingInstruction(u,A);this.addNode(p)}handleCallback(u){if(typeof this.callback==="function"){this.callback(u,this.dom)}else if(u){throw u}}addNode(u){const A=this.tagStack[this.tagStack.length-1];const p=A.children[A.children.length-1];if(this.options.withStartIndices){u.startIndex=this.parser.startIndex}if(this.options.withEndIndices){u.endIndex=this.parser.endIndex}A.children.push(u);if(p){u.prev=p;p.next=u}u.parent=A;this.lastNode=null}}const dl=null&&esm_DomHandler;const fl=/\n/g;function leac_n(u){const A=[...u.matchAll(fl)].map((u=>u.index||0));A.unshift(-1);const p=t(A,0,A.length);return u=>r(p,u)}function t(u,A,p){if(p-A==1)return{offset:u[A],index:A+1};const y=Math.ceil((A+p)/2),E=t(u,A,y),C=t(u,y,p);return{offset:E.offset,low:E,high:C}}function r(u,A){return function(u){return Object.prototype.hasOwnProperty.call(u,"index")}(u)?{line:u.index,column:A-u.offset}:r(u.high.offset<A?u.high:u.low,A)}function leac_o(u,A="",p={}){const y="string"!=typeof A?A:p,E="string"==typeof A?A:"",C=u.map(s),I=!!y.lineNumbers;return function(u,A=0){const p=I?leac_n(u):()=>({line:0,column:0});let y=A;const w=[];e:for(;y<u.length;){let A=!1;for(const I of C){I.regex.lastIndex=y;const C=I.regex.exec(u);if(C&&C[0].length>0){if(!I.discard){const u=p(y),A="string"==typeof I.replace?C[0].replace(new RegExp(I.regex.source,I.regex.flags),I.replace):C[0];w.push({state:E,name:I.name,text:A,offset:y,len:C[0].length,line:u.line,column:u.column})}if(y=I.regex.lastIndex,A=!0,I.push){const A=I.push(u,y);w.push(...A.tokens),y=A.offset}if(I.pop)break e;break}}if(!A)break}return{tokens:w,offset:y,complete:u.length<=y}}}function s(u,A){return{...u,regex:l(u,A)}}function l(u,A){if(0===u.name.length)throw new Error(`Rule #${A} has empty name, which is not allowed.`);if(function(u){return Object.prototype.hasOwnProperty.call(u,"regex")}(u))return function(u){if(u.global)throw new Error(`Regular expression /${u.source}/${u.flags} contains the global flag, which is not allowed.`);return u.sticky?u:new RegExp(u.source,u.flags+"y")}(u.regex);if(function(u){return Object.prototype.hasOwnProperty.call(u,"str")}(u)){if(0===u.str.length)throw new Error(`Rule #${A} ("${u.name}") has empty "str" property, which is not allowed.`);return new RegExp(leac_c(u.str),"y")}return new RegExp(leac_c(u.name),"y")}function leac_c(u){return u.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function emit(u){return(A,p)=>({matched:true,position:p,value:u})}function make(u){return(A,p)=>({matched:true,position:p,value:u(A,p)})}function action(u){return(A,p)=>{u(A,p);return{matched:true,position:p,value:null}}}function fail(u,A){return{matched:false}}function error(u){return(A,p)=>{throw new Error(u instanceof Function?u(A,p):u)}}function token(u,A){return(p,y)=>{let E=y;let C=undefined;if(y<p.tokens.length){C=u(p.tokens[y],p,y);if(C!==undefined){E++}}else{A?.(p,y)}return C===undefined?{matched:false}:{matched:true,position:E,value:C}}}function any(u,A){return A<u.tokens.length?{matched:true,position:A+1,value:u.tokens[A]}:{matched:false}}function satisfy(u){return(A,p)=>p<A.tokens.length&&u(A.tokens[p],A,p)?{matched:true,position:p+1,value:A.tokens[p]}:{matched:false}}function mapInner(u,A){return u.matched?{matched:true,position:u.position,value:A(u.value,u.position)}:u}function mapOuter(u,A){return u.matched?A(u):u}function map(u,A){return(p,y)=>mapInner(u(p,y),((u,E)=>A(u,p,y,E)))}function map1(u,A){return(p,y)=>mapOuter(u(p,y),(u=>A(u,p,y)))}function peek(u,A){return(p,y)=>{const E=u(p,y);A(E,p,y);return E}}function core_option(u,A){return(p,y)=>{const E=u(p,y);return E.matched?E:{matched:true,position:y,value:A}}}function not(u){return(A,p)=>{const y=u(A,p);return y.matched?{matched:false}:{matched:true,position:p,value:true}}}function choice(...u){return(A,p)=>{for(const y of u){const u=y(A,p);if(u.matched){return u}}return{matched:false}}}function otherwise(u,A){return(p,y)=>{const E=u(p,y);return E.matched?E:A(p,y)}}function longest(...u){return(A,p)=>{let y=undefined;for(const E of u){const u=E(A,p);if(u.matched&&(!y||y.position<u.position)){y=u}}return y||{matched:false}}}function takeWhile(u,A){return(p,y)=>{const E=[];let C=true;do{const I=u(p,y);if(I.matched&&A(I.value,E.length+1,p,y,I.position)){E.push(I.value);y=I.position}else{C=false}}while(C);return{matched:true,position:y,value:E}}}function takeUntil(u,A){return takeWhile(u,((u,p,y,E,C)=>!A(u,p,y,E,C)))}function takeWhileP(u,A){return takeWhile(u,((u,p,y,E)=>A(y,E).matched))}function takeUntilP(u,A){return takeWhile(u,((u,p,y,E)=>!A(y,E).matched))}function many(u){return takeWhile(u,(()=>true))}function many1(u){return ab(u,many(u),((u,A)=>[u,...A]))}function ab(u,A,p){return(y,E)=>mapOuter(u(y,E),(u=>mapInner(A(y,u.position),((A,C)=>p(u.value,A,y,E,C)))))}function left(u,A){return ab(u,A,(u=>u))}function right(u,A){return ab(u,A,((u,A)=>A))}function abc(u,A,p,y){return(E,C)=>mapOuter(u(E,C),(u=>mapOuter(A(E,u.position),(A=>mapInner(p(E,A.position),((p,I)=>y(u.value,A.value,p,E,C,I)))))))}function middle(u,A,p){return abc(u,A,p,((u,A)=>A))}function core_all(...u){return(A,p)=>{const y=[];let E=p;for(const p of u){const u=p(A,E);if(u.matched){y.push(u.value);E=u.position}else{return{matched:false}}}return{matched:true,position:E,value:y}}}function skip(...u){return map(core_all(...u),(()=>null))}function flatten(...u){return flatten1(core_all(...u))}function flatten1(u){return map(u,(u=>u.flatMap((u=>u))))}function sepBy1(u,A){return ab(u,many(right(A,u)),((u,A)=>[u,...A]))}function sepBy(u,A){return otherwise(sepBy1(u,A),emit([]))}function chainReduce(u,A){return(p,y)=>{let E=true;let C=u;let I=y;do{const u=A(C,p,I)(p,I);if(u.matched){C=u.value;I=u.position}else{E=false}}while(E);return{matched:true,position:I,value:C}}}function reduceLeft(u,A,p){return chainReduce(u,(u=>map(A,((A,y,E,C)=>p(u,A,y,E,C)))))}function reduceRight(u,A,p){return map(many(u),((u,y,E,C)=>u.reduceRight(((u,A)=>p(A,u,y,E,C)),A)))}function leftAssoc1(u,A){return chain(u,(u=>reduceLeft(u,A,((u,A)=>A(u)))))}function rightAssoc1(u,A){return ab(reduceRight(u,(u=>u),((u,A)=>p=>u(A(p)))),A,((u,A)=>u(A)))}function leftAssoc2(u,A,p){return chain(u,(u=>reduceLeft(u,ab(A,p,((u,A)=>[u,A])),((u,[A,p])=>A(u,p)))))}function rightAssoc2(u,A,p){return ab(reduceRight(ab(u,A,((u,A)=>[u,A])),(u=>u),(([u,A],p)=>y=>A(u,p(y)))),p,((u,A)=>u(A)))}function condition(u,A,p){return(y,E)=>u(y,E)?A(y,E):p(y,E)}function decide(u){return(A,p)=>mapOuter(u(A,p),(u=>u.value(A,u.position)))}function chain(u,A){return(p,y)=>mapOuter(u(p,y),(u=>A(u.value,p,y,u.position)(p,u.position)))}function ahead(u){return(A,p)=>mapOuter(u(A,p),(u=>({matched:true,position:p,value:u.value})))}function recursive(u){return function(A,p){return u()(A,p)}}function start(u,A){return A!==0?{matched:false}:{matched:true,position:A,value:true}}function end(u,A){return A<u.tokens.length?{matched:false}:{matched:true,position:A,value:true}}function remainingTokensNumber(u,A){return u.tokens.length-A}function parserPosition(u,A,p,y=3){const E=u.tokens.length;const C=clamp(0,A-y,E-y);const I=clamp(y,A+1+y,E);const w=u.tokens.slice(C,I);const v=[];const B=String(I-1).length+1;if(A<0){v.push(`${String(A).padStart(B)} >>`)}if(0<C){v.push("...".padStart(B+6))}for(let u=0;u<w.length;u++){const y=C+u;v.push(`${String(y).padStart(B)} ${y===A?">":" "} ${escapeWhitespace(p(w[u]))}`)}if(I<E){v.push("...".padStart(B+6))}if(E<=A){v.push(`${String(A).padStart(B)} >>`)}return v.join("\n")}function parse(u,A,p,y=JSON.stringify){const E={tokens:A,options:p};const C=u(E,0);if(!C.matched){throw new Error("No match")}if(C.position<E.tokens.length){throw new Error(`Partial match. Parsing stopped at:\n${parserPosition(E,C.position,y)}`)}return C.value}function tryParse(u,A,p){const y=u({tokens:A,options:p},0);return y.matched?y.value:undefined}function core_match(u,A,p){const y=u({tokens:A,options:p},0);return y.value}var Al=Object.freeze({__proto__:null});const hl=`(?:[ \\t\\r\\n\\f]*)`;const pl=`(?:\\n|\\r\\n|\\r|\\f)`;const gl=`[^\\x00-\\x7F]`;const ml=`(?:\\\\[0-9a-f]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?)`;const yl=`(?:\\\\[^\\n\\r\\f0-9a-f])`;const El=`(?:[_a-z]|${gl}|${ml}|${yl})`;const Cl=`(?:[_a-z0-9-]|${gl}|${ml}|${yl})`;const Il=`(?:${Cl}+)`;const bl=`(?:[-]?${El}${Cl}*)`;const wl=`'([^\\n\\r\\f\\\\']|\\\\${pl}|${gl}|${ml}|${yl})*'`;const vl=`"([^\\n\\r\\f\\\\"]|\\\\${pl}|${gl}|${ml}|${yl})*"`;const Bl=leac_o([{name:"ws",regex:new RegExp(hl)},{name:"hash",regex:new RegExp(`#${Il}`,"i")},{name:"ident",regex:new RegExp(bl,"i")},{name:"str1",regex:new RegExp(wl,"i")},{name:"str2",regex:new RegExp(vl,"i")},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]);const Sl=leac_o([{name:"unicode",regex:new RegExp(ml,"i")},{name:"escape",regex:new RegExp(yl,"i")},{name:"any",regex:new RegExp("[\\s\\S]","i")}]);function sumSpec([u,A,p],[y,E,C]){return[u+y,A+E,p+C]}function sumAllSpec(u){return u.reduce(sumSpec,[0,0,0])}const Dl=token((u=>u.name==="unicode"?String.fromCodePoint(parseInt(u.text.slice(1),16)):undefined));const kl=token((u=>u.name==="escape"?u.text.slice(1):undefined));const Ql=token((u=>u.name==="any"?u.text:undefined));const Fl=map(many(choice(Dl,kl,Ql)),(u=>u.join("")));function parseley_unescape(u){const A=Sl(u);const p=Fl({tokens:A.tokens,options:undefined},0);return p.value}function literal(u){return token((A=>A.name===u?true:undefined))}const xl=token((u=>u.name==="ws"?null:undefined));const Rl=core_option(xl,null);function optionallySpaced(u){return middle(Rl,u,Rl)}const _l=token((u=>u.name==="ident"?parseley_unescape(u.text):undefined));const Tl=token((u=>u.name==="hash"?parseley_unescape(u.text.slice(1)):undefined));const Nl=token((u=>u.name.startsWith("str")?parseley_unescape(u.text.slice(1,-1)):undefined));const Ll=left(core_option(_l,""),literal("|"));const Pl=otherwise(ab(Ll,_l,((u,A)=>({name:A,namespace:u}))),map(_l,(u=>({name:u,namespace:null}))));const Ol=otherwise(ab(Ll,literal("*"),(u=>({type:"universal",namespace:u,specificity:[0,0,0]}))),map(literal("*"),(()=>({type:"universal",namespace:null,specificity:[0,0,0]}))));const Ml=map(Pl,(({name:u,namespace:A})=>({type:"tag",name:u,namespace:A,specificity:[0,0,1]})));const Ul=ab(literal("."),_l,((u,A)=>({type:"class",name:A,specificity:[0,1,0]})));const Hl=map(Tl,(u=>({type:"id",name:u,specificity:[1,0,0]})));const Gl=token((u=>{if(u.name==="ident"){if(u.text==="i"||u.text==="I"){return"i"}if(u.text==="s"||u.text==="S"){return"s"}}return undefined}));const Wl=otherwise(ab(Nl,core_option(right(Rl,Gl),null),((u,A)=>({value:u,modifier:A}))),ab(_l,core_option(right(xl,Gl),null),((u,A)=>({value:u,modifier:A}))));const jl=choice(map(literal("="),(()=>"=")),ab(literal("~"),literal("="),(()=>"~=")),ab(literal("|"),literal("="),(()=>"|=")),ab(literal("^"),literal("="),(()=>"^=")),ab(literal("$"),literal("="),(()=>"$=")),ab(literal("*"),literal("="),(()=>"*=")));const zl=abc(literal("["),optionallySpaced(Pl),literal("]"),((u,{name:A,namespace:p})=>({type:"attrPresence",name:A,namespace:p,specificity:[0,1,0]})));const $l=middle(literal("["),abc(optionallySpaced(Pl),jl,optionallySpaced(Wl),(({name:u,namespace:A},p,{value:y,modifier:E})=>({type:"attrValue",name:u,namespace:A,matcher:p,value:y,modifier:E,specificity:[0,1,0]}))),literal("]"));const ql=otherwise(zl,$l);const Vl=otherwise(Ol,Ml);const Kl=choice(Hl,Ul,ql);const Jl=map(otherwise(flatten(Vl,many(Kl)),many1(Kl)),(u=>({type:"compound",list:u,specificity:sumAllSpec(u.map((u=>u.specificity)))})));const Yl=choice(map(literal(">"),(()=>">")),map(literal("+"),(()=>"+")),map(literal("~"),(()=>"~")),ab(literal("|"),literal("|"),(()=>"||")));const Xl=otherwise(optionallySpaced(Yl),map(xl,(()=>" ")));const Zl=leftAssoc2(Jl,map(Xl,(u=>(A,p)=>({type:"compound",list:[...p.list,{type:"combinator",combinator:u,left:A,specificity:A.specificity}],specificity:sumSpec(A.specificity,p.specificity)}))),Jl);const ec=leftAssoc2(map(Zl,(u=>({type:"list",list:[u]}))),map(optionallySpaced(literal(",")),(()=>(u,A)=>({type:"list",list:[...u.list,A]}))),Zl);function parse_(u,A){if(!(typeof A==="string"||A instanceof String)){throw new Error("Expected a selector string. Actual input is not a string!")}const p=Bl(A);if(!p.complete){throw new Error(`The input "${A}" was only partially tokenized, stopped at offset ${p.offset}!\n`+prettyPrintPosition(A,p.offset))}const y=optionallySpaced(u)({tokens:p.tokens,options:undefined},0);if(!y.matched){throw new Error(`No match for "${A}" input!`)}if(y.position<p.tokens.length){const u=p.tokens[y.position];throw new Error(`The input "${A}" was only partially parsed, stopped at offset ${u.offset}!\n`+prettyPrintPosition(A,u.offset,u.len))}return y.value}function prettyPrintPosition(u,A,p=1){return`${u.replace(/(\t)|(\r)|(\n)/g,((u,A,p)=>A?"␉":p?"␍":"␊"))}\n${"".padEnd(A)}${"^".repeat(p)}`}function parseley_parse(u){return parse_(ec,u)}function parse1(u){return parse_(Zl,u)}function serialize(u){if(!u.type){throw new Error("This is not an AST node.")}switch(u.type){case"universal":return _serNs(u.namespace)+"*";case"tag":return _serNs(u.namespace)+_serIdent(u.name);case"class":return"."+_serIdent(u.name);case"id":return"#"+_serIdent(u.name);case"attrPresence":return`[${_serNs(u.namespace)}${_serIdent(u.name)}]`;case"attrValue":return`[${_serNs(u.namespace)}${_serIdent(u.name)}${u.matcher}"${_serStr(u.value)}"${u.modifier?u.modifier:""}]`;case"combinator":return serialize(u.left)+u.combinator;case"compound":return u.list.reduce(((u,A)=>{if(A.type==="combinator"){return serialize(A)+u}else{return u+serialize(A)}}),"");case"list":return u.list.map(serialize).join(",")}}function _serNs(u){return u||u===""?_serIdent(u)+"|":""}function _codePoint(u){return`\\${u.codePointAt(0).toString(16)} `}function _serIdent(u){return u.replace(/(^[0-9])|(^-[0-9])|(^-$)|([-0-9a-zA-Z_]|[^\x00-\x7F])|(\x00)|([\x01-\x1f]|\x7f)|([\s\S])/g,((u,A,p,y,E,C,I,w)=>A?_codePoint(A):p?"-"+_codePoint(p.slice(1)):y?"\\-":E?E:C?"�":I?_codePoint(I):"\\"+w))}function _serStr(u){return u.replace(/(")|(\\)|(\x00)|([\x01-\x1f]|\x7f)/g,((u,A,p,y,E)=>A?'\\"':p?"\\\\":y?"�":_codePoint(E)))}function parseley_normalize(u){if(!u.type){throw new Error("This is not an AST node.")}switch(u.type){case"compound":{u.list.forEach(parseley_normalize);u.list.sort(((u,A)=>_compareArrays(_getSelectorPriority(u),_getSelectorPriority(A))));break}case"combinator":{parseley_normalize(u.left);break}case"list":{u.list.forEach(parseley_normalize);u.list.sort(((u,A)=>serialize(u)<serialize(A)?-1:1));break}}return u}function _getSelectorPriority(u){switch(u.type){case"universal":return[1];case"tag":return[1];case"id":return[2];case"class":return[3,u.name];case"attrPresence":return[4,serialize(u)];case"attrValue":return[5,serialize(u)];case"combinator":return[15,serialize(u)]}}function compareSelectors(u,A){return _compareArrays(u.specificity,A.specificity)}function compareSpecificity(u,A){return _compareArrays(u,A)}function _compareArrays(u,A){if(!Array.isArray(u)||!Array.isArray(A)){throw new Error("Arguments must be arrays.")}const p=u.length<A.length?u.length:A.length;for(let y=0;y<p;y++){if(u[y]===A[y]){continue}return u[y]<A[y]?-1:1}return u.length-A.length}var tc=Object.freeze({__proto__:null});var nc=Object.freeze({__proto__:null});const treeify=u=>"▽\n"+treeifyArray(u,rc);const rc=[["├─","│ "],["└─"," "]];const sc=[["┠─","┃ "],["┖─"," "]];const ic=[["╟─","║ "],["╙─"," "]];function treeifyArray(u,A=sc){return prefixItems(A,u.map((u=>treeifyNode(u))))}function treeifyNode(u){switch(u.type){case"terminal":{const A=u.valueContainer;return`◁ #${A.index} ${JSON.stringify(A.specificity)} ${A.value}`}case"tagName":return`◻ Tag name\n${treeifyArray(u.variants,ic)}`;case"attrValue":return`▣ Attr value: ${u.name}\n${treeifyArray(u.matchers,ic)}`;case"attrPresence":return`◨ Attr presence: ${u.name}\n${treeifyArray(u.cont)}`;case"pushElement":return`◉ Push element: ${u.combinator}\n${treeifyArray(u.cont,rc)}`;case"popElement":return`◌ Pop element\n${treeifyArray(u.cont,rc)}`;case"variant":return`◇ = ${u.value}\n${treeifyArray(u.cont)}`;case"matcher":return`◈ ${u.matcher} "${u.value}"${u.modifier||""}\n${treeifyArray(u.cont)}`}}function prefixItems(u,A){return A.map(((A,p,{length:y})=>prefixItem(u,A,p===y-1))).join("\n")}function prefixItem(u,A,p=true){const y=u[p?1:0];return y[0]+A.split("\n").join("\n"+y[1])}var oc=Object.freeze({__proto__:null,treeify:treeify});class DecisionTree{constructor(u){this.branches=weave(toAstTerminalPairs(u))}build(u){return u(this.branches)}}function toAstTerminalPairs(u){const A=u.length;const p=new Array(A);for(let y=0;y<A;y++){const[A,E]=u[y];const C=preprocess(parse1(A));p[y]={ast:C,terminal:{type:"terminal",valueContainer:{index:y,value:E,specificity:C.specificity}}}}return p}function preprocess(u){reduceSelectorVariants(u);parseley_normalize(u);return u}function reduceSelectorVariants(u){const A=[];u.list.forEach((u=>{switch(u.type){case"class":A.push({matcher:"~=",modifier:null,name:"class",namespace:null,specificity:u.specificity,type:"attrValue",value:u.name});break;case"id":A.push({matcher:"=",modifier:null,name:"id",namespace:null,specificity:u.specificity,type:"attrValue",value:u.name});break;case"combinator":reduceSelectorVariants(u.left);A.push(u);break;case"universal":break;default:A.push(u);break}}));u.list=A}function weave(u){const A=[];while(u.length){const p=findTopKey(u,(u=>true),getSelectorKind);const{matches:y,nonmatches:E,empty:C}=breakByKind(u,p);u=E;if(y.length){A.push(branchOfKind(p,y))}if(C.length){A.push(...terminate(C))}}return A}function terminate(u){const A=[];for(const p of u){const u=p.terminal;if(u.type==="terminal"){A.push(u)}else{const{matches:p,rest:y}=partition(u.cont,(u=>u.type==="terminal"));p.forEach((u=>A.push(u)));if(y.length){u.cont=y;A.push(u)}}}return A}function breakByKind(u,A){const p=[];const y=[];const E=[];for(const C of u){const u=C.ast.list;if(u.length){const E=u.some((u=>getSelectorKind(u)===A));(E?p:y).push(C)}else{E.push(C)}}return{matches:p,nonmatches:y,empty:E}}function getSelectorKind(u){switch(u.type){case"attrPresence":return`attrPresence ${u.name}`;case"attrValue":return`attrValue ${u.name}`;case"combinator":return`combinator ${u.combinator}`;default:return u.type}}function branchOfKind(u,A){if(u==="tag"){return tagNameBranch(A)}if(u.startsWith("attrValue ")){return attrValueBranch(u.substring(10),A)}if(u.startsWith("attrPresence ")){return attrPresenceBranch(u.substring(13),A)}if(u==="combinator >"){return combinatorBranch(">",A)}if(u==="combinator +"){return combinatorBranch("+",A)}throw new Error(`Unsupported selector kind: ${u}`)}function tagNameBranch(u){const A=spliceAndGroup(u,(u=>u.type==="tag"),(u=>u.name));const p=Object.entries(A).map((([u,A])=>({type:"variant",value:u,cont:weave(A.items)})));return{type:"tagName",variants:p}}function attrPresenceBranch(u,A){for(const p of A){spliceSimpleSelector(p,(A=>A.type==="attrPresence"&&A.name===u))}return{type:"attrPresence",name:u,cont:weave(A)}}function attrValueBranch(u,A){const p=spliceAndGroup(A,(A=>A.type==="attrValue"&&A.name===u),(u=>`${u.matcher} ${u.modifier||""} ${u.value}`));const y=[];for(const u of Object.values(p)){const A=u.oneSimpleSelector;const p=getAttrPredicate(A);const E=weave(u.items);y.push({type:"matcher",matcher:A.matcher,modifier:A.modifier,value:A.value,predicate:p,cont:E})}return{type:"attrValue",name:u,matchers:y}}function getAttrPredicate(u){if(u.modifier==="i"){const A=u.value.toLowerCase();switch(u.matcher){case"=":return u=>A===u.toLowerCase();case"~=":return u=>u.toLowerCase().split(/[ \t]+/).includes(A);case"^=":return u=>u.toLowerCase().startsWith(A);case"$=":return u=>u.toLowerCase().endsWith(A);case"*=":return u=>u.toLowerCase().includes(A);case"|=":return u=>{const p=u.toLowerCase();return A===p||p.startsWith(A)&&p[A.length]==="-"}}}else{const A=u.value;switch(u.matcher){case"=":return u=>A===u;case"~=":return u=>u.split(/[ \t]+/).includes(A);case"^=":return u=>u.startsWith(A);case"$=":return u=>u.endsWith(A);case"*=":return u=>u.includes(A);case"|=":return u=>A===u||u.startsWith(A)&&u[A.length]==="-"}}}function combinatorBranch(u,A){const p=spliceAndGroup(A,(A=>A.type==="combinator"&&A.combinator===u),(u=>serialize(u.left)));const y=[];for(const u of Object.values(p)){const A=weave(u.items);const p=u.oneSimpleSelector.left;y.push({ast:p,terminal:{type:"popElement",cont:A}})}return{type:"pushElement",combinator:u,cont:weave(y)}}function spliceAndGroup(u,A,p){const y={};while(u.length){const E=findTopKey(u,A,p);const bestKeyPredicate=u=>A(u)&&p(u)===E;const hasBestKeyPredicate=u=>u.ast.list.some(bestKeyPredicate);const{matches:C,rest:I}=partition1(u,hasBestKeyPredicate);let w=null;for(const u of C){const A=spliceSimpleSelector(u,bestKeyPredicate);if(!w){w=A}}if(w==null){throw new Error("No simple selector is found.")}y[E]={oneSimpleSelector:w,items:C};u=I}return y}function spliceSimpleSelector(u,A){const p=u.ast.list;const y=new Array(p.length);let E=-1;for(let u=p.length;u-- >0;){if(A(p[u])){y[u]=true;E=u}}if(E==-1){throw new Error(`Couldn't find the required simple selector.`)}const C=p[E];u.ast.list=p.filter(((u,A)=>!y[A]));return C}function findTopKey(u,A,p){const y={};for(const E of u){const u={};for(const y of E.ast.list.filter(A)){u[p(y)]=true}for(const A of Object.keys(u)){if(y[A]){y[A]++}else{y[A]=1}}}let E="";let C=0;for(const u of Object.entries(y)){if(u[1]>C){E=u[0];C=u[1]}}return E}function partition(u,A){const p=[];const y=[];for(const E of u){if(A(E)){p.push(E)}else{y.push(E)}}return{matches:p,rest:y}}function partition1(u,A){const p=[];const y=[];for(const E of u){if(A(E)){p.push(E)}else{y.push(E)}}return{matches:p,rest:y}}class Picker{constructor(u){this.f=u}pickAll(u){return this.f(u)}pick1(u,A=false){const p=this.f(u);const y=p.length;if(y===0){return null}if(y===1){return p[0].value}const E=A?comparatorPreferFirst:comparatorPreferLast;let C=p[0];for(let u=1;u<y;u++){const A=p[u];if(E(C,A)){C=A}}return C.value}}function comparatorPreferFirst(u,A){const p=compareSpecificity(A.specificity,u.specificity);return p>0||p===0&&A.index<u.index}function comparatorPreferLast(u,A){const p=compareSpecificity(A.specificity,u.specificity);return p>0||p===0&&A.index>u.index}function hp2Builder(u){return new Picker(handleArray(u))}function handleArray(u){const A=u.map(handleNode);return(u,...p)=>A.flatMap((A=>A(u,...p)))}function handleNode(u){switch(u.type){case"terminal":{const A=[u.valueContainer];return(u,...p)=>A}case"tagName":return handleTagName(u);case"attrValue":return handleAttrValueName(u);case"attrPresence":return handleAttrPresenceName(u);case"pushElement":return handlePushElementNode(u);case"popElement":return handlePopElementNode(u)}}function handleTagName(u){const A={};for(const p of u.variants){A[p.value]=handleArray(p.cont)}return(u,...p)=>{const y=A[u.name];return y?y(u,...p):[]}}function handleAttrPresenceName(u){const A=u.name;const p=handleArray(u.cont);return(u,...y)=>Object.prototype.hasOwnProperty.call(u.attribs,A)?p(u,...y):[]}function handleAttrValueName(u){const A=[];for(const p of u.matchers){const u=p.predicate;const y=handleArray(p.cont);A.push(((A,p,...E)=>u(A)?y(p,...E):[]))}const p=u.name;return(u,...y)=>{const E=u.attribs[p];return E||E===""?A.flatMap((A=>A(E,u,...y))):[]}}function handlePushElementNode(u){const A=handleArray(u.cont);const p=u.combinator==="+"?getPrecedingElement:getParentElement;return(u,...y)=>{const E=p(u);if(E===null){return[]}return A(E,u,...y)}}const getPrecedingElement=u=>{const A=u.prev;if(A===null){return null}return node_isTag(A)?A:getPrecedingElement(A)};const getParentElement=u=>{const A=u.parent;return A&&node_isTag(A)?A:null};function handlePopElementNode(u){const A=handleArray(u.cont);return(u,p,...y)=>A(p,...y)}const ac=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((u=>u.charCodeAt(0))));const lc=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((u=>u.charCodeAt(0))));var cc;const uc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);const dc=(cc=String.fromCodePoint)!==null&&cc!==void 0?cc:function(u){let A="";if(u>65535){u-=65536;A+=String.fromCharCode(u>>>10&1023|55296);u=56320|u&1023}A+=String.fromCharCode(u);return A};function replaceCodePoint(u){var A;if(u>=55296&&u<=57343||u>1114111){return 65533}return(A=uc.get(u))!==null&&A!==void 0?A:u}function decodeCodePoint(u){return dc(replaceCodePoint(u))}var fc;(function(u){u[u["NUM"]=35]="NUM";u[u["SEMI"]=59]="SEMI";u[u["EQUALS"]=61]="EQUALS";u[u["ZERO"]=48]="ZERO";u[u["NINE"]=57]="NINE";u[u["LOWER_A"]=97]="LOWER_A";u[u["LOWER_F"]=102]="LOWER_F";u[u["LOWER_X"]=120]="LOWER_X";u[u["LOWER_Z"]=122]="LOWER_Z";u[u["UPPER_A"]=65]="UPPER_A";u[u["UPPER_F"]=70]="UPPER_F";u[u["UPPER_Z"]=90]="UPPER_Z"})(fc||(fc={}));const Ac=32;var hc;(function(u){u[u["VALUE_LENGTH"]=49152]="VALUE_LENGTH";u[u["BRANCH_LENGTH"]=16256]="BRANCH_LENGTH";u[u["JUMP_TABLE"]=127]="JUMP_TABLE"})(hc||(hc={}));function decode_isNumber(u){return u>=fc.ZERO&&u<=fc.NINE}function isHexadecimalCharacter(u){return u>=fc.UPPER_A&&u<=fc.UPPER_F||u>=fc.LOWER_A&&u<=fc.LOWER_F}function isAsciiAlphaNumeric(u){return u>=fc.UPPER_A&&u<=fc.UPPER_Z||u>=fc.LOWER_A&&u<=fc.LOWER_Z||decode_isNumber(u)}function isEntityInAttributeInvalidEnd(u){return u===fc.EQUALS||isAsciiAlphaNumeric(u)}var pc;(function(u){u[u["EntityStart"]=0]="EntityStart";u[u["NumericStart"]=1]="NumericStart";u[u["NumericDecimal"]=2]="NumericDecimal";u[u["NumericHex"]=3]="NumericHex";u[u["NamedEntity"]=4]="NamedEntity"})(pc||(pc={}));var gc;(function(u){u[u["Legacy"]=0]="Legacy";u[u["Strict"]=1]="Strict";u[u["Attribute"]=2]="Attribute"})(gc||(gc={}));class EntityDecoder{constructor(u,A,p){this.decodeTree=u;this.emitCodePoint=A;this.errors=p;this.state=pc.EntityStart;this.consumed=1;this.result=0;this.treeIndex=0;this.excess=1;this.decodeMode=gc.Strict}startEntity(u){this.decodeMode=u;this.state=pc.EntityStart;this.result=0;this.treeIndex=0;this.excess=1;this.consumed=1}write(u,A){switch(this.state){case pc.EntityStart:{if(u.charCodeAt(A)===fc.NUM){this.state=pc.NumericStart;this.consumed+=1;return this.stateNumericStart(u,A+1)}this.state=pc.NamedEntity;return this.stateNamedEntity(u,A)}case pc.NumericStart:{return this.stateNumericStart(u,A)}case pc.NumericDecimal:{return this.stateNumericDecimal(u,A)}case pc.NumericHex:{return this.stateNumericHex(u,A)}case pc.NamedEntity:{return this.stateNamedEntity(u,A)}}}stateNumericStart(u,A){if(A>=u.length){return-1}if((u.charCodeAt(A)|Ac)===fc.LOWER_X){this.state=pc.NumericHex;this.consumed+=1;return this.stateNumericHex(u,A+1)}this.state=pc.NumericDecimal;return this.stateNumericDecimal(u,A)}addToNumericResult(u,A,p,y){if(A!==p){const E=p-A;this.result=this.result*Math.pow(y,E)+parseInt(u.substr(A,E),y);this.consumed+=E}}stateNumericHex(u,A){const p=A;while(A<u.length){const y=u.charCodeAt(A);if(decode_isNumber(y)||isHexadecimalCharacter(y)){A+=1}else{this.addToNumericResult(u,p,A,16);return this.emitNumericEntity(y,3)}}this.addToNumericResult(u,p,A,16);return-1}stateNumericDecimal(u,A){const p=A;while(A<u.length){const y=u.charCodeAt(A);if(decode_isNumber(y)){A+=1}else{this.addToNumericResult(u,p,A,10);return this.emitNumericEntity(y,2)}}this.addToNumericResult(u,p,A,10);return-1}emitNumericEntity(u,A){var p;if(this.consumed<=A){(p=this.errors)===null||p===void 0?void 0:p.absenceOfDigitsInNumericCharacterReference(this.consumed);return 0}if(u===fc.SEMI){this.consumed+=1}else if(this.decodeMode===gc.Strict){return 0}this.emitCodePoint(replaceCodePoint(this.result),this.consumed);if(this.errors){if(u!==fc.SEMI){this.errors.missingSemicolonAfterCharacterReference()}this.errors.validateNumericCharacterReference(this.result)}return this.consumed}stateNamedEntity(u,A){const{decodeTree:p}=this;let y=p[this.treeIndex];let E=(y&hc.VALUE_LENGTH)>>14;for(;A<u.length;A++,this.excess++){const C=u.charCodeAt(A);this.treeIndex=determineBranch(p,y,this.treeIndex+Math.max(1,E),C);if(this.treeIndex<0){return this.result===0||this.decodeMode===gc.Attribute&&(E===0||isEntityInAttributeInvalidEnd(C))?0:this.emitNotTerminatedNamedEntity()}y=p[this.treeIndex];E=(y&hc.VALUE_LENGTH)>>14;if(E!==0){if(C===fc.SEMI){return this.emitNamedEntityData(this.treeIndex,E,this.consumed+this.excess)}if(this.decodeMode!==gc.Strict){this.result=this.treeIndex;this.consumed+=this.excess;this.excess=0}}}return-1}emitNotTerminatedNamedEntity(){var u;const{result:A,decodeTree:p}=this;const y=(p[A]&hc.VALUE_LENGTH)>>14;this.emitNamedEntityData(A,y,this.consumed);(u=this.errors)===null||u===void 0?void 0:u.missingSemicolonAfterCharacterReference();return this.consumed}emitNamedEntityData(u,A,p){const{decodeTree:y}=this;this.emitCodePoint(A===1?y[u]&~hc.VALUE_LENGTH:y[u+1],p);if(A===3){this.emitCodePoint(y[u+2],p)}return p}end(){var u;switch(this.state){case pc.NamedEntity:{return this.result!==0&&(this.decodeMode!==gc.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0}case pc.NumericDecimal:{return this.emitNumericEntity(0,2)}case pc.NumericHex:{return this.emitNumericEntity(0,3)}case pc.NumericStart:{(u=this.errors)===null||u===void 0?void 0:u.absenceOfDigitsInNumericCharacterReference(this.consumed);return 0}case pc.EntityStart:{return 0}}}}function getDecoder(u){let A="";const p=new EntityDecoder(u,(u=>A+=dc(u)));return function decodeWithTrie(u,y){let E=0;let C=0;while((C=u.indexOf("&",C))>=0){A+=u.slice(E,C);p.startEntity(y);const I=p.write(u,C+1);if(I<0){E=C+p.end();break}E=C+I;C=I===0?E+1:E}const I=A+u.slice(E);A="";return I}}function determineBranch(u,A,p,y){const E=(A&hc.BRANCH_LENGTH)>>7;const C=A&hc.JUMP_TABLE;if(E===0){return C!==0&&y===C?p:-1}if(C){const A=y-C;return A<0||A>=E?-1:u[p+A]-1}let I=p;let w=I+E-1;while(I<=w){const A=I+w>>>1;const p=u[A];if(p<y){I=A+1}else if(p>y){w=A-1}else{return u[A+E]}}return-1}const mc=getDecoder(ac);const yc=getDecoder(lc);function decode_decodeHTML(u,A=gc.Legacy){return mc(u,A)}function decodeHTMLAttribute(u){return mc(u,gc.Attribute)}function decodeHTMLStrict(u){return mc(u,gc.Strict)}function decode_decodeXML(u){return yc(u,gc.Strict)}var Ec;(function(u){u[u["Tab"]=9]="Tab";u[u["NewLine"]=10]="NewLine";u[u["FormFeed"]=12]="FormFeed";u[u["CarriageReturn"]=13]="CarriageReturn";u[u["Space"]=32]="Space";u[u["ExclamationMark"]=33]="ExclamationMark";u[u["Number"]=35]="Number";u[u["Amp"]=38]="Amp";u[u["SingleQuote"]=39]="SingleQuote";u[u["DoubleQuote"]=34]="DoubleQuote";u[u["Dash"]=45]="Dash";u[u["Slash"]=47]="Slash";u[u["Zero"]=48]="Zero";u[u["Nine"]=57]="Nine";u[u["Semi"]=59]="Semi";u[u["Lt"]=60]="Lt";u[u["Eq"]=61]="Eq";u[u["Gt"]=62]="Gt";u[u["Questionmark"]=63]="Questionmark";u[u["UpperA"]=65]="UpperA";u[u["LowerA"]=97]="LowerA";u[u["UpperF"]=70]="UpperF";u[u["LowerF"]=102]="LowerF";u[u["UpperZ"]=90]="UpperZ";u[u["LowerZ"]=122]="LowerZ";u[u["LowerX"]=120]="LowerX";u[u["OpeningSquareBracket"]=91]="OpeningSquareBracket"})(Ec||(Ec={}));var Cc;(function(u){u[u["Text"]=1]="Text";u[u["BeforeTagName"]=2]="BeforeTagName";u[u["InTagName"]=3]="InTagName";u[u["InSelfClosingTag"]=4]="InSelfClosingTag";u[u["BeforeClosingTagName"]=5]="BeforeClosingTagName";u[u["InClosingTagName"]=6]="InClosingTagName";u[u["AfterClosingTagName"]=7]="AfterClosingTagName";u[u["BeforeAttributeName"]=8]="BeforeAttributeName";u[u["InAttributeName"]=9]="InAttributeName";u[u["AfterAttributeName"]=10]="AfterAttributeName";u[u["BeforeAttributeValue"]=11]="BeforeAttributeValue";u[u["InAttributeValueDq"]=12]="InAttributeValueDq";u[u["InAttributeValueSq"]=13]="InAttributeValueSq";u[u["InAttributeValueNq"]=14]="InAttributeValueNq";u[u["BeforeDeclaration"]=15]="BeforeDeclaration";u[u["InDeclaration"]=16]="InDeclaration";u[u["InProcessingInstruction"]=17]="InProcessingInstruction";u[u["BeforeComment"]=18]="BeforeComment";u[u["CDATASequence"]=19]="CDATASequence";u[u["InSpecialComment"]=20]="InSpecialComment";u[u["InCommentLike"]=21]="InCommentLike";u[u["BeforeSpecialS"]=22]="BeforeSpecialS";u[u["SpecialStartSequence"]=23]="SpecialStartSequence";u[u["InSpecialTag"]=24]="InSpecialTag";u[u["BeforeEntity"]=25]="BeforeEntity";u[u["BeforeNumericEntity"]=26]="BeforeNumericEntity";u[u["InNamedEntity"]=27]="InNamedEntity";u[u["InNumericEntity"]=28]="InNumericEntity";u[u["InHexEntity"]=29]="InHexEntity"})(Cc||(Cc={}));function isWhitespace(u){return u===Ec.Space||u===Ec.NewLine||u===Ec.Tab||u===Ec.FormFeed||u===Ec.CarriageReturn}function isEndOfTagSection(u){return u===Ec.Slash||u===Ec.Gt||isWhitespace(u)}function Tokenizer_isNumber(u){return u>=Ec.Zero&&u<=Ec.Nine}function isASCIIAlpha(u){return u>=Ec.LowerA&&u<=Ec.LowerZ||u>=Ec.UpperA&&u<=Ec.UpperZ}function isHexDigit(u){return u>=Ec.UpperA&&u<=Ec.UpperF||u>=Ec.LowerA&&u<=Ec.LowerF}var Ic;(function(u){u[u["NoValue"]=0]="NoValue";u[u["Unquoted"]=1]="Unquoted";u[u["Single"]=2]="Single";u[u["Double"]=3]="Double"})(Ic||(Ic={}));const bc={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])};class Tokenizer{constructor({xmlMode:u=false,decodeEntities:A=true},p){this.cbs=p;this.state=Cc.Text;this.buffer="";this.sectionStart=0;this.index=0;this.baseState=Cc.Text;this.isSpecial=false;this.running=true;this.offset=0;this.currentSequence=undefined;this.sequenceIndex=0;this.trieIndex=0;this.trieCurrent=0;this.entityResult=0;this.entityExcess=0;this.xmlMode=u;this.decodeEntities=A;this.entityTrie=u?lc:ac}reset(){this.state=Cc.Text;this.buffer="";this.sectionStart=0;this.index=0;this.baseState=Cc.Text;this.currentSequence=undefined;this.running=true;this.offset=0}write(u){this.offset+=this.buffer.length;this.buffer=u;this.parse()}end(){if(this.running)this.finish()}pause(){this.running=false}resume(){this.running=true;if(this.index<this.buffer.length+this.offset){this.parse()}}getIndex(){return this.index}getSectionStart(){return this.sectionStart}stateText(u){if(u===Ec.Lt||!this.decodeEntities&&this.fastForwardTo(Ec.Lt)){if(this.index>this.sectionStart){this.cbs.ontext(this.sectionStart,this.index)}this.state=Cc.BeforeTagName;this.sectionStart=this.index}else if(this.decodeEntities&&u===Ec.Amp){this.state=Cc.BeforeEntity}}stateSpecialStartSequence(u){const A=this.sequenceIndex===this.currentSequence.length;const p=A?isEndOfTagSection(u):(u|32)===this.currentSequence[this.sequenceIndex];if(!p){this.isSpecial=false}else if(!A){this.sequenceIndex++;return}this.sequenceIndex=0;this.state=Cc.InTagName;this.stateInTagName(u)}stateInSpecialTag(u){if(this.sequenceIndex===this.currentSequence.length){if(u===Ec.Gt||isWhitespace(u)){const A=this.index-this.currentSequence.length;if(this.sectionStart<A){const u=this.index;this.index=A;this.cbs.ontext(this.sectionStart,A);this.index=u}this.isSpecial=false;this.sectionStart=A+2;this.stateInClosingTagName(u);return}this.sequenceIndex=0}if((u|32)===this.currentSequence[this.sequenceIndex]){this.sequenceIndex+=1}else if(this.sequenceIndex===0){if(this.currentSequence===bc.TitleEnd){if(this.decodeEntities&&u===Ec.Amp){this.state=Cc.BeforeEntity}}else if(this.fastForwardTo(Ec.Lt)){this.sequenceIndex=1}}else{this.sequenceIndex=Number(u===Ec.Lt)}}stateCDATASequence(u){if(u===bc.Cdata[this.sequenceIndex]){if(++this.sequenceIndex===bc.Cdata.length){this.state=Cc.InCommentLike;this.currentSequence=bc.CdataEnd;this.sequenceIndex=0;this.sectionStart=this.index+1}}else{this.sequenceIndex=0;this.state=Cc.InDeclaration;this.stateInDeclaration(u)}}fastForwardTo(u){while(++this.index<this.buffer.length+this.offset){if(this.buffer.charCodeAt(this.index-this.offset)===u){return true}}this.index=this.buffer.length+this.offset-1;return false}stateInCommentLike(u){if(u===this.currentSequence[this.sequenceIndex]){if(++this.sequenceIndex===this.currentSequence.length){if(this.currentSequence===bc.CdataEnd){this.cbs.oncdata(this.sectionStart,this.index,2)}else{this.cbs.oncomment(this.sectionStart,this.index,2)}this.sequenceIndex=0;this.sectionStart=this.index+1;this.state=Cc.Text}}else if(this.sequenceIndex===0){if(this.fastForwardTo(this.currentSequence[0])){this.sequenceIndex=1}}else if(u!==this.currentSequence[this.sequenceIndex-1]){this.sequenceIndex=0}}isTagStartChar(u){return this.xmlMode?!isEndOfTagSection(u):isASCIIAlpha(u)}startSpecial(u,A){this.isSpecial=true;this.currentSequence=u;this.sequenceIndex=A;this.state=Cc.SpecialStartSequence}stateBeforeTagName(u){if(u===Ec.ExclamationMark){this.state=Cc.BeforeDeclaration;this.sectionStart=this.index+1}else if(u===Ec.Questionmark){this.state=Cc.InProcessingInstruction;this.sectionStart=this.index+1}else if(this.isTagStartChar(u)){const A=u|32;this.sectionStart=this.index;if(!this.xmlMode&&A===bc.TitleEnd[2]){this.startSpecial(bc.TitleEnd,3)}else{this.state=!this.xmlMode&&A===bc.ScriptEnd[2]?Cc.BeforeSpecialS:Cc.InTagName}}else if(u===Ec.Slash){this.state=Cc.BeforeClosingTagName}else{this.state=Cc.Text;this.stateText(u)}}stateInTagName(u){if(isEndOfTagSection(u)){this.cbs.onopentagname(this.sectionStart,this.index);this.sectionStart=-1;this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}}stateBeforeClosingTagName(u){if(isWhitespace(u)){}else if(u===Ec.Gt){this.state=Cc.Text}else{this.state=this.isTagStartChar(u)?Cc.InClosingTagName:Cc.InSpecialComment;this.sectionStart=this.index}}stateInClosingTagName(u){if(u===Ec.Gt||isWhitespace(u)){this.cbs.onclosetag(this.sectionStart,this.index);this.sectionStart=-1;this.state=Cc.AfterClosingTagName;this.stateAfterClosingTagName(u)}}stateAfterClosingTagName(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.state=Cc.Text;this.baseState=Cc.Text;this.sectionStart=this.index+1}}stateBeforeAttributeName(u){if(u===Ec.Gt){this.cbs.onopentagend(this.index);if(this.isSpecial){this.state=Cc.InSpecialTag;this.sequenceIndex=0}else{this.state=Cc.Text}this.baseState=this.state;this.sectionStart=this.index+1}else if(u===Ec.Slash){this.state=Cc.InSelfClosingTag}else if(!isWhitespace(u)){this.state=Cc.InAttributeName;this.sectionStart=this.index}}stateInSelfClosingTag(u){if(u===Ec.Gt){this.cbs.onselfclosingtag(this.index);this.state=Cc.Text;this.baseState=Cc.Text;this.sectionStart=this.index+1;this.isSpecial=false}else if(!isWhitespace(u)){this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}}stateInAttributeName(u){if(u===Ec.Eq||isEndOfTagSection(u)){this.cbs.onattribname(this.sectionStart,this.index);this.sectionStart=-1;this.state=Cc.AfterAttributeName;this.stateAfterAttributeName(u)}}stateAfterAttributeName(u){if(u===Ec.Eq){this.state=Cc.BeforeAttributeValue}else if(u===Ec.Slash||u===Ec.Gt){this.cbs.onattribend(Ic.NoValue,this.index);this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}else if(!isWhitespace(u)){this.cbs.onattribend(Ic.NoValue,this.index);this.state=Cc.InAttributeName;this.sectionStart=this.index}}stateBeforeAttributeValue(u){if(u===Ec.DoubleQuote){this.state=Cc.InAttributeValueDq;this.sectionStart=this.index+1}else if(u===Ec.SingleQuote){this.state=Cc.InAttributeValueSq;this.sectionStart=this.index+1}else if(!isWhitespace(u)){this.sectionStart=this.index;this.state=Cc.InAttributeValueNq;this.stateInAttributeValueNoQuotes(u)}}handleInAttributeValue(u,A){if(u===A||!this.decodeEntities&&this.fastForwardTo(A)){this.cbs.onattribdata(this.sectionStart,this.index);this.sectionStart=-1;this.cbs.onattribend(A===Ec.DoubleQuote?Ic.Double:Ic.Single,this.index);this.state=Cc.BeforeAttributeName}else if(this.decodeEntities&&u===Ec.Amp){this.baseState=this.state;this.state=Cc.BeforeEntity}}stateInAttributeValueDoubleQuotes(u){this.handleInAttributeValue(u,Ec.DoubleQuote)}stateInAttributeValueSingleQuotes(u){this.handleInAttributeValue(u,Ec.SingleQuote)}stateInAttributeValueNoQuotes(u){if(isWhitespace(u)||u===Ec.Gt){this.cbs.onattribdata(this.sectionStart,this.index);this.sectionStart=-1;this.cbs.onattribend(Ic.Unquoted,this.index);this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}else if(this.decodeEntities&&u===Ec.Amp){this.baseState=this.state;this.state=Cc.BeforeEntity}}stateBeforeDeclaration(u){if(u===Ec.OpeningSquareBracket){this.state=Cc.CDATASequence;this.sequenceIndex=0}else{this.state=u===Ec.Dash?Cc.BeforeComment:Cc.InDeclaration}}stateInDeclaration(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.cbs.ondeclaration(this.sectionStart,this.index);this.state=Cc.Text;this.sectionStart=this.index+1}}stateInProcessingInstruction(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.cbs.onprocessinginstruction(this.sectionStart,this.index);this.state=Cc.Text;this.sectionStart=this.index+1}}stateBeforeComment(u){if(u===Ec.Dash){this.state=Cc.InCommentLike;this.currentSequence=bc.CommentEnd;this.sequenceIndex=2;this.sectionStart=this.index+1}else{this.state=Cc.InDeclaration}}stateInSpecialComment(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.cbs.oncomment(this.sectionStart,this.index,0);this.state=Cc.Text;this.sectionStart=this.index+1}}stateBeforeSpecialS(u){const A=u|32;if(A===bc.ScriptEnd[3]){this.startSpecial(bc.ScriptEnd,4)}else if(A===bc.StyleEnd[3]){this.startSpecial(bc.StyleEnd,4)}else{this.state=Cc.InTagName;this.stateInTagName(u)}}stateBeforeEntity(u){this.entityExcess=1;this.entityResult=0;if(u===Ec.Number){this.state=Cc.BeforeNumericEntity}else if(u===Ec.Amp){}else{this.trieIndex=0;this.trieCurrent=this.entityTrie[0];this.state=Cc.InNamedEntity;this.stateInNamedEntity(u)}}stateInNamedEntity(u){this.entityExcess+=1;this.trieIndex=determineBranch(this.entityTrie,this.trieCurrent,this.trieIndex+1,u);if(this.trieIndex<0){this.emitNamedEntity();this.index--;return}this.trieCurrent=this.entityTrie[this.trieIndex];const A=this.trieCurrent&hc.VALUE_LENGTH;if(A){const p=(A>>14)-1;if(!this.allowLegacyEntity()&&u!==Ec.Semi){this.trieIndex+=p}else{const u=this.index-this.entityExcess+1;if(u>this.sectionStart){this.emitPartial(this.sectionStart,u)}this.entityResult=this.trieIndex;this.trieIndex+=p;this.entityExcess=0;this.sectionStart=this.index+1;if(p===0){this.emitNamedEntity()}}}}emitNamedEntity(){this.state=this.baseState;if(this.entityResult===0){return}const u=(this.entityTrie[this.entityResult]&hc.VALUE_LENGTH)>>14;switch(u){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~hc.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);this.emitCodePoint(this.entityTrie[this.entityResult+2])}}}stateBeforeNumericEntity(u){if((u|32)===Ec.LowerX){this.entityExcess++;this.state=Cc.InHexEntity}else{this.state=Cc.InNumericEntity;this.stateInNumericEntity(u)}}emitNumericEntity(u){const A=this.index-this.entityExcess-1;const p=A+2+Number(this.state===Cc.InHexEntity);if(p!==this.index){if(A>this.sectionStart){this.emitPartial(this.sectionStart,A)}this.sectionStart=this.index+Number(u);this.emitCodePoint(replaceCodePoint(this.entityResult))}this.state=this.baseState}stateInNumericEntity(u){if(u===Ec.Semi){this.emitNumericEntity(true)}else if(Tokenizer_isNumber(u)){this.entityResult=this.entityResult*10+(u-Ec.Zero);this.entityExcess++}else{if(this.allowLegacyEntity()){this.emitNumericEntity(false)}else{this.state=this.baseState}this.index--}}stateInHexEntity(u){if(u===Ec.Semi){this.emitNumericEntity(true)}else if(Tokenizer_isNumber(u)){this.entityResult=this.entityResult*16+(u-Ec.Zero);this.entityExcess++}else if(isHexDigit(u)){this.entityResult=this.entityResult*16+((u|32)-Ec.LowerA+10);this.entityExcess++}else{if(this.allowLegacyEntity()){this.emitNumericEntity(false)}else{this.state=this.baseState}this.index--}}allowLegacyEntity(){return!this.xmlMode&&(this.baseState===Cc.Text||this.baseState===Cc.InSpecialTag)}cleanup(){if(this.running&&this.sectionStart!==this.index){if(this.state===Cc.Text||this.state===Cc.InSpecialTag&&this.sequenceIndex===0){this.cbs.ontext(this.sectionStart,this.index);this.sectionStart=this.index}else if(this.state===Cc.InAttributeValueDq||this.state===Cc.InAttributeValueSq||this.state===Cc.InAttributeValueNq){this.cbs.onattribdata(this.sectionStart,this.index);this.sectionStart=this.index}}}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){while(this.shouldContinue()){const u=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case Cc.Text:{this.stateText(u);break}case Cc.SpecialStartSequence:{this.stateSpecialStartSequence(u);break}case Cc.InSpecialTag:{this.stateInSpecialTag(u);break}case Cc.CDATASequence:{this.stateCDATASequence(u);break}case Cc.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(u);break}case Cc.InAttributeName:{this.stateInAttributeName(u);break}case Cc.InCommentLike:{this.stateInCommentLike(u);break}case Cc.InSpecialComment:{this.stateInSpecialComment(u);break}case Cc.BeforeAttributeName:{this.stateBeforeAttributeName(u);break}case Cc.InTagName:{this.stateInTagName(u);break}case Cc.InClosingTagName:{this.stateInClosingTagName(u);break}case Cc.BeforeTagName:{this.stateBeforeTagName(u);break}case Cc.AfterAttributeName:{this.stateAfterAttributeName(u);break}case Cc.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(u);break}case Cc.BeforeAttributeValue:{this.stateBeforeAttributeValue(u);break}case Cc.BeforeClosingTagName:{this.stateBeforeClosingTagName(u);break}case Cc.AfterClosingTagName:{this.stateAfterClosingTagName(u);break}case Cc.BeforeSpecialS:{this.stateBeforeSpecialS(u);break}case Cc.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(u);break}case Cc.InSelfClosingTag:{this.stateInSelfClosingTag(u);break}case Cc.InDeclaration:{this.stateInDeclaration(u);break}case Cc.BeforeDeclaration:{this.stateBeforeDeclaration(u);break}case Cc.BeforeComment:{this.stateBeforeComment(u);break}case Cc.InProcessingInstruction:{this.stateInProcessingInstruction(u);break}case Cc.InNamedEntity:{this.stateInNamedEntity(u);break}case Cc.BeforeEntity:{this.stateBeforeEntity(u);break}case Cc.InHexEntity:{this.stateInHexEntity(u);break}case Cc.InNumericEntity:{this.stateInNumericEntity(u);break}default:{this.stateBeforeNumericEntity(u)}}this.index++}this.cleanup()}finish(){if(this.state===Cc.InNamedEntity){this.emitNamedEntity()}if(this.sectionStart<this.index){this.handleTrailingData()}this.cbs.onend()}handleTrailingData(){const u=this.buffer.length+this.offset;if(this.state===Cc.InCommentLike){if(this.currentSequence===bc.CdataEnd){this.cbs.oncdata(this.sectionStart,u,0)}else{this.cbs.oncomment(this.sectionStart,u,0)}}else if(this.state===Cc.InNumericEntity&&this.allowLegacyEntity()){this.emitNumericEntity(false)}else if(this.state===Cc.InHexEntity&&this.allowLegacyEntity()){this.emitNumericEntity(false)}else if(this.state===Cc.InTagName||this.state===Cc.BeforeAttributeName||this.state===Cc.BeforeAttributeValue||this.state===Cc.AfterAttributeName||this.state===Cc.InAttributeName||this.state===Cc.InAttributeValueSq||this.state===Cc.InAttributeValueDq||this.state===Cc.InAttributeValueNq||this.state===Cc.InClosingTagName){}else{this.cbs.ontext(this.sectionStart,u)}}emitPartial(u,A){if(this.baseState!==Cc.Text&&this.baseState!==Cc.InSpecialTag){this.cbs.onattribdata(u,A)}else{this.cbs.ontext(u,A)}}emitCodePoint(u){if(this.baseState!==Cc.Text&&this.baseState!==Cc.InSpecialTag){this.cbs.onattribentity(u)}else{this.cbs.ontextentity(u)}}}const wc=new Set(["input","option","optgroup","select","button","datalist","textarea"]);const vc=new Set(["p"]);const Bc=new Set(["thead","tbody"]);const Sc=new Set(["dd","dt"]);const Dc=new Set(["rt","rp"]);const kc=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",vc],["h1",vc],["h2",vc],["h3",vc],["h4",vc],["h5",vc],["h6",vc],["select",wc],["input",wc],["output",wc],["button",wc],["datalist",wc],["textarea",wc],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Sc],["dt",Sc],["address",vc],["article",vc],["aside",vc],["blockquote",vc],["details",vc],["div",vc],["dl",vc],["fieldset",vc],["figcaption",vc],["figure",vc],["footer",vc],["form",vc],["header",vc],["hr",vc],["main",vc],["nav",vc],["ol",vc],["pre",vc],["section",vc],["table",vc],["ul",vc],["rt",Dc],["rp",Dc],["tbody",Bc],["tfoot",Bc]]);const Qc=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);const Fc=new Set(["math","svg"]);const xc=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]);const Rc=/\s|\//;class Parser_Parser{constructor(u,A={}){var p,y,E,C,I;this.options=A;this.startIndex=0;this.endIndex=0;this.openTagStart=0;this.tagname="";this.attribname="";this.attribvalue="";this.attribs=null;this.stack=[];this.foreignContext=[];this.buffers=[];this.bufferOffset=0;this.writeIndex=0;this.ended=false;this.cbs=u!==null&&u!==void 0?u:{};this.lowerCaseTagNames=(p=A.lowerCaseTags)!==null&&p!==void 0?p:!A.xmlMode;this.lowerCaseAttributeNames=(y=A.lowerCaseAttributeNames)!==null&&y!==void 0?y:!A.xmlMode;this.tokenizer=new((E=A.Tokenizer)!==null&&E!==void 0?E:Tokenizer)(this.options,this);(I=(C=this.cbs).onparserinit)===null||I===void 0?void 0:I.call(C,this)}ontext(u,A){var p,y;const E=this.getSlice(u,A);this.endIndex=A-1;(y=(p=this.cbs).ontext)===null||y===void 0?void 0:y.call(p,E);this.startIndex=A}ontextentity(u){var A,p;const y=this.tokenizer.getSectionStart();this.endIndex=y-1;(p=(A=this.cbs).ontext)===null||p===void 0?void 0:p.call(A,dc(u));this.startIndex=y}isVoidElement(u){return!this.options.xmlMode&&Qc.has(u)}onopentagname(u,A){this.endIndex=A;let p=this.getSlice(u,A);if(this.lowerCaseTagNames){p=p.toLowerCase()}this.emitOpenTag(p)}emitOpenTag(u){var A,p,y,E;this.openTagStart=this.startIndex;this.tagname=u;const C=!this.options.xmlMode&&kc.get(u);if(C){while(this.stack.length>0&&C.has(this.stack[this.stack.length-1])){const u=this.stack.pop();(p=(A=this.cbs).onclosetag)===null||p===void 0?void 0:p.call(A,u,true)}}if(!this.isVoidElement(u)){this.stack.push(u);if(Fc.has(u)){this.foreignContext.push(true)}else if(xc.has(u)){this.foreignContext.push(false)}}(E=(y=this.cbs).onopentagname)===null||E===void 0?void 0:E.call(y,u);if(this.cbs.onopentag)this.attribs={}}endOpenTag(u){var A,p;this.startIndex=this.openTagStart;if(this.attribs){(p=(A=this.cbs).onopentag)===null||p===void 0?void 0:p.call(A,this.tagname,this.attribs,u);this.attribs=null}if(this.cbs.onclosetag&&this.isVoidElement(this.tagname)){this.cbs.onclosetag(this.tagname,true)}this.tagname=""}onopentagend(u){this.endIndex=u;this.endOpenTag(false);this.startIndex=u+1}onclosetag(u,A){var p,y,E,C,I,w;this.endIndex=A;let v=this.getSlice(u,A);if(this.lowerCaseTagNames){v=v.toLowerCase()}if(Fc.has(v)||xc.has(v)){this.foreignContext.pop()}if(!this.isVoidElement(v)){const u=this.stack.lastIndexOf(v);if(u!==-1){if(this.cbs.onclosetag){let A=this.stack.length-u;while(A--){this.cbs.onclosetag(this.stack.pop(),A!==0)}}else this.stack.length=u}else if(!this.options.xmlMode&&v==="p"){this.emitOpenTag("p");this.closeCurrentTag(true)}}else if(!this.options.xmlMode&&v==="br"){(y=(p=this.cbs).onopentagname)===null||y===void 0?void 0:y.call(p,"br");(C=(E=this.cbs).onopentag)===null||C===void 0?void 0:C.call(E,"br",{},true);(w=(I=this.cbs).onclosetag)===null||w===void 0?void 0:w.call(I,"br",false)}this.startIndex=A+1}onselfclosingtag(u){this.endIndex=u;if(this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]){this.closeCurrentTag(false);this.startIndex=u+1}else{this.onopentagend(u)}}closeCurrentTag(u){var A,p;const y=this.tagname;this.endOpenTag(u);if(this.stack[this.stack.length-1]===y){(p=(A=this.cbs).onclosetag)===null||p===void 0?void 0:p.call(A,y,!u);this.stack.pop()}}onattribname(u,A){this.startIndex=u;const p=this.getSlice(u,A);this.attribname=this.lowerCaseAttributeNames?p.toLowerCase():p}onattribdata(u,A){this.attribvalue+=this.getSlice(u,A)}onattribentity(u){this.attribvalue+=dc(u)}onattribend(u,A){var p,y;this.endIndex=A;(y=(p=this.cbs).onattribute)===null||y===void 0?void 0:y.call(p,this.attribname,this.attribvalue,u===Ic.Double?'"':u===Ic.Single?"'":u===Ic.NoValue?undefined:null);if(this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)){this.attribs[this.attribname]=this.attribvalue}this.attribvalue=""}getInstructionName(u){const A=u.search(Rc);let p=A<0?u:u.substr(0,A);if(this.lowerCaseTagNames){p=p.toLowerCase()}return p}ondeclaration(u,A){this.endIndex=A;const p=this.getSlice(u,A);if(this.cbs.onprocessinginstruction){const u=this.getInstructionName(p);this.cbs.onprocessinginstruction(`!${u}`,`!${p}`)}this.startIndex=A+1}onprocessinginstruction(u,A){this.endIndex=A;const p=this.getSlice(u,A);if(this.cbs.onprocessinginstruction){const u=this.getInstructionName(p);this.cbs.onprocessinginstruction(`?${u}`,`?${p}`)}this.startIndex=A+1}oncomment(u,A,p){var y,E,C,I;this.endIndex=A;(E=(y=this.cbs).oncomment)===null||E===void 0?void 0:E.call(y,this.getSlice(u,A-p));(I=(C=this.cbs).oncommentend)===null||I===void 0?void 0:I.call(C);this.startIndex=A+1}oncdata(u,A,p){var y,E,C,I,w,v,B,S,D,k;this.endIndex=A;const Q=this.getSlice(u,A-p);if(this.options.xmlMode||this.options.recognizeCDATA){(E=(y=this.cbs).oncdatastart)===null||E===void 0?void 0:E.call(y);(I=(C=this.cbs).ontext)===null||I===void 0?void 0:I.call(C,Q);(v=(w=this.cbs).oncdataend)===null||v===void 0?void 0:v.call(w)}else{(S=(B=this.cbs).oncomment)===null||S===void 0?void 0:S.call(B,`[CDATA[${Q}]]`);(k=(D=this.cbs).oncommentend)===null||k===void 0?void 0:k.call(D)}this.startIndex=A+1}onend(){var u,A;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let u=this.stack.length;u>0;this.cbs.onclosetag(this.stack[--u],true));}(A=(u=this.cbs).onend)===null||A===void 0?void 0:A.call(u)}reset(){var u,A,p,y;(A=(u=this.cbs).onreset)===null||A===void 0?void 0:A.call(u);this.tokenizer.reset();this.tagname="";this.attribname="";this.attribs=null;this.stack.length=0;this.startIndex=0;this.endIndex=0;(y=(p=this.cbs).onparserinit)===null||y===void 0?void 0:y.call(p,this);this.buffers.length=0;this.bufferOffset=0;this.writeIndex=0;this.ended=false}parseComplete(u){this.reset();this.end(u)}getSlice(u,A){while(u-this.bufferOffset>=this.buffers[0].length){this.shiftBuffer()}let p=this.buffers[0].slice(u-this.bufferOffset,A-this.bufferOffset);while(A-this.bufferOffset>this.buffers[0].length){this.shiftBuffer();p+=this.buffers[0].slice(0,A-this.bufferOffset)}return p}shiftBuffer(){this.bufferOffset+=this.buffers[0].length;this.writeIndex--;this.buffers.shift()}write(u){var A,p;if(this.ended){(p=(A=this.cbs).onerror)===null||p===void 0?void 0:p.call(A,new Error(".write() after done!"));return}this.buffers.push(u);if(this.tokenizer.running){this.tokenizer.write(u);this.writeIndex++}}end(u){var A,p;if(this.ended){(p=(A=this.cbs).onerror)===null||p===void 0?void 0:p.call(A,new Error(".end() after done!"));return}if(u)this.write(u);this.ended=true;this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){this.tokenizer.resume();while(this.tokenizer.running&&this.writeIndex<this.buffers.length){this.tokenizer.write(this.buffers[this.writeIndex++])}if(this.ended)this.tokenizer.end()}parseChunk(u){this.write(u)}done(u){this.end(u)}}function restoreDiff(u){for(let A=1;A<u.length;A++){u[A][0]+=u[A-1][0]+1}return u}const _c=new Map(restoreDiff([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(restoreDiff([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(restoreDiff([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(restoreDiff([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]]));const Tc=/["&'<>$\x80-\uFFFF]/g;const Nc=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);const Lc=String.prototype.codePointAt!=null?(u,A)=>u.codePointAt(A):(u,A)=>(u.charCodeAt(A)&64512)===55296?(u.charCodeAt(A)-55296)*1024+u.charCodeAt(A+1)-56320+65536:u.charCodeAt(A);function escape_encodeXML(u){let A="";let p=0;let y;while((y=Tc.exec(u))!==null){const E=y.index;const C=u.charCodeAt(E);const I=Nc.get(C);if(I!==undefined){A+=u.substring(p,E)+I;p=E+1}else{A+=`${u.substring(p,E)}&#x${Lc(u,E).toString(16)};`;p=Tc.lastIndex+=Number((C&64512)===55296)}}return A+u.substr(p)}const Pc=null&&escape_encodeXML;function getEscaper(u,A){return function escape(p){let y;let E=0;let C="";while(y=u.exec(p)){if(E!==y.index){C+=p.substring(E,y.index)}C+=A.get(y[0].charCodeAt(0));E=y.index+1}return C+p.substring(E)}}const Oc=getEscaper(/[&<>'"]/g,Nc);const Mc=getEscaper(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]]));const Uc=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));const Hc=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function encode_encodeHTML(u){return encodeHTMLTrieRe(Hc,u)}function encode_encodeNonAsciiHTML(u){return encodeHTMLTrieRe(xmlReplacer,u)}function encodeHTMLTrieRe(u,A){let p="";let y=0;let E;while((E=u.exec(A))!==null){const C=E.index;p+=A.substring(y,C);const I=A.charCodeAt(C);let w=htmlTrie.get(I);if(typeof w==="object"){if(C+1<A.length){const E=A.charCodeAt(C+1);const I=typeof w.n==="number"?w.n===E?w.o:undefined:w.n.get(E);if(I!==undefined){p+=I;y=u.lastIndex+=1;continue}}w=w.v}if(w!==undefined){p+=w;y=C+1}else{const E=getCodePoint(A,C);p+=`&#x${E.toString(16)};`;y=u.lastIndex+=Number(E!==I)}}return p+A.substr(y)}var Gc;(function(u){u[u["XML"]=0]="XML";u[u["HTML"]=1]="HTML"})(Gc||(Gc={}));var Wc;(function(u){u[u["UTF8"]=0]="UTF8";u[u["ASCII"]=1]="ASCII";u[u["Extensive"]=2]="Extensive";u[u["Attribute"]=3]="Attribute";u[u["Text"]=4]="Text"})(Wc||(Wc={}));function decode(u,A=Gc.XML){const p=typeof A==="number"?A:A.level;if(p===Gc.HTML){const p=typeof A==="object"?A.mode:undefined;return decodeHTML(u,p)}return decodeXML(u)}function decodeStrict(u,A=Gc.XML){var p;const y=typeof A==="number"?{level:A}:A;(p=y.mode)!==null&&p!==void 0?p:y.mode=DecodingMode.Strict;return decode(u,y)}function encode(u,A=Gc.XML){const p=typeof A==="number"?{level:A}:A;if(p.mode===Wc.UTF8)return escapeUTF8(u);if(p.mode===Wc.Attribute)return escapeAttribute(u);if(p.mode===Wc.Text)return escapeText(u);if(p.level===Gc.HTML){if(p.mode===Wc.ASCII){return encodeNonAsciiHTML(u)}return encodeHTML(u)}return encodeXML(u)}const jc=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((u=>[u.toLowerCase(),u])));const zc=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((u=>[u.toLowerCase(),u])));const $c=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function replaceQuotes(u){return u.replace(/"/g,"&quot;")}function formatAttributes(u,A){var p;if(!u)return;const y=((p=A.encodeEntities)!==null&&p!==void 0?p:A.decodeEntities)===false?replaceQuotes:A.xmlMode||A.encodeEntities!=="utf8"?escape_encodeXML:Mc;return Object.keys(u).map((p=>{var E,C;const I=(E=u[p])!==null&&E!==void 0?E:"";if(A.xmlMode==="foreign"){p=(C=zc.get(p))!==null&&C!==void 0?C:p}if(!A.emptyAttrs&&!A.xmlMode&&I===""){return p}return`${p}="${y(I)}"`})).join(" ")}const qc=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function render(u,A={}){const p="length"in u?u:[u];let y="";for(let u=0;u<p.length;u++){y+=renderNode(p[u],A)}return y}const Vc=null&&render;function renderNode(u,A){switch(u.type){case tl:return render(u.children,A);case cl:case rl:return renderDirective(u);case sl:return renderComment(u);case ll:return renderCdata(u);case il:case ol:case al:return renderTag(u,A);case nl:return renderText(u,A)}}const Kc=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]);const Jc=new Set(["svg","math"]);function renderTag(u,A){var p;if(A.xmlMode==="foreign"){u.name=(p=jc.get(u.name))!==null&&p!==void 0?p:u.name;if(u.parent&&Kc.has(u.parent.name)){A={...A,xmlMode:false}}}if(!A.xmlMode&&Jc.has(u.name)){A={...A,xmlMode:"foreign"}}let y=`<${u.name}`;const E=formatAttributes(u.attribs,A);if(E){y+=` ${E}`}if(u.children.length===0&&(A.xmlMode?A.selfClosingTags!==false:A.selfClosingTags&&qc.has(u.name))){if(!A.xmlMode)y+=" ";y+="/>"}else{y+=">";if(u.children.length>0){y+=render(u.children,A)}if(A.xmlMode||!qc.has(u.name)){y+=`</${u.name}>`}}return y}function renderDirective(u){return`<${u.data}>`}function renderText(u,A){var p;let y=u.data||"";if(((p=A.encodeEntities)!==null&&p!==void 0?p:A.decodeEntities)!==false&&!(!A.xmlMode&&u.parent&&$c.has(u.parent.name))){y=A.xmlMode||A.encodeEntities!=="utf8"?escape_encodeXML(y):Uc(y)}return y}function renderCdata(u){return`<![CDATA[${u.children[0].data}]]>`}function renderComment(u){return`\x3c!--${u.data}--\x3e`}function getOuterHTML(u,A){return renderHTML(u,A)}function getInnerHTML(u,A){return hasChildren(u)?u.children.map((u=>getOuterHTML(u,A))).join(""):""}function getText(u){if(Array.isArray(u))return u.map(getText).join("");if(isTag(u))return u.name==="br"?"\n":getText(u.children);if(isCDATA(u))return getText(u.children);if(isText(u))return u.data;return""}function stringify_textContent(u){if(Array.isArray(u))return u.map(stringify_textContent).join("");if(hasChildren(u)&&!isComment(u)){return stringify_textContent(u.children)}if(isText(u))return u.data;return""}function innerText(u){if(Array.isArray(u))return u.map(innerText).join("");if(hasChildren(u)&&(u.type===ElementType.Tag||isCDATA(u))){return innerText(u.children)}if(isText(u))return u.data;return""}function getChildren(u){return hasChildren(u)?u.children:[]}function getParent(u){return u.parent||null}function getSiblings(u){const A=getParent(u);if(A!=null)return getChildren(A);const p=[u];let{prev:y,next:E}=u;while(y!=null){p.unshift(y);({prev:y}=y)}while(E!=null){p.push(E);({next:E}=E)}return p}function getAttributeValue(u,A){var p;return(p=u.attribs)===null||p===void 0?void 0:p[A]}function hasAttrib(u,A){return u.attribs!=null&&Object.prototype.hasOwnProperty.call(u.attribs,A)&&u.attribs[A]!=null}function getName(u){return u.name}function nextElementSibling(u){let{next:A}=u;while(A!==null&&!isTag(A))({next:A}=A);return A}function prevElementSibling(u){let{prev:A}=u;while(A!==null&&!isTag(A))({prev:A}=A);return A}function querying_filter(u,A,p=true,y=Infinity){return find(u,Array.isArray(A)?A:[A],p,y)}function find(u,A,p,y){const E=[];const C=[Array.isArray(A)?A:[A]];const I=[0];for(;;){if(I[0]>=C[0].length){if(I.length===1){return E}C.shift();I.shift();continue}const A=C[0][I[0]++];if(u(A)){E.push(A);if(--y<=0)return E}if(p&&hasChildren(A)&&A.children.length>0){I.unshift(0);C.unshift(A.children)}}}function findOneChild(u,A){return A.find(u)}function querying_findOne(u,A,p=true){const y=Array.isArray(A)?A:[A];for(let A=0;A<y.length;A++){const E=y[A];if(isTag(E)&&u(E)){return E}if(p&&hasChildren(E)&&E.children.length>0){const A=querying_findOne(u,E.children,true);if(A)return A}}return null}function existsOne(u,A){return(Array.isArray(A)?A:[A]).some((A=>isTag(A)&&u(A)||hasChildren(A)&&existsOne(u,A.children)))}function findAll(u,A){const p=[];const y=[Array.isArray(A)?A:[A]];const E=[0];for(;;){if(E[0]>=y[0].length){if(y.length===1){return p}y.shift();E.shift();continue}const A=y[0][E[0]++];if(isTag(A)&&u(A))p.push(A);if(hasChildren(A)&&A.children.length>0){E.unshift(0);y.unshift(A.children)}}}const Yc={tag_name(u){if(typeof u==="function"){return A=>node_isTag(A)&&u(A.name)}else if(u==="*"){return node_isTag}return A=>node_isTag(A)&&A.name===u},tag_type(u){if(typeof u==="function"){return A=>u(A.type)}return A=>A.type===u},tag_contains(u){if(typeof u==="function"){return A=>node_isText(A)&&u(A.data)}return A=>node_isText(A)&&A.data===u}};function getAttribCheck(u,A){if(typeof A==="function"){return p=>isTag(p)&&A(p.attribs[u])}return p=>isTag(p)&&p.attribs[u]===A}function combineFuncs(u,A){return p=>u(p)||A(p)}function compileTest(u){const A=Object.keys(u).map((A=>{const p=u[A];return Object.prototype.hasOwnProperty.call(Yc,A)?Yc[A](p):getAttribCheck(A,p)}));return A.length===0?null:A.reduce(combineFuncs)}function testElement(u,A){const p=compileTest(u);return p?p(A):true}function getElements(u,A,p,y=Infinity){const E=compileTest(u);return E?filter(E,A,p,y):[]}function getElementById(u,A,p=true){if(!Array.isArray(A))A=[A];return findOne(getAttribCheck("id",u),A,p)}function legacy_getElementsByTagName(u,A,p=true,y=Infinity){return filter(Yc["tag_name"](u),A,p,y)}function getElementsByClassName(u,A,p=true,y=Infinity){return filter(getAttribCheck("class",u),A,p,y)}function getElementsByTagType(u,A,p=true,y=Infinity){return filter(Yc["tag_type"](u),A,p,y)}function removeSubsets(u){let A=u.length;while(--A>=0){const p=u[A];if(A>0&&u.lastIndexOf(p,A-1)>=0){u.splice(A,1);continue}for(let y=p.parent;y;y=y.parent){if(u.includes(y)){u.splice(A,1);break}}}return u}var Xc;(function(u){u[u["DISCONNECTED"]=1]="DISCONNECTED";u[u["PRECEDING"]=2]="PRECEDING";u[u["FOLLOWING"]=4]="FOLLOWING";u[u["CONTAINS"]=8]="CONTAINS";u[u["CONTAINED_BY"]=16]="CONTAINED_BY"})(Xc||(Xc={}));function compareDocumentPosition(u,A){const p=[];const y=[];if(u===A){return 0}let E=hasChildren(u)?u:u.parent;while(E){p.unshift(E);E=E.parent}E=hasChildren(A)?A:A.parent;while(E){y.unshift(E);E=E.parent}const C=Math.min(p.length,y.length);let I=0;while(I<C&&p[I]===y[I]){I++}if(I===0){return Xc.DISCONNECTED}const w=p[I-1];const v=w.children;const B=p[I];const S=y[I];if(v.indexOf(B)>v.indexOf(S)){if(w===A){return Xc.FOLLOWING|Xc.CONTAINED_BY}return Xc.FOLLOWING}if(w===u){return Xc.PRECEDING|Xc.CONTAINS}return Xc.PRECEDING}function uniqueSort(u){u=u.filter(((u,A,p)=>!p.includes(u,A+1)));u.sort(((u,A)=>{const p=compareDocumentPosition(u,A);if(p&Xc.PRECEDING){return-1}else if(p&Xc.FOLLOWING){return 1}return 0}));return u}function feeds_getFeed(u){const A=getOneElement(isValidFeed,u);return!A?null:A.name==="feed"?getAtomFeed(A):getRssFeed(A)}function getAtomFeed(u){var A;const p=u.children;const y={type:"atom",items:getElementsByTagName("entry",p).map((u=>{var A;const{children:p}=u;const y={media:getMediaElements(p)};addConditionally(y,"id","id",p);addConditionally(y,"title","title",p);const E=(A=getOneElement("link",p))===null||A===void 0?void 0:A.attribs["href"];if(E){y.link=E}const C=feeds_fetch("summary",p)||feeds_fetch("content",p);if(C){y.description=C}const I=feeds_fetch("updated",p);if(I){y.pubDate=new Date(I)}return y}))};addConditionally(y,"id","id",p);addConditionally(y,"title","title",p);const E=(A=getOneElement("link",p))===null||A===void 0?void 0:A.attribs["href"];if(E){y.link=E}addConditionally(y,"description","subtitle",p);const C=feeds_fetch("updated",p);if(C){y.updated=new Date(C)}addConditionally(y,"author","email",p,true);return y}function getRssFeed(u){var A,p;const y=(p=(A=getOneElement("channel",u.children))===null||A===void 0?void 0:A.children)!==null&&p!==void 0?p:[];const E={type:u.name.substr(0,3),id:"",items:getElementsByTagName("item",u.children).map((u=>{const{children:A}=u;const p={media:getMediaElements(A)};addConditionally(p,"id","guid",A);addConditionally(p,"title","title",A);addConditionally(p,"link","link",A);addConditionally(p,"description","description",A);const y=feeds_fetch("pubDate",A)||feeds_fetch("dc:date",A);if(y)p.pubDate=new Date(y);return p}))};addConditionally(E,"title","title",y);addConditionally(E,"link","link",y);addConditionally(E,"description","description",y);const C=feeds_fetch("lastBuildDate",y);if(C){E.updated=new Date(C)}addConditionally(E,"author","managingEditor",y,true);return E}const Zc=null&&["url","type","lang"];const eu=null&&["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements(u){return getElementsByTagName("media:content",u).map((u=>{const{attribs:A}=u;const p={medium:A["medium"],isDefault:!!A["isDefault"]};for(const u of Zc){if(A[u]){p[u]=A[u]}}for(const u of eu){if(A[u]){p[u]=parseInt(A[u],10)}}if(A["expression"]){p.expression=A["expression"]}return p}))}function getOneElement(u,A){return getElementsByTagName(u,A,true,1)[0]}function feeds_fetch(u,A,p=false){return textContent(getElementsByTagName(u,A,p,1)).trim()}function addConditionally(u,A,p,y,E=false){const C=feeds_fetch(p,y,E);if(C)u[A]=C}function isValidFeed(u){return u==="rss"||u==="feed"||u==="rdf:RDF"}function parseDocument(u,A){const p=new esm_DomHandler(undefined,A);new Parser_Parser(p,A).end(u);return p.root}function parseDOM(u,A){return parseDocument(u,A).children}function createDomStream(u,A,p){const y=new DomHandler(u,A,p);return new Parser(y,A)}const tu={xmlMode:true};function parseFeed(u,A=tu){return getFeed(parseDOM(u,A))}var nu=p(9592);function limitedDepthRecursive(u,A,p=()=>undefined){if(u===undefined){const f1=function(...u){return A(f1,...u)};return f1}if(u>=0){return function(...y){return A(limitedDepthRecursive(u-1,A,p),...y)}}return p}function trimCharacter(u,A){let p=0;let y=u.length;while(p<y&&u[p]===A){++p}while(y>p&&u[y-1]===A){--y}return p>0||y<u.length?u.substring(p,y):u}function trimCharacterEnd(u,A){let p=u.length;while(p>0&&u[p-1]===A){--p}return p<u.length?u.substring(0,p):u}function unicodeEscape(u){return u.replace(/[\s\S]/g,(u=>"\\u"+u.charCodeAt().toString(16).padStart(4,"0")))}function mergeDuplicatesPreferLast(u,A){const p=new Map;for(let y=u.length;y-- >0;){const E=u[y];const C=A(E);p.set(C,p.has(C)?nu(E,p.get(C),{arrayMerge:overwriteMerge$1}):E)}return[...p.values()].reverse()}const overwriteMerge$1=(u,A,p)=>[...A];function get(u,A){for(const p of A){if(!u){return undefined}u=u[p]}return u}function numberToLetterSequence(u,A="a",p=26){const y=[];do{u-=1;y.push(u%p);u=u/p>>0}while(u>0);const E=A.charCodeAt(0);return y.reverse().map((u=>String.fromCharCode(E+u))).join("")}const ru=["I","X","C","M"];const su=["V","L","D"];function numberToRoman(u){return[...u+""].map((u=>+u)).reverse().map(((u,A)=>u%5<4?(u<5?"":su[A])+ru[A].repeat(u%5):ru[A]+(u<5?su[A]:ru[A+1]))).reverse().join("")}class InlineTextBuilder{constructor(u,A=undefined){this.lines=[];this.nextLineWords=[];this.maxLineLength=A||u.wordwrap||Number.MAX_VALUE;this.nextLineAvailableChars=this.maxLineLength;this.wrapCharacters=get(u,["longWordSplit","wrapCharacters"])||[];this.forceWrapOnLimit=get(u,["longWordSplit","forceWrapOnLimit"])||false;this.stashedSpace=false;this.wordBreakOpportunity=false}pushWord(u,A=false){if(this.nextLineAvailableChars<=0&&!A){this.startNewLine()}const p=this.nextLineWords.length===0;const y=u.length+(p?0:1);if(y<=this.nextLineAvailableChars||A){this.nextLineWords.push(u);this.nextLineAvailableChars-=y}else{const[A,...y]=this.splitLongWord(u);if(!p){this.startNewLine()}this.nextLineWords.push(A);this.nextLineAvailableChars-=A.length;for(const u of y){this.startNewLine();this.nextLineWords.push(u);this.nextLineAvailableChars-=u.length}}}popWord(){const u=this.nextLineWords.pop();if(u!==undefined){const A=this.nextLineWords.length===0;const p=u.length+(A?0:1);this.nextLineAvailableChars+=p}return u}concatWord(u,A=false){if(this.wordBreakOpportunity&&u.length>this.nextLineAvailableChars){this.pushWord(u,A);this.wordBreakOpportunity=false}else{const p=this.popWord();this.pushWord(p?p.concat(u):u,A)}}startNewLine(u=1){this.lines.push(this.nextLineWords);if(u>1){this.lines.push(...Array.from({length:u-1},(()=>[])))}this.nextLineWords=[];this.nextLineAvailableChars=this.maxLineLength}isEmpty(){return this.lines.length===0&&this.nextLineWords.length===0}clear(){this.lines.length=0;this.nextLineWords.length=0;this.nextLineAvailableChars=this.maxLineLength}toString(){return[...this.lines,this.nextLineWords].map((u=>u.join(" "))).join("\n")}splitLongWord(u){const A=[];let p=0;while(u.length>this.maxLineLength){const y=u.substring(0,this.maxLineLength);const E=u.substring(this.maxLineLength);const C=y.lastIndexOf(this.wrapCharacters[p]);if(C>-1){u=y.substring(C+1)+E;A.push(y.substring(0,C+1))}else{p++;if(p<this.wrapCharacters.length){u=y+E}else{if(this.forceWrapOnLimit){A.push(y);u=E;if(u.length>this.maxLineLength){continue}}else{u=y+E}break}}}A.push(u);return A}}class StackItem{constructor(u=null){this.next=u}getRoot(){return this.next?this.next:this}}class BlockStackItem extends StackItem{constructor(u,A=null,p=1,y=undefined){super(A);this.leadingLineBreaks=p;this.inlineTextBuilder=new InlineTextBuilder(u,y);this.rawText="";this.stashedLineBreaks=0;this.isPre=A&&A.isPre;this.isNoWrap=A&&A.isNoWrap}}class ListStackItem extends BlockStackItem{constructor(u,A=null,{interRowLineBreaks:p=1,leadingLineBreaks:y=2,maxLineLength:E=undefined,maxPrefixLength:C=0,prefixAlign:I="left"}={}){super(u,A,y,E);this.maxPrefixLength=C;this.prefixAlign=I;this.interRowLineBreaks=p}}class ListItemStackItem extends BlockStackItem{constructor(u,A=null,{leadingLineBreaks:p=1,maxLineLength:y=undefined,prefix:E=""}={}){super(u,A,p,y);this.prefix=E}}class TableStackItem extends StackItem{constructor(u=null){super(u);this.rows=[];this.isPre=u&&u.isPre;this.isNoWrap=u&&u.isNoWrap}}class TableRowStackItem extends StackItem{constructor(u=null){super(u);this.cells=[];this.isPre=u&&u.isPre;this.isNoWrap=u&&u.isNoWrap}}class TableCellStackItem extends StackItem{constructor(u,A=null,p=undefined){super(A);this.inlineTextBuilder=new InlineTextBuilder(u,p);this.rawText="";this.stashedLineBreaks=0;this.isPre=A&&A.isPre;this.isNoWrap=A&&A.isNoWrap}}class TransformerStackItem extends StackItem{constructor(u=null,A){super(u);this.transform=A}}function charactersToCodes(u){return[...u].map((u=>"\\u"+u.charCodeAt(0).toString(16).padStart(4,"0"))).join("")}class WhitespaceProcessor{constructor(u){this.whitespaceChars=u.preserveNewlines?u.whitespaceCharacters.replace(/\n/g,""):u.whitespaceCharacters;const A=charactersToCodes(this.whitespaceChars);this.leadingWhitespaceRe=new RegExp(`^[${A}]`);this.trailingWhitespaceRe=new RegExp(`[${A}]$`);this.allWhitespaceOrEmptyRe=new RegExp(`^[${A}]*$`);this.newlineOrNonWhitespaceRe=new RegExp(`(\\n|[^\\n${A}])`,"g");this.newlineOrNonNewlineStringRe=new RegExp(`(\\n|[^\\n]+)`,"g");if(u.preserveNewlines){const u=new RegExp(`\\n|[^\\n${A}]+`,"gm");this.shrinkWrapAdd=function(A,p,y=u=>u,E=false){if(!A){return}const C=p.stashedSpace;let I=false;let w=u.exec(A);if(w){I=true;if(w[0]==="\n"){p.startNewLine()}else if(C||this.testLeadingWhitespace(A)){p.pushWord(y(w[0]),E)}else{p.concatWord(y(w[0]),E)}while((w=u.exec(A))!==null){if(w[0]==="\n"){p.startNewLine()}else{p.pushWord(y(w[0]),E)}}}p.stashedSpace=C&&!I||this.testTrailingWhitespace(A)}}else{const u=new RegExp(`[^${A}]+`,"g");this.shrinkWrapAdd=function(A,p,y=u=>u,E=false){if(!A){return}const C=p.stashedSpace;let I=false;let w=u.exec(A);if(w){I=true;if(C||this.testLeadingWhitespace(A)){p.pushWord(y(w[0]),E)}else{p.concatWord(y(w[0]),E)}while((w=u.exec(A))!==null){p.pushWord(y(w[0]),E)}}p.stashedSpace=C&&!I||this.testTrailingWhitespace(A)}}}addLiteral(u,A,p=true){if(!u){return}const y=A.stashedSpace;let E=false;let C=this.newlineOrNonNewlineStringRe.exec(u);if(C){E=true;if(C[0]==="\n"){A.startNewLine()}else if(y){A.pushWord(C[0],p)}else{A.concatWord(C[0],p)}while((C=this.newlineOrNonNewlineStringRe.exec(u))!==null){if(C[0]==="\n"){A.startNewLine()}else{A.pushWord(C[0],p)}}}A.stashedSpace=y&&!E}testLeadingWhitespace(u){return this.leadingWhitespaceRe.test(u)}testTrailingWhitespace(u){return this.trailingWhitespaceRe.test(u)}testContainsWords(u){return!this.allWhitespaceOrEmptyRe.test(u)}countNewlinesNoWords(u){this.newlineOrNonWhitespaceRe.lastIndex=0;let A=0;let p;while((p=this.newlineOrNonWhitespaceRe.exec(u))!==null){if(p[0]==="\n"){A++}else{return 0}}return A}}class BlockTextBuilder{constructor(u,A,p=undefined){this.options=u;this.picker=A;this.metadata=p;this.whitespaceProcessor=new WhitespaceProcessor(u);this._stackItem=new BlockStackItem(u);this._wordTransformer=undefined}pushWordTransform(u){this._wordTransformer=new TransformerStackItem(this._wordTransformer,u)}popWordTransform(){if(!this._wordTransformer){return undefined}const u=this._wordTransformer.transform;this._wordTransformer=this._wordTransformer.next;return u}startNoWrap(){this._stackItem.isNoWrap=true}stopNoWrap(){this._stackItem.isNoWrap=false}_getCombinedWordTransformer(){const u=this._wordTransformer?u=>applyTransformer(u,this._wordTransformer):undefined;const A=this.options.encodeCharacters;return u?A?p=>A(u(p)):u:A}_popStackItem(){const u=this._stackItem;this._stackItem=u.next;return u}addLineBreak(){if(!(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem)){return}if(this._stackItem.isPre){this._stackItem.rawText+="\n"}else{this._stackItem.inlineTextBuilder.startNewLine()}}addWordBreakOpportunity(){if(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem){this._stackItem.inlineTextBuilder.wordBreakOpportunity=true}}addInline(u,{noWordTransform:A=false}={}){if(!(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem)){return}if(this._stackItem.isPre){this._stackItem.rawText+=u;return}if(u.length===0||this._stackItem.stashedLineBreaks&&!this.whitespaceProcessor.testContainsWords(u)){return}if(this.options.preserveNewlines){const A=this.whitespaceProcessor.countNewlinesNoWords(u);if(A>0){this._stackItem.inlineTextBuilder.startNewLine(A);return}}if(this._stackItem.stashedLineBreaks){this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks)}this.whitespaceProcessor.shrinkWrapAdd(u,this._stackItem.inlineTextBuilder,A?undefined:this._getCombinedWordTransformer(),this._stackItem.isNoWrap);this._stackItem.stashedLineBreaks=0}addLiteral(u){if(!(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem)){return}if(u.length===0){return}if(this._stackItem.isPre){this._stackItem.rawText+=u;return}if(this._stackItem.stashedLineBreaks){this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks)}this.whitespaceProcessor.addLiteral(u,this._stackItem.inlineTextBuilder,this._stackItem.isNoWrap);this._stackItem.stashedLineBreaks=0}openBlock({leadingLineBreaks:u=1,reservedLineLength:A=0,isPre:p=false}={}){const y=Math.max(20,this._stackItem.inlineTextBuilder.maxLineLength-A);this._stackItem=new BlockStackItem(this.options,this._stackItem,u,y);if(p){this._stackItem.isPre=true}}closeBlock({trailingLineBreaks:u=1,blockTransform:A=undefined}={}){const p=this._popStackItem();const y=A?A(html_to_text_getText(p)):html_to_text_getText(p);addText(this._stackItem,y,p.leadingLineBreaks,Math.max(p.stashedLineBreaks,u))}openList({maxPrefixLength:u=0,prefixAlign:A="left",interRowLineBreaks:p=1,leadingLineBreaks:y=2}={}){this._stackItem=new ListStackItem(this.options,this._stackItem,{interRowLineBreaks:p,leadingLineBreaks:y,maxLineLength:this._stackItem.inlineTextBuilder.maxLineLength,maxPrefixLength:u,prefixAlign:A})}openListItem({prefix:u=""}={}){if(!(this._stackItem instanceof ListStackItem)){throw new Error("Can't add a list item to something that is not a list! Check the formatter.")}const A=this._stackItem;const p=Math.max(u.length,A.maxPrefixLength);const y=Math.max(20,A.inlineTextBuilder.maxLineLength-p);this._stackItem=new ListItemStackItem(this.options,A,{prefix:u,maxLineLength:y,leadingLineBreaks:A.interRowLineBreaks})}closeListItem(){const u=this._popStackItem();const A=u.next;const p=Math.max(u.prefix.length,A.maxPrefixLength);const y="\n"+" ".repeat(p);const E=A.prefixAlign==="right"?u.prefix.padStart(p):u.prefix.padEnd(p);const C=E+html_to_text_getText(u).replace(/\n/g,y);addText(A,C,u.leadingLineBreaks,Math.max(u.stashedLineBreaks,A.interRowLineBreaks))}closeList({trailingLineBreaks:u=2}={}){const A=this._popStackItem();const p=html_to_text_getText(A);if(p){addText(this._stackItem,p,A.leadingLineBreaks,u)}}openTable(){this._stackItem=new TableStackItem(this._stackItem)}openTableRow(){if(!(this._stackItem instanceof TableStackItem)){throw new Error("Can't add a table row to something that is not a table! Check the formatter.")}this._stackItem=new TableRowStackItem(this._stackItem)}openTableCell({maxColumnWidth:u=undefined}={}){if(!(this._stackItem instanceof TableRowStackItem)){throw new Error("Can't add a table cell to something that is not a table row! Check the formatter.")}this._stackItem=new TableCellStackItem(this.options,this._stackItem,u)}closeTableCell({colspan:u=1,rowspan:A=1}={}){const p=this._popStackItem();const y=trimCharacter(html_to_text_getText(p),"\n");p.next.cells.push({colspan:u,rowspan:A,text:y})}closeTableRow(){const u=this._popStackItem();u.next.rows.push(u.cells)}closeTable({tableToString:u,leadingLineBreaks:A=2,trailingLineBreaks:p=2}){const y=this._popStackItem();const E=u(y.rows);if(E){addText(this._stackItem,E,A,p)}}toString(){return html_to_text_getText(this._stackItem.getRoot())}}function html_to_text_getText(u){if(!(u instanceof BlockStackItem||u instanceof ListItemStackItem||u instanceof TableCellStackItem)){throw new Error("Only blocks, list items and table cells can be requested for text contents.")}return u.inlineTextBuilder.isEmpty()?u.rawText:u.rawText+u.inlineTextBuilder.toString()}function addText(u,A,p,y){if(!(u instanceof BlockStackItem||u instanceof ListItemStackItem||u instanceof TableCellStackItem)){throw new Error("Only blocks, list items and table cells can contain text.")}const E=html_to_text_getText(u);const C=Math.max(u.stashedLineBreaks,p);u.inlineTextBuilder.clear();if(E){u.rawText=E+"\n".repeat(C)+A}else{u.rawText=A;u.leadingLineBreaks=C}u.stashedLineBreaks=y}function applyTransformer(u,A){return A?applyTransformer(A.transform(u),A.next):u}function compile$1(u={}){const A=u.selectors.filter((u=>!u.format));if(A.length){throw new Error("Following selectors have no specified format: "+A.map((u=>`\`${u.selector}\``)).join(", "))}const p=new DecisionTree(u.selectors.map((u=>[u.selector,u]))).build(hp2Builder);if(typeof u.encodeCharacters!=="function"){u.encodeCharacters=makeReplacerFromDict(u.encodeCharacters)}const y=new DecisionTree(u.baseElements.selectors.map(((u,A)=>[u,A+1]))).build(hp2Builder);function findBaseElements(A){return findBases(A,u,y)}const E=limitedDepthRecursive(u.limits.maxDepth,recursiveWalk,(function(A,p){p.addInline(u.limits.ellipsis||"")}));return function(A,y=undefined){return html_to_text_process(A,y,u,p,findBaseElements,E)}}function html_to_text_process(u,A,p,y,E,C){const I=p.limits.maxInputLength;if(I&&u&&u.length>I){console.warn(`Input length ${u.length} is above allowed limit of ${I}. Truncating without ellipsis.`);u=u.substring(0,I)}const w=parseDocument(u,{decodeEntities:p.decodeEntities});const v=E(w.children);const B=new BlockTextBuilder(p,y,A);C(v,B);return B.toString()}function findBases(u,A,p){const y=[];function recursiveWalk(u,E){E=E.slice(0,A.limits.maxChildNodes);for(const C of E){if(C.type!=="tag"){continue}const E=p.pick1(C);if(E>0){y.push({selectorIndex:E,element:C})}else if(C.children){u(C.children)}if(y.length>=A.limits.maxBaseElements){return}}}const E=limitedDepthRecursive(A.limits.maxDepth,recursiveWalk);E(u);if(A.baseElements.orderBy!=="occurrence"){y.sort(((u,A)=>u.selectorIndex-A.selectorIndex))}return A.baseElements.returnDomByDefault&&y.length===0?u:y.map((u=>u.element))}function recursiveWalk(u,A,p){if(!A){return}const y=p.options;const E=A.length>y.limits.maxChildNodes;if(E){A=A.slice(0,y.limits.maxChildNodes);A.push({data:y.limits.ellipsis,type:"text"})}for(const E of A){switch(E.type){case"text":{p.addInline(E.data);break}case"tag":{const A=p.picker.pick1(E);const C=y.formatters[A.format];C(E,u,p,A.options||{});break}}}return}function makeReplacerFromDict(u){if(!u||Object.keys(u).length===0){return undefined}const A=Object.entries(u).filter((([,u])=>u!==false));const p=new RegExp(A.map((([u])=>`(${unicodeEscape([...u][0])})`)).join("|"),"g");const y=A.map((([,u])=>u));const replacer=(u,...A)=>y[A.findIndex((u=>u))];return u=>u.replace(p,replacer)}function formatSkip(u,A,p,y){}function formatInlineString(u,A,p,y){p.addLiteral(y.string||"")}function formatBlockString(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.addLiteral(y.string||"");p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatInline(u,A,p,y){A(u.children,p)}function formatBlock$1(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function renderOpenTag(u){const A=u.attribs&&u.attribs.length?" "+Object.entries(u.attribs).map((([u,A])=>A===""?u:`${u}=${A.replace(/"/g,"&quot;")}`)).join(" "):"";return`<${u.name}${A}>`}function renderCloseTag(u){return`</${u.name}>`}function formatInlineTag(u,A,p,y){p.startNoWrap();p.addLiteral(renderOpenTag(u));p.stopNoWrap();A(u.children,p);p.startNoWrap();p.addLiteral(renderCloseTag(u));p.stopNoWrap()}function formatBlockTag(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.startNoWrap();p.addLiteral(renderOpenTag(u));p.stopNoWrap();A(u.children,p);p.startNoWrap();p.addLiteral(renderCloseTag(u));p.stopNoWrap();p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatInlineHtml(u,A,p,y){p.startNoWrap();p.addLiteral(render(u,{decodeEntities:p.options.decodeEntities}));p.stopNoWrap()}function formatBlockHtml(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.startNoWrap();p.addLiteral(render(u,{decodeEntities:p.options.decodeEntities}));p.stopNoWrap();p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatInlineSurround(u,A,p,y){p.addLiteral(y.prefix||"");A(u.children,p);p.addLiteral(y.suffix||"")}var iu=Object.freeze({__proto__:null,block:formatBlock$1,blockHtml:formatBlockHtml,blockString:formatBlockString,blockTag:formatBlockTag,inline:formatInline,inlineHtml:formatInlineHtml,inlineString:formatInlineString,inlineSurround:formatInlineSurround,inlineTag:formatInlineTag,skip:formatSkip});function getRow(u,A){if(!u[A]){u[A]=[]}return u[A]}function findFirstVacantIndex(u,A=0){while(u[A]){A++}return A}function transposeInPlace(u,A){for(let p=0;p<A;p++){const A=getRow(u,p);for(let y=0;y<p;y++){const E=getRow(u,y);if(A[y]||E[p]){const u=A[y];A[y]=E[p];E[p]=u}}}}function putCellIntoLayout(u,A,p,y){for(let E=0;E<u.rowspan;E++){const C=getRow(A,p+E);for(let A=0;A<u.colspan;A++){C[y+A]=u}}}function getOrInitOffset(u,A){if(u[A]===undefined){u[A]=A===0?0:1+getOrInitOffset(u,A-1)}return u[A]}function updateOffset(u,A,p,y){u[A+p]=Math.max(getOrInitOffset(u,A+p),getOrInitOffset(u,A)+y)}function tableToString(u,A,p){const y=[];let E=0;const C=u.length;const I=[0];for(let p=0;p<C;p++){const C=getRow(y,p);const w=u[p];let v=0;for(let u=0;u<w.length;u++){const E=w[u];v=findFirstVacantIndex(C,v);putCellIntoLayout(E,y,p,v);v+=E.colspan;E.lines=E.text.split("\n");const B=E.lines.length;updateOffset(I,p,E.rowspan,B+A)}E=C.length>E?C.length:E}transposeInPlace(y,C>E?C:E);const w=[];const v=[0];for(let u=0;u<E;u++){let A=0;let E;const B=Math.min(C,y[u].length);while(A<B){E=y[u][A];if(E){if(!E.rendered){let y=0;for(let p=0;p<E.lines.length;p++){const C=E.lines[p];const B=I[A]+p;w[B]=(w[B]||"").padEnd(v[u])+C;y=C.length>y?C.length:y}updateOffset(v,u,E.colspan,y+p);E.rendered=true}A+=E.rowspan}else{const u=I[A];w[u]=w[u]||"";A++}}}return w.join("\n")}function formatLineBreak(u,A,p,y){p.addLineBreak()}function formatWbr(u,A,p,y){p.addWordBreakOpportunity()}function formatHorizontalLine(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.addInline("-".repeat(y.length||p.options.wordwrap||40));p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatParagraph(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatPre(u,A,p,y){p.openBlock({isPre:true,leadingLineBreaks:y.leadingLineBreaks||2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatHeading(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});if(y.uppercase!==false){p.pushWordTransform((u=>u.toUpperCase()));A(u.children,p);p.popWordTransform()}else{A(u.children,p)}p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatBlockquote(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2,reservedLineLength:2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2,blockTransform:u=>(y.trimEmptyLines!==false?trimCharacter(u,"\n"):u).split("\n").map((u=>"> "+u)).join("\n")})}function withBrackets(u,A){if(!A){return u}const p=typeof A[0]==="string"?A[0]:"[";const y=typeof A[1]==="string"?A[1]:"]";return p+u+y}function pathRewrite(u,A,p,y,E){const C=typeof A==="function"?A(u,y,E):u;return C[0]==="/"&&p?trimCharacterEnd(p,"/")+C:C}function formatImage(u,A,p,y){const E=u.attribs||{};const C=E.alt?E.alt:"";const I=!E.src?"":pathRewrite(E.src,y.pathRewrite,y.baseUrl,p.metadata,u);const w=!I?C:!C?withBrackets(I,y.linkBrackets):C+" "+withBrackets(I,y.linkBrackets);p.addInline(w,{noWordTransform:true})}function formatAnchor(u,A,p,y){function getHref(){if(y.ignoreHref){return""}if(!u.attribs||!u.attribs.href){return""}let A=u.attribs.href.replace(/^mailto:/,"");if(y.noAnchorUrl&&A[0]==="#"){return""}A=pathRewrite(A,y.pathRewrite,y.baseUrl,p.metadata,u);return A}const E=getHref();if(!E){A(u.children,p)}else{let C="";p.pushWordTransform((u=>{if(u){C+=u}return u}));A(u.children,p);p.popWordTransform();const I=y.hideLinkHrefIfSameAsText&&E===C;if(!I){p.addInline(!C?E:" "+withBrackets(E,y.linkBrackets),{noWordTransform:true})}}}function formatList(u,A,p,y,E){const C=get(u,["parent","name"])==="li";let I=0;const w=(u.children||[]).filter((u=>u.type!=="text"||!/^\s*$/.test(u.data))).map((function(u){if(u.name!=="li"){return{node:u,prefix:""}}const A=C?E().trimStart():E();if(A.length>I){I=A.length}return{node:u,prefix:A}}));if(!w.length){return}p.openList({interRowLineBreaks:1,leadingLineBreaks:C?1:y.leadingLineBreaks||2,maxPrefixLength:I,prefixAlign:"left"});for(const{node:u,prefix:y}of w){p.openListItem({prefix:y});A([u],p);p.closeListItem()}p.closeList({trailingLineBreaks:C?1:y.trailingLineBreaks||2})}function formatUnorderedList(u,A,p,y){const E=y.itemPrefix||" * ";return formatList(u,A,p,y,(()=>E))}function formatOrderedList(u,A,p,y){let E=Number(u.attribs.start||"1");const C=getOrderedListIndexFunction(u.attribs.type);const nextPrefixCallback=()=>" "+C(E++)+". ";return formatList(u,A,p,y,nextPrefixCallback)}function getOrderedListIndexFunction(u="1"){switch(u){case"a":return u=>numberToLetterSequence(u,"a");case"A":return u=>numberToLetterSequence(u,"A");case"i":return u=>numberToRoman(u).toLowerCase();case"I":return u=>numberToRoman(u);case"1":default:return u=>u.toString()}}function splitClassesAndIds(u){const A=[];const p=[];for(const y of u){if(y.startsWith(".")){A.push(y.substring(1))}else if(y.startsWith("#")){p.push(y.substring(1))}}return{classes:A,ids:p}}function isDataTable(u,A){if(A===true){return true}if(!u){return false}const{classes:p,ids:y}=splitClassesAndIds(A);const E=(u["class"]||"").split(" ");const C=(u["id"]||"").split(" ");return E.some((u=>p.includes(u)))||C.some((u=>y.includes(u)))}function formatTable(u,A,p,y){return isDataTable(u.attribs,p.options.tables)?formatDataTable(u,A,p,y):formatBlock(u,A,p,y)}function formatBlock(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks})}function formatDataTable(u,A,p,y){p.openTable();u.children.forEach(walkTable);p.closeTable({tableToString:u=>tableToString(u,y.rowSpacing??0,y.colSpacing??3),leadingLineBreaks:y.leadingLineBreaks,trailingLineBreaks:y.trailingLineBreaks});function formatCell(u){const E=+get(u,["attribs","colspan"])||1;const C=+get(u,["attribs","rowspan"])||1;p.openTableCell({maxColumnWidth:y.maxColumnWidth});A(u.children,p);p.closeTableCell({colspan:E,rowspan:C})}function walkTable(u){if(u.type!=="tag"){return}const A=y.uppercaseHeaderCells!==false?u=>{p.pushWordTransform((u=>u.toUpperCase()));formatCell(u);p.popWordTransform()}:formatCell;switch(u.name){case"thead":case"tbody":case"tfoot":case"center":u.children.forEach(walkTable);return;case"tr":{p.openTableRow();for(const p of u.children){if(p.type!=="tag"){continue}switch(p.name){case"th":{A(p);break}case"td":{formatCell(p);break}}}p.closeTableRow();break}}}}var ou=Object.freeze({__proto__:null,anchor:formatAnchor,blockquote:formatBlockquote,dataTable:formatDataTable,heading:formatHeading,horizontalLine:formatHorizontalLine,image:formatImage,lineBreak:formatLineBreak,orderedList:formatOrderedList,paragraph:formatParagraph,pre:formatPre,table:formatTable,unorderedList:formatUnorderedList,wbr:formatWbr});const au={baseElements:{selectors:["body"],orderBy:"selectors",returnDomByDefault:true},decodeEntities:true,encodeCharacters:{},formatters:{},limits:{ellipsis:"...",maxBaseElements:undefined,maxChildNodes:undefined,maxDepth:undefined,maxInputLength:1<<24},longWordSplit:{forceWrapOnLimit:false,wrapCharacters:[]},preserveNewlines:false,selectors:[{selector:"*",format:"inline"},{selector:"a",format:"anchor",options:{baseUrl:null,hideLinkHrefIfSameAsText:false,ignoreHref:false,linkBrackets:["[","]"],noAnchorUrl:true}},{selector:"article",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"aside",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"blockquote",format:"blockquote",options:{leadingLineBreaks:2,trailingLineBreaks:2,trimEmptyLines:true}},{selector:"br",format:"lineBreak"},{selector:"div",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"footer",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"form",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"h1",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:true}},{selector:"h2",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:true}},{selector:"h3",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:true}},{selector:"h4",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:true}},{selector:"h5",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:true}},{selector:"h6",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:true}},{selector:"header",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"hr",format:"horizontalLine",options:{leadingLineBreaks:2,length:undefined,trailingLineBreaks:2}},{selector:"img",format:"image",options:{baseUrl:null,linkBrackets:["[","]"]}},{selector:"main",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"nav",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"ol",format:"orderedList",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"p",format:"paragraph",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"pre",format:"pre",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"section",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"table",format:"table",options:{colSpacing:3,leadingLineBreaks:2,maxColumnWidth:60,rowSpacing:0,trailingLineBreaks:2,uppercaseHeaderCells:true}},{selector:"ul",format:"unorderedList",options:{itemPrefix:" * ",leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"wbr",format:"wbr"}],tables:[],whitespaceCharacters:" \t\r\n\f​",wordwrap:80};const concatMerge=(u,A,p)=>[...u,...A];const overwriteMerge=(u,A,p)=>[...A];const selectorsMerge=(u,A,p)=>u.some((u=>typeof u==="object"))?concatMerge(u,A):overwriteMerge(u,A);function compile(u={}){u=nu(au,u,{arrayMerge:overwriteMerge,customMerge:u=>u==="selectors"?selectorsMerge:undefined});u.formatters=Object.assign({},iu,ou,u.formatters);u.selectors=mergeDuplicatesPreferLast(u.selectors,(u=>u.selector));handleDeprecatedOptions(u);return compile$1(u)}function convert(u,A={},p=undefined){return compile(A)(u,p)}function handleDeprecatedOptions(u){if(u.tags){const A=Object.entries(u.tags).map((([u,A])=>({...A,selector:u||"*"})));u.selectors.push(...A);u.selectors=mergeDuplicatesPreferLast(u.selectors,(u=>u.selector))}function set(u,A,p){const y=A.pop();for(const p of A){let A=u[p];if(!A){A={};u[p]=A}u=A}u[y]=p}if(u["baseElement"]){const A=u["baseElement"];set(u,["baseElements","selectors"],Array.isArray(A)?A:[A])}if(u["returnDomByDefault"]!==undefined){set(u,["baseElements","returnDomByDefault"],u["returnDomByDefault"])}for(const A of u.selectors){if(A.format==="anchor"&&get(A,["options","noLinkBrackets"])){set(A,["options","linkBrackets"],false)}}}const WebFetch=async u=>{const{prompt:A}=u;if(!A){return{error:"Missing parameter: prompt must be provided."}}const p=/(https?:\/\/[^\s]+)/g;const y=A.match(p);if(!y||y.length===0){return{error:"No URLs found in the prompt."}}const E=y[0];try{const u=await fetch(E);const A=u.headers.get("content-type")||"";const p=await u.text();let y;if(A.toLowerCase().includes("text/html")){y=convert(p,{wordwrap:false,selectors:[{selector:"a",options:{ignoreHref:true}},{selector:"img",format:"skip"}]})}else{y=p}return{content:y.substring(0,1e5)}}catch(u){return{error:u.message}}};const lu={api_key:null,timeout:6e4};class errors_InvalidArgumentError extends Error{constructor(){super("Arguments are missing or of incorrect type");Object.setPrototypeOf(this,errors_InvalidArgumentError.prototype)}}class MissingApiKeyError extends Error{constructor(){super("api_key is required, get it from: https://serpapi.com/manage-api-key");Object.setPrototypeOf(this,MissingApiKeyError.prototype)}}class InvalidTimeoutError extends Error{constructor(){super("Enter a valid timeout in milliseconds");Object.setPrototypeOf(this,InvalidTimeoutError.prototype)}}class RequestTimeoutError extends Error{constructor(){super("The request was timed out");Object.setPrototypeOf(this,RequestTimeoutError.prototype)}}const cu="2.2.1";var uu=p(5692);const du=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring");const fu=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("process");const Au={execute:execute,getHostnameAndPort:getHostnameAndPort};function getHostnameAndPort(){return{hostname:"serpapi.com",port:443}}function getSource(){var u,A;const p=`serpapi@${cu}`;if(typeof Deno=="object"){const A=(u=Deno.version)===null||u===void 0?void 0:u.deno;if(A){return`deno@${A},${p}`}}else if(typeof fu=="object"){const u=(A=fu.versions)===null||A===void 0?void 0:A.node;if(u){return`nodejs@${u},${p}`}}return`nodejs,${p}`}function buildRequestOptions(u,A){const p=Object.assign({},A);for(const u in p){if(u==="requestOptions"||u==="timeout"||p[u]===undefined){delete p[u]}}const y=Object.assign(Object.assign({},Au.getHostnameAndPort()),{path:`${u}?${du.stringify(p)}`,method:"GET"});return Object.assign(Object.assign(Object.assign({},lu.requestOptions),A.requestOptions),y)}function execute(u,A,p){const y=buildRequestOptions(u,Object.assign(Object.assign({},A),{source:getSource()}));return new Promise(((u,A)=>{let E;const handleResponse=p=>{p.setEncoding("utf8");let y="";p.on("data",(u=>{y+=u}));p.on("end",(()=>{try{if(p.statusCode==200){u(y)}else{A(y)}}catch(u){A(u)}finally{if(E)clearTimeout(E)}}))};const handleError=u=>{A(u);if(E)clearTimeout(E)};const C=uu.get(y,handleResponse).on("error",handleError);if(p>0){E=setTimeout((()=>{A(new RequestTimeoutError);C.destroy()}),p)}}))}function validators_validateApiKey(u,A=false){if(A&&u===null){return undefined}const p=u!==null&&u!==void 0?u:lu.api_key;if(!p)throw new MissingApiKeyError;return p}function validators_validateTimeout(u){const A=u!==null&&u!==void 0?u:lu.timeout;if(A<=0)throw new InvalidTimeoutError;return A}const hu="/account";const pu="/locations.json";const gu="/search";const mu=null&&`/searches`;function getJson(...u){if(typeof u[0]==="string"&&typeof u[1]==="object"){const[A,p,y]=u;const E=Object.assign(Object.assign({},p),{engine:A});return _getJson(E,y)}else if(typeof u[0]==="object"&&typeof u[1]!=="object"&&(typeof u[1]==="undefined"||typeof u[1]==="function")){const[A,p]=u;return _getJson(A,p)}else{throw new errors_InvalidArgumentError}}async function _getJson(u,A){const p=validators_validateApiKey(u.api_key,true);const y=validators_validateTimeout(u.timeout);const E=await Au.execute(gu,Object.assign(Object.assign({},u),{api_key:p,output:"json"}),y);const C=JSON.parse(E);A===null||A===void 0?void 0:A(C);return C}function getHtml(...u){if(typeof u[0]==="string"&&typeof u[1]==="object"){const[A,p,y]=u;const E=Object.assign(Object.assign({},p),{engine:A});return _getHtml(E,y)}else if(typeof u[0]==="object"&&typeof u[1]!=="object"&&(typeof u[1]==="undefined"||typeof u[1]==="function")){const[A,p]=u;return _getHtml(A,p)}else{throw new InvalidArgumentError}}async function _getHtml(u,A){const p=validateApiKey(u.api_key,true);const y=validateTimeout(u.timeout);const E=await _internals.execute(gu,Object.assign(Object.assign({},u),{api_key:p,output:"html"}),y);A===null||A===void 0?void 0:A(E);return E}async function getJsonBySearchId(u,A={},p){const y=validateApiKey(A.api_key);const E=validateTimeout(A.timeout);const C=await _internals.execute(`${mu}/${u}`,{api_key:y,output:"json"},E);const I=JSON.parse(C);p===null||p===void 0?void 0:p(I);return I}async function getHtmlBySearchId(u,A={},p){const y=validateApiKey(A.api_key);const E=validateTimeout(A.timeout);const C=await _internals.execute(`${mu}/${u}`,{api_key:y,output:"html"},E);p===null||p===void 0?void 0:p(C);return C}async function getAccount(u={},A){const p=validateApiKey(u.api_key);const y=validateTimeout(u.timeout);const E=await _internals.execute(hu,{api_key:p},y);const C=JSON.parse(E);A===null||A===void 0?void 0:A(C);return C}async function getLocations(u={},A){const p=validateTimeout(u.timeout);const y=await _internals.execute(pu,u,p);const E=JSON.parse(y);A===null||A===void 0?void 0:A(E);return E}const GoogleSearch=async u=>{const{query:A}=u;if(!A){return{error:"Missing parameter: query must be provided."}}try{const u=await getJson({engine:"google",q:A,api_key:process.env["SERPAPI_API_KEY"]});return{results:u["organic_results"]}}catch(u){return{error:u.message}}};const WriteTodos=async u=>{const{todos:A}=u;if(!A){return{error:"Missing parameter: todos must be provided."}}const p=A.map(((u,A)=>`${A+1}. [${u.status}] ${u.description}`)).join("\n");const y=A.length>0?`Successfully updated the todo list. The current list is now:\n${p}`:"Successfully cleared the todo list.";return{llmContent:y,returnDisplay:{todos:A}}};async function GetWorkingDirectory(){return{cwd:process.cwd()}}const yu={ReadFile:ReadFile,WriteFile:WriteFile,Shell:Shell,ReadFolder:ReadFolder,FindFiles:FindFiles,SearchText:SearchText,Edit:Edit,ReadManyFiles:ReadManyFiles,SaveMemory:SaveMemory,WebFetch:WebFetch,GoogleSearch:GoogleSearch,WriteTodos:WriteTodos,GetWorkingDirectory:GetWorkingDirectory};const Eu=`${B.$.BACKEND_URL}/v1/tasks`;const Cu=`${B.$.BACKEND_URL}/v1/ws/session/start_or_resume/`;class WebSocketClient{ws=null;messageHandler=null;onStatusChange=null;sessionId=null;handshakeSent=false;isConnecting=false;connectionPromise=null;messageQueue=[];isReadyForUserInput=false;status="disconnected";setStatus(u){if(this.status===u)return;this.status=u;if(this.onStatusChange){this.onStatusChange(u)}}async createSession(){try{const u=await fetch(Eu,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:"New interactive session"})});if(!u.ok){throw new Error(`Failed to create session: ${u.status} ${u.statusText}`)}const A=await u.json();return A.id}catch(u){if(process.env["STK_DEBUG_WS"]==="1"){console.error("Failed to create session:",u)}return null}}setupWebSocketConnection(){if(!this.sessionId){return}this.setStatus("connecting");const u=`${Cu}${this.sessionId}`;this.ws=new v.Ay(u);this.ws.on("open",(async()=>{this.setStatus("connected");if(this.handshakeSent){return}let u=null;try{const{loadProjectSpec:A}=await p.e(905).then(p.bind(p,8905));u=await A(process.cwd())}catch(u){console.error("Failed to load project spec (CODEGEN.md):",u)}this.send({type:"handshake",payload:{client_type:"cli",known_tools:Object.keys(yu),custom_tools:[],projectSpec:u?{content:u.content,filePaths:u.filePaths}:null}});this.handshakeSent=true}));this.ws.on("message",(u=>{try{const A=JSON.parse(u.toString());if(A.type==="bootstrap_finished"){this.isReadyForUserInput=true;this.flushMessageQueue()}if(this.messageHandler){this.messageHandler(A)}}catch(u){console.error("Error parsing WebSocket message:",u)}}));this.ws.on("close",(()=>{this.ws=null;this.isConnecting=false;this.connectionPromise=null;this.handshakeSent=false;this.isReadyForUserInput=false;this.setStatus("disconnected")}));this.ws.on("error",(u=>{if(process.env["STK_DEBUG_WS"]==="1"){console.error("WebSocket error:",u)}this.isConnecting=false;this.connectionPromise=null;this.handshakeSent=false;this.isReadyForUserInput=false;this.setStatus("disconnected")}))}flushMessageQueue(){while(this.messageQueue.length>0){const u=this.messageQueue.shift();if(u){this.send(u)}}}ensureConnected(){if(this.ws&&this.ws.readyState===v.Ay.OPEN){return Promise.resolve()}if(this.isConnecting&&this.connectionPromise){return this.connectionPromise}this.isConnecting=true;this.setStatus("connecting");this.connectionPromise=(async()=>{try{if(!this.messageHandler){throw new Error("No message handler set. Cannot (re)connect WebSocket.")}if(!this.sessionId){this.sessionId=await this.createSession();if(!this.sessionId){throw new Error("Could not establish session. WebSocket connection aborted.")}}this.setupWebSocketConnection();await new Promise(((u,A)=>{if(!this.ws){return A(new Error("WebSocket instance not created."))}this.ws.once("open",(()=>{this.isConnecting=false;this.setStatus("connected");u()}));this.ws.once("error",(u=>{this.isConnecting=false;this.ws=null;this.setStatus("disconnected");A(u)}))}))}catch(u){this.isConnecting=false;this.connectionPromise=null;this.setStatus("disconnected");if(process.env["STK_DEBUG_WS"]==="1"){console.error("Connection failed:",u)}throw u}})();return this.connectionPromise}async connect(u,A){this.messageHandler=u;this.onStatusChange=A;this.setStatus("connecting");await this.ensureConnected()}async send(u){if(!this.ws||this.ws.readyState!==v.Ay.OPEN){this.messageQueue.push(u);await this.ensureConnected();return}const A=u.type==="handshake"||u.type==="tool_result";if(this.ws&&this.ws.readyState===v.Ay.OPEN&&(A||this.isReadyForUserInput)){const A=JSON.stringify(u);this.ws.send(A)}else{this.messageQueue.push(u)}}}const Iu=new WebSocketClient;const runShellCommand=(u,A)=>{const p=u.trim();if(!p){throw new Error("Command cannot be empty.")}const y=(0,Xt.spawn)(p,{cwd:A,shell:true,stdio:"pipe",env:{...process.env,COLUMNS:process.stdout?.columns?.toString()??process.env["COLUMNS"],LINES:process.stdout?.rows?.toString()??process.env["LINES"]}});return y};const sanitizePath=u=>{if(!u){return undefined}const A=C().normalize(u);const p=C().resolve(B.$.WORKSPACE_DIR,A);if(!p.startsWith(B.$.WORKSPACE_DIR)){return C().basename(u)}return C().relative(B.$.WORKSPACE_DIR,p)};var bu=p(4953);var wu=p(4536);var vu=p(3646);function isLiveAgentMessageDisabled(){const u=process.env["INK_DISABLE_LIVE_AGENT_MESSAGE"];if(!u)return false;const A=String(u).toLowerCase().trim();return A==="1"||A==="true"||A==="yes"}const Bu=isLiveAgentMessageDisabled();function extractHighlightedBlock(u){if(!u)return undefined;const A=u.trim();if(A.startsWith("`")&&A.endsWith("`")){const u=A.slice(1,-1).trim();if(u.length>0){return{content:u}}}if(A.startsWith("```")&&A.endsWith("```")){const u=A.slice(3,-3);const p=u.indexOf("\n");if(p===-1){const A=u.trim();if(A.length>0){return{content:A}}return undefined}const y=u.slice(0,p).trim();const E=u.slice(p+1).trim();if(E.length===0){return undefined}return{language:y.length>0?y:undefined,content:E}}return undefined}function buildInkViewModel(u){const A=u.messages.filter((u=>u.isFinal||u.role==="tool_execution"||u.role==="agent_thought")).map((u=>({id:u.id,role:u.role,text:u.text,toolName:u.toolName,toolParams:u.toolParams,status:u.status,isBootstrap:u.isBootstrap,highlightedBlock:u.role==="agent"?extractHighlightedBlock(u.text):undefined})));let p;if(!Bu){const A=u.messages.find((u=>(u.role==="agent"||u.role==="agent_thought")&&u.isStreaming));if(A){p={id:A.id,role:A.role,text:A.text,toolName:A.toolName,toolParams:A.toolParams,status:A.status,isBootstrap:A.isBootstrap,highlightedBlock:A.role==="agent"?extractHighlightedBlock(A.text):undefined}}}const y=[...u.shellRuns].reverse().find((u=>u.status==="running"||u.status==="pending"));const E=[...u.diffReviews].reverse().find((u=>u.status==="pending"));let C;if(y){const u=[y.stdout,y.stderr].filter(Boolean).join("\n");const A=u.split("\n");C={id:y.id,command:y.command,status:y.status,stdout:y.stdout,stderr:y.stderr,visibleOutput:u,isVisuallyTruncated:false,totalLines:A.length,visibleLinesCount:A.length}}const I=E?{id:E.id,title:E.title,toolName:E.toolName,toolParams:E.toolParams,oldContent:E.oldContent,newContent:E.newContent,status:E.status}:undefined;return{staticMessages:A,liveAgentMessage:p,activeShellRun:C,activeDiffReview:I,agentStatusLabel:u.agentStatus.label,agentStatusPhase:u.agentStatus.phase}}function useAgentCore(){const[u,A]=(0,I.useReducer)(vu.h,vu.R);const p=(0,I.useMemo)((()=>buildInkViewModel(u)),[u]);return{coreState:u,dispatchCore:A,viewModel:p}}const Su={ReadFile:ReadFile,WriteFile:WriteFile,Shell:Shell,ReadFolder:ReadFolder,FindFiles:FindFiles,SearchText:SearchText,Edit:Edit,ReadManyFiles:ReadManyFiles,SaveMemory:SaveMemory,WebFetch:WebFetch,GoogleSearch:GoogleSearch,WriteTodos:WriteTodos,GetWorkingDirectory:GetWorkingDirectory};const escapeRegExp=u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const useAgent=({autonomous:u=false})=>{const{coreState:A,dispatchCore:p,viewModel:E}=useAgentCore();const[v,S]=(0,I.useState)((()=>u));const D=(0,I.useRef)(v);(0,I.useEffect)((()=>{D.current=v}),[v]);const[k,Q]=(0,I.useState)({isVisible:false,text:"Agent is thinking..."});const[F,R]=(0,I.useState)(null);const _=(0,I.useRef)(null);(0,I.useEffect)((()=>{_.current=F}),[F]);const[P,O]=(0,I.useState)([]);const[U,H]=(0,I.useState)(null);const G=(0,I.useRef)(U);(0,I.useEffect)((()=>{G.current=U}),[U]);const[j,$]=(0,I.useState)(-1);const[q,K]=(0,I.useState)(null);const[J,ee]=(0,I.useState)(null);const[te,ne]=(0,I.useState)("");const[re,se]=(0,I.useState)(false);const[ie,oe]=(0,I.useState)(null);const ae=(0,I.useRef)(ie);(0,I.useEffect)((()=>{ae.current=ie}),[ie]);const[le,ce]=(0,I.useState)(false);const ue=(0,I.useRef)(le);const de=(0,I.useRef)("");const fe=(0,I.useRef)(k);const Ae=(0,I.useRef)(null);const he=(0,I.useRef)(false);(0,I.useEffect)((()=>{he.current=A.isBootstrapping}),[A.isBootstrapping]);const pe=(0,I.useCallback)((u=>{const A=(u||"").trim();if(!A)return false;if(/[;&|]/.test(A))return false;const p=A.split(/\s+/).filter(Boolean);if(p.length<2)return false;if(p[0]!=="mkdir")return false;const y=p.slice(1).filter((u=>!u.startsWith("-")));if(y.length===0)return false;return y.every((u=>u===".codegen"||u.startsWith(".codegen/")))}),[]);const ge=(0,I.useCallback)((u=>{if(v)return true;const A=u.parameters.dir_path;const p=A===".codegen"||A&&A.startsWith(".codegen/");if(p)return true;return pe(u.parameters.command)}),[v,pe]);(0,I.useEffect)((()=>{fe.current=k}),[k]);(0,wu.SB)();const me=(0,I.useCallback)((()=>{const u=de.current.match(/\*\*(.*?)\*\*/g);const A=u?u[u.length-1]?.slice(2,-2):null;Q({isVisible:true,text:A||"Agent is thinking..."})}),[]);(0,I.useEffect)((()=>{ue.current=le}),[le]);const sendInputToShell=u=>{if(!J)return;if(u===""){try{J.kill("SIGINT")}catch(u){console.error("Failed to send SIGINT to shell process:",u)}return}if(J.stdin){J.stdin.write(u)}};const handleShellCompletion=(u,A)=>{try{const y=A||q;if(!y){return}if(u.signal==="SIGINT"){const{tool_name:A,tool_id:E,generation_id:C,parameters:I}=y;const v=I?.command??"(shell)";p({type:"SHELL_RUN_FINISHED",runId:String(y.messageId),exitCode:130,generationId:C});const B=80;const S=(0,w.A)([u.stdout||"",u.stderr||""].filter(Boolean).join("\n"));const D=S.split("\n");const k=D.length>B;const Q=k?D.slice(-B):D;const F=Q.join("\n").trim();let R=F?`Shell: ${v} (cancelled by user via Ctrl+C)\n\n${F}`:`Shell: ${v} (cancelled by user via Ctrl+C)`;if(k){R+=`\n\n[Saída truncada; mostrando últimas ${Q.length} de ${D.length} linhas]`}p({type:"TOOL_RESULT_MESSAGE",text:R,generationId:C});try{const p={...u,stdout:(0,w.A)(u.stdout),stderr:(0,w.A)(u.stderr)};Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:E,generation_id:C,status:"error",result:p,error:"cancelled_by_user"}})}catch(u){console.error("Failed to send shell cancellation tool_result:",u)}me();K(null);ee(null);return}const{messageId:E,tool_name:C,tool_id:I,generation_id:v,parameters:B}=y;p({type:"SHELL_RUN_FINISHED",runId:String(E),exitCode:u.exitCode??1,generationId:v});const S=(u.exitCode??1)===0;const D=S?"✓":"✗";const k=B?.command??"(shell)";const Q=`${D} Shell: ${k} (exitCode=${u.exitCode??1})`;const F=80;const R=(0,w.A)([u.stdout||"",u.stderr||""].filter(Boolean).join("\n"));const _=R.split("\n");const P=_.length>F;const O=P?_.slice(-F):_;const U=O.join("\n").trim();let H=U?`${Q}\n\n${U}`:Q;if(P){H+=`\n\n[Saída truncada; mostrando últimas ${O.length} de ${_.length} linhas]`}p({type:"TOOL_RESULT_MESSAGE",text:H,generationId:v});const G={...u,stdout:(0,w.A)(u.stdout),stderr:(0,w.A)(u.stderr)};Iu.send({type:"tool_result",payload:{tool_name:C,tool_id:I,generation_id:v,status:u.exitCode===0?"success":"error",result:G,error:u.exitCode===0?null:(0,w.A)(u.stderr)||"shell_error"}});me()}catch(u){console.error("Error in handleShellCompletion:",u)}finally{K(null);ee(null)}};const ye=(0,I.useCallback)((()=>{if(!F)return;const{tool_name:u,tool_id:A,generation_id:y,parameters:E}=F;const{command:I,dir_path:w}=E;const v=C().resolve(B.$.WORKSPACE_DIR,w||".");const S=Date.now();p({type:"SHELL_RUN_STARTED",runId:String(S),command:I,generationId:y});try{const C=runShellCommand(I,v);const w=[];const B=[];C.stdout?.on("data",(u=>{w.push(u);p({type:"SHELL_OUTPUT_RECEIVED",runId:String(S),stdoutDelta:u.toString("utf8"),stderrDelta:"",generationId:y})}));C.stderr?.on("data",(u=>{B.push(u);p({type:"SHELL_OUTPUT_RECEIVED",runId:String(S),stdoutDelta:"",stderrDelta:u.toString("utf8"),generationId:y})}));C.on("close",((p,C)=>{const I={stdout:Buffer.concat(w).toString("utf8"),stderr:Buffer.concat(B).toString("utf8"),exitCode:p,signal:C};handleShellCompletion(I,{messageId:S,tool_name:u,tool_id:A,generation_id:y,parameters:E})}));ee(C);K({messageId:S,tool_name:u,tool_id:A,generation_id:y,parameters:E,status:"running",childProcess:C});Q({isVisible:false,text:""})}catch(E){console.error("Failed to start shell command:",E);p({type:"TOOL_RESULT_MESSAGE",text:`✗ Shell: ${I} (error starting: ${E.message??String(E)})`});try{Iu.send({type:"tool_result",payload:{tool_name:u,tool_id:A,generation_id:y,status:"error",result:E.message??String(E)}})}catch(u){console.error("Failed to send shell error tool_result:",u)}}R(null)}),[p,F,me]);(0,I.useEffect)((()=>{if(F&&ge(F)){ye()}}),[F,ge,ye]);const rejectShellCommand=()=>{if(!F)return;const{tool_name:u,tool_id:A,generation_id:y,parameters:E}=F;const C=E.command??"(shell)";try{Iu.send({type:"tool_result",payload:{tool_name:u,tool_id:A,generation_id:y,status:"error",result:null,error:"User rejected command execution."}})}catch(u){console.error("Failed to send shell rejection tool_result:",u)}p({type:"TOOL_RESULT_MESSAGE",text:`· Shell: ${C} (rejected by user)`});R(null);Q({isVisible:false,text:""})};const approveDiff=u=>{const y=E.activeDiffReview?.id;if(!y)return;if(Ae.current){Ae.current(["accepted",u]);Ae.current=null}p({type:"DIFF_REVIEW_RESOLVED",reviewId:String(y),result:"accepted",generationId:A.activeGenerationId})};const rejectDiff=()=>{const u=E.activeDiffReview?.id;if(!u)return;if(Ae.current){Ae.current(["rejected",undefined]);Ae.current=null}p({type:"DIFF_REVIEW_RESOLVED",reviewId:String(u),result:"rejected",generationId:A.activeGenerationId})};const Ee=(0,I.useCallback)((async u=>{const{tool_name:A,parameters:E,tool_id:I,generation_id:v}=u;const S=v==="bootstrap";p({type:"TOOL_EXECUTION_STARTED",toolId:I,toolName:A,toolParams:E,generationId:v});const k={...E};if(k["path"]){k["path"]=sanitizePath(k["path"])}if(k["file_path"]){k["file_path"]=sanitizePath(k["file_path"])}if(k["dir_path"]){k["dir_path"]=sanitizePath(k["dir_path"])}if(A==="ReadFile"&&k["path"]&&!k["file_path"]){k["file_path"]=k["path"]}if((A==="ReadFolder"||A==="FindFiles"||A==="SearchText")&&k["path"]&&!k["dir_path"]){k["dir_path"]=k["path"]}const F=Su[A];if(!F){const u=`Error: Tool '${A}' not found.`;p({type:"TOOL_EXECUTION_ERROR",toolId:I,toolName:A,toolParams:E,error:u,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u}});H(null);me();return}if(A==="WriteFile"||A==="Edit"){const u=Date.now();let w="";try{w=await(0,y.readFile)(C().resolve(B.$.WORKSPACE_DIR,k["file_path"]),"utf-8")}catch(u){if(u.code!=="ENOENT"){throw u}w=""}const S=A==="WriteFile"?k["content"]:w.replace(new RegExp(escapeRegExp(k["old_string"]),"g"),k["new_string"]);try{const y=k["file_path"];const C=y&&y.startsWith(".codegen/");if(!D.current&&!C){const y=new Promise((u=>{Ae.current=u}));p({type:"DIFF_REVIEW_OPENED",reviewId:String(u),toolName:A,toolParams:k,oldContent:w,newContent:S,generationId:v});const[E,C]=await y;if(E==="rejected"){throw new Error("User rejected changes.")}k["content"]=C!==undefined?C:S}else{k["content"]=S}const B=await F(k);p({type:"TOOL_EXECUTION_FINISHED",toolId:I,toolName:A,toolParams:E,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"success",result:B,error:null}});H(null);me()}catch(u){p({type:"TOOL_EXECUTION_ERROR",toolId:I,toolName:A,toolParams:E,error:u.message,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u.message}});me()}}else if(A==="Shell"){const u=k;if(S){const{command:p,dir_path:y}=u;const E=C().resolve(B.$.WORKSPACE_DIR,y||".");try{const u=runShellCommand(p,E);const y=await new Promise(((A,p)=>{const y=[];const E=[];u.stdout?.on("data",(u=>{y.push(u)}));u.stderr?.on("data",(u=>{E.push(u)}));u.on("error",(u=>{p(u)}));u.on("close",(u=>{A({stdout:Buffer.concat(y).toString("utf8"),stderr:Buffer.concat(E).toString("utf8"),exitCode:u})}))}));const C={command:p,stdout:(0,w.A)(y.stdout)||"(empty)",stderr:(0,w.A)(y.stderr)||"(empty)",error:y.exitCode===0?"(none)":(0,w.A)(y.stderr),exitCode:y.exitCode??0};Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:y.exitCode===0?"success":"error",result:C,error:y.exitCode===0?null:(0,w.A)(y.stderr)||"shell_error"}});H(null);Q({isVisible:false,text:""})}catch(u){Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u.message??String(u)}});me()}return}R({tool_name:A,tool_id:I,generation_id:v,parameters:u});Q({isVisible:false,text:""});return}else{try{const u=await F(k);p({type:"TOOL_EXECUTION_FINISHED",toolId:I,toolName:A,toolParams:E,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"success",result:u,error:null}});H(null);me()}catch(u){p({type:"TOOL_EXECUTION_ERROR",toolId:I,toolName:A,toolParams:E,error:u.message,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u.message}});me()}}}),[]);const Ce=(0,I.useRef)(false);(0,I.useEffect)((()=>{Ce.current=A.bootstrapFinished}),[A.bootstrapFinished]);(0,I.useEffect)((()=>{let u=false;const handleMessage=async A=>{if(ue.current){return}const y=A.payload?.generation_id;const E=y==="bootstrap";if(E&&!he.current){p({type:"BOOTSTRAP_STARTED"})}if(A.type==="bootstrap_finished"&&he.current){p({type:"BOOTSTRAP_FINISHED"});u=true}if(A.type==="run_tool"&&A.payload.tool_name==="Shell"){const u=A.payload;if(_.current?.tool_id===u.tool_id){return}}if(process.env["STK_DEBUG_AGENT_STREAM"]==="1"){console.log("[agent-stream]",{type:A.type,payload:A.payload,generation_id:A.payload?.generation_id})}if(A.payload?.generation_id){oe(A.payload.generation_id);ae.current=A.payload.generation_id}if(A.type==="agent_error"){const u=A.payload?.message||"An error occurred while communicating with the agent.";const E=A.payload?.details?` ${A.payload.details}`:"";p({type:"ERROR_OCCURRED",message:`${u}${E}`,generationId:y});Q({isVisible:false,text:""});return}if(A.type==="agent_message"){const u=A.payload?.content||"";Q({isVisible:false,text:""});p({type:"AGENT_DELTA_RECEIVED",delta:u,generationId:y});p({type:"AGENT_STREAM_FINISHED",generationId:y});return}if(A.type==="agent_message_delta"){const u=A.payload.content||"";Q({isVisible:false,text:""});p({type:"AGENT_DELTA_RECEIVED",delta:u,generationId:y})}else if(A.type==="agent_thought"){const u=A.payload.content||"";de.current+=u;const p=de.current.match(/\*\*(.*?)\*\*/g);const y=p?p[p.length-1]:null;if(y){const u=y.slice(2,-2);if(fe.current.text!==u){Q({isVisible:true,text:u})}}else if(!k.isVisible){Q({isVisible:true,text:"Agent is thinking..."})}}else if(A.type==="agent_finished"){p({type:"AGENT_STREAM_FINISHED",generationId:y});Q({isVisible:false,text:""});H(null);de.current=""}else if(A.type==="run_tool"){const{tool_id:u,tool_name:p}=A.payload;if(G.current===u){return}H(u);G.current=u;if(!E){Q({isVisible:true,text:`Preparing to execute: ${p}`})}Promise.resolve().then((()=>Ee(A.payload)))}else if(A.type==="agent_generation_cancelled"){const{generation_id:u}=A.payload;if(ae.current===u){oe(null);ae.current=null;ce(false);Q({isVisible:false,text:""});p({type:"TOOL_RESULT_MESSAGE",text:"· Agent generation cancelled by backend.",generationId:y})}}};Promise.resolve(Iu.connect(handleMessage,(u=>{p({type:"CONNECTION_STATUS_CHANGED",status:u});if(u==="connecting"&&Ce.current){Q({isVisible:true,text:"Reconectando..."})}else if(u==="connected"){Q({isVisible:false,text:""})}}))).catch((()=>{p({type:"CONNECTION_STATUS_CHANGED",status:"disconnected"})}))}),[Ee,p]);const Ie=(0,I.useCallback)((u=>{p({type:"TOOL_RESULT_MESSAGE",text:`· Modo autônomo: ${u?"ATIVADO":"DESATIVADO"} ·`,generationId:A.activeGenerationId})}),[p]);const be=(0,I.useCallback)((u=>{S(u);Ie(u)}),[Ie]);const we=(0,I.useCallback)((()=>{S((u=>{const A=!u;Ie(A);return A}))}),[Ie]);const submitUserInput=async(u,y)=>{if(process.env["STK_DEBUG_INPUT"]==="1"&&y){console.error("[STK_DEBUG_SUBMIT]",{text:u,imageCount:y.images?.length??0,extra:y})}const E=u.trim();if(E.startsWith("/")){const[u,A]=E.slice(1).split(/\s+/,2);const p=(u||"").toLowerCase();const y=(A||"").toLowerCase();const C=p==="autonomous"||p==="auto"||p==="a";if(C){if(y==="on"||y==="true"||y==="1")be(true);else if(y==="off"||y==="false"||y==="0")be(false);else we();ne("");return}}if(q?.status==="finished"){K(null)}p({type:"USER_SENT_MESSAGE",text:u});if(y){const u=y.images?.length??0;const E=u>0?`· ${u} imagem(s) de clipboard anexada(s) ·`:"· Nenhuma imagem encontrada no clipboard ·";p({type:"TOOL_RESULT_MESSAGE",text:E,generationId:A.activeGenerationId})}Q({isVisible:true,text:"Agent is thinking..."});oe(null);ce(false);de.current="";try{if(E.startsWith("/")){const A=E.slice(1).trim();if(A.length>0){await Iu.send({type:"magic_command",payload:{name:A}})}else{await Iu.send({type:"user_message",payload:{prompt:u}})}}else{await Iu.send({type:"user_message",payload:{prompt:u,images:y?.images}})}}catch{Q({isVisible:true,text:"Não foi possível conectar ao servidor. Verifique o backend e tente novamente."});p({type:"CONNECTION_STATUS_CHANGED",status:"disconnected"});return}O((A=>{const p=[...A,u];$(p.length);return p}));ne("")};const ve=(0,I.useCallback)((()=>{const u=Math.max(0,j-1);$(u);return P[u]}),[P,j]);const Be=(0,I.useCallback)((()=>{const u=Math.min(P.length,j+1);$(u);return P[u]}),[P,j]);const Se=(0,I.useCallback)((async(u,A)=>{try{const p=Su["FindFiles"];if(p){const y=await p({pattern:u,...A});return y.files||[]}return[]}catch(u){console.error("Error searching files:",u);return[]}}),[]);const resetHistory=()=>{$(P.length)};const cancelCurrentInteraction=()=>{Q({isVisible:false,text:""});ce(true);const u="· Cancellation request sent.";const y=ae.current??A.activeGenerationId;p({type:"TOOL_RESULT_MESSAGE",text:u,generationId:y});if(ae.current){try{Iu.send({type:"client_cancel_generation",payload:{generation_id:ae.current,reason:"user_pressed_escape"}});oe(null);ae.current=null}catch(u){console.error("Failed to send cancel message to backend:",u)}}else{try{Iu.send({type:"client_cancel_last",payload:{}})}catch(u){console.error("Failed to send cancel_last message to backend:",u)}}};return{agentStatus:k,isAutonomous:v,toggleAutonomous:we,pendingShellCommand:F,approveShellCommand:ye,rejectShellCommand:rejectShellCommand,approveDiff:approveDiff,rejectDiff:rejectDiff,submitUserInput:submitUserInput,navigateHistoryUp:ve,navigateHistoryDown:Be,searchFiles:Se,activeShellCommand:q,handleShellCompletion:handleShellCompletion,childProcess:J,sendInputToShell:sendInputToShell,inputText:te,setInputText:ne,isShellActive:re,setIsShellActive:se,resetHistory:resetHistory,cancelCurrentInteraction:cancelCurrentInteraction,activeGenerationId:ie,coreState:A,coreViewModel:E,hasCodegenSpec:(0,bu.q)().hasCodegenSpec}}},3345:(u,A,p)=>{p.d(A,{P:()=>useMagicCommands});var y=p(1943);var E=p.n(y);var C=p(6928);var I=p.n(C);var w=p(3102);var v=p.n(w);var B=p(6878);const S=["bootstrap-codegen"];const D="codegen-commands";async function getUserCommands(){try{const u=I().resolve(B.$.WORKSPACE_DIR,D);const A=await(0,y.readdir)(u,{withFileTypes:true});return A.filter((u=>u.isDirectory())).map((u=>u.name))}catch(u){return[]}}const useMagicCommands=()=>{const[u,A]=(0,w.useState)([]);(0,w.useEffect)((()=>{const fetchCommands=async()=>{const u=await getUserCommands();A([...S,...u])};fetchCommands()}),[]);return u}},4536:(u,A,p)=>{p.d(A,{SB:()=>useTerminalLayout});var y=p(3102);var E=p.n(y);const C=.5;const I=.5;const w=.4;const v=4;const useTerminalLayout=()=>{const u=process.stdout&&process.stdout.rows||24;return(0,y.useMemo)((()=>{const A=(()=>{const A=Math.floor(u*C)-v;return Math.min(Math.max(A,8),120)})();const p=(()=>{const A=Math.floor(u*w)-v;return Math.min(Math.max(A,5),40)})();const y=(()=>{const A=Math.floor(u*I)-v;return Math.min(Math.max(A,10),120)})();return{rows:u,maxAgentStreamingLines:A,shellViewHeight:p,diffReviewHeight:y,layoutConstants:{AGENT_STREAM_RATIO:C,DIFF_REVIEW_RATIO:I,SHELL_OUTPUT_RATIO:w,FOOTER_RESERVED_LINES:v}}}),[u])}},1196:(u,A,p)=>{p.d(A,{F:()=>readClipboardImageAsBase64});var y=p(5317);var E=p.n(y);var C=p(9023);var I=p.n(C);var w=p(9896);var v=p.n(w);var B=p(6928);var S=p.n(B);const D=(0,C.promisify)(y.execFile);async function getClipboardImageDir(u){const A=u||process.cwd();const p=S().join(A,".stk-clipboard");await v().promises.mkdir(p,{recursive:true});return p}async function readClipboardImageAsBase64(u){if(process.env["STK_CODEGEN_DISABLE_CLIPBOARD_IMAGE"]==="1"){return null}if(process.platform==="darwin"){return readMacClipboardImageFromClipboard(u)}return null}async function readMacClipboardImageFromClipboard(u){try{const{stdout:A}=await D("bash",["-lc",'command -v pngpaste || echo ""']);const p=A.trim();if(p){const A=await getClipboardImageDir(u);const y=Date.now();const E=S().join(A,`clipboard-${y}.png`);try{await D(p,[E]);const u=await v().promises.readFile(E);try{await v().promises.unlink(E)}catch{}return{base64:u.toString("base64"),mimeType:"image/png"}}catch{}}}catch{}return readMacClipboardImageViaAppleScriptToFile(u)}async function readMacClipboardImageViaAppleScriptToFile(u){const A=await getClipboardImageDir(u);const p=Date.now();const y=S().join(A,`clipboard-${p}`);const E=`\n on writeImageToGivenPath(theImage, mimeType, basePath)\n if mimeType is "image/png" then\n set tmpPath to basePath & ".png"\n else if mimeType is "image/tiff" then\n set tmpPath to basePath & ".tiff"\n else if mimeType is "image/jpeg" then\n set tmpPath to basePath & ".jpg"\n end if\n\n set outFile to POSIX file tmpPath\n set fileRef to open for access outFile with write permission\n set eof fileRef to 0\n write theImage to fileRef\n close access fileRef\n\n return mimeType & ":" & tmpPath\n end writeImageToGivenPath\n\n try\n set basePath to "${y}"\n try\n set theImage to the clipboard as «class PNGf»\n return writeImageToGivenPath(theImage, "image/png", basePath)\n on error\n try\n set theImage to the clipboard as TIFF\n return writeImageToGivenPath(theImage, "image/tiff", basePath)\n on error\n try\n set theImage to the clipboard as JPEG picture\n return writeImageToGivenPath(theImage, "image/jpeg", basePath)\n on error\n return "NO_IMAGE"\n end try\n end try\n end try\n end try\n `;try{const{stdout:u}=await D("osascript",["-e",E]);const A=u.trim();if(!A||A==="NO_IMAGE"){return null}const p=A.indexOf(":");if(p===-1){return null}const y=A.slice(0,p);const C=A.slice(p+1);if(!y||!C){return null}const I=await v().promises.readFile(C);try{await v().promises.unlink(C)}catch{}return{base64:I.toString("base64"),mimeType:y}}catch{return null}}async function cleanupOldClipboardImages(u,A=60*60*1e3){try{const p=await getClipboardImageDir(u);const y=await fs.promises.readdir(p);const E=Date.now()-A;for(const u of y){if(!u.startsWith("clipboard-"))continue;const A=path.join(p,u);const y=await fs.promises.stat(A);if(y.mtimeMs<E){await fs.promises.unlink(A)}}}catch{}}},786:(u,A,p)=>{p.d(A,{x:()=>checkCliVersion});var y=p(5317);var E=p(6878);const httpClientGet=async u=>{const A=await fetch(u);const p=await A.json();return{data:p}};var C=p(3646);const I=`${E.$.BACKEND_URL}/v1/cli/version`;const w="stk-codegen";async function checkCliVersionWithDeps({httpGet:u,execSync:A,exit:p,log:y,error:C,env:v}){const B=v["CLI_SKIP_VERSION_CHECK"];if(B&&["1","true"].includes(String(B).toLowerCase())){return}try{const v=await u(I);const B=v.data.version;if(E.$.CURRENT_VERSION<B){C(`Your CLI version is ${E.$.CURRENT_VERSION}, but the minimal required version is ${B}.`);y("Updating CLI to the latest version...");try{A(`npm install -g ${w}@latest`,{stdio:"inherit"});y("Update successful! Please restart the CLI manually to use the new version.");p(0)}catch{C("An error occurred during the automatic update process. Please update manually.");p(1)}}}catch{C("Could not verify CLI version or perform automatic update.")}}async function checkCliVersion(){return checkCliVersionWithDeps({httpGet:httpClientGet,execSync:y.execSync,exit:u=>process.exit(u),log:console.log,error:console.error,env:process.env})}},5183:(u,A,p)=>{p.d(A,{y:()=>parseInlineCodeSegments});function appendTextSegment(u,A){if(!A)return;const p=u[u.length-1];if(p&&p.type==="text"){p.content+=A}else{u.push({type:"text",content:A})}}function parseInlineCodeSegments(u){if(u===undefined||u===null){return[]}const A=[];let p="";let y=false;const flushBuffer=()=>{if(!p)return;if(y){A.push({type:"code",content:p})}else{appendTextSegment(A,p)}p=""};for(let E=0;E<u.length;E++){const C=u[E];if(C==="`"){if(y){if(p===""){appendTextSegment(A,"``")}else{A.push({type:"code",content:p})}p="";y=false}else{flushBuffer();y=true}}else{p+=C}}if(p){if(y){A.push({type:"code",content:p})}else{appendTextSegment(A,p)}}if(y){const u=A.pop();const p="`"+(u?.content??"");appendTextSegment(A,p)}if(A.length===0){return[{type:"text",content:u}]}return A}},4378:(u,A,p)=>{p.d(A,{M:()=>buildFriendlyLabel});const buildFriendlyLabel=(u,A)=>{const p=A?.["file_path"];const y=A?.["dir_path"]||".";const E=A?.["command"];const C=A?.["pattern"];switch(u){case"WriteFile":return p?`Criar/atualizar arquivo ${p}`:"Criar/atualizar arquivo";case"Edit":return p?`Editar arquivo ${p}`:"Editar arquivo";case"ReadFile":return p?`Ler arquivo ${p}`:"Ler arquivo";case"ReadFolder":return`Listar pasta ${y}`;case"FindFiles":return C?`Procurar arquivos que combinem ${C} em ${y}`:`Procurar arquivos em ${y}`;case"SearchText":return C?`Buscar "${C}" em ${y}`:`Buscar texto em ${y}`;case"Shell":return E?`Executar comando ${E}`:"Executar comando de shell";case"GoogleSearch":return A?.["query"]?`Pesquisar no Google: ${A["query"]}`:"Pesquisar no Google";default:return u}}},1096:(u,A,p)=>{p.d(A,{O:()=>isDelete,g:()=>isBackspace});const isBackspace=u=>u.delete===true||u.backspace===true;const isDelete=()=>false},4760:(u,A,p)=>{p.d(A,{a:()=>TextBuffer});class TextBuffer{text=[];cursor=0;constructor(u=""){this.text=u.split("");this.cursor=u.length}get value(){return this.text.join("")}get cursorPosition(){return this.cursor}insert(u){this.text.splice(this.cursor,0,u);this.cursor++}insertText(u){if(!u)return;const A=u.split("");this.text.splice(this.cursor,0,...A);this.cursor+=A.length}backspace(){if(this.cursor>0){this.text.splice(this.cursor-1,1);this.cursor--}}delete(){if(this.cursor<this.text.length){this.text.splice(this.cursor,1)}}moveCursorLeft(){if(this.cursor>0){this.cursor--}}moveCursorRight(){if(this.cursor<this.text.length){this.cursor++}}moveCursorToStart(){this.cursor=0}moveCursorToEnd(){this.cursor=this.text.length}_getLines(){return this.text.join("").split("\n")}_offsetToRowCol(u){const A=this._getLines();if(A.length===0){return{row:0,col:0}}let p=0;for(let y=0;y<A.length;y++){const E=A[y];const C=E?E.length+1:1;if(u<p+C){return{row:y,col:u-p}}p+=C}const y=A[A.length-1];return{row:A.length-1,col:y?y.length:0}}_rowColToOffset(u,A){const p=this._getLines();let y=0;for(let A=0;A<u;A++){const u=p[A];y+=(u?u.length:0)+1}return y+A}getLineCount(){return this._getLines().length}getCursorRow(){return this._offsetToRowCol(this.cursor).row}moveCursorUp(){const{row:u,col:A}=this._offsetToRowCol(this.cursor);if(u>0){const p=this._getLines();const y=p[u-1];const E=y?y.length:0;const C=Math.min(A,E);this.cursor=this._rowColToOffset(u-1,C)}}moveCursorDown(){const u=this._getLines();const{row:A,col:p}=this._offsetToRowCol(this.cursor);if(A<u.length-1){const y=u[A+1];const E=y?y.length:0;const C=Math.min(p,E);this.cursor=this._rowColToOffset(A+1,C)}}moveCursorWordLeft(){let u=this.cursor;while(u>0&&this.text[u-1]===" ")u--;while(u>0&&this.text[u-1]!==" ")u--;this.cursor=u}moveCursorWordRight(){let u=this.cursor;while(u<this.text.length&&this.text[u]!==" ")u++;while(u<this.text.length&&this.text[u]===" ")u++;this.cursor=u}clone(){const u=new TextBuffer(this.value);u.cursor=this.cursor;return u}}},8340:module=>{module.exports=eval("require")("bufferutil")},2461:module=>{module.exports=eval("require")("utf-8-validate")},2613:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert")},181:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer")},5317:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process")},9140:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("constants")},6982:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto")},4434:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("events")},9896:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs")},1943:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs/promises")},8611:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("http")},5675:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2")},5692:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("https")},3339:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("module")},9278:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("net")},4573:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:buffer")},8474:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events")},3024:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs")},1455:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises")},8161:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os")},6760:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path")},1708:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:process")},7075:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream")},7066:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tty")},3136:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url")},857:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("os")},6928:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("path")},2203:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream")},4756:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls")},2018:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty")},7016:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("url")},9023:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("util")},3106:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib")},9771:(u,A,p)=>{Object.defineProperty(A,"__esModule",{value:true});var y=p(1019);var E=p(2859);var C=p(6472);function isColorSupported(){return typeof process==="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?false:y.isColorSupported}const compose=(u,A)=>p=>u(A(p));function buildDefs(u){return{keyword:u.cyan,capitalized:u.yellow,jsxIdentifier:u.yellow,punctuator:u.yellow,number:u.magenta,string:u.green,regex:u.magenta,comment:u.gray,invalid:compose(compose(u.white,u.bgRed),u.bold),gutter:u.gray,marker:compose(u.red,u.bold),message:compose(u.red,u.bold),reset:u.reset}}const I=buildDefs(y.createColors(true));const w=buildDefs(y.createColors(false));function getDefs(u){return u?I:w}const v=new Set(["as","async","from","get","of","set"]);const B=/\r\n|[\n\r\u2028\u2029]/;const S=/^[()[\]{}]$/;let D;{const u=/^[a-z][\w-]*$/i;const getTokenType=function(A,p,y){if(A.type==="name"){if(C.isKeyword(A.value)||C.isStrictReservedWord(A.value,true)||v.has(A.value)){return"keyword"}if(u.test(A.value)&&(y[p-1]==="<"||y.slice(p-2,p)==="</")){return"jsxIdentifier"}if(A.value[0]!==A.value[0].toLowerCase()){return"capitalized"}}if(A.type==="punctuator"&&S.test(A.value)){return"bracket"}if(A.type==="invalid"&&(A.value==="@"||A.value==="#")){return"punctuator"}return A.type};D=function*(u){let A;while(A=E.default.exec(u)){const p=E.matchToToken(A);yield{type:getTokenType(p,A.index,u),value:p.value}}}}function highlight(u){if(u==="")return"";const A=getDefs(true);let p="";for(const{type:y,value:E}of D(u)){if(y in A){p+=E.split(B).map((u=>A[y](u))).join("\n")}else{p+=E}}return p}let k=false;const Q=/\r\n|[\n\r\u2028\u2029]/;function getMarkerLines(u,A,p){const y=Object.assign({column:0,line:-1},u.start);const E=Object.assign({},y,u.end);const{linesAbove:C=2,linesBelow:I=3}=p||{};const w=y.line;const v=y.column;const B=E.line;const S=E.column;let D=Math.max(w-(C+1),0);let k=Math.min(A.length,B+I);if(w===-1){D=0}if(B===-1){k=A.length}const Q=B-w;const F={};if(Q){for(let u=0;u<=Q;u++){const p=u+w;if(!v){F[p]=true}else if(u===0){const u=A[p-1].length;F[p]=[v,u-v+1]}else if(u===Q){F[p]=[0,S]}else{const y=A[p-u].length;F[p]=[0,y]}}}else{if(v===S){if(v){F[w]=[v,0]}else{F[w]=true}}else{F[w]=[v,S-v]}}return{start:D,end:k,markerLines:F}}function codeFrameColumns(u,A,p={}){const y=p.forceColor||isColorSupported()&&p.highlightCode;const E=getDefs(y);const C=u.split(Q);const{start:I,end:w,markerLines:v}=getMarkerLines(A,C,p);const B=A.start&&typeof A.start.column==="number";const S=String(w).length;const D=y?highlight(u):u;let k=D.split(Q,w).slice(I,w).map(((u,A)=>{const y=I+1+A;const C=` ${y}`.slice(-S);const w=` ${C} |`;const B=v[y];const D=!v[y+1];if(B){let A="";if(Array.isArray(B)){const y=u.slice(0,Math.max(B[0]-1,0)).replace(/[^\t]/g," ");const C=B[1]||1;A=["\n ",E.gutter(w.replace(/\d/g," "))," ",y,E.marker("^").repeat(C)].join("");if(D&&p.message){A+=" "+E.message(p.message)}}return[E.marker(">"),E.gutter(w),u.length>0?` ${u}`:"",A].join("")}else{return` ${E.gutter(w)}${u.length>0?` ${u}`:""}`}})).join("\n");if(p.message&&!B){k=`${" ".repeat(S+1)}${p.message}\n${k}`}if(y){return E.reset(k)}else{return k}}function index(u,A,p,y={}){if(!k){k=true;const u="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning){process.emitWarning(u,"DeprecationWarning")}else{const A=new Error(u);A.name="DeprecationWarning";console.warn(new Error(u))}}p=Math.max(p,0);const E={start:{column:p,line:A}};return codeFrameColumns(u,E,y)}A.codeFrameColumns=codeFrameColumns;A["default"]=index;A.highlight=highlight},7713:(u,A)=>{Object.defineProperty(A,"__esModule",{value:true});A.isIdentifierChar=isIdentifierChar;A.isIdentifierName=isIdentifierName;A.isIdentifierStart=isIdentifierStart;let p="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";let y="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const E=new RegExp("["+p+"]");const C=new RegExp("["+p+y+"]");p=y=null;const I=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489];const w=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(u,A){let p=65536;for(let y=0,E=A.length;y<E;y+=2){p+=A[y];if(p>u)return false;p+=A[y+1];if(p>=u)return true}return false}function isIdentifierStart(u){if(u<65)return u===36;if(u<=90)return true;if(u<97)return u===95;if(u<=122)return true;if(u<=65535){return u>=170&&E.test(String.fromCharCode(u))}return isInAstralSet(u,I)}function isIdentifierChar(u){if(u<48)return u===36;if(u<58)return true;if(u<65)return false;if(u<=90)return true;if(u<97)return u===95;if(u<=122)return true;if(u<=65535){return u>=170&&C.test(String.fromCharCode(u))}return isInAstralSet(u,I)||isInAstralSet(u,w)}function isIdentifierName(u){let A=true;for(let p=0;p<u.length;p++){let y=u.charCodeAt(p);if((y&64512)===55296&&p+1<u.length){const A=u.charCodeAt(++p);if((A&64512)===56320){y=65536+((y&1023)<<10)+(A&1023)}}if(A){A=false;if(!isIdentifierStart(y)){return false}}else if(!isIdentifierChar(y)){return false}}return!A}},6472:(u,A,p)=>{Object.defineProperty(A,"__esModule",{value:true});Object.defineProperty(A,"isIdentifierChar",{enumerable:true,get:function(){return y.isIdentifierChar}});Object.defineProperty(A,"isIdentifierName",{enumerable:true,get:function(){return y.isIdentifierName}});Object.defineProperty(A,"isIdentifierStart",{enumerable:true,get:function(){return y.isIdentifierStart}});Object.defineProperty(A,"isKeyword",{enumerable:true,get:function(){return E.isKeyword}});Object.defineProperty(A,"isReservedWord",{enumerable:true,get:function(){return E.isReservedWord}});Object.defineProperty(A,"isStrictBindOnlyReservedWord",{enumerable:true,get:function(){return E.isStrictBindOnlyReservedWord}});Object.defineProperty(A,"isStrictBindReservedWord",{enumerable:true,get:function(){return E.isStrictBindReservedWord}});Object.defineProperty(A,"isStrictReservedWord",{enumerable:true,get:function(){return E.isStrictReservedWord}});var y=p(7713);var E=p(8027)},8027:(u,A)=>{Object.defineProperty(A,"__esModule",{value:true});A.isKeyword=isKeyword;A.isReservedWord=isReservedWord;A.isStrictBindOnlyReservedWord=isStrictBindOnlyReservedWord;A.isStrictBindReservedWord=isStrictBindReservedWord;A.isStrictReservedWord=isStrictReservedWord;const p={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};const y=new Set(p.keyword);const E=new Set(p.strict);const C=new Set(p.strictBind);function isReservedWord(u,A){return A&&u==="await"||u==="enum"}function isStrictReservedWord(u,A){return isReservedWord(u,A)||E.has(u)}function isStrictBindOnlyReservedWord(u){return C.has(u)}function isStrictBindReservedWord(u,A){return isStrictReservedWord(u,A)||isStrictBindOnlyReservedWord(u)}function isKeyword(u){return y.has(u)}},5739:u=>{const A=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const p=typeof AbortController==="function";const y=p?AbortController:class AbortController{constructor(){this.signal=new I}abort(u=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||u;this.signal.aborted=true;this.signal.dispatchEvent({type:"abort",target:this.signal})}};const E=typeof AbortSignal==="function";const C=typeof y.AbortSignal==="function";const I=E?AbortSignal:C?y.AbortController:class AbortSignal{constructor(){this.reason=undefined;this.aborted=false;this._listeners=[]}dispatchEvent(u){if(u.type==="abort"){this.aborted=true;this.onabort(u);this._listeners.forEach((A=>A(u)),this)}}onabort(){}addEventListener(u,A){if(u==="abort"){this._listeners.push(A)}}removeEventListener(u,A){if(u==="abort"){this._listeners=this._listeners.filter((u=>u!==A))}}};const w=new Set;const deprecatedOption=(u,A)=>{const p=`LRU_CACHE_OPTION_${u}`;if(shouldWarn(p)){warn(p,`${u} option`,`options.${A}`,LRUCache)}};const deprecatedMethod=(u,A)=>{const p=`LRU_CACHE_METHOD_${u}`;if(shouldWarn(p)){const{prototype:y}=LRUCache;const{get:E}=Object.getOwnPropertyDescriptor(y,u);warn(p,`${u} method`,`cache.${A}()`,E)}};const deprecatedProperty=(u,A)=>{const p=`LRU_CACHE_PROPERTY_${u}`;if(shouldWarn(p)){const{prototype:y}=LRUCache;const{get:E}=Object.getOwnPropertyDescriptor(y,u);warn(p,`${u} property`,`cache.${A}`,E)}};const emitWarning=(...u)=>{typeof process==="object"&&process&&typeof process.emitWarning==="function"?process.emitWarning(...u):console.error(...u)};const shouldWarn=u=>!w.has(u);const warn=(u,A,p,y)=>{w.add(u);const E=`The ${A} is deprecated. Please use ${p} instead.`;emitWarning(E,"DeprecationWarning",u,y)};const isPosInt=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u);const getUintArray=u=>!isPosInt(u)?null:u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(u){super(u);this.fill(0)}}class Stack{constructor(u){if(u===0){return[]}const A=getUintArray(u);this.heap=new A(u);this.length=0}push(u){this.heap[this.length++]=u}pop(){return this.heap[--this.length]}}class LRUCache{constructor(u={}){const{max:A=0,ttl:p,ttlResolution:y=1,ttlAutopurge:E,updateAgeOnGet:C,updateAgeOnHas:I,allowStale:v,dispose:B,disposeAfter:S,noDisposeOnSet:D,noUpdateTTL:k,maxSize:Q=0,maxEntrySize:F=0,sizeCalculation:R,fetchMethod:_,fetchContext:P,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:U,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:G,ignoreFetchAbort:j}=u;const{length:$,maxAge:q,stale:K}=u instanceof LRUCache?{}:u;if(A!==0&&!isPosInt(A)){throw new TypeError("max option must be a nonnegative integer")}const J=A?getUintArray(A):Array;if(!J){throw new Error("invalid max value: "+A)}this.max=A;this.maxSize=Q;this.maxEntrySize=F||this.maxSize;this.sizeCalculation=R||$;if(this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}this.fetchMethod=_||null;if(this.fetchMethod&&typeof this.fetchMethod!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.fetchContext=P;if(!this.fetchMethod&&P!==undefined){throw new TypeError("cannot set fetchContext without fetchMethod")}this.keyMap=new Map;this.keyList=new Array(A).fill(null);this.valList=new Array(A).fill(null);this.next=new J(A);this.prev=new J(A);this.head=0;this.tail=0;this.free=new Stack(A);this.initialFill=1;this.size=0;if(typeof B==="function"){this.dispose=B}if(typeof S==="function"){this.disposeAfter=S;this.disposed=[]}else{this.disposeAfter=null;this.disposed=null}this.noDisposeOnSet=!!D;this.noUpdateTTL=!!k;this.noDeleteOnFetchRejection=!!O;this.allowStaleOnFetchRejection=!!H;this.allowStaleOnFetchAbort=!!G;this.ignoreFetchAbort=!!j;if(this.maxEntrySize!==0){if(this.maxSize!==0){if(!isPosInt(this.maxSize)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.initializeSizeTracking()}this.allowStale=!!v||!!K;this.noDeleteOnStaleGet=!!U;this.updateAgeOnGet=!!C;this.updateAgeOnHas=!!I;this.ttlResolution=isPosInt(y)||y===0?y:1;this.ttlAutopurge=!!E;this.ttl=p||q||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const u="LRU_CACHE_UNBOUNDED";if(shouldWarn(u)){w.add(u);const A="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(A,"UnboundedCacheWarning",u,LRUCache)}}if(K){deprecatedOption("stale","allowStale")}if(q){deprecatedOption("maxAge","ttl")}if($){deprecatedOption("length","sizeCalculation")}}getRemainingTTL(u){return this.has(u,{updateAgeOnHas:false})?Infinity:0}initializeTTLTracking(){this.ttls=new ZeroArray(this.max);this.starts=new ZeroArray(this.max);this.setItemTTL=(u,p,y=A.now())=>{this.starts[u]=p!==0?y:0;this.ttls[u]=p;if(p!==0&&this.ttlAutopurge){const A=setTimeout((()=>{if(this.isStale(u)){this.delete(this.keyList[u])}}),p+1);if(A.unref){A.unref()}}};this.updateItemAge=u=>{this.starts[u]=this.ttls[u]!==0?A.now():0};this.statusTTL=(A,p)=>{if(A){A.ttl=this.ttls[p];A.start=this.starts[p];A.now=u||getNow();A.remainingTTL=A.now+A.ttl-A.start}};let u=0;const getNow=()=>{const p=A.now();if(this.ttlResolution>0){u=p;const A=setTimeout((()=>u=0),this.ttlResolution);if(A.unref){A.unref()}}return p};this.getRemainingTTL=A=>{const p=this.keyMap.get(A);if(p===undefined){return 0}return this.ttls[p]===0||this.starts[p]===0?Infinity:this.starts[p]+this.ttls[p]-(u||getNow())};this.isStale=A=>this.ttls[A]!==0&&this.starts[A]!==0&&(u||getNow())-this.starts[A]>this.ttls[A]}updateItemAge(u){}statusTTL(u,A){}setItemTTL(u,A,p){}isStale(u){return false}initializeSizeTracking(){this.calculatedSize=0;this.sizes=new ZeroArray(this.max);this.removeItemSize=u=>{this.calculatedSize-=this.sizes[u];this.sizes[u]=0};this.requireSize=(u,A,p,y)=>{if(this.isBackgroundFetch(A)){return 0}if(!isPosInt(p)){if(y){if(typeof y!=="function"){throw new TypeError("sizeCalculation must be a function")}p=y(A,u);if(!isPosInt(p)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation or size "+"must be set.")}}return p};this.addItemSize=(u,A,p)=>{this.sizes[u]=A;if(this.maxSize){const A=this.maxSize-this.sizes[u];while(this.calculatedSize>A){this.evict(true)}}this.calculatedSize+=this.sizes[u];if(p){p.entrySize=A;p.totalCalculatedSize=this.calculatedSize}}}removeItemSize(u){}addItemSize(u,A){}requireSize(u,A,p,y){if(p||y){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}}*indexes({allowStale:u=this.allowStale}={}){if(this.size){for(let A=this.tail;true;){if(!this.isValidIndex(A)){break}if(u||!this.isStale(A)){yield A}if(A===this.head){break}else{A=this.prev[A]}}}}*rindexes({allowStale:u=this.allowStale}={}){if(this.size){for(let A=this.head;true;){if(!this.isValidIndex(A)){break}if(u||!this.isStale(A)){yield A}if(A===this.tail){break}else{A=this.next[A]}}}}isValidIndex(u){return u!==undefined&&this.keyMap.get(this.keyList[u])===u}*entries(){for(const u of this.indexes()){if(this.valList[u]!==undefined&&this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield[this.keyList[u],this.valList[u]]}}}*rentries(){for(const u of this.rindexes()){if(this.valList[u]!==undefined&&this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield[this.keyList[u],this.valList[u]]}}}*keys(){for(const u of this.indexes()){if(this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.keyList[u]}}}*rkeys(){for(const u of this.rindexes()){if(this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.keyList[u]}}}*values(){for(const u of this.indexes()){if(this.valList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.valList[u]}}}*rvalues(){for(const u of this.rindexes()){if(this.valList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.valList[u]}}}[Symbol.iterator](){return this.entries()}find(u,A){for(const p of this.indexes()){const y=this.valList[p];const E=this.isBackgroundFetch(y)?y.__staleWhileFetching:y;if(E===undefined)continue;if(u(E,this.keyList[p],this)){return this.get(this.keyList[p],A)}}}forEach(u,A=this){for(const p of this.indexes()){const y=this.valList[p];const E=this.isBackgroundFetch(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.keyList[p],this)}}rforEach(u,A=this){for(const p of this.rindexes()){const y=this.valList[p];const E=this.isBackgroundFetch(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.keyList[p],this)}}get prune(){deprecatedMethod("prune","purgeStale");return this.purgeStale}purgeStale(){let u=false;for(const A of this.rindexes({allowStale:true})){if(this.isStale(A)){this.delete(this.keyList[A]);u=true}}return u}dump(){const u=[];for(const p of this.indexes({allowStale:true})){const y=this.keyList[p];const E=this.valList[p];const C=this.isBackgroundFetch(E)?E.__staleWhileFetching:E;if(C===undefined)continue;const I={value:C};if(this.ttls){I.ttl=this.ttls[p];const u=A.now()-this.starts[p];I.start=Math.floor(Date.now()-u)}if(this.sizes){I.size=this.sizes[p]}u.unshift([y,I])}return u}load(u){this.clear();for(const[p,y]of u){if(y.start){const u=Date.now()-y.start;y.start=A.now()-u}this.set(p,y.value,y)}}dispose(u,A,p){}set(u,A,{ttl:p=this.ttl,start:y,noDisposeOnSet:E=this.noDisposeOnSet,size:C=0,sizeCalculation:I=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,status:v}={}){C=this.requireSize(u,A,C,I);if(this.maxEntrySize&&C>this.maxEntrySize){if(v){v.set="miss";v.maxEntrySizeExceeded=true}this.delete(u);return this}let B=this.size===0?undefined:this.keyMap.get(u);if(B===undefined){B=this.newIndex();this.keyList[B]=u;this.valList[B]=A;this.keyMap.set(u,B);this.next[this.tail]=B;this.prev[B]=this.tail;this.tail=B;this.size++;this.addItemSize(B,C,v);if(v){v.set="add"}w=false}else{this.moveToTail(B);const p=this.valList[B];if(A!==p){if(this.isBackgroundFetch(p)){p.__abortController.abort(new Error("replaced"))}else{if(!E){this.dispose(p,u,"set");if(this.disposeAfter){this.disposed.push([p,u,"set"])}}}this.removeItemSize(B);this.valList[B]=A;this.addItemSize(B,C,v);if(v){v.set="replace";const u=p&&this.isBackgroundFetch(p)?p.__staleWhileFetching:p;if(u!==undefined)v.oldValue=u}}else if(v){v.set="update"}}if(p!==0&&this.ttl===0&&!this.ttls){this.initializeTTLTracking()}if(!w){this.setItemTTL(B,p,y)}this.statusTTL(v,B);if(this.disposeAfter){while(this.disposed.length){this.disposeAfter(...this.disposed.shift())}}return this}newIndex(){if(this.size===0){return this.tail}if(this.size===this.max&&this.max!==0){return this.evict(false)}if(this.free.length!==0){return this.free.pop()}return this.initialFill++}pop(){if(this.size){const u=this.valList[this.head];this.evict(true);return u}}evict(u){const A=this.head;const p=this.keyList[A];const y=this.valList[A];if(this.isBackgroundFetch(y)){y.__abortController.abort(new Error("evicted"))}else{this.dispose(y,p,"evict");if(this.disposeAfter){this.disposed.push([y,p,"evict"])}}this.removeItemSize(A);if(u){this.keyList[A]=null;this.valList[A]=null;this.free.push(A)}this.head=this.next[A];this.keyMap.delete(p);this.size--;return A}has(u,{updateAgeOnHas:A=this.updateAgeOnHas,status:p}={}){const y=this.keyMap.get(u);if(y!==undefined){if(!this.isStale(y)){if(A){this.updateItemAge(y)}if(p)p.has="hit";this.statusTTL(p,y);return true}else if(p){p.has="stale";this.statusTTL(p,y)}}else if(p){p.has="miss"}return false}peek(u,{allowStale:A=this.allowStale}={}){const p=this.keyMap.get(u);if(p!==undefined&&(A||!this.isStale(p))){const u=this.valList[p];return this.isBackgroundFetch(u)?u.__staleWhileFetching:u}}backgroundFetch(u,A,p,E){const C=A===undefined?undefined:this.valList[A];if(this.isBackgroundFetch(C)){return C}const I=new y;if(p.signal){p.signal.addEventListener("abort",(()=>I.abort(p.signal.reason)))}const w={signal:I.signal,options:p,context:E};const cb=(y,E=false)=>{const{aborted:C}=I.signal;const B=p.ignoreFetchAbort&&y!==undefined;if(p.status){if(C&&!E){p.status.fetchAborted=true;p.status.fetchError=I.signal.reason;if(B)p.status.fetchAbortIgnored=true}else{p.status.fetchResolved=true}}if(C&&!B&&!E){return fetchFail(I.signal.reason)}if(this.valList[A]===v){if(y===undefined){if(v.__staleWhileFetching){this.valList[A]=v.__staleWhileFetching}else{this.delete(u)}}else{if(p.status)p.status.fetchUpdated=true;this.set(u,y,w.options)}}return y};const eb=u=>{if(p.status){p.status.fetchRejected=true;p.status.fetchError=u}return fetchFail(u)};const fetchFail=y=>{const{aborted:E}=I.signal;const C=E&&p.allowStaleOnFetchAbort;const w=C||p.allowStaleOnFetchRejection;const B=w||p.noDeleteOnFetchRejection;if(this.valList[A]===v){const p=!B||v.__staleWhileFetching===undefined;if(p){this.delete(u)}else if(!C){this.valList[A]=v.__staleWhileFetching}}if(w){if(p.status&&v.__staleWhileFetching!==undefined){p.status.returnedStale=true}return v.__staleWhileFetching}else if(v.__returned===v){throw y}};const pcall=(A,y)=>{this.fetchMethod(u,C,w).then((u=>A(u)),y);I.signal.addEventListener("abort",(()=>{if(!p.ignoreFetchAbort||p.allowStaleOnFetchAbort){A();if(p.allowStaleOnFetchAbort){A=u=>cb(u,true)}}}))};if(p.status)p.status.fetchDispatched=true;const v=new Promise(pcall).then(cb,eb);v.__abortController=I;v.__staleWhileFetching=C;v.__returned=null;if(A===undefined){this.set(u,v,{...w.options,status:undefined});A=this.keyMap.get(u)}else{this.valList[A]=v}return v}isBackgroundFetch(u){return u&&typeof u==="object"&&typeof u.then==="function"&&Object.prototype.hasOwnProperty.call(u,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(u,"__returned")&&(u.__returned===u||u.__returned===null)}async fetch(u,{allowStale:A=this.allowStale,updateAgeOnGet:p=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:C=this.noDisposeOnSet,size:I=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:v=this.noUpdateTTL,noDeleteOnFetchRejection:B=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:S=this.allowStaleOnFetchRejection,ignoreFetchAbort:D=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,fetchContext:Q=this.fetchContext,forceRefresh:F=false,status:R,signal:_}={}){if(!this.fetchMethod){if(R)R.fetch="get";return this.get(u,{allowStale:A,updateAgeOnGet:p,noDeleteOnStaleGet:y,status:R})}const P={allowStale:A,updateAgeOnGet:p,noDeleteOnStaleGet:y,ttl:E,noDisposeOnSet:C,size:I,sizeCalculation:w,noUpdateTTL:v,noDeleteOnFetchRejection:B,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:k,ignoreFetchAbort:D,status:R,signal:_};let O=this.keyMap.get(u);if(O===undefined){if(R)R.fetch="miss";const A=this.backgroundFetch(u,O,P,Q);return A.__returned=A}else{const y=this.valList[O];if(this.isBackgroundFetch(y)){const u=A&&y.__staleWhileFetching!==undefined;if(R){R.fetch="inflight";if(u)R.returnedStale=true}return u?y.__staleWhileFetching:y.__returned=y}const E=this.isStale(O);if(!F&&!E){if(R)R.fetch="hit";this.moveToTail(O);if(p){this.updateItemAge(O)}this.statusTTL(R,O);return y}const C=this.backgroundFetch(u,O,P,Q);const I=C.__staleWhileFetching!==undefined;const w=I&&A;if(R){R.fetch=I&&E?"stale":"refresh";if(w&&E)R.returnedStale=true}return w?C.__staleWhileFetching:C.__returned=C}}get(u,{allowStale:A=this.allowStale,updateAgeOnGet:p=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,status:E}={}){const C=this.keyMap.get(u);if(C!==undefined){const I=this.valList[C];const w=this.isBackgroundFetch(I);this.statusTTL(E,C);if(this.isStale(C)){if(E)E.get="stale";if(!w){if(!y){this.delete(u)}if(E)E.returnedStale=A;return A?I:undefined}else{if(E){E.returnedStale=A&&I.__staleWhileFetching!==undefined}return A?I.__staleWhileFetching:undefined}}else{if(E)E.get="hit";if(w){return I.__staleWhileFetching}this.moveToTail(C);if(p){this.updateItemAge(C)}return I}}else if(E){E.get="miss"}}connect(u,A){this.prev[A]=u;this.next[u]=A}moveToTail(u){if(u!==this.tail){if(u===this.head){this.head=this.next[u]}else{this.connect(this.prev[u],this.next[u])}this.connect(this.tail,u);this.tail=u}}get del(){deprecatedMethod("del","delete");return this.delete}delete(u){let A=false;if(this.size!==0){const p=this.keyMap.get(u);if(p!==undefined){A=true;if(this.size===1){this.clear()}else{this.removeItemSize(p);const A=this.valList[p];if(this.isBackgroundFetch(A)){A.__abortController.abort(new Error("deleted"))}else{this.dispose(A,u,"delete");if(this.disposeAfter){this.disposed.push([A,u,"delete"])}}this.keyMap.delete(u);this.keyList[p]=null;this.valList[p]=null;if(p===this.tail){this.tail=this.prev[p]}else if(p===this.head){this.head=this.next[p]}else{this.next[this.prev[p]]=this.next[p];this.prev[this.next[p]]=this.prev[p]}this.size--;this.free.push(p)}}}if(this.disposed){while(this.disposed.length){this.disposeAfter(...this.disposed.shift())}}return A}clear(){for(const u of this.rindexes({allowStale:true})){const A=this.valList[u];if(this.isBackgroundFetch(A)){A.__abortController.abort(new Error("deleted"))}else{const p=this.keyList[u];this.dispose(A,p,"delete");if(this.disposeAfter){this.disposed.push([A,p,"delete"])}}}this.keyMap.clear();this.valList.fill(null);this.keyList.fill(null);if(this.ttls){this.ttls.fill(0);this.starts.fill(0)}if(this.sizes){this.sizes.fill(0)}this.head=0;this.tail=0;this.initialFill=1;this.free.length=0;this.calculatedSize=0;this.size=0;if(this.disposed){while(this.disposed.length){this.disposeAfter(...this.disposed.shift())}}}get reset(){deprecatedMethod("reset","clear");return this.clear}get length(){deprecatedProperty("length","size");return this.size}static get AbortController(){return y}static get AbortSignal(){return I}}u.exports=LRUCache},750:(u,A,p)=>{p.d(A,{Ik:()=>Ce,Ku:()=>oe,CR:()=>cursorTo,eh:()=>cursorUp,Sc:()=>ue,_W:()=>eraseLines});var y=p(1708);var E=p(8161);const C=globalThis.window?.document!==undefined;const I=globalThis.process?.versions?.node!==undefined;const w=globalThis.process?.versions?.bun!==undefined;const v=globalThis.Deno?.version?.deno!==undefined;const B=globalThis.process?.versions?.electron!==undefined;const S=globalThis.navigator?.userAgent?.includes("jsdom")===true;const D=typeof WorkerGlobalScope!=="undefined"&&globalThis instanceof WorkerGlobalScope;const k=typeof DedicatedWorkerGlobalScope!=="undefined"&&globalThis instanceof DedicatedWorkerGlobalScope;const Q=typeof SharedWorkerGlobalScope!=="undefined"&&globalThis instanceof SharedWorkerGlobalScope;const F=typeof ServiceWorkerGlobalScope!=="undefined"&&globalThis instanceof ServiceWorkerGlobalScope;const R=globalThis.navigator?.userAgentData?.platform;const _=R==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===true||globalThis.process?.platform==="darwin";const P=R==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32";const O=R==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===true||globalThis.navigator?.userAgent?.includes(" Linux ")===true||globalThis.process?.platform==="linux";const U=R==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform);const H=R==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===true||globalThis.process?.platform==="android";const G="[";const j="]";const $="";const q=";";const K=!C&&y.env.TERM_PROGRAM==="Apple_Terminal";const J=!C&&y.platform==="win32";const ee=!C&&(y.env.TERM?.startsWith("screen")||y.env.TERM?.startsWith("tmux")||y.env.TMUX!==undefined);const te=C?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:y.cwd;const wrapOsc=u=>{if(ee){return"Ptmux;"+u.replaceAll("","")+"\\"}return u};const cursorTo=(u,A)=>{if(typeof u!=="number"){throw new TypeError("The `x` argument is required")}if(typeof A!=="number"){return G+(u+1)+"G"}return G+(A+1)+q+(u+1)+"H"};const cursorMove=(u,A)=>{if(typeof u!=="number"){throw new TypeError("The `x` argument is required")}let p="";if(u<0){p+=G+-u+"D"}else if(u>0){p+=G+u+"C"}if(A<0){p+=G+-A+"A"}else if(A>0){p+=G+A+"B"}return p};const cursorUp=(u=1)=>G+u+"A";const cursorDown=(u=1)=>G+u+"B";const cursorForward=(u=1)=>G+u+"C";const cursorBackward=(u=1)=>G+u+"D";const ne=G+"G";const re=K?"7":G+"s";const se=K?"8":G+"u";const ie=G+"6n";const oe=G+"E";const ae=G+"F";const le=G+"?25l";const ce=G+"?25h";const eraseLines=u=>{let A="";for(let p=0;p<u;p++){A+=fe+(p<u-1?cursorUp():"")}if(u){A+=ne}return A};const ue=G+"K";const de=G+"1K";const fe=G+"2K";const Ae=G+"J";const he=G+"1J";const pe=G+"2J";const ge=G+"S";const me=G+"T";const ye="c";const Ee=null&&`${pe}${G}H`;const isOldWindows=()=>{if(C||!J){return false}const u=E.release().split(".");const A=Number(u[0]);const p=Number(u[2]??0);if(A<10){return true}if(A===10&&p<10586){return true}return false};const Ce=isOldWindows()?`${pe}${G}0f`:`${pe}${G}3J${G}H`;const Ie=G+"?1049h";const be=G+"?1049l";const we=null&&$;const base_link=(u,A)=>{const p=wrapOsc(`${j}8${q}${q}${A}${$}`);const y=wrapOsc(`${j}8${q}${q}${$}`);return p+u+y};const base_image=(u,A={})=>{let p=`${j}1337;File=inline=1`;if(A.width){p+=`;width=${A.width}`}if(A.height){p+=`;height=${A.height}`}if(A.preserveAspectRatio===false){p+=";preserveAspectRatio=0"}const y=Buffer.from(u);return wrapOsc(p+`;size=${y.byteLength}`+":"+y.toString("base64")+$)};const ve={setCwd:(u=te())=>wrapOsc(`${j}50;CurrentDir=${u}${$}`),annotation(u,A={}){let p=`${j}1337;`;const y=A.x!==undefined;const E=A.y!==undefined;if((y||E)&&!(y&&E&&A.length!==undefined)){throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined")}u=u.replaceAll("|","");p+=A.isHidden?"AddHiddenAnnotation=":"AddAnnotation=";if(A.length>0){p+=(y?[u,A.length,A.x,A.y]:[A.length,u]).join("|")}else{p+=u}return wrapOsc(p+$)}};const Be={setCwd:(u=te())=>wrapOsc(`${j}9;9;${u}${$}`)};const setCwd=(u=te())=>ve.setCwd(u)+Be.setCwd(u)},651:(u,A,p)=>{p.d(A,{Ay:()=>S});const y=10;const wrapAnsi16=(u=0)=>A=>`[${A+u}m`;const wrapAnsi256=(u=0)=>A=>`[${38+u};5;${A}m`;const wrapAnsi16m=(u=0)=>(A,p,y)=>`[${38+u};2;${A};${p};${y}m`;const E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const C=Object.keys(E.modifier);const I=Object.keys(E.color);const w=Object.keys(E.bgColor);const v=[...I,...w];function assembleStyles(){const u=new Map;for(const[A,p]of Object.entries(E)){for(const[A,y]of Object.entries(p)){E[A]={open:`[${y[0]}m`,close:`[${y[1]}m`};p[A]=E[A];u.set(y[0],y[1])}Object.defineProperty(E,A,{value:p,enumerable:false})}Object.defineProperty(E,"codes",{value:u,enumerable:false});E.color.close="";E.bgColor.close="";E.color.ansi=wrapAnsi16();E.color.ansi256=wrapAnsi256();E.color.ansi16m=wrapAnsi16m();E.bgColor.ansi=wrapAnsi16(y);E.bgColor.ansi256=wrapAnsi256(y);E.bgColor.ansi16m=wrapAnsi16m(y);Object.defineProperties(E,{rgbToAnsi256:{value(u,A,p){if(u===A&&A===p){if(u<8){return 16}if(u>248){return 231}return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(A/255*5)+Math.round(p/255*5)},enumerable:false},hexToRgb:{value(u){const A=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!A){return[0,0,0]}let[p]=A;if(p.length===3){p=[...p].map((u=>u+u)).join("")}const y=Number.parseInt(p,16);return[y>>16&255,y>>8&255,y&255]},enumerable:false},hexToAnsi256:{value:u=>E.rgbToAnsi256(...E.hexToRgb(u)),enumerable:false},ansi256ToAnsi:{value(u){if(u<8){return 30+u}if(u<16){return 90+(u-8)}let A;let p;let y;if(u>=232){A=((u-232)*10+8)/255;p=A;y=A}else{u-=16;const E=u%36;A=Math.floor(u/36)/5;p=Math.floor(E/6)/5;y=E%6/5}const E=Math.max(A,p,y)*2;if(E===0){return 30}let C=30+(Math.round(y)<<2|Math.round(p)<<1|Math.round(A));if(E===2){C+=60}return C},enumerable:false},rgbToAnsi:{value:(u,A,p)=>E.ansi256ToAnsi(E.rgbToAnsi256(u,A,p)),enumerable:false},hexToAnsi:{value:u=>E.ansi256ToAnsi(E.hexToAnsi256(u)),enumerable:false}});return E}const B=assembleStyles();const S=B},1690:(u,A,p)=>{p.d(A,{A:()=>autoBind});const getAllProperties=u=>{const A=new Set;do{for(const p of Reflect.ownKeys(u)){A.add([u,p])}}while((u=Reflect.getPrototypeOf(u))&&u!==Object.prototype);return A};function autoBind(u,{include:A,exclude:p}={}){const filter=u=>{const match=A=>typeof A==="string"?u===A:A.test(u);if(A){return A.some(match)}if(p){return!p.some(match)}return true};for(const[A,p]of getAllProperties(u.constructor.prototype)){if(p==="constructor"||!filter(p)){continue}const y=Reflect.getOwnPropertyDescriptor(A,p);if(y&&typeof y.value==="function"){u[p]=u[p].bind(u)}}return u}},9611:(u,A,p)=>{p.d(A,{Ay:()=>ne});const y=10;const wrapAnsi16=(u=0)=>A=>`[${A+u}m`;const wrapAnsi256=(u=0)=>A=>`[${38+u};5;${A}m`;const wrapAnsi16m=(u=0)=>(A,p,y)=>`[${38+u};2;${A};${p};${y}m`;const E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const C=Object.keys(E.modifier);const I=Object.keys(E.color);const w=Object.keys(E.bgColor);const v=[...I,...w];function assembleStyles(){const u=new Map;for(const[A,p]of Object.entries(E)){for(const[A,y]of Object.entries(p)){E[A]={open:`[${y[0]}m`,close:`[${y[1]}m`};p[A]=E[A];u.set(y[0],y[1])}Object.defineProperty(E,A,{value:p,enumerable:false})}Object.defineProperty(E,"codes",{value:u,enumerable:false});E.color.close="";E.bgColor.close="";E.color.ansi=wrapAnsi16();E.color.ansi256=wrapAnsi256();E.color.ansi16m=wrapAnsi16m();E.bgColor.ansi=wrapAnsi16(y);E.bgColor.ansi256=wrapAnsi256(y);E.bgColor.ansi16m=wrapAnsi16m(y);Object.defineProperties(E,{rgbToAnsi256:{value(u,A,p){if(u===A&&A===p){if(u<8){return 16}if(u>248){return 231}return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(A/255*5)+Math.round(p/255*5)},enumerable:false},hexToRgb:{value(u){const A=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!A){return[0,0,0]}let[p]=A;if(p.length===3){p=[...p].map((u=>u+u)).join("")}const y=Number.parseInt(p,16);return[y>>16&255,y>>8&255,y&255]},enumerable:false},hexToAnsi256:{value:u=>E.rgbToAnsi256(...E.hexToRgb(u)),enumerable:false},ansi256ToAnsi:{value(u){if(u<8){return 30+u}if(u<16){return 90+(u-8)}let A;let p;let y;if(u>=232){A=((u-232)*10+8)/255;p=A;y=A}else{u-=16;const E=u%36;A=Math.floor(u/36)/5;p=Math.floor(E/6)/5;y=E%6/5}const E=Math.max(A,p,y)*2;if(E===0){return 30}let C=30+(Math.round(y)<<2|Math.round(p)<<1|Math.round(A));if(E===2){C+=60}return C},enumerable:false},rgbToAnsi:{value:(u,A,p)=>E.ansi256ToAnsi(E.rgbToAnsi256(u,A,p)),enumerable:false},hexToAnsi:{value:u=>E.ansi256ToAnsi(E.hexToAnsi256(u)),enumerable:false}});return E}const B=assembleStyles();const S=B;var D=p(1708);var k=p(8161);var Q=p(7066);function hasFlag(u,A=(globalThis.Deno?globalThis.Deno.args:D.argv)){const p=u.startsWith("-")?"":u.length===1?"-":"--";const y=A.indexOf(p+u);const E=A.indexOf("--");return y!==-1&&(E===-1||y<E)}const{env:F}=D;let R;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){R=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){R=1}function envForceColor(){if("FORCE_COLOR"in F){if(F.FORCE_COLOR==="true"){return 1}if(F.FORCE_COLOR==="false"){return 0}return F.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(F.FORCE_COLOR,10),3)}}function translateLevel(u){if(u===0){return false}return{level:u,hasBasic:true,has256:u>=2,has16m:u>=3}}function _supportsColor(u,{streamIsTTY:A,sniffFlags:p=true}={}){const y=envForceColor();if(y!==undefined){R=y}const E=p?R:y;if(E===0){return 0}if(p){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if("TF_BUILD"in F&&"AGENT_NAME"in F){return 1}if(u&&!A&&E===undefined){return 0}const C=E||0;if(F.TERM==="dumb"){return C}if(D.platform==="win32"){const u=k.release().split(".");if(Number(u[0])>=10&&Number(u[2])>=10586){return Number(u[2])>=14931?3:2}return 1}if("CI"in F){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((u=>u in F))){return 3}if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((u=>u in F))||F.CI_NAME==="codeship"){return 1}return C}if("TEAMCITY_VERSION"in F){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(F.TEAMCITY_VERSION)?1:0}if(F.COLORTERM==="truecolor"){return 3}if(F.TERM==="xterm-kitty"){return 3}if(F.TERM==="xterm-ghostty"){return 3}if(F.TERM==="wezterm"){return 3}if("TERM_PROGRAM"in F){const u=Number.parseInt((F.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(F.TERM_PROGRAM){case"iTerm.app":{return u>=3?3:2}case"Apple_Terminal":{return 2}}}if(/-256(color)?$/i.test(F.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(F.TERM)){return 1}if("COLORTERM"in F){return 1}return C}function createSupportsColor(u,A={}){const p=_supportsColor(u,{streamIsTTY:u&&u.isTTY,...A});return translateLevel(p)}const _={stdout:createSupportsColor({isTTY:Q.isatty(1)}),stderr:createSupportsColor({isTTY:Q.isatty(2)})};const P=_;function stringReplaceAll(u,A,p){let y=u.indexOf(A);if(y===-1){return u}const E=A.length;let C=0;let I="";do{I+=u.slice(C,y)+A+p;C=y+E;y=u.indexOf(A,C)}while(y!==-1);I+=u.slice(C);return I}function stringEncaseCRLFWithFirstIndex(u,A,p,y){let E=0;let C="";do{const I=u[y-1]==="\r";C+=u.slice(E,I?y-1:y)+A+(I?"\r\n":"\n")+p;E=y+1;y=u.indexOf("\n",E)}while(y!==-1);C+=u.slice(E);return C}const{stdout:O,stderr:U}=P;const H=Symbol("GENERATOR");const G=Symbol("STYLER");const j=Symbol("IS_EMPTY");const $=["ansi","ansi","ansi256","ansi16m"];const q=Object.create(null);const applyOptions=(u,A={})=>{if(A.level&&!(Number.isInteger(A.level)&&A.level>=0&&A.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const p=O?O.level:0;u.level=A.level===undefined?p:A.level};class Chalk{constructor(u){return chalkFactory(u)}}const chalkFactory=u=>{const chalk=(...u)=>u.join(" ");applyOptions(chalk,u);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(u){return chalkFactory(u)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[u,A]of Object.entries(S)){q[u]={get(){const p=createBuilder(this,createStyler(A.open,A.close,this[G]),this[j]);Object.defineProperty(this,u,{value:p});return p}}}q.visible={get(){const u=createBuilder(this,this[G],true);Object.defineProperty(this,"visible",{value:u});return u}};const getModelAnsi=(u,A,p,...y)=>{if(u==="rgb"){if(A==="ansi16m"){return S[p].ansi16m(...y)}if(A==="ansi256"){return S[p].ansi256(S.rgbToAnsi256(...y))}return S[p].ansi(S.rgbToAnsi(...y))}if(u==="hex"){return getModelAnsi("rgb",A,p,...S.hexToRgb(...y))}return S[p][u](...y)};const K=["rgb","hex","ansi256"];for(const u of K){q[u]={get(){const{level:A}=this;return function(...p){const y=createStyler(getModelAnsi(u,$[A],"color",...p),S.color.close,this[G]);return createBuilder(this,y,this[j])}}};const A="bg"+u[0].toUpperCase()+u.slice(1);q[A]={get(){const{level:A}=this;return function(...p){const y=createStyler(getModelAnsi(u,$[A],"bgColor",...p),S.bgColor.close,this[G]);return createBuilder(this,y,this[j])}}}}const J=Object.defineProperties((()=>{}),{...q,level:{enumerable:true,get(){return this[H].level},set(u){this[H].level=u}}});const createStyler=(u,A,p)=>{let y;let E;if(p===undefined){y=u;E=A}else{y=p.openAll+u;E=A+p.closeAll}return{open:u,close:A,openAll:y,closeAll:E,parent:p}};const createBuilder=(u,A,p)=>{const builder=(...u)=>applyStyle(builder,u.length===1?""+u[0]:u.join(" "));Object.setPrototypeOf(builder,J);builder[H]=u;builder[G]=A;builder[j]=p;return builder};const applyStyle=(u,A)=>{if(u.level<=0||!A){return u[j]?"":A}let p=u[G];if(p===undefined){return A}const{openAll:y,closeAll:E}=p;if(A.includes("")){while(p!==undefined){A=stringReplaceAll(A,p.close,p.open);p=p.parent}}const C=A.indexOf("\n");if(C!==-1){A=stringEncaseCRLFWithFirstIndex(A,E,y,C)}return y+A+E};Object.defineProperties(createChalk.prototype,q);const ee=createChalk();const te=createChalk({level:U?U.level:0});const ne=ee},7078:(u,A,p)=>{p.d(A,{A:()=>S});var y=p(1708);var E=p(5443);var C=p(7417);const I=E((()=>{C((()=>{y.stderr.write("[?25h")}),{alwaysLast:true})}));const w=I;let v=false;const B={};B.show=(u=y.stderr)=>{if(!u.isTTY){return}v=false;u.write("[?25h")};B.hide=(u=y.stderr)=>{if(!u.isTTY){return}w();v=true;u.write("[?25l")};B.toggle=(u,A)=>{if(u!==undefined){v=u}if(v){B.show(A)}else{B.hide(A)}};const S=B},4104:(u,A,p)=>{p.d(A,{Pp:()=>diffLines});class Diff{diff(u,A,p={}){let y;if(typeof p==="function"){y=p;p={}}else if("callback"in p){y=p.callback}const E=this.castInput(u,p);const C=this.castInput(A,p);const I=this.removeEmpty(this.tokenize(E,p));const w=this.removeEmpty(this.tokenize(C,p));return this.diffWithOptionsObj(I,w,p,y)}diffWithOptionsObj(u,A,p,y){var E;const done=u=>{u=this.postProcess(u,p);if(y){setTimeout((function(){y(u)}),0);return undefined}else{return u}};const C=A.length,I=u.length;let w=1;let v=C+I;if(p.maxEditLength!=null){v=Math.min(v,p.maxEditLength)}const B=(E=p.timeout)!==null&&E!==void 0?E:Infinity;const S=Date.now()+B;const D=[{oldPos:-1,lastComponent:undefined}];let k=this.extractCommon(D[0],A,u,0,p);if(D[0].oldPos+1>=I&&k+1>=C){return done(this.buildValues(D[0].lastComponent,A,u))}let Q=-Infinity,F=Infinity;const execEditLength=()=>{for(let y=Math.max(Q,-w);y<=Math.min(F,w);y+=2){let E;const w=D[y-1],v=D[y+1];if(w){D[y-1]=undefined}let B=false;if(v){const u=v.oldPos-y;B=v&&0<=u&&u<C}const S=w&&w.oldPos+1<I;if(!B&&!S){D[y]=undefined;continue}if(!S||B&&w.oldPos<v.oldPos){E=this.addToPath(v,true,false,0,p)}else{E=this.addToPath(w,false,true,1,p)}k=this.extractCommon(E,A,u,y,p);if(E.oldPos+1>=I&&k+1>=C){return done(this.buildValues(E.lastComponent,A,u))||true}else{D[y]=E;if(E.oldPos+1>=I){F=Math.min(F,y-1)}if(k+1>=C){Q=Math.max(Q,y+1)}}}w++};if(y){(function exec(){setTimeout((function(){if(w>v||Date.now()>S){return y(undefined)}if(!execEditLength()){exec()}}),0)})()}else{while(w<=v&&Date.now()<=S){const u=execEditLength();if(u){return u}}}}addToPath(u,A,p,y,E){const C=u.lastComponent;if(C&&!E.oneChangePerToken&&C.added===A&&C.removed===p){return{oldPos:u.oldPos+y,lastComponent:{count:C.count+1,added:A,removed:p,previousComponent:C.previousComponent}}}else{return{oldPos:u.oldPos+y,lastComponent:{count:1,added:A,removed:p,previousComponent:C}}}}extractCommon(u,A,p,y,E){const C=A.length,I=p.length;let w=u.oldPos,v=w-y,B=0;while(v+1<C&&w+1<I&&this.equals(p[w+1],A[v+1],E)){v++;w++;B++;if(E.oneChangePerToken){u.lastComponent={count:1,previousComponent:u.lastComponent,added:false,removed:false}}}if(B&&!E.oneChangePerToken){u.lastComponent={count:B,previousComponent:u.lastComponent,added:false,removed:false}}u.oldPos=w;return v}equals(u,A,p){if(p.comparator){return p.comparator(u,A)}else{return u===A||!!p.ignoreCase&&u.toLowerCase()===A.toLowerCase()}}removeEmpty(u){const A=[];for(let p=0;p<u.length;p++){if(u[p]){A.push(u[p])}}return A}castInput(u,A){return u}tokenize(u,A){return Array.from(u)}join(u){return u.join("")}postProcess(u,A){return u}get useLongestToken(){return false}buildValues(u,A,p){const y=[];let E;while(u){y.push(u);E=u.previousComponent;delete u.previousComponent;u=E}y.reverse();const C=y.length;let I=0,w=0,v=0;for(;I<C;I++){const u=y[I];if(!u.removed){if(!u.added&&this.useLongestToken){let y=A.slice(w,w+u.count);y=y.map((function(u,A){const y=p[v+A];return y.length>u.length?y:u}));u.value=this.join(y)}else{u.value=this.join(A.slice(w,w+u.count))}w+=u.count;if(!u.added){v+=u.count}}else{u.value=this.join(p.slice(v,v+u.count));v+=u.count}}return y}}class LineDiff extends Diff{constructor(){super(...arguments);this.tokenize=tokenize}equals(u,A,p){if(p.ignoreWhitespace){if(!p.newlineIsToken||!u.includes("\n")){u=u.trim()}if(!p.newlineIsToken||!A.includes("\n")){A=A.trim()}}else if(p.ignoreNewlineAtEof&&!p.newlineIsToken){if(u.endsWith("\n")){u=u.slice(0,-1)}if(A.endsWith("\n")){A=A.slice(0,-1)}}return super.equals(u,A,p)}}const y=new LineDiff;function diffLines(u,A,p){return y.diff(u,A,p)}function diffTrimmedLines(u,A,p){p=generateOptions(p,{ignoreWhitespace:true});return y.diff(u,A,p)}function tokenize(u,A){if(A.stripTrailingCr){u=u.replace(/\r\n/g,"\n")}const p=[],y=u.split(/(\n|\r\n)/);if(!y[y.length-1]){y.pop()}for(let u=0;u<y.length;u++){const E=y[u];if(u%2&&!A.newlineIsToken){p[p.length-1]+=E}else{p.push(E)}}return p}},9966:(u,A,p)=>{p.d(A,{n:()=>throttle});function debounce(u,A,{signal:p,edges:y}={}){let E=undefined;let C=null;const I=y!=null&&y.includes("leading");const w=y==null||y.includes("trailing");const invoke=()=>{if(C!==null){u.apply(E,C);E=undefined;C=null}};const onTimerEnd=()=>{if(w){invoke()}cancel()};let v=null;const schedule=()=>{if(v!=null){clearTimeout(v)}v=setTimeout((()=>{v=null;onTimerEnd()}),A)};const cancelTimer=()=>{if(v!==null){clearTimeout(v);v=null}};const cancel=()=>{cancelTimer();E=undefined;C=null};const flush=()=>{invoke()};const debounced=function(...u){if(p?.aborted){return}E=this;C=u;const A=v==null;schedule();if(I&&A){invoke()}};debounced.schedule=schedule;debounced.cancel=cancel;debounced.flush=flush;p?.addEventListener("abort",cancel,{once:true});return debounced}function debounce_debounce(u,A=0,p={}){if(typeof p!=="object"){p={}}const{leading:y=false,trailing:E=true,maxWait:C}=p;const I=Array(2);if(y){I[0]="leading"}if(E){I[1]="trailing"}let w=undefined;let v=null;const B=debounce((function(...A){w=u.apply(this,A);v=null}),A,{edges:I});const debounced=function(...A){if(C!=null){if(v===null){v=Date.now()}if(Date.now()-v>=C){w=u.apply(this,A);v=Date.now();B.cancel();B.schedule();return w}}B.apply(this,A);return w};const flush=()=>{B.flush();return w};debounced.cancel=B.cancel;debounced.flush=flush;return debounced}function throttle(u,A=0,p={}){const{leading:y=true,trailing:E=true}=p;return debounce_debounce(u,A,{leading:y,maxWait:A,trailing:E})}},5351:(u,A,p)=>{p.d(A,{Q1:()=>eastAsianWidth});var y=p(9957);function validate(u){if(!Number.isSafeInteger(u)){throw new TypeError(`Expected a code point, got \`${typeof u}\`.`)}}function eastAsianWidthType(u){validate(u);return getCategory(u)}function eastAsianWidth(u,{ambiguousAsWide:A=false}={}){validate(u);if((0,y.Ck)(u)||(0,y.EW)(u)||A&&(0,y.X2)(u)){return 2}return 1}},9957:(u,A,p)=>{p.d(A,{Ck:()=>isFullWidth,EW:()=>isWide,X2:()=>isAmbiguous});function isAmbiguous(u){return u===161||u===164||u===167||u===168||u===170||u===173||u===174||u>=176&&u<=180||u>=182&&u<=186||u>=188&&u<=191||u===198||u===208||u===215||u===216||u>=222&&u<=225||u===230||u>=232&&u<=234||u===236||u===237||u===240||u===242||u===243||u>=247&&u<=250||u===252||u===254||u===257||u===273||u===275||u===283||u===294||u===295||u===299||u>=305&&u<=307||u===312||u>=319&&u<=322||u===324||u>=328&&u<=331||u===333||u===338||u===339||u===358||u===359||u===363||u===462||u===464||u===466||u===468||u===470||u===472||u===474||u===476||u===593||u===609||u===708||u===711||u>=713&&u<=715||u===717||u===720||u>=728&&u<=731||u===733||u===735||u>=768&&u<=879||u>=913&&u<=929||u>=931&&u<=937||u>=945&&u<=961||u>=963&&u<=969||u===1025||u>=1040&&u<=1103||u===1105||u===8208||u>=8211&&u<=8214||u===8216||u===8217||u===8220||u===8221||u>=8224&&u<=8226||u>=8228&&u<=8231||u===8240||u===8242||u===8243||u===8245||u===8251||u===8254||u===8308||u===8319||u>=8321&&u<=8324||u===8364||u===8451||u===8453||u===8457||u===8467||u===8470||u===8481||u===8482||u===8486||u===8491||u===8531||u===8532||u>=8539&&u<=8542||u>=8544&&u<=8555||u>=8560&&u<=8569||u===8585||u>=8592&&u<=8601||u===8632||u===8633||u===8658||u===8660||u===8679||u===8704||u===8706||u===8707||u===8711||u===8712||u===8715||u===8719||u===8721||u===8725||u===8730||u>=8733&&u<=8736||u===8739||u===8741||u>=8743&&u<=8748||u===8750||u>=8756&&u<=8759||u===8764||u===8765||u===8776||u===8780||u===8786||u===8800||u===8801||u>=8804&&u<=8807||u===8810||u===8811||u===8814||u===8815||u===8834||u===8835||u===8838||u===8839||u===8853||u===8857||u===8869||u===8895||u===8978||u>=9312&&u<=9449||u>=9451&&u<=9547||u>=9552&&u<=9587||u>=9600&&u<=9615||u>=9618&&u<=9621||u===9632||u===9633||u>=9635&&u<=9641||u===9650||u===9651||u===9654||u===9655||u===9660||u===9661||u===9664||u===9665||u>=9670&&u<=9672||u===9675||u>=9678&&u<=9681||u>=9698&&u<=9701||u===9711||u===9733||u===9734||u===9737||u===9742||u===9743||u===9756||u===9758||u===9792||u===9794||u===9824||u===9825||u>=9827&&u<=9829||u>=9831&&u<=9834||u===9836||u===9837||u===9839||u===9886||u===9887||u===9919||u>=9926&&u<=9933||u>=9935&&u<=9939||u>=9941&&u<=9953||u===9955||u===9960||u===9961||u>=9963&&u<=9969||u===9972||u>=9974&&u<=9977||u===9979||u===9980||u===9982||u===9983||u===10045||u>=10102&&u<=10111||u>=11094&&u<=11097||u>=12872&&u<=12879||u>=57344&&u<=63743||u>=65024&&u<=65039||u===65533||u>=127232&&u<=127242||u>=127248&&u<=127277||u>=127280&&u<=127337||u>=127344&&u<=127373||u===127375||u===127376||u>=127387&&u<=127404||u>=917760&&u<=917999||u>=983040&&u<=1048573||u>=1048576&&u<=1114109}function isFullWidth(u){return u===12288||u>=65281&&u<=65376||u>=65504&&u<=65510}function isWide(u){return u>=4352&&u<=4447||u===8986||u===8987||u===9001||u===9002||u>=9193&&u<=9196||u===9200||u===9203||u===9725||u===9726||u===9748||u===9749||u>=9776&&u<=9783||u>=9800&&u<=9811||u===9855||u>=9866&&u<=9871||u===9875||u===9889||u===9898||u===9899||u===9917||u===9918||u===9924||u===9925||u===9934||u===9940||u===9962||u===9970||u===9971||u===9973||u===9978||u===9981||u===9989||u===9994||u===9995||u===10024||u===10060||u===10062||u>=10067&&u<=10069||u===10071||u>=10133&&u<=10135||u===10160||u===10175||u===11035||u===11036||u===11088||u===11093||u>=11904&&u<=11929||u>=11931&&u<=12019||u>=12032&&u<=12245||u>=12272&&u<=12287||u>=12289&&u<=12350||u>=12353&&u<=12438||u>=12441&&u<=12543||u>=12549&&u<=12591||u>=12593&&u<=12686||u>=12688&&u<=12773||u>=12783&&u<=12830||u>=12832&&u<=12871||u>=12880&&u<=42124||u>=42128&&u<=42182||u>=43360&&u<=43388||u>=44032&&u<=55203||u>=63744&&u<=64255||u>=65040&&u<=65049||u>=65072&&u<=65106||u>=65108&&u<=65126||u>=65128&&u<=65131||u>=94176&&u<=94180||u>=94192&&u<=94198||u>=94208&&u<=101589||u>=101631&&u<=101662||u>=101760&&u<=101874||u>=110576&&u<=110579||u>=110581&&u<=110587||u===110589||u===110590||u>=110592&&u<=110882||u===110898||u>=110928&&u<=110930||u===110933||u>=110948&&u<=110951||u>=110960&&u<=111355||u>=119552&&u<=119638||u>=119648&&u<=119670||u===126980||u===127183||u===127374||u>=127377&&u<=127386||u>=127488&&u<=127490||u>=127504&&u<=127547||u>=127552&&u<=127560||u===127568||u===127569||u>=127584&&u<=127589||u>=127744&&u<=127776||u>=127789&&u<=127797||u>=127799&&u<=127868||u>=127870&&u<=127891||u>=127904&&u<=127946||u>=127951&&u<=127955||u>=127968&&u<=127984||u===127988||u>=127992&&u<=128062||u===128064||u>=128066&&u<=128252||u>=128255&&u<=128317||u>=128331&&u<=128334||u>=128336&&u<=128359||u===128378||u===128405||u===128406||u===128420||u>=128507&&u<=128591||u>=128640&&u<=128709||u===128716||u>=128720&&u<=128722||u>=128725&&u<=128728||u>=128732&&u<=128735||u===128747||u===128748||u>=128756&&u<=128764||u>=128992&&u<=129003||u===129008||u>=129292&&u<=129338||u>=129340&&u<=129349||u>=129351&&u<=129535||u>=129648&&u<=129660||u>=129664&&u<=129674||u>=129678&&u<=129734||u===129736||u>=129741&&u<=129756||u>=129759&&u<=129770||u>=129775&&u<=129784||u>=131072&&u<=196605||u>=196608&&u<=262141}function getCategory(u){if(isAmbiguous(u))return"ambiguous";if(isFullWidth(u))return"fullwidth";if(u===8361||u>=65377&&u<=65470||u>=65474&&u<=65479||u>=65482&&u<=65487||u>=65490&&u<=65495||u>=65498&&u<=65500||u>=65512&&u<=65518){return"halfwidth"}if(u>=32&&u<=126||u===162||u===163||u===165||u===166||u===172||u===175||u>=10214&&u<=10221||u===10629||u===10630){return"narrow"}if(isWide(u))return"wide";return"neutral"}},8617:(u,A,p)=>{p.d(A,{A:()=>indentString});function indentString(u,A=1,p={}){const{indent:y=" ",includeEmptyLines:E=false}=p;if(typeof u!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof u}\``)}if(typeof A!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof A}\``)}if(A<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${A}\``)}if(typeof y!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof y}\``)}if(A===0){return u}const C=E?/^/gm:/^(?!\s*$)/gm;return u.replace(C,y.repeat(A))}},9930:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(3102);var C=p(5184);var I=p(6976);var w=u([C]);C=(w.then?(await w)():w)[0];function Spinner({type:u="dots"}){const[A,p]=(0,E.useState)(0);const y=I[u];(0,E.useEffect)((()=>{const u=setInterval((()=>{p((u=>{const A=u===y.frames.length-1;return A?0:u+1}))}),y.interval);return()=>{clearInterval(u)}}),[y]);return E.createElement(C.EY,null,y.frames[A])}const v=Spinner;y()}catch(B){y(B)}}))},4493:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(9611);const E=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/;const C=/^ansi256\(\s?(\d+)\s?\)$/;const isNamedColor=u=>u in y.Ay;const colorize=(u,A,p)=>{if(!A){return u}if(isNamedColor(A)){if(p==="foreground"){return y.Ay[A](u)}const E=`bg${A[0].toUpperCase()+A.slice(1)}`;return y.Ay[E](u)}if(A.startsWith("#")){return p==="foreground"?y.Ay.hex(A)(u):y.Ay.bgHex(A)(u)}if(A.startsWith("ansi256")){const E=C.exec(A);if(!E){return u}const I=Number(E[1]);return p==="foreground"?y.Ay.ansi256(I)(u):y.Ay.bgAnsi256(I)(u)}if(A.startsWith("rgb")){const C=E.exec(A);if(!C){return u}const I=Number(C[1]);const w=Number(C[2]);const v=Number(C[3]);return p==="foreground"?y.Ay.rgb(I,w,v)(u):y.Ay.bgRgb(I,w,v)(u)}return u};const I=colorize},7470:(u,A,p)=>{p.d(A,{E:()=>E});var y=p(3102);const E=(0,y.createContext)({isScreenReaderEnabled:false})},5076:(u,A,p)=>{p.d(A,{A:()=>App});var y=p(8474);var E=p(1708);var C=p(3102);var I=p(7078);var w=p(8023);var v=p(2608);var B=p(4371);var S=p(9834);var D=p(6978);var k=p(3024);var Q=p(4491);const convertToSpaces=(u,A=2)=>u.replace(/^\t+/gm,(u=>" ".repeat(u.length*A)));const F=convertToSpaces;const generateLineNumbers=(u,A)=>{const p=[];const y=u-A;const E=u+A;for(let u=y;u<=E;u++){p.push(u)}return p};const codeExcerpt=(u,A,p={})=>{var y;if(typeof u!=="string"){throw new TypeError("Source code is missing.")}if(!A||A<1){throw new TypeError("Line number must start from `1`.")}const E=F(u).split(/\r?\n/);if(A>E.length){return}return generateLineNumbers(A,(y=p.around)!==null&&y!==void 0?y:3).filter((u=>E[u-1]!==undefined)).map((u=>({line:u,value:E[u-1]})))};const R=codeExcerpt;var _=p(1140);var P=p(4882);const cleanupPath=u=>u?.replace(`file://${(0,E.cwd)()}/`,"");const O=new Q({cwd:(0,E.cwd)(),internals:Q.nodeInternals()});function ErrorOverview({error:u}){const A=u.stack?u.stack.split("\n").slice(1):undefined;const p=A?O.parseLine(A[0]):undefined;const y=cleanupPath(p?.file);let E;let I=0;if(y&&p?.line&&k.existsSync(y)){const u=k.readFileSync(y,"utf8");E=R(u,p.line);if(E){for(const{line:u}of E){I=Math.max(I,String(u).length)}}}return C.createElement(_.A,{flexDirection:"column",padding:1},C.createElement(_.A,null,C.createElement(P.A,{backgroundColor:"red",color:"white"}," ","ERROR"," "),C.createElement(P.A,null," ",u.message)),p&&y&&C.createElement(_.A,{marginTop:1},C.createElement(P.A,{dimColor:true},y,":",p.line,":",p.column)),p&&E&&C.createElement(_.A,{marginTop:1,flexDirection:"column"},E.map((({line:u,value:A})=>C.createElement(_.A,{key:u},C.createElement(_.A,{width:I+1},C.createElement(P.A,{dimColor:u!==p.line,backgroundColor:u===p.line?"red":undefined,color:u===p.line?"white":undefined,"aria-label":u===p.line?`Line ${u}, error`:`Line ${u}`},String(u).padStart(I," "),":")),C.createElement(P.A,{key:u,backgroundColor:u===p.line?"red":undefined,color:u===p.line?"white":undefined}," "+A))))),u.stack&&C.createElement(_.A,{marginTop:1,flexDirection:"column"},u.stack.split("\n").slice(1).map((u=>{const A=O.parseLine(u);if(!A){return C.createElement(_.A,{key:u},C.createElement(P.A,{dimColor:true},"- "),C.createElement(P.A,{dimColor:true,bold:true},u,"\\t"," "))}return C.createElement(_.A,{key:u},C.createElement(P.A,{dimColor:true},"- "),C.createElement(P.A,{dimColor:true,bold:true},A.function),C.createElement(P.A,{dimColor:true,color:"gray","aria-label":`at ${cleanupPath(A.file)??""} line ${A.line} column ${A.column}`}," ","(",cleanupPath(A.file)??"",":",A.line,":",A.column,")"))}))))}const U="\t";const H="";const G="";class App extends C.PureComponent{static displayName="InternalApp";static getDerivedStateFromError(u){return{error:u}}state={isFocusEnabled:true,activeFocusId:undefined,focusables:[],error:undefined};rawModeEnabledCount=0;internal_eventEmitter=new y.EventEmitter;isRawModeSupported(){return this.props.stdin.isTTY}render(){return C.createElement(w.A.Provider,{value:{exit:this.handleExit}},C.createElement(v.A.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC,internal_eventEmitter:this.internal_eventEmitter}},C.createElement(B.A.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},C.createElement(S.A.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},C.createElement(D.A.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?C.createElement(ErrorOverview,{error:this.state.error}):this.props.children)))))}componentDidMount(){I.A.hide(this.props.stdout)}componentWillUnmount(){I.A.show(this.props.stdout);if(this.isRawModeSupported()){this.handleSetRawMode(false)}}componentDidCatch(u){this.handleExit(u)}handleSetRawMode=u=>{const{stdin:A}=this.props;if(!this.isRawModeSupported()){if(A===E.stdin){throw new Error("Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported")}else{throw new Error("Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported")}}A.setEncoding("utf8");if(u){if(this.rawModeEnabledCount===0){A.ref();A.setRawMode(true);A.addListener("readable",this.handleReadable)}this.rawModeEnabledCount++;return}if(--this.rawModeEnabledCount===0){A.setRawMode(false);A.removeListener("readable",this.handleReadable);A.unref()}};handleReadable=()=>{let u;while((u=this.props.stdin.read())!==null){this.handleInput(u);this.internal_eventEmitter.emit("input",u)}};handleInput=u=>{if(u===""&&this.props.exitOnCtrlC){this.handleExit()}if(u===G&&this.state.activeFocusId){this.setState({activeFocusId:undefined})}if(this.state.isFocusEnabled&&this.state.focusables.length>0){if(u===U){this.focusNext()}if(u===H){this.focusPrevious()}}};handleExit=u=>{if(this.isRawModeSupported()){this.handleSetRawMode(false)}this.props.onExit(u)};enableFocus=()=>{this.setState({isFocusEnabled:true})};disableFocus=()=>{this.setState({isFocusEnabled:false})};focus=u=>{this.setState((A=>{const p=A.focusables.some((A=>A?.id===u));if(!p){return A}return{activeFocusId:u}}))};focusNext=()=>{this.setState((u=>{const A=u.focusables.find((u=>u.isActive))?.id;const p=this.findNextFocusable(u);return{activeFocusId:p??A}}))};focusPrevious=()=>{this.setState((u=>{const A=u.focusables.findLast((u=>u.isActive))?.id;const p=this.findPreviousFocusable(u);return{activeFocusId:p??A}}))};addFocusable=(u,{autoFocus:A})=>{this.setState((p=>{let y=p.activeFocusId;if(!y&&A){y=u}return{activeFocusId:y,focusables:[...p.focusables,{id:u,isActive:true}]}}))};removeFocusable=u=>{this.setState((A=>({activeFocusId:A.activeFocusId===u?undefined:A.activeFocusId,focusables:A.focusables.filter((A=>A.id!==u))})))};activateFocusable=u=>{this.setState((A=>({focusables:A.focusables.map((A=>{if(A.id!==u){return A}return{id:u,isActive:true}}))})))};deactivateFocusable=u=>{this.setState((A=>({activeFocusId:A.activeFocusId===u?undefined:A.activeFocusId,focusables:A.focusables.map((A=>{if(A.id!==u){return A}return{id:u,isActive:false}}))})))};findNextFocusable=u=>{const A=u.focusables.findIndex((A=>A.id===u.activeFocusId));for(let p=A+1;p<u.focusables.length;p++){const A=u.focusables[p];if(A?.isActive){return A.id}}return undefined};findPreviousFocusable=u=>{const A=u.focusables.findIndex((A=>A.id===u.activeFocusId));for(let p=A-1;p>=0;p--){const A=u.focusables[p];if(A?.isActive){return A.id}}return undefined}}},8023:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(3102);const E=(0,y.createContext)({exit(){}});E.displayName="InternalAppContext";const C=E},9806:(u,A,p)=>{p.d(A,{U:()=>E});var y=p(3102);const E=(0,y.createContext)(undefined)},1140:(u,A,p)=>{p.d(A,{A:()=>w});var y=p(3102);var E=p(7470);var C=p(9806);const I=(0,y.forwardRef)((({children:u,backgroundColor:A,"aria-label":p,"aria-hidden":I,"aria-role":w,"aria-state":v,...B},S)=>{const{isScreenReaderEnabled:D}=(0,y.useContext)(E.E);const k=p?y.createElement("ink-text",null,p):undefined;if(D&&I){return null}const Q=y.createElement("ink-box",{ref:S,style:{flexWrap:"nowrap",flexDirection:"row",flexGrow:0,flexShrink:1,...B,backgroundColor:A,overflowX:B.overflowX??B.overflow??"visible",overflowY:B.overflowY??B.overflow??"visible"},internal_accessibility:{role:w,state:v}},D&&k?k:u);if(A){return y.createElement(C.U.Provider,{value:A},Q)}return Q}));I.displayName="Box";const w=I},6978:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(3102);const E=(0,y.createContext)({activeId:undefined,add(){},remove(){},activate(){},deactivate(){},enableFocus(){},disableFocus(){},focusNext(){},focusPrevious(){},focus(){}});E.displayName="InternalFocusContext";const C=E},409:(u,A,p)=>{var y=p(3102);function Newline({count:u=1}){return React.createElement("ink-text",null,"\n".repeat(u))}},8701:(u,A,p)=>{var y=p(3102);var E=p(1140);function Spacer(){return React.createElement(Box,{flexGrow:1})}},4135:(u,A,p)=>{p.d(A,{A:()=>Static});var y=p(3102);function Static(u){const{items:A,children:p,style:E}=u;const[C,I]=(0,y.useState)(0);const w=(0,y.useMemo)((()=>A.slice(C)),[A,C]);(0,y.useLayoutEffect)((()=>{I(A.length)}),[A.length]);const v=w.map(((u,A)=>p(u,C+A)));const B=(0,y.useMemo)((()=>({position:"absolute",flexDirection:"column",...E})),[E]);return y.createElement("ink-box",{internal_static:true,style:B},v)}},9834:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(1708);var E=p(3102);const C=(0,E.createContext)({stderr:y.stderr,write(){}});C.displayName="InternalStderrContext";const I=C},2608:(u,A,p)=>{p.d(A,{A:()=>w});var y=p(8474);var E=p(1708);var C=p(3102);const I=(0,C.createContext)({stdin:E.stdin,internal_eventEmitter:new y.EventEmitter,setRawMode(){},isRawModeSupported:false,internal_exitOnCtrlC:true});I.displayName="InternalStdinContext";const w=I},4371:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(1708);var E=p(3102);const C=(0,E.createContext)({stdout:y.stdout,write(){}});C.displayName="InternalStdoutContext";const I=C},4882:(u,A,p)=>{p.d(A,{A:()=>Text});var y=p(3102);var E=p(9611);var C=p(4493);var I=p(7470);var w=p(9806);function Text({color:u,backgroundColor:A,dimColor:p=false,bold:v=false,italic:B=false,underline:S=false,strikethrough:D=false,inverse:k=false,wrap:Q="wrap",children:F,"aria-label":R,"aria-hidden":_=false}){const{isScreenReaderEnabled:P}=(0,y.useContext)(I.E);const O=(0,y.useContext)(w.U);const U=P&&R?R:F;if(U===undefined||U===null){return null}const transform=y=>{if(p){y=E.Ay.dim(y)}if(u){y=(0,C.A)(y,u,"foreground")}const I=A??O;if(I){y=(0,C.A)(y,I,"background")}if(v){y=E.Ay.bold(y)}if(B){y=E.Ay.italic(y)}if(S){y=E.Ay.underline(y)}if(D){y=E.Ay.strikethrough(y)}if(k){y=E.Ay.inverse(y)}return y};if(P&&_){return null}return y.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row",textWrap:Q},internal_transform:transform},P&&R?R:F)}},7829:(u,A,p)=>{var y=p(3102);var E=p(7470);function Transform({children:u,transform:A,accessibilityLabel:p}){const{isScreenReaderEnabled:y}=useContext(accessibilityContext);if(u===undefined||u===null){return null}return React.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:A},y&&p?p:u)}},7920:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{Bq:()=>setAttribute,Mq:()=>createTextNode,RM:()=>createNode,V6:()=>appendChildNode,V8:()=>removeChildNode,bC:()=>insertBeforeNode,eC:()=>setStyle,x6:()=>setTextNodeValue});var E=p(9466);var C=p(9670);var I=p(7389);var w=p(6503);var v=u([E]);E=(v.then?(await v)():v)[0];const createNode=u=>{const A={nodeName:u,style:{},attributes:{},childNodes:[],parentNode:undefined,yogaNode:u==="ink-virtual-text"?undefined:E.Ay.Node.create(),internal_accessibility:{}};if(u==="ink-text"){A.yogaNode?.setMeasureFunc(measureTextNode.bind(null,A))}return A};const appendChildNode=(u,A)=>{if(A.parentNode){removeChildNode(A.parentNode,A)}A.parentNode=u;u.childNodes.push(A);if(A.yogaNode){u.yogaNode?.insertChild(A.yogaNode,u.yogaNode.getChildCount())}if(u.nodeName==="ink-text"||u.nodeName==="ink-virtual-text"){markNodeAsDirty(u)}};const insertBeforeNode=(u,A,p)=>{if(A.parentNode){removeChildNode(A.parentNode,A)}A.parentNode=u;const y=u.childNodes.indexOf(p);if(y>=0){u.childNodes.splice(y,0,A);if(A.yogaNode){u.yogaNode?.insertChild(A.yogaNode,y)}return}u.childNodes.push(A);if(A.yogaNode){u.yogaNode?.insertChild(A.yogaNode,u.yogaNode.getChildCount())}if(u.nodeName==="ink-text"||u.nodeName==="ink-virtual-text"){markNodeAsDirty(u)}};const removeChildNode=(u,A)=>{if(A.yogaNode){A.parentNode?.yogaNode?.removeChild(A.yogaNode)}A.parentNode=undefined;const p=u.childNodes.indexOf(A);if(p>=0){u.childNodes.splice(p,1)}if(u.nodeName==="ink-text"||u.nodeName==="ink-virtual-text"){markNodeAsDirty(u)}};const setAttribute=(u,A,p)=>{if(A==="internal_accessibility"){u.internal_accessibility=p;return}u.attributes[A]=p};const setStyle=(u,A)=>{u.style=A};const createTextNode=u=>{const A={nodeName:"#text",nodeValue:u,yogaNode:undefined,parentNode:undefined,style:{}};setTextNodeValue(A,u);return A};const measureTextNode=function(u,A){const p=u.nodeName==="#text"?u.nodeValue:(0,w.A)(u);const y=(0,C.A)(p);if(y.width<=A){return y}if(y.width>=1&&A>0&&A<1){return y}const E=u.style?.textWrap??"wrap";const v=(0,I.A)(p,A,E);return(0,C.A)(v)};const findClosestYogaNode=u=>{if(!u?.parentNode){return undefined}return u.yogaNode??findClosestYogaNode(u.parentNode)};const markNodeAsDirty=u=>{const A=findClosestYogaNode(u);A?.markDirty()};const setTextNodeValue=(u,A)=>{if(typeof A!=="string"){A=String(A)}u.nodeValue=A;markNodeAsDirty(u)};y()}catch(u){y(u)}}))},3618:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>I});var E=p(9466);var C=u([E]);E=(C.then?(await C)():C)[0];const getMaxWidth=u=>u.getComputedWidth()-u.getComputedPadding(E.Ay.EDGE_LEFT)-u.getComputedPadding(E.Ay.EDGE_RIGHT)-u.getComputedBorder(E.Ay.EDGE_LEFT)-u.getComputedBorder(E.Ay.EDGE_RIGHT);const I=getMaxWidth;y()}catch(u){y(u)}}))},2062:(u,A,p)=>{var y=p(3102);var E=p(8023);const useApp=()=>useContext(AppContext);var C=null&&useApp},5235:(u,A,p)=>{var y=p(3102);var E=p(6978);const useFocusManager=()=>{const u=useContext(FocusContext);return{enableFocus:u.enableFocus,disableFocus:u.disableFocus,focusNext:u.focusNext,focusPrevious:u.focusPrevious,focus:u.focus}};var C=null&&useFocusManager},5845:(u,A,p)=>{var y=p(3102);var E=p(6978);var C=p(1123);const useFocus=({isActive:u=true,autoFocus:A=false,id:p}={})=>{const{isRawModeSupported:y,setRawMode:E}=useStdin();const{activeId:C,add:I,remove:w,activate:v,deactivate:B,focus:S}=useContext(FocusContext);const D=useMemo((()=>p??Math.random().toString().slice(2,7)),[p]);useEffect((()=>{I(D,{autoFocus:A});return()=>{w(D)}}),[D,A]);useEffect((()=>{if(u){v(D)}else{B(D)}}),[u,D]);useEffect((()=>{if(!y||!u){return}E(true);return()=>{E(false)}}),[u]);return{isFocused:Boolean(D)&&C===D,focus:S}};var I=null&&useFocus},2309:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>B});var E=p(3102);var C=p(5394);var I=p(2612);var w=p(1123);var v=u([I]);I=(v.then?(await v)():v)[0];const useInput=(u,A={})=>{const{stdin:p,setRawMode:y,internal_exitOnCtrlC:v,internal_eventEmitter:B}=(0,w.A)();(0,E.useEffect)((()=>{if(A.isActive===false){return}y(true);return()=>{y(false)}}),[A.isActive,y]);(0,E.useEffect)((()=>{if(A.isActive===false){return}const handleData=A=>{const p=(0,C.A)(A);const y={upArrow:p.name==="up",downArrow:p.name==="down",leftArrow:p.name==="left",rightArrow:p.name==="right",pageDown:p.name==="pagedown",pageUp:p.name==="pageup",home:p.name==="home",end:p.name==="end",return:p.name==="return",escape:p.name==="escape",ctrl:p.ctrl,shift:p.shift,tab:p.name==="tab",backspace:p.name==="backspace",delete:p.name==="delete",meta:p.meta||p.name==="escape"||p.option};let E=p.ctrl?p.name:p.sequence;if(C.f.includes(p.name)){E=""}if(E.startsWith("")){E=E.slice(1)}if(E.length===1&&typeof E[0]==="string"&&/[A-Z]/.test(E[0])){y.shift=true}if(!(E==="c"&&y.ctrl)||!v){I.A.batchedUpdates((()=>{u(E,y)}))}};B?.on("input",handleData);return()=>{B?.removeListener("input",handleData)}}),[A.isActive,p,v,u])};const B=useInput;y()}catch(u){y(u)}}))},5728:(u,A,p)=>{var y=p(3102);var E=p(7470);const useIsScreenReaderEnabled=()=>{const{isScreenReaderEnabled:u}=useContext(accessibilityContext);return u};var C=null&&useIsScreenReaderEnabled},2693:(u,A,p)=>{var y=p(3102);var E=p(9834);const useStderr=()=>useContext(StderrContext);var C=null&&useStderr},1123:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(3102);var E=p(2608);const useStdin=()=>(0,y.useContext)(E.A);const C=useStdin},90:(u,A,p)=>{var y=p(3102);var E=p(4371);const useStdout=()=>useContext(StdoutContext);var C=null&&useStdout},5184:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{EY:()=>I.A,Ge:()=>D.A,XX:()=>E.A,az:()=>C.A,jC:()=>w.A});var E=p(5406);var C=p(1140);var I=p(4882);var w=p(4135);var v=p(7829);var B=p(409);var S=p(8701);var D=p(2309);var k=p(2062);var Q=p(1123);var F=p(90);var R=p(2693);var _=p(5845);var P=p(5235);var O=p(5728);var U=u([E,D]);[E,D]=U.then?(await U)():U;y()}catch(u){y(u)}}))},7676:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>Ink});var E=p(1708);var C=p(3102);var I=p(9966);var w=p(750);var v=p(5306);var B=p(1690);var S=p(7417);var D=p(2651);var k=p(6225);var Q=p(9466);var F=p(3335);var R=p(2612);var _=p(2081);var P=p(7920);var O=p(9350);var U=p(1840);var H=p(5076);var G=p(7470);var j=u([Q,R,_,P]);[Q,R,_,P]=j.then?(await j)():j;const noop=()=>{};class Ink{options;log;throttledLog;isScreenReaderEnabled;isUnmounted;lastOutput;lastOutputHeight;lastTerminalWidth;container;rootNode;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;constructor(u){(0,B.A)(this);this.options=u;this.rootNode=P.RM("ink-root");this.rootNode.onComputeLayout=this.calculateLayout;this.isScreenReaderEnabled=u.isScreenReaderEnabled??E.env["INK_SCREEN_READER"]==="true";const A=u.debug||this.isScreenReaderEnabled;const p=u.maxFps??30;const y=p>0?Math.max(1,Math.ceil(1e3/p)):0;this.rootNode.onRender=A?this.onRender:(0,I.n)(this.onRender,y,{leading:true,trailing:true});this.rootNode.onImmediateRender=this.onRender;this.log=O.A.create(u.stdout,{incremental:u.incrementalRendering});this.throttledLog=A?this.log:(0,I.n)(this.log,undefined,{leading:true,trailing:true});this.isUnmounted=false;this.lastOutput="";this.lastOutputHeight=0;this.lastTerminalWidth=this.getTerminalWidth();this.fullStaticOutput="";this.container=R.A.createContainer(this.rootNode,k.LegacyRoot,null,false,null,"id",(()=>{}),(()=>{}),(()=>{}),(()=>{}),null);this.unsubscribeExit=S(this.unmount,{alwaysLast:false});if(E.env["DEV"]==="true"){R.A.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"})}if(u.patchConsole){this.patchConsole()}if(!v.A){u.stdout.on("resize",this.resized);this.unsubscribeResize=()=>{u.stdout.off("resize",this.resized)}}}getTerminalWidth=()=>this.options.stdout.columns||80;resized=()=>{const u=this.getTerminalWidth();if(u<this.lastTerminalWidth){this.log.clear();this.lastOutput=""}this.calculateLayout();this.onRender();this.lastTerminalWidth=u};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{const u=this.getTerminalWidth();this.rootNode.yogaNode.setWidth(u);this.rootNode.yogaNode.calculateLayout(undefined,undefined,Q.Ay.DIRECTION_LTR)};onRender=()=>{if(this.isUnmounted){return}const u=performance.now();const{output:A,outputHeight:p,staticOutput:y}=(0,_.A)(this.rootNode,this.isScreenReaderEnabled);this.options.onRender?.({renderTime:performance.now()-u});const E=y&&y!=="\n";if(this.options.debug){if(E){this.fullStaticOutput+=y}this.options.stdout.write(this.fullStaticOutput+A);return}if(v.A){if(E){this.options.stdout.write(y)}this.lastOutput=A;this.lastOutputHeight=p;return}if(this.isScreenReaderEnabled){if(E){const u=this.lastOutputHeight>0?w._W(this.lastOutputHeight):"";this.options.stdout.write(u+y);this.lastOutputHeight=0}if(A===this.lastOutput&&!E){return}const u=this.options.stdout.columns||80;const p=(0,F.A)(A,u,{trim:false,hard:true});if(E){this.options.stdout.write(p)}else{const u=this.lastOutputHeight>0?w._W(this.lastOutputHeight):"";this.options.stdout.write(u+p)}this.lastOutput=A;this.lastOutputHeight=p===""?0:p.split("\n").length;return}if(E){this.fullStaticOutput+=y}if(this.lastOutputHeight>=this.options.stdout.rows){this.options.stdout.write(w.Ik+this.fullStaticOutput+A);this.lastOutput=A;this.lastOutputHeight=p;this.log.sync(A);return}if(E){this.log.clear();this.options.stdout.write(y);this.log(A)}if(!E&&A!==this.lastOutput){this.throttledLog(A)}this.lastOutput=A;this.lastOutputHeight=p};render(u){const A=C.createElement(G.E.Provider,{value:{isScreenReaderEnabled:this.isScreenReaderEnabled}},C.createElement(H.A,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},u));R.A.updateContainerSync(A,this.container,null,noop);R.A.flushSyncWork()}writeToStdout(u){if(this.isUnmounted){return}if(this.options.debug){this.options.stdout.write(u+this.fullStaticOutput+this.lastOutput);return}if(v.A){this.options.stdout.write(u);return}this.log.clear();this.options.stdout.write(u);this.log(this.lastOutput)}writeToStderr(u){if(this.isUnmounted){return}if(this.options.debug){this.options.stderr.write(u);this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(v.A){this.options.stderr.write(u);return}this.log.clear();this.options.stderr.write(u);this.log(this.lastOutput)}unmount(u){if(this.isUnmounted){return}this.calculateLayout();this.onRender();this.unsubscribeExit();if(typeof this.restoreConsole==="function"){this.restoreConsole()}if(typeof this.unsubscribeResize==="function"){this.unsubscribeResize()}if(v.A){this.options.stdout.write(this.lastOutput+"\n")}else if(!this.options.debug){this.log.done()}this.isUnmounted=true;R.A.updateContainerSync(null,this.container,null,noop);R.A.flushSyncWork();U.A.delete(this.options.stdout);if(u instanceof Error){this.rejectExitPromise(u)}else{this.resolveExitPromise()}}async waitUntilExit(){this.exitPromise||=new Promise(((u,A)=>{this.resolveExitPromise=u;this.rejectExitPromise=A}));return this.exitPromise}clear(){if(!v.A&&!this.options.debug){this.log.clear()}}patchConsole(){if(this.options.debug){return}this.restoreConsole=(0,D.A)(((u,A)=>{if(u==="stdout"){this.writeToStdout(A)}if(u==="stderr"){const u=A.startsWith("The above error occurred");if(!u){this.writeToStderr(A)}}}))}}y()}catch(u){y(u)}}))},1840:(u,A,p)=>{p.d(A,{A:()=>E});const y=new WeakMap;const E=y},9350:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(750);var E=p(7078);const createStandard=(u,{showCursor:A=false}={})=>{let p=0;let C="";let I=false;const render=w=>{if(!A&&!I){E.A.hide();I=true}const v=w+"\n";if(v===C){return}C=v;u.write(y._W(p)+v);p=v.split("\n").length};render.clear=()=>{u.write(y._W(p));C="";p=0};render.done=()=>{C="";p=0;if(!A){E.A.show();I=false}};render.sync=u=>{const A=u+"\n";C=A;p=A.split("\n").length};return render};const createIncremental=(u,{showCursor:A=false}={})=>{let p=[];let C="";let I=false;const render=w=>{if(!A&&!I){E.A.hide();I=true}const v=w+"\n";if(v===C){return}const B=p.length;const S=v.split("\n");const D=S.length;const k=D-1;if(v==="\n"||C.length===0){u.write(y._W(B)+v);C=v;p=S;return}const Q=[];if(D<B){Q.push(y._W(B-D+1),y.eh(k))}else{Q.push(y.eh(B-1))}for(let u=0;u<k;u++){if(S[u]===p[u]){Q.push(y.Ku);continue}Q.push(y.CR(0)+S[u]+y.Sc+"\n")}u.write(Q.join(""));C=v;p=S};render.clear=()=>{u.write(y._W(p.length));C="";p=[]};render.done=()=>{C="";p=[];if(!A){E.A.show();I=false}};render.sync=u=>{const A=u+"\n";C=A;p=A.split("\n")};return render};const create=(u,{showCursor:A=false,incremental:p=false}={})=>{if(p){return createIncremental(u,{showCursor:A})}return createStandard(u,{showCursor:A})};const C={create:create};const I=C},9670:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(2511);const E=new Map;const measureText=u=>{if(u.length===0){return{width:0,height:0}}const A=E.get(u);if(A){return A}const p=(0,y.A)(u);const C=u.split("\n").length;const I={width:p,height:C};E.set(u,I);return I};const C=measureText},4479:(u,A,p)=>{p.d(A,{A:()=>Output});var y=p(316);var E=p(9767);var C=p(2511);var I=p(651);const w=new Set([27,155]);const v="[".codePointAt(0);const B="]".codePointAt(0);const S=new Set;const D=new Map;for(const[u,A]of I.Ay.codes){S.add(I.Ay.color.ansi(A));D.set(I.Ay.color.ansi(u),I.Ay.color.ansi(A))}const k="]8;;";const Q=k.split("").map((u=>u.charCodeAt(0)));const F="";const R=F.charCodeAt(0);const _=`]8;;${F}`;function getLinkStartCode(u){return`${k}${u}${F}`}function getEndCode(u){if(S.has(u))return u;if(D.has(u))return D.get(u);if(u.startsWith(k))return _;u=u.slice(2);if(u.startsWith("38")){return I.Ay.color.close}else if(u.startsWith("48")){return I.Ay.bgColor.close}const A=I.Ay.codes.get(parseInt(u,10));if(A){return I.Ay.color.ansi(A)}else{return I.Ay.reset.open}}function ansiCodesToString(u){const A=new Set(u.map((u=>u.code)));return[...A].join("")}function isIntensityCode(u){return u.code===I.Ay.bold.open||u.code===I.Ay.dim.open}function reduceAnsiCodes(u){return reduceAnsiCodesIncremental([],u)}function reduceAnsiCodesIncremental(u,A){let p=[...u];for(const u of A){if(u.code===I.Ay.reset.open){p=[]}else if(S.has(u.code)){p=p.filter((A=>A.endCode!==u.code))}else{if(isIntensityCode(u)){if(!p.find((A=>A.code===u.code&&A.endCode===u.endCode))){p.push(u)}}else{p=p.filter((A=>A.endCode!==u.endCode));p.push(u)}}}return p}function undoAnsiCodes(u){return reduceAnsiCodes(u).reverse().map((u=>({...u,code:u.endCode})))}function diffAnsiCodes(u,A){const p=new Set(A.map((u=>u.endCode)));const y=new Set(A.map((u=>u.code)));const E=new Set(u.map((u=>u.code)));return[...undoAnsiCodes(u.filter((u=>{if(isIntensityCode(u)){return!y.has(u.code)}return!p.has(u.endCode)}))),...A.filter((u=>!E.has(u.code)))]}function styledCharsFromTokens(u){let A=[];const p=[];for(const y of u){if(y.type==="ansi"){A=reduceAnsiCodesIncremental(A,[y])}else if(y.type==="char"){p.push({...y,styles:[...A]})}}return p}function styledCharsToString(u){let A="";for(let p=0;p<u.length;p++){const y=u[p];if(p===0){A+=ansiCodesToString(y.styles)}else{A+=ansiCodesToString(diffAnsiCodes(u[p-1].styles,y.styles))}A+=y.value;if(p===u.length-1){A+=ansiCodesToString(diffAnsiCodes(y.styles,[]))}}return A}var P=p(182);function parseLinkCode(u,A){u=u.slice(A);for(let A=1;A<Q.length;A++){if(u.charCodeAt(A)!==Q[A]){return undefined}}const p=u.indexOf("",k.length);if(p===-1)return undefined;return u.slice(0,p+1)}const O="0".charCodeAt(0);const U="9".charCodeAt(0);const H=";".charCodeAt(0);const G="m".charCodeAt(0);function findSGRSequenceEndIndex(u){for(let A=2;A<u.length;A++){const p=u.charCodeAt(A);if(p===G)return A;if(p===H)continue;if(p>=O&&p<=U)continue;break}return-1}function parseSGRSequence(u,A){u=u.slice(A);const p=findSGRSequenceEndIndex(u);if(p===-1)return;return u.slice(0,p+1)}function splitCompoundSGRSequences(u){if(!u.includes(";")){return[u]}const A=u.slice(2,-1).split(";");const p=[];for(let u=0;u<A.length;u++){const y=A[u];if(y==="38"||y==="48"){if(u+2<A.length&&A[u+1]==="5"){p.push(A.slice(u,u+3).join(";"));u+=2;continue}else if(u+4<A.length&&A[u+1]==="2"){p.push(A.slice(u,u+5).join(";"));u+=4;continue}}p.push(y)}return p.map((u=>`[${u}m`))}function tokenize(u,A=Number.POSITIVE_INFINITY){const p=[];let y=0;let E=0;while(y<u.length){const C=u.codePointAt(y);if(w.has(C)){let A;const E=u.codePointAt(y+1);if(E===B){A=parseLinkCode(u,y);if(A){p.push({type:"ansi",code:A,endCode:getEndCode(A)})}}else if(E===v){A=parseSGRSequence(u,y);if(A){const u=splitCompoundSGRSequences(A);for(const A of u){p.push({type:"ansi",code:A,endCode:getEndCode(A)})}}}if(A){y+=A.length;continue}}const I=(0,P.A)(C);const S=String.fromCodePoint(C);p.push({type:"char",value:S,fullWidth:I});y+=S.length;E+=I?2:S.length;if(E>=A){break}}return p}class Output{width;height;operations=[];constructor(u){const{width:A,height:p}=u;this.width=A;this.height=p}write(u,A,p,y){const{transformers:E}=y;if(!p){return}this.operations.push({type:"write",x:u,y:A,text:p,transformers:E})}clip(u){this.operations.push({type:"clip",clip:u})}unclip(){this.operations.push({type:"unclip"})}get(){const u=[];for(let A=0;A<this.height;A++){const A=[];for(let u=0;u<this.width;u++){A.push({type:"char",value:" ",fullWidth:false,styles:[]})}u.push(A)}const A=[];for(const p of this.operations){if(p.type==="clip"){A.push(p.clip)}if(p.type==="unclip"){A.pop()}if(p.type==="write"){const{text:I,transformers:w}=p;let{x:v,y:B}=p;let S=I.split("\n");const D=A.at(-1);if(D){const u=typeof D?.x1==="number"&&typeof D?.x2==="number";const A=typeof D?.y1==="number"&&typeof D?.y2==="number";if(u){const u=(0,C.A)(I);if(v+u<D.x1||v>D.x2){continue}}if(A){const u=S.length;if(B+u<D.y1||B>D.y2){continue}}if(u){S=S.map((u=>{const A=v<D.x1?D.x1-v:0;const p=(0,E.A)(u);const C=v+p>D.x2?D.x2-v:p;return(0,y.A)(u,A,C)}));if(v<D.x1){v=D.x1}}if(A){const u=B<D.y1?D.y1-B:0;const A=S.length;const p=B+A>D.y2?D.y2-B:A;S=S.slice(u,p);if(B<D.y1){B=D.y1}}}let k=0;for(let[A,p]of S.entries()){const y=u[B+k];if(!y){continue}for(const u of w){p=u(p,A)}const C=styledCharsFromTokens(tokenize(p));let I=v;for(const u of C){y[I]=u;const A=Math.max(1,(0,E.A)(u.value));if(A>1){for(let p=1;p<A;p++){y[I+p]={type:"char",value:"",fullWidth:false,styles:u.styles}}}I+=A}k++}}}const p=u.map((u=>{const A=u.filter((u=>u!==undefined));return styledCharsToString(A).trimEnd()})).join("\n");return{output:p,height:u.length}}}},5394:(u,A,p)=>{p.d(A,{A:()=>v,f:()=>w});var y=p(4573);const E=/^(?:\x1b)([a-zA-Z0-9])$/;const C=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;const I={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};const w=[...Object.values(I),"backspace"];const isShiftKey=u=>["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(u);const isCtrlKey=u=>["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(u);const parseKeypress=(u="")=>{let A;if(y.Buffer.isBuffer(u)){if(u[0]>127&&u[1]===undefined){u[0]-=128;u=""+String(u)}else{u=String(u)}}else if(u!==undefined&&typeof u!=="string"){u=String(u)}else if(!u){u=""}const p={name:"",ctrl:false,meta:false,shift:false,option:false,sequence:u,raw:u};p.sequence=p.sequence||u||p.name;if(u==="\r"){p.raw=undefined;p.name="return"}else if(u==="\n"){p.name="enter"}else if(u==="\t"){p.name="tab"}else if(u==="\b"||u==="\b"){p.name="backspace";p.meta=u.charAt(0)===""}else if(u===""||u===""){p.name="delete";p.meta=u.charAt(0)===""}else if(u===""||u===""){p.name="escape";p.meta=u.length===2}else if(u===" "||u===" "){p.name="space";p.meta=u.length===2}else if(u.length===1&&u<=""){p.name=String.fromCharCode(u.charCodeAt(0)+"a".charCodeAt(0)-1);p.ctrl=true}else if(u.length===1&&u>="0"&&u<="9"){p.name="number"}else if(u.length===1&&u>="a"&&u<="z"){p.name=u}else if(u.length===1&&u>="A"&&u<="Z"){p.name=u.toLowerCase();p.shift=true}else if(A=E.exec(u)){p.meta=true;p.shift=/^[A-Z]$/.test(A[1])}else if(A=C.exec(u)){const y=[...u];if(y[0]===""&&y[1]===""){p.option=true}const E=[A[1],A[2],A[4],A[6]].filter(Boolean).join("");const C=(A[3]||A[5]||1)-1;p.ctrl=!!(C&4);p.meta=!!(C&10);p.shift=!!(C&1);p.code=E;p.name=I[E];p.shift=isShiftKey(E)||p.shift;p.ctrl=isCtrlKey(E)||p.ctrl}return p};const v=parseKeypress},2612:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>F});var E=p(1708);var C=p(5228);var I=p(6225);var w=p(9466);var v=p(3102);var B=p(7920);var S=p(9892);var D=u([w,B,S]);[w,B,S]=D.then?(await D)():D;if(E.env["DEV"]==="true"){try{await p.e(194).then(p.bind(p,1194))}catch(u){if(u.code==="ERR_MODULE_NOT_FOUND"){console.warn(`\nThe environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`,\nbut this failed as it was not installed. Debugging with React Devtools requires it.\n\nTo install use this command:\n\n$ npm install --save-dev react-devtools-core\n\t\t\t\t`.trim()+"\n")}else{throw u}}}const diff=(u,A)=>{if(u===A){return}if(!u){return A}const p={};let y=false;for(const E of Object.keys(u)){const u=A?!Object.hasOwn(A,E):true;if(u){p[E]=undefined;y=true}}if(A){for(const E of Object.keys(A)){if(A[E]!==u[E]){p[E]=A[E];y=true}}}return y?p:undefined};const cleanupYogaNode=u=>{u?.unsetMeasureFunc();u?.freeRecursive()};let k=I.NoEventPriority;let Q;const F=C({getRootHostContext:()=>({isInsideText:false}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>false,resetAfterCommit(u){if(typeof u.onComputeLayout==="function"){u.onComputeLayout()}if(u.isStaticDirty){u.isStaticDirty=false;if(typeof u.onImmediateRender==="function"){u.onImmediateRender()}return}if(typeof u.onRender==="function"){u.onRender()}},getChildHostContext(u,A){const p=u.isInsideText;const y=A==="ink-text"||A==="ink-virtual-text";if(p===y){return u}return{isInsideText:y}},shouldSetTextContent:()=>false,createInstance(u,A,p,y){if(y.isInsideText&&u==="ink-box"){throw new Error(`<Box> can’t be nested inside <Text> component`)}const E=u==="ink-text"&&y.isInsideText?"ink-virtual-text":u;const C=(0,B.RM)(E);for(const[u,y]of Object.entries(A)){if(u==="children"){continue}if(u==="style"){(0,B.eC)(C,y);if(C.yogaNode){(0,S.A)(C.yogaNode,y)}continue}if(u==="internal_transform"){C.internal_transform=y;continue}if(u==="internal_static"){Q=p;C.internal_static=true;p.isStaticDirty=true;p.staticNode=C;continue}(0,B.Bq)(C,u,y)}return C},createTextInstance(u,A,p){if(!p.isInsideText){throw new Error(`Text string "${u}" must be rendered inside <Text> component`)}return(0,B.Mq)(u)},resetTextContent(){},hideTextInstance(u){(0,B.x6)(u,"")},unhideTextInstance(u,A){(0,B.x6)(u,A)},getPublicInstance:u=>u,hideInstance(u){u.yogaNode?.setDisplay(w.Ay.DISPLAY_NONE)},unhideInstance(u){u.yogaNode?.setDisplay(w.Ay.DISPLAY_FLEX)},appendInitialChild:B.V6,appendChild:B.V6,insertBefore:B.bC,finalizeInitialChildren(){return false},isPrimaryRenderer:true,supportsMutation:true,supportsPersistence:false,supportsHydration:false,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:B.V6,insertInContainerBefore:B.bC,removeChildFromContainer(u,A){(0,B.V8)(u,A);cleanupYogaNode(A.yogaNode)},commitUpdate(u,A,p,y){if(Q&&u.internal_static){Q.isStaticDirty=true}const E=diff(p,y);const C=diff(p["style"],y["style"]);if(!E&&!C){return}if(E){for(const[A,p]of Object.entries(E)){if(A==="style"){(0,B.eC)(u,p);continue}if(A==="internal_transform"){u.internal_transform=p;continue}if(A==="internal_static"){u.internal_static=true;continue}(0,B.Bq)(u,A,p)}}if(C&&u.yogaNode){(0,S.A)(u.yogaNode,C)}},commitTextUpdate(u,A,p){(0,B.x6)(u,p)},removeChild(u,A){(0,B.V8)(u,A);cleanupYogaNode(A.yogaNode)},setCurrentUpdatePriority(u){k=u},getCurrentUpdatePriority:()=>k,resolveUpdatePriority(){if(k!==I.NoEventPriority){return k}return I.DefaultEventPriority},maySuspendCommit(){return false},NotPendingTransition:undefined,HostTransitionContext:(0,v.createContext)(null),resetFormInstance(){},requestPostPaintCallback(){},shouldAttemptEagerTransition(){return false},trackSchedulerEvent(){},resolveEventType(){return null},resolveEventTimeStamp(){return-1.1},preloadInstance(){return true},startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady(){return null}});y()}catch(u){y(u)}}),1)},7235:(u,A,p)=>{p.d(A,{A:()=>E});var y=p(4493);const renderBackground=(u,A,p,E)=>{if(!p.style.backgroundColor){return}const C=p.yogaNode.getComputedWidth();const I=p.yogaNode.getComputedHeight();const w=p.style.borderStyle&&p.style.borderLeft!==false?1:0;const v=p.style.borderStyle&&p.style.borderRight!==false?1:0;const B=p.style.borderStyle&&p.style.borderTop!==false?1:0;const S=p.style.borderStyle&&p.style.borderBottom!==false?1:0;const D=C-w-v;const k=I-B-S;if(!(D>0&&k>0)){return}const Q=(0,y.A)(" ".repeat(D),p.style.backgroundColor,"background");for(let p=0;p<k;p++){E.write(u+w,A+B+p,Q,{transformers:[]})}};const E=renderBackground},9729:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(4284);var E=p(9611);var C=p(4493);const renderBorder=(u,A,p,I)=>{if(p.style.borderStyle){const w=p.yogaNode.getComputedWidth();const v=p.yogaNode.getComputedHeight();const B=typeof p.style.borderStyle==="string"?y[p.style.borderStyle]:p.style.borderStyle;const S=p.style.borderTopColor??p.style.borderColor;const D=p.style.borderBottomColor??p.style.borderColor;const k=p.style.borderLeftColor??p.style.borderColor;const Q=p.style.borderRightColor??p.style.borderColor;const F=p.style.borderTopDimColor??p.style.borderDimColor;const R=p.style.borderBottomDimColor??p.style.borderDimColor;const _=p.style.borderLeftDimColor??p.style.borderDimColor;const P=p.style.borderRightDimColor??p.style.borderDimColor;const O=p.style.borderTop!==false;const U=p.style.borderBottom!==false;const H=p.style.borderLeft!==false;const G=p.style.borderRight!==false;const j=w-(H?1:0)-(G?1:0);let $=O?(0,C.A)((H?B.topLeft:"")+B.top.repeat(j)+(G?B.topRight:""),S,"foreground"):undefined;if(O&&F){$=E.Ay.dim($)}let q=v;if(O){q-=1}if(U){q-=1}let K=((0,C.A)(B.left,k,"foreground")+"\n").repeat(q);if(_){K=E.Ay.dim(K)}let J=((0,C.A)(B.right,Q,"foreground")+"\n").repeat(q);if(P){J=E.Ay.dim(J)}let ee=U?(0,C.A)((H?B.bottomLeft:"")+B.bottom.repeat(j)+(G?B.bottomRight:""),D,"foreground"):undefined;if(U&&R){ee=E.Ay.dim(ee)}const te=O?1:0;if($){I.write(u,A,$,{transformers:[]})}if(H){I.write(u,A+te,K,{transformers:[]})}if(G){I.write(u+w-1,A+te,J,{transformers:[]})}if(ee){I.write(u,A+v-1,ee,{transformers:[]})}}};const I=renderBorder},3639:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>Q,K:()=>renderNodeToScreenReaderOutput});var E=p(2511);var C=p(8617);var I=p(9466);var w=p(7389);var v=p(3618);var B=p(6503);var S=p(9729);var D=p(7235);var k=u([I,v]);[I,v]=k.then?(await k)():k;const applyPaddingToText=(u,A)=>{const p=u.childNodes[0]?.yogaNode;if(p){const u=p.getComputedLeft();const y=p.getComputedTop();A="\n".repeat(y)+(0,C.A)(A,u)}return A};const renderNodeToScreenReaderOutput=(u,A={})=>{if(A.skipStaticElements&&u.internal_static){return""}if(u.yogaNode?.getDisplay()===I.Ay.DISPLAY_NONE){return""}let p="";if(u.nodeName==="ink-text"){p=(0,B.A)(u)}else if(u.nodeName==="ink-box"||u.nodeName==="ink-root"){const y=u.style.flexDirection==="row"||u.style.flexDirection==="row-reverse"?" ":"\n";const E=u.style.flexDirection==="row-reverse"||u.style.flexDirection==="column-reverse"?[...u.childNodes].reverse():[...u.childNodes];p=E.map((p=>{const y=renderNodeToScreenReaderOutput(p,{parentRole:u.internal_accessibility?.role,skipStaticElements:A.skipStaticElements});return y})).filter(Boolean).join(y)}if(u.internal_accessibility){const{role:y,state:E}=u.internal_accessibility;if(E){const u=Object.keys(E);const A=u.filter((u=>E[u])).join(", ");if(A){p=`(${A}) ${p}`}}if(y&&y!==A.parentRole){p=`${y}: ${p}`}}return p};const renderNodeToOutput=(u,A,p)=>{const{offsetX:y=0,offsetY:C=0,transformers:k=[],skipStaticElements:Q}=p;if(Q&&u.internal_static){return}const{yogaNode:F}=u;if(F){if(F.getDisplay()===I.Ay.DISPLAY_NONE){return}const p=y+F.getComputedLeft();const R=C+F.getComputedTop();let _=k;if(typeof u.internal_transform==="function"){_=[u.internal_transform,...k]}if(u.nodeName==="ink-text"){let y=(0,B.A)(u);if(y.length>0){const C=(0,E.A)(y);const I=(0,v.A)(F);if(C>I){const A=u.style.textWrap??"wrap";y=(0,w.A)(y,I,A)}y=applyPaddingToText(u,y);A.write(p,R,y,{transformers:_})}return}let P=false;if(u.nodeName==="ink-box"){(0,D.A)(p,R,u,A);(0,S.A)(p,R,u,A);const y=u.style.overflowX==="hidden"||u.style.overflow==="hidden";const E=u.style.overflowY==="hidden"||u.style.overflow==="hidden";if(y||E){const u=y?p+F.getComputedBorder(I.Ay.EDGE_LEFT):undefined;const C=y?p+F.getComputedWidth()-F.getComputedBorder(I.Ay.EDGE_RIGHT):undefined;const w=E?R+F.getComputedBorder(I.Ay.EDGE_TOP):undefined;const v=E?R+F.getComputedHeight()-F.getComputedBorder(I.Ay.EDGE_BOTTOM):undefined;A.clip({x1:u,x2:C,y1:w,y2:v});P=true}}if(u.nodeName==="ink-root"||u.nodeName==="ink-box"){for(const y of u.childNodes){renderNodeToOutput(y,A,{offsetX:p,offsetY:R,transformers:_,skipStaticElements:Q})}if(P){A.unclip()}}}};const Q=renderNodeToOutput;y()}catch(u){y(u)}}))},5406:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>B});var E=p(7075);var C=p(1708);var I=p(7676);var w=p(1840);var v=u([I]);I=(v.then?(await v)():v)[0];const render=(u,A)=>{const p={stdout:C.stdout,stdin:C.stdin,stderr:C.stderr,debug:false,exitOnCtrlC:true,patchConsole:true,maxFps:30,incrementalRendering:false,...getOptions(A)};const y=getInstance(p.stdout,(()=>new I.A(p)));y.render(u);return{rerender:y.render,unmount(){y.unmount()},waitUntilExit:y.waitUntilExit,cleanup:()=>w.A.delete(p.stdout),clear:y.clear}};const B=render;const getOptions=(u={})=>{if(u instanceof E.Stream){return{stdout:u,stdin:C.stdin}}return u};const getInstance=(u,A)=>{let p=w.A.get(u);if(!p){p=A();w.A.set(u,p)}return p};y()}catch(u){y(u)}}))},2081:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(3639);var C=p(4479);var I=u([E]);E=(I.then?(await I)():I)[0];const renderer=(u,A)=>{if(u.yogaNode){if(A){const A=(0,E.K)(u,{skipStaticElements:true});const p=A===""?0:A.split("\n").length;let y="";if(u.staticNode){y=(0,E.K)(u.staticNode,{skipStaticElements:false})}return{output:A,outputHeight:p,staticOutput:y?`${y}\n`:""}}const p=new C.A({width:u.yogaNode.getComputedWidth(),height:u.yogaNode.getComputedHeight()});(0,E.A)(u,p,{skipStaticElements:true});let y;if(u.staticNode?.yogaNode){y=new C.A({width:u.staticNode.yogaNode.getComputedWidth(),height:u.staticNode.yogaNode.getComputedHeight()});(0,E.A)(u.staticNode,y,{skipStaticElements:false})}const{output:I,height:w}=p.get();return{output:I,outputHeight:w,staticOutput:y?`${y.get().output}\n`:""}}return{output:"",outputHeight:0,staticOutput:""}};const w=renderer;y()}catch(u){y(u)}}))},6503:(u,A,p)=>{p.d(A,{A:()=>y});const squashTextNodes=u=>{let A="";for(let p=0;p<u.childNodes.length;p++){const y=u.childNodes[p];if(y===undefined){continue}let E="";if(y.nodeName==="#text"){E=y.nodeValue}else{if(y.nodeName==="ink-text"||y.nodeName==="ink-virtual-text"){E=squashTextNodes(y)}if(E.length>0&&typeof y.internal_transform==="function"){E=y.internal_transform(E,p)}}A+=E}return A};const y=squashTextNodes},9892:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>I});var E=p(9466);var C=u([E]);E=(C.then?(await C)():C)[0];const applyPositionStyles=(u,A)=>{if("position"in A){u.setPositionType(A.position==="absolute"?E.Ay.POSITION_TYPE_ABSOLUTE:E.Ay.POSITION_TYPE_RELATIVE)}};const applyMarginStyles=(u,A)=>{if("margin"in A){u.setMargin(E.Ay.EDGE_ALL,A.margin??0)}if("marginX"in A){u.setMargin(E.Ay.EDGE_HORIZONTAL,A.marginX??0)}if("marginY"in A){u.setMargin(E.Ay.EDGE_VERTICAL,A.marginY??0)}if("marginLeft"in A){u.setMargin(E.Ay.EDGE_START,A.marginLeft||0)}if("marginRight"in A){u.setMargin(E.Ay.EDGE_END,A.marginRight||0)}if("marginTop"in A){u.setMargin(E.Ay.EDGE_TOP,A.marginTop||0)}if("marginBottom"in A){u.setMargin(E.Ay.EDGE_BOTTOM,A.marginBottom||0)}};const applyPaddingStyles=(u,A)=>{if("padding"in A){u.setPadding(E.Ay.EDGE_ALL,A.padding??0)}if("paddingX"in A){u.setPadding(E.Ay.EDGE_HORIZONTAL,A.paddingX??0)}if("paddingY"in A){u.setPadding(E.Ay.EDGE_VERTICAL,A.paddingY??0)}if("paddingLeft"in A){u.setPadding(E.Ay.EDGE_LEFT,A.paddingLeft||0)}if("paddingRight"in A){u.setPadding(E.Ay.EDGE_RIGHT,A.paddingRight||0)}if("paddingTop"in A){u.setPadding(E.Ay.EDGE_TOP,A.paddingTop||0)}if("paddingBottom"in A){u.setPadding(E.Ay.EDGE_BOTTOM,A.paddingBottom||0)}};const applyFlexStyles=(u,A)=>{if("flexGrow"in A){u.setFlexGrow(A.flexGrow??0)}if("flexShrink"in A){u.setFlexShrink(typeof A.flexShrink==="number"?A.flexShrink:1)}if("flexWrap"in A){if(A.flexWrap==="nowrap"){u.setFlexWrap(E.Ay.WRAP_NO_WRAP)}if(A.flexWrap==="wrap"){u.setFlexWrap(E.Ay.WRAP_WRAP)}if(A.flexWrap==="wrap-reverse"){u.setFlexWrap(E.Ay.WRAP_WRAP_REVERSE)}}if("flexDirection"in A){if(A.flexDirection==="row"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_ROW)}if(A.flexDirection==="row-reverse"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_ROW_REVERSE)}if(A.flexDirection==="column"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_COLUMN)}if(A.flexDirection==="column-reverse"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_COLUMN_REVERSE)}}if("flexBasis"in A){if(typeof A.flexBasis==="number"){u.setFlexBasis(A.flexBasis)}else if(typeof A.flexBasis==="string"){u.setFlexBasisPercent(Number.parseInt(A.flexBasis,10))}else{u.setFlexBasis(Number.NaN)}}if("alignItems"in A){if(A.alignItems==="stretch"||!A.alignItems){u.setAlignItems(E.Ay.ALIGN_STRETCH)}if(A.alignItems==="flex-start"){u.setAlignItems(E.Ay.ALIGN_FLEX_START)}if(A.alignItems==="center"){u.setAlignItems(E.Ay.ALIGN_CENTER)}if(A.alignItems==="flex-end"){u.setAlignItems(E.Ay.ALIGN_FLEX_END)}}if("alignSelf"in A){if(A.alignSelf==="auto"||!A.alignSelf){u.setAlignSelf(E.Ay.ALIGN_AUTO)}if(A.alignSelf==="flex-start"){u.setAlignSelf(E.Ay.ALIGN_FLEX_START)}if(A.alignSelf==="center"){u.setAlignSelf(E.Ay.ALIGN_CENTER)}if(A.alignSelf==="flex-end"){u.setAlignSelf(E.Ay.ALIGN_FLEX_END)}}if("justifyContent"in A){if(A.justifyContent==="flex-start"||!A.justifyContent){u.setJustifyContent(E.Ay.JUSTIFY_FLEX_START)}if(A.justifyContent==="center"){u.setJustifyContent(E.Ay.JUSTIFY_CENTER)}if(A.justifyContent==="flex-end"){u.setJustifyContent(E.Ay.JUSTIFY_FLEX_END)}if(A.justifyContent==="space-between"){u.setJustifyContent(E.Ay.JUSTIFY_SPACE_BETWEEN)}if(A.justifyContent==="space-around"){u.setJustifyContent(E.Ay.JUSTIFY_SPACE_AROUND)}if(A.justifyContent==="space-evenly"){u.setJustifyContent(E.Ay.JUSTIFY_SPACE_EVENLY)}}};const applyDimensionStyles=(u,A)=>{if("width"in A){if(typeof A.width==="number"){u.setWidth(A.width)}else if(typeof A.width==="string"){u.setWidthPercent(Number.parseInt(A.width,10))}else{u.setWidthAuto()}}if("height"in A){if(typeof A.height==="number"){u.setHeight(A.height)}else if(typeof A.height==="string"){u.setHeightPercent(Number.parseInt(A.height,10))}else{u.setHeightAuto()}}if("minWidth"in A){if(typeof A.minWidth==="string"){u.setMinWidthPercent(Number.parseInt(A.minWidth,10))}else{u.setMinWidth(A.minWidth??0)}}if("minHeight"in A){if(typeof A.minHeight==="string"){u.setMinHeightPercent(Number.parseInt(A.minHeight,10))}else{u.setMinHeight(A.minHeight??0)}}};const applyDisplayStyles=(u,A)=>{if("display"in A){u.setDisplay(A.display==="flex"?E.Ay.DISPLAY_FLEX:E.Ay.DISPLAY_NONE)}};const applyBorderStyles=(u,A)=>{if("borderStyle"in A){const p=A.borderStyle?1:0;if(A.borderTop!==false){u.setBorder(E.Ay.EDGE_TOP,p)}if(A.borderBottom!==false){u.setBorder(E.Ay.EDGE_BOTTOM,p)}if(A.borderLeft!==false){u.setBorder(E.Ay.EDGE_LEFT,p)}if(A.borderRight!==false){u.setBorder(E.Ay.EDGE_RIGHT,p)}}};const applyGapStyles=(u,A)=>{if("gap"in A){u.setGap(E.Ay.GUTTER_ALL,A.gap??0)}if("columnGap"in A){u.setGap(E.Ay.GUTTER_COLUMN,A.columnGap??0)}if("rowGap"in A){u.setGap(E.Ay.GUTTER_ROW,A.rowGap??0)}};const styles=(u,A={})=>{applyPositionStyles(u,A);applyMarginStyles(u,A);applyPaddingStyles(u,A);applyFlexStyles(u,A);applyDimensionStyles(u,A);applyDisplayStyles(u,A);applyBorderStyles(u,A);applyGapStyles(u,A)};const I=styles;y()}catch(u){y(u)}}))},7389:(u,A,p)=>{p.d(A,{A:()=>w});var y=p(3335);var E=p(316);var C=p(9767);function getIndexOfNearestSpace(u,A,p){if(u.charAt(A)===" "){return A}const y=p?1:-1;for(let p=0;p<=3;p++){const E=A+p*y;if(u.charAt(E)===" "){return E}}return A}function cliTruncate(u,A,p={}){const{position:y="end",space:I=false,preferTruncationOnSpace:w=false}=p;let{truncationCharacter:v="…"}=p;if(typeof u!=="string"){throw new TypeError(`Expected \`input\` to be a string, got ${typeof u}`)}if(typeof A!=="number"){throw new TypeError(`Expected \`columns\` to be a number, got ${typeof A}`)}if(A<1){return""}const B=(0,C.A)(u);if(B<=A){return u}if(A===1){return v}const S={ESC:27,LEFT_BRACKET:91,LETTER_M:109};const isSgrParameter=u=>u>=48&&u<=57||u===59;function leadingSgrSpanEndIndex(u){let A=0;while(A+2<u.length&&u.codePointAt(A)===S.ESC&&u.codePointAt(A+1)===S.LEFT_BRACKET){let p=A+2;while(p<u.length&&isSgrParameter(u.codePointAt(p))){p++}if(p<u.length&&u.codePointAt(p)===S.LETTER_M){A=p+1;continue}break}return A}function trailingSgrSpanStartIndex(u){let A=u.length;while(A>1&&u.codePointAt(A-1)===S.LETTER_M){let p=A-2;while(p>=0&&isSgrParameter(u.codePointAt(p))){p--}if(p>=1&&u.codePointAt(p-1)===S.ESC&&u.codePointAt(p)===S.LEFT_BRACKET){A=p-1;continue}break}return A}function appendWithInheritedStyleFromEnd(u,A){const p=trailingSgrSpanStartIndex(u);if(p===u.length){return u+A}return u.slice(0,p)+A+u.slice(p)}function prependWithInheritedStyleFromStart(u,A){const p=leadingSgrSpanEndIndex(A);if(p===0){return u+A}return A.slice(0,p)+u+A.slice(p)}if(y==="start"){if(w){const p=getIndexOfNearestSpace(u,B-A+1,true);const y=(0,E.A)(u,p,B).trim();return prependWithInheritedStyleFromStart(v,y)}if(I){v+=" "}const p=(0,E.A)(u,B-A+(0,C.A)(v),B);return prependWithInheritedStyleFromStart(v,p)}if(y==="middle"){if(I){v=` ${v} `}const p=Math.floor(A/2);if(w){const y=getIndexOfNearestSpace(u,p);const C=getIndexOfNearestSpace(u,B-(A-p)+1,true);return(0,E.A)(u,0,y)+v+(0,E.A)(u,C,B).trim()}return(0,E.A)(u,0,p)+v+(0,E.A)(u,B-(A-p)+(0,C.A)(v),B)}if(y==="end"){if(w){const p=getIndexOfNearestSpace(u,A-1);const y=(0,E.A)(u,0,p);return appendWithInheritedStyleFromEnd(y,v)}if(I){v=` ${v}`}const p=(0,E.A)(u,0,A-(0,C.A)(v));return appendWithInheritedStyleFromEnd(p,v)}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${y}`)}const I={};const wrapText=(u,A,p)=>{const E=u+String(A)+String(p);const C=I[E];if(C){return C}let w=u;if(p==="wrap"){w=(0,y.A)(u,A,{trim:false,hard:true})}if(p.startsWith("truncate")){let y="end";if(p==="truncate-middle"){y="middle"}if(p==="truncate-start"){y="start"}w=cliTruncate(u,A,{position:y})}I[E]=w;return w};const w=wrapText},182:(u,A,p)=>{p.d(A,{A:()=>isFullwidthCodePoint});var y=p(9957);function isFullwidthCodePoint(u){if(!Number.isInteger(u)){return false}return(0,y.Ck)(u)||(0,y.EW)(u)}},5306:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(1708);const check=u=>u in y.env&&y.env[u]!=="0"&&y.env[u]!=="false";const E=check("CI")||check("CONTINUOUS_INTEGRATION");const C=E},4302:(u,A,p)=>{p.d(A,{A:()=>he});var y=p(6760);var E=p(1708);var C=p(3136);var I=p(932);var w=p(9023);var v=p(6928);
110
+ if(u.automaticFailover&&!w){makeRequest(u)}y.emit("error",new types_CacheError(A))}})();return y};this.addHook=(u,A)=>{if(!this.hooks.has(u)){this.hooks.set(u,A)}};this.removeHook=u=>this.hooks.delete(u);this.getHook=u=>this.hooks.get(u);this.runHook=async(u,...A)=>this.hooks.get(u)?.(...A);if(A){if(A instanceof Xi){this.cache=A}else{this.cache=new Xi({store:A,namespace:"cacheable-request"})}}this.request=this.request.bind(this);this.cacheRequest=u}}const so=Object.entries;const cloneResponse=u=>{const A=new Pe.PassThrough({autoDestroy:false});mimicResponse(u,A);return u.pipe(A)};const urlObjectToRequestOptions=u=>{const A={...u};A.path=`${u.pathname||"/"}${u.search||""}`;delete A.pathname;delete A.search;return A};const normalizeUrlObject=u=>({protocol:u.protocol,auth:u.auth,hostname:u.hostname||u.host||"localhost",port:u.port,pathname:u.pathname,search:u.search});const convertHeaders=u=>{const A=[];for(const p of Object.keys(u)){A[p.toLowerCase()]=u[p]}return A};const parseWithWhatwg=u=>{const A=new we.URL(u);return{protocol:A.protocol,slashes:true,auth:A.username||A.password?`${A.username}:${A.password}`:undefined,host:A.host,port:A.port,hostname:A.hostname,hash:A.hash,search:A.search,query:Object.fromEntries(A.searchParams),pathname:A.pathname,path:A.pathname+A.search,href:A.href}};const io=CacheableRequest;const oo="onResponse";const ao=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib");const lo=typeof ao.createZstdDecompress==="function";function decompressResponse(u){const A=(u.headers["content-encoding"]||"").toLowerCase();const p=["gzip","deflate","br"];if(lo){p.push("zstd")}if(!p.includes(A)){return u}let y=true;const E={...u.headers};const C=new Pe.PassThrough({autoDestroy:false});C.once("error",(()=>{u.destroy()}));function handleContentEncoding(p){let E;if(A==="zstd"){E=ao.createZstdDecompress()}else if(A==="br"){E=ao.createBrotliDecompress()}else if(A==="deflate"&&p.length>0&&(p[0]&8)===0){E=ao.createInflateRaw()}else{E=ao.createUnzip()}E.once("error",(A=>{if(y&&!u.readable){C.end();return}C.destroy(A)}));I.pipe(E).pipe(C)}const I=new Pe.Transform({transform(u,A,p){if(y===false){p(null,u);return}y=false;handleContentEncoding(u);p(null,u)},flush(u){if(y){C.end()}u()}});delete E["content-encoding"];delete E["content-length"];C.headers=E;mimicResponse(u,C);u.pipe(I);return C}var __typeError=u=>{throw TypeError(u)};var __accessCheck=(u,A,p)=>A.has(u)||__typeError("Cannot "+p);var __privateGet=(u,A,p)=>(__accessCheck(u,A,"read from private field"),p?p.call(u):A.get(u));var __privateAdd=(u,A,p)=>A.has(u)?__typeError("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(u):A.set(u,p);var __privateSet=(u,A,p,y)=>(__accessCheck(u,A,"write to private field"),y?y.call(u,p):A.set(u,p),p);var __privateMethod=(u,A,p)=>(__accessCheck(u,A,"access private method"),p);var co=65536;function*chunk(u){if(u.byteLength<=co){yield u;return}let A=0;while(A<u.byteLength){const p=Math.min(u.byteLength-A,co);const y=u.buffer.slice(A,A+p);A+=y.byteLength;yield new Uint8Array(y)}}var uo="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let u=16;let A="";while(u--){A+=uo[Math.random()*uo.length<<0]}return A}var escapeName=u=>String(u).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");var lib_isFunction=u=>typeof u==="function";var isReadableStreamFallback=u=>!!u&&typeof u==="object"&&!Array.isArray(u)&&lib_isFunction(u.getReader);var lib_isAsyncIterable=u=>lib_isFunction(u[Symbol.asyncIterator]);async function*readStream(u){const A=u.getReader();while(true){const{done:u,value:p}=await A.read();if(u){break}yield p}}async function*chunkStream(u){for await(const A of u){yield*chunk(A)}}var getStreamIterator=u=>{if(lib_isAsyncIterable(u)){return chunkStream(u)}if(isReadableStreamFallback(u)){return chunkStream(readStream(u))}throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")};var isFile=u=>Boolean(u&&typeof u==="object"&&lib_isFunction(u.constructor)&&u[Symbol.toStringTag]==="File"&&lib_isFunction(u.stream)&&u.name!=null);var lib_isFormData=u=>Boolean(u&&lib_isFunction(u.constructor)&&u[Symbol.toStringTag]==="FormData"&&lib_isFunction(u.append)&&lib_isFunction(u.getAll)&&lib_isFunction(u.entries)&&lib_isFunction(u[Symbol.iterator]));var getType=u=>Object.prototype.toString.call(u).slice(8,-1).toLowerCase();function lib_isPlainObject(u){if(getType(u)!=="object"){return false}const A=Object.getPrototypeOf(u);if(A===null||A===void 0){return true}return A.constructor?.toString?.()===Object.toString()}var normalizeValue=u=>String(u).replace(/\r|\n/g,((u,A,p)=>{if(u==="\r"&&p[A+1]!=="\n"||u==="\n"&&p[A-1]!=="\r"){return"\r\n"}return u}));function getProperty(u,A){if(typeof A==="string"){for(const[p,y]of Object.entries(u)){if(A.toLowerCase()===p.toLowerCase()){return y}}}return void 0}var proxyHeaders=u=>new Proxy(u,{get:(u,A)=>getProperty(u,A),has:(u,A)=>getProperty(u,A)!==void 0});var fo={enableAdditionalHeaders:false};var Ao={writable:false,configurable:false};var ho,po,go,mo,yo,Eo,Co,Io,bo,wo,vo;var Bo=class{constructor(u,A,p){__privateAdd(this,bo);__privateAdd(this,ho,"\r\n");__privateAdd(this,po);__privateAdd(this,go);__privateAdd(this,mo,"-".repeat(2));__privateAdd(this,yo,new TextEncoder);__privateAdd(this,Eo);__privateAdd(this,Co);__privateAdd(this,Io);if(!lib_isFormData(u)){throw new TypeError("Expected first argument to be a FormData instance.")}let y;if(lib_isPlainObject(A)){p=A}else{y=A}if(!y){y=`form-data-encoder-${createBoundary()}`}if(typeof y!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(p&&!lib_isPlainObject(p)){throw new TypeError("Expected options argument to be an object.")}__privateSet(this,Co,Array.from(u.entries()));__privateSet(this,Io,{...fo,...p});__privateSet(this,po,__privateGet(this,yo).encode(__privateGet(this,ho)));__privateSet(this,go,__privateGet(this,po).byteLength);this.boundary=y;this.contentType=`multipart/form-data; boundary=${this.boundary}`;__privateSet(this,Eo,__privateGet(this,yo).encode(`${__privateGet(this,mo)}${this.boundary}${__privateGet(this,mo)}${__privateGet(this,ho).repeat(2)}`));const E={"Content-Type":this.contentType};const C=__privateMethod(this,bo,vo).call(this);if(C){this.contentLength=C;E["Content-Length"]=C}this.headers=proxyHeaders(Object.freeze(E));Object.defineProperties(this,{boundary:Ao,contentType:Ao,contentLength:Ao,headers:Ao})}*values(){for(const[u,A]of __privateGet(this,Co)){const p=isFile(A)?A:__privateGet(this,yo).encode(normalizeValue(A));yield __privateMethod(this,bo,wo).call(this,u,p);yield p;yield __privateGet(this,po)}yield __privateGet(this,Eo)}async*encode(){for(const u of this.values()){if(isFile(u)){yield*getStreamIterator(u.stream())}else{yield*chunk(u)}}}[Symbol.iterator](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};ho=new WeakMap;po=new WeakMap;go=new WeakMap;mo=new WeakMap;yo=new WeakMap;Eo=new WeakMap;Co=new WeakMap;Io=new WeakMap;bo=new WeakSet;wo=function(u,A){let p="";p+=`${__privateGet(this,mo)}${this.boundary}${__privateGet(this,ho)}`;p+=`Content-Disposition: form-data; name="${escapeName(u)}"`;if(isFile(A)){p+=`; filename="${escapeName(A.name)}"${__privateGet(this,ho)}`;p+=`Content-Type: ${A.type||"application/octet-stream"}`}if(__privateGet(this,Io).enableAdditionalHeaders===true){const u=isFile(A)?A.size:A.byteLength;if(u!=null&&!isNaN(u)){p+=`${__privateGet(this,ho)}Content-Length: ${u}`}}return __privateGet(this,yo).encode(`${p}${__privateGet(this,ho).repeat(2)}`)};vo=function(){let u=0;for(const[A,p]of __privateGet(this,Co)){const y=isFile(p)?p:__privateGet(this,yo).encode(normalizeValue(p));const E=isFile(y)?y.size:y.byteLength;if(E==null||isNaN(E)){return void 0}u+=__privateMethod(this,bo,wo).call(this,A,y).byteLength;u+=E;u+=__privateGet(this,go)}return String(u+__privateGet(this,Eo).byteLength)};function isTlsSocket(u){return"encrypted"in u}const deferToConnect=(u,A)=>{let p;if(typeof A==="function"){const u=A;p={connect:u}}else{p=A}const y=typeof p.connect==="function";const E=typeof p.secureConnect==="function";const C=typeof p.close==="function";const onConnect=()=>{if(y){p.connect()}if(isTlsSocket(u)&&E){if(u.authorized){p.secureConnect()}else{u.once("secureConnect",p.secureConnect)}}if(C){u.once("close",p.close)}};if(u.writable&&!u.connecting){onConnect()}else if(u.connecting){u.once("connect",onConnect)}else if(u.destroyed&&C){const A="_hadError"in u?Boolean(u._hadError):false;p.close(A)}};const So=deferToConnect;const timer=u=>{if(u.timings){return u.timings}const A={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};u.timings=A;const handleError=u=>{u.once(Le.errorMonitor,(()=>{A.error=Date.now();A.phases.total=A.error-A.start}))};handleError(u);const onAbort=()=>{A.abort=Date.now();A.phases.total=A.abort-A.start};u.prependOnceListener("abort",onAbort);const onSocket=u=>{A.socket=Date.now();A.phases.wait=A.socket-A.start;if(cn.types.isProxy(u)){return}const p=u.writable&&!u.connecting;if(p){A.lookup=A.socket;A.connect=A.socket;if(u.__initial_connection_timings__){A.phases.dns=u.__initial_connection_timings__.dnsPhase;A.phases.tcp=u.__initial_connection_timings__.tcpPhase;A.phases.tls=u.__initial_connection_timings__.tlsPhase;if(A.phases.tls!==undefined){A.secureConnect=A.socket}}else{A.phases.dns=0;A.phases.tcp=0}return}const lookupListener=()=>{A.lookup=Date.now();A.phases.dns=A.lookup-A.socket};u.prependOnceListener("lookup",lookupListener);So(u,{connect(){A.connect=Date.now();if(A.lookup===undefined){u.removeListener("lookup",lookupListener);A.lookup=A.socket;A.phases.dns=0}A.phases.tcp=A.connect-A.lookup;if(A.phases.tcp===0&&A.phases.dns&&A.phases.dns>0){A.phases.dns=0}if(!u.__initial_connection_timings__){u.__initial_connection_timings__={dnsPhase:A.phases.dns,tcpPhase:A.phases.tcp}}},secureConnect(){A.secureConnect=Date.now();A.phases.tls=A.secureConnect-A.connect;if(u.__initial_connection_timings__){u.__initial_connection_timings__.tlsPhase=A.phases.tls}}})};if(u.socket){onSocket(u.socket)}else{u.prependOnceListener("socket",onSocket)}const onUpload=()=>{A.upload=Date.now();const u=A.secureConnect??A.connect;if(u!==undefined){A.phases.request=A.upload-u}};if(u.writableFinished){onUpload()}else{u.prependOnceListener("finish",onUpload)}u.prependOnceListener("response",(p=>{A.response=Date.now();A.phases.firstByte=A.response-A.upload;p.timings=A;handleError(p);p.prependOnceListener("end",(()=>{u.off("abort",onAbort);p.off("aborted",onAbort);if(A.phases.total!==undefined){return}A.end=Date.now();A.phases.download=A.end-A.response;A.phases.total=A.end-A.start}));p.prependOnceListener("aborted",onAbort)}));return A};const Do=timer;function is_form_data_isFormData(u){return Pi.nodeStream(u)&&Pi.function(u.getBoundary)}async function getBodySize(u,A){if(A&&"content-length"in A){return Number(A["content-length"])}if(!u){return 0}if(Pi.string(u)){return(new TextEncoder).encode(u).byteLength}if(Pi.buffer(u)){return u.length}if(Pi.typedArray(u)){return u.byteLength}if(is_form_data_isFormData(u)){try{return await(0,cn.promisify)(u.getLength.bind(u))()}catch(u){const A=u;throw new Error("Cannot determine content-length for form-data with stream(s) of unknown length. "+"This is a limitation of the `form-data` package. "+"To fix this, either:\n"+"1. Use the `knownLength` option when appending streams:\n"+" form.append('file', stream, {knownLength: 12345});\n"+"2. Switch to spec-compliant FormData (formdata-node package)\n"+"See: https://github.com/form-data/form-data#alternative-submission-methods\n"+`Original error: ${A.message}`)}}return undefined}function proxyEvents(u,A,p){const y={};for(const E of p){const eventFunction=(...u)=>{A.emit(E,...u)};y[E]=eventFunction;u.on(E,eventFunction)}return()=>{for(const[A,p]of Object.entries(y)){u.off(A,p)}}}const ko=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net");function unhandle(){const u=[];return{once(A,p,y){A.once(p,y);u.push({origin:A,event:p,fn:y})},unhandleAll(){for(const A of u){const{origin:u,event:p,fn:y}=A;u.removeListener(p,y)}u.length=0}}}const Qo=Symbol("reentry");const timed_out_noop=()=>{};class timed_out_TimeoutError extends Error{event;name="TimeoutError";code="ETIMEDOUT";constructor(u,A){super(`Timeout awaiting '${A}' for ${u}ms`);this.event=A}}function timedOut(u,A,p){if(Qo in u){return timed_out_noop}u[Qo]=true;const y=[];const{once:E,unhandleAll:C}=unhandle();const I=new Map;const addTimeout=(u,A,p)=>{const E=setTimeout(A,u,u,p);E.unref?.();const cancel=()=>{I.set(p,true);clearTimeout(E)};y.push(cancel);return cancel};const{host:w,hostname:v}=p;const timeoutHandler=(A,p)=>{setTimeout((()=>{if(!I.has(p)){u.destroy(new timed_out_TimeoutError(A,p))}}),0)};const cancelTimeouts=()=>{for(const u of y){u()}C()};u.once("error",(A=>{cancelTimeouts();if(u.listenerCount("error")===0){throw A}}));if(A.request!==undefined){const p=addTimeout(A.request,timeoutHandler,"request");E(u,"response",(u=>{E(u,"end",p)}))}if(A.socket!==undefined){const{socket:p}=A;const socketTimeoutHandler=()=>{timeoutHandler(p,"socket")};u.setTimeout(p,socketTimeoutHandler);y.push((()=>{u.removeListener("timeout",socketTimeoutHandler)}))}const B=A.lookup!==undefined;const S=A.connect!==undefined;const D=A.secureConnect!==undefined;const k=A.send!==undefined;if(B||S||D||k){E(u,"socket",(y=>{const{socketPath:C}=u;if(y.connecting){const u=Boolean(C??ko.isIP(v??w??"")!==0);if(B&&!u&&y.address().address===undefined){const u=addTimeout(A.lookup,timeoutHandler,"lookup");E(y,"lookup",u)}if(S){const timeConnect=()=>addTimeout(A.connect,timeoutHandler,"connect");if(u){E(y,"connect",timeConnect())}else{E(y,"lookup",(u=>{if(u===null){E(y,"connect",timeConnect())}}))}}if(D&&p.protocol==="https:"){E(y,"connect",(()=>{const u=addTimeout(A.secureConnect,timeoutHandler,"secureConnect");E(y,"secureConnect",u)}))}}if(k){const timeRequest=()=>addTimeout(A.send,timeoutHandler,"send");if(y.connecting){E(y,"connect",(()=>{E(u,"upload-complete",timeRequest())}))}else{E(u,"upload-complete",timeRequest())}}}))}if(A.response!==undefined){E(u,"upload-complete",(()=>{const p=addTimeout(A.response,timeoutHandler,"response");E(u,"response",p)}))}if(A.read!==undefined){E(u,"response",(u=>{const p=addTimeout(A.read,timeoutHandler,"read");E(u,"end",p)}))}return cancelTimeouts}function urlToOptions(u){u=u;const A={protocol:u.protocol,hostname:Pi.string(u.hostname)&&u.hostname.startsWith("[")?u.hostname.slice(1,-1):u.hostname,host:u.host,hash:u.hash,search:u.search,pathname:u.pathname,href:u.href,path:`${u.pathname||""}${u.search||""}`};if(Pi.string(u.port)&&u.port.length>0){A.port=Number(u.port)}if(u.username||u.password){A.auth=`${u.username||""}:${u.password||""}`}return A}class WeakableMap{weakMap=new WeakMap;map=new Map;set(u,A){if(typeof u==="object"){this.weakMap.set(u,A)}else{this.map.set(u,A)}}get(u){if(typeof u==="object"){return this.weakMap.get(u)}return this.map.get(u)}has(u){if(typeof u==="object"){return this.weakMap.has(u)}return this.map.has(u)}}const calculateRetryDelay=({attemptCount:u,retryOptions:A,error:p,retryAfter:y,computedValue:E})=>{if(p.name==="RetryError"){return 1}if(u>A.limit){return 0}const C=A.methods.includes(p.options.method);const I=A.errorCodes.includes(p.code);const w=p.response&&A.statusCodes.includes(p.response.statusCode);if(!C||!I&&!w){return 0}if(p.response){if(y){if(y>E){return 0}return y}if(p.response.statusCode===413){return 0}}const v=Math.random()*A.noise;return Math.min(2**(u-1)*1e3,A.backoffLimit)+v};const Fo=calculateRetryDelay;const xo=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tls");const Ro=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https");const _o=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns");const{Resolver:To}=_o.promises;const No=Symbol("cacheableLookupCreateConnection");const Lo=Symbol("cacheableLookupInstance");const Po=Symbol("expires");const Oo=typeof _o.ALL==="number";const verifyAgent=u=>{if(!(u&&typeof u.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=u=>{for(const A of u){if(A.family===6){continue}A.address=`::ffff:${A.address}`;A.family=6}};const getIfaceInfo=()=>{let u=false;let A=false;for(const p of Object.values(Qr.networkInterfaces())){for(const y of p){if(y.internal){continue}if(y.family==="IPv6"){A=true}else{u=true}if(u&&A){return{has4:u,has6:A}}}}return{has4:u,has6:A}};const source_isIterable=u=>Symbol.iterator in u;const ignoreNoResultErrors=u=>u.catch((u=>{if(u.code==="ENODATA"||u.code==="ENOTFOUND"||u.code==="ENOENT"){return[]}throw u}));const Mo={ttl:true};const Uo={all:true};const Ho={all:true,family:4};const Go={all:true,family:6};class CacheableLookup{constructor({cache:u=new Map,maxTtl:A=Infinity,fallbackDuration:p=3600,errorTtl:y=.15,resolver:E=new To,lookup:C=_o.lookup}={}){this.maxTtl=A;this.errorTtl=y;this._cache=u;this._resolver=E;this._dnsLookup=C&&(0,cn.promisify)(C);this.stats={cache:0,query:0};if(this._resolver instanceof To){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=(0,cn.promisify)(this._resolver.resolve4.bind(this._resolver));this._resolve6=(0,cn.promisify)(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=p;if(p>0){const u=setInterval((()=>{this._hostnamesToFallback.clear()}),p*1e3);if(u.unref){u.unref()}this._fallbackInterval=u}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(u){this.clear();this._resolver.setServers(u)}get servers(){return this._resolver.getServers()}lookup(u,A,p){if(typeof A==="function"){p=A;A={}}else if(typeof A==="number"){A={family:A}}if(!p){throw new Error("Callback must be a function.")}this.lookupAsync(u,A).then((u=>{if(A.all){p(null,u)}else{p(null,u.address,u.family,u.expires,u.ttl,u.source)}}),p)}async lookupAsync(u,A={}){if(typeof A==="number"){A={family:A}}let p=await this.query(u);if(A.family===6){const u=p.filter((u=>u.family===6));if(A.hints&_o.V4MAPPED){if(Oo&&A.hints&_o.ALL||u.length===0){map4to6(p)}else{p=u}}else{p=u}}else if(A.family===4){p=p.filter((u=>u.family===4))}if(A.hints&_o.ADDRCONFIG){const{_iface:u}=this;p=p.filter((A=>A.family===6?u.has6:u.has4))}if(p.length===0){const A=new Error(`cacheableLookup ENOTFOUND ${u}`);A.code="ENOTFOUND";A.hostname=u;throw A}if(A.all){return p}return p[0]}async query(u){let A="cache";let p=await this._cache.get(u);if(p){this.stats.cache++}if(!p){const y=this._pending[u];if(y){this.stats.cache++;p=await y}else{A="query";const y=this.queryAndCache(u);this._pending[u]=y;this.stats.query++;try{p=await y}finally{delete this._pending[u]}}}p=p.map((u=>({...u,source:A})));return p}async _resolve(u){const[A,p]=await Promise.all([ignoreNoResultErrors(this._resolve4(u,Mo)),ignoreNoResultErrors(this._resolve6(u,Mo))]);let y=0;let E=0;let C=0;const I=Date.now();for(const u of A){u.family=4;u.expires=I+u.ttl*1e3;y=Math.max(y,u.ttl)}for(const u of p){u.family=6;u.expires=I+u.ttl*1e3;E=Math.max(E,u.ttl)}if(A.length>0){if(p.length>0){C=Math.min(y,E)}else{C=y}}else{C=E}return{entries:[...A,...p],cacheTtl:C}}async _lookup(u){try{const[A,p]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(u,Ho)),ignoreNoResultErrors(this._dnsLookup(u,Go))]);return{entries:[...A,...p],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(u,A,p){if(this.maxTtl>0&&p>0){p=Math.min(p,this.maxTtl)*1e3;A[Po]=Date.now()+p;try{await this._cache.set(u,A,p)}catch(u){this.lookupAsync=async()=>{const A=new Error("Cache Error. Please recreate the CacheableLookup instance.");A.cause=u;throw A}}if(source_isIterable(this._cache)){this._tick(p)}}}async queryAndCache(u){if(this._hostnamesToFallback.has(u)){return this._dnsLookup(u,Uo)}let A=await this._resolve(u);if(A.entries.length===0&&this._dnsLookup){A=await this._lookup(u);if(A.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(u)}}const p=A.entries.length===0?this.errorTtl:A.cacheTtl;await this._set(u,A.entries,p);return A.entries}_tick(u){const A=this._nextRemovalTime;if(!A||u<A){clearTimeout(this._removalTimeout);this._nextRemovalTime=u;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let u=Infinity;const A=Date.now();for(const[p,y]of this._cache){const E=y[Po];if(A>=E){this._cache.delete(p)}else if(E<u){u=E}}if(u!==Infinity){this._tick(u-A)}}),u);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(u){verifyAgent(u);if(No in u){throw new Error("CacheableLookup has been already installed")}u[No]=u.createConnection;u[Lo]=this;u.createConnection=(A,p)=>{if(!("lookup"in A)){A.lookup=this.lookup}return u[No](A,p)}}uninstall(u){verifyAgent(u);if(u[No]){if(u[Lo]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}u.createConnection=u[No];delete u[No];delete u[Lo]}}updateInterfaceInfo(){const{_iface:u}=this;this._iface=getIfaceInfo();if(u.has4&&!this._iface.has4||u.has6&&!this._iface.has6){this._cache.clear()}}clear(u){if(u){this._cache.delete(u);return}this._cache.clear()}}var Wo=p(882);function parseLinkHeader(u){const A=[];const p=u.split(",");for(const y of p){const[p,...E]=y.split(";");const C=p.trim();if(C[0]!=="<"||C.at(-1)!==">"){throw new Error(`Invalid format of the Link header reference: ${C}`)}const I=C.slice(1,-1);const w={};if(E.length===0){throw new Error(`Unexpected end of Link header parameters: ${E.join(";")}`)}for(const A of E){const p=A.trim();const y=p.indexOf("=");if(y===-1){throw new Error(`Failed to parse Link header: ${u}`)}const E=p.slice(0,y).trim();const C=p.slice(y+1).trim();w[E]=C}A.push({reference:I,parameters:w})}return A}const[jo,zo]=un.versions.node.split(".").map(Number);function wrapAssertionWithContext(u,A){try{A()}catch(A){if(A instanceof Error){A.message=`Option '${u}': ${A.message}`}throw A}}function options_assertAny(u,A,p){wrapAssertionWithContext(u,(()=>{Ti.any(A,p)}))}function options_assertPlainObject(u,A){wrapAssertionWithContext(u,(()=>{Ti.plainObject(A)}))}function validateSearchParameters(u){for(const A in u){const p=u[A];options_assertAny(`searchParams.${A}`,[Pi.string,Pi.number,Pi.boolean,Pi.null,Pi.undefined],p)}}const $o=new Map;let qo;const getGlobalDnsCache=()=>{if(qo){return qo}qo=new CacheableLookup;return qo};const wrapQuickLruIfNeeded=u=>{if(u?.[Symbol.toStringTag]==="QuickLRU"&&typeof u.evict==="function"){return{get(A){return u.get(A)},set(A,p,y){if(y===undefined){u.set(A,p)}else{u.set(A,p,{maxAge:y})}return true},delete(A){return u.delete(A)},clear(){return u.clear()},has(A){return u.has(A)}}}return u};const Vo={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],beforeCache:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,copyPipedHeaders:true,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:u})=>u,backoffLimit:Number.POSITIVE_INFINITY,noise:100,enforceRetryRules:false},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,serverName:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined,secureOptions:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(u){if(u.request.options.responseType==="json"){return u.body}return JSON.parse(u.body)},paginate({response:u}){const A=u.headers.link;if(typeof A!=="string"||A.trim()===""){return false}const p=parseLinkHeader(A);const y=p.find((u=>u.parameters.rel==="next"||u.parameters.rel==='"next"'));if(y){return{url:new URL(y.reference,u.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined,signal:undefined,enableUnixSockets:false,strictContentLength:false};const cloneInternals=u=>{const{hooks:A,retry:p}=u;const y={...u,context:{...u.context},cacheOptions:{...u.cacheOptions},https:{...u.https},agent:{...u.agent},headers:{...u.headers},retry:{...p,errorCodes:[...p.errorCodes],methods:[...p.methods],statusCodes:[...p.statusCodes]},timeout:{...u.timeout},hooks:{init:[...A.init],beforeRequest:[...A.beforeRequest],beforeError:[...A.beforeError],beforeRedirect:[...A.beforeRedirect],beforeRetry:[...A.beforeRetry],beforeCache:[...A.beforeCache],afterResponse:[...A.afterResponse]},searchParams:u.searchParams?new URLSearchParams(u.searchParams):undefined,pagination:{...u.pagination}};return y};const cloneRaw=u=>{const{hooks:A,retry:p}=u;const y={...u};if(Pi.object(u.context)){y.context={...u.context}}if(Pi.object(u.cacheOptions)){y.cacheOptions={...u.cacheOptions}}if(Pi.object(u.https)){y.https={...u.https}}if(Pi.object(u.cacheOptions)){y.cacheOptions={...y.cacheOptions}}if(Pi.object(u.agent)){y.agent={...u.agent}}if(Pi.object(u.headers)){y.headers={...u.headers}}if(Pi.object(p)){y.retry={...p};if(Pi.array(p.errorCodes)){y.retry.errorCodes=[...p.errorCodes]}if(Pi.array(p.methods)){y.retry.methods=[...p.methods]}if(Pi.array(p.statusCodes)){y.retry.statusCodes=[...p.statusCodes]}}if(Pi.object(u.timeout)){y.timeout={...u.timeout}}if(Pi.object(A)){y.hooks={...A};if(Pi.array(A.init)){y.hooks.init=[...A.init]}if(Pi.array(A.beforeRequest)){y.hooks.beforeRequest=[...A.beforeRequest]}if(Pi.array(A.beforeError)){y.hooks.beforeError=[...A.beforeError]}if(Pi.array(A.beforeRedirect)){y.hooks.beforeRedirect=[...A.beforeRedirect]}if(Pi.array(A.beforeRetry)){y.hooks.beforeRetry=[...A.beforeRetry]}if(Pi.array(A.beforeCache)){y.hooks.beforeCache=[...A.beforeCache]}if(Pi.array(A.afterResponse)){y.hooks.afterResponse=[...A.afterResponse]}}if(u.searchParams){if(Pi.string(u.searchParams)){y.searchParams=u.searchParams}else if(u.searchParams instanceof URLSearchParams){y.searchParams=new URLSearchParams(u.searchParams)}else if(Pi.object(u.searchParams)){y.searchParams={...u.searchParams}}}if(Pi.object(u.pagination)){y.pagination={...u.pagination}}return y};const getHttp2TimeoutOption=u=>{const A=[u.timeout.socket,u.timeout.connect,u.timeout.lookup,u.timeout.request,u.timeout.secureConnect].filter((u=>typeof u==="number"));if(A.length>0){return Math.min(...A)}return undefined};const init=(u,A,p)=>{const y=u.hooks?.init;if(y){for(const u of y){u(A,p)}}};class Options{_unixOptions;_internals;_merging=false;_init;constructor(u,A,p){options_assertAny("input",[Pi.string,Pi.urlInstance,Pi.object,Pi.undefined],u);options_assertAny("options",[Pi.object,Pi.undefined],A);options_assertAny("defaults",[Pi.object,Pi.undefined],p);if(u instanceof Options||A instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(p?._internals??p??Vo);this._init=[...p?._init??[]];try{if(Pi.plainObject(u)){try{this.merge(u);this.merge(A)}finally{this.url=u.url}}else{try{this.merge(A)}finally{if(A?.url!==undefined){if(u===undefined){this.url=A.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(u!==undefined){this.url=u}}}}catch(u){u.options=this;throw u}}merge(u){if(!u){return}if(u instanceof Options){const A=[...u._init];for(const u of A){this.merge(u)}return}u=cloneRaw(u);init(this,u,this);init(u,u,this);this._merging=true;if("isStream"in u){this.isStream=u.isStream}try{let A=false;for(const p in u){if(p==="mutableDefaults"||p==="handlers"){continue}if(p==="url"){continue}if(p==="preserveHooks"){continue}if(!(p in this)){throw new Error(`Unexpected option: ${p}`)}const y=u[p];if(y===undefined){continue}this[p]=y;A=true}if(A){this._init.push(u)}}finally{this._merging=false}}get request(){return this._internals.request}set request(u){options_assertAny("request",[Pi.function,Pi.undefined],u);this._internals.request=u}get agent(){return this._internals.agent}set agent(u){options_assertPlainObject("agent",u);for(const A in u){if(!(A in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${A}`)}options_assertAny(`agent.${A}`,[Pi.object,Pi.undefined,u=>u===false],u[A])}if(this._merging){Object.assign(this._internals.agent,u)}else{this._internals.agent={...u}}}get h2session(){return this._internals.h2session}set h2session(u){this._internals.h2session=u}get decompress(){return this._internals.decompress}set decompress(u){Ti.boolean(u);this._internals.decompress=u}get timeout(){return this._internals.timeout}set timeout(u){options_assertPlainObject("timeout",u);for(const A in u){if(!(A in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${A}`)}options_assertAny(`timeout.${A}`,[Pi.number,Pi.undefined],u[A])}if(this._merging){Object.assign(this._internals.timeout,u)}else{this._internals.timeout={...u}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(u){options_assertAny("prefixUrl",[Pi.string,Pi.urlInstance],u);if(u===""){this._internals.prefixUrl="";return}u=u.toString();if(!u.endsWith("/")){u+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:A}=this._internals.url;this._internals.url.href=u+A.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=u}get body(){return this._internals.body}set body(u){options_assertAny("body",[Pi.string,Pi.buffer,Pi.nodeStream,Pi.generator,Pi.asyncGenerator,Pi.iterable,Pi.asyncIterable,lib_isFormData,Pi.typedArray,Pi.undefined],u);if(Pi.nodeStream(u)){Ti.truthy(u.readable)}if(u!==undefined){Ti.undefined(this._internals.form);Ti.undefined(this._internals.json)}this._internals.body=u}get form(){return this._internals.form}set form(u){options_assertAny("form",[Pi.plainObject,Pi.undefined],u);if(u!==undefined){Ti.undefined(this._internals.body);Ti.undefined(this._internals.json)}this._internals.form=u}get json(){return this._internals.json}set json(u){if(u!==undefined){Ti.undefined(this._internals.body);Ti.undefined(this._internals.form)}this._internals.json=u}get url(){return this._internals.url}set url(u){options_assertAny("url",[Pi.string,Pi.urlInstance,Pi.undefined],u);if(u===undefined){this._internals.url=undefined;return}if(Pi.string(u)&&u.startsWith("/")){throw new Error("`url` must not start with a slash")}const A=u.toString();const p=Pi.urlInstance(u)||/^[a-z][a-z\d+.-]*:\/\//i.test(A);const y=p?A:`${this.prefixUrl}${A}`;const E=new URL(y);this._internals.url=E;if(E.protocol==="unix:"){E.href=`http://unix${E.pathname}${E.search}`}if(E.protocol!=="http:"&&E.protocol!=="https:"){const u=new Error(`Unsupported protocol: ${E.protocol}`);u.code="ERR_UNSUPPORTED_PROTOCOL";throw u}if(this._internals.username){E.username=this._internals.username;this._internals.username=""}if(this._internals.password){E.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){E.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(E.hostname==="unix"){if(!this._internals.enableUnixSockets){throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled")}const u=/(?<socketPath>.+?):(?<path>.+)/.exec(`${E.pathname}${E.search}`);if(u?.groups){const{socketPath:A,path:p}=u.groups;this._unixOptions={socketPath:A,path:p,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(u){options_assertAny("cookieJar",[Pi.object,Pi.undefined],u);if(u===undefined){this._internals.cookieJar=undefined;return}let{setCookie:A,getCookieString:p}=u;Ti.function(A);Ti.function(p);if(A.length===4&&p.length===0){A=(0,cn.promisify)(A.bind(u));p=(0,cn.promisify)(p.bind(u));this._internals.cookieJar={setCookie:A,getCookieString:p}}else{this._internals.cookieJar=u}}get signal(){return this._internals.signal}set signal(u){Ti.object(u);this._internals.signal=u}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(u){Ti.boolean(u);this._internals.ignoreInvalidCookies=u}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new URLSearchParams}return this._internals.searchParams}set searchParams(u){options_assertAny("searchParams",[Pi.string,Pi.object,Pi.undefined],u);const A=this._internals.url;if(u===undefined){this._internals.searchParams=undefined;if(A){A.search=""}return}const p=this.searchParams;let y;if(Pi.string(u)){y=new URLSearchParams(u)}else if(u instanceof URLSearchParams){y=u}else{validateSearchParameters(u);y=new URLSearchParams;for(const A in u){const E=u[A];if(E===null){y.append(A,"")}else if(E===undefined){p.delete(A)}else{y.append(A,E)}}}if(this._merging){for(const u of y.keys()){p.delete(u)}for(const[u,A]of y){p.append(u,A)}}else if(A){A.search=p.toString()}else{this._internals.searchParams=p}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(u){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(u){options_assertAny("dnsLookup",[Pi.function,Pi.undefined],u);this._internals.dnsLookup=u}get dnsCache(){return this._internals.dnsCache}set dnsCache(u){options_assertAny("dnsCache",[Pi.object,Pi.boolean,Pi.undefined],u);if(u===true){this._internals.dnsCache=getGlobalDnsCache()}else if(u===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=u}}get context(){return this._internals.context}set context(u){Ti.object(u);if(this._merging){Object.assign(this._internals.context,u)}else{this._internals.context={...u}}}get hooks(){return this._internals.hooks}set hooks(u){Ti.object(u);for(const A in u){if(!(A in this._internals.hooks)){throw new Error(`Unexpected hook event: ${A}`)}const p=A;const y=u[p];options_assertAny(`hooks.${A}`,[Pi.array,Pi.undefined],y);if(y){for(const u of y){Ti.function(u)}}if(this._merging){if(y){this._internals.hooks[p].push(...y)}}else{if(!y){throw new Error(`Missing hook event: ${A}`)}this._internals.hooks[A]=[...y]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(u){options_assertAny("followRedirect",[Pi.boolean,Pi.function],u);this._internals.followRedirect=u}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(u){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(u){Ti.number(u);this._internals.maxRedirects=u}get cache(){return this._internals.cache}set cache(u){options_assertAny("cache",[Pi.object,Pi.string,Pi.boolean,Pi.undefined],u);if(u===true){this._internals.cache=$o}else if(u===false){this._internals.cache=undefined}else{this._internals.cache=wrapQuickLruIfNeeded(u)}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(u){Ti.boolean(u);this._internals.throwHttpErrors=u}get username(){const u=this._internals.url;const A=u?u.username:this._internals.username;return decodeURIComponent(A)}set username(u){Ti.string(u);const A=this._internals.url;const p=encodeURIComponent(u);if(A){A.username=p}else{this._internals.username=p}}get password(){const u=this._internals.url;const A=u?u.password:this._internals.password;return decodeURIComponent(A)}set password(u){Ti.string(u);const A=this._internals.url;const p=encodeURIComponent(u);if(A){A.password=p}else{this._internals.password=p}}get http2(){return this._internals.http2}set http2(u){Ti.boolean(u);this._internals.http2=u}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(u){Ti.boolean(u);this._internals.allowGetBody=u}get copyPipedHeaders(){return this._internals.copyPipedHeaders}set copyPipedHeaders(u){Ti.boolean(u);this._internals.copyPipedHeaders=u}get headers(){return this._internals.headers}set headers(u){options_assertPlainObject("headers",u);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(u))}else{this._internals.headers=lowercaseKeys(u)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(u){Ti.boolean(u);this._internals.methodRewriting=u}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(u){if(u!==undefined&&u!==4&&u!==6){throw new TypeError(`Invalid DNS lookup IP version: ${u}`)}this._internals.dnsLookupIpVersion=u}get parseJson(){return this._internals.parseJson}set parseJson(u){Ti.function(u);this._internals.parseJson=u}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(u){Ti.function(u);this._internals.stringifyJson=u}get retry(){return this._internals.retry}set retry(u){options_assertPlainObject("retry",u);options_assertAny("retry.calculateDelay",[Pi.function,Pi.undefined],u.calculateDelay);options_assertAny("retry.maxRetryAfter",[Pi.number,Pi.undefined],u.maxRetryAfter);options_assertAny("retry.limit",[Pi.number,Pi.undefined],u.limit);options_assertAny("retry.methods",[Pi.array,Pi.undefined],u.methods);options_assertAny("retry.statusCodes",[Pi.array,Pi.undefined],u.statusCodes);options_assertAny("retry.errorCodes",[Pi.array,Pi.undefined],u.errorCodes);options_assertAny("retry.noise",[Pi.number,Pi.undefined],u.noise);options_assertAny("retry.enforceRetryRules",[Pi.boolean,Pi.undefined],u.enforceRetryRules);if(u.noise&&Math.abs(u.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${u.noise}`)}for(const A in u){if(!(A in this._internals.retry)){throw new Error(`Unexpected retry option: ${A}`)}}if(this._merging){Object.assign(this._internals.retry,u)}else{this._internals.retry={...u}}const{retry:A}=this._internals;A.methods=[...new Set(A.methods.map((u=>u.toUpperCase())))];A.statusCodes=[...new Set(A.statusCodes)];A.errorCodes=[...new Set(A.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(u){options_assertAny("localAddress",[Pi.string,Pi.undefined],u);this._internals.localAddress=u}get method(){return this._internals.method}set method(u){Ti.string(u);this._internals.method=u.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(u){options_assertAny("createConnection",[Pi.function,Pi.undefined],u);this._internals.createConnection=u}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(u){options_assertPlainObject("cacheOptions",u);options_assertAny("cacheOptions.shared",[Pi.boolean,Pi.undefined],u.shared);options_assertAny("cacheOptions.cacheHeuristic",[Pi.number,Pi.undefined],u.cacheHeuristic);options_assertAny("cacheOptions.immutableMinTimeToLive",[Pi.number,Pi.undefined],u.immutableMinTimeToLive);options_assertAny("cacheOptions.ignoreCargoCult",[Pi.boolean,Pi.undefined],u.ignoreCargoCult);for(const A in u){if(!(A in this._internals.cacheOptions)){throw new Error(`Cache option \`${A}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,u)}else{this._internals.cacheOptions={...u}}}get https(){return this._internals.https}set https(u){options_assertPlainObject("https",u);options_assertAny("https.rejectUnauthorized",[Pi.boolean,Pi.undefined],u.rejectUnauthorized);options_assertAny("https.checkServerIdentity",[Pi.function,Pi.undefined],u.checkServerIdentity);options_assertAny("https.serverName",[Pi.string,Pi.undefined],u.serverName);options_assertAny("https.certificateAuthority",[Pi.string,Pi.object,Pi.array,Pi.undefined],u.certificateAuthority);options_assertAny("https.key",[Pi.string,Pi.object,Pi.array,Pi.undefined],u.key);options_assertAny("https.certificate",[Pi.string,Pi.object,Pi.array,Pi.undefined],u.certificate);options_assertAny("https.passphrase",[Pi.string,Pi.undefined],u.passphrase);options_assertAny("https.pfx",[Pi.string,Pi.buffer,Pi.array,Pi.undefined],u.pfx);options_assertAny("https.alpnProtocols",[Pi.array,Pi.undefined],u.alpnProtocols);options_assertAny("https.ciphers",[Pi.string,Pi.undefined],u.ciphers);options_assertAny("https.dhparam",[Pi.string,Pi.buffer,Pi.undefined],u.dhparam);options_assertAny("https.signatureAlgorithms",[Pi.string,Pi.undefined],u.signatureAlgorithms);options_assertAny("https.minVersion",[Pi.string,Pi.undefined],u.minVersion);options_assertAny("https.maxVersion",[Pi.string,Pi.undefined],u.maxVersion);options_assertAny("https.honorCipherOrder",[Pi.boolean,Pi.undefined],u.honorCipherOrder);options_assertAny("https.tlsSessionLifetime",[Pi.number,Pi.undefined],u.tlsSessionLifetime);options_assertAny("https.ecdhCurve",[Pi.string,Pi.undefined],u.ecdhCurve);options_assertAny("https.certificateRevocationLists",[Pi.string,Pi.buffer,Pi.array,Pi.undefined],u.certificateRevocationLists);options_assertAny("https.secureOptions",[Pi.number,Pi.undefined],u.secureOptions);for(const A in u){if(!(A in this._internals.https)){throw new Error(`HTTPS option \`${A}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,u)}else{this._internals.https={...u}}}get encoding(){return this._internals.encoding}set encoding(u){if(u===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}options_assertAny("encoding",[Pi.string,Pi.undefined],u);this._internals.encoding=u}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(u){Ti.boolean(u);this._internals.resolveBodyOnly=u}get isStream(){return this._internals.isStream}set isStream(u){Ti.boolean(u);this._internals.isStream=u}get responseType(){return this._internals.responseType}set responseType(u){if(u===undefined){this._internals.responseType="text";return}if(u!=="text"&&u!=="buffer"&&u!=="json"){throw new Error(`Invalid \`responseType\` option: ${u}`)}this._internals.responseType=u}get pagination(){return this._internals.pagination}set pagination(u){Ti.object(u);if(this._merging){Object.assign(this._internals.pagination,u)}else{this._internals.pagination=u}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(u){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(u){Ti.boolean(u);this._internals.setHost=u}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(u){options_assertAny("maxHeaderSize",[Pi.number,Pi.undefined],u);this._internals.maxHeaderSize=u}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(u){Ti.boolean(u);this._internals.enableUnixSockets=u}get strictContentLength(){return this._internals.strictContentLength}set strictContentLength(u){Ti.boolean(u);this._internals.strictContentLength=u}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](u,A){return(0,cn.inspect)(this._internals,A)}createNativeRequestOptions(){const u=this._internals;const A=u.url;let p;if(A.protocol==="https:"){if(u.http2){p={...u.agent,http2:u.agent.http2??Wo.globalAgent}}else{p=u.agent.https}}else{p=u.agent.http}const{https:y}=u;let{pfx:E}=y;if(Pi.array(E)&&Pi.plainObject(E[0])){E=E.map((u=>({buf:u.buffer,passphrase:u.passphrase})))}return{...u.cacheOptions,...this._unixOptions,ALPNProtocols:y.alpnProtocols,ca:y.certificateAuthority,cert:y.certificate,key:y.key,passphrase:y.passphrase,pfx:y.pfx,rejectUnauthorized:y.rejectUnauthorized,checkServerIdentity:y.checkServerIdentity??xo.checkServerIdentity,servername:y.serverName,ciphers:y.ciphers,honorCipherOrder:y.honorCipherOrder,minVersion:y.minVersion,maxVersion:y.maxVersion,sigalgs:y.signatureAlgorithms,sessionTimeout:y.tlsSessionLifetime,dhparam:y.dhparam,ecdhCurve:y.ecdhCurve,crl:y.certificateRevocationLists,secureOptions:y.secureOptions,lookup:u.dnsLookup??u.dnsCache?.lookup,family:u.dnsLookupIpVersion,agent:p,setHost:u.setHost,method:u.method,maxHeaderSize:u.maxHeaderSize,localAddress:u.localAddress,headers:u.headers,createConnection:u.createConnection,timeout:u.http2?getHttp2TimeoutOption(u):undefined,h2session:u.h2session}}getRequestFunction(){const u=this._internals.url;const{request:A}=this._internals;if(!A&&u){return this.getFallbackRequestFunction()}return A}getFallbackRequestFunction(){const u=this._internals.url;if(!u){return}if(u.protocol==="https:"){if(this._internals.http2){if(jo<15||jo===15&&zo<10){const u=new Error("To use the `http2` option, install Node.js 15.10.0 or above");u.code="EUNSUPPORTED";throw u}return Wo.auto}return Ro.request}return Mi.request}freeze(){const u=this._internals;Object.freeze(u);Object.freeze(u.hooks);Object.freeze(u.hooks.afterResponse);Object.freeze(u.hooks.beforeError);Object.freeze(u.hooks.beforeRedirect);Object.freeze(u.hooks.beforeRequest);Object.freeze(u.hooks.beforeRetry);Object.freeze(u.hooks.init);Object.freeze(u.https);Object.freeze(u.cacheOptions);Object.freeze(u.agent);Object.freeze(u.headers);Object.freeze(u.timeout);Object.freeze(u.retry);Object.freeze(u.retry.errorCodes);Object.freeze(u.retry.methods);Object.freeze(u.retry.statusCodes)}}const isResponseOk=u=>{const{statusCode:A}=u;const{followRedirect:p}=u.request.options;const y=typeof p==="function"?p(u):p;const E=y?299:399;return A>=200&&A<=E||A===304};class ParseError extends RequestError{name="ParseError";code="ERR_BODY_PARSE_FAILURE";constructor(u,A){const{options:p}=A.request;super(`${u.message} in "${p.url.toString()}"`,u,A.request)}}const parseBody=(u,A,p,y)=>{const{rawBody:E}=u;try{if(A==="text"){return E.toString(y)}if(A==="json"){return E.length===0?"":p(E.toString(y))}if(A==="buffer"){return E}}catch(A){throw new ParseError(A,u)}throw new ParseError({message:`Unknown body type '${A}'`,name:"Error"},u)};function isClientRequest(u){return u.writable&&!u.writableEnded}const Ko=isClientRequest;function isUnixSocketURL(u){return u.protocol==="unix:"||u.hostname==="unix"}function getUnixSocketPath(u){if(!isUnixSocketURL(u)){return undefined}return/(?<socketPath>.+?):(?<path>.+)/.exec(`${u.pathname}${u.search}`)?.groups?.socketPath}const Jo=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:diagnostics_channel");const Yo={requestCreate:Jo.channel("got:request:create"),requestStart:Jo.channel("got:request:start"),responseStart:Jo.channel("got:response:start"),responseEnd:Jo.channel("got:response:end"),retry:Jo.channel("got:request:retry"),error:Jo.channel("got:request:error"),redirect:Jo.channel("got:response:redirect")};function generateRequestId(){return(0,Hi.randomUUID)()}function publishRequestCreate(u){if(Yo.requestCreate.hasSubscribers){Yo.requestCreate.publish(u)}}function publishRequestStart(u){if(Yo.requestStart.hasSubscribers){Yo.requestStart.publish(u)}}function publishResponseStart(u){if(Yo.responseStart.hasSubscribers){Yo.responseStart.publish(u)}}function publishResponseEnd(u){if(Yo.responseEnd.hasSubscribers){Yo.responseEnd.publish(u)}}function publishRetry(u){if(Yo.retry.hasSubscribers){Yo.retry.publish(u)}}function publishError(u){if(Yo.error.hasSubscribers){Yo.error.publish(u)}}function publishRedirect(u){if(Yo.redirect.hasSubscribers){Yo.redirect.publish(u)}}const Xo=Pi.string(un.versions.brotli);const Zo=Pi.string(un.versions.zstd);const ea=new Set(["GET","HEAD"]);const ta=new WeakableMap;const ra=new Set([300,301,302,303,304,307,308]);const ia=new WeakSet;const oa=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends Pe.Duplex{["constructor"];_noPipe;options;response;requestUrl;redirectUrls=[];retryCount=0;_stopReading=false;_stopRetry=core_noop;_downloadedSize=0;_uploadedSize=0;_pipedServerResponses=new Set;_request;_responseSize;_bodySize;_unproxyEvents=core_noop;_isFromCache;_triggerRead=false;_jobs=[];_cancelTimeouts=core_noop;_removeListeners=core_noop;_nativeResponse;_flushed=false;_aborted=false;_expectedContentLength;_compressedBytesCount;_requestId=generateRequestId();_requestInitialized=false;constructor(u,A,p){super({autoDestroy:false,highWaterMark:0});this.on("pipe",(u=>{if(this.options.copyPipedHeaders&&u?.headers){Object.assign(this.options.headers,u.headers)}}));this.on("newListener",(u=>{if(u==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(u,A,p);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url;publishRequestCreate({requestId:this._requestId,url:this.options.url?.toString()??"",method:this.options.method})}catch(u){const{options:A}=u;if(A){this.options=A}this.flush=async()=>{this.flush=async()=>{};un.nextTick((()=>{if(this.options){this._beforeError(u)}else{const A=u instanceof RequestError?u:new RequestError(u.message,u,this);this.destroy(A)}}))};return}const{body:y}=this.options;if(Pi.nodeStream(y)){y.once("error",(u=>{if(this._flushed){this._beforeError(new UploadError(u,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(u,this))}}}))}if(this.options.signal){const abort=()=>{if(this.options.signal?.reason?.name==="TimeoutError"){this.destroy(new TimeoutError(this.options.signal.reason,this.timings,this))}else{this.destroy(new AbortError(this))}};if(this.options.signal.aborted){abort()}else{this.options.signal.addEventListener("abort",abort);this._removeListeners=()=>{this.options.signal?.removeEventListener("abort",abort)}}}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const u of this._jobs){u()}this._jobs.length=0;this._requestInitialized=true}catch(u){this._beforeError(u)}}_beforeError(u){if(this._stopReading){return}const{response:A,options:p}=this;const y=this.retryCount+(u.name==="RetryError"?0:1);this._stopReading=true;if(!(u instanceof RequestError)){u=new RequestError(u.message,u,this)}const E=u;void(async()=>{if(A?.readable&&!A.rawBody&&!this._request?.socket?.destroyed){A.setEncoding(this.readableEncoding);const u=await this._setRawBody(A);if(u){A.body=A.rawBody.toString()}}if(this.listenerCount("retry")!==0){let C;try{let u;if(A&&"retry-after"in A.headers){u=Number(A.headers["retry-after"]);if(Number.isNaN(u)){u=Date.parse(A.headers["retry-after"])-Date.now();if(u<=0){u=1}}else{u*=1e3}}const I=p.retry;const w=Fo({attemptCount:y,retryOptions:I,error:E,retryAfter:u,computedValue:I.maxRetryAfter??p.timeout.request??Number.POSITIVE_INFINITY});if(I.enforceRetryRules&&w===0){C=0}else{C=await I.calculateDelay({attemptCount:y,retryOptions:I,error:E,retryAfter:u,computedValue:w})}}catch(u){void this._error(new RequestError(u.message,u,this));return}if(C){await new Promise((u=>{const A=setTimeout(u,C);this._stopRetry=()=>{clearTimeout(A);u()}}));if(this.destroyed){return}const A=this.options.body;try{for(const u of this.options.hooks.beforeRetry){await u(E,this.retryCount+1)}}catch(u){void this._error(new RequestError(u.message,u,this));return}if(this.destroyed){return}const y=this.options.body;const I=A!==y;if(I){const u=A;this.options.body=undefined;this.destroy();if(Pi.nodeStream(u)&&u!==y){u.destroy()}if(Pi.nodeStream(y)&&(y.readableEnded||y.destroyed)){throw new TypeError("The reassigned stream body must be readable. Ensure you provide a fresh, readable stream in the beforeRetry hook.")}this.options._internals.body=y}else{this.destroy()}publishRetry({requestId:this._requestId,retryCount:this.retryCount+1,error:E,delay:C});this.emit("retry",this.retryCount+1,u,(u=>{const A=new Request(p.url,u,p);A.retryCount=this.retryCount+1;un.nextTick((()=>{void A.flush()}));return A}));return}}void this._error(E)})()}_read(){this._triggerRead=true;const{response:u}=this;if(u&&!this._stopReading){if(u.readableLength){this._triggerRead=false}let A;while((A=u.read())!==null){this._downloadedSize+=A.length;const u=this.downloadProgress;if(u.percent<1){this.emit("downloadProgress",u)}this.push(A)}}}_write(u,A,p){const write=()=>{this._writeRequest(u,A,p)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(u){const endRequest=()=>{if(!this._request||this._request.destroyed){u();return}this._request.end((A=>{if(this._request?._writableState?.errored){return}if(!A){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request?.emit("upload-complete")}u(A)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(u,A){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();this._removeListeners();if(this.options){const{body:u}=this.options;if(Pi.nodeStream(u)){u.destroy()}}if(this._request){this._request.destroy()}const p=this._request?.timings;if(p&&Pi.undefined(p.end)&&!Pi.undefined(p.response)&&Pi.undefined(p.error)&&Pi.undefined(p.abort)){p.end=Date.now();if(Pi.undefined(p.phases.total)){p.phases.download=p.end-p.response;p.phases.total=p.end-p.start}}if(u!==null&&!Pi.undefined(u)){const A=u instanceof Error&&ia.has(u);if(!A&&!(u instanceof RequestError)){u=u instanceof Error?new RequestError(u.message,u,this):new RequestError(String(u),{},this)}}A(u)}pipe(u,A){if(u instanceof Mi.ServerResponse){this._pipedServerResponses.add(u)}return super.pipe(u,A)}unpipe(u){if(u instanceof Mi.ServerResponse){this._pipedServerResponses.delete(u)}super.unpipe(u);return this}_checkContentLengthMismatch(){if(this.options.strictContentLength&&this._expectedContentLength!==undefined){const u=this._compressedBytesCount??this._downloadedSize;if(u!==this._expectedContentLength){this._beforeError(new ReadError({message:`Content-Length mismatch: expected ${this._expectedContentLength} bytes, received ${u} bytes`,name:"Error",code:"ERR_HTTP_CONTENT_LENGTH_MISMATCH"},this));return true}}return false}async _finalizeBody(){const{options:u}=this;const{headers:A}=u;const p=!Pi.undefined(u.form);const y=!Pi.undefined(u.json);const E=!Pi.undefined(u.body);const C=ea.has(u.method)&&!(u.method==="GET"&&u.allowGetBody);if(p||y||E){if(C){throw new TypeError(`The \`${u.method}\` method cannot be used with a body`)}const y=!Pi.string(A["content-type"]);if(E){if(lib_isFormData(u.body)){const p=new Bo(u.body);if(y){A["content-type"]=p.headers["Content-Type"]}if("Content-Length"in p.headers){A["content-length"]=p.headers["Content-Length"]}u.body=p.encode()}if(is_form_data_isFormData(u.body)&&y){A["content-type"]=`multipart/form-data; boundary=${u.body.getBoundary()}`}}else if(p){if(y){A["content-type"]="application/x-www-form-urlencoded"}const{form:p}=u;u.form=undefined;u.body=new URLSearchParams(p).toString()}else{if(y){A["content-type"]="application/json"}const{json:p}=u;u.json=undefined;u.body=u.stringifyJson(p)}const I=await getBodySize(u.body,u.headers);if(Pi.undefined(A["content-length"])&&Pi.undefined(A["transfer-encoding"])&&!C&&!Pi.undefined(I)){A["content-length"]=String(I)}}if(u.responseType==="json"&&!("accept"in u.headers)){u.headers.accept="application/json"}this._bodySize=Number(A["content-length"])||undefined}async _onResponseBase(u){if(this.isAborted){return}const{options:A}=this;const{url:p}=A;this._nativeResponse=u;const y=u.statusCode;const{method:E}=A;const C=E==="HEAD"||y>=100&&y<200||y===204||y===205||y===304;if(A.decompress&&!C){if(A.strictContentLength){this._compressedBytesCount=0;this._nativeResponse.on("data",(u=>{this._compressedBytesCount+=byteLength(u)}))}u=decompressResponse(u)}const I=u;I.statusMessage=I.statusMessage||Mi.STATUS_CODES[y];I.url=A.url.toString();I.requestUrl=this.requestUrl;I.redirectUrls=this.redirectUrls;I.request=this;I.isFromCache=this._nativeResponse.fromCache??false;I.ip=this.ip;I.retryCount=this.retryCount;I.ok=isResponseOk(I);this._isFromCache=I.isFromCache;this._responseSize=Number(u.headers["content-length"])||undefined;this.response=I;publishResponseStart({requestId:this._requestId,url:I.url,statusCode:y,headers:u.headers,isFromCache:I.isFromCache});u.once("error",(A=>{this._aborted=true;u.destroy();this._beforeError(new ReadError(A,this))}));u.once("aborted",(()=>{this._aborted=true;if(!this._checkContentLengthMismatch()){this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}}));const w=u.headers["set-cookie"];if(Pi.object(A.cookieJar)&&w){let u=w.map((async u=>A.cookieJar.setCookie(u,p.toString())));if(A.ignoreInvalidCookies){u=u.map((async u=>{try{await u}catch{}}))}try{await Promise.all(u)}catch(u){this._beforeError(u);return}}if(this.isAborted){return}if(u.headers.location&&ra.has(y)){const E=typeof A.followRedirect==="function"?A.followRedirect(I):A.followRedirect;if(E){u.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=A.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;this._downloadedSize=0;const E=new Options(undefined,undefined,this.options);const C=y===303&&E.method!=="GET"&&E.method!=="HEAD";const w=y!==307&&y!==308;const v=E.methodRewriting&&w;if(C||v){E.method="GET";E.body=undefined;E.json=undefined;E.form=undefined;delete E.headers["content-length"]}try{const A=Rs.Buffer.from(u.headers.location,"binary").toString();const C=new URL(A,p);if(!isUnixSocketURL(p)&&isUnixSocketURL(C)){this._beforeError(new RequestError("Cannot redirect to UNIX socket",{},this));return}const w=C.hostname!==p.hostname||C.port!==p.port||getUnixSocketPath(p)!==getUnixSocketPath(C);if(w){if("host"in E.headers){delete E.headers.host}if("cookie"in E.headers){delete E.headers.cookie}if("authorization"in E.headers){delete E.headers.authorization}if(E.username||E.password){E.username="";E.password=""}}else{C.username=E.username;C.password=E.password}this.redirectUrls.push(C);E.url=C;for(const u of E.hooks.beforeRedirect){await u(E,I)}publishRedirect({requestId:this._requestId,fromUrl:p.toString(),toUrl:C.toString(),statusCode:y});this.emit("redirect",E,I);this.options=E;await this._makeRequest()}catch(u){this._beforeError(u);return}return}}if(A.isStream&&A.throwHttpErrors&&!isResponseOk(I)){this._beforeError(new HTTPError(I));return}const v=u!==this._nativeResponse;if(!C&&(!v||A.strictContentLength)){const u=this._nativeResponse.headers["content-length"];if(u!==undefined){const A=Number(u);if(!Number.isNaN(A)&&A>=0){this._expectedContentLength=A}}}u.once("end",(()=>{if(this._checkContentLengthMismatch()){return}this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress);publishResponseEnd({requestId:this._requestId,url:I.url,statusCode:y,bodySize:this._downloadedSize,timings:this.timings});this.push(null)}));this.emit("downloadProgress",this.downloadProgress);u.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{u.resume()}));this.on("pause",(()=>{u.pause()}));if(this._noPipe){const A=await this._setRawBody();if(A){this.emit("response",u)}return}this.emit("response",u);for(const A of this._pipedServerResponses){if(A.headersSent){continue}const p=u!==this._nativeResponse;for(const y in u.headers){if(Object.hasOwn(u.headers,y)){const E=u.headers[y];if(p&&(y==="content-encoding"||y==="content-length")){continue}if(E!==undefined){A.setHeader(y,E)}}}A.statusCode=y}}async _setRawBody(u=this){if(u.readableEnded){return false}try{const A=await u.toArray();const p=isBuffer(A.at(0))?Rs.Buffer.concat(A):Rs.Buffer.from(A.join(""));if(!this.isAborted){this.response.rawBody=p;return true}}catch{}return false}async _onResponse(u){try{await this._onResponseBase(u)}catch(u){this._beforeError(u)}}_onRequest(u){const{options:A}=this;const{timeout:p,url:y}=A;publishRequestStart({requestId:this._requestId,url:y?.toString()??"",method:A.method,headers:A.headers});Do(u);this._cancelTimeouts=timedOut(u,p,y);if(this.options.http2){u.removeAllListeners("timeout");u.once("socket",(u=>{u.removeAllListeners("timeout")}))}const E=A.cache?"cacheableResponse":"response";u.once(E,(u=>{void this._onResponse(u)}));u.once("error",(A=>{this._aborted=true;u.destroy();A=A instanceof timed_out_TimeoutError?new TimeoutError(A,this.timings,this):new RequestError(A.message,A,this);this._beforeError(A)}));this._unproxyEvents=proxyEvents(u,this,oa);this._request=u;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",u)}async _asyncWrite(u){return new Promise(((A,p)=>{super.write(u,(u=>{if(u){p(u);return}A()}))}))}_sendBody(){const{body:u}=this.options;const A=this.redirectUrls.length===0?this:this._request??this;if(Pi.nodeStream(u)){u.pipe(A)}else if(Pi.buffer(u)){this._writeRequest(u,undefined,(()=>{}));A.end()}else if(Pi.typedArray(u)){const p=u;const y=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);this._writeRequest(y,undefined,(()=>{}));A.end()}else if(Pi.asyncIterable(u)||Pi.iterable(u)&&!Pi.string(u)&&!isBuffer(u)){(async()=>{try{for await(const A of u){await this._asyncWrite(A)}super.end()}catch(u){this._beforeError(u)}})()}else if(Pi.undefined(u)){const u=ea.has(this.options.method)&&!(this.options.method==="GET"&&this.options.allowGetBody);if((this._noPipe??false)||u||A!==this){A.end()}}else{this._writeRequest(u,undefined,(()=>{}));A.end()}}_prepareCache(u){if(ta.has(u)){return}const A=new io(((u,A)=>{const p=A?p=>{const{beforeCacheHooks:y,gotRequest:E}=u;if(!y||y.length===0){A(p);return}try{for(const u of y){const y=u(p);if(y===false){p.headers["cache-control"]="no-cache, no-store, must-revalidate";p.headers.pragma="no-cache";p.headers.expires="0";A(p);return}if(Pi.promise(y)){throw new TypeError("beforeCache hooks must be synchronous. The hook returned a Promise, but this hook must return synchronously. If you need async logic, use beforeRequest hook instead.")}if(y!==undefined){throw new TypeError("beforeCache hook must return false or undefined. To modify the response, mutate it directly.")}}}catch(u){if(E){E._beforeError(u instanceof RequestError?u:new RequestError(u.message,u,E));return}console.error("Got: beforeCache hook error (request context unavailable):",u);A(p);return}A(p)}:A;const y=u._request(u,p);if(Pi.promise(y)){y.once=(u,A)=>{if(u==="error"){(async()=>{try{await y}catch(u){A(u)}})()}else if(u==="abort"||u==="destroy"){(async()=>{try{const p=await y;p.once(u,A)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${u}`)}return y}}return y}),u);ta.set(u,A.request())}async _createCacheableRequest(u,A){return new Promise(((p,y)=>{Object.assign(A,urlToOptions(u));let E;const C=ta.get(A.cache)(A,(async u=>{u._readableState.autoDestroy=false;if(E){const fix=()=>{if(u.req){u.complete=u.req.res.complete}else if(u.complete===undefined){u.complete=true}};u.prependOnceListener("end",fix);fix();(await E).emit("cacheableResponse",u)}p(u)}));C.once("error",y);C.once("request",(async u=>{E=u;p(E)}))}))}async _makeRequest(){const{options:u}=this;const{headers:A,username:p,password:y}=u;const E=u.cookieJar;for(const u in A){if(Pi.undefined(A[u])){delete A[u]}else if(Pi.null(A[u])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${u}\` header`)}}if(u.decompress&&Pi.undefined(A["accept-encoding"])){const u=["gzip","deflate"];if(Xo){u.push("br")}if(Zo){u.push("zstd")}A["accept-encoding"]=u.join(", ")}if(p||y){const u=Rs.Buffer.from(`${p}:${y}`).toString("base64");A.authorization=`Basic ${u}`}if(E){const p=await E.getCookieString(u.url.toString());if(Pi.nonEmptyString(p)){A.cookie=p}}let C;for(const A of u.hooks.beforeRequest){const p=await A(u,{retryCount:this.retryCount});if(!Pi.undefined(p)){C=()=>p;break}}C||=u.getRequestFunction();const I=u.url;this._requestOptions=u.createNativeRequestOptions();if(u.cache){this._requestOptions._request=C;this._requestOptions.cache=u.cache;this._requestOptions.body=u.body;this._requestOptions.beforeCacheHooks=u.hooks.beforeCache;this._requestOptions.gotRequest=this;try{this._prepareCache(u.cache)}catch(u){throw new CacheError(u,this)}}const w=u.cache?this._createCacheableRequest:C;try{let A=w(I,this._requestOptions);if(Pi.promise(A)){A=await A}if(Pi.undefined(A)){A=u.getFallbackRequestFunction()(I,this._requestOptions);if(Pi.promise(A)){A=await A}}if(Ko(A)){this._onRequest(A)}else if(this.writableEnded){void this._onResponse(A)}else{this.once("finish",(()=>{void this._onResponse(A)}));this._sendBody()}}catch(u){if(u instanceof types_CacheError){throw new CacheError(u,this)}throw u}}async _error(u){try{if(this.options&&u instanceof HTTPError&&!this.options.throwHttpErrors){}else if(this.options){const A=this.options.hooks.beforeError;if(A.length>0){for(const p of A){u=await p(u);if(!(u instanceof Error)){throw new TypeError(`The \`beforeError\` hook must return an Error instance. Received ${Pi.string(u)?"string":String(typeof u)}.`)}}if(!(u instanceof RequestError)){ia.add(u)}}}}catch(A){u=new RequestError(A.message,A,this)}publishError({requestId:this._requestId,url:this.options?.url?.toString()??"",error:u,timings:this.timings});this.destroy(u);if(this._noPipe){un.nextTick((()=>{this.emit("error",u)}))}}_writeRequest(u,A,p){if(!this._request||this._request.destroyed){p();return}this._request.write(u,A,(y=>{if(!y&&!this._request.destroyed){const p=typeof u==="string"?Rs.Buffer.from(u,A):u;this._uploadedSize+=byteLength(p);const y=this.uploadProgress;if(y.percent<1){this.emit("uploadProgress",y)}}p(y)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let u;if(this._responseSize){u=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){u=1}else{u=0}return{percent:u,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let u;if(this._bodySize){u=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){u=1}else{u=0}return{percent:u,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}get isReadonly(){return!Pi.undefined(this.options?.body)||!Pi.undefined(this.options?.json)||!Pi.undefined(this.options?.form)}}class types_CancelError extends RequestError{constructor(u){super("Promise was canceled",{},u);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const aa=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(u){let A;let p;let y;const E=new Le.EventEmitter;let C=false;const I=new PCancelable(((w,v,B)=>{B((()=>{A.destroy()}));B.shouldReject=false;B((()=>{C=true;v(new types_CancelError(A))}));const makeRequest=S=>{B((()=>{}));const D=u??new Request(undefined,undefined,y);D.retryCount=S;D._noPipe=true;A=D;D.once("response",(async u=>{const A=(u.headers["content-encoding"]??"").toLowerCase();const y=A==="gzip"||A==="deflate"||A==="br"||A==="zstd";const{options:E}=D;if(y&&!E.decompress){u.body=u.rawBody}else{try{u.body=parseBody(u,E.responseType,E.parseJson,E.encoding)}catch(A){try{u.body=u.rawBody.toString()}catch(A){D._beforeError(new ParseError(A,u));return}if(isResponseOk(u)){D._beforeError(A);return}}}try{const A=E.hooks.afterResponse;for(const[p,y]of A.entries()){u=await y(u,(async u=>{const A=u.preserveHooks??false;E.merge(u);E.prefixUrl="";if(u.url){E.url=u.url}if(!A){E.hooks.afterResponse=E.hooks.afterResponse.slice(0,p)}throw new RetryError(D)}));if(!(Pi.object(u)&&Pi.number(u.statusCode)&&"body"in u)){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(u){D._beforeError(u);return}p=u;if(!isResponseOk(u)){D._beforeError(new HTTPError(u));return}D.destroy();C=true;w(D.options.resolveBodyOnly?u.body:u)}));let k=false;const onError=u=>{if(I.isCanceled){return}if(!D._stopReading){D._beforeError(u);return}if(k){return}k=true;C=true;const{options:A}=D;if(u instanceof HTTPError&&!A.throwHttpErrors){const{response:A}=u;D.destroy();w(D.options.resolveBodyOnly?A.body:A);return}v(u)};D.on("error",onError);const Q=D.options?.body;D.once("retry",((A,p)=>{u=undefined;if(C){return}const E=D.options.body;if(Q===E&&Pi.nodeStream(E)){p.message="Cannot retry with consumed body stream";onError(p);return}y=D.options;makeRequest(A)}));proxyEvents(D,E,aa);if(Pi.undefined(u)){void D.flush()}};makeRequest(0)}));I.on=(u,A)=>{E.on(u,A);return I};I.off=(u,A)=>{E.off(u,A);return I};const shortcut=(u,A)=>{const y=(async()=>{await u;const{options:y}=p.request;return parseBody(p,A,y.parseJson,y.encoding)})();Object.defineProperties(y,Object.getOwnPropertyDescriptors(u));return y};I.json=function(){if(A.options){const{headers:u}=A.options;if(!A.writableFinished&&!("accept"in u)){u.accept="application/json"}}return shortcut(this,"json")};I.buffer=function(){return shortcut(this,"buffer")};I.text=function(){return shortcut(this,"text")};return I}const isGotInstance=u=>Pi.function(u);const la=["get","post","put","patch","head","delete"];const create=u=>{u={options:new Options(undefined,undefined,u.options),handlers:[...u.handlers],mutableDefaults:u.mutableDefaults};Object.defineProperty(u,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(A,p,y=u.options)=>{const E=new Request(A,p,y);let C;const lastHandler=u=>{E.options=u;E._noPipe=!u?.isStream;void E.flush();if(u?.isStream){return E}C||=asPromise(E);return C};let I=0;const iterateHandlers=A=>{const p=u.handlers[I++]??lastHandler;const y=p(A,iterateHandlers);if(Pi.promise(y)&&!E.options?.isStream){C||=asPromise(E);if(y!==C){const u=Object.getOwnPropertyDescriptors(C);for(const A in u){if(A in y){delete u[A]}}Object.defineProperties(y,u);y.cancel=C.cancel}}return y};return iterateHandlers(E.options)};got.extend=(...A)=>{const p=new Options(undefined,undefined,u.options);const y=[...u.handlers];let E;for(const u of A){if(isGotInstance(u)){p.merge(u.defaults.options);y.push(...u.defaults.handlers);E=u.defaults.mutableDefaults}else{p.merge(u);if(u.handlers){y.push(...u.handlers)}E=u.mutableDefaults}}return create({options:p,handlers:y,mutableDefaults:Boolean(E)})};const paginateEach=async function*(A,p){let y=new Options(A,p,u.options);y.resolveBodyOnly=false;const{pagination:E}=y;Ti.function(E.transform);Ti.function(E.shouldContinue);Ti.function(E.filter);Ti.function(E.paginate);Ti.number(E.countLimit);Ti.number(E.requestLimit);Ti.number(E.backoff);const C=[];let{countLimit:I}=E;let w=0;while(w<E.requestLimit){if(w!==0){await(0,Dr.setTimeout)(E.backoff)}const u=await got(undefined,undefined,y);const A=await E.transform(u);const p=[];Ti.array(A);for(const u of A){if(E.filter({item:u,currentItems:p,allItems:C})){if(!E.shouldContinue({item:u,currentItems:p,allItems:C})){return}yield u;if(E.stackAllItems){C.push(u)}p.push(u);if(--I<=0){return}}}const v=E.paginate({response:u,currentItems:p,allItems:C});if(v===false){return}if(v===u.request.options){y=u.request.options}else{y.merge(v);try{Ti.any([Pi.urlInstance,Pi.undefined],v.url)}catch(u){if(u instanceof Error){u.message=`Option 'pagination.paginate.url': ${u.message}`}throw u}if(v.url!==undefined){y.prefixUrl="";y.url=v.url}}w++}};got.paginate=paginateEach;got.paginate.all=async(u,A)=>{const p=[];for await(const y of paginateEach(u,A)){p.push(y)}return p};got.paginate.each=paginateEach;got.stream=(u,A)=>got(u,{...A,isStream:true});for(const u of la){got[u]=(A,p)=>got(A,{...p,method:u});got.stream[u]=(A,p)=>got(A,{...p,method:u,isStream:true})}if(!u.mutableDefaults){Object.freeze(u.handlers);u.options.freeze()}Object.defineProperty(got,"defaults",{value:u,writable:false,configurable:false,enumerable:true});return got};const ca=create;const da={options:new Options,handlers:[],mutableDefaults:false};const fa=ca(da);const ha=fa;var pa=p(2473);const ga=Zt.homedir();const{env:ma}=process;const Ca=ma.XDG_DATA_HOME||(ga?E.join(ga,".local","share"):undefined);const ba=ma.XDG_CONFIG_HOME||(ga?E.join(ga,".config"):undefined);const va=ma.XDG_STATE_HOME||(ga?E.join(ga,".local","state"):undefined);const Sa=ma.XDG_CACHE_HOME||(ga?E.join(ga,".cache"):undefined);const ka=ma.XDG_RUNTIME_DIR||undefined;const Qa=(ma.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(Ca){Qa.unshift(Ca)}const Fa=(ma.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(ba){Fa.unshift(ba)}const{mkdir:xa,createWriteStream:_a,move:Na}=vi;const Ga=(0,Fe.dirname)((0,we.fileURLToPath)(import.meta.url));const ja=`microsoft/ripgrep-prebuilt`;const qa=process.env.RIPGREP_VERSION||"v13.0.0-10";const Va=(0,Fe.join)(Ga,"../bin");const getTarget=()=>{const u=process.env.npm_config_arch||Qr.arch();const A=process.env.platform||Qr.platform();switch(A){case"darwin":switch(u){case"arm64":return"aarch64-apple-darwin.tar.gz";default:return"x86_64-apple-darwin.tar.gz"}case"win32":switch(u){case"x64":return"x86_64-pc-windows-msvc.zip";case"arm":return"aarch64-pc-windows-msvc.zip";default:return"i686-pc-windows-msvc.zip"}case"linux":switch(u){case"x64":return"x86_64-unknown-linux-musl.tar.gz";case"arm":case"armv7l":return"arm-unknown-linux-gnueabihf.tar.gz";case"arm64":return"aarch64-unknown-linux-gnu.tar.gz";case"ppc64":return"powerpc64le-unknown-linux-gnu.tar.gz";case"s390x":return"s390x-unknown-linux-gnu.tar.gz";default:return"i686-unknown-linux-musl.tar.gz"}default:throw new VError("Unknown platform: "+A)}};const downloadFile=async(u,A)=>{let p=undefined;try{p=await vi.mkdtemp(E.join(Qr.tmpdir(),"download-ripgrep"));const y=E.join(p,"tmp-file");await(0,Os.pipeline)(ha.stream(u),_a(y));await xa((0,Fe.dirname)(A),{recursive:true});await Na(y,A)}catch(A){throw new VError(A,`Failed to download "${u}"`)}finally{if(p){await vi.rm(p,{recursive:true,force:true})}}};const unzip=async(u,A)=>{try{await xa(A,{recursive:true});await wi(u,{dir:A})}catch(A){throw new VError(A,`Failed to unzip "${u}"`)}};const untarGz=async(u,A)=>{try{await xa(A,{recursive:true});await Ai("tar",["xvf",u,"-C",A])}catch(A){throw new VError(A,`Failed to extract "${u}"`)}};const downloadRipGrep=async u=>{const A=getTarget();const p=`https://github.com/${ja}/releases/download/${qa}/ripgrep-${qa}-${A}`;const y=`${Sa}/vscode-ripgrep/ripgrep-${qa}-${A}`;const E=u??Va;if(!await(0,pa.s)(y)){await downloadFile(p,y)}else{console.info(`File ${y} has been cached`)}if(y.endsWith(".tar.gz")){await untarGz(y,E)}else if(y.endsWith(".zip")){await unzip(y,E)}else{throw new VError(`Invalid downloadPath ${y}`)}};const Ka=(0,Fe.dirname)((0,we.fileURLToPath)(import.meta.url));const Ya=(0,Fe.join)(Ka,"..","bin",`rg${process.platform==="win32"?".exe":""}`);const escapeRegex=u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const readGitignorePatterns=async()=>{try{const u=C().resolve(B.$.WORKSPACE_DIR,".gitignore");const A=await(0,y.readFile)(u,"utf-8");return A.split("\n").filter((u=>u.trim()&&!u.trim().startsWith("#"))).map((u=>u.trim())).map((u=>u.endsWith("/")?`${u}**`:u)).filter((u=>!u.startsWith(".codegen")))}catch{return[]}};const buildMatcher=(u,A,p)=>{const y=A?escapeRegex(u):u;const E=p?"g":"gi";return new RegExp(y,E)};const searchTextFallback=async u=>{const{pattern:A,dir_path:p=".",include:E,case_sensitive:I=false,fixed_strings:w,context:v}=u;const S=C().resolve(B.$.WORKSPACE_DIR,p);const D=await readGitignorePatterns();const k=await Yt(E||"**/*",{cwd:S,absolute:true,nodir:true,dot:false,ignore:D,nocase:!I});const Q=buildMatcher(A,w,I);const F=[];for(const u of k){let A;try{A=await(0,y.readFile)(u,"utf-8")}catch{continue}const p=A.split(/\r?\n/);for(let A=0;A<p.length;A++){const y=p[A];if(y===undefined)continue;Q.lastIndex=0;if(!Q.test(y))continue;const E=v?Math.max(0,A-v):A;const I=v?Math.min(p.length-1,A+v):A;for(let A=E;A<=I;A++){const y=p[A];if(y===undefined)continue;F.push({file:C().relative(B.$.WORKSPACE_DIR,u),line:A+1,content:y})}A=I}}return{matches:F}};const withSuppressedConsoleInfo=async u=>{const A=console.info;try{console.info=()=>{};return await u()}finally{console.info=A}};const ensureRipgrepAvailable=async()=>{try{const u=Re().mkdtempSync(C().join(en().tmpdir(),"ripgrep-"));await withSuppressedConsoleInfo((()=>downloadRipGrep(u)));return C().join(u,"rg")}catch(u){return null}};const SearchText=async u=>{if(B.$.DISABLE_RIPGREP){return await searchTextFallback(u)}const A=await ensureRipgrepAvailable();if(!A){return await searchTextFallback(u)}const{pattern:p,dir_path:y=".",include:E,case_sensitive:I,fixed_strings:w,context:v}=u;const S=C().resolve(B.$.WORKSPACE_DIR,y);const D=["--json"];if(!I){D.push("--ignore-case")}if(w){D.push("--fixed-strings");D.push(p)}else{D.push("--regexp",p)}if(v){D.push("--context",v.toString())}if(E){D.push("--glob",E)}D.push(S);try{const u=await new Promise(((u,p)=>{const y=(0,Xt.spawn)(A,D,{windowsHide:true});const E=[];const C=[];y.stdout.on("data",(u=>E.push(u)));y.stderr.on("data",(u=>C.push(u)));y.on("error",(u=>p(u)));y.on("close",(A=>{if(A===0){u(Buffer.concat(E).toString("utf8"))}else if(A===1){u("")}else{p(new Error(`ripgrep exited with code ${A}: ${Buffer.concat(C).toString("utf8")}`))}}))}));const p=u.trim().split("\n").map((u=>{try{const A=JSON.parse(u);if(A.type==="match"){const u=A.data;return{file:C().relative(B.$.WORKSPACE_DIR,u.path.text),line:u.line_number,content:u.lines.text.trimEnd()}}}catch{}return null})).filter(Boolean);return{matches:p}}catch{return await searchTextFallback(u)}};const WriteFile=async u=>{const{file_path:A,content:p}=u;if(!A){return{error:"Missing parameter: file_path must be provided."}}if(p===undefined){return{error:"Missing parameter: content must be provided."}}try{const u=C().resolve(B.$.WORKSPACE_DIR,A);const E=C().dirname(u);await(0,y.mkdir)(E,{recursive:true});await(0,y.writeFile)(u,p,"utf-8");return{success:true}}catch(u){return{error:u.message}}};const Edit=async u=>{const{file_path:A,old_string:p,new_string:E,expected_replacements:I=1}=u;if(!A){return{error:"Missing parameter: file_path must be provided."}}if(p===undefined){return{error:"Missing parameter: old_string must be provided."}}if(E===undefined){return{error:"Missing parameter: new_string must be provided."}}try{const u=C().resolve(B.$.WORKSPACE_DIR,A);let w="";try{w=await(0,y.readFile)(u,"utf-8")}catch(u){if(u.code!=="ENOENT"){throw u}}const v=new RegExp(p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");let S=0;const D=w.replace(v,(()=>{S++;return E}));if(S!==I){return{error:`Expected ${I} replacements, but made ${S}.`}}await(0,y.writeFile)(u,D,"utf-8");return{success:true,replacementsMade:S}}catch(u){return{error:u.message}}};const ReadManyFiles=async u=>{const{include:A,exclude:p=[]}=u;if(!A||A.length===0){return{error:"Missing parameter: include must be provided."}}try{const u=await Yt(A,{cwd:B.$.WORKSPACE_DIR,ignore:p,nodir:true,absolute:true});let E="";for(const A of u){const u=await(0,y.readFile)(A,"utf-8");E+=`--- ${C().relative(B.$.WORKSPACE_DIR,A)} ---\n\n${u}\n\n`}E+="--- End of content ---";return{content:E}}catch(u){return{error:u.message}}};const SaveMemory=async u=>{const{fact:A}=u;if(!A){return{error:"Missing parameter: fact must be provided."}}const p=C().join(en().homedir(),".codegen","CODEGEN.md");const E="## CodeGen Added Memories";try{await Re().promises.mkdir(C().dirname(p),{recursive:true});let u="";try{u=await(0,y.readFile)(p,"utf-8")}catch(u){if(u.code!=="ENOENT"){throw u}}const I=`- ${A.trim()}`;let w="";if(u.includes(E)){w=u.replace(E,`${E}\n${I}`)}else{w=`${u}\n\n${E}\n${I}\n`}await(0,y.writeFile)(p,w,"utf-8");return{success:true}}catch(u){return{error:u.message}}};var el;(function(u){u["Root"]="root";u["Text"]="text";u["Directive"]="directive";u["Comment"]="comment";u["Script"]="script";u["Style"]="style";u["Tag"]="tag";u["CDATA"]="cdata";u["Doctype"]="doctype"})(el||(el={}));function esm_isTag(u){return u.type===el.Tag||u.type===el.Script||u.type===el.Style}const tl=el.Root;const nl=el.Text;const rl=el.Directive;const sl=el.Comment;const il=el.Script;const ol=el.Style;const al=el.Tag;const ll=el.CDATA;const cl=el.Doctype;class Node{constructor(){this.parent=null;this.prev=null;this.next=null;this.startIndex=null;this.endIndex=null}get parentNode(){return this.parent}set parentNode(u){this.parent=u}get previousSibling(){return this.prev}set previousSibling(u){this.prev=u}get nextSibling(){return this.next}set nextSibling(u){this.next=u}cloneNode(u=false){return cloneNode(this,u)}}class DataNode extends Node{constructor(u){super();this.data=u}get nodeValue(){return this.data}set nodeValue(u){this.data=u}}class node_Text extends DataNode{constructor(){super(...arguments);this.type=el.Text}get nodeType(){return 3}}class node_Comment extends DataNode{constructor(){super(...arguments);this.type=el.Comment}get nodeType(){return 8}}class ProcessingInstruction extends DataNode{constructor(u,A){super(A);this.name=u;this.type=el.Directive}get nodeType(){return 1}}class NodeWithChildren extends Node{constructor(u){super();this.children=u}get firstChild(){var u;return(u=this.children[0])!==null&&u!==void 0?u:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(u){this.children=u}}class node_CDATA extends NodeWithChildren{constructor(){super(...arguments);this.type=el.CDATA}get nodeType(){return 4}}class Document extends NodeWithChildren{constructor(){super(...arguments);this.type=el.Root}get nodeType(){return 9}}class Element extends NodeWithChildren{constructor(u,A,p=[],y=(u==="script"?el.Script:u==="style"?el.Style:el.Tag)){super(p);this.name=u;this.attribs=A;this.type=y}get nodeType(){return 1}get tagName(){return this.name}set tagName(u){this.name=u}get attributes(){return Object.keys(this.attribs).map((u=>{var A,p;return{name:u,value:this.attribs[u],namespace:(A=this["x-attribsNamespace"])===null||A===void 0?void 0:A[u],prefix:(p=this["x-attribsPrefix"])===null||p===void 0?void 0:p[u]}}))}}function node_isTag(u){return esm_isTag(u)}function node_isCDATA(u){return u.type===el.CDATA}function node_isText(u){return u.type===el.Text}function node_isComment(u){return u.type===el.Comment}function isDirective(u){return u.type===el.Directive}function isDocument(u){return u.type===el.Root}function node_hasChildren(u){return Object.prototype.hasOwnProperty.call(u,"children")}function cloneNode(u,A=false){let p;if(node_isText(u)){p=new node_Text(u.data)}else if(node_isComment(u)){p=new node_Comment(u.data)}else if(node_isTag(u)){const y=A?cloneChildren(u.children):[];const E=new Element(u.name,{...u.attribs},y);y.forEach((u=>u.parent=E));if(u.namespace!=null){E.namespace=u.namespace}if(u["x-attribsNamespace"]){E["x-attribsNamespace"]={...u["x-attribsNamespace"]}}if(u["x-attribsPrefix"]){E["x-attribsPrefix"]={...u["x-attribsPrefix"]}}p=E}else if(node_isCDATA(u)){const y=A?cloneChildren(u.children):[];const E=new node_CDATA(y);y.forEach((u=>u.parent=E));p=E}else if(isDocument(u)){const y=A?cloneChildren(u.children):[];const E=new Document(y);y.forEach((u=>u.parent=E));if(u["x-mode"]){E["x-mode"]=u["x-mode"]}p=E}else if(isDirective(u)){const A=new ProcessingInstruction(u.name,u.data);if(u["x-name"]!=null){A["x-name"]=u["x-name"];A["x-publicId"]=u["x-publicId"];A["x-systemId"]=u["x-systemId"]}p=A}else{throw new Error(`Not implemented yet: ${u.type}`)}p.startIndex=u.startIndex;p.endIndex=u.endIndex;if(u.sourceCodeLocation!=null){p.sourceCodeLocation=u.sourceCodeLocation}return p}function cloneChildren(u){const A=u.map((u=>cloneNode(u,true)));for(let u=1;u<A.length;u++){A[u].prev=A[u-1];A[u-1].next=A[u]}return A}const ul={withStartIndices:false,withEndIndices:false,xmlMode:false};class esm_DomHandler{constructor(u,A,p){this.dom=[];this.root=new Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null;if(typeof A==="function"){p=A;A=ul}if(typeof u==="object"){A=u;u=undefined}this.callback=u!==null&&u!==void 0?u:null;this.options=A!==null&&A!==void 0?A:ul;this.elementCB=p!==null&&p!==void 0?p:null}onparserinit(u){this.parser=u}onreset(){this.dom=[];this.root=new Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null}onend(){if(this.done)return;this.done=true;this.parser=null;this.handleCallback(null)}onerror(u){this.handleCallback(u)}onclosetag(){this.lastNode=null;const u=this.tagStack.pop();if(this.options.withEndIndices){u.endIndex=this.parser.endIndex}if(this.elementCB)this.elementCB(u)}onopentag(u,A){const p=this.options.xmlMode?el.Tag:undefined;const y=new Element(u,A,undefined,p);this.addNode(y);this.tagStack.push(y)}ontext(u){const{lastNode:A}=this;if(A&&A.type===el.Text){A.data+=u;if(this.options.withEndIndices){A.endIndex=this.parser.endIndex}}else{const A=new node_Text(u);this.addNode(A);this.lastNode=A}}oncomment(u){if(this.lastNode&&this.lastNode.type===el.Comment){this.lastNode.data+=u;return}const A=new node_Comment(u);this.addNode(A);this.lastNode=A}oncommentend(){this.lastNode=null}oncdatastart(){const u=new node_Text("");const A=new node_CDATA([u]);this.addNode(A);u.parent=A;this.lastNode=u}oncdataend(){this.lastNode=null}onprocessinginstruction(u,A){const p=new ProcessingInstruction(u,A);this.addNode(p)}handleCallback(u){if(typeof this.callback==="function"){this.callback(u,this.dom)}else if(u){throw u}}addNode(u){const A=this.tagStack[this.tagStack.length-1];const p=A.children[A.children.length-1];if(this.options.withStartIndices){u.startIndex=this.parser.startIndex}if(this.options.withEndIndices){u.endIndex=this.parser.endIndex}A.children.push(u);if(p){u.prev=p;p.next=u}u.parent=A;this.lastNode=null}}const dl=null&&esm_DomHandler;const fl=/\n/g;function leac_n(u){const A=[...u.matchAll(fl)].map((u=>u.index||0));A.unshift(-1);const p=t(A,0,A.length);return u=>r(p,u)}function t(u,A,p){if(p-A==1)return{offset:u[A],index:A+1};const y=Math.ceil((A+p)/2),E=t(u,A,y),C=t(u,y,p);return{offset:E.offset,low:E,high:C}}function r(u,A){return function(u){return Object.prototype.hasOwnProperty.call(u,"index")}(u)?{line:u.index,column:A-u.offset}:r(u.high.offset<A?u.high:u.low,A)}function leac_o(u,A="",p={}){const y="string"!=typeof A?A:p,E="string"==typeof A?A:"",C=u.map(s),I=!!y.lineNumbers;return function(u,A=0){const p=I?leac_n(u):()=>({line:0,column:0});let y=A;const w=[];e:for(;y<u.length;){let A=!1;for(const I of C){I.regex.lastIndex=y;const C=I.regex.exec(u);if(C&&C[0].length>0){if(!I.discard){const u=p(y),A="string"==typeof I.replace?C[0].replace(new RegExp(I.regex.source,I.regex.flags),I.replace):C[0];w.push({state:E,name:I.name,text:A,offset:y,len:C[0].length,line:u.line,column:u.column})}if(y=I.regex.lastIndex,A=!0,I.push){const A=I.push(u,y);w.push(...A.tokens),y=A.offset}if(I.pop)break e;break}}if(!A)break}return{tokens:w,offset:y,complete:u.length<=y}}}function s(u,A){return{...u,regex:l(u,A)}}function l(u,A){if(0===u.name.length)throw new Error(`Rule #${A} has empty name, which is not allowed.`);if(function(u){return Object.prototype.hasOwnProperty.call(u,"regex")}(u))return function(u){if(u.global)throw new Error(`Regular expression /${u.source}/${u.flags} contains the global flag, which is not allowed.`);return u.sticky?u:new RegExp(u.source,u.flags+"y")}(u.regex);if(function(u){return Object.prototype.hasOwnProperty.call(u,"str")}(u)){if(0===u.str.length)throw new Error(`Rule #${A} ("${u.name}") has empty "str" property, which is not allowed.`);return new RegExp(leac_c(u.str),"y")}return new RegExp(leac_c(u.name),"y")}function leac_c(u){return u.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function emit(u){return(A,p)=>({matched:true,position:p,value:u})}function make(u){return(A,p)=>({matched:true,position:p,value:u(A,p)})}function action(u){return(A,p)=>{u(A,p);return{matched:true,position:p,value:null}}}function fail(u,A){return{matched:false}}function error(u){return(A,p)=>{throw new Error(u instanceof Function?u(A,p):u)}}function token(u,A){return(p,y)=>{let E=y;let C=undefined;if(y<p.tokens.length){C=u(p.tokens[y],p,y);if(C!==undefined){E++}}else{A?.(p,y)}return C===undefined?{matched:false}:{matched:true,position:E,value:C}}}function any(u,A){return A<u.tokens.length?{matched:true,position:A+1,value:u.tokens[A]}:{matched:false}}function satisfy(u){return(A,p)=>p<A.tokens.length&&u(A.tokens[p],A,p)?{matched:true,position:p+1,value:A.tokens[p]}:{matched:false}}function mapInner(u,A){return u.matched?{matched:true,position:u.position,value:A(u.value,u.position)}:u}function mapOuter(u,A){return u.matched?A(u):u}function map(u,A){return(p,y)=>mapInner(u(p,y),((u,E)=>A(u,p,y,E)))}function map1(u,A){return(p,y)=>mapOuter(u(p,y),(u=>A(u,p,y)))}function peek(u,A){return(p,y)=>{const E=u(p,y);A(E,p,y);return E}}function core_option(u,A){return(p,y)=>{const E=u(p,y);return E.matched?E:{matched:true,position:y,value:A}}}function not(u){return(A,p)=>{const y=u(A,p);return y.matched?{matched:false}:{matched:true,position:p,value:true}}}function choice(...u){return(A,p)=>{for(const y of u){const u=y(A,p);if(u.matched){return u}}return{matched:false}}}function otherwise(u,A){return(p,y)=>{const E=u(p,y);return E.matched?E:A(p,y)}}function longest(...u){return(A,p)=>{let y=undefined;for(const E of u){const u=E(A,p);if(u.matched&&(!y||y.position<u.position)){y=u}}return y||{matched:false}}}function takeWhile(u,A){return(p,y)=>{const E=[];let C=true;do{const I=u(p,y);if(I.matched&&A(I.value,E.length+1,p,y,I.position)){E.push(I.value);y=I.position}else{C=false}}while(C);return{matched:true,position:y,value:E}}}function takeUntil(u,A){return takeWhile(u,((u,p,y,E,C)=>!A(u,p,y,E,C)))}function takeWhileP(u,A){return takeWhile(u,((u,p,y,E)=>A(y,E).matched))}function takeUntilP(u,A){return takeWhile(u,((u,p,y,E)=>!A(y,E).matched))}function many(u){return takeWhile(u,(()=>true))}function many1(u){return ab(u,many(u),((u,A)=>[u,...A]))}function ab(u,A,p){return(y,E)=>mapOuter(u(y,E),(u=>mapInner(A(y,u.position),((A,C)=>p(u.value,A,y,E,C)))))}function left(u,A){return ab(u,A,(u=>u))}function right(u,A){return ab(u,A,((u,A)=>A))}function abc(u,A,p,y){return(E,C)=>mapOuter(u(E,C),(u=>mapOuter(A(E,u.position),(A=>mapInner(p(E,A.position),((p,I)=>y(u.value,A.value,p,E,C,I)))))))}function middle(u,A,p){return abc(u,A,p,((u,A)=>A))}function core_all(...u){return(A,p)=>{const y=[];let E=p;for(const p of u){const u=p(A,E);if(u.matched){y.push(u.value);E=u.position}else{return{matched:false}}}return{matched:true,position:E,value:y}}}function skip(...u){return map(core_all(...u),(()=>null))}function flatten(...u){return flatten1(core_all(...u))}function flatten1(u){return map(u,(u=>u.flatMap((u=>u))))}function sepBy1(u,A){return ab(u,many(right(A,u)),((u,A)=>[u,...A]))}function sepBy(u,A){return otherwise(sepBy1(u,A),emit([]))}function chainReduce(u,A){return(p,y)=>{let E=true;let C=u;let I=y;do{const u=A(C,p,I)(p,I);if(u.matched){C=u.value;I=u.position}else{E=false}}while(E);return{matched:true,position:I,value:C}}}function reduceLeft(u,A,p){return chainReduce(u,(u=>map(A,((A,y,E,C)=>p(u,A,y,E,C)))))}function reduceRight(u,A,p){return map(many(u),((u,y,E,C)=>u.reduceRight(((u,A)=>p(A,u,y,E,C)),A)))}function leftAssoc1(u,A){return chain(u,(u=>reduceLeft(u,A,((u,A)=>A(u)))))}function rightAssoc1(u,A){return ab(reduceRight(u,(u=>u),((u,A)=>p=>u(A(p)))),A,((u,A)=>u(A)))}function leftAssoc2(u,A,p){return chain(u,(u=>reduceLeft(u,ab(A,p,((u,A)=>[u,A])),((u,[A,p])=>A(u,p)))))}function rightAssoc2(u,A,p){return ab(reduceRight(ab(u,A,((u,A)=>[u,A])),(u=>u),(([u,A],p)=>y=>A(u,p(y)))),p,((u,A)=>u(A)))}function condition(u,A,p){return(y,E)=>u(y,E)?A(y,E):p(y,E)}function decide(u){return(A,p)=>mapOuter(u(A,p),(u=>u.value(A,u.position)))}function chain(u,A){return(p,y)=>mapOuter(u(p,y),(u=>A(u.value,p,y,u.position)(p,u.position)))}function ahead(u){return(A,p)=>mapOuter(u(A,p),(u=>({matched:true,position:p,value:u.value})))}function recursive(u){return function(A,p){return u()(A,p)}}function start(u,A){return A!==0?{matched:false}:{matched:true,position:A,value:true}}function end(u,A){return A<u.tokens.length?{matched:false}:{matched:true,position:A,value:true}}function remainingTokensNumber(u,A){return u.tokens.length-A}function parserPosition(u,A,p,y=3){const E=u.tokens.length;const C=clamp(0,A-y,E-y);const I=clamp(y,A+1+y,E);const w=u.tokens.slice(C,I);const v=[];const B=String(I-1).length+1;if(A<0){v.push(`${String(A).padStart(B)} >>`)}if(0<C){v.push("...".padStart(B+6))}for(let u=0;u<w.length;u++){const y=C+u;v.push(`${String(y).padStart(B)} ${y===A?">":" "} ${escapeWhitespace(p(w[u]))}`)}if(I<E){v.push("...".padStart(B+6))}if(E<=A){v.push(`${String(A).padStart(B)} >>`)}return v.join("\n")}function parse(u,A,p,y=JSON.stringify){const E={tokens:A,options:p};const C=u(E,0);if(!C.matched){throw new Error("No match")}if(C.position<E.tokens.length){throw new Error(`Partial match. Parsing stopped at:\n${parserPosition(E,C.position,y)}`)}return C.value}function tryParse(u,A,p){const y=u({tokens:A,options:p},0);return y.matched?y.value:undefined}function core_match(u,A,p){const y=u({tokens:A,options:p},0);return y.value}var Al=Object.freeze({__proto__:null});const hl=`(?:[ \\t\\r\\n\\f]*)`;const pl=`(?:\\n|\\r\\n|\\r|\\f)`;const gl=`[^\\x00-\\x7F]`;const ml=`(?:\\\\[0-9a-f]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?)`;const yl=`(?:\\\\[^\\n\\r\\f0-9a-f])`;const El=`(?:[_a-z]|${gl}|${ml}|${yl})`;const Cl=`(?:[_a-z0-9-]|${gl}|${ml}|${yl})`;const Il=`(?:${Cl}+)`;const bl=`(?:[-]?${El}${Cl}*)`;const wl=`'([^\\n\\r\\f\\\\']|\\\\${pl}|${gl}|${ml}|${yl})*'`;const vl=`"([^\\n\\r\\f\\\\"]|\\\\${pl}|${gl}|${ml}|${yl})*"`;const Bl=leac_o([{name:"ws",regex:new RegExp(hl)},{name:"hash",regex:new RegExp(`#${Il}`,"i")},{name:"ident",regex:new RegExp(bl,"i")},{name:"str1",regex:new RegExp(wl,"i")},{name:"str2",regex:new RegExp(vl,"i")},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]);const Sl=leac_o([{name:"unicode",regex:new RegExp(ml,"i")},{name:"escape",regex:new RegExp(yl,"i")},{name:"any",regex:new RegExp("[\\s\\S]","i")}]);function sumSpec([u,A,p],[y,E,C]){return[u+y,A+E,p+C]}function sumAllSpec(u){return u.reduce(sumSpec,[0,0,0])}const Dl=token((u=>u.name==="unicode"?String.fromCodePoint(parseInt(u.text.slice(1),16)):undefined));const kl=token((u=>u.name==="escape"?u.text.slice(1):undefined));const Ql=token((u=>u.name==="any"?u.text:undefined));const Fl=map(many(choice(Dl,kl,Ql)),(u=>u.join("")));function parseley_unescape(u){const A=Sl(u);const p=Fl({tokens:A.tokens,options:undefined},0);return p.value}function literal(u){return token((A=>A.name===u?true:undefined))}const xl=token((u=>u.name==="ws"?null:undefined));const Rl=core_option(xl,null);function optionallySpaced(u){return middle(Rl,u,Rl)}const _l=token((u=>u.name==="ident"?parseley_unescape(u.text):undefined));const Tl=token((u=>u.name==="hash"?parseley_unescape(u.text.slice(1)):undefined));const Nl=token((u=>u.name.startsWith("str")?parseley_unescape(u.text.slice(1,-1)):undefined));const Ll=left(core_option(_l,""),literal("|"));const Pl=otherwise(ab(Ll,_l,((u,A)=>({name:A,namespace:u}))),map(_l,(u=>({name:u,namespace:null}))));const Ol=otherwise(ab(Ll,literal("*"),(u=>({type:"universal",namespace:u,specificity:[0,0,0]}))),map(literal("*"),(()=>({type:"universal",namespace:null,specificity:[0,0,0]}))));const Ml=map(Pl,(({name:u,namespace:A})=>({type:"tag",name:u,namespace:A,specificity:[0,0,1]})));const Ul=ab(literal("."),_l,((u,A)=>({type:"class",name:A,specificity:[0,1,0]})));const Hl=map(Tl,(u=>({type:"id",name:u,specificity:[1,0,0]})));const Gl=token((u=>{if(u.name==="ident"){if(u.text==="i"||u.text==="I"){return"i"}if(u.text==="s"||u.text==="S"){return"s"}}return undefined}));const Wl=otherwise(ab(Nl,core_option(right(Rl,Gl),null),((u,A)=>({value:u,modifier:A}))),ab(_l,core_option(right(xl,Gl),null),((u,A)=>({value:u,modifier:A}))));const jl=choice(map(literal("="),(()=>"=")),ab(literal("~"),literal("="),(()=>"~=")),ab(literal("|"),literal("="),(()=>"|=")),ab(literal("^"),literal("="),(()=>"^=")),ab(literal("$"),literal("="),(()=>"$=")),ab(literal("*"),literal("="),(()=>"*=")));const zl=abc(literal("["),optionallySpaced(Pl),literal("]"),((u,{name:A,namespace:p})=>({type:"attrPresence",name:A,namespace:p,specificity:[0,1,0]})));const $l=middle(literal("["),abc(optionallySpaced(Pl),jl,optionallySpaced(Wl),(({name:u,namespace:A},p,{value:y,modifier:E})=>({type:"attrValue",name:u,namespace:A,matcher:p,value:y,modifier:E,specificity:[0,1,0]}))),literal("]"));const ql=otherwise(zl,$l);const Vl=otherwise(Ol,Ml);const Kl=choice(Hl,Ul,ql);const Jl=map(otherwise(flatten(Vl,many(Kl)),many1(Kl)),(u=>({type:"compound",list:u,specificity:sumAllSpec(u.map((u=>u.specificity)))})));const Yl=choice(map(literal(">"),(()=>">")),map(literal("+"),(()=>"+")),map(literal("~"),(()=>"~")),ab(literal("|"),literal("|"),(()=>"||")));const Xl=otherwise(optionallySpaced(Yl),map(xl,(()=>" ")));const Zl=leftAssoc2(Jl,map(Xl,(u=>(A,p)=>({type:"compound",list:[...p.list,{type:"combinator",combinator:u,left:A,specificity:A.specificity}],specificity:sumSpec(A.specificity,p.specificity)}))),Jl);const ec=leftAssoc2(map(Zl,(u=>({type:"list",list:[u]}))),map(optionallySpaced(literal(",")),(()=>(u,A)=>({type:"list",list:[...u.list,A]}))),Zl);function parse_(u,A){if(!(typeof A==="string"||A instanceof String)){throw new Error("Expected a selector string. Actual input is not a string!")}const p=Bl(A);if(!p.complete){throw new Error(`The input "${A}" was only partially tokenized, stopped at offset ${p.offset}!\n`+prettyPrintPosition(A,p.offset))}const y=optionallySpaced(u)({tokens:p.tokens,options:undefined},0);if(!y.matched){throw new Error(`No match for "${A}" input!`)}if(y.position<p.tokens.length){const u=p.tokens[y.position];throw new Error(`The input "${A}" was only partially parsed, stopped at offset ${u.offset}!\n`+prettyPrintPosition(A,u.offset,u.len))}return y.value}function prettyPrintPosition(u,A,p=1){return`${u.replace(/(\t)|(\r)|(\n)/g,((u,A,p)=>A?"␉":p?"␍":"␊"))}\n${"".padEnd(A)}${"^".repeat(p)}`}function parseley_parse(u){return parse_(ec,u)}function parse1(u){return parse_(Zl,u)}function serialize(u){if(!u.type){throw new Error("This is not an AST node.")}switch(u.type){case"universal":return _serNs(u.namespace)+"*";case"tag":return _serNs(u.namespace)+_serIdent(u.name);case"class":return"."+_serIdent(u.name);case"id":return"#"+_serIdent(u.name);case"attrPresence":return`[${_serNs(u.namespace)}${_serIdent(u.name)}]`;case"attrValue":return`[${_serNs(u.namespace)}${_serIdent(u.name)}${u.matcher}"${_serStr(u.value)}"${u.modifier?u.modifier:""}]`;case"combinator":return serialize(u.left)+u.combinator;case"compound":return u.list.reduce(((u,A)=>{if(A.type==="combinator"){return serialize(A)+u}else{return u+serialize(A)}}),"");case"list":return u.list.map(serialize).join(",")}}function _serNs(u){return u||u===""?_serIdent(u)+"|":""}function _codePoint(u){return`\\${u.codePointAt(0).toString(16)} `}function _serIdent(u){return u.replace(/(^[0-9])|(^-[0-9])|(^-$)|([-0-9a-zA-Z_]|[^\x00-\x7F])|(\x00)|([\x01-\x1f]|\x7f)|([\s\S])/g,((u,A,p,y,E,C,I,w)=>A?_codePoint(A):p?"-"+_codePoint(p.slice(1)):y?"\\-":E?E:C?"�":I?_codePoint(I):"\\"+w))}function _serStr(u){return u.replace(/(")|(\\)|(\x00)|([\x01-\x1f]|\x7f)/g,((u,A,p,y,E)=>A?'\\"':p?"\\\\":y?"�":_codePoint(E)))}function parseley_normalize(u){if(!u.type){throw new Error("This is not an AST node.")}switch(u.type){case"compound":{u.list.forEach(parseley_normalize);u.list.sort(((u,A)=>_compareArrays(_getSelectorPriority(u),_getSelectorPriority(A))));break}case"combinator":{parseley_normalize(u.left);break}case"list":{u.list.forEach(parseley_normalize);u.list.sort(((u,A)=>serialize(u)<serialize(A)?-1:1));break}}return u}function _getSelectorPriority(u){switch(u.type){case"universal":return[1];case"tag":return[1];case"id":return[2];case"class":return[3,u.name];case"attrPresence":return[4,serialize(u)];case"attrValue":return[5,serialize(u)];case"combinator":return[15,serialize(u)]}}function compareSelectors(u,A){return _compareArrays(u.specificity,A.specificity)}function compareSpecificity(u,A){return _compareArrays(u,A)}function _compareArrays(u,A){if(!Array.isArray(u)||!Array.isArray(A)){throw new Error("Arguments must be arrays.")}const p=u.length<A.length?u.length:A.length;for(let y=0;y<p;y++){if(u[y]===A[y]){continue}return u[y]<A[y]?-1:1}return u.length-A.length}var tc=Object.freeze({__proto__:null});var nc=Object.freeze({__proto__:null});const treeify=u=>"▽\n"+treeifyArray(u,rc);const rc=[["├─","│ "],["└─"," "]];const sc=[["┠─","┃ "],["┖─"," "]];const ic=[["╟─","║ "],["╙─"," "]];function treeifyArray(u,A=sc){return prefixItems(A,u.map((u=>treeifyNode(u))))}function treeifyNode(u){switch(u.type){case"terminal":{const A=u.valueContainer;return`◁ #${A.index} ${JSON.stringify(A.specificity)} ${A.value}`}case"tagName":return`◻ Tag name\n${treeifyArray(u.variants,ic)}`;case"attrValue":return`▣ Attr value: ${u.name}\n${treeifyArray(u.matchers,ic)}`;case"attrPresence":return`◨ Attr presence: ${u.name}\n${treeifyArray(u.cont)}`;case"pushElement":return`◉ Push element: ${u.combinator}\n${treeifyArray(u.cont,rc)}`;case"popElement":return`◌ Pop element\n${treeifyArray(u.cont,rc)}`;case"variant":return`◇ = ${u.value}\n${treeifyArray(u.cont)}`;case"matcher":return`◈ ${u.matcher} "${u.value}"${u.modifier||""}\n${treeifyArray(u.cont)}`}}function prefixItems(u,A){return A.map(((A,p,{length:y})=>prefixItem(u,A,p===y-1))).join("\n")}function prefixItem(u,A,p=true){const y=u[p?1:0];return y[0]+A.split("\n").join("\n"+y[1])}var oc=Object.freeze({__proto__:null,treeify:treeify});class DecisionTree{constructor(u){this.branches=weave(toAstTerminalPairs(u))}build(u){return u(this.branches)}}function toAstTerminalPairs(u){const A=u.length;const p=new Array(A);for(let y=0;y<A;y++){const[A,E]=u[y];const C=preprocess(parse1(A));p[y]={ast:C,terminal:{type:"terminal",valueContainer:{index:y,value:E,specificity:C.specificity}}}}return p}function preprocess(u){reduceSelectorVariants(u);parseley_normalize(u);return u}function reduceSelectorVariants(u){const A=[];u.list.forEach((u=>{switch(u.type){case"class":A.push({matcher:"~=",modifier:null,name:"class",namespace:null,specificity:u.specificity,type:"attrValue",value:u.name});break;case"id":A.push({matcher:"=",modifier:null,name:"id",namespace:null,specificity:u.specificity,type:"attrValue",value:u.name});break;case"combinator":reduceSelectorVariants(u.left);A.push(u);break;case"universal":break;default:A.push(u);break}}));u.list=A}function weave(u){const A=[];while(u.length){const p=findTopKey(u,(u=>true),getSelectorKind);const{matches:y,nonmatches:E,empty:C}=breakByKind(u,p);u=E;if(y.length){A.push(branchOfKind(p,y))}if(C.length){A.push(...terminate(C))}}return A}function terminate(u){const A=[];for(const p of u){const u=p.terminal;if(u.type==="terminal"){A.push(u)}else{const{matches:p,rest:y}=partition(u.cont,(u=>u.type==="terminal"));p.forEach((u=>A.push(u)));if(y.length){u.cont=y;A.push(u)}}}return A}function breakByKind(u,A){const p=[];const y=[];const E=[];for(const C of u){const u=C.ast.list;if(u.length){const E=u.some((u=>getSelectorKind(u)===A));(E?p:y).push(C)}else{E.push(C)}}return{matches:p,nonmatches:y,empty:E}}function getSelectorKind(u){switch(u.type){case"attrPresence":return`attrPresence ${u.name}`;case"attrValue":return`attrValue ${u.name}`;case"combinator":return`combinator ${u.combinator}`;default:return u.type}}function branchOfKind(u,A){if(u==="tag"){return tagNameBranch(A)}if(u.startsWith("attrValue ")){return attrValueBranch(u.substring(10),A)}if(u.startsWith("attrPresence ")){return attrPresenceBranch(u.substring(13),A)}if(u==="combinator >"){return combinatorBranch(">",A)}if(u==="combinator +"){return combinatorBranch("+",A)}throw new Error(`Unsupported selector kind: ${u}`)}function tagNameBranch(u){const A=spliceAndGroup(u,(u=>u.type==="tag"),(u=>u.name));const p=Object.entries(A).map((([u,A])=>({type:"variant",value:u,cont:weave(A.items)})));return{type:"tagName",variants:p}}function attrPresenceBranch(u,A){for(const p of A){spliceSimpleSelector(p,(A=>A.type==="attrPresence"&&A.name===u))}return{type:"attrPresence",name:u,cont:weave(A)}}function attrValueBranch(u,A){const p=spliceAndGroup(A,(A=>A.type==="attrValue"&&A.name===u),(u=>`${u.matcher} ${u.modifier||""} ${u.value}`));const y=[];for(const u of Object.values(p)){const A=u.oneSimpleSelector;const p=getAttrPredicate(A);const E=weave(u.items);y.push({type:"matcher",matcher:A.matcher,modifier:A.modifier,value:A.value,predicate:p,cont:E})}return{type:"attrValue",name:u,matchers:y}}function getAttrPredicate(u){if(u.modifier==="i"){const A=u.value.toLowerCase();switch(u.matcher){case"=":return u=>A===u.toLowerCase();case"~=":return u=>u.toLowerCase().split(/[ \t]+/).includes(A);case"^=":return u=>u.toLowerCase().startsWith(A);case"$=":return u=>u.toLowerCase().endsWith(A);case"*=":return u=>u.toLowerCase().includes(A);case"|=":return u=>{const p=u.toLowerCase();return A===p||p.startsWith(A)&&p[A.length]==="-"}}}else{const A=u.value;switch(u.matcher){case"=":return u=>A===u;case"~=":return u=>u.split(/[ \t]+/).includes(A);case"^=":return u=>u.startsWith(A);case"$=":return u=>u.endsWith(A);case"*=":return u=>u.includes(A);case"|=":return u=>A===u||u.startsWith(A)&&u[A.length]==="-"}}}function combinatorBranch(u,A){const p=spliceAndGroup(A,(A=>A.type==="combinator"&&A.combinator===u),(u=>serialize(u.left)));const y=[];for(const u of Object.values(p)){const A=weave(u.items);const p=u.oneSimpleSelector.left;y.push({ast:p,terminal:{type:"popElement",cont:A}})}return{type:"pushElement",combinator:u,cont:weave(y)}}function spliceAndGroup(u,A,p){const y={};while(u.length){const E=findTopKey(u,A,p);const bestKeyPredicate=u=>A(u)&&p(u)===E;const hasBestKeyPredicate=u=>u.ast.list.some(bestKeyPredicate);const{matches:C,rest:I}=partition1(u,hasBestKeyPredicate);let w=null;for(const u of C){const A=spliceSimpleSelector(u,bestKeyPredicate);if(!w){w=A}}if(w==null){throw new Error("No simple selector is found.")}y[E]={oneSimpleSelector:w,items:C};u=I}return y}function spliceSimpleSelector(u,A){const p=u.ast.list;const y=new Array(p.length);let E=-1;for(let u=p.length;u-- >0;){if(A(p[u])){y[u]=true;E=u}}if(E==-1){throw new Error(`Couldn't find the required simple selector.`)}const C=p[E];u.ast.list=p.filter(((u,A)=>!y[A]));return C}function findTopKey(u,A,p){const y={};for(const E of u){const u={};for(const y of E.ast.list.filter(A)){u[p(y)]=true}for(const A of Object.keys(u)){if(y[A]){y[A]++}else{y[A]=1}}}let E="";let C=0;for(const u of Object.entries(y)){if(u[1]>C){E=u[0];C=u[1]}}return E}function partition(u,A){const p=[];const y=[];for(const E of u){if(A(E)){p.push(E)}else{y.push(E)}}return{matches:p,rest:y}}function partition1(u,A){const p=[];const y=[];for(const E of u){if(A(E)){p.push(E)}else{y.push(E)}}return{matches:p,rest:y}}class Picker{constructor(u){this.f=u}pickAll(u){return this.f(u)}pick1(u,A=false){const p=this.f(u);const y=p.length;if(y===0){return null}if(y===1){return p[0].value}const E=A?comparatorPreferFirst:comparatorPreferLast;let C=p[0];for(let u=1;u<y;u++){const A=p[u];if(E(C,A)){C=A}}return C.value}}function comparatorPreferFirst(u,A){const p=compareSpecificity(A.specificity,u.specificity);return p>0||p===0&&A.index<u.index}function comparatorPreferLast(u,A){const p=compareSpecificity(A.specificity,u.specificity);return p>0||p===0&&A.index>u.index}function hp2Builder(u){return new Picker(handleArray(u))}function handleArray(u){const A=u.map(handleNode);return(u,...p)=>A.flatMap((A=>A(u,...p)))}function handleNode(u){switch(u.type){case"terminal":{const A=[u.valueContainer];return(u,...p)=>A}case"tagName":return handleTagName(u);case"attrValue":return handleAttrValueName(u);case"attrPresence":return handleAttrPresenceName(u);case"pushElement":return handlePushElementNode(u);case"popElement":return handlePopElementNode(u)}}function handleTagName(u){const A={};for(const p of u.variants){A[p.value]=handleArray(p.cont)}return(u,...p)=>{const y=A[u.name];return y?y(u,...p):[]}}function handleAttrPresenceName(u){const A=u.name;const p=handleArray(u.cont);return(u,...y)=>Object.prototype.hasOwnProperty.call(u.attribs,A)?p(u,...y):[]}function handleAttrValueName(u){const A=[];for(const p of u.matchers){const u=p.predicate;const y=handleArray(p.cont);A.push(((A,p,...E)=>u(A)?y(p,...E):[]))}const p=u.name;return(u,...y)=>{const E=u.attribs[p];return E||E===""?A.flatMap((A=>A(E,u,...y))):[]}}function handlePushElementNode(u){const A=handleArray(u.cont);const p=u.combinator==="+"?getPrecedingElement:getParentElement;return(u,...y)=>{const E=p(u);if(E===null){return[]}return A(E,u,...y)}}const getPrecedingElement=u=>{const A=u.prev;if(A===null){return null}return node_isTag(A)?A:getPrecedingElement(A)};const getParentElement=u=>{const A=u.parent;return A&&node_isTag(A)?A:null};function handlePopElementNode(u){const A=handleArray(u.cont);return(u,p,...y)=>A(p,...y)}const ac=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((u=>u.charCodeAt(0))));const lc=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((u=>u.charCodeAt(0))));var cc;const uc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);const dc=(cc=String.fromCodePoint)!==null&&cc!==void 0?cc:function(u){let A="";if(u>65535){u-=65536;A+=String.fromCharCode(u>>>10&1023|55296);u=56320|u&1023}A+=String.fromCharCode(u);return A};function replaceCodePoint(u){var A;if(u>=55296&&u<=57343||u>1114111){return 65533}return(A=uc.get(u))!==null&&A!==void 0?A:u}function decodeCodePoint(u){return dc(replaceCodePoint(u))}var fc;(function(u){u[u["NUM"]=35]="NUM";u[u["SEMI"]=59]="SEMI";u[u["EQUALS"]=61]="EQUALS";u[u["ZERO"]=48]="ZERO";u[u["NINE"]=57]="NINE";u[u["LOWER_A"]=97]="LOWER_A";u[u["LOWER_F"]=102]="LOWER_F";u[u["LOWER_X"]=120]="LOWER_X";u[u["LOWER_Z"]=122]="LOWER_Z";u[u["UPPER_A"]=65]="UPPER_A";u[u["UPPER_F"]=70]="UPPER_F";u[u["UPPER_Z"]=90]="UPPER_Z"})(fc||(fc={}));const Ac=32;var hc;(function(u){u[u["VALUE_LENGTH"]=49152]="VALUE_LENGTH";u[u["BRANCH_LENGTH"]=16256]="BRANCH_LENGTH";u[u["JUMP_TABLE"]=127]="JUMP_TABLE"})(hc||(hc={}));function decode_isNumber(u){return u>=fc.ZERO&&u<=fc.NINE}function isHexadecimalCharacter(u){return u>=fc.UPPER_A&&u<=fc.UPPER_F||u>=fc.LOWER_A&&u<=fc.LOWER_F}function isAsciiAlphaNumeric(u){return u>=fc.UPPER_A&&u<=fc.UPPER_Z||u>=fc.LOWER_A&&u<=fc.LOWER_Z||decode_isNumber(u)}function isEntityInAttributeInvalidEnd(u){return u===fc.EQUALS||isAsciiAlphaNumeric(u)}var pc;(function(u){u[u["EntityStart"]=0]="EntityStart";u[u["NumericStart"]=1]="NumericStart";u[u["NumericDecimal"]=2]="NumericDecimal";u[u["NumericHex"]=3]="NumericHex";u[u["NamedEntity"]=4]="NamedEntity"})(pc||(pc={}));var gc;(function(u){u[u["Legacy"]=0]="Legacy";u[u["Strict"]=1]="Strict";u[u["Attribute"]=2]="Attribute"})(gc||(gc={}));class EntityDecoder{constructor(u,A,p){this.decodeTree=u;this.emitCodePoint=A;this.errors=p;this.state=pc.EntityStart;this.consumed=1;this.result=0;this.treeIndex=0;this.excess=1;this.decodeMode=gc.Strict}startEntity(u){this.decodeMode=u;this.state=pc.EntityStart;this.result=0;this.treeIndex=0;this.excess=1;this.consumed=1}write(u,A){switch(this.state){case pc.EntityStart:{if(u.charCodeAt(A)===fc.NUM){this.state=pc.NumericStart;this.consumed+=1;return this.stateNumericStart(u,A+1)}this.state=pc.NamedEntity;return this.stateNamedEntity(u,A)}case pc.NumericStart:{return this.stateNumericStart(u,A)}case pc.NumericDecimal:{return this.stateNumericDecimal(u,A)}case pc.NumericHex:{return this.stateNumericHex(u,A)}case pc.NamedEntity:{return this.stateNamedEntity(u,A)}}}stateNumericStart(u,A){if(A>=u.length){return-1}if((u.charCodeAt(A)|Ac)===fc.LOWER_X){this.state=pc.NumericHex;this.consumed+=1;return this.stateNumericHex(u,A+1)}this.state=pc.NumericDecimal;return this.stateNumericDecimal(u,A)}addToNumericResult(u,A,p,y){if(A!==p){const E=p-A;this.result=this.result*Math.pow(y,E)+parseInt(u.substr(A,E),y);this.consumed+=E}}stateNumericHex(u,A){const p=A;while(A<u.length){const y=u.charCodeAt(A);if(decode_isNumber(y)||isHexadecimalCharacter(y)){A+=1}else{this.addToNumericResult(u,p,A,16);return this.emitNumericEntity(y,3)}}this.addToNumericResult(u,p,A,16);return-1}stateNumericDecimal(u,A){const p=A;while(A<u.length){const y=u.charCodeAt(A);if(decode_isNumber(y)){A+=1}else{this.addToNumericResult(u,p,A,10);return this.emitNumericEntity(y,2)}}this.addToNumericResult(u,p,A,10);return-1}emitNumericEntity(u,A){var p;if(this.consumed<=A){(p=this.errors)===null||p===void 0?void 0:p.absenceOfDigitsInNumericCharacterReference(this.consumed);return 0}if(u===fc.SEMI){this.consumed+=1}else if(this.decodeMode===gc.Strict){return 0}this.emitCodePoint(replaceCodePoint(this.result),this.consumed);if(this.errors){if(u!==fc.SEMI){this.errors.missingSemicolonAfterCharacterReference()}this.errors.validateNumericCharacterReference(this.result)}return this.consumed}stateNamedEntity(u,A){const{decodeTree:p}=this;let y=p[this.treeIndex];let E=(y&hc.VALUE_LENGTH)>>14;for(;A<u.length;A++,this.excess++){const C=u.charCodeAt(A);this.treeIndex=determineBranch(p,y,this.treeIndex+Math.max(1,E),C);if(this.treeIndex<0){return this.result===0||this.decodeMode===gc.Attribute&&(E===0||isEntityInAttributeInvalidEnd(C))?0:this.emitNotTerminatedNamedEntity()}y=p[this.treeIndex];E=(y&hc.VALUE_LENGTH)>>14;if(E!==0){if(C===fc.SEMI){return this.emitNamedEntityData(this.treeIndex,E,this.consumed+this.excess)}if(this.decodeMode!==gc.Strict){this.result=this.treeIndex;this.consumed+=this.excess;this.excess=0}}}return-1}emitNotTerminatedNamedEntity(){var u;const{result:A,decodeTree:p}=this;const y=(p[A]&hc.VALUE_LENGTH)>>14;this.emitNamedEntityData(A,y,this.consumed);(u=this.errors)===null||u===void 0?void 0:u.missingSemicolonAfterCharacterReference();return this.consumed}emitNamedEntityData(u,A,p){const{decodeTree:y}=this;this.emitCodePoint(A===1?y[u]&~hc.VALUE_LENGTH:y[u+1],p);if(A===3){this.emitCodePoint(y[u+2],p)}return p}end(){var u;switch(this.state){case pc.NamedEntity:{return this.result!==0&&(this.decodeMode!==gc.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0}case pc.NumericDecimal:{return this.emitNumericEntity(0,2)}case pc.NumericHex:{return this.emitNumericEntity(0,3)}case pc.NumericStart:{(u=this.errors)===null||u===void 0?void 0:u.absenceOfDigitsInNumericCharacterReference(this.consumed);return 0}case pc.EntityStart:{return 0}}}}function getDecoder(u){let A="";const p=new EntityDecoder(u,(u=>A+=dc(u)));return function decodeWithTrie(u,y){let E=0;let C=0;while((C=u.indexOf("&",C))>=0){A+=u.slice(E,C);p.startEntity(y);const I=p.write(u,C+1);if(I<0){E=C+p.end();break}E=C+I;C=I===0?E+1:E}const I=A+u.slice(E);A="";return I}}function determineBranch(u,A,p,y){const E=(A&hc.BRANCH_LENGTH)>>7;const C=A&hc.JUMP_TABLE;if(E===0){return C!==0&&y===C?p:-1}if(C){const A=y-C;return A<0||A>=E?-1:u[p+A]-1}let I=p;let w=I+E-1;while(I<=w){const A=I+w>>>1;const p=u[A];if(p<y){I=A+1}else if(p>y){w=A-1}else{return u[A+E]}}return-1}const mc=getDecoder(ac);const yc=getDecoder(lc);function decode_decodeHTML(u,A=gc.Legacy){return mc(u,A)}function decodeHTMLAttribute(u){return mc(u,gc.Attribute)}function decodeHTMLStrict(u){return mc(u,gc.Strict)}function decode_decodeXML(u){return yc(u,gc.Strict)}var Ec;(function(u){u[u["Tab"]=9]="Tab";u[u["NewLine"]=10]="NewLine";u[u["FormFeed"]=12]="FormFeed";u[u["CarriageReturn"]=13]="CarriageReturn";u[u["Space"]=32]="Space";u[u["ExclamationMark"]=33]="ExclamationMark";u[u["Number"]=35]="Number";u[u["Amp"]=38]="Amp";u[u["SingleQuote"]=39]="SingleQuote";u[u["DoubleQuote"]=34]="DoubleQuote";u[u["Dash"]=45]="Dash";u[u["Slash"]=47]="Slash";u[u["Zero"]=48]="Zero";u[u["Nine"]=57]="Nine";u[u["Semi"]=59]="Semi";u[u["Lt"]=60]="Lt";u[u["Eq"]=61]="Eq";u[u["Gt"]=62]="Gt";u[u["Questionmark"]=63]="Questionmark";u[u["UpperA"]=65]="UpperA";u[u["LowerA"]=97]="LowerA";u[u["UpperF"]=70]="UpperF";u[u["LowerF"]=102]="LowerF";u[u["UpperZ"]=90]="UpperZ";u[u["LowerZ"]=122]="LowerZ";u[u["LowerX"]=120]="LowerX";u[u["OpeningSquareBracket"]=91]="OpeningSquareBracket"})(Ec||(Ec={}));var Cc;(function(u){u[u["Text"]=1]="Text";u[u["BeforeTagName"]=2]="BeforeTagName";u[u["InTagName"]=3]="InTagName";u[u["InSelfClosingTag"]=4]="InSelfClosingTag";u[u["BeforeClosingTagName"]=5]="BeforeClosingTagName";u[u["InClosingTagName"]=6]="InClosingTagName";u[u["AfterClosingTagName"]=7]="AfterClosingTagName";u[u["BeforeAttributeName"]=8]="BeforeAttributeName";u[u["InAttributeName"]=9]="InAttributeName";u[u["AfterAttributeName"]=10]="AfterAttributeName";u[u["BeforeAttributeValue"]=11]="BeforeAttributeValue";u[u["InAttributeValueDq"]=12]="InAttributeValueDq";u[u["InAttributeValueSq"]=13]="InAttributeValueSq";u[u["InAttributeValueNq"]=14]="InAttributeValueNq";u[u["BeforeDeclaration"]=15]="BeforeDeclaration";u[u["InDeclaration"]=16]="InDeclaration";u[u["InProcessingInstruction"]=17]="InProcessingInstruction";u[u["BeforeComment"]=18]="BeforeComment";u[u["CDATASequence"]=19]="CDATASequence";u[u["InSpecialComment"]=20]="InSpecialComment";u[u["InCommentLike"]=21]="InCommentLike";u[u["BeforeSpecialS"]=22]="BeforeSpecialS";u[u["SpecialStartSequence"]=23]="SpecialStartSequence";u[u["InSpecialTag"]=24]="InSpecialTag";u[u["BeforeEntity"]=25]="BeforeEntity";u[u["BeforeNumericEntity"]=26]="BeforeNumericEntity";u[u["InNamedEntity"]=27]="InNamedEntity";u[u["InNumericEntity"]=28]="InNumericEntity";u[u["InHexEntity"]=29]="InHexEntity"})(Cc||(Cc={}));function isWhitespace(u){return u===Ec.Space||u===Ec.NewLine||u===Ec.Tab||u===Ec.FormFeed||u===Ec.CarriageReturn}function isEndOfTagSection(u){return u===Ec.Slash||u===Ec.Gt||isWhitespace(u)}function Tokenizer_isNumber(u){return u>=Ec.Zero&&u<=Ec.Nine}function isASCIIAlpha(u){return u>=Ec.LowerA&&u<=Ec.LowerZ||u>=Ec.UpperA&&u<=Ec.UpperZ}function isHexDigit(u){return u>=Ec.UpperA&&u<=Ec.UpperF||u>=Ec.LowerA&&u<=Ec.LowerF}var Ic;(function(u){u[u["NoValue"]=0]="NoValue";u[u["Unquoted"]=1]="Unquoted";u[u["Single"]=2]="Single";u[u["Double"]=3]="Double"})(Ic||(Ic={}));const bc={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])};class Tokenizer{constructor({xmlMode:u=false,decodeEntities:A=true},p){this.cbs=p;this.state=Cc.Text;this.buffer="";this.sectionStart=0;this.index=0;this.baseState=Cc.Text;this.isSpecial=false;this.running=true;this.offset=0;this.currentSequence=undefined;this.sequenceIndex=0;this.trieIndex=0;this.trieCurrent=0;this.entityResult=0;this.entityExcess=0;this.xmlMode=u;this.decodeEntities=A;this.entityTrie=u?lc:ac}reset(){this.state=Cc.Text;this.buffer="";this.sectionStart=0;this.index=0;this.baseState=Cc.Text;this.currentSequence=undefined;this.running=true;this.offset=0}write(u){this.offset+=this.buffer.length;this.buffer=u;this.parse()}end(){if(this.running)this.finish()}pause(){this.running=false}resume(){this.running=true;if(this.index<this.buffer.length+this.offset){this.parse()}}getIndex(){return this.index}getSectionStart(){return this.sectionStart}stateText(u){if(u===Ec.Lt||!this.decodeEntities&&this.fastForwardTo(Ec.Lt)){if(this.index>this.sectionStart){this.cbs.ontext(this.sectionStart,this.index)}this.state=Cc.BeforeTagName;this.sectionStart=this.index}else if(this.decodeEntities&&u===Ec.Amp){this.state=Cc.BeforeEntity}}stateSpecialStartSequence(u){const A=this.sequenceIndex===this.currentSequence.length;const p=A?isEndOfTagSection(u):(u|32)===this.currentSequence[this.sequenceIndex];if(!p){this.isSpecial=false}else if(!A){this.sequenceIndex++;return}this.sequenceIndex=0;this.state=Cc.InTagName;this.stateInTagName(u)}stateInSpecialTag(u){if(this.sequenceIndex===this.currentSequence.length){if(u===Ec.Gt||isWhitespace(u)){const A=this.index-this.currentSequence.length;if(this.sectionStart<A){const u=this.index;this.index=A;this.cbs.ontext(this.sectionStart,A);this.index=u}this.isSpecial=false;this.sectionStart=A+2;this.stateInClosingTagName(u);return}this.sequenceIndex=0}if((u|32)===this.currentSequence[this.sequenceIndex]){this.sequenceIndex+=1}else if(this.sequenceIndex===0){if(this.currentSequence===bc.TitleEnd){if(this.decodeEntities&&u===Ec.Amp){this.state=Cc.BeforeEntity}}else if(this.fastForwardTo(Ec.Lt)){this.sequenceIndex=1}}else{this.sequenceIndex=Number(u===Ec.Lt)}}stateCDATASequence(u){if(u===bc.Cdata[this.sequenceIndex]){if(++this.sequenceIndex===bc.Cdata.length){this.state=Cc.InCommentLike;this.currentSequence=bc.CdataEnd;this.sequenceIndex=0;this.sectionStart=this.index+1}}else{this.sequenceIndex=0;this.state=Cc.InDeclaration;this.stateInDeclaration(u)}}fastForwardTo(u){while(++this.index<this.buffer.length+this.offset){if(this.buffer.charCodeAt(this.index-this.offset)===u){return true}}this.index=this.buffer.length+this.offset-1;return false}stateInCommentLike(u){if(u===this.currentSequence[this.sequenceIndex]){if(++this.sequenceIndex===this.currentSequence.length){if(this.currentSequence===bc.CdataEnd){this.cbs.oncdata(this.sectionStart,this.index,2)}else{this.cbs.oncomment(this.sectionStart,this.index,2)}this.sequenceIndex=0;this.sectionStart=this.index+1;this.state=Cc.Text}}else if(this.sequenceIndex===0){if(this.fastForwardTo(this.currentSequence[0])){this.sequenceIndex=1}}else if(u!==this.currentSequence[this.sequenceIndex-1]){this.sequenceIndex=0}}isTagStartChar(u){return this.xmlMode?!isEndOfTagSection(u):isASCIIAlpha(u)}startSpecial(u,A){this.isSpecial=true;this.currentSequence=u;this.sequenceIndex=A;this.state=Cc.SpecialStartSequence}stateBeforeTagName(u){if(u===Ec.ExclamationMark){this.state=Cc.BeforeDeclaration;this.sectionStart=this.index+1}else if(u===Ec.Questionmark){this.state=Cc.InProcessingInstruction;this.sectionStart=this.index+1}else if(this.isTagStartChar(u)){const A=u|32;this.sectionStart=this.index;if(!this.xmlMode&&A===bc.TitleEnd[2]){this.startSpecial(bc.TitleEnd,3)}else{this.state=!this.xmlMode&&A===bc.ScriptEnd[2]?Cc.BeforeSpecialS:Cc.InTagName}}else if(u===Ec.Slash){this.state=Cc.BeforeClosingTagName}else{this.state=Cc.Text;this.stateText(u)}}stateInTagName(u){if(isEndOfTagSection(u)){this.cbs.onopentagname(this.sectionStart,this.index);this.sectionStart=-1;this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}}stateBeforeClosingTagName(u){if(isWhitespace(u)){}else if(u===Ec.Gt){this.state=Cc.Text}else{this.state=this.isTagStartChar(u)?Cc.InClosingTagName:Cc.InSpecialComment;this.sectionStart=this.index}}stateInClosingTagName(u){if(u===Ec.Gt||isWhitespace(u)){this.cbs.onclosetag(this.sectionStart,this.index);this.sectionStart=-1;this.state=Cc.AfterClosingTagName;this.stateAfterClosingTagName(u)}}stateAfterClosingTagName(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.state=Cc.Text;this.baseState=Cc.Text;this.sectionStart=this.index+1}}stateBeforeAttributeName(u){if(u===Ec.Gt){this.cbs.onopentagend(this.index);if(this.isSpecial){this.state=Cc.InSpecialTag;this.sequenceIndex=0}else{this.state=Cc.Text}this.baseState=this.state;this.sectionStart=this.index+1}else if(u===Ec.Slash){this.state=Cc.InSelfClosingTag}else if(!isWhitespace(u)){this.state=Cc.InAttributeName;this.sectionStart=this.index}}stateInSelfClosingTag(u){if(u===Ec.Gt){this.cbs.onselfclosingtag(this.index);this.state=Cc.Text;this.baseState=Cc.Text;this.sectionStart=this.index+1;this.isSpecial=false}else if(!isWhitespace(u)){this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}}stateInAttributeName(u){if(u===Ec.Eq||isEndOfTagSection(u)){this.cbs.onattribname(this.sectionStart,this.index);this.sectionStart=-1;this.state=Cc.AfterAttributeName;this.stateAfterAttributeName(u)}}stateAfterAttributeName(u){if(u===Ec.Eq){this.state=Cc.BeforeAttributeValue}else if(u===Ec.Slash||u===Ec.Gt){this.cbs.onattribend(Ic.NoValue,this.index);this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}else if(!isWhitespace(u)){this.cbs.onattribend(Ic.NoValue,this.index);this.state=Cc.InAttributeName;this.sectionStart=this.index}}stateBeforeAttributeValue(u){if(u===Ec.DoubleQuote){this.state=Cc.InAttributeValueDq;this.sectionStart=this.index+1}else if(u===Ec.SingleQuote){this.state=Cc.InAttributeValueSq;this.sectionStart=this.index+1}else if(!isWhitespace(u)){this.sectionStart=this.index;this.state=Cc.InAttributeValueNq;this.stateInAttributeValueNoQuotes(u)}}handleInAttributeValue(u,A){if(u===A||!this.decodeEntities&&this.fastForwardTo(A)){this.cbs.onattribdata(this.sectionStart,this.index);this.sectionStart=-1;this.cbs.onattribend(A===Ec.DoubleQuote?Ic.Double:Ic.Single,this.index);this.state=Cc.BeforeAttributeName}else if(this.decodeEntities&&u===Ec.Amp){this.baseState=this.state;this.state=Cc.BeforeEntity}}stateInAttributeValueDoubleQuotes(u){this.handleInAttributeValue(u,Ec.DoubleQuote)}stateInAttributeValueSingleQuotes(u){this.handleInAttributeValue(u,Ec.SingleQuote)}stateInAttributeValueNoQuotes(u){if(isWhitespace(u)||u===Ec.Gt){this.cbs.onattribdata(this.sectionStart,this.index);this.sectionStart=-1;this.cbs.onattribend(Ic.Unquoted,this.index);this.state=Cc.BeforeAttributeName;this.stateBeforeAttributeName(u)}else if(this.decodeEntities&&u===Ec.Amp){this.baseState=this.state;this.state=Cc.BeforeEntity}}stateBeforeDeclaration(u){if(u===Ec.OpeningSquareBracket){this.state=Cc.CDATASequence;this.sequenceIndex=0}else{this.state=u===Ec.Dash?Cc.BeforeComment:Cc.InDeclaration}}stateInDeclaration(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.cbs.ondeclaration(this.sectionStart,this.index);this.state=Cc.Text;this.sectionStart=this.index+1}}stateInProcessingInstruction(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.cbs.onprocessinginstruction(this.sectionStart,this.index);this.state=Cc.Text;this.sectionStart=this.index+1}}stateBeforeComment(u){if(u===Ec.Dash){this.state=Cc.InCommentLike;this.currentSequence=bc.CommentEnd;this.sequenceIndex=2;this.sectionStart=this.index+1}else{this.state=Cc.InDeclaration}}stateInSpecialComment(u){if(u===Ec.Gt||this.fastForwardTo(Ec.Gt)){this.cbs.oncomment(this.sectionStart,this.index,0);this.state=Cc.Text;this.sectionStart=this.index+1}}stateBeforeSpecialS(u){const A=u|32;if(A===bc.ScriptEnd[3]){this.startSpecial(bc.ScriptEnd,4)}else if(A===bc.StyleEnd[3]){this.startSpecial(bc.StyleEnd,4)}else{this.state=Cc.InTagName;this.stateInTagName(u)}}stateBeforeEntity(u){this.entityExcess=1;this.entityResult=0;if(u===Ec.Number){this.state=Cc.BeforeNumericEntity}else if(u===Ec.Amp){}else{this.trieIndex=0;this.trieCurrent=this.entityTrie[0];this.state=Cc.InNamedEntity;this.stateInNamedEntity(u)}}stateInNamedEntity(u){this.entityExcess+=1;this.trieIndex=determineBranch(this.entityTrie,this.trieCurrent,this.trieIndex+1,u);if(this.trieIndex<0){this.emitNamedEntity();this.index--;return}this.trieCurrent=this.entityTrie[this.trieIndex];const A=this.trieCurrent&hc.VALUE_LENGTH;if(A){const p=(A>>14)-1;if(!this.allowLegacyEntity()&&u!==Ec.Semi){this.trieIndex+=p}else{const u=this.index-this.entityExcess+1;if(u>this.sectionStart){this.emitPartial(this.sectionStart,u)}this.entityResult=this.trieIndex;this.trieIndex+=p;this.entityExcess=0;this.sectionStart=this.index+1;if(p===0){this.emitNamedEntity()}}}}emitNamedEntity(){this.state=this.baseState;if(this.entityResult===0){return}const u=(this.entityTrie[this.entityResult]&hc.VALUE_LENGTH)>>14;switch(u){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~hc.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);this.emitCodePoint(this.entityTrie[this.entityResult+2])}}}stateBeforeNumericEntity(u){if((u|32)===Ec.LowerX){this.entityExcess++;this.state=Cc.InHexEntity}else{this.state=Cc.InNumericEntity;this.stateInNumericEntity(u)}}emitNumericEntity(u){const A=this.index-this.entityExcess-1;const p=A+2+Number(this.state===Cc.InHexEntity);if(p!==this.index){if(A>this.sectionStart){this.emitPartial(this.sectionStart,A)}this.sectionStart=this.index+Number(u);this.emitCodePoint(replaceCodePoint(this.entityResult))}this.state=this.baseState}stateInNumericEntity(u){if(u===Ec.Semi){this.emitNumericEntity(true)}else if(Tokenizer_isNumber(u)){this.entityResult=this.entityResult*10+(u-Ec.Zero);this.entityExcess++}else{if(this.allowLegacyEntity()){this.emitNumericEntity(false)}else{this.state=this.baseState}this.index--}}stateInHexEntity(u){if(u===Ec.Semi){this.emitNumericEntity(true)}else if(Tokenizer_isNumber(u)){this.entityResult=this.entityResult*16+(u-Ec.Zero);this.entityExcess++}else if(isHexDigit(u)){this.entityResult=this.entityResult*16+((u|32)-Ec.LowerA+10);this.entityExcess++}else{if(this.allowLegacyEntity()){this.emitNumericEntity(false)}else{this.state=this.baseState}this.index--}}allowLegacyEntity(){return!this.xmlMode&&(this.baseState===Cc.Text||this.baseState===Cc.InSpecialTag)}cleanup(){if(this.running&&this.sectionStart!==this.index){if(this.state===Cc.Text||this.state===Cc.InSpecialTag&&this.sequenceIndex===0){this.cbs.ontext(this.sectionStart,this.index);this.sectionStart=this.index}else if(this.state===Cc.InAttributeValueDq||this.state===Cc.InAttributeValueSq||this.state===Cc.InAttributeValueNq){this.cbs.onattribdata(this.sectionStart,this.index);this.sectionStart=this.index}}}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){while(this.shouldContinue()){const u=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case Cc.Text:{this.stateText(u);break}case Cc.SpecialStartSequence:{this.stateSpecialStartSequence(u);break}case Cc.InSpecialTag:{this.stateInSpecialTag(u);break}case Cc.CDATASequence:{this.stateCDATASequence(u);break}case Cc.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(u);break}case Cc.InAttributeName:{this.stateInAttributeName(u);break}case Cc.InCommentLike:{this.stateInCommentLike(u);break}case Cc.InSpecialComment:{this.stateInSpecialComment(u);break}case Cc.BeforeAttributeName:{this.stateBeforeAttributeName(u);break}case Cc.InTagName:{this.stateInTagName(u);break}case Cc.InClosingTagName:{this.stateInClosingTagName(u);break}case Cc.BeforeTagName:{this.stateBeforeTagName(u);break}case Cc.AfterAttributeName:{this.stateAfterAttributeName(u);break}case Cc.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(u);break}case Cc.BeforeAttributeValue:{this.stateBeforeAttributeValue(u);break}case Cc.BeforeClosingTagName:{this.stateBeforeClosingTagName(u);break}case Cc.AfterClosingTagName:{this.stateAfterClosingTagName(u);break}case Cc.BeforeSpecialS:{this.stateBeforeSpecialS(u);break}case Cc.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(u);break}case Cc.InSelfClosingTag:{this.stateInSelfClosingTag(u);break}case Cc.InDeclaration:{this.stateInDeclaration(u);break}case Cc.BeforeDeclaration:{this.stateBeforeDeclaration(u);break}case Cc.BeforeComment:{this.stateBeforeComment(u);break}case Cc.InProcessingInstruction:{this.stateInProcessingInstruction(u);break}case Cc.InNamedEntity:{this.stateInNamedEntity(u);break}case Cc.BeforeEntity:{this.stateBeforeEntity(u);break}case Cc.InHexEntity:{this.stateInHexEntity(u);break}case Cc.InNumericEntity:{this.stateInNumericEntity(u);break}default:{this.stateBeforeNumericEntity(u)}}this.index++}this.cleanup()}finish(){if(this.state===Cc.InNamedEntity){this.emitNamedEntity()}if(this.sectionStart<this.index){this.handleTrailingData()}this.cbs.onend()}handleTrailingData(){const u=this.buffer.length+this.offset;if(this.state===Cc.InCommentLike){if(this.currentSequence===bc.CdataEnd){this.cbs.oncdata(this.sectionStart,u,0)}else{this.cbs.oncomment(this.sectionStart,u,0)}}else if(this.state===Cc.InNumericEntity&&this.allowLegacyEntity()){this.emitNumericEntity(false)}else if(this.state===Cc.InHexEntity&&this.allowLegacyEntity()){this.emitNumericEntity(false)}else if(this.state===Cc.InTagName||this.state===Cc.BeforeAttributeName||this.state===Cc.BeforeAttributeValue||this.state===Cc.AfterAttributeName||this.state===Cc.InAttributeName||this.state===Cc.InAttributeValueSq||this.state===Cc.InAttributeValueDq||this.state===Cc.InAttributeValueNq||this.state===Cc.InClosingTagName){}else{this.cbs.ontext(this.sectionStart,u)}}emitPartial(u,A){if(this.baseState!==Cc.Text&&this.baseState!==Cc.InSpecialTag){this.cbs.onattribdata(u,A)}else{this.cbs.ontext(u,A)}}emitCodePoint(u){if(this.baseState!==Cc.Text&&this.baseState!==Cc.InSpecialTag){this.cbs.onattribentity(u)}else{this.cbs.ontextentity(u)}}}const wc=new Set(["input","option","optgroup","select","button","datalist","textarea"]);const vc=new Set(["p"]);const Bc=new Set(["thead","tbody"]);const Sc=new Set(["dd","dt"]);const Dc=new Set(["rt","rp"]);const kc=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",vc],["h1",vc],["h2",vc],["h3",vc],["h4",vc],["h5",vc],["h6",vc],["select",wc],["input",wc],["output",wc],["button",wc],["datalist",wc],["textarea",wc],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Sc],["dt",Sc],["address",vc],["article",vc],["aside",vc],["blockquote",vc],["details",vc],["div",vc],["dl",vc],["fieldset",vc],["figcaption",vc],["figure",vc],["footer",vc],["form",vc],["header",vc],["hr",vc],["main",vc],["nav",vc],["ol",vc],["pre",vc],["section",vc],["table",vc],["ul",vc],["rt",Dc],["rp",Dc],["tbody",Bc],["tfoot",Bc]]);const Qc=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);const Fc=new Set(["math","svg"]);const xc=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]);const Rc=/\s|\//;class Parser_Parser{constructor(u,A={}){var p,y,E,C,I;this.options=A;this.startIndex=0;this.endIndex=0;this.openTagStart=0;this.tagname="";this.attribname="";this.attribvalue="";this.attribs=null;this.stack=[];this.foreignContext=[];this.buffers=[];this.bufferOffset=0;this.writeIndex=0;this.ended=false;this.cbs=u!==null&&u!==void 0?u:{};this.lowerCaseTagNames=(p=A.lowerCaseTags)!==null&&p!==void 0?p:!A.xmlMode;this.lowerCaseAttributeNames=(y=A.lowerCaseAttributeNames)!==null&&y!==void 0?y:!A.xmlMode;this.tokenizer=new((E=A.Tokenizer)!==null&&E!==void 0?E:Tokenizer)(this.options,this);(I=(C=this.cbs).onparserinit)===null||I===void 0?void 0:I.call(C,this)}ontext(u,A){var p,y;const E=this.getSlice(u,A);this.endIndex=A-1;(y=(p=this.cbs).ontext)===null||y===void 0?void 0:y.call(p,E);this.startIndex=A}ontextentity(u){var A,p;const y=this.tokenizer.getSectionStart();this.endIndex=y-1;(p=(A=this.cbs).ontext)===null||p===void 0?void 0:p.call(A,dc(u));this.startIndex=y}isVoidElement(u){return!this.options.xmlMode&&Qc.has(u)}onopentagname(u,A){this.endIndex=A;let p=this.getSlice(u,A);if(this.lowerCaseTagNames){p=p.toLowerCase()}this.emitOpenTag(p)}emitOpenTag(u){var A,p,y,E;this.openTagStart=this.startIndex;this.tagname=u;const C=!this.options.xmlMode&&kc.get(u);if(C){while(this.stack.length>0&&C.has(this.stack[this.stack.length-1])){const u=this.stack.pop();(p=(A=this.cbs).onclosetag)===null||p===void 0?void 0:p.call(A,u,true)}}if(!this.isVoidElement(u)){this.stack.push(u);if(Fc.has(u)){this.foreignContext.push(true)}else if(xc.has(u)){this.foreignContext.push(false)}}(E=(y=this.cbs).onopentagname)===null||E===void 0?void 0:E.call(y,u);if(this.cbs.onopentag)this.attribs={}}endOpenTag(u){var A,p;this.startIndex=this.openTagStart;if(this.attribs){(p=(A=this.cbs).onopentag)===null||p===void 0?void 0:p.call(A,this.tagname,this.attribs,u);this.attribs=null}if(this.cbs.onclosetag&&this.isVoidElement(this.tagname)){this.cbs.onclosetag(this.tagname,true)}this.tagname=""}onopentagend(u){this.endIndex=u;this.endOpenTag(false);this.startIndex=u+1}onclosetag(u,A){var p,y,E,C,I,w;this.endIndex=A;let v=this.getSlice(u,A);if(this.lowerCaseTagNames){v=v.toLowerCase()}if(Fc.has(v)||xc.has(v)){this.foreignContext.pop()}if(!this.isVoidElement(v)){const u=this.stack.lastIndexOf(v);if(u!==-1){if(this.cbs.onclosetag){let A=this.stack.length-u;while(A--){this.cbs.onclosetag(this.stack.pop(),A!==0)}}else this.stack.length=u}else if(!this.options.xmlMode&&v==="p"){this.emitOpenTag("p");this.closeCurrentTag(true)}}else if(!this.options.xmlMode&&v==="br"){(y=(p=this.cbs).onopentagname)===null||y===void 0?void 0:y.call(p,"br");(C=(E=this.cbs).onopentag)===null||C===void 0?void 0:C.call(E,"br",{},true);(w=(I=this.cbs).onclosetag)===null||w===void 0?void 0:w.call(I,"br",false)}this.startIndex=A+1}onselfclosingtag(u){this.endIndex=u;if(this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]){this.closeCurrentTag(false);this.startIndex=u+1}else{this.onopentagend(u)}}closeCurrentTag(u){var A,p;const y=this.tagname;this.endOpenTag(u);if(this.stack[this.stack.length-1]===y){(p=(A=this.cbs).onclosetag)===null||p===void 0?void 0:p.call(A,y,!u);this.stack.pop()}}onattribname(u,A){this.startIndex=u;const p=this.getSlice(u,A);this.attribname=this.lowerCaseAttributeNames?p.toLowerCase():p}onattribdata(u,A){this.attribvalue+=this.getSlice(u,A)}onattribentity(u){this.attribvalue+=dc(u)}onattribend(u,A){var p,y;this.endIndex=A;(y=(p=this.cbs).onattribute)===null||y===void 0?void 0:y.call(p,this.attribname,this.attribvalue,u===Ic.Double?'"':u===Ic.Single?"'":u===Ic.NoValue?undefined:null);if(this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)){this.attribs[this.attribname]=this.attribvalue}this.attribvalue=""}getInstructionName(u){const A=u.search(Rc);let p=A<0?u:u.substr(0,A);if(this.lowerCaseTagNames){p=p.toLowerCase()}return p}ondeclaration(u,A){this.endIndex=A;const p=this.getSlice(u,A);if(this.cbs.onprocessinginstruction){const u=this.getInstructionName(p);this.cbs.onprocessinginstruction(`!${u}`,`!${p}`)}this.startIndex=A+1}onprocessinginstruction(u,A){this.endIndex=A;const p=this.getSlice(u,A);if(this.cbs.onprocessinginstruction){const u=this.getInstructionName(p);this.cbs.onprocessinginstruction(`?${u}`,`?${p}`)}this.startIndex=A+1}oncomment(u,A,p){var y,E,C,I;this.endIndex=A;(E=(y=this.cbs).oncomment)===null||E===void 0?void 0:E.call(y,this.getSlice(u,A-p));(I=(C=this.cbs).oncommentend)===null||I===void 0?void 0:I.call(C);this.startIndex=A+1}oncdata(u,A,p){var y,E,C,I,w,v,B,S,D,k;this.endIndex=A;const Q=this.getSlice(u,A-p);if(this.options.xmlMode||this.options.recognizeCDATA){(E=(y=this.cbs).oncdatastart)===null||E===void 0?void 0:E.call(y);(I=(C=this.cbs).ontext)===null||I===void 0?void 0:I.call(C,Q);(v=(w=this.cbs).oncdataend)===null||v===void 0?void 0:v.call(w)}else{(S=(B=this.cbs).oncomment)===null||S===void 0?void 0:S.call(B,`[CDATA[${Q}]]`);(k=(D=this.cbs).oncommentend)===null||k===void 0?void 0:k.call(D)}this.startIndex=A+1}onend(){var u,A;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let u=this.stack.length;u>0;this.cbs.onclosetag(this.stack[--u],true));}(A=(u=this.cbs).onend)===null||A===void 0?void 0:A.call(u)}reset(){var u,A,p,y;(A=(u=this.cbs).onreset)===null||A===void 0?void 0:A.call(u);this.tokenizer.reset();this.tagname="";this.attribname="";this.attribs=null;this.stack.length=0;this.startIndex=0;this.endIndex=0;(y=(p=this.cbs).onparserinit)===null||y===void 0?void 0:y.call(p,this);this.buffers.length=0;this.bufferOffset=0;this.writeIndex=0;this.ended=false}parseComplete(u){this.reset();this.end(u)}getSlice(u,A){while(u-this.bufferOffset>=this.buffers[0].length){this.shiftBuffer()}let p=this.buffers[0].slice(u-this.bufferOffset,A-this.bufferOffset);while(A-this.bufferOffset>this.buffers[0].length){this.shiftBuffer();p+=this.buffers[0].slice(0,A-this.bufferOffset)}return p}shiftBuffer(){this.bufferOffset+=this.buffers[0].length;this.writeIndex--;this.buffers.shift()}write(u){var A,p;if(this.ended){(p=(A=this.cbs).onerror)===null||p===void 0?void 0:p.call(A,new Error(".write() after done!"));return}this.buffers.push(u);if(this.tokenizer.running){this.tokenizer.write(u);this.writeIndex++}}end(u){var A,p;if(this.ended){(p=(A=this.cbs).onerror)===null||p===void 0?void 0:p.call(A,new Error(".end() after done!"));return}if(u)this.write(u);this.ended=true;this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){this.tokenizer.resume();while(this.tokenizer.running&&this.writeIndex<this.buffers.length){this.tokenizer.write(this.buffers[this.writeIndex++])}if(this.ended)this.tokenizer.end()}parseChunk(u){this.write(u)}done(u){this.end(u)}}function restoreDiff(u){for(let A=1;A<u.length;A++){u[A][0]+=u[A-1][0]+1}return u}const _c=new Map(restoreDiff([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(restoreDiff([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(restoreDiff([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(restoreDiff([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]]));const Tc=/["&'<>$\x80-\uFFFF]/g;const Nc=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);const Lc=String.prototype.codePointAt!=null?(u,A)=>u.codePointAt(A):(u,A)=>(u.charCodeAt(A)&64512)===55296?(u.charCodeAt(A)-55296)*1024+u.charCodeAt(A+1)-56320+65536:u.charCodeAt(A);function escape_encodeXML(u){let A="";let p=0;let y;while((y=Tc.exec(u))!==null){const E=y.index;const C=u.charCodeAt(E);const I=Nc.get(C);if(I!==undefined){A+=u.substring(p,E)+I;p=E+1}else{A+=`${u.substring(p,E)}&#x${Lc(u,E).toString(16)};`;p=Tc.lastIndex+=Number((C&64512)===55296)}}return A+u.substr(p)}const Pc=null&&escape_encodeXML;function getEscaper(u,A){return function escape(p){let y;let E=0;let C="";while(y=u.exec(p)){if(E!==y.index){C+=p.substring(E,y.index)}C+=A.get(y[0].charCodeAt(0));E=y.index+1}return C+p.substring(E)}}const Oc=getEscaper(/[&<>'"]/g,Nc);const Mc=getEscaper(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]]));const Uc=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));const Hc=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function encode_encodeHTML(u){return encodeHTMLTrieRe(Hc,u)}function encode_encodeNonAsciiHTML(u){return encodeHTMLTrieRe(xmlReplacer,u)}function encodeHTMLTrieRe(u,A){let p="";let y=0;let E;while((E=u.exec(A))!==null){const C=E.index;p+=A.substring(y,C);const I=A.charCodeAt(C);let w=htmlTrie.get(I);if(typeof w==="object"){if(C+1<A.length){const E=A.charCodeAt(C+1);const I=typeof w.n==="number"?w.n===E?w.o:undefined:w.n.get(E);if(I!==undefined){p+=I;y=u.lastIndex+=1;continue}}w=w.v}if(w!==undefined){p+=w;y=C+1}else{const E=getCodePoint(A,C);p+=`&#x${E.toString(16)};`;y=u.lastIndex+=Number(E!==I)}}return p+A.substr(y)}var Gc;(function(u){u[u["XML"]=0]="XML";u[u["HTML"]=1]="HTML"})(Gc||(Gc={}));var Wc;(function(u){u[u["UTF8"]=0]="UTF8";u[u["ASCII"]=1]="ASCII";u[u["Extensive"]=2]="Extensive";u[u["Attribute"]=3]="Attribute";u[u["Text"]=4]="Text"})(Wc||(Wc={}));function decode(u,A=Gc.XML){const p=typeof A==="number"?A:A.level;if(p===Gc.HTML){const p=typeof A==="object"?A.mode:undefined;return decodeHTML(u,p)}return decodeXML(u)}function decodeStrict(u,A=Gc.XML){var p;const y=typeof A==="number"?{level:A}:A;(p=y.mode)!==null&&p!==void 0?p:y.mode=DecodingMode.Strict;return decode(u,y)}function encode(u,A=Gc.XML){const p=typeof A==="number"?{level:A}:A;if(p.mode===Wc.UTF8)return escapeUTF8(u);if(p.mode===Wc.Attribute)return escapeAttribute(u);if(p.mode===Wc.Text)return escapeText(u);if(p.level===Gc.HTML){if(p.mode===Wc.ASCII){return encodeNonAsciiHTML(u)}return encodeHTML(u)}return encodeXML(u)}const jc=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((u=>[u.toLowerCase(),u])));const zc=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((u=>[u.toLowerCase(),u])));const $c=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function replaceQuotes(u){return u.replace(/"/g,"&quot;")}function formatAttributes(u,A){var p;if(!u)return;const y=((p=A.encodeEntities)!==null&&p!==void 0?p:A.decodeEntities)===false?replaceQuotes:A.xmlMode||A.encodeEntities!=="utf8"?escape_encodeXML:Mc;return Object.keys(u).map((p=>{var E,C;const I=(E=u[p])!==null&&E!==void 0?E:"";if(A.xmlMode==="foreign"){p=(C=zc.get(p))!==null&&C!==void 0?C:p}if(!A.emptyAttrs&&!A.xmlMode&&I===""){return p}return`${p}="${y(I)}"`})).join(" ")}const qc=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function render(u,A={}){const p="length"in u?u:[u];let y="";for(let u=0;u<p.length;u++){y+=renderNode(p[u],A)}return y}const Vc=null&&render;function renderNode(u,A){switch(u.type){case tl:return render(u.children,A);case cl:case rl:return renderDirective(u);case sl:return renderComment(u);case ll:return renderCdata(u);case il:case ol:case al:return renderTag(u,A);case nl:return renderText(u,A)}}const Kc=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]);const Jc=new Set(["svg","math"]);function renderTag(u,A){var p;if(A.xmlMode==="foreign"){u.name=(p=jc.get(u.name))!==null&&p!==void 0?p:u.name;if(u.parent&&Kc.has(u.parent.name)){A={...A,xmlMode:false}}}if(!A.xmlMode&&Jc.has(u.name)){A={...A,xmlMode:"foreign"}}let y=`<${u.name}`;const E=formatAttributes(u.attribs,A);if(E){y+=` ${E}`}if(u.children.length===0&&(A.xmlMode?A.selfClosingTags!==false:A.selfClosingTags&&qc.has(u.name))){if(!A.xmlMode)y+=" ";y+="/>"}else{y+=">";if(u.children.length>0){y+=render(u.children,A)}if(A.xmlMode||!qc.has(u.name)){y+=`</${u.name}>`}}return y}function renderDirective(u){return`<${u.data}>`}function renderText(u,A){var p;let y=u.data||"";if(((p=A.encodeEntities)!==null&&p!==void 0?p:A.decodeEntities)!==false&&!(!A.xmlMode&&u.parent&&$c.has(u.parent.name))){y=A.xmlMode||A.encodeEntities!=="utf8"?escape_encodeXML(y):Uc(y)}return y}function renderCdata(u){return`<![CDATA[${u.children[0].data}]]>`}function renderComment(u){return`\x3c!--${u.data}--\x3e`}function getOuterHTML(u,A){return renderHTML(u,A)}function getInnerHTML(u,A){return hasChildren(u)?u.children.map((u=>getOuterHTML(u,A))).join(""):""}function getText(u){if(Array.isArray(u))return u.map(getText).join("");if(isTag(u))return u.name==="br"?"\n":getText(u.children);if(isCDATA(u))return getText(u.children);if(isText(u))return u.data;return""}function stringify_textContent(u){if(Array.isArray(u))return u.map(stringify_textContent).join("");if(hasChildren(u)&&!isComment(u)){return stringify_textContent(u.children)}if(isText(u))return u.data;return""}function innerText(u){if(Array.isArray(u))return u.map(innerText).join("");if(hasChildren(u)&&(u.type===ElementType.Tag||isCDATA(u))){return innerText(u.children)}if(isText(u))return u.data;return""}function getChildren(u){return hasChildren(u)?u.children:[]}function getParent(u){return u.parent||null}function getSiblings(u){const A=getParent(u);if(A!=null)return getChildren(A);const p=[u];let{prev:y,next:E}=u;while(y!=null){p.unshift(y);({prev:y}=y)}while(E!=null){p.push(E);({next:E}=E)}return p}function getAttributeValue(u,A){var p;return(p=u.attribs)===null||p===void 0?void 0:p[A]}function hasAttrib(u,A){return u.attribs!=null&&Object.prototype.hasOwnProperty.call(u.attribs,A)&&u.attribs[A]!=null}function getName(u){return u.name}function nextElementSibling(u){let{next:A}=u;while(A!==null&&!isTag(A))({next:A}=A);return A}function prevElementSibling(u){let{prev:A}=u;while(A!==null&&!isTag(A))({prev:A}=A);return A}function querying_filter(u,A,p=true,y=Infinity){return find(u,Array.isArray(A)?A:[A],p,y)}function find(u,A,p,y){const E=[];const C=[Array.isArray(A)?A:[A]];const I=[0];for(;;){if(I[0]>=C[0].length){if(I.length===1){return E}C.shift();I.shift();continue}const A=C[0][I[0]++];if(u(A)){E.push(A);if(--y<=0)return E}if(p&&hasChildren(A)&&A.children.length>0){I.unshift(0);C.unshift(A.children)}}}function findOneChild(u,A){return A.find(u)}function querying_findOne(u,A,p=true){const y=Array.isArray(A)?A:[A];for(let A=0;A<y.length;A++){const E=y[A];if(isTag(E)&&u(E)){return E}if(p&&hasChildren(E)&&E.children.length>0){const A=querying_findOne(u,E.children,true);if(A)return A}}return null}function existsOne(u,A){return(Array.isArray(A)?A:[A]).some((A=>isTag(A)&&u(A)||hasChildren(A)&&existsOne(u,A.children)))}function findAll(u,A){const p=[];const y=[Array.isArray(A)?A:[A]];const E=[0];for(;;){if(E[0]>=y[0].length){if(y.length===1){return p}y.shift();E.shift();continue}const A=y[0][E[0]++];if(isTag(A)&&u(A))p.push(A);if(hasChildren(A)&&A.children.length>0){E.unshift(0);y.unshift(A.children)}}}const Yc={tag_name(u){if(typeof u==="function"){return A=>node_isTag(A)&&u(A.name)}else if(u==="*"){return node_isTag}return A=>node_isTag(A)&&A.name===u},tag_type(u){if(typeof u==="function"){return A=>u(A.type)}return A=>A.type===u},tag_contains(u){if(typeof u==="function"){return A=>node_isText(A)&&u(A.data)}return A=>node_isText(A)&&A.data===u}};function getAttribCheck(u,A){if(typeof A==="function"){return p=>isTag(p)&&A(p.attribs[u])}return p=>isTag(p)&&p.attribs[u]===A}function combineFuncs(u,A){return p=>u(p)||A(p)}function compileTest(u){const A=Object.keys(u).map((A=>{const p=u[A];return Object.prototype.hasOwnProperty.call(Yc,A)?Yc[A](p):getAttribCheck(A,p)}));return A.length===0?null:A.reduce(combineFuncs)}function testElement(u,A){const p=compileTest(u);return p?p(A):true}function getElements(u,A,p,y=Infinity){const E=compileTest(u);return E?filter(E,A,p,y):[]}function getElementById(u,A,p=true){if(!Array.isArray(A))A=[A];return findOne(getAttribCheck("id",u),A,p)}function legacy_getElementsByTagName(u,A,p=true,y=Infinity){return filter(Yc["tag_name"](u),A,p,y)}function getElementsByClassName(u,A,p=true,y=Infinity){return filter(getAttribCheck("class",u),A,p,y)}function getElementsByTagType(u,A,p=true,y=Infinity){return filter(Yc["tag_type"](u),A,p,y)}function removeSubsets(u){let A=u.length;while(--A>=0){const p=u[A];if(A>0&&u.lastIndexOf(p,A-1)>=0){u.splice(A,1);continue}for(let y=p.parent;y;y=y.parent){if(u.includes(y)){u.splice(A,1);break}}}return u}var Xc;(function(u){u[u["DISCONNECTED"]=1]="DISCONNECTED";u[u["PRECEDING"]=2]="PRECEDING";u[u["FOLLOWING"]=4]="FOLLOWING";u[u["CONTAINS"]=8]="CONTAINS";u[u["CONTAINED_BY"]=16]="CONTAINED_BY"})(Xc||(Xc={}));function compareDocumentPosition(u,A){const p=[];const y=[];if(u===A){return 0}let E=hasChildren(u)?u:u.parent;while(E){p.unshift(E);E=E.parent}E=hasChildren(A)?A:A.parent;while(E){y.unshift(E);E=E.parent}const C=Math.min(p.length,y.length);let I=0;while(I<C&&p[I]===y[I]){I++}if(I===0){return Xc.DISCONNECTED}const w=p[I-1];const v=w.children;const B=p[I];const S=y[I];if(v.indexOf(B)>v.indexOf(S)){if(w===A){return Xc.FOLLOWING|Xc.CONTAINED_BY}return Xc.FOLLOWING}if(w===u){return Xc.PRECEDING|Xc.CONTAINS}return Xc.PRECEDING}function uniqueSort(u){u=u.filter(((u,A,p)=>!p.includes(u,A+1)));u.sort(((u,A)=>{const p=compareDocumentPosition(u,A);if(p&Xc.PRECEDING){return-1}else if(p&Xc.FOLLOWING){return 1}return 0}));return u}function feeds_getFeed(u){const A=getOneElement(isValidFeed,u);return!A?null:A.name==="feed"?getAtomFeed(A):getRssFeed(A)}function getAtomFeed(u){var A;const p=u.children;const y={type:"atom",items:getElementsByTagName("entry",p).map((u=>{var A;const{children:p}=u;const y={media:getMediaElements(p)};addConditionally(y,"id","id",p);addConditionally(y,"title","title",p);const E=(A=getOneElement("link",p))===null||A===void 0?void 0:A.attribs["href"];if(E){y.link=E}const C=feeds_fetch("summary",p)||feeds_fetch("content",p);if(C){y.description=C}const I=feeds_fetch("updated",p);if(I){y.pubDate=new Date(I)}return y}))};addConditionally(y,"id","id",p);addConditionally(y,"title","title",p);const E=(A=getOneElement("link",p))===null||A===void 0?void 0:A.attribs["href"];if(E){y.link=E}addConditionally(y,"description","subtitle",p);const C=feeds_fetch("updated",p);if(C){y.updated=new Date(C)}addConditionally(y,"author","email",p,true);return y}function getRssFeed(u){var A,p;const y=(p=(A=getOneElement("channel",u.children))===null||A===void 0?void 0:A.children)!==null&&p!==void 0?p:[];const E={type:u.name.substr(0,3),id:"",items:getElementsByTagName("item",u.children).map((u=>{const{children:A}=u;const p={media:getMediaElements(A)};addConditionally(p,"id","guid",A);addConditionally(p,"title","title",A);addConditionally(p,"link","link",A);addConditionally(p,"description","description",A);const y=feeds_fetch("pubDate",A)||feeds_fetch("dc:date",A);if(y)p.pubDate=new Date(y);return p}))};addConditionally(E,"title","title",y);addConditionally(E,"link","link",y);addConditionally(E,"description","description",y);const C=feeds_fetch("lastBuildDate",y);if(C){E.updated=new Date(C)}addConditionally(E,"author","managingEditor",y,true);return E}const Zc=null&&["url","type","lang"];const eu=null&&["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements(u){return getElementsByTagName("media:content",u).map((u=>{const{attribs:A}=u;const p={medium:A["medium"],isDefault:!!A["isDefault"]};for(const u of Zc){if(A[u]){p[u]=A[u]}}for(const u of eu){if(A[u]){p[u]=parseInt(A[u],10)}}if(A["expression"]){p.expression=A["expression"]}return p}))}function getOneElement(u,A){return getElementsByTagName(u,A,true,1)[0]}function feeds_fetch(u,A,p=false){return textContent(getElementsByTagName(u,A,p,1)).trim()}function addConditionally(u,A,p,y,E=false){const C=feeds_fetch(p,y,E);if(C)u[A]=C}function isValidFeed(u){return u==="rss"||u==="feed"||u==="rdf:RDF"}function parseDocument(u,A){const p=new esm_DomHandler(undefined,A);new Parser_Parser(p,A).end(u);return p.root}function parseDOM(u,A){return parseDocument(u,A).children}function createDomStream(u,A,p){const y=new DomHandler(u,A,p);return new Parser(y,A)}const tu={xmlMode:true};function parseFeed(u,A=tu){return getFeed(parseDOM(u,A))}var nu=p(9592);function limitedDepthRecursive(u,A,p=()=>undefined){if(u===undefined){const f1=function(...u){return A(f1,...u)};return f1}if(u>=0){return function(...y){return A(limitedDepthRecursive(u-1,A,p),...y)}}return p}function trimCharacter(u,A){let p=0;let y=u.length;while(p<y&&u[p]===A){++p}while(y>p&&u[y-1]===A){--y}return p>0||y<u.length?u.substring(p,y):u}function trimCharacterEnd(u,A){let p=u.length;while(p>0&&u[p-1]===A){--p}return p<u.length?u.substring(0,p):u}function unicodeEscape(u){return u.replace(/[\s\S]/g,(u=>"\\u"+u.charCodeAt().toString(16).padStart(4,"0")))}function mergeDuplicatesPreferLast(u,A){const p=new Map;for(let y=u.length;y-- >0;){const E=u[y];const C=A(E);p.set(C,p.has(C)?nu(E,p.get(C),{arrayMerge:overwriteMerge$1}):E)}return[...p.values()].reverse()}const overwriteMerge$1=(u,A,p)=>[...A];function get(u,A){for(const p of A){if(!u){return undefined}u=u[p]}return u}function numberToLetterSequence(u,A="a",p=26){const y=[];do{u-=1;y.push(u%p);u=u/p>>0}while(u>0);const E=A.charCodeAt(0);return y.reverse().map((u=>String.fromCharCode(E+u))).join("")}const ru=["I","X","C","M"];const su=["V","L","D"];function numberToRoman(u){return[...u+""].map((u=>+u)).reverse().map(((u,A)=>u%5<4?(u<5?"":su[A])+ru[A].repeat(u%5):ru[A]+(u<5?su[A]:ru[A+1]))).reverse().join("")}class InlineTextBuilder{constructor(u,A=undefined){this.lines=[];this.nextLineWords=[];this.maxLineLength=A||u.wordwrap||Number.MAX_VALUE;this.nextLineAvailableChars=this.maxLineLength;this.wrapCharacters=get(u,["longWordSplit","wrapCharacters"])||[];this.forceWrapOnLimit=get(u,["longWordSplit","forceWrapOnLimit"])||false;this.stashedSpace=false;this.wordBreakOpportunity=false}pushWord(u,A=false){if(this.nextLineAvailableChars<=0&&!A){this.startNewLine()}const p=this.nextLineWords.length===0;const y=u.length+(p?0:1);if(y<=this.nextLineAvailableChars||A){this.nextLineWords.push(u);this.nextLineAvailableChars-=y}else{const[A,...y]=this.splitLongWord(u);if(!p){this.startNewLine()}this.nextLineWords.push(A);this.nextLineAvailableChars-=A.length;for(const u of y){this.startNewLine();this.nextLineWords.push(u);this.nextLineAvailableChars-=u.length}}}popWord(){const u=this.nextLineWords.pop();if(u!==undefined){const A=this.nextLineWords.length===0;const p=u.length+(A?0:1);this.nextLineAvailableChars+=p}return u}concatWord(u,A=false){if(this.wordBreakOpportunity&&u.length>this.nextLineAvailableChars){this.pushWord(u,A);this.wordBreakOpportunity=false}else{const p=this.popWord();this.pushWord(p?p.concat(u):u,A)}}startNewLine(u=1){this.lines.push(this.nextLineWords);if(u>1){this.lines.push(...Array.from({length:u-1},(()=>[])))}this.nextLineWords=[];this.nextLineAvailableChars=this.maxLineLength}isEmpty(){return this.lines.length===0&&this.nextLineWords.length===0}clear(){this.lines.length=0;this.nextLineWords.length=0;this.nextLineAvailableChars=this.maxLineLength}toString(){return[...this.lines,this.nextLineWords].map((u=>u.join(" "))).join("\n")}splitLongWord(u){const A=[];let p=0;while(u.length>this.maxLineLength){const y=u.substring(0,this.maxLineLength);const E=u.substring(this.maxLineLength);const C=y.lastIndexOf(this.wrapCharacters[p]);if(C>-1){u=y.substring(C+1)+E;A.push(y.substring(0,C+1))}else{p++;if(p<this.wrapCharacters.length){u=y+E}else{if(this.forceWrapOnLimit){A.push(y);u=E;if(u.length>this.maxLineLength){continue}}else{u=y+E}break}}}A.push(u);return A}}class StackItem{constructor(u=null){this.next=u}getRoot(){return this.next?this.next:this}}class BlockStackItem extends StackItem{constructor(u,A=null,p=1,y=undefined){super(A);this.leadingLineBreaks=p;this.inlineTextBuilder=new InlineTextBuilder(u,y);this.rawText="";this.stashedLineBreaks=0;this.isPre=A&&A.isPre;this.isNoWrap=A&&A.isNoWrap}}class ListStackItem extends BlockStackItem{constructor(u,A=null,{interRowLineBreaks:p=1,leadingLineBreaks:y=2,maxLineLength:E=undefined,maxPrefixLength:C=0,prefixAlign:I="left"}={}){super(u,A,y,E);this.maxPrefixLength=C;this.prefixAlign=I;this.interRowLineBreaks=p}}class ListItemStackItem extends BlockStackItem{constructor(u,A=null,{leadingLineBreaks:p=1,maxLineLength:y=undefined,prefix:E=""}={}){super(u,A,p,y);this.prefix=E}}class TableStackItem extends StackItem{constructor(u=null){super(u);this.rows=[];this.isPre=u&&u.isPre;this.isNoWrap=u&&u.isNoWrap}}class TableRowStackItem extends StackItem{constructor(u=null){super(u);this.cells=[];this.isPre=u&&u.isPre;this.isNoWrap=u&&u.isNoWrap}}class TableCellStackItem extends StackItem{constructor(u,A=null,p=undefined){super(A);this.inlineTextBuilder=new InlineTextBuilder(u,p);this.rawText="";this.stashedLineBreaks=0;this.isPre=A&&A.isPre;this.isNoWrap=A&&A.isNoWrap}}class TransformerStackItem extends StackItem{constructor(u=null,A){super(u);this.transform=A}}function charactersToCodes(u){return[...u].map((u=>"\\u"+u.charCodeAt(0).toString(16).padStart(4,"0"))).join("")}class WhitespaceProcessor{constructor(u){this.whitespaceChars=u.preserveNewlines?u.whitespaceCharacters.replace(/\n/g,""):u.whitespaceCharacters;const A=charactersToCodes(this.whitespaceChars);this.leadingWhitespaceRe=new RegExp(`^[${A}]`);this.trailingWhitespaceRe=new RegExp(`[${A}]$`);this.allWhitespaceOrEmptyRe=new RegExp(`^[${A}]*$`);this.newlineOrNonWhitespaceRe=new RegExp(`(\\n|[^\\n${A}])`,"g");this.newlineOrNonNewlineStringRe=new RegExp(`(\\n|[^\\n]+)`,"g");if(u.preserveNewlines){const u=new RegExp(`\\n|[^\\n${A}]+`,"gm");this.shrinkWrapAdd=function(A,p,y=u=>u,E=false){if(!A){return}const C=p.stashedSpace;let I=false;let w=u.exec(A);if(w){I=true;if(w[0]==="\n"){p.startNewLine()}else if(C||this.testLeadingWhitespace(A)){p.pushWord(y(w[0]),E)}else{p.concatWord(y(w[0]),E)}while((w=u.exec(A))!==null){if(w[0]==="\n"){p.startNewLine()}else{p.pushWord(y(w[0]),E)}}}p.stashedSpace=C&&!I||this.testTrailingWhitespace(A)}}else{const u=new RegExp(`[^${A}]+`,"g");this.shrinkWrapAdd=function(A,p,y=u=>u,E=false){if(!A){return}const C=p.stashedSpace;let I=false;let w=u.exec(A);if(w){I=true;if(C||this.testLeadingWhitespace(A)){p.pushWord(y(w[0]),E)}else{p.concatWord(y(w[0]),E)}while((w=u.exec(A))!==null){p.pushWord(y(w[0]),E)}}p.stashedSpace=C&&!I||this.testTrailingWhitespace(A)}}}addLiteral(u,A,p=true){if(!u){return}const y=A.stashedSpace;let E=false;let C=this.newlineOrNonNewlineStringRe.exec(u);if(C){E=true;if(C[0]==="\n"){A.startNewLine()}else if(y){A.pushWord(C[0],p)}else{A.concatWord(C[0],p)}while((C=this.newlineOrNonNewlineStringRe.exec(u))!==null){if(C[0]==="\n"){A.startNewLine()}else{A.pushWord(C[0],p)}}}A.stashedSpace=y&&!E}testLeadingWhitespace(u){return this.leadingWhitespaceRe.test(u)}testTrailingWhitespace(u){return this.trailingWhitespaceRe.test(u)}testContainsWords(u){return!this.allWhitespaceOrEmptyRe.test(u)}countNewlinesNoWords(u){this.newlineOrNonWhitespaceRe.lastIndex=0;let A=0;let p;while((p=this.newlineOrNonWhitespaceRe.exec(u))!==null){if(p[0]==="\n"){A++}else{return 0}}return A}}class BlockTextBuilder{constructor(u,A,p=undefined){this.options=u;this.picker=A;this.metadata=p;this.whitespaceProcessor=new WhitespaceProcessor(u);this._stackItem=new BlockStackItem(u);this._wordTransformer=undefined}pushWordTransform(u){this._wordTransformer=new TransformerStackItem(this._wordTransformer,u)}popWordTransform(){if(!this._wordTransformer){return undefined}const u=this._wordTransformer.transform;this._wordTransformer=this._wordTransformer.next;return u}startNoWrap(){this._stackItem.isNoWrap=true}stopNoWrap(){this._stackItem.isNoWrap=false}_getCombinedWordTransformer(){const u=this._wordTransformer?u=>applyTransformer(u,this._wordTransformer):undefined;const A=this.options.encodeCharacters;return u?A?p=>A(u(p)):u:A}_popStackItem(){const u=this._stackItem;this._stackItem=u.next;return u}addLineBreak(){if(!(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem)){return}if(this._stackItem.isPre){this._stackItem.rawText+="\n"}else{this._stackItem.inlineTextBuilder.startNewLine()}}addWordBreakOpportunity(){if(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem){this._stackItem.inlineTextBuilder.wordBreakOpportunity=true}}addInline(u,{noWordTransform:A=false}={}){if(!(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem)){return}if(this._stackItem.isPre){this._stackItem.rawText+=u;return}if(u.length===0||this._stackItem.stashedLineBreaks&&!this.whitespaceProcessor.testContainsWords(u)){return}if(this.options.preserveNewlines){const A=this.whitespaceProcessor.countNewlinesNoWords(u);if(A>0){this._stackItem.inlineTextBuilder.startNewLine(A);return}}if(this._stackItem.stashedLineBreaks){this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks)}this.whitespaceProcessor.shrinkWrapAdd(u,this._stackItem.inlineTextBuilder,A?undefined:this._getCombinedWordTransformer(),this._stackItem.isNoWrap);this._stackItem.stashedLineBreaks=0}addLiteral(u){if(!(this._stackItem instanceof BlockStackItem||this._stackItem instanceof ListItemStackItem||this._stackItem instanceof TableCellStackItem)){return}if(u.length===0){return}if(this._stackItem.isPre){this._stackItem.rawText+=u;return}if(this._stackItem.stashedLineBreaks){this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks)}this.whitespaceProcessor.addLiteral(u,this._stackItem.inlineTextBuilder,this._stackItem.isNoWrap);this._stackItem.stashedLineBreaks=0}openBlock({leadingLineBreaks:u=1,reservedLineLength:A=0,isPre:p=false}={}){const y=Math.max(20,this._stackItem.inlineTextBuilder.maxLineLength-A);this._stackItem=new BlockStackItem(this.options,this._stackItem,u,y);if(p){this._stackItem.isPre=true}}closeBlock({trailingLineBreaks:u=1,blockTransform:A=undefined}={}){const p=this._popStackItem();const y=A?A(html_to_text_getText(p)):html_to_text_getText(p);addText(this._stackItem,y,p.leadingLineBreaks,Math.max(p.stashedLineBreaks,u))}openList({maxPrefixLength:u=0,prefixAlign:A="left",interRowLineBreaks:p=1,leadingLineBreaks:y=2}={}){this._stackItem=new ListStackItem(this.options,this._stackItem,{interRowLineBreaks:p,leadingLineBreaks:y,maxLineLength:this._stackItem.inlineTextBuilder.maxLineLength,maxPrefixLength:u,prefixAlign:A})}openListItem({prefix:u=""}={}){if(!(this._stackItem instanceof ListStackItem)){throw new Error("Can't add a list item to something that is not a list! Check the formatter.")}const A=this._stackItem;const p=Math.max(u.length,A.maxPrefixLength);const y=Math.max(20,A.inlineTextBuilder.maxLineLength-p);this._stackItem=new ListItemStackItem(this.options,A,{prefix:u,maxLineLength:y,leadingLineBreaks:A.interRowLineBreaks})}closeListItem(){const u=this._popStackItem();const A=u.next;const p=Math.max(u.prefix.length,A.maxPrefixLength);const y="\n"+" ".repeat(p);const E=A.prefixAlign==="right"?u.prefix.padStart(p):u.prefix.padEnd(p);const C=E+html_to_text_getText(u).replace(/\n/g,y);addText(A,C,u.leadingLineBreaks,Math.max(u.stashedLineBreaks,A.interRowLineBreaks))}closeList({trailingLineBreaks:u=2}={}){const A=this._popStackItem();const p=html_to_text_getText(A);if(p){addText(this._stackItem,p,A.leadingLineBreaks,u)}}openTable(){this._stackItem=new TableStackItem(this._stackItem)}openTableRow(){if(!(this._stackItem instanceof TableStackItem)){throw new Error("Can't add a table row to something that is not a table! Check the formatter.")}this._stackItem=new TableRowStackItem(this._stackItem)}openTableCell({maxColumnWidth:u=undefined}={}){if(!(this._stackItem instanceof TableRowStackItem)){throw new Error("Can't add a table cell to something that is not a table row! Check the formatter.")}this._stackItem=new TableCellStackItem(this.options,this._stackItem,u)}closeTableCell({colspan:u=1,rowspan:A=1}={}){const p=this._popStackItem();const y=trimCharacter(html_to_text_getText(p),"\n");p.next.cells.push({colspan:u,rowspan:A,text:y})}closeTableRow(){const u=this._popStackItem();u.next.rows.push(u.cells)}closeTable({tableToString:u,leadingLineBreaks:A=2,trailingLineBreaks:p=2}){const y=this._popStackItem();const E=u(y.rows);if(E){addText(this._stackItem,E,A,p)}}toString(){return html_to_text_getText(this._stackItem.getRoot())}}function html_to_text_getText(u){if(!(u instanceof BlockStackItem||u instanceof ListItemStackItem||u instanceof TableCellStackItem)){throw new Error("Only blocks, list items and table cells can be requested for text contents.")}return u.inlineTextBuilder.isEmpty()?u.rawText:u.rawText+u.inlineTextBuilder.toString()}function addText(u,A,p,y){if(!(u instanceof BlockStackItem||u instanceof ListItemStackItem||u instanceof TableCellStackItem)){throw new Error("Only blocks, list items and table cells can contain text.")}const E=html_to_text_getText(u);const C=Math.max(u.stashedLineBreaks,p);u.inlineTextBuilder.clear();if(E){u.rawText=E+"\n".repeat(C)+A}else{u.rawText=A;u.leadingLineBreaks=C}u.stashedLineBreaks=y}function applyTransformer(u,A){return A?applyTransformer(A.transform(u),A.next):u}function compile$1(u={}){const A=u.selectors.filter((u=>!u.format));if(A.length){throw new Error("Following selectors have no specified format: "+A.map((u=>`\`${u.selector}\``)).join(", "))}const p=new DecisionTree(u.selectors.map((u=>[u.selector,u]))).build(hp2Builder);if(typeof u.encodeCharacters!=="function"){u.encodeCharacters=makeReplacerFromDict(u.encodeCharacters)}const y=new DecisionTree(u.baseElements.selectors.map(((u,A)=>[u,A+1]))).build(hp2Builder);function findBaseElements(A){return findBases(A,u,y)}const E=limitedDepthRecursive(u.limits.maxDepth,recursiveWalk,(function(A,p){p.addInline(u.limits.ellipsis||"")}));return function(A,y=undefined){return html_to_text_process(A,y,u,p,findBaseElements,E)}}function html_to_text_process(u,A,p,y,E,C){const I=p.limits.maxInputLength;if(I&&u&&u.length>I){console.warn(`Input length ${u.length} is above allowed limit of ${I}. Truncating without ellipsis.`);u=u.substring(0,I)}const w=parseDocument(u,{decodeEntities:p.decodeEntities});const v=E(w.children);const B=new BlockTextBuilder(p,y,A);C(v,B);return B.toString()}function findBases(u,A,p){const y=[];function recursiveWalk(u,E){E=E.slice(0,A.limits.maxChildNodes);for(const C of E){if(C.type!=="tag"){continue}const E=p.pick1(C);if(E>0){y.push({selectorIndex:E,element:C})}else if(C.children){u(C.children)}if(y.length>=A.limits.maxBaseElements){return}}}const E=limitedDepthRecursive(A.limits.maxDepth,recursiveWalk);E(u);if(A.baseElements.orderBy!=="occurrence"){y.sort(((u,A)=>u.selectorIndex-A.selectorIndex))}return A.baseElements.returnDomByDefault&&y.length===0?u:y.map((u=>u.element))}function recursiveWalk(u,A,p){if(!A){return}const y=p.options;const E=A.length>y.limits.maxChildNodes;if(E){A=A.slice(0,y.limits.maxChildNodes);A.push({data:y.limits.ellipsis,type:"text"})}for(const E of A){switch(E.type){case"text":{p.addInline(E.data);break}case"tag":{const A=p.picker.pick1(E);const C=y.formatters[A.format];C(E,u,p,A.options||{});break}}}return}function makeReplacerFromDict(u){if(!u||Object.keys(u).length===0){return undefined}const A=Object.entries(u).filter((([,u])=>u!==false));const p=new RegExp(A.map((([u])=>`(${unicodeEscape([...u][0])})`)).join("|"),"g");const y=A.map((([,u])=>u));const replacer=(u,...A)=>y[A.findIndex((u=>u))];return u=>u.replace(p,replacer)}function formatSkip(u,A,p,y){}function formatInlineString(u,A,p,y){p.addLiteral(y.string||"")}function formatBlockString(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.addLiteral(y.string||"");p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatInline(u,A,p,y){A(u.children,p)}function formatBlock$1(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function renderOpenTag(u){const A=u.attribs&&u.attribs.length?" "+Object.entries(u.attribs).map((([u,A])=>A===""?u:`${u}=${A.replace(/"/g,"&quot;")}`)).join(" "):"";return`<${u.name}${A}>`}function renderCloseTag(u){return`</${u.name}>`}function formatInlineTag(u,A,p,y){p.startNoWrap();p.addLiteral(renderOpenTag(u));p.stopNoWrap();A(u.children,p);p.startNoWrap();p.addLiteral(renderCloseTag(u));p.stopNoWrap()}function formatBlockTag(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.startNoWrap();p.addLiteral(renderOpenTag(u));p.stopNoWrap();A(u.children,p);p.startNoWrap();p.addLiteral(renderCloseTag(u));p.stopNoWrap();p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatInlineHtml(u,A,p,y){p.startNoWrap();p.addLiteral(render(u,{decodeEntities:p.options.decodeEntities}));p.stopNoWrap()}function formatBlockHtml(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.startNoWrap();p.addLiteral(render(u,{decodeEntities:p.options.decodeEntities}));p.stopNoWrap();p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatInlineSurround(u,A,p,y){p.addLiteral(y.prefix||"");A(u.children,p);p.addLiteral(y.suffix||"")}var iu=Object.freeze({__proto__:null,block:formatBlock$1,blockHtml:formatBlockHtml,blockString:formatBlockString,blockTag:formatBlockTag,inline:formatInline,inlineHtml:formatInlineHtml,inlineString:formatInlineString,inlineSurround:formatInlineSurround,inlineTag:formatInlineTag,skip:formatSkip});function getRow(u,A){if(!u[A]){u[A]=[]}return u[A]}function findFirstVacantIndex(u,A=0){while(u[A]){A++}return A}function transposeInPlace(u,A){for(let p=0;p<A;p++){const A=getRow(u,p);for(let y=0;y<p;y++){const E=getRow(u,y);if(A[y]||E[p]){const u=A[y];A[y]=E[p];E[p]=u}}}}function putCellIntoLayout(u,A,p,y){for(let E=0;E<u.rowspan;E++){const C=getRow(A,p+E);for(let A=0;A<u.colspan;A++){C[y+A]=u}}}function getOrInitOffset(u,A){if(u[A]===undefined){u[A]=A===0?0:1+getOrInitOffset(u,A-1)}return u[A]}function updateOffset(u,A,p,y){u[A+p]=Math.max(getOrInitOffset(u,A+p),getOrInitOffset(u,A)+y)}function tableToString(u,A,p){const y=[];let E=0;const C=u.length;const I=[0];for(let p=0;p<C;p++){const C=getRow(y,p);const w=u[p];let v=0;for(let u=0;u<w.length;u++){const E=w[u];v=findFirstVacantIndex(C,v);putCellIntoLayout(E,y,p,v);v+=E.colspan;E.lines=E.text.split("\n");const B=E.lines.length;updateOffset(I,p,E.rowspan,B+A)}E=C.length>E?C.length:E}transposeInPlace(y,C>E?C:E);const w=[];const v=[0];for(let u=0;u<E;u++){let A=0;let E;const B=Math.min(C,y[u].length);while(A<B){E=y[u][A];if(E){if(!E.rendered){let y=0;for(let p=0;p<E.lines.length;p++){const C=E.lines[p];const B=I[A]+p;w[B]=(w[B]||"").padEnd(v[u])+C;y=C.length>y?C.length:y}updateOffset(v,u,E.colspan,y+p);E.rendered=true}A+=E.rowspan}else{const u=I[A];w[u]=w[u]||"";A++}}}return w.join("\n")}function formatLineBreak(u,A,p,y){p.addLineBreak()}function formatWbr(u,A,p,y){p.addWordBreakOpportunity()}function formatHorizontalLine(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});p.addInline("-".repeat(y.length||p.options.wordwrap||40));p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatParagraph(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatPre(u,A,p,y){p.openBlock({isPre:true,leadingLineBreaks:y.leadingLineBreaks||2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatHeading(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2});if(y.uppercase!==false){p.pushWordTransform((u=>u.toUpperCase()));A(u.children,p);p.popWordTransform()}else{A(u.children,p)}p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2})}function formatBlockquote(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks||2,reservedLineLength:2});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks||2,blockTransform:u=>(y.trimEmptyLines!==false?trimCharacter(u,"\n"):u).split("\n").map((u=>"> "+u)).join("\n")})}function withBrackets(u,A){if(!A){return u}const p=typeof A[0]==="string"?A[0]:"[";const y=typeof A[1]==="string"?A[1]:"]";return p+u+y}function pathRewrite(u,A,p,y,E){const C=typeof A==="function"?A(u,y,E):u;return C[0]==="/"&&p?trimCharacterEnd(p,"/")+C:C}function formatImage(u,A,p,y){const E=u.attribs||{};const C=E.alt?E.alt:"";const I=!E.src?"":pathRewrite(E.src,y.pathRewrite,y.baseUrl,p.metadata,u);const w=!I?C:!C?withBrackets(I,y.linkBrackets):C+" "+withBrackets(I,y.linkBrackets);p.addInline(w,{noWordTransform:true})}function formatAnchor(u,A,p,y){function getHref(){if(y.ignoreHref){return""}if(!u.attribs||!u.attribs.href){return""}let A=u.attribs.href.replace(/^mailto:/,"");if(y.noAnchorUrl&&A[0]==="#"){return""}A=pathRewrite(A,y.pathRewrite,y.baseUrl,p.metadata,u);return A}const E=getHref();if(!E){A(u.children,p)}else{let C="";p.pushWordTransform((u=>{if(u){C+=u}return u}));A(u.children,p);p.popWordTransform();const I=y.hideLinkHrefIfSameAsText&&E===C;if(!I){p.addInline(!C?E:" "+withBrackets(E,y.linkBrackets),{noWordTransform:true})}}}function formatList(u,A,p,y,E){const C=get(u,["parent","name"])==="li";let I=0;const w=(u.children||[]).filter((u=>u.type!=="text"||!/^\s*$/.test(u.data))).map((function(u){if(u.name!=="li"){return{node:u,prefix:""}}const A=C?E().trimStart():E();if(A.length>I){I=A.length}return{node:u,prefix:A}}));if(!w.length){return}p.openList({interRowLineBreaks:1,leadingLineBreaks:C?1:y.leadingLineBreaks||2,maxPrefixLength:I,prefixAlign:"left"});for(const{node:u,prefix:y}of w){p.openListItem({prefix:y});A([u],p);p.closeListItem()}p.closeList({trailingLineBreaks:C?1:y.trailingLineBreaks||2})}function formatUnorderedList(u,A,p,y){const E=y.itemPrefix||" * ";return formatList(u,A,p,y,(()=>E))}function formatOrderedList(u,A,p,y){let E=Number(u.attribs.start||"1");const C=getOrderedListIndexFunction(u.attribs.type);const nextPrefixCallback=()=>" "+C(E++)+". ";return formatList(u,A,p,y,nextPrefixCallback)}function getOrderedListIndexFunction(u="1"){switch(u){case"a":return u=>numberToLetterSequence(u,"a");case"A":return u=>numberToLetterSequence(u,"A");case"i":return u=>numberToRoman(u).toLowerCase();case"I":return u=>numberToRoman(u);case"1":default:return u=>u.toString()}}function splitClassesAndIds(u){const A=[];const p=[];for(const y of u){if(y.startsWith(".")){A.push(y.substring(1))}else if(y.startsWith("#")){p.push(y.substring(1))}}return{classes:A,ids:p}}function isDataTable(u,A){if(A===true){return true}if(!u){return false}const{classes:p,ids:y}=splitClassesAndIds(A);const E=(u["class"]||"").split(" ");const C=(u["id"]||"").split(" ");return E.some((u=>p.includes(u)))||C.some((u=>y.includes(u)))}function formatTable(u,A,p,y){return isDataTable(u.attribs,p.options.tables)?formatDataTable(u,A,p,y):formatBlock(u,A,p,y)}function formatBlock(u,A,p,y){p.openBlock({leadingLineBreaks:y.leadingLineBreaks});A(u.children,p);p.closeBlock({trailingLineBreaks:y.trailingLineBreaks})}function formatDataTable(u,A,p,y){p.openTable();u.children.forEach(walkTable);p.closeTable({tableToString:u=>tableToString(u,y.rowSpacing??0,y.colSpacing??3),leadingLineBreaks:y.leadingLineBreaks,trailingLineBreaks:y.trailingLineBreaks});function formatCell(u){const E=+get(u,["attribs","colspan"])||1;const C=+get(u,["attribs","rowspan"])||1;p.openTableCell({maxColumnWidth:y.maxColumnWidth});A(u.children,p);p.closeTableCell({colspan:E,rowspan:C})}function walkTable(u){if(u.type!=="tag"){return}const A=y.uppercaseHeaderCells!==false?u=>{p.pushWordTransform((u=>u.toUpperCase()));formatCell(u);p.popWordTransform()}:formatCell;switch(u.name){case"thead":case"tbody":case"tfoot":case"center":u.children.forEach(walkTable);return;case"tr":{p.openTableRow();for(const p of u.children){if(p.type!=="tag"){continue}switch(p.name){case"th":{A(p);break}case"td":{formatCell(p);break}}}p.closeTableRow();break}}}}var ou=Object.freeze({__proto__:null,anchor:formatAnchor,blockquote:formatBlockquote,dataTable:formatDataTable,heading:formatHeading,horizontalLine:formatHorizontalLine,image:formatImage,lineBreak:formatLineBreak,orderedList:formatOrderedList,paragraph:formatParagraph,pre:formatPre,table:formatTable,unorderedList:formatUnorderedList,wbr:formatWbr});const au={baseElements:{selectors:["body"],orderBy:"selectors",returnDomByDefault:true},decodeEntities:true,encodeCharacters:{},formatters:{},limits:{ellipsis:"...",maxBaseElements:undefined,maxChildNodes:undefined,maxDepth:undefined,maxInputLength:1<<24},longWordSplit:{forceWrapOnLimit:false,wrapCharacters:[]},preserveNewlines:false,selectors:[{selector:"*",format:"inline"},{selector:"a",format:"anchor",options:{baseUrl:null,hideLinkHrefIfSameAsText:false,ignoreHref:false,linkBrackets:["[","]"],noAnchorUrl:true}},{selector:"article",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"aside",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"blockquote",format:"blockquote",options:{leadingLineBreaks:2,trailingLineBreaks:2,trimEmptyLines:true}},{selector:"br",format:"lineBreak"},{selector:"div",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"footer",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"form",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"h1",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:true}},{selector:"h2",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:true}},{selector:"h3",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:true}},{selector:"h4",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:true}},{selector:"h5",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:true}},{selector:"h6",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:true}},{selector:"header",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"hr",format:"horizontalLine",options:{leadingLineBreaks:2,length:undefined,trailingLineBreaks:2}},{selector:"img",format:"image",options:{baseUrl:null,linkBrackets:["[","]"]}},{selector:"main",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"nav",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"ol",format:"orderedList",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"p",format:"paragraph",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"pre",format:"pre",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"section",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"table",format:"table",options:{colSpacing:3,leadingLineBreaks:2,maxColumnWidth:60,rowSpacing:0,trailingLineBreaks:2,uppercaseHeaderCells:true}},{selector:"ul",format:"unorderedList",options:{itemPrefix:" * ",leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"wbr",format:"wbr"}],tables:[],whitespaceCharacters:" \t\r\n\f​",wordwrap:80};const concatMerge=(u,A,p)=>[...u,...A];const overwriteMerge=(u,A,p)=>[...A];const selectorsMerge=(u,A,p)=>u.some((u=>typeof u==="object"))?concatMerge(u,A):overwriteMerge(u,A);function compile(u={}){u=nu(au,u,{arrayMerge:overwriteMerge,customMerge:u=>u==="selectors"?selectorsMerge:undefined});u.formatters=Object.assign({},iu,ou,u.formatters);u.selectors=mergeDuplicatesPreferLast(u.selectors,(u=>u.selector));handleDeprecatedOptions(u);return compile$1(u)}function convert(u,A={},p=undefined){return compile(A)(u,p)}function handleDeprecatedOptions(u){if(u.tags){const A=Object.entries(u.tags).map((([u,A])=>({...A,selector:u||"*"})));u.selectors.push(...A);u.selectors=mergeDuplicatesPreferLast(u.selectors,(u=>u.selector))}function set(u,A,p){const y=A.pop();for(const p of A){let A=u[p];if(!A){A={};u[p]=A}u=A}u[y]=p}if(u["baseElement"]){const A=u["baseElement"];set(u,["baseElements","selectors"],Array.isArray(A)?A:[A])}if(u["returnDomByDefault"]!==undefined){set(u,["baseElements","returnDomByDefault"],u["returnDomByDefault"])}for(const A of u.selectors){if(A.format==="anchor"&&get(A,["options","noLinkBrackets"])){set(A,["options","linkBrackets"],false)}}}const WebFetch=async u=>{const{prompt:A}=u;if(!A){return{error:"Missing parameter: prompt must be provided."}}const p=/(https?:\/\/[^\s]+)/g;const y=A.match(p);if(!y||y.length===0){return{error:"No URLs found in the prompt."}}const E=y[0];try{const u=await fetch(E);const A=u.headers.get("content-type")||"";const p=await u.text();let y;if(A.toLowerCase().includes("text/html")){y=convert(p,{wordwrap:false,selectors:[{selector:"a",options:{ignoreHref:true}},{selector:"img",format:"skip"}]})}else{y=p}return{content:y.substring(0,1e5)}}catch(u){return{error:u.message}}};const lu={api_key:null,timeout:6e4};class errors_InvalidArgumentError extends Error{constructor(){super("Arguments are missing or of incorrect type");Object.setPrototypeOf(this,errors_InvalidArgumentError.prototype)}}class MissingApiKeyError extends Error{constructor(){super("api_key is required, get it from: https://serpapi.com/manage-api-key");Object.setPrototypeOf(this,MissingApiKeyError.prototype)}}class InvalidTimeoutError extends Error{constructor(){super("Enter a valid timeout in milliseconds");Object.setPrototypeOf(this,InvalidTimeoutError.prototype)}}class RequestTimeoutError extends Error{constructor(){super("The request was timed out");Object.setPrototypeOf(this,RequestTimeoutError.prototype)}}const cu="2.2.1";var uu=p(5692);const du=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring");const fu=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("process");const Au={execute:execute,getHostnameAndPort:getHostnameAndPort};function getHostnameAndPort(){return{hostname:"serpapi.com",port:443}}function getSource(){var u,A;const p=`serpapi@${cu}`;if(typeof Deno=="object"){const A=(u=Deno.version)===null||u===void 0?void 0:u.deno;if(A){return`deno@${A},${p}`}}else if(typeof fu=="object"){const u=(A=fu.versions)===null||A===void 0?void 0:A.node;if(u){return`nodejs@${u},${p}`}}return`nodejs,${p}`}function buildRequestOptions(u,A){const p=Object.assign({},A);for(const u in p){if(u==="requestOptions"||u==="timeout"||p[u]===undefined){delete p[u]}}const y=Object.assign(Object.assign({},Au.getHostnameAndPort()),{path:`${u}?${du.stringify(p)}`,method:"GET"});return Object.assign(Object.assign(Object.assign({},lu.requestOptions),A.requestOptions),y)}function execute(u,A,p){const y=buildRequestOptions(u,Object.assign(Object.assign({},A),{source:getSource()}));return new Promise(((u,A)=>{let E;const handleResponse=p=>{p.setEncoding("utf8");let y="";p.on("data",(u=>{y+=u}));p.on("end",(()=>{try{if(p.statusCode==200){u(y)}else{A(y)}}catch(u){A(u)}finally{if(E)clearTimeout(E)}}))};const handleError=u=>{A(u);if(E)clearTimeout(E)};const C=uu.get(y,handleResponse).on("error",handleError);if(p>0){E=setTimeout((()=>{A(new RequestTimeoutError);C.destroy()}),p)}}))}function validators_validateApiKey(u,A=false){if(A&&u===null){return undefined}const p=u!==null&&u!==void 0?u:lu.api_key;if(!p)throw new MissingApiKeyError;return p}function validators_validateTimeout(u){const A=u!==null&&u!==void 0?u:lu.timeout;if(A<=0)throw new InvalidTimeoutError;return A}const hu="/account";const pu="/locations.json";const gu="/search";const mu=null&&`/searches`;function getJson(...u){if(typeof u[0]==="string"&&typeof u[1]==="object"){const[A,p,y]=u;const E=Object.assign(Object.assign({},p),{engine:A});return _getJson(E,y)}else if(typeof u[0]==="object"&&typeof u[1]!=="object"&&(typeof u[1]==="undefined"||typeof u[1]==="function")){const[A,p]=u;return _getJson(A,p)}else{throw new errors_InvalidArgumentError}}async function _getJson(u,A){const p=validators_validateApiKey(u.api_key,true);const y=validators_validateTimeout(u.timeout);const E=await Au.execute(gu,Object.assign(Object.assign({},u),{api_key:p,output:"json"}),y);const C=JSON.parse(E);A===null||A===void 0?void 0:A(C);return C}function getHtml(...u){if(typeof u[0]==="string"&&typeof u[1]==="object"){const[A,p,y]=u;const E=Object.assign(Object.assign({},p),{engine:A});return _getHtml(E,y)}else if(typeof u[0]==="object"&&typeof u[1]!=="object"&&(typeof u[1]==="undefined"||typeof u[1]==="function")){const[A,p]=u;return _getHtml(A,p)}else{throw new InvalidArgumentError}}async function _getHtml(u,A){const p=validateApiKey(u.api_key,true);const y=validateTimeout(u.timeout);const E=await _internals.execute(gu,Object.assign(Object.assign({},u),{api_key:p,output:"html"}),y);A===null||A===void 0?void 0:A(E);return E}async function getJsonBySearchId(u,A={},p){const y=validateApiKey(A.api_key);const E=validateTimeout(A.timeout);const C=await _internals.execute(`${mu}/${u}`,{api_key:y,output:"json"},E);const I=JSON.parse(C);p===null||p===void 0?void 0:p(I);return I}async function getHtmlBySearchId(u,A={},p){const y=validateApiKey(A.api_key);const E=validateTimeout(A.timeout);const C=await _internals.execute(`${mu}/${u}`,{api_key:y,output:"html"},E);p===null||p===void 0?void 0:p(C);return C}async function getAccount(u={},A){const p=validateApiKey(u.api_key);const y=validateTimeout(u.timeout);const E=await _internals.execute(hu,{api_key:p},y);const C=JSON.parse(E);A===null||A===void 0?void 0:A(C);return C}async function getLocations(u={},A){const p=validateTimeout(u.timeout);const y=await _internals.execute(pu,u,p);const E=JSON.parse(y);A===null||A===void 0?void 0:A(E);return E}const GoogleSearch=async u=>{const{query:A}=u;if(!A){return{error:"Missing parameter: query must be provided."}}try{const u=await getJson({engine:"google",q:A,api_key:process.env["SERPAPI_API_KEY"]});return{results:u["organic_results"]}}catch(u){return{error:u.message}}};const WriteTodos=async u=>{const{todos:A}=u;if(!A){return{error:"Missing parameter: todos must be provided."}}const p=A.map(((u,A)=>`${A+1}. [${u.status}] ${u.description}`)).join("\n");const y=A.length>0?`Successfully updated the todo list. The current list is now:\n${p}`:"Successfully cleared the todo list.";return{llmContent:y,returnDisplay:{todos:A}}};async function GetWorkingDirectory(){return{cwd:process.cwd()}}const yu={ReadFile:ReadFile,WriteFile:WriteFile,Shell:Shell,ReadFolder:ReadFolder,FindFiles:FindFiles,SearchText:SearchText,Edit:Edit,ReadManyFiles:ReadManyFiles,SaveMemory:SaveMemory,WebFetch:WebFetch,GoogleSearch:GoogleSearch,WriteTodos:WriteTodos,GetWorkingDirectory:GetWorkingDirectory};const Eu=`${B.$.BACKEND_URL}/v1/tasks`;const Cu=`${B.$.BACKEND_URL}/v1/ws/session/start_or_resume/`;class WebSocketClient{ws=null;messageHandler=null;onStatusChange=null;sessionId=null;handshakeSent=false;isConnecting=false;connectionPromise=null;messageQueue=[];isReadyForUserInput=false;status="disconnected";setStatus(u){if(this.status===u)return;this.status=u;if(this.onStatusChange){this.onStatusChange(u)}}async createSession(){try{const u=await fetch(Eu,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:"New interactive session"})});if(!u.ok){throw new Error(`Failed to create session: ${u.status} ${u.statusText}`)}const A=await u.json();return A.id}catch(u){if(process.env["STK_DEBUG_WS"]==="1"){console.error("Failed to create session:",u)}return null}}setupWebSocketConnection(){if(!this.sessionId){return}this.setStatus("connecting");const u=`${Cu}${this.sessionId}`;this.ws=new v.Ay(u);this.ws.on("open",(async()=>{this.setStatus("connected");if(this.handshakeSent){return}let u=null;try{const{loadProjectSpec:A}=await p.e(905).then(p.bind(p,8905));u=await A(process.cwd())}catch(u){console.error("Failed to load project spec (CODEGEN.md):",u)}this.send({type:"handshake",payload:{client_type:"cli",known_tools:Object.keys(yu),custom_tools:[],projectSpec:u?{content:u.content,filePaths:u.filePaths}:null}});this.handshakeSent=true}));this.ws.on("message",(u=>{try{const A=JSON.parse(u.toString());if(A.type==="bootstrap_finished"){this.isReadyForUserInput=true;this.flushMessageQueue()}if(this.messageHandler){this.messageHandler(A)}}catch(u){console.error("Error parsing WebSocket message:",u)}}));this.ws.on("close",(()=>{this.ws=null;this.isConnecting=false;this.connectionPromise=null;this.handshakeSent=false;this.isReadyForUserInput=false;this.setStatus("disconnected")}));this.ws.on("error",(u=>{if(process.env["STK_DEBUG_WS"]==="1"){console.error("WebSocket error:",u)}this.isConnecting=false;this.connectionPromise=null;this.handshakeSent=false;this.isReadyForUserInput=false;this.setStatus("disconnected")}))}flushMessageQueue(){while(this.messageQueue.length>0){const u=this.messageQueue.shift();if(u){this.send(u)}}}ensureConnected(){if(this.ws&&this.ws.readyState===v.Ay.OPEN){return Promise.resolve()}if(this.isConnecting&&this.connectionPromise){return this.connectionPromise}this.isConnecting=true;this.setStatus("connecting");this.connectionPromise=(async()=>{try{if(!this.messageHandler){throw new Error("No message handler set. Cannot (re)connect WebSocket.")}if(!this.sessionId){this.sessionId=await this.createSession();if(!this.sessionId){throw new Error("Could not establish session. WebSocket connection aborted.")}}this.setupWebSocketConnection();await new Promise(((u,A)=>{if(!this.ws){return A(new Error("WebSocket instance not created."))}this.ws.once("open",(()=>{this.isConnecting=false;this.setStatus("connected");u()}));this.ws.once("error",(u=>{this.isConnecting=false;this.ws=null;this.setStatus("disconnected");A(u)}))}))}catch(u){this.isConnecting=false;this.connectionPromise=null;this.setStatus("disconnected");if(process.env["STK_DEBUG_WS"]==="1"){console.error("Connection failed:",u)}throw u}})();return this.connectionPromise}async connect(u,A){this.messageHandler=u;this.onStatusChange=A;this.setStatus("connecting");await this.ensureConnected()}async send(u){if(!this.ws||this.ws.readyState!==v.Ay.OPEN){this.messageQueue.push(u);await this.ensureConnected();return}const A=u.type==="handshake"||u.type==="tool_result";if(this.ws&&this.ws.readyState===v.Ay.OPEN&&(A||this.isReadyForUserInput)){const A=JSON.stringify(u);this.ws.send(A)}else{this.messageQueue.push(u)}}}const Iu=new WebSocketClient;const runShellCommand=(u,A)=>{const p=u.trim();if(!p){throw new Error("Command cannot be empty.")}const y=(0,Xt.spawn)(p,{cwd:A,shell:true,stdio:"pipe",env:{...process.env,COLUMNS:process.stdout?.columns?.toString()??process.env["COLUMNS"],LINES:process.stdout?.rows?.toString()??process.env["LINES"]}});return y};const sanitizePath=u=>{if(!u){return undefined}const A=C().normalize(u);const p=C().resolve(B.$.WORKSPACE_DIR,A);if(!p.startsWith(B.$.WORKSPACE_DIR)){return C().basename(u)}return C().relative(B.$.WORKSPACE_DIR,p)};var bu=p(4953);var wu=p(4536);var vu=p(3646);function isLiveAgentMessageDisabled(){const u=process.env["INK_DISABLE_LIVE_AGENT_MESSAGE"];if(!u)return false;const A=String(u).toLowerCase().trim();return A==="1"||A==="true"||A==="yes"}const Bu=isLiveAgentMessageDisabled();function extractHighlightedBlock(u){if(!u)return undefined;const A=u.trim();if(A.startsWith("`")&&A.endsWith("`")){const u=A.slice(1,-1).trim();if(u.length>0){return{content:u}}}if(A.startsWith("```")&&A.endsWith("```")){const u=A.slice(3,-3);const p=u.indexOf("\n");if(p===-1){const A=u.trim();if(A.length>0){return{content:A}}return undefined}const y=u.slice(0,p).trim();const E=u.slice(p+1).trim();if(E.length===0){return undefined}return{language:y.length>0?y:undefined,content:E}}return undefined}function buildInkViewModel(u){const A=u.messages.filter((u=>u.isFinal||u.role==="tool_execution"||u.role==="agent_thought")).map((u=>({id:u.id,role:u.role,text:u.text,toolName:u.toolName,toolParams:u.toolParams,status:u.status,isBootstrap:u.isBootstrap,highlightedBlock:u.role==="agent"?extractHighlightedBlock(u.text):undefined})));let p;if(!Bu){const A=u.messages.find((u=>(u.role==="agent"||u.role==="agent_thought")&&u.isStreaming));if(A){p={id:A.id,role:A.role,text:A.text,toolName:A.toolName,toolParams:A.toolParams,status:A.status,isBootstrap:A.isBootstrap,highlightedBlock:A.role==="agent"?extractHighlightedBlock(A.text):undefined}}}const y=[...u.shellRuns].reverse().find((u=>u.status==="running"||u.status==="pending"));const E=[...u.diffReviews].reverse().find((u=>u.status==="pending"));let C;if(y){const u=[y.stdout,y.stderr].filter(Boolean).join("\n");const A=u.split("\n");C={id:y.id,command:y.command,status:y.status,stdout:y.stdout,stderr:y.stderr,visibleOutput:u,isVisuallyTruncated:false,totalLines:A.length,visibleLinesCount:A.length}}const I=E?{id:E.id,title:E.title,toolName:E.toolName,toolParams:E.toolParams,oldContent:E.oldContent,newContent:E.newContent,status:E.status}:undefined;return{staticMessages:A,liveAgentMessage:p,activeShellRun:C,activeDiffReview:I,agentStatusLabel:u.agentStatus.label,agentStatusPhase:u.agentStatus.phase}}function useAgentCore(){const[u,A]=(0,I.useReducer)(vu.h,vu.R);const p=(0,I.useMemo)((()=>buildInkViewModel(u)),[u]);return{coreState:u,dispatchCore:A,viewModel:p}}const Su={ReadFile:ReadFile,WriteFile:WriteFile,Shell:Shell,ReadFolder:ReadFolder,FindFiles:FindFiles,SearchText:SearchText,Edit:Edit,ReadManyFiles:ReadManyFiles,SaveMemory:SaveMemory,WebFetch:WebFetch,GoogleSearch:GoogleSearch,WriteTodos:WriteTodos,GetWorkingDirectory:GetWorkingDirectory};const escapeRegExp=u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const useAgent=({autonomous:u=false})=>{const{coreState:A,dispatchCore:p,viewModel:E}=useAgentCore();const[v,S]=(0,I.useState)((()=>u));const D=(0,I.useRef)(v);(0,I.useEffect)((()=>{D.current=v}),[v]);const[k,Q]=(0,I.useState)({isVisible:false,text:"Agent is thinking..."});const[F,R]=(0,I.useState)(null);const _=(0,I.useRef)(null);(0,I.useEffect)((()=>{_.current=F}),[F]);const[P,O]=(0,I.useState)([]);const[U,H]=(0,I.useState)(null);const G=(0,I.useRef)(U);(0,I.useEffect)((()=>{G.current=U}),[U]);const[j,$]=(0,I.useState)(-1);const[q,K]=(0,I.useState)(null);const[J,ee]=(0,I.useState)(null);const[te,ne]=(0,I.useState)("");const[re,se]=(0,I.useState)(false);const[ie,oe]=(0,I.useState)(null);const ae=(0,I.useRef)(ie);(0,I.useEffect)((()=>{ae.current=ie}),[ie]);const[le,ce]=(0,I.useState)(false);const ue=(0,I.useRef)(le);const de=(0,I.useRef)("");const fe=(0,I.useRef)(k);const Ae=(0,I.useRef)(null);const he=(0,I.useRef)(false);(0,I.useEffect)((()=>{he.current=A.isBootstrapping}),[A.isBootstrapping]);const pe=(0,I.useCallback)((u=>{const A=(u||"").trim();if(!A)return false;if(/[;&|]/.test(A))return false;const p=A.split(/\s+/).filter(Boolean);if(p.length<2)return false;if(p[0]!=="mkdir")return false;const y=p.slice(1).filter((u=>!u.startsWith("-")));if(y.length===0)return false;return y.every((u=>u===".codegen"||u.startsWith(".codegen/")))}),[]);const ge=(0,I.useCallback)((u=>{if(v)return true;const A=u.parameters.dir_path;const p=A===".codegen"||A&&A.startsWith(".codegen/");if(p)return true;return pe(u.parameters.command)}),[v,pe]);(0,I.useEffect)((()=>{fe.current=k}),[k]);(0,wu.SB)();const me=(0,I.useCallback)((()=>{const u=de.current.match(/\*\*(.*?)\*\*/g);const A=u?u[u.length-1]?.slice(2,-2):null;Q({isVisible:true,text:A||"Agent is thinking..."})}),[]);(0,I.useEffect)((()=>{ue.current=le}),[le]);const sendInputToShell=u=>{if(!J)return;if(u===""){try{J.kill("SIGINT")}catch(u){console.error("Failed to send SIGINT to shell process:",u)}return}if(J.stdin){J.stdin.write(u)}};const handleShellCompletion=(u,A)=>{try{const y=A||q;if(!y){return}if(u.signal==="SIGINT"){const{tool_name:A,tool_id:E,generation_id:C,parameters:I}=y;const v=I?.command??"(shell)";p({type:"SHELL_RUN_FINISHED",runId:String(y.messageId),exitCode:130,generationId:C});const B=80;const S=(0,w.A)([u.stdout||"",u.stderr||""].filter(Boolean).join("\n"));const D=S.split("\n");const k=D.length>B;const Q=k?D.slice(-B):D;const F=Q.join("\n").trim();let R=F?`Shell: ${v} (cancelled by user via Ctrl+C)\n\n${F}`:`Shell: ${v} (cancelled by user via Ctrl+C)`;if(k){R+=`\n\n[Saída truncada; mostrando últimas ${Q.length} de ${D.length} linhas]`}p({type:"TOOL_RESULT_MESSAGE",text:R,generationId:C});try{const p={...u,stdout:(0,w.A)(u.stdout),stderr:(0,w.A)(u.stderr)};Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:E,generation_id:C,status:"error",result:p,error:"cancelled_by_user"}})}catch(u){console.error("Failed to send shell cancellation tool_result:",u)}me();K(null);ee(null);return}const{messageId:E,tool_name:C,tool_id:I,generation_id:v,parameters:B}=y;p({type:"SHELL_RUN_FINISHED",runId:String(E),exitCode:u.exitCode??1,generationId:v});const S=(u.exitCode??1)===0;const D=S?"✓":"✗";const k=B?.command??"(shell)";const Q=`${D} Shell: ${k} (exitCode=${u.exitCode??1})`;const F=80;const R=(0,w.A)([u.stdout||"",u.stderr||""].filter(Boolean).join("\n"));const _=R.split("\n");const P=_.length>F;const O=P?_.slice(-F):_;const U=O.join("\n").trim();let H=U?`${Q}\n\n${U}`:Q;if(P){H+=`\n\n[Saída truncada; mostrando últimas ${O.length} de ${_.length} linhas]`}p({type:"TOOL_RESULT_MESSAGE",text:H,generationId:v});const G={...u,stdout:(0,w.A)(u.stdout),stderr:(0,w.A)(u.stderr)};Iu.send({type:"tool_result",payload:{tool_name:C,tool_id:I,generation_id:v,status:u.exitCode===0?"success":"error",result:G,error:u.exitCode===0?null:(0,w.A)(u.stderr)||"shell_error"}});me()}catch(u){console.error("Error in handleShellCompletion:",u)}finally{K(null);ee(null)}};const ye=(0,I.useCallback)((()=>{if(!F)return;const{tool_name:u,tool_id:A,generation_id:y,parameters:E}=F;const{command:I,dir_path:w}=E;const v=C().resolve(B.$.WORKSPACE_DIR,w||".");const S=Date.now();p({type:"SHELL_RUN_STARTED",runId:String(S),command:I,generationId:y});try{const C=runShellCommand(I,v);const w=[];const B=[];C.stdout?.on("data",(u=>{w.push(u);p({type:"SHELL_OUTPUT_RECEIVED",runId:String(S),stdoutDelta:u.toString("utf8"),stderrDelta:"",generationId:y})}));C.stderr?.on("data",(u=>{B.push(u);p({type:"SHELL_OUTPUT_RECEIVED",runId:String(S),stdoutDelta:"",stderrDelta:u.toString("utf8"),generationId:y})}));C.on("close",((p,C)=>{const I={stdout:Buffer.concat(w).toString("utf8"),stderr:Buffer.concat(B).toString("utf8"),exitCode:p,signal:C};handleShellCompletion(I,{messageId:S,tool_name:u,tool_id:A,generation_id:y,parameters:E})}));ee(C);K({messageId:S,tool_name:u,tool_id:A,generation_id:y,parameters:E,status:"running",childProcess:C});Q({isVisible:false,text:""})}catch(E){console.error("Failed to start shell command:",E);p({type:"TOOL_RESULT_MESSAGE",text:`✗ Shell: ${I} (error starting: ${E.message??String(E)})`});try{Iu.send({type:"tool_result",payload:{tool_name:u,tool_id:A,generation_id:y,status:"error",result:E.message??String(E)}})}catch(u){console.error("Failed to send shell error tool_result:",u)}}R(null)}),[p,F,me]);(0,I.useEffect)((()=>{if(F&&ge(F)){ye()}}),[F,ge,ye]);const rejectShellCommand=()=>{if(!F)return;const{tool_name:u,tool_id:A,generation_id:y,parameters:E}=F;const C=E.command??"(shell)";try{Iu.send({type:"tool_result",payload:{tool_name:u,tool_id:A,generation_id:y,status:"error",result:null,error:"User rejected command execution."}})}catch(u){console.error("Failed to send shell rejection tool_result:",u)}p({type:"TOOL_RESULT_MESSAGE",text:`· Shell: ${C} (rejected by user)`});R(null);Q({isVisible:false,text:""})};const approveDiff=u=>{const y=E.activeDiffReview?.id;if(!y)return;if(Ae.current){Ae.current(["accepted",u]);Ae.current=null}p({type:"DIFF_REVIEW_RESOLVED",reviewId:String(y),result:"accepted",generationId:A.activeGenerationId})};const rejectDiff=()=>{const u=E.activeDiffReview?.id;if(!u)return;if(Ae.current){Ae.current(["rejected",undefined]);Ae.current=null}p({type:"DIFF_REVIEW_RESOLVED",reviewId:String(u),result:"rejected",generationId:A.activeGenerationId})};const Ee=(0,I.useCallback)((async u=>{const{tool_name:A,parameters:E,tool_id:I,generation_id:v}=u;const S=v==="bootstrap";p({type:"TOOL_EXECUTION_STARTED",toolId:I,toolName:A,toolParams:E,generationId:v});const k={...E};if(k["path"]){k["path"]=sanitizePath(k["path"])}if(k["file_path"]){k["file_path"]=sanitizePath(k["file_path"])}if(k["dir_path"]){k["dir_path"]=sanitizePath(k["dir_path"])}if(A==="ReadFile"&&k["path"]&&!k["file_path"]){k["file_path"]=k["path"]}if((A==="ReadFolder"||A==="FindFiles"||A==="SearchText")&&k["path"]&&!k["dir_path"]){k["dir_path"]=k["path"]}const F=Su[A];if(!F){const u=`Error: Tool '${A}' not found.`;p({type:"TOOL_EXECUTION_ERROR",toolId:I,toolName:A,toolParams:E,error:u,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u}});H(null);me();return}if(A==="WriteFile"||A==="Edit"){const u=Date.now();let w="";try{w=await(0,y.readFile)(C().resolve(B.$.WORKSPACE_DIR,k["file_path"]),"utf-8")}catch(u){if(u.code!=="ENOENT"){throw u}w=""}const S=A==="WriteFile"?k["content"]:w.replace(new RegExp(escapeRegExp(k["old_string"]),"g"),k["new_string"]);try{const y=k["file_path"];const C=y&&y.startsWith(".codegen/");if(!D.current&&!C){const y=new Promise((u=>{Ae.current=u}));p({type:"DIFF_REVIEW_OPENED",reviewId:String(u),toolName:A,toolParams:k,oldContent:w,newContent:S,generationId:v});const[E,C]=await y;if(E==="rejected"){throw new Error("User rejected changes.")}k["content"]=C!==undefined?C:S}else{k["content"]=S}const B=await F(k);p({type:"TOOL_EXECUTION_FINISHED",toolId:I,toolName:A,toolParams:E,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"success",result:B,error:null}});H(null);me()}catch(u){p({type:"TOOL_EXECUTION_ERROR",toolId:I,toolName:A,toolParams:E,error:u.message,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u.message}});me()}}else if(A==="Shell"){const u=k;if(S){const{command:p,dir_path:y}=u;const E=C().resolve(B.$.WORKSPACE_DIR,y||".");try{const u=runShellCommand(p,E);const y=await new Promise(((A,p)=>{const y=[];const E=[];u.stdout?.on("data",(u=>{y.push(u)}));u.stderr?.on("data",(u=>{E.push(u)}));u.on("error",(u=>{p(u)}));u.on("close",(u=>{A({stdout:Buffer.concat(y).toString("utf8"),stderr:Buffer.concat(E).toString("utf8"),exitCode:u})}))}));const C={command:p,stdout:(0,w.A)(y.stdout)||"(empty)",stderr:(0,w.A)(y.stderr)||"(empty)",error:y.exitCode===0?"(none)":(0,w.A)(y.stderr),exitCode:y.exitCode??0};Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:y.exitCode===0?"success":"error",result:C,error:y.exitCode===0?null:(0,w.A)(y.stderr)||"shell_error"}});H(null);Q({isVisible:false,text:""})}catch(u){Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u.message??String(u)}});me()}return}R({tool_name:A,tool_id:I,generation_id:v,parameters:u});Q({isVisible:false,text:""});return}else{try{const u=await F(k);p({type:"TOOL_EXECUTION_FINISHED",toolId:I,toolName:A,toolParams:E,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"success",result:u,error:null}});H(null);me()}catch(u){p({type:"TOOL_EXECUTION_ERROR",toolId:I,toolName:A,toolParams:E,error:u.message,generationId:v});Iu.send({type:"tool_result",payload:{tool_name:A,tool_id:I,generation_id:v,status:"error",result:null,error:u.message}});me()}}}),[]);const Ce=(0,I.useRef)(false);(0,I.useEffect)((()=>{Ce.current=A.bootstrapFinished}),[A.bootstrapFinished]);(0,I.useEffect)((()=>{let u=false;const handleMessage=async A=>{if(ue.current){return}const y=A.payload?.generation_id;const E=y==="bootstrap";if(E&&!he.current){p({type:"BOOTSTRAP_STARTED"})}if(A.type==="bootstrap_finished"&&he.current){p({type:"BOOTSTRAP_FINISHED"});u=true}if(A.type==="run_tool"&&A.payload.tool_name==="Shell"){const u=A.payload;if(_.current?.tool_id===u.tool_id){return}}if(process.env["STK_DEBUG_AGENT_STREAM"]==="1"){console.log("[agent-stream]",{type:A.type,payload:A.payload,generation_id:A.payload?.generation_id})}if(A.payload?.generation_id){oe(A.payload.generation_id);ae.current=A.payload.generation_id}if(A.type==="agent_error"){const u=A.payload?.message||"An error occurred while communicating with the agent.";const E=A.payload?.details?` ${A.payload.details}`:"";p({type:"ERROR_OCCURRED",message:`${u}${E}`,generationId:y});Q({isVisible:false,text:""});return}if(A.type==="agent_message"){const u=A.payload?.content||"";Q({isVisible:false,text:""});p({type:"AGENT_DELTA_RECEIVED",delta:u,generationId:y});p({type:"AGENT_STREAM_FINISHED",generationId:y});return}if(A.type==="agent_message_delta"){const u=A.payload.content||"";Q({isVisible:false,text:""});p({type:"AGENT_DELTA_RECEIVED",delta:u,generationId:y})}else if(A.type==="agent_thought"){const u=A.payload.content||"";de.current+=u;const p=de.current.match(/\*\*(.*?)\*\*/g);const y=p?p[p.length-1]:null;if(y){const u=y.slice(2,-2);if(fe.current.text!==u){Q({isVisible:true,text:u})}}else if(!k.isVisible){Q({isVisible:true,text:"Agent is thinking..."})}}else if(A.type==="agent_finished"){p({type:"AGENT_STREAM_FINISHED",generationId:y});Q({isVisible:false,text:""});H(null);de.current=""}else if(A.type==="run_tool"){const{tool_id:u,tool_name:p}=A.payload;if(G.current===u){return}H(u);G.current=u;if(!E){Q({isVisible:true,text:`Preparing to execute: ${p}`})}Promise.resolve().then((()=>Ee(A.payload)))}else if(A.type==="agent_generation_cancelled"){const{generation_id:u}=A.payload;if(ae.current===u){oe(null);ae.current=null;ce(false);Q({isVisible:false,text:""});p({type:"TOOL_RESULT_MESSAGE",text:"· Agent generation cancelled by backend.",generationId:y})}}};Promise.resolve(Iu.connect(handleMessage,(u=>{p({type:"CONNECTION_STATUS_CHANGED",status:u});if(u==="connecting"&&Ce.current){Q({isVisible:true,text:"Reconectando..."})}else if(u==="connected"){Q({isVisible:false,text:""})}}))).catch((()=>{p({type:"CONNECTION_STATUS_CHANGED",status:"disconnected"})}))}),[Ee,p]);const Ie=(0,I.useCallback)((u=>{p({type:"TOOL_RESULT_MESSAGE",text:`· Modo autônomo: ${u?"ATIVADO":"DESATIVADO"} ·`,generationId:A.activeGenerationId})}),[p]);const be=(0,I.useCallback)((u=>{S(u);Ie(u)}),[Ie]);const we=(0,I.useCallback)((()=>{S((u=>{const A=!u;Ie(A);return A}))}),[Ie]);const submitUserInput=async(u,y)=>{if(process.env["STK_DEBUG_INPUT"]==="1"&&y){console.error("[STK_DEBUG_SUBMIT]",{text:u,imageCount:y.images?.length??0,extra:y})}const E=u.trim();if(E.startsWith("/")){const[u,A]=E.slice(1).split(/\s+/,2);const p=(u||"").toLowerCase();const y=(A||"").toLowerCase();const C=p==="autonomous"||p==="auto"||p==="a";if(C){if(y==="on"||y==="true"||y==="1")be(true);else if(y==="off"||y==="false"||y==="0")be(false);else we();ne("");return}}if(q?.status==="finished"){K(null)}p({type:"USER_SENT_MESSAGE",text:u});if(y){const u=y.images?.length??0;const E=u>0?`· ${u} imagem(s) de clipboard anexada(s) ·`:"· Nenhuma imagem encontrada no clipboard ·";p({type:"TOOL_RESULT_MESSAGE",text:E,generationId:A.activeGenerationId})}Q({isVisible:true,text:"Agent is thinking..."});oe(null);ce(false);de.current="";try{if(E.startsWith("/")){const A=E.slice(1).trim();if(A.length>0){await Iu.send({type:"magic_command",payload:{name:A}})}else{await Iu.send({type:"user_message",payload:{prompt:u}})}}else{await Iu.send({type:"user_message",payload:{prompt:u,images:y?.images}})}}catch{Q({isVisible:true,text:"Não foi possível conectar ao servidor. Verifique o backend e tente novamente."});p({type:"CONNECTION_STATUS_CHANGED",status:"disconnected"});return}O((A=>{const p=[...A,u];$(p.length);return p}));ne("")};const ve=(0,I.useCallback)((()=>{const u=Math.max(0,j-1);$(u);return P[u]}),[P,j]);const Be=(0,I.useCallback)((()=>{const u=Math.min(P.length,j+1);$(u);return P[u]}),[P,j]);const Se=(0,I.useCallback)((async(u,A)=>{try{const p=Su["FindFiles"];if(p){const y=await p({pattern:u,...A});return y.files||[]}return[]}catch(u){console.error("Error searching files:",u);return[]}}),[]);const resetHistory=()=>{$(P.length)};const cancelCurrentInteraction=()=>{Q({isVisible:false,text:""});ce(true);const u="· Cancellation request sent.";const y=ae.current??A.activeGenerationId;p({type:"TOOL_RESULT_MESSAGE",text:u,generationId:y});if(ae.current){try{Iu.send({type:"client_cancel_generation",payload:{generation_id:ae.current,reason:"user_pressed_escape"}});oe(null);ae.current=null}catch(u){console.error("Failed to send cancel message to backend:",u)}}else{try{Iu.send({type:"client_cancel_last",payload:{}})}catch(u){console.error("Failed to send cancel_last message to backend:",u)}}};return{agentStatus:k,isAutonomous:v,toggleAutonomous:we,pendingShellCommand:F,approveShellCommand:ye,rejectShellCommand:rejectShellCommand,approveDiff:approveDiff,rejectDiff:rejectDiff,submitUserInput:submitUserInput,navigateHistoryUp:ve,navigateHistoryDown:Be,searchFiles:Se,activeShellCommand:q,handleShellCompletion:handleShellCompletion,childProcess:J,sendInputToShell:sendInputToShell,inputText:te,setInputText:ne,isShellActive:re,setIsShellActive:se,resetHistory:resetHistory,cancelCurrentInteraction:cancelCurrentInteraction,activeGenerationId:ie,coreState:A,coreViewModel:E,hasCodegenSpec:(0,bu.q)().hasCodegenSpec}}},3345:(u,A,p)=>{p.d(A,{P:()=>useMagicCommands});var y=p(1943);var E=p.n(y);var C=p(6928);var I=p.n(C);var w=p(3102);var v=p.n(w);var B=p(6878);const S=["bootstrap-codegen"];const D="codegen-commands";async function getUserCommands(){try{const u=I().resolve(B.$.WORKSPACE_DIR,D);const A=await(0,y.readdir)(u,{withFileTypes:true});return A.filter((u=>u.isDirectory())).map((u=>u.name))}catch(u){return[]}}const useMagicCommands=()=>{const[u,A]=(0,w.useState)([]);(0,w.useEffect)((()=>{const fetchCommands=async()=>{const u=await getUserCommands();A([...S,...u])};fetchCommands()}),[]);return u}},4536:(u,A,p)=>{p.d(A,{SB:()=>useTerminalLayout});var y=p(3102);var E=p.n(y);const C=.5;const I=.5;const w=.4;const v=4;const useTerminalLayout=()=>{const u=process.stdout&&process.stdout.rows||24;return(0,y.useMemo)((()=>{const A=(()=>{const A=Math.floor(u*C)-v;return Math.min(Math.max(A,8),120)})();const p=(()=>{const A=Math.floor(u*w)-v;return Math.min(Math.max(A,5),40)})();const y=(()=>{const A=Math.floor(u*I)-v;return Math.min(Math.max(A,10),120)})();return{rows:u,maxAgentStreamingLines:A,shellViewHeight:p,diffReviewHeight:y,layoutConstants:{AGENT_STREAM_RATIO:C,DIFF_REVIEW_RATIO:I,SHELL_OUTPUT_RATIO:w,FOOTER_RESERVED_LINES:v}}}),[u])}},1196:(u,A,p)=>{p.d(A,{F:()=>readClipboardImageAsBase64});var y=p(5317);var E=p.n(y);var C=p(9023);var I=p.n(C);var w=p(9896);var v=p.n(w);var B=p(6928);var S=p.n(B);const D=(0,C.promisify)(y.execFile);async function getClipboardImageDir(u){const A=u||process.cwd();const p=S().join(A,".stk-clipboard");await v().promises.mkdir(p,{recursive:true});return p}async function readClipboardImageAsBase64(u){if(process.env["STK_CODEGEN_DISABLE_CLIPBOARD_IMAGE"]==="1"){return null}if(process.platform==="darwin"){return readMacClipboardImageFromClipboard(u)}return null}async function readMacClipboardImageFromClipboard(u){try{const{stdout:A}=await D("bash",["-lc",'command -v pngpaste || echo ""']);const p=A.trim();if(p){const A=await getClipboardImageDir(u);const y=Date.now();const E=S().join(A,`clipboard-${y}.png`);try{await D(p,[E]);const u=await v().promises.readFile(E);try{await v().promises.unlink(E)}catch{}return{base64:u.toString("base64"),mimeType:"image/png"}}catch{}}}catch{}return readMacClipboardImageViaAppleScriptToFile(u)}async function readMacClipboardImageViaAppleScriptToFile(u){const A=await getClipboardImageDir(u);const p=Date.now();const y=S().join(A,`clipboard-${p}`);const E=`\n on writeImageToGivenPath(theImage, mimeType, basePath)\n if mimeType is "image/png" then\n set tmpPath to basePath & ".png"\n else if mimeType is "image/tiff" then\n set tmpPath to basePath & ".tiff"\n else if mimeType is "image/jpeg" then\n set tmpPath to basePath & ".jpg"\n end if\n\n set outFile to POSIX file tmpPath\n set fileRef to open for access outFile with write permission\n set eof fileRef to 0\n write theImage to fileRef\n close access fileRef\n\n return mimeType & ":" & tmpPath\n end writeImageToGivenPath\n\n try\n set basePath to "${y}"\n try\n set theImage to the clipboard as «class PNGf»\n return writeImageToGivenPath(theImage, "image/png", basePath)\n on error\n try\n set theImage to the clipboard as TIFF\n return writeImageToGivenPath(theImage, "image/tiff", basePath)\n on error\n try\n set theImage to the clipboard as JPEG picture\n return writeImageToGivenPath(theImage, "image/jpeg", basePath)\n on error\n return "NO_IMAGE"\n end try\n end try\n end try\n end try\n `;try{const{stdout:u}=await D("osascript",["-e",E]);const A=u.trim();if(!A||A==="NO_IMAGE"){return null}const p=A.indexOf(":");if(p===-1){return null}const y=A.slice(0,p);const C=A.slice(p+1);if(!y||!C){return null}const I=await v().promises.readFile(C);try{await v().promises.unlink(C)}catch{}return{base64:I.toString("base64"),mimeType:y}}catch{return null}}async function cleanupOldClipboardImages(u,A=60*60*1e3){try{const p=await getClipboardImageDir(u);const y=await fs.promises.readdir(p);const E=Date.now()-A;for(const u of y){if(!u.startsWith("clipboard-"))continue;const A=path.join(p,u);const y=await fs.promises.stat(A);if(y.mtimeMs<E){await fs.promises.unlink(A)}}}catch{}}},786:(u,A,p)=>{p.d(A,{x:()=>checkCliVersion});var y=p(5317);var E=p(6878);const httpClientGet=async u=>{const A=await fetch(u);const p=await A.json();return{data:p}};var C=p(3646);const I=`${E.$.BACKEND_URL}/v1/cli/version`;const w="stk-codegen";function isVersionLess(u,A){const p=u.split(".").map(Number);const y=A.split(".").map(Number);const E=Math.max(p.length,y.length);for(let u=0;u<E;u++){const A=p[u]??0;const E=y[u]??0;if(A!==E)return A<E}return false}async function checkCliVersionWithDeps({httpGet:u,execSync:A,exit:p,log:y,error:C,env:v}){const B=v["CLI_SKIP_VERSION_CHECK"];if(B&&["1","true"].includes(String(B).toLowerCase())){return}try{const v=await u(I);const B=v.data.version;if(isVersionLess(E.$.CURRENT_VERSION,B)){C(`Your CLI version is ${E.$.CURRENT_VERSION}, but the minimal required version is ${B}.`);y("Updating CLI to the latest version...");try{A(`npm install -g ${w}@latest`,{stdio:"inherit"});y("Update successful! Please restart the CLI manually to use the new version.");p(0)}catch{C("An error occurred during the automatic update process. Please update manually.");p(1)}}}catch{C("Could not verify CLI version or perform automatic update.")}}async function checkCliVersion(){return checkCliVersionWithDeps({httpGet:httpClientGet,execSync:y.execSync,exit:u=>process.exit(u),log:console.log,error:console.error,env:process.env})}},5183:(u,A,p)=>{p.d(A,{y:()=>parseInlineCodeSegments});function appendTextSegment(u,A){if(!A)return;const p=u[u.length-1];if(p&&p.type==="text"){p.content+=A}else{u.push({type:"text",content:A})}}function parseInlineCodeSegments(u){if(u===undefined||u===null){return[]}const A=[];let p="";let y=false;const flushBuffer=()=>{if(!p)return;if(y){A.push({type:"code",content:p})}else{appendTextSegment(A,p)}p=""};for(let E=0;E<u.length;E++){const C=u[E];if(C==="`"){if(y){if(p===""){appendTextSegment(A,"``")}else{A.push({type:"code",content:p})}p="";y=false}else{flushBuffer();y=true}}else{p+=C}}if(p){if(y){A.push({type:"code",content:p})}else{appendTextSegment(A,p)}}if(y){const u=A.pop();const p="`"+(u?.content??"");appendTextSegment(A,p)}if(A.length===0){return[{type:"text",content:u}]}return A}},4378:(u,A,p)=>{p.d(A,{M:()=>buildFriendlyLabel});const buildFriendlyLabel=(u,A)=>{const p=A?.["file_path"];const y=A?.["dir_path"]||".";const E=A?.["command"];const C=A?.["pattern"];switch(u){case"WriteFile":return p?`Criar/atualizar arquivo ${p}`:"Criar/atualizar arquivo";case"Edit":return p?`Editar arquivo ${p}`:"Editar arquivo";case"ReadFile":return p?`Ler arquivo ${p}`:"Ler arquivo";case"ReadFolder":return`Listar pasta ${y}`;case"FindFiles":return C?`Procurar arquivos que combinem ${C} em ${y}`:`Procurar arquivos em ${y}`;case"SearchText":return C?`Buscar "${C}" em ${y}`:`Buscar texto em ${y}`;case"Shell":return E?`Executar comando ${E}`:"Executar comando de shell";case"GoogleSearch":return A?.["query"]?`Pesquisar no Google: ${A["query"]}`:"Pesquisar no Google";default:return u}}},1096:(u,A,p)=>{p.d(A,{O:()=>isDelete,g:()=>isBackspace});const isBackspace=u=>u.delete===true||u.backspace===true;const isDelete=()=>false},4760:(u,A,p)=>{p.d(A,{a:()=>TextBuffer});class TextBuffer{text=[];cursor=0;constructor(u=""){this.text=u.split("");this.cursor=u.length}get value(){return this.text.join("")}get cursorPosition(){return this.cursor}insert(u){this.text.splice(this.cursor,0,u);this.cursor++}insertText(u){if(!u)return;const A=u.split("");this.text.splice(this.cursor,0,...A);this.cursor+=A.length}backspace(){if(this.cursor>0){this.text.splice(this.cursor-1,1);this.cursor--}}delete(){if(this.cursor<this.text.length){this.text.splice(this.cursor,1)}}moveCursorLeft(){if(this.cursor>0){this.cursor--}}moveCursorRight(){if(this.cursor<this.text.length){this.cursor++}}moveCursorToStart(){this.cursor=0}moveCursorToEnd(){this.cursor=this.text.length}_getLines(){return this.text.join("").split("\n")}_offsetToRowCol(u){const A=this._getLines();if(A.length===0){return{row:0,col:0}}let p=0;for(let y=0;y<A.length;y++){const E=A[y];const C=E?E.length+1:1;if(u<p+C){return{row:y,col:u-p}}p+=C}const y=A[A.length-1];return{row:A.length-1,col:y?y.length:0}}_rowColToOffset(u,A){const p=this._getLines();let y=0;for(let A=0;A<u;A++){const u=p[A];y+=(u?u.length:0)+1}return y+A}getLineCount(){return this._getLines().length}getCursorRow(){return this._offsetToRowCol(this.cursor).row}moveCursorUp(){const{row:u,col:A}=this._offsetToRowCol(this.cursor);if(u>0){const p=this._getLines();const y=p[u-1];const E=y?y.length:0;const C=Math.min(A,E);this.cursor=this._rowColToOffset(u-1,C)}}moveCursorDown(){const u=this._getLines();const{row:A,col:p}=this._offsetToRowCol(this.cursor);if(A<u.length-1){const y=u[A+1];const E=y?y.length:0;const C=Math.min(p,E);this.cursor=this._rowColToOffset(A+1,C)}}moveCursorWordLeft(){let u=this.cursor;while(u>0&&this.text[u-1]===" ")u--;while(u>0&&this.text[u-1]!==" ")u--;this.cursor=u}moveCursorWordRight(){let u=this.cursor;while(u<this.text.length&&this.text[u]!==" ")u++;while(u<this.text.length&&this.text[u]===" ")u++;this.cursor=u}clone(){const u=new TextBuffer(this.value);u.cursor=this.cursor;return u}}},8340:module=>{module.exports=eval("require")("bufferutil")},2461:module=>{module.exports=eval("require")("utf-8-validate")},2613:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert")},181:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer")},5317:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process")},9140:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("constants")},6982:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto")},4434:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("events")},9896:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs")},1943:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs/promises")},8611:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("http")},5675:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2")},5692:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("https")},3339:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("module")},9278:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("net")},4573:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:buffer")},8474:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events")},3024:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs")},1455:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises")},8161:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os")},6760:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path")},1708:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:process")},7075:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream")},7066:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tty")},3136:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url")},857:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("os")},6928:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("path")},2203:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream")},4756:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls")},2018:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty")},7016:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("url")},9023:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("util")},3106:u=>{u.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib")},9771:(u,A,p)=>{Object.defineProperty(A,"__esModule",{value:true});var y=p(1019);var E=p(2859);var C=p(6472);function isColorSupported(){return typeof process==="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?false:y.isColorSupported}const compose=(u,A)=>p=>u(A(p));function buildDefs(u){return{keyword:u.cyan,capitalized:u.yellow,jsxIdentifier:u.yellow,punctuator:u.yellow,number:u.magenta,string:u.green,regex:u.magenta,comment:u.gray,invalid:compose(compose(u.white,u.bgRed),u.bold),gutter:u.gray,marker:compose(u.red,u.bold),message:compose(u.red,u.bold),reset:u.reset}}const I=buildDefs(y.createColors(true));const w=buildDefs(y.createColors(false));function getDefs(u){return u?I:w}const v=new Set(["as","async","from","get","of","set"]);const B=/\r\n|[\n\r\u2028\u2029]/;const S=/^[()[\]{}]$/;let D;{const u=/^[a-z][\w-]*$/i;const getTokenType=function(A,p,y){if(A.type==="name"){if(C.isKeyword(A.value)||C.isStrictReservedWord(A.value,true)||v.has(A.value)){return"keyword"}if(u.test(A.value)&&(y[p-1]==="<"||y.slice(p-2,p)==="</")){return"jsxIdentifier"}if(A.value[0]!==A.value[0].toLowerCase()){return"capitalized"}}if(A.type==="punctuator"&&S.test(A.value)){return"bracket"}if(A.type==="invalid"&&(A.value==="@"||A.value==="#")){return"punctuator"}return A.type};D=function*(u){let A;while(A=E.default.exec(u)){const p=E.matchToToken(A);yield{type:getTokenType(p,A.index,u),value:p.value}}}}function highlight(u){if(u==="")return"";const A=getDefs(true);let p="";for(const{type:y,value:E}of D(u)){if(y in A){p+=E.split(B).map((u=>A[y](u))).join("\n")}else{p+=E}}return p}let k=false;const Q=/\r\n|[\n\r\u2028\u2029]/;function getMarkerLines(u,A,p){const y=Object.assign({column:0,line:-1},u.start);const E=Object.assign({},y,u.end);const{linesAbove:C=2,linesBelow:I=3}=p||{};const w=y.line;const v=y.column;const B=E.line;const S=E.column;let D=Math.max(w-(C+1),0);let k=Math.min(A.length,B+I);if(w===-1){D=0}if(B===-1){k=A.length}const Q=B-w;const F={};if(Q){for(let u=0;u<=Q;u++){const p=u+w;if(!v){F[p]=true}else if(u===0){const u=A[p-1].length;F[p]=[v,u-v+1]}else if(u===Q){F[p]=[0,S]}else{const y=A[p-u].length;F[p]=[0,y]}}}else{if(v===S){if(v){F[w]=[v,0]}else{F[w]=true}}else{F[w]=[v,S-v]}}return{start:D,end:k,markerLines:F}}function codeFrameColumns(u,A,p={}){const y=p.forceColor||isColorSupported()&&p.highlightCode;const E=getDefs(y);const C=u.split(Q);const{start:I,end:w,markerLines:v}=getMarkerLines(A,C,p);const B=A.start&&typeof A.start.column==="number";const S=String(w).length;const D=y?highlight(u):u;let k=D.split(Q,w).slice(I,w).map(((u,A)=>{const y=I+1+A;const C=` ${y}`.slice(-S);const w=` ${C} |`;const B=v[y];const D=!v[y+1];if(B){let A="";if(Array.isArray(B)){const y=u.slice(0,Math.max(B[0]-1,0)).replace(/[^\t]/g," ");const C=B[1]||1;A=["\n ",E.gutter(w.replace(/\d/g," "))," ",y,E.marker("^").repeat(C)].join("");if(D&&p.message){A+=" "+E.message(p.message)}}return[E.marker(">"),E.gutter(w),u.length>0?` ${u}`:"",A].join("")}else{return` ${E.gutter(w)}${u.length>0?` ${u}`:""}`}})).join("\n");if(p.message&&!B){k=`${" ".repeat(S+1)}${p.message}\n${k}`}if(y){return E.reset(k)}else{return k}}function index(u,A,p,y={}){if(!k){k=true;const u="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning){process.emitWarning(u,"DeprecationWarning")}else{const A=new Error(u);A.name="DeprecationWarning";console.warn(new Error(u))}}p=Math.max(p,0);const E={start:{column:p,line:A}};return codeFrameColumns(u,E,y)}A.codeFrameColumns=codeFrameColumns;A["default"]=index;A.highlight=highlight},7713:(u,A)=>{Object.defineProperty(A,"__esModule",{value:true});A.isIdentifierChar=isIdentifierChar;A.isIdentifierName=isIdentifierName;A.isIdentifierStart=isIdentifierStart;let p="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";let y="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const E=new RegExp("["+p+"]");const C=new RegExp("["+p+y+"]");p=y=null;const I=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489];const w=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(u,A){let p=65536;for(let y=0,E=A.length;y<E;y+=2){p+=A[y];if(p>u)return false;p+=A[y+1];if(p>=u)return true}return false}function isIdentifierStart(u){if(u<65)return u===36;if(u<=90)return true;if(u<97)return u===95;if(u<=122)return true;if(u<=65535){return u>=170&&E.test(String.fromCharCode(u))}return isInAstralSet(u,I)}function isIdentifierChar(u){if(u<48)return u===36;if(u<58)return true;if(u<65)return false;if(u<=90)return true;if(u<97)return u===95;if(u<=122)return true;if(u<=65535){return u>=170&&C.test(String.fromCharCode(u))}return isInAstralSet(u,I)||isInAstralSet(u,w)}function isIdentifierName(u){let A=true;for(let p=0;p<u.length;p++){let y=u.charCodeAt(p);if((y&64512)===55296&&p+1<u.length){const A=u.charCodeAt(++p);if((A&64512)===56320){y=65536+((y&1023)<<10)+(A&1023)}}if(A){A=false;if(!isIdentifierStart(y)){return false}}else if(!isIdentifierChar(y)){return false}}return!A}},6472:(u,A,p)=>{Object.defineProperty(A,"__esModule",{value:true});Object.defineProperty(A,"isIdentifierChar",{enumerable:true,get:function(){return y.isIdentifierChar}});Object.defineProperty(A,"isIdentifierName",{enumerable:true,get:function(){return y.isIdentifierName}});Object.defineProperty(A,"isIdentifierStart",{enumerable:true,get:function(){return y.isIdentifierStart}});Object.defineProperty(A,"isKeyword",{enumerable:true,get:function(){return E.isKeyword}});Object.defineProperty(A,"isReservedWord",{enumerable:true,get:function(){return E.isReservedWord}});Object.defineProperty(A,"isStrictBindOnlyReservedWord",{enumerable:true,get:function(){return E.isStrictBindOnlyReservedWord}});Object.defineProperty(A,"isStrictBindReservedWord",{enumerable:true,get:function(){return E.isStrictBindReservedWord}});Object.defineProperty(A,"isStrictReservedWord",{enumerable:true,get:function(){return E.isStrictReservedWord}});var y=p(7713);var E=p(8027)},8027:(u,A)=>{Object.defineProperty(A,"__esModule",{value:true});A.isKeyword=isKeyword;A.isReservedWord=isReservedWord;A.isStrictBindOnlyReservedWord=isStrictBindOnlyReservedWord;A.isStrictBindReservedWord=isStrictBindReservedWord;A.isStrictReservedWord=isStrictReservedWord;const p={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};const y=new Set(p.keyword);const E=new Set(p.strict);const C=new Set(p.strictBind);function isReservedWord(u,A){return A&&u==="await"||u==="enum"}function isStrictReservedWord(u,A){return isReservedWord(u,A)||E.has(u)}function isStrictBindOnlyReservedWord(u){return C.has(u)}function isStrictBindReservedWord(u,A){return isStrictReservedWord(u,A)||isStrictBindOnlyReservedWord(u)}function isKeyword(u){return y.has(u)}},5739:u=>{const A=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const p=typeof AbortController==="function";const y=p?AbortController:class AbortController{constructor(){this.signal=new I}abort(u=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||u;this.signal.aborted=true;this.signal.dispatchEvent({type:"abort",target:this.signal})}};const E=typeof AbortSignal==="function";const C=typeof y.AbortSignal==="function";const I=E?AbortSignal:C?y.AbortController:class AbortSignal{constructor(){this.reason=undefined;this.aborted=false;this._listeners=[]}dispatchEvent(u){if(u.type==="abort"){this.aborted=true;this.onabort(u);this._listeners.forEach((A=>A(u)),this)}}onabort(){}addEventListener(u,A){if(u==="abort"){this._listeners.push(A)}}removeEventListener(u,A){if(u==="abort"){this._listeners=this._listeners.filter((u=>u!==A))}}};const w=new Set;const deprecatedOption=(u,A)=>{const p=`LRU_CACHE_OPTION_${u}`;if(shouldWarn(p)){warn(p,`${u} option`,`options.${A}`,LRUCache)}};const deprecatedMethod=(u,A)=>{const p=`LRU_CACHE_METHOD_${u}`;if(shouldWarn(p)){const{prototype:y}=LRUCache;const{get:E}=Object.getOwnPropertyDescriptor(y,u);warn(p,`${u} method`,`cache.${A}()`,E)}};const deprecatedProperty=(u,A)=>{const p=`LRU_CACHE_PROPERTY_${u}`;if(shouldWarn(p)){const{prototype:y}=LRUCache;const{get:E}=Object.getOwnPropertyDescriptor(y,u);warn(p,`${u} property`,`cache.${A}`,E)}};const emitWarning=(...u)=>{typeof process==="object"&&process&&typeof process.emitWarning==="function"?process.emitWarning(...u):console.error(...u)};const shouldWarn=u=>!w.has(u);const warn=(u,A,p,y)=>{w.add(u);const E=`The ${A} is deprecated. Please use ${p} instead.`;emitWarning(E,"DeprecationWarning",u,y)};const isPosInt=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u);const getUintArray=u=>!isPosInt(u)?null:u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(u){super(u);this.fill(0)}}class Stack{constructor(u){if(u===0){return[]}const A=getUintArray(u);this.heap=new A(u);this.length=0}push(u){this.heap[this.length++]=u}pop(){return this.heap[--this.length]}}class LRUCache{constructor(u={}){const{max:A=0,ttl:p,ttlResolution:y=1,ttlAutopurge:E,updateAgeOnGet:C,updateAgeOnHas:I,allowStale:v,dispose:B,disposeAfter:S,noDisposeOnSet:D,noUpdateTTL:k,maxSize:Q=0,maxEntrySize:F=0,sizeCalculation:R,fetchMethod:_,fetchContext:P,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:U,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:G,ignoreFetchAbort:j}=u;const{length:$,maxAge:q,stale:K}=u instanceof LRUCache?{}:u;if(A!==0&&!isPosInt(A)){throw new TypeError("max option must be a nonnegative integer")}const J=A?getUintArray(A):Array;if(!J){throw new Error("invalid max value: "+A)}this.max=A;this.maxSize=Q;this.maxEntrySize=F||this.maxSize;this.sizeCalculation=R||$;if(this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}this.fetchMethod=_||null;if(this.fetchMethod&&typeof this.fetchMethod!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.fetchContext=P;if(!this.fetchMethod&&P!==undefined){throw new TypeError("cannot set fetchContext without fetchMethod")}this.keyMap=new Map;this.keyList=new Array(A).fill(null);this.valList=new Array(A).fill(null);this.next=new J(A);this.prev=new J(A);this.head=0;this.tail=0;this.free=new Stack(A);this.initialFill=1;this.size=0;if(typeof B==="function"){this.dispose=B}if(typeof S==="function"){this.disposeAfter=S;this.disposed=[]}else{this.disposeAfter=null;this.disposed=null}this.noDisposeOnSet=!!D;this.noUpdateTTL=!!k;this.noDeleteOnFetchRejection=!!O;this.allowStaleOnFetchRejection=!!H;this.allowStaleOnFetchAbort=!!G;this.ignoreFetchAbort=!!j;if(this.maxEntrySize!==0){if(this.maxSize!==0){if(!isPosInt(this.maxSize)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.initializeSizeTracking()}this.allowStale=!!v||!!K;this.noDeleteOnStaleGet=!!U;this.updateAgeOnGet=!!C;this.updateAgeOnHas=!!I;this.ttlResolution=isPosInt(y)||y===0?y:1;this.ttlAutopurge=!!E;this.ttl=p||q||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const u="LRU_CACHE_UNBOUNDED";if(shouldWarn(u)){w.add(u);const A="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(A,"UnboundedCacheWarning",u,LRUCache)}}if(K){deprecatedOption("stale","allowStale")}if(q){deprecatedOption("maxAge","ttl")}if($){deprecatedOption("length","sizeCalculation")}}getRemainingTTL(u){return this.has(u,{updateAgeOnHas:false})?Infinity:0}initializeTTLTracking(){this.ttls=new ZeroArray(this.max);this.starts=new ZeroArray(this.max);this.setItemTTL=(u,p,y=A.now())=>{this.starts[u]=p!==0?y:0;this.ttls[u]=p;if(p!==0&&this.ttlAutopurge){const A=setTimeout((()=>{if(this.isStale(u)){this.delete(this.keyList[u])}}),p+1);if(A.unref){A.unref()}}};this.updateItemAge=u=>{this.starts[u]=this.ttls[u]!==0?A.now():0};this.statusTTL=(A,p)=>{if(A){A.ttl=this.ttls[p];A.start=this.starts[p];A.now=u||getNow();A.remainingTTL=A.now+A.ttl-A.start}};let u=0;const getNow=()=>{const p=A.now();if(this.ttlResolution>0){u=p;const A=setTimeout((()=>u=0),this.ttlResolution);if(A.unref){A.unref()}}return p};this.getRemainingTTL=A=>{const p=this.keyMap.get(A);if(p===undefined){return 0}return this.ttls[p]===0||this.starts[p]===0?Infinity:this.starts[p]+this.ttls[p]-(u||getNow())};this.isStale=A=>this.ttls[A]!==0&&this.starts[A]!==0&&(u||getNow())-this.starts[A]>this.ttls[A]}updateItemAge(u){}statusTTL(u,A){}setItemTTL(u,A,p){}isStale(u){return false}initializeSizeTracking(){this.calculatedSize=0;this.sizes=new ZeroArray(this.max);this.removeItemSize=u=>{this.calculatedSize-=this.sizes[u];this.sizes[u]=0};this.requireSize=(u,A,p,y)=>{if(this.isBackgroundFetch(A)){return 0}if(!isPosInt(p)){if(y){if(typeof y!=="function"){throw new TypeError("sizeCalculation must be a function")}p=y(A,u);if(!isPosInt(p)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation or size "+"must be set.")}}return p};this.addItemSize=(u,A,p)=>{this.sizes[u]=A;if(this.maxSize){const A=this.maxSize-this.sizes[u];while(this.calculatedSize>A){this.evict(true)}}this.calculatedSize+=this.sizes[u];if(p){p.entrySize=A;p.totalCalculatedSize=this.calculatedSize}}}removeItemSize(u){}addItemSize(u,A){}requireSize(u,A,p,y){if(p||y){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}}*indexes({allowStale:u=this.allowStale}={}){if(this.size){for(let A=this.tail;true;){if(!this.isValidIndex(A)){break}if(u||!this.isStale(A)){yield A}if(A===this.head){break}else{A=this.prev[A]}}}}*rindexes({allowStale:u=this.allowStale}={}){if(this.size){for(let A=this.head;true;){if(!this.isValidIndex(A)){break}if(u||!this.isStale(A)){yield A}if(A===this.tail){break}else{A=this.next[A]}}}}isValidIndex(u){return u!==undefined&&this.keyMap.get(this.keyList[u])===u}*entries(){for(const u of this.indexes()){if(this.valList[u]!==undefined&&this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield[this.keyList[u],this.valList[u]]}}}*rentries(){for(const u of this.rindexes()){if(this.valList[u]!==undefined&&this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield[this.keyList[u],this.valList[u]]}}}*keys(){for(const u of this.indexes()){if(this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.keyList[u]}}}*rkeys(){for(const u of this.rindexes()){if(this.keyList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.keyList[u]}}}*values(){for(const u of this.indexes()){if(this.valList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.valList[u]}}}*rvalues(){for(const u of this.rindexes()){if(this.valList[u]!==undefined&&!this.isBackgroundFetch(this.valList[u])){yield this.valList[u]}}}[Symbol.iterator](){return this.entries()}find(u,A){for(const p of this.indexes()){const y=this.valList[p];const E=this.isBackgroundFetch(y)?y.__staleWhileFetching:y;if(E===undefined)continue;if(u(E,this.keyList[p],this)){return this.get(this.keyList[p],A)}}}forEach(u,A=this){for(const p of this.indexes()){const y=this.valList[p];const E=this.isBackgroundFetch(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.keyList[p],this)}}rforEach(u,A=this){for(const p of this.rindexes()){const y=this.valList[p];const E=this.isBackgroundFetch(y)?y.__staleWhileFetching:y;if(E===undefined)continue;u.call(A,E,this.keyList[p],this)}}get prune(){deprecatedMethod("prune","purgeStale");return this.purgeStale}purgeStale(){let u=false;for(const A of this.rindexes({allowStale:true})){if(this.isStale(A)){this.delete(this.keyList[A]);u=true}}return u}dump(){const u=[];for(const p of this.indexes({allowStale:true})){const y=this.keyList[p];const E=this.valList[p];const C=this.isBackgroundFetch(E)?E.__staleWhileFetching:E;if(C===undefined)continue;const I={value:C};if(this.ttls){I.ttl=this.ttls[p];const u=A.now()-this.starts[p];I.start=Math.floor(Date.now()-u)}if(this.sizes){I.size=this.sizes[p]}u.unshift([y,I])}return u}load(u){this.clear();for(const[p,y]of u){if(y.start){const u=Date.now()-y.start;y.start=A.now()-u}this.set(p,y.value,y)}}dispose(u,A,p){}set(u,A,{ttl:p=this.ttl,start:y,noDisposeOnSet:E=this.noDisposeOnSet,size:C=0,sizeCalculation:I=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,status:v}={}){C=this.requireSize(u,A,C,I);if(this.maxEntrySize&&C>this.maxEntrySize){if(v){v.set="miss";v.maxEntrySizeExceeded=true}this.delete(u);return this}let B=this.size===0?undefined:this.keyMap.get(u);if(B===undefined){B=this.newIndex();this.keyList[B]=u;this.valList[B]=A;this.keyMap.set(u,B);this.next[this.tail]=B;this.prev[B]=this.tail;this.tail=B;this.size++;this.addItemSize(B,C,v);if(v){v.set="add"}w=false}else{this.moveToTail(B);const p=this.valList[B];if(A!==p){if(this.isBackgroundFetch(p)){p.__abortController.abort(new Error("replaced"))}else{if(!E){this.dispose(p,u,"set");if(this.disposeAfter){this.disposed.push([p,u,"set"])}}}this.removeItemSize(B);this.valList[B]=A;this.addItemSize(B,C,v);if(v){v.set="replace";const u=p&&this.isBackgroundFetch(p)?p.__staleWhileFetching:p;if(u!==undefined)v.oldValue=u}}else if(v){v.set="update"}}if(p!==0&&this.ttl===0&&!this.ttls){this.initializeTTLTracking()}if(!w){this.setItemTTL(B,p,y)}this.statusTTL(v,B);if(this.disposeAfter){while(this.disposed.length){this.disposeAfter(...this.disposed.shift())}}return this}newIndex(){if(this.size===0){return this.tail}if(this.size===this.max&&this.max!==0){return this.evict(false)}if(this.free.length!==0){return this.free.pop()}return this.initialFill++}pop(){if(this.size){const u=this.valList[this.head];this.evict(true);return u}}evict(u){const A=this.head;const p=this.keyList[A];const y=this.valList[A];if(this.isBackgroundFetch(y)){y.__abortController.abort(new Error("evicted"))}else{this.dispose(y,p,"evict");if(this.disposeAfter){this.disposed.push([y,p,"evict"])}}this.removeItemSize(A);if(u){this.keyList[A]=null;this.valList[A]=null;this.free.push(A)}this.head=this.next[A];this.keyMap.delete(p);this.size--;return A}has(u,{updateAgeOnHas:A=this.updateAgeOnHas,status:p}={}){const y=this.keyMap.get(u);if(y!==undefined){if(!this.isStale(y)){if(A){this.updateItemAge(y)}if(p)p.has="hit";this.statusTTL(p,y);return true}else if(p){p.has="stale";this.statusTTL(p,y)}}else if(p){p.has="miss"}return false}peek(u,{allowStale:A=this.allowStale}={}){const p=this.keyMap.get(u);if(p!==undefined&&(A||!this.isStale(p))){const u=this.valList[p];return this.isBackgroundFetch(u)?u.__staleWhileFetching:u}}backgroundFetch(u,A,p,E){const C=A===undefined?undefined:this.valList[A];if(this.isBackgroundFetch(C)){return C}const I=new y;if(p.signal){p.signal.addEventListener("abort",(()=>I.abort(p.signal.reason)))}const w={signal:I.signal,options:p,context:E};const cb=(y,E=false)=>{const{aborted:C}=I.signal;const B=p.ignoreFetchAbort&&y!==undefined;if(p.status){if(C&&!E){p.status.fetchAborted=true;p.status.fetchError=I.signal.reason;if(B)p.status.fetchAbortIgnored=true}else{p.status.fetchResolved=true}}if(C&&!B&&!E){return fetchFail(I.signal.reason)}if(this.valList[A]===v){if(y===undefined){if(v.__staleWhileFetching){this.valList[A]=v.__staleWhileFetching}else{this.delete(u)}}else{if(p.status)p.status.fetchUpdated=true;this.set(u,y,w.options)}}return y};const eb=u=>{if(p.status){p.status.fetchRejected=true;p.status.fetchError=u}return fetchFail(u)};const fetchFail=y=>{const{aborted:E}=I.signal;const C=E&&p.allowStaleOnFetchAbort;const w=C||p.allowStaleOnFetchRejection;const B=w||p.noDeleteOnFetchRejection;if(this.valList[A]===v){const p=!B||v.__staleWhileFetching===undefined;if(p){this.delete(u)}else if(!C){this.valList[A]=v.__staleWhileFetching}}if(w){if(p.status&&v.__staleWhileFetching!==undefined){p.status.returnedStale=true}return v.__staleWhileFetching}else if(v.__returned===v){throw y}};const pcall=(A,y)=>{this.fetchMethod(u,C,w).then((u=>A(u)),y);I.signal.addEventListener("abort",(()=>{if(!p.ignoreFetchAbort||p.allowStaleOnFetchAbort){A();if(p.allowStaleOnFetchAbort){A=u=>cb(u,true)}}}))};if(p.status)p.status.fetchDispatched=true;const v=new Promise(pcall).then(cb,eb);v.__abortController=I;v.__staleWhileFetching=C;v.__returned=null;if(A===undefined){this.set(u,v,{...w.options,status:undefined});A=this.keyMap.get(u)}else{this.valList[A]=v}return v}isBackgroundFetch(u){return u&&typeof u==="object"&&typeof u.then==="function"&&Object.prototype.hasOwnProperty.call(u,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(u,"__returned")&&(u.__returned===u||u.__returned===null)}async fetch(u,{allowStale:A=this.allowStale,updateAgeOnGet:p=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:C=this.noDisposeOnSet,size:I=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:v=this.noUpdateTTL,noDeleteOnFetchRejection:B=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:S=this.allowStaleOnFetchRejection,ignoreFetchAbort:D=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,fetchContext:Q=this.fetchContext,forceRefresh:F=false,status:R,signal:_}={}){if(!this.fetchMethod){if(R)R.fetch="get";return this.get(u,{allowStale:A,updateAgeOnGet:p,noDeleteOnStaleGet:y,status:R})}const P={allowStale:A,updateAgeOnGet:p,noDeleteOnStaleGet:y,ttl:E,noDisposeOnSet:C,size:I,sizeCalculation:w,noUpdateTTL:v,noDeleteOnFetchRejection:B,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:k,ignoreFetchAbort:D,status:R,signal:_};let O=this.keyMap.get(u);if(O===undefined){if(R)R.fetch="miss";const A=this.backgroundFetch(u,O,P,Q);return A.__returned=A}else{const y=this.valList[O];if(this.isBackgroundFetch(y)){const u=A&&y.__staleWhileFetching!==undefined;if(R){R.fetch="inflight";if(u)R.returnedStale=true}return u?y.__staleWhileFetching:y.__returned=y}const E=this.isStale(O);if(!F&&!E){if(R)R.fetch="hit";this.moveToTail(O);if(p){this.updateItemAge(O)}this.statusTTL(R,O);return y}const C=this.backgroundFetch(u,O,P,Q);const I=C.__staleWhileFetching!==undefined;const w=I&&A;if(R){R.fetch=I&&E?"stale":"refresh";if(w&&E)R.returnedStale=true}return w?C.__staleWhileFetching:C.__returned=C}}get(u,{allowStale:A=this.allowStale,updateAgeOnGet:p=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,status:E}={}){const C=this.keyMap.get(u);if(C!==undefined){const I=this.valList[C];const w=this.isBackgroundFetch(I);this.statusTTL(E,C);if(this.isStale(C)){if(E)E.get="stale";if(!w){if(!y){this.delete(u)}if(E)E.returnedStale=A;return A?I:undefined}else{if(E){E.returnedStale=A&&I.__staleWhileFetching!==undefined}return A?I.__staleWhileFetching:undefined}}else{if(E)E.get="hit";if(w){return I.__staleWhileFetching}this.moveToTail(C);if(p){this.updateItemAge(C)}return I}}else if(E){E.get="miss"}}connect(u,A){this.prev[A]=u;this.next[u]=A}moveToTail(u){if(u!==this.tail){if(u===this.head){this.head=this.next[u]}else{this.connect(this.prev[u],this.next[u])}this.connect(this.tail,u);this.tail=u}}get del(){deprecatedMethod("del","delete");return this.delete}delete(u){let A=false;if(this.size!==0){const p=this.keyMap.get(u);if(p!==undefined){A=true;if(this.size===1){this.clear()}else{this.removeItemSize(p);const A=this.valList[p];if(this.isBackgroundFetch(A)){A.__abortController.abort(new Error("deleted"))}else{this.dispose(A,u,"delete");if(this.disposeAfter){this.disposed.push([A,u,"delete"])}}this.keyMap.delete(u);this.keyList[p]=null;this.valList[p]=null;if(p===this.tail){this.tail=this.prev[p]}else if(p===this.head){this.head=this.next[p]}else{this.next[this.prev[p]]=this.next[p];this.prev[this.next[p]]=this.prev[p]}this.size--;this.free.push(p)}}}if(this.disposed){while(this.disposed.length){this.disposeAfter(...this.disposed.shift())}}return A}clear(){for(const u of this.rindexes({allowStale:true})){const A=this.valList[u];if(this.isBackgroundFetch(A)){A.__abortController.abort(new Error("deleted"))}else{const p=this.keyList[u];this.dispose(A,p,"delete");if(this.disposeAfter){this.disposed.push([A,p,"delete"])}}}this.keyMap.clear();this.valList.fill(null);this.keyList.fill(null);if(this.ttls){this.ttls.fill(0);this.starts.fill(0)}if(this.sizes){this.sizes.fill(0)}this.head=0;this.tail=0;this.initialFill=1;this.free.length=0;this.calculatedSize=0;this.size=0;if(this.disposed){while(this.disposed.length){this.disposeAfter(...this.disposed.shift())}}}get reset(){deprecatedMethod("reset","clear");return this.clear}get length(){deprecatedProperty("length","size");return this.size}static get AbortController(){return y}static get AbortSignal(){return I}}u.exports=LRUCache},750:(u,A,p)=>{p.d(A,{Ik:()=>Ce,Ku:()=>oe,CR:()=>cursorTo,eh:()=>cursorUp,Sc:()=>ue,_W:()=>eraseLines});var y=p(1708);var E=p(8161);const C=globalThis.window?.document!==undefined;const I=globalThis.process?.versions?.node!==undefined;const w=globalThis.process?.versions?.bun!==undefined;const v=globalThis.Deno?.version?.deno!==undefined;const B=globalThis.process?.versions?.electron!==undefined;const S=globalThis.navigator?.userAgent?.includes("jsdom")===true;const D=typeof WorkerGlobalScope!=="undefined"&&globalThis instanceof WorkerGlobalScope;const k=typeof DedicatedWorkerGlobalScope!=="undefined"&&globalThis instanceof DedicatedWorkerGlobalScope;const Q=typeof SharedWorkerGlobalScope!=="undefined"&&globalThis instanceof SharedWorkerGlobalScope;const F=typeof ServiceWorkerGlobalScope!=="undefined"&&globalThis instanceof ServiceWorkerGlobalScope;const R=globalThis.navigator?.userAgentData?.platform;const _=R==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===true||globalThis.process?.platform==="darwin";const P=R==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32";const O=R==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===true||globalThis.navigator?.userAgent?.includes(" Linux ")===true||globalThis.process?.platform==="linux";const U=R==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform);const H=R==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===true||globalThis.process?.platform==="android";const G="[";const j="]";const $="";const q=";";const K=!C&&y.env.TERM_PROGRAM==="Apple_Terminal";const J=!C&&y.platform==="win32";const ee=!C&&(y.env.TERM?.startsWith("screen")||y.env.TERM?.startsWith("tmux")||y.env.TMUX!==undefined);const te=C?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:y.cwd;const wrapOsc=u=>{if(ee){return"Ptmux;"+u.replaceAll("","")+"\\"}return u};const cursorTo=(u,A)=>{if(typeof u!=="number"){throw new TypeError("The `x` argument is required")}if(typeof A!=="number"){return G+(u+1)+"G"}return G+(A+1)+q+(u+1)+"H"};const cursorMove=(u,A)=>{if(typeof u!=="number"){throw new TypeError("The `x` argument is required")}let p="";if(u<0){p+=G+-u+"D"}else if(u>0){p+=G+u+"C"}if(A<0){p+=G+-A+"A"}else if(A>0){p+=G+A+"B"}return p};const cursorUp=(u=1)=>G+u+"A";const cursorDown=(u=1)=>G+u+"B";const cursorForward=(u=1)=>G+u+"C";const cursorBackward=(u=1)=>G+u+"D";const ne=G+"G";const re=K?"7":G+"s";const se=K?"8":G+"u";const ie=G+"6n";const oe=G+"E";const ae=G+"F";const le=G+"?25l";const ce=G+"?25h";const eraseLines=u=>{let A="";for(let p=0;p<u;p++){A+=fe+(p<u-1?cursorUp():"")}if(u){A+=ne}return A};const ue=G+"K";const de=G+"1K";const fe=G+"2K";const Ae=G+"J";const he=G+"1J";const pe=G+"2J";const ge=G+"S";const me=G+"T";const ye="c";const Ee=null&&`${pe}${G}H`;const isOldWindows=()=>{if(C||!J){return false}const u=E.release().split(".");const A=Number(u[0]);const p=Number(u[2]??0);if(A<10){return true}if(A===10&&p<10586){return true}return false};const Ce=isOldWindows()?`${pe}${G}0f`:`${pe}${G}3J${G}H`;const Ie=G+"?1049h";const be=G+"?1049l";const we=null&&$;const base_link=(u,A)=>{const p=wrapOsc(`${j}8${q}${q}${A}${$}`);const y=wrapOsc(`${j}8${q}${q}${$}`);return p+u+y};const base_image=(u,A={})=>{let p=`${j}1337;File=inline=1`;if(A.width){p+=`;width=${A.width}`}if(A.height){p+=`;height=${A.height}`}if(A.preserveAspectRatio===false){p+=";preserveAspectRatio=0"}const y=Buffer.from(u);return wrapOsc(p+`;size=${y.byteLength}`+":"+y.toString("base64")+$)};const ve={setCwd:(u=te())=>wrapOsc(`${j}50;CurrentDir=${u}${$}`),annotation(u,A={}){let p=`${j}1337;`;const y=A.x!==undefined;const E=A.y!==undefined;if((y||E)&&!(y&&E&&A.length!==undefined)){throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined")}u=u.replaceAll("|","");p+=A.isHidden?"AddHiddenAnnotation=":"AddAnnotation=";if(A.length>0){p+=(y?[u,A.length,A.x,A.y]:[A.length,u]).join("|")}else{p+=u}return wrapOsc(p+$)}};const Be={setCwd:(u=te())=>wrapOsc(`${j}9;9;${u}${$}`)};const setCwd=(u=te())=>ve.setCwd(u)+Be.setCwd(u)},651:(u,A,p)=>{p.d(A,{Ay:()=>S});const y=10;const wrapAnsi16=(u=0)=>A=>`[${A+u}m`;const wrapAnsi256=(u=0)=>A=>`[${38+u};5;${A}m`;const wrapAnsi16m=(u=0)=>(A,p,y)=>`[${38+u};2;${A};${p};${y}m`;const E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const C=Object.keys(E.modifier);const I=Object.keys(E.color);const w=Object.keys(E.bgColor);const v=[...I,...w];function assembleStyles(){const u=new Map;for(const[A,p]of Object.entries(E)){for(const[A,y]of Object.entries(p)){E[A]={open:`[${y[0]}m`,close:`[${y[1]}m`};p[A]=E[A];u.set(y[0],y[1])}Object.defineProperty(E,A,{value:p,enumerable:false})}Object.defineProperty(E,"codes",{value:u,enumerable:false});E.color.close="";E.bgColor.close="";E.color.ansi=wrapAnsi16();E.color.ansi256=wrapAnsi256();E.color.ansi16m=wrapAnsi16m();E.bgColor.ansi=wrapAnsi16(y);E.bgColor.ansi256=wrapAnsi256(y);E.bgColor.ansi16m=wrapAnsi16m(y);Object.defineProperties(E,{rgbToAnsi256:{value(u,A,p){if(u===A&&A===p){if(u<8){return 16}if(u>248){return 231}return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(A/255*5)+Math.round(p/255*5)},enumerable:false},hexToRgb:{value(u){const A=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!A){return[0,0,0]}let[p]=A;if(p.length===3){p=[...p].map((u=>u+u)).join("")}const y=Number.parseInt(p,16);return[y>>16&255,y>>8&255,y&255]},enumerable:false},hexToAnsi256:{value:u=>E.rgbToAnsi256(...E.hexToRgb(u)),enumerable:false},ansi256ToAnsi:{value(u){if(u<8){return 30+u}if(u<16){return 90+(u-8)}let A;let p;let y;if(u>=232){A=((u-232)*10+8)/255;p=A;y=A}else{u-=16;const E=u%36;A=Math.floor(u/36)/5;p=Math.floor(E/6)/5;y=E%6/5}const E=Math.max(A,p,y)*2;if(E===0){return 30}let C=30+(Math.round(y)<<2|Math.round(p)<<1|Math.round(A));if(E===2){C+=60}return C},enumerable:false},rgbToAnsi:{value:(u,A,p)=>E.ansi256ToAnsi(E.rgbToAnsi256(u,A,p)),enumerable:false},hexToAnsi:{value:u=>E.ansi256ToAnsi(E.hexToAnsi256(u)),enumerable:false}});return E}const B=assembleStyles();const S=B},1690:(u,A,p)=>{p.d(A,{A:()=>autoBind});const getAllProperties=u=>{const A=new Set;do{for(const p of Reflect.ownKeys(u)){A.add([u,p])}}while((u=Reflect.getPrototypeOf(u))&&u!==Object.prototype);return A};function autoBind(u,{include:A,exclude:p}={}){const filter=u=>{const match=A=>typeof A==="string"?u===A:A.test(u);if(A){return A.some(match)}if(p){return!p.some(match)}return true};for(const[A,p]of getAllProperties(u.constructor.prototype)){if(p==="constructor"||!filter(p)){continue}const y=Reflect.getOwnPropertyDescriptor(A,p);if(y&&typeof y.value==="function"){u[p]=u[p].bind(u)}}return u}},9611:(u,A,p)=>{p.d(A,{Ay:()=>ne});const y=10;const wrapAnsi16=(u=0)=>A=>`[${A+u}m`;const wrapAnsi256=(u=0)=>A=>`[${38+u};5;${A}m`;const wrapAnsi16m=(u=0)=>(A,p,y)=>`[${38+u};2;${A};${p};${y}m`;const E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const C=Object.keys(E.modifier);const I=Object.keys(E.color);const w=Object.keys(E.bgColor);const v=[...I,...w];function assembleStyles(){const u=new Map;for(const[A,p]of Object.entries(E)){for(const[A,y]of Object.entries(p)){E[A]={open:`[${y[0]}m`,close:`[${y[1]}m`};p[A]=E[A];u.set(y[0],y[1])}Object.defineProperty(E,A,{value:p,enumerable:false})}Object.defineProperty(E,"codes",{value:u,enumerable:false});E.color.close="";E.bgColor.close="";E.color.ansi=wrapAnsi16();E.color.ansi256=wrapAnsi256();E.color.ansi16m=wrapAnsi16m();E.bgColor.ansi=wrapAnsi16(y);E.bgColor.ansi256=wrapAnsi256(y);E.bgColor.ansi16m=wrapAnsi16m(y);Object.defineProperties(E,{rgbToAnsi256:{value(u,A,p){if(u===A&&A===p){if(u<8){return 16}if(u>248){return 231}return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(A/255*5)+Math.round(p/255*5)},enumerable:false},hexToRgb:{value(u){const A=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!A){return[0,0,0]}let[p]=A;if(p.length===3){p=[...p].map((u=>u+u)).join("")}const y=Number.parseInt(p,16);return[y>>16&255,y>>8&255,y&255]},enumerable:false},hexToAnsi256:{value:u=>E.rgbToAnsi256(...E.hexToRgb(u)),enumerable:false},ansi256ToAnsi:{value(u){if(u<8){return 30+u}if(u<16){return 90+(u-8)}let A;let p;let y;if(u>=232){A=((u-232)*10+8)/255;p=A;y=A}else{u-=16;const E=u%36;A=Math.floor(u/36)/5;p=Math.floor(E/6)/5;y=E%6/5}const E=Math.max(A,p,y)*2;if(E===0){return 30}let C=30+(Math.round(y)<<2|Math.round(p)<<1|Math.round(A));if(E===2){C+=60}return C},enumerable:false},rgbToAnsi:{value:(u,A,p)=>E.ansi256ToAnsi(E.rgbToAnsi256(u,A,p)),enumerable:false},hexToAnsi:{value:u=>E.ansi256ToAnsi(E.hexToAnsi256(u)),enumerable:false}});return E}const B=assembleStyles();const S=B;var D=p(1708);var k=p(8161);var Q=p(7066);function hasFlag(u,A=(globalThis.Deno?globalThis.Deno.args:D.argv)){const p=u.startsWith("-")?"":u.length===1?"-":"--";const y=A.indexOf(p+u);const E=A.indexOf("--");return y!==-1&&(E===-1||y<E)}const{env:F}=D;let R;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){R=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){R=1}function envForceColor(){if("FORCE_COLOR"in F){if(F.FORCE_COLOR==="true"){return 1}if(F.FORCE_COLOR==="false"){return 0}return F.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(F.FORCE_COLOR,10),3)}}function translateLevel(u){if(u===0){return false}return{level:u,hasBasic:true,has256:u>=2,has16m:u>=3}}function _supportsColor(u,{streamIsTTY:A,sniffFlags:p=true}={}){const y=envForceColor();if(y!==undefined){R=y}const E=p?R:y;if(E===0){return 0}if(p){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if("TF_BUILD"in F&&"AGENT_NAME"in F){return 1}if(u&&!A&&E===undefined){return 0}const C=E||0;if(F.TERM==="dumb"){return C}if(D.platform==="win32"){const u=k.release().split(".");if(Number(u[0])>=10&&Number(u[2])>=10586){return Number(u[2])>=14931?3:2}return 1}if("CI"in F){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((u=>u in F))){return 3}if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((u=>u in F))||F.CI_NAME==="codeship"){return 1}return C}if("TEAMCITY_VERSION"in F){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(F.TEAMCITY_VERSION)?1:0}if(F.COLORTERM==="truecolor"){return 3}if(F.TERM==="xterm-kitty"){return 3}if(F.TERM==="xterm-ghostty"){return 3}if(F.TERM==="wezterm"){return 3}if("TERM_PROGRAM"in F){const u=Number.parseInt((F.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(F.TERM_PROGRAM){case"iTerm.app":{return u>=3?3:2}case"Apple_Terminal":{return 2}}}if(/-256(color)?$/i.test(F.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(F.TERM)){return 1}if("COLORTERM"in F){return 1}return C}function createSupportsColor(u,A={}){const p=_supportsColor(u,{streamIsTTY:u&&u.isTTY,...A});return translateLevel(p)}const _={stdout:createSupportsColor({isTTY:Q.isatty(1)}),stderr:createSupportsColor({isTTY:Q.isatty(2)})};const P=_;function stringReplaceAll(u,A,p){let y=u.indexOf(A);if(y===-1){return u}const E=A.length;let C=0;let I="";do{I+=u.slice(C,y)+A+p;C=y+E;y=u.indexOf(A,C)}while(y!==-1);I+=u.slice(C);return I}function stringEncaseCRLFWithFirstIndex(u,A,p,y){let E=0;let C="";do{const I=u[y-1]==="\r";C+=u.slice(E,I?y-1:y)+A+(I?"\r\n":"\n")+p;E=y+1;y=u.indexOf("\n",E)}while(y!==-1);C+=u.slice(E);return C}const{stdout:O,stderr:U}=P;const H=Symbol("GENERATOR");const G=Symbol("STYLER");const j=Symbol("IS_EMPTY");const $=["ansi","ansi","ansi256","ansi16m"];const q=Object.create(null);const applyOptions=(u,A={})=>{if(A.level&&!(Number.isInteger(A.level)&&A.level>=0&&A.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const p=O?O.level:0;u.level=A.level===undefined?p:A.level};class Chalk{constructor(u){return chalkFactory(u)}}const chalkFactory=u=>{const chalk=(...u)=>u.join(" ");applyOptions(chalk,u);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(u){return chalkFactory(u)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[u,A]of Object.entries(S)){q[u]={get(){const p=createBuilder(this,createStyler(A.open,A.close,this[G]),this[j]);Object.defineProperty(this,u,{value:p});return p}}}q.visible={get(){const u=createBuilder(this,this[G],true);Object.defineProperty(this,"visible",{value:u});return u}};const getModelAnsi=(u,A,p,...y)=>{if(u==="rgb"){if(A==="ansi16m"){return S[p].ansi16m(...y)}if(A==="ansi256"){return S[p].ansi256(S.rgbToAnsi256(...y))}return S[p].ansi(S.rgbToAnsi(...y))}if(u==="hex"){return getModelAnsi("rgb",A,p,...S.hexToRgb(...y))}return S[p][u](...y)};const K=["rgb","hex","ansi256"];for(const u of K){q[u]={get(){const{level:A}=this;return function(...p){const y=createStyler(getModelAnsi(u,$[A],"color",...p),S.color.close,this[G]);return createBuilder(this,y,this[j])}}};const A="bg"+u[0].toUpperCase()+u.slice(1);q[A]={get(){const{level:A}=this;return function(...p){const y=createStyler(getModelAnsi(u,$[A],"bgColor",...p),S.bgColor.close,this[G]);return createBuilder(this,y,this[j])}}}}const J=Object.defineProperties((()=>{}),{...q,level:{enumerable:true,get(){return this[H].level},set(u){this[H].level=u}}});const createStyler=(u,A,p)=>{let y;let E;if(p===undefined){y=u;E=A}else{y=p.openAll+u;E=A+p.closeAll}return{open:u,close:A,openAll:y,closeAll:E,parent:p}};const createBuilder=(u,A,p)=>{const builder=(...u)=>applyStyle(builder,u.length===1?""+u[0]:u.join(" "));Object.setPrototypeOf(builder,J);builder[H]=u;builder[G]=A;builder[j]=p;return builder};const applyStyle=(u,A)=>{if(u.level<=0||!A){return u[j]?"":A}let p=u[G];if(p===undefined){return A}const{openAll:y,closeAll:E}=p;if(A.includes("")){while(p!==undefined){A=stringReplaceAll(A,p.close,p.open);p=p.parent}}const C=A.indexOf("\n");if(C!==-1){A=stringEncaseCRLFWithFirstIndex(A,E,y,C)}return y+A+E};Object.defineProperties(createChalk.prototype,q);const ee=createChalk();const te=createChalk({level:U?U.level:0});const ne=ee},7078:(u,A,p)=>{p.d(A,{A:()=>S});var y=p(1708);var E=p(5443);var C=p(7417);const I=E((()=>{C((()=>{y.stderr.write("[?25h")}),{alwaysLast:true})}));const w=I;let v=false;const B={};B.show=(u=y.stderr)=>{if(!u.isTTY){return}v=false;u.write("[?25h")};B.hide=(u=y.stderr)=>{if(!u.isTTY){return}w();v=true;u.write("[?25l")};B.toggle=(u,A)=>{if(u!==undefined){v=u}if(v){B.show(A)}else{B.hide(A)}};const S=B},4104:(u,A,p)=>{p.d(A,{Pp:()=>diffLines});class Diff{diff(u,A,p={}){let y;if(typeof p==="function"){y=p;p={}}else if("callback"in p){y=p.callback}const E=this.castInput(u,p);const C=this.castInput(A,p);const I=this.removeEmpty(this.tokenize(E,p));const w=this.removeEmpty(this.tokenize(C,p));return this.diffWithOptionsObj(I,w,p,y)}diffWithOptionsObj(u,A,p,y){var E;const done=u=>{u=this.postProcess(u,p);if(y){setTimeout((function(){y(u)}),0);return undefined}else{return u}};const C=A.length,I=u.length;let w=1;let v=C+I;if(p.maxEditLength!=null){v=Math.min(v,p.maxEditLength)}const B=(E=p.timeout)!==null&&E!==void 0?E:Infinity;const S=Date.now()+B;const D=[{oldPos:-1,lastComponent:undefined}];let k=this.extractCommon(D[0],A,u,0,p);if(D[0].oldPos+1>=I&&k+1>=C){return done(this.buildValues(D[0].lastComponent,A,u))}let Q=-Infinity,F=Infinity;const execEditLength=()=>{for(let y=Math.max(Q,-w);y<=Math.min(F,w);y+=2){let E;const w=D[y-1],v=D[y+1];if(w){D[y-1]=undefined}let B=false;if(v){const u=v.oldPos-y;B=v&&0<=u&&u<C}const S=w&&w.oldPos+1<I;if(!B&&!S){D[y]=undefined;continue}if(!S||B&&w.oldPos<v.oldPos){E=this.addToPath(v,true,false,0,p)}else{E=this.addToPath(w,false,true,1,p)}k=this.extractCommon(E,A,u,y,p);if(E.oldPos+1>=I&&k+1>=C){return done(this.buildValues(E.lastComponent,A,u))||true}else{D[y]=E;if(E.oldPos+1>=I){F=Math.min(F,y-1)}if(k+1>=C){Q=Math.max(Q,y+1)}}}w++};if(y){(function exec(){setTimeout((function(){if(w>v||Date.now()>S){return y(undefined)}if(!execEditLength()){exec()}}),0)})()}else{while(w<=v&&Date.now()<=S){const u=execEditLength();if(u){return u}}}}addToPath(u,A,p,y,E){const C=u.lastComponent;if(C&&!E.oneChangePerToken&&C.added===A&&C.removed===p){return{oldPos:u.oldPos+y,lastComponent:{count:C.count+1,added:A,removed:p,previousComponent:C.previousComponent}}}else{return{oldPos:u.oldPos+y,lastComponent:{count:1,added:A,removed:p,previousComponent:C}}}}extractCommon(u,A,p,y,E){const C=A.length,I=p.length;let w=u.oldPos,v=w-y,B=0;while(v+1<C&&w+1<I&&this.equals(p[w+1],A[v+1],E)){v++;w++;B++;if(E.oneChangePerToken){u.lastComponent={count:1,previousComponent:u.lastComponent,added:false,removed:false}}}if(B&&!E.oneChangePerToken){u.lastComponent={count:B,previousComponent:u.lastComponent,added:false,removed:false}}u.oldPos=w;return v}equals(u,A,p){if(p.comparator){return p.comparator(u,A)}else{return u===A||!!p.ignoreCase&&u.toLowerCase()===A.toLowerCase()}}removeEmpty(u){const A=[];for(let p=0;p<u.length;p++){if(u[p]){A.push(u[p])}}return A}castInput(u,A){return u}tokenize(u,A){return Array.from(u)}join(u){return u.join("")}postProcess(u,A){return u}get useLongestToken(){return false}buildValues(u,A,p){const y=[];let E;while(u){y.push(u);E=u.previousComponent;delete u.previousComponent;u=E}y.reverse();const C=y.length;let I=0,w=0,v=0;for(;I<C;I++){const u=y[I];if(!u.removed){if(!u.added&&this.useLongestToken){let y=A.slice(w,w+u.count);y=y.map((function(u,A){const y=p[v+A];return y.length>u.length?y:u}));u.value=this.join(y)}else{u.value=this.join(A.slice(w,w+u.count))}w+=u.count;if(!u.added){v+=u.count}}else{u.value=this.join(p.slice(v,v+u.count));v+=u.count}}return y}}class LineDiff extends Diff{constructor(){super(...arguments);this.tokenize=tokenize}equals(u,A,p){if(p.ignoreWhitespace){if(!p.newlineIsToken||!u.includes("\n")){u=u.trim()}if(!p.newlineIsToken||!A.includes("\n")){A=A.trim()}}else if(p.ignoreNewlineAtEof&&!p.newlineIsToken){if(u.endsWith("\n")){u=u.slice(0,-1)}if(A.endsWith("\n")){A=A.slice(0,-1)}}return super.equals(u,A,p)}}const y=new LineDiff;function diffLines(u,A,p){return y.diff(u,A,p)}function diffTrimmedLines(u,A,p){p=generateOptions(p,{ignoreWhitespace:true});return y.diff(u,A,p)}function tokenize(u,A){if(A.stripTrailingCr){u=u.replace(/\r\n/g,"\n")}const p=[],y=u.split(/(\n|\r\n)/);if(!y[y.length-1]){y.pop()}for(let u=0;u<y.length;u++){const E=y[u];if(u%2&&!A.newlineIsToken){p[p.length-1]+=E}else{p.push(E)}}return p}},9966:(u,A,p)=>{p.d(A,{n:()=>throttle});function debounce(u,A,{signal:p,edges:y}={}){let E=undefined;let C=null;const I=y!=null&&y.includes("leading");const w=y==null||y.includes("trailing");const invoke=()=>{if(C!==null){u.apply(E,C);E=undefined;C=null}};const onTimerEnd=()=>{if(w){invoke()}cancel()};let v=null;const schedule=()=>{if(v!=null){clearTimeout(v)}v=setTimeout((()=>{v=null;onTimerEnd()}),A)};const cancelTimer=()=>{if(v!==null){clearTimeout(v);v=null}};const cancel=()=>{cancelTimer();E=undefined;C=null};const flush=()=>{invoke()};const debounced=function(...u){if(p?.aborted){return}E=this;C=u;const A=v==null;schedule();if(I&&A){invoke()}};debounced.schedule=schedule;debounced.cancel=cancel;debounced.flush=flush;p?.addEventListener("abort",cancel,{once:true});return debounced}function debounce_debounce(u,A=0,p={}){if(typeof p!=="object"){p={}}const{leading:y=false,trailing:E=true,maxWait:C}=p;const I=Array(2);if(y){I[0]="leading"}if(E){I[1]="trailing"}let w=undefined;let v=null;const B=debounce((function(...A){w=u.apply(this,A);v=null}),A,{edges:I});const debounced=function(...A){if(C!=null){if(v===null){v=Date.now()}if(Date.now()-v>=C){w=u.apply(this,A);v=Date.now();B.cancel();B.schedule();return w}}B.apply(this,A);return w};const flush=()=>{B.flush();return w};debounced.cancel=B.cancel;debounced.flush=flush;return debounced}function throttle(u,A=0,p={}){const{leading:y=true,trailing:E=true}=p;return debounce_debounce(u,A,{leading:y,maxWait:A,trailing:E})}},5351:(u,A,p)=>{p.d(A,{Q1:()=>eastAsianWidth});var y=p(9957);function validate(u){if(!Number.isSafeInteger(u)){throw new TypeError(`Expected a code point, got \`${typeof u}\`.`)}}function eastAsianWidthType(u){validate(u);return getCategory(u)}function eastAsianWidth(u,{ambiguousAsWide:A=false}={}){validate(u);if((0,y.Ck)(u)||(0,y.EW)(u)||A&&(0,y.X2)(u)){return 2}return 1}},9957:(u,A,p)=>{p.d(A,{Ck:()=>isFullWidth,EW:()=>isWide,X2:()=>isAmbiguous});function isAmbiguous(u){return u===161||u===164||u===167||u===168||u===170||u===173||u===174||u>=176&&u<=180||u>=182&&u<=186||u>=188&&u<=191||u===198||u===208||u===215||u===216||u>=222&&u<=225||u===230||u>=232&&u<=234||u===236||u===237||u===240||u===242||u===243||u>=247&&u<=250||u===252||u===254||u===257||u===273||u===275||u===283||u===294||u===295||u===299||u>=305&&u<=307||u===312||u>=319&&u<=322||u===324||u>=328&&u<=331||u===333||u===338||u===339||u===358||u===359||u===363||u===462||u===464||u===466||u===468||u===470||u===472||u===474||u===476||u===593||u===609||u===708||u===711||u>=713&&u<=715||u===717||u===720||u>=728&&u<=731||u===733||u===735||u>=768&&u<=879||u>=913&&u<=929||u>=931&&u<=937||u>=945&&u<=961||u>=963&&u<=969||u===1025||u>=1040&&u<=1103||u===1105||u===8208||u>=8211&&u<=8214||u===8216||u===8217||u===8220||u===8221||u>=8224&&u<=8226||u>=8228&&u<=8231||u===8240||u===8242||u===8243||u===8245||u===8251||u===8254||u===8308||u===8319||u>=8321&&u<=8324||u===8364||u===8451||u===8453||u===8457||u===8467||u===8470||u===8481||u===8482||u===8486||u===8491||u===8531||u===8532||u>=8539&&u<=8542||u>=8544&&u<=8555||u>=8560&&u<=8569||u===8585||u>=8592&&u<=8601||u===8632||u===8633||u===8658||u===8660||u===8679||u===8704||u===8706||u===8707||u===8711||u===8712||u===8715||u===8719||u===8721||u===8725||u===8730||u>=8733&&u<=8736||u===8739||u===8741||u>=8743&&u<=8748||u===8750||u>=8756&&u<=8759||u===8764||u===8765||u===8776||u===8780||u===8786||u===8800||u===8801||u>=8804&&u<=8807||u===8810||u===8811||u===8814||u===8815||u===8834||u===8835||u===8838||u===8839||u===8853||u===8857||u===8869||u===8895||u===8978||u>=9312&&u<=9449||u>=9451&&u<=9547||u>=9552&&u<=9587||u>=9600&&u<=9615||u>=9618&&u<=9621||u===9632||u===9633||u>=9635&&u<=9641||u===9650||u===9651||u===9654||u===9655||u===9660||u===9661||u===9664||u===9665||u>=9670&&u<=9672||u===9675||u>=9678&&u<=9681||u>=9698&&u<=9701||u===9711||u===9733||u===9734||u===9737||u===9742||u===9743||u===9756||u===9758||u===9792||u===9794||u===9824||u===9825||u>=9827&&u<=9829||u>=9831&&u<=9834||u===9836||u===9837||u===9839||u===9886||u===9887||u===9919||u>=9926&&u<=9933||u>=9935&&u<=9939||u>=9941&&u<=9953||u===9955||u===9960||u===9961||u>=9963&&u<=9969||u===9972||u>=9974&&u<=9977||u===9979||u===9980||u===9982||u===9983||u===10045||u>=10102&&u<=10111||u>=11094&&u<=11097||u>=12872&&u<=12879||u>=57344&&u<=63743||u>=65024&&u<=65039||u===65533||u>=127232&&u<=127242||u>=127248&&u<=127277||u>=127280&&u<=127337||u>=127344&&u<=127373||u===127375||u===127376||u>=127387&&u<=127404||u>=917760&&u<=917999||u>=983040&&u<=1048573||u>=1048576&&u<=1114109}function isFullWidth(u){return u===12288||u>=65281&&u<=65376||u>=65504&&u<=65510}function isWide(u){return u>=4352&&u<=4447||u===8986||u===8987||u===9001||u===9002||u>=9193&&u<=9196||u===9200||u===9203||u===9725||u===9726||u===9748||u===9749||u>=9776&&u<=9783||u>=9800&&u<=9811||u===9855||u>=9866&&u<=9871||u===9875||u===9889||u===9898||u===9899||u===9917||u===9918||u===9924||u===9925||u===9934||u===9940||u===9962||u===9970||u===9971||u===9973||u===9978||u===9981||u===9989||u===9994||u===9995||u===10024||u===10060||u===10062||u>=10067&&u<=10069||u===10071||u>=10133&&u<=10135||u===10160||u===10175||u===11035||u===11036||u===11088||u===11093||u>=11904&&u<=11929||u>=11931&&u<=12019||u>=12032&&u<=12245||u>=12272&&u<=12287||u>=12289&&u<=12350||u>=12353&&u<=12438||u>=12441&&u<=12543||u>=12549&&u<=12591||u>=12593&&u<=12686||u>=12688&&u<=12773||u>=12783&&u<=12830||u>=12832&&u<=12871||u>=12880&&u<=42124||u>=42128&&u<=42182||u>=43360&&u<=43388||u>=44032&&u<=55203||u>=63744&&u<=64255||u>=65040&&u<=65049||u>=65072&&u<=65106||u>=65108&&u<=65126||u>=65128&&u<=65131||u>=94176&&u<=94180||u>=94192&&u<=94198||u>=94208&&u<=101589||u>=101631&&u<=101662||u>=101760&&u<=101874||u>=110576&&u<=110579||u>=110581&&u<=110587||u===110589||u===110590||u>=110592&&u<=110882||u===110898||u>=110928&&u<=110930||u===110933||u>=110948&&u<=110951||u>=110960&&u<=111355||u>=119552&&u<=119638||u>=119648&&u<=119670||u===126980||u===127183||u===127374||u>=127377&&u<=127386||u>=127488&&u<=127490||u>=127504&&u<=127547||u>=127552&&u<=127560||u===127568||u===127569||u>=127584&&u<=127589||u>=127744&&u<=127776||u>=127789&&u<=127797||u>=127799&&u<=127868||u>=127870&&u<=127891||u>=127904&&u<=127946||u>=127951&&u<=127955||u>=127968&&u<=127984||u===127988||u>=127992&&u<=128062||u===128064||u>=128066&&u<=128252||u>=128255&&u<=128317||u>=128331&&u<=128334||u>=128336&&u<=128359||u===128378||u===128405||u===128406||u===128420||u>=128507&&u<=128591||u>=128640&&u<=128709||u===128716||u>=128720&&u<=128722||u>=128725&&u<=128728||u>=128732&&u<=128735||u===128747||u===128748||u>=128756&&u<=128764||u>=128992&&u<=129003||u===129008||u>=129292&&u<=129338||u>=129340&&u<=129349||u>=129351&&u<=129535||u>=129648&&u<=129660||u>=129664&&u<=129674||u>=129678&&u<=129734||u===129736||u>=129741&&u<=129756||u>=129759&&u<=129770||u>=129775&&u<=129784||u>=131072&&u<=196605||u>=196608&&u<=262141}function getCategory(u){if(isAmbiguous(u))return"ambiguous";if(isFullWidth(u))return"fullwidth";if(u===8361||u>=65377&&u<=65470||u>=65474&&u<=65479||u>=65482&&u<=65487||u>=65490&&u<=65495||u>=65498&&u<=65500||u>=65512&&u<=65518){return"halfwidth"}if(u>=32&&u<=126||u===162||u===163||u===165||u===166||u===172||u===175||u>=10214&&u<=10221||u===10629||u===10630){return"narrow"}if(isWide(u))return"wide";return"neutral"}},8617:(u,A,p)=>{p.d(A,{A:()=>indentString});function indentString(u,A=1,p={}){const{indent:y=" ",includeEmptyLines:E=false}=p;if(typeof u!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof u}\``)}if(typeof A!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof A}\``)}if(A<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${A}\``)}if(typeof y!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof y}\``)}if(A===0){return u}const C=E?/^/gm:/^(?!\s*$)/gm;return u.replace(C,y.repeat(A))}},9930:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>v});var E=p(3102);var C=p(5184);var I=p(6976);var w=u([C]);C=(w.then?(await w)():w)[0];function Spinner({type:u="dots"}){const[A,p]=(0,E.useState)(0);const y=I[u];(0,E.useEffect)((()=>{const u=setInterval((()=>{p((u=>{const A=u===y.frames.length-1;return A?0:u+1}))}),y.interval);return()=>{clearInterval(u)}}),[y]);return E.createElement(C.EY,null,y.frames[A])}const v=Spinner;y()}catch(B){y(B)}}))},4493:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(9611);const E=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/;const C=/^ansi256\(\s?(\d+)\s?\)$/;const isNamedColor=u=>u in y.Ay;const colorize=(u,A,p)=>{if(!A){return u}if(isNamedColor(A)){if(p==="foreground"){return y.Ay[A](u)}const E=`bg${A[0].toUpperCase()+A.slice(1)}`;return y.Ay[E](u)}if(A.startsWith("#")){return p==="foreground"?y.Ay.hex(A)(u):y.Ay.bgHex(A)(u)}if(A.startsWith("ansi256")){const E=C.exec(A);if(!E){return u}const I=Number(E[1]);return p==="foreground"?y.Ay.ansi256(I)(u):y.Ay.bgAnsi256(I)(u)}if(A.startsWith("rgb")){const C=E.exec(A);if(!C){return u}const I=Number(C[1]);const w=Number(C[2]);const v=Number(C[3]);return p==="foreground"?y.Ay.rgb(I,w,v)(u):y.Ay.bgRgb(I,w,v)(u)}return u};const I=colorize},7470:(u,A,p)=>{p.d(A,{E:()=>E});var y=p(3102);const E=(0,y.createContext)({isScreenReaderEnabled:false})},5076:(u,A,p)=>{p.d(A,{A:()=>App});var y=p(8474);var E=p(1708);var C=p(3102);var I=p(7078);var w=p(8023);var v=p(2608);var B=p(4371);var S=p(9834);var D=p(6978);var k=p(3024);var Q=p(4491);const convertToSpaces=(u,A=2)=>u.replace(/^\t+/gm,(u=>" ".repeat(u.length*A)));const F=convertToSpaces;const generateLineNumbers=(u,A)=>{const p=[];const y=u-A;const E=u+A;for(let u=y;u<=E;u++){p.push(u)}return p};const codeExcerpt=(u,A,p={})=>{var y;if(typeof u!=="string"){throw new TypeError("Source code is missing.")}if(!A||A<1){throw new TypeError("Line number must start from `1`.")}const E=F(u).split(/\r?\n/);if(A>E.length){return}return generateLineNumbers(A,(y=p.around)!==null&&y!==void 0?y:3).filter((u=>E[u-1]!==undefined)).map((u=>({line:u,value:E[u-1]})))};const R=codeExcerpt;var _=p(1140);var P=p(4882);const cleanupPath=u=>u?.replace(`file://${(0,E.cwd)()}/`,"");const O=new Q({cwd:(0,E.cwd)(),internals:Q.nodeInternals()});function ErrorOverview({error:u}){const A=u.stack?u.stack.split("\n").slice(1):undefined;const p=A?O.parseLine(A[0]):undefined;const y=cleanupPath(p?.file);let E;let I=0;if(y&&p?.line&&k.existsSync(y)){const u=k.readFileSync(y,"utf8");E=R(u,p.line);if(E){for(const{line:u}of E){I=Math.max(I,String(u).length)}}}return C.createElement(_.A,{flexDirection:"column",padding:1},C.createElement(_.A,null,C.createElement(P.A,{backgroundColor:"red",color:"white"}," ","ERROR"," "),C.createElement(P.A,null," ",u.message)),p&&y&&C.createElement(_.A,{marginTop:1},C.createElement(P.A,{dimColor:true},y,":",p.line,":",p.column)),p&&E&&C.createElement(_.A,{marginTop:1,flexDirection:"column"},E.map((({line:u,value:A})=>C.createElement(_.A,{key:u},C.createElement(_.A,{width:I+1},C.createElement(P.A,{dimColor:u!==p.line,backgroundColor:u===p.line?"red":undefined,color:u===p.line?"white":undefined,"aria-label":u===p.line?`Line ${u}, error`:`Line ${u}`},String(u).padStart(I," "),":")),C.createElement(P.A,{key:u,backgroundColor:u===p.line?"red":undefined,color:u===p.line?"white":undefined}," "+A))))),u.stack&&C.createElement(_.A,{marginTop:1,flexDirection:"column"},u.stack.split("\n").slice(1).map((u=>{const A=O.parseLine(u);if(!A){return C.createElement(_.A,{key:u},C.createElement(P.A,{dimColor:true},"- "),C.createElement(P.A,{dimColor:true,bold:true},u,"\\t"," "))}return C.createElement(_.A,{key:u},C.createElement(P.A,{dimColor:true},"- "),C.createElement(P.A,{dimColor:true,bold:true},A.function),C.createElement(P.A,{dimColor:true,color:"gray","aria-label":`at ${cleanupPath(A.file)??""} line ${A.line} column ${A.column}`}," ","(",cleanupPath(A.file)??"",":",A.line,":",A.column,")"))}))))}const U="\t";const H="";const G="";class App extends C.PureComponent{static displayName="InternalApp";static getDerivedStateFromError(u){return{error:u}}state={isFocusEnabled:true,activeFocusId:undefined,focusables:[],error:undefined};rawModeEnabledCount=0;internal_eventEmitter=new y.EventEmitter;isRawModeSupported(){return this.props.stdin.isTTY}render(){return C.createElement(w.A.Provider,{value:{exit:this.handleExit}},C.createElement(v.A.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC,internal_eventEmitter:this.internal_eventEmitter}},C.createElement(B.A.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},C.createElement(S.A.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},C.createElement(D.A.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?C.createElement(ErrorOverview,{error:this.state.error}):this.props.children)))))}componentDidMount(){I.A.hide(this.props.stdout)}componentWillUnmount(){I.A.show(this.props.stdout);if(this.isRawModeSupported()){this.handleSetRawMode(false)}}componentDidCatch(u){this.handleExit(u)}handleSetRawMode=u=>{const{stdin:A}=this.props;if(!this.isRawModeSupported()){if(A===E.stdin){throw new Error("Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported")}else{throw new Error("Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported")}}A.setEncoding("utf8");if(u){if(this.rawModeEnabledCount===0){A.ref();A.setRawMode(true);A.addListener("readable",this.handleReadable)}this.rawModeEnabledCount++;return}if(--this.rawModeEnabledCount===0){A.setRawMode(false);A.removeListener("readable",this.handleReadable);A.unref()}};handleReadable=()=>{let u;while((u=this.props.stdin.read())!==null){this.handleInput(u);this.internal_eventEmitter.emit("input",u)}};handleInput=u=>{if(u===""&&this.props.exitOnCtrlC){this.handleExit()}if(u===G&&this.state.activeFocusId){this.setState({activeFocusId:undefined})}if(this.state.isFocusEnabled&&this.state.focusables.length>0){if(u===U){this.focusNext()}if(u===H){this.focusPrevious()}}};handleExit=u=>{if(this.isRawModeSupported()){this.handleSetRawMode(false)}this.props.onExit(u)};enableFocus=()=>{this.setState({isFocusEnabled:true})};disableFocus=()=>{this.setState({isFocusEnabled:false})};focus=u=>{this.setState((A=>{const p=A.focusables.some((A=>A?.id===u));if(!p){return A}return{activeFocusId:u}}))};focusNext=()=>{this.setState((u=>{const A=u.focusables.find((u=>u.isActive))?.id;const p=this.findNextFocusable(u);return{activeFocusId:p??A}}))};focusPrevious=()=>{this.setState((u=>{const A=u.focusables.findLast((u=>u.isActive))?.id;const p=this.findPreviousFocusable(u);return{activeFocusId:p??A}}))};addFocusable=(u,{autoFocus:A})=>{this.setState((p=>{let y=p.activeFocusId;if(!y&&A){y=u}return{activeFocusId:y,focusables:[...p.focusables,{id:u,isActive:true}]}}))};removeFocusable=u=>{this.setState((A=>({activeFocusId:A.activeFocusId===u?undefined:A.activeFocusId,focusables:A.focusables.filter((A=>A.id!==u))})))};activateFocusable=u=>{this.setState((A=>({focusables:A.focusables.map((A=>{if(A.id!==u){return A}return{id:u,isActive:true}}))})))};deactivateFocusable=u=>{this.setState((A=>({activeFocusId:A.activeFocusId===u?undefined:A.activeFocusId,focusables:A.focusables.map((A=>{if(A.id!==u){return A}return{id:u,isActive:false}}))})))};findNextFocusable=u=>{const A=u.focusables.findIndex((A=>A.id===u.activeFocusId));for(let p=A+1;p<u.focusables.length;p++){const A=u.focusables[p];if(A?.isActive){return A.id}}return undefined};findPreviousFocusable=u=>{const A=u.focusables.findIndex((A=>A.id===u.activeFocusId));for(let p=A-1;p>=0;p--){const A=u.focusables[p];if(A?.isActive){return A.id}}return undefined}}},8023:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(3102);const E=(0,y.createContext)({exit(){}});E.displayName="InternalAppContext";const C=E},9806:(u,A,p)=>{p.d(A,{U:()=>E});var y=p(3102);const E=(0,y.createContext)(undefined)},1140:(u,A,p)=>{p.d(A,{A:()=>w});var y=p(3102);var E=p(7470);var C=p(9806);const I=(0,y.forwardRef)((({children:u,backgroundColor:A,"aria-label":p,"aria-hidden":I,"aria-role":w,"aria-state":v,...B},S)=>{const{isScreenReaderEnabled:D}=(0,y.useContext)(E.E);const k=p?y.createElement("ink-text",null,p):undefined;if(D&&I){return null}const Q=y.createElement("ink-box",{ref:S,style:{flexWrap:"nowrap",flexDirection:"row",flexGrow:0,flexShrink:1,...B,backgroundColor:A,overflowX:B.overflowX??B.overflow??"visible",overflowY:B.overflowY??B.overflow??"visible"},internal_accessibility:{role:w,state:v}},D&&k?k:u);if(A){return y.createElement(C.U.Provider,{value:A},Q)}return Q}));I.displayName="Box";const w=I},6978:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(3102);const E=(0,y.createContext)({activeId:undefined,add(){},remove(){},activate(){},deactivate(){},enableFocus(){},disableFocus(){},focusNext(){},focusPrevious(){},focus(){}});E.displayName="InternalFocusContext";const C=E},409:(u,A,p)=>{var y=p(3102);function Newline({count:u=1}){return React.createElement("ink-text",null,"\n".repeat(u))}},8701:(u,A,p)=>{var y=p(3102);var E=p(1140);function Spacer(){return React.createElement(Box,{flexGrow:1})}},4135:(u,A,p)=>{p.d(A,{A:()=>Static});var y=p(3102);function Static(u){const{items:A,children:p,style:E}=u;const[C,I]=(0,y.useState)(0);const w=(0,y.useMemo)((()=>A.slice(C)),[A,C]);(0,y.useLayoutEffect)((()=>{I(A.length)}),[A.length]);const v=w.map(((u,A)=>p(u,C+A)));const B=(0,y.useMemo)((()=>({position:"absolute",flexDirection:"column",...E})),[E]);return y.createElement("ink-box",{internal_static:true,style:B},v)}},9834:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(1708);var E=p(3102);const C=(0,E.createContext)({stderr:y.stderr,write(){}});C.displayName="InternalStderrContext";const I=C},2608:(u,A,p)=>{p.d(A,{A:()=>w});var y=p(8474);var E=p(1708);var C=p(3102);const I=(0,C.createContext)({stdin:E.stdin,internal_eventEmitter:new y.EventEmitter,setRawMode(){},isRawModeSupported:false,internal_exitOnCtrlC:true});I.displayName="InternalStdinContext";const w=I},4371:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(1708);var E=p(3102);const C=(0,E.createContext)({stdout:y.stdout,write(){}});C.displayName="InternalStdoutContext";const I=C},4882:(u,A,p)=>{p.d(A,{A:()=>Text});var y=p(3102);var E=p(9611);var C=p(4493);var I=p(7470);var w=p(9806);function Text({color:u,backgroundColor:A,dimColor:p=false,bold:v=false,italic:B=false,underline:S=false,strikethrough:D=false,inverse:k=false,wrap:Q="wrap",children:F,"aria-label":R,"aria-hidden":_=false}){const{isScreenReaderEnabled:P}=(0,y.useContext)(I.E);const O=(0,y.useContext)(w.U);const U=P&&R?R:F;if(U===undefined||U===null){return null}const transform=y=>{if(p){y=E.Ay.dim(y)}if(u){y=(0,C.A)(y,u,"foreground")}const I=A??O;if(I){y=(0,C.A)(y,I,"background")}if(v){y=E.Ay.bold(y)}if(B){y=E.Ay.italic(y)}if(S){y=E.Ay.underline(y)}if(D){y=E.Ay.strikethrough(y)}if(k){y=E.Ay.inverse(y)}return y};if(P&&_){return null}return y.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row",textWrap:Q},internal_transform:transform},P&&R?R:F)}},7829:(u,A,p)=>{var y=p(3102);var E=p(7470);function Transform({children:u,transform:A,accessibilityLabel:p}){const{isScreenReaderEnabled:y}=useContext(accessibilityContext);if(u===undefined||u===null){return null}return React.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:A},y&&p?p:u)}},7920:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{Bq:()=>setAttribute,Mq:()=>createTextNode,RM:()=>createNode,V6:()=>appendChildNode,V8:()=>removeChildNode,bC:()=>insertBeforeNode,eC:()=>setStyle,x6:()=>setTextNodeValue});var E=p(9466);var C=p(9670);var I=p(7389);var w=p(6503);var v=u([E]);E=(v.then?(await v)():v)[0];const createNode=u=>{const A={nodeName:u,style:{},attributes:{},childNodes:[],parentNode:undefined,yogaNode:u==="ink-virtual-text"?undefined:E.Ay.Node.create(),internal_accessibility:{}};if(u==="ink-text"){A.yogaNode?.setMeasureFunc(measureTextNode.bind(null,A))}return A};const appendChildNode=(u,A)=>{if(A.parentNode){removeChildNode(A.parentNode,A)}A.parentNode=u;u.childNodes.push(A);if(A.yogaNode){u.yogaNode?.insertChild(A.yogaNode,u.yogaNode.getChildCount())}if(u.nodeName==="ink-text"||u.nodeName==="ink-virtual-text"){markNodeAsDirty(u)}};const insertBeforeNode=(u,A,p)=>{if(A.parentNode){removeChildNode(A.parentNode,A)}A.parentNode=u;const y=u.childNodes.indexOf(p);if(y>=0){u.childNodes.splice(y,0,A);if(A.yogaNode){u.yogaNode?.insertChild(A.yogaNode,y)}return}u.childNodes.push(A);if(A.yogaNode){u.yogaNode?.insertChild(A.yogaNode,u.yogaNode.getChildCount())}if(u.nodeName==="ink-text"||u.nodeName==="ink-virtual-text"){markNodeAsDirty(u)}};const removeChildNode=(u,A)=>{if(A.yogaNode){A.parentNode?.yogaNode?.removeChild(A.yogaNode)}A.parentNode=undefined;const p=u.childNodes.indexOf(A);if(p>=0){u.childNodes.splice(p,1)}if(u.nodeName==="ink-text"||u.nodeName==="ink-virtual-text"){markNodeAsDirty(u)}};const setAttribute=(u,A,p)=>{if(A==="internal_accessibility"){u.internal_accessibility=p;return}u.attributes[A]=p};const setStyle=(u,A)=>{u.style=A};const createTextNode=u=>{const A={nodeName:"#text",nodeValue:u,yogaNode:undefined,parentNode:undefined,style:{}};setTextNodeValue(A,u);return A};const measureTextNode=function(u,A){const p=u.nodeName==="#text"?u.nodeValue:(0,w.A)(u);const y=(0,C.A)(p);if(y.width<=A){return y}if(y.width>=1&&A>0&&A<1){return y}const E=u.style?.textWrap??"wrap";const v=(0,I.A)(p,A,E);return(0,C.A)(v)};const findClosestYogaNode=u=>{if(!u?.parentNode){return undefined}return u.yogaNode??findClosestYogaNode(u.parentNode)};const markNodeAsDirty=u=>{const A=findClosestYogaNode(u);A?.markDirty()};const setTextNodeValue=(u,A)=>{if(typeof A!=="string"){A=String(A)}u.nodeValue=A;markNodeAsDirty(u)};y()}catch(u){y(u)}}))},3618:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>I});var E=p(9466);var C=u([E]);E=(C.then?(await C)():C)[0];const getMaxWidth=u=>u.getComputedWidth()-u.getComputedPadding(E.Ay.EDGE_LEFT)-u.getComputedPadding(E.Ay.EDGE_RIGHT)-u.getComputedBorder(E.Ay.EDGE_LEFT)-u.getComputedBorder(E.Ay.EDGE_RIGHT);const I=getMaxWidth;y()}catch(u){y(u)}}))},2062:(u,A,p)=>{var y=p(3102);var E=p(8023);const useApp=()=>useContext(AppContext);var C=null&&useApp},5235:(u,A,p)=>{var y=p(3102);var E=p(6978);const useFocusManager=()=>{const u=useContext(FocusContext);return{enableFocus:u.enableFocus,disableFocus:u.disableFocus,focusNext:u.focusNext,focusPrevious:u.focusPrevious,focus:u.focus}};var C=null&&useFocusManager},5845:(u,A,p)=>{var y=p(3102);var E=p(6978);var C=p(1123);const useFocus=({isActive:u=true,autoFocus:A=false,id:p}={})=>{const{isRawModeSupported:y,setRawMode:E}=useStdin();const{activeId:C,add:I,remove:w,activate:v,deactivate:B,focus:S}=useContext(FocusContext);const D=useMemo((()=>p??Math.random().toString().slice(2,7)),[p]);useEffect((()=>{I(D,{autoFocus:A});return()=>{w(D)}}),[D,A]);useEffect((()=>{if(u){v(D)}else{B(D)}}),[u,D]);useEffect((()=>{if(!y||!u){return}E(true);return()=>{E(false)}}),[u]);return{isFocused:Boolean(D)&&C===D,focus:S}};var I=null&&useFocus},2309:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>B});var E=p(3102);var C=p(5394);var I=p(2612);var w=p(1123);var v=u([I]);I=(v.then?(await v)():v)[0];const useInput=(u,A={})=>{const{stdin:p,setRawMode:y,internal_exitOnCtrlC:v,internal_eventEmitter:B}=(0,w.A)();(0,E.useEffect)((()=>{if(A.isActive===false){return}y(true);return()=>{y(false)}}),[A.isActive,y]);(0,E.useEffect)((()=>{if(A.isActive===false){return}const handleData=A=>{const p=(0,C.A)(A);const y={upArrow:p.name==="up",downArrow:p.name==="down",leftArrow:p.name==="left",rightArrow:p.name==="right",pageDown:p.name==="pagedown",pageUp:p.name==="pageup",home:p.name==="home",end:p.name==="end",return:p.name==="return",escape:p.name==="escape",ctrl:p.ctrl,shift:p.shift,tab:p.name==="tab",backspace:p.name==="backspace",delete:p.name==="delete",meta:p.meta||p.name==="escape"||p.option};let E=p.ctrl?p.name:p.sequence;if(C.f.includes(p.name)){E=""}if(E.startsWith("")){E=E.slice(1)}if(E.length===1&&typeof E[0]==="string"&&/[A-Z]/.test(E[0])){y.shift=true}if(!(E==="c"&&y.ctrl)||!v){I.A.batchedUpdates((()=>{u(E,y)}))}};B?.on("input",handleData);return()=>{B?.removeListener("input",handleData)}}),[A.isActive,p,v,u])};const B=useInput;y()}catch(u){y(u)}}))},5728:(u,A,p)=>{var y=p(3102);var E=p(7470);const useIsScreenReaderEnabled=()=>{const{isScreenReaderEnabled:u}=useContext(accessibilityContext);return u};var C=null&&useIsScreenReaderEnabled},2693:(u,A,p)=>{var y=p(3102);var E=p(9834);const useStderr=()=>useContext(StderrContext);var C=null&&useStderr},1123:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(3102);var E=p(2608);const useStdin=()=>(0,y.useContext)(E.A);const C=useStdin},90:(u,A,p)=>{var y=p(3102);var E=p(4371);const useStdout=()=>useContext(StdoutContext);var C=null&&useStdout},5184:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{EY:()=>I.A,Ge:()=>D.A,XX:()=>E.A,az:()=>C.A,jC:()=>w.A});var E=p(5406);var C=p(1140);var I=p(4882);var w=p(4135);var v=p(7829);var B=p(409);var S=p(8701);var D=p(2309);var k=p(2062);var Q=p(1123);var F=p(90);var R=p(2693);var _=p(5845);var P=p(5235);var O=p(5728);var U=u([E,D]);[E,D]=U.then?(await U)():U;y()}catch(u){y(u)}}))},7676:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>Ink});var E=p(1708);var C=p(3102);var I=p(9966);var w=p(750);var v=p(5306);var B=p(1690);var S=p(7417);var D=p(2651);var k=p(6225);var Q=p(9466);var F=p(3335);var R=p(2612);var _=p(2081);var P=p(7920);var O=p(9350);var U=p(1840);var H=p(5076);var G=p(7470);var j=u([Q,R,_,P]);[Q,R,_,P]=j.then?(await j)():j;const noop=()=>{};class Ink{options;log;throttledLog;isScreenReaderEnabled;isUnmounted;lastOutput;lastOutputHeight;lastTerminalWidth;container;rootNode;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;constructor(u){(0,B.A)(this);this.options=u;this.rootNode=P.RM("ink-root");this.rootNode.onComputeLayout=this.calculateLayout;this.isScreenReaderEnabled=u.isScreenReaderEnabled??E.env["INK_SCREEN_READER"]==="true";const A=u.debug||this.isScreenReaderEnabled;const p=u.maxFps??30;const y=p>0?Math.max(1,Math.ceil(1e3/p)):0;this.rootNode.onRender=A?this.onRender:(0,I.n)(this.onRender,y,{leading:true,trailing:true});this.rootNode.onImmediateRender=this.onRender;this.log=O.A.create(u.stdout,{incremental:u.incrementalRendering});this.throttledLog=A?this.log:(0,I.n)(this.log,undefined,{leading:true,trailing:true});this.isUnmounted=false;this.lastOutput="";this.lastOutputHeight=0;this.lastTerminalWidth=this.getTerminalWidth();this.fullStaticOutput="";this.container=R.A.createContainer(this.rootNode,k.LegacyRoot,null,false,null,"id",(()=>{}),(()=>{}),(()=>{}),(()=>{}),null);this.unsubscribeExit=S(this.unmount,{alwaysLast:false});if(E.env["DEV"]==="true"){R.A.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"})}if(u.patchConsole){this.patchConsole()}if(!v.A){u.stdout.on("resize",this.resized);this.unsubscribeResize=()=>{u.stdout.off("resize",this.resized)}}}getTerminalWidth=()=>this.options.stdout.columns||80;resized=()=>{const u=this.getTerminalWidth();if(u<this.lastTerminalWidth){this.log.clear();this.lastOutput=""}this.calculateLayout();this.onRender();this.lastTerminalWidth=u};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{const u=this.getTerminalWidth();this.rootNode.yogaNode.setWidth(u);this.rootNode.yogaNode.calculateLayout(undefined,undefined,Q.Ay.DIRECTION_LTR)};onRender=()=>{if(this.isUnmounted){return}const u=performance.now();const{output:A,outputHeight:p,staticOutput:y}=(0,_.A)(this.rootNode,this.isScreenReaderEnabled);this.options.onRender?.({renderTime:performance.now()-u});const E=y&&y!=="\n";if(this.options.debug){if(E){this.fullStaticOutput+=y}this.options.stdout.write(this.fullStaticOutput+A);return}if(v.A){if(E){this.options.stdout.write(y)}this.lastOutput=A;this.lastOutputHeight=p;return}if(this.isScreenReaderEnabled){if(E){const u=this.lastOutputHeight>0?w._W(this.lastOutputHeight):"";this.options.stdout.write(u+y);this.lastOutputHeight=0}if(A===this.lastOutput&&!E){return}const u=this.options.stdout.columns||80;const p=(0,F.A)(A,u,{trim:false,hard:true});if(E){this.options.stdout.write(p)}else{const u=this.lastOutputHeight>0?w._W(this.lastOutputHeight):"";this.options.stdout.write(u+p)}this.lastOutput=A;this.lastOutputHeight=p===""?0:p.split("\n").length;return}if(E){this.fullStaticOutput+=y}if(this.lastOutputHeight>=this.options.stdout.rows){this.options.stdout.write(w.Ik+this.fullStaticOutput+A);this.lastOutput=A;this.lastOutputHeight=p;this.log.sync(A);return}if(E){this.log.clear();this.options.stdout.write(y);this.log(A)}if(!E&&A!==this.lastOutput){this.throttledLog(A)}this.lastOutput=A;this.lastOutputHeight=p};render(u){const A=C.createElement(G.E.Provider,{value:{isScreenReaderEnabled:this.isScreenReaderEnabled}},C.createElement(H.A,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},u));R.A.updateContainerSync(A,this.container,null,noop);R.A.flushSyncWork()}writeToStdout(u){if(this.isUnmounted){return}if(this.options.debug){this.options.stdout.write(u+this.fullStaticOutput+this.lastOutput);return}if(v.A){this.options.stdout.write(u);return}this.log.clear();this.options.stdout.write(u);this.log(this.lastOutput)}writeToStderr(u){if(this.isUnmounted){return}if(this.options.debug){this.options.stderr.write(u);this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(v.A){this.options.stderr.write(u);return}this.log.clear();this.options.stderr.write(u);this.log(this.lastOutput)}unmount(u){if(this.isUnmounted){return}this.calculateLayout();this.onRender();this.unsubscribeExit();if(typeof this.restoreConsole==="function"){this.restoreConsole()}if(typeof this.unsubscribeResize==="function"){this.unsubscribeResize()}if(v.A){this.options.stdout.write(this.lastOutput+"\n")}else if(!this.options.debug){this.log.done()}this.isUnmounted=true;R.A.updateContainerSync(null,this.container,null,noop);R.A.flushSyncWork();U.A.delete(this.options.stdout);if(u instanceof Error){this.rejectExitPromise(u)}else{this.resolveExitPromise()}}async waitUntilExit(){this.exitPromise||=new Promise(((u,A)=>{this.resolveExitPromise=u;this.rejectExitPromise=A}));return this.exitPromise}clear(){if(!v.A&&!this.options.debug){this.log.clear()}}patchConsole(){if(this.options.debug){return}this.restoreConsole=(0,D.A)(((u,A)=>{if(u==="stdout"){this.writeToStdout(A)}if(u==="stderr"){const u=A.startsWith("The above error occurred");if(!u){this.writeToStderr(A)}}}))}}y()}catch(u){y(u)}}))},1840:(u,A,p)=>{p.d(A,{A:()=>E});const y=new WeakMap;const E=y},9350:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(750);var E=p(7078);const createStandard=(u,{showCursor:A=false}={})=>{let p=0;let C="";let I=false;const render=w=>{if(!A&&!I){E.A.hide();I=true}const v=w+"\n";if(v===C){return}C=v;u.write(y._W(p)+v);p=v.split("\n").length};render.clear=()=>{u.write(y._W(p));C="";p=0};render.done=()=>{C="";p=0;if(!A){E.A.show();I=false}};render.sync=u=>{const A=u+"\n";C=A;p=A.split("\n").length};return render};const createIncremental=(u,{showCursor:A=false}={})=>{let p=[];let C="";let I=false;const render=w=>{if(!A&&!I){E.A.hide();I=true}const v=w+"\n";if(v===C){return}const B=p.length;const S=v.split("\n");const D=S.length;const k=D-1;if(v==="\n"||C.length===0){u.write(y._W(B)+v);C=v;p=S;return}const Q=[];if(D<B){Q.push(y._W(B-D+1),y.eh(k))}else{Q.push(y.eh(B-1))}for(let u=0;u<k;u++){if(S[u]===p[u]){Q.push(y.Ku);continue}Q.push(y.CR(0)+S[u]+y.Sc+"\n")}u.write(Q.join(""));C=v;p=S};render.clear=()=>{u.write(y._W(p.length));C="";p=[]};render.done=()=>{C="";p=[];if(!A){E.A.show();I=false}};render.sync=u=>{const A=u+"\n";C=A;p=A.split("\n")};return render};const create=(u,{showCursor:A=false,incremental:p=false}={})=>{if(p){return createIncremental(u,{showCursor:A})}return createStandard(u,{showCursor:A})};const C={create:create};const I=C},9670:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(2511);const E=new Map;const measureText=u=>{if(u.length===0){return{width:0,height:0}}const A=E.get(u);if(A){return A}const p=(0,y.A)(u);const C=u.split("\n").length;const I={width:p,height:C};E.set(u,I);return I};const C=measureText},4479:(u,A,p)=>{p.d(A,{A:()=>Output});var y=p(316);var E=p(9767);var C=p(2511);var I=p(651);const w=new Set([27,155]);const v="[".codePointAt(0);const B="]".codePointAt(0);const S=new Set;const D=new Map;for(const[u,A]of I.Ay.codes){S.add(I.Ay.color.ansi(A));D.set(I.Ay.color.ansi(u),I.Ay.color.ansi(A))}const k="]8;;";const Q=k.split("").map((u=>u.charCodeAt(0)));const F="";const R=F.charCodeAt(0);const _=`]8;;${F}`;function getLinkStartCode(u){return`${k}${u}${F}`}function getEndCode(u){if(S.has(u))return u;if(D.has(u))return D.get(u);if(u.startsWith(k))return _;u=u.slice(2);if(u.startsWith("38")){return I.Ay.color.close}else if(u.startsWith("48")){return I.Ay.bgColor.close}const A=I.Ay.codes.get(parseInt(u,10));if(A){return I.Ay.color.ansi(A)}else{return I.Ay.reset.open}}function ansiCodesToString(u){const A=new Set(u.map((u=>u.code)));return[...A].join("")}function isIntensityCode(u){return u.code===I.Ay.bold.open||u.code===I.Ay.dim.open}function reduceAnsiCodes(u){return reduceAnsiCodesIncremental([],u)}function reduceAnsiCodesIncremental(u,A){let p=[...u];for(const u of A){if(u.code===I.Ay.reset.open){p=[]}else if(S.has(u.code)){p=p.filter((A=>A.endCode!==u.code))}else{if(isIntensityCode(u)){if(!p.find((A=>A.code===u.code&&A.endCode===u.endCode))){p.push(u)}}else{p=p.filter((A=>A.endCode!==u.endCode));p.push(u)}}}return p}function undoAnsiCodes(u){return reduceAnsiCodes(u).reverse().map((u=>({...u,code:u.endCode})))}function diffAnsiCodes(u,A){const p=new Set(A.map((u=>u.endCode)));const y=new Set(A.map((u=>u.code)));const E=new Set(u.map((u=>u.code)));return[...undoAnsiCodes(u.filter((u=>{if(isIntensityCode(u)){return!y.has(u.code)}return!p.has(u.endCode)}))),...A.filter((u=>!E.has(u.code)))]}function styledCharsFromTokens(u){let A=[];const p=[];for(const y of u){if(y.type==="ansi"){A=reduceAnsiCodesIncremental(A,[y])}else if(y.type==="char"){p.push({...y,styles:[...A]})}}return p}function styledCharsToString(u){let A="";for(let p=0;p<u.length;p++){const y=u[p];if(p===0){A+=ansiCodesToString(y.styles)}else{A+=ansiCodesToString(diffAnsiCodes(u[p-1].styles,y.styles))}A+=y.value;if(p===u.length-1){A+=ansiCodesToString(diffAnsiCodes(y.styles,[]))}}return A}var P=p(182);function parseLinkCode(u,A){u=u.slice(A);for(let A=1;A<Q.length;A++){if(u.charCodeAt(A)!==Q[A]){return undefined}}const p=u.indexOf("",k.length);if(p===-1)return undefined;return u.slice(0,p+1)}const O="0".charCodeAt(0);const U="9".charCodeAt(0);const H=";".charCodeAt(0);const G="m".charCodeAt(0);function findSGRSequenceEndIndex(u){for(let A=2;A<u.length;A++){const p=u.charCodeAt(A);if(p===G)return A;if(p===H)continue;if(p>=O&&p<=U)continue;break}return-1}function parseSGRSequence(u,A){u=u.slice(A);const p=findSGRSequenceEndIndex(u);if(p===-1)return;return u.slice(0,p+1)}function splitCompoundSGRSequences(u){if(!u.includes(";")){return[u]}const A=u.slice(2,-1).split(";");const p=[];for(let u=0;u<A.length;u++){const y=A[u];if(y==="38"||y==="48"){if(u+2<A.length&&A[u+1]==="5"){p.push(A.slice(u,u+3).join(";"));u+=2;continue}else if(u+4<A.length&&A[u+1]==="2"){p.push(A.slice(u,u+5).join(";"));u+=4;continue}}p.push(y)}return p.map((u=>`[${u}m`))}function tokenize(u,A=Number.POSITIVE_INFINITY){const p=[];let y=0;let E=0;while(y<u.length){const C=u.codePointAt(y);if(w.has(C)){let A;const E=u.codePointAt(y+1);if(E===B){A=parseLinkCode(u,y);if(A){p.push({type:"ansi",code:A,endCode:getEndCode(A)})}}else if(E===v){A=parseSGRSequence(u,y);if(A){const u=splitCompoundSGRSequences(A);for(const A of u){p.push({type:"ansi",code:A,endCode:getEndCode(A)})}}}if(A){y+=A.length;continue}}const I=(0,P.A)(C);const S=String.fromCodePoint(C);p.push({type:"char",value:S,fullWidth:I});y+=S.length;E+=I?2:S.length;if(E>=A){break}}return p}class Output{width;height;operations=[];constructor(u){const{width:A,height:p}=u;this.width=A;this.height=p}write(u,A,p,y){const{transformers:E}=y;if(!p){return}this.operations.push({type:"write",x:u,y:A,text:p,transformers:E})}clip(u){this.operations.push({type:"clip",clip:u})}unclip(){this.operations.push({type:"unclip"})}get(){const u=[];for(let A=0;A<this.height;A++){const A=[];for(let u=0;u<this.width;u++){A.push({type:"char",value:" ",fullWidth:false,styles:[]})}u.push(A)}const A=[];for(const p of this.operations){if(p.type==="clip"){A.push(p.clip)}if(p.type==="unclip"){A.pop()}if(p.type==="write"){const{text:I,transformers:w}=p;let{x:v,y:B}=p;let S=I.split("\n");const D=A.at(-1);if(D){const u=typeof D?.x1==="number"&&typeof D?.x2==="number";const A=typeof D?.y1==="number"&&typeof D?.y2==="number";if(u){const u=(0,C.A)(I);if(v+u<D.x1||v>D.x2){continue}}if(A){const u=S.length;if(B+u<D.y1||B>D.y2){continue}}if(u){S=S.map((u=>{const A=v<D.x1?D.x1-v:0;const p=(0,E.A)(u);const C=v+p>D.x2?D.x2-v:p;return(0,y.A)(u,A,C)}));if(v<D.x1){v=D.x1}}if(A){const u=B<D.y1?D.y1-B:0;const A=S.length;const p=B+A>D.y2?D.y2-B:A;S=S.slice(u,p);if(B<D.y1){B=D.y1}}}let k=0;for(let[A,p]of S.entries()){const y=u[B+k];if(!y){continue}for(const u of w){p=u(p,A)}const C=styledCharsFromTokens(tokenize(p));let I=v;for(const u of C){y[I]=u;const A=Math.max(1,(0,E.A)(u.value));if(A>1){for(let p=1;p<A;p++){y[I+p]={type:"char",value:"",fullWidth:false,styles:u.styles}}}I+=A}k++}}}const p=u.map((u=>{const A=u.filter((u=>u!==undefined));return styledCharsToString(A).trimEnd()})).join("\n");return{output:p,height:u.length}}}},5394:(u,A,p)=>{p.d(A,{A:()=>v,f:()=>w});var y=p(4573);const E=/^(?:\x1b)([a-zA-Z0-9])$/;const C=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;const I={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};const w=[...Object.values(I),"backspace"];const isShiftKey=u=>["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(u);const isCtrlKey=u=>["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(u);const parseKeypress=(u="")=>{let A;if(y.Buffer.isBuffer(u)){if(u[0]>127&&u[1]===undefined){u[0]-=128;u=""+String(u)}else{u=String(u)}}else if(u!==undefined&&typeof u!=="string"){u=String(u)}else if(!u){u=""}const p={name:"",ctrl:false,meta:false,shift:false,option:false,sequence:u,raw:u};p.sequence=p.sequence||u||p.name;if(u==="\r"){p.raw=undefined;p.name="return"}else if(u==="\n"){p.name="enter"}else if(u==="\t"){p.name="tab"}else if(u==="\b"||u==="\b"){p.name="backspace";p.meta=u.charAt(0)===""}else if(u===""||u===""){p.name="delete";p.meta=u.charAt(0)===""}else if(u===""||u===""){p.name="escape";p.meta=u.length===2}else if(u===" "||u===" "){p.name="space";p.meta=u.length===2}else if(u.length===1&&u<=""){p.name=String.fromCharCode(u.charCodeAt(0)+"a".charCodeAt(0)-1);p.ctrl=true}else if(u.length===1&&u>="0"&&u<="9"){p.name="number"}else if(u.length===1&&u>="a"&&u<="z"){p.name=u}else if(u.length===1&&u>="A"&&u<="Z"){p.name=u.toLowerCase();p.shift=true}else if(A=E.exec(u)){p.meta=true;p.shift=/^[A-Z]$/.test(A[1])}else if(A=C.exec(u)){const y=[...u];if(y[0]===""&&y[1]===""){p.option=true}const E=[A[1],A[2],A[4],A[6]].filter(Boolean).join("");const C=(A[3]||A[5]||1)-1;p.ctrl=!!(C&4);p.meta=!!(C&10);p.shift=!!(C&1);p.code=E;p.name=I[E];p.shift=isShiftKey(E)||p.shift;p.ctrl=isCtrlKey(E)||p.ctrl}return p};const v=parseKeypress},2612:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>F});var E=p(1708);var C=p(5228);var I=p(6225);var w=p(9466);var v=p(3102);var B=p(7920);var S=p(9892);var D=u([w,B,S]);[w,B,S]=D.then?(await D)():D;if(E.env["DEV"]==="true"){try{await p.e(194).then(p.bind(p,1194))}catch(u){if(u.code==="ERR_MODULE_NOT_FOUND"){console.warn(`\nThe environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`,\nbut this failed as it was not installed. Debugging with React Devtools requires it.\n\nTo install use this command:\n\n$ npm install --save-dev react-devtools-core\n\t\t\t\t`.trim()+"\n")}else{throw u}}}const diff=(u,A)=>{if(u===A){return}if(!u){return A}const p={};let y=false;for(const E of Object.keys(u)){const u=A?!Object.hasOwn(A,E):true;if(u){p[E]=undefined;y=true}}if(A){for(const E of Object.keys(A)){if(A[E]!==u[E]){p[E]=A[E];y=true}}}return y?p:undefined};const cleanupYogaNode=u=>{u?.unsetMeasureFunc();u?.freeRecursive()};let k=I.NoEventPriority;let Q;const F=C({getRootHostContext:()=>({isInsideText:false}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>false,resetAfterCommit(u){if(typeof u.onComputeLayout==="function"){u.onComputeLayout()}if(u.isStaticDirty){u.isStaticDirty=false;if(typeof u.onImmediateRender==="function"){u.onImmediateRender()}return}if(typeof u.onRender==="function"){u.onRender()}},getChildHostContext(u,A){const p=u.isInsideText;const y=A==="ink-text"||A==="ink-virtual-text";if(p===y){return u}return{isInsideText:y}},shouldSetTextContent:()=>false,createInstance(u,A,p,y){if(y.isInsideText&&u==="ink-box"){throw new Error(`<Box> can’t be nested inside <Text> component`)}const E=u==="ink-text"&&y.isInsideText?"ink-virtual-text":u;const C=(0,B.RM)(E);for(const[u,y]of Object.entries(A)){if(u==="children"){continue}if(u==="style"){(0,B.eC)(C,y);if(C.yogaNode){(0,S.A)(C.yogaNode,y)}continue}if(u==="internal_transform"){C.internal_transform=y;continue}if(u==="internal_static"){Q=p;C.internal_static=true;p.isStaticDirty=true;p.staticNode=C;continue}(0,B.Bq)(C,u,y)}return C},createTextInstance(u,A,p){if(!p.isInsideText){throw new Error(`Text string "${u}" must be rendered inside <Text> component`)}return(0,B.Mq)(u)},resetTextContent(){},hideTextInstance(u){(0,B.x6)(u,"")},unhideTextInstance(u,A){(0,B.x6)(u,A)},getPublicInstance:u=>u,hideInstance(u){u.yogaNode?.setDisplay(w.Ay.DISPLAY_NONE)},unhideInstance(u){u.yogaNode?.setDisplay(w.Ay.DISPLAY_FLEX)},appendInitialChild:B.V6,appendChild:B.V6,insertBefore:B.bC,finalizeInitialChildren(){return false},isPrimaryRenderer:true,supportsMutation:true,supportsPersistence:false,supportsHydration:false,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:B.V6,insertInContainerBefore:B.bC,removeChildFromContainer(u,A){(0,B.V8)(u,A);cleanupYogaNode(A.yogaNode)},commitUpdate(u,A,p,y){if(Q&&u.internal_static){Q.isStaticDirty=true}const E=diff(p,y);const C=diff(p["style"],y["style"]);if(!E&&!C){return}if(E){for(const[A,p]of Object.entries(E)){if(A==="style"){(0,B.eC)(u,p);continue}if(A==="internal_transform"){u.internal_transform=p;continue}if(A==="internal_static"){u.internal_static=true;continue}(0,B.Bq)(u,A,p)}}if(C&&u.yogaNode){(0,S.A)(u.yogaNode,C)}},commitTextUpdate(u,A,p){(0,B.x6)(u,p)},removeChild(u,A){(0,B.V8)(u,A);cleanupYogaNode(A.yogaNode)},setCurrentUpdatePriority(u){k=u},getCurrentUpdatePriority:()=>k,resolveUpdatePriority(){if(k!==I.NoEventPriority){return k}return I.DefaultEventPriority},maySuspendCommit(){return false},NotPendingTransition:undefined,HostTransitionContext:(0,v.createContext)(null),resetFormInstance(){},requestPostPaintCallback(){},shouldAttemptEagerTransition(){return false},trackSchedulerEvent(){},resolveEventType(){return null},resolveEventTimeStamp(){return-1.1},preloadInstance(){return true},startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady(){return null}});y()}catch(u){y(u)}}),1)},7235:(u,A,p)=>{p.d(A,{A:()=>E});var y=p(4493);const renderBackground=(u,A,p,E)=>{if(!p.style.backgroundColor){return}const C=p.yogaNode.getComputedWidth();const I=p.yogaNode.getComputedHeight();const w=p.style.borderStyle&&p.style.borderLeft!==false?1:0;const v=p.style.borderStyle&&p.style.borderRight!==false?1:0;const B=p.style.borderStyle&&p.style.borderTop!==false?1:0;const S=p.style.borderStyle&&p.style.borderBottom!==false?1:0;const D=C-w-v;const k=I-B-S;if(!(D>0&&k>0)){return}const Q=(0,y.A)(" ".repeat(D),p.style.backgroundColor,"background");for(let p=0;p<k;p++){E.write(u+w,A+B+p,Q,{transformers:[]})}};const E=renderBackground},9729:(u,A,p)=>{p.d(A,{A:()=>I});var y=p(4284);var E=p(9611);var C=p(4493);const renderBorder=(u,A,p,I)=>{if(p.style.borderStyle){const w=p.yogaNode.getComputedWidth();const v=p.yogaNode.getComputedHeight();const B=typeof p.style.borderStyle==="string"?y[p.style.borderStyle]:p.style.borderStyle;const S=p.style.borderTopColor??p.style.borderColor;const D=p.style.borderBottomColor??p.style.borderColor;const k=p.style.borderLeftColor??p.style.borderColor;const Q=p.style.borderRightColor??p.style.borderColor;const F=p.style.borderTopDimColor??p.style.borderDimColor;const R=p.style.borderBottomDimColor??p.style.borderDimColor;const _=p.style.borderLeftDimColor??p.style.borderDimColor;const P=p.style.borderRightDimColor??p.style.borderDimColor;const O=p.style.borderTop!==false;const U=p.style.borderBottom!==false;const H=p.style.borderLeft!==false;const G=p.style.borderRight!==false;const j=w-(H?1:0)-(G?1:0);let $=O?(0,C.A)((H?B.topLeft:"")+B.top.repeat(j)+(G?B.topRight:""),S,"foreground"):undefined;if(O&&F){$=E.Ay.dim($)}let q=v;if(O){q-=1}if(U){q-=1}let K=((0,C.A)(B.left,k,"foreground")+"\n").repeat(q);if(_){K=E.Ay.dim(K)}let J=((0,C.A)(B.right,Q,"foreground")+"\n").repeat(q);if(P){J=E.Ay.dim(J)}let ee=U?(0,C.A)((H?B.bottomLeft:"")+B.bottom.repeat(j)+(G?B.bottomRight:""),D,"foreground"):undefined;if(U&&R){ee=E.Ay.dim(ee)}const te=O?1:0;if($){I.write(u,A,$,{transformers:[]})}if(H){I.write(u,A+te,K,{transformers:[]})}if(G){I.write(u+w-1,A+te,J,{transformers:[]})}if(ee){I.write(u,A+v-1,ee,{transformers:[]})}}};const I=renderBorder},3639:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>Q,K:()=>renderNodeToScreenReaderOutput});var E=p(2511);var C=p(8617);var I=p(9466);var w=p(7389);var v=p(3618);var B=p(6503);var S=p(9729);var D=p(7235);var k=u([I,v]);[I,v]=k.then?(await k)():k;const applyPaddingToText=(u,A)=>{const p=u.childNodes[0]?.yogaNode;if(p){const u=p.getComputedLeft();const y=p.getComputedTop();A="\n".repeat(y)+(0,C.A)(A,u)}return A};const renderNodeToScreenReaderOutput=(u,A={})=>{if(A.skipStaticElements&&u.internal_static){return""}if(u.yogaNode?.getDisplay()===I.Ay.DISPLAY_NONE){return""}let p="";if(u.nodeName==="ink-text"){p=(0,B.A)(u)}else if(u.nodeName==="ink-box"||u.nodeName==="ink-root"){const y=u.style.flexDirection==="row"||u.style.flexDirection==="row-reverse"?" ":"\n";const E=u.style.flexDirection==="row-reverse"||u.style.flexDirection==="column-reverse"?[...u.childNodes].reverse():[...u.childNodes];p=E.map((p=>{const y=renderNodeToScreenReaderOutput(p,{parentRole:u.internal_accessibility?.role,skipStaticElements:A.skipStaticElements});return y})).filter(Boolean).join(y)}if(u.internal_accessibility){const{role:y,state:E}=u.internal_accessibility;if(E){const u=Object.keys(E);const A=u.filter((u=>E[u])).join(", ");if(A){p=`(${A}) ${p}`}}if(y&&y!==A.parentRole){p=`${y}: ${p}`}}return p};const renderNodeToOutput=(u,A,p)=>{const{offsetX:y=0,offsetY:C=0,transformers:k=[],skipStaticElements:Q}=p;if(Q&&u.internal_static){return}const{yogaNode:F}=u;if(F){if(F.getDisplay()===I.Ay.DISPLAY_NONE){return}const p=y+F.getComputedLeft();const R=C+F.getComputedTop();let _=k;if(typeof u.internal_transform==="function"){_=[u.internal_transform,...k]}if(u.nodeName==="ink-text"){let y=(0,B.A)(u);if(y.length>0){const C=(0,E.A)(y);const I=(0,v.A)(F);if(C>I){const A=u.style.textWrap??"wrap";y=(0,w.A)(y,I,A)}y=applyPaddingToText(u,y);A.write(p,R,y,{transformers:_})}return}let P=false;if(u.nodeName==="ink-box"){(0,D.A)(p,R,u,A);(0,S.A)(p,R,u,A);const y=u.style.overflowX==="hidden"||u.style.overflow==="hidden";const E=u.style.overflowY==="hidden"||u.style.overflow==="hidden";if(y||E){const u=y?p+F.getComputedBorder(I.Ay.EDGE_LEFT):undefined;const C=y?p+F.getComputedWidth()-F.getComputedBorder(I.Ay.EDGE_RIGHT):undefined;const w=E?R+F.getComputedBorder(I.Ay.EDGE_TOP):undefined;const v=E?R+F.getComputedHeight()-F.getComputedBorder(I.Ay.EDGE_BOTTOM):undefined;A.clip({x1:u,x2:C,y1:w,y2:v});P=true}}if(u.nodeName==="ink-root"||u.nodeName==="ink-box"){for(const y of u.childNodes){renderNodeToOutput(y,A,{offsetX:p,offsetY:R,transformers:_,skipStaticElements:Q})}if(P){A.unclip()}}}};const Q=renderNodeToOutput;y()}catch(u){y(u)}}))},5406:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>B});var E=p(7075);var C=p(1708);var I=p(7676);var w=p(1840);var v=u([I]);I=(v.then?(await v)():v)[0];const render=(u,A)=>{const p={stdout:C.stdout,stdin:C.stdin,stderr:C.stderr,debug:false,exitOnCtrlC:true,patchConsole:true,maxFps:30,incrementalRendering:false,...getOptions(A)};const y=getInstance(p.stdout,(()=>new I.A(p)));y.render(u);return{rerender:y.render,unmount(){y.unmount()},waitUntilExit:y.waitUntilExit,cleanup:()=>w.A.delete(p.stdout),clear:y.clear}};const B=render;const getOptions=(u={})=>{if(u instanceof E.Stream){return{stdout:u,stdin:C.stdin}}return u};const getInstance=(u,A)=>{let p=w.A.get(u);if(!p){p=A();w.A.set(u,p)}return p};y()}catch(u){y(u)}}))},2081:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>w});var E=p(3639);var C=p(4479);var I=u([E]);E=(I.then?(await I)():I)[0];const renderer=(u,A)=>{if(u.yogaNode){if(A){const A=(0,E.K)(u,{skipStaticElements:true});const p=A===""?0:A.split("\n").length;let y="";if(u.staticNode){y=(0,E.K)(u.staticNode,{skipStaticElements:false})}return{output:A,outputHeight:p,staticOutput:y?`${y}\n`:""}}const p=new C.A({width:u.yogaNode.getComputedWidth(),height:u.yogaNode.getComputedHeight()});(0,E.A)(u,p,{skipStaticElements:true});let y;if(u.staticNode?.yogaNode){y=new C.A({width:u.staticNode.yogaNode.getComputedWidth(),height:u.staticNode.yogaNode.getComputedHeight()});(0,E.A)(u.staticNode,y,{skipStaticElements:false})}const{output:I,height:w}=p.get();return{output:I,outputHeight:w,staticOutput:y?`${y.get().output}\n`:""}}return{output:"",outputHeight:0,staticOutput:""}};const w=renderer;y()}catch(u){y(u)}}))},6503:(u,A,p)=>{p.d(A,{A:()=>y});const squashTextNodes=u=>{let A="";for(let p=0;p<u.childNodes.length;p++){const y=u.childNodes[p];if(y===undefined){continue}let E="";if(y.nodeName==="#text"){E=y.nodeValue}else{if(y.nodeName==="ink-text"||y.nodeName==="ink-virtual-text"){E=squashTextNodes(y)}if(E.length>0&&typeof y.internal_transform==="function"){E=y.internal_transform(E,p)}}A+=E}return A};const y=squashTextNodes},9892:(u,A,p)=>{p.a(u,(async(u,y)=>{try{p.d(A,{A:()=>I});var E=p(9466);var C=u([E]);E=(C.then?(await C)():C)[0];const applyPositionStyles=(u,A)=>{if("position"in A){u.setPositionType(A.position==="absolute"?E.Ay.POSITION_TYPE_ABSOLUTE:E.Ay.POSITION_TYPE_RELATIVE)}};const applyMarginStyles=(u,A)=>{if("margin"in A){u.setMargin(E.Ay.EDGE_ALL,A.margin??0)}if("marginX"in A){u.setMargin(E.Ay.EDGE_HORIZONTAL,A.marginX??0)}if("marginY"in A){u.setMargin(E.Ay.EDGE_VERTICAL,A.marginY??0)}if("marginLeft"in A){u.setMargin(E.Ay.EDGE_START,A.marginLeft||0)}if("marginRight"in A){u.setMargin(E.Ay.EDGE_END,A.marginRight||0)}if("marginTop"in A){u.setMargin(E.Ay.EDGE_TOP,A.marginTop||0)}if("marginBottom"in A){u.setMargin(E.Ay.EDGE_BOTTOM,A.marginBottom||0)}};const applyPaddingStyles=(u,A)=>{if("padding"in A){u.setPadding(E.Ay.EDGE_ALL,A.padding??0)}if("paddingX"in A){u.setPadding(E.Ay.EDGE_HORIZONTAL,A.paddingX??0)}if("paddingY"in A){u.setPadding(E.Ay.EDGE_VERTICAL,A.paddingY??0)}if("paddingLeft"in A){u.setPadding(E.Ay.EDGE_LEFT,A.paddingLeft||0)}if("paddingRight"in A){u.setPadding(E.Ay.EDGE_RIGHT,A.paddingRight||0)}if("paddingTop"in A){u.setPadding(E.Ay.EDGE_TOP,A.paddingTop||0)}if("paddingBottom"in A){u.setPadding(E.Ay.EDGE_BOTTOM,A.paddingBottom||0)}};const applyFlexStyles=(u,A)=>{if("flexGrow"in A){u.setFlexGrow(A.flexGrow??0)}if("flexShrink"in A){u.setFlexShrink(typeof A.flexShrink==="number"?A.flexShrink:1)}if("flexWrap"in A){if(A.flexWrap==="nowrap"){u.setFlexWrap(E.Ay.WRAP_NO_WRAP)}if(A.flexWrap==="wrap"){u.setFlexWrap(E.Ay.WRAP_WRAP)}if(A.flexWrap==="wrap-reverse"){u.setFlexWrap(E.Ay.WRAP_WRAP_REVERSE)}}if("flexDirection"in A){if(A.flexDirection==="row"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_ROW)}if(A.flexDirection==="row-reverse"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_ROW_REVERSE)}if(A.flexDirection==="column"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_COLUMN)}if(A.flexDirection==="column-reverse"){u.setFlexDirection(E.Ay.FLEX_DIRECTION_COLUMN_REVERSE)}}if("flexBasis"in A){if(typeof A.flexBasis==="number"){u.setFlexBasis(A.flexBasis)}else if(typeof A.flexBasis==="string"){u.setFlexBasisPercent(Number.parseInt(A.flexBasis,10))}else{u.setFlexBasis(Number.NaN)}}if("alignItems"in A){if(A.alignItems==="stretch"||!A.alignItems){u.setAlignItems(E.Ay.ALIGN_STRETCH)}if(A.alignItems==="flex-start"){u.setAlignItems(E.Ay.ALIGN_FLEX_START)}if(A.alignItems==="center"){u.setAlignItems(E.Ay.ALIGN_CENTER)}if(A.alignItems==="flex-end"){u.setAlignItems(E.Ay.ALIGN_FLEX_END)}}if("alignSelf"in A){if(A.alignSelf==="auto"||!A.alignSelf){u.setAlignSelf(E.Ay.ALIGN_AUTO)}if(A.alignSelf==="flex-start"){u.setAlignSelf(E.Ay.ALIGN_FLEX_START)}if(A.alignSelf==="center"){u.setAlignSelf(E.Ay.ALIGN_CENTER)}if(A.alignSelf==="flex-end"){u.setAlignSelf(E.Ay.ALIGN_FLEX_END)}}if("justifyContent"in A){if(A.justifyContent==="flex-start"||!A.justifyContent){u.setJustifyContent(E.Ay.JUSTIFY_FLEX_START)}if(A.justifyContent==="center"){u.setJustifyContent(E.Ay.JUSTIFY_CENTER)}if(A.justifyContent==="flex-end"){u.setJustifyContent(E.Ay.JUSTIFY_FLEX_END)}if(A.justifyContent==="space-between"){u.setJustifyContent(E.Ay.JUSTIFY_SPACE_BETWEEN)}if(A.justifyContent==="space-around"){u.setJustifyContent(E.Ay.JUSTIFY_SPACE_AROUND)}if(A.justifyContent==="space-evenly"){u.setJustifyContent(E.Ay.JUSTIFY_SPACE_EVENLY)}}};const applyDimensionStyles=(u,A)=>{if("width"in A){if(typeof A.width==="number"){u.setWidth(A.width)}else if(typeof A.width==="string"){u.setWidthPercent(Number.parseInt(A.width,10))}else{u.setWidthAuto()}}if("height"in A){if(typeof A.height==="number"){u.setHeight(A.height)}else if(typeof A.height==="string"){u.setHeightPercent(Number.parseInt(A.height,10))}else{u.setHeightAuto()}}if("minWidth"in A){if(typeof A.minWidth==="string"){u.setMinWidthPercent(Number.parseInt(A.minWidth,10))}else{u.setMinWidth(A.minWidth??0)}}if("minHeight"in A){if(typeof A.minHeight==="string"){u.setMinHeightPercent(Number.parseInt(A.minHeight,10))}else{u.setMinHeight(A.minHeight??0)}}};const applyDisplayStyles=(u,A)=>{if("display"in A){u.setDisplay(A.display==="flex"?E.Ay.DISPLAY_FLEX:E.Ay.DISPLAY_NONE)}};const applyBorderStyles=(u,A)=>{if("borderStyle"in A){const p=A.borderStyle?1:0;if(A.borderTop!==false){u.setBorder(E.Ay.EDGE_TOP,p)}if(A.borderBottom!==false){u.setBorder(E.Ay.EDGE_BOTTOM,p)}if(A.borderLeft!==false){u.setBorder(E.Ay.EDGE_LEFT,p)}if(A.borderRight!==false){u.setBorder(E.Ay.EDGE_RIGHT,p)}}};const applyGapStyles=(u,A)=>{if("gap"in A){u.setGap(E.Ay.GUTTER_ALL,A.gap??0)}if("columnGap"in A){u.setGap(E.Ay.GUTTER_COLUMN,A.columnGap??0)}if("rowGap"in A){u.setGap(E.Ay.GUTTER_ROW,A.rowGap??0)}};const styles=(u,A={})=>{applyPositionStyles(u,A);applyMarginStyles(u,A);applyPaddingStyles(u,A);applyFlexStyles(u,A);applyDimensionStyles(u,A);applyDisplayStyles(u,A);applyBorderStyles(u,A);applyGapStyles(u,A)};const I=styles;y()}catch(u){y(u)}}))},7389:(u,A,p)=>{p.d(A,{A:()=>w});var y=p(3335);var E=p(316);var C=p(9767);function getIndexOfNearestSpace(u,A,p){if(u.charAt(A)===" "){return A}const y=p?1:-1;for(let p=0;p<=3;p++){const E=A+p*y;if(u.charAt(E)===" "){return E}}return A}function cliTruncate(u,A,p={}){const{position:y="end",space:I=false,preferTruncationOnSpace:w=false}=p;let{truncationCharacter:v="…"}=p;if(typeof u!=="string"){throw new TypeError(`Expected \`input\` to be a string, got ${typeof u}`)}if(typeof A!=="number"){throw new TypeError(`Expected \`columns\` to be a number, got ${typeof A}`)}if(A<1){return""}const B=(0,C.A)(u);if(B<=A){return u}if(A===1){return v}const S={ESC:27,LEFT_BRACKET:91,LETTER_M:109};const isSgrParameter=u=>u>=48&&u<=57||u===59;function leadingSgrSpanEndIndex(u){let A=0;while(A+2<u.length&&u.codePointAt(A)===S.ESC&&u.codePointAt(A+1)===S.LEFT_BRACKET){let p=A+2;while(p<u.length&&isSgrParameter(u.codePointAt(p))){p++}if(p<u.length&&u.codePointAt(p)===S.LETTER_M){A=p+1;continue}break}return A}function trailingSgrSpanStartIndex(u){let A=u.length;while(A>1&&u.codePointAt(A-1)===S.LETTER_M){let p=A-2;while(p>=0&&isSgrParameter(u.codePointAt(p))){p--}if(p>=1&&u.codePointAt(p-1)===S.ESC&&u.codePointAt(p)===S.LEFT_BRACKET){A=p-1;continue}break}return A}function appendWithInheritedStyleFromEnd(u,A){const p=trailingSgrSpanStartIndex(u);if(p===u.length){return u+A}return u.slice(0,p)+A+u.slice(p)}function prependWithInheritedStyleFromStart(u,A){const p=leadingSgrSpanEndIndex(A);if(p===0){return u+A}return A.slice(0,p)+u+A.slice(p)}if(y==="start"){if(w){const p=getIndexOfNearestSpace(u,B-A+1,true);const y=(0,E.A)(u,p,B).trim();return prependWithInheritedStyleFromStart(v,y)}if(I){v+=" "}const p=(0,E.A)(u,B-A+(0,C.A)(v),B);return prependWithInheritedStyleFromStart(v,p)}if(y==="middle"){if(I){v=` ${v} `}const p=Math.floor(A/2);if(w){const y=getIndexOfNearestSpace(u,p);const C=getIndexOfNearestSpace(u,B-(A-p)+1,true);return(0,E.A)(u,0,y)+v+(0,E.A)(u,C,B).trim()}return(0,E.A)(u,0,p)+v+(0,E.A)(u,B-(A-p)+(0,C.A)(v),B)}if(y==="end"){if(w){const p=getIndexOfNearestSpace(u,A-1);const y=(0,E.A)(u,0,p);return appendWithInheritedStyleFromEnd(y,v)}if(I){v=` ${v}`}const p=(0,E.A)(u,0,A-(0,C.A)(v));return appendWithInheritedStyleFromEnd(p,v)}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${y}`)}const I={};const wrapText=(u,A,p)=>{const E=u+String(A)+String(p);const C=I[E];if(C){return C}let w=u;if(p==="wrap"){w=(0,y.A)(u,A,{trim:false,hard:true})}if(p.startsWith("truncate")){let y="end";if(p==="truncate-middle"){y="middle"}if(p==="truncate-start"){y="start"}w=cliTruncate(u,A,{position:y})}I[E]=w;return w};const w=wrapText},182:(u,A,p)=>{p.d(A,{A:()=>isFullwidthCodePoint});var y=p(9957);function isFullwidthCodePoint(u){if(!Number.isInteger(u)){return false}return(0,y.Ck)(u)||(0,y.EW)(u)}},5306:(u,A,p)=>{p.d(A,{A:()=>C});var y=p(1708);const check=u=>u in y.env&&y.env[u]!=="0"&&y.env[u]!=="false";const E=check("CI")||check("CONTINUOUS_INTEGRATION");const C=E},4302:(u,A,p)=>{p.d(A,{A:()=>he});var y=p(6760);var E=p(1708);var C=p(3136);var I=p(932);var w=p(9023);var v=p(6928);
111
111
  /**
112
112
  * @license
113
113
  * Copyright (c) 2016, Contributors